Nir Soffer <[email protected]> added the comment:
When using highlevel request() api, users can control the block size by
wrapping the file object with an iterator:
class FileIter:
def __init__(self, file, blocksize):
self.file = file
self.blocksize = blocksize
def __iter__(self):
while True:
datablock = self.file.read(self.blocksize)
if not datablock:
break
yield datablock
Adding configurable block size will avoid this workaround.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue31945>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com