Title: New site.py implementation fails to load .pth files in subprocesses · Issue #149819 · python/cpython · GitHub
Open Graph Title: New site.py implementation fails to load .pth files in subprocesses · Issue #149819 · python/cpython
X Title: New site.py implementation fails to load .pth files in subprocesses · Issue #149819 · python/cpython
Description: Bug report Bug description: After #149583, .pth files are no longer loaded in Python subprocesses, as started with subprocess.run([sys.executable, …]) and the like. The new implementation deliberately ignores .pth files in sys.path direc...
Open Graph Description: Bug report Bug description: After #149583, .pth files are no longer loaded in Python subprocesses, as started with subprocess.run([sys.executable, …]) and the like. The new implementation deliberat...
X Description: Bug report Bug description: After #149583, .pth files are no longer loaded in Python subprocesses, as started with subprocess.run([sys.executable, …]) and the like. The new implementation deliberat...
Opengraph URL: https://github.com/python/cpython/issues/149819
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"New site.py implementation fails to load .pth files in subprocesses","articleBody":"# Bug report\n\n### Bug description:\n\nAfter https://github.com/python/cpython/pull/149583, `.pth` files are no longer loaded in Python subprocesses, as started with `subprocess.run([sys.executable, …])` and the like.\n\nThe new implementation deliberately ignores `.pth` files in `sys.path` directories that are already known, and Python subprocesses already know all the paths of their parent process. Thus, all `.pth` files in those paths are ignored by subprocesses now.\n\nI specifically noticed this when running `setuptools` in a build subprocess, which now fails to install its `distutils` replacement hack.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-149888\n* gh-150177\n* gh-150202\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/scoder","@type":"Person","name":"scoder"},"datePublished":"2026-05-14T06:53:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/149819/cpython/issues/149819"}
| 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:2ddc98d2-91d2-0080-9c7d-4eab41da5367 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B378:27480A:1BF7352:283C17D:6A565665 |
| html-safe-nonce | 3323d17cf9051cd98a89397f22b9a0a948456dd34698b7b607cad436d5fba125 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzc4OjI3NDgwQToxQkY3MzUyOjI4M0MxN0Q6NkE1NjU2NjUiLCJ2aXNpdG9yX2lkIjoiNjcxODg5NDc4OTIxNDIzMDExNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6577e21a955e020a9addcd4c90527b77623341bcfd84d153571cea9c68fb4010 |
| hovercard-subject-tag | issue:4443883056 |
| 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/149819/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9a8fa30b88eab3e3e44fbd65b004400c61f8f328abbfda6d26fb7dfc6ace3244/python/cpython/issues/149819 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9a8fa30b88eab3e3e44fbd65b004400c61f8f328abbfda6d26fb7dfc6ace3244/python/cpython/issues/149819 |
| og:image:alt | Bug report Bug description: After #149583, .pth files are no longer loaded in Python subprocesses, as started with subprocess.run([sys.executable, …]) and the like. The new implementation deliberat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | scoder |
| hostname | github.com |
| expected-hostname | github.com |
| None | cffc1b7eb44a3dbb1e61c2a0523cad1f04e0368d730bf85ac498c992baf19e7d |
| 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 | 233d2274d9c68198aa6cb23d1db680b5c0b58bba |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width