replaced cStringIO with StringIO to make python26 happy