On 06/05/16 12:02, Cédric Krier wrote:
On 2016-05-06 11:44, Oscar Alvarez wrote:
File
"/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/trytond/protocols/jsonrpc.py",
line 126, in parsed_data
raise BadRequest('Unable to read JSON request')
werkzeug.exceptions.BadRequest: 400: Bad Request
Please could you look at which exception trigger this raise?
Here the result:
10846 139708903905024 [2016-05-06 21:37:53,104] ERROR werkzeug Error on
request:
Traceback (most recent call last):
File
"/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/werkzeug/serving.py",
line 193, in run_wsgi
execute(self.server.app)
File
"/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/werkzeug/serving.py",
line 181, in execute
application_iter = app(environ, start_response)
File
"/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/werkzeug/wsgi.py",
line 599, in __call__
return self.app(environ, start_response)
File
"/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/trytond/wsgi.py",
line 84, in __call__
return self.wsgi_app(environ, start_response)
File
"/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/trytond/wsgi.py",
line 74, in wsgi_app
response = cls.response(data, request)
File
"/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/trytond/protocols/jsonrpc.py",
line 149, in response
response = {'id': request.parsed_data.get('id', 0)}
File
"/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/werkzeug/utils.py",
line 73, in __get__
value = self.func(obj)
File
"/home/psk/.virtualenvs/tryton40/lib/python3.5/site-packages/trytond/protocols/jsonrpc.py",
line 124, in parsed_data
return json.loads(self.decoded_data, object_hook=JSONDecoder())
File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
I think that the problem is self.decoded_data variable because is type
"bytes", I added a "print" before this line and I could confirm this, so
when I convert this variable using .decode("utf-8"), the problem was
solved!.
Do I create an new issue?
Oscar Alvarez
--
You received this message because you are subscribed to the Google Groups
"tryton-dev" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tryton-dev/572D106B.3000809%40gmail.com.