bpo-45173 Remove configparser deprecations (GH-28292)

In the configparser module, these have been deprecated since Python 3.2:

* the SafeConfigParser class,
* the filename property of the ParsingError class,
* the readfp method of the ConfigParser class,
This commit is contained in:
Hugo van Kemenade 2021-09-13 20:12:36 +03:00 committed by GitHub
parent 85dc53a463
commit 1fc41ae870
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 94 deletions

View file

@ -1200,28 +1200,6 @@ ConfigParser Objects
names is stripped before :meth:`optionxform` is called.
.. method:: readfp(fp, filename=None)
.. deprecated:: 3.2
Use :meth:`read_file` instead.
.. versionchanged:: 3.2
:meth:`readfp` now iterates on *fp* instead of calling ``fp.readline()``.
For existing code calling :meth:`readfp` with arguments which don't
support iteration, the following generator may be used as a wrapper
around the file-like object::
def readline_generator(fp):
line = fp.readline()
while line:
yield line
line = fp.readline()
Instead of ``parser.readfp(fp)`` use
``parser.read_file(readline_generator(fp))``.
.. data:: MAX_INTERPOLATION_DEPTH
The maximum depth for recursive interpolation for :meth:`get` when the *raw*
@ -1359,6 +1337,9 @@ Exceptions
The ``filename`` attribute and :meth:`__init__` argument were renamed to
``source`` for consistency.
.. versionchanged:: 3.11
The deprecated ``filename`` attribute was removed.
.. rubric:: Footnotes