Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Avoid unnecessary file open in reader.py#67

Open
Stephen0512 wants to merge 1 commit intoArcadia-Science:masterfrom
Stephen0512:master
Open

Avoid unnecessary file open in reader.py#67
Stephen0512 wants to merge 1 commit intoArcadia-Science:masterfrom
Stephen0512:master

Conversation

@Stephen0512
Copy link
Copy Markdown

This pull request fixes a file-handling issue in reader.py. The code previously opened the file outside of a context manager, but that file handle was never used and was later reopened inside a with block. This resulted in an unnecessary file open and a potential resource leak. While Python’s garbage collector will eventually close the file once it is no longer referenced, it is generally better practice to explicitly close files or use a context manager.

This change removes the redundant open() call without changing behavior. The issue was identified during an ongoing research project.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant