summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2017-03-24 22:00:47 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2017-03-24 22:00:47 +0100
commitf140d01d3eea4c82e3ab1f10600148c4946bcbbc (patch)
tree1fdb6e78ef95568b454935fea09569cb7ddc3f6c
parentfa511457866b36bf3686d9398495371363672b77 (diff)
Open static files with mode = 'rb'.
This is a more sane mode for our use, and allows the code to work in python 3, which expects bytes.
-rw-r--r--pastepy.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pastepy.py b/pastepy.py
index 3c919a4..23eb40e 100644
--- a/pastepy.py
+++ b/pastepy.py
@@ -214,7 +214,7 @@ class Paste(object):
self.start_response('404 Not Found', [('Content-Type', 'text/html; charset=utf-8'), ('Location', '/')])
return ['<a href="/">asdf</a>']
self.start_response('200 OK', [('Content-Type', mimetypes.guess_type(filename)[0] or 'text/plain; charset=utf-8')])
- return open(filename)
+ return open(filename, 'rb')
def __call__(self, environ, start_response):
self.environ = environ