Commit e590a94e authored by bescoto's avatar bescoto

Catch ValueError if parsing corrupt mirror_metadata file


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@753 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 01274962
...@@ -269,7 +269,7 @@ class FlatExtractor: ...@@ -269,7 +269,7 @@ class FlatExtractor:
"""Return iterator that yields all objects with records""" """Return iterator that yields all objects with records"""
for record in self.iterate_records(): for record in self.iterate_records():
try: yield self.record_to_object(record) try: yield self.record_to_object(record)
except ParsingError, e: except (ParsingError, ValueError), e:
if self.at_end: break # Ignore whitespace/bad records at end if self.at_end: break # Ignore whitespace/bad records at end
log.Log("Error parsing flat file: %s" % (e,), 2) log.Log("Error parsing flat file: %s" % (e,), 2)
...@@ -314,7 +314,7 @@ class FlatExtractor: ...@@ -314,7 +314,7 @@ class FlatExtractor:
while 1: while 1:
next_pos = self.get_next_pos() next_pos = self.get_next_pos()
try: obj = self.record_to_object(self.buf[:next_pos]) try: obj = self.record_to_object(self.buf[:next_pos])
except ParsingError, e: except (ParsingError, ValueError), e:
log.Log("Error parsing metadata file: %s" % (e,), 2) log.Log("Error parsing metadata file: %s" % (e,), 2)
else: else:
if obj.index[:len(index)] != index: break if obj.index[:len(index)] != index: break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment