Commit c0848a97 authored by Jérome Perrin's avatar Jérome Perrin

bytes data

parent e77e2aee
""" """
Return true or false based on if document is convertible or not. Return true or false based on if document is convertible or not.
""" """
MARKER = (None, '',) MARKER = (None, b'',)
portal = context.getPortalObject() portal = context.getPortalObject()
portal_type = context.getPortalType() portal_type = context.getPortalType()
......
...@@ -86,4 +86,4 @@ class Sound(File): ...@@ -86,4 +86,4 @@ class Sound(File):
RESPONSE.setHeader('Content-Range', RESPONSE.setHeader('Content-Range',
'bytes %s-%s/%s' % (start, end-1, total_length)) 'bytes %s-%s/%s' % (start, end-1, total_length))
RESPONSE.setStatus(206) RESPONSE.setStatus(206)
return str(data) return bytes(data)
\ No newline at end of file \ No newline at end of file
...@@ -228,7 +228,7 @@ class CachedConvertableMixin: ...@@ -228,7 +228,7 @@ class CachedConvertableMixin:
if isinstance(data, OFSImage): if isinstance(data, OFSImage):
data = data.data data = data.data
if isinstance(data, Pdata): if isinstance(data, Pdata):
data = str(data) data = bytes(data)
return mime, data return mime, data
security.declareProtected(Permissions.AccessContentsInformation, 'getConversionSize') security.declareProtected(Permissions.AccessContentsInformation, 'getConversionSize')
......
...@@ -39,7 +39,7 @@ class png_to_text(popentransform): ...@@ -39,7 +39,7 @@ class png_to_text(popentransform):
else: else:
popen = Popen([command, tmpname], env=environment, stdin=PIPE, popen = Popen([command, tmpname], env=environment, stdin=PIPE,
stdout=PIPE) stdout=PIPE)
out = popen.communicate(str(data))[0] out = popen.communicate(bytes(data))[0]
if not self.useStdin: if not self.useStdin:
# remove tmp file # remove tmp file
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment