Mark Dong <jindo...@andrew.cmu.edu> added the comment:

Hi, 

I want to follow up on this:

On Linux (Ubuntu 20.04.4 LTS), the module also loads everything it finds in the 
registries (a.k.a, entries in the "knownfiles" variable) in "strict" mode, even 
though some of them aren't registered in IANA. (I'm assuming that "registered 
in IANA" means everything in here only: 
https://www.iana.org/assignments/media-types/media-types.xhtml)

For example, ".com" is recognized as having mimetype 
"applications/x-msdos-program". This becomes problematic when an unparsed URL, 
such as "http://abc.efg/hij.html#http://abc.com";, is fed into guess_type.

I'm wondering if we should make the documentation clearer and state that 
"strict=True" means using IANA registered types along with the types found on 
the machine, it seems like this is the expected behavior based on the comments 
in "def _default_mime_types()", or we should actually move everything other 
than IANA registered types out of strict mode.

Best regards,
Mark

----------
components:  -Windows
nosy: +markdtw
versions:  -Python 3.11

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

Reply via email to