diff --git a/Lib/smtplib.py b/Lib/smtplib.py --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -614,7 +614,7 @@ if not _have_ssl: raise RuntimeError("No SSL support included in this Python") self.sock = ssl.wrap_socket(self.sock, keyfile, certfile) - self.file = SSLFakeFile(self.sock) + self.file = self.sock.makefile('rb') # RFC 3207: # The client MUST discard any knowledge obtained from # the server, such as the list of SMTP service extensions, @@ -754,7 +754,7 @@ if self.debuglevel > 0: print>>stderr, 'connect:', (host, port) sock = socket.create_connection((host, port), timeout) sock = ssl.wrap_socket(sock, self.keyfile, self.certfile) - self.file = SSLFakeFile(self.sock) + self.file = sock.makefile('rb') return sock __all__.append("SMTP_SSL")