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
Support actions returning binary data with Python 3.
An action's handle() function may return content that should be sent
back to the client instead of the default HTML page. This content is
not restricted to being HTML text; it can be for any content type (the
handle() function should use self.client.setHeader in that case to set
the Content-Type header, and Content-Disposition if the browser is to
handle it as an attachment).
If the content type is binary data, of course the handle() function
has to return a bytes object in Python 3, not a str object. This then
runs into Roundup (write_html, called on whatever the action returns,
whether HTML or not) attempting to re-encode to the client character
set, which is only appropriate with a str object. This patch adds an
appropriate check to avoid the attempted re-encoding when given a
bytes object.
0 commit comments