Merged revisions 70642,70648,70656,70661,70765,70773,70789,70824-70825,70828,70830,70832,70836,70838,70842,70851,70855,70857-70858 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r70642 | georg.brandl | 2009-03-28 01:48:48 +0100 (Sa, 28 Mär 2009) | 1 line

  Fix typo.
........
  r70648 | georg.brandl | 2009-03-28 20:10:37 +0100 (Sa, 28 Mär 2009) | 1 line

  #5324: document __subclasses__().
........
  r70656 | georg.brandl | 2009-03-28 20:33:33 +0100 (Sa, 28 Mär 2009) | 2 lines

  Add a script to fixup rst files if the pre-commit hook rejects them.
........
  r70661 | georg.brandl | 2009-03-28 20:57:36 +0100 (Sa, 28 Mär 2009) | 2 lines

  Add section numbering to some of the larger subdocuments.
........
  r70765 | georg.brandl | 2009-03-31 00:09:34 +0200 (Di, 31 Mär 2009) | 1 line

  #5199: make warning about vars() assignment more visible.
........
  r70773 | georg.brandl | 2009-03-31 00:43:00 +0200 (Di, 31 Mär 2009) | 1 line

  #5039: make it clear that the impl. note refers to CPython.
........
  r70789 | georg.brandl | 2009-03-31 03:25:15 +0200 (Di, 31 Mär 2009) | 1 line

  Fix a wrong struct field assignment (docstring as closure).
........
  r70824 | georg.brandl | 2009-03-31 17:43:20 +0200 (Di, 31 Mär 2009) | 1 line

  #5519: remove reference to Kodos, which seems dead.
........
  r70825 | georg.brandl | 2009-03-31 17:46:30 +0200 (Di, 31 Mär 2009) | 1 line

  #5566: fix versionadded from PyLong ssize_t functions.
........
  r70828 | georg.brandl | 2009-03-31 17:50:16 +0200 (Di, 31 Mär 2009) | 1 line

  #5581: fget argument of abstractproperty is optional as well.
........
  r70830 | georg.brandl | 2009-03-31 18:11:45 +0200 (Di, 31 Mär 2009) | 1 line

  #5529: backport new docs of import semantics written by Brett to 2.x.
........
  r70832 | georg.brandl | 2009-03-31 18:31:11 +0200 (Di, 31 Mär 2009) | 1 line

  #1386675: specify WindowsError as the exception, because it has a winerror attribute that EnvironmentError doesnt have.
........
  r70836 | georg.brandl | 2009-03-31 18:50:25 +0200 (Di, 31 Mär 2009) | 1 line

  #5417: replace references to undocumented functions by ones to documented functions.
........
  r70838 | georg.brandl | 2009-03-31 18:54:38 +0200 (Di, 31 Mär 2009) | 1 line

  #992207: document that the parser only accepts \\n newlines.
........
  r70842 | georg.brandl | 2009-03-31 19:13:06 +0200 (Di, 31 Mär 2009) | 1 line

  #970783: document PyObject_Generic[GS]etAttr.
........
  r70851 | georg.brandl | 2009-03-31 20:26:55 +0200 (Di, 31 Mär 2009) | 1 line

  #837577: note cryptic return value of spawn*e on invalid env dicts.
........
  r70855 | georg.brandl | 2009-03-31 20:30:37 +0200 (Di, 31 Mär 2009) | 1 line

  #5245: note that PyRun_SimpleString doesnt return on SystemExit.
........
  r70857 | georg.brandl | 2009-03-31 20:33:10 +0200 (Di, 31 Mär 2009) | 1 line

  #5227: note that Py_Main doesnt return on SystemExit.
........
  r70858 | georg.brandl | 2009-03-31 20:38:56 +0200 (Di, 31 Mär 2009) | 1 line

  #5241: document missing U in regex howto.
........
diff --git a/Doc/library/_winreg.rst b/Doc/library/_winreg.rst
index 4e3cebb..e9c0fa7 100644
--- a/Doc/library/_winreg.rst
+++ b/Doc/library/_winreg.rst
@@ -1,4 +1,3 @@
-
 :mod:`_winreg` -- Windows registry access
 =========================================
 
@@ -47,8 +46,8 @@
 
    *key* is the predefined handle to connect to.
 
-   The return value is the handle of the opened key. If the function fails, an
-   :exc:`EnvironmentError` exception is  raised.
+   The return value is the handle of the opened key. If the function fails, a
+   :exc:`WindowsError` exception is  raised.
 
 
 .. function:: CreateKey(key, sub_key)
@@ -65,8 +64,8 @@
 
    If the key already exists, this function opens the existing key.
 
-   The return value is the handle of the opened key. If the function fails, an
-   :exc:`EnvironmentError` exception is  raised.
+   The return value is the handle of the opened key. If the function fails, a
+   :exc:`WindowsError` exception is  raised.
 
 
 .. function:: DeleteKey(key, sub_key)
@@ -82,7 +81,7 @@
    *This method can not delete keys with subkeys.*
 
    If the method succeeds, the entire key, including all of its values, is removed.
-   If the method fails, an :exc:`EnvironmentError`  exception is raised.
+   If the method fails, a :exc:`WindowsError`  exception is raised.
 
 
 .. function:: DeleteValue(key, value)
@@ -105,7 +104,7 @@
    *index* is an integer that identifies the index of the key to  retrieve.
 
    The function retrieves the name of one subkey each time it  is called.  It is
-   typically called repeatedly until an  :exc:`EnvironmentError` exception  is
+   typically called repeatedly until a  :exc:`WindowsError` exception  is
    raised, indicating, no more values are available.
 
 
@@ -119,7 +118,7 @@
    *index* is an integer that identifies the index of the value  to retrieve.
 
    The function retrieves the name of one subkey each time it is  called. It is
-   typically called repeatedly, until an  :exc:`EnvironmentError` exception is
+   typically called repeatedly, until a  :exc:`WindowsError` exception is
    raised, indicating  no more values.
 
    The result is a tuple of 3 items:
@@ -209,7 +208,7 @@
 
    The result is a new handle to the specified key.
 
-   If the function fails, :exc:`EnvironmentError` is raised.
+   If the function fails, :exc:`WindowsError` is raised.
 
 
 .. function:: OpenKeyEx()
diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst
index 5833dfa..505fca1 100644
--- a/Doc/library/abc.rst
+++ b/Doc/library/abc.rst
@@ -161,7 +161,7 @@
       multiple-inheritance.
 
 
-.. function:: abstractproperty(fget[, fset[, fdel[, doc]]])
+.. function:: abstractproperty([fget[, fset[, fdel[, doc]]]])
 
    A subclass of the built-in :func:`property`, indicating an abstract property.
 
@@ -189,6 +189,7 @@
           def setx(self, value): ...
           x = abstractproperty(getx, setx)
 
+
 .. rubric:: Footnotes
 
 .. [#] C++ programmers should note that Python's virtual base class
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index bad9848..499be9d 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1344,8 +1344,12 @@
    Without arguments, return a dictionary corresponding to the current local symbol
    table.  With a module, class or class instance object as argument (or anything
    else that has a :attr:`__dict__` attribute), returns a dictionary corresponding
-   to the object's symbol table.  The returned dictionary should not be modified:
-   the effects on the corresponding symbol table are undefined. [#]_
+   to the object's symbol table.
+
+   .. warning::
+
+      The returned dictionary should not be modified:
+      the effects on the corresponding symbol table are undefined. [#]_
 
 
 .. function:: xrange([start,] stop[, step])
diff --git a/Doc/library/index.rst b/Doc/library/index.rst
index 717bfb8..f25724c 100644
--- a/Doc/library/index.rst
+++ b/Doc/library/index.rst
@@ -38,6 +38,7 @@
 
 .. toctree::
    :maxdepth: 2
+   :numbered:
 
    intro.rst
    functions.rst
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 74fca8a..309fac2 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -1751,7 +1751,9 @@
    which is used to define the environment variables for the new process (they are
    used instead of the current process' environment); the functions
    :func:`spawnl`, :func:`spawnlp`, :func:`spawnv`, and :func:`spawnvp` all cause
-   the new process to inherit the environment of the current process.
+   the new process to inherit the environment of the current process.  Note that
+   keys and values in the *env* dictionary must be strings; invalid keys or
+   values will cause the function to fail, with a return value of ``127``.
 
    As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` are
    equivalent::
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 2237f07..906444a 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -8,12 +8,9 @@
 .. sectionauthor:: Andrew M. Kuchling <amk@amk.ca>
 
 
-
-
 This module provides regular expression matching operations similar to
 those found in Perl. Both patterns and strings to be searched can be
-Unicode strings as well as 8-bit strings.  The :mod:`re` module is
-always available.
+Unicode strings as well as 8-bit strings.
 
 Regular expressions use the backslash character (``'\'``) to indicate
 special forms or to allow special characters to be used without invoking
@@ -43,9 +40,6 @@
       second edition of the book no longer covers Python at all, but the first
       edition covered writing good regular expression patterns in great detail.
 
-   `Kodos <http://kodos.sf.net/>`_
-      is a graphical regular expression debugger written in Python.
-
 
 .. _re-syntax:
 
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 9b8cd35..9c207b0 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -2652,6 +2652,17 @@
 
    The name of the class or type.
 
+
+.. method:: class.__subclasses__
+
+   :term:`New-style class`\ es keep a list of weak references to their immediate
+   subclasses.  This method returns a list of all those references still alive.
+   Example::
+
+      >>> int.__subclasses__()
+      [<type 'bool'>]
+
+
 .. rubric:: Footnotes
 
 .. [#] Additional information on these special methods may be found in the Python
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index afdf52c..b556a3c 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -535,6 +535,22 @@
    characters are stored as UCS-2 or UCS-4.
 
 
+.. data:: meta_path
+
+    A list of :term:`finder` objects that have their :meth:`find_module`
+    methods called to see if one of the objects can find the module to be
+    imported. The :meth:`find_module` method is called at least with the
+    absolute name of the module being imported. If the module to be imported is
+    contained in package then the parent package's :attr:`__path__` attribute
+    is passed in as a second argument. The method returns :keyword:`None` if
+    the module cannot be found, else returns a :term:`loader`.
+
+    :data:`sys.meta_path` is searched before any implicit default finders or
+    :data:`sys.path`.
+
+    See :pep:`302` for the original specification.
+
+
 .. data:: modules
 
    .. index:: builtin: reload
@@ -571,6 +587,27 @@
       :data:`sys.path`.
 
 
+.. data:: path_hooks
+
+    A list of callables that take a path argument to try to create a
+    :term:`finder` for the path. If a finder can be created, it is to be
+    returned by the callable, else raise :exc:`ImportError`.
+
+    Originally specified in :pep:`302`.
+
+
+.. data:: path_importer_cache
+
+    A dictionary acting as a cache for :term:`finder` objects. The keys are
+    paths that have been passed to :data:`sys.path_hooks` and the values are
+    the finders that are found. If a path is a valid file system path but no
+    explicit finder is found on :data:`sys.path_hooks` then :keyword:`None` is
+    stored to represent the implicit default finder should be used. If the path
+    is not an existing path then :class:`imp.NullImporter` is set.
+
+    Originally specified in :pep:`302`.
+
+
 .. data:: platform
 
    This string contains a platform identifier that can be used to append