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: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=391c8b4ea2fb688f2c0184ee219723d837732937;p=thirdparty%2FPython%2Fcpython.git 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 71268558f703..717a472b59a4 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