python38: bump version.

patch socket_module.c for upstream bug #40628
This commit is contained in:
Jerome Duval
2020-05-15 15:44:28 +02:00
parent c92ab53eee
commit 8bf4e322fa
4 changed files with 130 additions and 43 deletions

View File

@@ -1,4 +1,4 @@
From 5a86655aff86a8588797bd27eedf31bdfe8807c7 Mon Sep 17 00:00:00 2001
From 9d575e09be9807ca02ebbeb5b4ccfb8f5e699a89 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 10 Apr 2014 16:03:33 +0000
Subject: initial Haiku patch
@@ -215,7 +215,7 @@ index 1cd9e56..893cf1f 100644
def test_mknod_dir_fd(self):
# Test using mknodat() to create a FIFO (the only use specified
diff --git a/Makefile.pre.in b/Makefile.pre.in
index beaccf5..8cbdddb 100644
index 35ca1a8..d316694 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -143,7 +143,7 @@ BINDIR= @bindir@
@@ -419,7 +419,7 @@ index 4363c0c..40994b0 100755
def main():
global filedict
diff --git a/configure.ac b/configure.ac
index 1ef0df7..a0d60f1 100644
index f9dabd8..f55f9f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1151,6 +1151,16 @@ if test $enable_shared = "yes"; then
@@ -487,7 +487,7 @@ index 1ef0df7..a0d60f1 100644
AC_MSG_CHECKING(for --with-libs)
AC_ARG_WITH(libs,
AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs]),
@@ -4296,6 +4313,7 @@ AC_CHECK_FUNC(__fpu_control,
@@ -4311,6 +4328,7 @@ AC_CHECK_FUNC(__fpu_control,
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
@@ -575,14 +575,14 @@ index 88cff61..7e0dc0a 100644
2.24.0
From ba498555a6561129cb85af96728e2abb80ac6df9 Mon Sep 17 00:00:00 2001
From 052d2b5998fc198fcc7dcdbbc99d15098690ba78 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 d1b6de5..6333785 100644
index 3f99be5..7114840 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1537,6 +1537,8 @@ class Popen(object):
@@ -613,7 +613,7 @@ index 3cf0683..adf3608 100644
2.24.0
From 5bd3ff9583dceb24e2af775b59037906fe7756d2 Mon Sep 17 00:00:00 2001
From b4a5b6f8165d5feecbb68454d327a7b9fd00fd9e Mon Sep 17 00:00:00 2001
From: Philippe Houdoin <philippe.houdoin@gmail.com>
Date: Wed, 24 May 2017 11:09:43 +0000
Subject: Implement CTypes's find_library for Haiku
@@ -697,14 +697,14 @@ index 97973bc..b2e4095 100644
2.24.0
From d6665e4df98dab9f724de1190825c14ca58ef84c Mon Sep 17 00:00:00 2001
From 1bda22cfae9cd3376da34240f1de6b3f10d8e426 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 82bff83..e66abd9 100755
index e052e51..d44cff1 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -522,6 +522,11 @@ def register_standard_browsers():
@@ -723,14 +723,14 @@ index 82bff83..e66abd9 100755
2.24.0
From 9cc979f3c67832887fcd11595976828d3243d148 Mon Sep 17 00:00:00 2001
From 45c95fc5412a0fc1e15c60271f605c4b6a71afbc Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 30 Nov 2019 23:26:57 +0100
Subject: don't reinit locks on fork.
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 6e01714..d84017a 100644
index b596f80..431f750 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -228,7 +228,7 @@ def _releaseLock():
@@ -745,3 +745,57 @@ index 6e01714..d84017a 100644
--
2.24.0
From 8401785ed0dcd5a7f372ac405126fe02154a6369 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()
upstream bug #40628 by Ryan C. Gordon
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 3173b3b..88b66ed 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -3101,7 +3101,7 @@ sock_connect(PySocketSockObject *s, PyObject *addro)
return NULL;
res = internal_connect(s, SAS2SA(&addrbuf), addrlen, 1);
- if (res < 0)
+ if (res == -1)
return NULL;
Py_RETURN_NONE;
@@ -3127,7 +3127,7 @@ sock_connect_ex(PySocketSockObject *s, PyObject *addro)
return NULL;
res = internal_connect(s, SAS2SA(&addrbuf), addrlen, 0);
- if (res < 0)
+ if (res == -1)
return NULL;
return PyLong_FromLong((long) res);
--
2.24.0
From 5a948cadd0123f22c3b747d9e9cba9a9d9e22370 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.
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 16812ec..54935bf 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -230,7 +230,7 @@ def _releaseLock():
# Prevent a held logging lock from blocking a child from logging.
-if not hasattr(os, 'register_at_fork'): # Windows and friends.
+if sys.platform.startswith('haiku') or not hasattr(os, 'register_at_fork'): # Windows and friends.
def _register_at_fork_reinit_lock(instance):
pass # no-op when os.register_at_fork does not exist.
else:
--
2.21.0

View File

@@ -1,4 +1,4 @@
From a98a3ada8aa548353cc3c8c30f3249ca9e0a5f8a Mon Sep 17 00:00:00 2001
From 8c20f44969e26aae573e7ea3cd01d6481496096b Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 10 Apr 2014 16:03:33 +0000
Subject: initial Haiku patch
@@ -228,7 +228,7 @@ index 9bdd284..0491681 100644
def test_mknod_dir_fd(self):
# Test using mknodat() to create a FIFO (the only use specified
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 502317a..ae9fe21 100644
index a914a9c..cc8522d 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -142,7 +142,7 @@ BINDIR= @bindir@
@@ -241,7 +241,7 @@ index 502317a..ae9fe21 100644
ABIFLAGS= @ABIFLAGS@
diff --git a/Modules/resource.c b/Modules/resource.c
index 87c72e7..af58ac5 100644
index afde03c..0173fea 100644
--- a/Modules/resource.c
+++ b/Modules/resource.c
@@ -99,6 +99,7 @@ resource_getrusage_impl(PyObject *module, int who)
@@ -276,7 +276,7 @@ index 87c72e7..af58ac5 100644
if (PyErr_Occurred()) {
Py_DECREF(result);
return NULL;
@@ -366,19 +382,19 @@ PyInit_resource(void)
@@ -376,19 +392,19 @@ PyInit_resource(void)
(PyObject*) &StructRUsageType);
/* insert constants */
@@ -300,7 +300,7 @@ index 87c72e7..af58ac5 100644
PyModule_AddIntMacro(m, RLIMIT_STACK);
#endif
@@ -390,31 +406,31 @@ PyInit_resource(void)
@@ -400,31 +416,31 @@ PyInit_resource(void)
PyModule_AddIntMacro(m, RLIMIT_NOFILE);
#endif
@@ -340,10 +340,10 @@ index 87c72e7..af58ac5 100644
#endif
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 594a0d6..c3f6534 100644
index 5dc5f4e..7f1727a 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -7418,7 +7418,9 @@ PyInit__socket(void)
@@ -7419,7 +7419,9 @@ PyInit__socket(void)
/* SOCK_RAW is marked as optional in the POSIX specification */
PyModule_AddIntMacro(m, SOCK_RAW);
#endif
@@ -419,10 +419,10 @@ index ea37c04..d6dc9e9 100755
def main():
global filedict
diff --git a/configure.ac b/configure.ac
index a189d42..b08b42f 100644
index d8de9d4..4c709e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1129,6 +1129,16 @@ if test $enable_shared = "yes"; then
@@ -1135,6 +1135,16 @@ if test $enable_shared = "yes"; then
PY3LIBRARY=libpython3.so
fi
;;
@@ -439,7 +439,7 @@ index a189d42..b08b42f 100644
hp*|HP*)
case `uname -m` in
ia64)
@@ -1204,6 +1214,7 @@ AC_PROG_MKDIR_P
@@ -1210,6 +1220,7 @@ AC_PROG_MKDIR_P
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
@@ -447,7 +447,7 @@ index a189d42..b08b42f 100644
CYGWIN*) LN="ln -s";;
*) LN=ln;;
esac
@@ -2591,7 +2602,7 @@ then
@@ -2597,7 +2608,7 @@ then
BLDSHARED="$LDSHARED"
fi
;;
@@ -456,7 +456,7 @@ index a189d42..b08b42f 100644
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
FreeBSD*)
@@ -2658,7 +2669,7 @@ then
@@ -2664,7 +2675,7 @@ then
else CCSHARED="+z";
fi;;
Linux-android*) ;;
@@ -465,7 +465,7 @@ index a189d42..b08b42f 100644
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
OpenUNIX*|UnixWare*)
if test "$GCC" = "yes"
@@ -2686,7 +2697,7 @@ then
@@ -2692,7 +2703,7 @@ then
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
@@ -474,7 +474,7 @@ index a189d42..b08b42f 100644
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
LINKFORSHARED="$extra_undefs -framework CoreFoundation"
@@ -2935,6 +2946,12 @@ LDFLAGS="-fsanitize=undefined $LDFLAGS"
@@ -2941,6 +2952,12 @@ LDFLAGS="-fsanitize=undefined $LDFLAGS"
AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
@@ -487,7 +487,7 @@ index a189d42..b08b42f 100644
AC_MSG_CHECKING(for --with-libs)
AC_ARG_WITH(libs,
AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs]),
@@ -4296,6 +4313,7 @@ AC_CHECK_FUNC(__fpu_control,
@@ -4317,6 +4334,7 @@ AC_CHECK_FUNC(__fpu_control,
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
@@ -496,7 +496,7 @@ index a189d42..b08b42f 100644
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff --git a/setup.py b/setup.py
index 20d7f35..148642c 100644
index b168ed4..5f94a60 100644
--- a/setup.py
+++ b/setup.py
@@ -45,6 +45,7 @@ CYGWIN = (HOST_PLATFORM == 'cygwin')
@@ -581,17 +581,17 @@ index 20d7f35..148642c 100644
return
--
2.21.0
2.24.0
From 0575b9f2e856ddd6cf28260e70acdeaf9809198a Mon Sep 17 00:00:00 2001
From 8642c35ff9d15c673485681da23a0838ff0158ac 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 85b9ea0..855d399 100644
index 5c2c2f0..760deab 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1690,6 +1690,8 @@ class Popen(object):
@@ -619,10 +619,10 @@ index e693e53..30ac104 100644
*--cur = Py_hexdigits[saved_errno % 16];
saved_errno /= 16;
--
2.21.0
2.24.0
From a631af68871420059e2c4b46eb943c29385ce183 Mon Sep 17 00:00:00 2001
From 763eb6f482bb5161775f997766fc156939071a02 Mon Sep 17 00:00:00 2001
From: Philippe Houdoin <philippe.houdoin@gmail.com>
Date: Wed, 24 May 2017 11:09:43 +0000
Subject: Implement CTypes's find_library for Haiku
@@ -703,20 +703,20 @@ index 97973bc..b2e4095 100644
print(cdll.LoadLibrary("libm.so"))
print(cdll.LoadLibrary("libcrypt.so"))
--
2.21.0
2.24.0
From 6cf94d0677df23ea9c042ded31f03ed7cb8fcb17 Mon Sep 17 00:00:00 2001
From 9c6c161c3019b69e72121a5e5593212742d250b2 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 0af36c4..0a39655 100755
index 9c73bcf..1a816e1 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -527,6 +527,11 @@ def register_standard_browsers():
@@ -543,6 +543,11 @@ def register_standard_browsers():
"netscape", "opera", iexplore):
if shutil.which(browser):
register(browser, None, BackgroundBrowser(browser))
@@ -729,17 +729,17 @@ index 0af36c4..0a39655 100755
# Prefer X browsers if present
if os.environ.get("DISPLAY"):
--
2.21.0
2.24.0
From 5a948cadd0123f22c3b747d9e9cba9a9d9e22370 Mon Sep 17 00:00:00 2001
From a1c29f7cdde22602c40a1bb48b2c664204fb04b3 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.
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 16812ec..54935bf 100644
index 0cfaec8..0cc63e2 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -230,7 +230,7 @@ def _releaseLock():
@@ -752,5 +752,38 @@ index 16812ec..54935bf 100644
pass # no-op when os.register_at_fork does not exist.
else:
--
2.21.0
2.24.0
From 177f35afacbb56ded7e841d133bac190b4bedd2e 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()
upstream bug #40628 by Ryan C. Gordon
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 7f1727a..df98f52 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -3242,7 +3242,7 @@ sock_connect(PySocketSockObject *s, PyObject *addro)
}
res = internal_connect(s, SAS2SA(&addrbuf), addrlen, 1);
- if (res < 0)
+ if (res == -1)
return NULL;
Py_RETURN_NONE;
@@ -3273,7 +3273,7 @@ sock_connect_ex(PySocketSockObject *s, PyObject *addro)
}
res = internal_connect(s, SAS2SA(&addrbuf), addrlen, 0);
- if (res < 0)
+ if (res == -1)
return NULL;
return PyLong_FromLong((long) res);
--
2.24.0

View File

@@ -11,7 +11,7 @@ OSI-approved open source license.
HOMEPAGE="https://www.python.org"
LICENSE="Python"
COPYRIGHT="1990-2018 Python Software Foundation"
REVISION="1"
REVISION="2"
SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz"
CHECKSUM_SHA256="06a0a9f1bf0d8cd1e4121194d666c4e28ddae4dd54346de6c343206599f02136"
SOURCE_DIR="Python-$portVersion"

View File

@@ -11,9 +11,9 @@ OSI-approved open source license.
HOMEPAGE="https://www.python.org"
LICENSE="Python"
COPYRIGHT="1990-2020 Python Software Foundation"
REVISION="2"
REVISION="1"
SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz"
CHECKSUM_SHA256="2646e7dc233362f59714c6193017bb2d6f7b38d6ab4a0cb5fbac5c36c4d845df"
CHECKSUM_SHA256="dfab5ec723c218082fe3d5d7ae17ecbdebffa9a1aea4d64aa3a2ecdd2e795864"
SOURCE_DIR="Python-$portVersion"
PATCHES="python3-$portVersion.patchset"
if [ "$secondaryArchSuffix" = _x86 ] ; then