Commit 777535e6 authored by Ruben De Visscher's avatar Ruben De Visscher

Don't pass encoding to unquote on Python 2 since it is not supported there.

parent 84c89421
...@@ -16,6 +16,7 @@ import sys ...@@ -16,6 +16,7 @@ import sys
import time import time
import traceback import traceback
from datetime import datetime from datetime import datetime
try: try:
from urllib import unquote from urllib import unquote
except ImportError: except ImportError:
...@@ -26,6 +27,12 @@ import gevent ...@@ -26,6 +27,12 @@ import gevent
from gevent.server import StreamServer from gevent.server import StreamServer
from gevent.hub import GreenletExit, PY3, reraise from gevent.hub import GreenletExit, PY3, reraise
from functools import partial
if PY3:
unquote_latin1 = partial(unquote, encoding='latin-1')
else:
unquote_latin1 = unquote
_no_undoc_members = True # Don't put undocumented things into sphinx _no_undoc_members = True # Don't put undocumented things into sphinx
__all__ = [ __all__ = [
...@@ -949,7 +956,7 @@ class WSGIHandler(object): ...@@ -949,7 +956,7 @@ class WSGIHandler(object):
path, query = self.path.split('?', 1) path, query = self.path.split('?', 1)
else: else:
path, query = self.path, '' path, query = self.path, ''
env['PATH_INFO'] = unquote(path, encoding='latin-1') env['PATH_INFO'] = unquote_latin1(path)
env['QUERY_STRING'] = query env['QUERY_STRING'] = query
if self.headers.typeheader is not None: if self.headers.typeheader is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment