Skip to content

Commit

Permalink
Merge pull request #13 from matthewhanson/develop
Browse files Browse the repository at this point in the history
publish 0.3.1
  • Loading branch information
matthewhanson authored Jul 30, 2020
2 parents 09c10a1 + c6ed5c6 commit 178d15d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [v0.3.1] = 2020-07-29

### Changed
- s3.download() now uses boto3 download_file for multipart stream downloads to avoid memory errors downloading large files

## [v0.3.0] = 2020-06-14

### Changed
Expand Down Expand Up @@ -77,7 +82,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
Initial Release

[Unreleased]: https://github.com/matthewhanson/boto3-utils/compare/master...develop
[v0.3.0]: https://github.com/matthewhanson/boto3-utils/compare/0.3.0...0.2.3
[v0.3.1]: https://github.com/matthewhanson/boto3-utils/compare/0.3.0...0.3.1
[v0.3.0]: https://github.com/matthewhanson/boto3-utils/compare/0.2.3...0.3.0
[v0.2.3]: https://github.com/matthewhanson/boto3-utils/compare/0.2.2...0.2.3
[v0.2.2]: https://github.com/matthewhanson/boto3-utils/compare/0.2.1...0.2.2
[v0.2.1]: https://github.com/matthewhanson/boto3-utils/compare/0.2.0...0.2.1
Expand Down
9 changes: 4 additions & 5 deletions boto3utils/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,10 @@ def download(self, uri, path=''):
logger.debug("Downloading %s as %s" % (uri, fout))
if path != '':
makedirs(path, exist_ok=True)

response = self.get_object(s3_uri['bucket'], s3_uri['key'])

with open(fout, 'wb') as f:
f.write(response['Body'].read())
extra_args = None
if self.requester_pays:
extra_args = {'RequestPayer': 'requester'}
self.s3.download_file(s3_uri['bucket'], s3_uri['key'], fout, ExtraArgs=extra_args)
return fout

def read(self, url):
Expand Down
2 changes: 1 addition & 1 deletion boto3utils/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.3.0'
__version__ = '0.3.1'

0 comments on commit 178d15d

Please sign in to comment.