Skip to content

fix: preserve process control exceptions in RSS and Atom conversion - #2652

Open
InfinityJMB (jblanc86-maker) wants to merge 2 commits into
microsoft:mainfrom
jblanc86-maker:fix/rss-process-control-exceptions
Open

InfinityJMB (jblanc86-maker) wants to merge 2 commits into
microsoft:mainfrom
jblanc86-maker:fix/rss-process-control-exceptions

Conversation

@jblanc86-maker

Copy link
Copy Markdown

RSS/Atom detection and HTML rendering currently catch BaseException. This silently turns KeyboardInterrupt and SystemExit into an unsupported-format result or unconverted content, preventing these signals from reaching the caller.

Catch Exception in the two generic handlers instead. XML detection still restores the stream position in finally; ordinary parse/render failures and the dedicated RecursionError fallback retain their behavior.

Validation

  • Added nine regression cases to the existing RSS suite: six cancellation/exit cases and three ordinary-error controls.
  • Before the production fix: six cases failed with DID NOT RAISE; all three controls passed.
  • After the fix: python -m pytest tests/test_rss.py -q — 173 passed on Python 3.12.14.
  • pre-commit run --all-files and git diff --check passed.
  • The full multi-format test suite was not run.

AI assistance: ChatGPT was used to investigate the issue and prepare the patch and tests.

Catch Exception in the two generic RSS handlers so KeyboardInterrupt and SystemExit reach the caller. Preserve stream-position cleanup and ordinary parsing/rendering fallbacks.
Add cancellation/exit regressions for XML detection and RSS/Atom rendering, plus ordinary-error and stream-position controls. All 173 RSS/Atom tests pass on Python 3.12.14.
@jblanc86-maker

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

1 participant