From: Georg Brandl Date: Wed, 14 Jun 2006 08:50:05 +0000 (+0000) Subject: Bug #1117556: SimpleHTTPServer now tries to find and use the system's X-Git-Tag: v2.4.4c1~176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7d903af232a4e2bb69a180a5f286e77ca29ba62;p=thirdparty%2FPython%2Fcpython.git Bug #1117556: SimpleHTTPServer now tries to find and use the system's mime.types file for determining MIME types. (backport from rev. 46955) --- diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py index fe0c46653f4a..482d189317d0 100644 --- a/Lib/SimpleHTTPServer.py +++ b/Lib/SimpleHTTPServer.py @@ -185,7 +185,9 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): return self.extensions_map[ext] else: return self.extensions_map[''] - + + if not mimetypes.inited: + mimetypes.init() # try to read system mime.types extensions_map = mimetypes.types_map.copy() extensions_map.update({ '': 'application/octet-stream', # Default diff --git a/Misc/NEWS b/Misc/NEWS index 691d20981f87..a4c1864c2b35 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -53,6 +53,9 @@ Extension Modules Library ------- +- Bug #1117556: SimpleHTTPServer now tries to find and use the system's + mime.types file for determining MIME types. + - Bug #1339007: Shelf objects now don't raise an exception in their __del__ method when initialization failed.