Use six.StringIO