diff options
author | Petri Lehtinen <petri@digip.org> | 2013-02-23 18:37:01 (GMT) |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2013-02-23 18:37:01 (GMT) |
commit | 827b36bed8b03a9bfc52134f7b4b9981db00b2be (patch) | |
tree | ce441e2cf9268e9ab07aeb2be61a5d3eb6d9eb6c /Doc/tutorial | |
parent | e460f26b2582606faa7b64e5dc8643b560472f0d (diff) | |
parent | 3c75a48c860e81063c8034e9929ad092b43677ef (diff) | |
download | cpython-827b36bed8b03a9bfc52134f7b4b9981db00b2be.zip cpython-827b36bed8b03a9bfc52134f7b4b9981db00b2be.tar.gz cpython-827b36bed8b03a9bfc52134f7b4b9981db00b2be.tar.bz2 |
Issue #8890: Stop advertising an insecure use of /tmp in docs
Diffstat (limited to 'Doc/tutorial')
-rw-r--r-- | Doc/tutorial/inputoutput.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst index 1324359..c804e25 100644 --- a/Doc/tutorial/inputoutput.rst +++ b/Doc/tutorial/inputoutput.rst @@ -234,12 +234,12 @@ two arguments: ``open(filename, mode)``. :: - >>> f = open('/tmp/workfile', 'w') + >>> f = open('workfile', 'w') .. XXX str(f) is <io.TextIOWrapper object at 0x82e8dc4> >>> print(f) - <open file '/tmp/workfile', mode 'w' at 80a0960> + <open file 'workfile', mode 'w' at 80a0960> The first argument is a string containing the filename. The second argument is another string containing a few characters describing the way in which the file @@ -346,7 +346,7 @@ of the file, 1 uses the current file position, and 2 uses the end of the file as the reference point. *from_what* can be omitted and defaults to 0, using the beginning of the file as the reference point. :: - >>> f = open('/tmp/workfile', 'rb+') + >>> f = open('workfile', 'rb+') >>> f.write(b'0123456789abcdef') 16 >>> f.seek(5) # Go to the 6th byte in the file @@ -377,7 +377,7 @@ objects. This has the advantage that the file is properly closed after its suite finishes, even if an exception is raised on the way. It is also much shorter than writing equivalent :keyword:`try`\ -\ :keyword:`finally` blocks:: - >>> with open('/tmp/workfile', 'r') as f: + >>> with open('workfile', 'r') as f: ... read_data = f.read() >>> f.closed True |