From ace29dbff823cff2b5591770522181a26564cf6b Mon Sep 17 00:00:00 2001 From: Konstantin-Glukhov Date: Mon, 12 Jul 2021 15:32:53 +0900 Subject: [PATCH 1/2] bpo-44572: On Windows platform disconnect STDIN in platform._syscmd_ver() to prevent erroneous STDIN consumption --- Lib/platform.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/platform.py b/Lib/platform.py index 02152f6fc9bf86..39c8ad587a8b78 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) From c7723005c14083e0bf4ff171533e7fca38bc8fc1 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Tue, 13 Jul 2021 15:32:50 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Windows/2021-07-13-15-32-49.bpo-44572.gXvhDc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Windows/2021-07-13-15-32-49.bpo-44572.gXvhDc.rst 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 00000000000000..6e074c59b8445b --- /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