Skip to content

Commit 0f1a183

Browse files
bpo-33641: Convert RFC references into links. (GH-7103)
85% of them are already links. (cherry picked from commit 0a36ac1) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent a4dd46a commit 0f1a183

23 files changed

+56
-60
lines changed

Doc/howto/logging-cookbook.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,11 +1652,11 @@ works::
16521652
Inserting a BOM into messages sent to a SysLogHandler
16531653
-----------------------------------------------------
16541654

1655-
`RFC 5424 <https://tools.ietf.org/html/rfc5424>`_ requires that a
1655+
:rfc:`5424` requires that a
16561656
Unicode message be sent to a syslog daemon as a set of bytes which have the
16571657
following structure: an optional pure-ASCII component, followed by a UTF-8 Byte
1658-
Order Mark (BOM), followed by Unicode encoded using UTF-8. (See the `relevant
1659-
section of the specification <https://tools.ietf.org/html/rfc5424#section-6>`_.)
1658+
Order Mark (BOM), followed by Unicode encoded using UTF-8. (See the
1659+
:rfc:`relevant section of the specification <5424#section-6>`.)
16601660

16611661
In Python 3.1, code was added to
16621662
:class:`~logging.handlers.SysLogHandler` to insert a BOM into the message, but
@@ -1666,7 +1666,7 @@ appear before it.
16661666

16671667
As this behaviour is broken, the incorrect BOM insertion code is being removed
16681668
from Python 3.2.4 and later. However, it is not being replaced, and if you
1669-
want to produce RFC 5424-compliant messages which include a BOM, an optional
1669+
want to produce :rfc:`5424`-compliant messages which include a BOM, an optional
16701670
pure-ASCII sequence before it and arbitrary Unicode after it, encoded using
16711671
UTF-8, then you need to do the following:
16721672

@@ -1689,7 +1689,7 @@ UTF-8, then you need to do the following:
16891689

16901690
The formatted message *will* be encoded using UTF-8 encoding by
16911691
``SysLogHandler``. If you follow the above rules, you should be able to produce
1692-
RFC 5424-compliant messages. If you don't, logging may not complain, but your
1692+
:rfc:`5424`-compliant messages. If you don't, logging may not complain, but your
16931693
messages will not be RFC 5424-compliant, and your syslog daemon may complain.
16941694

16951695

Doc/howto/logging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ which should print something like this:
297297
2010-12-12 11:41:42,612 is when this event was logged.
298298
299299
The default format for date/time display (shown above) is like ISO8601 or
300-
RFC 3339. If you need more control over the formatting of the date/time, provide
300+
:rfc:`3339`. If you need more control over the formatting of the date/time, provide
301301
a *datefmt* argument to ``basicConfig``, as in this example::
302302

303303
import logging

Doc/howto/urllib2.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ a different URL, urllib will handle that for you). For those it can't handle,
239239
urlopen will raise an :exc:`HTTPError`. Typical errors include '404' (page not
240240
found), '403' (request forbidden), and '401' (authentication required).
241241

242-
See section 10 of RFC 2616 for a reference on all the HTTP error codes.
242+
See section 10 of :rfc:`2616` for a reference on all the HTTP error codes.
243243

244244
The :exc:`HTTPError` instance raised will have an integer 'code' attribute, which
245245
corresponds to the error sent by the server.
@@ -252,7 +252,7 @@ codes in the 100--299 range indicate success, you will usually only see error
252252
codes in the 400--599 range.
253253

254254
:attr:`http.server.BaseHTTPRequestHandler.responses` is a useful dictionary of
255-
response codes in that shows all the response codes used by RFC 2616. The
255+
response codes in that shows all the response codes used by :rfc:`2616`. The
256256
dictionary is reproduced here for convenience ::
257257

258258
# Table mapping response codes to messages; entries have the

Doc/library/binascii.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The :mod:`binascii` module defines the following functions:
8080
*quotetabs* is present and true, all tabs and spaces will be encoded. If the
8181
optional argument *istext* is present and true, newlines are not encoded but
8282
trailing whitespace will be encoded. If the optional argument *header* is
83-
present and true, spaces will be encoded as underscores per RFC1522. If the
83+
present and true, spaces will be encoded as underscores per :rfc:`1522`. If the
8484
optional argument *header* is present and false, newline characters will be
8585
encoded as well; otherwise linefeed conversion might corrupt the binary data
8686
stream.

Doc/library/codecs.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ to the user.
14251425

14261426
Python supports this conversion in several ways: the ``idna`` codec performs
14271427
conversion between Unicode and ACE, separating an input string into labels
1428-
based on the separator characters defined in `section 3.1`_ (1) of :rfc:`3490`
1428+
based on the separator characters defined in :rfc:`section 3.1 of RFC 3490 <3490#section-3.1>`
14291429
and converting each label to ACE as required, and conversely separating an input
14301430
byte string into labels based on the ``.`` separator and converting any ACE
14311431
labels found into unicode. Furthermore, the :mod:`socket` module
@@ -1436,8 +1436,6 @@ parameters, such as :mod:`http.client` and :mod:`ftplib`, accept Unicode host
14361436
names (:mod:`http.client` then also transparently sends an IDNA hostname in the
14371437
:mailheader:`Host` field if it sends that field at all).
14381438

1439-
.. _section 3.1: https://tools.ietf.org/html/rfc3490#section-3.1
1440-
14411439
When receiving host names from the wire (such as in reverse name lookup), no
14421440
automatic conversion to Unicode is performed: Applications wishing to present
14431441
such host names to the user should decode them to Unicode.

Doc/library/email.examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ text content and the addresses may contain unicode characters):
1212
.. literalinclude:: ../includes/email-simple.py
1313

1414

15-
Parsing RFC822 headers can easily be done by the using the classes
15+
Parsing :rfc:`822` headers can easily be done by the using the classes
1616
from the :mod:`~email.parser` module:
1717

1818
.. literalinclude:: ../includes/email-headers.py

Doc/library/ftplib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
295295
If optional *rest* is given, a ``REST`` command is sent to the server, passing
296296
*rest* as an argument. *rest* is usually a byte offset into the requested file,
297297
telling the server to restart sending the file's bytes at the requested offset,
298-
skipping over the initial bytes. Note however that RFC 959 requires only that
298+
skipping over the initial bytes. Note however that :rfc:`959` requires only that
299299
*rest* be a string containing characters in the printable range from ASCII code
300300
33 to ASCII code 126. The :meth:`transfercmd` method, therefore, converts
301301
*rest* to a string, but no check is performed on the string's contents. If the

Doc/library/hashlib.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ BLAKE2
283283
.. index::
284284
single: blake2b, blake2s
285285

286-
BLAKE2_ is a cryptographic hash function defined in RFC-7693_ that comes in two
286+
BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes in two
287287
flavors:
288288

289289
* **BLAKE2b**, optimized for 64-bit platforms and produces digests of any size
@@ -707,7 +707,6 @@ Domain Dedication 1.0 Universal:
707707

708708
* *Alexandr Sokolovskiy*
709709

710-
.. _RFC-7693: https://tools.ietf.org/html/rfc7693
711710
.. _BLAKE2: https://blake2.net
712711
.. _HMAC: https://en.wikipedia.org/wiki/Hash-based_message_authentication_code
713712
.. _BLAKE: https://131002.net/blake/

Doc/library/http.cookiejar.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ The following classes are provided:
8888
:class:`DefaultCookiePolicy` objects.
8989

9090
:class:`DefaultCookiePolicy` implements the standard accept / reject rules for
91-
Netscape and RFC 2965 cookies. By default, RFC 2109 cookies (ie. cookies
91+
Netscape and :rfc:`2965` cookies. By default, :rfc:`2109` cookies (ie. cookies
9292
received in a :mailheader:`Set-Cookie` header with a version cookie-attribute of
9393
1) are treated according to the RFC 2965 rules. However, if RFC 2965 handling
9494
is turned off or :attr:`rfc2109_as_netscape` is ``True``, RFC 2109 cookies are
@@ -100,7 +100,7 @@ The following classes are provided:
100100

101101
.. class:: Cookie()
102102

103-
This class represents Netscape, RFC 2109 and RFC 2965 cookies. It is not
103+
This class represents Netscape, :rfc:`2109` and :rfc:`2965` cookies. It is not
104104
expected that users of :mod:`http.cookiejar` construct their own :class:`Cookie`
105105
instances. Instead, if necessary, call :meth:`make_cookies` on a
106106
:class:`CookieJar` instance.
@@ -123,14 +123,14 @@ The following classes are provided:
123123
the one sketched out in ``cookie_spec.html``.
124124

125125
:rfc:`2109` - HTTP State Management Mechanism
126-
Obsoleted by RFC 2965. Uses :mailheader:`Set-Cookie` with version=1.
126+
Obsoleted by :rfc:`2965`. Uses :mailheader:`Set-Cookie` with version=1.
127127

128128
:rfc:`2965` - HTTP State Management Mechanism
129129
The Netscape protocol with the bugs fixed. Uses :mailheader:`Set-Cookie2` in
130130
place of :mailheader:`Set-Cookie`. Not widely used.
131131

132132
http://kristol.org/cookie/errata.html
133-
Unfinished errata to RFC 2965.
133+
Unfinished errata to :rfc:`2965`.
134134

135135
:rfc:`2964` - Use of HTTP State Management
136136

@@ -320,7 +320,7 @@ writing.
320320

321321
.. note::
322322

323-
This loses information about RFC 2965 cookies, and also about newer or
323+
This loses information about :rfc:`2965` cookies, and also about newer or
324324
non-standard cookie-attributes such as ``port``.
325325

326326
.. warning::
@@ -410,13 +410,13 @@ be assigned to.
410410

411411
.. attribute:: CookiePolicy.rfc2965
412412

413-
Implement RFC 2965 protocol.
413+
Implement :rfc:`2965` protocol.
414414

415415

416416
.. attribute:: CookiePolicy.hide_cookie2
417417

418418
Don't add :mailheader:`Cookie2` header to requests (the presence of this header
419-
indicates to the server that we understand RFC 2965 cookies).
419+
indicates to the server that we understand :rfc:`2965` cookies).
420420

421421
The most useful way to define a :class:`CookiePolicy` class is by subclassing
422422
from :class:`DefaultCookiePolicy` and overriding some or all of the methods
@@ -431,7 +431,7 @@ DefaultCookiePolicy Objects
431431

432432
Implements the standard rules for accepting and returning cookies.
433433

434-
Both RFC 2965 and Netscape cookies are covered. RFC 2965 handling is switched
434+
Both :rfc:`2965` and Netscape cookies are covered. RFC 2965 handling is switched
435435
off by default.
436436

437437
The easiest way to provide your own policy is to override this class and call
@@ -510,11 +510,11 @@ all be assigned to.
510510

511511
.. attribute:: DefaultCookiePolicy.rfc2109_as_netscape
512512

513-
If true, request that the :class:`CookieJar` instance downgrade RFC 2109 cookies
513+
If true, request that the :class:`CookieJar` instance downgrade :rfc:`2109` cookies
514514
(ie. cookies received in a :mailheader:`Set-Cookie` header with a version
515515
cookie-attribute of 1) to Netscape cookies by setting the version attribute of
516516
the :class:`Cookie` instance to 0. The default value is :const:`None`, in which
517-
case RFC 2109 cookies are downgraded if and only if RFC 2965 handling is turned
517+
case RFC 2109 cookies are downgraded if and only if :rfc:`2965` handling is turned
518518
off. Therefore, RFC 2109 cookies are downgraded by default.
519519

520520

@@ -527,11 +527,11 @@ General strictness switches:
527527
and isn't guaranteed to work!
528528

529529

530-
RFC 2965 protocol strictness switches:
530+
:rfc:`2965` protocol strictness switches:
531531

532532
.. attribute:: DefaultCookiePolicy.strict_rfc2965_unverifiable
533533

534-
Follow RFC 2965 rules on unverifiable transactions (usually, an unverifiable
534+
Follow :rfc:`2965` rules on unverifiable transactions (usually, an unverifiable
535535
transaction is one resulting from a redirect or a request for an image hosted on
536536
another site). If this is false, cookies are *never* blocked on the basis of
537537
verifiability
@@ -541,7 +541,7 @@ Netscape protocol strictness switches:
541541

542542
.. attribute:: DefaultCookiePolicy.strict_ns_unverifiable
543543

544-
Apply RFC 2965 rules on unverifiable transactions even to Netscape cookies.
544+
Apply :rfc:`2965` rules on unverifiable transactions even to Netscape cookies.
545545

546546

547547
.. attribute:: DefaultCookiePolicy.strict_ns_domain
@@ -581,7 +581,7 @@ both flags are set).
581581

582582
.. attribute:: DefaultCookiePolicy.DomainRFC2965Match
583583

584-
When setting cookies, require a full RFC 2965 domain-match.
584+
When setting cookies, require a full :rfc:`2965` domain-match.
585585

586586
The following attributes are provided for convenience, and are the most useful
587587
combinations of the above flags:
@@ -605,7 +605,7 @@ Cookie Objects
605605
standard cookie-attributes specified in the various cookie standards. The
606606
correspondence is not one-to-one, because there are complicated rules for
607607
assigning default values, because the ``max-age`` and ``expires``
608-
cookie-attributes contain equivalent information, and because RFC 2109 cookies
608+
cookie-attributes contain equivalent information, and because :rfc:`2109` cookies
609609
may be 'downgraded' by :mod:`http.cookiejar` from version 1 to version 0 (Netscape)
610610
cookies.
611611

@@ -616,8 +616,8 @@ internal consistency, so you should know what you're doing if you do that.
616616

617617
.. attribute:: Cookie.version
618618

619-
Integer or :const:`None`. Netscape cookies have :attr:`version` 0. RFC 2965 and
620-
RFC 2109 cookies have a ``version`` cookie-attribute of 1. However, note that
619+
Integer or :const:`None`. Netscape cookies have :attr:`version` 0. :rfc:`2965` and
620+
:rfc:`2109` cookies have a ``version`` cookie-attribute of 1. However, note that
621621
:mod:`http.cookiejar` may 'downgrade' RFC 2109 cookies to Netscape cookies, in which
622622
case :attr:`version` is 0.
623623

@@ -673,7 +673,7 @@ internal consistency, so you should know what you're doing if you do that.
673673

674674
.. attribute:: Cookie.rfc2109
675675

676-
``True`` if this cookie was received as an RFC 2109 cookie (ie. the cookie
676+
``True`` if this cookie was received as an :rfc:`2109` cookie (ie. the cookie
677677
arrived in a :mailheader:`Set-Cookie` header, and the value of the Version
678678
cookie-attribute in that header was 1). This attribute is provided because
679679
:mod:`http.cookiejar` may 'downgrade' RFC 2109 cookies to Netscape cookies, in
@@ -745,7 +745,7 @@ cookies (assumes Unix/Netscape convention for location of the cookies file)::
745745
r = opener.open("http://example.com/")
746746

747747
The next example illustrates the use of :class:`DefaultCookiePolicy`. Turn on
748-
RFC 2965 cookies, be more strict about domains when setting and returning
748+
:rfc:`2965` cookies, be more strict about domains when setting and returning
749749
Netscape cookies, and block some domains from setting cookies or having them
750750
returned::
751751

Doc/library/imaplib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ An :class:`IMAP4` instance has the following methods:
342342

343343
.. method:: IMAP4.namespace()
344344

345-
Returns IMAP namespaces as defined in RFC2342.
345+
Returns IMAP namespaces as defined in :rfc:`2342`.
346346

347347

348348
.. method:: IMAP4.noop()

Doc/library/logging.handlers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ supports sending logging messages to a remote or local Unix syslog.
596596
(See: :issue:`12168`.) In earlier versions, the message sent to the
597597
syslog daemons was always terminated with a NUL byte, because early
598598
versions of these daemons expected a NUL terminated message - even
599-
though it's not in the relevant specification (RFC 5424). More recent
599+
though it's not in the relevant specification (:rfc:`5424`). More recent
600600
versions of these daemons don't expect the NUL byte but strip it off
601601
if it's there, and even more recent daemons (which adhere more closely
602602
to RFC 5424) pass the NUL byte on as part of the message.

Doc/library/logging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ The useful mapping keys in a :class:`LogRecord` are given in the section on
516516
initialized with a format string for the message as a whole, as well as a
517517
format string for the date/time portion of a message. If no *fmt* is
518518
specified, ``'%(message)s'`` is used. If no *datefmt* is specified, an
519-
ISO8601-like (or RFC3339-like) date format is used. See the
519+
ISO8601-like (or :rfc:`3339`-like) date format is used. See the
520520
:meth:`formatTime` documentation for more details.
521521

522522
The *style* parameter can be one of '%', '{' or '$' and determines how

Doc/library/nntplib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ them have been superseded by newer commands in :rfc:`3977`.
542542
is supplied, then the returned *list* is an empty list. This is an optional NNTP
543543
extension, and may not be supported by all servers.
544544
545-
RFC2980 says "It is suggested that this extension be deprecated". Use
545+
:rfc:`2980` says "It is suggested that this extension be deprecated". Use
546546
:meth:`descriptions` or :meth:`description` instead.
547547
548548

Doc/library/ssl.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2638,25 +2638,25 @@ with LibreSSL.
26382638
`SSL/TLS Strong Encryption: An Introduction <https://httpd.apache.org/docs/trunk/en/ssl/ssl_intro.html>`_
26392639
Intro from the Apache HTTP Server documentation
26402640

2641-
`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: Certificate-Based Key Management <https://www.ietf.org/rfc/rfc1422>`_
2641+
:rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: Certificate-Based Key Management <1422>`
26422642
Steve Kent
26432643

2644-
`RFC 4086: Randomness Requirements for Security <https://datatracker.ietf.org/doc/rfc4086/>`_
2644+
:rfc:`RFC 4086: Randomness Requirements for Security <4086>`
26452645
Donald E., Jeffrey I. Schiller
26462646

2647-
`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile <https://datatracker.ietf.org/doc/rfc5280/>`_
2647+
:rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile <5280>`
26482648
D. Cooper
26492649

2650-
`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 <https://tools.ietf.org/html/rfc5246>`_
2650+
:rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 <5246>`
26512651
T. Dierks et. al.
26522652

2653-
`RFC 6066: Transport Layer Security (TLS) Extensions <https://tools.ietf.org/html/rfc6066>`_
2653+
:rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`
26542654
D. Eastlake
26552655

26562656
`IANA TLS: Transport Layer Security (TLS) Parameters <https://www.iana.org/assignments/tls-parameters/tls-parameters.xml>`_
26572657
IANA
26582658

2659-
`RFC 7525: Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS) <https://tools.ietf.org/html/rfc7525>`_
2659+
:rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS) <7525>`
26602660
IETF
26612661

26622662
`Mozilla's Server Side TLS recommendations <https://wiki.mozilla.org/Security/Server_Side_TLS>`_

Doc/library/stringprep.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ define which tables it uses, and what other optional parts of the ``stringprep``
2626
procedure are part of the profile. One example of a ``stringprep`` profile is
2727
``nameprep``, which is used for internationalized domain names.
2828

29-
The module :mod:`stringprep` only exposes the tables from RFC 3454. As these
29+
The module :mod:`stringprep` only exposes the tables from :rfc:`3454`. As these
3030
tables would be very large to represent them as dictionaries or lists, the
3131
module uses the Unicode character database internally. The module source code
3232
itself was generated using the ``mkstringprep.py`` utility.

Doc/library/urllib.error.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ The following exceptions are raised by :mod:`urllib.error` as appropriate:
4141

4242
.. attribute:: code
4343

44-
An HTTP status code as defined in `RFC 2616
45-
<http://www.faqs.org/rfcs/rfc2616.html>`_. This numeric value corresponds
44+
An HTTP status code as defined in :rfc:`2616`. This numeric value corresponds
4645
to a value found in the dictionary of codes as found in
4746
:attr:`http.server.BaseHTTPRequestHandler.responses`.
4847

Doc/library/urllib.parse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ task isn't already covered by the URL parsing functions above.
468468
*string* may be either a :class:`str` or a :class:`bytes`.
469469

470470
.. versionchanged:: 3.7
471-
Moved from RFC 2396 to RFC 3986 for quoting URL strings. "~" is now
471+
Moved from :rfc:`2396` to :rfc:`3986` for quoting URL strings. "~" is now
472472
included in the set of reserved characters.
473473

474474
The optional *encoding* and *errors* parameters specify how to deal with

Doc/library/urllib.request.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ The following classes are provided:
232232
containing the image.
233233

234234
*unverifiable* should indicate whether the request is unverifiable,
235-
as defined by RFC 2965. It defaults to ``False``. An unverifiable
235+
as defined by :rfc:`2965`. It defaults to ``False``. An unverifiable
236236
request is one whose URL the user did not have the option to
237237
approve. For example, if the request is for an image in an HTML
238238
document, and the user had no option to approve the automatic
@@ -504,7 +504,7 @@ request.
504504
.. attribute:: Request.unverifiable
505505

506506
boolean, indicates whether the request is unverifiable as defined
507-
by RFC 2965.
507+
by :rfc:`2965`.
508508

509509
.. attribute:: Request.method
510510

0 commit comments

Comments
 (0)