diff --git a/Doc/conf.py b/Doc/conf.py
index 1de864c3da0fdd..0a9794f27ce08d 100644
--- a/Doc/conf.py
+++ b/Doc/conf.py
@@ -537,6 +537,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/.+',
diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst
index ebb6d5ed1288c6..e2710fab9cf800 100644
--- a/Doc/faq/design.rst
+++ b/Doc/faq/design.rst
@@ -328,7 +328,7 @@ Can Python be compiled to machine code, C or some other language?
-----------------------------------------------------------------
`Cython `_ compiles a modified version of Python with
-optional annotations into C extensions. `Nuitka `_ is
+optional annotations into C extensions. `Nuitka `_ is
an up-and-coming compiler of Python into C++ code, aiming to support the full
Python language.
@@ -345,7 +345,7 @@ to perform a garbage collection, obtain debugging statistics, and tune the
collector's parameters.
Other implementations (such as `Jython `_ or
-`PyPy `_), however, can rely on a different mechanism
+`PyPy `_), 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.
diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst
index 8f4c42d050b395..e2881a996ece41 100644
--- a/Doc/library/hashlib.rst
+++ b/Doc/library/hashlib.rst
@@ -653,7 +653,7 @@ on the hash function used in digital signatures.
by the signer.
(`NIST SP-800-106 "Randomized Hashing for Digital Signatures"
- `_)
+ `_)
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.
@@ -807,8 +807,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
@@ -825,7 +825,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/
diff --git a/Doc/library/http.cookiejar.rst b/Doc/library/http.cookiejar.rst
index 31ac8bafb6ab4b..23ddecf873876d 100644
--- a/Doc/library/http.cookiejar.rst
+++ b/Doc/library/http.cookiejar.rst
@@ -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
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index 892972d297cfb3..88882aee2b258e 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -13,7 +13,7 @@
`JSON (JavaScript Object Notation) `_, specified by
:rfc:`7159` (which obsoletes :rfc:`4627`) and by
-`ECMA-404 `_,
+`ECMA-404 `_,
is a lightweight data interchange format inspired by
`JavaScript `_ object literal syntax
(although it is not a strict subset of JavaScript [#rfc-errata]_ ).
@@ -546,7 +546,7 @@ Standard Compliance and Interoperability
----------------------------------------
The JSON format is specified by :rfc:`7159` and by
-`ECMA-404 `_.
+`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.
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index b7cf2b286958e8..bc216e6b551dec 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -1522,7 +1522,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
- `_.
+ `_.
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
@@ -1597,7 +1597,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
- `_.
+ `_.
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.
@@ -1829,7 +1829,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 `_ to their
+ A dictionary is returned which maps the names of each `piece of information `_ to their
numeric values. For example, here is the total number of hits and misses
in the session cache since the context was created::
@@ -1972,7 +1972,7 @@ to speed up repeated connections from the same clients.
.. attribute:: SSLContext.security_level
An integer representing the `security level
- `_
+ `_
for the context. This attribute is read-only.
.. versionadded:: 3.10
diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst
index fd9125bc00abf4..843e994dc24e74 100644
--- a/Doc/library/tkinter.rst
+++ b/Doc/library/tkinter.rst
@@ -58,7 +58,7 @@ details that are unchanged.
* `Modern Tkinter for Busy Python Developers `_
By Mark Roseman. (ISBN 978-1999149567)
- * `Python GUI programming with Tkinter `_
+ * `Python GUI programming with Tkinter `_
By Alan D. Moore. (ISBN 978-1788835886)
* `Programming Python `_
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 446ee6a0ec3cdb..bb49093505278c 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -2581,7 +2581,7 @@ Functions and decorators
.. seealso::
`Unreachable Code and Exhaustiveness Checking
- `__ has more
+ `__ has more
information about exhaustiveness checking with static typing.
.. versionadded:: 3.11
diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst
index 614fb19d1f56b6..c57f433e6efd98 100644
--- a/Doc/library/xmlrpc.client.rst
+++ b/Doc/library/xmlrpc.client.rst
@@ -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 `_
+ `XML-RPC Introspection `_
Describes the XML-RPC protocol extension for introspection.
`XML-RPC Specification `_
diff --git a/Doc/reference/introduction.rst b/Doc/reference/introduction.rst
index cf186705e6e987..b7b70e6be5a5b7 100644
--- a/Doc/reference/introduction.rst
+++ b/Doc/reference/introduction.rst
@@ -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 `_.
+ available on `the PyPy project's home page `_.
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
diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst
index 31d37aad2a7408..8b67652d1dfe6d 100644
--- a/Doc/using/mac.rst
+++ b/Doc/using/mac.rst
@@ -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 `__: Official Python bindings to the
- `Qt GUI toolkit `__.
+ `Qt GUI toolkit `__.
* `PyQt `__: Alternative
Python bindings to Qt.
diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst
index 013374f2bff481..87fccfbc7e591e 100644
--- a/Doc/using/windows.rst
+++ b/Doc/using/windows.rst
@@ -548,7 +548,7 @@ key features:
Popular scientific modules (such as numpy, scipy and pandas) and the
``conda`` package manager.
-`Enthought Deployment Manager `_
+`Enthought Deployment Manager `_
"The Next Generation Python Environment and Package Manager".
Previously Enthought provided Canopy, but it `reached end of life in 2016
@@ -1237,7 +1237,7 @@ shipped with PyWin32. It is an embeddable IDE with a built-in debugger.
.. seealso::
- `Win32 How Do I...? `_
+ `Win32 How Do I...? `_
by Tim Golden
`Python and COM `_
diff --git a/Doc/whatsnew/2.4.rst b/Doc/whatsnew/2.4.rst
index f085f5c6e271d9..3ad4e91415585a 100644
--- a/Doc/whatsnew/2.4.rst
+++ b/Doc/whatsnew/2.4.rst
@@ -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 `__
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.
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
index 86ce222425031a..a599393ff397e1 100644
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -1548,7 +1548,7 @@ changes, or look through the Subversion logs for all the details.
*ciphers* argument that's a string listing the encryption algorithms
to be allowed; the format of the string is described
`in the OpenSSL documentation
- `__.
+ `__.
(Added by Antoine Pitrou; :issue:`8322`.)
Another change makes the extension load all of OpenSSL's ciphers and
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst
index 3ecfdd873fbe9e..b1eae4732923a1 100644
--- a/Doc/whatsnew/3.12.rst
+++ b/Doc/whatsnew/3.12.rst
@@ -1265,7 +1265,7 @@ Deprecated
We added the warning to raise awareness as issues encountered by code doing
this are becoming more frequent. See the :func:`os.fork` documentation for
more details along with `this discussion on fork being incompatible with threads
- `_ for *why* we're now surfacing this
+ `_ for *why* we're now surfacing this
longstanding platform compatibility problem to developers.
When this warning appears due to usage of :mod:`multiprocessing` or
diff --git a/Misc/NEWS.d/3.10.0a7.rst b/Misc/NEWS.d/3.10.0a7.rst
index 53185d3aec8ad6..d866e805fd3a7e 100644
--- a/Misc/NEWS.d/3.10.0a7.rst
+++ b/Misc/NEWS.d/3.10.0a7.rst
@@ -715,7 +715,7 @@ this situation. Also ensures that the :func:`tempfile.gettempdir` and
Expose ``X509_V_FLAG_ALLOW_PROXY_CERTS`` as
:const:`~ssl.VERIFY_ALLOW_PROXY_CERTS` to allow proxy certificate validation
as explained in
-https://www.openssl.org/docs/man1.1.1/man7/proxy-certificates.html.
+https://docs.openssl.org/1.1.1/man7/proxy-certificates/.
..
diff --git a/Misc/NEWS.d/3.12.0a6.rst b/Misc/NEWS.d/3.12.0a6.rst
index 382dae33fcaee1..bc708d163ce0e9 100644
--- a/Misc/NEWS.d/3.12.0a6.rst
+++ b/Misc/NEWS.d/3.12.0a6.rst
@@ -17,7 +17,7 @@ from the HACL* project.
Updated the OpenSSL version used in Windows and macOS binary release builds
to 1.1.1t to address :cve:`2023-0286`, :cve:`2022-4303`, and :cve:`2022-4303` per
`the OpenSSL 2023-02-07 security advisory
-`_.
+`_.
..