mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Open the file in binary mode -- so serving images from a Windows box
might actually work.
This commit is contained in:
parent
08833f2a6d
commit
391c8b4ea2
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue