Message239030
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 |
|
Date |
User |
Action |
Args |
2015-03-23 14:35:30 | wolma | set | recipients:
+ wolma, vstinner, skrah, python-dev, martin.panter, serhiy.storchaka |
2015-03-23 14:35:30 | wolma | set | messageid: <1427121330.6.0.24452903784.issue23688@psf.upfronthosting.co.za> |
2015-03-23 14:35:30 | wolma | link | issue23688 messages |
2015-03-23 14:35:30 | wolma | create | |
|