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.
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 09bd83a..68929ba 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -1033,7 +1033,9 @@
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)) {