summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httplib.py
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2021-04-29 02:34:56 (GMT)
committerGitHub <noreply@github.com>2021-04-29 02:34:56 (GMT)
commitfa51c0c448aca9fe5d4e8bc02e71de528931778b (patch)
tree7b4b48eb74450ef91c4c2bf68a7e4c0b9f9c7246 /Lib/test/test_httplib.py
parent8557edbfa8f74514de82feea4c62f5963e4e0aa7 (diff)
downloadcpython-fa51c0c448aca9fe5d4e8bc02e71de528931778b.zip
cpython-fa51c0c448aca9fe5d4e8bc02e71de528931778b.tar.gz
cpython-fa51c0c448aca9fe5d4e8bc02e71de528931778b.tar.bz2
bpo-43651: Fix EncodingWarning in tests. (GH-25655)
* test_httplib * test_httpservers * test_logging
Diffstat (limited to 'Lib/test/test_httplib.py')
-rw-r--r--Lib/test/test_httplib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index 438c2eb..db41e29 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -2084,9 +2084,9 @@ class RequestBodyTest(TestCase):
def test_text_file_body(self):
self.addCleanup(os_helper.unlink, os_helper.TESTFN)
- with open(os_helper.TESTFN, "w") as f:
+ with open(os_helper.TESTFN, "w", encoding="utf-8") as f:
f.write("body")
- with open(os_helper.TESTFN) as f:
+ with open(os_helper.TESTFN, encoding="utf-8") as f:
self.conn.request("PUT", "/url", f)
message, f = self.get_headers_and_fp()
self.assertEqual("text/plain", message.get_content_type())