Skip to content

Inconsistent behavior of email.header.decode_header #81320

Closed

Description

@louisabraham
BPO 37139
Nosy @warsaw, @bitdancer, @louisabraham
Superseder
  • bpo-24797: email.header.decode_header return type is not consistent
  • 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 = <Date 2019-06-03.09:30:24.645>
    created_at = <Date 2019-06-03.08:52:55.361>
    labels = ['type-bug', 'expert-email']
    title = 'Inconsistent behavior of email.header.decode_header'
    updated_at = <Date 2019-06-03.16:09:16.404>
    user = 'https://github.com/louisabraham'

    bugs.python.org fields:

    activity = <Date 2019-06-03.16:09:16.404>
    actor = 'SilentGhost'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-06-03.09:30:24.645>
    closer = 'SilentGhost'
    components = ['email']
    creation = <Date 2019-06-03.08:52:55.361>
    creator = '[email protected]'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37139
    keywords = []
    message_count = 4.0
    messages = ['344392', '344396', '344400', '344439']
    nosy_count = 4.0
    nosy_names = ['barry', 'r.david.murray', 'SilentGhost', '[email protected]']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '24797'
    type = 'behavior'
    url = 'https://bugs.python.org/issue37139'
    versions = []

    Activity

    1. louisabraham commented on Jun 3, 2019

      louisabrahammannequin
      MannequinAuthor

      Hi,

      (this is my first issue btw)

      I think <https://docs.python.org/3/library/email.header.html#email.header.decode_header\> has a broken behavior.

      It returns a list of (decoded_string, charset) pairs. However, decoded_string can be either a string or bytes.
      I have no preference but it should really be of one type.

    2. SilentGhost commented on Jun 3, 2019

      SilentGhostmannequin
      Mannequin

      This seem like a duplicate of bpo-24797. I hope the answer given there applies.

    3. louisabraham commented on Jun 3, 2019

      louisabrahammannequin
      MannequinAuthor

      Indeed, this is exactly the same (I should have researched more, my bad).

      The problem is that I'm using mailbox.Maildir which uses the Compat32 API.

      Do you think I should create an issue for Maildir to support the new EmailMessage API?

    4. SilentGhost commented on Jun 3, 2019

      SilentGhostmannequin
      Mannequin

      There seems to be some work started in bpo-32975. Perhaps, you'd like to revive it or contribute otherwise?

    5. transferred this issue fromon Apr 10, 2022
    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

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions