-
-
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
[20.0.5] pypy 2.x site initialization strangeness #1652
Comments
Seems strange, did you open an issue with pypy, could help to understand what's the difference between the two modules 🤔 |
Some investigation, seems the meta path is different; but the paths otherwise the same. pypy -c 'import sys; print("meta paths"); print("\n".join(repr(i) for i in sys.meta_path)); print(""); print("path hooks"); print("\n".join(repr(i) for i in sys.path_hooks)); print("\npath"); print("\n".join(repr(i) for i in sys.path));print("\ntest import"); import cStringIO; print(cStringIO);' 167ms Sat 22 Feb 08:59:53 2020
meta paths
path hooks
<type 'zipimporter'>
path
''
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib_pypy/__extensions__'
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib_pypy'
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib-python/2.7'
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib-python/2.7/lib-tk'
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib-python/2.7/plat-darwin'
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib-python/2.7/plat-mac'
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib-python/2.7/plat-mac/lib-scriptpackages'
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/site-packages'
test import
<module 'cStringIO' (built-in)> venv/bin/pypy -c 'import sys; print("meta paths"); print("\n".join(repr(i) for i in sys.meta_path)); print(""); print("path hooks"); print("\n".join(repr(i) for i in sys.path_hooks)); print("\npath"); print("\n".join(repr(i) for i in sys.path));print("\ntest import"); import cStringIO; print(cStringIO);' 231ms Sat 22 Feb 08:59:58 2020
meta paths
<setuptools.extern.VendorImporter instance at 0x00000001059e9960>
<setuptools._vendor.six._SixMetaPathImporter object at 0x00000001059e1d70>
<pkg_resources.extern.VendorImporter instance at 0x000000010612b1e0>
<pkg_resources._vendor.six._SixMetaPathImporter object at 0x000000010612db08>
path hooks
<type 'zipimporter'>
path
''
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib_pypy/__extensions__'
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib_pypy'
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib-python/2.7'
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib-python/2.7/lib-tk'
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib-python/2.7/plat-darwin'
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib-python/2.7/plat-mac'
'/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib-python/2.7/plat-mac/lib-scriptpackages'
'/Users/bgabor8/git/github/virtualenv/venv/site-packages'
test import
<module 'cStringIO' from '/Users/bgabor8/.pyenv/versions/pypy2.7-7.3.0/lib_pypy/cStringIO.pyc'> Opened upstream issue https://foss.heptapod.net/pypy/pypy/issues/3174 to understand the difference. |
Looking at that file:
So I guess the question remains why is the built-in not discovered within the venv but is outside. Side question would be why the |
There is this in the pypy 2.7 code:
where
So by changing So in conclusion:
|
* fix pypy2 builtins are imported as stdlib modules Resolves #1652. Signed-off-by: Bernat Gabor <[email protected]> * test failure Signed-off-by: Bernat Gabor <[email protected]>
Hello, a fix for this issue has been released via virtualenv 20.0.6; see https://pypi.org/project/virtualenv/20.0.6/ (https://virtualenv.pypa.io/en/latest/changelog.html#v20-0-6-2020-02-26) . Please give a try and report back if your issue has not been addressed; if not, please comment here, and we'll reopen the ticket. We want to apologize for the inconvenience this has caused you and say thanks for having patience while we resolve the unexpected bugs with this new major release. |
This is affecting builds -- it makes pip fail in a strange way when invoking shlex:
virtualenv creation:
script difference:
the actual failure I'm seeing:
Investigation:
This seems to be the main difference:
leading to this difference:
The text was updated successfully, but these errors were encountered: