-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-76183: Fix legacy locale coercion tests on platforms that already have a default C.UTF-8 locale #4361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Lib/test/test_c_locale_coercion.py
Outdated
@@ -181,6 +183,22 @@ def setUpModule(): | |||
CLI_COERCION_TARGET = AVAILABLE_TARGETS[0] | |||
CLI_COERCION_WARNING = CLI_COERCION_WARNING_FMT.format(CLI_COERCION_TARGET) | |||
|
|||
# Determine the platform's default LC_CTYPE from the default locale. | |||
# POSIX provides that there *exists* a default locale to provide when | |||
# no enivornment variables are set, or are set to empty strings. However, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in the comment: enivornment -> environment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, I'll just fix that and squash...
…ault C.UTF-8 locale
91f7983
to
5f6d3a0
Compare
result.fail(py_cmd) | ||
|
||
DEFAULT_LC_CTYPE = result.out.decode("ascii").strip().upper() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try setting C_LOCALE_STREAM_ENCODING
to "utf-8"
instead ?
@@ -301,6 +319,11 @@ def _check_c_locale_coercion(self, | |||
# See https://bugs.python.org/issue30672 for discussion | |||
if locale_to_set == "POSIX": | |||
continue | |||
elif locale_to_set == "" and DEFAULT_LC_CTYPE == "C.UTF-8": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition is too restrictive:
- When
locale_to_set
is""
and a locale envt variable exists inextra_vars
with a non empty string (for example intest_LC_ALL_set_to_C
), the subtest may be run. - It seems that when
C_LOCALE_STREAM_ENCODING
is set to"utf-8"
andcoerce_c_localecoerce_c_locale
is not"warn"
then the test should pass.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
This PR is stale because it has been open for 30 days with no activity. |
@embray: are you planning on following up this PR/issue? |
This PR is stale because it has been open for 30 days with no activity. |
After one month, still no response. Suggesting to close this PR and the related issue (Cygwin is not supported). |
@embray Could you address the reviews please? |
This PR is stale because it has been open for 30 days with no activity. |
Fix legacy locale coercion tests on platforms that already have a default C.UTF-8 locale