From 06e79f156c73c42393490ba385d5a8aa7c21b3af Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 11 Aug 2009 23:59:41 +0000 Subject: Update imports to import portage.os (with unicode wrappers), and use _unicode_encode() and _unicode_decode() where appropriate. svn path=/main/trunk/; revision=14004 --- pym/portage/checksum.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pym/portage/checksum.py') diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py index 56719a1df..501ae3e6a 100644 --- a/pym/portage/checksum.py +++ b/pym/portage/checksum.py @@ -3,13 +3,13 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ +import portage from portage.const import PRIVATE_PATH,PRELINK_BINARY,HASHING_BLOCKSIZE -import os +from portage import os +from portage import _unicode_encode import errno import stat import tempfile -import portage.exception -import portage.process import commands #dict of all available hash functions @@ -25,7 +25,7 @@ def _generate_hash_function(hashtype, hashobject, origin="unknown"): @type filename: String @return: The hash and size of the data """ - f = open(filename, 'rb') + f = open(_unicode_encode(filename), 'rb') blocksize = HASHING_BLOCKSIZE data = f.read(blocksize) size = 0L -- cgit v1.2.3-1-g7c22