Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that responsejson is instance of dict #342

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion roboflow/adapters/rfapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
7 changes: 2 additions & 5 deletions roboflow/core/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down