From 148379492d314c0eb98ee8559aea7a2fd0baaeb2 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 1 Feb 2010 10:59:52 -0500 Subject: Clearer UnicodeDecodeError message in command_line.dispatch(). See #bea/e30# ("Where should the vcs-name and encoding configuration options live?") for details. --- libbe/ui/command_line.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libbe/ui') 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 -- cgit