use cStringIO and optionally disable colour