as deprecated, its docstring is now corrected).
(Contributed by Hugo van Kemenade in :issue:`45837`.)
+* The following have been deprecated in :mod:`configparser` since Python 3.2.
+ Their deprecation warnings have now been updated to note they will removed in
+ Python 3.12:
+
+ * the :class:`configparser.SafeConfigParser` class
+ * the :attr:`configparser.ParsingError.filename` property
+ * the :meth:`configparser.ParsingError.readfp` method
+
+ (Contributed by Hugo van Kemenade in :issue:`45173`.)
+
Removed
=======
def filename(self):
"""Deprecated, use `source'."""
warnings.warn(
- "The 'filename' attribute will be removed in future versions. "
+ "The 'filename' attribute will be removed in Python 3.12. "
"Use 'source' instead.",
DeprecationWarning, stacklevel=2
)
def filename(self, value):
"""Deprecated, user `source'."""
warnings.warn(
- "The 'filename' attribute will be removed in future versions. "
+ "The 'filename' attribute will be removed in Python 3.12. "
"Use 'source' instead.",
DeprecationWarning, stacklevel=2
)
def readfp(self, fp, filename=None):
"""Deprecated, use read_file instead."""
warnings.warn(
- "This method will be removed in future versions. "
+ "This method will be removed in Python 3.12. "
"Use 'parser.read_file()' instead.",
DeprecationWarning, stacklevel=2
)
super().__init__(*args, **kwargs)
warnings.warn(
"The SafeConfigParser class has been renamed to ConfigParser "
- "in Python 3.2. This alias will be removed in future versions."
+ "in Python 3.2. This alias will be removed in Python 3.12."
" Use ConfigParser directly instead.",
DeprecationWarning, stacklevel=2
)