Title: gh-151626: Fix tests that fail when PYTHONPYCACHEPREFIX is set by zangjiucheng · Pull Request #151952 · python/cpython · GitHub
Open Graph Title: gh-151626: Fix tests that fail when PYTHONPYCACHEPREFIX is set by zangjiucheng · Pull Request #151952 · python/cpython
X Title: gh-151626: Fix tests that fail when PYTHONPYCACHEPREFIX is set by zangjiucheng · Pull Request #151952 · python/cpython
Description: Summary Several tests in test_inspect, test_import, test_importlib.test_util, test_py_compile, and test_compileall assume the default __pycache__ bytecode layout and fail when the suite is run with PYTHONPYCACHEPREFIX set. Fix: neutralize sys.pycache_prefix (and PYTHONPYCACHEPREFIX for subprocess-based tests) where that assumption is made so tests are environment-independent. The key pattern for subprocess tests: assert_python_ok() runs with -I (isolated mode), which ignores PYTHONPYCACHEPREFIX, so the expected cached path must be computed with sys.pycache_prefix=None to match. Issue: gh-151626
Open Graph Description: Summary Several tests in test_inspect, test_import, test_importlib.test_util, test_py_compile, and test_compileall assume the default __pycache__ bytecode layout and fail when the suite is run wit...
X Description: Summary Several tests in test_inspect, test_import, test_importlib.test_util, test_py_compile, and test_compileall assume the default __pycache__ bytecode layout and fail when the suite is run wit...
Opengraph URL: https://github.com/python/cpython/pull/151952
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:47e5cbbf-eafa-9a79-b3fe-69ff041460a3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DE82:3CF864:258CB24:3219D8F:6A520D21 |
| html-safe-nonce | fb1f19931c7708727e8d585d0b6f1a2d1ec9952e55042b32d732ca421f9737b4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTgyOjNDRjg2NDoyNThDQjI0OjMyMTlEOEY6NkE1MjBEMjEiLCJ2aXNpdG9yX2lkIjoiNDE5MTM2NDYyNDk1MDYyNzYxNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 53be13c2814d337df46e45d0f89c2b6474170251623a4e4bf26098d49e28e33e |
| hovercard-subject-tag | pull_request:3915667224 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/151952/files |
| twitter:image | https://avatars.githubusercontent.com/u/56462380?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/56462380?s=400&v=4 |
| og:image:alt | Summary Several tests in test_inspect, test_import, test_importlib.test_util, test_py_compile, and test_compileall assume the default __pycache__ bytecode layout and fail when the suite is run wit... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width