Index: Lib/test/test_cookie.py =================================================================== --- Lib/test/test_cookie.py (revision 69615) +++ Lib/test/test_cookie.py (working copy) @@ -43,18 +43,20 @@ def test_load(self): C = Cookie.SimpleCookie() - C.load('Customer="WILE_E_COYOTE"; Version=1; Path=/acme') + C.load('Customer="WILE_E_COYOTE"; Version=1; Path=/acme; Comment="%s"' + % u'\N{BIOHAZARD SIGN}'.encode('UTF8')) self.assertEqual(C['Customer'].value, 'WILE_E_COYOTE') self.assertEqual(C['Customer']['version'], '1') self.assertEqual(C['Customer']['path'], '/acme') + self.assertEqual(C['Customer']['comment'], '\xe2\x98\xa3') self.assertEqual(C.output(['path']), 'Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme') self.assertEqual(C.js_output(), """ """) @@ -65,6 +67,8 @@ // end hiding --> """) + self.assertEqual(str(C), + 'Set-Cookie: Customer="WILE_E_COYOTE"; Comment="\\342\\230\\243"; Path=/acme; Version=1') def test_quoted_meta(self): # Try cookie with quoted meta-data