From: Guido van Rossum Date: Mon, 7 Dec 1998 03:53:18 +0000 (+0000) Subject: Open the file in binary mode -- so serving images from a Windows box X-Git-Tag: v1.5.2b1~115 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=391c8b4ea2fb688f2c0184ee219723d837732937;p=python Open the file in binary mode -- so serving images from a Windows box might actually work. --- diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py index 71268558f7..717a472b59 100644 --- a/Lib/SimpleHTTPServer.py +++ b/Lib/SimpleHTTPServer.py @@ -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