Issue127

Title time.mktime simple checks fail when is_dst applies to the original timestamp
Priority feature Status unread
Superseder Nosy List yaneurabeya
Assigned To Keywords

Created on 2011-05-09.06:56:05 by yaneurabeya, last changed 2011-05-09.06:56:05 by yaneurabeya.

Messages
msg622 (view) Author: yaneurabeya Date: 2011-05-09.06:56:04
There's an optimization in pkg_resources.ZipProvider._extract_resource that checks the timestamp of a zip egg's files vs the os.stat output for the real file on disk (if it exists). time.mktime is used. The problem with using this function call with -1, is that if the underlying timezone is modified between the time that the file was installed, and the next time the file is being installed or the file itself was stored without a value relative to a timezone, the _extract_resource method will re-extract and install the new file, even if the contents are the same on disk. This generates more unnecessary I/O, and creates race conditions depending on how things are installed on disk.

calendar.timegm can be used in its place, but it's not necessarily present on non-Unix platforms. A quick check that I ran shows that it's present on Cygwin, FreeBSD, Linux, and OSX however.
History
Date User Action Args
2011-05-09 06:56:05yaneurabeyacreate