Skip to content

Add missing text/rtf to mimetypes #97901

Closed
@amaddio

Description

@amaddio

Feature or enhancement

As of Python 3.10, the types map does not contain an entry for the valid mime type of text/rtf. It only contains a application/rtf entry for non standard types. The missing text/rtf mapping should be added as this is a valid mime type. For example this file type is guessed by the file command (e.g. version 5.04; see libmagic1). My temporary workaround is to add the mapping manually:

mimetypes.add_type("text/rtf", ".rtf", strict=False)

I would dare to add it to the list of standard types, but to be consistend with the other rtf mapping I'd add it to the non standard (strict=False) list.

Pitch

The feature is implemented in a pull request pointing to this issue. I simply adds one one line with the mapping. Other python lovers could take advantage of this functional mapping of a valid mime type to an extension.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython 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