From: Zac Medico Date: Sun, 16 Oct 2011 05:58:56 +0000 (-0700) Subject: _pull_valid_cache: pass unicode to hashed_path X-Git-Tag: v2.2.0_alpha68~20 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=28115d7d72cf0f0c42c636039ed2a08ee2412dd3;p=portage.git _pull_valid_cache: pass unicode to hashed_path 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. --- diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index a1308a7e7..13c27e979 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -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