From 85a4d0c404c767460887eafe5e7aa2511f70bad6 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 1 Jul 2012 11:30:22 +0200 Subject: make StaticFile work with py3k There is no file builtin, and binary mode gives bytes instead of str. --- wsgitools/applications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wsgitools/applications.py b/wsgitools/applications.py index dfd8a2f..9c6dad8 100644 --- a/wsgitools/applications.py +++ b/wsgitools/applications.py @@ -112,7 +112,7 @@ class StaticFile: try: if isinstance(self.filelike, basestring): # raises IOError - stream = file(self.filelike) + stream = open(self.filelike, "rb") size = os.path.getsize(self.filelike) else: stream = self.filelike -- cgit v1.2.3