Python 3 compatibility regarding StringIO.