[New-bugs-announce] [issue23946] Invalid timestamps reported by os.stat() when Windows FILETIME structures are mistakenly reset.
report at bugs.python.org
Tue Apr 14 13:56:59 CEST 2015
New submission from Cristi Fati:
In WinPE environment (at least this is where I found it, but there might be cases where this issue could be spotted in normal Windows), some folders might have some of the FILETIME structures reset (because of RAMDrive?). When the conversion between WIN style (100 * nsecs from 1601/01/01) to UX style (secs from 1970/01/01) is taking place (epoch is being substracted), it could yield invalid filetime values (that will be reported by os.stat).
The attached patch simply goes around this initializing the UX timestamps to 0.
It was found in Python-2.7.3, the patch is for 2.7.8, but I think it can be reproduced with all the newer versions.
components: Interpreter Core, Windows
nosy: CristiFati, steve.dower, tim.golden, zach.ware
title: Invalid timestamps reported by os.stat() when Windows FILETIME structures are mistakenly reset.
versions: Python 2.7
Added file: http://bugs.python.org/file38985/Python-2.7.8-invalid_filetimes.patch
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce