Message8371
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 |
|
Date |
User |
Action |
Args |
2014-05-10 10:16:29 | t-8ch | set | recipients:
+ t-8ch |
2014-05-10 10:16:29 | t-8ch | set | messageid: <1399716989.7.0.228617306621.issue2139@psf.upfronthosting.co.za> |
2014-05-10 10:16:29 | t-8ch | link | issue2139 messages |
2014-05-10 10:16:29 | t-8ch | create | |
|