Skip to content

gh-157880: Write visible headers of BabylMessage in mailbox.Babyl - #157881

Open
vasiliyk wants to merge 1 commit into
python:mainfrom
vasiliyk:gh-157880-babyl
Open

vasiliyk wants to merge 1 commit into
python:mainfrom
vasiliyk:gh-157880-babyl

Conversation

@vasiliyk

@vasiliyk vasiliyk commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

When adding a BabylMessage, Babyl._install_message() flattens its visible headers into a BytesIO and copies them line by line into the mailbox file. The buffer was never rewound after flattening, so readline() returned nothing and the visible headers block and the blank line after it were skipped.
Reading the message back with get_message() or get_bytes() then consumed the body as headers and failed with AssertionError.

Rewind the buffer before reading it, and add a test that adds a BabylMessage with visible headers and reads it back.

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