aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Modules/_localemodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_localemodule.c')
-rw-r--r--Modules/_localemodule.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index ad618398d5b..c1f56008b7c 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -692,7 +692,17 @@ _locale_nl_langinfo_impl(PyObject *module, int item)
result = result != NULL ? result : "";
char *oldloc = NULL;
if (langinfo_constants[i].category != LC_CTYPE
- && !is_all_ascii(result)
+ && (
+#ifdef __GLIBC__
+ // gh-133740: Always change the locale for ALT_DIGITS and ERA
+# ifdef ALT_DIGITS
+ item == ALT_DIGITS ||
+# endif
+# ifdef ERA
+ item == ERA ||
+# endif
+#endif
+ !is_all_ascii(result))
&& change_locale(langinfo_constants[i].category, &oldloc) < 0)
{
return NULL;