[issue46736] Generate HTML 5 with SimpleHTTPRequestHandler.list_directory

Dominic Davis-Foster report at bugs.python.org
Sun Feb 13 03:33:08 EST 2022


New submission from Dominic Davis-Foster <dom1310df at googlemail.com>:

Currently SimpleHTTPRequestHandler.list_directory (which is used with `python3 -m http.server` amongst other things) generates HTML with the doctype:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

i.e. HTML 4.01.


I propose making the generated page HTML 5 instead. The only necessary change is in the doctype; the rest of the page is valid already. HTML 5 has been supported by Chrome, Firefox, Safari and Opera since 2013, and Edge since 2015 so there shouldn't be any issues with browser compatibility.

The generated page has been HTML 4.01 since https://bugs.python.org/issue13295 in 2011, where it was originally proposed to switch to HTML 5.


Switching to HTML 5 would also allow http.server to be used to serve a simple index for pip that's compliant with PEP 503.

There's some discussion in https://github.com/pypa/pip/issues/10825

----------
components: Library (Lib)
messages: 413173
nosy: dom1310df
priority: normal
severity: normal
status: open
title: Generate HTML 5 with SimpleHTTPRequestHandler.list_directory
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46736>
_______________________________________


More information about the Python-bugs-list mailing list