diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-03-22 20:12:40 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-03-22 20:12:40 (GMT) |
commit | 9f274b1fab8b8ebd6d555dd99d75ebc9bb1f91bd (patch) | |
tree | 4bf52db1d4c42be64becbf2373bcef047c8490f9 /Lib/shutil.py | |
parent | a06bfd87da41d0a8810b3fd911d7b93ebdaa8ded (diff) | |
download | cpython-9f274b1fab8b8ebd6d555dd99d75ebc9bb1f91bd.zip cpython-9f274b1fab8b8ebd6d555dd99d75ebc9bb1f91bd.tar.gz cpython-9f274b1fab8b8ebd6d555dd99d75ebc9bb1f91bd.tar.bz2 |
Merged revisions 79301 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r79301 | antoine.pitrou | 2010-03-22 21:11:09 +0100 (lun., 22 mars 2010) | 11 lines
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.
........
................
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r-- | Lib/shutil.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index dc36820..78504b9 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", "SpecialFileError"] @@ -88,8 +89,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 as why: + if not hasattr(errno, 'EOPNOTSUPP') or why.errno != errno.EOPNOTSUPP: + raise def copy(src, dst): """Copy data and mode bits ("cp src dst"). |