The Wayback Machine - https://web.archive.org/web/20250607091453/https://github.com/python/cpython/pull/4361
Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

embray
Copy link
Contributor

@embray embray commented Nov 10, 2017

Fix legacy locale coercion tests on platforms that already have a default C.UTF-8 locale

@@ -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,
Copy link
Contributor

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

Copy link
Contributor Author

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...

@embray embray force-pushed the cygwin/test-c-locale-coercion branch from 91f7983 to 5f6d3a0 Compare November 10, 2017 11:17
result.fail(py_cmd)

DEFAULT_LC_CTYPE = result.out.decode("ascii").strip().upper()

Copy link
Contributor

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":
Copy link
Contributor

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 in extra_vars with a non empty string (for example in test_LC_ALL_set_to_C), the subtest may be run.
  • It seems that when C_LOCALE_STREAM_ENCODING is set to "utf-8" and coerce_c_localecoerce_c_locale is not "warn" then the test should pass.

@bedevere-bot
Copy link

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Aug 13, 2022
@erlend-aasland
Copy link
Contributor

@embray: are you planning on following up this PR/issue?

@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Jan 24, 2023
@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Feb 23, 2023
@erlend-aasland erlend-aasland changed the title bpo-32002 Fix legacy locale coercion tests on platforms that already have a default C.UTF-8 locale gh-76183: Fix legacy locale coercion tests on platforms that already have a default C.UTF-8 locale Feb 23, 2023
@erlend-aasland erlend-aasland added the pending The issue will be closed if no feedback is provided label Feb 23, 2023
@erlend-aasland
Copy link
Contributor

After one month, still no response. Suggesting to close this PR and the related issue (Cygwin is not supported).

@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Feb 24, 2023
@arhadthedev
Copy link
Member

arhadthedev commented Mar 4, 2023

@embray Could you address the reviews please?

@github-actions
Copy link

github-actions bot commented Apr 4, 2023

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Apr 4, 2023
@erlend-aasland erlend-aasland removed the pending The issue will be closed if no feedback is provided label Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants