Commit Graph

119707 Commits

Author SHA1 Message Date
Tom Levy fb79e1ed4a
Docs: fix typo in doc for sqlite3.Cursor.execute (#112442) 2023-11-27 09:27:47 +00:00
Alex Waygood 0622839cfe
gh-112414: Fix `AttributeError` when calling `repr()` on a namespace package imported with a custom loader (#112425) 2023-11-27 08:19:29 +00:00
Grant Ramsay e954ac7205
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>
2023-11-27 04:01:44 +00:00
Irit Katriel fb202af447
gh-99606: Make code generated for an empty f-string identical to that of a normal empty string (#112407) 2023-11-26 17:13:57 +00:00
Alex Waygood 418d585feb
gh-112405: Optimise `pathlib.Path.relative_to` (#112406) 2023-11-26 15:56:03 +00:00
Mark Dickinson 9fe60340d7
gh-112358: Fix Python 3.12 regression with subclassing struct.Struct. (#112424)
Revert commit c8c0afc713 (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`.
2023-11-26 14:29:52 +00:00
Hugo van Kemenade 3faf8e586d
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
2023-11-25 15:40:19 -08:00
Raymond Hettinger 97f8f28b3e
gh-112331: Fix reference manual description of attribute lookup mechanics (gh-112375) 2023-11-25 16:20:53 -06:00
Raymond Hettinger f93a4ef7a9
Descriptor HowTo: Sync the error-messages with the C code. Add tests. (gh-112403) 2023-11-25 16:18:00 -06:00
Hugo van Kemenade 0303a9fa79
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>
2023-11-25 20:08:32 +02:00
Barney Gale bbb4367b55
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>
2023-11-25 17:41:05 +00:00
Irit Katriel fbb9027a03
gh-94722: fix DocTest.__eq__ for case of no line number on one side (#112385) 2023-11-25 17:23:43 +00:00
Barney Gale 19a1fc1b3d
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()`
2023-11-25 17:19:38 +00:00
Hugo van Kemenade 6b961b8cea
gh-101100: Define `_tkinter` module to fix references (#112382)
Define _tkinter module to fix references
2023-11-25 08:18:02 +02:00
Hugo van Kemenade d525d01e27
gh-101100: Define `test.regrtest` module to fix references (#112381)
Define test.regrtest module to fix references
2023-11-25 08:17:31 +02:00
Irit Katriel 9eb3b35dd7
gh-112355: fix calculation of jump target of ENTER_EXECUTOR in dis (#112377) 2023-11-24 18:13:25 +00:00
Irit Katriel fafae08cc7
gh-59254: mention in open() doc that line buffering is for writing (#112318) 2023-11-24 18:59:41 +01:00
Donghee Na 4ec849bba8
gh-112213: Add missing declaration of target_critical_section (gh-112374)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-25 00:58:39 +09:00
Randolf Scholz e9d1360c9a
gh-112345: `typing.Protocol`: Let failed subclasscheck show non-method members (#112344)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-11-24 09:46:08 +00:00
Raymond Hettinger d9fc15222e
Remove bogus annotations from the descriptor howto guide (#112349) 2023-11-23 15:16:00 -06:00
Tian Gao dc0adb44d8
Add extra tests for `random.binomialvariate` (gh-112325) 2023-11-23 12:31:03 -06:00
Irit Katriel 89ddea4886
gh-112137: change dis output to show no-lineno as -- instead of None (#112335) 2023-11-23 14:34:27 +00:00
Eric Snow 9e56eedd01
gh-76785: Return an "excinfo" Object From Interpreter.run() (gh-111573) 2023-11-23 00:55:00 +00:00
Nikita Sobolev 14e539f097
gh-111809: Fix `test_deep_repr` from `test_userdict` on WASI (GH-112229) 2023-11-22 14:55:25 -08:00
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