Merge pull request #621 from languitar/fix-620

Handle dateparse exceptions for invalid date formats
This commit is contained in:
Pit
2020-05-19 19:04:28 +02:00
committed by GitHub
2 changed files with 20 additions and 4 deletions

View File

@@ -108,7 +108,7 @@ class DocumentParser:
try:
date = __parser(date_string, self.FILENAME_DATE_ORDER)
except TypeError:
except (TypeError, ValueError):
# Skip all matches that do not parse to a proper date
continue
@@ -134,7 +134,7 @@ class DocumentParser:
try:
date = __parser(date_string, self.DATE_ORDER)
except TypeError:
except (TypeError, ValueError):
# Skip all matches that do not parse to a proper date
continue