MCPcopy Index your code
hub / github.com/python/cpython / _WriteBufferStream

Class _WriteBufferStream

Lib/gzip.py:129–144  ·  view source on GitHub ↗

Minimal object to pass WriteBuffer flushes into GzipFile

Source from the content-addressed store, hash-verified

127
128
129class _WriteBufferStream(io.RawIOBase):
130 """Minimal object to pass WriteBuffer flushes into GzipFile"""
131 def __init__(self, gzip_file):
132 self.gzip_file = weakref.ref(gzip_file)
133
134 def write(self, data):
135 gzip_file = self.gzip_file()
136 if gzip_file is None:
137 raise RuntimeError("lost gzip_file")
138 return gzip_file._write_raw(data)
139
140 def seekable(self):
141 return False
142
143 def writable(self):
144 return True
145
146
147class GzipFile(_streams.BaseStream):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…