(original) (raw)
changeset: 100295:27a140558a47 branch: 2.7 parent: 100292:39b6fad0e7bf user: Martin Panter vadmium+py@gmail.com date: Mon Feb 22 10:10:00 2016 +0000 files: Doc/library/tempfile.rst Lib/tempfile.py description: Issue #26261: Clarify NamedTemporaryFile name attribute vs file.name diff -r 39b6fad0e7bf -r 27a140558a47 Doc/library/tempfile.rst --- a/Doc/library/tempfile.rst Mon Feb 22 09:10:54 2016 +0000 +++ b/Doc/library/tempfile.rst Mon Feb 22 10:10:00 2016 +0000 @@ -64,7 +64,8 @@ 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 diff -r 39b6fad0e7bf -r 27a140558a47 Lib/tempfile.py --- a/Lib/tempfile.py Mon Feb 22 09:10:54 2016 +0000 +++ b/Lib/tempfile.py Mon Feb 22 10:10:00 2016 +0000 @@ -455,8 +455,8 @@ 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. """ if dir is None: /vadmium+py@gmail.com