This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients CristiFati, eryksun, iritkatriel, paul.moore, steve.dower, tim.golden, zach.ware
Date 2021-03-04.18:14:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614881662.51.0.298872198606.issue23946@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2021-03-04 18:14:22eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, CristiFati, iritkatriel
2021-03-04 18:14:22eryksunsetmessageid: <1614881662.51.0.298872198606.issue23946@roundup.psfhosted.org>
2021-03-04 18:14:22eryksunlinkissue23946 messages
2021-03-04 18:14:22eryksuncreate