[Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review (original) (raw)
Guido van Rossum guido at python.org
Thu Feb 16 05:12:12 CET 2012
- Previous message: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review
- Next message: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Feb 15, 2012 at 7:28 PM, Larry Hastings <larry at hastings.org> wrote:
On 02/15/2012 09:43 AM, Guido van Rossum wrote:
Apart from the specific use case of making an exact copy of a directory tree that can be verified by other tools that simply compare the nanosecond times for equality, A data point on this specific use case. The following code throws its assert ~90% of the time in Python 3.2.2 on a modern Linux machine (assuming "foo" exists and "bar" does not): import shutil import os shutil.copy2("foo", "bar") assert os.stat("foo").stmtime == os.stat("bar").stmtime The problem is with os.utime. IIUC stat() on Linux added nanosecond atime/mtime support back in 2.5. But the corresponding utime() functions to write nanosecond atime/mtime didn't appear until relatively recently--and Python 3.2 doesn't use them. With statfloattimes turned on, os.stat effectively reads with ~100-nanosecond precision, but os.utime still only writes with microsecond precision. I fixed this in trunk last September (issue 12904); os.utime now preserves all the precision that Python currently conveys. One way of looking at it: in Python 3.2 it's already pretty bad and almost nobody is complaining. (There's me, I guess, but I scratched my itch.)
So, essentially you fixed this particular issue without having to do anything as drastic as the proposed PEP...
-- --Guido van Rossum (python.org/~guido)
- Previous message: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review
- Next message: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]