Issue #17147. Mention BytesIO in SpooledTemporaryFile documentation.

This commit is contained in:
Serhiy Storchaka 2013-02-09 11:46:42 +02:00
parent 01ad622a2c
commit 4f169a7a4d
2 changed files with 7 additions and 5 deletions

View File

@ -83,9 +83,11 @@ The module defines the following user-callable items:
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
is either a :class:`StringIO` object or a true 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.
is either a :class:`BytesIO` or :class:`StringIO` object (depending on
whether specifies binary or text *mode* was specified) or a true 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.
.. function:: TemporaryDirectory(suffix='', prefix='tmp', dir=None)

View File

@ -479,8 +479,8 @@ else:
raise
class SpooledTemporaryFile:
"""Temporary file wrapper, specialized to switch from
StringIO to a real file when it exceeds a certain size or
"""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.
"""
_rolled = False