Comment 11 for bug 1193563

Revision history for this message
Ronald Portier (Therp) (rportier1962) wrote :

Hello I think the error is in this line:

File "/usr/openerp/addons/web/controllers/main.py", line 1767, in index
    cookies={'fileToken': int(token)})

A cookie string is of course ... a string. By making the token numeric (int) instead of a string, the to_bytes method later on receives a number where it is expecting some kind of string. Hence the TypeError.

So the error is not with werkzeug, but squarely in openerp, so has to be solved there.

It is true that the error was triggered by an upgrade in werkzeug, that, as far as I can see, has to ensure better handling of the difference between python 2.x and 3.x, the whole stuff about moving to unicode strings. As this seems a worthwhile goal, we from our (the OpenERP) side should adapt.

I can reproduce the error by both printing and exporting (or trying to). Both those actions try to return a file to the client, in te one case a csv file, in the other a pdf...

I will try to submit a merge request.