]> granicus.if.org Git - python/commitdiff
Open the file in binary mode -- so serving images from a Windows box
authorGuido van Rossum <guido@python.org>
Mon, 7 Dec 1998 03:53:18 +0000 (03:53 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 7 Dec 1998 03:53:18 +0000 (03:53 +0000)
might actually work.

Lib/SimpleHTTPServer.py

index 71268558f703bbc684f5c59b88577b0f8ba905e3..717a472b59a4a022fdfb648d3e1aa49fc7039764 100644 (file)
@@ -64,7 +64,7 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
             self.send_error(403, "Directory listing not supported")
             return None
         try:
-            f = open(path)
+            f = open(path, 'rb')
         except IOError:
             self.send_error(404, "File not found")
             return None