Commit graph

119683 commits

Author SHA1 Message Date
Irit Katriel 10e1a0c916
gh-112137: change dis output to display labels instead of offsets (#112138) 2023-11-22 22:36:55 +00:00
Eric Snow 790db85c77
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().
2023-11-22 15:03:33 -07:00
Eric Snow 5c3a129ecf
gh-76785: Clean up the Failure-Related _xxsubinterpreters Tests (gh-112322) 2023-11-22 14:48:45 -07:00
Thomas Wouters 118522b972 Merge branch 'main' of https://github.com/python/cpython 2023-11-22 22:27:46 +01:00
Thomas Wouters 1c5279b9d6 Post 3.13.0a2 2023-11-22 22:24:48 +01:00
Mark Shannon 1619f4350e
GH-111485: Sort cases in the case generator output (GH-112315) 2023-11-22 15:19:50 +00:00
Mayuresh Kedari fef6fb8762
gh-111965: Use critical sections to make io.BufferedIOBase and its related classes thread safe (gh-112298) 2023-11-22 20:25:07 +09:00
Thomas Wouters 9c4347ef8b Python 3.13.0a2 2023-11-22 12:20:24 +01:00
Ned Deily ad0e2a9332
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.
2023-11-22 03:29:28 -05:00
Ned Deily fde8fe50e4
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.
2023-11-22 01:20:57 -05:00
Sebastian Rittau 6c47eaccfa
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.
2023-11-22 07:35:36 +02:00
Donghee Na 4fa376b005
gh-111863: Rename term Py_NOGIL to Py_GIL_DISABLED in sysconfig (gh-112307) 2023-11-22 10:32:43 +09:00
Tian Gao 46500c42f0
GH-111963: Clarify sys.monitoring.free_tool_id's limitations (GH-112291) 2023-11-21 14:58:30 -08:00
Junya Okabe 9d70831cb7
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>
2023-11-21 22:32:38 +00:00
Lincoln d857d5331a
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>
2023-11-21 11:46:26 -07:00
T. Wouters 4c483e0113
gh-111863: Rename blurb snippet placed in the wrong directory by accident. (#112300)
Rename blurb snippet placed in the wrong directory by accident.
2023-11-21 18:37:03 +01:00
James Turk e1540ae74d
gh-112252: Fix error on unset $OSNAME in venv/activate (GH-112253) 2023-11-21 20:48:53 +05:30
Liu, An-Chi 44aa603d59
gh-57879: Increase test coverage for pstats.py (gh-111447) 2023-11-21 22:32:09 +09:00
Christopher Chavez d67f947c72
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>
2023-11-21 03:12:19 -05:00
AN Long de2715f086
gh-59703: use the system dladdr function in getpath.c for macOS framework builds (GH-111546)
Co-authored-by: Ned Deily <nad@python.org>
2023-11-21 00:15:25 -05:00
Michael Droettboom 6a00a58f60
gh-111786: Use separate opcode vars for Tier 1 and Tier 2 (#112289)
This makes Windows about 3% faster on pyperformance benchmarks.
2023-11-20 15:13:44 -08:00
Guido van Rossum 8deb8bc2e5
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.)
2023-11-20 11:25:32 -08:00
Guido van Rossum c4c63211e8
gh-111848: Clean up RESERVE() macro (#112274)
Also avoid compiler warnings about unused 'reserved' variable.
2023-11-20 10:45:42 -08:00
Guido van Rossum 1995955173
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.
2023-11-20 10:08:53 -08:00
Pablo Galindo Salgado d59feb5dbe
gh-112243: Don't include comments in f-string debug expressions (#112284) 2023-11-20 15:18:24 +00:00
Hugo van Kemenade 3b3ec0d77f
gh-111863: Rename Py_NOGIL to Py_GIL_DISABLED (#111864)
Rename Py_NOGIL to Py_GIL_DISABLED
2023-11-20 15:52:00 +02:00
Crowthebird 1c8f912ebd
bpo-45759: Better error messages for non-matching 'elif'/'else' statements (#29513) 2023-11-20 13:27:53 +00:00
Brett Cannon 56e59a49ae
GH-111807: Lower the parser stack depth under WASI debug builds (#112225) 2023-11-20 13:27:33 +00:00
Michael ce1096f974
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]
2023-11-19 22:37:13 +00:00
Donghee Na 7c9f2677fb
gh-111926: Update _PyWeakref_IS_DEAD to be thread-safe (gh-112267) 2023-11-20 07:36:45 +09:00
Nikita Sobolev f8129146ef
gh-112266: Remove (if defined) part from __dict__ and __weakref__ docstrings (#112268) 2023-11-19 18:30:07 +00:00
AN Long 77d9f1e6d9
gh-111965: Using critical sections to make `io.StringIO` thread safe. (gh-112116) 2023-11-19 21:34:40 +09:00
Unique-Usman a6d25de375
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>
2023-11-19 05:20:10 -07:00
Alex Ptakhin 6bf8f20344
gh-110383: Fix documentation profile cumtime fix (#112221)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-11-19 02:56:54 -07:00
Terry Jan Reedy 14fd86a59d
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.
2023-11-19 06:39:26 +00:00
Anthony Shaw adedcfa06b
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>
2023-11-18 23:20:38 -05:00
DPR 18c6929469
gh-112186: Improve test case test_loop_is_closed_resource_warnings (#112187) 2023-11-19 03:21:34 +00:00
Donghee Na 2bcc0f7d34
gh-112213: Update _weakref module to use new AC feature (gh-112250) 2023-11-19 10:43:51 +09:00
Donghee Na b8c952af72
gh-111903: Update AC to support "pycore_critical_section.h" header (gh-112251) 2023-11-19 10:13:58 +09:00
AN Long 1a969b4f55
gh-111965: Use critical sections to make io.TextIOWrapper thread safe (gh-112193) 2023-11-19 08:21:04 +09:00
Donghee Na e52cc80f7f
gh-112213: Add @critical_section target directive to Argument Clinic (gh-112232)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-19 08:05:49 +09:00
Barney Gale 607b5e30c6
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.
2023-11-18 17:06:10 +00:00
Barney Gale 9c7c8bacc1
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.
2023-11-18 15:42:07 +00:00
Serhiy Storchaka 91d1730541
gh-112234: Remove the toplevel parameter in converttuple() (GH-112235)
It is and always was 0.
2023-11-18 13:47:34 +02:00
Donghee Na 0566ab9c4d
gh-111926: Update _weakref to be threadsafe in --disable-gil build (gh-112189) 2023-11-18 16:09:23 +09:00
Guido van Rossum eb3c94ea66
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`
2023-11-17 20:58:13 -08:00
Nikita Sobolev 43b1c33204
gh-111810: Fix test_repr_deep from test_userlist on WASI (#112197)
Co-authored-by: Brett Cannon <brett@python.org>
2023-11-17 16:08:23 -08:00
Brett Cannon f489ace9e7
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>
2023-11-17 15:52:11 -08:00
Charlie Zhao dabc0d77b2
Fix typo in documentation of importlib.metadata (GH-112099)
Fix minor typo in importlib doc
2023-11-17 15:11:30 -08:00
Guido van Rossum da314f7c8d
A few more cases_generator cleanups (#112220) 2023-11-17 22:36:37 +00:00