跳至内容
菜单
此问题已终结
4 回复
7120 查看

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

形象
丢弃

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.

最佳答案

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

形象
丢弃
最佳答案

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.

形象
丢弃
相关帖文 回复 查看 活动
1
7月 25
1607
3
2月 25
14803
1
4月 25
2044
Export Import 已解决
1
4月 25
1923
0
10月 23
1325