This pull request optimizes the code to download the release tarball with two changes:
Use context managers to automatically close the output file and HTTP response object removing the need for an explicit close call and handling the resource cleanup in cases of unexpected crashes, etc.
Instead of reading the entire response into memory, download it in chunks and write to the output file as the chunks arrive, curtsy of shutil.copyfileobj.
This pull request optimizes the code to download the release tarball with two changes: