[issue10148] st_mtime differs after shutil.copy2
Martin v. Löwis
report at bugs.python.org
Wed Oct 20 02:32:35 CEST 2010
Martin v. Löwis <martin at v.loewis.de> added the comment:
This is a system limitation. The underlying file system supports nanosecond resolution for the file stamps, and stat(2) also supports reporting them. However, utimes(2) only supports microsecond resolution when setting them.
Linux supports utimensat(2) since 2.6.22 (July 2007), however, Python doesn't use it. It would be possible to come up with a patch to transparently use it where available. Are you interested in writing such a patch?
As a consequential issue: For Python, a long time ago, it was decided that time stamps in system interfaces are floating point numbers. As a consequence, nanoseconds cannot be accurately represented for today's dates (IIUC). I doubt there is anything we could do about this; this is likely "won't fix".
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list