-
-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't unconditionally prepend ""
to a venv PEX's sys.path
#1983
Comments
Related: pantsbuild/pants#17531 |
@thejcannon, your example shell session is useful and is also true all the way back to Python 2.7 - almost:
In other words, all three of those modes insert CWD at the head of sys.path with sometimes CWD spelled as an absolute path and sometimes as ""; so when PEX acts as an interpreter (via either forcing with PEX_INTERPRETER=1 or else when it has no entry point defined), it should do the same. Currently zipapp mode does this correctly just here: But venv mode does it unconditionally as you highlight here: |
#1832 (comment) captures the location of the bug.
sys.path
behavior is documented https://docs.python.org/3/library/sys.html#sys.path which shows the prepending tosys.path
is dependent on howpython
is invoked.And to further prove the point:
The text was updated successfully, but these errors were encountered: