aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/ui
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2010-02-01 10:59:52 -0500
committerW. Trevor King <wking@drexel.edu>2010-02-01 10:59:52 -0500
commit148379492d314c0eb98ee8559aea7a2fd0baaeb2 (patch)
tree66c1b9f7ba4ec00ac207d43dcd7dd689429a3485 /libbe/ui
parent77bcd2ab6cd0afafc4c9ce8ec720fa167f1baeaf (diff)
downloadbugseverywhere-148379492d314c0eb98ee8559aea7a2fd0baaeb2.tar.gz
Clearer UnicodeDecodeError message in command_line.dispatch().
See #bea/e30# ("Where should the vcs-name and encoding configuration options live?") for details.
Diffstat (limited to 'libbe/ui')
-rw-r--r--libbe/ui/command_line.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/libbe/ui/command_line.py b/libbe/ui/command_line.py
index 89d791d..dd10954 100644
--- a/libbe/ui/command_line.py
+++ b/libbe/ui/command_line.py
@@ -267,6 +267,14 @@ def dispatch(ui, command, args):
ret = ui.run(command, options, args)
except CallbackExit:
return 0
+ except UnicodeDecodeError, e:
+ print >> ui.io.stdout, '\n'.join([
+ 'ERROR:', str(e),
+ 'You should set a locale that supports unicode, e.g.',
+ ' export LANG=en_US.utf8',
+ 'See http://docs.python.org/library/locale.html for details',
+ ])
+ return 1
except libbe.command.UserError, e:
print >> ui.io.stdout, 'ERROR:\n', e
return 1