This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author [email protected]
Recipients docs@python, [email protected]
Date 2013-02-22.05:55:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
Page is http://docs.python.org/3/library/tempfile.html#module-tempfile.

The code in question currently reads:
>>> f = NamedTemporaryFile(delete=False)
>>> f
<open file '<fdopen>', mode 'w+b' at 0x384698>
>>> f.name
'/var/folders/5q/5qTPn6xq2RaWqk+1Ytw3-U+++TI/-Tmp-/tmpG7V1Y0'
>>> f.write("Hello World!\n")
>>> f.close()
>>> os.unlink(f.name)
>>> os.path.exists(f.name)
False

It should read:
>>> import os
>>> from tempfile import NamedTemporaryFile
>>> f = NamedTemporaryFile(delete=False)
>>> f
<tempfile._TemporaryFileWrapper object at 0x29bfc50>
>>> f.name
'/tmp/tmpdxd_85'
>>> f.write("Hello World!\n".encode())
13
>>> f.close()
>>> os.unlink(f.name)
>>> os.path.exists(f.name)
False
History
Date User Action Args
2013-02-22 05:55:23[email protected]setrecipients: + [email protected], docs@python
2013-02-22 05:55:23[email protected]setmessageid: <[email protected]>
2013-02-22 05:55:23[email protected]linkissue17271 messages
2013-02-22 05:55:23[email protected]create