fixing StringIO python 2 3