Fix GeneratorFile for working with BufferedReader
The user files system uses a BufferedReader along with the magic library to determine the mime type of the user file being served. Currently, BufferedReader fails with an exception on Swift storage, because Swift storage returns a GeneratorFile, which is missing the `readable()` method.
This commit is contained in:
parent
1173192739
commit
30ede029d5
2 changed files with 31 additions and 0 deletions
|
@ -33,6 +33,9 @@ class GeneratorFile(object):
|
|||
raise StopIteration
|
||||
return r
|
||||
|
||||
def readable(self):
|
||||
return not self._closed
|
||||
|
||||
def readline(self):
|
||||
buf = []
|
||||
while True:
|
||||
|
|
Reference in a new issue