Skip to content

Commit 848c867

Browse files
hugovkAlexWaygood
andauthored
pythongh-101100: Fix Sphinx warnings from PEP 3108 stdlib re-organisation (python#114327)
* Fix Sphinx warnings from PEP 3108 stdblib re-organisation * Apply suggestions from code review Co-authored-by: Alex Waygood <[email protected]> * Update Doc/whatsnew/2.2.rst Co-authored-by: Alex Waygood <[email protected]> * Apply suggestions from code review Co-authored-by: Alex Waygood <[email protected]> --------- Co-authored-by: Alex Waygood <[email protected]>
1 parent 80734a6 commit 848c867

File tree

8 files changed

+90
-90
lines changed

8 files changed

+90
-90
lines changed

Doc/whatsnew/2.0.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -1039,12 +1039,12 @@ is an implementation of the Secure Socket Layer, which encrypts the data being
10391039
sent over a socket. When compiling Python, you can edit :file:`Modules/Setup`
10401040
to include SSL support, which adds an additional function to the :mod:`socket`
10411041
module: ``socket.ssl(socket, keyfile, certfile)``, which takes a socket
1042-
object and returns an SSL socket. The :mod:`httplib` and :mod:`urllib` modules
1042+
object and returns an SSL socket. The :mod:`httplib <http>` and :mod:`urllib` modules
10431043
were also changed to support ``https://`` URLs, though no one has implemented
10441044
FTP or SMTP over SSL.
10451045

1046-
The :mod:`httplib` module has been rewritten by Greg Stein to support HTTP/1.1.
1047-
Backward compatibility with the 1.5 version of :mod:`httplib` is provided,
1046+
The :mod:`httplib <http>` module has been rewritten by Greg Stein to support HTTP/1.1.
1047+
Backward compatibility with the 1.5 version of :mod:`!httplib` is provided,
10481048
though using HTTP/1.1 features such as pipelining will require rewriting code to
10491049
use a different set of interfaces.
10501050

@@ -1108,7 +1108,7 @@ module.
11081108
* :mod:`pyexpat`: An interface to the Expat XML parser. (Contributed by Paul
11091109
Prescod.)
11101110

1111-
* :mod:`robotparser`: Parse a :file:`robots.txt` file, which is used for writing
1111+
* :mod:`robotparser <urllib.robotparser>`: Parse a :file:`robots.txt` file, which is used for writing
11121112
web spiders that politely avoid certain areas of a web site. The parser accepts
11131113
the contents of a :file:`robots.txt` file, builds a set of rules from it, and
11141114
can then answer questions about the fetchability of a given URL. (Contributed
@@ -1129,10 +1129,10 @@ module.
11291129
:file:`Tools/idle/BrowserControl.py`, and adapted for the standard library by
11301130
Fred.)
11311131

1132-
* :mod:`_winreg`: An interface to the Windows registry. :mod:`_winreg` is an
1132+
* :mod:`_winreg <winreg>`: An interface to the Windows registry. :mod:`!_winreg` is an
11331133
adaptation of functions that have been part of PythonWin since 1995, but has now
11341134
been added to the core distribution, and enhanced to support Unicode.
1135-
:mod:`_winreg` was written by Bill Tutt and Mark Hammond.
1135+
:mod:`!_winreg` was written by Bill Tutt and Mark Hammond.
11361136

11371137
* :mod:`zipfile`: A module for reading and writing ZIP-format archives. These
11381138
are archives produced by :program:`PKZIP` on DOS/Windows or :program:`zip` on

Doc/whatsnew/2.2.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ implemented in C. In particular, it's not possible to subclass built-in types,
5555
so you can't just subclass, say, lists in order to add a single useful method to
5656
them. The :mod:`!UserList` module provides a class that supports all of the
5757
methods of lists and that can be subclassed further, but there's lots of C code
58-
that expects a regular Python list and won't accept a :class:`!UserList`
58+
that expects a regular Python list and won't accept a :class:`~collections.UserList`
5959
instance.
6060

6161
Python 2.2 fixes this, and in the process adds some exciting new capabilities.
@@ -69,7 +69,7 @@ A brief summary:
6969

7070
* It's also possible to automatically call methods on accessing or setting an
7171
instance attribute by using a new mechanism called :dfn:`properties`. Many uses
72-
of :meth:`!__getattr__` can be rewritten to use properties instead, making the
72+
of :meth:`~object.__getattr__` can be rewritten to use properties instead, making the
7373
resulting code simpler and faster. As a small side benefit, attributes can now
7474
have docstrings, too.
7575

@@ -933,7 +933,7 @@ anyway).
933933
New and Improved Modules
934934
========================
935935

936-
* The :mod:`!xmlrpclib` module was contributed to the standard library by Fredrik
936+
* The :mod:`xmlrpclib <xmlrpc.client>` module was contributed to the standard library by Fredrik
937937
Lundh, providing support for writing XML-RPC clients. XML-RPC is a simple
938938
remote procedure call protocol built on top of HTTP and XML. For example, the
939939
following snippet retrieves a list of RSS channels from the O'Reilly Network,
@@ -956,15 +956,15 @@ New and Improved Modules
956956
# 'description': 'A utility which converts HTML to XSL FO.',
957957
# 'title': 'html2fo 0.3 (Default)'}, ... ]
958958

959-
The :mod:`!SimpleXMLRPCServer` module makes it easy to create straightforward
959+
The :mod:`SimpleXMLRPCServer <xmlrpc.server>` module makes it easy to create straightforward
960960
XML-RPC servers. See http://xmlrpc.scripting.com/ for more information about XML-RPC.
961961

962962
* The new :mod:`hmac` module implements the HMAC algorithm described by
963963
:rfc:`2104`. (Contributed by Gerhard Häring.)
964964

965965
* Several functions that originally returned lengthy tuples now return
966966
pseudo-sequences that still behave like tuples but also have mnemonic attributes such
967-
as :attr:`!memberst_mtime` or :attr:`!tm_year`. The enhanced functions include
967+
as :attr:`!memberst_mtime` or :attr:`~time.struct_time.tm_year`. The enhanced functions include
968968
:func:`~os.stat`, :func:`~os.fstat`, :func:`~os.statvfs`, and :func:`~os.fstatvfs` in the
969969
:mod:`os` module, and :func:`~time.localtime`, :func:`~time.gmtime`, and :func:`~time.strptime` in
970970
the :mod:`time` module.

Doc/whatsnew/2.4.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ complete list of changes, or look through the CVS logs for all the details.
10811081
:func:`nsmallest` that use heaps to find the N largest or smallest values in a
10821082
dataset without the expense of a full sort. (Contributed by Raymond Hettinger.)
10831083

1084-
* The :mod:`httplib` module now contains constants for HTTP status codes defined
1084+
* The :mod:`httplib <http>` module now contains constants for HTTP status codes defined
10851085
in various HTTP-related RFC documents. Constants have names such as
10861086
:const:`OK`, :const:`CREATED`, :const:`CONTINUE`, and
10871087
:const:`MOVED_PERMANENTLY`; use pydoc to get a full list. (Contributed by
@@ -1218,10 +1218,10 @@ complete list of changes, or look through the CVS logs for all the details.
12181218
now include the string ``'%default'``, which will be replaced by the option's
12191219
default value. (Contributed by Greg Ward.)
12201220

1221-
* The long-term plan is to deprecate the :mod:`rfc822` module in some future
1221+
* The long-term plan is to deprecate the :mod:`!rfc822` module in some future
12221222
Python release in favor of the :mod:`email` package. To this end, the
1223-
:func:`email.Utils.formatdate` function has been changed to make it usable as a
1224-
replacement for :func:`rfc822.formatdate`. You may want to write new e-mail
1223+
:func:`email.Utils.formatdate <email.utils.formatdate>` function has been changed to make it usable as a
1224+
replacement for :func:`!rfc822.formatdate`. You may want to write new e-mail
12251225
processing code with this in mind. (Change implemented by Anthony Baxter.)
12261226

12271227
* A new ``urandom(n)`` function was added to the :mod:`os` module, returning
@@ -1308,7 +1308,7 @@ complete list of changes, or look through the CVS logs for all the details.
13081308
sockets, and regular expression pattern objects. (Contributed by Raymond
13091309
Hettinger.)
13101310

1311-
* The :mod:`xmlrpclib` module now supports a multi-call extension for
1311+
* The :mod:`xmlrpclib <xmlrpc.client>` module now supports a multi-call extension for
13121312
transmitting multiple XML-RPC calls in a single HTTP operation. (Contributed by
13131313
Brian Quinlan.)
13141314

@@ -1323,8 +1323,8 @@ complete list of changes, or look through the CVS logs for all the details.
13231323
cookielib
13241324
---------
13251325

1326-
The :mod:`cookielib` library supports client-side handling for HTTP cookies,
1327-
mirroring the :mod:`Cookie` module's server-side cookie support. Cookies are
1326+
The :mod:`cookielib <http.cookiejar>` library supports client-side handling for HTTP cookies,
1327+
mirroring the :mod:`Cookie <http.cookies>` module's server-side cookie support. Cookies are
13281328
stored in cookie jars; the library transparently stores cookies offered by the
13291329
web server in the cookie jar, and fetches the cookie from the jar when
13301330
connecting to the server. As in web browsers, policy objects control whether
@@ -1335,7 +1335,7 @@ are provided: one that stores cookies in the Netscape format so applications can
13351335
use the Mozilla or Lynx cookie files, and one that stores cookies in the same
13361336
format as the Perl libwww library.
13371337

1338-
:mod:`urllib2` has been changed to interact with :mod:`cookielib`:
1338+
:mod:`urllib2 <urllib.request>` has been changed to interact with :mod:`cookielib <http.cookiejar>`:
13391339
:class:`HTTPCookieProcessor` manages a cookie jar that is used when accessing
13401340
URLs.
13411341

Doc/whatsnew/2.5.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -1478,8 +1478,8 @@ complete list of changes, or look through the SVN logs for all the details.
14781478

14791479
.. Patch 790710
14801480
1481-
* The :mod:`pickle` and :mod:`cPickle` modules no longer accept a return value
1482-
of ``None`` from the :meth:`__reduce__` method; the method must return a tuple
1481+
* The :mod:`pickle` and :mod:`!cPickle` modules no longer accept a return value
1482+
of ``None`` from the :meth:`~object.__reduce__` method; the method must return a tuple
14831483
of arguments instead. The ability to return ``None`` was deprecated in Python
14841484
2.4, so this completes the removal of the feature.
14851485

@@ -1519,7 +1519,7 @@ complete list of changes, or look through the SVN logs for all the details.
15191519

15201520
.. Patch #1472854
15211521
1522-
* The :mod:`SimpleXMLRPCServer` and :mod:`DocXMLRPCServer` classes now have a
1522+
* The :mod:`SimpleXMLRPCServer <xmlrpc.server>` and :mod:`DocXMLRPCServer <xmlrpc.server>` classes now have a
15231523
:attr:`rpc_paths` attribute that constrains XML-RPC operations to a limited set
15241524
of URL paths; the default is to allow only ``'/'`` and ``'/RPC2'``. Setting
15251525
:attr:`rpc_paths` to ``None`` or an empty tuple disables this path checking.
@@ -1650,9 +1650,9 @@ complete list of changes, or look through the SVN logs for all the details.
16501650

16511651
.. Patch #754022
16521652
1653-
* The :mod:`xmlrpclib` module now supports returning :class:`~datetime.datetime` objects
1654-
for the XML-RPC date type. Supply ``use_datetime=True`` to the :func:`loads`
1655-
function or the :class:`Unmarshaller` class to enable this feature. (Contributed
1653+
* The :mod:`xmlrpclib <xmlrpc.client>` module now supports returning :class:`~datetime.datetime` objects
1654+
for the XML-RPC date type. Supply ``use_datetime=True`` to the :func:`~xmlrpc.client.loads`
1655+
function or the :class:`!Unmarshaller` class to enable this feature. (Contributed
16561656
by Skip Montanaro.)
16571657

16581658
.. Patch 1120353
@@ -2253,12 +2253,12 @@ code:
22532253
appeared. In Python 2.5, the argument must be exactly one %char specifier with
22542254
no surrounding text.
22552255

2256-
* Library: The :mod:`pickle` and :mod:`cPickle` modules no longer accept a
2257-
return value of ``None`` from the :meth:`__reduce__` method; the method must
2256+
* Library: The :mod:`pickle` and :mod:`!cPickle` modules no longer accept a
2257+
return value of ``None`` from the :meth:`~object.__reduce__` method; the method must
22582258
return a tuple of arguments instead. The modules also no longer accept the
22592259
deprecated *bin* keyword parameter.
22602260

2261-
* Library: The :mod:`SimpleXMLRPCServer` and :mod:`DocXMLRPCServer` classes now
2261+
* Library: The :mod:`SimpleXMLRPCServer <xmlrpc.server>` and :mod:`DocXMLRPCServer <xmlrpc.server>` classes now
22622262
have a :attr:`rpc_paths` attribute that constrains XML-RPC operations to a
22632263
limited set of URL paths; the default is to allow only ``'/'`` and ``'/RPC2'``.
22642264
Setting :attr:`rpc_paths` to ``None`` or an empty tuple disables this path

Doc/whatsnew/2.6.rst

+21-21
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ the :mod:`io` module:
10821082

10831083
(In Python 2.6, :class:`io.StringIO` is implemented in
10841084
pure Python, so it's pretty slow. You should therefore stick with the
1085-
existing :mod:`StringIO` module or :mod:`cStringIO` for now. At some
1085+
existing :mod:`!StringIO` module or :mod:`!cStringIO` for now. At some
10861086
point Python 3.0's :mod:`io` module will be rewritten into C for speed,
10871087
and perhaps the C implementation will be backported to the 2.x releases.)
10881088

@@ -1807,7 +1807,7 @@ changes, or look through the Subversion logs for all the details.
18071807
Nubis; :issue:`1817`.)
18081808

18091809
The :func:`parse_qs` and :func:`parse_qsl` functions have been
1810-
relocated from the :mod:`!cgi` module to the :mod:`urlparse` module.
1810+
relocated from the :mod:`!cgi` module to the :mod:`urlparse <urllib.parse>` module.
18111811
The versions still available in the :mod:`!cgi` module will
18121812
trigger :exc:`PendingDeprecationWarning` messages in 2.6
18131813
(:issue:`600362`).
@@ -1895,8 +1895,8 @@ changes, or look through the Subversion logs for all the details.
18951895

18961896
(Contributed by Raymond Hettinger.)
18971897

1898-
* The :mod:`Cookie` module's :class:`Morsel` objects now support an
1899-
:attr:`httponly` attribute. In some browsers. cookies with this attribute
1898+
* The :mod:`Cookie <http.cookies>` module's :class:`~http.cookies.Morsel` objects now support an
1899+
:attr:`~http.cookies.Morsel.httponly` attribute. In some browsers. cookies with this attribute
19001900
set cannot be accessed or manipulated by JavaScript code.
19011901
(Contributed by Arvin Schnell; :issue:`1638033`.)
19021902

@@ -1987,8 +1987,8 @@ changes, or look through the Subversion logs for all the details.
19871987
(Contributed by Raymond Hettinger.)
19881988

19891989
* An optional ``timeout`` parameter, specifying a timeout measured in
1990-
seconds, was added to the :class:`httplib.HTTPConnection` and
1991-
:class:`HTTPSConnection` class constructors. (Added by Facundo
1990+
seconds, was added to the :class:`httplib.HTTPConnection <http.client.HTTPConnection>` and
1991+
:class:`HTTPSConnection <http.client.HTTPSConnection>` class constructors. (Added by Facundo
19921992
Batista.)
19931993

19941994
* Most of the :mod:`inspect` module's functions, such as
@@ -2371,10 +2371,10 @@ changes, or look through the Subversion logs for all the details.
23712371
``socket(socket.AF_INET, ...)`` may be all that's required to make
23722372
your code work with IPv6.
23732373

2374-
* The base classes in the :mod:`SocketServer` module now support
2375-
calling a :meth:`handle_timeout` method after a span of inactivity
2376-
specified by the server's :attr:`timeout` attribute. (Contributed
2377-
by Michael Pomraning.) The :meth:`serve_forever` method
2374+
* The base classes in the :mod:`SocketServer <socketserver>` module now support
2375+
calling a :meth:`~socketserver.BaseServer.handle_timeout` method after a span of inactivity
2376+
specified by the server's :attr:`~socketserver.BaseServer.timeout` attribute. (Contributed
2377+
by Michael Pomraning.) The :meth:`~socketserver.BaseServer.serve_forever` method
23782378
now takes an optional poll interval measured in seconds,
23792379
controlling how often the server will check for a shutdown request.
23802380
(Contributed by Pedro Werneck and Jeffrey Yasskin;
@@ -2478,9 +2478,9 @@ changes, or look through the Subversion logs for all the details.
24782478
``with tempfile.NamedTemporaryFile() as tmp: ...``.
24792479
(Contributed by Alexander Belopolsky; :issue:`2021`.)
24802480

2481-
* The :mod:`test.test_support` module gained a number
2481+
* The :mod:`test.test_support <test.support>` module gained a number
24822482
of context managers useful for writing tests.
2483-
:func:`EnvironmentVarGuard` is a
2483+
:func:`~test.support.os_helper.EnvironmentVarGuard` is a
24842484
context manager that temporarily changes environment variables and
24852485
automatically restores them to their old values.
24862486

@@ -2577,9 +2577,9 @@ changes, or look through the Subversion logs for all the details.
25772577
(:issue:`1513695`)
25782578

25792579
* An optional ``timeout`` parameter was added to the
2580-
:func:`urllib.urlopen` function and the
2580+
:func:`urllib.urlopen <urllib.request.urlopen>` function and the
25812581
:class:`urllib.ftpwrapper` class constructor, as well as the
2582-
:func:`urllib2.urlopen` function. The parameter specifies a timeout
2582+
:func:`urllib2.urlopen <urllib.request.urlopen>` function. The parameter specifies a timeout
25832583
measured in seconds. For example::
25842584

25852585
>>> u = urllib2.urlopen("http://slow.example.com",
@@ -2604,7 +2604,7 @@ changes, or look through the Subversion logs for all the details.
26042604
intended for testing purposes that lets you temporarily modify the
26052605
warning filters and then restore their original values (:issue:`3781`).
26062606

2607-
* The XML-RPC :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer`
2607+
* The XML-RPC :class:`SimpleXMLRPCServer <xmlrpc.server>` and :class:`DocXMLRPCServer <xmlrpc.server>`
26082608
classes can now be prevented from immediately opening and binding to
26092609
their socket by passing ``False`` as the *bind_and_activate*
26102610
constructor parameter. This can be used to modify the instance's
@@ -2621,11 +2621,11 @@ changes, or look through the Subversion logs for all the details.
26212621
information. (Contributed by Alan McIntyre as part of his
26222622
project for Google's Summer of Code 2007.)
26232623

2624-
* The :mod:`xmlrpclib` module no longer automatically converts
2624+
* The :mod:`xmlrpclib <xmlrpc.client>` module no longer automatically converts
26252625
:class:`datetime.date` and :class:`datetime.time` to the
2626-
:class:`xmlrpclib.DateTime` type; the conversion semantics were
2626+
:class:`xmlrpclib.DateTime <xmlrpc.client.DateTime>` type; the conversion semantics were
26272627
not necessarily correct for all applications. Code using
2628-
:mod:`xmlrpclib` should convert :class:`date` and :class:`~datetime.time`
2628+
:mod:`!xmlrpclib` should convert :class:`date` and :class:`~datetime.time`
26292629
instances. (:issue:`1330538`) The code can also handle
26302630
dates before 1900 (contributed by Ralf Schmitt; :issue:`2014`)
26312631
and 64-bit integers represented by using ``<i8>`` in XML-RPC responses
@@ -3274,11 +3274,11 @@ that may require changes to your code:
32743274
:exc:`StandardError` but now it is, through :exc:`IOError`.
32753275
(Implemented by Gregory P. Smith; :issue:`1706815`.)
32763276

3277-
* The :mod:`xmlrpclib` module no longer automatically converts
3277+
* The :mod:`xmlrpclib <xmlrpc.client>` module no longer automatically converts
32783278
:class:`datetime.date` and :class:`datetime.time` to the
3279-
:class:`xmlrpclib.DateTime` type; the conversion semantics were
3279+
:class:`xmlrpclib.DateTime <xmlrpc.client.DateTime>` type; the conversion semantics were
32803280
not necessarily correct for all applications. Code using
3281-
:mod:`xmlrpclib` should convert :class:`date` and :class:`~datetime.time`
3281+
:mod:`!xmlrpclib` should convert :class:`date` and :class:`~datetime.time`
32823282
instances. (:issue:`1330538`)
32833283

32843284
* (3.0-warning mode) The :class:`Exception` class now warns

0 commit comments

Comments
 (0)