fix six.u and unicode usage
fix StringIO import compability