This question has been flagged
4 Replies
6429 Views

Hi, I have downloaded the latest code from nightly in that i am facing issues that not able to export any data nothing happens and i get this error in backend.

openerp.addons.web.http.HttpRequest.dispatch: An error occurred while handling a json request Traceback (most recent call last): File "/opt/openerp/server/openerp/addons/web/http.py", line 285, in dispatch r = method(self, **self.params) File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1630, in index cookies={'fileToken': int(token)}) File "/opt/openerp/server/openerp/addons/web/http.py", line 332, in make_response response.set_cookie(k, v) File "/usr/local/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 960, in set_cookie self.charset)) File "/usr/local/lib/python2.7/dist-packages/werkzeug/http.py", line 905, in dump_cookie value = to_bytes(value, charset) File "/usr/local/lib/python2.7/dist-packages/werkzeug/_compat.py", line 106, in to_bytes raise TypeError('Expected bytes') TypeError: Expected bytes

Avatar
Discard

Can you edit your question to include all the steps you have done to end up with this error? E.g. what you were trying to export and what you clicked to export the data etc.

Similar things we facing with openerp stable 7.0 version, when backup or exporting database.

Best Answer

Dude, this is because cookies are not intended to support unicode characters, you must use a decoded variable in the cookie you are trying to set. something like :

    set_cookie(k, bytes(v))

Avatar
Discard
Best Answer

Dear Friend,

I had same problem. but I try this code and it work fine.

First check the library of  werkzeug using below command.

pip show werkzeug | grep Version.

if you get  Version: 0.8.3 then fine other wise install werkzeug library with version 0.8.3

using below command you will install the library.

sudo pip install werkzeug==0.8.3

Hope may be helpfull. 

Thanks & Regards

Ankit H Gandhi.

Avatar
Discard