changeset: 73914:f82ebf9b3a52 user: Florent Xicluna date: Sat Dec 10 11:07:42 2011 +0100 files: 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 description: Issue #13248: turn 3.2's PendingDeprecationWarning into 3.3's DeprecationWarning (cgi, importlib, nntplib, smtpd). diff -r b7c5e30582d1 -r f82ebf9b3a52 Doc/library/nntplib.rst --- a/Doc/library/nntplib.rst Fri Dec 09 23:42:29 2011 +0100 +++ b/Doc/library/nntplib.rst Sat Dec 10 11:07:42 2011 +0100 @@ -517,6 +517,9 @@ 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: diff -r b7c5e30582d1 -r f82ebf9b3a52 Lib/cgi.py --- a/Lib/cgi.py Fri Dec 09 23:42:29 2011 +0100 +++ b/Lib/cgi.py Sat Dec 10 11:07:42 2011 +0100 @@ -1012,7 +1012,7 @@ 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("&", "&") # Must be done first! s = s.replace("<", "<") s = s.replace(">", ">") diff -r b7c5e30582d1 -r f82ebf9b3a52 Lib/importlib/abc.py --- a/Lib/importlib/abc.py Fri Dec 09 23:42:29 2011 +0100 +++ b/Lib/importlib/abc.py Sat Dec 10 11:07:42 2011 +0100 @@ -195,7 +195,7 @@ "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 @@ "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) diff -r b7c5e30582d1 -r f82ebf9b3a52 Lib/importlib/test/source/test_abc_loader.py --- a/Lib/importlib/test/source/test_abc_loader.py Fri Dec 09 23:42:29 2011 +0100 +++ b/Lib/importlib/test/source/test_abc_loader.py Sat Dec 10 11:07:42 2011 +0100 @@ -102,7 +102,7 @@ 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 @@ 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): diff -r b7c5e30582d1 -r f82ebf9b3a52 Lib/nntplib.py --- a/Lib/nntplib.py Fri Dec 09 23:42:29 2011 +0100 +++ b/Lib/nntplib.py Sat Dec 10 11:07:42 2011 +0100 @@ -828,7 +828,7 @@ - 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 @@ 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'): diff -r b7c5e30582d1 -r f82ebf9b3a52 Lib/smtpd.py --- a/Lib/smtpd.py Fri Dec 09 23:42:29 2011 +0100 +++ b/Lib/smtpd.py Sat Dec 10 11:07:42 2011 +0100 @@ -142,122 +142,122 @@ @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 diff -r b7c5e30582d1 -r f82ebf9b3a52 Lib/test/test_smtpd.py --- a/Lib/test/test_smtpd.py Fri Dec 09 23:42:29 2011 +0100 +++ b/Lib/test/test_smtpd.py Sat Dec 10 11:07:42 2011 +0100 @@ -239,49 +239,49 @@ 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(): diff -r b7c5e30582d1 -r f82ebf9b3a52 Misc/NEWS --- a/Misc/NEWS Fri Dec 09 23:42:29 2011 +0100 +++ b/Misc/NEWS Sat Dec 10 11:07:42 2011 +0100 @@ -406,6 +406,11 @@ 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.