ascii can't decode error in 14.04 server install

Bug #1311321 reported by Richard Harding
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
juju-quickstart
Fix Released
High
Francesco Banconi
juju-quickstart (Ubuntu)
Fix Released
Undecided
Unassigned
Trusty
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

Running juju-quickstart from a machine without locales installed and properly configured causes a traceback.

[Test Case]

Using juju-quickstart with the patch applied the following should not exit:

LC_ALL=C juju-quickstart -i

[Regression Potential]

The patch attempts to set encoding using urwid. If it fails the user is warned rather than the application printing a traceback. Regression potential is minimal.

[Original Bug Report]

Reported from a user in irc. They attempted to use juju-quickstart on 14.04 server install and got the following trace.

$ juju-quickstart

Traceback (most recent call last):
File "/usr/bin/juju-quickstart", line 32, in <module>
options = manage.setup()
File "/usr/lib/python2.7/dist-packages/quickstart/manage.py", line 427, in setup
_setup_env(options, parser)
File "/usr/lib/python2.7/dist-packages/quickstart/manage.py", line 276, in _setup_env
parser, env_type_db, env_db, env_file)
File "/usr/lib/python2.7/dist-packages/quickstart/manage.py", line 206, in _start_interactive_session
views.env_index, env_type_db, env_db, save_callable)
File "/usr/lib/python2.7/dist-packages/quickstart/cli/views.py", line 128, in show
loop.run()
File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 272, in run
self.screen.run_wrapper(self._run)
File "/usr/lib/python2.7/dist-packages/urwid/raw_display.py", line 242, in run_wrapper
return fn()
File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 312, in _run
self.draw_screen()
File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 563, in draw_screen
canvas = self._topmost_widget.render(self.screen_size, focus=True)
File "/usr/lib/python2.7/dist-packages/urwid/widget.py", line 141, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python2.7/dist-packages/urwid/container.py", line 755, in render
self.top_w_size(size, left, right, top, bottom), focus)
File "/usr/lib/python2.7/dist-packages/urwid/widget.py", line 141, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python2.7/dist-packages/urwid/container.py", line 1049, in render
focus and self.focus_part == 'header')
File "/usr/lib/python2.7/dist-packages/urwid/widget.py", line 141, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python2.7/dist-packages/urwid/container.py", line 1493, in render
canv = w.render((maxcol,), focus=focus and item_focus)
File "/usr/lib/python2.7/dist-packages/urwid/widget.py", line 141, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python2.7/dist-packages/urwid/decoration.py", line 225, in render
canv = self._original_widget.render(size, focus=focus)
File "/usr/lib/python2.7/dist-packages/urwid/widget.py", line 141, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python2.7/dist-packages/urwid/widget.py", line 751, in render
canv = SolidCanvas(self.div_char, maxcol, 1)
File "/usr/lib/python2.7/dist-packages/urwid/canvas.py", line 495, in __init__
self._text, cs = apply_target_encoding(fill_char[:end])
File "/usr/lib/python2.7/dist-packages/urwid/util.py", line 121, in apply_target_encoding
s = s.encode( _target_encoding )
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2582' in position 0: ordinal not in range(128)

Related branches

Revision history for this message
Richard Harding (rharding) wrote :

Seems locale is missing from the install.

$ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=fo_FO.UTF-8
LC_TIME=fo_FO.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY=fo_FO.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER=fo_FO.UTF-8
LC_NAME=fo_FO.UTF-8
LC_ADDRESS=fo_FO.UTF-8
LC_TELEPHONE=fo_FO.UTF-8
LC_MEASUREMENT=fo_FO.UTF-8
LC_IDENTIFICATION=fo_FO.UTF-8
LC_ALL=

Revision history for this message
Richard Harding (rharding) wrote :

1:11 hedin| it is 14.04
21:11 hedin| Linux ubuntu 3.13.0-24-generic
21:11 tvansteen| i would try:
21:11 tvansteen| sudo locale-gen en_GB.UTF-8 fo_FO.UTF-8
21:11 tvansteen| dpkg-reconfigure locales
21:12 hedin| tvansteenburgh: that fixed it, now juju-quickstart runs

Changed in juju-quickstart:
status: Confirmed → Won't Fix
status: Won't Fix → Triaged
status: Triaged → In Progress
assignee: nobody → Francesco Banconi (frankban)
Changed in juju-quickstart:
status: In Progress → Fix Committed
Changed in juju-quickstart:
status: Fix Committed → Fix Released
Brad Crittenden (bac)
description: updated
Revision history for this message
Robie Basak (racb) wrote :

Fixed in juju-quickstart 1.4.0-0ubuntu1 in Utopic. Trusty SRU pending.

Changed in juju-quickstart (Ubuntu):
status: New → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Richard, or anyone else affected,

Accepted juju-quickstart into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/juju-quickstart/1.3.1-0ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in juju-quickstart (Ubuntu Trusty):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Caio Begotti (caio1982) wrote :

Hi, just a heads up that this proposed update works for me (tested juju-quickstart version 1.3.1-0ubuntu1.1 on trusty).

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package juju-quickstart - 1.3.1-0ubuntu1.1

---------------
juju-quickstart (1.3.1-0ubuntu1.1) trusty; urgency=medium

  * Cherry-pick bugfixes from 1.3.2:
    - Make control bucket optional (LP: #1309678).
    - Support Trusty environments (LP: #1306537).
    - Check unicode support (LP: #1311321).
 -- Robie Basak <email address hidden> Wed, 02 Jul 2014 16:47:16 +0000

Changed in juju-quickstart (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for juju-quickstart has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.