Skip to content

Commit aa825d2

Browse files
committed
Merge in the main branch
2 parents c7392f7 + 28aea5d commit aa825d2

Some content is hidden

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

41 files changed

+1219
-404
lines changed

.github/workflows/reusable-macos.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
path: config.cache
3636
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
3737
- name: Install Homebrew dependencies
38-
run: brew install pkg-config [email protected] xz gdbm tcl-tk
38+
run: brew install pkg-config [email protected] xz gdbm tcl-tk make
3939
- name: Configure CPython
4040
run: |
4141
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
@@ -44,14 +44,27 @@ jobs:
4444
--config-cache \
4545
--with-pydebug \
4646
--enable-slower-safety \
47+
--enable-safety \
4748
${{ inputs.free-threading && '--disable-gil' || '' }} \
4849
--prefix=/opt/python-dev \
4950
--with-openssl="$(brew --prefix [email protected])"
5051
- name: Build CPython
51-
run: set -o pipefail; make -j8 2>&1 | tee compiler_output.txt
52+
if : ${{ inputs.free-threading || inputs.os != 'macos-13' }}
53+
run: gmake -j8
54+
- name: Build CPython for compiler warning check
55+
if : ${{ !inputs.free-threading && inputs.os == 'macos-13' }}
56+
run: set -o pipefail; gmake -j8 --output-sync 2>&1 | tee compiler_output_macos.txt
5257
- name: Display build info
5358
run: make pythoninfo
5459
- name: Check compiler warnings
55-
run: python3 Tools/build/check_warnings.py --compiler-output-file-path=compiler_output.txt --warning-ignore-file-path=Tools/build/.warningignore_macos --compiler-output-type=clang
60+
if : ${{ !inputs.free-threading && inputs.os == 'macos-13' }}
61+
run: >-
62+
python3 Tools/build/check_warnings.py
63+
--compiler-output-file-path=compiler_output_macos.txt
64+
--warning-ignore-file-path=Tools/build/.warningignore_macos
65+
--compiler-output-type=clang
66+
--fail-on-regression
67+
--fail-on-improvement
68+
--path-prefix="./"
5669
- name: Tests
5770
run: make test

.github/workflows/reusable-ubuntu.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,33 @@ jobs:
6767
working-directory: ${{ env.CPYTHON_BUILDDIR }}
6868
run: >-
6969
../cpython-ro-srcdir/configure
70-
CFLAGS="-fdiagnostics-format=json"
7170
--config-cache
7271
--with-pydebug
7372
--enable-slower-safety
73+
--enable-safety
7474
--with-openssl=$OPENSSL_DIR
7575
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
7676
- name: Build CPython out-of-tree
77+
if: ${{ inputs.free-threading }}
7778
working-directory: ${{ env.CPYTHON_BUILDDIR }}
78-
run: set -o pipefail; make -j4 2>&1 | tee compiler_output.txt
79+
run: make -j4
80+
- name: Build CPython out-of-tree (for compiler warning check)
81+
if: ${{ !inputs.free-threading}}
82+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
83+
run: set -o pipefail; make -j4 --output-sync 2>&1 | tee compiler_output_ubuntu.txt
7984
- name: Display build info
8085
working-directory: ${{ env.CPYTHON_BUILDDIR }}
8186
run: make pythoninfo
8287
- name: Check compiler warnings
83-
run: python Tools/build/check_warnings.py --compiler-output-file-path=${{ env.CPYTHON_BUILDDIR }}/compiler_output.txt --warning-ignore-file-path ${GITHUB_WORKSPACE}/Tools/build/.warningignore_ubuntu --compiler-output-type=json
88+
if: ${{ !inputs.free-threading }}
89+
run: >-
90+
python Tools/build/check_warnings.py
91+
--compiler-output-file-path=${{ env.CPYTHON_BUILDDIR }}/compiler_output_ubuntu.txt
92+
--warning-ignore-file-path ${GITHUB_WORKSPACE}/Tools/build/.warningignore_ubuntu
93+
--compiler-output-type=gcc
94+
--fail-on-regression
95+
--fail-on-improvement
96+
--path-prefix="../cpython-ro-srcdir/"
8497
- name: Remount sources writable for tests
8598
# some tests write to srcdir, lack of pyc files slows down testing
8699
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw

Doc/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,10 @@
553553
# Language redirects
554554
r'https://toml.io': 'https://toml.io/en/',
555555
r'https://www.redhat.com': 'https://www.redhat.com/en',
556+
# pypi.org project name normalization (upper to lowercase, underscore to hyphen)
557+
r'https://pypi.org/project/[A-Za-z\d_\-\.]+/': r'https://pypi.org/project/[a-z\d\-\.]+/',
558+
# Discourse title name expansion (text changes when title is edited)
559+
r'https://discuss\.python\.org/t/\d+': r'https://discuss\.python\.org/t/.*/\d+',
556560
# Other redirects
557561
r'https://www.boost.org/libs/.+': r'https://www.boost.org/doc/libs/\d_\d+_\d/.+',
558562
r'https://support.microsoft.com/en-us/help/\d+': 'https://support.microsoft.com/en-us/topic/.+',
Lines changed: 59 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,68 @@
11
Pending Removal in Python 3.15
22
------------------------------
33

4-
* :class:`http.server.CGIHTTPRequestHandler` will be removed along with its
5-
related ``--cgi`` flag to ``python -m http.server``. It was obsolete and
6-
rarely used. No direct replacement exists. *Anything* is better than CGI
7-
to interface a web server with a request handler.
8-
9-
* :class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python 3.11
10-
and originally planned for removal in Python 3.13 (:gh:`90817`),
11-
but removal has been postponed to Python 3.15.
12-
Use :func:`locale.setlocale`, :func:`locale.getencoding` and
13-
:func:`locale.getlocale` instead.
14-
(Contributed by Hugo van Kemenade in :gh:`111187`.)
4+
* :mod:`ctypes`:
5+
6+
* The undocumented :func:`!ctypes.SetPointerType` function
7+
has been deprecated since Python 3.13.
8+
9+
* :mod:`http.server`:
10+
11+
* The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler`
12+
has been deprecated since Python 3.13.
13+
No direct replacement exists.
14+
*Anything* is better than CGI to interface
15+
a web server with a request handler.
16+
17+
* The :option:`!--cgi` flag to the :program:`python -m http.server`
18+
command-line interface has been deprecated since Python 3.13.
19+
20+
* :class:`locale`:
21+
22+
* The :func:`~locale.getdefaultlocale` function
23+
has been deprecated since Python 3.11.
24+
Its removal was originally planned for Python 3.13 (:gh:`90817`),
25+
but has been postponed to Python 3.15.
26+
Use :func:`~locale.getlocale`, :func:`~locale.setlocale`,
27+
and :func:`~locale.getencoding` instead.
28+
(Contributed by Hugo van Kemenade in :gh:`111187`.)
1529

1630
* :mod:`pathlib`:
17-
:meth:`pathlib.PurePath.is_reserved` is deprecated and scheduled for
18-
removal in Python 3.15. Use :func:`os.path.isreserved` to detect reserved
19-
paths on Windows.
31+
32+
* :meth:`.PurePath.is_reserved`
33+
has been deprecated since Python 3.13.
34+
Use :func:`os.path.isreserved` to detect reserved paths on Windows.
2035

2136
* :mod:`platform`:
22-
:func:`~platform.java_ver` is deprecated and will be removed in 3.15.
23-
It was largely untested, had a confusing API,
24-
and was only useful for Jython support.
25-
(Contributed by Nikita Sobolev in :gh:`116349`.)
37+
38+
* :func:`~platform.java_ver` has been deprecated since Python 3.13.
39+
This function is only useful for Jython support, has a confusing API,
40+
and is largely untested.
2641

2742
* :mod:`threading`:
28-
Passing any arguments to :func:`threading.RLock` is now deprecated.
29-
C version allows any numbers of args and kwargs,
30-
but they are just ignored. Python version does not allow any arguments.
31-
All arguments will be removed from :func:`threading.RLock` in Python 3.15.
32-
(Contributed by Nikita Sobolev in :gh:`102029`.)
33-
34-
* :class:`typing.NamedTuple`:
35-
36-
* The undocumented keyword argument syntax for creating :class:`!NamedTuple` classes
37-
(``NT = NamedTuple("NT", x=int)``) is deprecated, and will be disallowed in
38-
3.15. Use the class-based syntax or the functional syntax instead.
39-
40-
* When using the functional syntax to create a :class:`!NamedTuple` class, failing to
41-
pass a value to the *fields* parameter (``NT = NamedTuple("NT")``) is
42-
deprecated. Passing ``None`` to the *fields* parameter
43-
(``NT = NamedTuple("NT", None)``) is also deprecated. Both will be
44-
disallowed in Python 3.15. To create a :class:`!NamedTuple` class with 0 fields, use
45-
``class NT(NamedTuple): pass`` or ``NT = NamedTuple("NT", [])``.
46-
47-
* :class:`typing.TypedDict`: When using the functional syntax to create a
48-
:class:`!TypedDict` class, failing to pass a value to the *fields* parameter (``TD =
49-
TypedDict("TD")``) is deprecated. Passing ``None`` to the *fields* parameter
50-
(``TD = TypedDict("TD", None)``) is also deprecated. Both will be disallowed
51-
in Python 3.15. To create a :class:`!TypedDict` class with 0 fields, use ``class
52-
TD(TypedDict): pass`` or ``TD = TypedDict("TD", {})``.
53-
54-
* :mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()``
55-
methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes.
56-
They will be removed in Python 3.15.
57-
(Contributed by Victor Stinner in :gh:`105096`.)
43+
44+
* :func:`~threading.RLock` will take no arguments in Python 3.15.
45+
Passing any arguments has been deprecated since Python 3.14,
46+
as the Python version does not permit any arguments,
47+
but the C version allows any number of positional or keyword arguments,
48+
ignoring every argument.
49+
50+
* :mod:`typing`:
51+
52+
* The undocumented keyword argument syntax for creating
53+
:class:`~typing.NamedTuple` classes
54+
(e.g. ``Point = NamedTuple("Point", x=int, y=int)``)
55+
has been deprecated since Python 3.13.
56+
Use the class-based syntax or the functional syntax instead.
57+
58+
* The :func:`typing.no_type_check_decorator` decorator function
59+
has been deprecated since Python 3.13.
60+
After eight years in the :mod:`typing` module,
61+
it has yet to be supported by any major type checker.
62+
63+
* :mod:`wave`:
64+
65+
* The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`,
66+
and :meth:`~wave.Wave_read.getmarkers` methods of
67+
the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes
68+
have been deprecated since Python 3.13.
Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,42 @@
11
Pending Removal in Python 3.16
22
------------------------------
33

4+
* :mod:`builtins`:
5+
6+
* Bitwise inversion on boolean types, ``~True`` or ``~False``
7+
has been deprecated since Python 3.12,
8+
as it produces surprising and unintuitive results (``-2`` and ``-1``).
9+
Use ``not x`` instead for the logical negation of a Boolean.
10+
In the rare case that you need the bitwise inversion of
11+
the underlying integer, convert to ``int`` explicitly (``~int(x)``).
12+
413
* :mod:`array`:
5-
:class:`array.array` ``'u'`` type (:c:type:`wchar_t`):
6-
use the ``'w'`` type instead (``Py_UCS4``).
714

8-
* :mod:`builtins`:
9-
``~bool``, bitwise inversion on bool.
15+
* The ``'u'`` format code (:c:type:`wchar_t`)
16+
has been deprecated in documentation since Python 3.3
17+
and at runtime since Python 3.13.
18+
Use the ``'w'`` format code (:c:type:`Py_UCS4`)
19+
for Unicode characters instead.
20+
21+
* :mod:`shutil`:
22+
23+
* The :class:`!ExecError` exception
24+
has been deprecated since Python 3.14.
25+
It has not been used by any function in :mod:`!shutil` since Python 3.4,
26+
and is now an alias of :exc:`RuntimeError`.
1027

1128
* :mod:`symtable`:
12-
Deprecate :meth:`symtable.Class.get_methods` due to the lack of interest.
13-
(Contributed by Bénédikt Tran in :gh:`119698`.)
1429

15-
* :mod:`shutil`: Deprecate :class:`!shutil.ExecError`, which hasn't
16-
been raised by any :mod:`!shutil` function since Python 3.4. It's
17-
now an alias for :exc:`RuntimeError`.
30+
* The :meth:`Class.get_methods <symtable.Class.get_methods>` method
31+
has been deprecated since Python 3.14.
32+
33+
* :mod:`sys`:
34+
35+
* The :func:`~sys._enablelegacywindowsfsencoding` function
36+
has been deprecated since Python 3.13.
37+
Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable instead.
38+
39+
* :mod:`tarfile`:
1840

41+
* The undocumented and unused :attr:`!TarFile.tarfile` attribute
42+
has been deprecated since Python 3.13.

Doc/faq/design.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ Can Python be compiled to machine code, C or some other language?
328328
-----------------------------------------------------------------
329329

330330
`Cython <https://cython.org/>`_ compiles a modified version of Python with
331-
optional annotations into C extensions. `Nuitka <https://www.nuitka.net/>`_ is
331+
optional annotations into C extensions. `Nuitka <https://nuitka.net/>`_ is
332332
an up-and-coming compiler of Python into C++ code, aiming to support the full
333333
Python language.
334334

@@ -345,7 +345,7 @@ to perform a garbage collection, obtain debugging statistics, and tune the
345345
collector's parameters.
346346

347347
Other implementations (such as `Jython <https://www.jython.org>`_ or
348-
`PyPy <https://www.pypy.org>`_), however, can rely on a different mechanism
348+
`PyPy <https://pypy.org>`_), however, can rely on a different mechanism
349349
such as a full-blown garbage collector. This difference can cause some
350350
subtle porting problems if your Python code depends on the behavior of the
351351
reference counting implementation.

Doc/library/hashlib.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ on the hash function used in digital signatures.
655655
by the signer.
656656

657657
(`NIST SP-800-106 "Randomized Hashing for Digital Signatures"
658-
<https://csrc.nist.gov/publications/detail/sp/800-106/archive/2009-02-25>`_)
658+
<https://csrc.nist.gov/pubs/sp/800/106/final>`_)
659659

660660
In BLAKE2 the salt is processed as a one-time input to the hash function during
661661
initialization, rather than as an input to each compression function.
@@ -809,8 +809,8 @@ Domain Dedication 1.0 Universal:
809809
.. _NIST-SP-800-132: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf
810810
.. _stackexchange pbkdf2 iterations question: https://security.stackexchange.com/questions/3959/recommended-of-iterations-when-using-pbkdf2-sha256/
811811
.. _Attacks on cryptographic hash algorithms: https://en.wikipedia.org/wiki/Cryptographic_hash_function#Attacks_on_cryptographic_hash_algorithms
812-
.. _the FIPS 180-4 standard: https://csrc.nist.gov/publications/detail/fips/180/4/final
813-
.. _the FIPS 202 standard: https://csrc.nist.gov/publications/detail/fips/202/final
812+
.. _the FIPS 180-4 standard: https://csrc.nist.gov/pubs/fips/180-4/upd1/final
813+
.. _the FIPS 202 standard: https://csrc.nist.gov/pubs/fips/202/final
814814
.. _HACL\* project: https://github.com/hacl-star/hacl-star
815815

816816

@@ -827,7 +827,7 @@ Domain Dedication 1.0 Universal:
827827
https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf
828828
The FIPS 180-4 publication on Secure Hash Algorithms.
829829

830-
https://csrc.nist.gov/publications/detail/fips/202/final
830+
https://csrc.nist.gov/pubs/fips/202/final
831831
The FIPS 202 publication on the SHA-3 Standard.
832832

833833
https://www.blake2.net/

Doc/library/http.cookiejar.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ The following classes are provided:
137137
The Netscape protocol with the bugs fixed. Uses :mailheader:`Set-Cookie2` in
138138
place of :mailheader:`Set-Cookie`. Not widely used.
139139

140-
http://kristol.org/cookie/errata.html
140+
https://kristol.org/cookie/errata.html
141141
Unfinished errata to :rfc:`2965`.
142142

143143
:rfc:`2964` - Use of HTTP State Management

Doc/library/json.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
`JSON (JavaScript Object Notation) <https://json.org>`_, specified by
1515
:rfc:`7159` (which obsoletes :rfc:`4627`) and by
16-
`ECMA-404 <https://www.ecma-international.org/publications-and-standards/standards/ecma-404/>`_,
16+
`ECMA-404 <https://ecma-international.org/publications-and-standards/standards/ecma-404/>`_,
1717
is a lightweight data interchange format inspired by
1818
`JavaScript <https://en.wikipedia.org/wiki/JavaScript>`_ object literal syntax
1919
(although it is not a strict subset of JavaScript [#rfc-errata]_ ).
@@ -557,7 +557,7 @@ Standard Compliance and Interoperability
557557
----------------------------------------
558558

559559
The JSON format is specified by :rfc:`7159` and by
560-
`ECMA-404 <https://www.ecma-international.org/publications-and-standards/standards/ecma-404/>`_.
560+
`ECMA-404 <https://ecma-international.org/publications-and-standards/standards/ecma-404/>`_.
561561
This section details this module's level of compliance with the RFC.
562562
For simplicity, :class:`JSONEncoder` and :class:`JSONDecoder` subclasses, and
563563
parameters other than those explicitly mentioned, are not considered.

Doc/library/ssl.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ to speed up repeated connections from the same clients.
15661566
The *capath* string, if present, is
15671567
the path to a directory containing several CA certificates in PEM format,
15681568
following an `OpenSSL specific layout
1569-
<https://www.openssl.org/docs/manmaster/man3/SSL_CTX_load_verify_locations.html>`_.
1569+
<https://docs.openssl.org/master/man3/SSL_CTX_load_verify_locations/>`_.
15701570

15711571
The *cadata* object, if present, is either an ASCII string of one or more
15721572
PEM-encoded certificates or a :term:`bytes-like object` of DER-encoded
@@ -1641,7 +1641,7 @@ to speed up repeated connections from the same clients.
16411641

16421642
Set the available ciphers for sockets created with this context.
16431643
It should be a string in the `OpenSSL cipher list format
1644-
<https://www.openssl.org/docs/manmaster/man1/ciphers.html>`_.
1644+
<https://docs.openssl.org/master/man1/ciphers/>`_.
16451645
If no cipher can be selected (because compile-time options or other
16461646
configuration forbids use of all the specified ciphers), an
16471647
:class:`SSLError` will be raised.
@@ -1874,7 +1874,7 @@ to speed up repeated connections from the same clients.
18741874
.. method:: SSLContext.session_stats()
18751875

18761876
Get statistics about the SSL sessions created or managed by this context.
1877-
A dictionary is returned which maps the names of each `piece of information <https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_sess_number.html>`_ to their
1877+
A dictionary is returned which maps the names of each `piece of information <https://docs.openssl.org/1.1.1/man3/SSL_CTX_sess_number/>`_ to their
18781878
numeric values. For example, here is the total number of hits and misses
18791879
in the session cache since the context was created::
18801880

@@ -2017,7 +2017,7 @@ to speed up repeated connections from the same clients.
20172017
.. attribute:: SSLContext.security_level
20182018

20192019
An integer representing the `security level
2020-
<https://www.openssl.org/docs/manmaster/man3/SSL_CTX_get_security_level.html>`_
2020+
<https://docs.openssl.org/master/man3/SSL_CTX_get_security_level/>`_
20212021
for the context. This attribute is read-only.
20222022

20232023
.. versionadded:: 3.10

Doc/library/tkinter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ details that are unchanged.
5858
* `Modern Tkinter for Busy Python Developers <https://tkdocs.com/book.html>`_
5959
By Mark Roseman. (ISBN 978-1999149567)
6060

61-
* `Python GUI programming with Tkinter <https://www.packtpub.com/product/python-gui-programming-with-tkinter/9781788835886>`_
61+
* `Python GUI programming with Tkinter <https://www.packtpub.com/en-us/product/python-gui-programming-with-tkinter-9781788835886>`_
6262
By Alan D. Moore. (ISBN 978-1788835886)
6363

6464
* `Programming Python <https://learning-python.com/about-pp4e.html>`_

Doc/library/typing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2866,7 +2866,7 @@ Functions and decorators
28662866

28672867
.. seealso::
28682868
`Unreachable Code and Exhaustiveness Checking
2869-
<https://typing.readthedocs.io/en/latest/source/unreachable.html>`__ has more
2869+
<https://typing.readthedocs.io/en/latest/guides/unreachable.html>`__ has more
28702870
information about exhaustiveness checking with static typing.
28712871

28722872
.. versionadded:: 3.11

Doc/library/xmlrpc.client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ between conformable Python objects and XML on the wire.
165165
A good description of XML-RPC operation and client software in several languages.
166166
Contains pretty much everything an XML-RPC client developer needs to know.
167167

168-
`XML-RPC Introspection <https://xmlrpc-c.sourceforge.net/introspection.html>`_
168+
`XML-RPC Introspection <https://xmlrpc-c.sourceforge.io/introspection.html>`_
169169
Describes the XML-RPC protocol extension for introspection.
170170

171171
`XML-RPC Specification <http://xmlrpc.scripting.com/spec.html>`_

0 commit comments

Comments
 (0)