Page MenuHomePhabricator

locale.getdefaultlocale() is deprecated since Python 3.11
Closed, ResolvedPublicBUG REPORT

Description

locale.getdefaultlocale() is deprecated since Python 3.11 and will be removed in Python 3.13

Where is it used?
It is used in config.py only
https://codesearch.wmcloud.org/pywikibot/?q=getdefaultlocale&i=nope&files=&excludeFiles=&repos=

What should be used instead?:

Use locale.setlocale(), locale.getpreferredencoding(False) and locale.getlocale() functions instead.

Software version:

  • Python 3.11+
  • Pywikibot 3.0+

Event Timeline

Xqt triaged this task as Medium priority.Jun 12 2022, 9:04 AM

Change 804749 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [fix] Use locale.getlocale to get the default userinterface_lang

https://gerrit.wikimedia.org/r/804749

Change 804749 merged by jenkins-bot:

[pywikibot/core@master] [fix] Use locale.getlocale to get the default userinterface_lang

https://gerrit.wikimedia.org/r/804749