This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: SimpleHTTPServer and mimetypes: almost together
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, mdaniel
Priority: normal Keywords:

Created on 2005-02-06 23:01 by mdaniel, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg24179 - (view) Author: Matthew L Daniel (mdaniel) Date: 2005-02-06 23:01
SimpleHTTPServer.py from python2.4 (and python2.3, so
this is an old bug that hasn't bothered anyone before
now), uses mimetypes for mime-type detection.

The issue is that it only uses 50% of mimetypes, in two
different ways.

I argue that SimpleHTTPServer should not be copying
mimetypes type-map into its own variable instead of
leveraging  the functionality found in
mimetypes.guess_type (which guesses without regard to
case, btw).

If, however, you guys stick with your own
extension_map, this bug is really about calling ``if
not mimetypes.inited: mimetypes.init()'' before doing
any such copying.

This allows mimetypes to find mime.types on the local
host and populate the types_map with lots of meaningful
mime types. If it doesn't find any mime.types, no harm
done.
msg24180 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-06-14 08:50
Logged In: YES 
user_id=849994

Thanks, fixed in 46955, 46956 (2.4).
History
Date User Action Args
2022-04-11 14:56:09adminsetgithub: 41536
2005-02-06 23:01:01mdanielcreate