-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Labels
Description
The locale.getdefaultlocale() function was deprecated in Python 3.11 and will be removed in 3.13 (see the note in the library docs). The deprecation warning issued when running says use setlocale(), getencoding() and getlocale() instead.
The only place it is used is crypto/encoding.py:
nativeauthenticator/nativeauthenticator/crypto/encoding.py
Lines 187 to 198 in 3db8285
| def get_system_encoding(): | |
| """ | |
| The encoding of the default system locale. Fallback to 'ascii' if the | |
| #encoding is unsupported by Python or could not be determined. See tickets | |
| #10335 and #5846. | |
| """ | |
| try: | |
| encoding = locale.getdefaultlocale()[1] or "ascii" | |
| codecs.lookup(encoding) | |
| except Exception: | |
| encoding = "ascii" | |
| return encoding |
I guess either locale.getencoding() or locale.getpreferredencoding would be a suitable replacement.