mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #27445: Don't pass str(_charset) to MIMEText.set_payload()
Patch by Claude Paroz.
This commit is contained in:
parent
82733fac8d
commit
2b2a9be913
3 changed files with 8 additions and 4 deletions
|
@ -1652,9 +1652,12 @@ class TestMIMEText(unittest.TestCase):
|
|||
eq(msg.get_charset().input_charset, 'us-ascii')
|
||||
eq(msg['content-type'], 'text/plain; charset="us-ascii"')
|
||||
# Also accept a Charset instance
|
||||
msg = MIMEText('hello there', _charset=Charset('utf-8'))
|
||||
charset = Charset('utf-8')
|
||||
charset.body_encoding = None
|
||||
msg = MIMEText('hello there', _charset=charset)
|
||||
eq(msg.get_charset().input_charset, 'utf-8')
|
||||
eq(msg['content-type'], 'text/plain; charset="utf-8"')
|
||||
eq(msg.get_payload(), 'hello there')
|
||||
|
||||
def test_7bit_input(self):
|
||||
eq = self.assertEqual
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue