mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Issue #13645: pyc files now contain the size of the corresponding source
code, to avoid timestamp collisions (especially on filesystems with a low timestamp resolution) when checking for freshness of the bytecode.
This commit is contained in:
parent
1f918c1480
commit
5136ac0ca2
14 changed files with 167 additions and 49 deletions
|
@ -1033,7 +1033,9 @@ unmarshal_code(PyObject *pathname, PyObject *data, time_t mtime)
|
|||
return Py_None; /* signal caller to try alternative */
|
||||
}
|
||||
|
||||
code = PyMarshal_ReadObjectFromString(buf + 8, size - 8);
|
||||
/* XXX the pyc's size field is ignored; timestamp collisions are probably
|
||||
unimportant with zip files. */
|
||||
code = PyMarshal_ReadObjectFromString(buf + 12, size - 12);
|
||||
if (code == NULL)
|
||||
return NULL;
|
||||
if (!PyCode_Check(code)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue