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 rjdymond
Recipients rjdymond
Date 2015-02-08.15:43:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1423410215.95.0.524604601959.issue23412@psf.upfronthosting.co.za>
In-reply-to
Content
importlib.import_module() sometimes fails to import a module that has just been written to the filesystem, aborting with an ImportError.

Example output when executing the attached file with Python 3.3 or 3.4:

Wrote tmpwbzb35.py
  Successfully imported tmpwbzb35
Wrote tmp34c6qs.py
Traceback (most recent call last):
  File "importerror.py", line 12, in <module>
    importlib.import_module(modname)
  File "/home/rjd/Python/Python3.3/lib/python3.3/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1522, in _find_and_load_unlocked
ImportError: No module named 'tmp34c6qs'

I have been unable to reproduce this behaviour with Python 2.7 or Python 3.2.
History
Date User Action Args
2015-02-08 15:43:35rjdymondsetrecipients: + rjdymond
2015-02-08 15:43:35rjdymondsetmessageid: <1423410215.95.0.524604601959.issue23412@psf.upfronthosting.co.za>
2015-02-08 15:43:35rjdymondlinkissue23412 messages
2015-02-08 15:43:35rjdymondcreate