bpython crashes with UnicodeEncodeError with Spanish L10n

Bug #1046922 reported by cousteau
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bpython (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

bpython crashes when running it if the system language is set to Spanish (even when run with `LANG=C bpython`).
Xubuntu 12.04 64b, Spanish

Traceback (most recent call last):
  File "/usr/bin/bpython", line 9, in <module>
    load_entry_point('bpython==0.10.1', 'console_scripts', 'bpython')()
  File "/usr/lib/python2.7/dist-packages/bpython/cli.py", line 1756, in main
    banner=banner)
  File "/usr/lib/python2.7/dist-packages/bpython/cli.py", line 1658, in curses_wrapper
    return func(stdscr, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bpython/cli.py", line 1701, in main_curses
    main_win, statusbar = init_wins(scr, config)
  File "/usr/lib/python2.7/dist-packages/bpython/cli.py", line 1549, in init_wins
    get_colpair(config, 'main'))
  File "/usr/lib/python2.7/dist-packages/bpython/cli.py", line 1416, in __init__
    self.settext(s, c)
  File "/usr/lib/python2.7/dist-packages/bpython/cli.py", line 1515, in settext
    self.win.addstr(s, self.c)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 71: ordinal not in range(128)

Character u'\xf3' is the "ó" in "Mostra el código fuente". This bug is fixed in https://bitbucket.org/bobf/bpython/changeset/b49882bf57a1 and applying that patch actually solves the problem (although the problem re-appears when running `LANG=C bpython` because then getpreferredencoding() returns "ascii").

Tags: patch bpython
Revision history for this message
cousteau (cousteaulecommandant) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch from https://bitbucket.org/bobf/bpython/changeset/b49882bf57a1" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
José Carlos García Monsálvez (garcia-josmon) wrote :

Quantal release of this package (0.11-1) fixes this and has the same depends. It's simple to backport.

Changed in bpython (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Changed in bpython (Ubuntu):
status: Triaged → Fix Released
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.