From 43a8b8f58fb7ba6eadb7ba5cb6ee6712f6f36fdc Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Tue, 18 Apr 2023 11:06:08 -0300 Subject: [PATCH 1/5] Doc: Fix broken links reported by linkcheck --- Doc/conf.py | 20 ++++++++++++++++++++ Doc/distributing/index.rst | 12 ++++-------- Doc/faq/library.rst | 4 ++-- Doc/howto/functional.rst | 4 ++-- Doc/howto/urllib2.rst | 4 ++-- Doc/library/readline.rst | 2 +- Doc/library/stdtypes.rst | 17 +++++++++-------- Doc/library/zipfile.rst | 2 +- Doc/whatsnew/2.6.rst | 2 +- Doc/whatsnew/2.7.rst | 2 +- Misc/NEWS.d/3.7.0b2.rst | 2 +- Misc/NEWS.d/3.8.0a1.rst | 2 +- Misc/NEWS.d/3.9.0a2.rst | 2 +- Misc/NEWS.d/3.9.0a4.rst | 2 +- 14 files changed, 47 insertions(+), 30 deletions(-) diff --git a/Doc/conf.py b/Doc/conf.py index 60404fd3829e5b..56b692b949f93a 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -263,6 +263,26 @@ r'https://github.com/python/cpython/tree/.*': 'https://github.com/python/cpython/blob/.*' } +linkcheck_anchors_ignore = [ + # ignore anchors that starts with a '/', e.g. Wikipedia media: + # https://en.wikipedia.org/wiki/Walrus#/media/File:Pacific_Walrus_-_Bull_(8247646168).jpg + r'\/.*', +] + +linkcheck_ignore = [ + # A code sample in Misc/NEWS.d/3.9.0a1.rst + 'https:\/\/$', + # The crawler gets "Anchor not found" + r'https://github.com.+?#.*', + r'https://devguide.python.org.+?/#.*', + r'https://developer.apple.com/documentation/.+?#.*', + # Robot crawlers not allowed: "403 Client Error: Forbidden" + r'https://support.enthought.com/hc/.*', + # SSLError CertificateError, even though it is valid + r'https://unix.org/version2/whatsnew/lp64_wp.html', +] + + # Options for extensions # ---------------------- diff --git a/Doc/distributing/index.rst b/Doc/distributing/index.rst index 21389adedf9c15..d237f8f082d87b 100644 --- a/Doc/distributing/index.rst +++ b/Doc/distributing/index.rst @@ -129,14 +129,10 @@ involved in creating and publishing a project: * `Uploading the project to the Python Package Index`_ * `The .pypirc file`_ -.. _Project structure: \ - https://packaging.python.org/tutorials/packaging-projects/#packaging-python-projects -.. _Building and packaging the project: \ - https://packaging.python.org/tutorials/packaging-projects/#creating-the-package-files -.. _Uploading the project to the Python Package Index: \ - https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives -.. _The .pypirc file: \ - https://packaging.python.org/specifications/pypirc/ +.. _Project structure: https://packaging.python.org/tutorials/packaging-projects/#packaging-python-projects +.. _Building and packaging the project: https://packaging.python.org/tutorials/packaging-projects/#creating-the-package-files +.. _Uploading the project to the Python Package Index: https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives +.. _The .pypirc file: https://packaging.python.org/specifications/pypirc/ How do I...? diff --git a/Doc/faq/library.rst b/Doc/faq/library.rst index a9cde456575020..3be39cd781d044 100644 --- a/Doc/faq/library.rst +++ b/Doc/faq/library.rst @@ -780,8 +780,8 @@ socket to :meth:`select.select` to check if it's writable. The :mod:`asyncio` module provides a general purpose single-threaded and concurrent asynchronous library, which can be used for writing non-blocking network code. - The third-party `Twisted `_ library is - a popular and feature-rich alternative. + The third-party `Twisted `_ library is a popular and + feature-rich alternative. Databases diff --git a/Doc/howto/functional.rst b/Doc/howto/functional.rst index 38a651b0f964a6..5cf12cc52bde4e 100644 --- a/Doc/howto/functional.rst +++ b/Doc/howto/functional.rst @@ -1208,8 +1208,8 @@ General ------- **Structure and Interpretation of Computer Programs**, by Harold Abelson and -Gerald Jay Sussman with Julie Sussman. Full text at -https://mitpress.mit.edu/sicp/. In this classic textbook of computer science, +Gerald Jay Sussman with Julie Sussman. The book can be found at +https://mitpress.mit.edu/sicp. In this classic textbook of computer science, chapters 2 and 3 discuss the use of sequences and streams to organize the data flow inside a program. The book uses Scheme for its examples, but many of the design approaches described in these chapters are applicable to functional-style diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst index 69af3c3a85c5d6..61ba6bd7224fcc 100644 --- a/Doc/howto/urllib2.rst +++ b/Doc/howto/urllib2.rst @@ -86,7 +86,7 @@ response:: import urllib.request - req = urllib.request.Request('http://www.voidspace.org.uk') + req = urllib.request.Request('http://python.org/') with urllib.request.urlopen(req) as response: the_page = response.read() @@ -458,7 +458,7 @@ To illustrate creating and installing a handler we will use the ``HTTPBasicAuthHandler``. For a more detailed discussion of this subject -- including an explanation of how Basic Authentication works - see the `Basic Authentication Tutorial -`_. +`__. When authentication is required, the server sends a header (as well as the 401 error code) requesting authentication. This specifies the authentication scheme diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst index 4d485d25b54020..8fb0eca8df74d8 100644 --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@ -19,7 +19,7 @@ function. Readline keybindings may be configured via an initialization file, typically ``.inputrc`` in your home directory. See `Readline Init File -`_ +`_ in the GNU Readline manual for information about the format and allowable constructs of that file, and the capabilities of the Readline library in general. diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index bcfc6e5cfce611..179bea870d6cf3 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1605,8 +1605,8 @@ expression support in the :mod:`re` module). converts it to ``"ss"``. The casefolding algorithm is - `described in section 3.13 of the Unicode Standard - `__. + `described in section 3.13 'Default Case Folding' of the Unicode Standard + `__. .. versionadded:: 3.3 @@ -1768,8 +1768,9 @@ expression support in the :mod:`re` module). one character, ``False`` otherwise. Alphabetic characters are those characters defined in the Unicode character database as "Letter", i.e., those with general category property being one of "Lm", "Lt", "Lu", "Ll", or "Lo". Note that this is different - from the `Alphabetic property defined in the Unicode Standard - `_. + from the `Alphabetic property defined in the section 4.10 'Letters, Alphabetic, and + Ideographic' of the Unicode Standard + `_. .. method:: str.isascii() @@ -1904,8 +1905,8 @@ expression support in the :mod:`re` module). lowercase. The lowercasing algorithm used is - `described in section 3.13 of the Unicode Standard - `__. + `described in section 3.13 'Default Case Folding' of the Unicode Standard + `__. .. method:: str.lstrip([chars]) @@ -2250,8 +2251,8 @@ expression support in the :mod:`re` module). titlecase). The uppercasing algorithm used is - `described in section 3.13 of the Unicode Standard - `__. + `described in section 3.13 'Default Case Folding' of the Unicode Standard + `__. .. method:: str.zfill(width) diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index e2a085d6e98e67..6f4826cb065c64 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -7,7 +7,7 @@ .. moduleauthor:: James C. Ahlstrom .. sectionauthor:: James C. Ahlstrom -**Source code:** :source:`Lib/zipfile.py` +**Source code:** :source:`Lib/zipfile/` -------------- diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst index 34f2656f765c7d..4ee2aacb108a36 100644 --- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -172,7 +172,7 @@ this edition of "What's New in Python" links to the bug/patch item for each change. Hosting of the Python bug tracker is kindly provided by -`Upfront Systems `__ +`Upfront Systems `__ of Stellenbosch, South Africa. Martin von Löwis put a lot of effort into importing existing bugs and patches from SourceForge; his scripts for this import operation are at diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst index 810a2cd2537c34..36afcb163f1afc 100644 --- a/Doc/whatsnew/2.7.rst +++ b/Doc/whatsnew/2.7.rst @@ -2104,7 +2104,7 @@ Changes to Python's build process and to the C API include: * The latest release of the GNU Debugger, GDB 7, can be `scripted using Python - `__. + `__. When you begin debugging an executable program P, GDB will look for a file named ``P-gdb.py`` and automatically read it. Dave Malcolm contributed a :file:`python-gdb.py` that adds a number of diff --git a/Misc/NEWS.d/3.7.0b2.rst b/Misc/NEWS.d/3.7.0b2.rst index b2ade206bd5f97..465714acdb33eb 100644 --- a/Misc/NEWS.d/3.7.0b2.rst +++ b/Misc/NEWS.d/3.7.0b2.rst @@ -357,7 +357,7 @@ Wirtel Add TLSVersion constants and SSLContext.maximum_version / minimum_version attributes. The new API wraps OpenSSL 1.1 -https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html +https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_min_proto_version.html feature. .. diff --git a/Misc/NEWS.d/3.8.0a1.rst b/Misc/NEWS.d/3.8.0a1.rst index 991bbc128670b2..aabba586dc60f3 100644 --- a/Misc/NEWS.d/3.8.0a1.rst +++ b/Misc/NEWS.d/3.8.0a1.rst @@ -5951,7 +5951,7 @@ Wirtel Add TLSVersion constants and SSLContext.maximum_version / minimum_version attributes. The new API wraps OpenSSL 1.1 -https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html +https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_min_proto_version.html feature. .. diff --git a/Misc/NEWS.d/3.9.0a2.rst b/Misc/NEWS.d/3.9.0a2.rst index 226ea0d3df2243..a03eb10f1d523a 100644 --- a/Misc/NEWS.d/3.9.0a2.rst +++ b/Misc/NEWS.d/3.9.0a2.rst @@ -686,7 +686,7 @@ added. Update documentation to state that to activate virtual environments under fish one should use `source`, not `.` as documented at -https://fishshell.com/docs/current/commands.html#source. +https://fishshell.com/docs/current/cmds/source.html. .. diff --git a/Misc/NEWS.d/3.9.0a4.rst b/Misc/NEWS.d/3.9.0a4.rst index 2aef8b26b01696..019b34c4082d10 100644 --- a/Misc/NEWS.d/3.9.0a4.rst +++ b/Misc/NEWS.d/3.9.0a4.rst @@ -392,7 +392,7 @@ The distutils ``bdist_msi`` command is deprecated in Python 3.9, use Improved performance of zipfile.Path for files with a large number of entries. Also improved performance and fixed minor issue as published with `importlib_metadata 1.5 -`_. +`_. .. From e9750920e11ac0e73fb74b4d42360155a69d4c8d Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Tue, 18 Apr 2023 21:34:10 -0300 Subject: [PATCH 2/5] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove extra diff line in faq/library.rst (merwok) - Use HTTPS to link Unicode 15.0.0 to solve a redirect (hugovk) - Use wayback machine link for openssl 1.1.0 instead of linking 1.1.1, "as this text mentions a feature from 1.1.0" (hugovk) Co-authored-by: Éric Co-authored-by: Hugo van Kemenade --- Doc/faq/library.rst | 4 ++-- Doc/library/stdtypes.rst | 2 +- Misc/NEWS.d/3.7.0b2.rst | 2 +- Misc/NEWS.d/3.8.0a1.rst | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/faq/library.rst b/Doc/faq/library.rst index 3be39cd781d044..597caaa778e1c8 100644 --- a/Doc/faq/library.rst +++ b/Doc/faq/library.rst @@ -780,8 +780,8 @@ socket to :meth:`select.select` to check if it's writable. The :mod:`asyncio` module provides a general purpose single-threaded and concurrent asynchronous library, which can be used for writing non-blocking network code. - The third-party `Twisted `_ library is a popular and - feature-rich alternative. + The third-party `Twisted `_ library is + a popular and feature-rich alternative. Databases diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 179bea870d6cf3..aea2410bae354b 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1606,7 +1606,7 @@ expression support in the :mod:`re` module). The casefolding algorithm is `described in section 3.13 'Default Case Folding' of the Unicode Standard - `__. + `__. .. versionadded:: 3.3 diff --git a/Misc/NEWS.d/3.7.0b2.rst b/Misc/NEWS.d/3.7.0b2.rst index 465714acdb33eb..9590914599bb86 100644 --- a/Misc/NEWS.d/3.7.0b2.rst +++ b/Misc/NEWS.d/3.7.0b2.rst @@ -357,7 +357,7 @@ Wirtel Add TLSVersion constants and SSLContext.maximum_version / minimum_version attributes. The new API wraps OpenSSL 1.1 -https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_min_proto_version.html +https://web.archive.org/web/20180309043602/https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html feature. .. diff --git a/Misc/NEWS.d/3.8.0a1.rst b/Misc/NEWS.d/3.8.0a1.rst index aabba586dc60f3..db2eba32e6ea34 100644 --- a/Misc/NEWS.d/3.8.0a1.rst +++ b/Misc/NEWS.d/3.8.0a1.rst @@ -5951,7 +5951,7 @@ Wirtel Add TLSVersion constants and SSLContext.maximum_version / minimum_version attributes. The new API wraps OpenSSL 1.1 -https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_min_proto_version.html +https://web.archive.org/web/20180309043602/https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html feature. .. From 95c516f4413a4f29e07ecb48e8825d1270e9aa38 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Tue, 18 Apr 2023 19:31:48 -0300 Subject: [PATCH 3/5] Doc: Make mark-up code as literal --- Doc/conf.py | 2 -- Misc/NEWS.d/3.9.0a1.rst | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Doc/conf.py b/Doc/conf.py index 56b692b949f93a..40cf1a37c60bfe 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -270,8 +270,6 @@ ] linkcheck_ignore = [ - # A code sample in Misc/NEWS.d/3.9.0a1.rst - 'https:\/\/$', # The crawler gets "Anchor not found" r'https://github.com.+?#.*', r'https://devguide.python.org.+?/#.*', diff --git a/Misc/NEWS.d/3.9.0a1.rst b/Misc/NEWS.d/3.9.0a1.rst index 633620583838df..0888a5c43087b5 100644 --- a/Misc/NEWS.d/3.9.0a1.rst +++ b/Misc/NEWS.d/3.9.0a1.rst @@ -4887,7 +4887,7 @@ Fix use of registry values to launch Python from Microsoft Store app. .. section: Windows Fix memory leak on Windows in creating an SSLContext object or running -urllib.request.urlopen('https://...'). +``urllib.request.urlopen('https://...')``. .. From 3616b40187eeff898fb2521cef472b2c7f7609eb Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Wed, 19 Apr 2023 06:07:17 -0300 Subject: [PATCH 4/5] Doc: Alphabetize items in linkcheck_ignore Co-authored-by: Hugo van Kemenade --- Doc/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/conf.py b/Doc/conf.py index 40cf1a37c60bfe..8e38ab8dcb6c19 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -271,9 +271,9 @@ linkcheck_ignore = [ # The crawler gets "Anchor not found" - r'https://github.com.+?#.*', - r'https://devguide.python.org.+?/#.*', r'https://developer.apple.com/documentation/.+?#.*', + r'https://devguide.python.org.+?/#.*', + r'https://github.com.+?#.*', # Robot crawlers not allowed: "403 Client Error: Forbidden" r'https://support.enthought.com/hc/.*', # SSLError CertificateError, even though it is valid From d7a007b8e45eda5ba68243ae7cb1d90b15be1153 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Fri, 21 Apr 2023 07:12:20 -0300 Subject: [PATCH 5/5] Doc: Improve comment in sphinx conf Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- Doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/conf.py b/Doc/conf.py index 8e38ab8dcb6c19..4c120bee64dde4 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -264,7 +264,7 @@ } linkcheck_anchors_ignore = [ - # ignore anchors that starts with a '/', e.g. Wikipedia media: + # ignore anchors that start with a '/', e.g. Wikipedia media files: # https://en.wikipedia.org/wiki/Walrus#/media/File:Pacific_Walrus_-_Bull_(8247646168).jpg r'\/.*', ]