Use six.text_type for casting to unicode