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

Fix /bytes endpoint with newer werkzeug versions #41

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

swt2c
Copy link

@swt2c swt2c commented Jan 10, 2024

At some point, werkzeug starting checking the inputs to the write() method, which caused the following traceback:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 364, in run_wsgi
execute(self.server.app)
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 328, in execute
write(data)
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 296, in write
assert isinstance(data, bytes), "applications must write bytes"
AssertionError: applications must write bytes

Fix this by using bytes instead of bytearray.

At some point, werkzeug starting checking the inputs to the write()
method, which caused the following traceback:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 364, in run_wsgi
    execute(self.server.app)
  File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 328, in execute
    write(data)
  File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 296, in write
    assert isinstance(data, bytes), "applications must write bytes"
AssertionError: applications must write bytes

Fix this by using bytes instead of bytearray.
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