Py2/3 StringIO usage