mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +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
|
@ -656,9 +656,8 @@ class SysModuleTest(unittest.TestCase):
|
|||
|
||||
def c_locale_get_error_handler(self, locale, isolated=False, encoding=None):
|
||||
# Force the POSIX locale
|
||||
env = os.environ.copy()
|
||||
env = dict(os.environ)
|
||||
env["LC_ALL"] = locale
|
||||
env["PYTHONCOERCECLOCALE"] = "0"
|
||||
code = '\n'.join((
|
||||
'import sys',
|
||||
'def dump(name):',
|
||||
|
@ -668,7 +667,10 @@ class SysModuleTest(unittest.TestCase):
|
|||
'dump("stdout")',
|
||||
'dump("stderr")',
|
||||
))
|
||||
args = [sys.executable, "-X", "utf8=0", "-c", code]
|
||||
args = [sys.executable,
|
||||
"-X", "utf8=0",
|
||||
"-X", "coerce_c_locale=0",
|
||||
"-c", code]
|
||||
if isolated:
|
||||
args.append("-I")
|
||||
if encoding is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue