Skip to content

Commit

Permalink
Merge branch 'garnaat-fix-614' into develop
Browse files Browse the repository at this point in the history
* garnaat-fix-614:
  Update CHANGELOG
  Don't encode the copy_source argument
  The fake session should no longer unquote the copy_source.
  Let botocore handle the quoting of the x-amz-copy-source header.
  Quote the filename in the x-amz-copy-source header for multipart COPY operations.  Fixes #614.

Conflicts:
	CHANGELOG.rst
  • Loading branch information
jamesls committed Mar 5, 2014
2 parents bf5e9b3 + 68cc044 commit 22cc39f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Next Release (TBD)
* bugfix:Bundled Installer: Allow creation of bundled
installer with ``pip 1.5``
(`issue 691 <https://github.com/aws/aws-cli/issues/691>`__)
* bugfix:``aws s3``: Fix issue when copying objects using
``aws s3 cp`` with key names containing ``+`` characters
(`issue #614 <https://github.com/aws/aws-cli/issues/614>`__)
* bugfix:``ec2 create-snapshot``: Remove ``Tags`` key from
output response
(`issue 247 <https://github.com/boto/botocore/pull/247>`__)
Expand Down
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 = quote(self.src.encode('utf-8'), safe='/~')
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
5 changes: 2 additions & 3 deletions tests/unit/customizations/s3/fake_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
import hashlib
from operator import itemgetter
from botocore.vendored import requests
from six import text_type
from six import StringIO
from io import BytesIO

from botocore.compat import unquote
from mock import MagicMock, Mock

from awscli.customizations.s3.filegenerator import find_bucket_key
Expand Down Expand Up @@ -224,8 +224,7 @@ def copy_object(self, kwargs):
key = kwargs['key']
copy_source = kwargs['copy_source']
src_bucket, src_key = find_bucket_key(copy_source)
src_key = unquote(src_key)
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 22cc39f

Please sign in to comment.