@@ -314,7 +314,7 @@ async def save(
314314 deleted attachments if too much time has passed, and it does not work
315315 on some types of attachments.
316316 chunksize: Optional[:class:`int`]
317- The maximum size of each chunk to process.
317+ The maximum size of each chunk to process. Must be a positive non-null integer.
318318
319319 Returns
320320 -------
@@ -336,7 +336,7 @@ async def save(
336336 data = await self .read (use_cached = use_cached )
337337
338338 if isinstance (fp , io .BufferedIOBase ):
339- if chunksize :
339+ if chunksize is not None :
340340 written = 0
341341 async for chunk in data :
342342 written += fp .write (chunk )
@@ -347,7 +347,7 @@ async def save(
347347 return written
348348 else :
349349 with open (fp , "wb" ) as f :
350- if chunksize :
350+ if chunksize is not None :
351351 written = 0
352352 async for chunk in data :
353353 written += f .write (chunk )
@@ -400,7 +400,7 @@ async def read_chunked(
400400 Parameters
401401 ----------
402402 chunksize: :class:`int`
403- The maximum size of each chunk to process.
403+ The maximum size of each chunk to process. Must be a positive non-null integer.
404404 use_cached: :class:`bool`
405405 Whether to use :attr:`proxy_url` rather than :attr:`url` when downloading
406406 the attachment. This will allow attachments to be saved after deletion
0 commit comments