diff -r 4207e9a39b78 Lib/shutil.py --- a/Lib/shutil.py Tue Dec 15 03:25:27 2009 +0000 +++ b/Lib/shutil.py Tue Dec 15 15:25:31 2009 +0800 @@ -9,6 +9,7 @@ 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 @@ 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").