Skip to content

Fixes #516: replace bare except with Exception and fix file handle leaks - #517

Merged
SunnyHaze merged 1 commit into
OpenDCAI:mainfrom
xuuuuuuu9:fix/bare-except-and-file-leaks
Aug 12, 2026
Merged

Fixes #516: replace bare except with Exception and fix file handle leaks#517
SunnyHaze merged 1 commit into
OpenDCAI:mainfrom
xuuuuuuu9:fix/bare-except-and-file-leaks

Conversation

@xuuuuuuu9

Copy link
Copy Markdown
Contributor

Fixes #516

Summary

Replaced all bare except: patterns across the codebase with specific exception types, and fixed file handle leaks from missing with context managers.

Changes

Bare except: → specific exceptions (4 files)

  • python_executor.py: 3 bare except:except Exception: — makes code executor process killable
  • format_utils.py: 1 bare except:except AttributeError: — precise exception type
  • modeling_flash_llama.py: 1 bare except:except Exception: — flash-attn version fallback

File handle leaks (1 file)

  • mathbook_question_extract.py: json.load(open(...))with open(...) as f: — ensures file descriptors are closed

@SunnyHaze

Copy link
Copy Markdown
Collaborator

LGTM, Thanks~

@SunnyHaze
SunnyHaze merged commit 7f99d99 into OpenDCAI:main Aug 12, 2026
9 checks passed
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.

Bare except: and file handle leaks in multiple modules

2 participants