summaryrefslogtreecommitdiffstats
path: root/Lib/email/test/test_email.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2011-03-15 16:20:02 (GMT)
committerR David Murray <rdmurray@bitdance.com>2011-03-15 16:20:02 (GMT)
commit56a9d7e3daff45f5fef206ea42398b4a0505fb47 (patch)
tree42f16713454d229e7b90122bb350eae90ca4550b /Lib/email/test/test_email.py
parentde3909da6b8d09b7bcb142994ebd6daba61a23d3 (diff)
downloadcpython-56a9d7e3daff45f5fef206ea42398b4a0505fb47.zip
cpython-56a9d7e3daff45f5fef206ea42398b4a0505fb47.tar.gz
cpython-56a9d7e3daff45f5fef206ea42398b4a0505fb47.tar.bz2
#11554: reactivate test_email_codecs, and make it pass.
The fix is to charset.py, which was not doing the encoding to the correct output character set when doing a body_encode for either the shift-jis or euc-jp charsets. There's also a fix for handling a bytes input in encoders.py. Patch by Michael Henry, comment changes by me.
Diffstat (limited to 'Lib/email/test/test_email.py')
-rw-r--r--Lib/email/test/test_email.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py
index f8bdaa2..a6ea1d1 100644
--- a/Lib/email/test/test_email.py
+++ b/Lib/email/test/test_email.py
@@ -3365,9 +3365,9 @@ class TestCharset(unittest.TestCase):
# built-in encodings where the header encoding is QP but the body
# encoding is not.
from email import charset as CharsetModule
- CharsetModule.add_charset('fake', CharsetModule.QP, None)
+ CharsetModule.add_charset('fake', CharsetModule.QP, None, 'utf-8')
c = Charset('fake')
- eq('hello w\xf6rld', c.body_encode('hello w\xf6rld'))
+ eq('hello world', c.body_encode('hello world'))
def test_unicode_charset_name(self):
charset = Charset('us-ascii')