use cStringIO on py2