We found that compare_branches.py could fail if the author of a commit contains non-unicode characters.
For instance, if we try to compare a branch 'apache-ref-master' consisting of a recently committed patch https://gerrit.cloudera.org/c/18215/ (
IMPALA-11113 and IMPALA-11114: fixed single_node_perf_run.py for TPCDS) to an older branch 'cdw-master-staging' by "$IMPALA_HOME/bin/compare_branches.py --source_remote_name="" --source_branch apache-ref-master --target_remote_name="" --target_branch cdw-master-staging", we will get the following error message. Because the author field, i.e., "Gergely Fürnstáhl", contains non-ascii characters.
One solution to resolving the issue is to surround 'author' with 'repr()'.