Skip to content

gh-153823: Unquoted apostrop#153842

Closed
palakkhinvasara wants to merge 6 commits into
python:mainfrom
palakkhinvasara:unquoted-apostrop
Closed

gh-153823: Unquoted apostrop#153842
palakkhinvasara wants to merge 6 commits into
python:mainfrom
palakkhinvasara:unquoted-apostrop

Conversation

@palakkhinvasara

Copy link
Copy Markdown
Contributor

#153823
Fix parsing of unquoted apostrophes in MIME parameter values

Bug description

The email package with policy.default incorrectly fails to parse MIME parameters containing an unquoted apostrophe.

For example:

import email
import email.policy

msg = email.message_from_string(
    "Content-Disposition: attachment; filename=O'Brien.pdf\n\n",
    policy=email.policy.default,
)

msg.get_filename()

@palakkhinvasara
palakkhinvasara requested a review from a team as a code owner July 17, 2026 12:57
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jul 17, 2026
@bedevere-app

bedevere-app Bot commented Jul 17, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app

bedevere-app Bot commented Jul 17, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@python-cla-bot

python-cla-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@read-the-docs-community

read-the-docs-community Bot commented Jul 17, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33633892 | 📁 Comparing 04d7620 against main (abdd7ae)

  🔍 Preview build  

2 files changed
± library/functions.html
± whatsnew/changelog.html

@palakkhinvasara palakkhinvasara changed the title Unquoted apostrop issue 153823 Unquoted apostrop Jul 17, 2026
@eendebakpt eendebakpt changed the title issue 153823 Unquoted apostrop gh-153823: Unquoted apostrop Jul 17, 2026
eq(subpart.get_filename(), 'dingusfish.gif')


def test_unquoted_apostrophe_in_parameter(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@palakkhinvasara I see no code changes in the PR. Have you missed some changes perhaps?

Comment thread Doc/library/functions.rst Outdated
(technically speaking, a condition list) using the *globals* and *locals*
mappings as global and local namespace. If the *globals* dictionary is
present and does not contain a value for the key ``__builtins__``, a
using the *globals* and *locals* mappings as global and local namespace.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change seems to be #153808, not related to the '.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants