Author corona10
Recipients corona10, vstinner
Date 2020-06-02.06:42:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1591080165.24.0.514984320107.issue40841@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-06-02 06:42:45corona10setrecipients: + corona10, vstinner
2020-06-02 06:42:45corona10setmessageid: <1591080165.24.0.514984320107.issue40841@roundup.psfhosted.org>
2020-06-02 06:42:45corona10linkissue40841 messages
2020-06-02 06:42:44corona10create