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

take unicode for Response.body instead of str #254

Closed
chadwhitacre opened this issue Oct 11, 2013 · 2 comments
Closed

take unicode for Response.body instead of str #254

chadwhitacre opened this issue Oct 11, 2013 · 2 comments

Comments

@chadwhitacre
Copy link
Contributor

This came up on gratipay/gratipay.com#158 and iirc @pjz mentioned it while sprinting on #225.

I'm open to this but I'd prefer that it be either unicode or str, not both.

@zwn
Copy link

zwn commented Oct 12, 2013

The body can be either unicode or str already. Just the default encoding when unicode does not make any sense. See https://github.com/gittip/aspen-python/blob/master/aspen/http/response.py#L112.

chadwhitacre added a commit that referenced this issue May 1, 2014
If a Response body is a unicode we want to encode it using self.charset
when sending to the wire. For static resources the body should be a byte
string so we shouldn't need to encode it at all.
@chadwhitacre
Copy link
Contributor Author

This is fixed in #334.

Changaco pushed a commit that referenced this issue Mar 11, 2016
If a Response body is a unicode we want to encode it using self.charset
when sending to the wire. For static resources the body should be a byte
string so we shouldn't need to encode it at all.
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

No branches or pull requests

2 participants