diff options
-rw-r--r-- | pym/portage/checksum.py | 4 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py index 5def1ac8a..0e6a9d552 100644 --- a/pym/portage/checksum.py +++ b/pym/portage/checksum.py @@ -6,6 +6,7 @@ import portage from portage.const import PRIVATE_PATH,PRELINK_BINARY,HASHING_BLOCKSIZE from portage import os +from portage import _fs_encoding from portage import _merge_encoding from portage import _unicode_encode import errno @@ -233,7 +234,8 @@ def perform_checksum(filename, hashname="MD5", calc_prelink=0): if hashname not in hashfunc_map: raise portage.exception.DigestException(hashname + \ " hash function not available (needs dev-python/pycrypto)") - myhash, mysize = hashfunc_map[hashname](myfilename) + myhash, mysize = hashfunc_map[hashname](_unicode_encode(myfilename, + encoding=_fs_encoding, errors='strict')) except (OSError, IOError), e: if e.errno == errno.ENOENT: raise portage.exception.FileNotFound(myfilename) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 6729e41e7..40d20876d 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -2288,6 +2288,7 @@ class dblink(object): """ os = _os_merge + perf_md5 = perform_md5 showMessage = self._display_merge scheduler = self._scheduler @@ -2391,6 +2392,7 @@ class dblink(object): pass else: os = portage.os + perf_md5 = portage.checksum.perform_md5 file_data = pkgfiles[objkey] file_type = file_data[0] @@ -2481,7 +2483,7 @@ class dblink(object): continue mymd5 = None try: - mymd5 = perform_md5(obj, calc_prelink=1) + mymd5 = perf_md5(obj, calc_prelink=1) except FileNotFound, e: # the file has disappeared between now and our stat call show_unmerge("---", unmerge_desc["!obj"], file_type, obj) |