json-repair 0.25.2__tar.gz → 0.25.3__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.25.2/src/json_repair.egg-info → json_repair-0.25.3}/PKG-INFO +1 -1
- {json_repair-0.25.2 → json_repair-0.25.3}/pyproject.toml +1 -1
- {json_repair-0.25.2 → json_repair-0.25.3}/src/json_repair/json_repair.py +13 -0
- {json_repair-0.25.2 → json_repair-0.25.3/src/json_repair.egg-info}/PKG-INFO +1 -1
- {json_repair-0.25.2 → json_repair-0.25.3}/tests/test_json_repair.py +1 -0
- {json_repair-0.25.2 → json_repair-0.25.3}/LICENSE +0 -0
- {json_repair-0.25.2 → json_repair-0.25.3}/README.md +0 -0
- {json_repair-0.25.2 → json_repair-0.25.3}/setup.cfg +0 -0
- {json_repair-0.25.2 → json_repair-0.25.3}/src/json_repair/__init__.py +0 -0
- {json_repair-0.25.2 → json_repair-0.25.3}/src/json_repair.egg-info/SOURCES.txt +0 -0
- {json_repair-0.25.2 → json_repair-0.25.3}/src/json_repair.egg-info/dependency_links.txt +0 -0
- {json_repair-0.25.2 → json_repair-0.25.3}/src/json_repair.egg-info/top_level.txt +0 -0
- {json_repair-0.25.2 → json_repair-0.25.3}/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.25.
|
6
|
+
version = "0.25.3"
|
7
7
|
license = {file = "LICENSE"}
|
8
8
|
authors = [
|
9
9
|
{ name="Stefano Baccianella", email="4247706+mangiucugna@users.noreply.github.com" },
|
@@ -352,6 +352,19 @@ class JSONParser:
|
|
352
352
|
)
|
353
353
|
doubled_quotes = True
|
354
354
|
self.index += 1
|
355
|
+
else:
|
356
|
+
# Ok this is not a doubled quote, check if this is an empty string or not
|
357
|
+
i = 1
|
358
|
+
next_c = self.get_char_at(i)
|
359
|
+
while next_c and next_c.isspace():
|
360
|
+
i += 1
|
361
|
+
next_c = self.get_char_at(i)
|
362
|
+
if next_c not in [",", "]", "}"]:
|
363
|
+
self.log(
|
364
|
+
"While parsing a string, we found a doubled quote but it was a mistake, removing one quote",
|
365
|
+
"info",
|
366
|
+
)
|
367
|
+
self.index += 1
|
355
368
|
|
356
369
|
# Initialize our return value
|
357
370
|
string_acc = ""
|
@@ -95,6 +95,7 @@ def test_missing_and_mixed_quotes():
|
|
95
95
|
== '{"name": "John", "age": 30, "city": "New"}'
|
96
96
|
)
|
97
97
|
assert repair_json('[{"key": "value", COMMENT "notes": "lorem "ipsum", sic."}]') == '[{"key": "value", "notes": "lorem \\"ipsum\\", sic."}]'
|
98
|
+
assert repair_json('{"key": ""value"}') == '{"key": "value"}'
|
98
99
|
|
99
100
|
def test_array_edge_cases():
|
100
101
|
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
|