From 78b53032b83a35fae9a41e610f667af3e41165b9 Mon Sep 17 00:00:00 2001 From: Leo Ueno Date: Mon, 25 Nov 2024 07:39:55 -0800 Subject: [PATCH 1/2] Check that responsejson is instance of dict --- roboflow/adapters/rfapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roboflow/adapters/rfapi.py b/roboflow/adapters/rfapi.py index 3e1d1982..11925588 100644 --- a/roboflow/adapters/rfapi.py +++ b/roboflow/adapters/rfapi.py @@ -101,7 +101,7 @@ def upload_image( pass if response.status_code != 200: - if responsejson: + if responsejson and isinstance(responsejson, dict): err_msg = responsejson if err_msg.get("error"): From e035b748d459261cb3d9c0a8cdb6d23ea67b716e Mon Sep 17 00:00:00 2001 From: Leo Ueno Date: Mon, 25 Nov 2024 07:52:36 -0800 Subject: [PATCH 2/2] Make ruff happy --- roboflow/core/version.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/roboflow/core/version.py b/roboflow/core/version.py index 069ffd35..c0b9da52 100644 --- a/roboflow/core/version.py +++ b/roboflow/core/version.py @@ -818,11 +818,8 @@ def __download_zip(self, link, location, format): def bar_progress(current, total, width=80): progress_message = ( - "Downloading Dataset Version Zip in " - + location - + " to " - + format - + ": %d%% [%d / %d] bytes" % (current / total * 100, current, total) + f"Downloading Dataset Version Zip in {location} to {format}: " + f"{current / total * 100:.0f}% [{current} / {total}] bytes" ) sys.stdout.write("\r" + progress_message) sys.stdout.flush()