json-repair 0.29.8__tar.gz → 0.29.9__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {json_repair-0.29.8/src/json_repair.egg-info → json_repair-0.29.9}/PKG-INFO +1 -1
- {json_repair-0.29.8 → json_repair-0.29.9}/pyproject.toml +1 -1
- {json_repair-0.29.8 → json_repair-0.29.9}/src/json_repair/json_parser.py +4 -2
- {json_repair-0.29.8 → json_repair-0.29.9/src/json_repair.egg-info}/PKG-INFO +1 -1
- {json_repair-0.29.8 → json_repair-0.29.9}/tests/test_json_repair.py +1 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/LICENSE +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/README.md +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/setup.cfg +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/src/json_repair/__init__.py +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/src/json_repair/__main__.py +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/src/json_repair/json_context.py +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/src/json_repair/json_repair.py +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/src/json_repair/py.typed +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/src/json_repair/string_file_wrapper.py +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/src/json_repair.egg-info/SOURCES.txt +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/src/json_repair.egg-info/dependency_links.txt +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/src/json_repair.egg-info/entry_points.txt +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/src/json_repair.egg-info/top_level.txt +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/tests/test_coverage.py +0 -0
- {json_repair-0.29.8 → json_repair-0.29.9}/tests/test_performance.py +0 -0
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.0"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
4
4
|
[project]
|
5
5
|
name = "json_repair"
|
6
|
-
version = "0.29.
|
6
|
+
version = "0.29.9"
|
7
7
|
license = {file = "LICENSE"}
|
8
8
|
authors = [
|
9
9
|
{ name="Stefano Baccianella", email="4247706+mangiucugna@users.noreply.github.com" },
|
@@ -318,11 +318,13 @@ class JSONParser:
|
|
318
318
|
if next_c and next_c in [",", "}"]:
|
319
319
|
rstring_delimiter_missing = False
|
320
320
|
elif char == ",":
|
321
|
+
# skip any whitespace first
|
322
|
+
i = self.skip_whitespaces_at(idx=1, move_main_index=False)
|
321
323
|
# We couldn't find any rstring_delimeter before the end of the string
|
322
324
|
# check if this is the last string of an object and therefore we can keep going
|
323
325
|
# make an exception if this is the last char before the closing brace
|
324
|
-
|
325
|
-
if i > 1:
|
326
|
+
j = self.skip_to_character(character="}", idx=i)
|
327
|
+
if j - i > 1:
|
326
328
|
# Ok it's not right after the comma
|
327
329
|
# Let's ignore
|
328
330
|
rstring_delimiter_missing = False
|
@@ -107,6 +107,7 @@ def test_missing_and_mixed_quotes():
|
|
107
107
|
assert repair_json('{"" key":"val"') == '{" key": "val"}'
|
108
108
|
assert repair_json('{"key": value "key2" : "value2" ') == '{"key": "value", "key2": "value2"}'
|
109
109
|
assert repair_json('{"key": "lorem ipsum ... "sic " tamet. ...}') == '{"key": "lorem ipsum ... \\"sic \\" tamet. ..."}'
|
110
|
+
assert repair_json('{"key": value , }') == '{"key": "value"}'
|
110
111
|
|
111
112
|
def test_array_edge_cases():
|
112
113
|
assert repair_json("[1, 2, 3,") == "[1, 2, 3]"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|