Message235557
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. |
|
Date |
User |
Action |
Args |
2015-02-08 15:43:35 | rjdymond | set | recipients:
+ rjdymond |
2015-02-08 15:43:35 | rjdymond | set | messageid: <1423410215.95.0.524604601959.issue23412@psf.upfronthosting.co.za> |
2015-02-08 15:43:35 | rjdymond | link | issue23412 messages |
2015-02-08 15:43:35 | rjdymond | create | |
|