Commit graph

118313 commits

Author SHA1 Message Date
Eric Snow
4f71f1680d
[3.12] gh-106931: Intern Statically Allocated Strings Globally (gh-107272) (gh-110713)
We tried this before with a dict and for all interned strings.  That ran into problems due to interpreter isolation.  However, exclusively using a per-interpreter cache caused some inconsistency that can eliminate the benefit of interning.  Here we circle back to using a global cache, but only for statically allocated strings.  We also use a more-basic _Py_hashtable_t for that global cache instead of a dict.

Ideally we would only have the global cache, but the optional isolation of each interpreter's allocator means that a non-static string object must not outlive its interpreter.  Thus we would have to store a copy of each such interned string in the global cache, tied to the main interpreter.

(cherry-picked from commit b72947a8d2)
2023-11-27 23:51:12 +00:00
Miss Islington (bot)
60a08e6ff2
[3.12] Correct documentation for AF_PACKET (GH-112339) (#112477)
Correct documentation for AF_PACKET (GH-112339)

Protocol in the address tuple should *not* be in the network-byte-order, because it is converted internally[1].

[1] 89ddea4886/Modules/socketmodule.cGH-L2144

network byte order doesn't make sense for a python level int anyways. It's a fixed size C serialization concept.
(cherry picked from commit 562d7149c6)

Co-authored-by: Eugene Toder <eltoder@users.noreply.github.com>
2023-11-27 23:48:59 +00:00
Eric Snow
ee7dc67081
[3.12] gh-105699: Revert gh-107783 "Re-enable the Multiple-Interpreters Stress Tests" (gh-112474)
Revert "[3.12] gh-105699: Re-enable the Multiple-Interpreters Stress Tests (gh-107572) (#107783)"

This reverts commit a4aac7d3ea.

The stress tests are still failing on FreeBSD.
2023-11-27 22:39:04 +00:00
Eric Snow
313554457e
[3.12] gh-109853: Fix sys.path[0] For Subinterpreters (gh-109994) (gh-110701)
This change makes sure sys.path[0] is set properly for subinterpreters.  Before, it wasn't getting set at all.

This change does not address the broader concerns from gh-109853.

(cherry-picked from commit a040a32ea2)
2023-11-27 22:21:12 +00:00
Eric Snow
592a849fdf
[3.12] gh-76785: Use Pending Calls When Releasing Cross-Interpreter Data (gh-109556) (gh-112288)
This fixes some crashes in the _xxinterpchannels module, due to a race between interpreters.
(cherry picked from commit fd7e08a6f3)
2023-11-27 14:49:48 -07:00
Miss Islington (bot)
a4aac7d3ea
[3.12] gh-105699: Re-enable the Multiple-Interpreters Stress Tests (gh-107572) (#107783)
We had disabled them due to crashes they exposed, which have since been fixed.
(cherry picked from commit f9e3ff1ea4)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: T. Wouters <thomas@python.org>
2023-11-27 14:48:08 -07:00
Miss Islington (bot)
1cb95cd2c5
[3.12] gh-68166: Tkinter: Add tests and examples for element_create() (GH-111453) (GH-111857)
* Remove mention of "vsapi" element type from the documentation.
* Add tests for element_create() and other ttk.Style methods.
* Add examples for element_create() in the documentation.
(cherry picked from commit 005d1e8fc8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-27 20:14:37 +00:00
Miss Islington (bot)
698b4b73bc
[3.12] gh-112388: Fix an error that was causing the parser to try to overwrite tokenizer errors (GH-112410) (#112466)
gh-112388: Fix an error that was causing the parser to try to overwrite tokenizer errors (GH-112410)
(cherry picked from commit 2c8b191742)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-11-27 19:02:57 +00:00
Miss Islington (bot)
7140716c88
[3.12] gh-112387: Fix error positions for decoded strings with backwards tokenize errors (GH-112409) (#112468)
gh-112387: Fix error positions for decoded strings with backwards tokenize errors (GH-112409)
(cherry picked from commit 45d648597b)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-11-27 18:57:34 +00:00
Miss Islington (bot)
4463d2e018
[3.12] bpo-41422: Visit the Pickler's and Unpickler's memo in tp_traverse (GH-21664) (GH-112464)
(cherry picked from commit 967f2a3052)

Co-authored-by: kale-smoothie <34165060+kale-smoothie@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-27 18:42:48 +00:00
Miss Islington (bot)
46047bb12b
[3.12] gh-112438: Fix support of format units with the "e" prefix in nested tuples in PyArg_Parse (gh-112439) (GH-112460)
(cherry picked from commit 4eea1e8236)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-27 17:57:30 +00:00
Miss Islington (bot)
3ef75ee584
[3.12] gh-84443: SSLSocket.recv_into() now support buffer protocol with itemsize != 1 (GH-20310) (GH-112458)
It is also no longer use __len__().

(cherry picked from commit 812360fddd)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-27 17:30:53 +00:00
Miss Islington (bot)
a2ed553b1a
[3.12] GH-101100: Fix reference warnings for `socket` methods (GH-110114) (#112455)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-27 17:04:18 +02:00
Miss Islington (bot)
a8269628f6
[3.12] Move What's New In Python 3.12 entries to the right section (GH-112447) (#112450)
Move What's New In Python 3.12 entries to the right section (GH-112447)

Jython and ctypes removals are unrelated to C API Removals.
(cherry picked from commit d44ee42cd7)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-11-27 12:02:16 +00:00
Miss Islington (bot)
2718947886
[3.12] Docs: fix typo in doc for sqlite3.Cursor.execute (GH-112442) (#112444)
Docs: fix typo in doc for sqlite3.Cursor.execute (GH-112442)
(cherry picked from commit fb79e1ed4a)

Co-authored-by: Tom Levy <tomlevy93@gmail.com>
2023-11-27 09:34:19 +00:00
Miss Islington (bot)
f9861e69c9
[3.12] gh-112414: Fix AttributeError when calling repr() on a namespace package imported with a custom loader (GH-112425) (#112440)
gh-112414: Fix `AttributeError` when calling `repr()` on a namespace package imported with a custom loader (GH-112425)
(cherry picked from commit 0622839cfe)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-27 08:53:57 +00:00
Mark Dickinson
42df73652d
[3.12] gh-112358: Fix Python 3.12 regression with subclassing struct.Struct (GH-112424) (#112426)
* [3.12] gh-112358: Fix Python 3.12 regression with subclassing struct.Struct. (GH-112424)

Revert commit c8c0afc713 (PR GH-94532),
which moved `struct.Struct` initialisation from `Struct.__init__` to `Struct.__new__`.
This caused issues with code in the wild that subclasses `struct.Struct`..
(cherry picked from commit 9fe60340d7)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>

* Remove unrelated test
2023-11-27 08:25:06 +00:00
Hugo van Kemenade
d7a7883326
[3.12] gh-101100: Fix Sphinx reference warnings (GH-112416) (#112420)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-26 05:22:13 -07:00
Miss Islington (bot)
b478c5e50c
[3.12] gh-112331: Fix reference manual description of attribute lookup mechanics (gh-112375) (#112412) 2023-11-25 22:26:31 +00:00
Miss Islington (bot)
2199cebd0f
[3.12] Descriptor HowTo: Sync the error-messages with the C code. Add tests. (gh-112403) (gh-112411) 2023-11-25 22:24:43 +00:00
Miss Islington (bot)
8b3c66bb90
[3.12] gh-101100 : Fix Sphinx warnings in library/doctest.rst (GH-112399) (#112402)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-25 12:26:00 -07:00
Miss Islington (bot)
e93af80749
[3.12] gh-94722: fix DocTest.__eq__ for case of no line number on one side (GH-112385) (#112400)
gh-94722: fix DocTest.__eq__ for case of no line number on one side (GH-112385)
(cherry picked from commit fbb9027a03)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-11-25 17:56:46 +00:00
Miss Islington (bot)
44eb329490
[3.12] gh-101100: Define _tkinter module to fix references (GH-112382) (#112392)
gh-101100: Define `_tkinter` module to fix references (GH-112382)

Define _tkinter module to fix references
(cherry picked from commit 6b961b8cea)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-25 10:00:21 +02:00
Miss Islington (bot)
4b9d50bb60
[3.12] gh-101100: Define test.regrtest module to fix references (GH-112381) (#112390)
gh-101100: Define `test.regrtest` module to fix references (GH-112381)

Define test.regrtest module to fix references
(cherry picked from commit d525d01e27)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-25 09:59:09 +02:00
Miss Islington (bot)
103728dc15
[3.12] gh-59254: mention in open() doc that line buffering is for writing (GH-112318) (#112378)
gh-59254: mention in open() doc that line buffering is for writing (GH-112318)
(cherry picked from commit fafae08cc7)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-11-24 18:15:54 +00:00
Miss Islington (bot)
86db104eeb
[3.12] Remove bogus annotations from the descriptor howto guide (GH-112349) (#112352)
Remove bogus annotations from the descriptor howto guide (GH-112349)
(cherry picked from commit d9fc15222e)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2023-11-23 23:07:14 +00:00
Tian Gao
3210e3c6cc
[3.12] GH-109052: Use the base opcode when comparing code objects (GH-112329) 2023-11-23 10:18:17 -08:00
Miss Islington (bot)
bfc6d91c78
[3.12] Fix docstring and var name of itertools recipe (GH-112113) (#112310)
Fix docstring and var name of itertools recipe (GH-112113)

`prepend()` works with arbitrary iterables, not only iterators. In fact,
the example given uses a `list`, which is iterable, but not an iterator.
(cherry picked from commit 6c47eaccfa)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2023-11-22 05:41:53 +00:00
Miss Islington (bot)
298e57ab56
[3.12] GH-111963: Clarify sys.monitoring.free_tool_id's limitations (GH-112304)
(cherry picked from commit 46500c42f0)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2023-11-21 23:06:13 +00:00
Miss Islington (bot)
fab9824658
[3.12] gh-110950: add upstream Tk fixes to macOS installer. (GH-111041) (#112294)
Add upstream Tk patches for three problems affecting tkinter users:

- Update macOS installer to include a fix accepted by upstream Tcl/Tk
for a crash encountered after the first :meth:`tkinter.Tk` instance
is destroyed. (gh-92603)

- Update macOS installer to include an upstream Tcl/Tk fix
for the ``ttk::ThemeChanged`` error encountered in Tkinter. (gh-71383)

- Update macOS installer to include an upstream Tcl/Tk fix for the
``Secure coding is not enabled for restorable state!`` warning
encountered in Tkinter on macOS 14 Sonoma. (gh-110950)

(cherry picked from commit d67f947c72)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Co-authored-by: Ned Deily <nad@python.org>
2023-11-21 08:46:13 +00:00
Pablo Galindo Salgado
7e70e2ed29
[3.12] gh-112243: Don't include comments in f-string debug expressions (GH-112284) (#112285)
(cherry picked from commit d59feb5dbe)
2023-11-20 15:38:57 +00:00
Miss Islington (bot)
d4fd165aba
[3.12] gh-73561: Omit interface scope from IPv6 when used as Host header (GH-93324) (#112272)
gh-73561: Omit interface scope from IPv6 when used as Host header (GH-93324)

Omit the `@interface_scope` from an IPv6 address when used as Host header by `http.client`.

---------

(cherry picked from commit ce1096f974)


 [Google LLC]

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
2023-11-19 15:25:36 -08:00
Miss Islington (bot)
cf8c830755
[3.12] gh-112266: Remove (if defined) part from __dict__ and __weakref__ docstrings (GH-112268) (#112270)
gh-112266: Remove `(if defined)` part from `__dict__` and `__weakref__` docstrings (GH-112268)
(cherry picked from commit f8129146ef)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-19 18:59:50 +00:00
Miss Islington (bot)
f521321ddf
[3.12] gh-112186: Improve test case test_loop_is_closed_resource_warnings (GH-112187) (#112255)
(cherry picked from commit 18c6929469)

Co-authored-by: DPR <dpr-0xff@pm.me>
2023-11-19 07:19:12 -08:00
Miss Islington (bot)
dedbd266d3
[3.12] gh-110383: Explained which error message is generated when there is an unhandled exception (GH-111574) (#112264)
Co-authored-by: Unique-Usman <86585626+Unique-Usman@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-19 05:29:24 -07:00
Miss Islington (bot)
5134f668b4
[3.12] gh-110383: Fix documentation profile cumtime fix (GH-112221) (#112262)
Co-authored-by: Alex Ptakhin <me@aptakhin.name>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-19 10:03:07 +00:00
Miss Islington (bot)
89c5180839
[3.12] IDLE: Fix test_debugger bug and buildbot failures (GH-112258) (#112259)
IDLE: Fix test_debugger bug and buildbot failures (GH-112258)

Missing "requires('gui')" causes Tk() to fail when no gui.
This caused CI Hypothesis test to fail, but I did not understand
the its error message. Then buildbots failed.

IdbTest failed on draft Bdb replacement because so different.
Simplified version works on old and new.
(cherry picked from commit 14fd86a59d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-11-19 06:53:37 +00:00
Miss Islington (bot)
a62dcacc6e
[3.12] gh-79871: IDLE - Fix and test debugger module (GH-11451) (#112256)
gh-79871: IDLE - Fix and test debugger module (GH-11451)

Add docstrings to the debugger module. Fix two bugs: initialize Idb.botframe (should be in Bdb); In Idb.in_rpc_code, check whether prev_frame is None before trying to use it. Make other code changes.

Expand test_debugger coverage from 19% to 66%.
---------

(cherry picked from commit adedcfa06b)

Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-11-19 04:35:59 +00:00
Nikita Sobolev
919be35eae
[3.12] gh-112155: Run typing.py doctests during tests (GH-112156) (#112230) 2023-11-18 11:13:37 +00:00
Miss Islington (bot)
0ea645445d
[3.12] gh-112194: Convert more examples to doctests in typing.py (GH-112195) (#112208)
gh-112194: Convert more examples to doctests in `typing.py` (GH-112195)
(cherry picked from commit 949b2cc6ea)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-17 18:28:35 +00:00
Miss Islington (bot)
976488ebf6
[3.12] gh-94309: "What's new in Python 3.12": improve deprecation notice for typing.Hashable and typing.Sized (GH-112196) (#112200)
gh-94309: "What's new in Python 3.12": improve deprecation notice for typing.Hashable and typing.Sized (GH-112196)
(cherry picked from commit fb4cddb0cc)

Co-authored-by: Ori Avtalion <ori@avtalion.name>
2023-11-17 12:37:12 +00:00
Miss Islington (bot)
94bac1c407
[3.12] gh-112165: Fix typo in __main__.py (GH-112183) (#112184)
gh-112165: Fix typo in `__main__.py` (GH-112183)

Change '[2]' to '[1]' to get second argument.
(cherry picked from commit 8cd70eefc7)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-11-17 01:11:46 +00:00
Miss Islington (bot)
8e37445044
[3.12] Remove imp_dummy_def from Tools/c-analyzer/cpython/ignored.tsv (gh-112122) (gh-112177)
It was removed in 3.12, no need to keep the ignore.
(cherry picked from commit 762eb58220)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-16 14:09:34 -07:00
DPR
2ef3676a5b
[3.12] gh-109538: Catch closed loop runtime error and issue warning (GH-111983) (#112142)
* [3.12] gh-109538: Avoid RuntimeError when StreamWriter is deleted with closed loop (GH-111983)

Issue a ResourceWarning instead.

(cherry picked from commit e0f5127975)
gh-109538: Avoid RuntimeError when StreamWriter is deleted with closed loop (#111983)

Issue a ResourceWarning instead.

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
(cherry picked from commit e0f5127975)

* Fix missing warnings import
2023-11-16 09:40:55 -08:00
Miss Islington (bot)
3f2cdbe666
[3.12] gh-111811: Fix test_recursive_repr for WASI (GH-112130) (#112131)
gh-111811: Fix test_recursive_repr for WASI (GH-112130)
(cherry picked from commit 7218bac8c8)

Co-authored-by: Kushal Das <mail@kushaldas.in>
2023-11-16 18:11:33 +01:00
Miss Islington (bot)
458a3c02e5
[3.12] GH-112152: Fix typo in typing.override docstring (GH-112158) (#112162)
GH-112152: Fix typo in `typing.override` docstring (GH-112158)
(cherry picked from commit 12c7e9d573)

Co-authored-by: Qua27 <92877777+Qua27@users.noreply.github.com>
2023-11-16 15:32:47 +00:00
Victor Stinner
a498433df2
[3.12] gh-112088: Run autoreconf in GHA check_generated_files (GH-112090) (#112159)
gh-112088: Run autoreconf in GHA check_generated_files (#112090)

The "Check if generated files are up to date" job of GitHub Actions
now runs the "autoreconf -ivf -Werror" command instead of the "make
regen-configure" command to avoid depending on the external quay.io
server.

Add Tools/build/regen-configure.sh script to regenerate the configure
with an Ubuntu container image. The
"quay.io/tiran/cpython_autoconf:271" container image
(https://github.com/tiran/cpython_autoconf) is no longer used.

(cherry picked from commit d9fd33a869)
2023-11-16 15:55:40 +01:00
Miss Islington (bot)
2e17a81719
[3.12] gh-110812: Isolating Extension Modules HOWTO: List GC-related gotchas (GH-111504) (GH-112148)
gh-110812: Isolating Extension Modules HOWTO: List GC-related gotchas (GH-111504)
(cherry picked from commit 985679f05d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2023-11-16 13:34:29 +01:00
Hugo van Kemenade
427cf61b51
[3.12] gh-111062: CI: Move OS test jobs to reusable workflows (gh-111568)
CI: Move OS test jobs to reusable workflows

Co-authored-by: Donghee Na <donghee.na@python.org>
2023-11-16 00:44:39 +00:00
Miss Islington (bot)
77f59bf664
[3.12] Fix typo in perf profiling docs (GH-112112) (#112117)
Fix typo in perf profiling docs (GH-112112)
(cherry picked from commit 0cfdd6e3d1)

Co-authored-by: Ryuji Tsutsui <ryu22e+github@gmail.com>
2023-11-15 15:48:04 +00:00