![](https://secure.gravatar.com/avatar/15b1cd41a4c23e7dc10893777afb4281.jpg?s=120&d=mm&r=g)
On Wed, Apr 27, 2022 at 5:56 PM Antoine Pitrou <antoine@python.org> wrote:
An environment variable is an easy to influence a program or system whose inner workings you don't control (for example a system that spawns child Python processes). And it sounds like a good idea to allow that given that it improves security?
Ok, you changed my mind and I added PYTHONDONTADDPATH0=1 env var. Example: $ ./python -c 'import sys, pprint; pprint.pprint(sys.path)' ['', '/usr/local/lib/python311.zip', '/home/vstinner/python/main/Lib', '/home/vstinner/python/main/build/lib.linux-x86_64-3.11-pydebug', '/home/vstinner/.local/lib/python3.11/site-packages'] $ PYTHONDONTADDPATH0=1 ./python -c 'import sys, pprint; pprint.pprint(sys.path)' ['/usr/local/lib/python311.zip', '/home/vstinner/python/main/Lib', '/home/vstinner/python/main/build/lib.linux-x86_64-3.11-pydebug', '/home/vstinner/.local/lib/python3.11/site-packages'] Victor -- Night gathers, and now my watch begins. It shall not end until my death.