mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25189)
* Fix _sitebuiltins * Fix test_inspect * Fix test_interpreters * Fix test_io * Fix test_iter * Fix test_json * Fix test_linecache * Fix test_lltrace * Fix test_logging * Fix logging
This commit is contained in:
parent
f84d5a1136
commit
fb78692f2a
11 changed files with 73 additions and 63 deletions
|
@ -2601,8 +2601,8 @@ class TextIOWrapperTest(unittest.TestCase):
|
|||
self.assertEqual(t.encoding, "utf-8")
|
||||
self.assertEqual(t.line_buffering, True)
|
||||
self.assertEqual("\xe9\n", t.readline())
|
||||
self.assertRaises(TypeError, t.__init__, b, newline=42)
|
||||
self.assertRaises(ValueError, t.__init__, b, newline='xyzzy')
|
||||
self.assertRaises(TypeError, t.__init__, b, encoding="utf-8", newline=42)
|
||||
self.assertRaises(ValueError, t.__init__, b, encoding="utf-8", newline='xyzzy')
|
||||
|
||||
def test_uninitialized(self):
|
||||
t = self.TextIOWrapper.__new__(self.TextIOWrapper)
|
||||
|
@ -3732,7 +3732,7 @@ class CTextIOWrapperTest(TextIOWrapperTest):
|
|||
r = self.BytesIO(b"\xc3\xa9\n\n")
|
||||
b = self.BufferedReader(r, 1000)
|
||||
t = self.TextIOWrapper(b, encoding="utf-8")
|
||||
self.assertRaises(ValueError, t.__init__, b, newline='xyzzy')
|
||||
self.assertRaises(ValueError, t.__init__, b, encoding="utf-8", newline='xyzzy')
|
||||
self.assertRaises(ValueError, t.read)
|
||||
|
||||
t = self.TextIOWrapper.__new__(self.TextIOWrapper)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue