(original) (raw)

diff -r 5f8c68281d18 Doc/library/tempfile.rst --- a/Doc/library/tempfile.rst Wed Feb 06 10:37:19 2013 +0200 +++ b/Doc/library/tempfile.rst Wed Feb 06 21:11:53 2013 +0200 @@ -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 + whenewer specifies binary or text *mode* has 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 -r 5f8c68281d18 Lib/tempfile.py --- a/Lib/tempfile.py Wed Feb 06 10:37:19 2013 +0200 +++ b/Lib/tempfile.py Wed Feb 06 21:11:53 2013 +0200 @@ -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