type(body) gives <type 'str'>

When stepping back I found in werkzeug/wrappers.py method _set_data,
and at that point both len(value) and len(self.response[0]) was still
the same and matching the actual content size.

The traceback was this:
[
'  File "/usr/share/python2.7/threading.py", line 525, in __bootstrap
\n',
'  File "/usr/share/python2.7/threading.py", line 552, in
__bootstrap_inner\n',
'  File "/usr/share/python2.7/threading.py", line 505, in run\n',
'  File "/usr/share/python2.7/SocketServer.py", line 582, in
process_request_thread\n',
'  File "/usr/share/python2.7/SocketServer.py", line 323, in
finish_request\n',
'  File "/usr/share/python2.7/SocketServer.py", line 639, in __init__
\n',
'  File "/usr/share/python2.7/site-packages/Werkzeug-0.8.3-py2.7.egg/
werkzeug/serving.py", line 182, in handle\n    rv =
BaseHTTPRequestHandler.handle(self)\n',
'  File "/usr/share/python2.7/BaseHTTPServer.py", line 343, in handle
\n',
'  File "/usr/share/python2.7/site-packages/Werkzeug-0.8.3-py2.7.egg/
werkzeug/serving.py", line 217, in handle_one_request\n    return
self.run_wsgi()\n',
'  File "/usr/share/python2.7/site-packages/Werkzeug-0.8.3-py2.7.egg/
werkzeug/serving.py", line 159, in run_wsgi\n    execute(app)\n',
'  File "/usr/share/python2.7/site-packages/Werkzeug-0.8.3-py2.7.egg/
werkzeug/serving.py", line 146, in execute\n    application_iter =
app(environ, start_response)\n',
'  File "/usr/share/python2.7/site-packages/openerp-6.1_1-py2.7.egg/
openerp/wsgi/core.py", line 397, in application\n    result =
handler(environ, start_response)\n',
'  File "/usr/share/python2.7/site-packages/openerp-6.1_1-py2.7.egg/
openerp/addons/web/common/http.py", line 473, in __call__\n    return
self.dispatch(environ, start_response)\n',
'  File "/usr/share/python2.7/site-packages/Werkzeug-0.8.3-py2.7.egg/
werkzeug/wsgi.py", line 411, in __call__\n    return self.app(environ,
start_response)\n',
'  File "/usr/share/python2.7/site-packages/openerp-6.1_1-py2.7.egg/
openerp/addons/web/common/http.py", line 500, in dispatch\n    result
= handler( request, self.config)\n',
'  File "/usr/share/python2.7/site-packages/openerp-6.1_1-py2.7.egg/
openerp/addons/web/common/http.py", line 246, in json_handler\n
return JsonRequest(request, config).dispatch(controller, f)\n',
'  File "/usr/share/python2.7/site-packages/openerp-6.1_1-py2.7.egg/
openerp/addons/web/common/http.py", line 231, in dispatch\n
_logger.warning(traceback.format_stack())\n']

What should I search for to find the place where the content is
actually passed on from werkzeug's BaseResponse? I have looked here
and there but cannot understand this, yet.

Thank you!


On Jun 7, 6:34 pm, Simon Sapin <[email protected]> wrote:
> Le 07/06/2012 17:14, Jānis a écrit :
>
> > The place in OpenERP's Python code that prepares the response, I
> > found, is this:
> > r = werkzeug.wrappers.Response(body, headers=[('Content-Type', mime),
> > ('Content-Length', len(body))])
> > return r
>
> You can add print(len(body), type(body)) there just to be sure, but I
> think the response would still be whole at this point.
>
> So you need to check everything between there and the browser. I would
> bet on some WSGI middleware. To get an idea of where to look, add this:
>
> import traceback
> traceback.print_stack()
>
> Each hopefully each middleware will have (at least) one frame on the stack.
>
> --
> Simon Sapin

-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pocoo-libs?hl=en.

Reply via email to