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

drugbank_xml_to_sql.py 'NoneType' has no attribute 'rstrip' #95

Open
svanschalkwyk opened this issue Feb 22, 2017 · 2 comments
Open

drugbank_xml_to_sql.py 'NoneType' has no attribute 'rstrip' #95

svanschalkwyk opened this issue Feb 22, 2017 · 2 comments

Comments

@svanschalkwyk
Copy link

$ python drugbank_xml_to_sql.py

Traceback (most recent call last):
File "drugbank_xml_to_sql.py", line 263, in
temp_mesh_ids = m.text.rstrip().split(", ")
AttributeError: 'NoneType' object has no attribute 'rstrip'

@svanschalkwyk
Copy link
Author

Fixing it: {http://www.drugbank.ca}category == Blood and Blood Forming Organs

@svanschalkwyk
Copy link
Author

Fix: starting @ line 260
if(m.tag == '{http://www.drugbank.ca}category'):
CATEGORY_NAME = m.text.rstrip().replace('\n', '\n').replace('\r', '\r').replace('|', '|')
if(m.tag == '{http://www.drugbank.ca}mesh-id'):
if(m.text != None):
temp_mesh_ids = m.text.rstrip().split(", ")
for index in range(len(temp_mesh_ids)):
mesh_ids.append((temp_mesh_ids[index]).replace('[', '').replace(']', ''))

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