Index: whatsnew/2.0.rst =================================================================== --- whatsnew/2.0.rst (revision 86557) +++ whatsnew/2.0.rst (working copy) @@ -236,13 +236,13 @@ (UTF8_encode, UTF8_decode, UTF8_streamreader, UTF8_streamwriter) = codecs.lookup('UTF-8') - output = UTF8_streamwriter( open( '/tmp/output', 'wb') ) + output = UTF8_streamwriter( open( 'tempfile', 'wb') ) output.write( unistr ) output.close() The following code would then read UTF-8 input from the file:: - input = UTF8_streamreader( open( '/tmp/output', 'rb') ) + input = UTF8_streamreader( open( 'tempfile', 'rb') ) print repr(input.read()) input.close() Index: whatsnew/2.3.rst =================================================================== --- whatsnew/2.3.rst (revision 86557) +++ whatsnew/2.3.rst (working copy) @@ -293,8 +293,8 @@ automatically imported if a ZIP archive's filename is added to ``sys.path``. For example:: - amk@nyman:~/src/python$ unzip -l /tmp/example.zip - Archive: /tmp/example.zip + amk@nyman:~/src/python$ unzip -l tempfile.zip + Archive: tempfile.zip Length Date Time Name -------- ---- ---- ---- 8467 11-26-02 22:30 jwzthreading.py @@ -303,10 +303,10 @@ amk@nyman:~/src/python$ ./python Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys - >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path + >>> sys.path.insert(0, 'tempfile.zip') # Add .zip file to front of path >>> import jwzthreading >>> jwzthreading.__file__ - '/tmp/example.zip/jwzthreading.py' + 'tempfile.zip/jwzthreading.py' >>> An entry in ``sys.path`` can now be the filename of a ZIP archive. The ZIP @@ -317,7 +317,7 @@ :file:`\*.pyc` files, importing may be rather slow. A path within the archive can also be specified to only import from a -subdirectory; for example, the path :file:`/tmp/example.zip/lib/` would only +subdirectory; for example, the path :file:`/path/to/tempfile.zip/lib/` would only import from the :file:`lib/` subdirectory within the archive. Index: whatsnew/2.4.rst =================================================================== --- whatsnew/2.4.rst (revision 86557) +++ whatsnew/2.4.rst (working copy) @@ -437,7 +437,7 @@ constructor, waits for the command to complete, and returns the status code of the subprocess. It can serve as a safer analog to :func:`os.system`:: - sts = subprocess.call(['dpkg', '-i', '/tmp/new-package.deb']) + sts = subprocess.call(['dpkg', '-i', '/home/user/new-package.deb']) if sts == 0: # Success ... @@ -449,7 +449,7 @@ the shell, you can add ``shell=True`` as a keyword argument and provide a string instead of a sequence:: - sts = subprocess.call('dpkg -i /tmp/new-package.deb', shell=True) + sts = subprocess.call('dpkg -i /home/user/new-package.deb', shell=True) The PEP takes various examples of shell and Python code and shows how they'd be translated into Python code that uses :mod:`subprocess`. Reading this section Index: whatsnew/2.5.rst =================================================================== --- whatsnew/2.5.rst (revision 86557) +++ whatsnew/2.5.rst (working copy) @@ -1409,7 +1409,7 @@ # 'factory=None' uses email.Message.Message as the class representing # individual messages. src = mailbox.Maildir('maildir', factory=None) - dest = mailbox.mbox('/tmp/mbox') + dest = mailbox.mbox('/path/to/mbox') for msg in src: dest.add(msg) @@ -1946,9 +1946,9 @@ To use the module, you must first create a :class:`Connection` object that represents the database. Here the data will be stored in the -:file:`/tmp/example` file:: +:file:`/home/user/dbfile` file:: - conn = sqlite3.connect('/tmp/example') + conn = sqlite3.connect('tempfile') You can also supply the special name ``:memory:`` to create a database in RAM. Index: whatsnew/2.6.rst =================================================================== --- whatsnew/2.6.rst (revision 86557) +++ whatsnew/2.6.rst (working copy) @@ -2308,7 +2308,7 @@ but skips both :file:`.svn` directories and Emacs backup files, which have names ending with '~':: - shutil.copytree('Doc/library', '/tmp/library', + shutil.copytree('Doc/library', '/path/to/library', ignore=shutil.ignore_patterns('*~', '.svn')) (Contributed by Tarek Ziadé; :issue:`2663`.) @@ -2829,8 +2829,8 @@ print new_struct # Write data structure to a file and read it back. - plistlib.writePlist(data_struct, '/tmp/customizations.plist') - new_struct = plistlib.readPlist('/tmp/customizations.plist') + plistlib.writePlist(data_struct, '/home/user/customizations.plist') + new_struct = plistlib.readPlist('/home/user/customizations.plist') # read/writePlist accepts file-like objects as well as paths. plistlib.writePlist(data_struct, sys.stdout) Index: whatsnew/2.7.rst =================================================================== --- whatsnew/2.7.rst (revision 86557) +++ whatsnew/2.7.rst (working copy) @@ -374,8 +374,8 @@ 'context': 0, 'inputs': []} - -> ./python.exe argparse-example.py -v -o /tmp/output -C 4 file1 file2 - {'output': '/tmp/output', + -> ./python.exe argparse-example.py -v -o /path/to/output -C 4 file1 file2 + {'output': '/path/to/output', 'is_verbose': True, 'context': 4, 'inputs': ['file1', 'file2']} Index: tutorial/inputoutput.rst =================================================================== --- tutorial/inputoutput.rst (revision 86557) +++ tutorial/inputoutput.rst (working copy) @@ -237,12 +237,12 @@ :: - >>> f = open('/tmp/workfile', 'w') + >>> f = open('tempfile', 'w') .. XXX str(f) is >>> print(f) - + 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 @@ -348,7 +348,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', 'rb+') + >>> f = open('tempfile', 'rb+') >>> f.write(b'0123456789abcdef') 16 >>> f.seek(5) # Go to the 6th byte in the file @@ -379,7 +379,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('tempfile', 'r') as f: ... read_data = f.read() >>> f.closed True Index: library/mailcap.rst =================================================================== --- library/mailcap.rst (revision 86557) +++ library/mailcap.rst (working copy) @@ -68,6 +68,6 @@ >>> import mailcap >>> d=mailcap.getcaps() - >>> mailcap.findmatch(d, 'video/mpeg', filename='/tmp/tmp1223') - ('xmpeg /tmp/tmp1223', {'view': 'xmpeg %s'}) + >>> mailcap.findmatch(d, 'video/mpeg', filename='/home/user/tmp1223') + ('xmpeg /home/user/tmp1223', {'view': 'xmpeg %s'}) Index: library/pipes.rst =================================================================== --- library/pipes.rst (revision 86557) +++ library/pipes.rst (working copy) @@ -25,10 +25,10 @@ >>> import pipes >>> t=pipes.Template() >>> t.append('tr a-z A-Z', '--') - >>> f=t.open('/tmp/1', 'w') + >>> f=t.open('/home/user/1', 'w') >>> f.write('hello world') >>> f.close() - >>> open('/tmp/1').read() + >>> open('/home/user/1').read() 'HELLO WORLD' Index: library/logging.rst =================================================================== --- library/logging.rst (revision 86557) +++ library/logging.rst (working copy) @@ -1687,7 +1687,7 @@ # The size of the rotated files is made small so you can see the results easily. def listener_configurer(): root = logging.getLogger() - h = logging.handlers.RotatingFileHandler('/tmp/mptest.log', 'a', 300, 10) + h = logging.handlers.RotatingFileHandler('tempfile.log', 'a', 300, 10) f = logging.Formatter('%(asctime)s %(processName)-10s %(name)s %(levelname)-8s %(message)s') h.setFormatter(f) root.addHandler(h) Index: library/zipimport.rst =================================================================== --- library/zipimport.rst (revision 86557) +++ library/zipimport.rst (working copy) @@ -16,7 +16,7 @@ also allows an item of ``sys.path`` to be a string naming a ZIP file archive. The ZIP archive can contain a subdirectory structure to support package imports, and a path within the archive can be specified to only import from a -subdirectory. For example, the path :file:`/tmp/example.zip/lib/` would only +subdirectory. For example, the path :file:`tempfile.zip/lib/` would only import from the :file:`lib/` subdirectory within the archive. Any files may be present in the ZIP archive, but only files :file:`.py` and @@ -144,8 +144,8 @@ Here is an example that imports a module from a ZIP archive - note that the :mod:`zipimport` module is not explicitly used. :: - $ unzip -l /tmp/example.zip - Archive: /tmp/example.zip + $ unzip -l tempfile.zip + Archive: tempfile.zip Length Date Time Name -------- ---- ---- ---- 8467 11-26-02 22:30 jwzthreading.py @@ -154,8 +154,8 @@ $ ./python Python 2.3 (#1, Aug 1 2003, 19:54:32) >>> import sys - >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path + >>> sys.path.insert(0, 'tempfile.zip') # Add .zip file to front of path >>> import jwzthreading >>> jwzthreading.__file__ - '/tmp/example.zip/jwzthreading.py' + 'tempfile.zip/jwzthreading.py' Index: library/sqlite3.rst =================================================================== --- library/sqlite3.rst (revision 86557) +++ library/sqlite3.rst (working copy) @@ -18,9 +18,9 @@ To use the module, you must first create a :class:`Connection` object that represents the database. Here the data will be stored in the -:file:`/tmp/example` file:: +:file:`tempfile` file:: - conn = sqlite3.connect('/tmp/example') + conn = sqlite3.connect('tempfile') You can also supply the special name ``:memory:`` to create a database in RAM. Index: library/imghdr.rst =================================================================== --- library/imghdr.rst (revision 86557) +++ library/imghdr.rst (working copy) @@ -62,6 +62,6 @@ Example:: >>> import imghdr - >>> imghdr.what('/tmp/bass.gif') + >>> imghdr.what('/home/user/bass.gif') 'gif' Index: library/atexit.rst =================================================================== --- library/atexit.rst (revision 86557) +++ library/atexit.rst (working copy) @@ -67,7 +67,7 @@ making an explicit call into this module at termination. :: try: - _count = int(open("/tmp/counter").read()) + _count = int(open("tempfile").read()) except IOError: _count = 0 @@ -76,7 +76,7 @@ _count = _count + n def savecounter(): - open("/tmp/counter", "w").write("%d" % _count) + open("tempfile", "w").write("%d" % _count) import atexit atexit.register(savecounter) Index: install/index.rst =================================================================== --- install/index.rst (revision 86557) +++ install/index.rst (working copy) @@ -188,7 +188,7 @@ to keep the source tree pristine, you can change the build directory with the :option:`--build-base` option. For example:: - python setup.py build --build-base=/tmp/pybuild/foo-1.0 + python setup.py build --build-base=/path/to/pybuild/foo-1.0 (Or you could do this permanently with a directive in your system or personal Distutils configuration file; see section :ref:`inst-config-files`.) Normally, this @@ -548,11 +548,11 @@ Note that these two are *not* equivalent if you supply a different installation base directory when you run the setup script. For example, :: - python setup.py install --install-base=/tmp + python setup.py install --install-base=/alt/path -would install pure modules to :file:`{/tmp/python/lib}` in the first case, and -to :file:`{/tmp/lib}` in the second case. (For the second case, you probably -want to supply an installation base of :file:`/tmp/python`.) +would install pure modules to :file:`{/alt/path/python/lib}` in the first case, and +to :file:`{/alt/path/lib}` in the second case. (For the second case, you probably +want to supply an installation base of :file:`/alt/path/python`.) You probably noticed the use of ``$HOME`` and ``$PLAT`` in the sample configuration file input. These are Distutils configuration variables, which