Repository navigation
Translate SearchIterator C++ exceptions - #297
Open
chapmanjacobd wants to merge 2 commits into
Open
chapmanjacobd wants to merge 2 commits into
chapmanjacobd wants to merge 2 commits into
Conversation
Declare all SearchIterator getters with Cython exception translation so stale full-text references become Python errors instead of aborting the interpreter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
@chapmanjacobd why are you fixing only these 4 methods? I feel like we miss the Please also add a succint entry in CHANGELOG.md |
Author
|
Well each one adds a little bit of overhead. I think it makes sense to not be 100% exhaustive. But I'll add a few more where the operations are large and where they are likely needed the most and add a changelog entry. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
Also removed |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The Cython declarations for
zim::SearchIteratorgetters omitexcept +. If a stale full-text index references an entry that is no longer present, iterating search results letszim::EntryNotFoundescape through the CPython evaluation loop and abort the process.I reproduced this with the streetzim
osm-hawaii-2026-09-26.zimarchive and querya;Archive.check()returns true, but the native iterator aborts.Change
Add Cython exception translation to search-result getters and iteration, archive-entry iteration, suggestion iteration, entry title/redirect properties, and query setters. Exceptions from these calls become catchable Python exceptions rather than escaping into CPython.
Remove unnecessary exception translation from the simple
Blob.data(),end(), andsize()accessors. Add a minimal changelog entry.Validation
pytest -qpassed (210 tests, 5 warnings); rebuilding and rerunning the stale-index reproducer raisedRuntimeError: Cannot find entryinstead of aborting.