Message 260844 - Python tracker
I had the same issue as Jonathan with Python 3.5.1, big chunks of data get truncated (to ~85KB).
The problem disappears when splitting original data into smaller chunks:
def _write(self,data):
chunk_size = 1024
for chunk in (data[i:i+chunk_size] for i in range(0, len(data), chunk_size)):
self.stdout.write(chunk)