summaryrefslogtreecommitdiffstats
path: root/Lib/wsgiref/util.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-01-12 10:08:11 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-01-12 10:08:11 (GMT)
commit0abbe8c090707130fd492307b79cf5c608dedce0 (patch)
treea5e48384c257bc97888162ecb2a864d39156f906 /Lib/wsgiref/util.py
parent55c9e0366ee4477c34c881c942face4368cd4501 (diff)
downloadcpython-0abbe8c090707130fd492307b79cf5c608dedce0.zip
cpython-0abbe8c090707130fd492307b79cf5c608dedce0.tar.gz
cpython-0abbe8c090707130fd492307b79cf5c608dedce0.tar.bz2
Issue #20138: The wsgiref.application_uri() and wsgiref.request_uri()
functions now conform to PEP 3333 when handle non-ASCII URLs.
Diffstat (limited to 'Lib/wsgiref/util.py')
-rw-r--r--Lib/wsgiref/util.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/wsgiref/util.py b/Lib/wsgiref/util.py
index 1f1e6cc..516fe89 100644
--- a/Lib/wsgiref/util.py
+++ b/Lib/wsgiref/util.py
@@ -57,14 +57,14 @@ def application_uri(environ):
if environ['SERVER_PORT'] != '80':
url += ':' + environ['SERVER_PORT']
- url += quote(environ.get('SCRIPT_NAME') or '/')
+ url += quote(environ.get('SCRIPT_NAME') or '/', encoding='latin1')
return url
def request_uri(environ, include_query=True):
"""Return the full request URI, optionally including the query string"""
url = application_uri(environ)
from urllib.parse import quote
- path_info = quote(environ.get('PATH_INFO',''),safe='/;=,')
+ path_info = quote(environ.get('PATH_INFO',''), safe='/;=,', encoding='latin1')
if not environ.get('SCRIPT_NAME'):
url += path_info[1:]
else: