Open mbway opened 3 months ago
In the documentation for utime
it states
Note that the exact times you set here may not be returned by a subsequent stat() call, depending on the resolution with which your operating system records access and modification times; see stat(). The best way to preserve exact times is to use the st_atime_ns and st_mtime_ns fields from the os.stat() result object with the ns parameter to utime.
This may be connected to a failing cython test on windows where there is a check that ctime.time()
matches time.time()
. I think we should carefully check the time module on windows to make sure it matches the CPython implementation more closely.
When running the following script with
pypy3.10
on Windows 10:the expected result is that the assertion passes as the call to
os.utime
should set the same timestamp as the file already has, but when running on windows, sometimes the assertion fails. The failure is more likely when addingtime.sleep(0.1)
between the call tostat()
and the call toutime
. When running with cpython 3.10.11 (or any other cpython version) the assertion never seems to fail.note: the problem occurs when using
times=()
orns=()
in theos.utime
call