python3.12: update to version 3.12.2. (#10111)

This commit is contained in:
OscarL
2024-02-16 07:27:40 -03:00
committed by GitHub
parent eef3fd5c7a
commit 8a3f3ee2ae
2 changed files with 153 additions and 57 deletions

View File

@@ -1,4 +1,4 @@
From 31f0964946800a1164bbfcaab683f91e6ece1160 Mon Sep 17 00:00:00 2001
From 666d6b836b05ef4ba74e7c75d097a77283da31b8 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sun, 8 Oct 2023 01:02:25 -0300
Subject: initial Haiku patch
@@ -32,7 +32,7 @@ index 0000000..4372ee2
+set -v
+eval $PYTHON_FOR_BUILD ../../Tools/scripts/h2py.py -i "'(u_long)'" $HEADERS/posix/netinet/in.h
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 7af1845..e9083a1 100644
index dd5e69f..7846bd0 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -147,7 +147,7 @@ BINDIR= @bindir@
@@ -184,7 +184,7 @@ index 13f1115..45f477c 100644
else
PyErr_SetString(PyExc_KeyError, "getspnam(): name not found");
diff --git a/configure.ac b/configure.ac
index bd2be94..6abc95c 100644
index 384718d..8b2ad86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1524,6 +1524,16 @@ if test $enable_shared = "yes"; then
@@ -230,7 +230,7 @@ index bd2be94..6abc95c 100644
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
LINKFORSHARED="$extra_undefs -framework CoreFoundation"
@@ -5595,6 +5606,7 @@ AC_CHECK_FUNC([__fpu_control],
@@ -5596,6 +5607,7 @@ AC_CHECK_FUNC([__fpu_control],
AC_SUBST([LIBM])
case $ac_sys_system in
Darwin) ;;
@@ -242,14 +242,14 @@ index bd2be94..6abc95c 100644
2.42.1
From 070a7808197ff721ae67f73272b31ee35f0f8dc8 Mon Sep 17 00:00:00 2001
From f356f5fb0ebffb2c49bf3453cea4a747fc4f9351 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sun, 16 Apr 2017 10:05:42 +0200
Subject: fix for negative errnos
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 6df5dd5..39dde15 100644
index 3264d9a..829477d 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1938,6 +1938,8 @@ class Popen:
@@ -258,14 +258,14 @@ index 6df5dd5..39dde15 100644
errno_num = int(hex_errno, 16)
+ if sys.platform.startswith('haiku'):
+ errno_num = -errno_num;
child_exec_never_called = (err_msg == "noexec")
if child_exec_never_called:
if err_msg == "noexec:chdir":
err_msg = ""
# The error must be from chdir(cwd).
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index 85634d7..afe4d31 100644
index d75bb92..cce5acc 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -751,6 +751,10 @@ error:
@@ -756,6 +756,10 @@ error:
char *cur;
_Py_write_noraise(errpipe_write, "OSError:", 8);
cur = hex_errno + sizeof(hex_errno);
@@ -280,7 +280,7 @@ index 85634d7..afe4d31 100644
2.42.1
From 3b96d73ce97e26367a0347e3c41657cbc1e4723a Mon Sep 17 00:00:00 2001
From 369c0684ddc4e0ae9fddcaa61a54b4abd75c7ecc Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sun, 8 Oct 2023 20:06:31 -0300
Subject: Implement CTypes's find_library for Haiku
@@ -290,7 +290,7 @@ This combines:
- A slight variation of Adrien Destugues' fix for x86_gcc2.
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 0c2510e..6b88fc8 100644
index c550883..6b23423 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -1,4 +1,5 @@
@@ -299,7 +299,7 @@ index 0c2510e..6b88fc8 100644
import shutil
import subprocess
import sys
@@ -265,6 +266,60 @@ elif os.name == "posix":
@@ -268,6 +269,60 @@ elif os.name == "posix":
def find_library(name, is64 = False):
return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
@@ -360,7 +360,7 @@ index 0c2510e..6b88fc8 100644
else:
def _findSoname_ldconfig(name):
@@ -367,6 +422,12 @@ def test():
@@ -370,6 +425,12 @@ def test():
print(f"crypt\t:: {cdll.LoadLibrary(find_library('crypt'))}")
print(f"crypto\t:: {find_library('crypto')}")
print(f"crypto\t:: {cdll.LoadLibrary(find_library('crypto'))}")
@@ -377,14 +377,14 @@ index 0c2510e..6b88fc8 100644
2.42.1
From ca75abd88def4395a64735827f5b7109fbb7abac Mon Sep 17 00:00:00 2001
From b20fcfb936ab8a295bfdbf39034a47b04bebb688 Mon Sep 17 00:00:00 2001
From: Philipp Wolfer <phil@parolu.io>
Date: Mon, 23 Sep 2019 09:14:58 +0200
Subject: webbrowser: Support for default browsers on Haiku
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index e0170af..8567cdd 100755
index ba6711e..ba543ab 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -477,6 +477,12 @@ def register_standard_browsers():
@@ -404,7 +404,7 @@ index e0170af..8567cdd 100755
2.42.1
From fbff72b7fde21f86e24b6a7f1349db2e1e457e65 Mon Sep 17 00:00:00 2001
From 4606de02e0b3084650e40920cfc0ce24cdcc0749 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 4 Oct 2019 22:02:35 +0200
Subject: since 3.8, don't reinit locks on fork.
@@ -427,7 +427,7 @@ index 056380f..4836719 100644
2.42.1
From 1f4b4d2b4791e6f774d954a03456e60013d2a3e5 Mon Sep 17 00:00:00 2001
From e307fa5fe7c3e649784139b9de373e22df415b06 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 15 May 2020 15:20:57 +0200
Subject: handle errors returned by internal_connect()
@@ -435,7 +435,7 @@ Subject: handle errors returned by internal_connect()
upstream bug #40628 by Ryan C. Gordon
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index de7229d..b62a0a2 100644
index 9724879..f714ed8 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -3489,7 +3489,7 @@ sock_connect(PySocketSockObject *s, PyObject *addro)
@@ -460,17 +460,17 @@ index de7229d..b62a0a2 100644
2.42.1
From 98a311772fba924c07eb3a32cbac92f95279fe29 Mon Sep 17 00:00:00 2001
From 7057c788962153b1fb4f4796d08fe5c8c434757c Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 19 Oct 2020 18:03:09 +0200
Subject: ttyname_r can use MAXPATHLEN
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 0ac5a8d..86c1d7e 100644
index 1c23061..60d70cb 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -3173,11 +3173,14 @@ static PyObject *
@@ -3178,11 +3178,14 @@ static PyObject *
os_ttyname_impl(PyObject *module, int fd)
/*[clinic end generated code: output=c424d2e9d1cd636a input=9ff5a58b08115c55]*/
{
@@ -490,7 +490,7 @@ index 0ac5a8d..86c1d7e 100644
2.42.1
From 56199bd790240009ec5cdbbd74144142579db4e9 Mon Sep 17 00:00:00 2001
From 3fd68c9485a6a48650b0b1dcf59c8d6e58514475 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Mon, 24 Oct 2022 20:04:10 -0300
Subject: Lib/test: require the "largefile" usage flag for I/O heavy tests.
@@ -501,7 +501,7 @@ This avoids needing several GBs of storage to run the tests
(unless the "largefile" resource usage flag is enabled).
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 196b7d2..3be21d5 100644
index cceaed8..38ba876 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -613,7 +613,7 @@ class IOTest(unittest.TestCase):
@@ -527,10 +527,10 @@ index 3b0930f..c793ea1 100644
'test requires %s bytes and a long time to run' % str(size))
else:
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index dfcf303..886d3af 100644
index 1867e8c..e4fab02 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -1007,7 +1007,7 @@ class LargeMmapTests(unittest.TestCase):
@@ -1009,7 +1009,7 @@ class LargeMmapTests(unittest.TestCase):
unlink(TESTFN)
def _make_test_file(self, num_zeroes, tail):
@@ -543,7 +543,7 @@ index dfcf303..886d3af 100644
2.42.1
From aa3d40bca38365054b490204b66d98506a491a45 Mon Sep 17 00:00:00 2001
From 52cae49f99338cea29be70b9ee8df39c183914ca Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sun, 8 Oct 2023 01:04:42 -0300
Subject: default schemes for Haiku
@@ -628,7 +628,7 @@ index 122d441..a27fa57 100644
2.42.1
From e118085cfba9fad7fce67c8fb65a39b471491010 Mon Sep 17 00:00:00 2001
From 7302823ccc167141842859053fddb08ab2cbd3b2 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sun, 8 Oct 2023 01:05:12 -0300
Subject: Fix _getuserbase() and getsizepackages() for Haiku.
@@ -636,10 +636,10 @@ Subject: Fix _getuserbase() and getsizepackages() for Haiku.
Based on previous patches by Jerome Duval and me.
diff --git a/Lib/site.py b/Lib/site.py
index 672fa7b..e783664 100644
index 924b246..aaa646c 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -281,6 +281,14 @@ def _getuserbase():
@@ -291,6 +291,14 @@ def _getuserbase():
return joinuser("~", "Library", sys._framework,
"%d.%d" % sys.version_info[:2])
@@ -654,7 +654,7 @@ index 672fa7b..e783664 100644
return joinuser("~", ".local")
@@ -361,7 +369,14 @@ def getsitepackages(prefixes=None):
@@ -371,7 +379,14 @@ def getsitepackages(prefixes=None):
continue
seen.add(prefix)
@@ -693,7 +693,7 @@ index a27fa57..80e1c3f 100644
2.42.1
From 2d7c447d9320004cfbcd91742424e73023c6db07 Mon Sep 17 00:00:00 2001
From 4a0d231167cb942ca9d67271b700ec36cedbdece Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sun, 8 Oct 2023 01:05:31 -0300
Subject: Fix location of REPL's history file.
@@ -701,10 +701,10 @@ Subject: Fix location of REPL's history file.
From "initial Haiku patch" by Jerome Duval.
diff --git a/Lib/site.py b/Lib/site.py
index e783664..da965d6 100644
index aaa646c..e9b0ca3 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -480,8 +480,16 @@ def enablerlcompleter():
@@ -490,8 +490,16 @@ def enablerlcompleter():
# each interpreter exit when readline was already configured
# through a PYTHONSTARTUP hook, see:
# http://bugs.python.org/issue5845#msg198636
@@ -727,7 +727,7 @@ index e783664..da965d6 100644
2.42.1
From f3d0759f2a1c943a35509681acd92fe183c7ffbb Mon Sep 17 00:00:00 2001
From 798c0cfe518fd6ee067decc43617007bac937624 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sun, 8 Oct 2023 17:02:19 -0300
Subject: Use spawn instead of fork for multiprocessing.
@@ -780,7 +780,7 @@ index de8a264..02a301e 100644
2.42.1
From 9f2791c8db4df7c11923fa164291eff3fb44a769 Mon Sep 17 00:00:00 2001
From 5403dd2261900f25730afe2bf8485925103cd9eb Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sun, 10 Dec 2023 19:50:22 -0300
Subject: Miscellaneous "Lib/test/" fixes for Haiku.
@@ -816,7 +816,6 @@ index ebfcffd..0517b87 100644
not sys.platform.startswith(('sunos', 'aix')):
# Somehow /dev/tty appears seekable on some BSDs
self.assertEqual(f.seekable(), False)
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index b6dbf3d..5d5e43f 100644
--- a/Lib/test/test_sysconfig.py
@@ -837,3 +836,69 @@ index b6dbf3d..5d5e43f 100644
--
2.42.1
From 54ad51aa2db24c579f90dc1170c74d98f40cc980 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sat, 10 Feb 2024 06:01:25 -0300
Subject: Fix build on nightlies, following the addition of kqueue.
See HaikuPorts issue #10001.
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index b7c6b1b..84bb449 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -2722,13 +2722,20 @@ _select_exec(PyObject *m)
#ifdef EVFILT_SIGNAL
PyModule_AddIntConstant(m, "KQ_FILTER_SIGNAL", EVFILT_SIGNAL);
#endif
+#ifdef EVFILT_TIMER
PyModule_AddIntConstant(m, "KQ_FILTER_TIMER", EVFILT_TIMER);
-
+#endif
/* event flags */
PyModule_AddIntConstant(m, "KQ_EV_ADD", EV_ADD);
PyModule_AddIntConstant(m, "KQ_EV_DELETE", EV_DELETE);
+#ifdef EV_ENABLE
PyModule_AddIntConstant(m, "KQ_EV_ENABLE", EV_ENABLE);
+#else
+ PyModule_AddIntConstant(m, "KQ_EV_ENABLE", 0); // "test_kqueue.py" assumes KQ_EV_ENABLE exists
+#endif
+#ifdef EV_DISABLE
PyModule_AddIntConstant(m, "KQ_EV_DISABLE", EV_DISABLE);
+#endif
PyModule_AddIntConstant(m, "KQ_EV_ONESHOT", EV_ONESHOT);
PyModule_AddIntConstant(m, "KQ_EV_CLEAR", EV_CLEAR);
@@ -2761,14 +2768,28 @@ _select_exec(PyObject *m)
/* PROC filter flags */
#ifdef EVFILT_PROC
PyModule_AddIntConstant(m, "KQ_NOTE_EXIT", NOTE_EXIT);
+#ifdef NOTE_FORK
PyModule_AddIntConstant(m, "KQ_NOTE_FORK", NOTE_FORK);
+#endif
+#ifdef NOTE_EXEC
PyModule_AddIntConstant(m, "KQ_NOTE_EXEC", NOTE_EXEC);
+#endif
+#ifdef NOTE_PCTRLMASK
PyModule_AddIntConstant(m, "KQ_NOTE_PCTRLMASK", NOTE_PCTRLMASK);
+#endif
+#ifdef NOTE_PDATAMASK
PyModule_AddIntConstant(m, "KQ_NOTE_PDATAMASK", NOTE_PDATAMASK);
+#endif
+#ifdef NOTE_TRACK
PyModule_AddIntConstant(m, "KQ_NOTE_TRACK", NOTE_TRACK);
+#endif
+#ifdef NOTE_CHILD
PyModule_AddIntConstant(m, "KQ_NOTE_CHILD", NOTE_CHILD);
+#endif
+#ifdef NOTE_TRACKERR
PyModule_AddIntConstant(m, "KQ_NOTE_TRACKERR", NOTE_TRACKERR);
+#endif
#endif
/* NETDEV filter flags */
--
2.42.1