]> arthur.barton.de Git - bup.git/commitdiff
In _add_linux_attr(), catch IOError, not EnvironmentError; handle ENOTTY.
authorRob Browning <rlb@defaultvalue.org>
Wed, 19 Jan 2011 05:51:06 +0000 (23:51 -0600)
committerRob Browning <rlb@defaultvalue.org>
Wed, 19 Jan 2011 05:51:11 +0000 (23:51 -0600)
In _add_linux_attr(), when calling get_linux_file_attr(), catch
IOError, not EnvironmentError and handle ENOTTY (call add_error()).
ENOTTY can indicate that the underlying ioctl (FS_IOC_GETFLAGS) is
inappropriate.

lib/bup/metadata.py

index 17215ce993cdce3ce223cabeb19260ff3a463642..7cc843bf3dc064e79cb6c8e55860be297a43c28e 100644 (file)
@@ -413,9 +413,11 @@ class Metadata:
                 attr = get_linux_file_attr(path)
                 if(attr != 0):
                     self.linux_attr = get_linux_file_attr(path)
-            except EnvironmentError, e:
+            except IOError, e:
                 if e.errno == errno.EACCES:
                     add_error('read Linux attr: %s' % e)
+                elif e.errno == errno.ENOTTY: # Inappropriate ioctl for device.
+                    add_error('read Linux attr: %s' % e)
                 else:
                     raise