UnicodeDecodeError with xenial on custom package-installs

Bug #1684081 reported by Philip Choi
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
diskimage-builder
New
Undecided
Unassigned

Bug Description

Was using disk-image-create command to build a Ubuntu 16.04 (Xenial) image with custom elements containing "chrony" package. It failed with below exception. Ubuntu 16.04 is installed with python3 as default so I guess somewhere within package-installs-v2 is not handling the UTF8<>ascii conversion very well. But to be honest I am not a developer so any pointer or suggestions to address or get around this would be greatly appreciated. Thanks!

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Setting up chrony (2.1.1-1) ...
Traceback (most recent call last):
  File "/usr/local/bin/package-installs-v2", line 137, in <module>
    main()
  File "/usr/local/bin/package-installs-v2", line 130, in main
    process_output(install_args, follow=True)
  File "/usr/local/bin/package-installs-v2", line 38, in process_output
    for line in iter(proc.stdout.readline, ''):
  File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 59: ordinal not in range(128)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Revision history for this message
Mathieu Gagné (mgagne) wrote :

I don't have a proper fix to suggest. I however managed to workaround the issue by exporting the following environment variables in a custom DIB element:

# foobar/environment.d/00-locale
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.