From 9a9b176eb7e052af84c01c0cfb3231e51f980f2d Mon Sep 17 00:00:00 2001 From: samschott Date: Tue, 9 May 2023 10:24:29 +0200 Subject: [PATCH 1/6] gh-104180: Read SOCKS proxies from macOS System Configuration (#104181) read SOCKS proxies from macOS System Configuration in ``urllib.request``. --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Oleg Iarygin --- .../macOS/2023-05-04-21-47-59.gh-issue-104180.lEJCwd.rst | 2 ++ Modules/_scproxy.c | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 Misc/NEWS.d/next/macOS/2023-05-04-21-47-59.gh-issue-104180.lEJCwd.rst diff --git a/Misc/NEWS.d/next/macOS/2023-05-04-21-47-59.gh-issue-104180.lEJCwd.rst b/Misc/NEWS.d/next/macOS/2023-05-04-21-47-59.gh-issue-104180.lEJCwd.rst new file mode 100644 index 00000000000000..b6b18dcfd81394 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2023-05-04-21-47-59.gh-issue-104180.lEJCwd.rst @@ -0,0 +1,2 @@ +Support reading SOCKS proxy configuration from macOS System Configuration. +Patch by Sam Schott. diff --git a/Modules/_scproxy.c b/Modules/_scproxy.c index e66918016b8da6..0df0324df55f7d 100644 --- a/Modules/_scproxy.c +++ b/Modules/_scproxy.c @@ -206,6 +206,11 @@ get_proxies(PyObject* Py_UNUSED(mod), PyObject *Py_UNUSED(ignored)) kSCPropNetProxiesGopherProxy, kSCPropNetProxiesGopherPort); if (r == -1) goto error; + r = set_proxy(result, "socks", proxyDict, + kSCPropNetProxiesSOCKSEnable, + kSCPropNetProxiesSOCKSProxy, + kSCPropNetProxiesSOCKSPort); + if (r == -1) goto error; CFRelease(proxyDict); return result; From 03029ace924f7dac7ef49eee3417e0af6623060d Mon Sep 17 00:00:00 2001 From: Zhang Na <44800775+loongson-zn@users.noreply.github.com> Date: Tue, 9 May 2023 17:19:40 +0800 Subject: [PATCH 2/6] gh-90656: Add platform triplets for 64-bit LoongArch (LA64) (#30939) Signed-off-by: Zhang Na Co-authored-by: WANG Xuerui --- Doc/whatsnew/3.12.rst | 8 ++++++++ .../2022-06-20-15-15-11.gh-issue-90656.kFBbKe.rst | 7 +++++++ configure | 14 ++++++++++++++ configure.ac | 14 ++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2022-06-20-15-15-11.gh-issue-90656.kFBbKe.rst diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 65b3e9ffb8072d..fe6ad575f71720 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -1169,6 +1169,14 @@ Build Changes optimization levels (0, 1, 2) at once. (Contributed by Victor Stinner in :gh:`99289`.) +* Add platform triplets for 64-bit LoongArch: + + * loongarch64-linux-gnusf + * loongarch64-linux-gnuf32 + * loongarch64-linux-gnu + + (Contributed by Zhang Na in :gh:`90656`.) + C API Changes ============= diff --git a/Misc/NEWS.d/next/Build/2022-06-20-15-15-11.gh-issue-90656.kFBbKe.rst b/Misc/NEWS.d/next/Build/2022-06-20-15-15-11.gh-issue-90656.kFBbKe.rst new file mode 100644 index 00000000000000..dfe71a5552070d --- /dev/null +++ b/Misc/NEWS.d/next/Build/2022-06-20-15-15-11.gh-issue-90656.kFBbKe.rst @@ -0,0 +1,7 @@ +Add platform triplets for 64-bit LoongArch: + +* loongarch64-linux-gnusf +* loongarch64-linux-gnuf32 +* loongarch64-linux-gnu + +Patch by Zhang Na. diff --git a/configure b/configure index b8fa9d66e735dd..c9ea72cf6efacf 100755 --- a/configure +++ b/configure @@ -6143,6 +6143,20 @@ cat > conftest.c <=6) && defined(_MIPSEL) diff --git a/configure.ac b/configure.ac index 0940b93c25f7bf..10672bd3761da8 100644 --- a/configure.ac +++ b/configure.ac @@ -959,6 +959,20 @@ cat > conftest.c <=6) && defined(_MIPSEL) From 41aff464cef83d2655029ddd180a51110e8d7f8e Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Tue, 9 May 2023 12:29:00 +0200 Subject: [PATCH 3/6] require-pr-label.yml: Add missing "permissions:" (#104309) --- .github/workflows/require-pr-label.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/require-pr-label.yml b/.github/workflows/require-pr-label.yml index 916bbeb4352734..88aaea039f04f4 100644 --- a/.github/workflows/require-pr-label.yml +++ b/.github/workflows/require-pr-label.yml @@ -4,6 +4,10 @@ on: pull_request: types: [opened, reopened, labeled, unlabeled, synchronize] +permissions: + issues: read + pull-requests: read + jobs: label: name: DO-NOT-MERGE / unresolved review From 9196da417d20e1484e23b3c80483b0222abaadf2 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 9 May 2023 13:33:36 +0100 Subject: [PATCH 4/6] gh-103193: Fix refleaks in `test_inspect` and `test_typing` (#104320) --- Lib/test/libregrtest/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py index fb13fa0e243ba7..fd46819fd903fe 100644 --- a/Lib/test/libregrtest/utils.py +++ b/Lib/test/libregrtest/utils.py @@ -210,6 +210,13 @@ def clear_caches(): else: fractions._hash_algorithm.cache_clear() + try: + inspect = sys.modules['inspect'] + except KeyError: + pass + else: + inspect._shadowed_dict_from_mro_tuple.cache_clear() + def get_build_info(): # Get most important configure and build options as a list of strings. From 85f981880ae9591ba577e44d2945a771078a7c35 Mon Sep 17 00:00:00 2001 From: Itamar Ostricher Date: Tue, 9 May 2023 05:39:59 -0700 Subject: [PATCH 5/6] gh-97696: Move around and update the whatsnew entry for asyncio eager task factory (#104298) --- Doc/whatsnew/3.12.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index fe6ad575f71720..12d357f117b1b6 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -282,6 +282,11 @@ asyncio writing to sockets and uses :meth:`~socket.socket.sendmsg` if the platform supports it. (Contributed by Kumar Aditya in :gh:`91166`.) +* Added :func:`asyncio.eager_task_factory` and :func:`asyncio.create_eager_task_factory` + functions to allow opting an event loop in to eager task execution, + making some use-cases 2x to 5x faster. + (Contributed by Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`) + * On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default if :func:`os.pidfd_open` is available and functional instead of :class:`~asyncio.ThreadedChildWatcher`. @@ -644,11 +649,6 @@ Optimizations * Speed up :class:`asyncio.Task` creation by deferring expensive string formatting. (Contributed by Itamar O in :gh:`103793`.) -* Added :func:`asyncio.eager_task_factory` and :func:`asyncio.create_eager_task_factory` - functions to allow opting an event loop in to eager task execution, - speeding up some use-cases by up to 50%. - (Contributed by Jacob Bower & Itamar O in :gh:`102853`) - CPython bytecode changes ======================== From c21f82876089f3e9a7b1e706c029664b799fa659 Mon Sep 17 00:00:00 2001 From: chgnrdv <52372310+chgnrdv@users.noreply.github.com> Date: Tue, 9 May 2023 15:41:09 +0300 Subject: [PATCH 6/6] gh-104276: Make `_struct.unpack_iterator` type use type flag instead of custom constructor (#104277) --- Modules/_struct.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Modules/_struct.c b/Modules/_struct.c index 26434f714de5cc..4f9478bd98095d 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -1832,11 +1832,6 @@ unpackiter_iternext(unpackiterobject *self) return result; } -PyObject *unpackiter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - PyErr_Format(PyExc_TypeError, "Cannot create '%.200s objects", _PyType_Name(type)); - return NULL; -} - static PyType_Slot unpackiter_type_slots[] = { {Py_tp_dealloc, unpackiter_dealloc}, {Py_tp_getattro, PyObject_GenericGetAttr}, @@ -1844,7 +1839,6 @@ static PyType_Slot unpackiter_type_slots[] = { {Py_tp_iter, PyObject_SelfIter}, {Py_tp_iternext, unpackiter_iternext}, {Py_tp_methods, unpackiter_methods}, - {Py_tp_new, unpackiter_new}, {0, 0}, }; @@ -1853,7 +1847,7 @@ static PyType_Spec unpackiter_type_spec = { sizeof(unpackiterobject), 0, (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | - Py_TPFLAGS_IMMUTABLETYPE), + Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION), unpackiter_type_slots };