Invalid encoding returned for ca@valencia locale
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python |
Confirmed
|
Unknown
|
|||
ubuntu-release-upgrader (Ubuntu) |
Incomplete
|
High
|
howard goddard |
Bug Description
While upgrading from 13.04 to 13.10 using locale ca@valencia, the process fails with the following traceback:
Traceback (most recent call last):
File "/tmp/ubuntu-
<module>
sys.exit(main())
File
"/tmp/ubuntu-
line 243, in main
if app.run():
File
"/tmp/ubuntu-
line 1791, in run
return self.fullUpgrade()
File
"/tmp/ubuntu-
line 1744, in fullUpgrade
if not self.askDistUpg
File
"/tmp/ubuntu-
line 996, in askDistUpgrade
self.cache.
File
"/tmp/ubuntu-
line 165, in confirmChanges
downloadSize, actions)
File
"/tmp/ubuntu-
line 387, in confirmChanges
downloadSizeStr = downloadSizeStr
LookupError: unknown encoding: utf_8_valencia
Looking at it in more detail, this comes from the following code in DistUpgrade/
try:
locale.
(code, ENCODING) = locale.
except:
logging.
ENCODING = "utf-8" #pyflakes
if not ENCODING:
ENCODING = "utf-8"
And digging deeper, it seems getdefaultlocale does not return the correct encoding when the locale is set to ca_ES
>>> import locale
>>> locale.
'LC_CTYPE=
>>> locale.
('ca_ES', 'utf_8_valencia')
Instead of 'utf_8_valencia', here I'd expect 'UTF-8' to be returned. The returned locale is also wrong: it should be ca_ES@valencia.
While this needs to be fixed upstream, it might be worth adding a workaround (and a check for a valid encoding) in ubuntu-
This will also affect other @ locales, such as sr@Latin (Serbian with Latin encoding).
Changed in python: | |
status: | Unknown → New |
Changed in python: | |
status: | New → Confirmed |
Changed in ubuntu-release-upgrader (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in ubuntu-release-upgrader (Ubuntu): | |
assignee: | nobody → howard goddard (hgoddard2) |
This bug is still open, and it also affects updating from 13.10 to 14.04, even if the triaged bug in python was fixed in december, four months ago.