From 7cd473ecafc052611ad6d624edd950731d67fd17 Mon Sep 17 00:00:00 2001 From: David Rousselie Date: Mon, 10 Mar 2008 12:11:50 +0100 Subject: [PATCH] Fix a typing bug in SMTPAccount darcs-hash:20080310111150-86b55-6a62a729d02d870e2160007bc9d485d9d6883657.gz --- src/jmc/model/account.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/jmc/model/account.py b/src/jmc/model/account.py index 194d6fe..49a30db 100644 --- a/src/jmc/model/account.py +++ b/src/jmc/model/account.py @@ -763,6 +763,16 @@ class SMTPAccount(Account): smtp_connection = smtplib.SMTP() if self.__logger.getEffectiveLevel() == logging.DEBUG: smtp_connection.set_debuglevel(1) + + # It seems there is a bug that set self.port to something that is + # not an integer. How ? Here is a temporary workaround. + from types import IntType + if type(self.port) != IntType: + self.__logger.debug("BUG: SMTPAccount.port is not an integer: " + + str(type(self.port)) + ", value: " + + str(self.port)) + self.port = int(self.port) + smtp_connection.connect(self.host, self.port) self.__say_hello(smtp_connection) if self.tls: