From 0ba9634205c005fba3915a76b2857dcb836afc9e Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Fri, 30 Sep 2011 10:59:07 +0200 Subject: [PATCH] Fix string formatting when port is not given. If port is None, we would try to format an empty string with %d wich fails. Fix it by using %s. Reported-by: Iain Dalton Signed-off-by: Sebastian Spaeth --- offlineimap/ui/UIBase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offlineimap/ui/UIBase.py b/offlineimap/ui/UIBase.py index caf5efd..b5dcdaa 100644 --- a/offlineimap/ui/UIBase.py +++ b/offlineimap/ui/UIBase.py @@ -232,7 +232,7 @@ class UIBase: if s.verbose < 0: return displaystr = '' hostname = hostname if hostname else '' - port = "%d" % port if port else '' + port = "%s" % port if port else '' if hostname: displaystr = ' to %s:%s' % (hostname, port) s._msg("Establishing connection%s" % displaystr)