Use StringIO.StringIO for Python2