You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are three places in coverage.py where a file is simply opened and read from in a single line, e.g., open(file_path)read(). While technically valid, it does rely somewhat on CPython semantics of refcounting; other VMs might not close the open file quickly. It also triggers ResourceWarnings in Python 3.2 when run under development settings.
A patch is attached which adds try/finally blocks to explicitly close files.
Brett, thanks, I should have known this, having made these very same changes to Cog when porting to Jython. The patch looks great, but I won't get to applying it for a few days...
Originally reported by Brett Cannon (Bitbucket: brettcannon, GitHub: brettcannon)
There are three places in coverage.py where a file is simply opened and read from in a single line, e.g.,
open(file_path)read()
. While technically valid, it does rely somewhat on CPython semantics of refcounting; other VMs might not close the open file quickly. It also triggers ResourceWarnings in Python 3.2 when run under development settings.A patch is attached which adds try/finally blocks to explicitly close files.
The text was updated successfully, but these errors were encountered: