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

url encode error 500 #930

Closed
larryhq opened this issue Nov 7, 2014 · 14 comments
Closed

url encode error 500 #930

larryhq opened this issue Nov 7, 2014 · 14 comments

Comments

@larryhq
Copy link

larryhq commented Nov 7, 2014

http://<mysite.com>/api/v1/tags/%E5%A5%94%E9%A9%B0/cards/
python3.4.2 + django1.7.1 + gunicorn19.1.1
if url include chinese ,it traceback 500 error

Traceback (most recent call last):
  File "/home/ubuntu/Envs/guadou/lib/python3.4/site-packages/aiohttp/server.py", line 215, in start
    yield from handler
  File "/home/ubuntu/Envs/guadou/lib/python3.4/site-packages/aiohttp/wsgi.py", line 153, in handle_request
    riter = self.wsgi(environ, response.start_response)
  File "/home/ubuntu/Envs/guadou/lib/python3.4/site-packages/django/core/handlers/wsgi.py", line 177, in __call__
    request = self.request_class(environ)
  File "/home/ubuntu/Envs/guadou/lib/python3.4/site-packages/django/core/handlers/wsgi.py", line 86, in __init__
    path_info = get_path_info(environ)
  File "/home/ubuntu/Envs/guadou/lib/python3.4/site-packages/django/core/handlers/wsgi.py", line 203, in get_path_info
    path_info = get_bytes_from_wsgi(environ, 'PATH_INFO', '/')
  File "/home/ubuntu/Envs/guadou/lib/python3.4/site-packages/django/core/handlers/wsgi.py", line 250, in get_bytes_from_wsgi
    return value if six.PY2 else value.encode(ISO_8859_1)
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 13-14: ordinal not in range(256)
@benoitc
Copy link
Owner

benoitc commented Nov 7, 2014

cc @fafhrd91 @asvetlov looks like an issue while decoding the headers in aiohttp, could you check?

@asvetlov
Copy link
Collaborator

asvetlov commented Nov 7, 2014

I'll take a look, thanks.

@asvetlov
Copy link
Collaborator

asvetlov commented Nov 7, 2014

The source of problem is unquote(path_info) calll: https://github.com/KeepSafe/aiohttp/blob/master/aiohttp/wsgi.py#L131

Not sure that unquoting should be called on wsgi level.

Thoughts?

@asvetlov
Copy link
Collaborator

Fixed in aiohttp 0.10.2 release.

@tilgovi
Copy link
Collaborator

tilgovi commented Nov 19, 2014

\o/

@larryhq
Copy link
Author

larryhq commented Nov 25, 2014

@asvetlov @fafhrd91
Thank you for taking the time to look at this issue!
But,there is a problem with it.
When I access the url with chinese, it will traceback 404 error, if i update aiohttp to 0.10.2
This is my start command:

    gunicorn myproject.wsgi:application -w 3 -k gaiohttp -n gunicorn_aiohttp -b 0.0.0.0:8000

python3.4.2 + django1.7.1 + gunicorn19.1.1

@nyssance
Copy link

@benoitc @asvetlov Not fixed yet 404 error. aiohttp 0.12.0

@asvetlov
Copy link
Collaborator

Please try aiohttp 0.13.0

@asvetlov asvetlov reopened this Dec 29, 2014
@nyssance
Copy link

@asvetlov Fix it aio-libs/aiohttp#248

@tilgovi
Copy link
Collaborator

tilgovi commented Mar 13, 2016

Do we need this issue here or is it an upstream issue?

@benoitc
Copy link
Owner

benoitc commented Mar 13, 2016

should be probably closed there. Maybe we could add a test about the version inside the worker like others?

@tilgovi
Copy link
Collaborator

tilgovi commented Mar 13, 2016

Maybe we could add a test about the version inside the worker like others?

Where do you mean? Is there an example?

@benoitc
Copy link
Owner

benoitc commented Mar 13, 2016

oups sorry. yed the evenlet worker is checking the version installed.
On Sun, 13 Mar 2016 at 14:22, Randall Leeds [email protected]
wrote:

Maybe we could add a test about the version inside the worker like others?

Where do you mean? Is there an example?


Reply to this email directly or view it on GitHub
#930 (comment).

@benoitc benoitc added - Bugs - and removed - Bugs - labels Feb 26, 2017
@benoitc
Copy link
Owner

benoitc commented Nov 6, 2017

i'm closing this issue.

@benoitc benoitc closed this as completed Nov 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants