[meld/meld-3-12] misc: Ignore ENOTSUP when copying file metadata



commit 23b8078103bc257ef091400a10540321b0527f19
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Nov 9 08:34:21 2014 +1000

    misc: Ignore ENOTSUP when copying file metadata
    
    This error will be thrown when, for example, trying to copy files to
    an FTP mount. Getting this error is a very strong indication that
    doing this metadata modification on this location will *never* work,
    so there's not a lot of point in showing the user an error.

 meld/misc.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/meld/misc.py b/meld/misc.py
index 5bed516..f6530e8 100644
--- a/meld/misc.py
+++ b/meld/misc.py
@@ -322,7 +322,7 @@ def copy2(src, dst):
     try:
         shutil.copystat(src, dst)
     except OSError as e:
-        if e.errno != errno.EPERM:
+        if e.errno not in (errno.EPERM, errno.ENOTSUP):
             raise
 
 def copytree(src, dst):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]