Skip to content

Commit

Permalink
Let botocore handle the quoting of the x-amz-copy-source header.
Browse files Browse the repository at this point in the history
  • Loading branch information
garnaat authored and jamesls committed Mar 4, 2014
1 parent 15e7b06 commit d2e00ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 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 = quote(self.src.encode('utf-8'), safe='/~')
copy_source = self.src.encode('utf-8')
bucket, key = find_bucket_key(self.dest)
params = {'endpoint': self.endpoint, 'bucket': bucket,
'copy_source': copy_source, 'key': key}
Expand Down
4 changes: 1 addition & 3 deletions awscli/customizations/s3/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,11 @@ def __call__(self):
upload_id = self._upload_context.wait_for_upload_id()
bucket, key = find_bucket_key(self._filename.dest)
src_bucket, src_key = find_bucket_key(self._filename.src)
copy_source = '%s/%s' % (src_bucket, src_key)
copy_source = quote(copy_source.encode('utf-8'), safe='/~')
params = {'endpoint': self._filename.endpoint,
'bucket': bucket, 'key': key,
'part_number': self._part_number,
'upload_id': upload_id,
'copy_source': copy_source,
'copy_source': '%s/%s' % (src_bucket, src_key),
'copy_source_range': range_param}
response_data, http = operate(
self._filename.service, 'UploadPartCopy', params)
Expand Down

0 comments on commit d2e00ea

Please sign in to comment.