From: Rob Browning Date: Wed, 19 Jan 2011 05:51:06 +0000 (-0600) Subject: In _add_linux_attr(), catch IOError, not EnvironmentError; handle ENOTTY. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=35e6efa79a6e41bb7b13d05327787b0b1fb028a5;p=packages%2Fb%2Fbup.git In _add_linux_attr(), catch IOError, not EnvironmentError; handle ENOTTY. 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. --- diff --git a/lib/bup/metadata.py b/lib/bup/metadata.py index 17215ce..7cc843b 100644 --- a/lib/bup/metadata.py +++ b/lib/bup/metadata.py @@ -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