use six.text_type.encode to test for non-ascii bytes_type