Author prikryl
Recipients
Date 2005-02-21.09:02:55
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Hi,

The shutil.copystat() may fail in case when the 
destination file has read-only attribute. It's because the 
implementation calls the os.utime() first and os.chmod() 
later. In Windows (I am not sure if also in Unix-based 
system), the os.utime() fails for read-only files. 

The implementation should ensure the read/write access 
by " try: os.chmod(dst, 0600)..." before calling the 
os.utime(). The file mode will be copied from the source 
file in the next step anyway. The simplistic test 
attached (Unix line ending used inside the tst.py zipped 
inside).

Petr
History
Date User Action Args
2007-08-23 14:29:39adminlinkissue1145257 messages
2007-08-23 14:29:39admincreate