-
Committer:
Ryan Harper
-
Date:
2016-11-30 22:57:10 UTC
-
Revision ID:
ryan.harper@canonical.com-20161130225710-z7puto0dvsvf269m
util.load_file: handle decoding binary data as-needed
Add support for decoding binary data when loading files.
This resolves an issue where curtin.commands.apply_net attempted to
read a file from the system with utf-8 encodeded data and caused
a stacktrace.
Modify one caller in block_info to disable decoding, and add
unittests to support the various modes.
Note, we skip the load_file tests on systems with mock < 2.0.0
which does not support handling open with binary_data as side-effect.