partialjson 0.0.9__tar.gz → 0.1.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: partialjson
3
- Version: 0.0.9
3
+ Version: 0.1.0
4
4
  Summary: Parse incomplete or partial json
5
5
  Home-page: https://github.com/iw4p/partialjson
6
6
  Author: Nima Akbarzadeh
@@ -6,7 +6,7 @@ Parsing ChatGPT JSON stream response — Partial and incomplete JSON parser pyth
6
6
 
7
7
  from .json_parser import JSONParser
8
8
 
9
- __version__ = "0.0.9"
9
+ __version__ = "0.1.0"
10
10
  __author__ = "Nima Akbarzadeh"
11
11
  __author_email__ = "iw4p@protonmail.com"
12
12
  __license__ = "MIT"
@@ -117,14 +117,14 @@ class JSONParser:
117
117
  return s[1:], ""
118
118
  return s[1:], ""
119
119
  else:
120
- # Check for incomplete escape sequences
120
+ # Handle incomplete escape sequences
121
121
  if incomplete_escape_regex.match(s[1:]):
122
- return s[1:], ""
122
+ return "", ""
123
123
  # Attempt to parse the string without incomplete escape sequences
124
124
  try:
125
125
  return json.loads(f'"{s[1:]}"'), ""
126
126
  except json.JSONDecodeError:
127
- return s[1:], ""
127
+ return "", ""
128
128
  str_val = s[: end + 1]
129
129
  s = s[end + 1 :]
130
130
  if not self.strict:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: partialjson
3
- Version: 0.0.9
3
+ Version: 0.1.0
4
4
  Summary: Parse incomplete or partial json
5
5
  Home-page: https://github.com/iw4p/partialjson
6
6
  Author: Nima Akbarzadeh
File without changes
File without changes
File without changes
File without changes