Skip to content

Commit fcde7d1

Browse files
committed
Slightly expand the allowed KNOWN_LABEL_ENDINGS
1 parent 4de50c7 commit fcde7d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pdr/parselabel/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
KNOWN_LABEL_ENDINGS = (
7-
re.compile(b"\nEND {0,2}(\r| {8})"), # common PVL convention
7+
re.compile(b"\nEND {0,8}(\r| {8})"), # common PVL convention
88
re.compile(b"\x00{3}"), # just null bytes, for odder cases
99
)
1010
"""
@@ -29,7 +29,7 @@ def _scan_to_end_of_label(
2929
if (chunk := buf.read(50 * 1024)) == b'':
3030
break
3131
for ending in KNOWN_LABEL_ENDINGS:
32-
if (endmatch := re.search(ending, text[:-15] + chunk)) is not None:
32+
if (endmatch := re.search(ending, chunk)) is not None:
3333
return text + chunk[: endmatch.span()[1]]
3434
text, length = text + chunk, length + 50 * 1024
3535
if raise_no_ending is True:

0 commit comments

Comments
 (0)