fix bytes/unicode for py3