mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
bpo-43651: Fix EncodingWarning in tests. (GH-25655)
* test_httplib * test_httpservers * test_logging
This commit is contained in:
parent
8557edbfa8
commit
fa51c0c448
3 changed files with 21 additions and 17 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue