mcs07 / ChemDataExtractor

Automatically extract chemical information from scientific documents
http://chemdataextractor.org
MIT License
287 stars 112 forks source link

import error: HTMLParser in Python 3 #7

Closed gorgitko closed 7 years ago

gorgitko commented 7 years ago

In Python 3 is HTMLParser in html.parser

So to prevent import error I had to change in cli/dict.py:

line 16: import HTMLParser from html.parser import HTMLParser line 27: pars = HTMLParser.HTMLParser() pars = HTMLParser()

mcs07 commented 7 years ago

Thanks for the report. This should be fixed by #6. I'll hopefully push a new version to PyPI this evening.

gorgitko commented 7 years ago

Just one more thing (I don't want to make new ticket for that):

cli/__init__.py line 55: jsonstring = json.dumps(records, indent=2, ensure_ascii=False).decode('utf-8')

This prevents the AttributeError: 'str' object has no attribute 'decode'