Quellcode durchsuchen

seeking to an invalid position is an IOError in python 3.2

python >= 3.3 raises OSError in this case.
Thomas Waldmann vor 9 Jahren
Ursprung
Commit
7e5d30f41a
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      borg/repository.py

+ 1 - 1
borg/repository.py

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