mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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:
parent
85dc53a463
commit
1fc41ae870
5 changed files with 18 additions and 94 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue