[ python-Bugs-1117556 ] SimpleHTTPServer and mimetypes: almost together

SourceForge.net noreply at sourceforge.net
Wed Jun 14 10:50:40 CEST 2006


Bugs item #1117556, was opened at 2005-02-06 23:01
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1117556&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Matthew L Daniel (mdaniel)
Assigned to: Nobody/Anonymous (nobody)
Summary: SimpleHTTPServer and mimetypes: almost together

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2006-06-14 08:50

Message:
Logged In: YES 
user_id=849994

Thanks, fixed in 46955, 46956 (2.4).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1117556&group_id=5470


More information about the Python-bugs-list mailing list