classification
Title: Document imp.NullImporter is NOT used anymore by import
Type: enhancement Stage: needs patch
Components: Documentation Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: Andreas.Pelme, brett.cannon, ezio.melotti, python-dev
Priority: normal Keywords: easy

Created on 2013-02-10 19:50 by brett.cannon, last changed 2013-03-13 18:11 by brett.cannon. This issue is now closed.

Messages (4)
msg181846 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-02-10 19:50
imp.NullImporter should not be claiming that it is still used to fill sys.path_importer_cache on misses.
msg182767 - (view) Author: Andreas Pelme (Andreas.Pelme) * Date: 2013-02-23 17:06
This seems like an oversight from

http://bugs.python.org/issue15473

The release notes for 3.3 added a note about this:
"Because None is now inserted into sys.path_importer_cache, if you are clearing out entries in the dictionary of paths that do not have a finder, you will need to remove keys paired with values of None and imp.NullImporter to be backwards-compatible. This will lead to extra overhead on older versions of Python that re-insert None into sys.path_importer_cache where it repesents the use of implicit finders, but semantically it should not change anything."

But the relevant docs for NullImporter (http://docs.python.org/2/library/imp.html#imp.NullImporter) and sys.path_importer_cache (http://docs.python.org/2/library/sys.html#sys.path_importer_cache) did not get updated.

We have verified that the release notes in 3.4 is correct, and NullImporter is never used.

We are however not sure about the correct wording for the documentation fix.
msg182885 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-02-24 19:24
The docs for NullImporter need to not mention that it is used with sys.path_importer_cache since it isn't. As for sys.path_importer_cache, it should say that None is inserted and not NullImporter. Both need a versionchanged notation of the switch from None to NullImporter, but sys.path_importer_cache needs a special mention that to be fully backwards-compatible to check for both None and NullImporter.

And just to make sure you are looking at the right docs, Andreas, your links were to the Python 2.7 docs. If you look at the top of the docs you will see a dropdown which lets you switch to the 3.3 or 3.4 docs easily.
msg184095 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-03-13 18:03
New changeset 8e390e4784b0 by Brett Cannon in branch 'default':
Issue #17176: Document that imp.NullImporter is no longer inserted
http://hg.python.org/cpython/rev/8e390e4784b0

New changeset e470370b4701 by Brett Cannon in branch '3.3':
Issue #17176: Document that imp.NullImporter is no longer
http://hg.python.org/cpython/rev/e470370b4701
History
Date User Action Args
2013-03-13 18:11:30brett.cannonsetstatus: open -> closed
resolution: fixed
2013-03-13 18:03:07python-devsetnosy: + python-dev
messages: + msg184095
2013-02-24 19:24:43brett.cannonsetmessages: + msg182885
2013-02-23 17:06:22Andreas.Pelmesetnosy: + Andreas.Pelme
messages: + msg182767
2013-02-15 20:58:10ezio.melottisetkeywords: + easy
nosy: + ezio.melotti
type: enhancement
2013-02-10 19:50:27brett.cannoncreate