Skip to content

Commit

Permalink
Merge branch 'main' into pythongh-123940
Browse files Browse the repository at this point in the history
  • Loading branch information
mpage committed Sep 17, 2024
2 parents 96613ed + a15a584 commit d18c872
Show file tree
Hide file tree
Showing 48 changed files with 162 additions and 123 deletions.
4 changes: 2 additions & 2 deletions Doc/c-api/code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ bound into a function.
Return the line number of the instruction that occurs on or before ``byte_offset`` and ends after it.
If you just need the line number of a frame, use :c:func:`PyFrame_GetLineNumber` instead.
For efficiently iterating over the line numbers in a code object, use `the API described in PEP 626
<https://peps.python.org/pep-0626/#out-of-process-debuggers-and-profilers>`_.
For efficiently iterating over the line numbers in a code object, use :pep:`the API described in PEP 626
<0626#out-of-process-debuggers-and-profilers>`.
.. c:function:: int PyCode_Addr2Location(PyObject *co, int byte_offset, int *start_line, int *start_column, int *end_line, int *end_column)
Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/refcounting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ of Python objects.
``NULL``, use :c:func:`Py_XINCREF`.
Do not expect this function to actually modify *o* in any way.
For at least `some objects <https://peps.python.org/pep-0683/>`_,
For at least :pep:`some objects <0683>`,
this function has no effect.
.. versionchanged:: 3.12
Expand Down Expand Up @@ -130,7 +130,7 @@ of Python objects.
use :c:func:`Py_XDECREF`.
Do not expect this function to actually modify *o* in any way.
For at least `some objects <https://peps.python.org/pep-0683/>`_,
For at least :pep:`some objects <683>`,
this function has no effect.
.. warning::
Expand Down
4 changes: 4 additions & 0 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@
# Language redirects
r'https://toml.io': 'https://toml.io/en/',
r'https://www.redhat.com': 'https://www.redhat.com/en',
# pypi.org project name normalization (upper to lowercase, underscore to hyphen)
r'https://pypi.org/project/[A-Za-z\d_\-\.]+/': r'https://pypi.org/project/[a-z\d\-\.]+/',
# Discourse title name expansion (text changes when title is edited)
r'https://discuss\.python\.org/t/\d+': r'https://discuss\.python\.org/t/.*/\d+',
# Other redirects
r'https://www.boost.org/libs/.+': r'https://www.boost.org/doc/libs/\d_\d+_\d/.+',
r'https://support.microsoft.com/en-us/help/\d+': 'https://support.microsoft.com/en-us/topic/.+',
Expand Down
4 changes: 2 additions & 2 deletions Doc/faq/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ Can Python be compiled to machine code, C or some other language?
-----------------------------------------------------------------

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

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

Other implementations (such as `Jython <https://www.jython.org>`_ or
`PyPy <https://www.pypy.org>`_), however, can rely on a different mechanism
`PyPy <https://pypy.org>`_), however, can rely on a different mechanism
such as a full-blown garbage collector. This difference can cause some
subtle porting problems if your Python code depends on the behavior of the
reference counting implementation.
Expand Down
4 changes: 2 additions & 2 deletions Doc/faq/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ releases.
The latest stable releases can always be found on the `Python download page
<https://www.python.org/downloads/>`_. There are two production-ready versions
of Python: 2.x and 3.x. The recommended version is 3.x, which is supported by
most widely used libraries. Although 2.x is still widely used, `it is not
maintained anymore <https://peps.python.org/pep-0373/>`_.
most widely used libraries. Although 2.x is still widely used, :pep:`it is not
maintained anymore <0373>`.

How many people are using Python?
---------------------------------
Expand Down
3 changes: 1 addition & 2 deletions Doc/library/ast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2033,8 +2033,7 @@ Function and class definitions
* ``name`` is a raw string for the class name
* ``bases`` is a list of nodes for explicitly specified base classes.
* ``keywords`` is a list of :class:`.keyword` nodes, principally for 'metaclass'.
Other keywords will be passed to the metaclass, as per `PEP-3115
<https://peps.python.org/pep-3115/>`_.
Other keywords will be passed to the metaclass, as per :pep:`3115`.
* ``body`` is a list of nodes representing the code within the class
definition.
* ``decorator_list`` is a list of nodes, as in :class:`FunctionDef`.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/functools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ The :mod:`functools` module defines the following functions:
cache. See :ref:`faq-cache-method-calls`

An `LRU (least recently used) cache
<https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)>`_
<https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_(LRU)>`_
works best when the most recent calls are the best predictors of upcoming
calls (for example, the most popular articles on a news server tend to
change each day). The cache's size limit assures that the cache does not
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/hashlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ on the hash function used in digital signatures.
by the signer.

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

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


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

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

https://www.blake2.net/
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/http.cookiejar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ The following classes are provided:
The Netscape protocol with the bugs fixed. Uses :mailheader:`Set-Cookie2` in
place of :mailheader:`Set-Cookie`. Not widely used.

http://kristol.org/cookie/errata.html
https://kristol.org/cookie/errata.html
Unfinished errata to :rfc:`2965`.

:rfc:`2964` - Use of HTTP State Management
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/json.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

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

The JSON format is specified by :rfc:`7159` and by
`ECMA-404 <https://www.ecma-international.org/publications-and-standards/standards/ecma-404/>`_.
`ECMA-404 <https://ecma-international.org/publications-and-standards/standards/ecma-404/>`_.
This section details this module's level of compliance with the RFC.
For simplicity, :class:`JSONEncoder` and :class:`JSONDecoder` subclasses, and
parameters other than those explicitly mentioned, are not considered.
Expand Down
29 changes: 14 additions & 15 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -525,21 +525,20 @@ Module constants
The mappings from SQLite threading modes to DB-API 2.0 threadsafety levels
are as follows:

+------------------+-----------------+----------------------+-------------------------------+
| SQLite threading | `threadsafety`_ | `SQLITE_THREADSAFE`_ | DB-API 2.0 meaning |
| mode | | | |
+==================+=================+======================+===============================+
| single-thread | 0 | 0 | Threads may not share the |
| | | | module |
+------------------+-----------------+----------------------+-------------------------------+
| multi-thread | 1 | 2 | Threads may share the module, |
| | | | but not connections |
+------------------+-----------------+----------------------+-------------------------------+
| serialized | 3 | 1 | Threads may share the module, |
| | | | connections and cursors |
+------------------+-----------------+----------------------+-------------------------------+

.. _threadsafety: https://peps.python.org/pep-0249/#threadsafety
+------------------+----------------------+----------------------+-------------------------------+
| SQLite threading | :pep:`threadsafety | `SQLITE_THREADSAFE`_ | DB-API 2.0 meaning |
| mode | <0249#threadsafety>` | | |
+==================+======================+======================+===============================+
| single-thread | 0 | 0 | Threads may not share the |
| | | | module |
+------------------+----------------------+----------------------+-------------------------------+
| multi-thread | 1 | 2 | Threads may share the module, |
| | | | but not connections |
+------------------+----------------------+----------------------+-------------------------------+
| serialized | 3 | 1 | Threads may share the module, |
| | | | connections and cursors |
+------------------+----------------------+----------------------+-------------------------------+

.. _SQLITE_THREADSAFE: https://sqlite.org/compile.html#threadsafe

.. versionchanged:: 3.11
Expand Down
10 changes: 5 additions & 5 deletions Doc/library/ssl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ to speed up repeated connections from the same clients.
The *capath* string, if present, is
the path to a directory containing several CA certificates in PEM format,
following an `OpenSSL specific layout
<https://www.openssl.org/docs/manmaster/man3/SSL_CTX_load_verify_locations.html>`_.
<https://docs.openssl.org/master/man3/SSL_CTX_load_verify_locations/>`_.

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

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

Get statistics about the SSL sessions created or managed by this context.
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
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
numeric values. For example, here is the total number of hits and misses
in the session cache since the context was created::

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

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

.. versionadded:: 3.10
Expand Down Expand Up @@ -2759,7 +2759,7 @@ enabled when negotiating a SSL session is possible through the
:meth:`SSLContext.set_ciphers` method. Starting from Python 3.2.3, the
ssl module disables certain weak ciphers by default, but you may want
to further restrict the cipher choice. Be sure to read OpenSSL's documentation
about the `cipher list format <https://www.openssl.org/docs/man1.1.1/man1/ciphers.html#CIPHER-LIST-FORMAT>`_.
about the `cipher list format <https://docs.openssl.org/1.1.1/man1/ciphers/#cipher-list-format>`_.
If you want to check which ciphers are enabled by a given cipher list, use
:meth:`SSLContext.get_ciphers` or the ``openssl ciphers`` command on your
system.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/tkinter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ details that are unchanged.
* `Modern Tkinter for Busy Python Developers <https://tkdocs.com/book.html>`_
By Mark Roseman. (ISBN 978-1999149567)

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

* `Programming Python <https://learning-python.com/about-pp4e.html>`_
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2866,7 +2866,7 @@ Functions and decorators

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

.. versionadded:: 3.11
Expand Down
16 changes: 8 additions & 8 deletions Doc/library/wsgiref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -783,8 +783,8 @@ in :pep:`3333`.

.. class:: StartResponse()

A :class:`typing.Protocol` describing `start_response()
<https://peps.python.org/pep-3333/#the-start-response-callable>`_
A :class:`typing.Protocol` describing :pep:`start_response()
<3333#the-start-response-callable>`
callables (:pep:`3333`).

.. data:: WSGIEnvironment
Expand All @@ -797,18 +797,18 @@ in :pep:`3333`.

.. class:: InputStream()

A :class:`typing.Protocol` describing a `WSGI Input Stream
<https://peps.python.org/pep-3333/#input-and-error-streams>`_.
A :class:`typing.Protocol` describing a :pep:`WSGI Input Stream
<3333#input-and-error-streams>`.

.. class:: ErrorStream()

A :class:`typing.Protocol` describing a `WSGI Error Stream
<https://peps.python.org/pep-3333/#input-and-error-streams>`_.
A :class:`typing.Protocol` describing a :pep:`WSGI Error Stream
<3333#input-and-error-streams>`.

.. class:: FileWrapper()

A :class:`typing.Protocol` describing a `file wrapper
<https://peps.python.org/pep-3333/#optional-platform-specific-file-handling>`_.
A :class:`typing.Protocol` describing a :pep:`file wrapper
<3333#optional-platform-specific-file-handling>`.
See :class:`wsgiref.util.FileWrapper` for a concrete implementation of this
protocol.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/xmlrpc.client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ between conformable Python objects and XML on the wire.
A good description of XML-RPC operation and client software in several languages.
Contains pretty much everything an XML-RPC client developer needs to know.

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

`XML-RPC Specification <http://xmlrpc.scripting.com/spec.html>`_
Expand Down
2 changes: 1 addition & 1 deletion Doc/reference/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ PyPy
and a Just in Time compiler. One of the goals of the project is to encourage
experimentation with the language itself by making it easier to modify the
interpreter (since it is written in Python). Additional information is
available on `the PyPy project's home page <https://www.pypy.org/>`_.
available on `the PyPy project's home page <https://pypy.org/>`_.

Each of these implementations varies in some way from the language as documented
in this manual, or introduces specific information beyond what's covered in the
Expand Down
2 changes: 1 addition & 1 deletion Doc/using/mac.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ https://www.activestate.com; it can also be built from source.
A number of alternative macOS GUI toolkits are available:

* `PySide <https://www.qt.io/qt-for-python>`__: Official Python bindings to the
`Qt GUI toolkit <https://qt.io>`__.
`Qt GUI toolkit <https://www.qt.io>`__.

* `PyQt <https://riverbankcomputing.com/software/pyqt/intro>`__: Alternative
Python bindings to Qt.
Expand Down
4 changes: 2 additions & 2 deletions Doc/using/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ key features:
Popular scientific modules (such as numpy, scipy and pandas) and the
``conda`` package manager.

`Enthought Deployment Manager <https://www.enthought.com/edm/>`_
`Enthought Deployment Manager <https://assets.enthought.com/downloads/edm/>`_
"The Next Generation Python Environment and Package Manager".

Previously Enthought provided Canopy, but it `reached end of life in 2016
Expand Down Expand Up @@ -1305,7 +1305,7 @@ shipped with PyWin32. It is an embeddable IDE with a built-in debugger.

.. seealso::

`Win32 How Do I...? <http://timgolden.me.uk/python/win32_how_do_i.html>`_
`Win32 How Do I...? <https://timgolden.me.uk/python/win32_how_do_i.html>`_
by Tim Golden

`Python and COM <https://www.boddie.org.uk/python/COM.html>`_
Expand Down
6 changes: 3 additions & 3 deletions Doc/whatsnew/2.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -684,11 +684,11 @@ includes a quick-start tutorial and a reference.
Written by Facundo Batista and implemented by Facundo Batista, Eric Price,
Raymond Hettinger, Aahz, and Tim Peters.

http://www.lahey.com/float.htm
`http://www.lahey.com/float.htm <https://web.archive.org/web/20230604072523/http://www.lahey.com/float.htm>`__
The article uses Fortran code to illustrate many of the problems that
floating-point inaccuracy can cause.

http://speleotrove.com/decimal/
https://speleotrove.com/decimal/
A description of a decimal-based representation. This representation is being
proposed as a standard, and underlies the new Python decimal type. Much of this
material was written by Mike Cowlishaw, designer of the Rexx language.
Expand Down Expand Up @@ -757,7 +757,7 @@ API that perform ASCII-only conversions, ignoring the locale setting:
:c:expr:`double` to an ASCII string.

The code for these functions came from the GLib library
(https://developer-old.gnome.org/glib/2.26/), whose developers kindly
(`https://developer-old.gnome.org/glib/2.26/ <http://web.archive.org/web/20210306104320/https://developer.gnome.org/glib/2.26/>`__), whose developers kindly
relicensed the relevant functions and donated them to the Python Software
Foundation. The :mod:`locale` module can now change the numeric locale,
letting extensions such as GTK+ produce the correct results.
Expand Down
Loading

0 comments on commit d18c872

Please sign in to comment.