json-repair 0.54.1__py3-none-any.whl → 0.54.3__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.
@@ -84,10 +84,13 @@ class JSONParser:
84
84
  while self.index < len(self.json_str):
85
85
  self.context.reset()
86
86
  j = self.parse_json()
87
- if j != "":
87
+ if j:
88
88
  if ObjectComparer.is_same_object(json[-1], j):
89
89
  # replace the last entry with the new one since the new one seems an update
90
90
  json.pop()
91
+ else:
92
+ if not json[-1]:
93
+ json.pop()
91
94
  json.append(j)
92
95
  else:
93
96
  # this was a bust, move the index
@@ -125,7 +125,12 @@ def parse_object(self: "JSONParser") -> JSONReturnType:
125
125
 
126
126
  if self.get_char_at() in [",", "'", '"']:
127
127
  self.index += 1
128
-
128
+ if self.get_char_at() == "]" and ContextValues.ARRAY in self.context.context:
129
+ self.log(
130
+ "While parsing an object we found a closing array bracket, closing the object here and rolling back the index"
131
+ )
132
+ self.index -= 1
133
+ break
129
134
  # Remove trailing spaces
130
135
  self.skip_whitespaces()
131
136
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: json_repair
3
- Version: 0.54.1
3
+ Version: 0.54.3
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
@@ -1,11 +1,11 @@
1
1
  json_repair/__init__.py,sha256=JQ4Nm8YzR8Id2a527Ql0Az-rKapTp8DCMPKybLtQ620,180
2
2
  json_repair/__main__.py,sha256=EsJb-y89uZEvGQQg1GdIDWzfDwfOMvVekKEtdguQXCM,67
3
- json_repair/json_parser.py,sha256=nATFDlcEnPD8G2NDSKj2nme_v1la_cCcFZrdQvEjTZs,8495
3
+ json_repair/json_parser.py,sha256=1C24BNRNOg-hwJzLsCWuW75xYctm0haSynrDsGCy3d8,8595
4
4
  json_repair/json_repair.py,sha256=iT-OJgpBnKUJVIV4IUlXmMUkOyW6bNnKCZLB7Fys8hk,12758
5
5
  json_repair/parse_array.py,sha256=rZfnRiS86vBATOUHqSx2T5fE79Ndlk2NoTsg9Wek7l4,2239
6
6
  json_repair/parse_comment.py,sha256=MUDxrx8BFfAaKvx6x4gWviJNvwRi2yv5qnrR6honmas,2660
7
7
  json_repair/parse_number.py,sha256=XCx5ygGuliFn0T9sFqTFggTrDMNlV2uAIE2PYdt5Hao,1321
8
- json_repair/parse_object.py,sha256=noaiP10kzl-jA-1jc6tMmtFoJMIputpB3zFxcAuYQvY,6986
8
+ json_repair/parse_object.py,sha256=q6ZJ5hQkT_Q_Jzd2FtDRvwWzyZ9a1NfQ1XadozcHX6U,7280
9
9
  json_repair/parse_string.py,sha256=L4McLWzRkbW_7Xx_hSGOmfpoPMwbYTGEKBAjqwanLEs,26146
10
10
  json_repair/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  json_repair/parse_string_helpers/parse_boolean_or_null.py,sha256=pGmH1QATBls70kTvUlJv4F8NiPaBWcyGhRL03sTOnto,871
@@ -14,9 +14,9 @@ json_repair/utils/constants.py,sha256=cv2gvyosuq0me0600WyTysM9avrtfXPuXYR26tawcu
14
14
  json_repair/utils/json_context.py,sha256=WsMOjqpGSr6aaDONcrk8UFtTurzWon2Qq9AoBBYseoI,934
15
15
  json_repair/utils/object_comparer.py,sha256=XKV3MRab8H7_v4sm-wpEa5le0XX9OeycWo5S-MFm-GI,1716
16
16
  json_repair/utils/string_file_wrapper.py,sha256=Zlm0ZfJAw_VPlIy-QldL_OKYrPk3TYGq1JVAFPv7SnQ,6862
17
- json_repair-0.54.1.dist-info/licenses/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
18
- json_repair-0.54.1.dist-info/METADATA,sha256=ZsLr6MREEfdma1fHpVtcWWvI07KnJ3TZO2yIH60YHqI,12222
19
- json_repair-0.54.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- json_repair-0.54.1.dist-info/entry_points.txt,sha256=SNfge3zPSP-ASqriYU9r3NAPaXdseYr7ciPMKdV2uSw,57
21
- json_repair-0.54.1.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
22
- json_repair-0.54.1.dist-info/RECORD,,
17
+ json_repair-0.54.3.dist-info/licenses/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
18
+ json_repair-0.54.3.dist-info/METADATA,sha256=ODPQ2cWesHEWEcTanUliVt3zcheD92bPK_McZz3A1U4,12222
19
+ json_repair-0.54.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
+ json_repair-0.54.3.dist-info/entry_points.txt,sha256=SNfge3zPSP-ASqriYU9r3NAPaXdseYr7ciPMKdV2uSw,57
21
+ json_repair-0.54.3.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
22
+ json_repair-0.54.3.dist-info/RECORD,,