Mercurial > cpython-lru_cache-weakref
diff Doc/tutorial/inputoutput.rst @ 82352:488957f9b664 2.7
Issue #8890: Stop advertising an insecure use of /tmp in docs
| author | Petri Lehtinen <petri@digip.org> |
|---|---|
| date | Sat, 23 Feb 2013 19:24:08 +0100 |
| parents | 0dbdaa0ff648 |
| children | 6a4746b0afaf |
line wrap: on
line diff
--- a/Doc/tutorial/inputoutput.rst Sat Feb 23 19:05:09 2013 +0100 +++ b/Doc/tutorial/inputoutput.rst Sat Feb 23 19:24:08 2013 +0100 @@ -236,9 +236,9 @@ :: - >>> f = open('/tmp/workfile', 'w') + >>> f = open('workfile', 'w') >>> 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 @@ -339,7 +339,7 @@ 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', 'r+') + >>> f = open('workfile', 'r+') >>> f.write('0123456789abcdef') >>> f.seek(5) # Go to the 6th byte in the file >>> f.read(1) @@ -363,7 +363,7 @@ 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
