You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2013/09/04 12:28:19 UTC
[12/14] git commit: Fix local storage test failurs under Python 3.2.
Fix local storage test failurs under Python 3.2.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/c96e7a93
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/c96e7a93
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/c96e7a93
Branch: refs/heads/0.13.1
Commit: c96e7a9388ed9ae34fab06b2d733718d36d54dd0
Parents: fedd709
Author: Tomaz Muraus <to...@apache.org>
Authored: Fri Aug 23 14:54:07 2013 +0200
Committer: Tomaz Muraus <to...@apache.org>
Committed: Wed Sep 4 12:09:53 2013 +0200
----------------------------------------------------------------------
libcloud/storage/drivers/local.py | 3 ++-
libcloud/test/storage/test_local.py | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/c96e7a93/libcloud/storage/drivers/local.py
----------------------------------------------------------------------
diff --git a/libcloud/storage/drivers/local.py b/libcloud/storage/drivers/local.py
index b341d99..77ddb23 100644
--- a/libcloud/storage/drivers/local.py
+++ b/libcloud/storage/drivers/local.py
@@ -32,6 +32,7 @@ except ImportError:
from libcloud.utils.files import read_in_chunks
from libcloud.utils.py3 import relpath
+from libcloud.utils.py3 import u
from libcloud.common.base import Connection
from libcloud.storage.base import Object, Container, StorageDriver
from libcloud.common.types import LibcloudError
@@ -175,7 +176,7 @@ class LocalStorageDriver(StorageDriver):
# use only the mtime attribute here. If the file contents change,
# the underlying file-system will change mtime
data_hash = self._get_hash_function()
- data_hash.update(str(stat.st_mtime))
+ data_hash.update(u(stat.st_mtime).encode('ascii'))
data_hash = data_hash.hexdigest()
extra = {}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/c96e7a93/libcloud/test/storage/test_local.py
----------------------------------------------------------------------
diff --git a/libcloud/test/storage/test_local.py b/libcloud/test/storage/test_local.py
index d88c4b7..bb70f38 100644
--- a/libcloud/test/storage/test_local.py
+++ b/libcloud/test/storage/test_local.py
@@ -310,7 +310,7 @@ class LocalTests(unittest.TestCase):
data = ''
for buff in stream:
- data += buff
+ data += buff.decode('utf-8')
self.assertTrue(len(data), 4096)