From 6f4c36f6e0103ea54ee0a2c03bad81bfb7c8442d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 4 Aug 2009 20:00:20 +0000 Subject: [PATCH] Decode arguments to unicode if necessary (needed at least for unicode file names passed to the owners command). svn path=/main/trunk/; revision=13906 --- bin/portageq | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/portageq b/bin/portageq index cf9c5f066..825152911 100755 --- a/bin/portageq +++ b/bin/portageq @@ -605,10 +605,15 @@ def main(): sys.path.insert(0, pym_path) import portage + args = sys.argv[2:] + if args and not isinstance(args[0], unicode): + for i in xrange(len(args)): + args[i] = unicode(args[i], encoding='utf_8', errors='replace') + try: if uses_root: - sys.argv[2] = portage.settings["ROOT"] - retval = function(sys.argv[2:]) + args[0] = portage.settings["ROOT"] + retval = function(args) if retval: sys.exit(retval) except portage.exception.PermissionDenied, e: -- 2.26.2