We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4646bbc commit 8a422a1Copy full SHA for 8a422a1
1 file changed
src/py2exe_gui/Core/runtime_info.py
@@ -5,7 +5,7 @@
5
运行时信息
6
"""
7
8
-from locale import LC_CTYPE, getlocale
+from locale import getdefaultlocale
9
from typing import NamedTuple, Optional
10
11
from ..Constants import PLATFORM, get_platform
@@ -16,4 +16,7 @@ class RuntimeInfo(NamedTuple):
16
language_code: Optional[str]
17
18
19
-RUNTIME_INFO = RuntimeInfo(get_platform(), getlocale(category=LC_CTYPE)[0])
+# 虽然 locale.getdefaultlocale() 函数已被废弃[https://github.com/python/cpython/issues/90817],
20
+# 但仍然是目前唯一能在 Windows 平台正确获取语言编码的方式[https://github.com/python/cpython/issues/82986]
21
+# 当 Python 更新修复了这一问题后,将迁移至 locale.getlocale()
22
+RUNTIME_INFO = RuntimeInfo(get_platform(), getdefaultlocale()[0]) # noqa
0 commit comments