Trent Nelson added the comment:
I've figured out what the primary problem is on these platforms: os.stat()
returns st_mtime and st_atime values with nanosecond resolution, but without a
corresponding utimensat(), we can only affect time with microsecond precision
via utimes().
Therefore, the following logic is faulty:
def _test_utime(self, filename, attr, utime, delta):
# Issue #13327 removed the requirement to pass None as the
# second argument. Check that the previous methods of passing
# a time tuple or None work in addition to no argument.
st0 = os.stat(filename)
# Doesn't set anything new, but sets the time tuple way
utime(filename, (attr(st0, "st_atime"), attr(st0, "st_mtime")))
# Setting the time to the time you just read, then reading again,
# should always return exactly the same times.
st1 = os.stat(filename)
self.assertEqual(attr(st0, "st_mtime"), attr(st1, "st_mtime"))
self.assertEqual(attr(st0, "st_atime"), attr(st1, "st_atime"))
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue15745>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com