[issue19727] os.utime(..., None) has poor resolution on Windows

2013-11-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Here is a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file32796/utime_win.patch

___
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



[issue19727] os.utime(..., None) has poor resolution on Windows

2013-11-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Redoing (indentation issue).

--
Added file: http://bugs.python.org/file32797/utime_win.patch

___
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



[issue19727] os.utime(..., None) has poor resolution on Windows

2013-11-23 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


Removed file: http://bugs.python.org/file32796/utime_win.patch

___
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



[issue19727] os.utime(..., None) has poor resolution on Windows

2013-11-23 Thread STINNER Victor

STINNER Victor added the comment:

utime_win.patch looks good to me.

--
nosy: +haypo

___
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



[issue19727] os.utime(..., None) has poor resolution on Windows

2013-11-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6a9e262c5423 by Antoine Pitrou in branch 'default':
Issue #19727: os.utime(..., None) is now potentially more precise under Windows.
http://hg.python.org/cpython/rev/6a9e262c5423

--
nosy: +python-dev

___
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



[issue19727] os.utime(..., None) has poor resolution on Windows

2013-11-23 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
resolution:  - fixed
status: open - closed

___
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



[issue19727] os.utime(..., None) has poor resolution on Windows

2013-11-22 Thread Antoine Pitrou

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