From: Georg Brandl Date: Fri, 16 Dec 2005 19:36:08 +0000 (+0000) Subject: Patch #1360443: Make SimpleHTTPServer display unencoded directory names. X-Git-Tag: v2.5a0~1017 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6ee6952eb2f86d1708a960e235be25cebdf65f58;p=thirdparty%2FPython%2Fcpython.git Patch #1360443: Make SimpleHTTPServer display unencoded directory names. --- diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py index 93af10900aae..eac95cab96a7 100644 --- a/Lib/SimpleHTTPServer.py +++ b/Lib/SimpleHTTPServer.py @@ -103,8 +103,9 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): return None list.sort(key=lambda a: a.lower()) f = StringIO() - f.write("Directory listing for %s\n" % self.path) - f.write("

Directory listing for %s

\n" % self.path) + displaypath = cgi.escape(urllib.unquote(self.path)) + f.write("Directory listing for %s\n" % displaypath) + f.write("

Directory listing for %s

\n" % displaypath) f.write("
\n