Exception thrown when port is not specified

Iain Dalton iain.dalton at gmail.com
Thu Sep 29 19:05:59 BST 2011


Line 235 of offlineimap/ui/UIBase.py is:

         port = "%d" % port if port else ''

but %d can't take '', so it throws an exception.  If this is intended,
it's more roundabout than just

         port = int(port)

which also throws an exception.  If not intended, '' should be a default
port number, and instead of `x if x else y', you can more succintly say
`x or y', so the line could be

         port = "%d" % port or DEFAULT_PORT





More information about the OfflineIMAP-project mailing list