Align `.py[co]` IANA Media Types with RFC6838 · Issue #135387 · python/cpython · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

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

Closed as not planned
Closed as not planned
@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

      TMZ Celebrity News – Breaking Stories, Videos & Gossip

      Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

      Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

      🎥 Watch TMZ Live

      TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.