Workaround for bugs in VObject during filtering

This commit is contained in:
Unrud
2017-06-09 02:30:51 +02:00
committed by Unrud
parent db572e91f8
commit 12871fdcb3
2 changed files with 30 additions and 10 deletions

View File

@ -1034,8 +1034,19 @@ class Collection(BaseCollection):
ctext = vobject_item.serialize()
cetag = get_etag(ctext)
try:
ctag, cstart, cend = xmlutils.find_tag_and_time_range(
vobject_item)
try:
ctag, cstart, cend = xmlutils.find_tag_and_time_range(
vobject_item)
except xmlutils.VObjectBugException as e:
# HACK: Extraction of metadata failed, because of bugs in
# VObject.
self.logger.warning(
"Failed to find tag and time range of item %r from %r "
"(Bug in VObject): %s", href, self.path, e,
exc_info=True)
ctag = xmlutils.find_tag(vobject_item)
cstart = xmlutils.TIMESTAMP_MIN
cend = xmlutils.TIMESTAMP_MAX
except Exception as e:
raise RuntimeError("Failed to find tag and time range of item "
"%r from %r: %s" % (href, self.path,