vzhd1701/enex2notion

[Bug]: Could not import notes >1800

sst1xx opened this issue · 2 comments

enex2notion version

enex2notion 0.2.24

What OS are you using?

MacOS

OS Version / Linux distribution

macOS 13.01

Bug description

Could you help me to understand what's wrong with import please?
I can import a short Notebook (~39 notes) but cannot to do the same for 1864 notes.
Tested with brew and pip as well.

Log excerpt

INFO: Creating 'Evernote ENEX Import' page...
INFO: Processing notebook 'Evernote'...
Traceback (most recent call last):
  File "/usr/local/bin/enex2notion", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 32, in cli
    _process_input(enex_uploader, args.enex_input)
  File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 42, in _process_input
    enex_uploader.upload_notebook(path)
  File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli_upload.py", line 53, in upload_notebook
    self.notebook_notes_count = count_notes(enex_file)
                                ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/enex_parser.py", line 23, in count_notes
    return sum(iter_process_xml_elements(enex_file, "note", lambda e: 1))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/enex_parser_xml.py", line 23, in iter_process_xml_elements
    for event, elem in context:
  File "/usr/local/Cellar/python@3.11/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/xml/etree/ElementTree.py", line 1249, in iterator
    yield from pullparser.read_events()
  File "/usr/local/Cellar/python@3.11/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/xml/etree/ElementTree.py", line 1320, in read_events
    raise event
  File "/usr/local/Cellar/python@3.11/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/xml/etree/ElementTree.py", line 1292, in feed
    self._parser.feed(data)
xml.etree.ElementTree.ParseError: mismatched tag: line 812329, column 2

Seems like one of the notes in that enex file is malformed. You can open the enex file in text editor that shows lines, navigate to line 812329 and track back to the note's title.

@vzhd1701 Vlad thank you so much for this advice. U r absolutely right. Issue was connected with malformed notes from Google Notebook. I deleted all incorrect notes and migration has been started. Also thanks for this awesome software.