json-repair 0.16.0__py3-none-any.whl → 0.16.1__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 +24 -7
- {json_repair-0.16.0.dist-info → json_repair-0.16.1.dist-info}/METADATA +1 -1
- json_repair-0.16.1.dist-info/RECORD +7 -0
- json_repair-0.16.0.dist-info/RECORD +0 -7
- {json_repair-0.16.0.dist-info → json_repair-0.16.1.dist-info}/LICENSE +0 -0
- {json_repair-0.16.0.dist-info → json_repair-0.16.1.dist-info}/WHEEL +0 -0
- {json_repair-0.16.0.dist-info → json_repair-0.16.1.dist-info}/top_level.txt +0 -0
json_repair/json_repair.py
CHANGED
@@ -302,7 +302,8 @@ class JSONParser:
|
|
302
302
|
while next_c and next_c != rstring_delimiter:
|
303
303
|
# If we are in an object context, let's check for the right delimiters
|
304
304
|
if (
|
305
|
-
|
305
|
+
next_c == lstring_delimiter
|
306
|
+
or ("object_key" in self.context and next_c == ":")
|
306
307
|
or ("object_value" in self.context and next_c in ["}", ","])
|
307
308
|
or ("array" in self.context and next_c in ["]", ","])
|
308
309
|
):
|
@@ -310,12 +311,28 @@ class JSONParser:
|
|
310
311
|
i += 1
|
311
312
|
next_c = self.get_char_at(i)
|
312
313
|
if next_c == rstring_delimiter:
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
)
|
317
|
-
|
318
|
-
|
314
|
+
# But this might not be it! This could be just a missing comma
|
315
|
+
# We need to check if we find a rstring_delimiter and a colon after
|
316
|
+
i += 1
|
317
|
+
next_c = self.get_char_at(i)
|
318
|
+
while next_c and next_c != rstring_delimiter:
|
319
|
+
i += 1
|
320
|
+
next_c = self.get_char_at(i)
|
321
|
+
i += 1
|
322
|
+
next_c = self.get_char_at(i)
|
323
|
+
while next_c and next_c != ":":
|
324
|
+
if next_c in [lstring_delimiter, rstring_delimiter, ","]:
|
325
|
+
break
|
326
|
+
i += 1
|
327
|
+
next_c = self.get_char_at(i)
|
328
|
+
# Only if we fail to find a ':' then we know this is misplaced quote
|
329
|
+
if next_c != ":":
|
330
|
+
self.log(
|
331
|
+
"While parsing a string, we a misplaced quote that would have closed the string but has a different meaning here, ignoring it",
|
332
|
+
"info",
|
333
|
+
)
|
334
|
+
self.index += 1
|
335
|
+
char = self.get_char_at()
|
319
336
|
|
320
337
|
if (
|
321
338
|
char
|
@@ -0,0 +1,7 @@
|
|
1
|
+
json_repair/__init__.py,sha256=AlNie5y6BZBioGi5fzTAUvum_y0U5aL5aNsuQ_68LQc,175
|
2
|
+
json_repair/json_repair.py,sha256=P3jzLaa70VyyE-kjRhijJ4gEPMXba3FmsocJF7bPB9I,21417
|
3
|
+
json_repair-0.16.1.dist-info/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
|
4
|
+
json_repair-0.16.1.dist-info/METADATA,sha256=UCkuATUR-x0kFLbunLN_htTmUy5T5ZAzXOFhEVeISNc,7355
|
5
|
+
json_repair-0.16.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
6
|
+
json_repair-0.16.1.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
|
7
|
+
json_repair-0.16.1.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
json_repair/__init__.py,sha256=AlNie5y6BZBioGi5fzTAUvum_y0U5aL5aNsuQ_68LQc,175
|
2
|
-
json_repair/json_repair.py,sha256=XahLp82VVwg8KgyywNxMFBHIPIbvPDp6uWMP1VD_40w,20418
|
3
|
-
json_repair-0.16.0.dist-info/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
|
4
|
-
json_repair-0.16.0.dist-info/METADATA,sha256=-OLuKPGwu4enrP7kP2947Gyz9l7JRVpGTRH1b1MB2ZY,7355
|
5
|
-
json_repair-0.16.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
6
|
-
json_repair-0.16.0.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
|
7
|
-
json_repair-0.16.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|