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

qtile: locale.Error: unsupported locale setting #41784

Closed
steveej opened this issue Jun 10, 2018 · 6 comments
Closed

qtile: locale.Error: unsupported locale setting #41784

steveej opened this issue Jun 10, 2018 · 6 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@steveej
Copy link
Contributor

steveej commented Jun 10, 2018

Issue description

I have qtile 0.11.1 pulled in via the unstable channel at the commit seen below in the technical details section. It throws the following error on my system:

$ qtile --version
Traceback (most recent call last):
  File "/nix/store/0rhv2icj7zfbccd8wjma6m5lql5wk6ds-qtile-0.10.7/bin/..qtile-wrapped-wrapped", line 8, in <module>
    from libqtile.scripts.qtile import main
  File "/nix/store/0rhv2icj7zfbccd8wjma6m5lql5wk6ds-qtile-0.10.7/lib/python2.7/site-packages/libqtile/scripts/qtile.py", line 30, in <module>
    locale.setlocale(locale.LC_ALL, locale.getdefaultlocale())
  File "/nix/store/l9j2jsc9flrbmpf799nw9wdq59gpwms8-python-2.7.14/lib/python2.7/locale.py", line 581, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

In my system configuration I have

  i18n = {
    consoleFont = "lat9w-16";
    defaultLocale = "en_US.UTF-8";
  };

set.

Steps to reproduce

  1. set the locales as described above
  2. install qtile from the unstable channel described below
  3. attempt to run qtile

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.16.13, NixOS, 18.03.132628.a381b789984 (Impala)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.1pre6148_a4aac7f
  • channels(root): "nixos-18.03.132628.a381b789984, nixos-unstable-18.09pre140958.696c6bed4e8"
  • channels(steveej): ""
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs

EDIT: I just noticed the above was produced with qtile 0.10.7 due to a typo in the overrides

(...)
      gitpkgs = import /home/steveej/src/github/NixOS/nixpkgs {};
(...)
    packageOverrides = pkgs: with pkgs; {
      qtile = gitpkgs.qtile;
(...)

The fork point of my local repository is currently: 9292bdb which is before the version bump of qtile which I had suspected to be the culprit.

So my actual question is, if it's not the recent version bump of qtile, what else could be breaking this?

@steveej steveej changed the title qtile 0.11.1: locale.Error: unsupported locale setting qtile: locale.Error: unsupported locale setting Jun 10, 2018
@dpaetzel
Copy link
Contributor

dpaetzel commented Jun 19, 2018

I get a very similar error when using khard 0.12.2.

$ khard
Traceback (most recent call last):
  File "/nix/store/x1nrik6n21zsggqdlb7xxpx17bnlky5y-khard-0.12.2/bin/.khard-wrapped", line 12, in <module>
    sys.exit(main())
  File "/nix/store/x1nrik6n21zsggqdlb7xxpx17bnlky5y-khard-0.12.2/lib/python3.6/site-packages/khard/khard.py", line 1478, in main
    args = parse_args()
  File "/nix/store/x1nrik6n21zsggqdlb7xxpx17bnlky5y-khard-0.12.2/lib/python3.6/site-packages/khard/khard.py", line 1454, in parse_args
    config = Config(args.config)
  File "/nix/store/x1nrik6n21zsggqdlb7xxpx17bnlky5y-khard-0.12.2/lib/python3.6/site-packages/khard/config.py", line 48, in __init__
    locale.setlocale(locale.LC_ALL, '')
  File "/nix/store/p1bp0kpmxi7nzrla7n7c4waqic0a2myk-python3-3.6.4/lib/python3.6/locale.py", line 598, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

Any help would be much appreciated!

@dpaetzel
Copy link
Contributor

After reading #38991 (especially, this comment) I uninstalled khard from my user environment and added it to my environment.systemPackages which solved the issue for me.

@kamilchm
Copy link
Member

kamilchm commented Jun 28, 2018

I have qtile installed in environment.systemPackages and it works fine (Linux 4.16.11, NixOS, 18.09.git.0e326d3 (Jellyfish)):

$ qtile --version
0.11.1

@steveej
Copy link
Contributor Author

steveej commented Aug 20, 2018

I have qtile installed in environment.systemPackages and it works fine (Linux 4.16.11, NixOS, 18.09.git.0e326d3 (Jellyfish)):

Installing it in my systemPackages is not an option for me since I use home-manager.
I just checked after this long while and the situation is still the same:

$ qtile --version
Traceback (most recent call last):
  File "/nix/store/226yd49pimppq30yr9cx9s4wm0qcskgn-qtile-0.12.0/bin/..qtile-wrapped-wrapped", line 8, in <module>
    from libqtile.scripts.qtile import main
  File "/nix/store/226yd49pimppq30yr9cx9s4wm0qcskgn-qtile-0.12.0/lib/python2.7/site-packages/libqtile/scripts/qtile.py", line 31, in <module>
    locale.setlocale(locale.LC_ALL, locale.getdefaultlocale())  # type: ignore
  File "/nix/store/9qjc0d5557h3dkpsvfq98b2k96lnb6pw-python-2.7.15/lib/python2.7/locale.py", line 581, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

I assume we can workaround this by exporting LOCALE_ARCHIVE as described here #38991 (comment)

@stale
Copy link

stale bot commented Jun 4, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 4, 2020
@steveej
Copy link
Contributor Author

steveej commented Jun 11, 2020

I'm no longer experiencing this issue.

@steveej steveej closed this as completed Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

3 participants