json-repair 0.26.0__py3-none-any.whl → 0.27.1__py3-none-any.whl

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.
@@ -301,7 +301,7 @@ class JSONParser:
301
301
 
302
302
  char = self.get_char_at()
303
303
  # A valid string can only start with a valid quote or, in our case, with a literal
304
- while char and char not in ['"', "'", "“"] and not char.isalpha():
304
+ while char and char not in ['"', "'", "“"] and not char.isalnum():
305
305
  self.index += 1
306
306
  char = self.get_char_at()
307
307
 
@@ -315,7 +315,7 @@ class JSONParser:
315
315
  elif char == "“":
316
316
  lstring_delimiter = "“"
317
317
  rstring_delimiter = "”"
318
- elif char.isalpha():
318
+ elif char.isalnum():
319
319
  # This could be a <boolean> and not a string. Because (T)rue or (F)alse or (N)ull are valid
320
320
  # But remember, object keys are only of type string
321
321
  if char.lower() in ["t", "f", "n"] and self.get_context() != "object_key":
@@ -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) > 1 and string_acc[-1] == "\\":
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]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: json_repair
3
- Version: 0.26.0
3
+ Version: 0.27.1
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
@@ -0,0 +1,7 @@
1
+ json_repair/__init__.py,sha256=IIzSm1DsCRrr8seF3UeMZXwxcq-tE3j-8d1WBxvEJvE,178
2
+ json_repair/json_repair.py,sha256=54sOesew2z21WAd4UVaEYOLI8oUkSqF8Z4HbkYBdCj8,31792
3
+ json_repair-0.27.1.dist-info/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
4
+ json_repair-0.27.1.dist-info/METADATA,sha256=z1CIA9xV6Cnd7Ko49bZ1snzdwJHK-ev8vKCfhV62vzo,7863
5
+ json_repair-0.27.1.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
6
+ json_repair-0.27.1.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
7
+ json_repair-0.27.1.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- json_repair/__init__.py,sha256=IIzSm1DsCRrr8seF3UeMZXwxcq-tE3j-8d1WBxvEJvE,178
2
- json_repair/json_repair.py,sha256=OSRwsg96BbOzdgwN3BuynsIu1HxYt1oY4o3kebAXXhQ,31792
3
- json_repair-0.26.0.dist-info/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
4
- json_repair-0.26.0.dist-info/METADATA,sha256=YZ4ccI-izYyi-SXujrNbSpD_Op0CDYAM7DTJ4K9Cfnw,7863
5
- json_repair-0.26.0.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
6
- json_repair-0.26.0.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
7
- json_repair-0.26.0.dist-info/RECORD,,