Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 391c8b4

Browse files
committed
Open the file in binary mode -- so serving images from a Windows box
might actually work.
1 parent 08833f2 commit 391c8b4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/SimpleHTTPServer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def send_head(self):
6464
self.send_error(403, "Directory listing not supported")
6565
return None
6666
try:
67-
f = open(path)
67+
f = open(path, 'rb')
6868
except IOError:
6969
self.send_error(404, "File not found")
7070
return None

0 commit comments

Comments
 (0)