Ver Fonte

seeking to an invalid position is an IOError in python 3.2

python >= 3.3 raises OSError in this case.
Thomas Waldmann há 9 anos atrás
pai
commit
7e5d30f41a
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      borg/repository.py

+ 1 - 1
borg/repository.py

@@ -529,7 +529,7 @@ class LoggedIO:
         with open(filename, 'rb') as fd:
             try:
                 fd.seek(-self.header_fmt.size, os.SEEK_END)
-            except OSError as e:
+            except (IOError, OSError) as e:
                 # return False if segment file is empty or too small
                 if e.errno == errno.EINVAL:
                     return False