json-repair 0.50.0__py3-none-any.whl → 0.50.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/parse_string.py +12 -9
- {json_repair-0.50.0.dist-info → json_repair-0.50.1.dist-info}/METADATA +2 -2
- {json_repair-0.50.0.dist-info → json_repair-0.50.1.dist-info}/RECORD +7 -7
- {json_repair-0.50.0.dist-info → json_repair-0.50.1.dist-info}/WHEEL +0 -0
- {json_repair-0.50.0.dist-info → json_repair-0.50.1.dist-info}/entry_points.txt +0 -0
- {json_repair-0.50.0.dist-info → json_repair-0.50.1.dist-info}/licenses/LICENSE +0 -0
- {json_repair-0.50.0.dist-info → json_repair-0.50.1.dist-info}/top_level.txt +0 -0
json_repair/parse_string.py
CHANGED
@@ -391,18 +391,21 @@ def parse_string(self: "JSONParser") -> str | bool | None:
|
|
391
391
|
self.index += 1
|
392
392
|
char = self.get_char_at()
|
393
393
|
elif self.context.current == ContextValues.ARRAY:
|
394
|
-
#
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
394
|
+
# So here we can have a few valid cases:
|
395
|
+
# ["bla bla bla "puppy" bla bla bla "kitty" bla bla"]
|
396
|
+
# ["value1" value2", "value3"]
|
397
|
+
# The basic idea is that if we find an even number of delimiters after this delimiter
|
398
|
+
# we ignore this delimiter as it should be fine
|
399
|
+
even_delimiters = next_c == rstring_delimiter
|
400
|
+
while next_c == rstring_delimiter:
|
399
401
|
i = self.skip_to_character(character=[rstring_delimiter, "]"], idx=i + 1)
|
402
|
+
next_c = self.get_char_at(i)
|
403
|
+
if next_c != rstring_delimiter:
|
404
|
+
even_delimiters = False
|
405
|
+
break
|
400
406
|
i = self.skip_to_character(character=[rstring_delimiter, "]"], idx=i + 1)
|
401
407
|
next_c = self.get_char_at(i)
|
402
|
-
|
403
|
-
# next_c = self.get_char_at(i)
|
404
|
-
# if next_c in [",", "]"]:
|
405
|
-
if even_delimiters and next_c != "]":
|
408
|
+
if even_delimiters:
|
406
409
|
# If we got up to here it means that this is a situation like this:
|
407
410
|
# ["bla bla bla "puppy" bla bla bla "kitty" bla bla"]
|
408
411
|
# So we need to ignore this quote
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: json_repair
|
3
|
-
Version: 0.50.
|
3
|
+
Version: 0.50.1
|
4
4
|
Summary: A package to repair broken json strings
|
5
5
|
Author-email: Stefano Baccianella <4247706+mangiucugna@users.noreply.github.com>
|
6
6
|
License-Expression: MIT
|
@@ -17,7 +17,7 @@ Dynamic: license-file
|
|
17
17
|
|
18
18
|
[](https://pypi.org/project/json-repair/)
|
19
19
|

|
20
|
-
[](https://pypi.org/project/json-repair/)
|
21
21
|
[](https://pepy.tech/projects/json-repair)
|
22
22
|
[](https://github.com/sponsors/mangiucugna)
|
23
23
|
[](https://github.com/mangiucugna/json_repair/stargazers)
|
@@ -10,12 +10,12 @@ json_repair/parse_boolean_or_null.py,sha256=WMSkvvxsp4wvauBcDqtt9WnLMD5SMoxeRfZF
|
|
10
10
|
json_repair/parse_comment.py,sha256=JHtQ_QlxOvPNnMh7lhUaoTjFGelqjhTNq7qn9xUE7SU,2648
|
11
11
|
json_repair/parse_number.py,sha256=33zAtkbuVzi9Lqjxu7cXn9WlVzd3WjRx9Ln_LFzVL4o,1259
|
12
12
|
json_repair/parse_object.py,sha256=UzkY0C5NSE2CtVnZwugMyhhtUJPgs0MwBb4kF4l2ftU,4563
|
13
|
-
json_repair/parse_string.py,sha256=
|
13
|
+
json_repair/parse_string.py,sha256=7PX7eIjez6-y2Dgl2njxRC7FyV-j-WmW6RVhlXrDEfk,24379
|
14
14
|
json_repair/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
15
15
|
json_repair/string_file_wrapper.py,sha256=tGkWBEUPE-CZPf4uSM5NE9oSDTpskX0myJiXsl-gbds,4333
|
16
|
-
json_repair-0.50.
|
17
|
-
json_repair-0.50.
|
18
|
-
json_repair-0.50.
|
19
|
-
json_repair-0.50.
|
20
|
-
json_repair-0.50.
|
21
|
-
json_repair-0.50.
|
16
|
+
json_repair-0.50.1.dist-info/licenses/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
|
17
|
+
json_repair-0.50.1.dist-info/METADATA,sha256=DjTnwnBHvhzIGhlj-NbF37_8v3Dg4UgqTSPZ7UMfL7k,10980
|
18
|
+
json_repair-0.50.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
19
|
+
json_repair-0.50.1.dist-info/entry_points.txt,sha256=SNfge3zPSP-ASqriYU9r3NAPaXdseYr7ciPMKdV2uSw,57
|
20
|
+
json_repair-0.50.1.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
|
21
|
+
json_repair-0.50.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|