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 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.
I specifically noticed this when running setuptools in a build subprocess, which now fails to install its distutils replacement hack.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Bug report
Bug description:
After #149583,
.pthfiles are no longer loaded in Python subprocesses, as started withsubprocess.run([sys.executable, …])and the like.The new implementation deliberately ignores
.pthfiles insys.pathdirectories that are already known, and Python subprocesses already know all the paths of their parent process. Thus, all.pthfiles in those paths are ignored by subprocesses now.I specifically noticed this when running
setuptoolsin a build subprocess, which now fails to install itsdistutilsreplacement hack.CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux