Skip to content

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