From 6f2499a9b04849394521828ba25ea5d992fa8644 Mon Sep 17 00:00:00 2001 From: Max Bachmann Date: Tue, 6 May 2025 22:51:28 +0200 Subject: [PATCH 1/2] only use console when available --- Modules/posixmodule.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 922694fa367ac3..4a58308dc50607 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -16865,12 +16865,16 @@ static PyObject * os__supports_virtual_terminal_impl(PyObject *module) /*[clinic end generated code: output=bd0556a6d9d99fe6 input=0752c98e5d321542]*/ { +#ifdef HAVE_WINDOWS_CONSOLE_IO DWORD mode = 0; HANDLE handle = GetStdHandle(STD_ERROR_HANDLE); if (!GetConsoleMode(handle, &mode)) { Py_RETURN_FALSE; } return PyBool_FromLong(mode & ENABLE_VIRTUAL_TERMINAL_PROCESSING); +#else + Py_RETURN_FALSE; +#endif /* HAVE_WINDOWS_CONSOLE_IO */ } #endif From 2ecf680f1c8bb9d53160a15e7c8e11b4887c57f8 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 08:19:16 +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 --- .../next/Windows/2025-05-07-08-19-15.gh-issue-133537.yzf963.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Windows/2025-05-07-08-19-15.gh-issue-133537.yzf963.rst diff --git a/Misc/NEWS.d/next/Windows/2025-05-07-08-19-15.gh-issue-133537.yzf963.rst b/Misc/NEWS.d/next/Windows/2025-05-07-08-19-15.gh-issue-133537.yzf963.rst new file mode 100644 index 00000000000000..94e45f9d8ee741 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2025-05-07-08-19-15.gh-issue-133537.yzf963.rst @@ -0,0 +1 @@ +Avoid using console I/O in WinAPI partitions that don’t support it