New submission from Dong-hee Na <donghee.n...@gmail.com>:

The current mimetypes.guess_type API guesses file types based on file 
extensions.

However, there is a more accurate method which is calling sniffing.

Some languages like Go(https://golang.org/pkg/net/http/#DetectContentType) 
provides mimesniff API and the method is implemented based on a standard way 
which is published on https://mimesniff.spec.whatwg.org/


I have a sample code implementation this
https://github.com/corona10/mimesniff/blob/master/mimesniff/mimesniff.py
But the API interface will be changed to mimetypes API.


So I would like to provide mimetypes.sniff API rather than a new stdlib package 
like mimesniff.

----------
components: Library (Lib)
messages: 370591
nosy: corona10, vstinner
priority: normal
severity: normal
status: open
title: Implement mimetypes.sniff
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40841>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to