mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Port relevant patches for SF 1409455 to the trunk for email 3.0/Python 2.5.
Will port to Python 2.4.
This commit is contained in:
parent
a871ef2b3e
commit
e58df82919
5 changed files with 20 additions and 8 deletions
|
@ -250,11 +250,14 @@ class Message:
|
|||
charset=charset.get_output_charset())
|
||||
else:
|
||||
self.set_param('charset', charset.get_output_charset())
|
||||
if str(charset) <> charset.get_output_charset():
|
||||
self._payload = charset.body_encode(self._payload)
|
||||
if not self.has_key('Content-Transfer-Encoding'):
|
||||
cte = charset.get_body_encoding()
|
||||
try:
|
||||
cte(self)
|
||||
except TypeError:
|
||||
self._payload = charset.body_encode(self._payload)
|
||||
self.add_header('Content-Transfer-Encoding', cte)
|
||||
|
||||
def get_charset(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue