Skip to content

Commit b06e9ba

Browse files
committed
bpo-45173: Note these configparser deprecations will be removed in 3.12
1 parent ebfa178 commit b06e9ba

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

Doc/whatsnew/3.11.rst

+10
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,16 @@ Deprecated
457457
as deprecated, its docstring is now corrected).
458458
(Contributed by Hugo van Kemenade in :issue:`45837`.)
459459

460+
* The following have been deprecated in :mod:`configparser` since Python 3.2.
461+
Their deprecation warnings have now been updated to note they will removed in
462+
Python 3.12:
463+
464+
* the :class:`configparser.SafeConfigParser` class
465+
* the :attr:`configparser.ParsingError.filename` property
466+
* the :meth:`configparser.ParsingError.readfp` method
467+
468+
(Contributed by Hugo van Kemenade in :issue:`45173`.)
469+
460470
Removed
461471
=======
462472

Lib/configparser.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def __init__(self, source=None, filename=None):
316316
def filename(self):
317317
"""Deprecated, use `source'."""
318318
warnings.warn(
319-
"The 'filename' attribute will be removed in future versions. "
319+
"The 'filename' attribute will be removed in Python 3.12. "
320320
"Use 'source' instead.",
321321
DeprecationWarning, stacklevel=2
322322
)
@@ -326,7 +326,7 @@ def filename(self):
326326
def filename(self, value):
327327
"""Deprecated, user `source'."""
328328
warnings.warn(
329-
"The 'filename' attribute will be removed in future versions. "
329+
"The 'filename' attribute will be removed in Python 3.12. "
330330
"Use 'source' instead.",
331331
DeprecationWarning, stacklevel=2
332332
)
@@ -757,7 +757,7 @@ def read_dict(self, dictionary, source='<dict>'):
757757
def readfp(self, fp, filename=None):
758758
"""Deprecated, use read_file instead."""
759759
warnings.warn(
760-
"This method will be removed in future versions. "
760+
"This method will be removed in Python 3.12. "
761761
"Use 'parser.read_file()' instead.",
762762
DeprecationWarning, stacklevel=2
763763
)
@@ -1232,7 +1232,7 @@ def __init__(self, *args, **kwargs):
12321232
super().__init__(*args, **kwargs)
12331233
warnings.warn(
12341234
"The SafeConfigParser class has been renamed to ConfigParser "
1235-
"in Python 3.2. This alias will be removed in future versions."
1235+
"in Python 3.2. This alias will be removed in Python 3.12."
12361236
" Use ConfigParser directly instead.",
12371237
DeprecationWarning, stacklevel=2
12381238
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Note the configparser deprecations will be removed in Python 3.12.

0 commit comments

Comments
 (0)