[PATCH 1/4] Re: Don't use CStringIO to format a traceback

Sebastian Spaeth Sebastian at SSpaeth.de
Thu Jun 30 08:43:06 BST 2011


On Thu, 16 Jun 2011 18:41:34 +0200, Nicolas Sebrecht <nicolas.s-dev at laposte.net> wrote:
> >      def getMainExceptionString(s):
> > -        sbuf = StringIO()
> > -        traceback.print_exc(file = sbuf)
> > -        return "Main program terminated with exception:\n" + \
> > -               sbuf.getvalue() + "\n" + \
> > +        return "Main program terminated with exception:\n%s\n" %\
> > +               traceback.format_exc() + \
> >                 s.getThreadDebugLog(threading.currentThread())
> 
> Doesn't it need
> 
>   + "\n"
> 
> like before?

No, I checked and format_exc() adds an \n to the output. Still nominating this small
cleanup patch for inclusion :-).

Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20110630/de018e0b/attachment-0001.sig>


More information about the OfflineIMAP-project mailing list