From a35865fada8bb234e2b7ab61e45a4c62a7d8b054 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 16 Dec 2005 19:36:24 +0000 Subject: [PATCH] Patch #1360443: Make SimpleHTTPServer display unencoded directory names. --- Lib/SimpleHTTPServer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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