Workaround for weird behaviour of pypy when writing to the io classes.