File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,6 @@ def _datalad_get(filepath):
209209
210210def _s3_get (filepath ):
211211 from sys import stderr
212- from math import ceil
213212 from tqdm import tqdm
214213 import requests
215214
@@ -228,14 +227,12 @@ def _s3_get(filepath):
228227 filepath .unlink ()
229228
230229 with filepath .open ("wb" ) as f :
231- for data in tqdm (
232- r .iter_content (block_size ),
233- total = ceil (total_size // block_size ),
234- unit = "B" ,
235- unit_scale = True ,
236- ):
237- wrote = wrote + len (data )
238- f .write (data )
230+ with tqdm (total = total_size , unit = "B" , unit_scale = True ) as t :
231+ for data in r .iter_content (block_size ):
232+ wrote = wrote + len (data )
233+ f .write (data )
234+ t .update (len (data ))
235+
239236 if total_size != 0 and wrote != total_size :
240237 raise RuntimeError ("ERROR, something went wrong" )
241238
You can’t perform that action at this time.
0 commit comments