[Python-Dev] Safely importing zip files with C extensions (original) (raw)
Vinay Sajip vinay_sajip at yahoo.co.uk
Wed Mar 27 21:41:05 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 ]
Amaury Forgeot d'Arc <amauryfa gmail.com> writes:
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.pathhook entry do the job.
That's what the mount() actually does - adds the wheel to a registry that an import hook uses. You also need a place to check that the wheel being mounted is compatible with the Python doing the mounting - I'm not sure whether what the import hook should do if e.g. there is a compatibility problem with the wheel (e.g. is it clear that it should always raise an ImportError? Or ignore the wheel - seems wrong? Or do something else?)
Regards,
Vinay Sajip
- 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 ]