Commit graph

117842 commits

Author SHA1 Message Date
Miss Islington (bot)
19863c36d2
[3.12] Docs: Argument Clinic: Move the CConverter class to the reference (GH-107671) (#107701)
Docs: Argument Clinic: Move the CConverter class to the reference (GH-107671)
(cherry picked from commit a6675b1a59)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-08-07 12:03:07 +02:00
Miss Islington (bot)
ab1988d5a6
[3.12] Improve cross-references in runpy docs (GH-107673) (#107698)
Improve cross-references in `runpy` docs (GH-107673)

- Add links to `__main__` and `sys.path` where appropriate
- Ensure each paragraph never has more than one link to the same thing, to avoid visual clutter from too many links
(cherry picked from commit 4e242d1ffb)

Co-authored-by: Kamil Turek <kamil.turek@hotmail.com>
2023-08-07 00:48:48 +02:00
Miss Islington (bot)
e94548479a
[3.12] Docs: Argument Clinic: Improve 'How to write a custom converter' (GH-107328) (#107669)
Docs: Argument Clinic: Improve 'How to write a custom converter' (GH-107328)

- Omit unneccesary wording and sentences
- Don't mention implementation details (no digression, explanation)

(cherry picked from commit 4a5b4221e3)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-08-06 22:09:00 +02:00
Miss Islington (bot)
e950d70451
[3.12] Docs: Fix Sphinx annotations in Doc/library/ctypes.rst (GH-107672) (#107685)
Docs: Fix Sphinx annotations in Doc/library/ctypes.rst (GH-107672)
(cherry picked from commit 71a7c96ffe)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-06 22:08:38 +02:00
Miss Islington (bot)
6b02734af7
[3.12] GH-84435: Make pyspecific directives translatable (GH-19470) (#107681)
GH-84435: Make pyspecific directives translatable (GH-19470)
(cherry picked from commit ecb05e0b98)

Co-authored-by: cocoatomo <cocoatomo77@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-08-06 16:17:45 +02:00
Miss Islington (bot)
c80112906a
[3.12] Do not use deprecated `logger.warn()` in pyspecific (GH-107694) (#107695)
Do not use deprecated ``logger.warn()`` in pyspecific (GH-107694)
(cherry picked from commit 9564e31cbc)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-06 16:17:20 +02:00
Miss Islington (bot)
cc766c0b15
[3.12] Docs: skip python-docs-theme 2023.7 to fix mobile menu (GH-107666) (#107690)
Docs: skip python-docs-theme 2023.7 to fix mobile menu (GH-107666)
(cherry picked from commit 9641c4d8e2)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-08-06 15:15:39 +02:00
Miss Islington (bot)
6132f7099d
[3.12] gh-107662: Switch 'any' and 'anext' in functions.rst (GH-107663) (#107664)
gh-107662: Switch 'any' and 'anext' in functions.rst (GH-107663)

Order was reversed in index at top, not in body.
(cherry picked from commit 9ebc6ecbc3)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-08-06 15:14:42 +02:00
Thomas Wouters
4edff44e7d Post 3.12.0rc1 2023-08-06 14:50:13 +02:00
Thomas Wouters
63bcd91dac Python 3.12.0rc1 2023-08-05 14:11:50 +02:00
Miss Islington (bot)
236cdadb08
[3.12] gh-107432 Fix incorrect indentation in annotations HOWTO (GH-107445) (#107654)
gh-107432 Fix incorrect indentation in annotations HOWTO (GH-107445)

gh-107432 Fix incorrect indentation in annotations document

Body text in https://docs.python.org/3/howto/annotations.html was
indented throughout, and was being rendered in blockquote elements.
(cherry picked from commit 5e2746d6e2)

Co-authored-by: Daniele Procida <daniele@vurt.org>
2023-08-05 14:08:04 +02:00
Eric Snow
6e4eec7606
[3.12] gh-107630: Revert "[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567) (#107599)" (#107648)
Revert "[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567) (#107599)"

This reverts commit 58af2293c5.
2023-08-05 13:44:54 +02:00
Miss Islington (bot)
0e7a4f7336
[3.12] Docs: Only include Plausible for html, not for epub etc (GH-107637) (#107642)
Docs: Only include Plausible for html, not for epub etc (GH-107637)

Only include Plausible for html, not for epub etc
(cherry picked from commit 904b5319b3)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-08-04 22:20:46 +02:00
Hugo van Kemenade
28a9849d7c
[3.12] Docs: upgrade to python-docs-theme 2023.7 (GH-107617) (#107633)
(cherry picked from commit 19f32b24b2)
2023-08-04 22:20:20 +02:00
T. Wouters
310e1460c0
[3.12] Update the expected bytecode magic in test_importlib.test_util (#107626)
Update the expected bytecode magic in test_importlib.test_util to the final
3.12 magic number. From now on it's not allowed to change for any 3.12
release.
2023-08-04 13:41:03 +00:00
Miss Islington (bot)
98902d6c05
[3.12] GH-107263: Increase C stack limit for most functions, except _PyEval_EvalFrameDefault() (GH-107535) (#107618)
GH-107263: Increase C stack limit for most functions, except `_PyEval_EvalFrameDefault()` (GH-107535)

* Set C recursion limit to 1500, set cost of eval loop to 2 frames, and compiler mutliply to 2.
(cherry picked from commit fa45958450)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2023-08-04 12:25:51 +02:00
Miss Islington (bot)
58af2293c5
[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567) (#107599)
gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567)

The linked list of objects was a global variable, which broke isolation between interpreters, causing crashes. To solve this, we've moved the linked list to each interpreter.
(cherry picked from commit 58ef741867)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-08-04 00:18:29 +02:00
Miss Islington (bot)
d2c7b25afb
[3.12] gh-107576: Ensure __orig_bases__ are our own in get_original_bases (GH-107584) (#107592)
gh-107576: Ensure `__orig_bases__` are our own in `get_original_bases` (GH-107584)
(cherry picked from commit ed4a978449)

Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
Co-authored-by: Chris Bouchard <chris@upliftinglemma.net>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-08-03 17:07:43 +02:00
Miss Islington (bot)
93fcf75878
[3.12] gh-107077: Raise SSLCertVerificationError even if the error is set via SSL_ERROR_SYSCALL (GH-107586) (#107587)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: T. Wouters <thomas@python.org>
2023-08-03 15:09:29 +01:00
Miss Islington (bot)
12d1c494ae
[3.12] gh-107471: Fix Refleaks in test_import (gh-107569) (#107571)
gh-107471: Fix Refleaks in test_import (gh-107569)

gh-107184 introduced a refleak in test_import.SubinterpImportTests (specifically test_singlephase_check_with_setting_and_override and test_single_init_extension_compat).  We fix it here by making sure _testsinglephase is removed from sys.modules whenever we clear the runtime's internal state for the module.

The underlying problem is strictly contained in the internal function _PyImport_ClearExtension() (AKA _testinternalcapi.clear_extension()), which is only used in tests.

(This also fixes an intermittent segfault introduced in the same place, in test_disallowed_reimport.)
(cherry picked from commit 017f047183)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-08-02 23:23:15 +02:00
Miss Islington (bot)
f7e16d74ad
[3.12] Clarify Self interaction with subclasses (GH-107511) (#107548)
Clarify `Self` interaction with subclasses (GH-107511)
(cherry picked from commit c8872f4285)

Co-authored-by: Alexandru Mărășteanu <alexei@users.noreply.github.com>
2023-08-02 01:52:28 +02:00
Miss Islington (bot)
b68faa3fa3
[3.12] gh-106092: Fix use-after-free crash in frame_dealloc (GH-106875) (#107532)
gh-106092: Fix use-after-free crash in frame_dealloc (GH-106875)

It was possible for the trashcan to delay the deallocation of a
PyFrameObject until after its corresponding _PyInterpreterFrame has
already been freed.  So frame_dealloc needs to avoid dereferencing the
f_frame pointer unless it first checks that the pointer still points
to the interpreter frame within the frame object.

(cherry picked from commit 557b05c7a5)

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Co-authored-by: Anders Kaseorg <andersk@mit.edu>
2023-08-01 12:42:55 +02:00
Miss Islington (bot)
fc4532a55d
[3.12] gh-105766: Document that Custom Allocators Must Be Thread-Safe (gh-107519) (gh-107522)
gh-105766: Document that Custom Allocators Must Be Thread-Safe (gh-107519)
(cherry picked from commit db361a340a)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-07-31 17:25:18 -06:00
Miss Islington (bot)
31cd12ab21
[3.12] gh-99113: Add a What's New Entry for PEP 684 (gh-107520) (gh-107523)
gh-99113: Add a What's New Entry for PEP 684 (gh-107520)
(cherry picked from commit 79e479c45f)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-07-31 17:24:45 -06:00
Miss Islington (bot)
3f6afafa7e
[3.12] gh-107306: Add a Doc Entry for Py_mod_multiple_interpreters (GH-107403) (gh-107521)
gh-107306: Add a Doc Entry for Py_mod_multiple_interpreters (GH-107403)

It was added in 3.12 for PEP 684 (per-interpreter GIL).
(cherry picked from commit fb344e99aa)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-07-31 23:15:13 +00:00
Miss Islington (bot)
fd60855299
[3.12] gh-107507: Replace 'The goals of Argument Clinic' with a summary (GH-107508) (#107516)
Summarise the goals of Argument Clinic in a single sentence.
Mention that Argument Clinic was introduced with PEP-436.
(cherry picked from commit abb71c6a8f)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-31 21:42:58 +00:00
Miss Islington (bot)
0fbe69fc41
[3.12] gh-106762: Add news for EnumMeta.__getattr__ removal (GH-107466) (GH-107509)
gh-106762: Add news for `EnumMeta.__getattr__` removal (GH-107466)
(cherry picked from commit de51dede5b)

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2023-07-31 11:33:32 -07:00
Miss Islington (bot)
5f7862dc1f
[3.12] GH-101291: Add warning to "what's new" that PyLongObject internals have changed. (GH-107388) (#107392)
(cherry picked from commit 1ee605c588)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2023-07-31 10:16:00 -07:00
Miss Islington (bot)
f66b992e27
[3.12] gh-106368: Add test for Argument Clinic misbehaving custom converter_init() (GH-107496) (#107499)
(cherry picked from commit 2c5d206b33)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-31 15:57:25 +00:00
Miss Islington (bot)
9f58d9ec90
[3.12] gh-105578: Add more usage examples to typing.AnyStr docs (GH-107045) (#107503)
gh-105578: Add more usage examples to `typing.AnyStr` docs (GH-107045)

``typing.AnyStr`` has different semantics to ``str | bytes``, which often leads to user confusion
(cherry picked from commit f877b32b87)

Co-authored-by: Michael The <michael-the1@users.noreply.github.com>
2023-07-31 15:33:00 +00:00
Łukasz Langa
831fd19d30
[3.12] gh-105751: Remove obsolete object base class in some ctypes tests (GH-107460) (#107501)
(cherry picked from commit 520efecfc3)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2023-07-31 17:01:25 +02:00
Charlie Zhao
99518bbbf4
[3.12] gh-106263: Fix segfault in signaldict_repr in _decimal module (#… (#107491)
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>

(cherry picked from commit 3979150a0d)
2023-07-31 14:34:16 +02:00
Miss Islington (bot)
8f080a290b
[3.12] gh-102509: Start initializing ob_digit of _PyLongValue (GH-102510) (#107464)
gh-102509: Start initializing `ob_digit` of `_PyLongValue` (GH-102510)
(cherry picked from commit fc130c47da)

Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
2023-07-31 14:27:59 +02:00
Łukasz Langa
54aaaadef8
[3.12] gh-46376: Return existing pointer when possible in ctypes (GH-107131) (#107487)
(cherry picked from commit 08447b5deb)

Co-authored-by: Konstantin <kpp.live+github@gmail.com>
2023-07-31 11:16:45 +02:00
Miss Islington (bot)
04bd8c76b2
[3.12] gh-104280: Add test cases for DTrace probes (GH-107125) (#107489)
gh-104280: Add test cases for DTrace probes (GH-107125)
(cherry picked from commit a1c737b73d)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2023-07-31 11:16:30 +02:00
Łukasz Langa
1d21c99e1d
[3.12] gh-105751, test_ctypes: Remove disabled tests (GH-105826) (#107483)
* The following tests were disabled since the initial ctypes commit
  in 2006, commit babddfca75:

  * Callbacks.test_char_p()
  * DeletePointerTestCase.test_X()
  * NumberTestCase.test_perf()
  * StructureTestCase.test_subclass_creation()
  * Tests.test_X() of test_byteswap

* NumberTestCase.test_bool_from_address() was disabled in 2007 by
  commit 5dc4fe09b7.
* Remove check_perf() and run_test() of test_numbers.
(cherry picked from commit 8f10140e74)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-07-31 10:28:36 +02:00
Ned Deily
f9f9bc9bb7
[3.12] gh-99079: add What's New item (GH-107481) 2023-07-31 07:12:07 +00:00
Ned Deily
08f8165b13
[3.12] Update macOS installer screens for 3.12rc/final. (GH-107473) 2023-07-31 01:22:34 -04:00
Ned Deily
23655fc627
[3.12] gh-99079: Update macOS installer to use OpenSSL 3.0.9. (gh-107472) 2023-07-31 01:21:43 -04:00
Miss Islington (bot)
0b3d638175
[3.12] gh-107427: Update the description of UNPACK_SEQUENCE (gh-107429) (gh-107459) 2023-07-30 15:49:26 +00:00
Miss Islington (bot)
e3b5ed7b1c
[3.12] Fix the documentation for PyCode_New add qualname parameter (GH-107186) (#107440)
Fix the documentation for PyCode_New add `qualname` parameter (GH-107186)
(cherry picked from commit f2abeb590d)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2023-07-29 17:52:17 +00:00
Miss Islington (bot)
2c0a99d322
[3.12] gh-107422: Remove outdated TypedDict example from typing docs (GH-107436) (#107437)
gh-107422: Remove outdated `TypedDict` example from typing docs (GH-107436)
(cherry picked from commit 89fd4f4a3f)

Co-authored-by: Rakesh Sabale <102187286+ghubrakesh@users.noreply.github.com>
2023-07-29 17:12:50 +00:00
Serhiy Storchaka
d514e1439f
[3.12] gh-101100: Sphinx warnings: pick the low hanging fruits (GH-107386) (GH-107419)
(cherry picked from commit f2d07d3289)
2023-07-29 09:16:27 +03:00
Serhiy Storchaka
34e6e14602
[3.12] gh-107091: Fix some uses of :func: role (GH-107378) (GH-107416)
:c:func: or :c:macro: should be used instead.
(cherry picked from commit 413ba8943e)
2023-07-29 05:52:25 +00:00
justdan6
80aebd54c8
[3.12] gh-106881: Check for linux/limits.h before including it (#107397) (#107414)
* Check for linux/limits.h before including it

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
(cherry picked from commit 11c055f5ff)
2023-07-28 16:29:31 -07:00
Eric Snow
da151fdc7a
[3.12] gh-105699: Use a _Py_hashtable_t for the PyModuleDef Cache (gh-106974) (gh-107412)
gh-105699: Use a _Py_hashtable_t for the PyModuleDef Cache (gh-106974)

This fixes a crasher due to a race condition, triggered infrequently when two isolated (own GIL) subinterpreters simultaneously initialize their sys or builtins modules.  The crash happened due the combination of the "detached" thread state we were using and the "last holder" logic we use for the GIL.  It turns out it's tricky to use the same thread state for different threads.  Who could have guessed?

We solve the problem by eliminating the one object we were still sharing between interpreters.  We replace it with a low-level hashtable, using the "raw" allocator to avoid tying it to the main interpreter.

We also remove the accommodations for "detached" thread states, which were a dubious idea to start with.

(cherry picked from commit 8ba4df91ae)
2023-07-28 23:16:12 +00:00
Miss Islington (bot)
e5ca2aa2c6
[3.12] gh-107307: Update the importlib Docs for PEP 684 (gh-107400) (gh-107413)
gh-107307: Update the importlib Docs for PEP 684 (gh-107400)
(cherry picked from commit cf63df88d3)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-07-28 22:09:34 +00:00
Miss Islington (bot)
b4355de947
[3.12] gh-104629: Build _testclinic extension module on Windows (GH-104723) (#107393)
(cherry picked from commit 3a1d819ebc)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-28 20:57:26 +00:00
Miss Islington (bot)
32502da987
[3.12] gh-107305: Update the C-API Docs for PEP 684 (gh-107324) (gh-107402)
gh-107305: Update the C-API Docs for PEP 684 (gh-107324)
(cherry picked from commit c0b81c4b54)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-07-28 19:54:57 +00:00
Miss Islington (bot)
0f42f41ea8
[3.12] gh-107091: Fix some uses of :const: role (GH-107379) (GH-107384)
It is for references, not for literals.
(cherry picked from commit 0aa58fa7a6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-28 10:35:20 +00:00