You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Py2, headers are byte strings, so when getOutput and hence __str__ attempts to encode them, they must first silently be decoded to unicode using the default encoding. If the default encoding is ascii, and the headers contained any non-ascii values (commonly latin-1), this will fail with a UnicodeError.
Fix the testlayer's ``FakeResponse`` assuming that headers were in
unicode on Python 2, where they should usually be encoded bytes
already. This could lead to UnicodeDecodeError if the headers
contained non-ascii characters. Also make it implement ``__unicode__``
on Python 2 and ``__bytes__`` on Python 3 to ease cross version
testing.
Also add explicit Py3.6 support.
Fixes#7.
On Py2, headers are byte strings, so when
getOutput
and hence__str__
attempts toencode
them, they must first silently be decoded to unicode using the default encoding. If the default encoding is ascii, and the headers contained any non-ascii values (commonly latin-1), this will fail with a UnicodeError.This came up in porting zope.app.form to zope.app.wsgi.
The text was updated successfully, but these errors were encountered: