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

2015-02-09 Thread Brett Cannon
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.invali

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

2015-02-08 Thread SilentGhost
Changes by SilentGhost : -- versions: +Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

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

2015-02-08 Thread SilentGhost
SilentGhost added the comment: Looks like some sort of race condition. Sleeping for a second before import_module seem to solve the problem. -- components: +Interpreter Core nosy: +SilentGhost, brett.cannon, eric.snow, ncoghlan ___ Python tracker

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

2015-02-08 Thread Richard Dymond
New submission from Richard Dymond: 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 tmpwbz