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

[16.0][FIX] don't use deprecated locale.getdefaultlocale() #163

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion server_environment/system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import platform
import subprocess
from functools import lru_cache

from odoo import release
from odoo.tools.config import config
Expand All @@ -19,6 +20,7 @@ def _get_output(cmd):
return p.communicate()[0].rstrip()


@lru_cache(maxsize=1)
def get_server_environment():
# inspired by server/bin/service/web_services.py
try:
Expand All @@ -29,7 +31,7 @@ def get_server_environment():
except Exception:
rev_id = "Can not retrieve revison from git or bzr"

os_lang = ".".join([x for x in locale.getdefaultlocale() if x])
os_lang = ".".join([x for x in locale.getlocale() if x])
if not os_lang:
os_lang = "NOT SET"
if os.name == "posix" and platform.system() == "Linux":
Expand Down
Loading