Skip to content

Commit f3bb5a1

Browse files
committed
Merge in the main branch
2 parents f08fac8 + b3cfd36 commit f3bb5a1

102 files changed

Lines changed: 3477 additions & 817 deletions

File tree

Some content is hidden

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

.github/workflows/jit.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3636
with:
3737
persist-credentials: false
38+
- name: Install dependencies
39+
run: |
40+
sudo ./.github/workflows/posix-deps-apt.sh
3841
- name: Build tier two interpreter
3942
run: |
4043
./configure --enable-experimental-jit=interpreter --with-pydebug
@@ -152,6 +155,9 @@ jobs:
152155
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
153156
with:
154157
python-version: '3.11'
158+
- name: Install dependencies
159+
run: |
160+
sudo ./.github/workflows/posix-deps-apt.sh
155161
- name: Build
156162
run: |
157163
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM_VERSION }}
@@ -188,6 +194,9 @@ jobs:
188194
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
189195
with:
190196
python-version: '3.11'
197+
- name: Install dependencies
198+
run: |
199+
sudo ./.github/workflows/posix-deps-apt.sh
191200
- name: Build
192201
run: |
193202
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM_VERSION }}

.github/workflows/mypy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ jobs:
7171
persist-credentials: false
7272
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
7373
with:
74-
python-version: "3.13"
74+
python-version: "3.15"
75+
allow-prereleases: true
7576
cache: pip
7677
cache-dependency-path: Tools/requirements-dev.txt
7778
- run: pip install -r Tools/requirements-dev.txt

.readthedocs.yml

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,47 @@ build:
1212
tools:
1313
python: "3"
1414

15-
commands:
16-
# https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition
17-
#
18-
# Cancel building pull requests when there aren't changes in the Doc directory.
19-
#
20-
# If there are no changes (git diff exits with 0) we force the command to return with 183.
21-
# This is a special exit code on Read the Docs that will cancel the build immediately.
22-
- |
23-
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && [ "$(git diff --quiet origin/main -- Doc/ .readthedocs.yml; echo $?)" -eq 0 ];
24-
then
25-
echo "No changes to Doc/ - exiting the build.";
26-
exit 183;
27-
fi
28-
29-
- asdf plugin add uv
30-
- asdf install uv latest
31-
- asdf global uv latest
32-
- make -C Doc venv html
33-
- mkdir _readthedocs
34-
- mv Doc/build/html _readthedocs/html
15+
jobs:
16+
post_checkout:
17+
# https://docs.readthedocs.com/platform/stable/guides/build/skip-build.html#skip-builds-based-on-conditions
18+
#
19+
# Cancel building pull requests when there aren't changes in the Doc
20+
# directory or RTD configuration, or if we can't cleanly merge the base
21+
# branch.
22+
- |
23+
set -eEux;
24+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ];
25+
then
26+
base_branch=main;
27+
git fetch --depth=50 origin $base_branch:origin-$base_branch;
28+
for attempt in $(seq 10);
29+
do
30+
if ! git merge-base HEAD origin-$base_branch;
31+
then
32+
git fetch --deepen=50 origin $base_branch;
33+
else
34+
break;
35+
fi;
36+
done;
37+
if ! git -c "user.name=rtd" -c "user.email=no-reply@readthedocs.org" merge --no-stat --no-edit origin-$base_branch;
38+
then
39+
echo "Unsuccessful merge with '$base_branch' branch, skipping the build";
40+
exit 183;
41+
fi;
42+
if git diff --exit-code --stat origin-$base_branch -- Doc/ .readthedocs.yml;
43+
then
44+
echo "No changes to Doc/ - skipping the build.";
45+
exit 183;
46+
fi;
47+
fi;
48+
create_environment:
49+
- echo "Skipping default environment creation"
50+
install:
51+
- asdf plugin add uv
52+
- asdf install uv latest
53+
- asdf global uv latest
54+
build:
55+
html:
56+
- make -C Doc venv html
57+
- mkdir -p "$READTHEDOCS_OUTPUT"
58+
- mv Doc/build/html "$READTHEDOCS_OUTPUT/"

Doc/c-api/exceptions.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,3 +1348,67 @@ Tracebacks
13481348
13491349
This function returns ``0`` on success, and returns ``-1`` with an
13501350
exception set on failure.
1351+
1352+
.. c:function:: const char* PyUnstable_DumpTraceback(int fd, PyThreadState *tstate)
1353+
1354+
Write a trace of the Python stack in *tstate* into the file *fd*. The format
1355+
looks like::
1356+
1357+
Traceback (most recent call first):
1358+
File "xxx", line xxx in <xxx>
1359+
File "xxx", line xxx in <xxx>
1360+
...
1361+
File "xxx", line xxx in <xxx>
1362+
1363+
This function is meant to debug situations such as segfaults, fatal errors,
1364+
and similar. The file and function names it outputs are encoded to ASCII with
1365+
backslashreplace and truncated to 500 characters. It writes only the first
1366+
100 frames; further frames are truncated with the line ``...``.
1367+
1368+
This function will return ``NULL`` on success, or an error message on error.
1369+
1370+
This function is intended for use in crash scenarios such as signal handlers
1371+
for SIGSEGV, where the interpreter may be in an inconsistent state. Given
1372+
that it reads interpreter data structures that may be partially modified, the
1373+
function might produce incomplete output or it may even crash itself.
1374+
1375+
The caller does not need to hold an :term:`attached thread state`, nor does
1376+
*tstate* need to be attached.
1377+
1378+
.. versionadded:: next
1379+
1380+
.. c:function:: const char* PyUnstable_DumpTracebackThreads(int fd, PyInterpreterState *interp, PyThreadState *current_tstate, Py_ssize_t max_threads)
1381+
1382+
Write the traces of all Python threads in *interp* into the file *fd*.
1383+
1384+
If *interp* is ``NULL`` then this function will try to identify the current
1385+
interpreter using thread-specific storage. If it cannot, it will return an
1386+
error.
1387+
1388+
If *current_tstate* is not ``NULL`` then it will be used to identify what the
1389+
current thread is in the written output. If it is ``NULL`` then this function
1390+
will identify the current thread using thread-specific storage. It is not an
1391+
error if the function is unable to get the current Python thread state.
1392+
1393+
This function will return ``NULL`` on success, or an error message on error.
1394+
1395+
This function is meant to debug debug situations such as segfaults, fatal
1396+
errors, and similar. It calls :c:func:`PyUnstable_DumpTraceback` for each
1397+
thread. It only writes the tracebacks of the first *max_threads* threads,
1398+
further output is truncated with the line ``...``. If *max_threads* is 0, the
1399+
function will use a default value of 100 for the argument.
1400+
1401+
This function is intended for use in crash scenarios such as signal handlers
1402+
for SIGSEGV, where the interpreter may be in an inconsistent state. Given
1403+
that it reads interpreter data structures that may be partially modified, the
1404+
function might produce incomplete output or it may even crash itself.
1405+
1406+
The caller does not need to hold an :term:`attached thread state`, nor does
1407+
*current_tstate* need to be attached.
1408+
1409+
.. warning::
1410+
On the :term:`free-threaded build`, this function is not thread-safe. If
1411+
another thread deletes its :term:`thread state` while this function is being
1412+
called, the process will likely crash.
1413+
1414+
.. versionadded:: next

0 commit comments

Comments
 (0)