cpython: 576128c0d068 (original) (raw)
Mercurial > cpython
changeset 98621:576128c0d068
Merge #25328: add missing raise keyword in decode_data+SMTPUTF8 check. [#25328]
R David Murray rdmurray@bitdance.com | |
---|---|
date | Fri, 09 Oct 2015 10:20:58 -0400 |
parents | 92025e9c6b54(current diff)d471cf4a73b2(diff) |
children | d9a89c9137d2 |
files | Misc/NEWS |
diffstat | 3 files changed, 11 insertions(+), 2 deletions(-)[+] [-] Lib/smtpd.py 4 Lib/test/test_smtpd.py 6 Misc/NEWS 3 |
line wrap: on
line diff
--- a/Lib/smtpd.py +++ b/Lib/smtpd.py @@ -137,8 +137,8 @@ class SMTPChannel(asynchat.async_chat): self.enable_SMTPUTF8 = enable_SMTPUTF8 if enable_SMTPUTF8: if decode_data:
ValueError("decode_data and enable_SMTPUTF8 cannot be set to"[](#l1.7)
" True at the same time")[](#l1.8)
raise ValueError("decode_data and enable_SMTPUTF8 cannot"[](#l1.9)
" be set to True at the same time")[](#l1.10) decode_data = False[](#l1.11) if decode_data is None:[](#l1.12) warn("The decode_data default of True will change to False in 3.6;"[](#l1.13)
--- a/Lib/test/test_smtpd.py +++ b/Lib/test/test_smtpd.py @@ -313,6 +313,12 @@ class SMTPDChannelTest(unittest.TestCase DummyDispatcherBroken, BrokenDummyServer, (support.HOST, 0), ('b', 0), decode_data=True)
- def test_decode_data_and_enable_SMTPUTF8_raises(self):
self.assertRaises([](#l2.8)
ValueError, smtpd.SMTPChannel,[](#l2.9)
self.server, self.channel.conn, self.channel.addr,[](#l2.10)
enable_SMTPUTF8=True, decode_data=True)[](#l2.11)
+ def test_server_accept(self): self.server.handle_accept()
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -48,6 +48,9 @@ Core and Builtins Library ------- +- Issue #25328: smtpd's SMTPChannel now correctly raises a ValueError if both