Closed twobaker closed 1 year ago
I had the exact same problem right now. The culprit in my case was a single note whose creation date, as reported within EN 10, was Tuesday, 16 Dec 1969, 04:29
. This is clearly erroneous and some glitch in the EN database itself. Nevertheless, evernote-backup needs to handle bad creation (and other(?)) dates more gracefully. According to https://docs.python.org/3/library/datetime.html#datetime-objects, need to expect OverflowError or OSError for dates prior to 1970.
In my case, this one note was no longer useful, so I deleted it and expunged it from Trash in EN itself. Then, after a sync
to capture that change, exporting worked normally.
Thanks for a great tool!
Editing to add: I've kept an Evernote-Legacy exported .enex of the faulty note if helpful, but the only remarkable thing about it is the clearly corrupt <created>19691216T092941Z</created>
which is what makes fmt_time, line 14 choke.
I'm not running on a machine where I can try changing python code, but perhaps this special case, which is erroneous data within EN itself, could be simply caught with a try: ... except: return None
in fmt_time in note_formatter_util.py? This would match the None returned by if timestamp is None: return timestamp
on line 8.
It may be caused by an invalid timestamp (for me it's a negative timestamp). I fixed it in PR #48.
Alternatively, you can try...catch the OSError and simply ignore all cases.
Windows 7 x64, evernote-backup 1.9.3
$ evernote-backup
Usage: evernote-backup.exe [OPTIONS] COMMAND [ARGS]...
Try 'evernote-backup.exe --help' for help.
$ evernote-backup --single-notes export ./myfiles
Error: No such option: --single-notes
$ evernote-backup export --single-notes ./myfiles
Reading database en_backup.db...
Exporting notebooks...
[#################-------------------] 9/19 00:00:12
Traceback (most recent call last):
File "evernote_backup\cli.py", line 305, in main
File "click\core.py", line 1157, in __call__
File "click\core.py", line 1078, in main
File "click\core.py", line 1688, in invoke
File "click\core.py", line 1434, in invoke
File "click\core.py", line 783, in invoke
File "evernote_backup\cli.py", line 260, in export
File "evernote_backup\cli_app.py", line 160, in export
File "evernote_backup\note_exporter.py", line 64, in export_notebooks
File "evernote_backup\note_exporter.py", line 88, in _export_active
File "evernote_backup\note_exporter.py", line 97, in _export_notes
File "evernote_backup\note_exporter.py", line 115, in _output_single_notes
File "evernote_backup\note_exporter.py", line 128, in _write_export_file
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\...\\myfiles\\loooooong.enex'
Two failures here:
evernote-backup version
1.9.2
What OS are you using?
Windows
OS Version / Linux distribution
Windows 10
Bug description
Sync and auth works fine, but exporting notes give an error. Allways same notebook (8 from 91), no matter if single export or notebook export.
Log excerpt