diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-13 17:52:16 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-13 17:52:16 (GMT) |
commit | 5136ac0ca21a05691978df8d0650f902c8ca3463 (patch) | |
tree | 4b5569dad3f1b36f115c673602dde6ff49eae5e0 /Modules | |
parent | 1f918c1480a1566b774391bbc4ddf1d4153965a1 (diff) | |
download | cpython-5136ac0ca21a05691978df8d0650f902c8ca3463.zip cpython-5136ac0ca21a05691978df8d0650f902c8ca3463.tar.gz cpython-5136ac0ca21a05691978df8d0650f902c8ca3463.tar.bz2 |
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.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/zipimport.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 @@ 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)) { |