Skip to content

gh-156312: Prevent mailbox.MH replacement failures from corrupting messages - #156313

Open
lpyu001 wants to merge 4 commits into
python:mainfrom
lpyu001:fix-mailbox-bug-156312
Open

lpyu001 wants to merge 4 commits into
python:mainfrom
lpyu001:fix-mailbox-bug-156312

Conversation

@lpyu001

@lpyu001 lpyu001 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Make mailbox.MH.__setitem__() failure-atomic by writing replacements to a temporary file before replacing the original. Failed serialization now leaves the existing message unchanged.

…ing messages

Make `mailbox.MH.__setitem__()` failure-atomic by writing replacements to a temporary file before replacing the original. Failed serialization now leaves the existing message unchanged.
Serialize the replacement to a temporary file before overwriting the existing MH message, so invalid input or input read errors leave the original message unchanged.

Co-Authored-By: lipengyu <lipengyu@kylinos.cn>
@lpyu001
lpyu001 marked this pull request as ready for review September 13, 2026 04:29
@lpyu001 lpyu001 closed this Sep 23, 2026
@lpyu001
lpyu001 deleted the fix-mailbox-bug-156312 branch September 23, 2026 02:54
@lpyu001
lpyu001 restored the fix-mailbox-bug-156312 branch September 23, 2026 03:05
@lpyu001 lpyu001 reopened this Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant