Skip to content

Commit

Permalink
fix reading OFS.Image objects (use interal api call __bytes__)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbauer committed Sep 14, 2018
1 parent 0e564e6 commit 63b4f5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plone/resource/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ def readFile(self, path):
f = self.context.unrestrictedTraverse(path)
except Exception as e:
raise IOError(str(e))
return f.data
if isinstance(f.data, six.binary_type):
return f.data
return f.data.__bytes__()

def listDirectory(self):
return [n for n in self.context.objectIds()
Expand Down

0 comments on commit 63b4f5e

Please sign in to comment.