Repository navigation
Conversation
StateData(**state_dict) raises TypeError when state_dict is valid JSON but not a dict (e.g., a list [1, 2] or string "x"). Only ValueError was caught, leaving TypeError unhandled. Fixes: allen0099#368
Owner
|
Thanks for looking at #368. The one-line change points in the right direction, but it is missing what the issue asks for: a test for each of We will fix #368 ourselves in a separate PR, so I am closing this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In , raises when is valid JSON but not a dict object (e.g., a JSON array or string ). Only was caught, leaving unhandled.
Fix
Catch both and in the final try block of .
Testing
The fix was validated against the reported scenario: when is a non-dict JSON value, raises which is now caught and re-raised as .
Fixes #368