[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

Dong-hee Na report at bugs.python.org
Fri Feb 8 21:15:26 EST 2019


Dong-hee Na <donghee.na92 at gmail.com> added the comment:

The proposed patch I mentioned on bpo-35939 also solve the above situation.

Python 3.8.0a1+ (heads/bpo-12317:96d37dbcd2, Feb  8 2019, 12:03:40)
[Clang 9.1.0 (clang-902.0.39.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mimetypes
>>> mimetypes.guess_type("http://example.com")
(None, None)
>>> mimetypes.guess_type("example.com")
('application/x-msdownload', None)
>>>

I've also added the unit tests of mimetypes-host.patch. It works well.
I think that we close this issue also when the bpo-35939 is closed.

Thanks alot!

----------
nosy: +corona10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22347>
_______________________________________


More information about the Python-bugs-list mailing list