Merge ~sylvain-pineau/checkbox-ng:fix-1838366 into checkbox-ng:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 30dfbb0e9b53544024fa7cb47c578c5f083cd985
Merged at revision: 04a85a6d5ef560c750af9a9c4165100cb2711a75
Proposed branch: ~sylvain-pineau/checkbox-ng:fix-1838366
Merge into: checkbox-ng:master
Diff against target: 27 lines (+10/-6)
1 file modified
checkbox_ng/launcher/run.py (+10/-6)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
Sylvain Pineau (community) Needs Resubmitting
Review via email: mp+373702@code.launchpad.net

Description of the change

Patch for the linked bug

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

Might it be worth printing out some informational message so developers + testers know what's happening?

"<hiding binary test output>" or similar?

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

--------------[ Running job 4 / 7. Estimated time left: 0:00:02 ]---------------
--------------[ Attach FWTS desktop diagnosis log to submission ]---------------
ID: com.canonical.certification::firmware/fwts_desktop_diagnosis_results.log.gz
Category: com.canonical.plainbox::firmware
... 8< -------------------------------------------------------------------------
(Hiding binary test output)
Outcome: job passed

review: Needs Resubmitting
Revision history for this message
Jonathan Cave (jocave) wrote :

Lovely, thanks :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/checkbox_ng/launcher/run.py b/checkbox_ng/launcher/run.py
2index e3f10e1..3f927c1 100644
3--- a/checkbox_ng/launcher/run.py
4+++ b/checkbox_ng/launcher/run.py
5@@ -170,12 +170,16 @@ class NormalUI(IJobRunnerUI):
6 'stdout': sys.stdout,
7 'stderr': sys.stderr
8 }[stream_name]
9- if stream_name == 'stdout':
10- print(self.C.GREEN(line.decode("UTF-8", "ignore")),
11- end='', file=stream)
12- elif stream_name == 'stderr':
13- print(self.C.RED(line.decode("UTF-8", "ignore")),
14- end='', file=stream)
15+ try:
16+ if stream_name == 'stdout':
17+ print(self.C.GREEN(line.decode("UTF-8")),
18+ end='', file=stream)
19+ elif stream_name == 'stderr':
20+ print(self.C.RED(line.decode("UTF-8")),
21+ end='', file=stream)
22+ except UnicodeDecodeError:
23+ self.show_cmd_output = False
24+ print(self.C.BLACK("(" + _("Hiding binary test output") + ")"))
25 stream.flush()
26
27 def finished_executing_program(self, returncode):

Subscribers

People subscribed via source and target branches