Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
7157 Lượt xem

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

Ảnh đại diện
Huỷ bỏ

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.

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 25
1727
3
thg 2 25
14914
1
thg 4 25
2068
Export Import Đã xử lý
1
thg 4 25
1978
0
thg 10 23
1354