This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author wolma
Recipients martin.panter, python-dev, serhiy.storchaka, skrah, vstinner, wolma
Date 2015-03-23.14:35:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1427121330.6.0.24452903784.issue23688@psf.upfronthosting.co.za>
In-reply-to
Content
something like:


    def write(self,data):
        self._check_closed()
        if self.mode != WRITE:
            import errno
            raise OSError(errno.EBADF, "write() on read-only GzipFile object")

        if self.fileobj is None:
            raise ValueError("write() on closed GzipFile object")

        if isinstance(data, bytes):
            length = len(data)
        elif isinstance(data, memoryview) and not data.c_contiguous:
            data = data.tobytes()
            length = len(data)
        else:
            # accept any data that supports the buffer protocol
            data = memoryview(data)
            length = data.nbytes

        if length > 0:
            self.fileobj.write(self.compress.compress(data))
            self.size += length
            self.crc = zlib.crc32(data, self.crc) & 0xffffffff
            self.offset += length

        return length
History
Date User Action Args
2015-03-23 14:35:30wolmasetrecipients: + wolma, vstinner, skrah, python-dev, martin.panter, serhiy.storchaka
2015-03-23 14:35:30wolmasetmessageid: <1427121330.6.0.24452903784.issue23688@psf.upfronthosting.co.za>
2015-03-23 14:35:30wolmalinkissue23688 messages
2015-03-23 14:35:30wolmacreate