json-repair 0.1.5__py3-none-any.whl → 0.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- json_repair/json_repair.py +4 -1
- {json_repair-0.1.5.dist-info → json_repair-0.1.6.dist-info}/METADATA +1 -1
- json_repair-0.1.6.dist-info/RECORD +7 -0
- json_repair-0.1.5.dist-info/RECORD +0 -7
- {json_repair-0.1.5.dist-info → json_repair-0.1.6.dist-info}/LICENSE +0 -0
- {json_repair-0.1.5.dist-info → json_repair-0.1.6.dist-info}/WHEEL +0 -0
- {json_repair-0.1.5.dist-info → json_repair-0.1.6.dist-info}/top_level.txt +0 -0
json_repair/json_repair.py
CHANGED
@@ -46,7 +46,9 @@ class JSONParser:
|
|
46
46
|
if self.get_char_at() != ":":
|
47
47
|
self.insert_char_at(":")
|
48
48
|
self.index += 1
|
49
|
+
self.context = "object_value"
|
49
50
|
value = self.parse_json()
|
51
|
+
self.context = ""
|
50
52
|
obj[key] = value
|
51
53
|
|
52
54
|
if self.get_char_at() == ",":
|
@@ -95,6 +97,7 @@ class JSONParser:
|
|
95
97
|
(char := self.get_char_at()) != '"'
|
96
98
|
and char is not False
|
97
99
|
and (self.context != "object_key" or char != ":")
|
100
|
+
and (self.context != "object_value" or (char != "," and char != "}"))
|
98
101
|
):
|
99
102
|
self.index += 1
|
100
103
|
|
@@ -102,7 +105,7 @@ class JSONParser:
|
|
102
105
|
if self.get_char_at() != '"':
|
103
106
|
self.insert_char_at('"')
|
104
107
|
# A fallout of the previous special case, we need to update the index only if we didn't enter that case
|
105
|
-
if self.context != "object_key" or char != ":":
|
108
|
+
if (self.context != "object_key" or char != ":") and (self.context != "object_value" or (char != "," and char != "}")):
|
106
109
|
self.index += 1
|
107
110
|
|
108
111
|
return self.json_str[start:end]
|
@@ -0,0 +1,7 @@
|
|
1
|
+
json_repair/__init__.py,sha256=5Sn_TG7QYURJ6Fo9s7-vzngauLjfLQ1FVDgmZ35oS1c,52
|
2
|
+
json_repair/json_repair.py,sha256=MbP2LWsfJmB7KoeV3Q5Pqvi9r05kRsGOfCdrhXXF6EM,5138
|
3
|
+
json_repair-0.1.6.dist-info/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
|
4
|
+
json_repair-0.1.6.dist-info/METADATA,sha256=8X5GeJ-btfCFKp-6Ycq1rUHJa9X1pnNScz3VvjrXdVg,3482
|
5
|
+
json_repair-0.1.6.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
6
|
+
json_repair-0.1.6.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
|
7
|
+
json_repair-0.1.6.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
json_repair/__init__.py,sha256=5Sn_TG7QYURJ6Fo9s7-vzngauLjfLQ1FVDgmZ35oS1c,52
|
2
|
-
json_repair/json_repair.py,sha256=dxVR6iFDHLjlskxf_55n95CFHtfc8PfVs4gD4PMam9U,4912
|
3
|
-
json_repair-0.1.5.dist-info/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
|
4
|
-
json_repair-0.1.5.dist-info/METADATA,sha256=hukRglu9HI5Dpad9rcgJGxt2zavgLMc-vYQx3E0MhUU,3482
|
5
|
-
json_repair-0.1.5.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
6
|
-
json_repair-0.1.5.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
|
7
|
-
json_repair-0.1.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|