Quanlong Huang has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/18270 )
Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before printing it ...................................................................... IMPALA-11133 (Addendum): Encode a string in utf8 before printing it In the first part of this patch, we decoded a string with 'utf8' in order to print it (on the command line) since the author field of a commit could contain non-ASCII characters. However, we did not take into consideration that in some scenarios, we would like to redirect the output to another file. If this is the case, then we may encounter a UnicodeEncodeError due to sys.stdout.encoding being None. To resolve the issue, we encode the formatted string with 'utf8'. Testing: - Manually verified that we won't get a UnicodeEncodeError if we redirect the output to another file. Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f Reviewed-on: http://gerrit.cloudera.org:8080/18270 Reviewed-by: Quanlong Huang <[email protected]> Tested-by: Quanlong Huang <[email protected]> --- M bin/compare_branches.py 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Quanlong Huang: Looks good to me, approved; Verified -- To view, visit http://gerrit.cloudera.org:8080/18270 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f Gerrit-Change-Number: 18270 Gerrit-PatchSet: 6 Gerrit-Owner: Fang-Yu Rao <[email protected]> Gerrit-Reviewer: Fang-Yu Rao <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Laszlo Gaal <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]>
