[Spacewalk-list] 1.9 and Unicode

Jan Pazdziora jpazdziora at redhat.com
Tue Apr 30 06:15:54 UTC 2013


On Mon, Apr 29, 2013 at 08:48:22PM -0400, Ciro Iriarte wrote:
> > [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]   File
> > "/usr/lib/python2.6/site-packages/spacewalk/common/rhnTB.py", line
> > 150, in Traceback
> > [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]
> > ostream.write("%s\\n" % exc.getvalue().encode('utf-8'))

[...]

> Hi!, I'm seeing the same error...
> 
> [Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]   File
> "/usr/lib/python2.6/site-packages/spacewalk/common/rhnTB.py", line
> 150, in Traceback
> [Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]
> ostream.write("%s\\n" % exc.getvalue().encode('utf-8'))

That's weird. Did you restart httpd? Because the original error line
was 150 and the current line seems to be 150 even if the patch

> --- /usr/lib/python2.6/site-packages/spacewalk/common/rhnTB.py.orig
>  2013-04-29 19:56:51.387243659 -0400
> +++ /usr/lib/python2.6/site-packages/spacewalk/common/rhnTB.py
> 2013-04-29 19:57:57.986933719 -0400
> @@ -148,6 +148,11 @@ def Traceback(method = None, req = None,
>      # we always log it somewhere
>      if ostream:
>          ostream.write("%s\n" % exc.getvalue().encode('utf-8'))
> +       the_value = exc.getvalue()
> +       if isinstance(the_value, unicode):
> +               ostream.write("%s\n" % exc.getvalue().encode('utf-8'))
> +       else:
> +               ostream.write("%s\n" % exc.getvalue())
> 
>      if mail:
>          # print the stack frames for the mail we send out

should have moved it to line 152.

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat




More information about the Spacewalk-list mailing list