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 steve.dower
Recipients brian.curtin, jkloth, loewis, pitrou, python-dev, steve.dower, tim.golden, tim.peters
Date 2013-11-23.05:09:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1385183389.41.0.865000803983.issue19715@psf.upfronthosting.co.za>
In-reply-to
Content
The "000" or "500" still smells of floating point rounding to me. Windows appears to round-trip the values provided perfectly:

import ctypes
def do_test(t):
    h = ctypes.windll.kernel32.CreateFileW("test.txt", 0xC0000000, 7, None, 2, 0, 0)
    assert h != -1
    try:
        mt1 = ctypes.c_uint64(t)
        assert ctypes.windll.kernel32.SetFileTime(h, None, None, ctypes.byref(mt1)) != 0
        mt2 = ctypes.c_uint64()
        assert ctypes.windll.kernel32.GetFileTime(h, None, None, ctypes.byref(mt2)) != 0
        assert mt1.value == mt2.value
        print(mt2.value)
    finally:
        assert ctypes.windll.kernel32.CloseHandle(h) != 0

>>> do_test(123)
123
>>> do_test(999999999999999999)
999999999999999999

Now, I'm not going to make any claims about GetSystemTime's accuracy, and there could well be floating point conversions within there that cause the rounding issue, but I'm more inclined to think that one of Python's conversions is at fault.

Of course, an easy way around this would be to sleep for >100ns before touching the file again.
History
Date User Action Args
2013-11-23 05:09:49steve.dowersetrecipients: + steve.dower, tim.peters, loewis, pitrou, tim.golden, jkloth, brian.curtin, python-dev
2013-11-23 05:09:49steve.dowersetmessageid: <1385183389.41.0.865000803983.issue19715@psf.upfronthosting.co.za>
2013-11-23 05:09:49steve.dowerlinkissue19715 messages
2013-11-23 05:09:49steve.dowercreate