Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1f0e1f3c
Commit
1f0e1f3c
authored
Feb 22, 2016
by
Martin Panter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #26261: Clarify NamedTemporaryFile name attribute vs file.name
parent
1c5e715d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
Doc/library/tempfile.rst
Doc/library/tempfile.rst
+2
-1
Lib/tempfile.py
Lib/tempfile.py
+2
-2
No files found.
Doc/library/tempfile.rst
View file @
1f0e1f3c
...
@@ -74,7 +74,8 @@ The module defines the following user-callable items:
...
@@ -74,7 +74,8 @@ The module defines the following user-callable items:
This function operates exactly as :func:`TemporaryFile` does, except that
This function operates exactly as :func:`TemporaryFile` does, except that
the file is guaranteed to have a visible name in the file system (on
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
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
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
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
on Windows NT or later). If *delete* is true (the default), the file is
...
...
Lib/tempfile.py
View file @
1f0e1f3c
...
@@ -533,8 +533,8 @@ def NamedTemporaryFile(mode='w+b', buffering=-1, encoding=None,
...
@@ -533,8 +533,8 @@ def NamedTemporaryFile(mode='w+b', buffering=-1, encoding=None,
The file is created as mkstemp() would do it.
The file is created as mkstemp() would do it.
Returns an object with a file-like interface; the name of the file
Returns an object with a file-like interface; the name of the file
is accessible as
file.name. The file will be automatically deleted
is accessible as
its 'name' attribute. The file will be automatically
when it is closed unless the 'delete' argument is set to False.
deleted
when it is closed unless the 'delete' argument is set to False.
"""
"""
prefix
,
suffix
,
dir
,
output_type
=
_sanitize_params
(
prefix
,
suffix
,
dir
)
prefix
,
suffix
,
dir
,
output_type
=
_sanitize_params
(
prefix
,
suffix
,
dir
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment