[Python-Dev] Safely importing zip files with C extensions
Bradley M. Froehle
brad.froehle at gmail.com
Wed Mar 27 22:19:39 CET 2013
More information about the Python-Dev mailing list
Wed Mar 27 22:19:39 CET 2013
- Previous message: [Python-Dev] Safely importing zip files with C extensions
- Next message: [Python-Dev] Safely importing zip files with C extensions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Mar 27, 2013 at 1:13 PM, Amaury Forgeot d'Arc <amauryfa at gmail.com>wrote: > 2013/3/27 Vinay Sajip <vinay_sajip at yahoo.co.uk> > >> When you mount a wheel, its absolute path name is added to >> sys.path, allowing the Python code in it to be imported. >> > > Better: just put the wheel path to sys.path > sys.path.append('/tmp/simplejson-3.1.2-cp27-none-linux_x86_64.whl') > and let a sys.path_hook entry do the job. > > Such a WheelImporter could even inherit from zipimporter, plus the magic > required for C extensions. > I implemented just such a path hook ---- zipimporter plus the magic required for C extensions --- as a challenge to myself to learn more about the Python import mechanisms. See https://github.com/bfroehle/pydzipimport. Cheers, Brad -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130327/3c4baf7b/attachment.html>
- Previous message: [Python-Dev] Safely importing zip files with C extensions
- Next message: [Python-Dev] Safely importing zip files with C extensions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list