Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

unicode constants in the response dict were not the responsible of th…

…e UnicodeDecodeError
  • Loading branch information...
commit 57dabee6ad6d58f71994adc6d246becc98c8056e 1 parent ec94d61
@moliware moliware authored
Showing with 15 additions and 15 deletions.
  1. +15 −15 boto/glacier/layer1.py
View
30 boto/glacier/layer1.py
@@ -83,8 +83,8 @@ def make_request(self, verb, resource, headers=None,
if response.getheader('Content-Type') == 'application/json':
body = json.loads(response.read())
else:
- body = {'Response': response.read()}
- body['RequestId'] = response.getheader('x-amzn-requestid')
+ body = {u'Response': response.read()}
+ body[u'RequestId'] = response.getheader('x-amzn-requestid')
if response_headers:
for header_name, item_name in response_headers:
body[item_name] = response.getheader(header_name)
@@ -346,8 +346,8 @@ def initiate_job(self, vault_name, job_data):
archive-retrieval|inventory-retrieval
"""
uri = 'vaults/%s/jobs' % vault_name
- response_headers = [('x-amz-job-id', 'JobId'),
- ('Location', 'Location')]
+ response_headers = [('x-amz-job-id', u'JobId'),
+ ('Location', u'Location')]
json_job_data = json.dumps(job_data)
return self.make_request('POST', uri, data=json_job_data,
ok_responses=(202,),
@@ -378,9 +378,9 @@ def get_job_output(self, vault_name, job_id, byte_range=None):
:param range: A tuple of integers specifying the slice (in bytes)
of the archive you want to receive
"""
- response_headers = [('x-amz-sha256-tree-hash', 'TreeHash'),
- ('Content-Range', 'ContentRange'),
- ('Content-Type', 'ContentType')]
+ response_headers = [('x-amz-sha256-tree-hash', u'TreeHash'),
+ ('Content-Range', u'ContentRange'),
+ ('Content-Type', u'ContentType')]
headers = None
if byte_range:
headers = {'Range': 'bytes=%d-%d' % byte_range}
@@ -421,9 +421,9 @@ def upload_archive(self, vault_name, archive,
:type description: str
:param description: An optional description of the archive.
"""
- response_headers = [('x-amz-archive-id', 'ArchiveId'),
- ('Location', 'Location'),
- ('x-amz-sha256-tree-hash', 'TreeHash')]
+ response_headers = [('x-amz-archive-id', u'ArchiveId'),
+ ('Location', u'Location'),
+ ('x-amz-sha256-tree-hash', u'TreeHash')]
uri = 'vaults/%s/archives' % vault_name
headers = {'x-amz-content-sha256': linear_hash,
'x-amz-sha256-tree-hash': tree_hash,
@@ -468,8 +468,8 @@ def initiate_multipart_upload(self, vault_name, part_size,
a power of 2. The minimum allowable part size is 1MB and the
maximum is 4GB.
"""
- response_headers = [('x-amz-multipart-upload-id', 'UploadId'),
- ('Location', 'Location')]
+ response_headers = [('x-amz-multipart-upload-id', u'UploadId'),
+ ('Location', u'Location')]
headers = {'x-amz-part-size': str(part_size)}
if description:
headers['x-amz-archive-description'] = description
@@ -506,8 +506,8 @@ def complete_multipart_upload(self, vault_name, upload_id,
archive. This value should be the sum of all the sizes of
the individual parts that you uploaded.
"""
- response_headers = [('x-amz-archive-id', 'ArchiveId'),
- ('Location', 'Location')]
+ response_headers = [('x-amz-archive-id', u'ArchiveId'),
+ ('Location', u'Location')]
headers = {'x-amz-sha256-tree-hash': sha256_treehash,
'x-amz-archive-size': str(archive_size)}
uri = 'vaults/%s/multipart-uploads/%s' % (vault_name, upload_id)
@@ -621,7 +621,7 @@ def upload_part(self, vault_name, upload_id, linear_hash,
headers = {'x-amz-content-sha256': linear_hash,
'x-amz-sha256-tree-hash': tree_hash,
'Content-Range': 'bytes %d-%d/*' % byte_range}
- response_headers = [('x-amz-sha256-tree-hash', 'TreeHash')]
+ response_headers = [('x-amz-sha256-tree-hash', u'TreeHash')]
uri = 'vaults/%s/multipart-uploads/%s' % (vault_name, upload_id)
return self.make_request('PUT', uri, headers=headers,
data=part_data, ok_responses=(204,),
Please sign in to comment.
Something went wrong with that request. Please try again.