Skip to content

Commit baf910d

Browse files
committed
downloads should utilize streaming
1 parent 7d92087 commit baf910d

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Changelog
5858
resource that already exists (`Issue #182 <https://github.com/maxtepkeev/python-redmine/issues/182>`__)
5959
- Enumeration, Version, Group and Notes ``custom_fields`` attribute was returned as a list of dicts instead
6060
of being converted to ``ResourceSet`` object
61+
- Downloads were downloaded fully into memory instead of being streamed as needed
6162
- ``ResourceRequirementsError`` exception was broken since v2.0.0
6263
- RedmineUP CRM Contact and Deal resources sometimes weren't converted to Resource objects using Search API
6364

redminelib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ def download(self, url, savepath=None, filename=None, params=None):
124124
:param string filename: (optional). Name that will be used for the file.
125125
:param dict params: (optional). Params to send in the query string.
126126
"""
127-
with self.session(return_raw_response=True):
128-
response = self.engine.request('get', url, params=dict(params or {}, **{'stream': True}))
127+
with self.session(requests={'stream': True}, return_raw_response=True):
128+
response = self.engine.request('get', url, params=params or {})
129129

130130
# If a savepath wasn't provided we return a response directly
131131
# so a user can have maximum control over response data

0 commit comments

Comments
 (0)