[issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds

Devin Bayer report at bugs.python.org
Thu Oct 12 16:04:58 EDT 2017


Devin Bayer <dev at doubly.so> added the comment:

Hello Brett, it would be nice if you would discuss this before closing. The referenced PEP will not solve my use case, because hash-based checking will not become the default.

The issue is that by default the source file loader will be returning stale bytecode and that's incorrect behavior.

If you wish to avoid the stat call you could use a higher resolution timestamp in the pyc file, or better yet add a second field indicating bytecode compilation time.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31772>
_______________________________________


More information about the Python-bugs-list mailing list