From: Georg Brandl Date: Fri, 16 Dec 2005 19:36:24 +0000 (+0000) Subject: Patch #1360443: Make SimpleHTTPServer display unencoded directory names. X-Git-Tag: v2.4.3c1~186 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a35865fada8bb234e2b7ab61e45a4c62a7d8b054;p=thirdparty%2FPython%2Fcpython.git Patch #1360443: Make SimpleHTTPServer display unencoded directory names. --- diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py index 4d8eb77fc242..4b27d17005d1 100644 --- a/Lib/SimpleHTTPServer.py +++ b/Lib/SimpleHTTPServer.py @@ -99,8 +99,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