hotfix: fix bug in append start read implementation

This commit is contained in:
Justus Kuhlmann 2025-11-10 08:11:15 +00:00
commit 4f63bc4f4c

View file

@ -632,6 +632,7 @@ def _check_append_rep(content, start_list):
def _read_chunk_structure(chunk, pattern, b2b): def _read_chunk_structure(chunk, pattern, b2b):
start_read = 0
for linenumber, line in enumerate(chunk): for linenumber, line in enumerate(chunk):
if line.startswith("gauge_name"): if line.startswith("gauge_name"):
gauge_line = linenumber gauge_line = linenumber
@ -643,8 +644,8 @@ def _read_chunk_structure(chunk, pattern, b2b):
if re.search(pattern, found_pat): if re.search(pattern, found_pat):
start_read = corr_line + 7 + b2b start_read = corr_line + 7 + b2b
break break
else: if start_read == 0:
raise ValueError("Did not find pattern\n", pattern) raise ValueError("Did not find pattern\n", pattern)
endline = corr_line + 6 + b2b endline = corr_line + 6 + b2b
while not chunk[endline] == "\n": while not chunk[endline] == "\n":
endline += 1 endline += 1