Skip to content

Wsgi.errors is text #62

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

Merged
merged 2 commits into from
Oct 12, 2020
Merged

Wsgi.errors is text #62

merged 2 commits into from
Oct 12, 2020

Conversation

brondsem
Copy link
Contributor

@brondsem brondsem commented Oct 9, 2020

The current ErrorMiddleware raises this error on python 3

  File "/allura-data/virtualenv/lib/python3.6/site-packages/paste/exceptions/errormiddleware.py", line 188, in exception_handler
    simple_html_error=simple_html_error)
  File "/allura-data/virtualenv/lib/python3.6/site-packages/paste/exceptions/errormiddleware.py", line 391, in handle_exception
    error_stream.write(line)
  File "/allura-data/virtualenv/lib/python3.6/site-packages/gunicorn/http/wsgi.py", line 71, in write
    stream.write(data)
TypeError: write() argument must be str, not bytes

PEP-333 and PEP-3333 say that wsgi.errors is a text stream, so this changes ErrorMiddleware as well as the tests & other usage of wsgi.errors to no longer be bytes. It also is a more complete fix for #18

Plus a next() change in ErrorMiddleware too.

@cdent cdent merged commit 652112c into pasteorg:master Oct 12, 2020
@cdent
Copy link
Collaborator

cdent commented Oct 12, 2020

Yup, thanks.

@cdent
Copy link
Collaborator

cdent commented Oct 12, 2020

This and the other one included in https://pypi.org/project/Paste/3.5.0/

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

Successfully merging this pull request may close these issues.

2 participants