From: Dong-hee Na Date: Wed, 23 Feb 2022 17:59:32 +0000 (+0900) Subject: closes bpo-46736: SimpleHTTPRequestHandler now uses HTML5. (GH-31533) X-Git-Tag: v3.11.0a6~116 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0bb40a42d71873ea267aace8c92a02d66fe36dc2;p=thirdparty%2FPython%2Fcpython.git closes bpo-46736: SimpleHTTPRequestHandler now uses HTML5. (GH-31533) Co-authored-by: Oleg Iarygin --- diff --git a/Lib/http/server.py b/Lib/http/server.py index 194a503c45f7..a6100d482975 100644 --- a/Lib/http/server.py +++ b/Lib/http/server.py @@ -109,11 +109,10 @@ from http import HTTPStatus # Default error message template DEFAULT_ERROR_MESSAGE = """\ - - + + - + Error response @@ -777,14 +776,13 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): displaypath = urllib.parse.unquote(path) displaypath = html.escape(displaypath, quote=False) enc = sys.getfilesystemencoding() - title = 'Directory listing for %s' % displaypath - r.append('') - r.append('\n') - r.append('' % enc) - r.append('%s\n' % title) - r.append('\n

%s

' % title) + title = f'Directory listing for {displaypath}' + r.append('') + r.append('') + r.append('') + r.append(f'') + r.append(f'{title}\n') + r.append(f'\n

{title}

') r.append('
\n