python3.12: update to version 3.12.1 (#9875)

This commit is contained in:
OscarL
2023-12-11 04:25:15 -03:00
committed by GitHub
parent c7132aa43c
commit 015f20ff8f
2 changed files with 101 additions and 94 deletions

View File

@@ -1,4 +1,4 @@
From df5c54613613970c62e0bb947915137a4cba20dc Mon Sep 17 00:00:00 2001
From 31f0964946800a1164bbfcaab683f91e6ece1160 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 09ceccd..921668a 100644
index 7af1845..e9083a1 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -147,7 +147,7 @@ BINDIR= @bindir@
@@ -184,10 +184,10 @@ index 13f1115..45f477c 100644
else
PyErr_SetString(PyExc_KeyError, "getspnam(): name not found");
diff --git a/configure.ac b/configure.ac
index ba768ae..7d4c2a2 100644
index bd2be94..6abc95c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1519,6 +1519,16 @@ if test $enable_shared = "yes"; then
@@ -1524,6 +1524,16 @@ if test $enable_shared = "yes"; then
PY3LIBRARY=libpython3.so
fi
;;
@@ -204,7 +204,7 @@ index ba768ae..7d4c2a2 100644
hp*|HP*)
case `uname -m` in
ia64)
@@ -1664,6 +1674,7 @@ AC_PROG_MKDIR_P
@@ -1669,6 +1679,7 @@ AC_PROG_MKDIR_P
AC_SUBST([LN])
if test -z "$LN" ; then
case $ac_sys_system in
@@ -212,7 +212,7 @@ index ba768ae..7d4c2a2 100644
CYGWIN*) LN="ln -s";;
*) LN=ln;;
esac
@@ -3405,7 +3416,7 @@ then
@@ -3415,7 +3426,7 @@ then
else CCSHARED="+z";
fi;;
Linux-android*) ;;
@@ -221,7 +221,7 @@ index ba768ae..7d4c2a2 100644
Emscripten*|WASI*)
AS_VAR_IF([enable_wasm_dynamic_linking], [yes], [
CCSHARED="-fPIC"
@@ -3438,7 +3449,7 @@ then
@@ -3448,7 +3459,7 @@ then
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
@@ -230,7 +230,7 @@ index ba768ae..7d4c2a2 100644
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
LINKFORSHARED="$extra_undefs -framework CoreFoundation"
@@ -5585,6 +5596,7 @@ AC_CHECK_FUNC([__fpu_control],
@@ -5595,6 +5606,7 @@ AC_CHECK_FUNC([__fpu_control],
AC_SUBST([LIBM])
case $ac_sys_system in
Darwin) ;;
@@ -239,10 +239,10 @@ index ba768ae..7d4c2a2 100644
esac
AC_MSG_CHECKING([for --with-libm=STRING])
--
2.42.0
2.42.1
From 8060168bd8aad149b472d7df7eea26de9c762b6b Mon Sep 17 00:00:00 2001
From 070a7808197ff721ae67f73272b31ee35f0f8dc8 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
@@ -262,10 +262,10 @@ index 6df5dd5..39dde15 100644
if child_exec_never_called:
err_msg = ""
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index 2d88f5e..4f4107d 100644
index 85634d7..afe4d31 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -749,6 +749,10 @@ error:
@@ -751,6 +751,10 @@ error:
char *cur;
_Py_write_noraise(errpipe_write, "OSError:", 8);
cur = hex_errno + sizeof(hex_errno);
@@ -277,10 +277,10 @@ index 2d88f5e..4f4107d 100644
*--cur = Py_hexdigits[saved_errno % 16];
saved_errno /= 16;
--
2.42.0
2.42.1
From 4612cb6c4e15103be299909cd0e70307e9040e2f Mon Sep 17 00:00:00 2001
From 3b96d73ce97e26367a0347e3c41657cbc1e4723a 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..6912890 100644
index 0c2510e..6b88fc8 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -1,4 +1,5 @@
@@ -374,10 +374,10 @@ index 0c2510e..6912890 100644
print(cdll.LoadLibrary("libm.so"))
print(cdll.LoadLibrary("libcrypt.so"))
--
2.42.0
2.42.1
From 8ee1d200626134a91f104725bb98855c5b233156 Mon Sep 17 00:00:00 2001
From ca75abd88def4395a64735827f5b7109fbb7abac 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
@@ -401,10 +401,10 @@ index e0170af..8567cdd 100755
# First try to use the default Windows browser
register("windows-default", WindowsDefault)
--
2.42.0
2.42.1
From 14eb288ddca79c42e4d8ab2edaba990a04e3dc7e Mon Sep 17 00:00:00 2001
From fbff72b7fde21f86e24b6a7f1349db2e1e457e65 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.
@@ -424,10 +424,10 @@ index 056380f..4836719 100644
pass # no-op when os.register_at_fork does not exist.
else:
--
2.42.0
2.42.1
From 607f0a89afcf78f21a9341a861ff392bf86c9dd4 Mon Sep 17 00:00:00 2001
From 1f4b4d2b4791e6f774d954a03456e60013d2a3e5 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 4ec68e2..ce5940a 100644
index de7229d..b62a0a2 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -3489,7 +3489,7 @@ sock_connect(PySocketSockObject *s, PyObject *addro)
@@ -457,20 +457,20 @@ index 4ec68e2..ce5940a 100644
return PyLong_FromLong((long) res);
--
2.42.0
2.42.1
From 959d4fd2ff3ebe73727ad275c2a48018bab26f11 Mon Sep 17 00:00:00 2001
From 98a311772fba924c07eb3a32cbac92f95279fe29 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 b9ca286..8badc69 100644
index 0ac5a8d..86c1d7e 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -3150,11 +3150,14 @@ static PyObject *
@@ -3173,11 +3173,14 @@ static PyObject *
os_ttyname_impl(PyObject *module, int fd)
/*[clinic end generated code: output=c424d2e9d1cd636a input=9ff5a58b08115c55]*/
{
@@ -487,10 +487,10 @@ index b9ca286..8badc69 100644
if (buffer == NULL) {
return PyErr_NoMemory();
--
2.42.0
2.42.1
From 2b11dd68750848d57c2d29e9d03905664989f826 Mon Sep 17 00:00:00 2001
From 56199bd790240009ec5cdbbd74144142579db4e9 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,10 +501,10 @@ 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 e032325..ffff694 100644
index 196b7d2..3be21d5 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -609,7 +609,7 @@ class IOTest(unittest.TestCase):
@@ -613,7 +613,7 @@ class IOTest(unittest.TestCase):
# On Windows and Mac OSX this test consumes large resources; It takes
# a long time to build the >2 GiB file and takes >2 GiB of disk space
# therefore the resource must be enabled to run this test.
@@ -540,10 +540,10 @@ index dfcf303..886d3af 100644
'test requires %s bytes and a long time to run' % str(0x180000000))
f = open(TESTFN, 'w+b')
--
2.42.0
2.42.1
From e2bd114cfa56d90620bccd2985e87c51ee8d34cb Mon Sep 17 00:00:00 2001
From aa3d40bca38365054b490204b66d98506a491a45 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
@@ -625,10 +625,10 @@ index 122d441..a27fa57 100644
return {
'prefix': 'nt',
--
2.42.0
2.42.1
From 3e16846d599f86dc1060af64ee270aaf450d628a Mon Sep 17 00:00:00 2001
From e118085cfba9fad7fce67c8fb65a39b471491010 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.
@@ -690,10 +690,10 @@ index a27fa57..80e1c3f 100644
_HAS_USER_BASE = (_getuserbase() is not None)
--
2.42.0
2.42.1
From 374f9308fed872a638ea31a041ff2e476bc95220 Mon Sep 17 00:00:00 2001
From 2d7c447d9320004cfbcd91742424e73023c6db07 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.
@@ -724,64 +724,10 @@ index e783664..da965d6 100644
readline.read_history_file(history)
except OSError:
--
2.42.0
2.42.1
From a4920c9e12d2225ec24df04ef1686a6ad63adb31 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sun, 8 Oct 2023 02:17:22 -0300
Subject: Miscellaneous "Lib/test/" fixes for Haiku.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
test_fileio.py fix from "initial Haiku patch" by Jérôme Duval.
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index 55e0619..24a811e 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -5917,6 +5917,9 @@ def pairs(iterable):
class ZoneInfo(tzinfo):
zoneroot = '/usr/share/zoneinfo'
+ if sys.platform.startswith('haiku'):
+ zoneroot = '/system/data/zoneinfo'
+
def __init__(self, ut, ti):
"""
diff --git a/Lib/test/test_email/test_utils.py b/Lib/test/test_email/test_utils.py
index 25fa48c..ee46514 100644
--- a/Lib/test/test_email/test_utils.py
+++ b/Lib/test/test_email/test_utils.py
@@ -145,7 +145,8 @@ class LocaltimeTests(unittest.TestCase):
# XXX: Need a more robust test for Olson's tzdata
@unittest.skipIf(sys.platform.startswith('win'),
"Windows does not use Olson's TZ database")
- @unittest.skipUnless(os.path.exists('/usr/share/zoneinfo') or
+ @unittest.skipUnless(os.path.exists('/system/data/zoneinfo') or
+ os.path.exists('/usr/share/zoneinfo') or
os.path.exists('/usr/lib/zoneinfo'),
"Can't find the Olson's TZ database")
@test.support.run_with_tz('Europe/Kiev')
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py
index ebfcffd..0517b87 100644
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -391,6 +391,7 @@ class OtherFileTests:
self.assertEqual(f.writable(), True)
if sys.platform != "darwin" and \
'bsd' not in sys.platform and \
+ 'haiku' not in sys.platform and \
not sys.platform.startswith(('sunos', 'aix')):
# Somehow /dev/tty appears seekable on some BSDs
self.assertEqual(f.seekable(), False)
--
2.42.0
From b12c15d58f31c69459b41bf652e9f271e0a1604f Mon Sep 17 00:00:00 2001
From f3d0759f2a1c943a35509681acd92fe183c7ffbb 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.
@@ -831,5 +777,63 @@ index de8a264..02a301e 100644
# on macOS since macOS 10.14 (Mojave). Use spawn by default instead.
_default_context = DefaultContext(_concrete_contexts['spawn'])
--
2.42.0
2.42.1
From 9f2791c8db4df7c11923fa164291eff3fb44a769 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.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
test_fileio.py fix from "initial Haiku patch" by Jérôme Duval.
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index 55e0619..24a811e 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -5917,6 +5917,9 @@ def pairs(iterable):
class ZoneInfo(tzinfo):
zoneroot = '/usr/share/zoneinfo'
+ if sys.platform.startswith('haiku'):
+ zoneroot = '/system/data/zoneinfo'
+
def __init__(self, ut, ti):
"""
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py
index ebfcffd..0517b87 100644
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -391,6 +391,7 @@ class OtherFileTests:
self.assertEqual(f.writable(), True)
if sys.platform != "darwin" and \
'bsd' not in sys.platform and \
+ 'haiku' not in sys.platform and \
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
+++ b/Lib/test/test_sysconfig.py
@@ -335,9 +335,10 @@ class TestSysConfig(unittest.TestCase):
self.assertTrue(os.path.isfile(config_h), config_h)
def test_get_scheme_names(self):
- wanted = ['nt', 'posix_home', 'posix_prefix', 'posix_venv', 'nt_venv', 'venv']
+ wanted = ['nt', 'posix_home', 'posix_prefix', 'posix_venv', 'nt_venv', 'venv', 'haiku',
+ 'haiku_home', 'haiku_vendor']
if HAS_USER_BASE:
- wanted.extend(['nt_user', 'osx_framework_user', 'posix_user'])
+ wanted.extend(['nt_user', 'osx_framework_user', 'posix_user', 'haiku_user'])
self.assertEqual(get_scheme_names(), tuple(sorted(wanted)))
@skip_unless_symlink
--
2.42.1

View File

@@ -13,7 +13,7 @@ LICENSE="Python"
COPYRIGHT="1990-2023 Python Software Foundation"
REVISION="1"
SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-${portVersion}.tar.xz"
CHECKSUM_SHA256="795c34f44df45a0e9b9710c8c71c15c671871524cd412ca14def212e8ccb155d"
CHECKSUM_SHA256="8dfb8f426fcd226657f9e2bd5f1e96e53264965176fa17d32658e873591aeb21"
SOURCE_DIR="Python-${portVersion}"
pyShortVer="${portVersion%.*}"
@@ -313,6 +313,9 @@ TEST()
-x test_mailbox
-x test_tempfile
-x test_thread
# 3.12.1
-x test_queue
)
local -x LOGNAME=buildbot # this skips tests_tools/test_freeze, copied from Gentoo's ebuild