[Python-checkins] cpython (merge 3.3 -> default): Issue #17147. Mention BytesIO in SpooledTemporaryFile documentation.
serhiy.storchaka
python-checkins at python.org
Sat Feb 9 10:55:59 CET 2013
http://hg.python.org/cpython/rev/c75d065a6bc2
changeset: 82084:c75d065a6bc2
parent: 82079:48747ef5f65b
parent: 82083:e16f331689e6
user: Serhiy Storchaka <storchaka at gmail.com>
date: Sat Feb 09 11:53:09 2013 +0200
summary:
Issue #17147. Mention BytesIO in SpooledTemporaryFile documentation.
files:
Doc/library/tempfile.rst | 8 +++++---
Lib/tempfile.py | 4 ++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst
--- a/Doc/library/tempfile.rst
+++ b/Doc/library/tempfile.rst
@@ -82,9 +82,11 @@
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 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
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -472,8 +472,8 @@
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
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list