Skip to content

Commit cef0a54

Browse files
authored
bpo-45382: test.pythoninfo: set wmic.exe encoding to OEM (GH-30890)
1 parent ec7c17e commit cef0a54

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/pythoninfo.py

+3
Original file line numberDiff line numberDiff line change
@@ -731,9 +731,12 @@ def collect_windows(info_add):
731731

732732
import subprocess
733733
try:
734+
# When wmic.exe output is redirected to a pipe,
735+
# it uses the OEM code page
734736
proc = subprocess.Popen(["wmic", "os", "get", "Caption,Version", "/value"],
735737
stdout=subprocess.PIPE,
736738
stderr=subprocess.PIPE,
739+
encoding="oem",
737740
text=True)
738741
output, stderr = proc.communicate()
739742
if proc.returncode:

0 commit comments

Comments
 (0)