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

Method rotator

Lib/test/test_logging.py:6512–6518  ·  view source on GitHub ↗
(source, dest)

Source from the content-addressed store, hash-verified

6510 return name + ".gz"
6511
6512 def rotator(source, dest):
6513 with open(source, "rb") as sf:
6514 data = sf.read()
6515 compressed = zlib.compress(data, 9)
6516 with open(dest, "wb") as df:
6517 df.write(compressed)
6518 os.remove(source)
6519
6520 rh = logging.handlers.RotatingFileHandler(
6521 self.fn, encoding="utf-8", backupCount=2, maxBytes=1)

Callers 1

rotateMethod · 0.45

Calls 5

openFunction · 0.50
readMethod · 0.45
compressMethod · 0.45
writeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected