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

Brian Brazil report at bugs.python.org
Sun Aug 8 16:53:11 CEST 2010


Brian Brazil <brian.brazil at gmail.com> added the comment:

Here's a quick test:

Python 3.2a1+ (py3k:83811, Aug  8 2010, 09:00:22) 
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, shutil
>>> open('a', 'w').write('a')
1
>>> open('b', 'w').write('b')
1
>>> os.chmod('b', 000)
>>> shutil.move('a', 'b')
>>> open('b').read()
'a'
>>> 

This is the correct behaviour on Unix, so I'd say this can be closed off.

----------
nosy: +bbrazil

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


More information about the Python-bugs-list mailing list