]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #13248: turn 3.2's PendingDeprecationWarning into 3.3's DeprecationWarning...
authorFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 10 Dec 2011 10:07:42 +0000 (11:07 +0100)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 10 Dec 2011 10:07:42 +0000 (11:07 +0100)
Doc/library/nntplib.rst
Lib/cgi.py
Lib/importlib/abc.py
Lib/importlib/test/source/test_abc_loader.py
Lib/nntplib.py
Lib/smtpd.py
Lib/test/test_smtpd.py
Misc/NEWS

index 01294e821dcc4a16640fc2f2922c4d9725a491c5..62da72ce0d8acce62dc0ac6aa16b1f1dffeb4cc7 100644 (file)
@@ -517,6 +517,9 @@ them have been superseded by newer commands in :rfc:`3977`.
    article with message ID *id*.  Most of the time, this extension is not
    enabled by NNTP server administrators.
 
+   .. deprecated:: 3.3
+      The XPATH extension is not actively used.
+
 
 .. XXX deprecated:
 
index b3e32f1ba86879d7a0227c9a43505c4d4f0d18fe..e964f0c435c9e4efa02e435cae7f1d12dbd300e9 100755 (executable)
@@ -1012,7 +1012,7 @@ environment as well.  Here are some common variable names:
 def escape(s, quote=None):
     """Deprecated API."""
     warn("cgi.escape is deprecated, use html.escape instead",
-         PendingDeprecationWarning, stacklevel=2)
+         DeprecationWarning, stacklevel=2)
     s = s.replace("&", "&amp;") # Must be done first!
     s = s.replace("<", "&lt;")
     s = s.replace(">", "&gt;")
index fa343f85a47610cc897f0f01cf478b0dafc28f7b..df8cd93634428bf2d9607194fa5df2326083992d 100644 (file)
@@ -195,7 +195,7 @@ class PyLoader(SourceLoader):
                             "use SourceLoader instead. "
                             "See the importlib documentation on how to be "
                             "compatible with Python 3.1 onwards.",
-                        PendingDeprecationWarning)
+                        DeprecationWarning)
         path = self.source_path(fullname)
         if path is None:
             raise ImportError
@@ -234,7 +234,7 @@ class PyPycLoader(PyLoader):
                             "removal in Python 3.4; use SourceLoader instead. "
                             "If Python 3.1 compatibility is required, see the "
                             "latest documentation for PyLoader.",
-                        PendingDeprecationWarning)
+                        DeprecationWarning)
         source_timestamp = self.source_mtime(fullname)
         # Try to use bytecode if it is available.
         bytecode_path = self.bytecode_path(fullname)
index 32459074a070fecf7c85bcbce639ed304e31bb61..3c19b0b0d5fcc2fd1584b9ed90c0de068f09dcc7 100644 (file)
@@ -102,7 +102,7 @@ class PyLoaderMock(abc.PyLoader):
             warnings.simplefilter("always")
             path = super().get_filename(name)
             assert len(w) == 1
-            assert issubclass(w[0].category, PendingDeprecationWarning)
+            assert issubclass(w[0].category, DeprecationWarning)
             return path
 
 
@@ -198,7 +198,7 @@ class PyPycLoaderMock(abc.PyPycLoader, PyLoaderMock):
             warnings.simplefilter("always")
             code_object = super().get_code(name)
             assert len(w) == 1
-            assert issubclass(w[0].category, PendingDeprecationWarning)
+            assert issubclass(w[0].category, DeprecationWarning)
             return code_object
 
 class PyLoaderTests(testing_abc.LoaderTests):
index 3e863dc7400f93ad72248e9a45fc9d24b64c768e..19a462dd2977b12cb8866830b80825378c441f4a 100644 (file)
@@ -828,7 +828,7 @@ class _NNTPBase:
         - list: list of (name,title) strings"""
         warnings.warn("The XGTITLE extension is not actively used, "
                       "use descriptions() instead",
-                      PendingDeprecationWarning, 2)
+                      DeprecationWarning, 2)
         line_pat = re.compile('^([^ \t]+)[ \t]+(.*)$')
         resp, raw_lines = self._longcmdstring('XGTITLE ' + group, file)
         lines = []
@@ -846,7 +846,7 @@ class _NNTPBase:
         path: directory path to article
         """
         warnings.warn("The XPATH extension is not actively used",
-                      PendingDeprecationWarning, 2)
+                      DeprecationWarning, 2)
 
         resp = self._shortcmd('XPATH {0}'.format(id))
         if not resp.startswith('223'):
index df835b2163fb0632e2348d5c24f3b6ba57c20147..d66b0d74da779a20b1cab07884e75cbdcfd08ca0 100755 (executable)
@@ -142,122 +142,122 @@ class SMTPChannel(asynchat.async_chat):
     @property
     def __server(self):
         warn("Access to __server attribute on SMTPChannel is deprecated, "
-            "use 'smtp_server' instead", PendingDeprecationWarning, 2)
+            "use 'smtp_server' instead", DeprecationWarning, 2)
         return self.smtp_server
     @__server.setter
     def __server(self, value):
         warn("Setting __server attribute on SMTPChannel is deprecated, "
-            "set 'smtp_server' instead", PendingDeprecationWarning, 2)
+            "set 'smtp_server' instead", DeprecationWarning, 2)
         self.smtp_server = value
 
     @property
     def __line(self):
         warn("Access to __line attribute on SMTPChannel is deprecated, "
-            "use 'received_lines' instead", PendingDeprecationWarning, 2)
+            "use 'received_lines' instead", DeprecationWarning, 2)
         return self.received_lines
     @__line.setter
     def __line(self, value):
         warn("Setting __line attribute on SMTPChannel is deprecated, "
-            "set 'received_lines' instead", PendingDeprecationWarning, 2)
+            "set 'received_lines' instead", DeprecationWarning, 2)
         self.received_lines = value
 
     @property
     def __state(self):
         warn("Access to __state attribute on SMTPChannel is deprecated, "
-            "use 'smtp_state' instead", PendingDeprecationWarning, 2)
+            "use 'smtp_state' instead", DeprecationWarning, 2)
         return self.smtp_state
     @__state.setter
     def __state(self, value):
         warn("Setting __state attribute on SMTPChannel is deprecated, "
-            "set 'smtp_state' instead", PendingDeprecationWarning, 2)
+            "set 'smtp_state' instead", DeprecationWarning, 2)
         self.smtp_state = value
 
     @property
     def __greeting(self):
         warn("Access to __greeting attribute on SMTPChannel is deprecated, "
-            "use 'seen_greeting' instead", PendingDeprecationWarning, 2)
+            "use 'seen_greeting' instead", DeprecationWarning, 2)
         return self.seen_greeting
     @__greeting.setter
     def __greeting(self, value):
         warn("Setting __greeting attribute on SMTPChannel is deprecated, "
-            "set 'seen_greeting' instead", PendingDeprecationWarning, 2)
+            "set 'seen_greeting' instead", DeprecationWarning, 2)
         self.seen_greeting = value
 
     @property
     def __mailfrom(self):
         warn("Access to __mailfrom attribute on SMTPChannel is deprecated, "
-            "use 'mailfrom' instead", PendingDeprecationWarning, 2)
+            "use 'mailfrom' instead", DeprecationWarning, 2)
         return self.mailfrom
     @__mailfrom.setter
     def __mailfrom(self, value):
         warn("Setting __mailfrom attribute on SMTPChannel is deprecated, "
-            "set 'mailfrom' instead", PendingDeprecationWarning, 2)
+            "set 'mailfrom' instead", DeprecationWarning, 2)
         self.mailfrom = value
 
     @property
     def __rcpttos(self):
         warn("Access to __rcpttos attribute on SMTPChannel is deprecated, "
-            "use 'rcpttos' instead", PendingDeprecationWarning, 2)
+            "use 'rcpttos' instead", DeprecationWarning, 2)
         return self.rcpttos
     @__rcpttos.setter
     def __rcpttos(self, value):
         warn("Setting __rcpttos attribute on SMTPChannel is deprecated, "
-            "set 'rcpttos' instead", PendingDeprecationWarning, 2)
+            "set 'rcpttos' instead", DeprecationWarning, 2)
         self.rcpttos = value
 
     @property
     def __data(self):
         warn("Access to __data attribute on SMTPChannel is deprecated, "
-            "use 'received_data' instead", PendingDeprecationWarning, 2)
+            "use 'received_data' instead", DeprecationWarning, 2)
         return self.received_data
     @__data.setter
     def __data(self, value):
         warn("Setting __data attribute on SMTPChannel is deprecated, "
-            "set 'received_data' instead", PendingDeprecationWarning, 2)
+            "set 'received_data' instead", DeprecationWarning, 2)
         self.received_data = value
 
     @property
     def __fqdn(self):
         warn("Access to __fqdn attribute on SMTPChannel is deprecated, "
-            "use 'fqdn' instead", PendingDeprecationWarning, 2)
+            "use 'fqdn' instead", DeprecationWarning, 2)
         return self.fqdn
     @__fqdn.setter
     def __fqdn(self, value):
         warn("Setting __fqdn attribute on SMTPChannel is deprecated, "
-            "set 'fqdn' instead", PendingDeprecationWarning, 2)
+            "set 'fqdn' instead", DeprecationWarning, 2)
         self.fqdn = value
 
     @property
     def __peer(self):
         warn("Access to __peer attribute on SMTPChannel is deprecated, "
-            "use 'peer' instead", PendingDeprecationWarning, 2)
+            "use 'peer' instead", DeprecationWarning, 2)
         return self.peer
     @__peer.setter
     def __peer(self, value):
         warn("Setting __peer attribute on SMTPChannel is deprecated, "
-            "set 'peer' instead", PendingDeprecationWarning, 2)
+            "set 'peer' instead", DeprecationWarning, 2)
         self.peer = value
 
     @property
     def __conn(self):
         warn("Access to __conn attribute on SMTPChannel is deprecated, "
-            "use 'conn' instead", PendingDeprecationWarning, 2)
+            "use 'conn' instead", DeprecationWarning, 2)
         return self.conn
     @__conn.setter
     def __conn(self, value):
         warn("Setting __conn attribute on SMTPChannel is deprecated, "
-            "set 'conn' instead", PendingDeprecationWarning, 2)
+            "set 'conn' instead", DeprecationWarning, 2)
         self.conn = value
 
     @property
     def __addr(self):
         warn("Access to __addr attribute on SMTPChannel is deprecated, "
-            "use 'addr' instead", PendingDeprecationWarning, 2)
+            "use 'addr' instead", DeprecationWarning, 2)
         return self.addr
     @__addr.setter
     def __addr(self, value):
         warn("Setting __addr attribute on SMTPChannel is deprecated, "
-            "set 'addr' instead", PendingDeprecationWarning, 2)
+            "set 'addr' instead", DeprecationWarning, 2)
         self.addr = value
 
     # Overrides base class for convenience
index 68ccc29036af30860ca93058de794c4a369a51cf..dd235655e862c5da1b8fa93be633ada41f0d893d 100644 (file)
@@ -239,49 +239,49 @@ class SMTPDChannelTest(TestCase):
         self.assertEqual(self.channel.socket.last, b'501 Syntax: RSET\r\n')
 
     def test_attribute_deprecations(self):
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             spam = self.channel._SMTPChannel__server
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             self.channel._SMTPChannel__server = 'spam'
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             spam = self.channel._SMTPChannel__line
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             self.channel._SMTPChannel__line = 'spam'
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             spam = self.channel._SMTPChannel__state
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             self.channel._SMTPChannel__state = 'spam'
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             spam = self.channel._SMTPChannel__greeting
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             self.channel._SMTPChannel__greeting = 'spam'
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             spam = self.channel._SMTPChannel__mailfrom
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             self.channel._SMTPChannel__mailfrom = 'spam'
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             spam = self.channel._SMTPChannel__rcpttos
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             self.channel._SMTPChannel__rcpttos = 'spam'
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             spam = self.channel._SMTPChannel__data
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             self.channel._SMTPChannel__data = 'spam'
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             spam = self.channel._SMTPChannel__fqdn
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             self.channel._SMTPChannel__fqdn = 'spam'
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             spam = self.channel._SMTPChannel__peer
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             self.channel._SMTPChannel__peer = 'spam'
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             spam = self.channel._SMTPChannel__conn
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             self.channel._SMTPChannel__conn = 'spam'
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             spam = self.channel._SMTPChannel__addr
-        with support.check_warnings(('', PendingDeprecationWarning)):
+        with support.check_warnings(('', DeprecationWarning)):
             self.channel._SMTPChannel__addr = 'spam'
 
 def test_main():
index af756ee4c6871f2e849e869af31d401da2c0975f..58c281355b01cca70f18287b2bc688e2b059cd9e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -406,6 +406,11 @@ Core and Builtins
 Library
 -------
 
+- Issue #13248: Turn 3.2's PendingDeprecationWarning into 3.3's
+  DeprecationWarning.  It covers 'cgi.escape', 'importlib.abc.PyLoader',
+  'importlib.abc.PyPycLoader', 'nntplib.NNTP.xgtitle', 'nntplib.NNTP.xpath',
+  and private attributes of 'smtpd.SMTPChannel'.
+
 - Issue #5905: time.strftime() is now using the locale encoding, instead of
   UTF-8, if the wcsftime() function is not available.