[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-03-04 Thread Quanlong Huang (Code Review)
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 
Tested-by: Quanlong Huang 
---
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 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-03-04 Thread Quanlong Huang (Code Review)
Quanlong Huang has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 5: Verified+1 Code-Review+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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 5
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Sat, 05 Mar 2022 06:52:57 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-03-04 Thread Quanlong Huang (Code Review)
Quanlong Huang has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 4: Verified+1

> Patch Set 4: Verified-1
>
> Build failed: https://jenkins.impala.io/job/gerrit-verify-dryrun/7897/

The failure is unrelated to this patch. Filed IMPALA-11161 for it.
Merging this patch.


--
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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 4
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Sat, 05 Mar 2022 06:51:48 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-03-04 Thread Quanlong Huang (Code Review)
Quanlong Huang has removed a vote on this change.

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Removed Verified-1 by Impala Public Jenkins 
--
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: deleteVote
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 4
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-03-03 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 4: Verified-1

Build failed: https://jenkins.impala.io/job/gerrit-verify-dryrun/7897/


--
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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 4
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Thu, 03 Mar 2022 10:03:13 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-03-02 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 4:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/7897/ 
DRY_RUN=false


--
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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 4
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Thu, 03 Mar 2022 05:06:11 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-03-02 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 4: Code-Review+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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 4
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Thu, 03 Mar 2022 05:06:11 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-03-02 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 3:

Build failed: https://jenkins.impala.io/job/gerrit-verify-dryrun/7896/


--
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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 3
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Thu, 03 Mar 2022 04:52:36 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-03-02 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 3:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/7896/ 
DRY_RUN=false


--
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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 3
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Thu, 03 Mar 2022 00:10:11 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-03-02 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 3: Verified-1

Build failed: https://jenkins.impala.io/job/gerrit-verify-dryrun/7893/


--
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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 3
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Wed, 02 Mar 2022 11:49:10 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-03-01 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 3: Code-Review+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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 3
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Wed, 02 Mar 2022 06:41:22 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-03-01 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 3:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/7893/ 
DRY_RUN=false


--
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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 3
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Wed, 02 Mar 2022 06:41:22 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-02-28 Thread Laszlo Gaal (Code Review)
Laszlo Gaal has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 2: Code-Review+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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 2
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Mon, 28 Feb 2022 16:34:34 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-02-24 Thread Quanlong Huang (Code Review)
Quanlong Huang has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 2: Code-Review+1


--
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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 2
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Fri, 25 Feb 2022 00:34:50 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-02-24 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 2:

Build Successful

https://jenkins.impala.io/job/gerrit-code-review-checks/10225/ : Initial code 
review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun 
to run full precommit tests.


--
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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 2
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Thu, 24 Feb 2022 23:01:17 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-02-24 Thread Fang-Yu Rao (Code Review)
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 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-02-24 Thread Laszlo Gaal (Code Review)
Laszlo Gaal has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/18270/1/bin/compare_branches.py
File bin/compare_branches.py:

http://gerrit.cloudera.org:8080/#/c/18270/1/bin/compare_branches.py@271
PS1, Line 271: utf8
Nit: could you please use the same encoding alias at all the three locations on 
this line? I know they are all aliases (cf. 
https://docs.python.org/2/library/codecs.html#standard-encodings), but unifying 
them would save future readers the trip to that web page. Thanks!



--
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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 1
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Thu, 24 Feb 2022 16:04:34 +
Gerrit-HasComments: Yes


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-02-23 Thread Impala Public Jenkins (Code Review)
Impala Public Jenkins has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 1:

Build Successful

https://jenkins.impala.io/job/gerrit-code-review-checks/10218/ : Initial code 
review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun 
to run full precommit tests.


--
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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 1
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Thu, 24 Feb 2022 00:48:37 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-02-23 Thread Quanlong Huang (Code Review)
Quanlong Huang has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18270 )

Change subject: IMPALA-11133 (Addendum): Encode a string in utf8 before 
printing it
..


Patch Set 1: Code-Review+1


--
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: comment
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 1
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Impala Public Jenkins 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang 
Gerrit-Comment-Date: Thu, 24 Feb 2022 00:30:13 +
Gerrit-HasComments: No


[Impala-ASF-CR] IMPALA-11133 (Addendum): Encode a string in utf8 before printing it

2022-02-23 Thread Fang-Yu Rao (Code Review)
Fang-Yu Rao has uploaded this change for review. ( 
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 in '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/1
--
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: newchange
Gerrit-Change-Id: Iad9b1fb0a523e219bc9f40a57ff7335808be283f
Gerrit-Change-Number: 18270
Gerrit-PatchSet: 1
Gerrit-Owner: Fang-Yu Rao 
Gerrit-Reviewer: Fang-Yu Rao 
Gerrit-Reviewer: Laszlo Gaal 
Gerrit-Reviewer: Quanlong Huang