Skip to content

Commit 1718aa2

Browse files
committed
Merge remote-tracking branch 'origin/main' into fast-bytes-creation-from-list-tuple-2
# Conflicts: # Objects/bytesobject.c
2 parents eb0c36b + 46afba7 commit 1718aa2

660 files changed

Lines changed: 14435 additions & 27997 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/CODEOWNERS

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,15 @@ Misc/libabigail.abignore @encukou
156156
# ----------------------------------------------------------------------------
157157

158158
# Android
159-
Android/ @mhsmith @freakboy3742
159+
Platforms/Android/ @mhsmith @freakboy3742
160160
Doc/using/android.rst @mhsmith @freakboy3742
161161
Lib/_android_support.py @mhsmith @freakboy3742
162162
Lib/test/test_android.py @mhsmith @freakboy3742
163163

164164
# iOS
165165
Doc/using/ios.rst @freakboy3742
166166
Lib/_ios_support.py @freakboy3742
167-
Apple/ @freakboy3742
168-
iOS/ @freakboy3742
167+
Platforms/Apple/ @freakboy3742
169168

170169
# macOS
171170
Mac/ @python/macos-team
@@ -176,8 +175,8 @@ Lib/test/test__osx_support.py @python/macos-team
176175
Tools/wasm/README.md @brettcannon @freakboy3742 @emmatyping
177176

178177
# WebAssembly (Emscripten)
179-
Tools/wasm/config.site-wasm32-emscripten @freakboy3742 @emmatyping
180-
Tools/wasm/emscripten @freakboy3742 @emmatyping
178+
Platforms/emscripten @freakboy3742 @emmatyping
179+
Tools/wasm/emscripten @freakboy3742 @emmatyping
181180

182181
# WebAssembly (WASI)
183182
Platforms/WASI @brettcannon @emmatyping @savannahostrowski
@@ -574,9 +573,9 @@ Lib/shutil.py @giampaolo
574573
Lib/test/test_shutil.py @giampaolo
575574

576575
# Site
577-
Lib/site.py @FFY00
578-
Lib/test/test_site.py @FFY00
579-
Doc/library/site.rst @FFY00
576+
Lib/site.py @FFY00 @warsaw
577+
Lib/test/test_site.py @FFY00 @warsaw
578+
Doc/library/site.rst @FFY00 @warsaw
580579

581580
# string.templatelib
582581
Doc/library/string.templatelib.rst @lysnikolaou @AA-Turner
@@ -587,10 +586,10 @@ Lib/test/test_string/test_templatelib.py @lysnikolaou @AA-Turner
587586
**/*sysconfig* @FFY00
588587

589588
# SQLite 3
590-
Doc/library/sqlite3.rst @berkerpeksag @erlend-aasland
591-
Lib/sqlite3/ @berkerpeksag @erlend-aasland
592-
Lib/test/test_sqlite3/ @berkerpeksag @erlend-aasland
593-
Modules/_sqlite/ @berkerpeksag @erlend-aasland
589+
Doc/library/sqlite3.rst @erlend-aasland
590+
Lib/sqlite3/ @erlend-aasland
591+
Lib/test/test_sqlite3/ @erlend-aasland
592+
Modules/_sqlite/ @erlend-aasland
594593

595594
# Subprocess
596595
Lib/subprocess.py @gpshead
@@ -623,9 +622,6 @@ Modules/_typesmodule.c @AA-Turner
623622
Lib/unittest/mock.py @cjw296
624623
Lib/test/test_unittest/testmock/ @cjw296
625624

626-
# Urllib
627-
**/*robotparser* @berkerpeksag
628-
629625
# Venv
630626
**/*venv* @vsajip @FFY00
631627

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ body:
3434
label: "CPython versions tested on:"
3535
multiple: true
3636
options:
37-
- "3.9"
3837
- "3.10"
3938
- "3.11"
4039
- "3.12"
4140
- "3.13"
4241
- "3.14"
4342
- "3.15"
43+
- "3.16"
4444
- "CPython main branch"
4545
validations:
4646
required: true

.github/ISSUE_TEMPLATE/crash.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ body:
2727
label: "CPython versions tested on:"
2828
multiple: true
2929
options:
30-
- "3.9"
3130
- "3.10"
3231
- "3.11"
3332
- "3.12"
3433
- "3.13"
3534
- "3.14"
3635
- "3.15"
36+
- "3.16"
3737
- "CPython main branch"
3838
validations:
3939
required: true

.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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ jobs:
6969
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7070
with:
7171
persist-credentials: false
72-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
72+
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
7373
with:
74-
python-version: "3.13"
75-
cache: pip
76-
cache-dependency-path: Tools/requirements-dev.txt
77-
- run: pip install -r Tools/requirements-dev.txt
74+
python-version: "3.15"
75+
activate-environment: true
76+
cache-dependency-glob: Tools/requirements-dev.txt
77+
- run: uv pip install -r Tools/requirements-dev.txt
7878
- run: python3 Misc/mypy/make_symlinks.py --symlink
79-
- run: mypy --config-file ${{ matrix.target }}/mypy.ini
79+
- run: mypy --num-workers 4 --config-file ${{ matrix.target }}/mypy.ini

.github/workflows/posix-deps-apt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ apt-get -yq --no-install-recommends install \
2727
zlib1g-dev
2828

2929
# Workaround missing libmpdec-dev on ubuntu 24.04 by building mpdecimal
30-
# from source. ppa:ondrej/php (launchpad.net) are unreliable
30+
# from source. ppa:ondrej/php (launchpad.net) are unreliable
3131
# (https://status.canonical.com) so fetch the tarball directly
3232
# from the upstream host.
3333
# https://www.bytereef.org/mpdecimal/

.github/workflows/reusable-macos.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ jobs:
3838
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
3939
- name: Install Homebrew dependencies
4040
run: |
41-
brew install pkg-config openssl@3.5 xz gdbm tcl-tk@9 make
42-
# Because alternate versions are not symlinked into place by default:
43-
brew link --overwrite tcl-tk@9
41+
brew bundle --file=Misc/Brewfile
42+
brew install make
4443
- name: Configure CPython
4544
run: |
4645
MACOSX_DEPLOYMENT_TARGET=10.15 \

.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/dict.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Dictionary objects
151151
* If the key is present, set *\*result* to a new :term:`strong reference`
152152
to the value and return ``1``.
153153
* If the key is missing, set *\*result* to ``NULL`` and return ``0``.
154-
* On error, raise an exception and return ``-1``.
154+
* On error, raise an exception, set *\*result* to ``NULL`` and return ``-1``.
155155
156156
The first argument can be a :class:`dict` or a :class:`frozendict`.
157157

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:: 3.15
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:: 3.15

0 commit comments

Comments
 (0)