]> granicus.if.org Git - python/commitdiff
Issue #26261: Clarify NamedTemporaryFile name attribute vs file.name
authorMartin Panter <vadmium+py@gmail.com>
Mon, 22 Feb 2016 10:10:00 +0000 (10:10 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Mon, 22 Feb 2016 10:10:00 +0000 (10:10 +0000)
Doc/library/tempfile.rst
Lib/tempfile.py

index 19e1e7faaf1b7332e00084483530c7b5ff1c301e..b714d0ff92d94c171877aa094fea08c6f196a50b 100644 (file)
@@ -74,7 +74,8 @@ The module defines the following user-callable items:
    This function operates exactly as :func:`TemporaryFile` does, except that
    the file is guaranteed to have a visible name in the file system (on
    Unix, the directory entry is not unlinked).  That name can be retrieved
-   from the :attr:`name` attribute of the file object.  Whether the name can be
+   from the :attr:`name` attribute of the returned
+   file-like object.  Whether the name can be
    used to open 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
index d381a25dd19c2ed21d2a2012603d2636b3bcfcd2..c39820e198c19f7f62e87ea0af1ef4ad7ff87476 100644 (file)
@@ -533,8 +533,8 @@ def NamedTemporaryFile(mode='w+b', buffering=-1, encoding=None,
     The file is created as mkstemp() would do it.
 
     Returns an object with a file-like interface; the name of the file
-    is accessible as file.name.  The file will be automatically deleted
-    when it is closed unless the 'delete' argument is set to False.
+    is accessible as its 'name' attribute.  The file will be automatically
+    deleted when it is closed unless the 'delete' argument is set to False.
     """
 
     prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)