PyUnit : Failed to read XML-RPC request: Invalid byte 2 of 3-byte UTF-8 sequence
-
12-12-2019 - |
Question
When I run pyunit from eclipse, the PyUnit view is not updated and I have the following error
Finding files... done.
Importing test modules ... done.
----------------------------------------------------------------------
Ran 1 tests in 0.000s
OK
Traceback (most recent call last):
File "C:\Program Files\eclipse\plugins\org.python.pydev.debug_2.4.0.2012020116\pysrc\pydev_runfiles_xml_rpc.py", line 131, in run
self.server.notifyCommands(commands)
File "C:\Python27\lib\xmlrpclib.py", line 1224, in __call__
return self.__send(self.__name, args)
File "C:\Python27\lib\xmlrpclib.py", line 1575, in __request
verbose=self.__verbose
File "C:\Python27\lib\xmlrpclib.py", line 1264, in request
return self.single_request(host, handler, request_body, verbose)
File "C:\Python27\lib\xmlrpclib.py", line 1297, in single_request
return self.parse_response(response)
File "C:\Python27\lib\xmlrpclib.py", line 1473, in parse_response
return u.close()
File "C:\Python27\lib\xmlrpclib.py", line 793, in close
raise Fault(**self._stack[0])
Fault: <Fault 0: 'Failed to read XML-RPC request: Invalid byte 2 of 3-byte UTF-8 sequence.'>
Do you have any idea what cause this error ?
Solution
The problem was caused by insufficient access rights to the eclipse directory (read only access). I grant permissions to the installation directory (modification), and now i don't have this error.
OTHER TIPS
I also came across this error using pyunit with eclipse.
My problem was, during a test, trying to print a utf-8 string to the pyunit console. Converting the string solved the problem:
Problem code:
print(my_Utf8_String)
Fixed:
print (unicode(my_Utf8_String).encode('utf8'))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow