← Back to team overview

pymarc-team team mailing list archive

[Bug 400881] [NEW] Error when parsing possible invalid marc indicators

 

Public bug reported:

I'm occasionally getting an error from line 157 in record.py (pymarc 2.33) where the indicator is being parsed from a list. Would it be possible to instead place those in the Field constructor on line 165 as:
indicators = subs[0][0:2] so that errors in the indicator can be handled in user code instead of crashing the parsing of the record completely?

This would also require a change to the field class in Field.py. Instead of parsing out a magic number of indicators (line 40):
self.indicators = indicators
for i in range(0,len(self.indicators)):
  setattr(self,'indicator%s' % (str(i+1)),self.indicators[i])

** Affects: pymarc
     Importance: Undecided
         Status: New

-- 
Error when parsing possible invalid marc indicators
https://bugs.launchpad.net/bugs/400881
You received this bug notification because you are a member of pymarc-
team, which is the registrant for pymarc.

Status in pymarc: New

Bug description:
I'm occasionally getting an error from line 157 in record.py (pymarc 2.33) where the indicator is being parsed from a list. Would it be possible to instead place those in the Field constructor on line 165 as:
indicators = subs[0][0:2] so that errors in the indicator can be handled in user code instead of crashing the parsing of the record completely?

This would also require a change to the field class in Field.py. Instead of parsing out a magic number of indicators (line 40):
self.indicators = indicators
for i in range(0,len(self.indicators)):
  setattr(self,'indicator%s' % (str(i+1)),self.indicators[i])



Follow ups

References