Using StringIO instead of cStringIO