You can reproduce this exception in at least some non-Unicode locales, although I'm not entirely sure why ubiquity would have been in such a locale or why it would have been attempting to render such a large value; this may not have been the original case, but it'll do for a reproducer. The et_EE locale must be generated before running this.
$ LC_ALL=et_EE python3
Python 3.3.2+ (default, Oct 9 2013, 14:50:09)
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> import apt_pkg
>>> locale.setlocale(locale.LC_ALL, '')
'et_EE'
>>> apt_pkg.size_to_str(10000000000000000000000000000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 2: invalid start byte
You can reproduce this exception in at least some non-Unicode locales, although I'm not entirely sure why ubiquity would have been in such a locale or why it would have been attempting to render such a large value; this may not have been the original case, but it'll do for a reproducer. The et_EE locale must be generated before running this.
$ LC_ALL=et_EE python3 setlocale( locale. LC_ALL, '') size_to_ str(10000000000 000000000000000 000) Error: 'utf-8' codec can't decode byte 0xa0 in position 2: invalid start byte
Python 3.3.2+ (default, Oct 9 2013, 14:50:09)
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> import apt_pkg
>>> locale.
'et_EE'
>>> apt_pkg.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecode