From d95133b66f64a2e4f1c8aafa5ff9183c6acfe9a7 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Thu, 14 Aug 2008 01:09:11 +0000 Subject: 149: CLI.run() now does an arg.decode('utf-8') for args in sys.argv so that non-ascii characters work --- ipalib/cli.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ipalib/cli.py b/ipalib/cli.py index d2583f57d..d17d12bca 100644 --- a/ipalib/cli.py +++ b/ipalib/cli.py @@ -40,8 +40,7 @@ def from_cli(cli_name): Takes a string from the Command Line Interface and transforms it into a Python identifier. """ - assert isinstance(cli_name, basestring) - return cli_name.replace('-', '_') + return str(cli_name).replace('-', '_') class help(public.cmd): @@ -100,7 +99,7 @@ class CLI(object): self.print_commands() print 'ipa: ERROR: unknown command %r' % cmd sys.exit(2) - self.run_cmd(cmd, sys.argv[2:]) + self.run_cmd(cmd, (s.decode('utf-8') for s in sys.argv[2:])) def run_cmd(self, cmd, given): (args, kw) = self.parse(given) -- cgit