Kaydet (Commit) 83cc0d0a authored tarafından Georg Brandl's avatar Georg Brandl

Bug #1117556: SimpleHTTPServer now tries to find and use the system's

mime.types file for determining MIME types.
üst 0540be96
...@@ -192,6 +192,8 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): ...@@ -192,6 +192,8 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
else: else:
return self.extensions_map[''] return self.extensions_map['']
if not mimetypes.inited:
mimetypes.init() # try to read system mime.types
extensions_map = mimetypes.types_map.copy() extensions_map = mimetypes.types_map.copy()
extensions_map.update({ extensions_map.update({
'': 'application/octet-stream', # Default '': 'application/octet-stream', # Default
......
...@@ -156,6 +156,9 @@ Extension Modules ...@@ -156,6 +156,9 @@ Extension Modules
Library 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 - Bug #1339007: Shelf objects now don't raise an exception in their
__del__ method when initialization failed. __del__ method when initialization failed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment