PyDocs

Nav

File and Directory Access

SpooledTemporaryFile

  • SpooledTemporaryFile(max_size=0, mode='w+b', buffering=-1, encoding=None, newline=None, suffix=None, prefix=None, dir=None, *, errors=None)
Temporary file wrapper, specialized to switch from BytesIO
or StringIO to a real file when it exceeds a certain size or
when a fileno is needed.
Changed in 3.3, 3.8, 3.11
  • 3.3: the truncate method now accepts a size argument.
  • 3.8: Added errors parameter.
  • 3.11: Fully implements the io.BufferedIOBase and io.TextIOBase abstract base classes (depending on whether binary or text mode was specified).
Members of SpooledTemporaryFile

r

rollover
The resulting file has one additional method, rollover(), which causes the file to roll over to an on-disk file regardless of its size.
0 Examples
No examples for tempfile/SpooledTemporaryFile.
See Also
No see-alsos for tempfile/SpooledTemporaryFile
0 Notes
No notes for SpooledTemporaryFile