Compiling Modules/_cursesmodule.c using clang-cl reveals a stupid bug here:
|
#if defined(MS_WINDOWS) |
|
char *buffer[100]; |
|
UINT cp; |
|
cp = GetConsoleOutputCP(); |
|
if (cp != 0) { |
|
PyOS_snprintf(buffer, sizeof(buffer), "cp%u", cp); |
and consequently a compile-error:
Modules/_cursesmodule.c(1963,27): error: incompatible pointer types passing 'char *[100]' to parameter of type 'char *'
[-Wincompatible-pointer-types]
1963 | PyOS_snprintf(buffer, sizeof(buffer), "cp%u", cp);
| ^~~~~~
./Include\pyerrors.h(324,37): note: passing argument to parameter 'str' here
324 | PyAPI_FUNC(int) PyOS_snprintf(char *str, size_t size, const char *format, ...)
| ^
Surely it should be:
--- a/Modules/_cursesmodule.c 2026-07-23 18:30:17
+++ b/Modules/_cursesmodule.c 2026-07-24 11:06:43
@@ -1956,7 +1956,7 @@
{
if (encoding == NULL) {
#if defined(MS_WINDOWS)
- char *buffer[100];
+ char buffer[100];
UINT cp;
cp = GetConsoleOutputCP();
if (cp != 0) {
I tried to build with this Curses port: https://github.com/Bill-Gray/PDCursesMod.git
but eventually gave up on all the missing functions.
Apart from a pip install windows-curses, it seems it would be a major task to get
_curses*.pyd to link and work on Windows (from a git-build).
Any pointers?
Linked PRs
Compiling
Modules/_cursesmodule.cusing clang-cl reveals a stupid bug here:cpython/Modules/_cursesmodule.c
Lines 1958 to 1963 in eef2349
and consequently a compile-error:
Surely it should be:
I tried to build with this Curses port: https://github.com/Bill-Gray/PDCursesMod.git
but eventually gave up on all the missing functions.
Apart from a
pip install windows-curses, it seems it would be a major task to get_curses*.pydto link and work on Windows (from a git-build).Any pointers?
Linked PRs