Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Addapplication/yaml tomimetypes #132054

Closed
Closed
Labels
stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement
@Kristinita

Description

@Kristinita

1. Summary

It would be nice if Python will associate popular configuration extensions.yaml and.yml with theapplication/yaml media type.

2. Behavior

2.1. Current

>>>importmimetypes>>>mimetypes.guess_file_type("KiraGoddess.yaml")(None,None)>>>mimetypes.guess_file_type("KiraGoddess.yml")(None,None)

2.2. Desired

>>>importmimetypes>>>mimetypes.guess_file_type("KiraGoddess.yaml")('application/yaml',None)>>>mimetypes.guess_file_type("KiraGoddess.yml")('application/yaml',None)

3. Specifications

Comments in themimetypes Python module:

# Before adding new types, make sure they are either registered with IANA,
# at http://www.iana.org/assignments/media-types
# or extensions, i.e. using the x- prefix

RFC 9512 Abstract:

This document registers theapplication/yaml media type and the+yaml structured syntax suffix with IANA.

RFC 9512 “Filename Extension” section:

The "yaml" filename extension is the preferred one; it is the most popular and widely used on the web. The "yml" filename extension is still used. The simultaneous usage of two filename extensions in the same context might cause interoperability issues (e.g., when both a "config.yaml" and a "config.yml" are present).

IANA specification forapplication/yaml.

4. Has this already been discussed elsewhere?

Issue authors in this issue tracker write:

This is a minor feature, which does not need previous discussion elsewhere

Thanks.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp