Skip to content

Commit 93a3757

Browse files
committed
simplify stream-saving, this code may have been causing inexplicable freezes
1 parent 7806355 commit 93a3757

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

download.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ def save_file_from_stream(resp, filename):
8383
"""
8484
Save a file from a streamed response
8585
"""
86-
chunk_size = 1024
86+
#chunk_size = 1024
8787
with open(filename + '.' + find_extension(resp), 'wb') as fd: # pylint: disable=invalid-name
88-
for chunk in resp.iter_content(chunk_size):
89-
fd.write(chunk)
88+
fd.write(resp.content)
89+
#for chunk in resp.iter_content(chunk_size):
90+
# fd.write(chunk)
9091

9192

9293
def strain_soup(bbl, soup, target, get_statement_url):

0 commit comments

Comments
 (0)