Fang-Yu Rao has uploaded a new patch set (#2). ( 
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
---
M bin/compare_branches.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/70/18270/2
--
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: newpatchset
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 2
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]>

Reply via email to