diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-09 09:47:20 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-09 09:47:20 (GMT) |
commit | 23a6726bc849be613c02b76815f26cc75cf4789c (patch) | |
tree | 1703de3f7f37498cee09ba3a68321cb1cc1ac6ee | |
parent | 8135de80f799431d041878315840ef3a7110d0a3 (diff) | |
parent | 4f169a7a4df0cfb4da6c7bab40a17dddc083cf2a (diff) | |
download | cpython-23a6726bc849be613c02b76815f26cc75cf4789c.zip cpython-23a6726bc849be613c02b76815f26cc75cf4789c.tar.gz cpython-23a6726bc849be613c02b76815f26cc75cf4789c.tar.bz2 |
Issue #17147. Mention BytesIO in SpooledTemporaryFile documentation.
-rw-r--r-- | Doc/library/tempfile.rst | 8 | ||||
-rw-r--r-- | Lib/tempfile.py | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst index 96ead1f..b97603f 100644 --- a/Doc/library/tempfile.rst +++ b/Doc/library/tempfile.rst @@ -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. 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. .. versionchanged:: 3.3 the truncate method now accepts a ``size`` argument. diff --git a/Lib/tempfile.py b/Lib/tempfile.py index 47c60f4..acd717b 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -470,8 +470,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 |