Skip to content

Align .py[co] IANA Media Types with RFC6838 #135387

Open
@RokeJulianLockhart

Description

@RokeJulianLockhart

Documentation

The current (unregistered) IANA Media Type types for Python (text\/x-python.*):

  1. ``text/x-python`` instead of ``text/plain``.

    1

  2. <Extension Id="py" ContentType="text/x-python">

    2

  3. cpython/Lib/mimetypes.py

    Lines 540 to 541 in 49d7236

    '.pyc' : 'application/x-python-code',
    '.pyo' : 'application/x-python-code',

    3

...appear to be incorrect, per current guidance, for RFC 6838 states that the x- prefix has been deprecated in favour of the x. tree: 4

The unregistered tree includes media types intended exclusively for use in private environments and only with the active agreement of the parties exchanging them. It uses the x. tree prefix. Examples are application/x.foo, video/x.bar. Media types in this tree cannot be registered.

This type was originally defined in RFC 1590 (published in September 1993) using the x- or X- prefix. RFC 2048 (published in November 1996) introduced the x. prefix, but discouraged use of the unregistered tree, as new personal and vendor trees with relaxed registration requirements are now available. The current RFC 6838 (published in January 2013) maintains the same recommendation, but subtypes prefixed with x- or X- are no longer considered to be members of this tree.

Media types that have been widely deployed (with a subtype prefixed with x- or X-) without being registered, should be, if possible, re-registered with a proper prefixed subtype.

Footnotes

  1. 49d72365cd2d6c09a154a9a061efef4130e2c758/Misc/NEWS.d/3.10.0a1.rst?plain=1#L3030C1-L3030C44

  2. 49d72365cd2d6c09a154a9a061efef4130e2c758/Tools/msi/launcher/launcher_reg.wxs#L9C32-L9C67

  3. 49d72365cd2d6c09a154a9a061efef4130e2c758/Lib/mimetypes.py#L540C9-L541C48

  4. en.wikipedia.org/w/index.php?title=Media_type&oldid=1292890008#Unregistered_tree 5

  5. serialseb.github.com/issues/24#issue-3136552984

Metadata

Metadata

Assignees

No one assigned

    Labels

    pendingThe issue will be closed if no feedback is providedstdlibPython modules in the Lib dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions