ports/149005: [patch] fix EOPNOTSUPP for copy2/copystat in python2.6
John Hein
jhein at symmetricom.com
Tue Jul 27 19:50:04 UTC 2010
The following reply was made to PR ports/149005; it has been noted by GNATS.
From: John Hein <jhein at symmetricom.com>
To: FreeBSD-gnats-submit at FreeBSD.org,
freebsd-ports-bugs at FreeBSD.org
Cc:
Subject: Re: ports/149005: [patch] fix EOPNOTSUPP for copy2/copystat in python2.6
Date: Tue, 27 Jul 2010 13:44:38 -0600
--mZzHroiXY0
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit
Updated patch fixes the filename paths so 'make patch' works...
--mZzHroiXY0
Content-Type: text/plain; name="patch-copystat"
Content-Description: patch-copystat
Content-Disposition: inline;
filename="patch-copystat"
Content-Transfer-Encoding: 7bit
# $FreeBSD$
Work around 'Operation not supported' issues when using copystat()
(and copy2() which calls copystat()) to a filesystem destination
that does not support chflags(2) (e.g., nfs, zfs).
http://bugs.python.org/issue7512
This has already been applied upstream and 2.7 has it already.
http://svn.python.org/view/python/branches/release26-maint/Lib/shutil.py?view=diff&pathrev=79300&r1=79299&r2=79300
Also affects mercurial...
http://www.selenic.com/pipermail/mercurial/2010-March/030716.html
--- Lib/shutil.py.orig 2009-01-29 13:30:51.000000000 -0700
+++ Lib/shutil.py 2010-07-27 11:17:45.000000000 -0600
@@ -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").
--mZzHroiXY0--
More information about the freebsd-ports-bugs
mailing list