diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-08-09 21:43:28 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-08-09 21:43:28 +0000 |
commit | 98ec39227b27c24dd609ddff95e4f7f9ec53585b (patch) | |
tree | 5deced849936ca4a92bd093114a14934ea430bbb | |
parent | 22b56d3d2db211468f040772529e56fd16bb2151 (diff) | |
download | portage-98ec39227b27c24dd609ddff95e4f7f9ec53585b.tar.gz portage-98ec39227b27c24dd609ddff95e4f7f9ec53585b.tar.bz2 portage-98ec39227b27c24dd609ddff95e4f7f9ec53585b.zip |
Always use encoding='utf_8' for unicode() calls.
svn path=/main/trunk/; revision=13960
-rw-r--r-- | pym/portage/__init__.py | 2 | ||||
-rw-r--r-- | pym/portage/dbapi/porttree.py | 2 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 5 | ||||
-rw-r--r-- | pym/portage/sets/shell.py | 3 |
4 files changed, 7 insertions, 5 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 321487a1c..d9fe686c1 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -247,7 +247,7 @@ def cacheddir(my_original_path, ignorecvs, ignorelist, EmptyOnError, followSymli ftype = [] for x in list: if not isinstance(x, unicode): - x = unicode(x, errors='replace') + x = unicode(x, encoding='utf_8', errors='replace') try: if followSymlinks: pathstat = os.stat(mypath+"/"+x) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 9f36af569..d9b85b18a 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -879,7 +879,7 @@ class portdbapi(dbapi): continue for x in file_list: if not isinstance(x, unicode): - x = unicode(x, errors='replace') + x = unicode(x, encoding='utf_8', errors='replace') pf = None if glep55: diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index ec9813197..90fe4317c 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -897,7 +897,7 @@ class vardbapi(dbapi): returnme = [] for x in dir_list: if not isinstance(x, unicode): - x = unicode(x, errors='replace') + x = unicode(x, encoding='utf_8', errors='replace') if self._excluded_dirs.match(x) is not None: continue ps = pkgsplit(x) @@ -930,7 +930,8 @@ class vardbapi(dbapi): def listdir(p, **kwargs): try: return [isinstance(x, unicode) and x or \ - unicode(x, errors='replace') for x in os.listdir(p) \ + unicode(x, encoding='utf_8', errors='replace') \ + for x in os.listdir(p) \ if os.path.isdir(os.path.join(p, x))] except EnvironmentError, e: if e.errno == PermissionDenied.errno: diff --git a/pym/portage/sets/shell.py b/pym/portage/sets/shell.py index 43a8fe02f..25ccb03c7 100644 --- a/pym/portage/sets/shell.py +++ b/pym/portage/sets/shell.py @@ -35,7 +35,8 @@ class CommandOutputSet(PackageSet): pipe = subprocess.Popen(self._command, stdout=subprocess.PIPE, shell=True) stdout, stderr = pipe.communicate() if pipe.wait() == os.EX_OK: - self._setAtoms(unicode(stdout, errors='replace').splitlines()) + self._setAtoms(unicode(stdout, + encoding='utf_8', errors='replace').splitlines()) def singleBuilder(self, options, settings, trees): if not "command" in options: |