[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Armin for your report. -- components: +Library (Lib) resolution: - fixed stage: test needed - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138 ___ ___

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 29732b43ccf2 by Serhiy Storchaka in branch '3.3': Issue #20138: The wsgiref.application_uri() and wsgiref.request_uri() http://hg.python.org/cpython/rev/29732b43ccf2 New changeset 73781fe1daa2 by Serhiy Storchaka in branch 'default': Issue #20138:

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-11 Thread Armin Ronacher
Armin Ronacher added the comment: Two things wrong with your example: a) PATH_INFO on Python 3 must not be bytes b) PATH_INFO on Python 3 must be latin1 transfer encoded. See unicode_to_wsgi and wsgi_to_bytes functions in PEP . -- ___ Python

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-11 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138 ___ ___

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-11 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138 ___ ___ Python-bugs-list

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: OK, now I understand the issue. Here is a patch which fixes wsgiref.application_uri() and wsgiref.request_uri(). -- keywords: +patch Added file: http://bugs.python.org/file33416/wsgiref_latin1.patch ___ Python

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138 ___ ___ Python-bugs-list

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: SCRIPT_NAME=/spammity, PATH_INFO=/späm) Has the policy of limiting stdlib code to ascii chars, including \ escapes, except where needed for tests, been changed? -- ___ Python tracker rep...@bugs.python.org

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: SCRIPT_NAME=/spammity, PATH_INFO=/späm) Has the policy of limiting stdlib code to ascii chars, including \ escapes, except where needed for tests, been changed? This character is already used in this file. --

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-11 Thread Senthil Kumaran
Senthil Kumaran added the comment: And those examples were only in test. Use of latin-1 to have a literal text for round trip is ok. The patch looks good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: Which version and bugfix release are you using? What is werkzeug and what does it have to do with stdlib urllib? An stdlib test cannot depend on 3rd party code. -- nosy: +terry.reedy stage: - test needed type: - behavior versions: +Python 3.3, Python

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-10 Thread Armin Ronacher
Armin Ronacher added the comment: Which version and bugfix release are you using? You can reproduce it against the current development version of Python 3. What is werkzeug and what does it have to do with stdlib urllib? Werkzeug is a WSGI implementation. An stdlib test cannot depend on

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-10 Thread Armin Ronacher
Armin Ronacher added the comment: What it currently returns: from wsgiref.util import request_uri request_uri({ ... 'wsgi.url_scheme': 'http', ... 'SCRIPT_NAME': '', ... 'PATH_INFO': '/\xe2\x98\x83', ... 'SERVER_PORT': '80', ... 'SERVER_NAME': 'localhost' ... })

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please show us the value of env? Perhaps it is werkzeug creates wrongly quoted URL. request_uri() just calls urllib.parse.quote() which works good. from urllib.parse import quote, unquote quote('/\N{SNOWMAN}') '/%E2%98%83' unquote('/%E2%98%83')

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: from wsgiref.util import request_uri request_uri({ ... 'wsgi.url_scheme': 'http', ... 'SCRIPT_NAME': '', ... 'PATH_INFO': '/\N{SNOWMAN}', ... 'SERVER_PORT': '80', ... 'SERVER_NAME': 'localhost' ... }) 'http://localhost/%E2%98%83' request_uri({ ...

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-10 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138 ___ ___ Python-bugs-list

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-06 Thread Armin Ronacher
New submission from Armin Ronacher: I just noticed through looking through someone else's WSGI framework that wsgiref is incorrectly handling URL handling. It does not go through the WSGI coding dance in the wsgiref.utils.request_uri function. Testcase through werkzeug: from wsgiref.util

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-06 Thread Graham Dumpleton
Changes by Graham Dumpleton graham.dumple...@gmail.com: -- nosy: +grahamd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138 ___ ___

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-06 Thread Florian Apolloner
Changes by Florian Apolloner flor...@apolloner.eu: -- nosy: +apollo13 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138 ___ ___ Python-bugs-list

[issue20138] wsgiref on Python 3.x incorrectly implements URL handling causing mangled Unicode

2014-01-06 Thread Chris Rebert
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20138 ___ ___ Python-bugs-list