_pull_valid_cache: pass unicode to hashed_path
authorZac Medico <zmedico@gentoo.org>
Sun, 16 Oct 2011 05:58:56 +0000 (22:58 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 16 Oct 2011 05:58:56 +0000 (22:58 -0700)
This removes a conversion to bytes that should have been removed in
commit 2ed1cb53cc4158af08c22d466b15b9a9a7767212. The hashed_path
location attribute should always be unicode, for consistency will path
handling throughout portage. The hashed_path class internally uses the
portage portage.os wrapper to ensure that paths are encoded as utf_8
bytes when they are passed to the real os module for stat calls.

pym/portage/dbapi/porttree.py

index a1308a7e7af6faf1276f5f9f208dea5279b9e26e..13c27e9794d8922bd983fd101b8337a9429a04b5 100644 (file)
@@ -420,10 +420,7 @@ class portdbapi(dbapi):
 
        def _pull_valid_cache(self, cpv, ebuild_path, repo_path):
                try:
-                       # Don't use unicode-wrapped os module, for better performance.
-                       path = _unicode_encode(ebuild_path,
-                               encoding=_encodings['fs'], errors='strict')
-                       ebuild_hash = eclass_cache.hashed_path(path)
+                       ebuild_hash = eclass_cache.hashed_path(ebuild_path)
                        # snag mtime since we use it later, and to trigger stat failure
                        # if it doesn't exist
                        ebuild_hash.mtime