bpo-47000: Make io.text_encoding() respects UTF-8 mode (GH-32003)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This commit is contained in:
Inada Naoki 2022-04-04 11:46:57 +09:00 committed by GitHub
parent 6db2db91b9
commit 4216dce04b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 52 additions and 17 deletions

View file

@ -161,7 +161,7 @@ class UTF8ModeTests(unittest.TestCase):
filename = __file__
out = self.get_output('-c', code, filename, PYTHONUTF8='1')
self.assertEqual(out, 'UTF-8/strict')
self.assertEqual(out.lower(), 'utf-8/strict')
def _check_io_encoding(self, module, encoding=None, errors=None):
filename = __file__
@ -183,10 +183,10 @@ class UTF8ModeTests(unittest.TestCase):
PYTHONUTF8='1')
if not encoding:
encoding = 'UTF-8'
encoding = 'utf-8'
if not errors:
errors = 'strict'
self.assertEqual(out, f'{encoding}/{errors}')
self.assertEqual(out.lower(), f'{encoding}/{errors}')
def check_io_encoding(self, module):
self._check_io_encoding(module, encoding="latin1")