diff -r c43362d35d8d Doc/library/smtpd.rst --- a/Doc/library/smtpd.rst Fri Jul 04 17:00:25 2014 -0700 +++ b/Doc/library/smtpd.rst Wed Jul 30 01:23:56 2014 +0200 @@ -218,3 +218,6 @@ VRFY Returns code 252 (the server doesn't know if the address is valid) EXPN Reports that the command is not implemented. ======== =================================================================== + + .. versionchanged:: 3.5 + Deprecated properties were removed. diff -r c43362d35d8d Doc/whatsnew/3.5.rst --- a/Doc/whatsnew/3.5.rst Fri Jul 04 17:00:25 2014 -0700 +++ b/Doc/whatsnew/3.5.rst Wed Jul 30 01:23:56 2014 +0200 @@ -338,6 +338,8 @@ attribute, the qualified name, which is now used for the representation of a generator (``repr(gen)``). See :issue:`21205`. +* Previously deprecated properties of :class:`smtpd.SMTPChannel` got removed. + Changes in the C API -------------------- diff -r c43362d35d8d Lib/smtpd.py --- a/Lib/smtpd.py Fri Jul 04 17:00:25 2014 -0700 +++ b/Lib/smtpd.py Wed Jul 30 01:23:56 2014 +0200 @@ -165,128 +165,6 @@ self.set_terminator(b'\r\n') self.extended_smtp = False - # properties for backwards-compatibility - @property - def __server(self): - warn("Access to __server attribute on SMTPChannel is deprecated, " - "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", DeprecationWarning, 2) - self.smtp_server = value - - @property - def __line(self): - warn("Access to __line attribute on SMTPChannel is deprecated, " - "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", DeprecationWarning, 2) - self.received_lines = value - - @property - def __state(self): - warn("Access to __state attribute on SMTPChannel is deprecated, " - "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", DeprecationWarning, 2) - self.smtp_state = value - - @property - def __greeting(self): - warn("Access to __greeting attribute on SMTPChannel is deprecated, " - "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", DeprecationWarning, 2) - self.seen_greeting = value - - @property - def __mailfrom(self): - warn("Access to __mailfrom attribute on SMTPChannel is deprecated, " - "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", DeprecationWarning, 2) - self.mailfrom = value - - @property - def __rcpttos(self): - warn("Access to __rcpttos attribute on SMTPChannel is deprecated, " - "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", DeprecationWarning, 2) - self.rcpttos = value - - @property - def __data(self): - warn("Access to __data attribute on SMTPChannel is deprecated, " - "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", DeprecationWarning, 2) - self.received_data = value - - @property - def __fqdn(self): - warn("Access to __fqdn attribute on SMTPChannel is deprecated, " - "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", DeprecationWarning, 2) - self.fqdn = value - - @property - def __peer(self): - warn("Access to __peer attribute on SMTPChannel is deprecated, " - "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", DeprecationWarning, 2) - self.peer = value - - @property - def __conn(self): - warn("Access to __conn attribute on SMTPChannel is deprecated, " - "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", DeprecationWarning, 2) - self.conn = value - - @property - def __addr(self): - warn("Access to __addr attribute on SMTPChannel is deprecated, " - "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", DeprecationWarning, 2) - self.addr = value - # Overrides base class for convenience def push(self, msg): asynchat.async_chat.push(self, bytes(msg + '\r\n', 'ascii')) diff -r c43362d35d8d Lib/test/test_smtpd.py --- a/Lib/test/test_smtpd.py Fri Jul 04 17:00:25 2014 -0700 +++ b/Lib/test/test_smtpd.py Wed Jul 30 01:23:56 2014 +0200 @@ -489,52 +489,6 @@ b'500 Error: command "UNKNOWN_CMD" not ' + \ b'recognized\r\n') - def test_attribute_deprecations(self): - with support.check_warnings(('', DeprecationWarning)): - spam = self.channel._SMTPChannel__server - with support.check_warnings(('', DeprecationWarning)): - self.channel._SMTPChannel__server = 'spam' - with support.check_warnings(('', DeprecationWarning)): - spam = self.channel._SMTPChannel__line - with support.check_warnings(('', DeprecationWarning)): - self.channel._SMTPChannel__line = 'spam' - with support.check_warnings(('', DeprecationWarning)): - spam = self.channel._SMTPChannel__state - with support.check_warnings(('', DeprecationWarning)): - self.channel._SMTPChannel__state = 'spam' - with support.check_warnings(('', DeprecationWarning)): - spam = self.channel._SMTPChannel__greeting - with support.check_warnings(('', DeprecationWarning)): - self.channel._SMTPChannel__greeting = 'spam' - with support.check_warnings(('', DeprecationWarning)): - spam = self.channel._SMTPChannel__mailfrom - with support.check_warnings(('', DeprecationWarning)): - self.channel._SMTPChannel__mailfrom = 'spam' - with support.check_warnings(('', DeprecationWarning)): - spam = self.channel._SMTPChannel__rcpttos - with support.check_warnings(('', DeprecationWarning)): - self.channel._SMTPChannel__rcpttos = 'spam' - with support.check_warnings(('', DeprecationWarning)): - spam = self.channel._SMTPChannel__data - with support.check_warnings(('', DeprecationWarning)): - self.channel._SMTPChannel__data = 'spam' - with support.check_warnings(('', DeprecationWarning)): - spam = self.channel._SMTPChannel__fqdn - with support.check_warnings(('', DeprecationWarning)): - self.channel._SMTPChannel__fqdn = 'spam' - with support.check_warnings(('', DeprecationWarning)): - spam = self.channel._SMTPChannel__peer - with support.check_warnings(('', DeprecationWarning)): - self.channel._SMTPChannel__peer = 'spam' - with support.check_warnings(('', DeprecationWarning)): - spam = self.channel._SMTPChannel__conn - with support.check_warnings(('', DeprecationWarning)): - self.channel._SMTPChannel__conn = 'spam' - with support.check_warnings(('', DeprecationWarning)): - spam = self.channel._SMTPChannel__addr - with support.check_warnings(('', DeprecationWarning)): - self.channel._SMTPChannel__addr = 'spam' - def test_decode_data_default_warning(self): server = DummyServer((support.HOST, 0), ('b', 0)) conn, addr = self.server.accept()