]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-111460: Restore ncurses widechar support on macOS (GH-111878) (gh-112034)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 14 Nov 2023 01:59:01 +0000 (02:59 +0100)
committerGitHub <noreply@github.com>
Tue, 14 Nov 2023 01:59:01 +0000 (10:59 +0900)
gh-111460: Restore ncurses widechar support on macOS (GH-111878)
(cherry picked from commit d2f305dfd183025a95592319b280fcf4b20c8694)

Co-authored-by: Davide Rizzo <sorcio@gmail.com>
Misc/NEWS.d/next/Library/2023-11-09-12-57-43.gh-issue-111460.TQaz9I.rst [new file with mode: 0644]
configure
configure.ac

diff --git a/Misc/NEWS.d/next/Library/2023-11-09-12-57-43.gh-issue-111460.TQaz9I.rst b/Misc/NEWS.d/next/Library/2023-11-09-12-57-43.gh-issue-111460.TQaz9I.rst
new file mode 100644 (file)
index 0000000..956c536
--- /dev/null
@@ -0,0 +1,3 @@
+:mod:`curses`: restore wide character support (including
+:func:`curses.unget_wch` and :meth:`~curses.window.get_wch`) on macOS, which
+was unavailable due to a regression in Python 3.12.
index 7c3250729c89d31ea562304379139685487ae7a4..778eacf51c72f1c22cbbfc8d6698adeefa1751f0 100755 (executable)
--- a/configure
+++ b/configure
@@ -26079,7 +26079,7 @@ fi
 fi
 CURSES_CFLAGS=$(echo $CURSES_CFLAGS | sed 's/-D_XOPEN_SOURCE=600//g')
 
-if test "$have_curses" = no -a "$ac_sys_system" = "Darwin"; then
+if test "$have_curses" != no -a "$ac_sys_system" = "Darwin"; then
 
   as_fn_append CURSES_CFLAGS " -D_XOPEN_SOURCE_EXTENDED=1"
   printf "%s\n" "#define HAVE_NCURSESW 1" >>confdefs.h
index 3afa9aca8bbd43c1af4d5d4b9aea87c86be1dbf0..ac8400183d8a7b3359460410773fb091ae929b2f 100644 (file)
@@ -6439,9 +6439,11 @@ dnl remove _XOPEN_SOURCE macro from curses cflags. pyconfig.h sets
 dnl the macro to 700.
 CURSES_CFLAGS=$(echo $CURSES_CFLAGS | sed 's/-D_XOPEN_SOURCE=600//g')
 
-if test "$have_curses" = no -a "$ac_sys_system" = "Darwin"; then
+if test "$have_curses" != no -a "$ac_sys_system" = "Darwin"; then
   dnl On macOS, there is no separate /usr/lib/libncursesw nor libpanelw.
-  dnl If we are here, we found a locally-supplied version of libncursesw.
+  dnl System-supplied ncurses combines libncurses/libpanel and supports wide
+  dnl characters, so we can use it like ncursesw.
+  dnl If a locally-supplied version of libncursesw is found, we will use that.
   dnl There should also be a libpanelw.
   dnl _XOPEN_SOURCE defines are usually excluded for macOS, but we need
   dnl _XOPEN_SOURCE_EXTENDED here for ncurses wide char support.