diff options
Diffstat (limited to 'Lib/wsgiref')
-rw-r--r-- | Lib/wsgiref/simple_server.py | 5 | ||||
-rw-r--r-- | Lib/wsgiref/util.py | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Lib/wsgiref/simple_server.py b/Lib/wsgiref/simple_server.py index 44a91fa..a82c80a 100644 --- a/Lib/wsgiref/simple_server.py +++ b/Lib/wsgiref/simple_server.py @@ -11,7 +11,8 @@ module. See also the BaseHTTPServer module docs for other API information. """ from http.server import BaseHTTPRequestHandler, HTTPServer -import urllib, sys +import sys +import urllib.parse from wsgiref.handlers import SimpleHandler __version__ = "0.1" @@ -93,7 +94,7 @@ class WSGIRequestHandler(BaseHTTPRequestHandler): else: path,query = self.path,'' - env['PATH_INFO'] = urllib.unquote(path) + env['PATH_INFO'] = urllib.parse.unquote(path) env['QUERY_STRING'] = query host = self.address_string() diff --git a/Lib/wsgiref/util.py b/Lib/wsgiref/util.py index a4ca02f..2686b66 100644 --- a/Lib/wsgiref/util.py +++ b/Lib/wsgiref/util.py @@ -50,7 +50,7 @@ def guess_scheme(environ): def application_uri(environ): """Return the application's base URI (no PATH_INFO or QUERY_STRING)""" url = environ['wsgi.url_scheme']+'://' - from urllib import quote + from urllib.parse import quote if environ.get('HTTP_HOST'): url += environ['HTTP_HOST'] @@ -70,7 +70,7 @@ def application_uri(environ): def request_uri(environ, include_query=1): """Return the full request URI, optionally including the query string""" url = application_uri(environ) - from urllib import quote + from urllib.parse import quote path_info = quote(environ.get('PATH_INFO','')) if not environ.get('SCRIPT_NAME'): url += path_info[1:] |