From ca897e960a4dd05283110dd84ab43838a403e5c4 Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Wed, 2 Nov 2011 19:33:29 +0200 Subject: #13295: http.server now produces valid HTML 4.01 strict. --- Lib/http/server.py | 22 ++++++++++++++-------- Misc/NEWS | 2 ++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Lib/http/server.py b/Lib/http/server.py index e571418..b79d191 100644 --- a/Lib/http/server.py +++ b/Lib/http/server.py @@ -105,6 +105,7 @@ import copy DEFAULT_ERROR_MESSAGE = """\ + Error response @@ -734,10 +735,16 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): list.sort(key=lambda a: a.lower()) r = [] displaypath = html.escape(urllib.parse.unquote(self.path)) - r.append('') - r.append("\nDirectory listing for %s\n" % displaypath) - r.append("\n

Directory listing for %s

\n" % displaypath) - r.append("
\n\n
\n\n\n') + encoded = '\n'.join(r).encode(enc) f = io.BytesIO() f.write(encoded) f.seek(0) diff --git a/Misc/NEWS b/Misc/NEWS index 3cd7621..c751ba6 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -350,6 +350,8 @@ Core and Builtins Library ------- +- Issue #13295: http.server now produces valid HTML 4.01 strict. + - Issue #2892: preserve iterparse events in case of SyntaxError. - Issue #13287: urllib.request and urllib.error now contains a __all__ and -- cgit v0.12