diskimage-builder/diskimage_builder
Tobias Henkel b62ed1823c
Fix encoding issue during processing output
When using the package-installs element there can be some encoding
problems if the package installation emits unparsable output
[1]. However in this case we just want to forward the output to the
console which normally can handle this correctly. In order to fix this
switch off universal_newlines processing such that we just operate on
bytes.

Further we have to decode the lines without setting the locale and
ignoring errors. This is required because print encodes without
setting the locale and thus we need to filter/modify the stream such
that it doesn't crash.

[1] Traceback:
2018-03-01 09:58:00.515 | Traceback (most recent call last):
2018-03-01 09:58:00.515 |   File "/usr/local/bin/package-installs-v2", line 137, in <module>
2018-03-01 09:58:00.515 |     main()
2018-03-01 09:58:00.515 |   File "/usr/local/bin/package-installs-v2", line 130, in main
2018-03-01 09:58:00.515 |     process_output(install_args, follow=True)
2018-03-01 09:58:00.515 |     for line in iter(proc.stdout.readline, ''):
2018-03-01 09:58:00.515 |   File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
2018-03-01 09:58:00.515 |     return codecs.ascii_decode(input, self.errors)[0]
2018-03-01 09:58:00.515 | UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 34: ordinal not in range(128)

Change-Id: Ie4af9b4523459a630cfb98d09093bfe9ef7aa61e
2018-03-01 16:09:25 +00:00
..
block_device Set default label for XFS disks 2018-01-29 15:10:08 +11:00
elements Fix encoding issue during processing output 2018-03-01 16:09:25 +00:00
lib Fix /dev/pts mount options handling 2017-11-24 07:14:56 +00:00
tests Move "functional" unit tests under block-device 2017-06-05 12:22:52 +10:00
__init__.py Bump hacking to 0.9.x series 2014-07-21 10:15:41 +02:00
disk_image_create.py squash-package-install to use the correct python 2017-03-13 20:24:39 +11:00
element_dependencies.py Trivial fix typos 2017-05-31 11:17:05 +07:00
logging_config.py Add timestamp output filter 2017-06-16 15:58:50 +10:00
paths.py Move diskimage-image-create to an entry point 2016-11-02 05:12:11 +00:00
version.py Create docs site containing element READMEs 2015-02-10 11:45:35 -08:00