You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Charset instance not passed to set_payload() #71632
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=Noneclosed_at=<Date2016-09-08.16:43:04.342>created_at=<Date2016-07-02.21:13:07.583>labels= ['type-bug', 'expert-email']
title='Charset instance not passed to set_payload()'updated_at=<Date2016-09-08.16:59:30.868>user='https://bugs.python.org/claudep'
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.
Activity
claudep commentedon 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.
python-dev commentedon 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 commentedon Sep 8, 2016
Thanks for the patch, Claude.
claudep commentedon Sep 8, 2016
Thanks for pushing the patch!