Skip to content

Fix bare except clause in msgpack/fallback.py#714

Closed
koteshyelamati wants to merge 1 commit into
msgpack:mainfrom
koteshyelamati:main
Closed

Fix bare except clause in msgpack/fallback.py#714
koteshyelamati wants to merge 1 commit into
msgpack:mainfrom
koteshyelamati:main

Conversation

@koteshyelamati

Copy link
Copy Markdown

Replace bare except: with except Exception: in the pack() method's buffer reset handler.

Bare except: catches BaseException (including SystemExit and KeyboardInterrupt), which means pressing Ctrl+C during a pack operation would silently reset the buffer instead of propagating the interrupt. Using except Exception: preserves the buffer-reset behavior for actual serialization errors while allowing KeyboardInterrupt and SystemExit to propagate normally.

Catch specific exceptions during packing to improve error handling.
@methane

methane commented Jul 15, 2026

Copy link
Copy Markdown
Member

I use raise. It propagate exception.

@methane methane closed this Jul 15, 2026
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.

2 participants