Skip to content

Commit de8a762

Browse files
update vendor to version 3.9.21
1 parent 5facbed commit de8a762

File tree

119 files changed

+4342
-693
lines changed

Some content is hidden

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

119 files changed

+4342
-693
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run_tests: ${{ steps.check.outputs.run_tests }}
2626
run_ssl_tests: ${{ steps.check.outputs.run_ssl_tests }}
2727
steps:
28-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2929
- name: Check for source changes
3030
id: check
3131
run: |
@@ -57,8 +57,8 @@ jobs:
5757
needs: check_source
5858
if: needs.check_source.outputs.run_tests == 'true'
5959
steps:
60-
- uses: actions/checkout@v2
61-
- uses: actions/setup-python@v2
60+
- uses: actions/checkout@v4
61+
- uses: actions/setup-python@v4
6262
- name: Install Dependencies
6363
run: |
6464
sudo ./.github/workflows/posix-deps-apt.sh
@@ -79,8 +79,8 @@ jobs:
7979
needs: check_source
8080
if: needs.check_source.outputs.run_tests == 'true'
8181
steps:
82-
- uses: actions/checkout@v3
83-
- uses: actions/setup-python@v3
82+
- uses: actions/checkout@v4
83+
- uses: actions/setup-python@v4
8484
- name: Install Dependencies
8585
run: sudo ./.github/workflows/posix-deps-apt.sh
8686
- name: Add ccache to PATH
@@ -93,8 +93,12 @@ jobs:
9393
grep "aclocal 1.16.3" aclocal.m4
9494
grep -q "runstatedir" configure
9595
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
96+
- name: Configure CPython
97+
run: |
98+
# Build Python with the libpython dynamic library
99+
./configure --config-cache --with-pydebug --enable-shared
96100
- name: Regenerate autoconf files
97-
run: docker run --rm -v $(pwd):/src quay.io/tiran/cpython_autoconf:269
101+
run: make regen-configure
98102
- name: Build CPython
99103
run: |
100104
./configure --with-pydebug
@@ -119,7 +123,7 @@ jobs:
119123
needs: check_source
120124
if: needs.check_source.outputs.run_tests == 'true'
121125
steps:
122-
- uses: actions/checkout@v3
126+
- uses: actions/checkout@v4
123127
- name: Build CPython
124128
run: .\PCbuild\build.bat -e -p Win32
125129
- name: Display build info
@@ -133,7 +137,7 @@ jobs:
133137
needs: check_source
134138
if: needs.check_source.outputs.run_tests == 'true'
135139
steps:
136-
- uses: actions/checkout@v3
140+
- uses: actions/checkout@v4
137141
- name: Build CPython
138142
run: .\PCbuild\build.bat -e -p x64
139143
- name: Display build info
@@ -152,18 +156,24 @@ jobs:
152156
HOMEBREW_NO_INSTALL_CLEANUP: 1
153157
PYTHONSTRICTEXTENSIONBUILD: 1
154158
steps:
155-
- uses: actions/checkout@v3
159+
- uses: actions/checkout@v4
160+
- name: Install Homebrew dependencies
161+
run: |
162+
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@8
163+
# Because alternate versions are not symlinked into place by default:
164+
brew link tcl-tk@8
156165
- name: Configure CPython
157166
run: |
158-
brew install pkg-config openssl@1.1 xz gdbm tcl-tk
159167
CC=clang \
160168
CPPFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
161169
LDFLAGS="-L$(brew --prefix gdbm)/lib -L$(brew --prefix xz)/lib" \
162170
./configure --prefix=/opt/python-dev \
163171
--with-pydebug \
164-
--with-openssl="$(brew --prefix openssl@1.1)" \
172+
--with-openssl="$(brew --prefix openssl@3.0)" \
165173
--with-tcltk-libs="$(pkg-config --libs tk)" \
166-
--with-tcltk-includes="$(pkg-config --cflags tk)"
174+
--with-tcltk-includes="$(pkg-config --cflags tk)" \
175+
--with-dbmliborder=gdbm:ndbm
176+
# (--with-dbmliborder needed for homebrew's gdbm 1.24: see gh-89452)
167177
- name: Build CPython
168178
run: make -j4
169179
- name: Display build info
@@ -177,10 +187,10 @@ jobs:
177187
needs: check_source
178188
if: needs.check_source.outputs.run_tests == 'true'
179189
env:
180-
OPENSSL_VER: 1.1.1u
190+
OPENSSL_VER: 3.0.11
181191
PYTHONSTRICTEXTENSIONBUILD: 1
182192
steps:
183-
- uses: actions/checkout@v3
193+
- uses: actions/checkout@v4
184194
- name: Install Dependencies
185195
run: sudo ./.github/workflows/posix-deps-apt.sh
186196
- name: Configure OpenSSL env vars
@@ -219,14 +229,14 @@ jobs:
219229
strategy:
220230
fail-fast: false
221231
matrix:
222-
openssl_ver: [1.0.2u, 1.1.0l, 1.1.1u, 3.0.9, 3.1.1]
232+
openssl_ver: [1.0.2u, 1.1.0l, 1.1.1w, 3.0.11, 3.1.3]
223233
env:
224234
OPENSSL_VER: ${{ matrix.openssl_ver }}
225235
MULTISSL_DIR: ${{ github.workspace }}/multissl
226236
OPENSSL_DIR: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}
227237
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
228238
steps:
229-
- uses: actions/checkout@v3
239+
- uses: actions/checkout@v4
230240
- name: Install Dependencies
231241
run: sudo ./.github/workflows/posix-deps-apt.sh
232242
- name: Configure OpenSSL env vars

.github/workflows/build_msi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ jobs:
2525
name: 'Windows (x86) Installer'
2626
runs-on: windows-latest
2727
steps:
28-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2929
- name: Build CPython installer
3030
run: .\Tools\msi\build.bat -x86
3131

3232
build_win_amd64:
3333
name: 'Windows (x64) Installer'
3434
runs-on: windows-latest
3535
steps:
36-
- uses: actions/checkout@v3
36+
- uses: actions/checkout@v4
3737
- name: Build CPython installer
3838
run: .\Tools\msi\build.bat -x64

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
env:
2828
OPENSSL_VER: 1.1.1k
2929
steps:
30-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v4
3131
- name: Install Dependencies
3232
run: sudo ./.github/workflows/posix-deps-apt.sh
3333
- name: 'Restore OpenSSL build'
@@ -76,7 +76,7 @@ jobs:
7676
name: 'Ubuntu (C Coverage)'
7777
runs-on: ubuntu-latest
7878
steps:
79-
- uses: actions/checkout@v2
79+
- uses: actions/checkout@v4
8080
- name: Install Dependencies
8181
run: sudo ./.github/workflows/posix-deps-apt.sh
8282
- name: Configure CPython

.github/workflows/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
name: 'Docs'
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2828
- name: 'Install Dependencies'
2929
run: sudo ./.github/workflows/posix-deps-apt.sh && sudo apt-get install wamerican
3030
- name: 'Configure CPython'

.github/workflows/verify-ensurepip-wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
verify:
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424
- uses: actions/setup-python@v4
2525
with:
2626
python-version: '3'

.readthedocs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This is a dummy config file so that readthedocs.org doesn't fail on security branches.
2+
# Note that this won't result in docs actually getting built;
3+
# clicking on the docs preview link on a PR will result in a 404.
4+
version: 2
5+
formats: []
6+
build:
7+
os: "ubuntu-22.04"
8+
tools:
9+
python: "3.11"
10+
jobs:
11+
post_checkout:
12+
- exit 183

Doc/constraints.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# We have upper bounds on our transitive dependencies here
2+
# To avoid new releases unexpectedly breaking our build.
3+
# This file can be updated on an ad-hoc basis,
4+
# though it will probably have to be updated
5+
# whenever Doc/requirements.txt is updated.
6+
7+
# Direct dependencies of Sphinx
8+
babel<3
9+
colorama<0.5
10+
imagesize<1.5
11+
Jinja2<3.2
12+
packaging<24
13+
Pygments>=2.16.1,<3
14+
requests<3
15+
snowballstemmer<3
16+
sphinxcontrib-applehelp<1.0.5
17+
sphinxcontrib-devhelp<1.0.6
18+
sphinxcontrib-htmlhelp<2.0.5
19+
sphinxcontrib-jsmath<1.1
20+
sphinxcontrib-qthelp<1.0.7
21+
sphinxcontrib-serializinghtml<1.1.10
22+
23+
# Direct dependencies of Jinja2 (Jinja is a dependency of Sphinx, see above)
24+
MarkupSafe<2.2

Doc/library/ast.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,20 +1591,28 @@ and classes for traversing abstract syntax trees:
15911591

15921592
.. function:: literal_eval(node_or_string)
15931593

1594-
Safely evaluate an expression node or a string containing a Python literal or
1594+
Evaluate an expression node or a string containing only a Python literal or
15951595
container display. The string or node provided may only consist of the
15961596
following Python literal structures: strings, bytes, numbers, tuples, lists,
15971597
dicts, sets, booleans, and ``None``.
15981598

1599-
This can be used for safely evaluating strings containing Python values from
1600-
untrusted sources without the need to parse the values oneself. It is not
1601-
capable of evaluating arbitrarily complex expressions, for example involving
1602-
operators or indexing.
1599+
This can be used for evaluating strings containing Python values without the
1600+
need to parse the values oneself. It is not capable of evaluating
1601+
arbitrarily complex expressions, for example involving operators or
1602+
indexing.
1603+
1604+
This function had been documented as "safe" in the past without defining
1605+
what that meant. That was misleading. This is specifically designed not to
1606+
execute Python code, unlike the more general :func:`eval`. There is no
1607+
namespace, no name lookups, or ability to call out. But it is not free from
1608+
attack: A relatively small input can lead to memory exhaustion or to C stack
1609+
exhaustion, crashing the process. There is also the possibility for
1610+
excessive CPU consumption denial of service on some inputs. Calling it on
1611+
untrusted data is thus not recommended.
16031612

16041613
.. warning::
1605-
It is possible to crash the Python interpreter with a
1606-
sufficiently large/complex string due to stack depth limitations
1607-
in Python's AST compiler.
1614+
It is possible to crash the Python interpreter due to stack depth
1615+
limitations in Python's AST compiler.
16081616

16091617
.. versionchanged:: 3.2
16101618
Now allows bytes and set literals.

Doc/library/asyncio.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,26 @@ Additionally, there are **low-level** APIs for
5656
* :ref:`bridge <asyncio-futures>` callback-based libraries and code
5757
with async/await syntax.
5858

59+
.. _asyncio-cli:
60+
61+
.. rubric:: asyncio REPL
62+
63+
You can experiment with an ``asyncio`` concurrent context in the REPL:
64+
65+
.. code-block:: pycon
66+
67+
$ python -m asyncio
68+
asyncio REPL ...
69+
Use "await" directly instead of "asyncio.run()".
70+
Type "help", "copyright", "credits" or "license" for more information.
71+
>>> import asyncio
72+
>>> await asyncio.sleep(10, result='hello')
73+
'hello'
74+
75+
.. audit-event:: cpython.run_stdin "" ""
76+
77+
.. versionchanged:: 3.9.20 (also 3.8.20)
78+
Emits audit events.
5979

6080
.. We use the "rubric" directive here to avoid creating
6181
the "Reference" subsection in the TOC.

Doc/library/email.errors.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ The following exception classes are defined in the :mod:`email.errors` module:
5959
:class:`~email.mime.image.MIMEImage`).
6060

6161

62+
.. exception:: HeaderWriteError()
63+
64+
Raised when an error occurs when the :mod:`~email.generator` outputs
65+
headers.
66+
67+
6268
Here is the list of the defects that the :class:`~email.parser.FeedParser`
6369
can find while parsing messages. Note that the defects are added to the message
6470
where the problem was found, so for example, if a message nested inside a

0 commit comments

Comments
 (0)