Skip to content

fix: replace bare except with json.JSONDecodeError in trajectory parser#318

Open
nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
nuthalapativarun:fix/trajectory-parser-bare-except
Open

fix: replace bare except with json.JSONDecodeError in trajectory parser#318
nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
nuthalapativarun:fix/trajectory-parser-bare-except

Conversation

@nuthalapativarun
Copy link
Copy Markdown

Summary

  • Replace a bare except: clause with except json.JSONDecodeError: in the trajectory parser's evaluation log loader

Changes

  • ufo/trajectory/parser.py: narrow the exception catch in _load_evaluation_data from bare except to json.JSONDecodeError — the only error json.load raises for malformed input; a bare except would silently swallow unrelated errors (e.g. IOError, PermissionError) and hide data corruption issues

Related Issue

No open issue — identified as a code quality improvement in ufo/trajectory/parser.py.

@nuthalapativarun
Copy link
Copy Markdown
Author

Hi team — gentle ping on this PR. Happy to rebase or address any feedback if needed. Let me know if there's anything blocking review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant