@@ -301,7 +301,7 @@ def _response_event(self, response: Response) -> None:
301
301
302
302
def download2fp (self , url_path : str , fp , dav : bool , params = None , ** kwargs ):
303
303
adapter = self .adapter_dav if dav else self .adapter
304
- with adapter .stream ("GET" , url_path , params = params , headers = kwargs .get ("headers" , None )) as response :
304
+ with adapter .stream ("GET" , url_path , params = params , headers = kwargs .get ("headers" )) as response :
305
305
check_error (response )
306
306
for data_chunk in response .iter_raw (chunk_size = kwargs .get ("chunk_size" , 5 * 1024 * 1024 )):
307
307
fp .write (data_chunk )
@@ -425,7 +425,7 @@ async def _response_event(self, response: Response) -> None:
425
425
426
426
async def download2fp (self , url_path : str , fp , dav : bool , params = None , ** kwargs ):
427
427
adapter = self .adapter_dav if dav else self .adapter
428
- async with adapter .stream ("GET" , url_path , params = params , headers = kwargs .get ("headers" , None )) as response :
428
+ async with adapter .stream ("GET" , url_path , params = params , headers = kwargs .get ("headers" )) as response :
429
429
check_error (response )
430
430
async for data_chunk in response .aiter_raw (chunk_size = kwargs .get ("chunk_size" , 5 * 1024 * 1024 )):
431
431
fp .write (data_chunk )
0 commit comments