Skip to content

email.utils.encode_rfc2231(string, None, None) returns broken value #85014

Open

Description

@spaceone
mannequin
BPO 40837
Nosy @warsaw, @orsenthil, @bitdancer, @maxking, @spaceone
PRs
  • gh-85014: Fix email.utils.encode_rfc2231(string, None, None) #20564
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2020-06-01.02:17:05.810>
    labels = ['type-bug', 'library', 'expert-email', '3.10']
    title = 'email.utils.encode_rfc2231(string, None, None) returns broken value'
    updated_at = <Date 2020-06-05.04:08:13.869>
    user = 'https://github.com/spaceone'

    bugs.python.org fields:

    activity = <Date 2020-06-05.04:08:13.869>
    actor = 'xtreak'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)', 'email']
    creation = <Date 2020-06-01.02:17:05.810>
    creator = 'spaceone'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40837
    keywords = []
    message_count = 2.0
    messages = ['370526', '370670']
    nosy_count = 5.0
    nosy_names = ['barry', 'orsenthil', 'r.david.murray', 'maxking', 'spaceone']
    pr_nums = ['20564']
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue40837'
    versions = ['Python 3.10']

    Activity

    1. spaceone commented on Jun 1, 2020

      spaceonemannequin
      MannequinAuthor

      encode_rfc2231() must not change the returned value if no transformation of the input was done.
      This is also mentioned in the docstring of that function.

      Actual behavior:
      encode_rfc2231('foo bar', None, None)
      'foo%20bar'

      Expected behavior:
      encode_rfc2231('foo bar', None, None)
      'foo bar'

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Jun 1, 2020
    3. orsenthil commented on Jun 3, 2020

      @orsenthil
      Member

      This will be a breaking change to the clients relying on current broken behavior, setting the fix version to 3.10 (current active).

    4. transferred this issue fromon Apr 10, 2022
    5. added
      3.15bugs and security fixes
      and removed on Apr 8, 2026
    6. spaceone commented on Jun 3, 2026

      @spaceone
      ContributorAuthor

      NEWS entry written.
      CLA is signed.
      → PR #20564 is ready to go.

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

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.15bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-emailtype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions