This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients ncoghlan, vstinner
Date 2012-02-08.01:19:52
SpamBayes Score 1.4485635e-12
Marked as misclassified No
Message-id <1328663994.2.0.189878263913.issue13964@psf.upfronthosting.co.za>
In-reply-to
Content
Python 3.3 has 4 new functions to set the access and modification time of a file (only os.utime() was already present in Python 3.2). New functions taking timestamp with a nanonsecond resolution use a tuple of int because the float type doesn't support nanosecond resolution. Thanks to the PEP 410, we can simplify the API to use a simple number (int, float or Decimal) instead of a tuple of 2 integers.

Current API:

- futimes(fd[, (atime, mtime)]): 1 argument for timestamps
- lutimes(path[, (atime, mtime)]): 1 argument for timestamps
- utime(path[, (atime, mtime)]): 1 argument for timestamps

- futimens(fd[, (atime_sec, atime_nsec), (mtime_sec, mtime_nsec)]): 2 arguments for timestamps
- utimensat(dirfd, path[, atime=(atime_sec, atime_nsec), mtime=(mtime_sec, mtime_nsec), flags=0]): 2 arguments for timestamps

I propose to:

- support Decimal type in all functions: avoid conversion to float to not lose precision
- remove os.futimens(): os.futimes() does already use futimens() if the function is present (and Decimal can be used to get nanosecond resolution)
- change os.utimensat() API to: os.utimensat(dirfd, path[, (atime, mtime), flags=0])
History
Date User Action Args
2012-02-08 01:19:54vstinnersetrecipients: + vstinner, ncoghlan
2012-02-08 01:19:54vstinnersetmessageid: <1328663994.2.0.189878263913.issue13964@psf.upfronthosting.co.za>
2012-02-08 01:19:53vstinnerlinkissue13964 messages
2012-02-08 01:19:52vstinnercreate