Skip to content

Commit

Permalink
Don't encode the copy_source argument
Browse files Browse the repository at this point in the history
Picks up on where aws#615 left off.
  • Loading branch information
jamesls committed Mar 4, 2014
1 parent 07c1247 commit 6e59b20
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion awscli/customizations/s3/fileinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 0 additions & 1 deletion awscli/customizations/s3/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/customizations/s3/fake_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 = ''
Expand Down

0 comments on commit 6e59b20

Please sign in to comment.