json-repair 0.17.4__tar.gz → 0.19.0__tar.gz
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-0.17.4/src/json_repair.egg-info → json_repair-0.19.0}/PKG-INFO +1 -1
- {json_repair-0.17.4 → json_repair-0.19.0}/pyproject.toml +1 -1
- {json_repair-0.17.4 → json_repair-0.19.0}/src/json_repair/json_repair.py +6 -1
- {json_repair-0.17.4 → json_repair-0.19.0/src/json_repair.egg-info}/PKG-INFO +1 -1
- {json_repair-0.17.4 → json_repair-0.19.0}/tests/test_json_repair.py +3 -1
- {json_repair-0.17.4 → json_repair-0.19.0}/LICENSE +0 -0
- {json_repair-0.17.4 → json_repair-0.19.0}/README.md +0 -0
- {json_repair-0.17.4 → json_repair-0.19.0}/setup.cfg +0 -0
- {json_repair-0.17.4 → json_repair-0.19.0}/src/json_repair/__init__.py +0 -0
- {json_repair-0.17.4 → json_repair-0.19.0}/src/json_repair.egg-info/SOURCES.txt +0 -0
- {json_repair-0.17.4 → json_repair-0.19.0}/src/json_repair.egg-info/dependency_links.txt +0 -0
- {json_repair-0.17.4 → json_repair-0.19.0}/src/json_repair.egg-info/top_level.txt +0 -0
- {json_repair-0.17.4 → json_repair-0.19.0}/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.
|
6
|
+
version = "0.19.0"
|
7
7
|
license = {file = "LICENSE"}
|
8
8
|
authors = [
|
9
9
|
{ name="Stefano Baccianella", email="4247706+mangiucugna@users.noreply.github.com" },
|
@@ -178,7 +178,12 @@ class JSONParser:
|
|
178
178
|
if not value:
|
179
179
|
break
|
180
180
|
|
181
|
-
|
181
|
+
if value == "..." and self.get_char_at(-1) == ".":
|
182
|
+
self.log(
|
183
|
+
"While parsing an array, found a stray '...'; ignoring it", "info"
|
184
|
+
)
|
185
|
+
else:
|
186
|
+
arr.append(value)
|
182
187
|
|
183
188
|
# skip over whitespace after a value but before closing ]
|
184
189
|
char = self.get_char_at()
|
@@ -39,6 +39,9 @@ def test_repair_json():
|
|
39
39
|
== '{"name": "John", "age": 30, "city": "New York"}'
|
40
40
|
)
|
41
41
|
assert repair_json("[1, 2, 3,") == "[1, 2, 3]"
|
42
|
+
assert repair_json("[1, 2, 3, ...]") == "[1, 2, 3]"
|
43
|
+
assert repair_json("[1, 2, ... , 3]") == "[1, 2, 3]"
|
44
|
+
assert repair_json("[1, 2, '...', 3]") == '[1, 2, "...", 3]'
|
42
45
|
assert (
|
43
46
|
repair_json('{"employees":["John", "Anna",')
|
44
47
|
== '{"employees": ["John", "Anna"]}'
|
@@ -156,7 +159,6 @@ def test_repair_json_with_objects():
|
|
156
159
|
"age": 30,
|
157
160
|
"city": "New York",
|
158
161
|
}
|
159
|
-
assert repair_json("[1, 2, 3,", return_objects=True) == [1, 2, 3]
|
160
162
|
assert repair_json('{"employees":["John", "Anna",', return_objects=True) == {
|
161
163
|
"employees": ["John", "Anna"]
|
162
164
|
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|