security(polymarket-browse): replace bare except: with specific exception handling #32

Closed
shoko wants to merge 0 commits from security/9-bare-except into master
Owner

Summary

Replace bare except: clauses with specific exception handling to prevent swallowing critical errors.

Changes

  • Lines 386, 400: except: changed to except (ValueError, TypeError):
  • ValueError: datetime.fromisoformat parse failure
  • TypeError: input is not a string type

Rationale

Bare except: catches ALL exceptions including KeyboardInterrupt, SystemExit, and MemoryError. This security fix ensures only expected parsing errors are caught.

Testing

70/70 tests passing

## Summary Replace bare `except:` clauses with specific exception handling to prevent swallowing critical errors. ## Changes - Lines 386, 400: `except:` changed to `except (ValueError, TypeError):` - `ValueError`: datetime.fromisoformat parse failure - `TypeError`: input is not a string type ## Rationale Bare `except:` catches ALL exceptions including `KeyboardInterrupt`, `SystemExit`, and `MemoryError`. This security fix ensures only expected parsing errors are caught. ## Testing 70/70 tests passing
shoko added 1 commit 2026-03-26 20:09:38 +01:00
- Lines 386, 400: except: changed to except (ValueError, TypeError):
- ValueError: datetime.fromisoformat parse failure
- TypeError: input is not a string
- Prevents swallowing KeyboardInterrupt, SystemExit, MemoryError
shoko reviewed 2026-03-27 01:51:02 +01:00
shoko left a comment
Author
Owner

Review requested

Review requested
shoko added the need review label 2026-03-27 01:52:44 +01:00
han approved these changes 2026-03-27 02:02:05 +01:00
han left a comment
Collaborator

lgtm

lgtm
han added approved and removed need review labels 2026-03-27 02:02:23 +01:00
shoko closed this pull request 2026-03-27 04:09:42 +01:00

Pull request closed

Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/jujutsu-skills#32