Skip to content

Fix pack_map_pairs recovery after packing errors - #745

Open
mikamikasuki wants to merge 1 commit into
msgpack:mainfrom
mikamikasuki:fix/pack-map-pairs-recovery
Open

mikamikasuki wants to merge 1 commit into
msgpack:mainfrom
mikamikasuki:fix/pack-map-pairs-recovery

Conversation

@mikamikasuki

Copy link
Copy Markdown

Problem: Packer.pack_map_pairs() retains partial output when a serializer callback raises, so the next successful call can return corrupted data.

Fix: Clear the buffer after packing errors in both the C extension and Python fallback, matching Packer.pack(). Preserve the original exception.

Validation: 147 native tests and 144 fallback tests passed. Regression coverage checks both autoreset modes, recovery, and successful buffered streams. Ruff, formatting, and package builds passed.

This branch has not been deployed

No deployments
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