()
| 180 | CLI_COERCION_WARNING = None |
| 181 | |
| 182 | def setUpModule(): |
| 183 | global AVAILABLE_TARGETS |
| 184 | global CLI_COERCION_TARGET |
| 185 | global CLI_COERCION_WARNING |
| 186 | |
| 187 | if AVAILABLE_TARGETS is not None: |
| 188 | # initialization already done |
| 189 | return |
| 190 | AVAILABLE_TARGETS = [] |
| 191 | |
| 192 | # Find the target locales available in the current system |
| 193 | for target_locale in _C_UTF8_LOCALES: |
| 194 | if _set_locale_in_subprocess(target_locale): |
| 195 | AVAILABLE_TARGETS.append(target_locale) |
| 196 | |
| 197 | if AVAILABLE_TARGETS: |
| 198 | # Coercion is expected to use the first available target locale |
| 199 | CLI_COERCION_TARGET = AVAILABLE_TARGETS[0] |
| 200 | CLI_COERCION_WARNING = CLI_COERCION_WARNING_FMT.format(CLI_COERCION_TARGET) |
| 201 | |
| 202 | if support.verbose: |
| 203 | print(f"AVAILABLE_TARGETS = {AVAILABLE_TARGETS!r}") |
| 204 | print(f"EXPECTED_C_LOCALE_EQUIVALENTS = {EXPECTED_C_LOCALE_EQUIVALENTS!r}") |
| 205 | print(f"EXPECTED_C_LOCALE_STREAM_ENCODING = {EXPECTED_C_LOCALE_STREAM_ENCODING!r}") |
| 206 | print(f"EXPECTED_C_LOCALE_FS_ENCODING = {EXPECTED_C_LOCALE_FS_ENCODING!r}") |
| 207 | print(f"EXPECT_COERCION_IN_DEFAULT_LOCALE = {EXPECT_COERCION_IN_DEFAULT_LOCALE!r}") |
| 208 | print(f"_C_UTF8_LOCALES = {_C_UTF8_LOCALES!r}") |
| 209 | print(f"_check_nl_langinfo_CODESET = {_check_nl_langinfo_CODESET!r}") |
| 210 | |
| 211 | |
| 212 | class _LocaleHandlingTestCase(unittest.TestCase): |
nothing calls this directly
no test coverage detected
searching dependent graphs…