json-repair 0.29.6__tar.gz → 0.29.7__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.29.6/src/json_repair.egg-info → json_repair-0.29.7}/PKG-INFO +1 -1
  2. {json_repair-0.29.6 → json_repair-0.29.7}/pyproject.toml +1 -1
  3. {json_repair-0.29.6 → json_repair-0.29.7}/src/json_repair/json_parser.py +1 -1
  4. {json_repair-0.29.6 → json_repair-0.29.7/src/json_repair.egg-info}/PKG-INFO +1 -1
  5. {json_repair-0.29.6 → json_repair-0.29.7}/tests/test_json_repair.py +1 -1
  6. {json_repair-0.29.6 → json_repair-0.29.7}/LICENSE +0 -0
  7. {json_repair-0.29.6 → json_repair-0.29.7}/README.md +0 -0
  8. {json_repair-0.29.6 → json_repair-0.29.7}/setup.cfg +0 -0
  9. {json_repair-0.29.6 → json_repair-0.29.7}/src/json_repair/__init__.py +0 -0
  10. {json_repair-0.29.6 → json_repair-0.29.7}/src/json_repair/__main__.py +0 -0
  11. {json_repair-0.29.6 → json_repair-0.29.7}/src/json_repair/json_context.py +0 -0
  12. {json_repair-0.29.6 → json_repair-0.29.7}/src/json_repair/json_repair.py +0 -0
  13. {json_repair-0.29.6 → json_repair-0.29.7}/src/json_repair/py.typed +0 -0
  14. {json_repair-0.29.6 → json_repair-0.29.7}/src/json_repair/string_file_wrapper.py +0 -0
  15. {json_repair-0.29.6 → json_repair-0.29.7}/src/json_repair.egg-info/SOURCES.txt +0 -0
  16. {json_repair-0.29.6 → json_repair-0.29.7}/src/json_repair.egg-info/dependency_links.txt +0 -0
  17. {json_repair-0.29.6 → json_repair-0.29.7}/src/json_repair.egg-info/entry_points.txt +0 -0
  18. {json_repair-0.29.6 → json_repair-0.29.7}/src/json_repair.egg-info/top_level.txt +0 -0
  19. {json_repair-0.29.6 → json_repair-0.29.7}/tests/test_coverage.py +0 -0
  20. {json_repair-0.29.6 → json_repair-0.29.7}/tests/test_performance.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: json_repair
3
- Version: 0.29.6
3
+ Version: 0.29.7
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.29.6"
6
+ version = "0.29.7"
7
7
  license = {file = "LICENSE"}
8
8
  authors = [
9
9
  { name="Stefano Baccianella", email="4247706+mangiucugna@users.noreply.github.com" },
@@ -336,8 +336,8 @@ class JSONParser:
336
336
  if char and len(string_acc) > 0 and string_acc[-1] == "\\":
337
337
  # This is a special case, if people use real strings this might happen
338
338
  self.log("Found a stray escape sequence, normalizing it")
339
- string_acc = string_acc[:-1]
340
339
  if char in [rstring_delimiter, "t", "n", "r", "b", "\\"]:
340
+ string_acc = string_acc[:-1]
341
341
  escape_seqs = {"t": "\t", "n": "\n", "r": "\r", "b": "\b"}
342
342
  string_acc += escape_seqs.get(char, char) or char
343
343
  self.index += 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: json_repair
3
- Version: 0.29.6
3
+ Version: 0.29.7
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
@@ -120,7 +120,7 @@ def test_array_edge_cases():
120
120
 
121
121
  def test_escaping():
122
122
  assert repair_json("'\"'") == '""'
123
- assert repair_json("{\"key\": 'string\"\n\t\le'") == '{"key": "string\\"\\n\\tle"}'
123
+ assert repair_json("{\"key\": 'string\"\n\t\le'") == '{"key": "string\\"\\n\\t\\\\le"}'
124
124
  assert repair_json(r'{"real_content": "Some string: Some other string \t Some string <a href=\"https://domain.com\">Some link</a>"') == r'{"real_content": "Some string: Some other string \t Some string <a href=\"https://domain.com\">Some link</a>"}'
125
125
  assert repair_json('{"key_1\n": "value"}') == '{"key_1": "value"}'
126
126
  assert repair_json('{"key\t_": "value"}') == '{"key\\t_": "value"}'
File without changes
File without changes
File without changes