diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-08-04 20:00:20 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-08-04 20:00:20 +0000 |
commit | 6f4c36f6e0103ea54ee0a2c03bad81bfb7c8442d (patch) | |
tree | 32cbd0fab471c0a79aa32b02945f2db199edfee8 | |
parent | 8a2c435913dfd077adfca4e666e1f9c28bc04efe (diff) | |
download | portage-6f4c36f6e0103ea54ee0a2c03bad81bfb7c8442d.tar.gz portage-6f4c36f6e0103ea54ee0a2c03bad81bfb7c8442d.tar.bz2 portage-6f4c36f6e0103ea54ee0a2c03bad81bfb7c8442d.zip |
Decode arguments to unicode if necessary (needed at least for unicode file
names passed to the owners command).
svn path=/main/trunk/; revision=13906
-rwxr-xr-x | bin/portageq | 9 |
1 files 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: |