From 1e6f6441222b756ec0fce46fe60752473e57bc4a Mon Sep 17 00:00:00 2001 From: Iksas Date: Wed, 14 Aug 2024 21:24:53 +0200 Subject: fix crash caused by unsupported locales --- menuconfig.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'menuconfig.py') diff --git a/menuconfig.py b/menuconfig.py index 21b5f54..9c5732a 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -703,8 +703,12 @@ def menuconfig(kconf): # errors ourselves. kconf.warn = False - # Make curses use the locale settings specified in the environment - locale.setlocale(locale.LC_ALL, "") + try: + # Make curses use the locale settings specified in the environment + locale.setlocale(locale.LC_ALL, "") + except locale.Error: + # fall back to the default locale + locale.setlocale(locale.LC_ALL, "C") # Try to fix Unicode issues on systems with bad defaults if _CHANGE_C_LC_CTYPE_TO_UTF8: -- cgit v1.2.3