diff --git a/src/cryptojwt/key_bundle.py b/src/cryptojwt/key_bundle.py index efedd85c..f4d7b0dd 100755 --- a/src/cryptojwt/key_bundle.py +++ b/src/cryptojwt/key_bundle.py @@ -290,7 +290,8 @@ def do_local_jwk(self, filename): :param filename: Name of the file from which the JWKS should be loaded """ - _info = json.loads(open(filename).read()) + with open(filename) as input_file: + _info = json.load(input_file) if 'keys' in _info: self.do_keys(_info["keys"]) else: