Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
dbecb2e2
Commit
dbecb2e2
authored
Jan 04, 2016
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify the test for #712 and add a changelog.
parent
336ed4d3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
changelog.rst
changelog.rst
+4
-0
gevent/pywsgi.py
gevent/pywsgi.py
+2
-0
greentest/test__pywsgi.py
greentest/test__pywsgi.py
+6
-4
No files found.
changelog.rst
View file @
dbecb2e2
...
...
@@ -22,6 +22,10 @@
Reported in :issue:`704` by Shaun Crampton.
- PyPy: Optimize the CFFI backend to use less memory (two pointers per
watcher).
- Python 3: The WSGI ``PATH_INFO`` entry is decoded from URL escapes
using latin-1, not UTF-8. This improves compliance with PEP 333 and
compatibility with some frameworks like Django. Fixed in :pr:`712`
by Ruben De Visscher.
1.1rc2 (Dec 11, 2015)
=====================
...
...
gevent/pywsgi.py
View file @
dbecb2e2
...
...
@@ -956,6 +956,8 @@ class WSGIHandler(object):
path
,
query
=
self
.
path
.
split
(
'?'
,
1
)
else
:
path
,
query
=
self
.
path
,
''
# Note that self.path contains the original str object; if it contains
# encoded escapes, it will NOT match PATH_INFO.
env
[
'PATH_INFO'
]
=
unquote_latin1
(
path
)
env
[
'QUERY_STRING'
]
=
query
...
...
greentest/test__pywsgi.py
View file @
dbecb2e2
...
...
@@ -728,10 +728,12 @@ class TestInternational(TestCase):
validator
=
None
# wsgiref.validate.IteratorWrapper([]) does not have __len__
def
application
(
self
,
environ
,
start_response
):
if
not
PY3
:
self
.
assertEqual
(
environ
[
'PATH_INFO'
],
'/
\
xd0
\
xbf
\
xd1
\
x80
\
xd0
\
xb8
\
xd0
\
xb2
\
xd0
\
xb5
\
xd1
\
x82
'
)
else
:
self
.
assertEqual
(
environ
[
'PATH_INFO'
],
'/
\
u043f
\
u0440
\
u0438
\
u0432
\
u0435
\
u0442
'
.
encode
(
'utf-8'
).
decode
(
'latin-1'
))
path_bytes
=
b'/
\
xd0
\
xbf
\
xd1
\
x80
\
xd0
\
xb8
\
xd0
\
xb2
\
xd0
\
xb5
\
xd1
\
x82
'
if
PY3
:
# Under PY3, the escapes were decoded as latin-1
path_bytes
=
path_bytes
.
decode
(
'latin-1'
)
self
.
assertEqual
(
environ
[
'PATH_INFO'
],
path_bytes
)
self
.
assertEqual
(
environ
[
'QUERY_STRING'
],
'%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81=%D0%BE%D1%82%D0%B2%D0%B5%D1%82'
)
start_response
(
"200 PASSED"
,
[(
'Content-Type'
,
'text/plain'
)])
return
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment