]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45173: Note these configparser deprecations will be removed in 3.12 30952/head
authorHugo van Kemenade <hugovk@users.noreply.github.com>
Thu, 27 Jan 2022 07:16:40 +0000 (09:16 +0200)
committerHugo van Kemenade <hugovk@users.noreply.github.com>
Thu, 27 Jan 2022 09:17:16 +0000 (11:17 +0200)
Doc/whatsnew/3.11.rst
Lib/configparser.py
Misc/NEWS.d/next/Library/2022-01-27-11-16-59.bpo-45173.wreRF2.rst [new file with mode: 0644]

index 03cc3f4d22c4102ddb29e2bf865d928e085c6867..e0cba0e988b6307d299e667e43bb30b0cbf73f63 100644 (file)
@@ -457,6 +457,16 @@ Deprecated
   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
 =======
 
index 042a5c74b696fbc7533c957277a5f75c7b45d06a..3470624e63f61bbd3071fc21b394d008a63199bc 100644 (file)
@@ -316,7 +316,7 @@ class ParsingError(Error):
     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
         )
@@ -326,7 +326,7 @@ class ParsingError(Error):
     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
         )
@@ -757,7 +757,7 @@ class RawConfigParser(MutableMapping):
     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
         )
@@ -1232,7 +1232,7 @@ class SafeConfigParser(ConfigParser):
         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
         )
diff --git a/Misc/NEWS.d/next/Library/2022-01-27-11-16-59.bpo-45173.wreRF2.rst b/Misc/NEWS.d/next/Library/2022-01-27-11-16-59.bpo-45173.wreRF2.rst
new file mode 100644 (file)
index 0000000..ee5a88f
--- /dev/null
@@ -0,0 +1 @@
+Note the configparser deprecations will be removed in Python 3.12.