From 1eab261b3034100afed6e2b4ea2303641176eb93 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Wed, 23 Nov 2022 21:59:42 +0000 Subject: fix bugs made visible by py 3.11 --- parsers/logbooks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'parsers/logbooks.py') 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*(?:

)?(.*?)(.*)$(?i)", trippara) + s = re.match(r"(?i)(?s)\s*(?:

)?(.*?)(.*)$", 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) -- cgit v1.2.3