When I run this script:
import os
for k,v in os.environ.items():
print(f'key={k} val={v}')
it prints the environjment with an altered _ value.
The new _ value is:
key=_ val=/usr/local/bin/python3.11
while the original value was:
_=/usr/bin/env
Then this _ value alters the sys.path that Pyton uses in some way.
Is this behavior documented?
How to prevent _ from being altered when child Python processes are launched?