New submission from Antoine Pitrou: os.utime() uses the following code when times is None under Windows:
SYSTEMTIME now; GetSystemTime(&now); if (!SystemTimeToFileTime(&now, &mtime) || !SystemTimeToFileTime(&now, &atime)) { PyErr_SetFromWindowsErr(0); goto exit; } The problem is GetSystemTime has poor resolution (milliseconds). Instead, it could call GetSystemTimeAsFileTime which writes directly into a FILETIME structure, and potentially (?) has better resolution. (according to a comment on MSDN, "Resolution on Windows 7 seems to be sub-millisecond": http://msdn.microsoft.com/en-us/library/windows/desktop/ms724397%28v=vs.85%29.aspx ) ---------- components: Library (Lib), Windows messages: 203943 nosy: brian.curtin, larry, loewis, pitrou, steve.dower, tim.golden, tim.peters priority: normal severity: normal status: open title: os.utime(..., None) has poor resolution on Windows type: behavior versions: Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19727> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com