[issue23412] importlib sometimes fails to import a recently created module

Brett Cannon report at bugs.python.org
Mon Feb 9 16:45:49 CET 2015


Brett Cannon added the comment:

Because stat results are cached for performance reasons, it's possible to write to the file system and then try to read/import from it before the modification time for the directory even picks up that there was a change. For this reason there is importlib.invalidate_caches(): https://docs.python.org/3/library/importlib.html#importlib.invalidate_caches .

I have opened http://bugs.python.org/issue23422 to track that the docs for importlib.import_module() point out invalidate_caches().

----------
resolution:  -> not a bug
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23412>
_______________________________________


More information about the Python-bugs-list mailing list