summaryrefslogtreecommitdiff
path: root/Doc/library/tempfile.rst
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-06 17:05:40 +0000
committerChristian Heimes <christian@cheimes.de>2008-01-06 17:05:40 +0000
commitc5c204b3c2a5ca800161fa0118312d2f8164071b (patch)
tree9bd97a001e6cef55df567790b2e1bdda48bd2f69 /Doc/library/tempfile.rst
parent5a49a0e254067c0d12822022e15bd05f7e8408a6 (diff)
downloadcpython-c5c204b3c2a5ca800161fa0118312d2f8164071b.tar.gz
Merged revisions 59774-59783 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r59774 | georg.brandl | 2008-01-06 16:41:50 +0100 (Sun, 06 Jan 2008) | 2 lines #1501: document that 0**0 == 1. ........ r59775 | georg.brandl | 2008-01-06 16:48:20 +0100 (Sun, 06 Jan 2008) | 2 lines #759525: document that dir() doesn't return metaclass attrs when given a class as arg. ........ r59776 | georg.brandl | 2008-01-06 16:55:26 +0100 (Sun, 06 Jan 2008) | 2 lines #1615275: clarify return object types of different tempfile factories. ........ r59777 | georg.brandl | 2008-01-06 17:01:26 +0100 (Sun, 06 Jan 2008) | 2 lines #1727024: document that Popen.returncode is set by Popen.poll/wait. ........ r59778 | georg.brandl | 2008-01-06 17:04:56 +0100 (Sun, 06 Jan 2008) | 2 lines #1686390: add example for csv.Sniffer use. ........ r59779 | georg.brandl | 2008-01-06 17:12:39 +0100 (Sun, 06 Jan 2008) | 2 lines #1559684: document that shutil.copy* doesn't copy all metadata on Posix and Windows too. ........ r59780 | georg.brandl | 2008-01-06 17:17:56 +0100 (Sun, 06 Jan 2008) | 2 lines #1582: document __reversed__, patch by Mark Russell. ........ r59781 | georg.brandl | 2008-01-06 17:22:56 +0100 (Sun, 06 Jan 2008) | 2 lines #1499: Document compile() exceptions. ........ r59782 | georg.brandl | 2008-01-06 17:49:50 +0100 (Sun, 06 Jan 2008) | 2 lines #1325: Add docs and tests for zipimporter.archive and zipimporter.prefix. ........
Diffstat (limited to 'Doc/library/tempfile.rst')
-rw-r--r--Doc/library/tempfile.rst12
1 files changed, 11 insertions, 1 deletions
diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst
index 74c032ff27..e38dbab1cb 100644
--- a/Doc/library/tempfile.rst
+++ b/Doc/library/tempfile.rst
@@ -34,7 +34,7 @@ The module defines the following user-callable functions:
.. function:: TemporaryFile([mode='w+b'[, bufsize=-1[, suffix[, prefix[, dir]]]]])
- Return a file (or file-like) object that can be used as a temporary storage
+ Return a file-like object that can be used as a temporary storage
area. The file is created using :func:`mkstemp`. It will be destroyed as soon
as it is closed (including an implicit close when the object is garbage
collected). Under Unix, the directory entry for the file is removed immediately
@@ -49,6 +49,10 @@ The module defines the following user-callable functions:
The *dir*, *prefix* and *suffix* parameters are passed to :func:`mkstemp`.
+ The returned object is a true file object on POSIX platforms. On other
+ platforms, it is a file-like object whose :attr:`file` attribute is the
+ underlying true file object.
+
.. function:: NamedTemporaryFile([mode='w+b'[, bufsize=-1[, suffix[, prefix[, dir[, delete]]]]]])
@@ -59,6 +63,8 @@ The module defines the following user-callable functions:
the file a second time, while the named temporary file is still open, varies
across platforms (it can be so used on Unix; it cannot on Windows NT or later).
If *delete* is true (the default), the file is deleted as soon as it is closed.
+ The returned object is always a file-like object whose :attr:`file` attribute
+ is the underlying true file object.
.. function:: SpooledTemporaryFile([max_size=0, [mode='w+b'[, bufsize=-1[, suffix[, prefix[, dir]]]]]])
@@ -71,6 +77,10 @@ The module defines the following user-callable functions:
The resulting file has one additional method, :func:`rollover`, which 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.
+
.. function:: mkstemp([suffix[, prefix[, dir[, text]]]])