[issue1076515] shutil.move clobbers read-only files.

Antoine Pitrou report at bugs.python.org
Mon Sep 13 16:01:40 CEST 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

I agree that this follows Unix behaviour: a read-only file is a file whose contents cannot be modified, but you can replace it with another totally different file. You can also delete it, by the way (*).

Also, even if this weren't the desired behaviour, changing it would break compatibility for existing scripts.

(*)

>>> open('b', 'w').write('b')
1
>>> os.chmod('b', 000)
>>> os.remove('b')
>>> open('b', 'r')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IOError: [Errno 2] No such file or directory: 'b'

----------
nosy: +pitrou

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


More information about the Python-bugs-list mailing list