json-repair 0.52.3__py3-none-any.whl → 0.52.4__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.
- json_repair/parse_string.py +5 -5
 - {json_repair-0.52.3.dist-info → json_repair-0.52.4.dist-info}/METADATA +1 -1
 - {json_repair-0.52.3.dist-info → json_repair-0.52.4.dist-info}/RECORD +7 -7
 - {json_repair-0.52.3.dist-info → json_repair-0.52.4.dist-info}/WHEEL +0 -0
 - {json_repair-0.52.3.dist-info → json_repair-0.52.4.dist-info}/entry_points.txt +0 -0
 - {json_repair-0.52.3.dist-info → json_repair-0.52.4.dist-info}/licenses/LICENSE +0 -0
 - {json_repair-0.52.3.dist-info → json_repair-0.52.4.dist-info}/top_level.txt +0 -0
 
    
        json_repair/parse_string.py
    CHANGED
    
    | 
         @@ -193,7 +193,7 @@ def parse_string(self: "JSONParser") -> JSONReturnType: 
     | 
|
| 
       193 
193 
     | 
    
         
             
                        not self.stream_stable
         
     | 
| 
       194 
194 
     | 
    
         
             
                        and char == "]"
         
     | 
| 
       195 
195 
     | 
    
         
             
                        and ContextValues.ARRAY in self.context.context
         
     | 
| 
       196 
     | 
    
         
            -
                        and string_acc[-1] != rstring_delimiter
         
     | 
| 
      
 196 
     | 
    
         
            +
                        and (not string_acc or string_acc[-1] != rstring_delimiter)
         
     | 
| 
       197 
197 
     | 
    
         
             
                    ):
         
     | 
| 
       198 
198 
     | 
    
         
             
                        # We found the end of an array and we are in array context
         
     | 
| 
       199 
199 
     | 
    
         
             
                        # So let's check if we find a rstring_delimiter forward otherwise end early
         
     | 
| 
         @@ -226,9 +226,9 @@ def parse_string(self: "JSONParser") -> JSONReturnType: 
     | 
|
| 
       226 
226 
     | 
    
         
             
                    self.index += 1
         
     | 
| 
       227 
227 
     | 
    
         
             
                    char = self.get_char_at()
         
     | 
| 
       228 
228 
     | 
    
         
             
                    # Unclosed string ends with a \ character. This character is ignored if stream_stable = True.
         
     | 
| 
       229 
     | 
    
         
            -
                    if self.stream_stable and not char and string_acc[-1] == "\\":
         
     | 
| 
      
 229 
     | 
    
         
            +
                    if self.stream_stable and not char and string_acc and string_acc[-1] == "\\":
         
     | 
| 
       230 
230 
     | 
    
         
             
                        string_acc = string_acc[:-1]
         
     | 
| 
       231 
     | 
    
         
            -
                    if char and string_acc[-1] == "\\":
         
     | 
| 
      
 231 
     | 
    
         
            +
                    if char and string_acc and string_acc[-1] == "\\":
         
     | 
| 
       232 
232 
     | 
    
         
             
                        # This is a special case, if people use real strings this might happen
         
     | 
| 
       233 
233 
     | 
    
         
             
                        self.log("Found a stray escape sequence, normalizing it")
         
     | 
| 
       234 
234 
     | 
    
         
             
                        if char in [rstring_delimiter, "t", "n", "r", "b", "\\"]:
         
     | 
| 
         @@ -237,7 +237,7 @@ def parse_string(self: "JSONParser") -> JSONReturnType: 
     | 
|
| 
       237 
237 
     | 
    
         
             
                            string_acc += escape_seqs.get(char, char)
         
     | 
| 
       238 
238 
     | 
    
         
             
                            self.index += 1
         
     | 
| 
       239 
239 
     | 
    
         
             
                            char = self.get_char_at()
         
     | 
| 
       240 
     | 
    
         
            -
                            while char and string_acc[-1] == "\\" and char in [rstring_delimiter, "\\"]:
         
     | 
| 
      
 240 
     | 
    
         
            +
                            while char and string_acc and string_acc[-1] == "\\" and char in [rstring_delimiter, "\\"]:
         
     | 
| 
       241 
241 
     | 
    
         
             
                                # this is a bit of a special case, if I don't do this it will close the loop or create a train of \\
         
     | 
| 
       242 
242 
     | 
    
         
             
                                # I don't love it though
         
     | 
| 
       243 
243 
     | 
    
         
             
                                string_acc = string_acc[:-1] + char
         
     | 
| 
         @@ -289,7 +289,7 @@ def parse_string(self: "JSONParser") -> JSONReturnType: 
     | 
|
| 
       289 
289 
     | 
    
         
             
                            )
         
     | 
| 
       290 
290 
     | 
    
         
             
                            break
         
     | 
| 
       291 
291 
     | 
    
         
             
                    # ChatGPT sometimes forget to quote stuff in html tags or markdown, so we do this whole thing here
         
     | 
| 
       292 
     | 
    
         
            -
                    if char == rstring_delimiter and string_acc[-1] != "\\":
         
     | 
| 
      
 292 
     | 
    
         
            +
                    if char == rstring_delimiter and string_acc and string_acc[-1] != "\\":
         
     | 
| 
       293 
293 
     | 
    
         
             
                        # Special case here, in case of double quotes one after another
         
     | 
| 
       294 
294 
     | 
    
         
             
                        if doubled_quotes and self.get_char_at(1) == rstring_delimiter:
         
     | 
| 
       295 
295 
     | 
    
         
             
                            self.log("While parsing a string, we found a doubled quote, ignoring it")
         
     | 
| 
         @@ -10,12 +10,12 @@ json_repair/parse_boolean_or_null.py,sha256=WMSkvvxsp4wvauBcDqtt9WnLMD5SMoxeRfZF 
     | 
|
| 
       10 
10 
     | 
    
         
             
            json_repair/parse_comment.py,sha256=JHtQ_QlxOvPNnMh7lhUaoTjFGelqjhTNq7qn9xUE7SU,2648
         
     | 
| 
       11 
11 
     | 
    
         
             
            json_repair/parse_number.py,sha256=33zAtkbuVzi9Lqjxu7cXn9WlVzd3WjRx9Ln_LFzVL4o,1259
         
     | 
| 
       12 
12 
     | 
    
         
             
            json_repair/parse_object.py,sha256=xMpO64sYW0JmUtW75BTD0EdPQjY7PYVgu4tHVXrWB6s,5582
         
     | 
| 
       13 
     | 
    
         
            -
            json_repair/parse_string.py,sha256= 
     | 
| 
      
 13 
     | 
    
         
            +
            json_repair/parse_string.py,sha256=banF0nNbONvO4C_SDQMDuCZO99UIQvKzRVki9xWVpfU,25686
         
     | 
| 
       14 
14 
     | 
    
         
             
            json_repair/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
         
     | 
| 
       15 
15 
     | 
    
         
             
            json_repair/string_file_wrapper.py,sha256=tGkWBEUPE-CZPf4uSM5NE9oSDTpskX0myJiXsl-gbds,4333
         
     | 
| 
       16 
     | 
    
         
            -
            json_repair-0.52. 
     | 
| 
       17 
     | 
    
         
            -
            json_repair-0.52. 
     | 
| 
       18 
     | 
    
         
            -
            json_repair-0.52. 
     | 
| 
       19 
     | 
    
         
            -
            json_repair-0.52. 
     | 
| 
       20 
     | 
    
         
            -
            json_repair-0.52. 
     | 
| 
       21 
     | 
    
         
            -
            json_repair-0.52. 
     | 
| 
      
 16 
     | 
    
         
            +
            json_repair-0.52.4.dist-info/licenses/LICENSE,sha256=wrjQo8MhNrNCicXtMe3MHmS-fx8AmQk1ue8AQwiiFV8,1076
         
     | 
| 
      
 17 
     | 
    
         
            +
            json_repair-0.52.4.dist-info/METADATA,sha256=x1rE0e8rADu8qoy4k4vE2iKEamEsfh-ykMu7xMngX7I,11027
         
     | 
| 
      
 18 
     | 
    
         
            +
            json_repair-0.52.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
         
     | 
| 
      
 19 
     | 
    
         
            +
            json_repair-0.52.4.dist-info/entry_points.txt,sha256=SNfge3zPSP-ASqriYU9r3NAPaXdseYr7ciPMKdV2uSw,57
         
     | 
| 
      
 20 
     | 
    
         
            +
            json_repair-0.52.4.dist-info/top_level.txt,sha256=7-VZwZN2CgB_n0NlSLk-rEUFh8ug21lESbsblOYuZqw,12
         
     | 
| 
      
 21 
     | 
    
         
            +
            json_repair-0.52.4.dist-info/RECORD,,
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     |