If the Codec.decode() method cannot encode the given data to utf-8
an Encoding exception is raised which causes kiwi to raise a
KiwiDecodingError. That way to handle the error causes an image
build to fail. However, this sort of error for example happens if
the .changes file of a package contains invalid characters. From
a user perspective this cannot be fixed and you cannot build the
image because of a stupid character error in a .changes file
outside your control. Because of this reason this commit handles
the decode error case differently and applies the 'replace'
strategy on error. The characters in questions gets replaced and
the rest of the data which can be decoded is returned.
This commit adds a stderr_to_stdout option to Command.run method to
redirect stderr to stdout.
Additionally this commit also includes to the debug log the dracut
call output, including both, stderr and stdout.
Fixes#1114
@classmethod are used in Python to represent methods that can
query and update the class (cls parameter). Is expected to be
used for metaprograming, or advanced techniques that require the
access to the class itself, before we have an instance.
@staticmethod are used to associate a function to a class. It will
not be have access to the instance (self) not the class (cls). In
other programming languages are known as class methods.
This patch replace all the @classmethod with @staticmethod when
there is not need to access to the cls parameter, because the
intention is to be used as normal functions.
In case of a literal decoding failure it tries to decode
the result in utf-8. This is handy in python2 environments where
python and the host might be using different charset configurations.
In python3 this issue seams to be solved.
Fixes#829 and bsc#1110871