Merge branch 'merge' into merge-all

This commit is contained in:
Thomas Waldmann 2015-03-20 02:35:03 +01:00
commit d2c2b9a67c
2 changed files with 4 additions and 2 deletions

View file

@ -613,7 +613,9 @@ class ArchiveChecker:
continue
try:
archive = msgpack.unpackb(data)
except Exception:
# Ignore exceptions that might be raised when feeding
# msgpack with invalid data
except (TypeError, ValueError, StopIteration):
continue
if isinstance(archive, dict) and b'items' in archive and b'cmdline' in archive:
self.report_progress('Found archive ' + archive[b'name'].decode('utf-8'), error=True)

View file

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