Commit graph

118809 commits

Author SHA1 Message Date
Ł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
Mark Shannon
3f167de440
[3.12] GH-106898: Add the exception as an argument to the PY_UNWIND event callback function. (GH-107347) (GH-107382) 2023-07-28 11:30:16 +01:00
Mark Shannon
0902afbae2
[3.12] GH-106895: Raise a ValueError when attempting to disable events that cannot be disabled. (GH-107337) (GH-107351) 2023-07-28 10:53:33 +01:00
Mark Shannon
3b1a4c1842
[3.12] GH-106897: Add RERAISE event to sys.monitoring. (GH-107291) (GH-107346)
* Ensures that exception handling events are balanced. Each [re]raise event has a matching unwind/handled event.
2023-07-28 09:48:35 +01:00
Serhiy Storchaka
4014869b4b
[3.12] gh-107298: Fix yet more Sphinx warnings in the C API doc (GH-107345) (GH-107380)
(cherry picked from commit 983305268e)
2023-07-28 08:20:53 +00:00
Serhiy Storchaka
e6a4b10820
[3.12] gh-107298: Fix more Sphinx warnings in the C API doc (GH-107329) (GH-107376)
Declare the following functions as macros, since they are actually
macros. It avoids a warning on "TYPE" or "macro" argument.

* PyMem_New()
* PyMem_Resize()
* PyModule_AddIntMacro()
* PyModule_AddStringMacro()
* PyObject_GC_New()
* PyObject_GC_NewVar()
* PyObject_New()
* PyObject_NewVar()

Add C standard C types to nitpick_ignore in Doc/conf.py:

* int64_t
* uint64_t
* uintptr_t

No longer ignore non existing "__int" type in nitpick_ignore.

Update Doc/tools/.nitignore.
(cherry picked from commit 8d61a71f9c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-07-28 09:56:52 +03:00
Serhiy Storchaka
ef7422a1b9
[3.12] gh-107298: Fix Sphinx warnings in the C API doc (GH-107302) (GH-107375)
(cherry picked from commit 391e03fa05)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-07-28 06:40:16 +00:00
Miss Islington (bot)
4f72a9a2e0
[3.12] gh-106723: forward -Xfrozen_modules option to spawned process interpreters (GH-106724) (#107367)
gh-106723: forward -Xfrozen_modules option to spawned process interpreters (GH-106724)
(cherry picked from commit 3dcac78581)

Co-authored-by: Felipe A. Hernandez <ergoithz@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-07-28 06:24:29 +00:00
Miss Islington (bot)
17ce87ba7f
[3.12] gh-107298: Fix doc references to undocumented modules (GH-107300) (GH-107370)
Update also Doc/tools/.nitignore.
(cherry picked from commit 87b39028e5)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-07-28 06:17:49 +00:00
Miss Islington (bot)
2827ad2f31
[3.12] gh-106368: Argument clinic tests: improve failure message when tests in ClinicExternalTests fail (GH-107364) (#107365)
gh-106368: Argument clinic tests: improve failure message when tests in `ClinicExternalTests` fail (GH-107364)
(cherry picked from commit 76c26eaca4)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-28 00:39:51 +00:00
Miss Islington (bot)
abaf89d908
[3.12] gh-104621: Check for Incompatible Extensions in import_find_extension() (gh-107184) (gh-107360)
gh-104621: Check for Incompatible Extensions in import_find_extension() (gh-107184)

This fixes a bug where incompatible modules could still be imported if attempted multiple times.
(cherry picked from commit 75c974f535)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-07-27 21:51:34 +00:00
Miss Islington (bot)
5daf19d763
[3.12] gh-104432: Use memcpy() to avoid misaligned loads (GH-104433) (#107355)
gh-104432: Use `memcpy()` to avoid misaligned loads (GH-104433)

Fix potential unaligned memory access on C APIs involving returned sequences
of `char *` pointers within the :mod:`grp` and :mod:`socket` modules. These
were revealed using a ``-fsaniziter=alignment`` build on ARM macOS.
(cherry picked from commit f01e4cedba)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
2023-07-27 13:52:39 -07:00
Miss Islington (bot)
c580527d92
[3.12] gh-105699: Disable the Interpreters Stress Tests (gh-107354) (gh-107357)
gh-105699: Disable the Interpreters Stress Tests (gh-107354)

The two tests are crashing periodically in CI and on buildbots.  I suspect the problem is in the _xxsubinterpreters module.
 Regardless, I'm disabling the tests temporarily, to reduce the noise as we approach 3.12rc1.  I'll be investigating the crashes separately.
(cherry picked from commit 4f67921ad2)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-07-27 20:09:05 +00:00
Miss Islington (bot)
57ef065eb3
[3.12] gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-105258) (gh-107303)
The _xxsubinterpreters module was meant to only use public API.  Some internal C-API usage snuck in over the last few years (e.g. gh-28969).  This fixes that.
(cherry picked from commit e6373c0d8b)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-07-27 13:15:47 -06:00
Miss Islington (bot)
0063ad8189
[3.12] Bump some docs dependencies to resolve a Dependabot security alert (GH-107341) (#107342)
Bump some docs dependencies to resolve a Dependabot security alert (GH-107341)
(cherry picked from commit f84d77b4e0)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-27 13:13:02 +01:00
Miss Islington (bot)
38c982d92e
[3.12] gh-106996: Rewrite turtle explanation (GH-107244) (#107335)
Co-authored-by: Daniele Procida <daniele@vurt.org>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-07-27 08:11:50 +00:00
Miss Islington (bot)
5f3e371e2d
[3.12] Docs: Argument Clinic: Restructure "Basic concepts and usage" (GH-106981) (#107325)
Split "Basic concepts and usage" into:

- Reference
  - Terminology
  - CLI reference

- Background
  - Basic concepts

(cherry picked from commit 2ad699002e)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-07-27 09:07:55 +02:00
Miss Islington (bot)
36e96baa33
[3.12] gh-107298: Docs: add targets for some :c:member: and :c:macro: references (GH-107316) (GH-107332)
Add targets for PyStructSequence_Desc and PyStructSequence_Field members
and macros like Py_EQ.
Fix target for Py_RETURN_RICHCOMPARE.
(cherry picked from commit abec9a1b20)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-27 09:37:54 +03:00
Serhiy Storchaka
434e3b89a7
[3.12] gh-107091: Fix some uses of :attr: role (GH-107318) (GH-107330)
Fix also formatting of PyMethodDef members.
(cherry picked from commit d363eb5b02)
2023-07-27 09:24:18 +03:00
Miss Islington (bot)
6bbcd792f7
[3.12] Docs: Remove the numbered steps from the Argument Clinic tutorial (GH-107203) (#107317)
Instead, order the tutorial as one body of prose, making it easier to
align the tutorial according to Diátaxis principles.

(cherry picked from commit 592395577c)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-26 21:03:35 +00:00
Miss Islington (bot)
4f6d7a5890
[3.12] gh-105002: [pathlib] Fix relative_to with walk_up=True using ".." (GH-107014) (#107315)
gh-105002: [pathlib] Fix relative_to with walk_up=True using ".." (GH-107014)

It makes sense to raise an Error because ".." can not
be resolved and the current working directory is unknown.
(cherry picked from commit e7e6e4b035)

Co-authored-by: János Kukovecz <kukoveczjanos@gmail.com>
2023-07-26 20:17:31 +00:00
Miss Islington (bot)
58af565c50
[3.12] Document that os.link() is not available on Emscripten (GH-104822) (GH-107308)
Document that `os.link()` is not available on Emscripten (GH-104822)
(cherry picked from commit 737d1da074)

Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2023-07-26 13:00:40 -07:00
Miss Islington (bot)
da2097dffb
[3.12] gh-107091: Fix some uses of :c:type: role (GH-107138) (GH-107312)
(cherry picked from commit 6d5b6e71c8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-26 19:37:39 +00:00
Miss Islington (bot)
9f5a5f0b33
[3.12] gh-107091: Fix some uses of :c:member: role (GH-107129) (GH-107310)
(cherry picked from commit af61cb9c78)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-26 22:30:46 +03:00
Miss Islington (bot)
0d2e1317bd
[3.12] gh-106948: Update documentation nitpick_ignore for c:identifer domain (GH-107295) (#107297)
gh-106948: Update documentation nitpick_ignore for c:identifer domain (GH-107295)

Update the nitpick_ignore of the documentation configuration to fix
Sphinx warnings about standard C types when declaring functions with
the "c:function" markups.

Copy standard C types declared in the "c:type" domain to the
"c:identifier" domain, since "c:function" markup looks for types in
the "c:identifier" domain.

(cherry picked from commit b1de3807b8)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-26 18:16:04 +02:00
Miss Islington (bot)
d2355426d6
[3.12] gh-106350: Tkinter: do not ignore return value of mp_init() (GH-106351) (GH-107258)
(cherry picked from commit b5ae7c4984)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
2023-07-26 10:58:33 +03:00
Miss Islington (bot)
ef808517f4
[3.12] gh-106368: Increase Argument Clinic CLI test coverage (GH-107277) (#107282)
(cherry picked from commit 579100f6d7)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-26 07:13:22 +00:00
Miss Islington (bot)
3d15c8b84b
[3.12] gh-106185: Deduplicate CPythonTracebackErrorCaretTests in test_traceback (GH-106187) (GH-107268)
(cherry picked from commit 7c89f11892)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-07-25 21:23:33 +00:00
Miss Islington (bot)
0107731a06
[3.12] gh-106939: document ShareableList nul-strip quirk. (GH-107266) (#107269)
gh-106939: document ShareableList nul-strip quirk. (GH-107266)

* gh-106939: document ShareableList nul-strip quirk.
* Mention the `int` size constraint.
(cherry picked from commit 70dc009469)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-07-25 21:19:25 +00:00
Miss Islington (bot)
c3c8916dea
[3.12] gh-107226: PyModule_AddObjectRef() should only be in the limited API 3.10 (GH-107227) (GH-107260)
(cherry picked from commit 698b015135)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-25 23:01:18 +03:00
Miss Islington (bot)
11d86c5c33
[3.12] gh-62519: Make pgettext search plurals when translation is not found (GH-107118) (GH-107134)
(cherry picked from commit b3c34e55c0)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2023-07-25 21:48:59 +03:00
Ezio Melotti
313284aa42
[3.12] Remove superflous whitespaces in layout.html. (#107251)
Remove superflous whitespaces in layout.html.
2023-07-25 16:25:07 +00:00
Miss Islington (bot)
ca42d67208
[3.12] gh-105699: Add some stress tests for subinterpreter creation (GH-106966) (gh-107012)
gh-105699: Add some stress tests for subinterpreter creation (GH-106966)
(cherry picked from commit adda43dc0b)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-07-25 09:42:46 -06:00
Miss Islington (bot)
9c31d94050
[3.12] gh-105059: Fix MSCV compiler warning on PyObject union (GH-107239) (#107248)
gh-105059: Fix MSCV compiler warning on PyObject union (GH-107239)

Use pragma to ignore the MSCV compiler warning on the PyObject
nameless union.
(cherry picked from commit 1c8fe9bdb6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-07-25 15:35:49 +00:00