Message388116
For example, the named-pipe filesystem (NPFS), doesn't return timestamps for pipes in the directory listing, so the timestamps are all 0 (i.e. 1601-01-01):
>>> write_time = win32file.FindFilesW('//./pipe/*')[0][3]
>>> format(write_time, '%Y-%m-%d %H:%M')
'1601-01-01 00:00'
>>> next(os.scandir('//./pipe')).stat().st_mtime
-11644473600.0
I agree that a zero-valued NT timestamp should be converted to a zero-valued Unix timestamp. No one has a file that was created, modified, changed, or accessed in 1601.
As mentioned above, the 1601 date doesn't roundtrip in Windows as a Unix timestamp since dates before the Unix epoch aren't supported:
>>> write_time.timestamp()
-11644473600.0
>>> datetime.fromtimestamp(write_time.timestamp())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument |
|
Date |
User |
Action |
Args |
2021-03-04 18:14:22 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, steve.dower, CristiFati, iritkatriel |
2021-03-04 18:14:22 | eryksun | set | messageid: <1614881662.51.0.298872198606.issue23946@roundup.psfhosted.org> |
2021-03-04 18:14:22 | eryksun | link | issue23946 messages |
2021-03-04 18:14:22 | eryksun | create | |
|