Title: Some tests fail when __pycache__ prefix is set · Issue #151626 · python/cpython · GitHub
Open Graph Title: Some tests fail when __pycache__ prefix is set · Issue #151626 · python/cpython
X Title: Some tests fail when __pycache__ prefix is set · Issue #151626 · python/cpython
Description: Bug report Bug description: Some tests that check .pyc files creation are failing when sys.pycache_prefix is set. List of tests that failed on Arm64 MacOS (maybe there's more in skipped ones): test.test_inspect.test_inspect.TestModuleCLI...
Open Graph Description: Bug report Bug description: Some tests that check .pyc files creation are failing when sys.pycache_prefix is set. List of tests that failed on Arm64 MacOS (maybe there's more in skipped ones): test...
X Description: Bug report Bug description: Some tests that check .pyc files creation are failing when sys.pycache_prefix is set. List of tests that failed on Arm64 MacOS (maybe there's more in skipped ones): ...
Opengraph URL: https://github.com/python/cpython/issues/151626
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Some tests fail when __pycache__ prefix is set","articleBody":"# Bug report\n\n### Bug description:\n\nSome tests that check .pyc files creation are failing when `sys.pycache_prefix` is set.\n\nList of tests that failed on Arm64 MacOS (maybe there's more in skipped ones):\n- [ ] `test.test_inspect.test_inspect.TestModuleCLI.test_details_option_with_package`\n- [ ] `test.test_import.PycacheTests.test_import_pyc_path`\n- [ ] `test.test_import.PycacheTests.test_unwritable_directory`\n- [ ] `test.test_importlib.test_util.PEP3147Tests.test_cache_from_source`\n- [ ] `test.test_importlib.test_util.PEP3147Tests.test_cache_from_source_cwd`\n- [ ] `test.test_importlib.test_util.PEP3147Tests.test_cache_from_source_no_dot`\n- [ ] `test.test_importlib.test_util.PEP3147Tests.test_cache_from_source_optimization_None`\n- [ ] `test.test_importlib.test_util.PEP3147Tests.test_cache_from_source_optimization_empty_string`\n- [ ] `test.test_importlib.test_util.PEP3147Tests.test_cache_from_source_optimization_set`\n- [ ] `test.test_importlib.test_util.PEP3147Tests.test_cache_from_source_path_like_arg`\n- [ ] `test.test_py_compile.PyCompileCLITestCase.test_with_files`\n- [ ] `test.test_py_compile.PyCompileTestsBase.test_double_dot_no_clobber`\n- [ ] `test.test_compileall.CompileallTestsBase.test_include_on_stdin`\n- [ ] `test.test_compileall.CompileallTestsBase.test_multiple_runs`\n- [ ] `test.test_compileall.CompileallTestsBase.test_symlink_loop`\n\nexample: `PYTHONPYCACHEPREFIX=\"$HOME/__pycache__\" ./python.exe -m test test.test_compileall test.test_import test.test_importlib.test_util test.test_inspect.test_inspect test.test_py_compile -v`\n\noutput (edited for clarity and length): [testres.txt](https://github.com/user-attachments/files/29077902/testres.txt)\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nmacOS\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-151952\n* gh-152736\n* gh-152744\n* gh-152748\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/ringobanana-3900","@type":"Person","name":"ringobanana-3900"},"datePublished":"2026-06-18T07:46:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/151626/cpython/issues/151626"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d5061fd3-0c3a-aa3f-7892-2427f644e72a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8880:9C6CC:30042B9:441331D:6A5121CA |
| html-safe-nonce | 1078855784edd4abf6bf222aaafc9d5adfd755c4444612c7a184eb2292442f83 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODgwOjlDNkNDOjMwMDQyQjk6NDQxMzMxRDo2QTUxMjFDQSIsInZpc2l0b3JfaWQiOiI0NDE4NjkyMDM0MTMyNTE3MzIyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ddc9ae771fba2b55d474fb82a2e6beded94257525c0bd3af7c6464798dbeb138 |
| hovercard-subject-tag | issue:4690310362 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/151626/issue_layout |
| twitter:image | https://opengraph.githubassets.com/db25b8cd84770a1ce6f14fe2adf317f47767f341ed3a41e0c59f1d6c52e89265/python/cpython/issues/151626 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/db25b8cd84770a1ce6f14fe2adf317f47767f341ed3a41e0c59f1d6c52e89265/python/cpython/issues/151626 |
| og:image:alt | Bug report Bug description: Some tests that check .pyc files creation are failing when sys.pycache_prefix is set. List of tests that failed on Arm64 MacOS (maybe there's more in skipped ones): test... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ringobanana-3900 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 689b683944b0d7f015d0e776452c970832fa81b82dc15284469b556ecced715b |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 942b51ed3bd5feee3d5e2719f890a5fe286edbbb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width