gh-91156: Use locale.getencoding() instead of getpreferredencoding (GH-91732)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Inada Naoki 2022-04-22 10:39:24 +09:00 committed by GitHub
parent efe7fd4170
commit 1317b70f89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 29 additions and 44 deletions

View file

@ -216,7 +216,7 @@ class CmdLineTest(unittest.TestCase):
code = (
b'import locale; '
b'print(ascii("' + undecodable + b'"), '
b'locale.getpreferredencoding())')
b'locale.getencoding())')
p = subprocess.Popen(
[sys.executable, "-c", code],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,