summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-06-14 08:50:03 (GMT)
committerGeorg Brandl <georg@python.org>2006-06-14 08:50:03 (GMT)
commit83cc0d0addd23dbd2b32f4de9835538496ad71cd (patch)
tree3d95739b6f53dd4f3d7415b26ff128a6da8d2485
parent0540be96f3b4f9fa684ee7ce4f9e777a169d8138 (diff)
downloadcpython-83cc0d0addd23dbd2b32f4de9835538496ad71cd.zip
cpython-83cc0d0addd23dbd2b32f4de9835538496ad71cd.tar.gz
cpython-83cc0d0addd23dbd2b32f4de9835538496ad71cd.tar.bz2
Bug #1117556: SimpleHTTPServer now tries to find and use the system's
mime.types file for determining MIME types.
-rw-r--r--Lib/SimpleHTTPServer.py4
-rw-r--r--Misc/NEWS3
2 files changed, 6 insertions, 1 deletions
diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py
index 089936f..6f348a1 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 630d36b..a8099f7 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.