mangiucugna / json_repair

A python module to repair invalid JSON, commonly used to parse the output of LLMs

Home Page:https://pypi.org/project/json-repair/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infinite loop with open array and closed parent element

mlxyz opened this issue · comments

commented

Describe the bug
The library runs into an infinite loop when calling repair_json('{foo: [}').

To Reproduce
Steps to reproduce the behavior:

  1. Call repair_json('{foo: [}')

Expected behavior
Output of fixed json: {foo: []}

Unfortunately, I don't have the time to create a PR so I just report the bug here.

Thank you for reporting, I am releasing 0.4.4 right now with the fix.