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

Exception generated in base.py when empty tags are manipulated as if they were strings #153

Open
seasidesparrow opened this issue Dec 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@seasidesparrow
Copy link
Member

Describe the bug
Parsing the JATS file /proj/ads/abstracts/data/IOPP/2024-11-19/0004-637X/0004-637X_976/0004-637X_976_1/0004-637X_976_1_119/apj_976_1_119.xml yields an exception because of a <sc/> tag in the abstract. base.py applies a modification to anything tagged as small caps by using .upper(), but in the case of an empty tag, it is trying to apply upper case to NoneType.

To Reproduce
Steps to reproduce the behavior:

Additional context
This can be fixed by checking for the existence of e.string in base.py L592, and only then apply .upper() if e.string is not None.

@seasidesparrow seasidesparrow added the bug Something isn't working label Dec 16, 2024
seasidesparrow added a commit to seasidesparrow/ADSIngestParser that referenced this issue Dec 16, 2024
 	modified:   adsingestp/parsers/base.py
 	new file:   tests/stubdata/input/jats_empty_smallcaps_tag_apj_976_1_119.xml
 	new file:   tests/stubdata/output/jats_empty_smallcaps_tag_apj_976_1_119.json
 	modified:   tests/test_jats.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant