error messages containing unicode

Jim jhefferon at smcvt.edu
Wed Jan 31 11:01:52 EST 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