mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
bpo-34589: Add -X coerce_c_locale command line option (GH-9378)
Add a new -X coerce_c_locale command line option to control C locale coercion (PEP 538).
This commit is contained in:
parent
7a0791b699
commit
dbdee0073c
8 changed files with 160 additions and 52 deletions
|
@ -27,6 +27,8 @@ class UTF8ModeTests(unittest.TestCase):
|
|||
return (loc in POSIX_LOCALES)
|
||||
|
||||
def get_output(self, *args, failure=False, **kw):
|
||||
# Always disable the C locale coercion (PEP 538)
|
||||
args = ('-X', 'coerce_c_locale=0', *args)
|
||||
kw = dict(self.DEFAULT_ENV, **kw)
|
||||
if failure:
|
||||
out = assert_python_failure(*args, **kw)
|
||||
|
@ -116,7 +118,6 @@ class UTF8ModeTests(unittest.TestCase):
|
|||
# PYTHONLEGACYWINDOWSFSENCODING disables the UTF-8 mode
|
||||
# and has the priority over -X utf8 and PYTHONUTF8
|
||||
out = self.get_output('-X', 'utf8', '-c', code,
|
||||
PYTHONUTF8='strict',
|
||||
PYTHONLEGACYWINDOWSFSENCODING='1')
|
||||
self.assertEqual(out, 'mbcs/replace')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue