[C++-sig] zipimport and bad mtimes

Philip Winston pwinston at gmail.com
Wed Jul 25 19:35:49 CEST 2007


I'm loading the standard libs out of a .zip file with an embedded
interpreter.  With Py_VerboseFlag on I see several "has bad mtime"
messages during initialization.  I modified zipimport.c to print more
details and am now seeing this during init:

python25.zip\site.pyc mtime is okay
python25.zip\os.pyc mtime is off by 3600
python25.zip\ntpath.pyc mtime is okay
python25.zip\stat.pyc mtime is okay
python25.zip\UserDict.pyc mtime is off by 3600
python25.zip\copy_reg.pyc mtime is okay
python25.zip\types.pyc mtime is okay
python25.zip\locale.pyc mtime is okay
python25.zip\encodings\__init__.pyc mtime is okay
python25.zip\codecs.pyc mtime is off by 3600
python25.zip\encodings\aliases.pyc mtime is okay
python25.zip\re.pyc mtime is off by 3600
python25.zip\sre_compile.pyc mtime is okay
python25.zip\sre_constants.pyc mtime is okay
python25.zip\sre_parse.pyc mtime is okay
python25.zip\encodings\cp1252.pyc mtime is okay
python25.zip\warnings.pyc mtime is okay
python25.zip\linecache.pyc mtime is okay

So most mtime's are okay, but the ones that are bad are off by exactly
1 hour.  It looks like the internal timestamp in .pyc is one hour
*earlier* than the .py timestamp. I created the zip by deleting *all*
.pyc files and then using compileall and then zipping up everything
(.py and .pyc).   Any ideas where bad times could be from, or are they
don't really bad?

-Philip



More information about the Cplusplus-sig mailing list