summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-01-25 19:02:23 (GMT)
committerGitHub <noreply@github.com>2022-01-25 19:02:23 (GMT)
commitcef0a5458f254c2f8536b928dee25862ca90ffa6 (patch)
treeb5c1b8d072cb4d58f40a66e56c6c222d006ed85f /Lib
parentec7c17ea236f71c8376abcc2930a7c857d417966 (diff)
downloadcpython-cef0a5458f254c2f8536b928dee25862ca90ffa6.zip
cpython-cef0a5458f254c2f8536b928dee25862ca90ffa6.tar.gz
cpython-cef0a5458f254c2f8536b928dee25862ca90ffa6.tar.bz2
bpo-45382: test.pythoninfo: set wmic.exe encoding to OEM (GH-30890)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/pythoninfo.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index cfd7ac2..d15a11c 100644
--- a/Lib/test/pythoninfo.py
+++ b/Lib/test/pythoninfo.py
@@ -731,9 +731,12 @@ def collect_windows(info_add):
import subprocess
try:
+ # When wmic.exe output is redirected to a pipe,
+ # it uses the OEM code page
proc = subprocess.Popen(["wmic", "os", "get", "Caption,Version", "/value"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
+ encoding="oem",
text=True)
output, stderr = proc.communicate()
if proc.returncode: