diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-03-24 06:41:21 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-24 15:41:21 +0200 |
| commit | ed3ec04a085593dd0d07820f9bce836d2c46d01e (patch) | |
| tree | b21b91b2233132377f5604eefa6db4c43a16a49d /.github/workflows/codeqa-test.yml | |
| parent | 251a0939a0e09352ae930f480cadbabfc103d240 (diff) | |
| download | wheel-git-ed3ec04a085593dd0d07820f9bce836d2c46d01e.tar.gz | |
Fix resource leak in WheelFile.open() (#338)
In WheelFile.open(), if the hash does not exist, avoid opening the file
before raising the exception. Previously would leak the open file
resource which could result in a ResourceWarning when Python warnings
are enabled:
ResourceWarning: unclosed file <_io.FileIO name='…/test_testzip_missing_hash0/test-1.0-py2.py3-none-any.whl' mode='rb' closefd=True>
Python warnings are now enabled during tests to help catch these
earlier.
Diffstat (limited to '.github/workflows/codeqa-test.yml')
| -rw-r--r-- | .github/workflows/codeqa-test.yml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/.github/workflows/codeqa-test.yml b/.github/workflows/codeqa-test.yml index 7d638cb..a84594b 100644 --- a/.github/workflows/codeqa-test.yml +++ b/.github/workflows/codeqa-test.yml @@ -50,4 +50,4 @@ jobs: - name: Install test dependencies run: pip install .[test] - name: Test with pytest - run: pytest + run: python -b -m pytest -W always |
