summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_c_locale_coercion.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-41700: Skip test if the locale is not supported (GH-22081)Dong-hee Na2020-09-041-1/+4
|
* bpo-31904: Fix test_c_locale_coercion encodings for VxWorks RTOS (GH-19448)pxinwr2020-04-091-0/+4
|
* bpo-37335, test_c_locale_coercion: Remove unnecessary code (GH-14447)Jakub Kulík2019-07-021-19/+5
| | | | | | Python initialization now ensures that sys stream encoding names are always normalized by codecs.lookup(encoding).name. Simplify test_c_locale_coercion: it doesn't have to normalize encoding names anymore.
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-011-5/+2
|
* bpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806)Victor Stinner2018-11-301-2/+26
| | | | Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the C locale if the LC_CTYPE locale is "C".
* bpo-35290: Add debug info to test_c_locale_coercion (GH-10631)Victor Stinner2018-11-211-6/+15
| | | | In verbose mode, test_c_locale_coercion now dumps global variables at startup.
* Revert "bpo-34589: Add -X coerce_c_locale command line option (GH-9378)" ↵Victor Stinner2018-09-191-45/+10
| | | | | | | | | | | | | | | | (GH-9430) * Revert "bpo-34589: Add -X coerce_c_locale command line option (GH-9378)" This reverts commit dbdee0073cf0b88fe541980ace1f650900f455cc. * Revert "bpo-34589: C locale coercion off by default (GH-9073)" This reverts commit 7a0791b6992d420dc52536257f2f093851ed7215. * Revert "bpo-34589: Make _PyCoreConfig.coerce_c_locale private (GH-9371)" This reverts commit 188ebfa475a6f6aa2d0ea14ca8e1fbe7865b6d27.
* bpo-34589: Add -X coerce_c_locale command line option (GH-9378)Victor Stinner2018-09-181-10/+45
| | | | Add a new -X coerce_c_locale command line option to control C locale coercion (PEP 538).
* Revert "bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)" (GH-7919)Victor Stinner2018-06-261-2/+2
| | | This reverts commit 8fbbdf0c3107c3052659e166f73990b466eacbb0.
* bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)Victor Stinner2018-06-221-2/+2
| | | | | | | | * Add support.MS_WINDOWS: True if Python is running on Microsoft Windows. * Add support.MACOS: True if Python is running on Apple macOS. * Replace support.is_android with support.ANDROID * Replace support.is_jython with support.JYTHON * Cleanup code to initialize unix_shell
* bpo-32002: Refactor C locale coercion tests (GH-4369)Nick Coghlan2017-12-161-54/+82
| | | | | | | | | | Exactly which locale requests will end up giving you the "C" locale is actually platform dependent. A blank locale and "POSIX" will translate to "C" on most Linux distros, but may not do so on other platforms, so this adjusts the way the tests are structured to better account for that. This is an initial step towards fixing the current test failure on Cygwin (hence the issue reference)
* bpo-29240, bpo-32030: Py_Main() re-reads config if encoding changes (#4899)Victor Stinner2017-12-161-2/+3
| | | | | | | | | | | | | | | | | | bpo-29240, bpo-32030: If the encoding change (C locale coerced or UTF-8 Mode changed), Py_Main() now reads again the configuration with the new encoding. Changes: * Add _Py_UnixMain() called by main(). * Rename pymain_free_pymain() to pymain_clear_pymain(), it can now be called multipled times. * Rename pymain_parse_cmdline_envvars() to pymain_read_conf(). * Py_Main() now clears orig_argc and orig_argv at exit. * Remove argv_copy2, Py_Main() doesn't modify argv anymore. There is no need anymore to get two copies of the wchar_t** argv. * _PyCoreConfig: add coerce_c_locale and coerce_c_locale_warn. * Py_UTF8Mode is now initialized to -1. * Locale coercion (PEP 538) now respects -I and -E options.
* bpo-29240: PEP 540: Add a new UTF-8 Mode (#855)Victor Stinner2017-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | * Add -X utf8 command line option, PYTHONUTF8 environment variable and a new sys.flags.utf8_mode flag. * If the LC_CTYPE locale is "C" at startup: enable automatically the UTF-8 mode. * Add _winapi.GetACP(). encodings._alias_mbcs() now calls _winapi.GetACP() to get the ANSI code page * locale.getpreferredencoding() now returns 'UTF-8' in the UTF-8 mode. As a side effect, open() now uses the UTF-8 encoding by default in this mode. * Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding in the UTF-8 Mode. * Update subprocess._args_from_interpreter_flags() to handle -X utf8 * Skip some tests relying on the current locale if the UTF-8 mode is enabled. * Add test_utf8mode.py. * _Py_DecodeUTF8_surrogateescape() gets a new optional parameter to return also the length (number of wide characters). * pymain_get_global_config() and pymain_set_global_config() now always copy flag values, rather than only copying if the new value is greater than the old value.
* bpo-28180: Fix the implementation of PEP 538 on Android (GH-4334)xdegaye2017-11-121-3/+18
|
* bpo-30836: fix test_c_locale_coercion on AIX (GH-2713)Nick Coghlan2017-07-151-1/+8
| | | | | | | | AIX uses iso8859-1 in the C locale, not ASCII AIX doesn't currently provide any of the locale coercion locales, but we leave locale coercion enabled in case one gets added in the future.
* bpo-30647: Check nl_langinfo(CODESET) in locale coercion (GH-2374)Nick Coghlan2017-06-291-7/+18
| | | | | | | | | | | | | - On some versions of FreeBSD, setting the "UTF-8" locale succeeds, but a subsequent "nl_langinfo(CODESET)" fails - adding a check for this in the coercion logic means that coercion will happen on systems where this check succeeds, and will be skipped otherwise - that way CPython should automatically adapt to changes in platform behaviour, rather than needing a new release to enable coercion at build time - this also allows UTF-8 to be re-enabled as a coercion target, restoring the locale coercion behaviour on Mac OS X
* bpo-30565: Add PYTHONCOERCECLOCALE=warn runtime flag (GH-2260)Nick Coghlan2017-06-181-78/+130
| | | | | | | | | | | | - removes PY_WARN_ON_C_LOCALE build time flag - locale coercion and compatibility warnings are now always compiled in, but are off by default - adds PYTHONCOERCECLOCALE=warn runtime option to aid in debugging potentially locale related compatibility problems Due to not-yet-resolved test failures on *BSD systems (including Mac OS X), this also temporarily disables UTF-8 as a locale coercion target, and skips testing the interpreter's behavior in the POSIX locale.
* bpo-28180: Standard stream & FS encoding differ on Mac OS X (GH-2208)Nick Coghlan2017-06-151-21/+37
| | | | | | | | | In the C locale on Mac OS X, the default filesystem encoding used for operating system interfaces is UTF-8, but the default encoding used on the standard streams is still ASCII. Setting the POSIX locale also behaves differently from setting other locales on Mac OS X, so skip that in the test suite for now.
* bpo-28180: assume UTF-8 for Mac OS X PEP 538 tests (GH-2130)Nick Coghlan2017-06-131-5/+24
|
* bpo-30635: Fix refleak in test_c_locale_coercion (#2126)Victor Stinner2017-06-131-21/+25
| | | | | | | | | When checking for reference leaks, test_c_locale_coercion is run multiple times and so _LocaleCoercionTargetsTestCase.setUpClass() is called multiple times. setUpClass() appends new value at each call, so it looks like a reference leak. Moving the setup from setUpClass() to setUpModule() avoids this, eliminating the false alarm.
* bpo-28180: Implementation for PEP 538 (#659)Nick Coghlan2017-06-111-0/+262
- new PYTHONCOERCECLOCALE config setting - coerces legacy C locale to C.UTF-8, C.utf8 or UTF-8 by default - always uses C.UTF-8 on Android - uses `surrogateescape` on stdin and stdout in the coercion target locales - configure option to disable locale coercion at build time - configure option to disable C locale warning at build time