You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request]: Add timeout parameter to repair_json #203
I’d like to request a simple feature: add an optional timeout parameter to the repair_json function.
In some cases, when the input JSON string is badly malformed, the repair process may take too long. A timeout option would allow users to stop the repair process after a specified amount of time. The feature is friendly for Python users to stop a repair task that may take a very long time.
If not provided, the current behavior stays unchanged.
If the timeout is reached, the function should raise an exception or return a clear error.
Thank you so much!
Context
I ran into a problematic case with a malformed JSON response that contained an unclosed string followed by many comma-separated fragments. For this input shape, the runtime appeared to grow non-linearly as the input size increased:
In production or user-facing applications, this kind of input can cause a request to hang for too long. An optional timeout parameter would let callers put an upper bound on repair time, fail gracefully, and avoid blocking the application when malformed input triggers very slow repair behavior.
Hi, thanks for reporting. Before I add a feature like this that would require some work, can you try the latest release? I have investigated your report and I think I found the performance bottlenecks that require a timeout to begin with.
Activity
mangiucugna commentedon Jun 29, 2026
Hi, thanks for reporting. Before I add a feature like this that would require some work, can you try the latest release? I have investigated your report and I think I found the performance bottlenecks that require a timeout to begin with.