diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-14 01:09:11 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-14 01:09:11 +0000 |
commit | d95133b66f64a2e4f1c8aafa5ff9183c6acfe9a7 (patch) | |
tree | 1304a8da84a8a19b089dae8d7914ca36e0d2ac66 | |
parent | fe7440735d8527b281f642056f11579b428dce0f (diff) | |
download | freeipa-d95133b66f64a2e4f1c8aafa5ff9183c6acfe9a7.tar.gz freeipa-d95133b66f64a2e4f1c8aafa5ff9183c6acfe9a7.tar.xz freeipa-d95133b66f64a2e4f1c8aafa5ff9183c6acfe9a7.zip |
149: CLI.run() now does an arg.decode('utf-8') for args in sys.argv so that non-ascii characters work
-rw-r--r-- | ipalib/cli.py | 5 |
1 files 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) |