From: Zac Medico Date: Tue, 4 Aug 2009 20:00:20 +0000 (-0000) Subject: Decode arguments to unicode if necessary (needed at least for unicode file X-Git-Tag: v2.2_rc36~11 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=6f4c36f6e0103ea54ee0a2c03bad81bfb7c8442d;p=portage.git Decode arguments to unicode if necessary (needed at least for unicode file names passed to the owners command). svn path=/main/trunk/; revision=13906 --- 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: