MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / close

Method close

tools/python-3.11.9-amd64/Lib/gzip.py:327–344  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

325 return self.fileobj is None
326
327 def close(self):
328 fileobj = self.fileobj
329 if fileobj is None:
330 return
331 self.fileobj = None
332 try:
333 if self.mode == WRITE:
334 fileobj.write(self.compress.flush())
335 write32u(fileobj, self.crc)
336 # self.size may exceed 2 GiB, or even 4 GiB
337 write32u(fileobj, self.size & 0xffffffff)
338 elif self.mode == READ:
339 self._buffer.close()
340 finally:
341 myfileobj = self.myfileobj
342 if myfileobj:
343 self.myfileobj = None
344 myfileobj.close()
345
346 def flush(self,zlib_mode=zlib.Z_SYNC_FLUSH):
347 self._check_not_closed()

Callers 2

gzopenMethod · 0.95
mainFunction · 0.95

Calls 3

write32uFunction · 0.85
writeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected