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

Py3: can't print record with raw fields #88

Open
Wooble opened this issue Mar 9, 2016 · 2 comments
Open

Py3: can't print record with raw fields #88

Wooble opened this issue Mar 9, 2016 · 2 comments

Comments

@Wooble
Copy link
Collaborator

Wooble commented Mar 9, 2016

pymarc.field.Field.__str__() uses native str as the arguments to self.data.replace, but in a RawField, data is a bytes object, so we get TypeError: 'str' does not support the buffer interface

RawField should probably have its own implementation of __str__, although it's unclear to me how we should represent a field with an unknown encoding as text...

@cclauss
Copy link
Contributor

cclauss commented Dec 5, 2018

Is this issue resolved?

@Wooble
Copy link
Collaborator Author

Wooble commented Dec 6, 2018

It's not, and looking deeper into it I can't see a good way to represent an arbitrary byte in MarcBreaker (http://www.loc.gov/marc/makrbrkr.html#mechanics) format especially since "" means "space" in the 00x fields, so "\x" doesn't work. Of course, these fields should be all ASCII, but the whole point of RawField is that sometimes they're not in the real world.

I suppose I could see how MarcEdit treats such a pathological record.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants