New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unsupported locale setting error in 2.1.0 #377
Comments
I opened a stack overflow for this (before i saw this ticket...): The locale error from the SO issue was being thrown from urwid when using pudb. |
Hello! I'm using urwid for a TUI program I'm writing, and since urwid was updated to v2.1.0 I got the same issue when trying to run my program on Ubuntu Core 16. Here is the output of
Because of this, when urwid tries to execute the code that was added for 2.1.0 in util.py, it fails. This issue can be replicated manually:
|
Hello, The issue append on the chroot env, During the test of alot package ERROR: tests.widgets.test_globals (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.widgets.test_globals
Traceback (most recent call last):
File "/usr/lib/python3.7/unittest/loader.py", line 436, in _find_test_path
module = self._get_module_from_name(name)
File "/usr/lib/python3.7/unittest/loader.py", line 377, in _get_module_from_name
__import__(name)
File "/var/tmp/portage/mail-client/alot-0.9.1/work/alot-0.9.1/tests/widgets/test_globals.py", line 22, in <module>
from alot.widgets import globals as globals_
File "/var/tmp/portage/mail-client/alot-0.9.1/work/alot-0.9.1/alot/widgets/globals.py", line 10, in <module>
import urwid
File "/usr/lib/python3.7/site-packages/urwid/__init__.py", line 26, in <module>
from urwid.widget import (FLOW, BOX, FIXED, LEFT, RIGHT, CENTER, TOP, MIDDLE,
File "/usr/lib/python3.7/site-packages/urwid/widget.py", line 27, in <module>
from urwid.util import (MetaSuper, decompose_tagmarkup, calc_width,
File "/usr/lib/python3.7/site-packages/urwid/util.py", line 61, in <module>
detected_encoding = detect_encoding()
File "/usr/lib/python3.7/site-packages/urwid/util.py", line 58, in detect_encoding
locale.setlocale(locale.LC_ALL, initial)
File "/usr/lib/python3.7/locale.py", line 608, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting The issue is fixed by that patch fd010f8 --- 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() I would like to see this fixed, let me know if I can test / help. |
Ignore resetting to invalid locale (Closes: #377)
Description:
I'm trying to import pudb into my code base with
from pudb import set_trace; set_trace()
and I get this error.If I downgrade to
2.0.1
everything is fine. This is running inside thepython:3.6-slim-stretch
image.Affected versions (if applicable)
2.1.0
The text was updated successfully, but these errors were encountered: