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

Charset instance not passed to set_payload() #71632

Closed
claudep mannequin opened this issue Jul 2, 2016 · 4 comments
Closed

Charset instance not passed to set_payload() #71632

claudep mannequin opened this issue Jul 2, 2016 · 4 comments
Labels
topic-email type-bug An unexpected behavior, bug, or error

Comments

@claudep
Copy link
Mannequin

claudep mannequin commented Jul 2, 2016

BPO 27445
Nosy @warsaw, @bitdancer, @berkerpeksag
Files
  • issue27445.diff
  • 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 2016-09-08.16:43:04.342>
    created_at = <Date 2016-07-02.21:13:07.583>
    labels = ['type-bug', 'expert-email']
    title = 'Charset instance not passed to set_payload()'
    updated_at = <Date 2016-09-08.16:59:30.868>
    user = 'https://bugs.python.org/claudep'

    bugs.python.org fields:

    activity = <Date 2016-09-08.16:59:30.868>
    actor = 'claudep'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-09-08.16:43:04.342>
    closer = 'berker.peksag'
    components = ['email']
    creation = <Date 2016-07-02.21:13:07.583>
    creator = 'claudep'
    dependencies = []
    files = ['43614']
    hgrepos = []
    issue_num = 27445
    keywords = ['patch']
    message_count = 4.0
    messages = ['269740', '275061', '275062', '275066']
    nosy_count = 5.0
    nosy_names = ['barry', 'r.david.murray', 'python-dev', 'berker.peksag', 'claudep']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue27445'
    versions = ['Python 3.5', 'Python 3.6']

    @claudep
    Copy link
    Mannequin Author

    claudep mannequin commented Jul 2, 2016

    In issue bpo-16324, I contributed an improvement so as MIMEText __init__ accept Charset instances, not only encoding strings. The use case is from Django where we customize the Charset.body_encoding before passing it to the MIMEText initialization.

    Unfortunately, what I didn't notice when Berker adapted my patch is that the Charset is casted to its string representation for the whole method, while I initially intended to let the unchanged Charset passed to self.set_payload. And the test I suggested was not smart enough to detect that.

    @claudep claudep mannequin added the topic-email label Jul 2, 2016
    @berkerpeksag berkerpeksag added the type-bug An unexpected behavior, bug, or error label Sep 7, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 8, 2016

    New changeset 4f6fef83cd0c by Berker Peksag in branch '3.5':
    Issue bpo-27445: Don't pass str(_charset) to MIMEText.set_payload()
    https://hg.python.org/cpython/rev/4f6fef83cd0c

    New changeset c5cb8bd335ae by Berker Peksag in branch 'default':
    Issue bpo-27445: Merge from 3.5
    https://hg.python.org/cpython/rev/c5cb8bd335ae

    @berkerpeksag
    Copy link
    Member

    Thanks for the patch, Claude.

    @claudep
    Copy link
    Mannequin Author

    claudep mannequin commented Sep 8, 2016

    Thanks for pushing the patch!

    @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

    1 participant