Merge pull request #1594 from fujimotos/sf/json-bytes

AWSServiceSpec: Fix `TypeError` exceptions within json.load()
This commit is contained in:
Steve Pulec 2018-05-30 23:07:20 -04:00 committed by GitHub
commit 05e544f2ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import datetime
import json
import logging
import re
import io
import pytz
from moto.core.exceptions import DryRunClientError
@ -622,7 +623,7 @@ class AWSServiceSpec(object):
def __init__(self, path):
self.path = resource_filename('botocore', path)
with open(self.path, "rb") as f:
with io.open(self.path, 'r', encoding='utf-8') as f:
spec = json.load(f)
self.metadata = spec['metadata']
self.operations = spec['operations']