It appears that sending a WSGI error response is broken with the Python 3.5 plugin. Here is a little WSGI app that repros the problem:

import sys
def application(environ, start_response):
    try:
        start_response('201 OK', [('Content-Type', 'text/plain')])
        raise Exception("Borked")
        yield b"hello\n"
    except:
start_response('500 Internal Server Error', [('Content-type', 'text/plain')], sys.exc_info())
        yield b"an error errored"

With the Python 3.4 plugin, the error content is delivered correctly. In Python 3.5, no content is delivered and the log contains this error:

Traceback (most recent call last):
  File "/root/mini_wsgi.py", line 6, in application
    raise Exception("Borked")
Exception: Borked
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/root/mini_wsgi.py", line 9, in application
start_response('500 Internal Server Error', [('Content-type', 'text/plain')], sys.exc_info()) SystemError: <built-in function uwsgi_spit> returned a result with an error set

I believe it may be related to this Python issue: https://bugs.python.org/issue23571

Is there anything we can do to work around this?
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to