FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-45382: test.pythoninfo: set wmic.exe encoding to OEM (GH-30890) · python/cpython@cef0a54 · GitHub

Repository navigation

Commit cef0a54

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

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎Lib/test/pythoninfo.py‎

Lines changed: 3 additions & 0 deletions
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)

Back | FazBrowse Home | New Git URL