summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2005-12-16 19:36:08 (GMT)
committerGeorg Brandl <georg@python.org>2005-12-16 19:36:08 (GMT)
commit6ee6952eb2f86d1708a960e235be25cebdf65f58 (patch)
tree4f97d0fd99c8ea50f2818b3164032c8bb9ef1ce1 /Lib
parent08caadcce39d95bcc2ecbde48ed97b9af677d8a9 (diff)
downloadcpython-6ee6952eb2f86d1708a960e235be25cebdf65f58.zip
cpython-6ee6952eb2f86d1708a960e235be25cebdf65f58.tar.gz
cpython-6ee6952eb2f86d1708a960e235be25cebdf65f58.tar.bz2
Patch #1360443: Make SimpleHTTPServer display unencoded directory names.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/SimpleHTTPServer.py5
1 files 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("<title>Directory listing for %s</title>\n" % self.path)
- f.write("<h2>Directory listing for %s</h2>\n" % self.path)
+ displaypath = cgi.escape(urllib.unquote(self.path))
+ f.write("<title>Directory listing for %s</title>\n" % displaypath)
+ f.write("<h2>Directory listing for %s</h2>\n" % displaypath)
f.write("<hr>\n<ul>\n")
for name in list:
fullname = os.path.join(path, name)