Merge lp:~canonical-platform-qa/ubuntu-release-upgrader/fix-garbled-DistUpgradeViewNonInteractive-output into lp:ubuntu-release-upgrader

Proposed by Christopher Lee
Status: Merged
Merged at revision: 2946
Proposed branch: lp:~canonical-platform-qa/ubuntu-release-upgrader/fix-garbled-DistUpgradeViewNonInteractive-output
Merge into: lp:ubuntu-release-upgrader
Diff against target: 20 lines (+2/-1)
1 file modified
DistUpgrade/DistUpgradeViewNonInteractive.py (+2/-1)
To merge this branch: bzr merge lp:~canonical-platform-qa/ubuntu-release-upgrader/fix-garbled-DistUpgradeViewNonInteractive-output
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+284203@code.launchpad.net

Commit message

Decode os.read() bytes to string to clarify output.

Description of the change

Ensure output when using DistUpgradeViewNonInteractive frontend is not garbled as single bytestream escaped characters.

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for fixing this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'DistUpgrade/DistUpgradeViewNonInteractive.py'
2--- DistUpgrade/DistUpgradeViewNonInteractive.py 2015-01-20 22:30:06 +0000
3+++ DistUpgrade/DistUpgradeViewNonInteractive.py 2016-01-28 04:19:08 +0000
4@@ -22,6 +22,7 @@
5 import apt
6 import apt_pkg
7 import logging
8+import locale
9 import time
10 import sys
11 import os
12@@ -225,7 +226,7 @@
13 self.last_activity = time.time()
14 try:
15 s = os.read(self.master_fd, 1)
16- sys.stdout.write("%s" % s)
17+ sys.stdout.write("%s" % s.decode(locale.getpreferredencoding()))
18 except OSError:
19 # happens after we are finished because the fd is closed
20 return

Subscribers

People subscribed via source and target branches