Issue1145257
Created on 2005-02-21 09:02 by prikryl, last changed 2009-03-20 21:43 by ajaksu2.
|
msg24358 - (view) |
Author: Petr Prikryl (prikryl) |
Date: 2005-02-21 09:02 |
|
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
|
|
msg24359 - (view) |
Author: Thomas Waldmann (thomaswaldmann) |
Date: 2007-03-24 19:06 |
|
See http://sourceforge.net/tracker/index.php?func=detail&aid=1666318&group_id=5470&atid=105470 for another problem with utime() on win32/nt with directories.
|
|
| Date |
User |
Action |
Args |
| 2009-03-20 21:43:50 | ajaksu2 | set | dependencies:
+ shutil.copytree doesn't preserve directory permissions type: behavior stage: test needed versions:
+ Python 2.6, Python 3.0, - Python 2.4 |
| 2005-02-21 09:02:55 | prikryl | create | |
|