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

Fix #41 (set charset of messages part of a multipart/alternative message correctly) #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

WuShell
Copy link

@WuShell WuShell commented Feb 20, 2019

More info in the commit including the fix.
Tests pass.
Ok?

(thanks!)

Fixes the bug described here: repoze#41

Rationale:

get_content_charset() has been there in email.message.Message for a long
time now, returning the charset of the body of the Message (which is what we
are looking for there).

get_charset() has been deprecated for some time now, returns None by default
(even if a charset is set in the Content-Type header).

There are some other ways to retrieve the charset (get_params(),
get_param('charset'), message['Content-Type'].params) but get_content_charset()
is the only one that exists through all existing python versions, and it is
there even in the new email.message.EmailMessage class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant