summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-12-07 03:53:18 (GMT)
committerGuido van Rossum <guido@python.org>1998-12-07 03:53:18 (GMT)
commit391c8b4ea2fb688f2c0184ee219723d837732937 (patch)
tree2f64579052b815218dc4f80b38f704b2f31040e9 /Lib
parent08833f2a6dce778a3b1cde627d853441dcce5844 (diff)
downloadcpython-391c8b4ea2fb688f2c0184ee219723d837732937.zip
cpython-391c8b4ea2fb688f2c0184ee219723d837732937.tar.gz
cpython-391c8b4ea2fb688f2c0184ee219723d837732937.tar.bz2
Open the file in binary mode -- so serving images from a Windows box
might actually work.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/SimpleHTTPServer.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py
index 7126855..717a472 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