Issue13295
Created on 2011-10-30 15:07 by karlcow, last changed 2022-04-11 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| server-html5.patch | karlcow, 2011-10-30 15:07 | |||
| issue13295.diff | ezio.melotti, 2011-10-30 16:25 | review | ||
| issue13295-2.diff | ezio.melotti, 2011-10-31 18:53 | review | ||
| Messages (14) | |||
|---|---|---|---|
| msg146641 - (view) | Author: karl (karlcow) * | Date: 2011-10-30 15:07 | |
The code has a set of old HTML templates. Here is a patch to change it to very simple html5 templates. |
|||
| msg146643 - (view) | Author: Ezio Melotti (ezio.melotti) * ![]() |
Date: 2011-10-30 16:12 | |
I think HTML 4.01 strict is still fine -- no need to move to HTML 5 yet. The template that uses HTML 3.2 can probably be updated though. |
|||
| msg146644 - (view) | Author: Ezio Melotti (ezio.melotti) * ![]() |
Date: 2011-10-30 16:25 | |
Here's a patch to replace 3.2 with 4.01. The output of the page should be checked and validated before committing this. I'm not sure if this should go in 2.7/3.2 too, on one hand it's not a bug fix so it shouldn't, on the other hand I don't think it will break anything and it's consistent with the doctype used for the error page. |
|||
| msg146658 - (view) | Author: Martin v. Löwis (loewis) * ![]() |
Date: 2011-10-30 20:41 | |
Ezio: your patch is fine for 3.3. I agree it's not a bug fix. I propose the following additional changes, though: - the name of the root element should be lower-case in the DOCTYPE declaration. - DEFAULT_ERROR_MESSAGE should get an opening html tag. karl: HTML 3.2 may be old, but it's not outdated. |
|||
| msg146697 - (view) | Author: karl (karlcow) * | Date: 2011-10-31 15:05 | |
Ezio, Martin, HTML 3.2, HTML 4.01 are not outdated. They have stable specifications. That said their doctypes have not influence at all in browsers. The html5 doctype <!DOCTYPE html> has been chosen because it was the minimal string of characters that put the browsers into strict mode rendering (See Quirks Mode in CSS). The W3C validator is the only tool implementing an SGML parser able to understand HTML 3.2 and HTML 4.01. Note also that the W3C validtor includes an html5 validator if the concern is the validity of the output. |
|||
| msg146701 - (view) | Author: Ezio Melotti (ezio.melotti) * ![]() |
Date: 2011-10-31 15:13 | |
My point is that the HTML5 doctype doesn't bring us anything (except maybe a shorter string), so I don't see the point of changing it. When the HTML5 spec is stable we can switch to it, but even then the update won't change anything. |
|||
| msg146703 - (view) | Author: karl (karlcow) * | Date: 2011-10-31 15:35 | |
Yup. I doesn't bring anything except putting the output in line with the reality of browsers implementations. You may close it. I don't mind. |
|||
| msg146704 - (view) | Author: Éric Araujo (eric.araujo) * ![]() |
Date: 2011-10-31 16:08 | |
I’d rather fix the page (look at the diff to find one violation: the first heading is an h2 instead of h1) and use an HTML5 doctype, as it’s just HTML 4.01 + pragmatism. |
|||
| msg146715 - (view) | Author: Martin v. Löwis (loewis) * ![]() |
Date: 2011-10-31 17:05 | |
I declare the original issue closed - there is no reason to switch to HTML 5 in this code. There are side issues, such as the HTML 3.2 perhaps being incorrect; people who want to commit patches in that respect can just go ahead. |
|||
| msg146718 - (view) | Author: Éric Araujo (eric.araujo) * ![]() |
Date: 2011-10-31 17:15 | |
Okay. |
|||
| msg146729 - (view) | Author: Ezio Melotti (ezio.melotti) * ![]() |
Date: 2011-10-31 18:53 | |
Attached patch updates the pages to pass the validation, use HTML 4.01 and specify the encoding of the page in the <meta> tag. |
|||
| msg146850 - (view) | Author: Éric Araujo (eric.araujo) * ![]() |
Date: 2011-11-02 16:58 | |
Thanks. +0. |
|||
| msg146855 - (view) | Author: Roundup Robot (python-dev) ![]() |
Date: 2011-11-02 17:33 | |
New changeset 10823e7be085 by Ezio Melotti in branch 'default': #13295: http.server now produces valid HTML 4.01 strict. http://hg.python.org/cpython/rev/10823e7be085 |
|||
| msg146856 - (view) | Author: Ezio Melotti (ezio.melotti) * ![]() |
Date: 2011-11-02 17:35 | |
Fixed, thanks for the report and the reviews! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:23 | admin | set | github: 57504 |
| 2011-11-02 17:35:26 | ezio.melotti | set | status: open -> closed resolution: fixed messages: + msg146856 stage: commit review -> resolved |
| 2011-11-02 17:33:56 | python-dev | set | nosy:
+ python-dev messages: + msg146855 |
| 2011-11-02 16:58:45 | eric.araujo | set | messages: + msg146850 |
| 2011-10-31 18:53:40 | ezio.melotti | set | files:
+ issue13295-2.diff stage: patch review -> commit review |
| 2011-10-31 17:15:29 | eric.araujo | set | title: html5 template for Lib/http/server.py -> Fix HTML produced by http.server messages: + msg146718 versions: + Python 2.7, Python 3.2 |
| 2011-10-31 17:05:25 | loewis | set | messages: + msg146715 |
| 2011-10-31 16:08:23 | eric.araujo | set | messages: + msg146704 |
| 2011-10-31 15:51:37 | ezio.melotti | set | assignee: ezio.melotti stage: patch review |
| 2011-10-31 15:35:53 | karlcow | set | messages: + msg146703 |
| 2011-10-31 15:13:28 | ezio.melotti | set | messages: + msg146701 |
| 2011-10-31 15:05:15 | karlcow | set | messages: + msg146697 |
| 2011-10-30 20:41:14 | loewis | set | nosy:
+ loewis messages: + msg146658 |
| 2011-10-30 16:25:08 | ezio.melotti | set | files:
+ issue13295.diff messages: + msg146644 |
| 2011-10-30 16:12:51 | ezio.melotti | set | nosy:
+ eric.araujo, ezio.melotti messages:
+ msg146643 |
| 2011-10-30 15:07:24 | karlcow | create | |

