Comment 9 for bug 1773150

Revision history for this message
Marcus Gaskamp (mgpanther) wrote : Re: [2.4.0~rc1] smartctl verify fails due to Unicode in Disk Vendor Name

I managed to export the default scripts and get them working.

The issue seems to be in the syntax of .decode('utf-8') by default the error handling is strict which will break via exception.

In this case that syntax will break the script for all decode exceptions anywhere in the smart output.

This is overly cautious as the smart output is compared to a regex anyway. If the command output didn't match the regex it should still fail the test only more gracefully.

Considering how it's used I think all instances in this script are safe to be replaced with .decode('utf-8', 'replace') which will not stop script execution dead as previously noted.

Perhaps some additional parsing may need to be done but I think this will patch the script to work as expected the vast majority of the time.

There are three places where .decode will break execution. I've included my patch.