diff options
author | Inada Naoki <songofacandy@gmail.com> | 2021-04-29 02:34:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 02:34:56 (GMT) |
commit | fa51c0c448aca9fe5d4e8bc02e71de528931778b (patch) | |
tree | 7b4b48eb74450ef91c4c2bf68a7e4c0b9f9c7246 /Lib/test/test_httplib.py | |
parent | 8557edbfa8f74514de82feea4c62f5963e4e0aa7 (diff) | |
download | cpython-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.py | 4 |
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()) |