python: Deal with str and byte differences.