mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-04 04:57:07 -08:00
Closes: https://bugs.gentoo.org/736412 Closes: https://bugs.gentoo.org/736410 Package-Manager: Portage-2.3.99, Repoman-2.3.2 Signed-off-by: Guillaume Seren <guillaumeseren@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/17059 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
33 lines
998 B
Diff
33 lines
998 B
Diff
From fd010f8336407ad1a42522b424d2ea7b7800ebc4 Mon Sep 17 00:00:00 2001
|
|
From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
|
|
Date: Fri, 26 Jun 2020 22:26:23 +0200
|
|
Subject: [PATCH] Ignore resetting to invalid locale (Closes: #377)
|
|
|
|
Resetting the locale was introduced in 5dcf236, before that an invalid
|
|
locale was ignored. Restore the old behavior insofar that only valid
|
|
locales are restored.
|
|
This fixes the unit tests of scottkosty/vit with unset LANG.
|
|
---
|
|
urwid/util.py | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/urwid/util.py b/urwid/util.py
|
|
index 17c049d..acd62f6 100644
|
|
--- a/urwid/util.py
|
|
+++ b/urwid/util.py
|
|
@@ -55,7 +55,10 @@ def detect_encoding():
|
|
else:
|
|
raise
|
|
finally:
|
|
- locale.setlocale(locale.LC_ALL, initial)
|
|
+ try:
|
|
+ locale.setlocale(locale.LC_ALL, initial)
|
|
+ except locale.Error:
|
|
+ pass
|
|
|
|
if 'detected_encoding' not in locals():
|
|
detected_encoding = detect_encoding()
|
|
--
|
|
2.26.2
|
|
|