diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2022-11-23 21:59:42 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2022-11-23 21:59:42 +0000 |
commit | 1eab261b3034100afed6e2b4ea2303641176eb93 (patch) | |
tree | 278b1aba70e265a9a8e3833276a8cf53b52ab5bc /parsers/logbooks.py | |
parent | b06d1dae4222cdb6e50fef629967bc76625b52e9 (diff) | |
download | troggle-1eab261b3034100afed6e2b4ea2303641176eb93.tar.gz troggle-1eab261b3034100afed6e2b4ea2303641176eb93.tar.bz2 troggle-1eab261b3034100afed6e2b4ea2303641176eb93.zip |
fix bugs made visible by py 3.11
Diffstat (limited to 'parsers/logbooks.py')
-rw-r--r-- | parsers/logbooks.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/parsers/logbooks.py b/parsers/logbooks.py index 08112dd..bf7039d 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -362,7 +362,7 @@ def parser_html_01(year, expedition, txt): # print(f" #0 - tid: {tid}") try: #print(f" #1 - tid: {tid}") - s = re.match(r"(?s)\s*(?:<p>)?(.*?)</?p>(.*)$(?i)", trippara) + s = re.match(r"(?i)(?s)\s*(?:<p>)?(.*?)</?p>(.*)$", trippara) if not s: message = " ! - Skipping logentry {year} failure to parse header: " + tid + trippara[:300] + "..." DataIssue.objects.create(parser='logbooks', message=message) @@ -449,6 +449,7 @@ def parser_html_01(year, expedition, txt): logdataissues[tid]=message print(message) errorcount += 1 + raise if errorcount >5 : message = f" !!- TOO MANY ERRORS - aborting at '{tid}' logbook: {year}" DataIssue.objects.create(parser='logbooks', message=message) |