Skip to content

Commit d6eb10d

Browse files
authored
Merge branch 'python:main' into fix-issue-137317
2 parents 9541a02 + ab1bef8 commit d6eb10d

File tree

218 files changed

+9184
-3160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+9184
-3160
lines changed

.github/workflows/tail-call.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ jobs:
114114
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
115115
brew install llvm@${{ matrix.llvm }}
116116
export SDKROOT="$(xcrun --show-sdk-path)"
117-
export PATH="/usr/local/opt/llvm/bin:$PATH"
118-
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
117+
export PATH="/usr/local/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
118+
export PATH="/opt/homebrew/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
119119
CC=clang-20 ./configure --with-tail-call-interp
120120
make all --jobs 4
121121
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ iOS/testbed/Python.xcframework/ios-*/lib
8080
iOS/testbed/Python.xcframework/ios-*/Python.framework
8181
iOS/testbed/iOSTestbed.xcodeproj/project.xcworkspace
8282
iOS/testbed/iOSTestbed.xcodeproj/xcuserdata
83-
iOS/testbed/iOSTestbed.xcodeproj/xcshareddata
8483
Mac/Makefile
8584
Mac/PythonLauncher/Info.plist
8685
Mac/PythonLauncher/Makefile

Doc/c-api/init_config.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,7 @@ If a ``._pth`` file is present:
22582258
* Set :c:member:`~PyConfig.isolated` to ``1``.
22592259
* Set :c:member:`~PyConfig.use_environment` to ``0``.
22602260
* Set :c:member:`~PyConfig.site_import` to ``0``.
2261+
* Set :c:member:`~PyConfig.user_site_directory` to ``0`` (since 3.15).
22612262
* Set :c:member:`~PyConfig.safe_path` to ``1``.
22622263
22632264
If :c:member:`~PyConfig.home` is not set and a ``pyvenv.cfg`` file is present in
@@ -2278,6 +2279,12 @@ The ``__PYVENV_LAUNCHER__`` environment variable is used to set
22782279
therefore affected by :option:`-S`.
22792280
22802281
2282+
.. versionchanged:: 3.15
2283+
2284+
:c:member:`~PyConfig.user_site_directory` is now set to ``0`` when a
2285+
``._pth`` file is present.
2286+
2287+
22812288
Py_GetArgcArgv()
22822289
================
22832290

Doc/extending/extending.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,14 @@ references to all its items, so when item 1 is replaced, it has to dispose of
10841084
the original item 1. Now let's suppose the original item 1 was an instance of a
10851085
user-defined class, and let's further suppose that the class defined a
10861086
:meth:`!__del__` method. If this class instance has a reference count of 1,
1087-
disposing of it will call its :meth:`!__del__` method.
1087+
disposing of it will call its :meth:`!__del__` method. Internally,
1088+
:c:func:`PyList_SetItem` calls :c:func:`Py_DECREF` on the replaced item,
1089+
which invokes replaced item's corresponding
1090+
:c:member:`~PyTypeObject.tp_dealloc` function. During
1091+
deallocation, :c:member:`~PyTypeObject.tp_dealloc` calls
1092+
:c:member:`~PyTypeObject.tp_finalize`, which is mapped to the
1093+
:meth:`!__del__` method for class instances (see :pep:`442`). This entire
1094+
sequence happens synchronously within the :c:func:`PyList_SetItem` call.
10881095

10891096
Since it is written in Python, the :meth:`!__del__` method can execute arbitrary
10901097
Python code. Could it perhaps do something to invalidate the reference to

Doc/howto/remote_debugging.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -374,13 +374,13 @@ To locate a thread:
374374
reliable thread to target.
375375

376376
3. Optionally, use the offset ``interpreter_state.threads_head`` to iterate
377-
through the linked list of all thread states. Each ``PyThreadState`` structure
378-
contains a ``native_thread_id`` field, which may be compared to a target thread
379-
ID to find a specific thread.
377+
through the linked list of all thread states. Each ``PyThreadState``
378+
structure contains a ``native_thread_id`` field, which may be compared to
379+
a target thread ID to find a specific thread.
380380

381-
1. Once a valid ``PyThreadState`` has been found, its address can be used in
382-
later steps of the protocol, such as writing debugger control fields and
383-
scheduling execution.
381+
4. Once a valid ``PyThreadState`` has been found, its address can be used in
382+
later steps of the protocol, such as writing debugger control fields and
383+
scheduling execution.
384384

385385
The following is an example implementation that locates the main thread state::
386386

@@ -454,15 +454,15 @@ its fields are defined by the ``_Py_DebugOffsets`` structure and include the
454454
following:
455455

456456
- ``debugger_script_path``: A fixed-size buffer that holds the full path to a
457-
Python source file (``.py``). This file must be accessible and readable by
458-
the target process when execution is triggered.
457+
Python source file (``.py``). This file must be accessible and readable by
458+
the target process when execution is triggered.
459459

460460
- ``debugger_pending_call``: An integer flag. Setting this to ``1`` tells the
461-
interpreter that a script is ready to be executed.
461+
interpreter that a script is ready to be executed.
462462

463463
- ``eval_breaker``: A field checked by the interpreter during execution.
464-
Setting bit 5 (``_PY_EVAL_PLEASE_STOP_BIT``, value ``1U << 5``) in this
465-
field causes the interpreter to pause and check for debugger activity.
464+
Setting bit 5 (``_PY_EVAL_PLEASE_STOP_BIT``, value ``1U << 5``) in this
465+
field causes the interpreter to pause and check for debugger activity.
466466

467467
To complete the injection, the debugger must perform the following steps:
468468

Doc/library/_thread.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,16 @@ This module defines the following constants and functions:
120120
Its value may be used to uniquely identify this particular thread system-wide
121121
(until the thread terminates, after which the value may be recycled by the OS).
122122

123-
.. availability:: Windows, FreeBSD, Linux, macOS, OpenBSD, NetBSD, AIX, DragonFlyBSD, GNU/kFreeBSD.
123+
.. availability:: Windows, FreeBSD, Linux, macOS, OpenBSD, NetBSD, AIX, DragonFlyBSD, GNU/kFreeBSD, Solaris.
124124

125125
.. versionadded:: 3.8
126126

127127
.. versionchanged:: 3.13
128128
Added support for GNU/kFreeBSD.
129129

130+
.. versionchanged:: next
131+
Added support for Solaris.
132+
130133

131134
.. function:: stack_size([size])
132135

Doc/library/asyncio-eventloop.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,12 @@ clocks to track time.
304304
custom :class:`contextvars.Context` for the *callback* to run in.
305305
The current context is used when no *context* is provided.
306306

307+
.. note::
308+
309+
For performance, callbacks scheduled with :meth:`loop.call_later`
310+
may run up to one clock-resolution early (see
311+
``time.get_clock_info('monotonic').resolution``).
312+
307313
.. versionchanged:: 3.7
308314
The *context* keyword-only parameter was added. See :pep:`567`
309315
for more details.
@@ -324,6 +330,12 @@ clocks to track time.
324330
An instance of :class:`asyncio.TimerHandle` is returned which can
325331
be used to cancel the callback.
326332

333+
.. note::
334+
335+
For performance, callbacks scheduled with :meth:`loop.call_at`
336+
may run up to one clock-resolution early (see
337+
``time.get_clock_info('monotonic').resolution``).
338+
327339
.. versionchanged:: 3.7
328340
The *context* keyword-only parameter was added. See :pep:`567`
329341
for more details.

Doc/library/asyncio-stream.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ StreamWriter
321321
stream.write(data)
322322
await stream.drain()
323323

324+
.. note::
325+
The *data* buffer should be a C contiguous one-dimensional :term:`bytes-like object <bytes-like object>`.
326+
324327
.. method:: writelines(data)
325328

326329
The method writes a list (or any iterable) of bytes to the underlying socket

Doc/library/curses.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ the following methods and attributes:
770770

771771
.. method:: window.attron(attr)
772772

773-
Add attribute *attr* from the "background" set applied to all writes to the
773+
Add attribute *attr* to the "background" set applied to all writes to the
774774
current window.
775775

776776

Doc/library/dataclasses.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,11 @@ Module contents
161161
:class:`object`, this means it will fall back to id-based hashing).
162162

163163
- *frozen*: If true (the default is ``False``), assigning to fields will
164-
generate an exception. This emulates read-only frozen instances. If
165-
:meth:`~object.__setattr__` or :meth:`~object.__delattr__` is defined in the class, then
166-
:exc:`TypeError` is raised. See the discussion below.
164+
generate an exception. This emulates read-only frozen instances.
165+
See the :ref:`discussion <dataclasses-frozen>` below.
166+
167+
If :meth:`~object.__setattr__` or :meth:`~object.__delattr__` is defined in the class
168+
and *frozen* is true, then :exc:`TypeError` is raised.
167169

168170
- *match_args*: If true (the default is ``True``), the
169171
:attr:`~object.__match_args__` tuple will be created from the list of

0 commit comments

Comments
 (0)