edsu / pymarc

process MARC records from Python
http://python.org/pypi/pymarc
Other
253 stars 98 forks source link

Backslash is printed in MARC file if the indicator is a space #102

Closed terrywmc closed 7 years ago

terrywmc commented 7 years ago

I have discovered that if the field object detect the indicator is a space, it will be converted as '\\'

for indicator in self.indicators: if indicator in (' ','\'): text += '\' else: text += '%s' % indicator

The "\" will be printed in the MARC file, another library such as Perl's MARC::Record will trigger it as an invalid indicator.

edsu commented 7 years ago

This logic is only relevant for the MARCMaker format, or when you print a record as a string. Is this what you are doing? MARCMaker/Breaker says, or really shows that you need to use a backslash instead of a space.