Updated base to use cStringIO