json-repair 0.35.0__tar.gz → 0.36.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (20) hide show
  1. {json_repair-0.35.0/src/json_repair.egg-info → json_repair-0.36.0}/PKG-INFO +2 -2
  2. {json_repair-0.35.0 → json_repair-0.36.0}/pyproject.toml +1 -1
  3. {json_repair-0.35.0 → json_repair-0.36.0}/src/json_repair/json_parser.py +4 -0
  4. {json_repair-0.35.0 → json_repair-0.36.0/src/json_repair.egg-info}/PKG-INFO +2 -2
  5. {json_repair-0.35.0 → json_repair-0.36.0}/tests/test_json_repair.py +2 -1
  6. {json_repair-0.35.0 → json_repair-0.36.0}/LICENSE +0 -0
  7. {json_repair-0.35.0 → json_repair-0.36.0}/README.md +0 -0
  8. {json_repair-0.35.0 → json_repair-0.36.0}/setup.cfg +0 -0
  9. {json_repair-0.35.0 → json_repair-0.36.0}/src/json_repair/__init__.py +0 -0
  10. {json_repair-0.35.0 → json_repair-0.36.0}/src/json_repair/__main__.py +0 -0
  11. {json_repair-0.35.0 → json_repair-0.36.0}/src/json_repair/json_context.py +0 -0
  12. {json_repair-0.35.0 → json_repair-0.36.0}/src/json_repair/json_repair.py +0 -0
  13. {json_repair-0.35.0 → json_repair-0.36.0}/src/json_repair/py.typed +0 -0
  14. {json_repair-0.35.0 → json_repair-0.36.0}/src/json_repair/string_file_wrapper.py +0 -0
  15. {json_repair-0.35.0 → json_repair-0.36.0}/src/json_repair.egg-info/SOURCES.txt +0 -0
  16. {json_repair-0.35.0 → json_repair-0.36.0}/src/json_repair.egg-info/dependency_links.txt +0 -0
  17. {json_repair-0.35.0 → json_repair-0.36.0}/src/json_repair.egg-info/entry_points.txt +0 -0
  18. {json_repair-0.35.0 → json_repair-0.36.0}/src/json_repair.egg-info/top_level.txt +0 -0
  19. {json_repair-0.35.0 → json_repair-0.36.0}/tests/test_coverage.py +0 -0
  20. {json_repair-0.35.0 → json_repair-0.36.0}/tests/test_performance.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: json_repair
3
- Version: 0.35.0
3
+ Version: 0.36.0
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: MIT License
@@ -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.35.0"
6
+ version = "0.36.0"
7
7
  license = {file = "LICENSE"}
8
8
  authors = [
9
9
  { name="Stefano Baccianella", email="4247706+mangiucugna@users.noreply.github.com" },
@@ -223,6 +223,10 @@ class JSONParser:
223
223
  "While parsing an array we missed the closing ], adding it back",
224
224
  )
225
225
  self.index -= 1
226
+ # Add the missing closing bracket
227
+ self.json_str = (
228
+ self.json_str[: self.index + 1] + "]" + self.json_str[self.index + 1 :]
229
+ )
226
230
 
227
231
  self.index += 1
228
232
  self.context.reset()
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: json_repair
3
- Version: 0.35.0
3
+ Version: 0.36.0
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: MIT License
@@ -122,7 +122,8 @@ def test_array_edge_cases():
122
122
  assert repair_json('{"key1": {"key2": [1, 2, 3') == '{"key1": {"key2": [1, 2, 3]}}'
123
123
  assert repair_json('{"key": ["value]}') == '{"key": ["value"]}'
124
124
  assert repair_json('["lorem "ipsum" sic"]') == '["lorem \\"ipsum\\" sic"]'
125
-
125
+ assert repair_json('{"key1": ["value1", "value2"}, "key2": ["value3", "value4"]}') == '{"key1": ["value1", "value2"], "key2": ["value3", "value4"]}'
126
+
126
127
  def test_escaping():
127
128
  assert repair_json("'\"'") == '""'
128
129
  assert repair_json("{\"key\": 'string\"\n\t\le'") == '{"key": "string\\"\\n\\t\\\\le"}'
File without changes
File without changes
File without changes