From 1177985e19a8caff2a645b5326164d04cdc780f2 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Fri, 5 Jun 2015 19:56:43 -0400 Subject: [PATCH] Python 3 fixes. --- moto/glacier/responses.py | 2 +- tests/test_glacier/test_glacier_archives.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/moto/glacier/responses.py b/moto/glacier/responses.py index fd3bf352..37cbdc4c 100644 --- a/moto/glacier/responses.py +++ b/moto/glacier/responses.py @@ -123,7 +123,7 @@ class GlacierResponse(_TemplateEnvironmentMixin): "Marker": None, }) elif method == 'POST': - json_body = json.loads(body) + json_body = json.loads(body.decode("utf-8")) archive_id = json_body['ArchiveId'] job_id = self.backend.initiate_job(vault_name, archive_id) headers['x-amz-job-id'] = job_id diff --git a/tests/test_glacier/test_glacier_archives.py b/tests/test_glacier/test_glacier_archives.py index 72b2afb1..6a139a91 100644 --- a/tests/test_glacier/test_glacier_archives.py +++ b/tests/test_glacier/test_glacier_archives.py @@ -10,7 +10,7 @@ from moto import mock_glacier @mock_glacier def test_create_and_delete_archive(): the_file = NamedTemporaryFile(delete=False) - the_file.write("some stuff") + the_file.write(b"some stuff") the_file.close() conn = boto.glacier.connect_to_region("us-west-2")