A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-May/065173.html below:

[Python-Dev] Import hooks falling back on built-in import machinery?

[Python-Dev] Import hooks falling back on built-in import machinery? [Python-Dev] Import hooks falling back on built-in import machinery?Georg Brandl g.brandl at gmx.net
Thu May 25 19:47:59 CEST 2006
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

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4