Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception with expose_tracebacks=True and unicode in traceback #338

Closed
jkmnt opened this issue Apr 1, 2021 · 2 comments · Fixed by #378
Closed

Exception with expose_tracebacks=True and unicode in traceback #338

jkmnt opened this issue Apr 1, 2021 · 2 comments · Fixed by #378
Labels

Comments

@jkmnt
Copy link

jkmnt commented Apr 1, 2021

Not so important since the expose_tracebacks is not for production, but anyway:

if expose_tracebacks is true and there is non-ascii in exception trace,
waitress fails to encode the error body:

class ErrorTask(Task): def execute(self): self.write(tobytes(body))

Socket is left open and client stucks.

waitress 1.4.4, windows

@stevepiercy
Copy link
Member

@jkmnt would you please provide a code sample that reproduces this issue?

Also would you try it against Waitress 2.0.0, assuming your code is for Python 3?

@jkmnt
Copy link
Author

jkmnt commented Apr 1, 2021

Tried against the waitress 2.0.0, same result.
The minimal sample reproducing the problem:

import waitress

def application(environ, start_response):
    body = b'Hello world!\n'
    status = '200 OK'
    headers = [('Content-type', 'text/plain')]
    start_response(status, headers)
    raise Exception('here we are' + chr(8364))
    return [body]

waitress.serve(application, port=22222, expose_tracebacks=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants