[New-bugs-announce] [issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds

Devin Bayer report at bugs.python.org
Thu Oct 12 09:43:00 EDT 2017


New submission from Devin Bayer <dev at doubly.so>:

The current import machinery will use stale cached bytecode if the source is modified more than once per second and with equal size.

A straightforward fix is to require the bytecode mtime to be greater than the source file mtime. In the unusual case where the file is written twice with the precision the filesystem records, this will ignore the cache, but at least we aren't behaving incorrectly.

----------
components: Interpreter Core
messages: 304236
nosy: akvadrako
priority: normal
severity: normal
status: open
title: SourceLoader uses stale bytecode in case of equal mtime seconds
type: behavior
versions: Python 3.7

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


More information about the New-bugs-announce mailing list