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

Method rollover

Lib/tempfile.py:738–751  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

736 self.rollover()
737
738 def rollover(self):
739 if self._rolled: return
740 file = self._file
741 newfile = self._file = TemporaryFile(**self._TemporaryFileArgs)
742 del self._TemporaryFileArgs
743
744 pos = file.tell()
745 if hasattr(newfile, 'buffer'):
746 newfile.buffer.write(file.detach().getvalue())
747 else:
748 newfile.write(file.getvalue())
749 newfile.seek(pos, 0)
750
751 self._rolled = True
752
753 # The method caching trick from NamedTemporaryFile
754 # won't work here, because _file may change from a

Callers 3

_checkMethod · 0.95
filenoMethod · 0.95
truncateMethod · 0.95

Calls 6

TemporaryFileFunction · 0.85
tellMethod · 0.45
writeMethod · 0.45
getvalueMethod · 0.45
detachMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected