error messages containing unicode

Jim jhefferon at smcvt.edu
Wed Jan 31 17:01:52 CET 2007


Oops, there is a typo in what I wrote above.  Sorry.

On Jan 31, 7:57 am, "Jim" <jheffe... at smcvt.edu> wrote:
> Oh, I agree.  If I have a string mesg that is unicode-not-ascii and I
> say
>   try:
>       raise Exception mesg
>   except Exception, err:
>       print "Trouble"+mesg
> then I have problems.
should say:
   try:
       raise Exception mesg
   except Exception, err:
       print "Trouble"+str(err)

Jim




More information about the Python-list mailing list