Skip to content

Commit 5169113

Browse files
hugovkAlexWaygood
andauthored
[3.11] gh-101100: Fix Sphinx warnings in library/configparser.rst (GH-113598) (#113600)
(cherry picked from commit 30a6d79) Co-authored-by: Alex Waygood <[email protected]>
1 parent 0291212 commit 5169113

File tree

11 files changed

+33
-34
lines changed

11 files changed

+33
-34
lines changed

Doc/library/configparser.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ converters and customize the provided ones. [1]_
208208
Fallback Values
209209
---------------
210210

211-
As with a dictionary, you can use a section's :meth:`get` method to
211+
As with a dictionary, you can use a section's :meth:`~ConfigParser.get` method to
212212
provide fallback values:
213213

214214
.. doctest::
@@ -232,7 +232,7 @@ even if we specify a fallback:
232232
>>> topsecret.get('CompressionLevel', '3')
233233
'9'
234234

235-
One more thing to be aware of is that the parser-level :meth:`get` method
235+
One more thing to be aware of is that the parser-level :meth:`~ConfigParser.get` method
236236
provides a custom, more complex interface, maintained for backwards
237237
compatibility. When using this method, a fallback value can be provided via
238238
the ``fallback`` keyword-only argument:
@@ -481,7 +481,7 @@ historical background and it's very likely that you will want to customize some
481481
of the features.
482482

483483
The most common way to change the way a specific config parser works is to use
484-
the :meth:`__init__` options:
484+
the :meth:`!__init__` options:
485485

486486
* *defaults*, default value: ``None``
487487

@@ -491,7 +491,7 @@ the :meth:`__init__` options:
491491
the documented default.
492492

493493
Hint: if you want to specify default values for a specific section, use
494-
:meth:`read_dict` before you read the actual file.
494+
:meth:`~ConfigParser.read_dict` before you read the actual file.
495495

496496
* *dict_type*, default value: :class:`dict`
497497

@@ -635,8 +635,8 @@ the :meth:`__init__` options:
635635
* *strict*, default value: ``True``
636636

637637
When set to ``True``, the parser will not allow for any section or option
638-
duplicates while reading from a single source (using :meth:`read_file`,
639-
:meth:`read_string` or :meth:`read_dict`). It is recommended to use strict
638+
duplicates while reading from a single source (using :meth:`~ConfigParser.read_file`,
639+
:meth:`~ConfigParser.read_string` or :meth:`~ConfigParser.read_dict`). It is recommended to use strict
640640
parsers in new applications.
641641

642642
.. versionchanged:: 3.2
@@ -697,7 +697,7 @@ the :meth:`__init__` options:
697697
desirable, users may define them in a subclass or pass a dictionary where each
698698
key is a name of the converter and each value is a callable implementing said
699699
conversion. For instance, passing ``{'decimal': decimal.Decimal}`` would add
700-
:meth:`getdecimal` on both the parser object and all section proxies. In
700+
:meth:`!getdecimal` on both the parser object and all section proxies. In
701701
other words, it will be possible to write both
702702
``parser_instance.getdecimal('section', 'key', fallback=0)`` and
703703
``parser_instance['section'].getdecimal('key', 0)``.
@@ -1062,11 +1062,11 @@ ConfigParser Objects
10621062
yielding Unicode strings (for example files opened in text mode).
10631063

10641064
Optional argument *source* specifies the name of the file being read. If
1065-
not given and *f* has a :attr:`name` attribute, that is used for
1065+
not given and *f* has a :attr:`!name` attribute, that is used for
10661066
*source*; the default is ``'<???>'``.
10671067

10681068
.. versionadded:: 3.2
1069-
Replaces :meth:`readfp`.
1069+
Replaces :meth:`!readfp`.
10701070

10711071
.. method:: read_string(string, source='<string>')
10721072

@@ -1236,7 +1236,7 @@ ConfigParser Objects
12361236

12371237
.. data:: MAX_INTERPOLATION_DEPTH
12381238

1239-
The maximum depth for recursive interpolation for :meth:`get` when the *raw*
1239+
The maximum depth for recursive interpolation for :meth:`~configparser.ConfigParser.get` when the *raw*
12401240
parameter is false. This is relevant only when the default *interpolation*
12411241
is used.
12421242

@@ -1309,13 +1309,13 @@ Exceptions
13091309

13101310
.. exception:: DuplicateSectionError
13111311

1312-
Exception raised if :meth:`add_section` is called with the name of a section
1312+
Exception raised if :meth:`~ConfigParser.add_section` is called with the name of a section
13131313
that is already present or in strict parsers when a section if found more
13141314
than once in a single input file, string or dictionary.
13151315

13161316
.. versionadded:: 3.2
13171317
Optional ``source`` and ``lineno`` attributes and arguments to
1318-
:meth:`__init__` were added.
1318+
:meth:`!__init__` were added.
13191319

13201320

13211321
.. exception:: DuplicateOptionError
@@ -1368,7 +1368,7 @@ Exceptions
13681368
Exception raised when errors occur attempting to parse a file.
13691369

13701370
.. versionchanged:: 3.2
1371-
The ``filename`` attribute and :meth:`__init__` argument were renamed to
1371+
The ``filename`` attribute and :meth:`!__init__` argument were renamed to
13721372
``source`` for consistency.
13731373

13741374

Doc/library/logging.config.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ in :mod:`logging` itself) and defining handlers which are declared either in
9393

9494
:param fname: A filename, or a file-like object, or an instance derived
9595
from :class:`~configparser.RawConfigParser`. If a
96-
``RawConfigParser``-derived instance is passed, it is used as
97-
is. Otherwise, a :class:`~configparser.Configparser` is
96+
:class:`!RawConfigParser`-derived instance is passed, it is used as
97+
is. Otherwise, a :class:`~configparser.ConfigParser` is
9898
instantiated, and the configuration read by it from the
9999
object passed in ``fname``. If that has a :meth:`readline`
100100
method, it is assumed to be a file-like object and read using
@@ -103,7 +103,7 @@ in :mod:`logging` itself) and defining handlers which are declared either in
103103
:meth:`~configparser.ConfigParser.read`.
104104

105105

106-
:param defaults: Defaults to be passed to the ConfigParser can be specified
106+
:param defaults: Defaults to be passed to the :class:`!ConfigParser` can be specified
107107
in this argument.
108108

109109
:param disable_existing_loggers: If specified as ``False``, loggers which

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Doc/library/asyncio-task.rst
3333
Doc/library/bdb.rst
3434
Doc/library/collections.rst
3535
Doc/library/concurrent.futures.rst
36-
Doc/library/configparser.rst
3736
Doc/library/copy.rst
3837
Doc/library/csv.rst
3938
Doc/library/ctypes.rst

Doc/whatsnew/2.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ Module changes
10301030

10311031
Lots of improvements and bugfixes were made to Python's extensive standard
10321032
library; some of the affected modules include :mod:`readline`,
1033-
:mod:`ConfigParser`, :mod:`cgi`, :mod:`calendar`, :mod:`posix`, :mod:`readline`,
1033+
:mod:`ConfigParser <configparser>`, :mod:`cgi`, :mod:`calendar`, :mod:`posix`, :mod:`readline`,
10341034
:mod:`xmllib`, :mod:`aifc`, :mod:`chunk, wave`, :mod:`random`, :mod:`shelve`,
10351035
and :mod:`nntplib`. Consult the CVS logs for the exact patch-by-patch details.
10361036

Doc/whatsnew/2.4.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,9 +1052,9 @@ complete list of changes, or look through the CVS logs for all the details.
10521052
advantage of :class:`collections.deque` for improved performance. (Contributed
10531053
by Raymond Hettinger.)
10541054

1055-
* The :mod:`ConfigParser` classes have been enhanced slightly. The :meth:`read`
1055+
* The :mod:`ConfigParser <configparser>` classes have been enhanced slightly. The :meth:`~configparser.ConfigParser.read`
10561056
method now returns a list of the files that were successfully parsed, and the
1057-
:meth:`set` method raises :exc:`TypeError` if passed a *value* argument that
1057+
:meth:`~configparser.ConfigParser.set` method raises :exc:`TypeError` if passed a *value* argument that
10581058
isn't a string. (Contributed by John Belmonte and David Goodger.)
10591059

10601060
* The :mod:`curses` module now supports the ncurses extension

Doc/whatsnew/2.7.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ remains O(1).
287287
The standard library now supports use of ordered dictionaries in several
288288
modules.
289289

290-
* The :mod:`ConfigParser` module uses them by default, meaning that
290+
* The :mod:`ConfigParser <configparser>` module uses them by default, meaning that
291291
configuration files can now be read, modified, and then written back
292292
in their original order.
293293

@@ -1134,7 +1134,7 @@ changes, or look through the Subversion logs for all the details.
11341134
another type that isn't a :class:`Mapping`.
11351135
(Fixed by Daniel Stutzbach; :issue:`8729`.)
11361136

1137-
* Constructors for the parsing classes in the :mod:`ConfigParser` module now
1137+
* Constructors for the parsing classes in the :mod:`ConfigParser <configparser>` module now
11381138
take an *allow_no_value* parameter, defaulting to false; if true,
11391139
options without values will be allowed. For example::
11401140

Doc/whatsnew/3.11.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ Standard Library
17731773

17741774
* the :class:`!configparser.SafeConfigParser` class
17751775
* the :attr:`!configparser.ParsingError.filename` property
1776-
* the :meth:`configparser.RawConfigParser.readfp` method
1776+
* the :meth:`!configparser.RawConfigParser.readfp` method
17771777

17781778
(Contributed by Hugo van Kemenade in :issue:`45173`.)
17791779

Doc/whatsnew/3.2.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ PEP 391: Dictionary Based Configuration for Logging
183183

184184
The :mod:`logging` module provided two kinds of configuration, one style with
185185
function calls for each option or another style driven by an external file saved
186-
in a :mod:`ConfigParser` format. Those options did not provide the flexibility
186+
in a :mod:`configparser` format. Those options did not provide the flexibility
187187
to create configurations from JSON or YAML files, nor did they support
188188
incremental configuration, which is needed for specifying logger options from a
189189
command line.
@@ -2132,7 +2132,7 @@ configparser
21322132

21332133
The :mod:`configparser` module was modified to improve usability and
21342134
predictability of the default parser and its supported INI syntax. The old
2135-
:class:`ConfigParser` class was removed in favor of :class:`SafeConfigParser`
2135+
:class:`!ConfigParser` class was removed in favor of :class:`!SafeConfigParser`
21362136
which has in turn been renamed to :class:`~configparser.ConfigParser`. Support
21372137
for inline comments is now turned off by default and section or option
21382138
duplicates are not allowed in a single configuration source.
@@ -2412,7 +2412,7 @@ when one operand is much larger than the other (patch by Andress Bennetts in
24122412
(:issue:`1569291` by Alexander Belopolsky). The :class:`BaseHTTPRequestHandler`
24132413
has more efficient buffering (:issue:`3709` by Andrew Schaaf). The
24142414
:func:`operator.attrgetter` function has been sped-up (:issue:`10160` by
2415-
Christos Georgiou). And :class:`ConfigParser` loads multi-line arguments a bit
2415+
Christos Georgiou). And :class:`~configparser.ConfigParser` loads multi-line arguments a bit
24162416
faster (:issue:`7113` by Łukasz Langa).
24172417

24182418

@@ -2612,8 +2612,8 @@ This section lists previously described changes and other bugfixes that may
26122612
require changes to your code:
26132613

26142614
* The :mod:`configparser` module has a number of clean-ups. The major change is
2615-
to replace the old :class:`ConfigParser` class with long-standing preferred
2616-
alternative :class:`SafeConfigParser`. In addition there are a number of
2615+
to replace the old :class:`!ConfigParser` class with long-standing preferred
2616+
alternative :class:`!SafeConfigParser`. In addition there are a number of
26172617
smaller incompatibilities:
26182618

26192619
* The interpolation syntax is now validated on

Misc/NEWS.d/3.11.0a1.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,9 +1642,9 @@ interval specified with nanosecond precision.
16421642
.. nonce: UptGAn
16431643
.. section: Library
16441644
1645-
Remove from the :mod:`configparser` module: the :class:`SafeConfigParser`
1646-
class, the :attr:`filename` property of the :class:`ParsingError` class, the
1647-
:meth:`readfp` method of the :class:`ConfigParser` class, deprecated since
1645+
Remove from the :mod:`configparser` module: the :class:`!SafeConfigParser`
1646+
class, the :attr:`!filename` property of the :class:`~configparser.ParsingError` class, the
1647+
:meth:`!readfp` method of the :class:`~configparser.ConfigParser` class, deprecated since
16481648
Python 3.2.
16491649

16501650
Patch by Hugo van Kemenade.

Misc/NEWS.d/3.11.0a6.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ uvloop library.
941941
942942
Make the :class:`configparser.ConfigParser` constructor raise
943943
:exc:`TypeError` if the ``interpolation`` parameter is not of type
944-
:class:`configparser.Interpolation`
944+
:class:`!configparser.Interpolation`
945945

946946
..
947947

Misc/NEWS.d/3.8.0a1.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5044,8 +5044,8 @@ functionality.
50445044
.. nonce: C_K-J9
50455045
.. section: Library
50465046
5047-
`ConfigParser.items()` was fixed so that key-value pairs passed in via
5048-
`vars` are not included in the resulting output.
5047+
``ConfigParser.items()`` was fixed so that key-value pairs passed in via
5048+
:func:`vars` are not included in the resulting output.
50495049

50505050
..
50515051

0 commit comments

Comments
 (0)