KoHighlights icon indicating copy to clipboard operation
KoHighlights copied to clipboard

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

Open ngm opened this issue 3 years ago • 5 comments

Steps:

  • Mount Kobo e-reader (that is running koreader)
  • Start KoHighlights from command line
  • Scan Directory (/media/user/KOBOeReader/)
  • Select all files in list with Ctrl-A
  • Ctrl-S to Export selected highlights
  • Select 'As individual book files'

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

ngm avatar Oct 22 '22 09:10 ngm

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:

noembryo avatar Oct 22 '22 11:10 noembryo

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 avatar Oct 22 '22 15:10 ngm

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.

ngm avatar Oct 22 '22 15:10 ngm

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 avatar Oct 22 '22 15:10 noembryo

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

noembryo avatar Oct 22 '22 16:10 noembryo

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

noembryo avatar Nov 24 '22 14:11 noembryo