classification
Title: os.utime returns an error on NTFS-3G partition
Type: Stage:
Components: IO Versions: Python 2.6
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Aaron.Masover, loewis
Priority: normal Keywords:

Created on 2010-12-26 23:14 by Aaron.Masover, last changed 2010-12-27 00:29 by Aaron.Masover. This issue is now closed.

Messages (3)
msg124684 - (view) Author: Aaron Masover (Aaron.Masover) Date: 2010-12-26 23:14
I'm working with Anki (http://ankisrs.net/) on a linux NTFS-3G partition. Anki requires access to modification times in order to handle its backup files. This works fine on my ext3 partition, but on an NTFS partition accessed with NTFS-3G an error is returned:

youlun@yinghuochong:/storage/文件/anki/decks$ python -c 'import shutil,os; shutil.copyfile(u"\u6f22\u5b57.anki", "new.anki"); os.utime("new.anki", None)'
youlun@yinghuochong:/storage/文件/anki/decks$ python -c 'import shutil,os; shutil.copyfile(u"\u6f22\u5b57.anki", "new.anki"); os.utime("new.anki", (1293402264,1293402264))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
OSError: [Errno 1] Operation not permitted: 'new.anki'

Note that passing numbers into os.utime returns an error.
msg124687 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-12-26 23:59
Why do you think this is a bug in Python?
msg124689 - (view) Author: Aaron Masover (Aaron.Masover) Date: 2010-12-27 00:29
The Anki author suggested that it was a python bug. However, that example command works on a drive set with different permissions, so this looks more like an NTFS-3G bug.
History
Date User Action Args
2010-12-27 00:29:50Aaron.Masoversetstatus: open -> closed

messages: + msg124689
2010-12-26 23:59:23loewissetnosy: + loewis
messages: + msg124687
2010-12-26 23:14:19Aaron.Masovercreate