Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.

Commit 7741c4d

Browse files
committed
MARCMaker error
Now pymarc will at least complain about the record length being invalid rather than throwing a ValueError because it can't convert =LDR into an integer.
1 parent 7e2a01f commit 7741c4d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pymarc/reader.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ def __next__(self):
8787
if len(first5) < 5:
8888
raise RecordLengthInvalid
8989

90-
length = int(first5)
90+
try:
91+
length = int(first5)
92+
except ValueError:
93+
raise RecordLengthInvalid
94+
9195
chunk = self.file_handle.read(length - 5)
9296
chunk = first5 + chunk
9397
record = Record(chunk,

0 commit comments

Comments
 (0)