Author nirs
Recipients brett.cannon, nirs, serhiy.storchaka, vstinner, yselivanov
Date 2017-11-06.09:57:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1509962269.15.0.213398074469.issue31945@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-11-06 09:57:49nirssetrecipients: + nirs, brett.cannon, vstinner, serhiy.storchaka, yselivanov
2017-11-06 09:57:49nirssetmessageid: <1509962269.15.0.213398074469.issue31945@psf.upfronthosting.co.za>
2017-11-06 09:57:49nirslinkissue31945 messages
2017-11-06 09:57:49nirscreate