UnicodeDecodeError with glade files in pbuilder
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-distutils-extra |
Fix Released
|
Undecided
|
Unassigned | ||
python-distutils-extra (Ubuntu) |
Fix Released
|
Undecided
|
Martin Pitt | ||
Precise |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Test case]
Install the version from -proposed
1. have a package with an ui file with some UTF-8 characters using p-d-e
2. run pdebuild
-> no crash should occurs
[Regression potential]
Unlucky as the test suite covers other .ui file case
Hi, we're currently switching Onboard to Python 3. Building with python3-
pdebuild
...
running build_i18n
Traceback (most recent call last):
File "setup.py", line 157, in <module>
cmdclass = {'test': TestCommand},
File "/usr/lib/
distutils.
File "/usr/lib/
dist.
File "/usr/lib/
self.
File "/usr/lib/
cmd_obj.run()
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
cmd_obj.run()
File "/usr/lib/
contents = open(f).read()
File "/usr/lib/
return codecs.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 31523: ordinal not in range(128)
What seems to be happening is that pbuilder sets LANG=C, which causes Python 3 to assume a default encoding of 'ANSI_X3.4-1968' (ASCII). Our glade files are UTF-8 encoded, so read() is bound to fail.
As a workaround I've added this to Onboard's setup.py for now:
locale.
With this the build runs through.
Onboard trunk
python3-
python3 3.2.3-0ubuntu1
Ubuntu 12.10, quantal
description: | updated |
Reproduced in test suite and fixed in trunk.