This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymarc | |
from pymarc.exceptions import RecordLengthInvalid, RecordLeaderInvalid | |
from pymarc.exceptions import BaseAddressInvalid, BaseAddressNotFound | |
from pymarc.exceptions import RecordDirectoryInvalid, NoFieldsFound | |
class PermissiveMARCReader(pymarc.MARCReader): | |
"""PermissiveMARCReader: recovers from most pymarc exceptions""" | |
def __init__(self, marc_target, to_unicode=False, force_utf8=False, | |
hide_utf8_warnings=False, utf8_handling='strict'): | |
super(PermissiveMARCReader,self).__init__(marc_target, to_unicode, |