File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 11Changelog
22=========
33
4+ Changes in Version 4.3.3
5+ ------------------------
6+
7+ - Fixed a performance regression in :meth: `~gridfs.GridOut.download_to_stream `
8+ and :meth: `~gridfs.GridOut.download_to_stream_by_name ` by reading in chunks
9+ instead of line by line.
10+
11+
412Changes in Version 4.3 (4.3.2)
513------------------------------
614
Original file line number Diff line number Diff line change @@ -796,7 +796,10 @@ def download_to_stream(
796796 Added ``session`` parameter.
797797 """
798798 with self .open_download_stream (file_id , session = session ) as gout :
799- for chunk in gout :
799+ while True :
800+ chunk = gout .readchunk ()
801+ if not len (chunk ):
802+ break
800803 destination .write (chunk )
801804
802805 @_csot .apply
@@ -977,7 +980,10 @@ def download_to_stream_by_name(
977980 Added ``session`` parameter.
978981 """
979982 with self .open_download_stream_by_name (filename , revision , session = session ) as gout :
980- for chunk in gout :
983+ while True :
984+ chunk = gout .readchunk ()
985+ if not len (chunk ):
986+ break
981987 destination .write (chunk )
982988
983989 def rename (
You can’t perform that action at this time.
0 commit comments