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

XML parse error #11

Closed
dskrad opened this issue Jan 24, 2021 · 2 comments
Closed

XML parse error #11

dskrad opened this issue Jan 24, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@dskrad
Copy link

dskrad commented Jan 24, 2021

I am on Windows 10 using Windows Subsystem for Linux, Python 3.8. I installed evernote-to-sqlite via pipx (in a venv). I tried using enex files from the latest version of Evernote for Windows (10.6.9 which only lets you export 50 notes at a time) and from Legacy Evernote (6.25.2.9198 which lets you export all your notes at once). The enex file from latest evernote gives this error:

File "/usr/lib/python3.8/xml/etree/ElementTree.py", line 1320, in XML parser.feed(text)
xml.etree.ElementTree.ParseError: XML or text declaration not at start of entity: line 2, column 6

The enex file from Legacy Evernote gives this error:

File "/home/david/.local/pipx/venvs/evernote-to-sqlite/lib/python3.8/site-packages/evernote_to_sqlite/utils.py", line 28, in save_note
updated = note.find("updated").text
AttributeError: 'NoneType' object has no attribute 'text'
@dskrad
Copy link
Author

dskrad commented Feb 11, 2021

I solved this issue by modifying line 31 of utils.py

content = ET.tostring(ET.fromstring(content_xml.strip())).decode("utf-8")

@simonw simonw added the bug Something isn't working label Feb 11, 2021
@simonw simonw closed this as completed in 44e58ba Feb 11, 2021
@simonw
Copy link
Contributor

simonw commented Feb 11, 2021

Thanks for the fix!

simonw added a commit that referenced this issue Feb 11, 2021
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

2 participants