diff --git a/awscli/customizations/s3/fileinfo.py b/awscli/customizations/s3/fileinfo.py index 3d9f04208c31..9e174569c87e 100644 --- a/awscli/customizations/s3/fileinfo.py +++ b/awscli/customizations/s3/fileinfo.py @@ -235,7 +235,7 @@ def copy(self): """ Copies a object in s3 to another location in s3. """ - copy_source = self.src.encode('utf-8') + copy_source = self.src bucket, key = find_bucket_key(self.dest) params = {'endpoint': self.endpoint, 'bucket': bucket, 'copy_source': copy_source, 'key': key} diff --git a/awscli/customizations/s3/tasks.py b/awscli/customizations/s3/tasks.py index a014f6778118..d187fb105530 100644 --- a/awscli/customizations/s3/tasks.py +++ b/awscli/customizations/s3/tasks.py @@ -7,7 +7,6 @@ from botocore.vendored import requests from botocore.exceptions import IncompleteReadError -from botocore.compat import quote from awscli.customizations.s3.utils import find_bucket_key, MD5Error, \ operate, ReadFileChunk, relative_path, IORequest, IOCloseRequest diff --git a/tests/unit/customizations/s3/fake_session.py b/tests/unit/customizations/s3/fake_session.py index 021afbc82a05..979c3ee37eb5 100644 --- a/tests/unit/customizations/s3/fake_session.py +++ b/tests/unit/customizations/s3/fake_session.py @@ -13,6 +13,7 @@ import hashlib from operator import itemgetter from botocore.vendored import requests +from six import text_type from six import StringIO from io import BytesIO @@ -223,7 +224,7 @@ def copy_object(self, kwargs): key = kwargs['key'] copy_source = kwargs['copy_source'] src_bucket, src_key = find_bucket_key(copy_source) - if hasattr(src_key, 'decode'): + if not isinstance(src_key, text_type) and hasattr(src_key, 'decode'): src_key = src_key.decode('utf-8') response_data = {} etag = ''