CVS: tmda/bin tmda-ofmipd,1.40,1.41 ChangeLog,1.286,1.287

Timothy Legant <[email protected]>
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda/bin
In directory sc8-pr-cvs1:/tmp/cvs-serv26694/bin

Modified Files:
	tmda-ofmipd ChangeLog 
Log Message:
Fixed bug where class IMAP4_SSL was defined locally (in tmda-ofmipd)
in all Python 2.x releases rather than just Python 2.2 and below.
Version 2.3 now defines the class natively.

Also, changed IMAP4_SSL to use 'host' and 'port' parameters of the
open() method rather than 'self.host' and 'self.port'.  The
implementation of the base class changed in Python 2.3, which doesn't
really affect this code, but pointed out that we were making
unjustified assumptions about the implementation.


Index: tmda-ofmipd
===================================================================
RCS file: /cvsroot/tmda/tmda/bin/tmda-ofmipd,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- tmda-ofmipd	30 Oct 2003 18:18:56 -0000	1.40
+++ tmda-ofmipd	13 Nov 2003 19:28:08 -0000	1.41
@@ -374,7 +374,7 @@
     vmaj, vmin = sys.version_info[:2]
     # Python version 2.2 and before don't have IMAP4_SSL
     import imaplib
-    if vmaj <= 2 or (vmaj == 2 and vmin <= 2):
+    if vmaj < 2 or (vmaj == 2 and vmin <= 2):
         class IMAP4_SSL(imaplib.IMAP4):
             # extends IMAP4 class to talk SSL cause it's not yet
             # implemented in python 2.2
@@ -384,7 +384,7 @@
                 read, readline, send, shutdown.
                 """
                 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-                self.sock.connect((self.host, self.port))
+                self.sock.connect((host, port))
                 self.sslsock = socket.ssl(self.sock)
                 self.file = self.sock.makefile('rb')
         

Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/bin/ChangeLog,v
retrieving revision 1.286
retrieving revision 1.287
diff -u -r1.286 -r1.287
--- ChangeLog	30 Oct 2003 18:18:56 -0000	1.286
+++ ChangeLog	13 Nov 2003 19:28:08 -0000	1.287
@@ -1,3 +1,14 @@
+2003-11-13  Tim Legant  <[email protected]>
+
+	* tmda-ofmipd (class IMAP4_SSL): This local class is only
+	necessary before Python version 2.3.  The test to define this
+	class (or not) was wrong, so any Python version 2.x ended up
+	adding the class.
+
+	* (IMAP4_SSL.open): The implementation changed with
+	2.3, pointing out that we should be using the 'host' and 'port'
+	parameters of open() rather than 'self.host' and 'self.port'.
+
 2003-10-30  Jason R. Mastaler  <[email protected]>
 
 	* tmda-ofmipd (SMTPChannel.auth_notify_succeed): Add the
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.