Skip to content

Preserve control-flow exceptions when joining pointer parts - #91

Merged
stefankoegl merged 1 commit into
stefankoegl:masterfrom
muneikh:fix-pointer-join-interruptions
Oct 11, 2026
Merged

stefankoegl merged 1 commit into
stefankoegl:masterfrom
muneikh:fix-pointer-join-interruptions

Conversation

@muneikh

@muneikh muneikh commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

JsonPointer.join() accepts an iterable of path components. Its bare exception handler also catches KeyboardInterrupt, SystemExit, and GeneratorExit raised by that iterable, replacing them with JsonPointerException("Invalid suffix"). This prevents cancellation and process termination from reaching the caller.

Catch ordinary Exception instances so invalid suffixes keep the existing error behavior while control-flow exceptions propagate unchanged. Regression tests cover all three exception types and verify object identity. The new cases fail before the change; the complete suite passes afterward (48 tests, 13 subtests). flake8 jsonpointer.py tests.py passes.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.917%. remained the same — muneikh:fix-pointer-join-interruptions into stefankoegl:master

@stefankoegl
stefankoegl merged commit 86b82bf into stefankoegl:master Oct 11, 2026
13 checks passed
@stefankoegl

Copy link
Copy Markdown
Owner

Good catch, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants