From 5a1873c31a84ed4b0a53703d73f73c3198a635d7 Mon Sep 17 00:00:00 2001 From: wwakabobik Date: Tue, 10 Oct 2023 19:47:23 +0200 Subject: [PATCH] Remove redundant encoding for binary mode --- testrail_api_reporter/utils/reporter_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testrail_api_reporter/utils/reporter_utils.py b/testrail_api_reporter/utils/reporter_utils.py index eaaa74d..c1c64fd 100644 --- a/testrail_api_reporter/utils/reporter_utils.py +++ b/testrail_api_reporter/utils/reporter_utils.py @@ -28,10 +28,10 @@ def upload_image(filename, api_token): """ payload = {"type": "file", "action": "upload", "key": api_token} with open(filename, "rb") as source_file: - files = {"source": source_file} - response = requests.post( - url="https://freeimage.host/api/1/upload", data=payload, timeout=5, verify=True, files=files - ) + response = requests.post( + url="https://freeimage.host/api/1/upload", data=payload, timeout=5, verify=True, + files={"source": source_file} + ) return { "image": response.json()["image"]["file"]["resource"]["chain"]["image"], "thumb": response.json()["image"]["file"]["resource"]["chain"]["thumb"],