Python 3.x compatability - StringIO