Skip to content
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

locale.Error: unsupported locale setting when locale is set to an unsupported value #2765

Open
rathann opened this issue Jan 9, 2025 · 1 comment
Labels

Comments

@rathann
Copy link
Contributor

rathann commented Jan 9, 2025

Information

  • Solaar version (solaar --version or git describe --tags if cloned from this repository): 1.1.14
  • Distribution: Fedora 41
  • Kernel version (ex. uname -srmo): Linux 6.12.7-200.fc41.x86_64 x86_64 GNU/Linux
  • Output of solaar show:
Traceback (most recent call last):
  File "/usr/bin/solaar", line 53, in <module>
    import solaar.gtk
  File "/usr/lib/python3.13/site-packages/solaar/gtk.py", line 33, in <module>
    from solaar import cli
  File "/usr/lib/python3.13/site-packages/solaar/cli/__init__.py", line 25, in <module>
    from logitech_receiver import base
  File "/usr/lib/python3.13/site-packages/logitech_receiver/base.py", line 34, in <module>
    from . import base_usb
  File "/usr/lib/python3.13/site-packages/logitech_receiver/base_usb.py", line 30, in <module>
    from solaar.i18n import _
  File "/usr/lib/python3.13/site-packages/solaar/i18n.py", line 62, in <module>
    set_locale_to_system_default()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/solaar/i18n.py", line 49, in set_locale_to_system_default
    locale.setlocale(locale.LC_ALL, "")
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/locale.py", line 615, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
  • Contents of ~/.config/solaar/config.yaml (or ~/.config/solaar/config.json if ~/.config/solaar/config.yaml not present): N/A

  • Errors or warrnings from Solaar:

locale.Error: unsupported locale setting

Describe the bug
Solaar outputs a traceback instead of handling unsupported locale setting gracefully.

To Reproduce
Steps to reproduce the behavior:

  1. LC_TIME=en_SE.UTF-8 solaar show

Additional context
Apparently, KDE locale settings do list en_SE as a supported locale, even if it's not supported by the underlying OS. Downstream bug report: https://bugzilla.redhat.com/show_bug.cgi?id=2336507 .

Looks similar to #905 . It looks like blanket exception handling was changed in 1.1.14 (244d0ee) .

@rathann rathann added the bug label Jan 9, 2025
@pfps
Copy link
Collaborator

pfps commented Jan 9, 2025

@MattHag This appears to be due to your change. Why did you change the except clause to be more specific?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants