-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
UnicodeEncodeError on python3 #1151
Comments
According to the RFC 7230:
https://tools.ietf.org/html/rfc7230#section-3.2.4 I am not sure what to do yet. Either we let the gunicorn return an error like it is right now and fix the test. (we should also fix the encoding to usascii only sigh ). Or we quote by default the header value. Thoughts? |
To complete my comment above. This is more about deciding if as a server we should not take care about it and let the application handling the issue, or if we should fix the headers encoding whatever the application give us. |
@berkerpeksag @tilgovi thoughts? |
bump. |
Since the updated RFC 7230 implys that new Headers Key and Value should be sent as USASCII only don't try to test utf8 headers in examples. We now only encode them to ascii. Gunicorn will fail if it's unable to encode them letting the responsability to the application to correctly encode the response. (we are just a gateway). While i'm here simplify the code to not create an extra function only used at one place. NOTE: if anyone come to a better solution, i am happy to revisit it on the next release. fix benoitc#1151
This commit reverts one aspect changed by 5f4ebd2 (benoitc#1151); header-values are again encoded as latin-1 and not ascii. Test is restored but uses a latin-1-mappable test-character, not a general utf8 character. Fixed benoitc#1778. Signed-off-by: Brett Randall <javabrett@gmail.com>
This commit reverts one aspect changed by 5f4ebd2 (benoitc#1151); header-values are again encoded as latin-1 and not ascii. Test is restored but uses a latin-1-mappable test-character, not a general utf8 character. Fixed benoitc#1778. Signed-off-by: Brett Randall <javabrett@gmail.com>
This commit reverts one aspect changed by 5f4ebd2 (benoitc#1151); header-values are again encoded as latin-1 and not ascii. Test is restored but uses a latin-1-mappable test-character, not a general utf8 character. Fixed benoitc#1778. Signed-off-by: Brett Randall <javabrett@gmail.com>
This commit reverts one aspect changed by 5f4ebd2 (benoitc#1151); header-values are again encoded as latin-1 and not ascii. Test is restored but uses a latin-1-mappable test-character, not a general utf8 character. Fixed benoitc#1778. Signed-off-by: Brett Randall <javabrett@gmail.com>
This commit reverts one aspect changed by 5f4ebd2 (benoitc#1151); header-values are again encoded as latin-1 and not ascii. Test is restored but uses a latin-1-mappable test-character, not a general utf8 character. Fixed benoitc#1778. Signed-off-by: Brett Randall <javabrett@gmail.com>
This commit reverts one aspect changed by 5f4ebd2 (benoitc#1151); header-values are again encoded as latin-1 and not ascii. Test is restored but uses a latin-1-mappable test-character, not a general utf8 character. Fixed benoitc#1778. Signed-off-by: Brett Randall <javabrett@gmail.com> (cherry picked from commit 879651b)
This commit reverts one aspect changed by 5f4ebd2 (#1151); header-values are again encoded as latin-1 and not ascii. Test is restored but uses a latin-1-mappable test-character, not a general utf8 character. Fixed #1778. Signed-off-by: Brett Randall <javabrett@gmail.com> (cherry picked from commit 879651b)
I wonder if someone is really using Python 3 or at least test gunicorn with it, but we have a regression introduced via #1102 during the tests. Python 2 version is not affected. This is actually a blocker for 19.4.
To reproduce it, do the following:
The text was updated successfully, but these errors were encountered: