Skip to content

Fix bare except blocks #299

Closed
Closed

Description

@avinxshKD

There are a lot of bare except: statements throughout the code that catch everything including KeyboardInterrupt and SystemExit. Makes debugging painful, if something hangs you can't even Ctrl+C out of it, and actual errors get silently swallowed

Worst is cwrap.py which has 15+ bare excepts like

try:
    apikey=open(concore.inpath+'1/concore.apikey',newline=None).readline().rstrip()
except:
    apikey = ''

These should at minimum be except Exception: to avoid catching system-level stuff, or better yet catch specific exceptions like FileNotFoundError or IOError depending on what could actually fail. Not critical but would make debugging way easier

Activity

  1. added 2 commits that reference this issue on Feb 13, 2026
    84667aa
    86f2e15
  2. avinxshKD commented on Feb 13, 2026

    @avinxshKD
    ContributorAuthor

    Hi @pradeeban ready for review, fixed bare excepts in main repo as asked
    And also kept separate from the file I/O refactoring PR. #301

    could you also check my previous issues and related PRs to ensure these align with the project's direction? Thanks

  3. pradeeban commented on Feb 13, 2026

    @pradeeban
    Member

    Thanks, yes, this is a good one to fix.

  4. added a commit that references this issue on Feb 14, 2026
    c539ee4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions