[entities] cw 3.22: Binary is now a BytesIO (closes #10624160)

this is a workaround for cubicweb bug #10669732

authorSamuel Trégouët <samuel.tregouet@logilab.fr>
changeset8381a7653419
branchdefault
phasepublic
hiddenno
parent revision#00f668018eec [test] make hook tests pass with cubicweb 3.22 (related to #10624160)
child revision#8c0adbe9e7f9 [pkg] centos packaging conflict with filesystem permission on centos7
files modified by this revision
entities.py
# HG changeset patch
# User Samuel Trégouët <samuel.tregouet@logilab.fr>
# Date 1454665013 -3600
# Fri Feb 05 10:36:53 2016 +0100
# Node ID 8381a76534191188adeaff0066845494011e751f
# Parent 00f668018eec620834c0ea76e1bebdf3a641bcda
[entities] cw 3.22: Binary is now a BytesIO (closes #10624160)

this is a workaround for cubicweb bug #10669732

diff --git a/entities.py b/entities.py
@@ -93,10 +93,11 @@
1          for outname, content in communicate(proc):
2              self.debug('Appending %s bytes to %s (stream %s)',
3                         len(content), outputs[outname].eid, outname)
4              outputs[outname].data.write(content)
5              outputs[outname].cw_set(data=outputs[outname].data)
6 +            outputs[outname].data.seek(0, 2)  # go to the end of stream
7              self._cw.commit(free_cnxset=False)
8 
9          return proc.wait()
10 
11      def _finalize(self, return_code, trname):