Skip to content

Commit

Permalink
Merge pull request #378 from Backblaze/fix_double_download_2
Browse files Browse the repository at this point in the history
Hotfix double download of small files
  • Loading branch information
ppolewicz authored Mar 22, 2023
2 parents a1453ed + b086a03 commit 472eaee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
* Connection timeout is now being set explicitly

### Fixed
* Small files downloaded twice

### Infrastructure
* Disable changelog verification for dependabot PRs

Expand Down
2 changes: 1 addition & 1 deletion b2sdk/b2http.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __enter__(self):
return self.response

def __exit__(self, exc_type, exc_val, exc_tb):
self.response.close()
return None


class HttpCallback:
Expand Down
2 changes: 1 addition & 1 deletion test/unit/b2http/test_b2http.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def test_get_content(self):
stream=True,
timeout=(B2Http.CONNECTION_TIMEOUT, B2Http.TIMEOUT),
)
self.response.close.assert_called_with()
self.response.close.assert_not_called() # prevent premature close() on requests.Response

def test_head_content(self):
self.session.head.return_value = self.response
Expand Down

0 comments on commit 472eaee

Please sign in to comment.