diff --git a/moto/glacier/responses.py b/moto/glacier/responses.py index fd3bf3525..37cbdc4c9 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 72b2afb16..6a139a91c 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")