From: Zac Medico Date: Sat, 15 Aug 2009 06:48:15 +0000 (-0000) Subject: Make _generate_hash_function() use _fs_encoding to encode the filename X-Git-Tag: v2.2_rc39~61 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2a841b102f7a852d937d62c57a1cd44f55e6e45b;p=portage.git Make _generate_hash_function() use _fs_encoding to encode the filename (if it's not already encoded), and enable errors='strict'. svn path=/main/trunk/; revision=14060 --- diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py index b22e62b61..330d85dfb 100644 --- a/pym/portage/checksum.py +++ b/pym/portage/checksum.py @@ -27,7 +27,8 @@ def _generate_hash_function(hashtype, hashobject, origin="unknown"): @type filename: String @return: The hash and size of the data """ - f = open(_unicode_encode(filename), 'rb') + f = open(_unicode_encode(filename, + encoding=_fs_encoding, errors='strict'), 'rb') blocksize = HASHING_BLOCKSIZE data = f.read(blocksize) size = 0L