mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25145)
* test_asyncio * test_bz2 * test_math * test_cmath * test_cmd_line * test_cmd_line_script * test_compile * test_contextlib * test_profile * ctypes/test/test_find * test_multiprocessing * test_configparser * test_csv * test_dbm_dumb * test_decimal * test_difflib * os.fdopen() calls io.text_encoding() to emit EncodingWarning for right place.
This commit is contained in:
parent
dc6d3e1e4c
commit
35715d1e72
19 changed files with 78 additions and 75 deletions
|
@ -2096,7 +2096,7 @@ class BaseLoopSockSendfileTests(test_utils.TestCase):
|
|||
|
||||
def test_nonbinary_file(self):
|
||||
sock = self.make_socket()
|
||||
with open(os_helper.TESTFN, 'r') as f:
|
||||
with open(os_helper.TESTFN, encoding="utf-8") as f:
|
||||
with self.assertRaisesRegex(ValueError, "binary mode"):
|
||||
self.run_loop(self.loop.sock_sendfile(sock, f))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue