From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 14 Jul 2021 16:17:18 +0000 (-0700) Subject: bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent erroneou... X-Git-Tag: v3.9.7~158 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5fc784e28ab9cd02c30395d1973ff825b787efa2;p=thirdparty%2FPython%2Fcpython.git bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent erroneous STDIN consumption (GH-27092) (cherry picked from commit 0ee0a740e12ec8568aafa033aa6bb08b265afe26) Co-authored-by: Konstantin-Glukhov --- diff --git a/Lib/platform.py b/Lib/platform.py index 0bce4381cca7..d6412e169b48 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -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 index 000000000000..6e074c59b844 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2021-07-13-15-32-49.bpo-44572.gXvhDc.rst @@ -0,0 +1 @@ +Avoid consuming standard input in the :mod:`platform` module \ No newline at end of file