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 eric.snow
Recipients Arfrever, brett.cannon, eric.snow, ncoghlan, ronaldoussoren
Date 2013-12-08.03:27:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386473264.24.0.144679680995.issue19851@psf.upfronthosting.co.za>
In-reply-to
Content
This is actually a problem with importlib.reload() (which imp.reload() simply wraps).  The attached patch provides a test that reproduces the error.  I'll work on a fix ASAP.

Interestingly, the kind of failure depends on frozen vs. source importlib:

======================================================================
ERROR: test_reload_submodule (test.test_importlib.test_api.Frozen_ReloadTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_importlib/test_api.py", line 430, in test_reload_submodule
    self.init.reload(ham)
  File "Lib/importlib/__init__.py", line 161, in reload
    methods.exec(module)
  File "<frozen importlib._bootstrap>", line 1134, in exec
AttributeError: 'NoneType' object has no attribute 'name'

======================================================================
ERROR: test_reload_submodule (test.test_importlib.test_api.Source_ReloadTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_importlib/test_api.py", line 430, in test_reload_submodule
    self.init.reload(ham)
  File "Lib/importlib/__init__.py", line 158, in reload
    raise ImportError(msg.format(parent_name), name=parent_name)
ImportError: parent 'spam' not in sys.modules

----------------------------------------------------------------------
History
Date User Action Args
2013-12-08 03:27:44eric.snowsetrecipients: + eric.snow, brett.cannon, ronaldoussoren, ncoghlan, Arfrever
2013-12-08 03:27:44eric.snowsetmessageid: <1386473264.24.0.144679680995.issue19851@psf.upfronthosting.co.za>
2013-12-08 03:27:44eric.snowlinkissue19851 messages
2013-12-08 03:27:43eric.snowcreate