Skip to content

gh-135854: Fix function email.message.Message.get_boundary strips boundaries twice #135891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tanloong
Copy link
Contributor

@tanloong tanloong commented Jun 24, 2025

email.message.get_boundary() invokes email.message.get_param() and utils.collapse_rfc2231_value(), causing boundaries being stripped twice. This PR passes unquote=False to email.message.get_param() to avoid the redundant stripping.

def test_boundary_stripped_only_once(self):
eq = self.assertEqual
msg = email.message_from_string('''\
MIME-Version: 1.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please properly indent this string block?

eq(len(msg.get_payload()), 2)

msg = email.message_from_string('''\
MIME-Version: 1.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also this

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.

3 participants