Commit graph

117611 commits

Author SHA1 Message Date
Eric Snow aa9707dda9
[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (#107751)
* Unrevert "[3.12] gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567) (#107599)".

This reverts commit 6e4eec7606 (gh-107648).

* Initialize each interpreter's refchain properly.

* Skip test_basic_multiple_interpreters_deleted_no_reset on tracerefs builds.
2023-08-16 12:03:05 +02:00
Serhiy Storchaka bd2ef82a50
[3.12] gh-100061: Proper fix of the bug in the matching of possessive quantifiers (GH-102612) (#108003)
Restore the global Input Stream pointer after trying to match a sub-pattern.

.
(cherry picked from commit abd9cc52d9)

Co-authored-by: SKO <41810398+uyw4687@users.noreply.github.com>
2023-08-16 12:00:55 +02:00
Miss Islington (bot) 00bfed7cba
[3.12] gh-91051: fix segfault when using all 8 type watchers (GH-107853) (#107876)
* gh-91051: fix segfault when using all 8 type watchers (GH-107853)
(cherry picked from commit 66e4edd734)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-08-16 11:58:54 +02:00
Miss Islington (bot) f0a583b6fb
[3.12] gh-107963: Fix set_forkserver_preload to check the type of given list (GH-107965) (#107975)
gh-107963: Fix set_forkserver_preload to check the type of given list (GH-107965)
(cherry picked from commit 6515ec3d3d)


gh-107963: Fix set_forkserver_preload to check the type of given list

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2023-08-15 16:56:53 +02:00
Miss Islington (bot) d189480942
[3.12] gh-107967: Fix infinite recursion on invalid escape sequence warning (GH-107968) (#107970)
gh-107967: Fix infinite recursion on invalid escape sequence warning (GH-107968)
(cherry picked from commit d66bc9e8a7)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2023-08-15 13:41:55 +01:00
Miss Islington (bot) e8963a86ea
[3.12] Add another example to the statistics docs (GH-107904) (#107941)
Add another example to the statistics docs (GH-107904)
(cherry picked from commit 2b6dc2accc)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2023-08-14 16:58:54 +02:00
Miss Islington (bot) ba8ab4e8ae
[3.12] gh-107877: Update logging levels reference table with usage criteria. (GH-107894) (#107922)
gh-107877: Update logging levels reference table with usage criteria. (GH-107894)
(cherry picked from commit cc2cf85d03)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-08-14 14:40:47 +02:00
Miss Islington (bot) 39ce30dd3e
[3.12] gh-107891: Fix typo in 3.12 whatsnew (GH-107892) (#107893)
gh-107891: Fix typo in 3.12 whatsnew  (GH-107892)
(cherry picked from commit 2e1f688fe0)

Co-authored-by: wookie184 <wookie1840@gmail.com>
2023-08-14 14:39:30 +02:00
Miss Islington (bot) d20d52bc4d
[3.12] Docs: Document PyBUF_MAX_NDIM (GH-107865) (#107871)
Docs: Document PyBUF_MAX_NDIM (GH-107865)
(cherry picked from commit 637f7ff2c6)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-08-11 22:29:57 +02:00
Miss Islington (bot) 98dd9d9725
[3.12] gh-91054: make code watcher tests resilient to other watchers (GH-107821) (#107835)
gh-91054: make code watcher tests resilient to other watchers (GH-107821)
(cherry picked from commit 2ec16fed14)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-08-11 16:13:14 +02:00
Miss Islington (bot) 431ce239d2
[3.12] gh-107810: Improve DeprecationWarning for metaclasses with custom tp_new (GH-107834) (#107864)
gh-107810: Improve DeprecationWarning for metaclasses with custom tp_new (GH-107834)

(cherry picked from commit 16dcce2176)

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2023-08-11 16:12:50 +02:00
Miss Islington (bot) 585b4cc3bd
[3.12] Fix the long64 reader in umarshal.py (GH-107828) (#107849)
Fix the long64 reader in umarshal.py (GH-107828)
(cherry picked from commit 50bbc56009)

Co-authored-by: Martin DeMello <martindemello@gmail.com>
2023-08-11 11:59:45 +02:00
Miss Islington (bot) 81d3afae1a
[3.12] GH-107774: Add missing audit event for PEP 669 (GH-107775) (#107839)
GH-107774: Add missing audit event for PEP 669 (GH-107775)
(cherry picked from commit 494e3d4436)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2023-08-11 11:58:58 +02:00
Miss Islington (bot) ddca26188d
[3.12] GH-107724: Fix the signature of PY_THROW callback functions. (GH-107725) (#107802)
GH-107724: Fix the signature of `PY_THROW` callback functions. (GH-107725)
(cherry picked from commit 52fbcf61b5)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2023-08-11 11:58:27 +02:00
Miss Islington (bot) 7853c76906
[3.12] GH-106684: Close asyncio.StreamWriter when asyncio.StreamWriter is not closed by application (GH-107650) (#107656)
GH-106684: raise `ResourceWarning` when `asyncio.StreamWriter` is not closed (GH-107650)
(cherry picked from commit 41178e4199)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-08-10 11:24:22 +02:00
Miss Islington (bot) a71500cd24
[3.12] gh-107814: Avoid output from Nuget installation in find_python.bat (GH-107815) (#107823)
gh-107814: Avoid output from Nuget installation in find_python.bat (GH-107815)
(cherry picked from commit 1e229e2c3d)

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
2023-08-10 11:19:14 +02:00
Serhiy Storchaka 3bb43b7b1b
[3.12] gh-106052: Fix bug in the matching of possessive quantifiers (GH-106515) (#107796)
[3.12] gh-106052: Fix bug in the matching of possessive quantifiers (gh-106515)

It did not work in the case of a subpattern containing backtracking.

Temporary implement possessive quantifiers as equivalent greedy qualifiers
in atomic groups..
(cherry picked from commit 7b6e34e5ba)
2023-08-09 12:26:51 +02:00
Miss Islington (bot) aa2ecef22a
[3.12] gh-98154: Clarify Usage of "Reference Count" In the Docs (gh-107552) (#107752)
* gh-98154: Clarify Usage of "Reference Count" In the Docs (gh-107552)

PEP 683 (immortal objects) revealed some ways in which the Python documentation has been unnecessarily coupled to the implementation details of reference counts.  In the end users should focus on reference ownership, including taking references and releasing them, rather than on how many reference counts an object has.

This change updates the documentation to reflect that perspective.  It also updates the docs relative to immortal objects in a handful of places.
(cherry picked from commit 5dc825d504)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>

* Fix a typo.

---------

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-08-08 16:25:35 +02:00
Miss Islington (bot) e5582bdbcf
[3.12] gh-107442: Document all valid types for ctypes _as_parameter_ (GH-107443) (#107707)
gh-107442: Document all valid types for ctypes _as_parameter_ (GH-107443)
(cherry picked from commit 6925c578a0)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2023-08-07 14:33:25 +02:00
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