]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #17147. Mention BytesIO in SpooledTemporaryFile documentation.
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 9 Feb 2013 09:46:42 +0000 (11:46 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 9 Feb 2013 09:46:42 +0000 (11:46 +0200)
Doc/library/tempfile.rst
Lib/tempfile.py

index c143b88e2ad913581e23819d73e3ae134cf89879..b68a412383b88fe10bad7b1676828b55ae09a938 100644 (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)
index b8fc18c3bf713bcbac2da31fa1a5896b4789285e..86300b6a242ede8f790743d63d5bf9665d66af6d 100644 (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