mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Fix incorrect use of json.dumps
All optional parameters to json.dumps() are now keyword-only in Python 3.6. Although this is the error that's flag, the tests use of json.dumps is actually incorrect: it should write the json.dumps with write()
This commit is contained in:
parent
36b1780f74
commit
64fb960c00
1 changed files with 2 additions and 1 deletions
|
|
@ -266,7 +266,8 @@ def test_with_tuf_and_metadata_tampering(self):
|
|||
tuf.formats.check_signable_object_format(metadata)
|
||||
|
||||
with open(metadata_path, 'wb') as file_object:
|
||||
json.dumps(metadata, file_object, indent=1, sort_keys=True).encode('utf-8')
|
||||
file_object.write(json.dumps(metadata, indent=1,
|
||||
separators=(',', ': '), sort_keys=True).encode('utf-8'))
|
||||
|
||||
# Verify that the malicious 'targets.json' is not downloaded. Perform
|
||||
# a refresh of top-level metadata to demonstrate that the malicious
|
||||
|
|
|
|||
Loading…
Reference in a new issue