Skip to content

Commit 1dbe01d

Browse files
committed
Fix no content on stream download
1 parent 8d5c971 commit 1dbe01d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

O365/drive.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,20 @@ def download(self, to_path=None, name=None, chunk_size='auto',
9393
response.reason))
9494
return False
9595

96-
def write_output(out):
97-
if stream:
98-
for chunk in response.iter_content(
99-
chunk_size=chunk_size):
100-
if chunk:
101-
out.write(chunk)
102-
else:
103-
out.write(response.content)
104-
105-
if output:
106-
write_output(output)
107-
else:
108-
with to_path.open(mode='wb') as output:
96+
def write_output(out):
97+
if stream:
98+
for chunk in response.iter_content(
99+
chunk_size=chunk_size):
100+
if chunk:
101+
out.write(chunk)
102+
else:
103+
out.write(response.content)
104+
105+
if output:
109106
write_output(output)
107+
else:
108+
with to_path.open(mode='wb') as output:
109+
write_output(output)
110110

111111
except Exception as e:
112112
log.error(

0 commit comments

Comments
 (0)