json-repair 0.27.0__tar.gz → 0.27.1__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.27.0/src/json_repair.egg-info → json_repair-0.27.1}/PKG-INFO +1 -1
- {json_repair-0.27.0 → json_repair-0.27.1}/pyproject.toml +1 -1
- {json_repair-0.27.0 → json_repair-0.27.1}/src/json_repair/json_repair.py +1 -1
- {json_repair-0.27.0 → json_repair-0.27.1/src/json_repair.egg-info}/PKG-INFO +1 -1
- {json_repair-0.27.0 → json_repair-0.27.1}/tests/test_json_repair.py +1 -0
- {json_repair-0.27.0 → json_repair-0.27.1}/LICENSE +0 -0
- {json_repair-0.27.0 → json_repair-0.27.1}/README.md +0 -0
- {json_repair-0.27.0 → json_repair-0.27.1}/setup.cfg +0 -0
- {json_repair-0.27.0 → json_repair-0.27.1}/src/json_repair/__init__.py +0 -0
- {json_repair-0.27.0 → json_repair-0.27.1}/src/json_repair.egg-info/SOURCES.txt +0 -0
- {json_repair-0.27.0 → json_repair-0.27.1}/src/json_repair.egg-info/dependency_links.txt +0 -0
- {json_repair-0.27.0 → json_repair-0.27.1}/src/json_repair.egg-info/top_level.txt +0 -0
- {json_repair-0.27.0 → json_repair-0.27.1}/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.27.
|
6
|
+
version = "0.27.1"
|
7
7
|
license = {file = "LICENSE"}
|
8
8
|
authors = [
|
9
9
|
{ name="Stefano Baccianella", email="4247706+mangiucugna@users.noreply.github.com" },
|
@@ -412,7 +412,7 @@ class JSONParser:
|
|
412
412
|
string_acc += char
|
413
413
|
self.index += 1
|
414
414
|
char = self.get_char_at()
|
415
|
-
if len(string_acc) >
|
415
|
+
if len(string_acc) > 0 and string_acc[-1] == "\\":
|
416
416
|
# This is a special case, if people use real strings this might happen
|
417
417
|
self.log("Found a stray escape sequence, normalizing it", "info")
|
418
418
|
string_acc = string_acc[:-1]
|
@@ -97,6 +97,7 @@ def test_missing_and_mixed_quotes():
|
|
97
97
|
assert repair_json('[{"key": "value", COMMENT "notes": "lorem "ipsum", sic."}]') == '[{"key": "value", "notes": "lorem \\"ipsum\\", sic."}]'
|
98
98
|
assert repair_json('{"key": ""value"}') == '{"key": "value"}'
|
99
99
|
assert repair_json('{"key": "value", 5: "value"}') == '{"key": "value", "5": "value"}'
|
100
|
+
assert repair_json('{"foo": "\\"bar\\""') == '{"foo": "\\"bar\\""}'
|
100
101
|
|
101
102
|
def test_array_edge_cases():
|
102
103
|
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
|