]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent erroneou...
authorKonstantin-Glukhov <glukhov.k@gmail.com>
Tue, 13 Jul 2021 19:21:48 +0000 (04:21 +0900)
committerGitHub <noreply@github.com>
Tue, 13 Jul 2021 19:21:48 +0000 (20:21 +0100)
Lib/platform.py
Misc/NEWS.d/next/Windows/2021-07-13-15-32-49.bpo-44572.gXvhDc.rst [new file with mode: 0644]

index 02152f6fc9bf860e2994b825c68d291b024ebb83..39c8ad587a8b7893b1dc1a9cf2667edf0bd31455 100755 (executable)
@@ -280,6 +280,7 @@ def _syscmd_ver(system='', release='', version='',
     for cmd in ('ver', 'command /c ver', 'cmd /c ver'):
         try:
             info = subprocess.check_output(cmd,
+                                           stdin=subprocess.DEVNULL,
                                            stderr=subprocess.DEVNULL,
                                            text=True,
                                            shell=True)
diff --git a/Misc/NEWS.d/next/Windows/2021-07-13-15-32-49.bpo-44572.gXvhDc.rst b/Misc/NEWS.d/next/Windows/2021-07-13-15-32-49.bpo-44572.gXvhDc.rst
new file mode 100644 (file)
index 0000000..6e074c5
--- /dev/null
@@ -0,0 +1 @@
+Avoid consuming standard input in the :mod:`platform` module
\ No newline at end of file