~wesley-wiedenmeier/curtin/error-output

Viewing all changes in revision 322.

  • Committer: Scott Moser
  • Date: 2015-12-17 17:03:06 UTC
  • mfrom: (320.2.4 trunk.lp1526127)
  • Revision ID: smoser@ubuntu.com-20151217170306-p3mnmzt3cpxes8us
subp: add decode parameter, defaulting to replace

previously stdout and stderr of a process called by subp would have
decode('utf-8') called on it. If that raised a UnicodeDecodeError
then it would be passed up.

Some programs used by curtin may at times output such binary data.
The example that triggered this was unexpectd binary data in lsblock
output.

Now, the caller can call subp with the decoding that they want.
Default is decode=replace. If decode=False, no decode is done. To get the
old behavior, the user needs to pass 'decode=strict'

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: