[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Martin Panter
Martin Panter added the comment: Graham: On my Linux computer, Curl seems to treat the test “URL” as a string of bytes and doesn’t percent encode it. Therefore you may be affected by Issue 26717 which I fixed the other day. But in real life, URLs are meant to only have literal ASCII characters

[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Graham Dumpleton
Graham Dumpleton added the comment: This gets even weirder. Gunicorn behaves same as wsgiref. However, it turns out they both only show the unexpected result if using curl. If you use safari they are both fine. Waitress blows up altogether on it with an exception when you use curl as client,

[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Graham Dumpleton
Graham Dumpleton added the comment: There does appear to be something wrong with wsgiref, because with that rewritten code you should for: curl http://127.0.0.1:8000/тест get: pi: /тест qs: {} and for: curl http://127.0.0.1:8000/?a=тест get: pi: / qs: {'a': ['тест']} The PATH_INFO case a

[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Graham Dumpleton
Graham Dumpleton added the comment: Your code should be written as: res = """\ e: {} pi: {} qs: {} """.format( pprint.pformat(e), urllib.parse.unquote(e['PATH_INFO'].encode('Latin-1').decode('UTF-8')), urllib.parse.parse_qs(urllib.parse.unquote(e['QUERY_STRING'].enco

[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Александр Эри
Александр Эри added the comment: My browser encodes url in utf-8. To resolve this bug we need to look in web standards, not in pep. -- ___ Python tracker ___ ___

[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Martin Panter
Martin Panter added the comment: I think this is already covered in Issue 16679. PEP says it’s meant to work this way. I admit it is very quirky. See also Issue 22264 discussing future enhancements. -- nosy: +martin.panter resolution: -> duplicate status: open -> closed supersede

[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Alexey Gorshkov
Alexey Gorshkov added the comment: also attaching same print output in console -- Added file: http://bugs.python.org/file42535/Screenshot from 2016-04-20 14-28-03.png ___ Python tracker ___

[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Alexey Gorshkov
Alexey Gorshkov added the comment: take a look at 'pi:' result, please. - attaching screenshot -- Added file: http://bugs.python.org/file42534/Screenshot from 2016-04-20 14-26-03.png ___ Python tracker ___

[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread SilentGhost
SilentGhost added the comment: What do you mean by "breaks"? Also, why do you encode your string as utf-8? -- components: +Library (Lib) -Extension Modules nosy: +SilentGhost, orsenthil ___ Python tracker _

[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Александр Эри
Александр Эри added the comment: look also #issue26717 -- nosy: +Александр Эри ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Alexey Gorshkov
Changes by Alexey Gorshkov : Added file: http://bugs.python.org/file42533/t.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Alexey Gorshkov
Changes by Alexey Gorshkov : Removed file: http://bugs.python.org/file42532/t.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue26808] wsgiref.simple_server breaks unicode in URIs

2016-04-20 Thread Alexey Gorshkov
New submission from Alexey Gorshkov: example code is in attachment example URI is (for example): http://127.0.0.1:8005/тест -- components: Extension Modules files: t.py messages: 263819 nosy: animus priority: normal severity: normal status: open title: wsgiref.simple_server breaks unico