Skip to content

getdefaultlocale() deprecated in Python 3.11 #2538

Closed
@pesekon2

Description

@pesekon2

Describe the bug

Initializing GRASS with Python 3.11, I am getting the following warning messages:

/grass/bin.x86_64-pc-linux-gnu/grass:69: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
  ENCODING = locale.getdefaultlocale()[1]
/grass/bin.x86_64-pc-linux-gnu/grass:1421: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
  language, encoding = locale.getdefaultlocale()

Not annoying so much, but it could cause us some problems once the function will be fully removed from locale.

Possible solution

Change to getlocale(). Will dive deeper to find out if it can cause some problems.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions