From 345fff3de82f29a8bbb8bdead8cda1c1e480d040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Thu, 28 Jul 2011 22:27:28 +0200 Subject: [PATCH 01/13] Remove mentions of previous license in profile module (#12417 followup) --- Doc/library/profile.rst | 24 ------------------------ Doc/license.rst | 30 ------------------------------ Lib/pstats.py | 2 -- 3 files changed, 56 deletions(-) diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst index a69a0da3788..00171aea472 100644 --- a/Doc/library/profile.rst +++ b/Doc/library/profile.rst @@ -10,29 +10,6 @@ The Python Profilers .. module:: profile :synopsis: Python source profiler. -.. index:: single: InfoSeek Corporation - -Copyright © 1994, by InfoSeek Corporation, all rights reserved. - -Written by James Roskind. [#]_ - -Permission to use, copy, modify, and distribute this Python software and its -associated documentation for any purpose (subject to the restriction in the -following sentence) without fee is hereby granted, provided that the above -copyright notice appears in all copies, and that both that copyright notice and -this permission notice appear in supporting documentation, and that the name of -InfoSeek not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. This permission is -explicitly restricted to the copying and modification of the software to remain -in Python, compiled Python, or other languages (such as C) wherein the modified -or derived code is exclusively imported into a Python module. - -INFOSEEK CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT -SHALL INFOSEEK CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING -OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .. _profiler-introduction: @@ -65,7 +42,6 @@ The Python standard library provides three different profilers: :mod:`cProfile`. Adds significant overhead to profiled programs. If you're trying to extend the profiler in some way, the task might be easier with this module. - Copyright © 1994, by InfoSeek Corporation. .. versionchanged:: 2.4 Now also reports the time spent in calls to built-in functions and methods. diff --git a/Doc/license.rst b/Doc/license.rst index a9cec20f094..374ee15d215 100644 --- a/Doc/license.rst +++ b/Doc/license.rst @@ -540,36 +540,6 @@ The :mod:`Cookie` module contains the following notice:: PERFORMANCE OF THIS SOFTWARE. -Profiling ---------- - -The :mod:`profile` and :mod:`pstats` modules contain the following notice:: - - Copyright 1994, by InfoSeek Corporation, all rights reserved. - Written by James Roskind - - Permission to use, copy, modify, and distribute this Python software - and its associated documentation for any purpose (subject to the - restriction in the following sentence) without fee is hereby granted, - provided that the above copyright notice appears in all copies, and - that both that copyright notice and this permission notice appear in - supporting documentation, and that the name of InfoSeek not be used in - advertising or publicity pertaining to distribution of the software - without specific, written prior permission. This permission is - explicitly restricted to the copying and modification of the software - to remain in Python, compiled Python, or other languages (such as C) - wherein the modified or derived code is exclusively imported into a - Python module. - - INFOSEEK CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS. IN NO EVENT SHALL INFOSEEK CORPORATION BE LIABLE FOR ANY - SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - Execution tracing ----------------- diff --git a/Lib/pstats.py b/Lib/pstats.py index b1bf4dffa92..91cdee186b0 100644 --- a/Lib/pstats.py +++ b/Lib/pstats.py @@ -1,7 +1,5 @@ """Class for printing reports on profiled python code.""" -# Class for printing reports on profiled python code. rev 1.0 4/1/94 -# # Written by James Roskind # Based on prior profile module by Sjoerd Mullender... # which was hacked somewhat by: Guido van Rossum From 8fde9506b73ff51753d7df799d1dba3b92101138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 29 Jul 2011 11:34:17 +0200 Subject: [PATCH 02/13] Improve glossary entry for ABCs. - Rename reST target name for collections ABCs to avoid collisions - Link to glossary entry from numbers module doc (other modules already do it) --- Doc/glossary.rst | 11 ++++++----- Doc/library/abc.rst | 4 ++-- Doc/library/collections.rst | 12 ++++++------ Doc/library/numbers.rst | 6 +++--- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index fa811442c2e..eb72558ecc7 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -27,12 +27,13 @@ Glossary :ref:`2to3-reference`. abstract base class - :ref:`abstract-base-classes` complement :term:`duck-typing` by + Abstract base classes complement :term:`duck-typing` by providing a way to define interfaces when other techniques like - :func:`hasattr` would be clumsy. Python comes with many built-in ABCs for + :func:`hasattr` would be clumsy or subtly wrong (for example with + :ref:`magic methods `). Python comes with many built-in ABCs for data structures (in the :mod:`collections` module), numbers (in the :mod:`numbers` module), and streams (in the :mod:`io` module). You can - create your own ABC with the :mod:`abc` module. + create your own ABCs with the :mod:`abc` module. argument A value passed to a function or method, assigned to a named local @@ -424,8 +425,8 @@ Glossary mapping A container object that supports arbitrary key lookups and implements the methods specified in the :class:`Mapping` or :class:`MutableMapping` - :ref:`abstract base classes `. Examples include - :class:`dict`, :class:`collections.defaultdict`, + :ref:`abstract base classes `. Examples + include :class:`dict`, :class:`collections.defaultdict`, :class:`collections.OrderedDict` and :class:`collections.Counter`. metaclass diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst index 9f70b024c40..0408f302069 100644 --- a/Doc/library/abc.rst +++ b/Doc/library/abc.rst @@ -9,8 +9,8 @@ .. versionadded:: 2.6 -This module provides the infrastructure for defining an :term:`abstract base -class` (ABCs) in Python, as outlined in :pep:`3119`; see the PEP for why this +This module provides the infrastructure for defining :term:`abstract base +classes ` (ABCs) in Python, as outlined in :pep:`3119`; see the PEP for why this was added to Python. (See also :pep:`3141` and the :mod:`numbers` module regarding a type hierarchy for numbers based on ABCs.) diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 0f098f716e8..9f6d079253b 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -28,7 +28,7 @@ Python's general purpose built-in containers, :class:`dict`, :class:`list`, ===================== ==================================================================== =========================== In addition to the concrete container classes, the collections module provides -:ref:`abstract-base-classes` that can be used to test whether a class provides a +:ref:`collections-abstract-base-classes` that can be used to test whether a class provides a particular interface, for example, whether it is hashable or a mapping. .. seealso:: @@ -851,8 +851,8 @@ If a new entry overwrites an existing entry, the original insertion position is changed and moved to the end:: class LastUpdatedOrderedDict(OrderedDict): - 'Store items in the order the keys were last added' + def __setitem__(self, key, value): if key in self: del self[key] @@ -871,10 +871,10 @@ so that the counter remembers the order elements are first encountered:: return self.__class__, (OrderedDict(self),) -.. _abstract-base-classes: +.. _collections-abstract-base-classes: -ABCs - abstract base classes ----------------------------- +Collections Abstract Base Classes +--------------------------------- The collections module offers the following :term:`ABCs `: @@ -888,7 +888,7 @@ ABC Inherits from Abstract Methods Mixin :class:`Sized` ``__len__`` :class:`Callable` ``__call__`` -:class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``, +:class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``, ``__iter__``, ``__reversed__``, :class:`Iterable`, ``index``, and ``count`` :class:`Container` diff --git a/Doc/library/numbers.rst b/Doc/library/numbers.rst index a0a825f7b20..f46e8ac824e 100644 --- a/Doc/library/numbers.rst +++ b/Doc/library/numbers.rst @@ -7,9 +7,9 @@ .. versionadded:: 2.6 -The :mod:`numbers` module (:pep:`3141`) defines a hierarchy of numeric abstract -base classes which progressively define more operations. None of the types -defined in this module can be instantiated. +The :mod:`numbers` module (:pep:`3141`) defines a hierarchy of numeric +:term:`abstract base classes ` which progressively define +more operations. None of the types defined in this module can be instantiated. .. class:: Number From ec464cf9bb27380f6e351a9fe4d5b52c9b4a12af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 29 Jul 2011 11:35:27 +0200 Subject: [PATCH 03/13] Add missing reST target to one heading in the tutorial --- Doc/tutorial/interpreter.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/tutorial/interpreter.rst b/Doc/tutorial/interpreter.rst index df93af20e91..0cdba6e6e74 100644 --- a/Doc/tutorial/interpreter.rst +++ b/Doc/tutorial/interpreter.rst @@ -166,6 +166,8 @@ also be ``.pyw``, in that case, the console window that normally appears is suppressed. +.. _tut-source-encoding: + Source Code Encoding -------------------- From 5dd034b84fe53934e1c43526f2d03e006cb1e030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 27 May 2011 04:42:47 +0200 Subject: [PATCH 04/13] Minor doc addition for clarity --- Doc/library/functions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 635b4653245..e31dff8f84c 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -583,7 +583,7 @@ available. They are listed here in alphabetical order. Two objects with non-overlapping lifetimes may have the same :func:`id` value. - .. impl-detail:: This is the address of the object. + .. impl-detail:: This is the address of the object in memory. .. function:: input([prompt]) From 8d2a6fd9a94ca7570764522ccd8f426b820faeca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 29 Jul 2011 11:43:47 +0200 Subject: [PATCH 05/13] Fix typo in 97a75fccd7c8 --- Doc/c-api/veryhigh.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/c-api/veryhigh.rst b/Doc/c-api/veryhigh.rst index 927368d7a10..188fac874e2 100644 --- a/Doc/c-api/veryhigh.rst +++ b/Doc/c-api/veryhigh.rst @@ -32,7 +32,7 @@ the same library that the Python runtime is using. prepared exactly as those which are passed to a C program's :cfunc:`main` function. It is important to note that the argument list may be modified (but the contents of the strings pointed to by the argument list are not). The return - value will be ```0``` if the interpreter exits normally (ie, without an + value will be ``0`` if the interpreter exits normally (ie, without an exception), ``1`` if the interpreter exits due to an exception, or ``2`` if the parameter list does not represent a valid Python command line. From ad84ea11c21e503dd5be12a0702340d38c96603c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 29 Jul 2011 11:53:57 +0200 Subject: [PATCH 06/13] Add links from builtins module docs to built-in functions and constants docs --- Doc/library/__builtin__.rst | 4 +++- Doc/library/constants.rst | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Doc/library/__builtin__.rst b/Doc/library/__builtin__.rst index ec189b6c9fb..673d74f984b 100644 --- a/Doc/library/__builtin__.rst +++ b/Doc/library/__builtin__.rst @@ -8,7 +8,9 @@ This module provides direct access to all 'built-in' identifiers of Python; for example, ``__builtin__.open`` is the full name for the built-in function -:func:`open`. +:func:`open`. See :ref:`built-in-funcs` and :ref:`built-in-consts` for +documentation. + This module is not normally accessed explicitly by most applications, but can be useful in modules that provide objects with the same name as a built-in value, diff --git a/Doc/library/constants.rst b/Doc/library/constants.rst index 80e792c9521..0db83374811 100644 --- a/Doc/library/constants.rst +++ b/Doc/library/constants.rst @@ -1,3 +1,5 @@ +.. _built-in-consts: + Built-in Constants ================== From 2e1c294d28233c75cf25467d6a8082486d4aab5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 29 Jul 2011 11:57:50 +0200 Subject: [PATCH 07/13] =?UTF-8?q?Fix=20=E2=80=9Canyways=E2=80=9D=20(follow?= =?UTF-8?q?ing=20R.=20David=20Murray=20in=205c7520e02d5a)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Doc/install/index.rst | 2 +- Doc/library/ossaudiodev.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/install/index.rst b/Doc/install/index.rst index 915654d4ea8..e8037067b03 100644 --- a/Doc/install/index.rst +++ b/Doc/install/index.rst @@ -72,7 +72,7 @@ In that case, you would download the installer appropriate to your platform and do the obvious thing with it: run it if it's an executable installer, ``rpm --install`` it if it's an RPM, etc. You don't need to run Python or a setup script, you don't need to compile anything---you might not even need to read any -instructions (although it's always a good idea to do so anyways). +instructions (although it's always a good idea to do so anyway). Of course, things will not always be that easy. You might be interested in a module distribution that doesn't have an easy-to-use installer for your diff --git a/Doc/library/ossaudiodev.rst b/Doc/library/ossaudiodev.rst index 37ead5d68d3..848eca5dfca 100644 --- a/Doc/library/ossaudiodev.rst +++ b/Doc/library/ossaudiodev.rst @@ -17,7 +17,7 @@ the standard audio interface for Linux and recent versions of FreeBSD. ALSA is in the standard kernel as of 2.5.x. Presumably if you use ALSA, you'll have to make sure its OSS compatibility layer is active to use ossaudiodev, but you're gonna need it for the vast - majority of Linux audio apps anyways. + majority of Linux audio apps anyway. Sounds like things are also complicated for other BSDs. In response to my python-dev query, Thomas Wouters said: From 299172bdbaaf767cbe4eb1ae425c6cfc9173f953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Tue, 26 Jul 2011 16:54:24 +0200 Subject: [PATCH 08/13] Make indentation comply with our style guide and the rest of the file --- Doc/tutorial/classes.rst | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index f9a2d114002..c3640a05f7c 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -556,24 +556,24 @@ occurs within the definition of a class. Name mangling is helpful for letting subclasses override methods without breaking intraclass method calls. For example:: - class Mapping: - def __init__(self, iterable): - self.items_list = [] - self.__update(iterable) + class Mapping: + def __init__(self, iterable): + self.items_list = [] + self.__update(iterable) - def update(self, iterable): - for item in iterable: - self.items_list.append(item) + def update(self, iterable): + for item in iterable: + self.items_list.append(item) - __update = update # private copy of original update() method + __update = update # private copy of original update() method - class MappingSubclass(Mapping): + class MappingSubclass(Mapping): - def update(self, keys, values): - # provides new signature for update() - # but does not break __init__() - for item in zip(keys, values): - self.items_list.append(item) + def update(self, keys, values): + # provides new signature for update() + # but does not break __init__() + for item in zip(keys, values): + self.items_list.append(item) Note that the mangling rules are designed mostly to avoid accidents; it still is possible to access or modify a variable that is considered private. This can From 0fb681ea5065bbdba792e04d46e02be088e95ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 29 Jul 2011 12:06:13 +0200 Subject: [PATCH 09/13] Fix missing or shebangs and executable bits for scripts (#10318) --- Tools/scripts/analyze_dxp.py | 1 + Tools/scripts/cleanfuture.py | 0 Tools/scripts/combinerefs.py | 0 Tools/scripts/db2pickle.py | 0 Tools/scripts/diff.py | 1 + Tools/scripts/find_recursionlimit.py | 0 Tools/scripts/hotshotmain.py | 0 Tools/scripts/mailerdaemon.py | 1 + Tools/scripts/md5sum.py | 0 Tools/scripts/patchcheck.py | 1 + Tools/scripts/pickle2db.py | 0 Tools/scripts/pysource.py | 0 Tools/scripts/redemo.py | 1 + 13 files changed, 5 insertions(+) mode change 100644 => 100755 Tools/scripts/analyze_dxp.py mode change 100644 => 100755 Tools/scripts/cleanfuture.py mode change 100644 => 100755 Tools/scripts/combinerefs.py mode change 100644 => 100755 Tools/scripts/db2pickle.py mode change 100644 => 100755 Tools/scripts/diff.py mode change 100644 => 100755 Tools/scripts/find_recursionlimit.py mode change 100644 => 100755 Tools/scripts/hotshotmain.py mode change 100644 => 100755 Tools/scripts/mailerdaemon.py mode change 100644 => 100755 Tools/scripts/md5sum.py mode change 100644 => 100755 Tools/scripts/patchcheck.py mode change 100644 => 100755 Tools/scripts/pickle2db.py mode change 100644 => 100755 Tools/scripts/pysource.py mode change 100644 => 100755 Tools/scripts/redemo.py diff --git a/Tools/scripts/analyze_dxp.py b/Tools/scripts/analyze_dxp.py old mode 100644 new mode 100755 index bde931e7503..1224383e2d9 --- a/Tools/scripts/analyze_dxp.py +++ b/Tools/scripts/analyze_dxp.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python """ Some helper functions to analyze the output of sys.getdxp() (which is only available if Python was built with -DDYNAMIC_EXECUTION_PROFILE). diff --git a/Tools/scripts/cleanfuture.py b/Tools/scripts/cleanfuture.py old mode 100644 new mode 100755 diff --git a/Tools/scripts/combinerefs.py b/Tools/scripts/combinerefs.py old mode 100644 new mode 100755 diff --git a/Tools/scripts/db2pickle.py b/Tools/scripts/db2pickle.py old mode 100644 new mode 100755 diff --git a/Tools/scripts/diff.py b/Tools/scripts/diff.py old mode 100644 new mode 100755 index 52dcab1ff9c..513e2a7112d --- a/Tools/scripts/diff.py +++ b/Tools/scripts/diff.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python """ Command line interface to difflib.py providing diffs in four formats: * ndiff: lists every line and highlights interline changes. diff --git a/Tools/scripts/find_recursionlimit.py b/Tools/scripts/find_recursionlimit.py old mode 100644 new mode 100755 diff --git a/Tools/scripts/hotshotmain.py b/Tools/scripts/hotshotmain.py old mode 100644 new mode 100755 diff --git a/Tools/scripts/mailerdaemon.py b/Tools/scripts/mailerdaemon.py old mode 100644 new mode 100755 index 85f90aa611f..a1eeaadf9fe --- a/Tools/scripts/mailerdaemon.py +++ b/Tools/scripts/mailerdaemon.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python """mailerdaemon - classes to parse mailer-daemon messages""" import rfc822 diff --git a/Tools/scripts/md5sum.py b/Tools/scripts/md5sum.py old mode 100644 new mode 100755 diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py old mode 100644 new mode 100755 index bc8bc795333..7398e7820d5 --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python import re import sys import shutil diff --git a/Tools/scripts/pickle2db.py b/Tools/scripts/pickle2db.py old mode 100644 new mode 100755 diff --git a/Tools/scripts/pysource.py b/Tools/scripts/pysource.py old mode 100644 new mode 100755 diff --git a/Tools/scripts/redemo.py b/Tools/scripts/redemo.py old mode 100644 new mode 100755 index de7f3c4a219..2b5ade44aa2 --- a/Tools/scripts/redemo.py +++ b/Tools/scripts/redemo.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python """Basic regular expression demostration facility (Perl style syntax).""" from Tkinter import * From 2636d77c47a1ba92c3ca39dc125067e4ff538635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 29 Jul 2011 12:07:04 +0200 Subject: [PATCH 10/13] Make VCSes ignore the compiled shared library file (#12255) --- .bzrignore | 1 + .hgignore | 1 + 2 files changed, 2 insertions(+) diff --git a/.bzrignore b/.bzrignore index e0f006555b4..2527052a1ba 100644 --- a/.bzrignore +++ b/.bzrignore @@ -13,6 +13,7 @@ Makefile.pre platform pyconfig.h libpython*.a +libpython*.so* python.exe python-gdb.py reflog.txt diff --git a/.hgignore b/.hgignore index 5df8684bcb1..8e512545041 100644 --- a/.hgignore +++ b/.hgignore @@ -38,6 +38,7 @@ Parser/pgen.stamp$ syntax: glob python.exe-gdb.py libpython*.a +libpython*.so* *.swp *.o *.pyc From 3037bb7340f3ea74d3f90d555a44050bcbe39257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 29 Jul 2011 12:07:31 +0200 Subject: [PATCH 11/13] Stop ignoring Mercurial merge conflits files (#12255). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R. David Murray and I think that it’s more useful to have these files show up in the output of “hg status”, to let the user know that some merged file have to be checked before commit. If you want to ignore these files in your clones, it’s possible to do so from another ignore file; see the bug report for directions. --- .hgignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.hgignore b/.hgignore index 8e512545041..8c402ff3c62 100644 --- a/.hgignore +++ b/.hgignore @@ -45,8 +45,6 @@ libpython*.so* *.pyo *.pyd *.cover -*.orig -*.rej *~ Lib/lib2to3/*.pickle Lib/test/data/* From d01aebe3d6093902bda8cb41e7931fd9125e7d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 29 Jul 2011 12:10:53 +0200 Subject: [PATCH 12/13] Update documentation for shutil.move (#12043) and fix a few typos. Adding Sandro Tosi to Doc/ACKS for this patch and all his work on the docs mailing list and on the bug tracker. --- Doc/ACKS.txt | 1 + Doc/library/shutil.rst | 27 +++++++++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Doc/ACKS.txt b/Doc/ACKS.txt index 774192e812f..1e44cf7d027 100644 --- a/Doc/ACKS.txt +++ b/Doc/ACKS.txt @@ -199,6 +199,7 @@ docs@python.org), and we'll be glad to correct the problem. * Kalle Svensson * Jim Tittsler * David Turner + * Sandro Tosi * Ville Vainio * Martijn Vries * Charles G. Waldman diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index ed622addc9b..1082d2a37b4 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -161,24 +161,31 @@ Directory and files operations .. function:: move(src, dst) - Recursively move a file or directory to another location. + Recursively move a file or directory (*src*) to another location (*dst*). - Uses :func:`os.rename` to perform the move. If it fails, for reasons such as - when *src* and *dst* are on different filesystems or in case of windows where - rename is not supported when *dst* exists, fallback to copying *src* (with - :func:`copy2`) to the *dst* and then remove *src*. + If the destination is a directory or a symlink to a directory, then *src* is + moved inside that directory. + + The destination directory must not already exist. If the destination already + exists but is not a directory, it may be overwritten depending on + :func:`os.rename` semantics. + + If the destination is on the current filesystem, then :func:`os.rename` is + used. Otherwise, *src* is copied (using :func:`copy2`) to *dst* and then + removed. .. versionadded:: 2.3 .. exception:: Error - This exception collects exceptions that raised during a multi-file operation. For - :func:`copytree`, the exception argument is a list of 3-tuples (*srcname*, - *dstname*, *exception*). + This exception collects exceptions that are raised during a multi-file + operation. For :func:`copytree`, the exception argument is a list of 3-tuples + (*srcname*, *dstname*, *exception*). .. versionadded:: 2.3 + .. _shutil-example: copytree example @@ -277,7 +284,7 @@ Archives operations .. function:: get_archive_formats() - Returns a list of supported formats for archiving. + Return a list of supported formats for archiving. Each element of the returned sequence is a tuple ``(name, description)`` By default :mod:`shutil` provides these formats: @@ -295,7 +302,7 @@ Archives operations .. function:: register_archive_format(name, function, [extra_args, [description]]) - Registers an archiver for the format *name*. *function* is a callable that + Register an archiver for the format *name*. *function* is a callable that will be used to invoke the archiver. If given, *extra_args* is a sequence of ``(name, value)`` that will be From bd21b01079aa743f139877138f78ae031316e329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Thu, 28 Jul 2011 22:50:18 +0200 Subject: [PATCH 13/13] Turn raw URI into real link --- Doc/distutils/apiref.rst | 4 ++-- Doc/tools/sphinxext/susp-ignored.csv | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst index 28af893648b..63eca411e57 100644 --- a/Doc/distutils/apiref.rst +++ b/Doc/distutils/apiref.rst @@ -72,8 +72,8 @@ setup script). Indirectly provides the :class:`distutils.dist.Distribution` and | | be built | :class:`distutils.core.Extension` | +--------------------+--------------------------------+-------------------------------------------------------------+ | *classifiers* | A list of categories for the | The list of available | - | | package | categorizations is at | - | | | http://pypi.python.org/pypi?:action=list_classifiers. | + | | package | categorizations is available on `PyPI | + | | | `_. | +--------------------+--------------------------------+-------------------------------------------------------------+ | *distclass* | the :class:`Distribution` | A subclass of | | | class to use | :class:`distutils.core.Distribution` | diff --git a/Doc/tools/sphinxext/susp-ignored.csv b/Doc/tools/sphinxext/susp-ignored.csv index a97b7646e73..18049889219 100644 --- a/Doc/tools/sphinxext/susp-ignored.csv +++ b/Doc/tools/sphinxext/susp-ignored.csv @@ -5,7 +5,6 @@ c-api/sequence,,:i2,o[i1:i2] c-api/sequence,,:i2,o[i1:i2] = v c-api/sequence,,:i2,del o[i1:i2] c-api/unicode,,:end,str[start:end] -distutils/apiref,,:action,http://pypi.python.org/pypi?:action=list_classifiers distutils/setupscript,,::, extending/embedding,,:numargs,"if(!PyArg_ParseTuple(args, "":numargs""))" extending/extending,,:set,"if (PyArg_ParseTuple(args, ""O:set_callback"", &temp)) {"