Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit899c7dc

Browse files
gh-133740: Fix locale.nl_langinfo(ALT_DIGITS) (#134468)
Set the LC_CTYPE locale to the LC_TIME locale even ifnl_langinfo(ALT_DIGITS) result is ASCII. The result is a listseparated by NUL characters and the code only checks the first listitem which can be ASCII whereas following items are non-ASCII.Fix test__locale for the uk_UA locale on RHEL 7.Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent8c5e555 commit899c7dc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

‎Modules/_localemodule.c

Lines 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+
# ifdefALT_DIGITS
699+
item==ALT_DIGITS||
700+
# endif
701+
# ifdefERA
702+
item==ERA||
703+
# endif
704+
#endif
705+
!is_all_ascii(result))
696706
&&change_locale(langinfo_constants[i].category,&oldloc)<0)
697707
{
698708
returnNULL;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp