Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c31b25c

Browse filesBrowse files
miss-islingtonvstinnerserhiy-storchaka
authored
[3.14] gh-133740: Fix locale.nl_langinfo(ALT_DIGITS) (GH-134468) (#134512)
gh-133740: Fix locale.nl_langinfo(ALT_DIGITS) (GH-134468) Set the LC_CTYPE locale to the LC_TIME locale even if nl_langinfo(ALT_DIGITS) result is ASCII. The result is a list separated by NUL characters and the code only checks the first list item which can be ASCII whereas following items are non-ASCII. Fix test__locale for the uk_UA locale on RHEL 7. (cherry picked from commit 899c7dc) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent ced49a1 commit c31b25c
Copy full SHA for c31b25c

File tree

Expand file treeCollapse file tree

1 file changed

+11
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-1
lines changed

‎Modules/_localemodule.c

Copy file name to clipboardExpand all lines: Modules/_localemodule.c
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,17 @@ _locale_nl_langinfo_impl(PyObject *module, int item)
692692
result = result != NULL ? result : "";
693693
char *oldloc = NULL;
694694
if (langinfo_constants[i].category != LC_CTYPE
695-
&& !is_all_ascii(result)
695+
&& (
696+
#ifdef __GLIBC__
697+
// gh-133740: Always change the locale for ALT_DIGITS and ERA
698+
# ifdef ALT_DIGITS
699+
item == ALT_DIGITS ||
700+
# endif
701+
# ifdef ERA
702+
item == ERA ||
703+
# endif
704+
#endif
705+
!is_all_ascii(result))
696706
&& change_locale(langinfo_constants[i].category, &oldloc) < 0)
697707
{
698708
return NULL;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.