Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4fdff7 commit 10ee7a7Copy full SHA for 10ee7a7
1 file changed
Lib/email/test/test_email.py
@@ -2307,6 +2307,17 @@ def test_utf8_shortest(self):
2307
h = Header(u'\u83ca\u5730\u6642\u592b', 'utf-8')
2308
eq(h.encode(), '=?utf-8?b?6I+K5Zyw5pmC5aSr?=')
2309
2310
+ def test_bad_8bit_header(self):
2311
+ raises = self.assertRaises
2312
+ eq = self.assertEqual
2313
+ x = 'Ynwp4dUEbay Auction Semiar- No Charge \x96 Earn Big'
2314
+ raises(UnicodeError, Header, x)
2315
+ h = Header()
2316
+ raises(UnicodeError, h.append, x)
2317
+ eq(str(Header(x, errors='replace')), x)
2318
+ h.append(x, errors='replace')
2319
+ eq(str(h), x)
2320
+
2321
2322
2323
# Test RFC 2231 header parameters (en/de)coding
0 commit comments