We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb7a69d commit 2aee263Copy full SHA for 2aee263
roboflow/core/project.py
@@ -1,7 +1,7 @@
1
-import ast
2
import datetime
3
import json
4
import os
+import re
5
import sys
6
import time
7
import warnings
@@ -553,7 +553,11 @@ def _annotation_params(self, annotation_path):
553
554
def _parse_upload_error(self, error: rfapi.UploadError) -> str:
555
dict_part = str(error).split(": ", 2)[2]
556
- parsed_dict: dict = ast.literal_eval(dict_part)
+ if re.search(r"'\w+':", dict_part):
557
+ temp_str = dict_part.replace(r"\'", "<PLACEHOLDER>")
558
+ temp_str = temp_str.replace("'", '"')
559
+ dict_part = temp_str.replace("<PLACEHOLDER>", "'")
560
+ parsed_dict: dict = json.loads(dict_part)
561
message = parsed_dict.get("message")
562
return message or str(parsed_dict)
563
0 commit comments