[New-bugs-announce] [issue15382] os.utime() mishandles some arguments

Arfrever Frehtes Taifersar Arahesis report at bugs.python.org
Tue Jul 17 23:02:38 CEST 2012


New submission from Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA at GMail.Com>:

Contrarily to documentation:

1. os.utime() accepts a tuple with floats passed by ns argument:
>>> os.utime(file, ns=(0.5, 0.5))
>>>

2. os.utime() does not accept explicit ns=None:
>>> os.utime(file, times=None)
>>> os.utime(file, ns=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: utime: 'ns' must be a tuple of two ints
>>>

3. os.utime() does not accept both times and ns when only times is a tuple:
>>> os.utime(file, times=None, ns=(0, 0))
>>> os.utime(file, times=(0, 0), ns=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: utime: you may specify either 'times' or 'ns' but not both
>>>

----------
messages: 165730
nosy: Arfrever, haypo, larry
priority: normal
severity: normal
status: open
title: os.utime() mishandles some arguments
versions: Python 3.3

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


More information about the New-bugs-announce mailing list