You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2013-10-06.16:57:21.793>created_at=<Date2012-06-30.19:55:23.278>labels= ['type-feature', 'docs']
title='os.utime() docs not clear on behavior on nonexistant files'updated_at=<Date2013-10-06.16:57:21.792>user='https://bugs.python.org/dewin'
"Set the access and modified times of the file specified by path. [...] The effect is similar to running the Unix program touch on the path.)"
Unlike 'touch', os.utime() will not create an empty file if called on a file that does not exist. IMO the current behavior is correct, but the comparison of os.utime() to touch implies that it would create empty files.
I suggest clarifying the documentation to emphasize that os.utime() will not create new files and raises OSError in the event that the file does not exist.
New changeset 62321359c35b by Georg Brandl in branch '3.3':
Closes bpo-15228: remove reference to Unix "touch"; it is confusing since the path needs to exist for os.utime() to succeed http://hg.python.org/cpython/rev/62321359c35b
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: