Skip to content

fix: close file handles in read_full_med_mentions and read_ner_from_tsv#612

Open
Chessing234 wants to merge 1 commit into
allenai:mainfrom
Chessing234:fix/599-close-file-handles
Open

fix: close file handles in read_full_med_mentions and read_ner_from_tsv#612
Chessing234 wants to merge 1 commit into
allenai:mainfrom
Chessing234:fix/599-close-file-handles

Conversation

@Chessing234

Copy link
Copy Markdown

Fixes #599

Summary

  • Wrap PMID ID list reads in read_full_med_mentions() with context managers
  • Wrap TSV iteration in read_ner_from_tsv() with a context manager

Test plan

  • Verified file opens use with statements and preserve existing behavior

Made with Cursor

Use context managers when opening ID list files and TSV inputs so file
handles are closed promptly instead of relying on GC.

Fixes allenai#599.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

fix: unclosed file handles in read_full_med_mentions() and read_ner_from_tsv()

1 participant