From 7740280c458564d2803eb1bb57d0ed0c0035d109 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Tue, 11 Nov 2008 16:52:44 +0000 Subject: QPID-1448 - Management APIs and CLI tools are not unicode safe The management APIs (old and new) now use unicode strings as the default. The CLI utilities now use the preferred shell encoding to support multibyte characters in the command line and in managed objects. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@713079 13f79535-47bb-0310-9956-ffa450edef68 --- python/commands/qpid-config | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'python/commands/qpid-config') diff --git a/python/commands/qpid-config b/python/commands/qpid-config index 6917d4c5c0..e2d3108a33 100755 --- a/python/commands/qpid-config +++ b/python/commands/qpid-config @@ -22,6 +22,7 @@ import os import getopt import sys +import locale from qpid import qmfconsole _recursive = False @@ -305,10 +306,16 @@ try: longOpts = ("durable", "cluster-durable", "bindings", "broker-addr=", "file-count=", "file-size=", "max-queue-size=", "max-queue-count=", "policy-type=", "last-value-queue", "optimistic-consume", "sequence", "ive") - (optlist, cargs) = getopt.gnu_getopt (sys.argv[1:], "a:b", longOpts) + (optlist, encArgs) = getopt.gnu_getopt (sys.argv[1:], "a:b", longOpts) except: Usage () +try: + encoding = locale.getpreferredencoding() + cargs = [a.decode(encoding) for a in encArgs] +except: + cargs = encArgs + for opt in optlist: if opt[0] == "-b" or opt[0] == "--bindings": _recursive = True @@ -381,6 +388,7 @@ try: Usage () except Exception,e: print "Failed:", e.message + raise sys.exit(1) bm.Disconnect() -- cgit v1.2.1