From 83cc0d0addd23dbd2b32f4de9835538496ad71cd Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 14 Jun 2006 08:50:03 +0000 Subject: [PATCH] Bug #1117556: SimpleHTTPServer now tries to find and use the system's mime.types file for determining MIME types. --- Lib/SimpleHTTPServer.py | 4 +++- Misc/NEWS | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py index 089936f7405..6f348a1097f 100644 --- a/Lib/SimpleHTTPServer.py +++ b/Lib/SimpleHTTPServer.py @@ -191,7 +191,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 630d36b8457..a8099f74823 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -156,6 +156,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.