diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-03-08 13:17:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-08 13:17:05 +0100 |
| commit | d4fd31684ad5a7b9be8a9d26c5a8796f96c8d80b (patch) | |
| tree | 7391c1dfc45b8bc0b7f2a6ac752cce63ed7806f8 /django | |
| parent | d9fc383a5e0ad0a570fb2aa0387cabc648053c09 (diff) | |
Refs #33173 -- Used locale.getlocale() instead of getdefaultlocale().
locale.getdefaultlocale() was deprecated in Python 3.11, see
https://bugs.python.org/issue46659.
Diffstat (limited to 'django')
| -rw-r--r-- | django/utils/encoding.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/encoding.py b/django/utils/encoding.py index 89eac79dd4..360eb91ed5 100644 --- a/django/utils/encoding.py +++ b/django/utils/encoding.py @@ -249,12 +249,12 @@ def filepath_to_uri(path): def get_system_encoding(): """ - The encoding of the default system locale. Fallback to 'ascii' if the + The encoding for the character type functions. 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" + encoding = locale.getlocale()[1] or "ascii" codecs.lookup(encoding) except Exception: encoding = "ascii" |
