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.

classification
Title: os.utime(file, (0,0,)) fails on on vfat, but doesn't fail immediately
Type: behavior Stage: resolved
Components: Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Damien.Elmes, lambacck, pitrou
Priority: normal Keywords: patch

Created on 2010-02-05 16:07 by Damien.Elmes, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
win_utime.patch pitrou, 2010-02-05 17:26
win_utime_updated.patch lambacck, 2010-11-21 03:07 Updated patch to apply to current py3k branch.
Messages (5)
msg98879 - (view) Author: Damien Elmes (Damien.Elmes) Date: 2010-02-05 16:07
It seems like you can't set a modtime of 0 on a vfat partition. This may not be a valid thing to do, but it took me a long time to figure out it was a bad thing, as the error doesn't appear until the next time the error flag is checked:

>>> os.utime("testfile", (0.0,0.0))
>>> import time
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
WindowsError: [Error 87] The parameter is incorrect
msg98887 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-02-05 17:26
Looks like a missing "goto done" in posix_utime(), posixmodule.c, line 2805. Could you test the following patch?
msg98888 - (view) Author: Damien Elmes (Damien.Elmes) Date: 2010-02-05 17:33
I'm afraid I don't have a Windows build environment handy, but a quick look at the function in question seems to indicate that is the problem. Thanks for the quick reply!
msg121846 - (view) Author: Chris Lambacher (lambacck) * Date: 2010-11-21 03:07
win_utime.patch does not apply cleanly on the py3k branch. Adapted, as in the attached win_utime_updated.patch, the solution does fix the problem.

I have not added a test because I don't know how to deal with the fat32 requirement in order to cause failure, though I did test before and after applying the test on fat32 locally.
msg125577 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-01-06 18:31
Committed in r87802 (3.2), r87803 (3.1) and r87804 (2.7). Will watch the buildbots.
History
Date User Action Args
2022-04-11 14:56:57adminsetgithub: 52106
2011-01-06 20:07:37pitrousetstatus: pending -> closed
nosy: pitrou, lambacck, Damien.Elmes
2011-01-06 18:31:31pitrousetstatus: open -> pending
versions: - Python 2.6
nosy: pitrou, lambacck, Damien.Elmes
messages: + msg125577

resolution: fixed
stage: needs patch -> resolved
2010-11-21 03:07:52lambaccksetfiles: + win_utime_updated.patch
nosy: + lambacck
messages: + msg121846

2010-02-05 17:33:30Damien.Elmessetmessages: + msg98888
2010-02-05 17:26:59pitrousetfiles: + win_utime.patch
priority: normal
type: behavior

versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.5
keywords: + patch
nosy: + pitrou

messages: + msg98887
stage: needs patch
2010-02-05 16:07:37Damien.Elmescreate