grass
grass copied to clipboard
[Bug] Python 3.11gettext: unexpected keyword argument 'codeset'
Describe the bug
Using GRASS GIS 8 with Python 3.11 leads to:
grass
/usr/bin/grass:68: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
ENCODING = locale.getdefaultlocale()[1]
/usr/bin/grass:1417: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
language, encoding = locale.getdefaultlocale()
Traceback (most recent call last):
File "/usr/bin/grass", line 2743, in <module>
main()
File "/usr/bin/grass", line 2430, in main
set_language(grass_config_dir)
File "/usr/bin/grass", line 1560, in set_language
gettext.install("grasslibs", gpath("locale"), codeset=encoding)
TypeError: install() got an unexpected keyword argument 'codeset'
Versions used:
lsb_release -d
Description: Fedora release 37 (Rawhide)
python3 --version
Python 3.11.0b5
Suspected reason:
https://docs.python.org/3.11/whatsnew/3.11.html
The following deprecated functions and methods are removed in the gettext module: lgettext(), ldgettext(), lngettext() and ldngettext().
Function bind_textdomain_codeset(), methods output_charset() and set_output_charset(), and the codeset parameter of functions translation() and install() are also removed, since they are only used for the l*gettext() functions. (Contributed by Dong-hee Na and Serhiy Storchaka in bpo-44235.)
To Reproduce Steps to reproduce the behavior:
- Get a fresh Linux distro:
docker run -it --rm fedora:rawhide bash
- Compile/install
https://grasswiki.osgeo.org/wiki/Compile_and_Install#GRASS_GIS_8_on_Fedora
Expected behavior
Startup should work as before with Python < 3.11.