summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIksas <iksas@mailbox.org>2024-08-14 21:24:53 +0200
committerTorsten Tejlmand Rasmussen <torsten.rasmussen@nordicsemi.no>2025-10-21 20:34:23 +0200
commit1e6f6441222b756ec0fce46fe60752473e57bc4a (patch)
tree25e987ca54d8f5fda5d82d4debd1bf4fce9ce35f
parent0380400353870974eef82c5ffccd2efb39928370 (diff)
fix crash caused by unsupported locales
-rwxr-xr-xmenuconfig.py8
1 files changed, 6 insertions, 2 deletions
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: