fix bugs made visible by py 3.11

This commit is contained in:
2022-11-23 21:59:42 +00:00
parent b06d1dae42
commit 1eab261b30
8 changed files with 84 additions and 28 deletions

View File

@@ -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)