summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-04 20:00:20 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-04 20:00:20 +0000
commit6f4c36f6e0103ea54ee0a2c03bad81bfb7c8442d (patch)
tree32cbd0fab471c0a79aa32b02945f2db199edfee8
parent8a2c435913dfd077adfca4e666e1f9c28bc04efe (diff)
downloadportage-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-xbin/portageq9
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: