From: Zac Medico Date: Sun, 9 Aug 2009 21:43:28 +0000 (-0000) Subject: Always use encoding='utf_8' for unicode() calls. X-Git-Tag: v2.2_rc37~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=98ec39227b27c24dd609ddff95e4f7f9ec53585b;p=portage.git Always use encoding='utf_8' for unicode() calls. svn path=/main/trunk/; revision=13960 --- 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: