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
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20138
___
___
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:
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
Changes by R. David Murray rdmur...@bitdance.com:
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20138
___
___
Changes by Terry J. Reedy tjre...@udel.edu:
--
nosy: +orsenthil
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20138
___
___
Python-bugs-list
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
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +barry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20138
___
___
Python-bugs-list
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
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.
--
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
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
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
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'
... })
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')
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({
...
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20138
___
___
Python-bugs-list
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
Changes by Graham Dumpleton graham.dumple...@gmail.com:
--
nosy: +grahamd
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20138
___
___
Changes by Florian Apolloner flor...@apolloner.eu:
--
nosy: +apollo13
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20138
___
___
Python-bugs-list
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20138
___
___
Python-bugs-list
21 matches
Mail list logo