From 391c8b4ea2fb688f2c0184ee219723d837732937 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 7 Dec 1998 03:53:18 +0000 Subject: [PATCH] Open the file in binary mode -- so serving images from a Windows box might actually work. --- Lib/SimpleHTTPServer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py index 71268558f70..717a472b59a 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