eliascotto / export-kobo

A Python tool to export annotations and highlights from a Kobo SQLite file. Now with web UI.
MIT License
26 stars 2 forks source link

Error on file SQL file from Kobo Libra Colour: Could not decode to UTF-8 column 'ExtraAnnotationData' with text '' #4

Closed steeltrap closed 3 months ago

steeltrap commented 4 months ago

When using the script with a KoboReader.sqlite file from a Kobo Libra Colour, the program returns the following error:

Could not decode to UTF-8 column 'ExtraAnnotationData' with text ''

This is fixed by adding a single line after the sql connection is opened (current line 630):

sql_connection.text_factory = lambda b: b.decode(errors = 'ignore')

This may be bad practice (as errors are ignored) but program then functions as expected.

Thank you for a useful tool!

eliascotto commented 4 months ago

Hey, thanks for reporting the issue.

I checked the code and it seems that ExtraAnnotationData wasn't used at all, so it has possibly been removed in the next software version. That's probably what's causing the issue.

I removed the column in this PR #5 . Would you mind checking with your device to see if it's working correctly now?