Merge lp:~rodsmith/checkbox/smart-utf-probs into lp:checkbox

Proposed by Rod Smith
Status: Merged
Approved by: Jeff Lane 
Approved revision: 4042
Merged at revision: 4045
Proposed branch: lp:~rodsmith/checkbox/smart-utf-probs
Merge into: lp:checkbox
Diff against target: 13 lines (+2/-1)
1 file modified
providers/plainbox-provider-checkbox/bin/disk_smart (+2/-1)
To merge this branch: bzr merge lp:~rodsmith/checkbox/smart-utf-probs
Reviewer Review Type Date Requested Status
Jeff Lane  Approve
Review via email: mp+273905@code.launchpad.net

Description of the change

Altered disk_smart test to explicitly specify utf-8 encoding and to reject characters with encoding errors when probing to see if the disk supports SMART. Fix in response to https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1504181

To post a comment you must log in.
Revision history for this message
Jeff Lane  (bladernr) wrote :

thanks for fixing this quickly

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'providers/plainbox-provider-checkbox/bin/disk_smart'
2--- providers/plainbox-provider-checkbox/bin/disk_smart 2015-08-14 14:59:19 +0000
3+++ providers/plainbox-provider-checkbox/bin/disk_smart 2015-10-08 19:13:47 +0000
4@@ -114,7 +114,8 @@
5 command = 'smartctl -i %s' % disk
6 diskinfo_bytes = (Popen(command, stdout=PIPE, shell=True)
7 .communicate()[0])
8- diskinfo = diskinfo_bytes.decode().splitlines()
9+ diskinfo = (diskinfo_bytes.decode(encoding='utf-8', errors='ignore')
10+ .splitlines())
11
12 logging.debug('SMART Info for disk %s', disk)
13 logging.debug(diskinfo)

Subscribers

People subscribed via source and target branches