From 7f0946298ea2e2b70a1981a3898cf4faf052ef63 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Mon, 18 Nov 2019 06:31:42 -0800 Subject: Replaced encode() usage with bytes literals. --- tests/httpwrappers/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/httpwrappers') diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py index 0c81cd0341..bafdd2891c 100644 --- a/tests/httpwrappers/tests.py +++ b/tests/httpwrappers/tests.py @@ -294,7 +294,7 @@ class HttpResponseTests(unittest.TestCase): # ASCII strings or bytes values are converted to strings. r['key'] = 'test' self.assertEqual(r['key'], 'test') - r['key'] = 'test'.encode('ascii') + r['key'] = b'test' self.assertEqual(r['key'], 'test') self.assertIn(b'test', r.serialize_headers()) @@ -334,7 +334,7 @@ class HttpResponseTests(unittest.TestCase): # Bug #20889: long lines trigger newlines to be added to headers # (which is not allowed due to bug #10188) h = HttpResponse() - f = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz a\xcc\x88'.encode('latin-1') + f = b'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz a\xcc\x88' f = f.decode('utf-8') h['Content-Disposition'] = 'attachment; filename="%s"' % f # This one is triggering https://bugs.python.org/issue20747, that is Python -- cgit v1.3