Message8371

Author t-8ch
Recipients t-8ch
Date 2014-05-10.10:16:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1399716989.7.0.228617306621.issue2139@psf.upfronthosting.co.za>
In-reply-to
Content
When putting a wheel (zipfile on the PYTHONPATH) the import mechanism does not pick it up (this breaks for example virtualenv).

# This works with CPython (tested 2.5 - 3.4) and PyPy (1.9 and 2.0) given I use PYTHONPATH=/tmp/requests-2.2.1-py2.py3-none-any.whl
requests = __import__('requests')
print(requests.__file__)
print(requests.__loader__)

# This also works on Jython (and all the others), so zipimport can't be to broken)
import zipimport
ARCHIVE = 'requests-2.2.1-py2.py3-none-any.whl'
requests = zipimport.zipimporter(ARCHIVE).load_module('requests')

print(requests.__file__)
print(requests.__loader__)


Tested with 2.5.3 and 01460e803ef3
History
Date User Action Args
2014-05-10 10:16:29t-8chsetrecipients: + t-8ch
2014-05-10 10:16:29t-8chsetmessageid: <1399716989.7.0.228617306621.issue2139@psf.upfronthosting.co.za>
2014-05-10 10:16:29t-8chlinkissue2139 messages
2014-05-10 10:16:29t-8chcreate