Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError when mapping 5XX fields #68

Open
CaptSolo opened this issue May 18, 2020 · 1 comment
Open

AttributeError when mapping 5XX fields #68

CaptSolo opened this issue May 18, 2020 · 1 comment

Comments

@CaptSolo
Copy link
Contributor

Program fails with an AttributeError when mapping 5XX fields in case if subfield "4" is not present:

  File "virtual-env/to-SKOS/lib/python3.7/site-packages/mc2skos/record.py", line 597, in __init__
    super(AuthorityRecord, self).__init__(record, options)
  File "virtual-env/to-SKOS/lib/python3.7/site-packages/mc2skos/record.py", line 70, in __init__
    self.parse(options or {})
  File "virtual-env/to-SKOS/lib/python3.7/site-packages/mc2skos/record.py", line 691, in parse
    elif sf_w == 'r' and is_uri(sf_4):
  File "virtual-env/to-SKOS/lib/python3.7/site-packages/mc2skos/util.py", line 2, in is_uri
    return value.startswith('http://') or value.startswith('https://')
AttributeError: 'NoneType' object has no attribute 'startswith'

Would it be possible to "fall back" to some default scheme (e.g. the scheme supplied in cmd line parameters) instead of failing with error in cases when subfield "0" does not have a URI and there is no subfield "4"?

@CaptSolo
Copy link
Contributor Author

Example MARC XML data file attached.

150_record-2.txt

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

No branches or pull requests

1 participant