From 6ee6952eb2f86d1708a960e235be25cebdf65f58 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 16 Dec 2005 19:36:08 +0000 Subject: 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 93af109..eac95ca 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