From 2a841b102f7a852d937d62c57a1cd44f55e6e45b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 15 Aug 2009 06:48:15 +0000 Subject: 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 --- pym/portage/checksum.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pym/portage/checksum.py') 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 -- cgit v1.2.3-1-g7c22