This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author barry
Recipients barry, brett.cannon, chris.jerdonek, eric.smith, eric.snow, jaraco
Date 2012-11-20.20:01:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20121120150133.45ad381e@resist.wooz.org>
In-reply-to <1353430298.26.0.981980426696.issue16514@psf.upfronthosting.co.za>
Content
On Nov 20, 2012, at 04:51 PM, Eric V. Smith wrote:

>I agree it's a bug. And the fix looks good to me.

Thanks.

>Having said that: I haven't looked at the import.c version to verify what is
>happening. Does the test pass under 3.2?

Yep.  See below.  When you take a look at the path_hooks iteration loop,
you'll see why.

-----snip snip-----
import sys

sys.path.insert(0, None)
sys.path_importer_cache.pop(None, None)
sys.modules.pop('email', None)

import email
print(email)
-----snip snip-----

% python3.2 /tmp/foo.py
<module 'email' from '/usr/lib/python3.2/email/__init__.py'>
% python3.3 /tmp/foo.py
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1271, in _path_importer_cache
KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/foo.py", line 7, in <module>
    import email
  File "<frozen importlib._bootstrap>", line 1561, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1519, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1473, in _find_module
  File "<frozen importlib._bootstrap>", line 1308, in find_module
  File "<frozen importlib._bootstrap>", line 1284, in _get_loader
  File "<frozen importlib._bootstrap>", line 1273, in _path_importer_cache
  File "<frozen importlib._bootstrap>", line 1254, in _path_hooks
TypeError: 'NoneType' object is not iterable
Error in sys.excepthook:
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1271, in _path_importer_cache
KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 58, in apport_excepthook
    from cStringIO import StringIO
  File "<frozen importlib._bootstrap>", line 1561, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1519, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1473, in _find_module
  File "<frozen importlib._bootstrap>", line 1308, in find_module
  File "<frozen importlib._bootstrap>", line 1284, in _get_loader
  File "<frozen importlib._bootstrap>", line 1273, in _path_importer_cache
  File "<frozen importlib._bootstrap>", line 1254, in _path_hooks
TypeError: 'NoneType' object is not iterable

Original exception was:
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1271, in _path_importer_cache
KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/foo.py", line 7, in <module>
    import email
  File "<frozen importlib._bootstrap>", line 1561, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1519, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1473, in _find_module
  File "<frozen importlib._bootstrap>", line 1308, in find_module
  File "<frozen importlib._bootstrap>", line 1284, in _get_loader
  File "<frozen importlib._bootstrap>", line 1273, in _path_importer_cache
  File "<frozen importlib._bootstrap>", line 1254, in _path_hooks
TypeError: 'NoneType' object is not iterable
History
Date User Action Args
2012-11-20 20:01:37barrysetrecipients: + barry, brett.cannon, jaraco, eric.smith, chris.jerdonek, eric.snow
2012-11-20 20:01:37barrylinkissue16514 messages
2012-11-20 20:01:37barrycreate