Update imports to import portage.os (with unicode wrappers), and use
authorZac Medico <zmedico@gentoo.org>
Tue, 11 Aug 2009 23:59:41 +0000 (23:59 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 11 Aug 2009 23:59:41 +0000 (23:59 -0000)
_unicode_encode() and _unicode_decode() where appropriate.

svn path=/main/trunk/; revision=14004

pym/portage/checksum.py
pym/portage/eclass_cache.py

index 56719a1dfab276c7b63d24783ebb7841c5e288ae..501ae3e6a9d79884b34a53e9548870c2c3193b08 100644 (file)
@@ -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
index 8f80ec53e6c39135147123dfe10201806e832b9b..3f86a6d695b5f47ff57b99210982577ff59c3449 100644 (file)
@@ -6,10 +6,10 @@
 __all__ = ["cache"]
 
 import warnings
-from portage.util import normalize_path, writemsg
-import errno, os, sys
-from portage.data import portage_gid
+from portage.util import normalize_path
+import errno
 from portage.exception import PermissionDenied
+from portage import os
 
 class cache(object):
        """