Always use encoding='utf_8' for unicode() calls.
authorZac Medico <zmedico@gentoo.org>
Sun, 9 Aug 2009 21:43:28 +0000 (21:43 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 9 Aug 2009 21:43:28 +0000 (21:43 -0000)
svn path=/main/trunk/; revision=13960

pym/portage/__init__.py
pym/portage/dbapi/porttree.py
pym/portage/dbapi/vartree.py
pym/portage/sets/shell.py

index 321487a1c0ebbd524716deb87b3c914ff77ed1f0..d9fe686c1f0f702c473295d906cf4b863565c5e4 100644 (file)
@@ -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)
index 9f36af5699b9cae9d589e6d880626e0102bf429a..d9b85b18abdbc981abc62cf6c95f88caf238d7f6 100644 (file)
@@ -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:
index ec9813197859c0d4886a5bf925b7209a3deb866f..90fe4317c3c3ab7d644cc5b26436d382ff921346 100644 (file)
@@ -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:
index 43a8fe02f722e145eaa3c5fe42cca3c53aee7511..25ccb03c75688fff2d4bb4cb6eae8d14583760b7 100644 (file)
@@ -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: