-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
MIMEText __init__ does not support Charset instance #60528
Comments
When initializing a MIMEText instance, it might be desirable to set the _charset parameter to a real Charset instance, not only a charset identifier (for example to pass a Charset with customized body_encoding). Unfortunately, this is failing: File ".../django/core/mail/message.py", line 128, in __init__ It is possible to later call set_charset, but the payload is already encoded (and 'Content-Transfer-Encoding' is set). |
I don't think you missed anything. It doesn't look like this has ever worked, but you'd certainly think it would. The documentation doesn't claim anything about it one way or another. That probably means we should treat it as an enhancement rather than a bug fix, but I'm open to argument on that. |
It's fine for me to consider it as an enhancement. The fix might be as simple as replacing **{'charset': _charset} by **{'charset': str(charset)} in MIMEText __init_. |
Here's an updated patch. |
The updated patch looks good to me. Go ahead and commit it. |
New changeset d43d4d4ebf2c by Berker Peksag in branch 'default': |
Thanks for the patch, Claude and thanks for the review, David! |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: