From 62b5b12d58adb6689c09cc6b97f9067fbfe969f1 Mon Sep 17 00:00:00 2001 From: Alex Bostock Date: Tue, 20 Feb 2024 17:00:52 +0000 Subject: [PATCH] Fix style / lint issues --- scribemi/ScribeMi.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scribemi/ScribeMi.py b/scribemi/ScribeMi.py index 3e072ed..1d1ddf5 100644 --- a/scribemi/ScribeMi.py +++ b/scribemi/ScribeMi.py @@ -419,9 +419,11 @@ def fetch_model(self, task: MITask): res = requests.get(modelUrl) if res.status_code == 200: md5checksum_expected = res.headers['ETag'].replace('"', '') - md5checksum = md5(res.text.encode()).hexdigest() + md5checksum = md5(res.text.encode(), usedforsecurity=False).hexdigest() if md5checksum != md5checksum_expected: - raise Exception("Integrity Error: invalid checksum. Please retry.") + raise Exception( + "Integrity Error: invalid checksum. Please retry." + ) return json.loads(res.text) elif res.status_code == 401 or res.status_code == 403: @@ -500,6 +502,6 @@ def delete_task(self, task: MITask): def upload_file(file, md5checksum, url): - res = requests.put(url, data=file, headers={ 'Content-MD5': md5checksum }) + res = requests.put(url, data=file, headers={'Content-MD5': md5checksum}) if res.status_code != 200: raise Exception("Error uploading file: {}".format(res.status_code))