Skip to content

Commit 0ee0a74

Browse files
author
Konstantin-Glukhov
authored
bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent erroneous STDIN consumption (GH-27092)
1 parent 6252670 commit 0ee0a74

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Lib/platform.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ def _syscmd_ver(system='', release='', version='',
280280
for cmd in ('ver', 'command /c ver', 'cmd /c ver'):
281281
try:
282282
info = subprocess.check_output(cmd,
283+
stdin=subprocess.DEVNULL,
283284
stderr=subprocess.DEVNULL,
284285
text=True,
285286
shell=True)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Avoid consuming standard input in the :mod:`platform` module

0 commit comments

Comments
 (0)