Skip to content
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

Inconsistent behavior of email.header.decode_header #81320

Closed
louisabraham mannequin opened this issue Jun 3, 2019 · 4 comments
Closed

Inconsistent behavior of email.header.decode_header #81320

louisabraham mannequin opened this issue Jun 3, 2019 · 4 comments
Labels
topic-email type-bug An unexpected behavior, bug, or error

Comments

@louisabraham
Copy link
Mannequin

louisabraham mannequin commented Jun 3, 2019

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 = 'louis.abraham@yahoo.fr'
    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', 'louis.abraham@yahoo.fr']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '24797'
    type = 'behavior'
    url = 'https://bugs.python.org/issue37139'
    versions = []

    @louisabraham
    Copy link
    Mannequin Author

    louisabraham mannequin commented Jun 3, 2019

    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.

    @SilentGhost
    Copy link
    Mannequin

    SilentGhost mannequin commented Jun 3, 2019

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

    @SilentGhost SilentGhost mannequin added the topic-email label Jun 3, 2019
    @SilentGhost SilentGhost mannequin closed this as completed Jun 3, 2019
    @SilentGhost SilentGhost mannequin added the type-bug An unexpected behavior, bug, or error label Jun 3, 2019
    @louisabraham
    Copy link
    Mannequin Author

    louisabraham mannequin commented Jun 3, 2019

    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?

    @SilentGhost
    Copy link
    Mannequin

    SilentGhost mannequin commented Jun 3, 2019

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

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    topic-email type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants