From 3abe9095564ef0ba4996455a62e537d5f18c67fc Mon Sep 17 00:00:00 2001 From: notmasteryet Date: Mon, 5 Sep 2011 22:19:20 -0500 Subject: [PATCH] Allow test.py serve files with spaces in the name --- test/test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test.py b/test/test.py index d1e798d86..0d40efbc8 100644 --- a/test/test.py +++ b/test/test.py @@ -126,14 +126,15 @@ class PDFTestHandler(BaseHTTPRequestHandler): self.wfile.write("

PDFs of " + path + "

\n") for filename in os.listdir(location): if filename.lower().endswith('.pdf'): - self.wfile.write("" + + self.wfile.write("" + filename + "
\n") self.wfile.write("") def do_GET(self): url = urlparse(self.path) # Ignore query string - path, _ = url.path, url.query + path, _ = urllib.unquote_plus(url.path), url.query path = os.path.abspath(os.path.realpath(DOC_ROOT + os.sep + path)) prefix = os.path.commonprefix(( path, DOC_ROOT )) _, ext = os.path.splitext(path.lower())