Fix unpacking errors triggered by _embed_annotations in get_bookmarks() and get_highlights() functions #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When using the
_embed_annotations, users may run into unpacking errors in theget_bookmarks()andget_highlights()functions insidesioyek.py.These functions expect a fixed number of columns returned by SQLite queries. However, on some systems (e.g., Arch Linux with Python 3.12+), the database may return extra columns due to schema changes or environment-specific differences.
This can trigger errors like:
ValueError: too many values to unpack (expected 4)ValueError: too many values to unpack (expected 8)These issues break the
_embed_annotationsfeature, which depends on both functions to extract highlights and bookmarks.What this PR does
*_) to capture only the needed fields_embed_annotationsmore reliable across environmentsTesting
_embed_annotationsworks correctly after adding highlights and bookmarkspipon Python 3.12embed_annotations.pyruns successfully