]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent erroneou...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 13 Jul 2021 19:48:23 +0000 (12:48 -0700)
committerGitHub <noreply@github.com>
Tue, 13 Jul 2021 19:48:23 +0000 (20:48 +0100)
(cherry picked from commit 0ee0a740e12ec8568aafa033aa6bb08b265afe26)

Co-authored-by: Konstantin-Glukhov <glukhov.k@gmail.com>
Lib/platform.py
Misc/NEWS.d/next/Windows/2021-07-13-15-32-49.bpo-44572.gXvhDc.rst [new file with mode: 0644]

index d298a42edc8483028198d8ce4a89b7dcc20f1795..134fbae6b1cc7e2785c7cb1d95d2fc00365f6ca2 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