MCPcopy Create free account
hub / github.com/python/cpython / _set_locale_in_subprocess

Function _set_locale_in_subprocess

Lib/test/test_c_locale_coercion.py:89–96  ·  view source on GitHub ↗
(locale_name)

Source from the content-addressed store, hash-verified

87)
88
89def _set_locale_in_subprocess(locale_name):
90 cmd_fmt = "import locale; print(locale.setlocale(locale.LC_CTYPE, '{}'))"
91 if _check_nl_langinfo_CODESET:
92 # If there's no valid CODESET, we expect coercion to be skipped
93 cmd_fmt += "; import sys; sys.exit(not locale.nl_langinfo(locale.CODESET))"
94 cmd = cmd_fmt.format(locale_name)
95 result, py_cmd = run_python_until_end("-c", cmd, PYTHONCOERCECLOCALE='')
96 return result.rc == 0
97
98
99

Callers 1

setUpModuleFunction · 0.85

Calls 2

run_python_until_endFunction · 0.90
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…