Replace io.BytesIO with six.BytesIO for py2.6/2.7