[issue6260] os.utime should allow None values for ATIME or MTIME

James report at bugs.python.org
Wed Jun 10 22:06:33 CEST 2009


New submission from James <purpleidea at gmail.com>:

Hi, in using os.utime, it's nice that you can specify `None' for the
second argument. However it would be even `nicer' to be able to specify
None for either (or potentially both) values for the argument in the
tuple. to emulate this, i've been using os.stat to read the value
beforehand, and just use os.utime with the new value, and the old one
pulled from stat()

HTH, _J

example:
os.utime('/dev/pts/1', None) WORKS
os.utime('/dev/pts/1') SHOULD WORK (allow second argument to default to
None)
os.utime('/dev/pts/1', (time.time(), None)) SHOULD WORK
os.utime('/dev/pts/1', (None, None)) SHOULD WORK
os.utime('/dev/pts/1', (None, time.time())) I GUESS SHOULD WORK

ps: if this is a feature you'd agree with, let me know any maybe i can
*try* to write a patch?

----------
components: IO
messages: 89227
nosy: purpleidea
severity: normal
status: open
title: os.utime should allow None values for ATIME or MTIME
type: feature request
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6260>
_______________________________________


More information about the Python-bugs-list mailing list