Skip to content

Commit 0a36ac1

Browse files
bpo-33641: Convert RFC references into links. (pythonGH-7103)
85% of them are already links.
1 parent a5c4228 commit 0a36ac1

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()

0 commit comments

Comments
 (0)