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
Describe the bug
I was trying the json response streaming from openai api and fix it using this library. When the json input was {" it got my program stuck for some reason. After deep investigation, I found it was an infinite loop in this library. Attached below are some screenshots with what's happening and the function that it's happening in. I added some print() in the library code to check what's happening.
To Reproduce
Steps to reproduce the behavior:
Import the library
make your JSON string {"
use the repair_json function from the library
You will have a stuck program with an infinite loop.
Expected behavior
Should throw an error or have an empty object like {}.
Screenshots
Desktop (please complete the following information):
OS: MacOS Sonoma
Version 0.4.1
The text was updated successfully, but these errors were encountered:
Describe the bug
I was trying the json response streaming from openai api and fix it using this library. When the json input was
{"
it got my program stuck for some reason. After deep investigation, I found it was an infinite loop in this library. Attached below are some screenshots with what's happening and the function that it's happening in. I added someprint()
in the library code to check what's happening.To Reproduce
Steps to reproduce the behavior:
{"
repair_json
function from the libraryExpected behavior
Should throw an error or have an empty object like
{}
.Screenshots
![CleanShot 2023-11-22 at 07 01 50@2x](https://private-user-images.githubusercontent.com/60552218/284805181-6b2b7096-6d5e-473a-ae7b-84c89b7afee6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk0MjE1MDksIm5iZiI6MTcxOTQyMTIwOSwicGF0aCI6Ii82MDU1MjIxOC8yODQ4MDUxODEtNmIyYjcwOTYtNmQ1ZS00NzNhLWFlN2ItODRjODliN2FmZWU2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI2VDE3MDAwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY5N2FhNDRlN2VkNTFlZjU3NTQxNTdhY2JhMTM0ZmE3YTNjNmI5NDQ4OGYzNWM0ZGFiZmNhODVhYzI5ZDdhNDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.2v3BMt26HiPiIF8RMZ3SOnjMpiUbLU2d70REbImkEig)
![CleanShot 2023-11-22 at 07 00 37@2x](https://private-user-images.githubusercontent.com/60552218/284805195-864a11a1-1d85-4065-9c4b-2d4a2d6bc66f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk0MjE1MDksIm5iZiI6MTcxOTQyMTIwOSwicGF0aCI6Ii82MDU1MjIxOC8yODQ4MDUxOTUtODY0YTExYTEtMWQ4NS00MDY1LTljNGItMmQ0YTJkNmJjNjZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI2VDE3MDAwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY1ODg1NDAxNzU3MzVhYTZhOTM5ZWFmZDg3MjZlYjM1OWMyMDZhM2YyZjI1MWUxNmM1M2QyYjVlNDc0MzMyMmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Bb0n_9mZHIMO04aIh2DrUGc6eVLB9jatVZ-JHZRFq78)
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: