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

[Bug] Python 3.11gettext: unexpected keyword argument 'codeset' #2507

Closed
neteler opened this issue Aug 2, 2022 · 1 comment · Fixed by #2539
Closed

[Bug] Python 3.11gettext: unexpected keyword argument 'codeset' #2507

neteler opened this issue Aug 2, 2022 · 1 comment · Fixed by #2539
Labels
bug Something isn't working duplicate This issue or pull request already exists Python Related code is in Python
Milestone

Comments

@neteler
Copy link
Member

neteler commented Aug 2, 2022

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:

  1. Get a fresh Linux distro:

docker run -it --rm fedora:rawhide bash

  1. 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.

@neteler neteler added bug Something isn't working Python Related code is in Python labels Aug 2, 2022
@neteler neteler added this to the 8.4.0 milestone Aug 2, 2022
@neteler neteler changed the title [Bug] [Bug] Python 3.11gettext: unexpected keyword argument 'codeset' Aug 2, 2022
@neteler neteler added the duplicate This issue or pull request already exists label Sep 14, 2022
@neteler
Copy link
Member Author

neteler commented Sep 14, 2022

Duplicate of #2538

@neteler neteler marked this as a duplicate of #2538 Sep 14, 2022
@neteler neteler closed this as completed Sep 14, 2022
ninsbl pushed a commit to ninsbl/grass that referenced this issue Oct 26, 2022
ninsbl pushed a commit to ninsbl/grass that referenced this issue Feb 17, 2023
marisn pushed a commit to marisn/grass that referenced this issue Jun 2, 2023
neteler pushed a commit to nilason/grass that referenced this issue Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists Python Related code is in Python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant