Ticket #5852: 5852.2.patch
| File 5852.2.patch, 2.5 KB (added by moijes12, 9 months ago) |
|---|
-
twisted/mail/smtp.py
8 8 9 9 import time, re, base64, types, socket, os, random, rfc822 10 10 import binascii 11 import warnings 11 12 from email.base64MIME import encode as encode_base64 12 13 13 14 from zope.interface import implements, Interface … … 1239 1240 # ClientContextFactory to use for STARTTLS 1240 1241 context = None 1241 1242 1243 1244 def __setattr__(self, name, val): 1245 if name == 'tlsMode': 1246 warnings.warn("tlsMode attribute of twisted.mail.smtp.ESMTPClient is deprecated since Twisted 12.2", category=DeprecationWarning, stacklevel=2) 1247 self.__dict__[name] = val 1248 1249 1242 1250 def __init__(self, secret, contextFactory=None, *args, **kw): 1243 1251 SMTPClient.__init__(self, *args, **kw) 1244 1252 self.authenticators = [] -
twisted/mail/test/test_smtp.py
609 609 def test_loginAuth(self): 610 610 """ 611 611 L{ESMTPClient} can authenticate using the I{LOGIN} SASL mechanism. 612 612 613 613 614 @see: U{http://sepp.oetiker.ch/sasl-2.1.19-ds/draft-murchison-sasl-login-00.txt} 614 615 """ … … 1518 1519 client.sentMail(199, "Test response", 1, addresses, client.log) 1519 1520 1520 1521 return onDone 1522 1523 1524 1525 class DeprecationTests(unittest.TestCase): 1526 """ 1527 Test for deprecations. 1528 """ 1529 1530 1531 def test_esmtpClientTlsModeDeprecation(self): 1532 """ 1533 Test deprecation of ESMTPClient.tlsMode. 1534 """ 1535 import warnings 1536 with warnings.catch_warnings(record=True) as w: 1537 warnings.simplefilter("default") 1538 from twisted.mail.smtp import ESMTPClient 1539 client = ESMTPClient('', '', '') 1540 self.assertEqual(len(w), 1) 1541 self.assertIdentical(w[-1].category, DeprecationWarning) 1542 self.assertEqual(str(w[-1].message), "tlsMode attribute of twisted.mail.smtp.ESMTPClient is deprecated since Twisted 12.2") -
twisted/mail/topfiles/5852.removal
1 tlsMode attribute of twisted.mail.smtp.ESMTPClient is deprecated since Twisted 12.2.
