[prev in list] [next in list] [prev in thread] [next in thread]
List: python-dev
Subject: [Python-Dev] Import hooks falling back on built-in import machinery?
From: Georg Brandl <g.brandl () gmx ! net>
Date: 2006-05-25 17:47:59
Message-ID: e54qkl$i44$1 () sea ! gmane ! org
[Download RAW message or body]
While working on a patch involving sys.path_importer_cache, I discovered
that if a path_hooks import hook has been found for a given sys.path entry,
but isn't able to import a specific module, find_module() tries to import
the module from this sys.path entry as a regular file.
This results in e.g. doing an open call to /usr/lib/python25.zip/x.py when
I do "import x", while I think that once a sys.path entry has been identified
as belonging to a sys.path_hooks importer instance, it shouldn't be handled
by the built-in machinery anymore since the path string could be anything.
PEP 302 says "...it was chosen to ... simply fall back to the built-in logic
if no hook on sys.path_hooks could handle the path item", but that's
refering to sys.path entries, not individual module names to be imported.
Georg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev%40progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic