Skip to content

[Bug] GRASS won't start for unknown locale #3447

Description

@madi

Hello!

GRASS latest version, give the following error message at startup and won't start:

`Failed to enforce user specified language 'bn' with error: 'unsupported locale setting'
A LANGUAGE environmental variable has been set.
Part of messages will be displayed in the requested language.
Starting GRASS GIS...
WARNING: Ignoring unsupported debug level (must be >=0 and <=5): unknown locale: bn

          __________  ___   __________    _______________
         / ____/ __ \/   | / ___/ ___/   / ____/  _/ ___/
        / / __/ /_/ / /| | \__ \\_  \   / / __ / / \__ \
       / /_/ / _, _/ ___ |___/ /__/ /  / /_/ // / ___/ /
       \____/_/ |_/_/  |_/____/____/   \____/___//____/

Welcome to GRASS GIS 8.4.0dev (4d2dac4789)
GRASS GIS homepage:                      https://grass.osgeo.org
This version running through:            Bash Shell (/bin/bash)
Help is available with the command:      g.manual -i
See the licence terms with:              g.version -c
See citation options with:               g.version -x
If required, restart the GUI with:       g.gui wxpython
When ready to quit enter:                exit

Launching <wxpython> GUI in the background, please wait...
GRASS Italia/PERMANENT:~ > Traceback (most recent call last):
  File "/usr/local/grass84/etc/python/grass/script/utils.py", line 163, in _get_encoding
    encoding = locale.getencoding()
AttributeError: module 'locale' has no attribute 'getencoding'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/grass", line 2768, in <module>
    main()
  File "/usr/local/bin/grass", line 2735, in main
    gui_process = start_gui(grass_gui)
  File "/usr/local/bin/grass", line 1794, in start_gui
    if is_debug() or "WX_DEBUG" in gs.gisenv():
  File "/usr/local/grass84/etc/python/grass/script/core.py", line 1151, in gisenv
    s = read_command("g.gisenv", flags="n", env=env)
  File "/usr/local/grass84/etc/python/grass/script/core.py", line 525, in read_command
    stdout = _make_unicode(stdout, encoding)
  File "/usr/local/grass84/etc/python/grass/script/core.py", line 117, in _make_unicode
    return decode(val)
  File "/usr/local/grass84/etc/python/grass/script/utils.py", line 193, in decode
    enc = _get_encoding()
  File "/usr/local/grass84/etc/python/grass/script/utils.py", line 165, in _get_encoding
    encoding = locale.getdefaultlocale()[1]
  File "/usr/lib/python3.10/locale.py", line 584, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib/python3.10/locale.py", line 511, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: bn

My locales look OK:

$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=it_IT.UTF-8
LC_TIME=it_IT.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=it_IT.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=it_IT.UTF-8
LC_NAME=it_IT.UTF-8
LC_ADDRESS=it_IT.UTF-8
LC_TELEPHONE=it_IT.UTF-8
LC_MEASUREMENT=it_IT.UTF-8
LC_IDENTIFICATION=it_IT.UTF-8
LC_ALL=

System description (please complete the following information):

  • Operating System:
    uname -a Linux ThinkPad-P53 5.15.0-94-generic #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • GRASS GIS version
    GRASS GIS 8.4.0dev (4d2dac4)

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions