noembryo / KoHighlights

KOHighlights is a utility for viewing KOReader's highlights and/or export them to simple text, html, csv or markdown files.
MIT License
128 stars 5 forks source link

Error when exporting individual book files when a filename is too long #26

Closed ngm closed 1 year ago

ngm commented 1 year ago

Steps:

The interface can still be used, but the three progress dots continue to animate, and at the command line, I see the error:

IOError: [Errno 36] File name too long: "/home/neil/org/book-highlights/p2pmodels.eu - David Bollier_ \xe2\x80\x9cIn digital contexts, the whole social dimensions of the stewardship and curation of a Commons don't really get adequate attention\xe2\x80\x9d - P2P Models.txt"

And not all of the files are exported because it has got stuck on this one.

OS: Linux Mint KoHighlights: 1.5.0.0

noembryo commented 1 year ago

OK. "File name too long". A file system limitation (or at least a limitation in the way Qt accesses the file system).

What the program should do, is skip this error and continue with the export. To do that, I have to find out where in the code the error is happening, and warn the user about it.

Somewhere at the user part of the file system, (something like ~/.config/KOHighlights/), should be some error_log_2022-xx-xx.txt files that have the same error but with code line numbers. It would save me some time if you post them here. I will look at it anyway.. :pray:

ngm commented 1 year ago

Thanks! Sorry, should have pasted that full traceback earlier, here it is:

Original exception was:
Traceback (most recent call last):
  File "secondary.py", line 400, in on_export_btn_clicked
  File "main.py", line 2209, in on_export
  File "main.py", line 2227, in export
  File "main.py", line 2289, in save_multi_files
IOError: [Errno 36] File name too long: "/home/neil/org/book-highlights/p2pmodels.eu - David Bollier_ \xe2\x80\x9cIn digital contexts, the whole social dimensions of the stewardship and curation of a Commons don't really get adequate attention\xe2\x80\x9d - P2P Models.txt"
ngm commented 1 year ago

P.S. in the file error_log_2022-10-22.txt I just see the following:

Crash@2022-10-22 10:08:13

Crash@2022-10-22 10:30:52

The traceback above I copied from the command line output.

noembryo commented 1 year ago

Crash@2022-10-22 10:30:52

Yeah, worst logging ever.. :grin: (Actually there is no logging at all in the script, just a hack) Thanks for your info, though!

noembryo commented 1 year ago

Next version will have a fix for that.. :pray:

noembryo commented 1 year ago

Fixed (!) in v1.6.0.0.. :wink: