Skip to content

fix unclosed file handle in get_xml#807

Open
darshmenon wants to merge 1 commit into
ARISE-Initiative:masterfrom
darshmenon:fix-unclosed-file-in-get-xml
Open

fix unclosed file handle in get_xml#807
darshmenon wants to merge 1 commit into
ARISE-Initiative:masterfrom
darshmenon:fix-unclosed-file-in-get-xml

Conversation

@darshmenon
Copy link
Copy Markdown

Fixes #801

get_xml() in binding_utils.py called open(filename).read() without a context manager, leaving the file handle open and causing ResourceWarning: unclosed file every time get_state() is called.

Fixed by wrapping in a with block so the file is properly closed after reading.

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.

get_xml() -> ResourceWarning: Enable tracemalloc to get the object allocation traceback

1 participant