]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
23 months agogh-111789: Use PyDict_GetItemRef() in Python/bltinmodule.c (gh-112081)
Serhiy Storchaka [Mon, 27 Nov 2023 17:52:54 +0000 (19:52 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Python/bltinmodule.c (gh-112081)

23 months agogh-111789: Use PyDict_GetItemRef() in Modules/pyexpat.c (gh-112079)
Serhiy Storchaka [Mon, 27 Nov 2023 17:51:31 +0000 (19:51 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Modules/pyexpat.c (gh-112079)

23 months agogh-111789: Use PyDict_GetItemRef() in Modules/_threadmodule.c (gh-112077)
Serhiy Storchaka [Mon, 27 Nov 2023 17:46:43 +0000 (19:46 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Modules/_threadmodule.c (gh-112077)

23 months agogh-111789: Use PyDict_GetItemRef() in Modules/_struct.c (gh-112076)
Serhiy Storchaka [Mon, 27 Nov 2023 17:41:47 +0000 (19:41 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Modules/_struct.c (gh-112076)

23 months agogh-111789: Use PyDict_GetItemRef() in Modules/_csv.c (gh-112073)
Serhiy Storchaka [Mon, 27 Nov 2023 17:35:52 +0000 (19:35 +0200)] 
gh-111789: Use PyDict_GetItemRef() in Modules/_csv.c (gh-112073)

23 months agogh-112438: Fix support of format units with the "e" prefix in nested tuples in PyArg_...
Serhiy Storchaka [Mon, 27 Nov 2023 17:32:55 +0000 (19:32 +0200)] 
gh-112438: Fix support of format units with the "e" prefix in nested tuples in PyArg_Parse (gh-112439)

23 months agogh-84443: SSLSocket.recv_into() now support buffer protocol with itemsize != 1 (GH...
Zackery Spytz [Mon, 27 Nov 2023 17:15:39 +0000 (09:15 -0800)] 
gh-84443: SSLSocket.recv_into() now support buffer protocol with itemsize != 1 (GH-20310)

It is also no longer use __len__().

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
23 months agogh-111874: Call `__set_name__` on objects that define the method inside a `typing...
Alex Waygood [Mon, 27 Nov 2023 16:34:44 +0000 (16:34 +0000)] 
gh-111874: Call `__set_name__` on objects that define the method inside a `typing.NamedTuple` class dictionary as part of the creation of that class (#111876)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
23 months agoGH-101100: Fix reference warnings for ``socket`` methods (#110114)
Adam Turner [Mon, 27 Nov 2023 14:36:54 +0000 (14:36 +0000)] 
GH-101100: Fix reference warnings for ``socket`` methods (#110114)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
23 months agoMove What's New In Python 3.12 entries to the right section (#112447)
Victor Stinner [Mon, 27 Nov 2023 11:55:52 +0000 (12:55 +0100)] 
Move What's New In Python 3.12 entries to the right section (#112447)

Jython and ctypes removals are unrelated to C API Removals.

23 months agogh-111147: Fix `test_set_of_sets_reprs` in `test_pprint` (GH-111148)
Nikita Sobolev [Mon, 27 Nov 2023 10:01:26 +0000 (13:01 +0300)] 
gh-111147: Fix `test_set_of_sets_reprs` in `test_pprint` (GH-111148)

Make it stable and not depending on implementation details.

2 years agoDocs: fix typo in doc for sqlite3.Cursor.execute (#112442)
Tom Levy [Mon, 27 Nov 2023 09:27:47 +0000 (22:27 +1300)] 
Docs: fix typo in doc for sqlite3.Cursor.execute (#112442)

2 years agogh-112414: Fix `AttributeError` when calling `repr()` on a namespace package imported...
Alex Waygood [Mon, 27 Nov 2023 08:19:29 +0000 (08:19 +0000)] 
gh-112414: Fix `AttributeError` when calling `repr()` on a namespace package imported with a custom loader (#112425)

2 years agogh-63284: Add support for TLS-PSK (pre-shared key) to the ssl module (#103181)
Grant Ramsay [Mon, 27 Nov 2023 04:01:44 +0000 (17:01 +1300)] 
gh-63284: Add support for TLS-PSK (pre-shared key) to the ssl module (#103181)

Add support for TLS-PSK (pre-shared key) to the ssl module.

---------

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 years agogh-99606: Make code generated for an empty f-string identical to that of a normal...
Irit Katriel [Sun, 26 Nov 2023 17:13:57 +0000 (17:13 +0000)] 
gh-99606: Make code generated for an empty f-string identical to that of a normal empty string (#112407)

2 years agogh-112405: Optimise `pathlib.Path.relative_to` (#112406)
Alex Waygood [Sun, 26 Nov 2023 15:56:03 +0000 (15:56 +0000)] 
gh-112405: Optimise `pathlib.Path.relative_to` (#112406)

2 years agogh-112358: Fix Python 3.12 regression with subclassing struct.Struct. (#112424)
Mark Dickinson [Sun, 26 Nov 2023 14:29:52 +0000 (14:29 +0000)] 
gh-112358: Fix Python 3.12 regression with subclassing struct.Struct. (#112424)

Revert commit c8c0afc7137ab9f22bf59d591084948ca967c97c (PR #94532),
which moved `struct.Struct` initialisation from `Struct.__init__` to `Struct.__new__`.
This caused issues with code in the wild that subclasses `struct.Struct`.

2 years agogh-101100: Fix Sphinx reference warnings (GH-112416)
Hugo van Kemenade [Sat, 25 Nov 2023 23:40:19 +0000 (01:40 +0200)] 
gh-101100: Fix Sphinx reference warnings (GH-112416)

* Fix Sphinx warning in library/xml.rst

Direct use of the pyexpat module is deprecated, but this is how to check the version for security purposes

* Fix Sphinx warning in library/importlib.resources.rst

* Use italics for parameters

* Link to the exception

* Fix Sphinx warning in library/gzip.rst

* Document message and header defect base classes to fix Sphinx warning in library/email.headerregistry.rst

* Restore feed_eof() doc to fix Sphinx warning in library/asyncio-stream.rst

* Fix Sphinx warning in extending/newtypes.rst

* Fix Sphinx warning in c-api/set.rst

On stdtypes.rst, set and frozenset are documented together and the frozenset has the working refs

2 years agogh-112331: Fix reference manual description of attribute lookup mechanics (gh-112375)
Raymond Hettinger [Sat, 25 Nov 2023 22:20:53 +0000 (16:20 -0600)] 
gh-112331: Fix reference manual description of attribute lookup mechanics (gh-112375)

2 years agoDescriptor HowTo: Sync the error-messages with the C code. Add tests. (gh-112403)
Raymond Hettinger [Sat, 25 Nov 2023 22:18:00 +0000 (16:18 -0600)] 
Descriptor HowTo:  Sync the error-messages with the C code. Add tests. (gh-112403)

2 years agogh-101100 : Fix Sphinx warnings in `library/doctest.rst` (#112399)
Hugo van Kemenade [Sat, 25 Nov 2023 18:08:32 +0000 (20:08 +0200)] 
gh-101100 : Fix Sphinx warnings in `library/doctest.rst` (#112399)

* Fix Sphinx warnings in library/doctest.rst

* Don't link to self, and wrap a line

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* Link to load_tests protocol

* Link to option flags

* Wrap line

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoGH-77621: Delay some imports from pathlib (#112244)
Barney Gale [Sat, 25 Nov 2023 17:41:05 +0000 (17:41 +0000)] 
GH-77621: Delay some imports from pathlib (#112244)

Import `contextlib`, `glob` and `re` only as required.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-94722: fix DocTest.__eq__ for case of no line number on one side (#112385)
Irit Katriel [Sat, 25 Nov 2023 17:23:43 +0000 (17:23 +0000)] 
gh-94722: fix DocTest.__eq__ for case of no line number on one side (#112385)

2 years agoGH-112361: Speed up pathlib by removing some temporary objects. (#112362)
Barney Gale [Sat, 25 Nov 2023 17:19:38 +0000 (17:19 +0000)] 
GH-112361: Speed up pathlib by removing some temporary objects. (#112362)

Construct only one new list object (using `list.copy()`) when creating a
new path object with a modified tail. This slightly speeds up
`with_name()` and `with_suffix()`

2 years agogh-101100: Define `_tkinter` module to fix references (#112382)
Hugo van Kemenade [Sat, 25 Nov 2023 06:18:02 +0000 (08:18 +0200)] 
gh-101100: Define `_tkinter` module to fix references (#112382)

Define _tkinter module to fix references

2 years agogh-101100: Define `test.regrtest` module to fix references (#112381)
Hugo van Kemenade [Sat, 25 Nov 2023 06:17:31 +0000 (08:17 +0200)] 
gh-101100: Define `test.regrtest` module to fix references (#112381)

Define test.regrtest module to fix references

2 years agogh-112355: fix calculation of jump target of ENTER_EXECUTOR in dis (#112377)
Irit Katriel [Fri, 24 Nov 2023 18:13:25 +0000 (18:13 +0000)] 
gh-112355: fix calculation of jump target of ENTER_EXECUTOR in dis (#112377)

2 years agogh-59254: mention in open() doc that line buffering is for writing (#112318)
Irit Katriel [Fri, 24 Nov 2023 17:59:41 +0000 (17:59 +0000)] 
gh-59254: mention in open() doc that line buffering is for writing (#112318)

2 years agogh-112213: Add missing declaration of target_critical_section (gh-112374)
Donghee Na [Fri, 24 Nov 2023 15:58:39 +0000 (15:58 +0000)] 
gh-112213: Add missing declaration of target_critical_section (gh-112374)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-112345: `typing.Protocol`: Let failed subclasscheck show non-method members (...
Randolf Scholz [Fri, 24 Nov 2023 09:46:08 +0000 (10:46 +0100)] 
gh-112345: `typing.Protocol`: Let failed subclasscheck show non-method members (#112344)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoRemove bogus annotations from the descriptor howto guide (#112349)
Raymond Hettinger [Thu, 23 Nov 2023 21:16:00 +0000 (21:16 +0000)] 
Remove bogus annotations from the descriptor howto guide (#112349)

2 years agoAdd extra tests for `random.binomialvariate` (gh-112325)
Tian Gao [Thu, 23 Nov 2023 18:31:03 +0000 (10:31 -0800)] 
Add extra tests for `random.binomialvariate` (gh-112325)

2 years agogh-112137: change dis output to show no-lineno as -- instead of None (#112335)
Irit Katriel [Thu, 23 Nov 2023 14:34:27 +0000 (14:34 +0000)] 
gh-112137: change dis output to show no-lineno as -- instead of None (#112335)

2 years agogh-76785: Return an "excinfo" Object From Interpreter.run() (gh-111573)
Eric Snow [Thu, 23 Nov 2023 00:55:00 +0000 (17:55 -0700)] 
gh-76785: Return an "excinfo" Object From Interpreter.run() (gh-111573)

2 years agogh-111809: Fix `test_deep_repr` from `test_userdict` on WASI (GH-112229)
Nikita Sobolev [Wed, 22 Nov 2023 22:55:25 +0000 (01:55 +0300)] 
gh-111809: Fix `test_deep_repr` from `test_userdict` on WASI (GH-112229)

2 years agogh-112137: change dis output to display labels instead of offsets (#112138)
Irit Katriel [Wed, 22 Nov 2023 22:36:55 +0000 (22:36 +0000)] 
gh-112137: change dis output to display labels instead of offsets (#112138)

2 years agogh-76785: Add _PyType_GetModuleName() to the Internal C-API (gh-112323)
Eric Snow [Wed, 22 Nov 2023 22:03:33 +0000 (15:03 -0700)] 
gh-76785: Add _PyType_GetModuleName() to the Internal C-API (gh-112323)

The new function corresponds to the existing (public) PyType_GetName() and PyType_GetQualName().

2 years agogh-76785: Clean up the Failure-Related _xxsubinterpreters Tests (gh-112322)
Eric Snow [Wed, 22 Nov 2023 21:48:45 +0000 (14:48 -0700)] 
gh-76785: Clean up the Failure-Related _xxsubinterpreters Tests (gh-112322)

2 years agoMerge branch 'main' of https://github.com/python/cpython
Thomas Wouters [Wed, 22 Nov 2023 21:27:46 +0000 (22:27 +0100)] 
Merge branch 'main' of https://github.com/python/cpython

2 years agoPost 3.13.0a2
Thomas Wouters [Wed, 22 Nov 2023 21:24:48 +0000 (22:24 +0100)] 
Post 3.13.0a2

2 years agoGH-111485: Sort cases in the case generator output (GH-112315)
Mark Shannon [Wed, 22 Nov 2023 15:19:50 +0000 (15:19 +0000)] 
GH-111485: Sort cases in the case generator output (GH-112315)

2 years agogh-111965: Use critical sections to make io.BufferedIOBase and its related classes...
Mayuresh Kedari [Wed, 22 Nov 2023 11:25:07 +0000 (16:55 +0530)] 
gh-111965: Use critical sections to make io.BufferedIOBase and its related classes thread safe (gh-112298)

2 years agoPython 3.13.0a2 v3.13.0a2
Thomas Wouters [Wed, 22 Nov 2023 10:43:55 +0000 (11:43 +0100)] 
Python 3.13.0a2

2 years agoDo not build the macOS installer with mimalloc enabled (#112312)
Ned Deily [Wed, 22 Nov 2023 08:29:28 +0000 (03:29 -0500)] 
Do not build the macOS installer with mimalloc enabled  (#112312)

Do not build the macOS installer with mimalloc enabled pending resolution of
weak linking crashes during interpreter startup on macOS 10.9,
10.10, and 10.11 when built on macOS 11 and later.

2 years agogh-59703: restore include of mach-o/dyld.h (gh-112309)
Ned Deily [Wed, 22 Nov 2023 06:20:57 +0000 (01:20 -0500)] 
gh-59703: restore include of mach-o/dyld.h  (gh-112309)

On older versions of macOS, _NSGetExecutablePath appears to only
be available via macho-o/dyld so macho-o/dyld.h is still needed.

2 years agoFix docstring and var name of itertools recipe (#112113)
Sebastian Rittau [Wed, 22 Nov 2023 05:35:36 +0000 (06:35 +0100)] 
Fix docstring and var name of itertools recipe (#112113)

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

2 years agogh-111863: Rename term Py_NOGIL to Py_GIL_DISABLED in sysconfig (gh-112307)
Donghee Na [Wed, 22 Nov 2023 01:32:43 +0000 (01:32 +0000)] 
gh-111863: Rename term Py_NOGIL to Py_GIL_DISABLED in sysconfig (gh-112307)

2 years agoGH-111963: Clarify sys.monitoring.free_tool_id's limitations (GH-112291)
Tian Gao [Tue, 21 Nov 2023 22:58:30 +0000 (14:58 -0800)] 
GH-111963: Clarify sys.monitoring.free_tool_id's limitations (GH-112291)

2 years agogh-110745: add a newline argument to pathlib.Path.read_text (#110880)
Junya Okabe [Tue, 21 Nov 2023 22:32:38 +0000 (07:32 +0900)] 
gh-110745: add a newline argument to pathlib.Path.read_text (#110880)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Barney Gale <barney.gale@gmail.com>
2 years agogh-111361: Added an update for unicodedata in what's new in Python 3.13 (#112031)
Lincoln [Tue, 21 Nov 2023 18:46:26 +0000 (21:46 +0300)] 
gh-111361: Added an update for unicodedata in what's new in Python 3.13 (#112031)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-111863: Rename blurb snippet placed in the wrong directory by accident. (#112300)
T. Wouters [Tue, 21 Nov 2023 17:37:03 +0000 (18:37 +0100)] 
gh-111863: Rename blurb snippet placed in the wrong directory by accident. (#112300)

Rename blurb snippet placed in the wrong directory by accident.

2 years agogh-112252: Fix error on unset $OSNAME in venv/activate (GH-112253)
James Turk [Tue, 21 Nov 2023 15:18:53 +0000 (09:18 -0600)] 
gh-112252: Fix error on unset $OSNAME in venv/activate (GH-112253)

2 years agogh-57879: Increase test coverage for pstats.py (gh-111447)
Liu, An-Chi [Tue, 21 Nov 2023 13:32:09 +0000 (22:32 +0900)] 
gh-57879: Increase test coverage for pstats.py (gh-111447)

2 years agogh-110950: add upstream Tk fixes to macOS installer. (GH-111041)
Christopher Chavez [Tue, 21 Nov 2023 08:12:19 +0000 (02:12 -0600)] 
gh-110950: add upstream Tk fixes to macOS installer. (GH-111041)

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)

Co-authored-by: Ned Deily <nad@python.org>
2 years agogh-59703: use the system dladdr function in getpath.c for macOS framework builds...
AN Long [Tue, 21 Nov 2023 05:15:25 +0000 (13:15 +0800)] 
gh-59703: use the system dladdr function in getpath.c for macOS framework builds (GH-111546)

Co-authored-by: Ned Deily <nad@python.org>
2 years agogh-111786: Use separate opcode vars for Tier 1 and Tier 2 (#112289)
Michael Droettboom [Mon, 20 Nov 2023 23:13:44 +0000 (18:13 -0500)] 
gh-111786: Use separate opcode vars for Tier 1 and Tier 2 (#112289)

This makes Windows about 3% faster on pyperformance benchmarks.

2 years agogh-112287: Speed up Tier 2 (uop) interpreter a little (#112286)
Guido van Rossum [Mon, 20 Nov 2023 19:25:32 +0000 (11:25 -0800)] 
gh-112287: Speed up Tier 2 (uop) interpreter a little (#112286)

This makes the Tier 2 interpreter a little faster.
I calculated by about 3%,
though I hesitate to claim an exact number.

This starts by doubling the trace size limit (to 512),
making it more likely that loops fit in a trace.

The rest of the approach is to only load
`oparg` and `operand` in cases that use them.
The code generator know when these are used.

For `oparg`, it will conditionally emit
```
oparg = CURRENT_OPARG();
```
at the top of the case block.
(The `oparg` variable may be referenced multiple times
by the instructions code block, so it must be in a variable.)

For `operand`, it will use `CURRENT_OPERAND()` directly
instead of referencing the `operand` variable,
which no longer exists.
(There is only one place where this will be used.)

2 years agogh-111848: Clean up RESERVE() macro (#112274)
Guido van Rossum [Mon, 20 Nov 2023 18:45:42 +0000 (10:45 -0800)] 
gh-111848: Clean up RESERVE() macro (#112274)

Also avoid compiler warnings about unused 'reserved' variable.

2 years agogh-106529: Make FOR_ITER a viable uop (#112134)
Guido van Rossum [Mon, 20 Nov 2023 18:08:53 +0000 (10:08 -0800)] 
gh-106529: Make FOR_ITER a viable uop (#112134)

This uses the new mechanism whereby certain uops
are replaced by others during translation,
using the `_PyUop_Replacements` table.
We further special-case the `_FOR_ITER_TIER_TWO` uop
to update the deoptimization target to point
just past the corresponding `END_FOR` opcode.

Two tiny code cleanups are also part of this PR.

2 years agogh-112243: Don't include comments in f-string debug expressions (#112284)
Pablo Galindo Salgado [Mon, 20 Nov 2023 15:18:24 +0000 (15:18 +0000)] 
gh-112243: Don't include comments in f-string debug expressions (#112284)

2 years agogh-111863: Rename `Py_NOGIL` to `Py_GIL_DISABLED` (#111864)
Hugo van Kemenade [Mon, 20 Nov 2023 13:52:00 +0000 (15:52 +0200)] 
gh-111863: Rename `Py_NOGIL` to `Py_GIL_DISABLED` (#111864)

Rename Py_NOGIL to Py_GIL_DISABLED

2 years agobpo-45759: Better error messages for non-matching 'elif'/'else' statements (#29513)
Crowthebird [Mon, 20 Nov 2023 13:27:53 +0000 (21:27 +0800)] 
bpo-45759: Better error messages for non-matching 'elif'/'else' statements (#29513)

2 years agoGH-111807: Lower the parser stack depth under WASI debug builds (#112225)
Brett Cannon [Mon, 20 Nov 2023 13:27:33 +0000 (05:27 -0800)] 
GH-111807: Lower the parser stack depth under WASI debug builds (#112225)

2 years agogh-73561: Omit interface scope from IPv6 when used as Host header (#93324)
Michael [Sun, 19 Nov 2023 22:37:13 +0000 (23:37 +0100)] 
gh-73561: Omit interface scope from IPv6 when used as Host header (#93324)

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

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google LLC]
2 years agogh-111926: Update _PyWeakref_IS_DEAD to be thread-safe (gh-112267)
Donghee Na [Sun, 19 Nov 2023 22:36:45 +0000 (22:36 +0000)] 
gh-111926: Update _PyWeakref_IS_DEAD to be thread-safe (gh-112267)

2 years agogh-112266: Remove `(if defined)` part from `__dict__` and `__weakref__` docstrings...
Nikita Sobolev [Sun, 19 Nov 2023 18:30:07 +0000 (21:30 +0300)] 
gh-112266: Remove `(if defined)` part from `__dict__` and `__weakref__` docstrings (#112268)

2 years agogh-111965: Using critical sections to make ``io.StringIO`` thread safe. (gh-112116)
AN Long [Sun, 19 Nov 2023 12:34:40 +0000 (20:34 +0800)] 
gh-111965: Using critical sections to make ``io.StringIO`` thread safe. (gh-112116)

2 years agogh-110383: Explained which error message is generated when there is an unhandled...
Unique-Usman [Sun, 19 Nov 2023 12:20:10 +0000 (17:50 +0530)] 
gh-110383: Explained which error message is generated when there is an unhandled exception (#111574)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-110383: Fix documentation profile cumtime fix (#112221)
Alex Ptakhin [Sun, 19 Nov 2023 09:56:54 +0000 (10:56 +0100)] 
gh-110383: Fix documentation profile cumtime fix (#112221)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agoIDLE: Fix test_debugger bug and buildbot failures (#112258)
Terry Jan Reedy [Sun, 19 Nov 2023 06:39:26 +0000 (01:39 -0500)] 
IDLE: Fix test_debugger bug and buildbot failures (#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.

2 years agogh-79871: IDLE - Fix and test debugger module (#11451)
Anthony Shaw [Sun, 19 Nov 2023 04:20:38 +0000 (15:20 +1100)] 
gh-79871: IDLE - Fix and test debugger module (#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%.
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agogh-112186: Improve test case `test_loop_is_closed_resource_warnings` (#112187)
DPR [Sun, 19 Nov 2023 03:21:34 +0000 (11:21 +0800)] 
gh-112186: Improve test case `test_loop_is_closed_resource_warnings` (#112187)

2 years agogh-112213: Update _weakref module to use new AC feature (gh-112250)
Donghee Na [Sun, 19 Nov 2023 01:43:51 +0000 (01:43 +0000)] 
gh-112213: Update _weakref module to use new AC feature (gh-112250)

2 years agogh-111903: Update AC to support "pycore_critical_section.h" header (gh-112251)
Donghee Na [Sun, 19 Nov 2023 01:13:58 +0000 (01:13 +0000)] 
gh-111903: Update AC to support "pycore_critical_section.h" header (gh-112251)

2 years agogh-111965: Use critical sections to make io.TextIOWrapper thread safe (gh-112193)
AN Long [Sat, 18 Nov 2023 23:21:04 +0000 (07:21 +0800)] 
gh-111965: Use critical sections to make io.TextIOWrapper thread safe (gh-112193)

2 years agogh-112213: Add @critical_section target directive to Argument Clinic (gh-112232)
Donghee Na [Sat, 18 Nov 2023 23:05:49 +0000 (23:05 +0000)] 
gh-112213: Add @critical_section target directive to Argument Clinic (gh-112232)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoGH-110109: Test pure functionality of `pathlib.Path` user subclasses (#112242)
Barney Gale [Sat, 18 Nov 2023 17:06:10 +0000 (17:06 +0000)] 
GH-110109: Test pure functionality of `pathlib.Path` user subclasses (#112242)

Add `PurePathTest` as a superclass of `PathTest`, and therefore also
`PathSubclassTest`. This adds coverage of pure functionality in user
subclasses of `pathlib.Path`.

Remove `PosixPathAsPureTest` and `WindowsPathAsPureTest`, as they
now duplicate `PosixPathTest` and `WindowsPathTest`.

This makes the MROs of test unit classes match the MROs of pathlib
classes.

2 years agoGH-110109: Fix misplaced tests for `pathlib.WindowsPath.owner()` and `group()` (...
Barney Gale [Sat, 18 Nov 2023 15:42:07 +0000 (15:42 +0000)] 
GH-110109: Fix misplaced tests for `pathlib.WindowsPath.owner()` and `group()` (#112239)

Move test methods from `WindowsPathAsPureTest` to `WindowsPathTest` unit.
The former test unit is intended to exercise only pure path functionality.

2 years agogh-112234: Remove the toplevel parameter in converttuple() (GH-112235)
Serhiy Storchaka [Sat, 18 Nov 2023 11:47:34 +0000 (13:47 +0200)] 
gh-112234: Remove the toplevel parameter in converttuple() (GH-112235)

It is and always was 0.

2 years agogh-111926: Update _weakref to be threadsafe in --disable-gil build (gh-112189)
Donghee Na [Sat, 18 Nov 2023 07:09:23 +0000 (07:09 +0000)] 
gh-111926: Update _weakref to be threadsafe in --disable-gil build (gh-112189)

2 years agogh-110319: Assert type_version != 0 before using it (#112226)
Guido van Rossum [Sat, 18 Nov 2023 04:58:13 +0000 (20:58 -0800)] 
gh-110319: Assert type_version != 0 before using it (#112226)

- Ensure that `assert(type_version != 0);` always comes *before* using `type_version`

Also:
- In cases_generator, rename `-v` to from `--verbose` to `--viable`

2 years agogh-111810: Fix `test_repr_deep` from `test_userlist` on WASI (#112197)
Nikita Sobolev [Sat, 18 Nov 2023 00:08:23 +0000 (03:08 +0300)] 
gh-111810: Fix `test_repr_deep` from `test_userlist` on WASI (#112197)

Co-authored-by: Brett Cannon <brett@python.org>
2 years agoGH-111808: Make the default value for `test.support.infinite_recursion()` conditional...
Brett Cannon [Fri, 17 Nov 2023 23:52:11 +0000 (15:52 -0800)] 
GH-111808: Make the default value for `test.support.infinite_recursion()` conditional on compiler optimizations (GH-112223)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years agoFix typo in documentation of `importlib.metadata` (GH-112099)
Charlie Zhao [Fri, 17 Nov 2023 23:11:30 +0000 (07:11 +0800)] 
Fix typo in documentation of `importlib.metadata` (GH-112099)

Fix minor typo in importlib doc

2 years agoA few more cases_generator cleanups (#112220)
Guido van Rossum [Fri, 17 Nov 2023 22:36:37 +0000 (14:36 -0800)] 
A few more cases_generator cleanups (#112220)

2 years agogh-112026: Update What's New: _PyObject_Vectorcall() was restored (#112171)
Victor Stinner [Fri, 17 Nov 2023 22:30:42 +0000 (23:30 +0100)] 
gh-112026: Update What's New: _PyObject_Vectorcall() was restored (#112171)

2 years agoVarious small improvements to uop debug output (#112218)
Guido van Rossum [Fri, 17 Nov 2023 22:25:57 +0000 (14:25 -0800)] 
Various small improvements to uop debug output (#112218)

- Show uop name in Error/DEOPT messages
- Add target to some messages
- Expose uop_name() as _PyUopName()

2 years agogh-106529: Cleanups split off gh-112134 (#112214)
Guido van Rossum [Fri, 17 Nov 2023 19:49:42 +0000 (11:49 -0800)] 
gh-106529: Cleanups split off gh-112134 (#112214)

- Double max trace size to 256
- Add a dependency on executor_cases.c.h for ceval.o
- Mark `_SPECIALIZE_UNPACK_SEQUENCE` as `TIER_ONE_ONLY`
- Add debug output back showing the optimized trace
- Bunch of cleanups to Tools/cases_generator/

2 years agoFix syntax in CODEOWNERS file (#112210)
Alex Waygood [Fri, 17 Nov 2023 18:31:45 +0000 (18:31 +0000)] 
Fix syntax in CODEOWNERS file (#112210)

2 years agogh-112194: Convert more examples to doctests in `typing.py` (#112195)
Nikita Sobolev [Fri, 17 Nov 2023 17:56:31 +0000 (20:56 +0300)] 
gh-112194: Convert more examples to doctests in `typing.py` (#112195)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoGH-110109: Speed up `pathlib._PathBase.resolve()` (#110412)
Barney Gale [Fri, 17 Nov 2023 16:58:17 +0000 (16:58 +0000)] 
GH-110109: Speed up `pathlib._PathBase.resolve()` (#110412)

- Add fast path to `_split_stack()`
- Skip unnecessarily resolution of the current directory when a relative
  path is given to `resolve()`
- Remove stat and target caches, which slow down most `resolve()` calls in
  practice.
- Slightly refactor code for clarity.

2 years agoTweak my interests (and Mark Shannon's :-) in CODEOWNERS (#112206)
Guido van Rossum [Fri, 17 Nov 2023 16:44:51 +0000 (08:44 -0800)] 
Tweak my interests (and Mark Shannon's :-) in CODEOWNERS (#112206)

2 years agoGH-110109: Churn `pathlib.PurePath` methods (#112012)
Barney Gale [Fri, 17 Nov 2023 15:32:50 +0000 (15:32 +0000)] 
GH-110109: Churn `pathlib.PurePath` methods (#112012)

Re-arrange `pathlib.PurePath` methods in source code. No other changes.

The `PurePath` implementations of certain special methods, such as
`__eq__()` and `__hash__()`, are not usually applicable to user subclasses
of `_PathBase`. To facilitate their removal, another patch will split the
`PurePath` class into `_PurePathBase` and `PurePath`, with the latter
providing these special methods.

This patch prepares the ground for splitting `PurePath`. It's similar to
e8d77b0, which preceded splitting `Path`. By churning the methods here,
subsequent patches will be easier to review and less likely to break
things.

2 years agogh-110481, doc: Add "immortal" term to the glossary (#112180)
Victor Stinner [Fri, 17 Nov 2023 14:09:19 +0000 (15:09 +0100)] 
gh-110481, doc: Add "immortal" term to the glossary (#112180)

2 years agogh-94309: "What's new in Python 3.12": improve deprecation notice for typing.Hashable...
Ori Avtalion [Fri, 17 Nov 2023 12:30:47 +0000 (14:30 +0200)] 
gh-94309: "What's new in Python 3.12": improve deprecation notice for typing.Hashable and typing.Sized (#112196)

2 years agogh-112070: make `functools.lru_cache` threadsafe in --disable-gil build (gh-112111)
Wanderxjtu [Fri, 17 Nov 2023 05:03:02 +0000 (13:03 +0800)] 
gh-112070: make `functools.lru_cache` threadsafe in --disable-gil build (gh-112111)

* gh-112070: make `functools.lrucacle` threadsafe in --disable-gil build

* gh-112070: update generate `functoolsmodule` files

* gh-112070: add NEWS file

* Delete Misc/NEWS.d/next/Library/2023-11-15-20-19-45.gh-issue-112070.q6OhcU.rst

* gh-112070: reformat functoolsmodule.c

---------

Co-authored-by: Sam Gross <colesbury@gmail.com>
2 years agogh-112165: Fix typo in `__main__.py` (#112183)
Terry Jan Reedy [Fri, 17 Nov 2023 01:05:16 +0000 (20:05 -0500)] 
gh-112165: Fix typo in `__main__.py` (#112183)

Change '[2]' to '[1]' to get second argument.

2 years agogh-111799: Fix `testRecursiveRepr` from `test_fileio` on WASI (GH-112181)
Nikita Sobolev [Thu, 16 Nov 2023 23:12:27 +0000 (02:12 +0300)] 
gh-111799: Fix `testRecursiveRepr` from `test_fileio` on WASI (GH-112181)

2 years agogh-111482: Fix time_clockid_converter() on AIX (#112170)
Victor Stinner [Thu, 16 Nov 2023 23:00:16 +0000 (00:00 +0100)] 
gh-111482: Fix time_clockid_converter() on AIX (#112170)

clockid_t is defined as long long on AIX.

2 years agogh-111800: Fix `test_recursive_repr` from `test_io` under WASI to not recurse so...
Nikita Sobolev [Thu, 16 Nov 2023 19:47:38 +0000 (22:47 +0300)] 
gh-111800: Fix `test_recursive_repr` from `test_io` under WASI to not recurse so deeply (GH-112150)