diff --git a/swift/obj/replicator.py b/swift/obj/replicator.py index c4df49deba..762a77ea46 100644 --- a/swift/obj/replicator.py +++ b/swift/obj/replicator.py @@ -394,7 +394,7 @@ class ObjectReplicator(Daemon): return 1 # failure response code total_time = time.time() - start_time - for result in results.split('\n'): + for result in results.decode('utf8').split('\n'): if result == '': continue if result.startswith('cd+'): diff --git a/test/unit/obj/test_replicator.py b/test/unit/obj/test_replicator.py index 51c54ca931..4c66e13d15 100644 --- a/test/unit/obj/test_replicator.py +++ b/test/unit/obj/test_replicator.py @@ -19,6 +19,7 @@ import os import mock from gzip import GzipFile from shutil import rmtree +import six import six.moves.cPickle as pickle import time import tempfile @@ -124,7 +125,8 @@ def _mock_process(ret): MockProcess.captured_log = captured_log orig_process = subprocess.Popen MockProcess.ret_code = (i[0] for i in ret) - MockProcess.ret_log = (i[1] for i in ret) + MockProcess.ret_log = (i[1] if six.PY2 else i[1].encode('utf8') + for i in ret) MockProcess.check_args = (i[2] for i in ret) object_replicator.subprocess.Popen = MockProcess yield captured_log