-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
python2: site .pth files are not processed if PYTHONPATH points to site-packages #1959
Labels
Comments
I've also hit this issue by trying to spawn a subprocess with PYTHONPATH set from sys.path of the parent (to make sure the child can import everything parent could). |
Can you create a PR that would fix this, with tests and changelog? |
navytux
added a commit
to navytux/virtualenv
that referenced
this issue
Oct 1, 2020
5 tasks
Yes: #1960. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Issue
Hello up there. I've discovered that with python2 virtualenv 20 does not process .pth files under site-packages if $PYTHONPATH points to site-packages directory. It is a regression compared to virtualenv 16. This causes testing breakage of real projects, for example pygolong tox tests with new virtualenv become broken due to this issue.
Below is a brief demonstration for the problem:
The issue happens due to below check of
if full_path not in sys.path
invirtualenv/src/virtualenv/create/via_global_ref/builtin/python2/site.py
Lines 47 to 56 in 5e46e4a
which, in the presence of namespace packages (packages that are only installed via .pth files, not via
__init__.py
) leads to ImportError for those packages. For the reference here are corresponding directory and .pth for zope.interfaces:As said above this leads to pygolang tox tests failure, e.g.
Thanks beforehand,
Kirill
Environment
Provide at least:
Linux deco 5.8.0-2-amd64 #1 SMP Debian 5.8.10-1 (2020-09-19) x86_64 GNU/Linux
pip list
of the host python wherevirtualenv
is installed:Output of the virtual environment creation
Make sure to run the creation with
-vvv --with-traceback
:The text was updated successfully, but these errors were encountered: