Commit 23a6726b authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #17147. Mention BytesIO in SpooledTemporaryFile documentation.

parents 8135de80 4f169a7a
...@@ -82,9 +82,11 @@ The module defines the following user-callable items: ...@@ -82,9 +82,11 @@ The module defines the following user-callable items:
causes the file to roll over to an on-disk file regardless of its size. causes the file to roll over to an on-disk file regardless of its size.
The returned object is a file-like object whose :attr:`_file` attribute The returned object is a file-like object whose :attr:`_file` attribute
is either a :class:`StringIO` object or a true file object, depending on is either a :class:`BytesIO` or :class:`StringIO` object (depending on
whether :func:`rollover` has been called. This file-like object can be whether specifies binary or text *mode* was specified) or a true file
used in a :keyword:`with` statement, just like a normal file. object, depending on whether :func:`rollover` has been called. This
file-like object can be used in a :keyword:`with` statement, just like
a normal file.
.. versionchanged:: 3.3 .. versionchanged:: 3.3
the truncate method now accepts a ``size`` argument. the truncate method now accepts a ``size`` argument.
......
...@@ -470,8 +470,8 @@ else: ...@@ -470,8 +470,8 @@ else:
raise raise
class SpooledTemporaryFile: class SpooledTemporaryFile:
"""Temporary file wrapper, specialized to switch from """Temporary file wrapper, specialized to switch from BytesIO
StringIO to a real file when it exceeds a certain size or or StringIO to a real file when it exceeds a certain size or
when a fileno is needed. when a fileno is needed.
""" """
_rolled = False _rolled = False
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment