summaryrefslogtreecommitdiffstats
path: root/Lib/smtpd.py
diff options
context:
space:
mode:
authorJosiah Carlson <josiah.carlson@gmail.com>2008-07-07 04:15:08 (GMT)
committerJosiah Carlson <josiah.carlson@gmail.com>2008-07-07 04:15:08 (GMT)
commitd74900ebb5a22b387b49684990da1925e1d6bdc9 (patch)
tree2bdffc475f22a3db675656e49458f74ebfc39951 /Lib/smtpd.py
parentd51ee54a232f4986abd18a4113f3af1158c2fd53 (diff)
downloadcpython-d74900ebb5a22b387b49684990da1925e1d6bdc9.zip
cpython-d74900ebb5a22b387b49684990da1925e1d6bdc9.tar.gz
cpython-d74900ebb5a22b387b49684990da1925e1d6bdc9.tar.bz2
Committing Py3k version of changelist 64080 and 64257, along with updated tests
for smtpd, which required updating with the new semantics.
Diffstat (limited to 'Lib/smtpd.py')
-rwxr-xr-xLib/smtpd.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/smtpd.py b/Lib/smtpd.py
index 3197ca9..ea59aef 100755
--- a/Lib/smtpd.py
+++ b/Lib/smtpd.py
@@ -124,11 +124,11 @@ class SMTPChannel(asynchat.async_chat):
self.__peer = conn.getpeername()
print('Peer:', repr(self.__peer), file=DEBUGSTREAM)
self.push('220 %s %s' % (self.__fqdn, __version__))
- self.set_terminator('\r\n')
+ self.set_terminator(b'\r\n')
# Overrides base class for convenience
def push(self, msg):
- asynchat.async_chat.push(self, msg + '\r\n')
+ asynchat.async_chat.push(self, bytes(msg + '\r\n', 'ascii'))
# Implementation of base class abstract method
def collect_incoming_data(self, data):
@@ -177,7 +177,7 @@ class SMTPChannel(asynchat.async_chat):
self.__rcpttos = []
self.__mailfrom = None
self.__state = self.COMMAND
- self.set_terminator('\r\n')
+ self.set_terminator(b'\r\n')
if not status:
self.push('250 Ok')
else:
@@ -264,7 +264,7 @@ class SMTPChannel(asynchat.async_chat):
self.push('501 Syntax: DATA')
return
self.__state = self.DATA
- self.set_terminator('\r\n.\r\n')
+ self.set_terminator(b'\r\n.\r\n')
self.push('354 End data with <CR><LF>.<CR><LF>')