Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate HTML 5 with SimpleHTTPRequestHandler.list_directory #90892

Closed
dom1310df mannequin opened this issue Feb 13, 2022 · 3 comments
Closed

Generate HTML 5 with SimpleHTTPRequestHandler.list_directory #90892

dom1310df mannequin opened this issue Feb 13, 2022 · 3 comments
Labels
3.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@dom1310df
Copy link
Mannequin

dom1310df mannequin commented Feb 13, 2022

BPO 46736
Nosy @benjaminp, @merwok, @corona10
PRs
  • bpo-46736: SimpleHTTPRequestHandler now uses HTML5 grammar. #31533
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2022-02-23.17:59:36.369>
    created_at = <Date 2022-02-13.08:33:08.013>
    labels = ['type-feature', 'library', '3.11']
    title = 'Generate HTML 5 with SimpleHTTPRequestHandler.list_directory'
    updated_at = <Date 2022-02-23.17:59:36.363>
    user = 'https://bugs.python.org/dom1310df'

    bugs.python.org fields:

    activity = <Date 2022-02-23.17:59:36.363>
    actor = 'benjamin.peterson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-02-23.17:59:36.369>
    closer = 'benjamin.peterson'
    components = ['Library (Lib)']
    creation = <Date 2022-02-13.08:33:08.013>
    creator = 'dom1310df'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46736
    keywords = ['patch']
    message_count = 3.0
    messages = ['413173', '413500', '413834']
    nosy_count = 4.0
    nosy_names = ['benjamin.peterson', 'eric.araujo', 'corona10', 'dom1310df']
    pr_nums = ['31533']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue46736'
    versions = ['Python 3.11']

    @dom1310df
    Copy link
    Mannequin Author

    dom1310df mannequin commented Feb 13, 2022

    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 pypa/pip#10825

    @dom1310df dom1310df mannequin added 3.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Feb 13, 2022
    @merwok
    Copy link
    Member

    merwok commented Feb 18, 2022

    Would you like to make a pull request?

    @benjaminp
    Copy link
    Contributor

    New changeset 0bb40a4 by Dong-hee Na in branch 'main':
    closes bpo-46736: SimpleHTTPRequestHandler now uses HTML5. (GH-31533)
    0bb40a4

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants