From cfa176685a5e788bafc7749d7a93f43ea3e4de9f Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Wed, 31 Mar 2021 18:49:41 +0900 Subject: Revert "bpo-43510: PEP 597: Accept `encoding="locale"` in binary mode (GH-25103)" (#25108) This reverts commit ff3c9739bd69aa8b58007e63c9e40e6708b4761e. --- Lib/test/test_io.py | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'Lib/test/test_io.py') diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 6a9ce39f08e..c731302a9f2 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -531,17 +531,6 @@ class IOTest(unittest.TestCase): self.assertRaises(OSError, obj.truncate) self.assertRaises(OSError, obj.truncate, 0) - def test_open_binmode_encoding(self): - """open() raises ValueError when encoding is specified in bin mode""" - self.assertRaises(ValueError, self.open, os_helper.TESTFN, - "wb", encoding="utf-8") - - # encoding=None and encoding="locale" is allowed. - with self.open(os_helper.TESTFN, "wb", encoding=None): - pass - with self.open(os_helper.TESTFN, "wb", encoding="locale"): - pass - def test_open_handles_NUL_chars(self): fn_with_NUL = 'foo\0bar' self.assertRaises(ValueError, self.open, fn_with_NUL, 'w') -- cgit v1.2.3