summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-03-22 20:11:09 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-03-22 20:11:09 (GMT)
commit910bd51ea1baef3ea0b4c9f1e3d2d150108368c5 (patch)
treeb3f8922640c37b1f4ec53a2f257a524d9954bafe /Lib
parentca2edce67695b73e21a64a352632feedc08ccf29 (diff)
downloadcpython-910bd51ea1baef3ea0b4c9f1e3d2d150108368c5.zip
cpython-910bd51ea1baef3ea0b4c9f1e3d2d150108368c5.tar.gz
cpython-910bd51ea1baef3ea0b4c9f1e3d2d150108368c5.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. ........
Diffstat (limited to 'Lib')
-rw-r--r--Lib/shutil.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 2ddeb2a..98b7ea0 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -11,6 +11,7 @@ from os.path import abspath
import fnmatch
from warnings import warn
import collections
+import errno
try:
from pwd import getpwnam
@@ -105,8 +106,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").