mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-45382: test.pythoninfo: set wmic.exe encoding to OEM (GH-30890)
This commit is contained in:
parent
ec7c17ea23
commit
cef0a5458f
1 changed files with 3 additions and 0 deletions
|
@ -731,9 +731,12 @@ def collect_windows(info_add):
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
try:
|
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"],
|
proc = subprocess.Popen(["wmic", "os", "get", "Caption,Version", "/value"],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
|
encoding="oem",
|
||||||
text=True)
|
text=True)
|
||||||
output, stderr = proc.communicate()
|
output, stderr = proc.communicate()
|
||||||
if proc.returncode:
|
if proc.returncode:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue