[Spacewalk-list] 1.9 and Unicode

Ciro Iriarte cyruspy at gmail.com
Tue Apr 30 00:48:22 UTC 2013


2013/4/28 Ciro Iriarte <cyruspy at gmail.com>:
> Hi!, I've succesfully installed Spacewalk 1.8 in the past, but for a
> new installation of 1.9 I'm seeing an error that seems related to
> Unicode.
>
>
> I get this trying to add a client with:
>
> --
> rhnreg_ks --serverUrl=http://server/XMLRPC --activationkey=1-centos6
> --
>
> ---
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201] mod_wsgi
> (pid=2474): Exception occurred processing WSGI script
> '/usr/share/rhn/wsgi/xmlrpc.py'.
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201] Traceback
> (most recent call last):
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]   File
> "/usr/share/rhn/wsgi/xmlrpc.py", line 22, in application
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]     return
> wsgiHandler.handle(environ, start_response, "xmlrpc", "server.xmlrpc")
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]   File
> "/usr/share/rhn/wsgi/wsgiHandler.py", line 45, in handle
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]     ret =
> appServ(req)
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]   File
> "/usr/lib/python2.6/site-packages/spacewalk/server/apacheHandler.py",
> line 196, in handler
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]     ret =
> self._req_processor.process()
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]   File
> "/usr/lib/python2.6/site-packages/spacewalk/server/apacheRequest.py",
> line 476, in process
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]     return
> self.call_function(method, params)
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]   File
> "/usr/lib/python2.6/site-packages/spacewalk/server/apacheRequest.py",
> line 174, in call_function
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]
> Traceback(method, self.req, severity="unhandled")
> [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'))
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]   File
> "/usr/lib64/python2.6/StringIO.py", line 270, in getvalue
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]     self.buf
> += ''.join(self.buflist)
> [Sun Apr 28 17:42:46 2013] [error] [client 10.1.20.201]
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
> 48: ordinal not in range(128)
> ---
>
> Any body has seen this?:
>
>
> Regards,
>
> --
> Ciro Iriarte
> http://cyruspy.wordpress.com
> --

Hi!, I'm seeing the same error...

---
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201] mod_wsgi
(pid=1682): Exception occurred processing WSGI script
'/usr/share/rhn/wsgi/xmlrpc.py'.
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201] Traceback
(most recent call last):
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]   File
"/usr/share/rhn/wsgi/xmlrpc.py", line 22, in application
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]     return
wsgiHandler.handle(environ, start_response, "xmlrpc", "server.xmlrpc")
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]   File
"/usr/share/rhn/wsgi/wsgiHandler.py", line 45, in handle
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]     ret = appServ(req)
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]   File
"/usr/lib/python2.6/site-packages/spacewalk/server/apacheHandler.py",
line 196, in handler
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]     ret =
self._req_processor.process()
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]   File
"/usr/lib/python2.6/site-packages/spacewalk/server/apacheRequest.py",
line 476, in process
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]     return
self.call_function(method, params)
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]   File
"/usr/lib/python2.6/site-packages/spacewalk/server/apacheRequest.py",
line 174, in call_function
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]
Traceback(method, self.req, severity="unhandled")
[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'))
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]   File
"/usr/lib64/python2.6/StringIO.py", line 270, in getvalue
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]     self.buf
+= ''.join(self.buflist)
[Mon Apr 29 20:45:34 2013] [error] [client 10.1.20.201]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
48: ordinal not in range(128)
---


--
--- /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
--

Regards,

--
Ciro Iriarte
http://cyruspy.wordpress.com
--




More information about the Spacewalk-list mailing list