diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2010-03-22 20:03:59 (GMT) |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-03-22 20:03:59 (GMT) |
| commit | ab5a9997e0b83ee808ac0a83b846676ce91045ba (patch) | |
| tree | 89f9aab803f1f1acc507b7f7c39f0d3f59bc005f | |
| parent | 498c43866af3ae3496ae8d1aa8a8cfdc5b6a7866 (diff) | |
| download | cpython-ab5a9997e0b83ee808ac0a83b846676ce91045ba.zip cpython-ab5a9997e0b83ee808ac0a83b846676ce91045ba.tar.gz cpython-ab5a9997e0b83ee808ac0a83b846676ce91045ba.tar.bz2 | |
Merged revisions 79299 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79299 | antoine.pitrou | 2010-03-22 20:59:46 +0100 (lun., 22 mars 2010) | 5 lines
Issue #7512: shutil.copystat() could raise an OSError when the filesystem
didn't support chflags() (for example ZFS under FreeBSD). The error is
now silenced.
........
| -rw-r--r-- | Lib/shutil.py | 8 | ||||
| -rw-r--r-- | Misc/NEWS | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index cfb6646..4b62cbb 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -9,6 +9,7 @@ import sys import stat from os.path import abspath import fnmatch +import errno __all__ = ["copyfileobj","copyfile","copymode","copystat","copy","copy2", "copytree","move","rmtree","Error"] @@ -74,8 +75,11 @@ def copystat(src, dst): if hasattr(os, 'chmod'): os.chmod(dst, mode) if hasattr(os, 'chflags') and hasattr(st, 'st_flags'): - os.chflags(dst, st.st_flags) - + try: + os.chflags(dst, st.st_flags) + except OSError, why: + if not hasattr(errno, 'EOPNOTSUPP') or why.errno != errno.EOPNOTSUPP: + raise def copy(src, dst): """Copy data and mode bits ("cp src dst"). @@ -23,6 +23,10 @@ Core and Builtins Library ------- +- Issue #7512: shutil.copystat() could raise an OSError when the filesystem + didn't support chflags() (for example ZFS under FreeBSD). The error is + now silenced. + - Issue #3890: Fix recv() and recv_into() on non-blocking SSL sockets. - Issue #6544: fix a reference leak in the kqueue implementation's error |
