-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters