[Python-checkins] r63619 - in python/branches/tlee-ast-optimize: Demo/pdist/cmptree.py Demo/pdist/server.py Doc/library/_winreg.rst Doc/library/basehttpserver.rst Doc/library/bsddb.rst Doc/library/collections.rst Doc/library/configparser.rst Doc/library/datatypes.rst Doc/library/logging.rst Doc/library/math.rst Doc/library/queue.rst Doc/library/repr.rst Doc/library/reprlib.rst Doc/library/shlex.rst Doc/library/simplexmlrpcserver.rst Doc/library/socket.rst Doc/library/socketserver.rst Doc/library/struct.rst Doc/library/threading.rst Doc/reference/expressions.rst Doc/reference/simple_stmts.rst Doc/tutorial/stdlib2.rst Doc/whatsnew/2.6.rst Include/pyport.h Lib/BaseHTTPServer.py Lib/ConfigParser.py Lib/Queue.py Lib/SimpleXMLRPCServer.py Lib/SocketServer.py Lib/bdb.py Lib/bsddb/db.py Lib/bsddb/dbtables.py Lib/bsddb/test/test_all.py Lib/bsddb/test/test_replication.py Lib/bsddb/test/test_sequence.py Lib/configparser.py Lib/copy.py Lib/ctypes/test/__init__.py Lib/ctypes/test/runtests.py Lib/distutils/command/upload.py Lib/distutils/config.py Lib/distutils/dist.py Lib/idlelib/Debugger.py Lib/idlelib/ObjectBrowser.py Lib/idlelib/configHandler.py Lib/idlelib/rpc.py Lib/idlelib/run.py Lib/lib-old/ConfigParser.py Lib/lib-old/Queue.py Lib/lib-old/SocketServer.py Lib/lib-old/repr.py Lib/lib-tk/tkMessageBox.py Lib/logging/config.py Lib/pdb.py Lib/pydoc.py Lib/queue.py Lib/repr.py Lib/reprlib.py Lib/socketserver.py Lib/test/test___all__.py Lib/test/test_bsddb3.py Lib/test/test_cfgparser.py Lib/test/test_dummy_thread.py Lib/test/test_ioctl.py Lib/test/test_json.py Lib/test/test_logging.py Lib/test/test_math.py Lib/test/test_minidom.py Lib/test/test_opcodes.py Lib/test/test_platform.py Lib/test/test_py3kwarn.py Lib/test/test_pydoc.py Lib/test/test_queue.py Lib/test/test_repr.py Lib/test/test_reprlib.py Lib/test/test_socket.py Lib/test/test_socketserver.py Lib/test/test_wsgiref.py Lib/xml/dom/minidom.py Misc/ACKS Misc/NEWS Misc/cheatsheet Modules/_bsddb.c Modules/_ctypes/libffi/configure Modules/_ctypes/libffi/configure.ac Modules/_ctypes/malloc_closure.c Modules/bsddb.h Modules/mathmodule.c PCbuild/pyproject.vsprops Tools/webchecker/wsgui.py configure configure.in pyconfig.h.in setup.py

thomas.lee python-checkins at python.org
Sun May 25 10:45:22 CEST 2008


Author: thomas.lee
Date: Sun May 25 10:45:18 2008
New Revision: 63619

Log:
Merged revisions 63517-63611 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r63522 | thomas.heller | 2008-05-22 04:47:02 +1000 (Thu, 22 May 2008) | 2 lines
  
  The -x <test1[,test2...]> flag allows to exclude tests.
........
  r63523 | thomas.heller | 2008-05-22 05:47:44 +1000 (Thu, 22 May 2008) | 2 lines
  
  Oops, get_tests may be called with 3 arguments.
........
  r63528 | benjamin.peterson | 2008-05-22 08:52:39 +1000 (Thu, 22 May 2008) | 2 lines
  
  check for toolbox glue before testing platform.mac_ver intensly
........
  r63530 | benjamin.peterson | 2008-05-22 10:57:02 +1000 (Thu, 22 May 2008) | 2 lines
  
  use more specific asserts in test_opcode
........
  r63531 | benjamin.peterson | 2008-05-22 11:02:23 +1000 (Thu, 22 May 2008) | 2 lines
  
  remove redundant invocation of json doctests
........
  r63534 | brett.cannon | 2008-05-22 13:18:35 +1000 (Thu, 22 May 2008) | 1 line
  
  Add Quentin Gallet-Gilles for (at least) a fixer for markupbase.
........
  r63537 | jesus.cea | 2008-05-23 01:27:38 +1000 (Fri, 23 May 2008) | 1 line
  
  bsddb module updated to version 4.7.0
........
  r63540 | benjamin.peterson | 2008-05-23 09:09:26 +1000 (Fri, 23 May 2008) | 3 lines
  
  fix test_pydoc so it works on make installed Python installations
  Also let it pass when invoked directly
........
  r63541 | raymond.hettinger | 2008-05-23 10:49:27 +1000 (Fri, 23 May 2008) | 1 line
  
  Docs for Issue 2819.
........
  r63542 | mark.dickinson | 2008-05-23 11:35:30 +1000 (Fri, 23 May 2008) | 5 lines
  
  Issue #2819: Add math.sum, a function that sums a sequence of floats 
  efficiently but with no intermediate loss of precision.  Based on 
  Raymond Hettinger's ASPN recipe.  Thanks Jean Brouwers for the patch.
........
  r63543 | mark.dickinson | 2008-05-23 12:36:48 +1000 (Fri, 23 May 2008) | 2 lines
  
  Add tests for math.sum (Issue #2819)
........
  r63544 | mark.dickinson | 2008-05-23 13:30:01 +1000 (Fri, 23 May 2008) | 2 lines
  
  Better error reporting in test_math.py
........
  r63545 | mark.dickinson | 2008-05-23 14:22:50 +1000 (Fri, 23 May 2008) | 6 lines
  
  Temporary checkin to get configure to report more
  information about the processor on the Debian/alpha
  buildbot.  (I'm still trying to track down the cause
  of the test_math failures for this machine.)  This
  checkin will be reverted within the next 48 hours.
........
  r63546 | raymond.hettinger | 2008-05-23 14:32:43 +1000 (Fri, 23 May 2008) | 1 line
  
  Tweak the comments and formatting.
........
  r63547 | brett.cannon | 2008-05-23 15:03:59 +1000 (Fri, 23 May 2008) | 1 line
  
  Revert the renaming of repr to reprlib.
........
  r63549 | brett.cannon | 2008-05-23 15:05:20 +1000 (Fri, 23 May 2008) | 1 line
  
  Remove the old repr stub.
........
  r63553 | mark.dickinson | 2008-05-23 22:07:36 +1000 (Fri, 23 May 2008) | 3 lines
  
  Skip math.sum tests on non IEEE 754 platforms, and on IEEE 754 platforms 
  that exhibit the problem described in issue #2937. 
........
  r63562 | martin.v.loewis | 2008-05-24 01:06:50 +1000 (Sat, 24 May 2008) | 2 lines
  
  Patch #1722225: Support QNX 6.
........
  r63563 | martin.v.loewis | 2008-05-24 01:18:28 +1000 (Sat, 24 May 2008) | 3 lines
  
  Issue #1390: Raise ValueError in toxml when an invalid comment would
  otherwise be produced.
........
  r63564 | raymond.hettinger | 2008-05-24 03:21:44 +1000 (Sat, 24 May 2008) | 1 line
  
  Issue 2909: show how to name unpacked fields.
........
  r63567 | raymond.hettinger | 2008-05-24 03:34:34 +1000 (Sat, 24 May 2008) | 1 line
  
  Fix typo
........
  r63568 | mark.dickinson | 2008-05-24 04:04:06 +1000 (Sat, 24 May 2008) | 2 lines
  
  Revert temporary checkin in revision 63545.
........
  r63569 | martin.v.loewis | 2008-05-24 05:33:13 +1000 (Sat, 24 May 2008) | 3 lines
  
  Mention that the leaking of variables from list comprehensions
  is fixed in 3.0.
........
  r63570 | trent.nelson | 2008-05-24 06:33:14 +1000 (Sat, 24 May 2008) | 1 line
  
  Introduce a user macro named $(externalsDir), which should point to the root directory of where all the external sources should live.  Developers can change this value if their external sources live elsewhere.  The default of '..\..' matches the current status quo.
........
  r63575 | martin.v.loewis | 2008-05-24 19:00:04 +1000 (Sat, 24 May 2008) | 3 lines
  
  Use announce instead of print, to suppress output in
  the testsuite.
........
  r63576 | martin.v.loewis | 2008-05-24 19:36:45 +1000 (Sat, 24 May 2008) | 3 lines
  
  Don't try to get the window size if it was never set before.
  Fixes the test failure on Solaris.
........
  r63586 | georg.brandl | 2008-05-25 04:08:33 +1000 (Sun, 25 May 2008) | 2 lines
  
  socketserver renaming reversal part 1: remove stub module.
........
  r63587 | georg.brandl | 2008-05-25 04:11:29 +1000 (Sun, 25 May 2008) | 5 lines
  
  socketserver renaming reversal part 2: move rename module.
  
  I'm doing this case-only rename in a two-step process via a different directory
  to hopefully avoid problems with case-insensitive filesystems.
........
  r63588 | guilherme.polo | 2008-05-25 04:24:49 +1000 (Sun, 25 May 2008) | 1 line
  
  Fixed an import that remained from the lib-tk -> tkinter -> lib-tk renaming
........
  r63589 | georg.brandl | 2008-05-25 04:31:28 +1000 (Sun, 25 May 2008) | 3 lines
  
  socketserver renaming reversal part 3: move the module into the right
  place and fix all references to it.  Closes #2926.
........
  r63597 | gregory.p.smith | 2008-05-25 07:21:23 +1000 (Sun, 25 May 2008) | 3 lines
  
  Correct the url to the external bsddb.db docs (likely to be integrated
  soon anyways?)
........
  r63598 | gregory.p.smith | 2008-05-25 13:13:41 +1000 (Sun, 25 May 2008) | 2 lines
  
  Use test_support to get network ports to bind to.
........
  r63599 | georg.brandl | 2008-05-25 17:08:35 +1000 (Sun, 25 May 2008) | 2 lines
  
  Queue renaming reversal part 1: remove stub module.
........
  r63600 | georg.brandl | 2008-05-25 17:10:03 +1000 (Sun, 25 May 2008) | 2 lines
  
  Queue renaming reversal part 2: move module.
........
  r63601 | gregory.p.smith | 2008-05-25 17:14:09 +1000 (Sun, 25 May 2008) | 7 lines
  
  * Give the test_bsddb3 tests a unique temporary directory to run their
    stuff in and clean it up afterwards regardless of the result.
  * Get rid of duplicate list of test modules to run, they're maintained
    within test_all now.
  * Print the BerkeleyDB version to stderr when running test_bsddb3 to
    help buildbot problem diagnosis.
........
  r63603 | georg.brandl | 2008-05-25 17:20:14 +1000 (Sun, 25 May 2008) | 3 lines
  
  Queue renaming reversal part 3: move module into place and
  change imports and other references. Closes #2925.
........
  r63604 | gregory.p.smith | 2008-05-25 17:20:34 +1000 (Sun, 25 May 2008) | 3 lines
  
  print out information about which BerkeleyDB library was found by
  setup.py to use to build the bsddb module.
........
  r63605 | georg.brandl | 2008-05-25 17:21:41 +1000 (Sun, 25 May 2008) | 2 lines
  
  ConfigParser renaming reversal part 1: remove stub module.
........
  r63606 | georg.brandl | 2008-05-25 17:21:58 +1000 (Sun, 25 May 2008) | 2 lines
  
  ConfigParser renaming reversal part 2: move module.
........
  r63607 | georg.brandl | 2008-05-25 17:25:25 +1000 (Sun, 25 May 2008) | 2 lines
  
  ConfigParser renaming reversal part 3: move module into place and adapt imports.
........
  r63611 | georg.brandl | 2008-05-25 17:46:33 +1000 (Sun, 25 May 2008) | 2 lines
  
  Hint about _winreg renaming in the docs.
........


Added:
   python/branches/tlee-ast-optimize/Doc/library/repr.rst
      - copied unchanged from r63611, /python/trunk/Doc/library/repr.rst
   python/branches/tlee-ast-optimize/Lib/ConfigParser.py
      - copied unchanged from r63611, /python/trunk/Lib/ConfigParser.py
   python/branches/tlee-ast-optimize/Lib/Queue.py
      - copied unchanged from r63611, /python/trunk/Lib/Queue.py
   python/branches/tlee-ast-optimize/Lib/SocketServer.py
      - copied unchanged from r63611, /python/trunk/Lib/SocketServer.py
   python/branches/tlee-ast-optimize/Lib/repr.py
      - copied unchanged from r63611, /python/trunk/Lib/repr.py
   python/branches/tlee-ast-optimize/Lib/test/test_repr.py
      - copied unchanged from r63611, /python/trunk/Lib/test/test_repr.py
Removed:
   python/branches/tlee-ast-optimize/Doc/library/reprlib.rst
   python/branches/tlee-ast-optimize/Lib/configparser.py
   python/branches/tlee-ast-optimize/Lib/lib-old/ConfigParser.py
   python/branches/tlee-ast-optimize/Lib/lib-old/Queue.py
   python/branches/tlee-ast-optimize/Lib/lib-old/SocketServer.py
   python/branches/tlee-ast-optimize/Lib/lib-old/repr.py
   python/branches/tlee-ast-optimize/Lib/queue.py
   python/branches/tlee-ast-optimize/Lib/reprlib.py
   python/branches/tlee-ast-optimize/Lib/socketserver.py
   python/branches/tlee-ast-optimize/Lib/test/test_reprlib.py
Modified:
   python/branches/tlee-ast-optimize/   (props changed)
   python/branches/tlee-ast-optimize/Demo/pdist/cmptree.py
   python/branches/tlee-ast-optimize/Demo/pdist/server.py
   python/branches/tlee-ast-optimize/Doc/library/_winreg.rst
   python/branches/tlee-ast-optimize/Doc/library/basehttpserver.rst
   python/branches/tlee-ast-optimize/Doc/library/bsddb.rst
   python/branches/tlee-ast-optimize/Doc/library/collections.rst
   python/branches/tlee-ast-optimize/Doc/library/configparser.rst
   python/branches/tlee-ast-optimize/Doc/library/datatypes.rst
   python/branches/tlee-ast-optimize/Doc/library/logging.rst
   python/branches/tlee-ast-optimize/Doc/library/math.rst
   python/branches/tlee-ast-optimize/Doc/library/queue.rst
   python/branches/tlee-ast-optimize/Doc/library/shlex.rst
   python/branches/tlee-ast-optimize/Doc/library/simplexmlrpcserver.rst
   python/branches/tlee-ast-optimize/Doc/library/socket.rst
   python/branches/tlee-ast-optimize/Doc/library/socketserver.rst
   python/branches/tlee-ast-optimize/Doc/library/struct.rst
   python/branches/tlee-ast-optimize/Doc/library/threading.rst
   python/branches/tlee-ast-optimize/Doc/reference/expressions.rst
   python/branches/tlee-ast-optimize/Doc/reference/simple_stmts.rst
   python/branches/tlee-ast-optimize/Doc/tutorial/stdlib2.rst
   python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst
   python/branches/tlee-ast-optimize/Include/pyport.h
   python/branches/tlee-ast-optimize/Lib/BaseHTTPServer.py
   python/branches/tlee-ast-optimize/Lib/SimpleXMLRPCServer.py
   python/branches/tlee-ast-optimize/Lib/bdb.py
   python/branches/tlee-ast-optimize/Lib/bsddb/db.py
   python/branches/tlee-ast-optimize/Lib/bsddb/dbtables.py
   python/branches/tlee-ast-optimize/Lib/bsddb/test/test_all.py
   python/branches/tlee-ast-optimize/Lib/bsddb/test/test_replication.py
   python/branches/tlee-ast-optimize/Lib/bsddb/test/test_sequence.py
   python/branches/tlee-ast-optimize/Lib/copy.py
   python/branches/tlee-ast-optimize/Lib/ctypes/test/__init__.py
   python/branches/tlee-ast-optimize/Lib/ctypes/test/runtests.py
   python/branches/tlee-ast-optimize/Lib/distutils/command/upload.py
   python/branches/tlee-ast-optimize/Lib/distutils/config.py
   python/branches/tlee-ast-optimize/Lib/distutils/dist.py
   python/branches/tlee-ast-optimize/Lib/idlelib/Debugger.py
   python/branches/tlee-ast-optimize/Lib/idlelib/ObjectBrowser.py
   python/branches/tlee-ast-optimize/Lib/idlelib/configHandler.py
   python/branches/tlee-ast-optimize/Lib/idlelib/rpc.py
   python/branches/tlee-ast-optimize/Lib/idlelib/run.py
   python/branches/tlee-ast-optimize/Lib/lib-tk/tkMessageBox.py
   python/branches/tlee-ast-optimize/Lib/logging/config.py
   python/branches/tlee-ast-optimize/Lib/pdb.py
   python/branches/tlee-ast-optimize/Lib/pydoc.py
   python/branches/tlee-ast-optimize/Lib/test/test___all__.py
   python/branches/tlee-ast-optimize/Lib/test/test_bsddb3.py
   python/branches/tlee-ast-optimize/Lib/test/test_cfgparser.py
   python/branches/tlee-ast-optimize/Lib/test/test_dummy_thread.py
   python/branches/tlee-ast-optimize/Lib/test/test_ioctl.py
   python/branches/tlee-ast-optimize/Lib/test/test_json.py
   python/branches/tlee-ast-optimize/Lib/test/test_logging.py
   python/branches/tlee-ast-optimize/Lib/test/test_math.py
   python/branches/tlee-ast-optimize/Lib/test/test_minidom.py
   python/branches/tlee-ast-optimize/Lib/test/test_opcodes.py
   python/branches/tlee-ast-optimize/Lib/test/test_platform.py
   python/branches/tlee-ast-optimize/Lib/test/test_py3kwarn.py
   python/branches/tlee-ast-optimize/Lib/test/test_pydoc.py
   python/branches/tlee-ast-optimize/Lib/test/test_queue.py
   python/branches/tlee-ast-optimize/Lib/test/test_socket.py
   python/branches/tlee-ast-optimize/Lib/test/test_socketserver.py
   python/branches/tlee-ast-optimize/Lib/test/test_wsgiref.py
   python/branches/tlee-ast-optimize/Lib/xml/dom/minidom.py
   python/branches/tlee-ast-optimize/Misc/ACKS
   python/branches/tlee-ast-optimize/Misc/NEWS
   python/branches/tlee-ast-optimize/Misc/cheatsheet
   python/branches/tlee-ast-optimize/Modules/_bsddb.c
   python/branches/tlee-ast-optimize/Modules/_ctypes/libffi/configure
   python/branches/tlee-ast-optimize/Modules/_ctypes/libffi/configure.ac
   python/branches/tlee-ast-optimize/Modules/_ctypes/malloc_closure.c
   python/branches/tlee-ast-optimize/Modules/bsddb.h
   python/branches/tlee-ast-optimize/Modules/mathmodule.c
   python/branches/tlee-ast-optimize/PCbuild/pyproject.vsprops
   python/branches/tlee-ast-optimize/Tools/webchecker/wsgui.py
   python/branches/tlee-ast-optimize/configure
   python/branches/tlee-ast-optimize/configure.in
   python/branches/tlee-ast-optimize/pyconfig.h.in
   python/branches/tlee-ast-optimize/setup.py

Modified: python/branches/tlee-ast-optimize/Demo/pdist/cmptree.py
==============================================================================
--- python/branches/tlee-ast-optimize/Demo/pdist/cmptree.py	(original)
+++ python/branches/tlee-ast-optimize/Demo/pdist/cmptree.py	Sun May 25 10:45:18 2008
@@ -1,7 +1,7 @@
 """Compare local and remote dictionaries and transfer differing files -- like rdist."""
 
 import sys
-from reprlib import repr
+from repr import repr
 import FSProxy
 import time
 import os

Modified: python/branches/tlee-ast-optimize/Demo/pdist/server.py
==============================================================================
--- python/branches/tlee-ast-optimize/Demo/pdist/server.py	(original)
+++ python/branches/tlee-ast-optimize/Demo/pdist/server.py	Sun May 25 10:45:18 2008
@@ -4,7 +4,7 @@
 import socket
 import pickle
 from fnmatch import fnmatch
-from reprlib import repr
+from repr import repr
 
 
 # Default verbosity (0 = silent, 1 = print connections, 2 = print requests too)

Modified: python/branches/tlee-ast-optimize/Doc/library/_winreg.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/_winreg.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/_winreg.rst	Sun May 25 10:45:18 2008
@@ -7,6 +7,11 @@
    :synopsis: Routines and objects for manipulating the Windows registry.
 .. sectionauthor:: Mark Hammond <MarkH at ActiveState.com>
 
+.. note::
+   The :mod:`_winreg` module has been renamed to :mod:`winreg` in Python 3.0.
+   The :term:`2to3` tool will automatically adapt imports when converting your
+   sources to 3.0.
+
 
 .. versionadded:: 2.0
 

Modified: python/branches/tlee-ast-optimize/Doc/library/basehttpserver.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/basehttpserver.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/basehttpserver.rst	Sun May 25 10:45:18 2008
@@ -21,7 +21,7 @@
 functioning Web servers. See the :mod:`SimpleHTTPServer` and
 :mod:`CGIHTTPServer` modules.
 
-The first class, :class:`HTTPServer`, is a :class:`socketserver.TCPServer`
+The first class, :class:`HTTPServer`, is a :class:`SocketServer.TCPServer`
 subclass.  It creates and listens at the HTTP socket, dispatching the requests
 to a handler.  Code to create and run the server looks like this::
 

Modified: python/branches/tlee-ast-optimize/Doc/library/bsddb.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/bsddb.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/bsddb.rst	Sun May 25 10:45:18 2008
@@ -15,15 +15,15 @@
 :func:`marshal.dumps` or  :func:`pickle.dumps`.
 
 The :mod:`bsddb` module requires a Berkeley DB library version from 3.3 thru
-4.5.
+4.7.
 
 
 .. seealso::
 
-   http://pybsddb.sourceforge.net/
+   http://www.jcea.es/programacion/pybsddb.htm
       The website with documentation for the :mod:`bsddb.db` Python Berkeley DB
       interface that closely mirrors the object oriented interface provided in
-      Berkeley DB 3 and 4.
+      Berkeley DB 4.x itself.
 
    http://www.oracle.com/database/berkeley-db/
       The Berkeley DB library.

Modified: python/branches/tlee-ast-optimize/Doc/library/collections.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/collections.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/collections.rst	Sun May 25 10:45:18 2008
@@ -122,7 +122,7 @@
    Since some set operations create new sets, the default mixin methods need
    a way to create new instances from an iterable. The class constructor is
    assumed to have a signature in the form ``ClassName(iterable)``.
-   That assumption is factored-out to a singleinternal classmethod called
+   That assumption is factored-out to an internal classmethod called
    :meth:`_from_iterable` which calls ``cls(iterable)`` to produce a new set.
    If the :class:`Set` mixin is being used in a class with a different
    constructor signature, you will need to override :meth:`from_iterable`

Modified: python/branches/tlee-ast-optimize/Doc/library/configparser.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/configparser.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/configparser.rst	Sun May 25 10:45:18 2008
@@ -1,10 +1,7 @@
-:mod:`configparser` --- Configuration file parser
+:mod:`ConfigParser` --- Configuration file parser
 =================================================
 
 .. module:: ConfigParser
-   :synopsis: Old name for the configparser module.
-
-.. module:: configparser
    :synopsis: Configuration file parser.
 
 .. moduleauthor:: Ken Manheimer <klm at zope.com>
@@ -13,9 +10,10 @@
 .. sectionauthor:: Christopher G. Petrilli <petrilli at amber.org>
 
 .. note::
-   The :mod:`ConfigParser` module has been renamed to :mod:`configparser` in
-   Python 3.0.  It is importable under both names in Python 2.6 and the rest of
-   the 2.x series.
+
+   The :mod:`ConfigParser` module has been renamed to `configparser` in Python
+   3.0.  The :term:`2to3` tool will automatically adapt imports when converting
+   your sources to 3.0.
 
 .. index::
    pair: .ini; file
@@ -233,9 +231,9 @@
    load the required file or files using :meth:`readfp` before calling :meth:`read`
    for any optional files::
 
-      import configparser, os
+      import ConfigParser, os
 
-      config = configparser.ConfigParser()
+      config = ConfigParser.ConfigParser()
       config.readfp(open('defaults.cfg'))
       config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')])
 
@@ -375,10 +373,10 @@
 
 An example of writing to a configuration file::
 
-   import configparser
+   import ConfigParser
+
+   config = ConfigParser.RawConfigParser()
 
-   config = configparser.RawConfigParser()
-   
    # When adding sections or items, add them in the reverse order of
    # how you want them to be displayed in the actual file.
    # In addition, please note that using RawConfigParser's and the raw
@@ -393,16 +391,16 @@
    config.set('Section1', 'baz', 'fun')
    config.set('Section1', 'bar', 'Python')
    config.set('Section1', 'foo', '%(bar)s is %(baz)s!')
-   
+
    # Writing our configuration file to 'example.cfg'
    with open('example.cfg', 'wb') as configfile:
        config.write(configfile)
 
 An example of reading the configuration file again::
 
-   import configparser
+   import ConfigParser
 
-   config = configparser.RawConfigParser()
+   config = ConfigParser.RawConfigParser()
    config.read('example.cfg')
 
    # getfloat() raises an exception if the value is not a float
@@ -419,9 +417,9 @@
 To get interpolation, you will need to use a :class:`ConfigParser` or
 :class:`SafeConfigParser`::
 
-   import configparser
+   import ConfigParser
 
-   config = configparser.ConfigParser()
+   config = ConfigParser.ConfigParser()
    config.read('example.cfg')
 
    # Set the third, optional argument of get to 1 if you wish to use raw mode.
@@ -433,15 +431,15 @@
    print config.get('Section1', 'foo', 0, {'bar': 'Documentation',
                                            'baz': 'evil'})
 
-Defaults are available in all three types of ConfigParsers. They are used in 
+Defaults are available in all three types of ConfigParsers. They are used in
 interpolation if an option used is not defined elsewhere. ::
 
-   import configparser
+   import ConfigParser
 
    # New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each
-   config = configparser.SafeConfigParser({'bar': 'Life', 'baz': 'hard'})
+   config = ConfigParser.SafeConfigParser({'bar': 'Life', 'baz': 'hard'})
    config.read('example.cfg')
-   
+
    print config.get('Section1', 'foo') # -> "Python is fun!"
    config.remove_option('Section1', 'bar')
    config.remove_option('Section1', 'baz')
@@ -452,7 +450,7 @@
    def opt_move(config, section1, section2, option):
        try:
            config.set(section2, option, config.get(section1, option, 1))
-       except configparser.NoSectionError:
+       except ConfigParser.NoSectionError:
            # Create non-existent section
            config.add_section(section2)
            opt_move(config, section1, section2, option)

Modified: python/branches/tlee-ast-optimize/Doc/library/datatypes.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/datatypes.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/datatypes.rst	Sun May 25 10:45:18 2008
@@ -36,4 +36,4 @@
    new.rst
    copy.rst
    pprint.rst
-   reprlib.rst
+   repr.rst

Modified: python/branches/tlee-ast-optimize/Doc/library/logging.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/logging.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/logging.rst	Sun May 25 10:45:18 2008
@@ -1299,17 +1299,17 @@
    logger2.warning('Jail zesty vixen who grabbed pay from quack.')
    logger2.error('The five boxing wizards jump quickly.')
 
-At the receiving end, you can set up a receiver using the :mod:`socketserver`
+At the receiving end, you can set up a receiver using the :mod:`SocketServer`
 module. Here is a basic working example::
 
    import cPickle
    import logging
    import logging.handlers
-   import socketserver
+   import SocketServer
    import struct
 
 
-   class LogRecordStreamHandler(socketserver.StreamRequestHandler):
+   class LogRecordStreamHandler(SocketServer.StreamRequestHandler):
        """Handler for a streaming logging request.
 
        This basically logs the record using whatever logging policy is
@@ -1351,7 +1351,7 @@
            # cycles and network bandwidth!
            logger.handle(record)
 
-   class LogRecordSocketReceiver(socketserver.ThreadingTCPServer):
+   class LogRecordSocketReceiver(SocketServer.ThreadingTCPServer):
        """simple TCP socket-based logging receiver suitable for testing.
        """
 
@@ -1360,7 +1360,7 @@
        def __init__(self, host='localhost',
                     port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,
                     handler=LogRecordStreamHandler):
-           socketserver.ThreadingTCPServer.__init__(self, (host, port), handler)
+           SocketServer.ThreadingTCPServer.__init__(self, (host, port), handler)
            self.abort = 0
            self.timeout = 1
            self.logname = None
@@ -2240,12 +2240,12 @@
 
 .. function:: fileConfig(fname[, defaults])
 
-   Reads the logging configuration from a :mod:`configparser`\-format file named
-   *fname*.  This function can be called several times from an application,
-   allowing an end user the ability to select from various pre-canned
-   configurations (if the developer provides a mechanism to present the choices
-   and load the chosen configuration). Defaults to be passed to the ConfigParser
-   can be specified in the *defaults* argument.
+   Reads the logging configuration from a ConfigParser-format file named *fname*.
+   This function can be called several times from an application, allowing an end
+   user the ability to select from various pre-canned configurations (if the
+   developer provides a mechanism to present the choices and load the chosen
+   configuration). Defaults to be passed to ConfigParser can be specified in the
+   *defaults* argument.
 
 
 .. function:: listen([port])
@@ -2275,20 +2275,18 @@
 Configuration file format
 ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-The configuration file format understood by :func:`fileConfig` is
-based on :mod:`configparser` functionality. The file must contain
-sections called ``[loggers]``, ``[handlers]`` and ``[formatters]``
-which identify by name the entities of each type which are defined in
-the file. For each such entity, there is a separate section which
-identified how that entity is configured. Thus, for a logger named
-``log01`` in the ``[loggers]`` section, the relevant configuration
-details are held in a section ``[logger_log01]``. Similarly, a handler
-called ``hand01`` in the ``[handlers]`` section will have its
-configuration held in a section called ``[handler_hand01]``, while a
-formatter called ``form01`` in the ``[formatters]`` section will have
-its configuration specified in a section called
-``[formatter_form01]``. The root logger configuration must be
-specified in a section called ``[logger_root]``.
+The configuration file format understood by :func:`fileConfig` is based on
+ConfigParser functionality. The file must contain sections called ``[loggers]``,
+``[handlers]`` and ``[formatters]`` which identify by name the entities of each
+type which are defined in the file. For each such entity, there is a separate
+section which identified how that entity is configured. Thus, for a logger named
+``log01`` in the ``[loggers]`` section, the relevant configuration details are
+held in a section ``[logger_log01]``. Similarly, a handler called ``hand01`` in
+the ``[handlers]`` section will have its configuration held in a section called
+``[handler_hand01]``, while a formatter called ``form01`` in the
+``[formatters]`` section will have its configuration specified in a section
+called ``[formatter_form01]``. The root logger configuration must be specified
+in a section called ``[logger_root]``.
 
 Examples of these sections in the file are given below. ::
 

Modified: python/branches/tlee-ast-optimize/Doc/library/math.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/math.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/math.rst	Sun May 25 10:45:18 2008
@@ -103,6 +103,12 @@
    Return the fractional and integer parts of *x*.  Both results carry the sign of
    *x*, and both are floats.
 
+.. function:: sum(iterable)
+
+   Return an accurate floating point sum of values in the iterable.  Avoids
+   loss of precision by tracking multiple intermediate partial sums.  The
+   algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the
+   typical case where the rounding mode is half-even.
 
 .. function:: trunc(x)
 

Modified: python/branches/tlee-ast-optimize/Doc/library/queue.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/queue.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/queue.rst	Sun May 25 10:45:18 2008
@@ -2,17 +2,15 @@
 ===========================================
 
 .. module:: Queue
-   :synopsis: Old name for the queue module.
-
-.. module:: queue
    :synopsis: A synchronized queue class.
 
 .. note::
-   The :mod:`Queue` module has been renamed to :mod:`queue` in Python 3.0.  It
-   is importable under both names in Python 2.6 and the rest of the 2.x series.
+   The :mod:`Queue` module has been renamed to :mod:`queue` in Python 3.0.  The
+   :term:`2to3` tool will automatically adapt imports when converting your
+   sources to 3.0.
 
 
-The :mod:`queue` module implements multi-producer, multi-consumer queues.
+The :mod:`Queue` module implements multi-producer, multi-consumer queues.
 It is especially useful in threaded programming when information must be
 exchanged safely between multiple threads.  The :class:`Queue` class in this
 module implements all the required locking semantics.  It depends on the
@@ -26,7 +24,7 @@
 the entries are kept sorted (using the :mod:`heapq` module) and the
 lowest valued entry is retrieved first.
 
-The :mod:`queue` module defines the following classes and exceptions:
+The :mod:`Queue` module defines the following classes and exceptions:
 
 .. class:: Queue(maxsize)
 
@@ -75,7 +73,7 @@
 -------------
 
 Queue objects (:class:`Queue`, :class:`LifoQueue`, or :class:`PriorityQueue`)
-provide the public methods described below.  
+provide the public methods described below.
 
 
 .. method:: Queue.qsize()
@@ -170,20 +168,20 @@
 
 Example of how to wait for enqueued tasks to be completed::
 
-   def worker(): 
-       while True: 
-           item = q.get() 
-           do_work(item) 
-           q.task_done() 
+   def worker():
+       while True:
+           item = q.get()
+           do_work(item)
+           q.task_done()
 
-   q = Queue() 
-   for i in range(num_worker_threads): 
+   q = Queue()
+   for i in range(num_worker_threads):
         t = Thread(target=worker)
         t.setDaemon(True)
-        t.start() 
+        t.start()
 
    for item in source():
-       q.put(item) 
+       q.put(item)
 
    q.join()       # block until all tasks are done
 

Deleted: python/branches/tlee-ast-optimize/Doc/library/reprlib.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/reprlib.rst	Sun May 25 10:45:18 2008
+++ (empty file)
@@ -1,143 +0,0 @@
-:mod:`reprlib` --- Alternate :func:`repr` implementation
-========================================================
-
-.. module:: repr
-   :synopsis: Old name for the reprlib module.
-
-.. module:: reprlib
-   :synopsis: Alternate repr() implementation with size limits.
-.. sectionauthor:: Fred L. Drake, Jr. <fdrake at acm.org>
-
-.. note::
-   The :mod:`repr` module has been renamed to :mod:`reprlib` in
-   Python 3.0.  It is importable under both names in Python 2.6
-   and the rest of the 2.x series.
-
-
-The :mod:`reprlib` module provides a means for producing object representations
-with limits on the size of the resulting strings. This is used in the Python
-debugger and may be useful in other contexts as well.
-
-This module provides a class, an instance, and a function:
-
-
-.. class:: Repr()
-
-   Class which provides formatting services useful in implementing functions
-   similar to the built-in :func:`repr`; size limits for  different object types
-   are added to avoid the generation of representations which are excessively long.
-
-
-.. data:: aRepr
-
-   This is an instance of :class:`Repr` which is used to provide the :func:`repr`
-   function described below.  Changing the attributes of this object will affect
-   the size limits used by :func:`repr` and the Python debugger.
-
-
-.. function:: repr(obj)
-
-   This is the :meth:`repr` method of ``aRepr``.  It returns a string similar to
-   that returned by the built-in function of the same  name, but with limits on
-   most sizes.
-
-
-.. _repr-objects:
-
-Repr Objects
-------------
-
-:class:`Repr` instances provide several members which can be used to provide
-size limits for the representations of different object types,  and methods
-which format specific object types.
-
-
-.. attribute:: Repr.maxlevel
-
-   Depth limit on the creation of recursive representations.  The default is ``6``.
-
-
-.. attribute:: Repr.maxdict
-               Repr.maxlist
-               Repr.maxtuple
-               Repr.maxset
-               Repr.maxfrozenset
-               Repr.maxdeque
-               Repr.maxarray
-
-   Limits on the number of entries represented for the named object type.  The
-   default is ``4`` for :attr:`maxdict`, ``5`` for :attr:`maxarray`, and  ``6`` for
-   the others.
-
-   .. versionadded:: 2.4
-      :attr:`maxset`, :attr:`maxfrozenset`, and :attr:`set`.
-
-
-.. attribute:: Repr.maxlong
-
-   Maximum number of characters in the representation for a long integer.  Digits
-   are dropped from the middle.  The default is ``40``.
-
-
-.. attribute:: Repr.maxstring
-
-   Limit on the number of characters in the representation of the string.  Note
-   that the "normal" representation of the string is used as the character source:
-   if escape sequences are needed in the representation, these may be mangled when
-   the representation is shortened.  The default is ``30``.
-
-
-.. attribute:: Repr.maxother
-
-   This limit is used to control the size of object types for which no specific
-   formatting method is available on the :class:`Repr` object. It is applied in a
-   similar manner as :attr:`maxstring`.  The default is ``20``.
-
-
-.. method:: Repr.repr(obj)
-
-   The equivalent to the built-in :func:`repr` that uses the formatting imposed by
-   the instance.
-
-
-.. method:: Repr.repr1(obj, level)
-
-   Recursive implementation used by :meth:`repr`.  This uses the type of *obj* to
-   determine which formatting method to call, passing it *obj* and *level*.  The
-   type-specific methods should call :meth:`repr1` to perform recursive formatting,
-   with ``level - 1`` for the value of *level* in the recursive  call.
-
-
-.. method:: Repr.repr_TYPE(obj, level)
-   :noindex:
-
-   Formatting methods for specific types are implemented as methods with a name
-   based on the type name.  In the method name, **TYPE** is replaced by
-   ``string.join(string.split(type(obj).__name__, '_'))``. Dispatch to these
-   methods is handled by :meth:`repr1`. Type-specific methods which need to
-   recursively format a value should call ``self.repr1(subobj, level - 1)``.
-
-
-.. _subclassing-reprs:
-
-Subclassing Repr Objects
-------------------------
-
-The use of dynamic dispatching by :meth:`Repr.repr1` allows subclasses of
-:class:`Repr` to add support for additional built-in object types or to modify
-the handling of types already supported. This example shows how special support
-for file objects could be added::
-
-   import repr
-   import sys
-
-   class MyRepr(repr.Repr):
-       def repr_file(self, obj, level):
-           if obj.name in ['<stdin>', '<stdout>', '<stderr>']:
-               return obj.name
-           else:
-               return `obj`
-
-   aRepr = MyRepr()
-   print aRepr.repr(sys.stdin)          # prints '<stdin>'
-

Modified: python/branches/tlee-ast-optimize/Doc/library/shlex.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/shlex.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/shlex.rst	Sun May 25 10:45:18 2008
@@ -63,7 +63,7 @@
 
 .. seealso::
 
-   Module :mod:`configparser`
+   Module :mod:`ConfigParser`
       Parser for configuration files similar to the Windows :file:`.ini` files.
 
 

Modified: python/branches/tlee-ast-optimize/Doc/library/simplexmlrpcserver.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/simplexmlrpcserver.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/simplexmlrpcserver.rst	Sun May 25 10:45:18 2008
@@ -22,7 +22,7 @@
    functions that can be called by the XML-RPC protocol.  The *requestHandler*
    parameter should be a factory for request handler instances; it defaults to
    :class:`SimpleXMLRPCRequestHandler`.  The *addr* and *requestHandler* parameters
-   are passed to the :class:`socketserver.TCPServer` constructor.  If *logRequests*
+   are passed to the :class:`SocketServer.TCPServer` constructor.  If *logRequests*
    is true (the default), requests will be logged; setting this parameter to false
    will turn off logging.   The *allow_none* and *encoding* parameters are passed
    on to  :mod:`xmlrpclib` and control the XML-RPC responses that will be returned
@@ -63,7 +63,7 @@
 --------------------------
 
 The :class:`SimpleXMLRPCServer` class is based on
-:class:`socketserver.TCPServer` and provides a means of creating simple, stand
+:class:`SocketServer.TCPServer` and provides a means of creating simple, stand
 alone XML-RPC servers.
 
 

Modified: python/branches/tlee-ast-optimize/Doc/library/socket.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/socket.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/socket.rst	Sun May 25 10:45:18 2008
@@ -481,7 +481,7 @@
 
 .. seealso::
 
-   Module :mod:`socketserver`
+   Module :mod:`SocketServer`
       Classes that simplify writing network servers.
 
 

Modified: python/branches/tlee-ast-optimize/Doc/library/socketserver.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/socketserver.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/socketserver.rst	Sun May 25 10:45:18 2008
@@ -1,19 +1,18 @@
-:mod:`socketserver` --- A framework for network servers
+
+:mod:`SocketServer` --- A framework for network servers
 =======================================================
 
 .. module:: SocketServer
-   :synopsis: Old name for the socketserver module.
-
-.. module:: socketserver
    :synopsis: A framework for network servers.
 
 .. note::
-   The :mod:`SocketServer` module has been renamed to :mod:`socketserver` in
-   Python 3.0.  It is importable under both names in Python 2.6 and the rest of
-   the 2.x series.
+
+   The :mod:`SocketServer` module has been renamed to `socketserver` in Python
+   3.0.  The :term:`2to3` tool will automatically adapt imports when converting
+   your sources to 3.0.
 
 
-The :mod:`socketserver` module simplifies the task of writing network servers.
+The :mod:`SocketServer` module simplifies the task of writing network servers.
 
 There are four basic server classes: :class:`TCPServer` uses the Internet TCP
 protocol, which provides for continuous streams of data between the client and
@@ -220,7 +219,7 @@
 users of the server object.
 
 .. XXX should the default implementations of these be documented, or should
-   it be assumed that the user will look at socketserver.py?
+   it be assumed that the user will look at SocketServer.py?
 
 
 .. function:: finish_request()
@@ -325,14 +324,14 @@
 Examples
 --------
 
-:class:`socketserver.TCPServer` Example
+:class:`SocketServer.TCPServer` Example
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 This is the server side::
 
-   import socketserver
+   import SocketServer
 
-   class MyTCPHandler(socketserver.BaseRequestHandler):
+   class MyTCPHandler(SocketServer.BaseRequestHandler):
        """
        The RequestHandler class for our server.
 
@@ -353,7 +352,7 @@
        HOST, PORT = "localhost", 9999
 
        # Create the server, binding to localhost on port 9999
-       server = socketserver.TCPServer((HOST, PORT), MyTCPHandler)
+       server = SocketServer.TCPServer((HOST, PORT), MyTCPHandler)
 
        # Activate the server; this will keep running until you
        # interrupt the program with Ctrl-C
@@ -362,7 +361,7 @@
 An alternative request handler class that makes use of streams (file-like
 objects that simplify communication by providing the standard file interface)::
 
-   class MyTCPHandler(socketserver.StreamRequestHandler):
+   class MyTCPHandler(SocketServer.StreamRequestHandler):
 
        def handle(self):
            # self.rfile is a file-like object created by the handler;
@@ -423,14 +422,14 @@
    Received: PYTHON IS NICE
 
 
-:class:`socketserver.UDPServer` Example
+:class:`SocketServer.UDPServer` Example
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 This is the server side::
 
-   import socketserver
+   import SocketServer
 
-   class MyUDPHandler(socketserver.BaseRequestHandler):
+   class MyUDPHandler(SocketServer.BaseRequestHandler):
        """
        This class works similar to the TCP handler class, except that
        self.request consists of a pair of data and client socket, and since
@@ -447,7 +446,7 @@
 
    if __name__ == "__main__":
       HOST, PORT = "localhost", 9999
-      server = socketserver.UDPServer((HOST, PORT), BaseUDPRequestHandler)
+      server = SocketServer.UDPServer((HOST, PORT), BaseUDPRequestHandler)
       server.serve_forever()
 
 This is the client side::
@@ -482,9 +481,9 @@
 
    import socket
    import threading
-   import socketserver
+   import SocketServer
 
-   class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
+   class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):
 
        def handle(self):
            data = self.request.recv(1024)
@@ -492,7 +491,7 @@
            response = "%s: %s" % (cur_thread.getName(), data)
            self.request.send(response)
 
-   class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
+   class ThreadedTCPServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
        pass
 
    def client(ip, port, message):

Modified: python/branches/tlee-ast-optimize/Doc/library/struct.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/struct.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/struct.rst	Sun May 25 10:45:18 2008
@@ -233,6 +233,16 @@
 native size and alignment are in effect; standard size and alignment does not
 enforce any alignment.
 
+Unpacked fields can be named by assigning them to variables or by wrapping
+the result in a named tuple::
+
+    >>> record = 'raymond   \x32\x12\x08\x01\x08'
+    >>> name, serialnum, school, gradelevel = unpack('<10sHHb', record)
+
+    >>> from collections import namedtuple
+    >>> Student = namedtuple('Student', 'name serialnum school gradelevel')
+    >>> Student._make(unpack('<10sHHb', s))
+    Student(name='raymond   ', serialnum=4658, school=264, gradelevel=8)
 
 .. seealso::
 

Modified: python/branches/tlee-ast-optimize/Doc/library/threading.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/library/threading.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/library/threading.rst	Sun May 25 10:45:18 2008
@@ -8,7 +8,7 @@
 
 This module constructs higher-level threading interfaces on top of the  lower
 level :mod:`thread` module.
-See also the :mod:`mutex` and :mod:`queue` modules.
+See also the :mod:`mutex` and :mod:`Queue` modules.
 
 The :mod:`dummy_threading` module is provided for situations where
 :mod:`threading` cannot be used because :mod:`thread` is missing.

Modified: python/branches/tlee-ast-optimize/Doc/reference/expressions.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/reference/expressions.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/reference/expressions.rst	Sun May 25 10:45:18 2008
@@ -1318,10 +1318,9 @@
 
 .. rubric:: Footnotes
 
-.. [#] In Python 2.3, a list comprehension "leaks" the control variables of each
-   ``for`` it contains into the containing scope.  However, this behavior is
-   deprecated, and relying on it will not work once this bug is fixed in a future
-   release.
+.. [#] In Python 2.3 and later releases, a list comprehension "leaks" the control
+   variables of each ``for`` it contains into the containing scope.  However, this 
+   behavior is deprecated, and relying on it will not work in Python 3.0
 
 .. [#] While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be
    true numerically due to roundoff.  For example, and assuming a platform on which

Modified: python/branches/tlee-ast-optimize/Doc/reference/simple_stmts.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/reference/simple_stmts.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/reference/simple_stmts.rst	Sun May 25 10:45:18 2008
@@ -534,7 +534,7 @@
 If no expressions are present, :keyword:`raise` re-raises the last exception
 that was active in the current scope.  If no exception is active in the current
 scope, a :exc:`TypeError` exception is raised indicating that this is an error
-(if running under IDLE, a :exc:`queue.Empty` exception is raised instead).
+(if running under IDLE, a :exc:`Queue.Empty` exception is raised instead).
 
 Otherwise, :keyword:`raise` evaluates the expressions to get three objects,
 using ``None`` as the value of omitted expressions.  The first two objects are

Modified: python/branches/tlee-ast-optimize/Doc/tutorial/stdlib2.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/tutorial/stdlib2.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/tutorial/stdlib2.rst	Sun May 25 10:45:18 2008
@@ -13,11 +13,11 @@
 Output Formatting
 =================
 
-The :mod:`reprlib` module provides a version of :func:`repr` customized for
+The :mod:`repr` module provides a version of :func:`repr` customized for
 abbreviated displays of large or deeply nested containers::
 
-   >>> import reprlib
-   >>> reprlib.repr(set('supercalifragilisticexpialidocious'))
+   >>> import repr
+   >>> repr.repr(set('supercalifragilisticexpialidocious'))
    "set(['a', 'c', 'd', 'e', 'f', 'g', ...])"
 
 The :mod:`pprint` module offers more sophisticated control over printing both
@@ -174,7 +174,7 @@
 
    class AsyncZip(threading.Thread):
        def __init__(self, infile, outfile):
-           threading.Thread.__init__(self)        
+           threading.Thread.__init__(self)
            self.infile = infile
            self.outfile = outfile
        def run(self):
@@ -198,9 +198,9 @@
 While those tools are powerful, minor design errors can result in problems that
 are difficult to reproduce.  So, the preferred approach to task coordination is
 to concentrate all access to a resource in a single thread and then use the
-:mod:`queue` module to feed that thread with requests from other threads.
-Applications using :class:`Queue` objects for inter-thread communication and
-coordination are easier to design, more readable, and more reliable.
+:mod:`Queue` module to feed that thread with requests from other threads.
+Applications using :class:`Queue.Queue` objects for inter-thread communication
+and coordination are easier to design, more readable, and more reliable.
 
 
 .. _tut-logging:
@@ -358,11 +358,11 @@
 results in decimal floating point and binary floating point. The difference
 becomes significant if the results are rounded to the nearest cent::
 
-   >>> from decimal import *       
+   >>> from decimal import *
    >>> Decimal('0.70') * Decimal('1.05')
    Decimal("0.7350")
    >>> .70 * 1.05
-   0.73499999999999999       
+   0.73499999999999999
 
 The :class:`Decimal` result keeps a trailing zero, automatically inferring four
 place significance from multiplicands with two place significance.  Decimal
@@ -380,7 +380,7 @@
    >>> sum([Decimal('0.1')]*10) == Decimal('1.0')
    True
    >>> sum([0.1]*10) == 1.0
-   False      
+   False
 
 The :mod:`decimal` module provides arithmetic with as much precision as needed::
 

Modified: python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst
==============================================================================
--- python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst	(original)
+++ python/branches/tlee-ast-optimize/Doc/whatsnew/2.6.rst	Sun May 25 10:45:18 2008
@@ -1,5 +1,5 @@
 ****************************
-  What's New in Python 2.6  
+  What's New in Python 2.6
 ****************************
 
 .. XXX add trademark info for Apple, Microsoft, SourceForge.
@@ -10,42 +10,42 @@
 
 .. $Id: whatsnew26.tex 55746 2007-06-02 18:33:53Z neal.norwitz $
    Rules for maintenance:
-   
+
    * Anyone can add text to this document.  Do not spend very much time
    on the wording of your changes, because your text will probably
    get rewritten to some degree.
-   
+
    * The maintainer will go through Misc/NEWS periodically and add
    changes; it's therefore more important to add your changes to
    Misc/NEWS than to this file.
-   
+
    * This is not a complete list of every single change; completeness
    is the purpose of Misc/NEWS.  Some changes I consider too small
    or esoteric to include.  If such a change is added to the text,
    I'll just remove it.  (This is another reason you shouldn't spend
    too much time on writing your addition.)
-   
+
    * If you want to draw your new text to the attention of the
    maintainer, add 'XXX' to the beginning of the paragraph or
    section.
-   
+
    * It's OK to just add a fragmentary note about a change.  For
    example: "XXX Describe the transmogrify() function added to the
    socket module."  The maintainer will research the change and
    write the necessary text.
-   
+
    * You can comment out your additions if you like, but it's not
    necessary (especially when a final release is some months away).
-   
+
    * Credit the author of a patch or bugfix.   Just the name is
    sufficient; the e-mail address isn't necessary.
-   
+
    * It's helpful to add the bug/patch number in a parenthetical comment.
-   
+
    XXX Describe the transmogrify() function added to the socket
    module.
    (Contributed by P.Y. Developer; :issue:`12345`.)
-   
+
    This saves the maintainer some effort going through the SVN logs
    when researching a change.
 
@@ -74,7 +74,7 @@
 ================
 
 The development cycle for Python 2.6 also saw the release of the first
-alphas of Python 3.0, and the development of 3.0 has influenced 
+alphas of Python 3.0, and the development of 3.0 has influenced
 a number of features in 2.6.
 
 Python 3.0 is a far-ranging redesign of Python that breaks
@@ -83,7 +83,7 @@
 Python 3.0.  However, not all the changes in 3.0 necessarily break
 compatibility.  In cases where new features won't cause existing code
 to break, they've been backported to 2.6 and are described in this
-document in the appropriate place.  Some of the 3.0-derived features 
+document in the appropriate place.  Some of the 3.0-derived features
 are:
 
 * A :meth:`__complex__` method for converting objects to a complex number.
@@ -94,7 +94,7 @@
 A new command-line switch, :option:`-3`, enables warnings
 about features that will be removed in Python 3.0.  You can run code
 with this switch to see how much work will be necessary to port
-code to 3.0.  The value of this switch is available 
+code to 3.0.  The value of this switch is available
 to Python code as the boolean variable :data:`sys.py3kwarning`,
 and to C extension code as :cdata:`Py_Py3kWarningFlag`.
 
@@ -116,9 +116,9 @@
 Development Changes
 ==================================================
 
-While 2.6 was being developed, the Python development process 
-underwent two significant changes: the developer group 
-switched from SourceForge's issue tracker to a customized 
+While 2.6 was being developed, the Python development process
+underwent two significant changes: the developer group
+switched from SourceForge's issue tracker to a customized
 Roundup installation, and the documentation was converted from
 LaTeX to reStructuredText.
 
@@ -135,34 +135,34 @@
 therefore posted a call for issue trackers, asking volunteers to set
 up different products and import some of the bugs and patches from
 SourceForge.  Four different trackers were examined: Atlassian's `Jira
-<http://www.atlassian.com/software/jira/>`__, 
-`Launchpad <http://www.launchpad.net>`__, 
-`Roundup <http://roundup.sourceforge.net/>`__, and 
-`Trac <http://trac.edgewall.org/>`__.  
+<http://www.atlassian.com/software/jira/>`__,
+`Launchpad <http://www.launchpad.net>`__,
+`Roundup <http://roundup.sourceforge.net/>`__, and
+`Trac <http://trac.edgewall.org/>`__.
 The committee eventually settled on Jira
 and Roundup as the two candidates.  Jira is a commercial product that
-offers a no-cost hosted instance to free-software projects; Roundup 
+offers a no-cost hosted instance to free-software projects; Roundup
 is an open-source project that requires volunteers
 to administer it and a server to host it.
 
 After posting a call for volunteers, a new Roundup installation was
 set up at http://bugs.python.org.  One installation of Roundup can
 host multiple trackers, and this server now also hosts issue trackers
-for Jython and for the Python web site.  It will surely find 
+for Jython and for the Python web site.  It will surely find
 other uses in the future.  Where possible,
 this edition of "What's New in Python" links to the bug/patch
 item for each change.
 
-Hosting is kindly provided by 
-`Upfront Systems <http://www.upfrontsystems.co.za/>`__ 
+Hosting is kindly provided by
+`Upfront Systems <http://www.upfrontsystems.co.za/>`__
 of Stellenbosch, South Africa.  Martin von Loewis put a
 lot of effort into importing existing bugs and patches from
-SourceForge; his scripts for this import operation are at 
+SourceForge; his scripts for this import operation are at
 http://svn.python.org/view/tracker/importer/.
 
 .. seealso::
 
-  http://bugs.python.org 
+  http://bugs.python.org
     The Python bug tracker.
 
   http://bugs.jython.org:
@@ -189,8 +189,8 @@
 Unfortunately, converting LaTeX to HTML is fairly complicated, and
 Fred L. Drake Jr., the Python documentation editor for many years,
 spent a lot of time wrestling the conversion process into shape.
-Occasionally people would suggest converting the documentation into 
-SGML or, later, XML, but performing a good conversion is a major task 
+Occasionally people would suggest converting the documentation into
+SGML or, later, XML, but performing a good conversion is a major task
 and no one pursued the task to completion.
 
 During the 2.6 development cycle, Georg Brandl put a substantial
@@ -222,7 +222,7 @@
 statement an optional feature, to be enabled by a ``from __future__
 import with_statement`` directive.  In 2.6 the statement no longer needs to
 be specially enabled; this means that :keyword:`with` is now always a
-keyword.  The rest of this section is a copy of the corresponding 
+keyword.  The rest of this section is a copy of the corresponding
 section from "What's New in Python 2.5" document; if you read
 it back when Python 2.5 came out, you can skip the rest of this
 section.
@@ -518,7 +518,7 @@
    :pep:`370` - Per-user ``site-packages`` Directory
      PEP written and implemented by Christian Heimes.
 
-  
+
 .. ======================================================================
 
 .. _pep-3101:
@@ -539,7 +539,7 @@
 
      # Use the named keyword arguments
      uid = 'root'
-     
+
      'User ID: {uid}   Last seen: {last_login}'.format(uid='root',
             last_login = '5 Mar 2008 07:20') ->
        'User ID: root   Last seen: 5 Mar 2008 07:20'
@@ -548,8 +548,8 @@
 
      format("Empty dict: {{}}") -> "Empty dict: {}"
 
-Field names can be integers indicating positional arguments, such as 
-``{0}``, ``{1}``, etc. or names of keyword arguments.  You can also 
+Field names can be integers indicating positional arguments, such as
+``{0}``, ``{1}``, etc. or names of keyword arguments.  You can also
 supply compound field names that read attributes or access dictionary keys::
 
     import sys
@@ -602,7 +602,7 @@
 =                (For numeric types only) Pad after the sign.
 ================ ============================================
 
-Format specifiers can also include a presentation type, which 
+Format specifiers can also include a presentation type, which
 controls how the value is formatted.  For example, floating-point numbers
 can be formatted as a general number or in exponential notation:
 
@@ -660,10 +660,10 @@
 =====================================================
 
 The ``print`` statement becomes the :func:`print` function in Python 3.0.
-Making :func:`print` a function makes it easier to change 
-by doing 'def print(...)' or importing a new function from somewhere else. 
+Making :func:`print` a function makes it easier to change
+by doing 'def print(...)' or importing a new function from somewhere else.
 
-Python 2.6 has a ``__future__`` import that removes ``print`` as language 
+Python 2.6 has a ``__future__`` import that removes ``print`` as language
 syntax, letting you use the functional form instead.  For example::
 
     from __future__ import print_function
@@ -677,7 +677,7 @@
 
  * **args**: positional arguments whose values will be printed out.
  * **sep**: the separator, which will be printed between arguments.
- * **end**: the ending text, which will be printed after all of the 
+ * **end**: the ending text, which will be printed after all of the
    arguments have been output.
  * **file**: the file object to which the output will be sent.
 
@@ -693,7 +693,7 @@
 PEP 3110: Exception-Handling Changes
 =====================================================
 
-One error that Python programmers occasionally make 
+One error that Python programmers occasionally make
 is the following::
 
     try:
@@ -701,11 +701,11 @@
     except TypeError, ValueError:
         ...
 
-The author is probably trying to catch both 
+The author is probably trying to catch both
 :exc:`TypeError` and :exc:`ValueError` exceptions, but this code
-actually does something different: it will catch 
+actually does something different: it will catch
 :exc:`TypeError` and bind the resulting exception object
-to the local name ``"ValueError"``.  The correct code 
+to the local name ``"ValueError"``.  The correct code
 would have specified a tuple::
 
     try:
@@ -718,7 +718,7 @@
 node that's a tuple.
 
 Python 3.0 changes the syntax to make this unambiguous by replacing
-the comma with the word "as".  To catch an exception and store the 
+the comma with the word "as".  To catch an exception and store the
 exception object in the variable ``exc``, you must write::
 
     try:
@@ -744,13 +744,13 @@
 =====================================================
 
 Python 3.0 adopts Unicode as the language's fundamental string type, and
-denotes 8-bit literals differently, either as ``b'string'`` 
-or using a :class:`bytes` constructor.  For future compatibility, 
+denotes 8-bit literals differently, either as ``b'string'``
+or using a :class:`bytes` constructor.  For future compatibility,
 Python 2.6 adds :class:`bytes` as a synonym for the :class:`str` type,
 and it also supports the ``b''`` notation.
 
 There's also a ``__future__`` import that causes all string literals
-to become Unicode strings.  This means that ``\u`` escape sequences 
+to become Unicode strings.  This means that ``\u`` escape sequences
 can be used to include Unicode characters::
 
 
@@ -786,7 +786,7 @@
 the :mod:`io` module:
 
 * :class:`RawIOBase`: defines raw I/O operations: :meth:`read`,
-  :meth:`readinto`, 
+  :meth:`readinto`,
   :meth:`write`, :meth:`seek`, :meth:`tell`, :meth:`truncate`,
   and :meth:`close`.
   Most of the methods of this class will often map to a single system call.
@@ -799,36 +799,36 @@
 
   .. XXX should 2.6 register them in io.py?
 
-* :class:`BufferedIOBase`: is an abstract base class that 
-  buffers data in memory to reduce the number of 
+* :class:`BufferedIOBase`: is an abstract base class that
+  buffers data in memory to reduce the number of
   system calls used, making I/O processing more efficient.
-  It supports all of the methods of :class:`RawIOBase`, 
+  It supports all of the methods of :class:`RawIOBase`,
   and adds a :attr:`raw` attribute holding the underlying raw object.
 
   There are four concrete classes implementing this ABC:
-  :class:`BufferedWriter` and 
+  :class:`BufferedWriter` and
   :class:`BufferedReader` for objects that only support
   writing or reading and don't support random access,
   :class:`BufferedRandom` for objects that support the :meth:`seek` method
   for random access,
-  and :class:`BufferedRWPair` for objects such as TTYs that have 
+  and :class:`BufferedRWPair` for objects such as TTYs that have
   both read and write operations that act upon unconnected streams of data.
 
 * :class:`TextIOBase`: Provides functions for reading and writing
   strings (remember, strings will be Unicode in Python 3.0),
-  and supporting universal newlines.  :class:`TextIOBase` defines 
-  the :meth:`readline` method and supports iteration upon 
-  objects.   
+  and supporting universal newlines.  :class:`TextIOBase` defines
+  the :meth:`readline` method and supports iteration upon
+  objects.
 
   There are two concrete implementations.  :class:`TextIOWrapper`
   wraps a buffered I/O object, supporting all of the methods for
-  text I/O and adding a :attr:`buffer` attribute for access 
+  text I/O and adding a :attr:`buffer` attribute for access
   to the underlying object.  :class:`StringIO` simply buffers
   everything in memory without ever writing anything to disk.
 
   (In current 2.6 alpha releases, :class:`io.StringIO` is implemented in
-  pure Python, so it's pretty slow.   You should therefore stick with the 
-  existing :mod:`StringIO` module or :mod:`cStringIO` for now.  At some 
+  pure Python, so it's pretty slow.   You should therefore stick with the
+  existing :mod:`StringIO` module or :mod:`cStringIO` for now.  At some
   point Python 3.0's :mod:`io` module will be rewritten into C for speed,
   and perhaps the C implementation will be  backported to the 2.x releases.)
 
@@ -836,7 +836,7 @@
 
 In Python 2.6, the underlying implementations haven't been
 restructured to build on top of the :mod:`io` module's classes.  The
-module is being provided to make it easier to write code that's 
+module is being provided to make it easier to write code that's
 forward-compatible with 3.0, and to save developers the effort of writing
 their own implementations of buffering and text I/O.
 
@@ -855,7 +855,7 @@
 =====================================================
 
 The buffer protocol is a C-level API that lets Python types
-exchange pointers into their internal representations.  A 
+exchange pointers into their internal representations.  A
 memory-mapped file can be viewed as a buffer of characters, for
 example, and this lets another module such as :mod:`re`
 treat memory-mapped files as a string of characters to be searched.
@@ -863,19 +863,19 @@
 The primary users of the buffer protocol are numeric-processing
 packages such as NumPy, which can expose the internal representation
 of arrays so that callers can write data directly into an array instead
-of going through a slower API.  This PEP updates the buffer protocol in light of experience 
+of going through a slower API.  This PEP updates the buffer protocol in light of experience
 from NumPy development, adding a number of new features
-such as indicating the shape of an array, 
+such as indicating the shape of an array,
 locking memory .
 
-The most important new C API function is 
+The most important new C API function is
 ``PyObject_GetBuffer(PyObject *obj, Py_buffer *view, int flags)``, which
 takes an object and a set of flags, and fills in the
-``Py_buffer`` structure with information 
+``Py_buffer`` structure with information
 about the object's memory representation.  Objects
-can use this operation to lock memory in place 
+can use this operation to lock memory in place
 while an external caller could be modifying the contents,
-so there's a corresponding 
+so there's a corresponding
 ``PyObject_ReleaseBuffer(PyObject *obj, Py_buffer *view)`` to
 indicate that the external caller is done.
 
@@ -883,7 +883,7 @@
 constraints upon the memory returned.  Some examples are:
 
  * :const:`PyBUF_WRITABLE` indicates that the memory must be writable.
- 
+
  * :const:`PyBUF_LOCK` requests a read-only or exclusive lock on the memory.
 
  * :const:`PyBUF_C_CONTIGUOUS` and :const:`PyBUF_F_CONTIGUOUS`
@@ -897,7 +897,7 @@
    :pep:`3118` - Revising the buffer protocol
       PEP written by Travis Oliphant and Carl Banks; implemented by
       Travis Oliphant.
-      
+
 
 .. ======================================================================
 
@@ -909,16 +909,16 @@
 Some object-oriented languages such as Java support interfaces: declarations
 that a class has a given set of methods or supports a given access protocol.
 Abstract Base Classes (or ABCs) are an equivalent feature for Python. The ABC
-support consists of an :mod:`abc` module containing a metaclass called 
+support consists of an :mod:`abc` module containing a metaclass called
 :class:`ABCMeta`, special handling
 of this metaclass by the :func:`isinstance` and :func:`issubclass` built-ins,
 and a collection of basic ABCs that the Python developers think will be widely
 useful.
 
-Let's say you have a particular class and wish to know whether it supports 
+Let's say you have a particular class and wish to know whether it supports
 dictionary-style access.  The phrase "dictionary-style" is vague, however.
-It probably means that accessing items with ``obj[1]`` works.  
-Does it imply that setting items with ``obj[2] = value`` works?  
+It probably means that accessing items with ``obj[1]`` works.
+Does it imply that setting items with ``obj[2] = value`` works?
 Or that the object will have :meth:`keys`, :meth:`values`, and :meth:`items`
 methods?  What about the iterative variants  such as :meth:`iterkeys`?  :meth:`copy`
 and :meth:`update`?  Iterating over the object with :func:`iter`?
@@ -927,7 +927,7 @@
 module.  :class:`Iterable` indicates that a class defines :meth:`__iter__`,
 and :class:`Container` means the class supports  ``x in y`` expressions
 by defining a :meth:`__contains__` method.  The basic dictionary interface of
-getting items, setting items, and 
+getting items, setting items, and
 :meth:`keys`, :meth:`values`, and :meth:`items`, is defined by the
 :class:`MutableMapping` ABC.
 
@@ -935,22 +935,22 @@
 to indicate they support that ABC's interface::
 
     import collections
-  
+
     class Storage(collections.MutableMapping):
         ...
 
 
-Alternatively, you could write the class without deriving from 
+Alternatively, you could write the class without deriving from
 the desired ABC and instead register the class by
 calling the ABC's :meth:`register` method::
 
     import collections
-    
+
     class Storage:
         ...
-	
+
     collections.MutableMapping.register(Storage)
-    
+
 For classes that you write, deriving from the ABC is probably clearer.
 The :meth:`register`  method is useful when you've written a new
 ABC that can describe an existing type or class, or if you want
@@ -963,8 +963,8 @@
   PrintableType.register(float)
   PrintableType.register(str)
 
-Classes should obey the semantics specified by an ABC, but 
-Python can't check this; it's up to the class author to  
+Classes should obey the semantics specified by an ABC, but
+Python can't check this; it's up to the class author to
 understand the ABC's requirements and to implement the code accordingly.
 
 To check whether an object supports a particular interface, you can
@@ -972,11 +972,11 @@
 
     def func(d):
 	if not isinstance(d, collections.MutableMapping):
-	    raise ValueError("Mapping object expected, not %r" % d)        
+	    raise ValueError("Mapping object expected, not %r" % d)
 
-(Don't feel that you must now begin writing lots of checks as in the 
-above example.  Python has a strong tradition of duck-typing, where 
-explicit type-checking isn't done and code simply calls methods on 
+(Don't feel that you must now begin writing lots of checks as in the
+above example.  Python has a strong tradition of duck-typing, where
+explicit type-checking isn't done and code simply calls methods on
 an object, trusting that those methods will be there and raising an
 exception if they aren't.  Be judicious in checking for ABCs
 and only do it where it helps.)
@@ -988,46 +988,46 @@
 
   class Drawable():
       __metaclass__ = ABCMeta
-  
+
       def draw(self, x, y, scale=1.0):
 	  pass
 
       def draw_doubled(self, x, y):
 	  self.draw(x, y, scale=2.0)
 
-	
+
   class Square(Drawable):
       def draw(self, x, y, scale):
           ...
 
-	  
+
 In the :class:`Drawable` ABC above, the :meth:`draw_doubled` method
 renders the object at twice its size and can be implemented in terms
 of other methods described in :class:`Drawable`.  Classes implementing
-this ABC therefore don't need to provide their own implementation 
+this ABC therefore don't need to provide their own implementation
 of :meth:`draw_doubled`, though they can do so.  An implementation
-of :meth:`draw` is necessary, though; the ABC can't provide 
-a useful generic implementation.  You 
-can apply the ``@abstractmethod`` decorator to methods such as 
-:meth:`draw` that must be implemented; Python will 
-then raise an exception for classes that 
+of :meth:`draw` is necessary, though; the ABC can't provide
+a useful generic implementation.  You
+can apply the ``@abstractmethod`` decorator to methods such as
+:meth:`draw` that must be implemented; Python will
+then raise an exception for classes that
 don't define the method::
 
     class Drawable():
 	__metaclass__ = ABCMeta
-    
+
 	@abstractmethod
 	def draw(self, x, y, scale):
 	    pass
 
-Note that the exception is only raised when you actually 
+Note that the exception is only raised when you actually
 try to create an instance of a subclass without the method::
 
     >>> s=Square()
     Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
     TypeError: Can't instantiate abstract class Square with abstract methods draw
-    >>> 
+    >>>
 
 Abstract data attributes can be declared using the ``@abstractproperty`` decorator::
 
@@ -1035,7 +1035,7 @@
     def readonly(self):
        return self._x
 
-Subclasses must then define a :meth:`readonly` property 
+Subclasses must then define a :meth:`readonly` property
 
 .. seealso::
 
@@ -1056,7 +1056,7 @@
 adds support for binary (base-2) integer literals, signalled by a "0b"
 or "0B" prefix.
 
-Python 2.6 doesn't drop support for a leading 0 signalling 
+Python 2.6 doesn't drop support for a leading 0 signalling
 an octal number, but it does add support for "0o" and "0b"::
 
     >>> 0o21, 2*8 + 1
@@ -1064,8 +1064,8 @@
     >>> 0b101111
     47
 
-The :func:`oct` built-in still returns numbers 
-prefixed with a leading zero, and a new :func:`bin` 
+The :func:`oct` built-in still returns numbers
+prefixed with a leading zero, and a new :func:`bin`
 built-in returns the binary representation for a number::
 
     >>> oct(42)
@@ -1141,36 +1141,36 @@
 round off the results or introduce tiny errors that may break the
 commutativity and associativity properties; inexact numbers may
 perform such rounding or introduce small errors.  Integers, long
-integers, and rational numbers are exact, while floating-point 
+integers, and rational numbers are exact, while floating-point
 and complex numbers are inexact.
 
 :class:`Complex` is a subclass of :class:`Number`.  Complex numbers
 can undergo the basic operations of addition, subtraction,
 multiplication, division, and exponentiation, and you can retrieve the
-real and imaginary parts and obtain a number's conjugate.  Python's built-in 
+real and imaginary parts and obtain a number's conjugate.  Python's built-in
 complex type is an implementation of :class:`Complex`.
 
-:class:`Real` further derives from :class:`Complex`, and adds 
-operations that only work on real numbers: :func:`floor`, :func:`trunc`, 
-rounding, taking the remainder mod N, floor division, 
-and comparisons.  
+:class:`Real` further derives from :class:`Complex`, and adds
+operations that only work on real numbers: :func:`floor`, :func:`trunc`,
+rounding, taking the remainder mod N, floor division,
+and comparisons.
 
 :class:`Rational` numbers derive from :class:`Real`, have
 :attr:`numerator` and :attr:`denominator` properties, and can be
 converted to floats.  Python 2.6 adds a simple rational-number class,
-:class:`Fraction`, in the :mod:`fractions` module.  (It's called 
-:class:`Fraction` instead of :class:`Rational` to avoid 
+:class:`Fraction`, in the :mod:`fractions` module.  (It's called
+:class:`Fraction` instead of :class:`Rational` to avoid
 a name clash with :class:`numbers.Rational`.)
 
 :class:`Integral` numbers derive from :class:`Rational`, and
-can be shifted left and right with ``<<`` and ``>>``, 
-combined using bitwise operations such as ``&`` and ``|``, 
+can be shifted left and right with ``<<`` and ``>>``,
+combined using bitwise operations such as ``&`` and ``|``,
 and can be used as array indexes and slice boundaries.
 
 In Python 3.0, the PEP slightly redefines the existing built-ins
 :func:`round`, :func:`math.floor`, :func:`math.ceil`, and adds a new
-one, :func:`math.trunc`, that's been backported to Python 2.6. 
-:func:`math.trunc` rounds toward zero, returning the closest 
+one, :func:`math.trunc`, that's been backported to Python 2.6.
+:func:`math.trunc` rounds toward zero, returning the closest
 :class:`Integral` that's between the function's argument and zero.
 
 .. seealso::
@@ -1181,7 +1181,7 @@
    `Scheme's numerical tower <http://www.gnu.org/software/guile/manual/html_node/Numerical-Tower.html#Numerical-Tower>`__, from the Guile manual.
 
    `Scheme's number datatypes <http://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_sec_6.2>`__ from the R5RS Scheme specification.
-  
+
 
 The :mod:`fractions` Module
 --------------------------------------------------
@@ -1205,8 +1205,8 @@
     >>> a/b
     Fraction(5, 3)
 
-To help in converting floating-point numbers to rationals, 
-the float type now has a :meth:`as_integer_ratio()` method that returns 
+To help in converting floating-point numbers to rationals,
+the float type now has a :meth:`as_integer_ratio()` method that returns
 the numerator and denominator for a fraction that evaluates to the same
 floating-point value::
 
@@ -1239,7 +1239,7 @@
 
     >>> def f(**kw):
     ...    print sorted(kw)
-    ... 
+    ...
     >>> ud=UserDict.UserDict()
     >>> ud['a'] = 1
     >>> ud['b'] = 'string'
@@ -1264,21 +1264,21 @@
 
 * Properties now have three attributes, :attr:`getter`,
   :attr:`setter` and :attr:`deleter`, that are useful shortcuts for
-  adding or modifying a getter, setter or deleter function to an 
+  adding or modifying a getter, setter or deleter function to an
   existing property. You would use them like this::
 
     class C(object):
-	@property                                                              
-	def x(self): 
-	    return self._x                                            
-
-	@x.setter                                                              
-	def x(self, value): 
-	    self._x = value                                    
-
-	@x.deleter                                                             
-	def x(self): 
-	    del self._x             
+	@property
+	def x(self):
+	    return self._x
+
+	@x.setter
+	def x(self, value):
+	    self._x = value
+
+	@x.deleter
+	def x(self):
+	    del self._x
 
     class D(C):
         @C.x.getter
@@ -1290,22 +1290,22 @@
             self._x = value / 2
 
 
-* C functions and methods that use 
-  :cfunc:`PyComplex_AsCComplex` will now accept arguments that 
-  have a :meth:`__complex__` method.  In particular, the functions in the 
+* C functions and methods that use
+  :cfunc:`PyComplex_AsCComplex` will now accept arguments that
+  have a :meth:`__complex__` method.  In particular, the functions in the
   :mod:`cmath` module will now accept objects with this method.
   This is a backport of a Python 3.0 change.
   (Contributed by Mark Dickinson; :issue:`1675423`.)
 
   A numerical nicety: when creating a complex number from two floats
-  on systems that support signed zeros (-0 and +0), the 
-  :func:`complex` constructor will now preserve the sign 
+  on systems that support signed zeros (-0 and +0), the
+  :func:`complex` constructor will now preserve the sign
   of the zero.  (:issue:`1507`)
 
 * More floating-point features were also added.  The :func:`float` function
   will now turn the strings ``+nan`` and ``-nan`` into the corresponding
-  IEEE 754 Not A Number values, and ``+inf`` and ``-inf`` into 
-  positive or negative infinity.  This works on any platform with 
+  IEEE 754 Not A Number values, and ``+inf`` and ``-inf`` into
+  positive or negative infinity.  This works on any platform with
   IEEE 754 semantics.  (Contributed by Christian Heimes; :issue:`1635`.)
 
   Other functions in the :mod:`math` module, :func:`isinf` and
@@ -1316,11 +1316,11 @@
   functions have been improved to give more consistent behaviour
   across platforms, especially with respect to handling of
   floating-point exceptions and IEEE 754 special values.
-  The new functions are: 
+  The new functions are:
 
   * :func:`isinf` and :func:`isnan` determine whether a given float is
     a (positive or negative) infinity or a NaN (Not a Number),
-    respectively. 
+    respectively.
 
   * ``copysign(x, y)`` copies the sign bit of an IEEE 754 number,
     returning the absolute value of *x* combined with the sign bit of
@@ -1350,31 +1350,31 @@
   (Contributed by Christian Heimes and Mark Dickinson.)
 
 * Changes to the :class:`Exception` interface
-  as dictated by :pep:`352` continue to be made.  For 2.6, 
+  as dictated by :pep:`352` continue to be made.  For 2.6,
   the :attr:`message` attribute is being deprecated in favor of the
   :attr:`args` attribute.
 
-* The :exc:`GeneratorExit` exception now subclasses 
-  :exc:`BaseException` instead of :exc:`Exception`.  This means 
+* The :exc:`GeneratorExit` exception now subclasses
+  :exc:`BaseException` instead of :exc:`Exception`.  This means
   that an exception handler that does ``except Exception:``
-  will not inadvertently catch :exc:`GeneratorExit`. 
+  will not inadvertently catch :exc:`GeneratorExit`.
   (Contributed by Chad Austin; :issue:`1537`.)
 
-* Generator objects now have a :attr:`gi_code` attribute that refers to 
-  the original code object backing the generator.  
+* Generator objects now have a :attr:`gi_code` attribute that refers to
+  the original code object backing the generator.
   (Contributed by Collin Winter; :issue:`1473257`.)
 
 * The :func:`compile` built-in function now accepts keyword arguments
   as well as positional parameters.  (Contributed by Thomas Wouters;
   :issue:`1444529`.)
 
-* The :func:`complex` constructor now accepts strings containing 
+* The :func:`complex` constructor now accepts strings containing
   parenthesized complex numbers, letting ``complex(repr(cmplx))``
   will now round-trip values.  For example, ``complex('(3+4j)')``
   now returns the value (3+4j).  (:issue:`1491866`)
 
-* The string :meth:`translate` method now accepts ``None`` as the 
-  translation table parameter, which is treated as the identity 
+* The string :meth:`translate` method now accepts ``None`` as the
+  translation table parameter, which is treated as the identity
   transformation.   This makes it easier to carry out operations
   that only delete characters.  (Contributed by Bengt Richter;
   :issue:`1193128`.)
@@ -1383,7 +1383,7 @@
   method on the objects it receives.  This method must return a list
   of strings containing the names of valid attributes for the object,
   and lets the object control the value that :func:`dir` produces.
-  Objects that have :meth:`__getattr__` or :meth:`__getattribute__` 
+  Objects that have :meth:`__getattr__` or :meth:`__getattribute__`
   methods can use this to advertise pseudo-attributes they will honor.
   (:issue:`1591665`)
 
@@ -1411,12 +1411,12 @@
 * Type objects now have a cache of methods that can reduce
   the amount of work required to find the correct method implementation
   for a particular class; once cached, the interpreter doesn't need to
-  traverse base classes to figure out the right method to call.  
-  The cache is cleared if a base class or the class itself is modified, 
-  so the cache should remain correct even in the face of Python's dynamic 
+  traverse base classes to figure out the right method to call.
+  The cache is cleared if a base class or the class itself is modified,
+  so the cache should remain correct even in the face of Python's dynamic
   nature.
-  (Original optimization implemented by Armin Rigo, updated for 
-  Python 2.6 by Kevin Jacobs; :issue:`1700288`.) 
+  (Original optimization implemented by Armin Rigo, updated for
+  Python 2.6 by Kevin Jacobs; :issue:`1700288`.)
 
 * All of the functions in the :mod:`struct` module have been rewritten in
   C, thanks to work at the Need For Speed sprint.
@@ -1427,7 +1427,7 @@
   these types.  (Contributed by Neal Norwitz.)
 
 * Unicode strings now use faster code for detecting
-  whitespace and line breaks; this speeds up the :meth:`split` method 
+  whitespace and line breaks; this speeds up the :meth:`split` method
   by about 25% and :meth:`splitlines` by 35%.
   (Contributed by Antoine Pitrou.)  Memory usage is reduced
   by using pymalloc for the Unicode string's data.
@@ -1468,10 +1468,10 @@
 complete list of changes, or look through the Subversion logs for all the
 details.
 
-* (3.0-warning mode) Python 3.0 will feature a reorganized standard 
+* (3.0-warning mode) Python 3.0 will feature a reorganized standard
   library; many outdated modules are being dropped,
-  and some modules are being renamed or moved into packages. 
-  Python 2.6 running in 3.0-warning mode will warn about these modules 
+  and some modules are being renamed or moved into packages.
+  Python 2.6 running in 3.0-warning mode will warn about these modules
   when they are imported.
 
   The modules that have been renamed are:
@@ -1485,6 +1485,8 @@
   * :mod:`Tkinter` has become the :mod:`tkinter` package.
   * :mod:`Queue` has become :mod:`queue`.
 
+  .. XXX no warnings anymore for renamed modules!
+
   The list of deprecated modules is:
   :mod:`audiodev`,
   :mod:`bgenlocations`,
@@ -1580,18 +1582,18 @@
   thanks to Mark Dickinson and Christian Heimes, that added some new
   features and greatly improved the accuracy of the computations.
 
-  Five new functions were added: 
+  Five new functions were added:
 
   * :func:`polar` converts a complex number to polar form, returning
-    the modulus and argument of that complex number. 
+    the modulus and argument of that complex number.
 
   * :func:`rect` does the opposite, turning a (modulus, argument) pair
     back into the corresponding complex number.
 
-  * :func:`phase` returns the phase or argument of a complex number.  
+  * :func:`phase` returns the phase or argument of a complex number.
 
   * :func:`isnan` returns True if either
-    the real or imaginary part of its argument is a NaN.  
+    the real or imaginary part of its argument is a NaN.
 
   * :func:`isinf` returns True if either the real or imaginary part of
     its argument is infinite.
@@ -1614,7 +1616,7 @@
   fieldnames)` is a factory function that creates subclasses of the standard tuple
   whose fields are accessible by name as well as index.  For example::
 
-     >>> var_type = collections.namedtuple('variable', 
+     >>> var_type = collections.namedtuple('variable',
      ...             'id name type size')
      # Names are separated by spaces or commas.
      # 'id, name, type, size' would also work.
@@ -1633,15 +1635,15 @@
      variable(id=1, name='amplitude', type='int', size=4)
 
   Where the new :class:`namedtuple` type proved suitable, the standard
-  library has been modified to return them.  For example, 
-  the :meth:`Decimal.as_tuple` method now returns a named tuple with 
+  library has been modified to return them.  For example,
+  the :meth:`Decimal.as_tuple` method now returns a named tuple with
   :attr:`sign`, :attr:`digits`, and :attr:`exponent` fields.
 
   (Contributed by Raymond Hettinger.)
 
-* Another change to the :mod:`collections` module is that the 
+* Another change to the :mod:`collections` module is that the
   :class:`deque` type now supports an optional *maxlen* parameter;
-  if supplied, the deque's size will be restricted to no more 
+  if supplied, the deque's size will be restricted to no more
   than *maxlen* items.  Adding more items to a full deque causes
   old items to be discarded.
 
@@ -1660,7 +1662,7 @@
 
   (Contributed by Raymond Hettinger.)
 
-* The :mod:`ctypes` module now supports a :class:`c_bool` datatype 
+* The :mod:`ctypes` module now supports a :class:`c_bool` datatype
   that represents the C99 ``bool`` type.  (Contributed by David Remahl;
   :issue:`1649190`.)
 
@@ -1676,9 +1678,9 @@
   (Contributed by Fabian Kreutz.)
   ::
 
-     # Boldface text starting at y=0,x=21 
+     # Boldface text starting at y=0,x=21
      # and affecting the rest of the line.
-     stdscr.chgat(0,21, curses.A_BOLD)  
+     stdscr.chgat(0,21, curses.A_BOLD)
 
   The :class:`Textbox` class in the :mod:`curses.textpad` module
   now supports editing in insert mode as well as overwrite mode.
@@ -1690,7 +1692,7 @@
   object, zero-padded on
   the left to six places.  (Contributed by Skip Montanaro; :issue:`1158`.)
 
-* The :mod:`decimal` module was updated to version 1.66 of 
+* The :mod:`decimal` module was updated to version 1.66 of
   `the General Decimal Specification <http://www2.hursley.ibm.com/decimal/decarith.html>`__.  New features
   include some methods for some basic mathematical functions such as
   :meth:`exp` and :meth:`log10`::
@@ -1702,14 +1704,14 @@
     >>> Decimal(1000).log10()
     Decimal("3")
 
-  The :meth:`as_tuple` method of :class:`Decimal` objects now returns a 
+  The :meth:`as_tuple` method of :class:`Decimal` objects now returns a
   named tuple with :attr:`sign`, :attr:`digits`, and :attr:`exponent` fields.
-  
+
   (Implemented by Facundo Batista and Mark Dickinson.  Named tuple
   support added by Raymond Hettinger.)
 
-* The :mod:`difflib` module's :class:`SequenceMatcher` class 
-  now returns named tuples representing matches. 
+* The :mod:`difflib` module's :class:`SequenceMatcher` class
+  now returns named tuples representing matches.
   In addition to behaving like tuples, the returned values
   also have :attr:`a`, :attr:`b`, and :attr:`size` attributes.
   (Contributed by Raymond Hettinger.)
@@ -1717,25 +1719,25 @@
 * An optional ``timeout`` parameter was added to the
   :class:`ftplib.FTP` class constructor as well as the :meth:`connect`
   method, specifying a timeout measured in seconds.  (Added by Facundo
-  Batista.)  Also, the :class:`FTP` class's 
+  Batista.)  Also, the :class:`FTP` class's
   :meth:`storbinary` and :meth:`storlines`
-  now take an optional *callback* parameter that will be called with 
+  now take an optional *callback* parameter that will be called with
   each block of data after the data has been sent.
   (Contributed by Phil Schwartz; :issue:`1221598`.)
 
-* The :func:`reduce` built-in function is also available in the 
+* The :func:`reduce` built-in function is also available in the
   :mod:`functools` module.  In Python 3.0, the built-in is dropped and it's
   only available from :mod:`functools`; currently there are no plans
-  to drop the built-in in the 2.x series.  (Patched by 
+  to drop the built-in in the 2.x series.  (Patched by
   Christian Heimes; :issue:`1739906`.)
 
-* The :func:`glob.glob` function can now return Unicode filenames if 
+* The :func:`glob.glob` function can now return Unicode filenames if
   a Unicode path was used and Unicode filenames are matched within the
   directory.  (:issue:`1001604`)
 
 * The :mod:`gopherlib` module has been removed.
 
-* A new function in the :mod:`heapq` module: ``merge(iter1, iter2, ...)`` 
+* A new function in the :mod:`heapq` module: ``merge(iter1, iter2, ...)``
   takes any number of iterables that return data *in sorted
   order*, and returns a new iterator that returns the contents of all
   the iterators, also in sorted order.  For example::
@@ -1744,25 +1746,25 @@
        [1, 2, 3, 5, 8, 9, 16]
 
   Another new function, ``heappushpop(heap, item)``,
-  pushes *item* onto *heap*, then pops off and returns the smallest item. 
+  pushes *item* onto *heap*, then pops off and returns the smallest item.
   This is more efficient than making a call to :func:`heappush` and then
   :func:`heappop`.
 
   (Contributed by Raymond Hettinger.)
 
 * An optional ``timeout`` parameter was added to the
-  :class:`httplib.HTTPConnection` and :class:`HTTPSConnection` 
+  :class:`httplib.HTTPConnection` and :class:`HTTPSConnection`
   class constructors, specifying a timeout measured in seconds.
   (Added by Facundo Batista.)
 
-* Most of the :mod:`inspect` module's functions, such as 
-  :func:`getmoduleinfo` and :func:`getargs`, now return named tuples.  
+* Most of the :mod:`inspect` module's functions, such as
+  :func:`getmoduleinfo` and :func:`getargs`, now return named tuples.
   In addition to behaving like tuples, the elements of the  return value
   can also be accessed as attributes.
   (Contributed by Raymond Hettinger.)
 
-  Some new functions in the module include 
-  :func:`isgenerator`, :func:`isgeneratorfunction`, 
+  Some new functions in the module include
+  :func:`isgenerator`, :func:`isgeneratorfunction`,
   and :func:`isabstract`.
 
 * The :mod:`itertools` module gained several new functions.
@@ -1779,25 +1781,25 @@
   every possible combination of the elements returned from each iterable. ::
 
      itertools.product([1,2,3], [4,5,6]) ->
-       [(1, 4), (1, 5), (1, 6), 
-	(2, 4), (2, 5), (2, 6), 
+       [(1, 4), (1, 5), (1, 6),
+	(2, 4), (2, 5), (2, 6),
 	(3, 4), (3, 5), (3, 6)]
 
   The optional *repeat* keyword argument is used for taking the
-  product of an iterable or a set of iterables with themselves, 
+  product of an iterable or a set of iterables with themselves,
   repeated *N* times.  With a single iterable argument, *N*-tuples
   are returned::
 
      itertools.product([1,2], repeat=3)) ->
-       [(1, 1, 1), (1, 1, 2), (1, 2, 1), (1, 2, 2), 
+       [(1, 1, 1), (1, 1, 2), (1, 2, 1), (1, 2, 2),
         (2, 1, 1), (2, 1, 2), (2, 2, 1), (2, 2, 2)]
 
   With two iterables, *2N*-tuples are returned. ::
 
      itertools(product([1,2], [3,4], repeat=2) ->
-       [(1, 3, 1, 3), (1, 3, 1, 4), (1, 3, 2, 3), (1, 3, 2, 4), 
-        (1, 4, 1, 3), (1, 4, 1, 4), (1, 4, 2, 3), (1, 4, 2, 4), 
-        (2, 3, 1, 3), (2, 3, 1, 4), (2, 3, 2, 3), (2, 3, 2, 4), 
+       [(1, 3, 1, 3), (1, 3, 1, 4), (1, 3, 2, 3), (1, 3, 2, 4),
+        (1, 4, 1, 3), (1, 4, 1, 4), (1, 4, 2, 3), (1, 4, 2, 4),
+        (2, 3, 1, 3), (2, 3, 1, 4), (2, 3, 2, 3), (2, 3, 2, 4),
         (2, 4, 1, 3), (2, 4, 1, 4), (2, 4, 2, 3), (2, 4, 2, 4)]
 
   ``combinations(iterable, r)`` returns sub-sequences of length *r* from
@@ -1810,35 +1812,35 @@
       [('1', '2', '3')]
 
     itertools.combinations('1234', 3) ->
-      [('1', '2', '3'), ('1', '2', '4'), ('1', '3', '4'), 
+      [('1', '2', '3'), ('1', '2', '4'), ('1', '3', '4'),
        ('2', '3', '4')]
 
   ``permutations(iter[, r])`` returns all the permutations of length *r* of
-  the iterable's elements.  If *r* is not specified, it will default to the 
+  the iterable's elements.  If *r* is not specified, it will default to the
   number of elements produced by the iterable. ::
 
     itertools.permutations([1,2,3,4], 2) ->
-      [(1, 2), (1, 3), (1, 4), 
-       (2, 1), (2, 3), (2, 4), 
-       (3, 1), (3, 2), (3, 4), 
+      [(1, 2), (1, 3), (1, 4),
+       (2, 1), (2, 3), (2, 4),
+       (3, 1), (3, 2), (3, 4),
        (4, 1), (4, 2), (4, 3)]
 
   ``itertools.chain(*iterables)`` is an existing function in
   :mod:`itertools` that gained a new constructor in Python 2.6.
-  ``itertools.chain.from_iterable(iterable)`` takes a single 
+  ``itertools.chain.from_iterable(iterable)`` takes a single
   iterable that should return other iterables.  :func:`chain` will
   then return all the elements of the first iterable, then
   all the elements of the second, and so on. ::
 
     chain.from_iterable([[1,2,3], [4,5,6]]) ->
        [1, 2, 3, 4, 5, 6]
-  
+
   (All contributed by Raymond Hettinger.)
 
-* The :mod:`logging` module's :class:`FileHandler` class 
+* The :mod:`logging` module's :class:`FileHandler` class
   and its subclasses :class:`WatchedFileHandler`, :class:`RotatingFileHandler`,
-  and :class:`TimedRotatingFileHandler` now 
-  have an optional *delay* parameter to its constructor.  If *delay* 
+  and :class:`TimedRotatingFileHandler` now
+  have an optional *delay* parameter to its constructor.  If *delay*
   is true, opening of the log file is deferred until the first
   :meth:`emit` call is made.  (Contributed by Vinay Sajip.)
 
@@ -1853,16 +1855,16 @@
   the forward search.
   (Contributed by John Lenton.)
 
-* The :mod:`operator` module gained a 
-  :func:`methodcaller` function that takes a name and an optional 
-  set of arguments, returning a callable that will call 
+* The :mod:`operator` module gained a
+  :func:`methodcaller` function that takes a name and an optional
+  set of arguments, returning a callable that will call
   the named function on any arguments passed to it.  For example::
 
     >>> # Equivalent to lambda s: s.replace('old', 'new')
     >>> replacer = operator.methodcaller('replace', 'old', 'new')
     >>> replacer('old wine in old bottles')
     'new wine in new bottles'
-   
+
   (Contributed by Georg Brandl, after a suggestion by Gregory Petrosyan.)
 
   The :func:`attrgetter` function now accepts dotted names and performs
@@ -1876,8 +1878,8 @@
 
   (Contributed by Georg Brandl, after a suggestion by Barry Warsaw.)
 
-* New functions in the :mod:`os` module include 
-  ``fchmod(fd, mode)``,   ``fchown(fd, uid, gid)``,  
+* New functions in the :mod:`os` module include
+  ``fchmod(fd, mode)``,   ``fchown(fd, uid, gid)``,
   and ``lchmod(path, mode)``, on operating systems that support these
   functions. :func:`fchmod` and :func:`fchown` let you change the mode
   and ownership of an opened file, and :func:`lchmod` changes the mode
@@ -1891,8 +1893,8 @@
   parameter's default value is false.  Note that the function can fall
   into an infinite recursion if there's a symlink that points to a
   parent directory.  (:issue:`1273829`)
-       
-* The ``os.environ`` object's :meth:`clear` method will now unset the 
+
+* The ``os.environ`` object's :meth:`clear` method will now unset the
   environment variables using :func:`os.unsetenv` in addition to clearing
   the object's keys.  (Contributed by Martin Horcicka; :issue:`1181`.)
 
@@ -1908,23 +1910,23 @@
   working directory to the destination ``path``.  (Contributed by
   Richard Barran; :issue:`1339796`.)
 
-  On Windows, :func:`os.path.expandvars` will now expand environment variables 
-  in the form "%var%", and "~user" will be expanded into the 
+  On Windows, :func:`os.path.expandvars` will now expand environment variables
+  in the form "%var%", and "~user" will be expanded into the
   user's home directory path.  (Contributed by Josiah Carlson;
   :issue:`957650`.)
 
-* The Python debugger provided by the :mod:`pdb` module 
+* The Python debugger provided by the :mod:`pdb` module
   gained a new command: "run" restarts the Python program being debugged,
   and can optionally take new command-line arguments for the program.
   (Contributed by Rocky Bernstein; :issue:`1393667`.)
 
-  The :func:`post_mortem` function, used to enter debugging of a 
+  The :func:`post_mortem` function, used to enter debugging of a
   traceback, will now use the traceback returned by :func:`sys.exc_info`
   if no traceback is supplied.   (Contributed by Facundo Batista;
   :issue:`1106316`.)
 
-* The :mod:`pickletools` module now has an :func:`optimize` function 
-  that takes a string containing a pickle and removes some unused 
+* The :mod:`pickletools` module now has an :func:`optimize` function
+  that takes a string containing a pickle and removes some unused
   opcodes, returning a shorter pickle that contains the same data structure.
   (Contributed by Raymond Hettinger.)
 
@@ -1942,7 +1944,7 @@
           +-- StopIteration
           +-- StandardError
      ...'
-    >>> 
+    >>>
 
   (Contributed by Paul Moore; :issue:`2439`.)
 
@@ -1959,13 +1961,13 @@
   processes faster.  (Contributed by Georg Brandl; :issue:`1663329`.)
 
 * The :mod:`pyexpat` module's :class:`Parser` objects now allow setting
-  their :attr:`buffer_size` attribute to change the size of the buffer 
+  their :attr:`buffer_size` attribute to change the size of the buffer
   used to hold character data.
   (Contributed by Achim Gaedke; :issue:`1137`.)
 
-* The :mod:`queue` module now provides queue classes that retrieve entries
-  in different orders.  The :class:`PriorityQueue` class stores 
-  queued items in a heap and retrieves them in priority order, 
+* The :mod:`Queue` module now provides queue classes that retrieve entries
+  in different orders.  The :class:`PriorityQueue` class stores
+  queued items in a heap and retrieves them in priority order,
   and :class:`LifoQueue` retrieves the most recently added entries first,
   meaning that it behaves like a stack.
   (Contributed by Raymond Hettinger.)
@@ -1979,8 +1981,8 @@
 
   The new ``triangular(low, high, mode)`` function returns random
   numbers following a triangular distribution.   The returned values
-  are between *low* and *high*, not including *high* itself, and 
-  with *mode* as the mode, the most frequently occurring value 
+  are between *low* and *high*, not including *high* itself, and
+  with *mode* as the mode, the most frequently occurring value
   in the distribution.  (Contributed by Wladmir van der Laan and
   Raymond Hettinger; :issue:`1681432`.)
 
@@ -1991,8 +1993,8 @@
 
 * The :mod:`rgbimg` module has been removed.
 
-* The :mod:`sched` module's :class:`scheduler` instances now 
-  have a read-only :attr:`queue` attribute that returns the 
+* The :mod:`sched` module's :class:`scheduler` instances now
+  have a read-only :attr:`queue` attribute that returns the
   contents of the scheduler's queue, represented as a list of
   named tuples with the fields ``(time, priority, action, argument)``.
   (Contributed by Raymond Hettinger; :issue:`1861`.)
@@ -2001,19 +2003,19 @@
   for the Linux :cfunc:`epoll` and BSD :cfunc:`kqueue` system calls.
   Also, a :meth:`modify` method was added to the existing :class:`poll`
   objects; ``pollobj.modify(fd, eventmask)`` takes a file descriptor
-  or file object and an event mask, 
-  
+  or file object and an event mask,
+
   (Contributed by Christian Heimes; :issue:`1657`.)
 
-* The :mod:`sets` module has been deprecated; it's better to 
+* The :mod:`sets` module has been deprecated; it's better to
   use the built-in :class:`set` and :class:`frozenset` types.
 
-* Integrating signal handling with GUI handling event loops 
+* Integrating signal handling with GUI handling event loops
   like those used by Tkinter or GTk+ has long been a problem; most
   software ends up polling, waking up every fraction of a second.
   The :mod:`signal` module can now make this more efficient.
   Calling ``signal.set_wakeup_fd(fd)`` sets a file descriptor
-  to be used; when a signal is received, a byte is written to that 
+  to be used; when a signal is received, a byte is written to that
   file descriptor.  There's also a C-level function,
   :cfunc:`PySignal_SetWakeupFd`, for setting the descriptor.
 
@@ -2022,7 +2024,7 @@
   will be passed to :func:`set_wakeup_fd`, and the readable descriptor
   will be added to the list of descriptors monitored by the event loop via
   :cfunc:`select` or :cfunc:`poll`.
-  On receiving a signal, a byte will be written and the main event loop 
+  On receiving a signal, a byte will be written and the main event loop
   will be woken up, without the need to poll.
 
   (Contributed by Adam Olsen; :issue:`1583`.)
@@ -2040,7 +2042,7 @@
 
 * The :mod:`smtplib` module now supports SMTP over SSL thanks to the
   addition of the :class:`SMTP_SSL` class. This class supports an
-  interface identical to the existing :class:`SMTP` class.   Both 
+  interface identical to the existing :class:`SMTP` class.   Both
   class constructors also have an optional ``timeout`` parameter
   that specifies a timeout for the initial connection attempt, measured in
   seconds.
@@ -2063,35 +2065,35 @@
   environments.  TIPC addresses are 4- or 5-tuples.
   (Contributed by Alberto Bertogli; :issue:`1646`.)
 
-  A new function, :func:`create_connection`, takes an address 
-  and connects to it using an optional timeout value, returning 
+  A new function, :func:`create_connection`, takes an address
+  and connects to it using an optional timeout value, returning
   the connected socket object.
 
-* The base classes in the :mod:`socketserver` module now support
-  calling a :meth:`handle_timeout` method after a span of inactivity 
-  specified by the server's :attr:`timeout` attribute.  (Contributed 
-  by Michael Pomraning.)  The :meth:`serve_forever` method 
+* The base classes in the :mod:`SocketServer` module now support
+  calling a :meth:`handle_timeout` method after a span of inactivity
+  specified by the server's :attr:`timeout` attribute.  (Contributed
+  by Michael Pomraning.)  The :meth:`serve_forever` method
   now takes an optional poll interval measured in seconds,
   controlling how often the server will check for a shutdown request.
-  (Contributed by Pedro Werneck and Jeffrey Yasskin; 
+  (Contributed by Pedro Werneck and Jeffrey Yasskin;
   :issue:`742598`, :issue:`1193577`.)
 
 * The :mod:`struct` module now supports the C99 :ctype:`_Bool` type,
-  using the format character ``'?'``. 
+  using the format character ``'?'``.
   (Contributed by David Remahl.)
 
 * The :class:`Popen` objects provided by the :mod:`subprocess` module
   now have :meth:`terminate`, :meth:`kill`, and :meth:`send_signal` methods.
   On Windows, :meth:`send_signal` only supports the :const:`SIGTERM`
   signal, and all these methods are aliases for the Win32 API function
-  :cfunc:`TerminateProcess`.  
+  :cfunc:`TerminateProcess`.
   (Contributed by Christian Heimes.)
- 
+
 * A new variable in the :mod:`sys` module,
   :attr:`float_info`, is an object
   containing information about the platform's floating-point support
   derived from the :file:`float.h` file.  Attributes of this object
-  include 
+  include
   :attr:`mant_dig` (number of digits in the mantissa), :attr:`epsilon`
   (smallest difference between 1.0 and the next largest value
   representable), and several others.  (Contributed by Christian Heimes;
@@ -2103,25 +2105,25 @@
   variable is initially set on start-up by supplying the :option:`-B`
   switch to the Python interpreter, or by setting the
   :envvar:`PYTHONDONTWRITEBYTECODE` environment variable before
-  running the interpreter.  Python code can subsequently 
+  running the interpreter.  Python code can subsequently
   change the value of this variable to control whether bytecode files
   are written or not.
   (Contributed by Neal Norwitz and Georg Brandl.)
 
-  Information about the command-line arguments supplied to the Python 
-  interpreter are available as attributes of a ``sys.flags`` named 
-  tuple.  For example, the :attr:`verbose` attribute is true if Python 
+  Information about the command-line arguments supplied to the Python
+  interpreter are available as attributes of a ``sys.flags`` named
+  tuple.  For example, the :attr:`verbose` attribute is true if Python
   was executed in verbose mode, :attr:`debug` is true in debugging mode, etc.
   These attributes are all read-only.
   (Contributed by Christian Heimes.)
 
   It's now possible to determine the current profiler and tracer functions
-  by calling :func:`sys.getprofile` and :func:`sys.gettrace`.  
+  by calling :func:`sys.getprofile` and :func:`sys.gettrace`.
   (Contributed by Georg Brandl; :issue:`1648`.)
 
 * The :mod:`tarfile` module now supports POSIX.1-2001 (pax) and
   POSIX.1-1988 (ustar) format tarfiles, in addition to the GNU tar
-  format that was already supported.  The default format 
+  format that was already supported.  The default format
   is GNU tar; specify the ``format`` parameter to open a file
   using a different format::
 
@@ -2136,37 +2138,37 @@
 
   The :meth:`TarFile.add` method now accepts a ``exclude`` argument that's
   a function that can be used to exclude certain filenames from
-  an archive. 
-  The function must take a filename and return true if the file 
+  an archive.
+  The function must take a filename and return true if the file
   should be excluded or false if it should be archived.
   The function is applied to both the name initially passed to :meth:`add`
   and to the names of files in recursively-added directories.
-  
+
   (All changes contributed by Lars Gustäbel).
 
 * An optional ``timeout`` parameter was added to the
   :class:`telnetlib.Telnet` class constructor, specifying a timeout
   measured in seconds.  (Added by Facundo Batista.)
 
-* The :class:`tempfile.NamedTemporaryFile` class usually deletes 
-  the temporary file it created when the file is closed.  This 
-  behaviour can now be changed by passing ``delete=False`` to the 
+* The :class:`tempfile.NamedTemporaryFile` class usually deletes
+  the temporary file it created when the file is closed.  This
+  behaviour can now be changed by passing ``delete=False`` to the
   constructor.  (Contributed by Damien Miller; :issue:`1537850`.)
 
-  A new class, :class:`SpooledTemporaryFile`, behaves like 
-  a temporary file but stores its data in memory until a maximum size is 
-  exceeded.  On reaching that limit, the contents will be written to 
+  A new class, :class:`SpooledTemporaryFile`, behaves like
+  a temporary file but stores its data in memory until a maximum size is
+  exceeded.  On reaching that limit, the contents will be written to
   an on-disk temporary file.  (Contributed by Dustin J. Mitchell.)
 
   The :class:`NamedTemporaryFile` and :class:`SpooledTemporaryFile` classes
-  both work as context managers, so you can write 
+  both work as context managers, so you can write
   ``with tempfile.NamedTemporaryFile() as tmp: ...``.
   (Contributed by Alexander Belopolsky; :issue:`2021`.)
 
 * The :mod:`test.test_support` module now contains a
   :func:`EnvironmentVarGuard`
   context manager that  supports temporarily changing environment variables and
-  automatically restores them to their old values. 
+  automatically restores them to their old values.
 
   Another context manager, :class:`TransientResource`, can surround calls
   to resources that may or may not be available; it will catch and
@@ -2175,12 +2177,12 @@
   external web site::
 
       with test_support.TransientResource(IOError, errno=errno.ETIMEDOUT):
-          f = urllib.urlopen('https://sf.net')                         
+          f = urllib.urlopen('https://sf.net')
           ...
 
   (Contributed by Brett Cannon.)
 
-* The :mod:`textwrap` module can now preserve existing whitespace 
+* The :mod:`textwrap` module can now preserve existing whitespace
   at the beginnings and ends of the newly-created lines
   by specifying ``drop_whitespace=False``
   as an argument::
@@ -2196,22 +2198,22 @@
       has a bunch
        of    extra
        whitespace.
-    >>> 
+    >>>
 
   (Contributed by Dwayne Bailey; :issue:`1581073`.)
 
-* The :mod:`timeit` module now accepts callables as well as strings 
+* The :mod:`timeit` module now accepts callables as well as strings
   for the statement being timed and for the setup code.
-  Two convenience functions were added for creating 
-  :class:`Timer` instances: 
-  ``repeat(stmt, setup, time, repeat, number)`` and 
+  Two convenience functions were added for creating
+  :class:`Timer` instances:
+  ``repeat(stmt, setup, time, repeat, number)`` and
   ``timeit(stmt, setup, time, number)`` create an instance and call
   the corresponding method. (Contributed by Erik Demaine;
   :issue:`1533909`.)
 
 * An optional ``timeout`` parameter was added to the
   :func:`urllib.urlopen` function and the
-  :class:`urllib.ftpwrapper` class constructor, as well as the 
+  :class:`urllib.ftpwrapper` class constructor, as well as the
   :func:`urllib2.urlopen` function.  The parameter specifies a timeout
   measured in seconds.   For example::
 
@@ -2219,11 +2221,11 @@
      Traceback (most recent call last):
        ...
      urllib2.URLError: <urlopen error timed out>
-     >>>   
+     >>>
 
-  (Added by Facundo Batista.) 
+  (Added by Facundo Batista.)
 
-* The :mod:`warnings` module's :func:`formatwarning` and :func:`showwarning` 
+* The :mod:`warnings` module's :func:`formatwarning` and :func:`showwarning`
   gained an optional *line* argument that can be used to supply the
   line of source code.  (Added as part of :issue:`1631171`, which re-implemented
   part of the :mod:`warnings` module in C code.)
@@ -2232,30 +2234,30 @@
   classes can now be prevented from immediately opening and binding to
   their socket by passing True as the ``bind_and_activate``
   constructor parameter.  This can be used to modify the instance's
-  :attr:`allow_reuse_address` attribute before calling the 
-  :meth:`server_bind` and :meth:`server_activate` methods to 
+  :attr:`allow_reuse_address` attribute before calling the
+  :meth:`server_bind` and :meth:`server_activate` methods to
   open the socket and begin listening for connections.
   (Contributed by Peter Parente; :issue:`1599845`.)
 
   :class:`SimpleXMLRPCServer` also has a :attr:`_send_traceback_header`
-  attribute; if true, the exception and formatted traceback are returned 
-  as HTTP headers "X-Exception" and "X-Traceback".  This feature is 
+  attribute; if true, the exception and formatted traceback are returned
+  as HTTP headers "X-Exception" and "X-Traceback".  This feature is
   for debugging purposes only and should not be used on production servers
   because the tracebacks could possibly reveal passwords or other sensitive
-  information.  (Contributed by Alan McIntyre as part of his 
+  information.  (Contributed by Alan McIntyre as part of his
   project for Google's Summer of Code 2007.)
 
 * The :mod:`xmlrpclib` module no longer automatically converts
-  :class:`datetime.date` and :class:`datetime.time` to the 
+  :class:`datetime.date` and :class:`datetime.time` to the
   :class:`xmlrpclib.DateTime` type; the conversion semantics were
   not necessarily correct for all applications.  Code using
-  :mod:`xmlrpclib` should convert :class:`date` and :class:`time` 
-  instances. (:issue:`1330538`)  The code can also handle 
+  :mod:`xmlrpclib` should convert :class:`date` and :class:`time`
+  instances. (:issue:`1330538`)  The code can also handle
   dates before 1900.  (Contributed by Ralf Schmitt; :issue:`2014`.)
 
-* The :mod:`zipfile` module's :class:`ZipFile` class now has 
-  :meth:`extract` and :meth:`extractall` methods that will unpack 
-  a single file or all the files in the archive to the current directory, or 
+* The :mod:`zipfile` module's :class:`ZipFile` class now has
+  :meth:`extract` and :meth:`extractall` methods that will unpack
+  a single file or all the files in the archive to the current directory, or
   to a specified directory::
 
     z = zipfile.ZipFile('python-251.zip')
@@ -2326,12 +2328,12 @@
 plistlib: A Property-List Parser
 --------------------------------------------------
 
-A commonly-used format on MacOS X is the ``.plist`` format, 
-which stores basic data types (numbers, strings, lists, 
+A commonly-used format on MacOS X is the ``.plist`` format,
+which stores basic data types (numbers, strings, lists,
 and dictionaries) and serializes them into an XML-based format.
 (It's a lot like the XML-RPC serialization of data types.)
 
-Despite being primarily used on MacOS X, the format 
+Despite being primarily used on MacOS X, the format
 has nothing Mac-specific about it and the Python implementation works
 on any platform that Python supports, so the :mod:`plistlib` module
 has been promoted to the standard library.
@@ -2359,7 +2361,7 @@
 
     # read/writePlist accepts file-like objects as well as paths.
     plistlib.writePlist(data_struct, sys.stdout)
-   
+
 
 .. ======================================================================
 
@@ -2378,25 +2380,25 @@
   own implementations of :cfunc:`memmove` and :cfunc:`strerror`, which
   are in the C89 standard library.
 
-* The BerkeleyDB module now has a C API object, available as 
+* The BerkeleyDB module now has a C API object, available as
   ``bsddb.db.api``.   This object can be used by other C extensions
   that wish to use the :mod:`bsddb` module for their own purposes.
   (Contributed by Duncan Grisby; :issue:`1551895`.)
 
-* The new buffer interface, previously described in 
+* The new buffer interface, previously described in
   `the PEP 3118 section <#pep-3118-revised-buffer-protocol>`__,
   adds :cfunc:`PyObject_GetBuffer` and :cfunc:`PyObject_ReleaseBuffer`,
   as well as a few other functions.
 
 * Python's use of the C stdio library is now thread-safe, or at least
   as thread-safe as the underlying library is.  A long-standing potential
-  bug occurred if one thread closed a file object while another thread 
-  was reading from or writing to the object.  In 2.6 file objects 
-  have a reference count, manipulated by the 
+  bug occurred if one thread closed a file object while another thread
+  was reading from or writing to the object.  In 2.6 file objects
+  have a reference count, manipulated by the
   :cfunc:`PyFile_IncUseCount` and :cfunc:`PyFile_DecUseCount`
-  functions.  File objects can't be closed unless the reference count 
-  is zero.  :cfunc:`PyFile_IncUseCount` should be called while the GIL 
-  is still held, before carrying out an I/O operation using the 
+  functions.  File objects can't be closed unless the reference count
+  is zero.  :cfunc:`PyFile_IncUseCount` should be called while the GIL
+  is still held, before carrying out an I/O operation using the
   ``FILE *`` pointer, and :cfunc:`PyFile_DecUseCount` should be called
   immediately after the GIL is re-acquired.
   (Contributed by Antoine Pitrou and Gregory P. Smith.)
@@ -2409,11 +2411,11 @@
   thread, the :exc:`ImportError` is raised.
   (Contributed by Christian Heimes.)
 
-* Several functions return information about the platform's 
+* Several functions return information about the platform's
   floating-point support.  :cfunc:`PyFloat_GetMax` returns
   the maximum representable floating point value,
-  and :cfunc:`PyFloat_GetMin` returns the minimum 
-  positive value.  :cfunc:`PyFloat_GetInfo` returns a dictionary 
+  and :cfunc:`PyFloat_GetMin` returns the minimum
+  positive value.  :cfunc:`PyFloat_GetInfo` returns a dictionary
   containing more information from the :file:`float.h` file, such as
   ``"mant_dig"`` (number of digits in the mantissa), ``"epsilon"``
   (smallest difference between 1.0 and the next largest value
@@ -2425,23 +2427,23 @@
   and ``PyOS_strnicmp(char*, char*, Py_ssize_t)``.
   (Contributed by Christian Heimes; :issue:`1635`.)
 
-* Many C extensions define their own little macro for adding 
-  integers and strings to the module's dictionary in the 
-  ``init*`` function.  Python 2.6 finally defines standard macros 
+* Many C extensions define their own little macro for adding
+  integers and strings to the module's dictionary in the
+  ``init*`` function.  Python 2.6 finally defines standard macros
   for adding values to a module, :cmacro:`PyModule_AddStringMacro`
-  and :cmacro:`PyModule_AddIntMacro()`.  (Contributed by 
+  and :cmacro:`PyModule_AddIntMacro()`.  (Contributed by
   Christian Heimes.)
 
 * Some macros were renamed in both 3.0 and 2.6 to make it clearer that
   they are macros,
   not functions.  :cmacro:`Py_Size()` became :cmacro:`Py_SIZE()`,
   :cmacro:`Py_Type()` became :cmacro:`Py_TYPE()`, and
-  :cmacro:`Py_Refcnt()` became :cmacro:`Py_REFCNT()`.  
+  :cmacro:`Py_Refcnt()` became :cmacro:`Py_REFCNT()`.
   The mixed-case macros are still available
   in Python 2.6 for backward compatibility.
   (:issue:`1629`)
 
-* Distutils now places C extensions it builds in a 
+* Distutils now places C extensions it builds in a
   different directory when running on a debug version of Python.
   (Contributed by Collin Winter; :issue:`1530959`.)
 
@@ -2453,7 +2455,7 @@
   always defined.
 
 * A new Makefile target, "make check", prepares the Python source tree
-  for making a patch: it fixes trailing whitespace in all modified 
+  for making a patch: it fixes trailing whitespace in all modified
   ``.py`` files, checks whether the documentation has been changed,
   and reports whether the :file:`Misc/ACKS` and :file:`Misc/NEWS` files
   have been updated.
@@ -2475,35 +2477,35 @@
 * The support for Windows 95, 98, ME and NT4 has been dropped.
   Python 2.6 requires at least Windows 2000 SP4.
 
-* The :mod:`msvcrt` module now supports 
+* The :mod:`msvcrt` module now supports
   both the normal and wide char variants of the console I/O
-  API.  The :func:`getwch` function reads a keypress and returns a Unicode 
+  API.  The :func:`getwch` function reads a keypress and returns a Unicode
   value, as does the :func:`getwche` function.  The :func:`putwch` function
   takes a Unicode character and writes it to the console.
   (Contributed by Christian Heimes.)
 
-* :func:`os.path.expandvars` will now expand environment variables 
-  in the form "%var%", and "~user" will be expanded into the 
+* :func:`os.path.expandvars` will now expand environment variables
+  in the form "%var%", and "~user" will be expanded into the
   user's home directory path.  (Contributed by Josiah Carlson.)
 
-* The :mod:`socket` module's socket objects now have an 
-  :meth:`ioctl` method that provides a limited interface to the 
+* The :mod:`socket` module's socket objects now have an
+  :meth:`ioctl` method that provides a limited interface to the
   :cfunc:`WSAIoctl` system interface.
 
-* The :mod:`_winreg` module now has a function, 
-  :func:`ExpandEnvironmentStrings`, 
+* The :mod:`_winreg` module now has a function,
+  :func:`ExpandEnvironmentStrings`,
   that expands environment variable references such as ``%NAME%``
   in an input string.  The handle objects provided by this
-  module now support the context protocol, so they can be used 
+  module now support the context protocol, so they can be used
   in :keyword:`with` statements. (Contributed by Christian Heimes.)
 
-  :mod:`_winreg` also has better support for x64 systems, 
+  :mod:`_winreg` also has better support for x64 systems,
   exposing the :func:`DisableReflectionKey`, :func:`EnableReflectionKey`,
   and :func:`QueryReflectionKey` functions, which enable and disable
   registry reflection for 32-bit processes running on 64-bit systems.
   (:issue:`1753245`)
 
-* The new default compiler on Windows is Visual Studio 2008 (VS 9.0). The 
+* The new default compiler on Windows is Visual Studio 2008 (VS 9.0). The
   build directories for Visual Studio 2003 (VS7.1) and 2005 (VS8.0)
   were moved into the PC/ directory. The new PCbuild directory supports
   cross compilation for X64, debug builds and Profile Guided Optimization
@@ -2526,7 +2528,7 @@
 
 Some of the more notable changes are:
 
-* It's now possible to prevent Python from writing any :file:`.pyc` 
+* It's now possible to prevent Python from writing any :file:`.pyc`
   or :file:`.pyo` files by either supplying the :option:`-B` switch
   or setting the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable
   to any non-empty string when running the Python interpreter.  These
@@ -2547,23 +2549,23 @@
 * The :meth:`__init__` method of :class:`collections.deque`
   now clears any existing contents of the deque
   before adding elements from the iterable.  This change makes the
-  behavior match that of ``list.__init__()``.  
+  behavior match that of ``list.__init__()``.
 
-* The :class:`Decimal` constructor now accepts leading and trailing 
+* The :class:`Decimal` constructor now accepts leading and trailing
   whitespace when passed a string.  Previously it would raise an
   :exc:`InvalidOperation` exception.  On the other hand, the
   :meth:`create_decimal` method of :class:`Context` objects now
-  explicitly disallows extra whitespace, raising a 
+  explicitly disallows extra whitespace, raising a
   :exc:`ConversionSyntax` exception.
 
-* Due to an implementation accident, if you passed a file path to 
+* Due to an implementation accident, if you passed a file path to
   the built-in  :func:`__import__` function, it would actually import
-  the specified file.  This was never intended to work, however, and 
-  the implementation now explicitly checks for this case and raises 
+  the specified file.  This was never intended to work, however, and
+  the implementation now explicitly checks for this case and raises
   an :exc:`ImportError`.
 
 * C API: the :cfunc:`PyImport_Import` and :cfunc:`PyImport_ImportModule`
-  functions now default to absolute imports, not relative imports.  
+  functions now default to absolute imports, not relative imports.
   This will affect C extensions that import other modules.
 
 * The :mod:`socket` module exception :exc:`socket.error` now inherits
@@ -2572,21 +2574,21 @@
   (Implemented by Gregory P. Smith; :issue:`1706815`.)
 
 * The :mod:`xmlrpclib` module no longer automatically converts
-  :class:`datetime.date` and :class:`datetime.time` to the 
+  :class:`datetime.date` and :class:`datetime.time` to the
   :class:`xmlrpclib.DateTime` type; the conversion semantics were
   not necessarily correct for all applications.  Code using
-  :mod:`xmlrpclib` should convert :class:`date` and :class:`time` 
+  :mod:`xmlrpclib` should convert :class:`date` and :class:`time`
   instances. (:issue:`1330538`)
 
-* (3.0-warning mode) The :class:`Exception` class now warns 
-  when accessed using slicing or index access; having 
+* (3.0-warning mode) The :class:`Exception` class now warns
+  when accessed using slicing or index access; having
   :class:`Exception` behave like a tuple is being phased out.
 
 * (3.0-warning mode) inequality comparisons between two dictionaries
   or two objects that don't implement comparison methods are reported
   as warnings.  ``dict1 == dict2`` still works, but ``dict1 < dict2``
   is being phased out.
-  
+
   Comparisons between cells, which are an implementation detail of Python's
   scoping rules, also cause warnings because such comparisons are forbidden
   entirely in 3.0.
@@ -2600,6 +2602,6 @@
 ================
 
 The author would like to thank the following people for offering suggestions,
-corrections and assistance with various drafts of this article: 
+corrections and assistance with various drafts of this article:
 Georg Brandl, Jim Jewett.
 

Modified: python/branches/tlee-ast-optimize/Include/pyport.h
==============================================================================
--- python/branches/tlee-ast-optimize/Include/pyport.h	(original)
+++ python/branches/tlee-ast-optimize/Include/pyport.h	Sun May 25 10:45:18 2008
@@ -454,6 +454,13 @@
 extern char * _getpty(int *, int, mode_t, int);
 #endif
 
+/* On QNX 6, struct termio must be declared by including sys/termio.h
+   if TCGETA, TCSETA, TCSETAW, or TCSETAF are used.  sys/termio.h must
+   be included before termios.h or it will generate an error. */
+#ifdef HAVE_SYS_TERMIO_H
+#include <sys/termio.h>
+#endif
+
 #if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY)
 #if !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H)
 /* BSDI does not supply a prototype for the 'openpty' and 'forkpty'

Modified: python/branches/tlee-ast-optimize/Lib/BaseHTTPServer.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/BaseHTTPServer.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/BaseHTTPServer.py	Sun May 25 10:45:18 2008
@@ -74,7 +74,7 @@
 import time
 import socket # For gethostbyaddr()
 import mimetools
-import socketserver
+import SocketServer
 
 # Default error message template
 DEFAULT_ERROR_MESSAGE = """\
@@ -94,19 +94,19 @@
 def _quote_html(html):
     return html.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
 
-class HTTPServer(socketserver.TCPServer):
+class HTTPServer(SocketServer.TCPServer):
 
     allow_reuse_address = 1    # Seems to make sense in testing environment
 
     def server_bind(self):
         """Override server_bind to store the server name."""
-        socketserver.TCPServer.server_bind(self)
+        SocketServer.TCPServer.server_bind(self)
         host, port = self.socket.getsockname()[:2]
         self.server_name = socket.getfqdn(host)
         self.server_port = port
 
 
-class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
+class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
 
     """HTTP request handler base class.
 

Modified: python/branches/tlee-ast-optimize/Lib/SimpleXMLRPCServer.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/SimpleXMLRPCServer.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/SimpleXMLRPCServer.py	Sun May 25 10:45:18 2008
@@ -101,7 +101,7 @@
 
 import xmlrpclib
 from xmlrpclib import Fault
-import socketserver
+import SocketServer
 import BaseHTTPServer
 import sys
 import os
@@ -512,7 +512,7 @@
         if self.server.logRequests:
             BaseHTTPServer.BaseHTTPRequestHandler.log_request(self, code, size)
 
-class SimpleXMLRPCServer(socketserver.TCPServer,
+class SimpleXMLRPCServer(SocketServer.TCPServer,
                          SimpleXMLRPCDispatcher):
     """Simple XML-RPC server.
 
@@ -536,7 +536,7 @@
         self.logRequests = logRequests
 
         SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
-        socketserver.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)
+        SocketServer.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)
 
         # [Bug #1222790] If possible, set close-on-exec flag; if a
         # method spawns a subprocess, the subprocess shouldn't have

Modified: python/branches/tlee-ast-optimize/Lib/bdb.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/bdb.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/bdb.py	Sun May 25 10:45:18 2008
@@ -325,7 +325,7 @@
     #
 
     def format_stack_entry(self, frame_lineno, lprefix=': '):
-        import linecache, reprlib
+        import linecache, repr
         frame, lineno = frame_lineno
         filename = self.canonic(frame.f_code.co_filename)
         s = '%s(%r)' % (filename, lineno)
@@ -338,13 +338,13 @@
         else:
             args = None
         if args:
-            s = s + reprlib.repr(args)
+            s = s + repr.repr(args)
         else:
             s = s + '()'
         if '__return__' in frame.f_locals:
             rv = frame.f_locals['__return__']
             s = s + '->'
-            s = s + reprlib.repr(rv)
+            s = s + repr.repr(rv)
         line = linecache.getline(filename, lineno)
         if line: s = s + lprefix + line.strip()
         return s

Modified: python/branches/tlee-ast-optimize/Lib/bsddb/db.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/bsddb/db.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/bsddb/db.py	Sun May 25 10:45:18 2008
@@ -48,4 +48,4 @@
     from _bsddb import __version__
 
 if version() < (3, 2, 0):
-    raise ImportError, "correct BerkeleyDB symbols not found.  Perhaps python was statically linked with an older version?"
+    raise ImportError, "correct Berkeley DB symbols not found.  Perhaps python was statically linked with an older version?"

Modified: python/branches/tlee-ast-optimize/Lib/bsddb/dbtables.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/bsddb/dbtables.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/bsddb/dbtables.py	Sun May 25 10:45:18 2008
@@ -13,7 +13,7 @@
 #   --  Gregory P. Smith <greg at krypto.org>
 
 # This provides a simple database table interface built on top of
-# the Python BerkeleyDB 3 interface.
+# the Python Berkeley DB 3 interface.
 #
 _cvsid = '$Id$'
 
@@ -139,7 +139,7 @@
                  recover=0, dbflags=0):
         """bsdTableDB(filename, dbhome, create=0, truncate=0, mode=0600)
 
-        Open database name in the dbhome BerkeleyDB directory.
+        Open database name in the dbhome Berkeley DB directory.
         Use keyword arguments when calling this constructor.
         """
         self.db = None

Modified: python/branches/tlee-ast-optimize/Lib/bsddb/test/test_all.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/bsddb/test/test_all.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/bsddb/test/test_all.py	Sun May 25 10:45:18 2008
@@ -67,6 +67,8 @@
     return path
 
 
+# NOTE: This path is overridden by a unique one and cleaned up
+# afterwards when run under regrtest via Lib/test/test_bsddb3.py.
 get_new_path.prefix="/tmp/z-Berkeley_DB"
 get_new_path.num=0
 
@@ -97,7 +99,7 @@
 test_all.verbose = verbose
 
 
-def suite():
+def suite(module_prefix='', timing_check=None):
     try:
         # this is special, it used to segfault the interpreter
         import test_1413192
@@ -107,14 +109,14 @@
     test_modules = [
         'test_associate',
         'test_basics',
-        'test_compat',
         'test_compare',
+        'test_compat',
+        'test_cursor_pget_bug',
         'test_dbobj',
         'test_dbshelve',
         'test_dbtables',
-        'test_early_close',
         'test_distributed_transactions',
-        'test_replication',
+        'test_early_close',
         'test_get_none',
         'test_join',
         'test_lock',
@@ -122,15 +124,21 @@
         'test_pickle',
         'test_queue',
         'test_recno',
-        'test_thread',
+        'test_replication',
         'test_sequence',
-        'test_cursor_pget_bug',
+        'test_thread',
         ]
 
     alltests = unittest.TestSuite()
     for name in test_modules:
-        module = __import__(name)
+        #module = __import__(name)
+        # Do it this way so that suite may be called externally via
+        # python's Lib/test/test_bsddb3.
+        module = __import__(module_prefix+name, globals(), locals(), name)
+
         alltests.addTest(module.test_suite())
+        if timing_check:
+            alltests.addTest(unittest.makeSuite(timing_check))
     return alltests
 
 

Modified: python/branches/tlee-ast-optimize/Lib/bsddb/test/test_replication.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/bsddb/test/test_replication.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/bsddb/test/test_replication.py	Sun May 25 10:45:18 2008
@@ -2,6 +2,7 @@
 """
 
 import os
+import time
 import unittest
 
 try:
@@ -57,10 +58,12 @@
         self.dbenvMaster.set_event_notify(confirmed_master)
         self.dbenvClient.set_event_notify(client_startupdone)
 
-        self.dbenvMaster.repmgr_set_local_site("127.0.0.1",46117)
-        self.dbenvClient.repmgr_set_local_site("127.0.0.1",46118)
-        self.dbenvMaster.repmgr_add_remote_site("127.0.0.1",46118)
-        self.dbenvClient.repmgr_add_remote_site("127.0.0.1",46117)
+        master_port = test_support.find_unused_port()
+        self.dbenvMaster.repmgr_set_local_site("127.0.0.1", master_port)
+        client_port = test_support.find_unused_port()
+        self.dbenvClient.repmgr_set_local_site("127.0.0.1", client_port)
+        self.dbenvMaster.repmgr_add_remote_site("127.0.0.1", client_port)
+        self.dbenvClient.repmgr_add_remote_site("127.0.0.1", master_port)
         self.dbenvMaster.rep_set_nsites(2)
         self.dbenvClient.rep_set_nsites(2)
         self.dbenvMaster.rep_set_priority(10)
@@ -91,10 +94,9 @@
         # The timeout is necessary in BDB 4.5, since DB_EVENT_REP_STARTUPDONE
         # is not generated if the master has no new transactions.
         # This is solved in BDB 4.6 (#15542).
-        import time
         timeout = time.time()+2
         while (time.time()<timeout) and not (self.confirmed_master and self.client_startupdone) :
-            time.sleep(0.001)
+            time.sleep(0.02)
         if db.version() >= (4,6) :
             self.assertTrue(time.time()<timeout)
         else :
@@ -103,14 +105,14 @@
         d = self.dbenvMaster.repmgr_site_list()
         self.assertEquals(len(d), 1)
         self.assertEquals(d[0][0], "127.0.0.1")
-        self.assertEquals(d[0][1], 46118)
+        self.assertEquals(d[0][1], client_port)
         self.assertTrue((d[0][2]==db.DB_REPMGR_CONNECTED) or \
                 (d[0][2]==db.DB_REPMGR_DISCONNECTED))
 
         d = self.dbenvClient.repmgr_site_list()
         self.assertEquals(len(d), 1)
         self.assertEquals(d[0][0], "127.0.0.1")
-        self.assertEquals(d[0][1], 46117)
+        self.assertEquals(d[0][1], master_port)
         self.assertTrue((d[0][2]==db.DB_REPMGR_CONNECTED) or \
                 (d[0][2]==db.DB_REPMGR_DISCONNECTED))
 

Modified: python/branches/tlee-ast-optimize/Lib/bsddb/test/test_sequence.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/bsddb/test/test_sequence.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/bsddb/test/test_sequence.py	Sun May 25 10:45:18 2008
@@ -110,7 +110,7 @@
             self.assertRaises(db.DBNotFoundError, seq.open,
                     key='id', txn=None, flags=0)
 
-            self.assertRaises(db.DBNotFoundError, seq.stat)
+            self.assertRaises(db.DBInvalidArgError, seq.stat)
 
             d.close()
 

Deleted: python/branches/tlee-ast-optimize/Lib/configparser.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/configparser.py	Sun May 25 10:45:18 2008
+++ (empty file)
@@ -1,669 +0,0 @@
-"""Configuration file parser.
-
-A setup file consists of sections, lead by a "[section]" header,
-and followed by "name: value" entries, with continuations and such in
-the style of RFC 822.
-
-The option values can contain format strings which refer to other values in
-the same section, or values in a special [DEFAULT] section.
-
-For example:
-
-    something: %(dir)s/whatever
-
-would resolve the "%(dir)s" to the value of dir.  All reference
-expansions are done late, on demand.
-
-Intrinsic defaults can be specified by passing them into the
-ConfigParser constructor as a dictionary.
-
-class:
-
-ConfigParser -- responsible for parsing a list of
-                configuration files, and managing the parsed database.
-
-    methods:
-
-    __init__(defaults=None)
-        create the parser and specify a dictionary of intrinsic defaults.  The
-        keys must be strings, the values must be appropriate for %()s string
-        interpolation.  Note that `__name__' is always an intrinsic default;
-        its value is the section's name.
-
-    sections()
-        return all the configuration section names, sans DEFAULT
-
-    has_section(section)
-        return whether the given section exists
-
-    has_option(section, option)
-        return whether the given option exists in the given section
-
-    options(section)
-        return list of configuration options for the named section
-
-    read(filenames)
-        read and parse the list of named configuration files, given by
-        name.  A single filename is also allowed.  Non-existing files
-        are ignored.  Return list of successfully read files.
-
-    readfp(fp, filename=None)
-        read and parse one configuration file, given as a file object.
-        The filename defaults to fp.name; it is only used in error
-        messages (if fp has no `name' attribute, the string `<???>' is used).
-
-    get(section, option, raw=False, vars=None)
-        return a string value for the named option.  All % interpolations are
-        expanded in the return values, based on the defaults passed into the
-        constructor and the DEFAULT section.  Additional substitutions may be
-        provided using the `vars' argument, which must be a dictionary whose
-        contents override any pre-existing defaults.
-
-    getint(section, options)
-        like get(), but convert value to an integer
-
-    getfloat(section, options)
-        like get(), but convert value to a float
-
-    getboolean(section, options)
-        like get(), but convert value to a boolean (currently case
-        insensitively defined as 0, false, no, off for False, and 1, true,
-        yes, on for True).  Returns False or True.
-
-    items(section, raw=False, vars=None)
-        return a list of tuples with (name, value) for each option
-        in the section.
-
-    remove_section(section)
-        remove the given file section and all its options
-
-    remove_option(section, option)
-        remove the given option from the given section
-
-    set(section, option, value)
-        set the given option
-
-    write(fp)
-        write the configuration state in .ini format
-"""
-
-import re
-
-__all__ = ["NoSectionError", "DuplicateSectionError", "NoOptionError",
-           "InterpolationError", "InterpolationDepthError",
-           "InterpolationSyntaxError", "ParsingError",
-           "MissingSectionHeaderError",
-           "ConfigParser", "SafeConfigParser", "RawConfigParser",
-           "DEFAULTSECT", "MAX_INTERPOLATION_DEPTH"]
-
-DEFAULTSECT = "DEFAULT"
-
-MAX_INTERPOLATION_DEPTH = 10
-
-
-
-# exception classes
-class Error(Exception):
-    """Base class for ConfigParser exceptions."""
-
-    def _get_message(self):
-        """Getter for 'message'; needed only to override deprecation in
-        BaseException."""
-        return self.__message
-
-    def _set_message(self, value):
-        """Setter for 'message'; needed only to override deprecation in
-        BaseException."""
-        self.__message = value
-
-    # BaseException.message has been deprecated since Python 2.6.  To prevent
-    # DeprecationWarning from popping up over this pre-existing attribute, use
-    # a new property that takes lookup precedence.
-    message = property(_get_message, _set_message)
-
-    def __init__(self, msg=''):
-        self.message = msg
-        Exception.__init__(self, msg)
-
-    def __repr__(self):
-        return self.message
-
-    __str__ = __repr__
-
-class NoSectionError(Error):
-    """Raised when no section matches a requested option."""
-
-    def __init__(self, section):
-        Error.__init__(self, 'No section: %r' % (section,))
-        self.section = section
-
-class DuplicateSectionError(Error):
-    """Raised when a section is multiply-created."""
-
-    def __init__(self, section):
-        Error.__init__(self, "Section %r already exists" % section)
-        self.section = section
-
-class NoOptionError(Error):
-    """A requested option was not found."""
-
-    def __init__(self, option, section):
-        Error.__init__(self, "No option %r in section: %r" %
-                       (option, section))
-        self.option = option
-        self.section = section
-
-class InterpolationError(Error):
-    """Base class for interpolation-related exceptions."""
-
-    def __init__(self, option, section, msg):
-        Error.__init__(self, msg)
-        self.option = option
-        self.section = section
-
-class InterpolationMissingOptionError(InterpolationError):
-    """A string substitution required a setting which was not available."""
-
-    def __init__(self, option, section, rawval, reference):
-        msg = ("Bad value substitution:\n"
-               "\tsection: [%s]\n"
-               "\toption : %s\n"
-               "\tkey    : %s\n"
-               "\trawval : %s\n"
-               % (section, option, reference, rawval))
-        InterpolationError.__init__(self, option, section, msg)
-        self.reference = reference
-
-class InterpolationSyntaxError(InterpolationError):
-    """Raised when the source text into which substitutions are made
-    does not conform to the required syntax."""
-
-class InterpolationDepthError(InterpolationError):
-    """Raised when substitutions are nested too deeply."""
-
-    def __init__(self, option, section, rawval):
-        msg = ("Value interpolation too deeply recursive:\n"
-               "\tsection: [%s]\n"
-               "\toption : %s\n"
-               "\trawval : %s\n"
-               % (section, option, rawval))
-        InterpolationError.__init__(self, option, section, msg)
-
-class ParsingError(Error):
-    """Raised when a configuration file does not follow legal syntax."""
-
-    def __init__(self, filename):
-        Error.__init__(self, 'File contains parsing errors: %s' % filename)
-        self.filename = filename
-        self.errors = []
-
-    def append(self, lineno, line):
-        self.errors.append((lineno, line))
-        self.message += '\n\t[line %2d]: %s' % (lineno, line)
-
-class MissingSectionHeaderError(ParsingError):
-    """Raised when a key-value pair is found before any section header."""
-
-    def __init__(self, filename, lineno, line):
-        Error.__init__(
-            self,
-            'File contains no section headers.\nfile: %s, line: %d\n%r' %
-            (filename, lineno, line))
-        self.filename = filename
-        self.lineno = lineno
-        self.line = line
-
-
-class RawConfigParser:
-    def __init__(self, defaults=None, dict_type=dict):
-        self._dict = dict_type
-        self._sections = self._dict()
-        self._defaults = self._dict()
-        if defaults:
-            for key, value in defaults.items():
-                self._defaults[self.optionxform(key)] = value
-
-    def defaults(self):
-        return self._defaults
-
-    def sections(self):
-        """Return a list of section names, excluding [DEFAULT]"""
-        # self._sections will never have [DEFAULT] in it
-        return self._sections.keys()
-
-    def add_section(self, section):
-        """Create a new section in the configuration.
-
-        Raise DuplicateSectionError if a section by the specified name
-        already exists. Raise ValueError if name is DEFAULT or any of it's
-        case-insensitive variants.
-        """
-        if section.lower() == "default":
-            raise ValueError, 'Invalid section name: %s' % section
-
-        if section in self._sections:
-            raise DuplicateSectionError(section)
-        self._sections[section] = self._dict()
-
-    def has_section(self, section):
-        """Indicate whether the named section is present in the configuration.
-
-        The DEFAULT section is not acknowledged.
-        """
-        return section in self._sections
-
-    def options(self, section):
-        """Return a list of option names for the given section name."""
-        try:
-            opts = self._sections[section].copy()
-        except KeyError:
-            raise NoSectionError(section)
-        opts.update(self._defaults)
-        if '__name__' in opts:
-            del opts['__name__']
-        return opts.keys()
-
-    def read(self, filenames):
-        """Read and parse a filename or a list of filenames.
-
-        Files that cannot be opened are silently ignored; this is
-        designed so that you can specify a list of potential
-        configuration file locations (e.g. current directory, user's
-        home directory, systemwide directory), and all existing
-        configuration files in the list will be read.  A single
-        filename may also be given.
-
-        Return list of successfully read files.
-        """
-        if isinstance(filenames, basestring):
-            filenames = [filenames]
-        read_ok = []
-        for filename in filenames:
-            try:
-                fp = open(filename)
-            except IOError:
-                continue
-            self._read(fp, filename)
-            fp.close()
-            read_ok.append(filename)
-        return read_ok
-
-    def readfp(self, fp, filename=None):
-        """Like read() but the argument must be a file-like object.
-
-        The `fp' argument must have a `readline' method.  Optional
-        second argument is the `filename', which if not given, is
-        taken from fp.name.  If fp has no `name' attribute, `<???>' is
-        used.
-
-        """
-        if filename is None:
-            try:
-                filename = fp.name
-            except AttributeError:
-                filename = '<???>'
-        self._read(fp, filename)
-
-    def get(self, section, option):
-        opt = self.optionxform(option)
-        if section not in self._sections:
-            if section != DEFAULTSECT:
-                raise NoSectionError(section)
-            if opt in self._defaults:
-                return self._defaults[opt]
-            else:
-                raise NoOptionError(option, section)
-        elif opt in self._sections[section]:
-            return self._sections[section][opt]
-        elif opt in self._defaults:
-            return self._defaults[opt]
-        else:
-            raise NoOptionError(option, section)
-
-    def items(self, section):
-        try:
-            d2 = self._sections[section]
-        except KeyError:
-            if section != DEFAULTSECT:
-                raise NoSectionError(section)
-            d2 = self._dict()
-        d = self._defaults.copy()
-        d.update(d2)
-        if "__name__" in d:
-            del d["__name__"]
-        return d.items()
-
-    def _get(self, section, conv, option):
-        return conv(self.get(section, option))
-
-    def getint(self, section, option):
-        return self._get(section, int, option)
-
-    def getfloat(self, section, option):
-        return self._get(section, float, option)
-
-    _boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True,
-                       '0': False, 'no': False, 'false': False, 'off': False}
-
-    def getboolean(self, section, option):
-        v = self.get(section, option)
-        if v.lower() not in self._boolean_states:
-            raise ValueError, 'Not a boolean: %s' % v
-        return self._boolean_states[v.lower()]
-
-    def optionxform(self, optionstr):
-        return optionstr.lower()
-
-    def has_option(self, section, option):
-        """Check for the existence of a given option in a given section."""
-        if not section or section == DEFAULTSECT:
-            option = self.optionxform(option)
-            return option in self._defaults
-        elif section not in self._sections:
-            return False
-        else:
-            option = self.optionxform(option)
-            return (option in self._sections[section]
-                    or option in self._defaults)
-
-    def set(self, section, option, value):
-        """Set an option."""
-        if not section or section == DEFAULTSECT:
-            sectdict = self._defaults
-        else:
-            try:
-                sectdict = self._sections[section]
-            except KeyError:
-                raise NoSectionError(section)
-        sectdict[self.optionxform(option)] = value
-
-    def write(self, fp):
-        """Write an .ini-format representation of the configuration state."""
-        if self._defaults:
-            fp.write("[%s]\n" % DEFAULTSECT)
-            for (key, value) in self._defaults.items():
-                fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t')))
-            fp.write("\n")
-        for section in self._sections:
-            fp.write("[%s]\n" % section)
-            for (key, value) in self._sections[section].items():
-                if key != "__name__":
-                    fp.write("%s = %s\n" %
-                             (key, str(value).replace('\n', '\n\t')))
-            fp.write("\n")
-
-    def remove_option(self, section, option):
-        """Remove an option."""
-        if not section or section == DEFAULTSECT:
-            sectdict = self._defaults
-        else:
-            try:
-                sectdict = self._sections[section]
-            except KeyError:
-                raise NoSectionError(section)
-        option = self.optionxform(option)
-        existed = option in sectdict
-        if existed:
-            del sectdict[option]
-        return existed
-
-    def remove_section(self, section):
-        """Remove a file section."""
-        existed = section in self._sections
-        if existed:
-            del self._sections[section]
-        return existed
-
-    #
-    # Regular expressions for parsing section headers and options.
-    #
-    SECTCRE = re.compile(
-        r'\['                                 # [
-        r'(?P<header>[^]]+)'                  # very permissive!
-        r'\]'                                 # ]
-        )
-    OPTCRE = re.compile(
-        r'(?P<option>[^:=\s][^:=]*)'          # very permissive!
-        r'\s*(?P<vi>[:=])\s*'                 # any number of space/tab,
-                                              # followed by separator
-                                              # (either : or =), followed
-                                              # by any # space/tab
-        r'(?P<value>.*)$'                     # everything up to eol
-        )
-
-    def _read(self, fp, fpname):
-        """Parse a sectioned setup file.
-
-        The sections in setup file contains a title line at the top,
-        indicated by a name in square brackets (`[]'), plus key/value
-        options lines, indicated by `name: value' format lines.
-        Continuations are represented by an embedded newline then
-        leading whitespace.  Blank lines, lines beginning with a '#',
-        and just about everything else are ignored.
-        """
-        cursect = None                            # None, or a dictionary
-        optname = None
-        lineno = 0
-        e = None                                  # None, or an exception
-        while True:
-            line = fp.readline()
-            if not line:
-                break
-            lineno = lineno + 1
-            # comment or blank line?
-            if line.strip() == '' or line[0] in '#;':
-                continue
-            if line.split(None, 1)[0].lower() == 'rem' and line[0] in "rR":
-                # no leading whitespace
-                continue
-            # continuation line?
-            if line[0].isspace() and cursect is not None and optname:
-                value = line.strip()
-                if value:
-                    cursect[optname] = "%s\n%s" % (cursect[optname], value)
-            # a section header or option header?
-            else:
-                # is it a section header?
-                mo = self.SECTCRE.match(line)
-                if mo:
-                    sectname = mo.group('header')
-                    if sectname in self._sections:
-                        cursect = self._sections[sectname]
-                    elif sectname == DEFAULTSECT:
-                        cursect = self._defaults
-                    else:
-                        cursect = self._dict()
-                        cursect['__name__'] = sectname
-                        self._sections[sectname] = cursect
-                    # So sections can't start with a continuation line
-                    optname = None
-                # no section header in the file?
-                elif cursect is None:
-                    raise MissingSectionHeaderError(fpname, lineno, line)
-                # an option line?
-                else:
-                    mo = self.OPTCRE.match(line)
-                    if mo:
-                        optname, vi, optval = mo.group('option', 'vi', 'value')
-                        if vi in ('=', ':') and ';' in optval:
-                            # ';' is a comment delimiter only if it follows
-                            # a spacing character
-                            pos = optval.find(';')
-                            if pos != -1 and optval[pos-1].isspace():
-                                optval = optval[:pos]
-                        optval = optval.strip()
-                        # allow empty values
-                        if optval == '""':
-                            optval = ''
-                        optname = self.optionxform(optname.rstrip())
-                        cursect[optname] = optval
-                    else:
-                        # a non-fatal parsing error occurred.  set up the
-                        # exception but keep going. the exception will be
-                        # raised at the end of the file and will contain a
-                        # list of all bogus lines
-                        if not e:
-                            e = ParsingError(fpname)
-                        e.append(lineno, repr(line))
-        # if any parsing errors occurred, raise an exception
-        if e:
-            raise e
-
-
-class ConfigParser(RawConfigParser):
-
-    def get(self, section, option, raw=False, vars=None):
-        """Get an option value for a given section.
-
-        All % interpolations are expanded in the return values, based on the
-        defaults passed into the constructor, unless the optional argument
-        `raw' is true.  Additional substitutions may be provided using the
-        `vars' argument, which must be a dictionary whose contents overrides
-        any pre-existing defaults.
-
-        The section DEFAULT is special.
-        """
-        d = self._defaults.copy()
-        try:
-            d.update(self._sections[section])
-        except KeyError:
-            if section != DEFAULTSECT:
-                raise NoSectionError(section)
-        # Update with the entry specific variables
-        if vars:
-            for key, value in vars.items():
-                d[self.optionxform(key)] = value
-        option = self.optionxform(option)
-        try:
-            value = d[option]
-        except KeyError:
-            raise NoOptionError(option, section)
-
-        if raw:
-            return value
-        else:
-            return self._interpolate(section, option, value, d)
-
-    def items(self, section, raw=False, vars=None):
-        """Return a list of tuples with (name, value) for each option
-        in the section.
-
-        All % interpolations are expanded in the return values, based on the
-        defaults passed into the constructor, unless the optional argument
-        `raw' is true.  Additional substitutions may be provided using the
-        `vars' argument, which must be a dictionary whose contents overrides
-        any pre-existing defaults.
-
-        The section DEFAULT is special.
-        """
-        d = self._defaults.copy()
-        try:
-            d.update(self._sections[section])
-        except KeyError:
-            if section != DEFAULTSECT:
-                raise NoSectionError(section)
-        # Update with the entry specific variables
-        if vars:
-            for key, value in vars.items():
-                d[self.optionxform(key)] = value
-        options = d.keys()
-        if "__name__" in options:
-            options.remove("__name__")
-        if raw:
-            return [(option, d[option])
-                    for option in options]
-        else:
-            return [(option, self._interpolate(section, option, d[option], d))
-                    for option in options]
-
-    def _interpolate(self, section, option, rawval, vars):
-        # do the string interpolation
-        value = rawval
-        depth = MAX_INTERPOLATION_DEPTH
-        while depth:                    # Loop through this until it's done
-            depth -= 1
-            if "%(" in value:
-                value = self._KEYCRE.sub(self._interpolation_replace, value)
-                try:
-                    value = value % vars
-                except KeyError, e:
-                    raise InterpolationMissingOptionError(
-                        option, section, rawval, e[0])
-            else:
-                break
-        if "%(" in value:
-            raise InterpolationDepthError(option, section, rawval)
-        return value
-
-    _KEYCRE = re.compile(r"%\(([^)]*)\)s|.")
-
-    def _interpolation_replace(self, match):
-        s = match.group(1)
-        if s is None:
-            return match.group()
-        else:
-            return "%%(%s)s" % self.optionxform(s)
-
-
-class SafeConfigParser(ConfigParser):
-
-    def _interpolate(self, section, option, rawval, vars):
-        # do the string interpolation
-        L = []
-        self._interpolate_some(option, L, rawval, section, vars, 1)
-        return ''.join(L)
-
-    _interpvar_re = re.compile(r"%\(([^)]+)\)s")
-    _badpercent_re = re.compile(r"%[^%]|%$")
-
-    def _interpolate_some(self, option, accum, rest, section, map, depth):
-        if depth > MAX_INTERPOLATION_DEPTH:
-            raise InterpolationDepthError(option, section, rest)
-        while rest:
-            p = rest.find("%")
-            if p < 0:
-                accum.append(rest)
-                return
-            if p > 0:
-                accum.append(rest[:p])
-                rest = rest[p:]
-            # p is no longer used
-            c = rest[1:2]
-            if c == "%":
-                accum.append("%")
-                rest = rest[2:]
-            elif c == "(":
-                m = self._interpvar_re.match(rest)
-                if m is None:
-                    raise InterpolationSyntaxError(option, section,
-                        "bad interpolation variable reference %r" % rest)
-                var = self.optionxform(m.group(1))
-                rest = rest[m.end():]
-                try:
-                    v = map[var]
-                except KeyError:
-                    raise InterpolationMissingOptionError(
-                        option, section, rest, var)
-                if "%" in v:
-                    self._interpolate_some(option, accum, v,
-                                           section, map, depth + 1)
-                else:
-                    accum.append(v)
-            else:
-                raise InterpolationSyntaxError(
-                    option, section,
-                    "'%%' must be followed by '%%' or '(', found: %r" % (rest,))
-
-    def set(self, section, option, value):
-        """Set an option.  Extend ConfigParser.set: check for string values."""
-        if not isinstance(value, basestring):
-            raise TypeError("option values must be strings")
-        # check for bad percent signs:
-        # first, replace all "good" interpolations
-        tmp_value = self._interpvar_re.sub('', value)
-        # then, check if there's a lone percent sign left
-        m = self._badpercent_re.search(tmp_value)
-        if m:
-            raise ValueError("invalid interpolation syntax in %r at "
-                             "position %d" % (value, m.start()))
-        ConfigParser.set(self, section, option, value)

Modified: python/branches/tlee-ast-optimize/Lib/copy.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/copy.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/copy.py	Sun May 25 10:45:18 2008
@@ -399,16 +399,17 @@
     print l2
     l.append({l[1]: l, 'xyz': l[2]})
     l3 = copy(l)
-    import reprlib
-    print map(reprlib.repr, l)
-    print map(reprlib.repr, l1)
-    print map(reprlib.repr, l2)
-    print map(reprlib.repr, l3)
+    import repr
+    print map(repr.repr, l)
+    print map(repr.repr, l1)
+    print map(repr.repr, l2)
+    print map(repr.repr, l3)
     l3 = deepcopy(l)
-    print map(reprlib.repr, l)
-    print map(reprlib.repr, l1)
-    print map(reprlib.repr, l2)
-    print map(reprlib.repr, l3)
+    import repr
+    print map(repr.repr, l)
+    print map(repr.repr, l1)
+    print map(repr.repr, l2)
+    print map(repr.repr, l3)
 
 if __name__ == '__main__':
     _test()

Modified: python/branches/tlee-ast-optimize/Lib/ctypes/test/__init__.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/ctypes/test/__init__.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/ctypes/test/__init__.py	Sun May 25 10:45:18 2008
@@ -50,11 +50,16 @@
             if fnmatch.fnmatchcase(fnm, mask):
                 yield "%s.%s" % (package.__name__, os.path.splitext(fnm)[0])
 
-def get_tests(package, mask, verbosity):
+def get_tests(package, mask, verbosity, exclude=()):
     """Return a list of skipped test modules, and a list of test cases."""
     tests = []
     skipped = []
     for modname in find_package_modules(package, mask):
+        if modname.split(".")[-1] in exclude:
+            skipped.append(modname)
+            if verbosity > 1:
+                print >> sys.stderr, "Skipped %s: excluded" % modname
+            continue
         try:
             mod = __import__(modname, globals(), locals(), ['*'])
         except ResourceDenied, detail:
@@ -151,12 +156,13 @@
 
 def main(*packages):
     try:
-        opts, args = getopt.getopt(sys.argv[1:], "rqvu:")
+        opts, args = getopt.getopt(sys.argv[1:], "rqvu:x:")
     except getopt.error:
         return usage()
 
     verbosity = 1
     search_leaks = False
+    exclude = []
     for flag, value in opts:
         if flag == "-q":
             verbosity -= 1
@@ -171,17 +177,19 @@
             search_leaks = True
         elif flag == "-u":
             use_resources.extend(value.split(","))
+        elif flag == "-x":
+            exclude.append(value.split(","))
 
     mask = "test_*.py"
     if args:
         mask = args[0]
 
     for package in packages:
-        run_tests(package, mask, verbosity, search_leaks)
+        run_tests(package, mask, verbosity, search_leaks, exclude)
 
 
-def run_tests(package, mask, verbosity, search_leaks):
-    skipped, testcases = get_tests(package, mask, verbosity)
+def run_tests(package, mask, verbosity, search_leaks, exclude):
+    skipped, testcases = get_tests(package, mask, verbosity, exclude)
     runner = TestRunner(verbosity=verbosity)
 
     suites = [unittest.makeSuite(o) for o in testcases]

Modified: python/branches/tlee-ast-optimize/Lib/ctypes/test/runtests.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/ctypes/test/runtests.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/ctypes/test/runtests.py	Sun May 25 10:45:18 2008
@@ -8,6 +8,8 @@
          Add resources to the lits of allowed resources. '*' allows all
          resources.
   -v     verbose mode: print the test currently executed
+  -x<test1[,test2...]>
+         Exclude specified tests.
   mask   mask to select filenames containing testcases, wildcards allowed
 """
 import sys

Modified: python/branches/tlee-ast-optimize/Lib/distutils/command/upload.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/distutils/command/upload.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/distutils/command/upload.py	Sun May 25 10:45:18 2008
@@ -14,11 +14,7 @@
 import base64
 import urlparse
 import cStringIO as StringIO
-try:
-    from configparser import ConfigParser
-except ImportError:
-    # For backward-compatibility with Python versions < 2.6.
-    from ConfigParser import ConfigParser
+from ConfigParser import ConfigParser
 
 
 class upload(PyPIRCCommand):

Modified: python/branches/tlee-ast-optimize/Lib/distutils/config.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/distutils/config.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/distutils/config.py	Sun May 25 10:45:18 2008
@@ -5,11 +5,7 @@
 """
 import os
 import sys
-try:
-    from configparser import ConfigParser
-except ImportError:
-    # For backward-compatibility with Python versions < 2.6.
-    from ConfigParser import ConfigParser
+from ConfigParser import ConfigParser
 
 from distutils.cmd import Command
 
@@ -62,7 +58,7 @@
         """Reads the .pypirc file."""
         rc = self._get_rc_file()
         if os.path.exists(rc):
-            print 'Using PyPI login from %s' % rc
+            self.announce('Using PyPI login from %s' % rc)
             repository = self.repository or self.DEFAULT_REPOSITORY
             realm = self.realm or self.DEFAULT_REALM
 

Modified: python/branches/tlee-ast-optimize/Lib/distutils/dist.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/distutils/dist.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/distutils/dist.py	Sun May 25 10:45:18 2008
@@ -358,11 +358,7 @@
 
 
     def parse_config_files (self, filenames=None):
-        try:
-            from configparser import ConfigParser
-        except ImportError:
-            # For backward-compatibility with Python versions < 2.6.
-            from ConfigParser import ConfigParser
+        from ConfigParser import ConfigParser
 
         if filenames is None:
             filenames = self.find_config_files()

Modified: python/branches/tlee-ast-optimize/Lib/idlelib/Debugger.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/idlelib/Debugger.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/idlelib/Debugger.py	Sun May 25 10:45:18 2008
@@ -413,8 +413,8 @@
             height = 20*len(dict) # XXX 20 == observed height of Entry widget
         self.master = master
         self.title = title
-        import reprlib
-        self.repr = reprlib.Repr()
+        import repr
+        self.repr = repr.Repr()
         self.repr.maxstring = 60
         self.repr.maxother = 60
         self.frame = frame = Frame(master)

Modified: python/branches/tlee-ast-optimize/Lib/idlelib/ObjectBrowser.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/idlelib/ObjectBrowser.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/idlelib/ObjectBrowser.py	Sun May 25 10:45:18 2008
@@ -11,7 +11,7 @@
 
 from TreeWidget import TreeItem, TreeNode, ScrolledCanvas
 
-from reprlib import Repr
+from repr import Repr
 
 myrepr = Repr()
 myrepr.maxstring = 100

Modified: python/branches/tlee-ast-optimize/Lib/idlelib/configHandler.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/idlelib/configHandler.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/idlelib/configHandler.py	Sun May 25 10:45:18 2008
@@ -21,7 +21,7 @@
 import sys
 import string
 import macosxSupport
-from configparser import ConfigParser, NoOptionError, NoSectionError
+from ConfigParser import ConfigParser, NoOptionError, NoSectionError
 
 class InvalidConfigType(Exception): pass
 class InvalidConfigSet(Exception): pass

Modified: python/branches/tlee-ast-optimize/Lib/idlelib/rpc.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/idlelib/rpc.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/idlelib/rpc.py	Sun May 25 10:45:18 2008
@@ -5,7 +5,7 @@
 has only one client per server, this was not a limitation.
 
    +---------------------------------+ +-------------+
-   | socketserver.BaseRequestHandler | | SocketIO    |
+   | SocketServer.BaseRequestHandler | | SocketIO    |
    +---------------------------------+ +-------------+
                    ^                   | register()  |
                    |                   | unregister()|
@@ -31,11 +31,11 @@
 import os
 import socket
 import select
-import socketserver
+import SocketServer
 import struct
 import cPickle as pickle
 import threading
-import queue
+import Queue
 import traceback
 import copy_reg
 import types
@@ -66,12 +66,12 @@
 BUFSIZE = 8*1024
 LOCALHOST = '127.0.0.1'
 
-class RPCServer(socketserver.TCPServer):
+class RPCServer(SocketServer.TCPServer):
 
     def __init__(self, addr, handlerclass=None):
         if handlerclass is None:
             handlerclass = RPCHandler
-        socketserver.TCPServer.__init__(self, addr, handlerclass)
+        SocketServer.TCPServer.__init__(self, addr, handlerclass)
 
     def server_bind(self):
         "Override TCPServer method, no bind() phase for connecting entity"
@@ -117,8 +117,8 @@
 #----------------- end class RPCServer --------------------
 
 objecttable = {}
-request_queue = queue.Queue(0)
-response_queue = queue.Queue(0)
+request_queue = Queue.Queue(0)
+response_queue = Queue.Queue(0)
 
 
 class SocketIO(object):
@@ -413,7 +413,7 @@
             # send queued response if there is one available
             try:
                 qmsg = response_queue.get(0)
-            except queue.Empty:
+            except Queue.Empty:
                 pass
             else:
                 seq, response = qmsg
@@ -492,7 +492,7 @@
     def __init__(self, oid):
         self.oid = oid
 
-class RPCHandler(socketserver.BaseRequestHandler, SocketIO):
+class RPCHandler(SocketServer.BaseRequestHandler, SocketIO):
 
     debugging = False
     location = "#S"  # Server
@@ -500,10 +500,10 @@
     def __init__(self, sock, addr, svr):
         svr.current_handler = self ## cgt xxx
         SocketIO.__init__(self, sock)
-        socketserver.BaseRequestHandler.__init__(self, sock, addr, svr)
+        SocketServer.BaseRequestHandler.__init__(self, sock, addr, svr)
 
     def handle(self):
-        "handle() method required by socketserver"
+        "handle() method required by SocketServer"
         self.mainloop()
 
     def get_remote_proxy(self, oid):

Modified: python/branches/tlee-ast-optimize/Lib/idlelib/run.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/idlelib/run.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/idlelib/run.py	Sun May 25 10:45:18 2008
@@ -5,7 +5,7 @@
 import traceback
 import thread
 import threading
-import queue
+import Queue
 
 import CallTips
 import AutoComplete
@@ -85,7 +85,7 @@
                     continue
             try:
                 seq, request = rpc.request_queue.get(block=True, timeout=0.05)
-            except queue.Empty:
+            except Queue.Empty:
                 continue
             method, args, kwargs = request
             ret = method(*args, **kwargs)

Deleted: python/branches/tlee-ast-optimize/Lib/lib-old/ConfigParser.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/lib-old/ConfigParser.py	Sun May 25 10:45:18 2008
+++ (empty file)
@@ -1,8 +0,0 @@
-import sys
-from warnings import warnpy3k
-
-warnpy3k("the ConfigParser module has been renamed "
-         "to 'configparser' in Python 3.0", stacklevel=2)
-
-import configparser
-sys.modules[__name__] = configparser

Deleted: python/branches/tlee-ast-optimize/Lib/lib-old/Queue.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/lib-old/Queue.py	Sun May 25 10:45:18 2008
+++ (empty file)
@@ -1,8 +0,0 @@
-import sys
-from warnings import warnpy3k
-
-warnpy3k("the Queue module has been renamed "
-         "to 'queue' in Python 3.0", stacklevel=2)
-
-import queue
-sys.modules[__name__] = queue

Deleted: python/branches/tlee-ast-optimize/Lib/lib-old/SocketServer.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/lib-old/SocketServer.py	Sun May 25 10:45:18 2008
+++ (empty file)
@@ -1,8 +0,0 @@
-import sys
-from warnings import warnpy3k
-
-warnpy3k("the SocketServer module has been renamed "
-         "to 'socketserver' in Python 3.0", stacklevel=2)
-
-import socketserver
-sys.modules[__name__] = socketserver

Deleted: python/branches/tlee-ast-optimize/Lib/lib-old/repr.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/lib-old/repr.py	Sun May 25 10:45:18 2008
+++ (empty file)
@@ -1,7 +0,0 @@
-from warnings import warnpy3k
-warnpy3k("The repr module has been renamed to 'reprlib' in Python 3.0",
-         stacklevel=2)
-
-from sys import modules
-import reprlib
-modules[__name__] = repr

Modified: python/branches/tlee-ast-optimize/Lib/lib-tk/tkMessageBox.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/lib-tk/tkMessageBox.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/lib-tk/tkMessageBox.py	Sun May 25 10:45:18 2008
@@ -22,7 +22,7 @@
 # - type: dialog type; that is, which buttons to display (see below)
 #
 
-from Tkinter.commondialog import Dialog
+from tkCommonDialog import Dialog
 
 #
 # constants

Modified: python/branches/tlee-ast-optimize/Lib/logging/config.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/logging/config.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/logging/config.py	Sun May 25 10:45:18 2008
@@ -35,7 +35,7 @@
 except ImportError:
     thread = None
 
-from socketserver import ThreadingTCPServer, StreamRequestHandler
+from SocketServer import ThreadingTCPServer, StreamRequestHandler
 
 
 DEFAULT_LOGGING_CONFIG_PORT = 9030
@@ -65,9 +65,9 @@
     rather than a filename, in which case the file-like object will be read
     using readfp.
     """
-    import configparser
+    import ConfigParser
 
-    cp = configparser.ConfigParser(defaults)
+    cp = ConfigParser.ConfigParser(defaults)
     if hasattr(cp, 'readfp') and hasattr(fname, 'readline'):
         cp.readfp(fname)
     else:

Modified: python/branches/tlee-ast-optimize/Lib/pdb.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/pdb.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/pdb.py	Sun May 25 10:45:18 2008
@@ -8,7 +8,7 @@
 import linecache
 import cmd
 import bdb
-from reprlib import Repr
+from repr import Repr
 import os
 import re
 import pprint

Modified: python/branches/tlee-ast-optimize/Lib/pydoc.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/pydoc.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/pydoc.py	Sun May 25 10:45:18 2008
@@ -53,7 +53,7 @@
 #     path will be displayed.
 
 import sys, imp, os, re, types, inspect, __builtin__, pkgutil
-from reprlib import Repr
+from repr import Repr
 from string import expandtabs, find, join, lower, split, strip, rfind, rstrip
 try:
     from collections import deque

Deleted: python/branches/tlee-ast-optimize/Lib/queue.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/queue.py	Sun May 25 10:45:18 2008
+++ (empty file)
@@ -1,244 +0,0 @@
-"""A multi-producer, multi-consumer queue."""
-
-from time import time as _time
-from collections import deque
-import heapq
-
-__all__ = ['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue']
-
-class Empty(Exception):
-    "Exception raised by Queue.get(block=0)/get_nowait()."
-    pass
-
-class Full(Exception):
-    "Exception raised by Queue.put(block=0)/put_nowait()."
-    pass
-
-class Queue:
-    """Create a queue object with a given maximum size.
-
-    If maxsize is <= 0, the queue size is infinite.
-    """
-    def __init__(self, maxsize=0):
-        try:
-            import threading
-        except ImportError:
-            import dummy_threading as threading
-        self.maxsize = maxsize
-        self._init(maxsize)
-        # mutex must be held whenever the queue is mutating.  All methods
-        # that acquire mutex must release it before returning.  mutex
-        # is shared between the three conditions, so acquiring and
-        # releasing the conditions also acquires and releases mutex.
-        self.mutex = threading.Lock()
-        # Notify not_empty whenever an item is added to the queue; a
-        # thread waiting to get is notified then.
-        self.not_empty = threading.Condition(self.mutex)
-        # Notify not_full whenever an item is removed from the queue;
-        # a thread waiting to put is notified then.
-        self.not_full = threading.Condition(self.mutex)
-        # Notify all_tasks_done whenever the number of unfinished tasks
-        # drops to zero; thread waiting to join() is notified to resume
-        self.all_tasks_done = threading.Condition(self.mutex)
-        self.unfinished_tasks = 0
-
-    def task_done(self):
-        """Indicate that a formerly enqueued task is complete.
-
-        Used by Queue consumer threads.  For each get() used to fetch a task,
-        a subsequent call to task_done() tells the queue that the processing
-        on the task is complete.
-
-        If a join() is currently blocking, it will resume when all items
-        have been processed (meaning that a task_done() call was received
-        for every item that had been put() into the queue).
-
-        Raises a ValueError if called more times than there were items
-        placed in the queue.
-        """
-        self.all_tasks_done.acquire()
-        try:
-            unfinished = self.unfinished_tasks - 1
-            if unfinished <= 0:
-                if unfinished < 0:
-                    raise ValueError('task_done() called too many times')
-                self.all_tasks_done.notifyAll()
-            self.unfinished_tasks = unfinished
-        finally:
-            self.all_tasks_done.release()
-
-    def join(self):
-        """Blocks until all items in the Queue have been gotten and processed.
-
-        The count of unfinished tasks goes up whenever an item is added to the
-        queue. The count goes down whenever a consumer thread calls task_done()
-        to indicate the item was retrieved and all work on it is complete.
-
-        When the count of unfinished tasks drops to zero, join() unblocks.
-        """
-        self.all_tasks_done.acquire()
-        try:
-            while self.unfinished_tasks:
-                self.all_tasks_done.wait()
-        finally:
-            self.all_tasks_done.release()
-
-    def qsize(self):
-        """Return the approximate size of the queue (not reliable!)."""
-        self.mutex.acquire()
-        n = self._qsize()
-        self.mutex.release()
-        return n
-
-    def empty(self):
-        """Return True if the queue is empty, False otherwise (not reliable!)."""
-        self.mutex.acquire()
-        n = not self._qsize()
-        self.mutex.release()
-        return n
-
-    def full(self):
-        """Return True if the queue is full, False otherwise (not reliable!)."""
-        self.mutex.acquire()
-        n = 0 < self.maxsize == self._qsize()
-        self.mutex.release()
-        return n
-
-    def put(self, item, block=True, timeout=None):
-        """Put an item into the queue.
-
-        If optional args 'block' is true and 'timeout' is None (the default),
-        block if necessary until a free slot is available. If 'timeout' is
-        a positive number, it blocks at most 'timeout' seconds and raises
-        the Full exception if no free slot was available within that time.
-        Otherwise ('block' is false), put an item on the queue if a free slot
-        is immediately available, else raise the Full exception ('timeout'
-        is ignored in that case).
-        """
-        self.not_full.acquire()
-        try:
-            if self.maxsize > 0:
-                if not block:
-                    if self._qsize() == self.maxsize:
-                        raise Full
-                elif timeout is None:
-                    while self._qsize() == self.maxsize:
-                        self.not_full.wait()
-                elif timeout < 0:
-                    raise ValueError("'timeout' must be a positive number")
-                else:
-                    endtime = _time() + timeout
-                    while self._qsize() == self.maxsize:
-                        remaining = endtime - _time()
-                        if remaining <= 0.0:
-                            raise Full
-                        self.not_full.wait(remaining)
-            self._put(item)
-            self.unfinished_tasks += 1
-            self.not_empty.notify()
-        finally:
-            self.not_full.release()
-
-    def put_nowait(self, item):
-        """Put an item into the queue without blocking.
-
-        Only enqueue the item if a free slot is immediately available.
-        Otherwise raise the Full exception.
-        """
-        return self.put(item, False)
-
-    def get(self, block=True, timeout=None):
-        """Remove and return an item from the queue.
-
-        If optional args 'block' is true and 'timeout' is None (the default),
-        block if necessary until an item is available. If 'timeout' is
-        a positive number, it blocks at most 'timeout' seconds and raises
-        the Empty exception if no item was available within that time.
-        Otherwise ('block' is false), return an item if one is immediately
-        available, else raise the Empty exception ('timeout' is ignored
-        in that case).
-        """
-        self.not_empty.acquire()
-        try:
-            if not block:
-                if not self._qsize():
-                    raise Empty
-            elif timeout is None:
-                while not self._qsize():
-                    self.not_empty.wait()
-            elif timeout < 0:
-                raise ValueError("'timeout' must be a positive number")
-            else:
-                endtime = _time() + timeout
-                while not self._qsize():
-                    remaining = endtime - _time()
-                    if remaining <= 0.0:
-                        raise Empty
-                    self.not_empty.wait(remaining)
-            item = self._get()
-            self.not_full.notify()
-            return item
-        finally:
-            self.not_empty.release()
-
-    def get_nowait(self):
-        """Remove and return an item from the queue without blocking.
-
-        Only get an item if one is immediately available. Otherwise
-        raise the Empty exception.
-        """
-        return self.get(False)
-
-    # Override these methods to implement other queue organizations
-    # (e.g. stack or priority queue).
-    # These will only be called with appropriate locks held
-
-    # Initialize the queue representation
-    def _init(self, maxsize):
-        self.queue = deque()
-
-    def _qsize(self, len=len):
-        return len(self.queue)
-
-    # Put a new item in the queue
-    def _put(self, item):
-        self.queue.append(item)
-
-    # Get an item from the queue
-    def _get(self):
-        return self.queue.popleft()
-
-
-class PriorityQueue(Queue):
-    '''Variant of Queue that retrieves open entries in priority order (lowest first).
-
-    Entries are typically tuples of the form:  (priority number, data).
-    '''
-
-    def _init(self, maxsize):
-        self.queue = []
-
-    def _qsize(self, len=len):
-        return len(self.queue)
-
-    def _put(self, item, heappush=heapq.heappush):
-        heappush(self.queue, item)
-
-    def _get(self, heappop=heapq.heappop):
-        return heappop(self.queue)
-
-
-class LifoQueue(Queue):
-    '''Variant of Queue that retrieves most recently added entries first.'''
-
-    def _init(self, maxsize):
-        self.queue = []
-
-    def _qsize(self, len=len):
-        return len(self.queue)
-
-    def _put(self, item):
-        self.queue.append(item)
-
-    def _get(self):
-        return self.queue.pop()

Deleted: python/branches/tlee-ast-optimize/Lib/reprlib.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/reprlib.py	Sun May 25 10:45:18 2008
+++ (empty file)
@@ -1,132 +0,0 @@
-"""Redo the builtin repr() (representation) but with limits on most sizes."""
-
-__all__ = ["Repr","repr"]
-
-import __builtin__
-from itertools import islice
-
-class Repr:
-
-    def __init__(self):
-        self.maxlevel = 6
-        self.maxtuple = 6
-        self.maxlist = 6
-        self.maxarray = 5
-        self.maxdict = 4
-        self.maxset = 6
-        self.maxfrozenset = 6
-        self.maxdeque = 6
-        self.maxstring = 30
-        self.maxlong = 40
-        self.maxother = 20
-
-    def repr(self, x):
-        return self.repr1(x, self.maxlevel)
-
-    def repr1(self, x, level):
-        typename = type(x).__name__
-        if ' ' in typename:
-            parts = typename.split()
-            typename = '_'.join(parts)
-        if hasattr(self, 'repr_' + typename):
-            return getattr(self, 'repr_' + typename)(x, level)
-        else:
-            s = __builtin__.repr(x)
-            if len(s) > self.maxother:
-                i = max(0, (self.maxother-3)//2)
-                j = max(0, self.maxother-3-i)
-                s = s[:i] + '...' + s[len(s)-j:]
-            return s
-
-    def _repr_iterable(self, x, level, left, right, maxiter, trail=''):
-        n = len(x)
-        if level <= 0 and n:
-            s = '...'
-        else:
-            newlevel = level - 1
-            repr1 = self.repr1
-            pieces = [repr1(elem, newlevel) for elem in islice(x, maxiter)]
-            if n > maxiter:  pieces.append('...')
-            s = ', '.join(pieces)
-            if n == 1 and trail:  right = trail + right
-        return '%s%s%s' % (left, s, right)
-
-    def repr_tuple(self, x, level):
-        return self._repr_iterable(x, level, '(', ')', self.maxtuple, ',')
-
-    def repr_list(self, x, level):
-        return self._repr_iterable(x, level, '[', ']', self.maxlist)
-
-    def repr_array(self, x, level):
-        header = "array('%s', [" % x.typecode
-        return self._repr_iterable(x, level, header, '])', self.maxarray)
-
-    def repr_set(self, x, level):
-        x = _possibly_sorted(x)
-        return self._repr_iterable(x, level, 'set([', '])', self.maxset)
-
-    def repr_frozenset(self, x, level):
-        x = _possibly_sorted(x)
-        return self._repr_iterable(x, level, 'frozenset([', '])',
-                                   self.maxfrozenset)
-
-    def repr_deque(self, x, level):
-        return self._repr_iterable(x, level, 'deque([', '])', self.maxdeque)
-
-    def repr_dict(self, x, level):
-        n = len(x)
-        if n == 0: return '{}'
-        if level <= 0: return '{...}'
-        newlevel = level - 1
-        repr1 = self.repr1
-        pieces = []
-        for key in islice(_possibly_sorted(x), self.maxdict):
-            keyrepr = repr1(key, newlevel)
-            valrepr = repr1(x[key], newlevel)
-            pieces.append('%s: %s' % (keyrepr, valrepr))
-        if n > self.maxdict: pieces.append('...')
-        s = ', '.join(pieces)
-        return '{%s}' % (s,)
-
-    def repr_str(self, x, level):
-        s = __builtin__.repr(x[:self.maxstring])
-        if len(s) > self.maxstring:
-            i = max(0, (self.maxstring-3)//2)
-            j = max(0, self.maxstring-3-i)
-            s = __builtin__.repr(x[:i] + x[len(x)-j:])
-            s = s[:i] + '...' + s[len(s)-j:]
-        return s
-
-    def repr_long(self, x, level):
-        s = __builtin__.repr(x) # XXX Hope this isn't too slow...
-        if len(s) > self.maxlong:
-            i = max(0, (self.maxlong-3)//2)
-            j = max(0, self.maxlong-3-i)
-            s = s[:i] + '...' + s[len(s)-j:]
-        return s
-
-    def repr_instance(self, x, level):
-        try:
-            s = __builtin__.repr(x)
-            # Bugs in x.__repr__() can cause arbitrary
-            # exceptions -- then make up something
-        except Exception:
-            return '<%s instance at %x>' % (x.__class__.__name__, id(x))
-        if len(s) > self.maxstring:
-            i = max(0, (self.maxstring-3)//2)
-            j = max(0, self.maxstring-3-i)
-            s = s[:i] + '...' + s[len(s)-j:]
-        return s
-
-
-def _possibly_sorted(x):
-    # Since not all sequences of items can be sorted and comparison
-    # functions may raise arbitrary exceptions, return an unsorted
-    # sequence in that case.
-    try:
-        return sorted(x)
-    except Exception:
-        return list(x)
-
-aRepr = Repr()
-repr = aRepr.repr

Deleted: python/branches/tlee-ast-optimize/Lib/socketserver.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/socketserver.py	Sun May 25 10:45:18 2008
+++ (empty file)
@@ -1,681 +0,0 @@
-"""Generic socket server classes.
-
-This module tries to capture the various aspects of defining a server:
-
-For socket-based servers:
-
-- address family:
-        - AF_INET{,6}: IP (Internet Protocol) sockets (default)
-        - AF_UNIX: Unix domain sockets
-        - others, e.g. AF_DECNET are conceivable (see <socket.h>
-- socket type:
-        - SOCK_STREAM (reliable stream, e.g. TCP)
-        - SOCK_DGRAM (datagrams, e.g. UDP)
-
-For request-based servers (including socket-based):
-
-- client address verification before further looking at the request
-        (This is actually a hook for any processing that needs to look
-         at the request before anything else, e.g. logging)
-- how to handle multiple requests:
-        - synchronous (one request is handled at a time)
-        - forking (each request is handled by a new process)
-        - threading (each request is handled by a new thread)
-
-The classes in this module favor the server type that is simplest to
-write: a synchronous TCP/IP server.  This is bad class design, but
-save some typing.  (There's also the issue that a deep class hierarchy
-slows down method lookups.)
-
-There are five classes in an inheritance diagram, four of which represent
-synchronous servers of four types:
-
-        +------------+
-        | BaseServer |
-        +------------+
-              |
-              v
-        +-----------+        +------------------+
-        | TCPServer |------->| UnixStreamServer |
-        +-----------+        +------------------+
-              |
-              v
-        +-----------+        +--------------------+
-        | UDPServer |------->| UnixDatagramServer |
-        +-----------+        +--------------------+
-
-Note that UnixDatagramServer derives from UDPServer, not from
-UnixStreamServer -- the only difference between an IP and a Unix
-stream server is the address family, which is simply repeated in both
-unix server classes.
-
-Forking and threading versions of each type of server can be created
-using the ForkingMixIn and ThreadingMixIn mix-in classes.  For
-instance, a threading UDP server class is created as follows:
-
-        class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass
-
-The Mix-in class must come first, since it overrides a method defined
-in UDPServer! Setting the various member variables also changes
-the behavior of the underlying server mechanism.
-
-To implement a service, you must derive a class from
-BaseRequestHandler and redefine its handle() method.  You can then run
-various versions of the service by combining one of the server classes
-with your request handler class.
-
-The request handler class must be different for datagram or stream
-services.  This can be hidden by using the request handler
-subclasses StreamRequestHandler or DatagramRequestHandler.
-
-Of course, you still have to use your head!
-
-For instance, it makes no sense to use a forking server if the service
-contains state in memory that can be modified by requests (since the
-modifications in the child process would never reach the initial state
-kept in the parent process and passed to each child).  In this case,
-you can use a threading server, but you will probably have to use
-locks to avoid two requests that come in nearly simultaneous to apply
-conflicting changes to the server state.
-
-On the other hand, if you are building e.g. an HTTP server, where all
-data is stored externally (e.g. in the file system), a synchronous
-class will essentially render the service "deaf" while one request is
-being handled -- which may be for a very long time if a client is slow
-to reqd all the data it has requested.  Here a threading or forking
-server is appropriate.
-
-In some cases, it may be appropriate to process part of a request
-synchronously, but to finish processing in a forked child depending on
-the request data.  This can be implemented by using a synchronous
-server and doing an explicit fork in the request handler class
-handle() method.
-
-Another approach to handling multiple simultaneous requests in an
-environment that supports neither threads nor fork (or where these are
-too expensive or inappropriate for the service) is to maintain an
-explicit table of partially finished requests and to use select() to
-decide which request to work on next (or whether to handle a new
-incoming request).  This is particularly important for stream services
-where each client can potentially be connected for a long time (if
-threads or subprocesses cannot be used).
-
-Future work:
-- Standard classes for Sun RPC (which uses either UDP or TCP)
-- Standard mix-in classes to implement various authentication
-  and encryption schemes
-- Standard framework for select-based multiplexing
-
-XXX Open problems:
-- What to do with out-of-band data?
-
-BaseServer:
-- split generic "request" functionality out into BaseServer class.
-  Copyright (C) 2000  Luke Kenneth Casson Leighton <lkcl at samba.org>
-
-  example: read entries from a SQL database (requires overriding
-  get_request() to return a table entry from the database).
-  entry is processed by a RequestHandlerClass.
-
-"""
-
-# Author of the BaseServer patch: Luke Kenneth Casson Leighton
-
-# XXX Warning!
-# There is a test suite for this module, but it cannot be run by the
-# standard regression test.
-# To run it manually, run Lib/test/test_socketserver.py.
-
-__version__ = "0.4"
-
-
-import socket
-import select
-import sys
-import os
-try:
-    import threading
-except ImportError:
-    import dummy_threading as threading
-
-__all__ = ["TCPServer","UDPServer","ForkingUDPServer","ForkingTCPServer",
-           "ThreadingUDPServer","ThreadingTCPServer","BaseRequestHandler",
-           "StreamRequestHandler","DatagramRequestHandler",
-           "ThreadingMixIn", "ForkingMixIn"]
-if hasattr(socket, "AF_UNIX"):
-    __all__.extend(["UnixStreamServer","UnixDatagramServer",
-                    "ThreadingUnixStreamServer",
-                    "ThreadingUnixDatagramServer"])
-
-class BaseServer:
-
-    """Base class for server classes.
-
-    Methods for the caller:
-
-    - __init__(server_address, RequestHandlerClass)
-    - serve_forever(poll_interval=0.5)
-    - shutdown()
-    - handle_request()  # if you do not use serve_forever()
-    - fileno() -> int   # for select()
-
-    Methods that may be overridden:
-
-    - server_bind()
-    - server_activate()
-    - get_request() -> request, client_address
-    - handle_timeout()
-    - verify_request(request, client_address)
-    - server_close()
-    - process_request(request, client_address)
-    - close_request(request)
-    - handle_error()
-
-    Methods for derived classes:
-
-    - finish_request(request, client_address)
-
-    Class variables that may be overridden by derived classes or
-    instances:
-
-    - timeout
-    - address_family
-    - socket_type
-    - allow_reuse_address
-
-    Instance variables:
-
-    - RequestHandlerClass
-    - socket
-
-    """
-
-    timeout = None
-
-    def __init__(self, server_address, RequestHandlerClass):
-        """Constructor.  May be extended, do not override."""
-        self.server_address = server_address
-        self.RequestHandlerClass = RequestHandlerClass
-        self.__is_shut_down = threading.Event()
-        self.__serving = False
-
-    def server_activate(self):
-        """Called by constructor to activate the server.
-
-        May be overridden.
-
-        """
-        pass
-
-    def serve_forever(self, poll_interval=0.5):
-        """Handle one request at a time until shutdown.
-
-        Polls for shutdown every poll_interval seconds. Ignores
-        self.timeout. If you need to do periodic tasks, do them in
-        another thread.
-        """
-        self.__serving = True
-        self.__is_shut_down.clear()
-        while self.__serving:
-            # XXX: Consider using another file descriptor or
-            # connecting to the socket to wake this up instead of
-            # polling. Polling reduces our responsiveness to a
-            # shutdown request and wastes cpu at all other times.
-            r, w, e = select.select([self], [], [], poll_interval)
-            if r:
-                self._handle_request_noblock()
-        self.__is_shut_down.set()
-
-    def shutdown(self):
-        """Stops the serve_forever loop.
-
-        Blocks until the loop has finished. This must be called while
-        serve_forever() is running in another thread, or it will
-        deadlock.
-        """
-        self.__serving = False
-        self.__is_shut_down.wait()
-
-    # The distinction between handling, getting, processing and
-    # finishing a request is fairly arbitrary.  Remember:
-    #
-    # - handle_request() is the top-level call.  It calls
-    #   select, get_request(), verify_request() and process_request()
-    # - get_request() is different for stream or datagram sockets
-    # - process_request() is the place that may fork a new process
-    #   or create a new thread to finish the request
-    # - finish_request() instantiates the request handler class;
-    #   this constructor will handle the request all by itself
-
-    def handle_request(self):
-        """Handle one request, possibly blocking.
-
-        Respects self.timeout.
-        """
-        # Support people who used socket.settimeout() to escape
-        # handle_request before self.timeout was available.
-        timeout = self.socket.gettimeout()
-        if timeout is None:
-            timeout = self.timeout
-        elif self.timeout is not None:
-            timeout = min(timeout, self.timeout)
-        fd_sets = select.select([self], [], [], timeout)
-        if not fd_sets[0]:
-            self.handle_timeout()
-            return
-        self._handle_request_noblock()
-
-    def _handle_request_noblock(self):
-        """Handle one request, without blocking.
-
-        I assume that select.select has returned that the socket is
-        readable before this function was called, so there should be
-        no risk of blocking in get_request().
-        """
-        try:
-            request, client_address = self.get_request()
-        except socket.error:
-            return
-        if self.verify_request(request, client_address):
-            try:
-                self.process_request(request, client_address)
-            except:
-                self.handle_error(request, client_address)
-                self.close_request(request)
-
-    def handle_timeout(self):
-        """Called if no new request arrives within self.timeout.
-
-        Overridden by ForkingMixIn.
-        """
-        pass
-
-    def verify_request(self, request, client_address):
-        """Verify the request.  May be overridden.
-
-        Return True if we should proceed with this request.
-
-        """
-        return True
-
-    def process_request(self, request, client_address):
-        """Call finish_request.
-
-        Overridden by ForkingMixIn and ThreadingMixIn.
-
-        """
-        self.finish_request(request, client_address)
-        self.close_request(request)
-
-    def server_close(self):
-        """Called to clean-up the server.
-
-        May be overridden.
-
-        """
-        pass
-
-    def finish_request(self, request, client_address):
-        """Finish one request by instantiating RequestHandlerClass."""
-        self.RequestHandlerClass(request, client_address, self)
-
-    def close_request(self, request):
-        """Called to clean up an individual request."""
-        pass
-
-    def handle_error(self, request, client_address):
-        """Handle an error gracefully.  May be overridden.
-
-        The default is to print a traceback and continue.
-
-        """
-        print '-'*40
-        print 'Exception happened during processing of request from',
-        print client_address
-        import traceback
-        traceback.print_exc() # XXX But this goes to stderr!
-        print '-'*40
-
-
-class TCPServer(BaseServer):
-
-    """Base class for various socket-based server classes.
-
-    Defaults to synchronous IP stream (i.e., TCP).
-
-    Methods for the caller:
-
-    - __init__(server_address, RequestHandlerClass, bind_and_activate=True)
-    - serve_forever(poll_interval=0.5)
-    - shutdown()
-    - handle_request()  # if you don't use serve_forever()
-    - fileno() -> int   # for select()
-
-    Methods that may be overridden:
-
-    - server_bind()
-    - server_activate()
-    - get_request() -> request, client_address
-    - handle_timeout()
-    - verify_request(request, client_address)
-    - process_request(request, client_address)
-    - close_request(request)
-    - handle_error()
-
-    Methods for derived classes:
-
-    - finish_request(request, client_address)
-
-    Class variables that may be overridden by derived classes or
-    instances:
-
-    - timeout
-    - address_family
-    - socket_type
-    - request_queue_size (only for stream sockets)
-    - allow_reuse_address
-
-    Instance variables:
-
-    - server_address
-    - RequestHandlerClass
-    - socket
-
-    """
-
-    address_family = socket.AF_INET
-
-    socket_type = socket.SOCK_STREAM
-
-    request_queue_size = 5
-
-    allow_reuse_address = False
-
-    def __init__(self, server_address, RequestHandlerClass, bind_and_activate=True):
-        """Constructor.  May be extended, do not override."""
-        BaseServer.__init__(self, server_address, RequestHandlerClass)
-        self.socket = socket.socket(self.address_family,
-                                    self.socket_type)
-        if bind_and_activate:
-            self.server_bind()
-            self.server_activate()
-
-    def server_bind(self):
-        """Called by constructor to bind the socket.
-
-        May be overridden.
-
-        """
-        if self.allow_reuse_address:
-            self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-        self.socket.bind(self.server_address)
-        self.server_address = self.socket.getsockname()
-
-    def server_activate(self):
-        """Called by constructor to activate the server.
-
-        May be overridden.
-
-        """
-        self.socket.listen(self.request_queue_size)
-
-    def server_close(self):
-        """Called to clean-up the server.
-
-        May be overridden.
-
-        """
-        self.socket.close()
-
-    def fileno(self):
-        """Return socket file number.
-
-        Interface required by select().
-
-        """
-        return self.socket.fileno()
-
-    def get_request(self):
-        """Get the request and client address from the socket.
-
-        May be overridden.
-
-        """
-        return self.socket.accept()
-
-    def close_request(self, request):
-        """Called to clean up an individual request."""
-        request.close()
-
-
-class UDPServer(TCPServer):
-
-    """UDP server class."""
-
-    allow_reuse_address = False
-
-    socket_type = socket.SOCK_DGRAM
-
-    max_packet_size = 8192
-
-    def get_request(self):
-        data, client_addr = self.socket.recvfrom(self.max_packet_size)
-        return (data, self.socket), client_addr
-
-    def server_activate(self):
-        # No need to call listen() for UDP.
-        pass
-
-    def close_request(self, request):
-        # No need to close anything.
-        pass
-
-class ForkingMixIn:
-
-    """Mix-in class to handle each request in a new process."""
-
-    timeout = 300
-    active_children = None
-    max_children = 40
-
-    def collect_children(self):
-        """Internal routine to wait for children that have exited."""
-        if self.active_children is None: return
-        while len(self.active_children) >= self.max_children:
-            # XXX: This will wait for any child process, not just ones
-            # spawned by this library. This could confuse other
-            # libraries that expect to be able to wait for their own
-            # children.
-            try:
-                pid, status = os.waitpid(0, options=0)
-            except os.error:
-                pid = None
-            if pid not in self.active_children: continue
-            self.active_children.remove(pid)
-
-        # XXX: This loop runs more system calls than it ought
-        # to. There should be a way to put the active_children into a
-        # process group and then use os.waitpid(-pgid) to wait for any
-        # of that set, but I couldn't find a way to allocate pgids
-        # that couldn't collide.
-        for child in self.active_children:
-            try:
-                pid, status = os.waitpid(child, os.WNOHANG)
-            except os.error:
-                pid = None
-            if not pid: continue
-            try:
-                self.active_children.remove(pid)
-            except ValueError, e:
-                raise ValueError('%s. x=%d and list=%r' % (e.message, pid,
-                                                           self.active_children))
-
-    def handle_timeout(self):
-        """Wait for zombies after self.timeout seconds of inactivity.
-
-        May be extended, do not override.
-        """
-        self.collect_children()
-
-    def process_request(self, request, client_address):
-        """Fork a new subprocess to process the request."""
-        self.collect_children()
-        pid = os.fork()
-        if pid:
-            # Parent process
-            if self.active_children is None:
-                self.active_children = []
-            self.active_children.append(pid)
-            self.close_request(request)
-            return
-        else:
-            # Child process.
-            # This must never return, hence os._exit()!
-            try:
-                self.finish_request(request, client_address)
-                os._exit(0)
-            except:
-                try:
-                    self.handle_error(request, client_address)
-                finally:
-                    os._exit(1)
-
-
-class ThreadingMixIn:
-    """Mix-in class to handle each request in a new thread."""
-
-    # Decides how threads will act upon termination of the
-    # main process
-    daemon_threads = False
-
-    def process_request_thread(self, request, client_address):
-        """Same as in BaseServer but as a thread.
-
-        In addition, exception handling is done here.
-
-        """
-        try:
-            self.finish_request(request, client_address)
-            self.close_request(request)
-        except:
-            self.handle_error(request, client_address)
-            self.close_request(request)
-
-    def process_request(self, request, client_address):
-        """Start a new thread to process the request."""
-        t = threading.Thread(target = self.process_request_thread,
-                             args = (request, client_address))
-        if self.daemon_threads:
-            t.setDaemon (1)
-        t.start()
-
-
-class ForkingUDPServer(ForkingMixIn, UDPServer): pass
-class ForkingTCPServer(ForkingMixIn, TCPServer): pass
-
-class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass
-class ThreadingTCPServer(ThreadingMixIn, TCPServer): pass
-
-if hasattr(socket, 'AF_UNIX'):
-
-    class UnixStreamServer(TCPServer):
-        address_family = socket.AF_UNIX
-
-    class UnixDatagramServer(UDPServer):
-        address_family = socket.AF_UNIX
-
-    class ThreadingUnixStreamServer(ThreadingMixIn, UnixStreamServer): pass
-
-    class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): pass
-
-class BaseRequestHandler:
-
-    """Base class for request handler classes.
-
-    This class is instantiated for each request to be handled.  The
-    constructor sets the instance variables request, client_address
-    and server, and then calls the handle() method.  To implement a
-    specific service, all you need to do is to derive a class which
-    defines a handle() method.
-
-    The handle() method can find the request as self.request, the
-    client address as self.client_address, and the server (in case it
-    needs access to per-server information) as self.server.  Since a
-    separate instance is created for each request, the handle() method
-    can define arbitrary other instance variariables.
-
-    """
-
-    def __init__(self, request, client_address, server):
-        self.request = request
-        self.client_address = client_address
-        self.server = server
-        try:
-            self.setup()
-            self.handle()
-            self.finish()
-        finally:
-            sys.exc_traceback = None    # Help garbage collection
-
-    def setup(self):
-        pass
-
-    def handle(self):
-        pass
-
-    def finish(self):
-        pass
-
-
-# The following two classes make it possible to use the same service
-# class for stream or datagram servers.
-# Each class sets up these instance variables:
-# - rfile: a file object from which receives the request is read
-# - wfile: a file object to which the reply is written
-# When the handle() method returns, wfile is flushed properly
-
-
-class StreamRequestHandler(BaseRequestHandler):
-
-    """Define self.rfile and self.wfile for stream sockets."""
-
-    # Default buffer sizes for rfile, wfile.
-    # We default rfile to buffered because otherwise it could be
-    # really slow for large data (a getc() call per byte); we make
-    # wfile unbuffered because (a) often after a write() we want to
-    # read and we need to flush the line; (b) big writes to unbuffered
-    # files are typically optimized by stdio even when big reads
-    # aren't.
-    rbufsize = -1
-    wbufsize = 0
-
-    def setup(self):
-        self.connection = self.request
-        self.rfile = self.connection.makefile('rb', self.rbufsize)
-        self.wfile = self.connection.makefile('wb', self.wbufsize)
-
-    def finish(self):
-        if not self.wfile.closed:
-            self.wfile.flush()
-        self.wfile.close()
-        self.rfile.close()
-
-
-class DatagramRequestHandler(BaseRequestHandler):
-
-    # XXX Regrettably, I cannot get this working on Linux;
-    # s.recvfrom() doesn't return a meaningful client address.
-
-    """Define self.rfile and self.wfile for datagram sockets."""
-
-    def setup(self):
-        try:
-            from cStringIO import StringIO
-        except ImportError:
-            from StringIO import StringIO
-        self.packet, self.socket = self.request
-        self.rfile = StringIO(self.packet)
-        self.wfile = StringIO()
-
-    def finish(self):
-        self.socket.sendto(self.wfile.getvalue(), self.client_address)

Modified: python/branches/tlee-ast-optimize/Lib/test/test___all__.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test___all__.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test___all__.py	Sun May 25 10:45:18 2008
@@ -37,12 +37,12 @@
         self.check_all("BaseHTTPServer")
         self.check_all("Bastion")
         self.check_all("CGIHTTPServer")
-        self.check_all("configparser")
+        self.check_all("ConfigParser")
         self.check_all("Cookie")
         self.check_all("MimeWriter")
-        self.check_all("queue")
+        self.check_all("Queue")
         self.check_all("SimpleHTTPServer")
-        self.check_all("socketserver")
+        self.check_all("SocketServer")
         self.check_all("StringIO")
         self.check_all("UserString")
         self.check_all("aifc")
@@ -123,7 +123,7 @@
         self.check_all("quopri")
         self.check_all("random")
         self.check_all("re")
-        self.check_all("reprlib")
+        self.check_all("repr")
         self.check_all("rexec")
         self.check_all("rfc822")
         self.check_all("rlcompleter")

Modified: python/branches/tlee-ast-optimize/Lib/test/test_bsddb3.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_bsddb3.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_bsddb3.py	Sun May 25 10:45:18 2008
@@ -48,61 +48,29 @@
             sys.__stdout__.flush()
 
 
-def suite():
-    test_modules = [
-        'test_associate',
-        'test_basics',
-        'test_compare',
-        'test_compat',
-        'test_cursor_pget_bug',
-        'test_dbobj',
-        'test_dbshelve',
-        'test_dbtables',
-        'test_distributed_transactions',
-        'test_early_close',
-        'test_get_none',
-        'test_join',
-        'test_lock',
-        'test_misc',
-        'test_pickle',
-        'test_queue',
-        'test_recno',
-        'test_replication',
-        'test_sequence',
-        'test_thread',
-        ]
-
-    alltests = unittest.TestSuite()
-    for name in test_modules:
-        module = __import__("bsddb.test."+name, globals(), locals(), name)
-        #print module,name
-        alltests.addTest(module.test_suite())
-        alltests.addTest(unittest.makeSuite(TimingCheck))
-    return alltests
-
-
 # For invocation through regrtest
 def test_main():
-    run_unittest(suite())
-    db_home = os.path.join(tempfile.gettempdir(), 'db_home')
-    # The only reason to remove db_home is in case if there is an old
-    # one lying around.  This might be by a different user, so just
-    # ignore errors.  We should always make a unique name now.
+    from bsddb import db
+    from bsddb.test import test_all
+    test_all.get_new_path.prefix = os.path.join(tempfile.gettempdir(),
+                                                'z-test_bsddb3-%s' %
+                                                 os.getpid())
+    # Please leave this print in, having this show up in the buildbots
+    # makes diagnosing problems a lot easier.
+    print >>sys.stderr, db.DB_VERSION_STRING
+    print >>sys.stderr, 'Test path prefix:  ', test_all.get_new_path.prefix
     try:
-        rmtree(db_home)
-    except:
-        pass
-    rmtree('db_home%d' % os.getpid())
+        run_unittest(test_all.suite(module_prefix='bsddb.test.',
+                                    timing_check=TimingCheck))
+    finally:
+        # The only reason to remove db_home is in case if there is an old
+        # one lying around.  This might be by a different user, so just
+        # ignore errors.  We should always make a unique name now.
+        try:
+            rmtree(test_all.get_new_path.prefix)
+        except:
+            pass
 
-# For invocation as a script
-if __name__ == '__main__':
-    from bsddb import db
-    print '-=' * 38
-    print db.DB_VERSION_STRING
-    print 'bsddb.db.version():   %s' % (db.version(),)
-    print 'bsddb.db.__version__: %s' % db.__version__
-    print 'bsddb.db.cvsid:       %s' % db.cvsid
-    print 'python version:        %s' % sys.version
-    print '-=' * 38
 
+if __name__ == '__main__':
     test_main()

Modified: python/branches/tlee-ast-optimize/Lib/test/test_cfgparser.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_cfgparser.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_cfgparser.py	Sun May 25 10:45:18 2008
@@ -1,4 +1,4 @@
-import configparser
+import ConfigParser
 import StringIO
 import unittest
 import UserDict
@@ -94,7 +94,7 @@
                     "remove_option() failed to report non-existance of option"
                     " that was removed")
 
-        self.assertRaises(configparser.NoSectionError,
+        self.assertRaises(ConfigParser.NoSectionError,
                           cf.remove_option, 'No Such Section', 'foo')
 
         eq(cf.get('Long Line', 'foo'),
@@ -147,17 +147,17 @@
 
     def test_parse_errors(self):
         self.newconfig()
-        self.parse_error(configparser.ParsingError,
+        self.parse_error(ConfigParser.ParsingError,
                          "[Foo]\n  extra-spaces: splat\n")
-        self.parse_error(configparser.ParsingError,
+        self.parse_error(ConfigParser.ParsingError,
                          "[Foo]\n  extra-spaces= splat\n")
-        self.parse_error(configparser.ParsingError,
+        self.parse_error(ConfigParser.ParsingError,
                          "[Foo]\noption-without-value\n")
-        self.parse_error(configparser.ParsingError,
+        self.parse_error(ConfigParser.ParsingError,
                          "[Foo]\n:value-without-option-name\n")
-        self.parse_error(configparser.ParsingError,
+        self.parse_error(ConfigParser.ParsingError,
                          "[Foo]\n=value-without-option-name\n")
-        self.parse_error(configparser.MissingSectionHeaderError,
+        self.parse_error(ConfigParser.MissingSectionHeaderError,
                          "No Section!\n")
 
     def parse_error(self, exc, src):
@@ -170,13 +170,13 @@
                          "new ConfigParser should have no defined sections")
         self.failIf(cf.has_section("Foo"),
                     "new ConfigParser should have no acknowledged sections")
-        self.assertRaises(configparser.NoSectionError,
+        self.assertRaises(ConfigParser.NoSectionError,
                           cf.options, "Foo")
-        self.assertRaises(configparser.NoSectionError,
+        self.assertRaises(ConfigParser.NoSectionError,
                           cf.set, "foo", "bar", "value")
-        self.get_error(configparser.NoSectionError, "foo", "bar")
+        self.get_error(ConfigParser.NoSectionError, "foo", "bar")
         cf.add_section("foo")
-        self.get_error(configparser.NoOptionError, "foo", "bar")
+        self.get_error(ConfigParser.NoOptionError, "foo", "bar")
 
     def get_error(self, exc, section, option):
         try:
@@ -215,7 +215,7 @@
     def test_weird_errors(self):
         cf = self.newconfig()
         cf.add_section("Foo")
-        self.assertRaises(configparser.DuplicateSectionError,
+        self.assertRaises(ConfigParser.DuplicateSectionError,
                           cf.add_section, "Foo")
 
     def test_write(self):
@@ -324,7 +324,7 @@
 
 
 class ConfigParserTestCase(TestCaseBase):
-    config_class = configparser.ConfigParser
+    config_class = ConfigParser.ConfigParser
 
     def test_interpolation(self):
         cf = self.get_interpolation_config()
@@ -335,11 +335,11 @@
            "something with lots of interpolation (9 steps)")
         eq(cf.get("Foo", "bar10"),
            "something with lots of interpolation (10 steps)")
-        self.get_error(configparser.InterpolationDepthError, "Foo", "bar11")
+        self.get_error(ConfigParser.InterpolationDepthError, "Foo", "bar11")
 
     def test_interpolation_missing_value(self):
         cf = self.get_interpolation_config()
-        e = self.get_error(configparser.InterpolationError,
+        e = self.get_error(ConfigParser.InterpolationError,
                            "Interpolation Error", "name")
         self.assertEqual(e.reference, "reference")
         self.assertEqual(e.section, "Interpolation Error")
@@ -375,7 +375,7 @@
 
 
 class RawConfigParserTestCase(TestCaseBase):
-    config_class = configparser.RawConfigParser
+    config_class = ConfigParser.RawConfigParser
 
     def test_interpolation(self):
         cf = self.get_interpolation_config()
@@ -410,7 +410,7 @@
 
 
 class SafeConfigParserTestCase(ConfigParserTestCase):
-    config_class = configparser.SafeConfigParser
+    config_class = ConfigParser.SafeConfigParser
 
     def test_safe_interpolation(self):
         # See http://www.python.org/sf/511737

Modified: python/branches/tlee-ast-optimize/Lib/test/test_dummy_thread.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_dummy_thread.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_dummy_thread.py	Sun May 25 10:45:18 2008
@@ -7,7 +7,7 @@
 """
 import dummy_thread as _thread
 import time
-import queue
+import Queue
 import random
 import unittest
 from test import test_support
@@ -124,7 +124,7 @@
             """Use to test _thread.start_new_thread() passes args properly."""
             queue.put((arg1, arg2))
 
-        testing_queue = queue.Queue(1)
+        testing_queue = Queue.Queue(1)
         _thread.start_new_thread(arg_tester, (testing_queue, True, True))
         result = testing_queue.get()
         self.failUnless(result[0] and result[1],
@@ -148,7 +148,7 @@
             queue.put(_thread.get_ident())
 
         thread_count = 5
-        testing_queue = queue.Queue(thread_count)
+        testing_queue = Queue.Queue(thread_count)
         if test_support.verbose:
             print
             print "*** Testing multiple thread creation "\

Modified: python/branches/tlee-ast-optimize/Lib/test/test_ioctl.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_ioctl.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_ioctl.py	Sun May 25 10:45:18 2008
@@ -52,13 +52,10 @@
                 set_winsz_opcode_maybe_neg, = struct.unpack("i",
                         struct.pack("I", termios.TIOCSWINSZ))
 
-            # We're just testing that these calls do not raise exceptions.
-            saved_winsz = fcntl.ioctl(mfd, termios.TIOCGWINSZ, "\0"*8)
             our_winsz = struct.pack("HHHH",80,25,0,0)
             # test both with a positive and potentially negative ioctl code
             new_winsz = fcntl.ioctl(mfd, set_winsz_opcode_pos, our_winsz)
             new_winsz = fcntl.ioctl(mfd, set_winsz_opcode_maybe_neg, our_winsz)
-            fcntl.ioctl(mfd, set_winsz_opcode_maybe_neg, saved_winsz)
         finally:
             os.close(mfd)
             os.close(sfd)

Modified: python/branches/tlee-ast-optimize/Lib/test/test_json.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_json.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_json.py	Sun May 25 10:45:18 2008
@@ -11,7 +11,6 @@
 
 def test_main():
     test.test_support.run_unittest(json.tests.test_suite())
-    test.test_support.run_doctest(json)
 
 
 if __name__ == "__main__":

Modified: python/branches/tlee-ast-optimize/Lib/test/test_logging.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_logging.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_logging.py	Sun May 25 10:45:18 2008
@@ -33,7 +33,7 @@
 import re
 import select
 import socket
-from socketserver import ThreadingTCPServer, StreamRequestHandler
+from SocketServer import ThreadingTCPServer, StreamRequestHandler
 import string
 import struct
 import sys

Modified: python/branches/tlee-ast-optimize/Lib/test/test_math.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_math.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_math.py	Sun May 25 10:45:18 2008
@@ -630,6 +630,158 @@
         self.assertRaises(ValueError, math.sqrt, NINF)
         self.assert_(math.isnan(math.sqrt(NAN)))
 
+    def testSum(self):
+        # math.sum relies on exact rounding for correct operation.
+        # There's a known problem with IA32 floating-point that causes
+        # inexact rounding in some situations, and will cause the
+        # math.sum tests below to fail; see issue #2937.  On non IEEE
+        # 754 platforms, and on IEEE 754 platforms that exhibit the
+        # problem described in issue #2937, we simply skip the whole
+        # test.
+
+        if not float.__getformat__("double").startswith("IEEE"):
+            return
+
+        # on IEEE 754 compliant machines, both of the expressions
+        # below should round to 10000000000000002.0.
+        if 1e16+2.999 != 1e16+2.9999:
+            return
+
+        # Python version of math.sum algorithm, for comparison
+        def msum(iterable):
+            """Full precision sum of values in iterable.  Returns the value of
+            the sum, rounded to the nearest representable floating-point number
+            using the round-half-to-even rule.
+
+            """
+            # Stage 1: accumulate partials
+            partials = []
+            for x in iterable:
+                i = 0
+                for y in partials:
+                    if abs(x) < abs(y):
+                        x, y = y, x
+                    hi = x + y
+                    lo = y - (hi - x)
+                    if lo:
+                        partials[i] = lo
+                        i += 1
+                    x = hi
+                partials[i:] = [x] if x else []
+
+            # Stage 2: sum partials
+            if not partials:
+                return 0.0
+
+            # sum from the top, stopping as soon as the sum is inexact.
+            total = partials.pop()
+            while partials:
+                x = partials.pop()
+                old_total, total = total, total + x
+                error = x - (total - old_total)
+                if error != 0.0:
+                    # adjust for correct rounding if necessary
+                    if partials and (partials[-1] > 0.0) == (error > 0.0) and \
+                            total + 2*error - total == 2*error:
+                        total += 2*error
+                    break
+            return total
+
+        from sys import float_info
+        maxfloat = float_info.max
+        twopow = 2.**(float_info.max_exp - 1)
+
+        test_values = [
+            ([], 0.0),
+            ([0.0], 0.0),
+            ([1e100, 1.0, -1e100, 1e-100, 1e50, -1.0, -1e50], 1e-100),
+            ([1e308, 1e308, -1e308], OverflowError),
+            ([-1e308, 1e308, 1e308], 1e308),
+            ([1e308, -1e308, 1e308], 1e308),
+            ([2.0**1023, 2.0**1023, -2.0**1000], OverflowError),
+            ([twopow, twopow, twopow, twopow, -twopow, -twopow, -twopow],
+             OverflowError),
+            ([2.0**53, -0.5, -2.0**-54], 2.0**53-1.0),
+            ([2.0**53, 1.0, 2.0**-100], 2.0**53+2.0),
+            ([2.0**53+10.0, 1.0, 2.0**-100], 2.0**53+12.0),
+
+            ([2.0**53-4.0, 0.5, 2.0**-54], 2.0**53-3.0),
+            ([2.0**1023-2.0**970, -1.0, 2.0**1023], OverflowError),
+            ([maxfloat, maxfloat*2.**-54], maxfloat),
+            ([maxfloat, maxfloat*2.**-53], OverflowError),
+            ([1./n for n in range(1, 1001)], 7.4854708605503451),
+            ([(-1.)**n/n for n in range(1, 1001)], -0.69264743055982025),
+            ([1.7**(i+1)-1.7**i for i in range(1000)] + [-1.7**1000], -1.0),
+            ([INF, -INF, NAN], ValueError),
+            ([NAN, INF, -INF], ValueError),
+            ([INF, NAN, INF], ValueError),
+
+            ([INF, INF], OverflowError),
+            ([INF, -INF], ValueError),
+            ([-INF, 1e308, 1e308, -INF], OverflowError),
+            ([2.0**1023-2.0**970, 0.0, 2.0**1023], OverflowError),
+            ([2.0**1023-2.0**970, 1.0, 2.0**1023], OverflowError),
+            ([2.0**1023, 2.0**1023], OverflowError),
+            ([2.0**1023, 2.0**1023, -1.0], OverflowError),
+            ([twopow, twopow, twopow, twopow, -twopow, -twopow],
+             OverflowError),
+            ([twopow, twopow, twopow, twopow, -twopow, twopow], OverflowError),
+            ([-twopow, -twopow, -twopow, -twopow], OverflowError),
+
+            ([2.**1023, 2.**1023, -2.**971], OverflowError),
+            ([2.**1023, 2.**1023, -2.**970], OverflowError),
+            ([-2.**970,  2.**1023,  2.**1023, -2.**-1074], OverflowError),
+            ([ 2.**1023, 2.**1023, -2.**970,   2.**-1074], OverflowError),
+            ([-2.**1023,  2.**971, -2.**1023], -maxfloat),
+            ([-2.**1023, -2.**1023, 2.**970],   OverflowError),
+            ([-2.**1023,  -2.**1023,  2.**970,  2.**-1074], OverflowError),
+            ([-2.**-1074, -2.**1023, -2.**1023, 2.**970], OverflowError),
+            ([2.**930, -2.**980, 2.**1023, 2.**1023, twopow, -twopow],
+             OverflowError),
+            ([2.**1023, 2.**1023, -1e307], OverflowError),
+            ([1e16, 1., 1e-16], 10000000000000002.0),
+            ([1e16-2., 1.-2.**53, -(1e16-2.), -(1.-2.**53)], 0.0),
+        ]
+
+        for i, (vals, s) in enumerate(test_values):
+            if isinstance(s, type) and issubclass(s, Exception):
+                try:
+                    m = math.sum(vals)
+                except s:
+                    pass
+                else:
+                    self.fail("test %d failed: got %r, expected %r "
+                              "for math.sum(%.100r)" %
+                              (i, m, s.__name__, vals))
+            else:
+                try:
+                    self.assertEqual(math.sum(vals), s)
+                except OverflowError:
+                    self.fail("test %d failed: got OverflowError, expected %r "
+                              "for math.sum(%.100r)" % (i, s, vals))
+                except ValueError:
+                    self.fail("test %d failed: got ValueError, expected %r "
+                              "for math.sum(%.100r)" % (i, s, vals))
+
+                # compare with output of msum above, but only when
+                # result isn't an IEEE special or an exception
+                if not math.isinf(s) and not math.isnan(s):
+                    self.assertEqual(msum(vals), s)
+
+        from random import random, gauss, shuffle
+        for j in xrange(1000):
+            vals = [7, 1e100, -7, -1e100, -9e-20, 8e-20] * 10
+            s = 0
+            for i in xrange(200):
+                v = gauss(0, random()) ** 7 - s
+                s += v
+                vals.append(v)
+            shuffle(vals)
+
+            s = msum(vals)
+            self.assertEqual(msum(vals), math.sum(vals))
+
+
     def testTan(self):
         self.assertRaises(TypeError, math.tan)
         self.ftest('tan(0)', math.tan(0), 0)
@@ -766,6 +918,10 @@
                 message = ("Unexpected ValueError in " +
                            "test %s:%s(%r)\n" % (id, fn, ar))
                 self.fail(message)
+            except OverflowError:
+                message = ("Unexpected OverflowError in " +
+                           "test %s:%s(%r)\n" % (id, fn, ar))
+                self.fail(message)
             self.ftest("%s:%s(%r)" % (id, fn, ar), result, er)
 
 def test_main():

Modified: python/branches/tlee-ast-optimize/Lib/test/test_minidom.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_minidom.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_minidom.py	Sun May 25 10:45:18 2008
@@ -1314,6 +1314,11 @@
             for i in range(len(n1.childNodes)):
                 stack.append((n1.childNodes[i], n2.childNodes[i]))
 
+    def testSerializeCommentNodeWithDoubleHyphen(self):
+        doc = create_doc_without_doctype()
+        doc.appendChild(doc.createComment("foo--bar"))
+        self.assertRaises(ValueError, doc.toxml)
+
 def test_main():
     run_unittest(MinidomTest)
 

Modified: python/branches/tlee-ast-optimize/Lib/test/test_opcodes.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_opcodes.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_opcodes.py	Sun May 25 10:45:18 2008
@@ -48,12 +48,12 @@
 
         try: raise AClass, b
         except BClass, v:
-            if v != b: self.fail("v!=b")
+            self.assertEqual(v, b)
         else: self.fail("no exception")
 
         try: raise b
         except AClass, v:
-            if v != b: self.fail("v!=b AClass")
+            self.assertEqual(v, b)
         else:
             self.fail("no exception")
 
@@ -72,35 +72,35 @@
 
         f = eval('lambda: None')
         g = eval('lambda: None')
-        self.failIf(f == g)
+        self.assertNotEquals(f, g)
 
         f = eval('lambda a: a')
         g = eval('lambda a: a')
-        self.failIf(f == g)
+        self.assertNotEquals(f, g)
 
         f = eval('lambda a=1: a')
         g = eval('lambda a=1: a')
-        self.failIf(f == g)
+        self.assertNotEquals(f, g)
 
         f = eval('lambda: 0')
         g = eval('lambda: 1')
-        self.failIf(f == g)
+        self.assertNotEquals(f, g)
 
         f = eval('lambda: None')
         g = eval('lambda a: None')
-        self.failIf(f == g)
+        self.assertNotEquals(f, g)
 
         f = eval('lambda a: None')
         g = eval('lambda b: None')
-        self.failIf(f == g)
+        self.assertNotEquals(f, g)
 
         f = eval('lambda a: None')
         g = eval('lambda a=None: None')
-        self.failIf(f == g)
+        self.assertNotEquals(f, g)
 
         f = eval('lambda a=0: None')
         g = eval('lambda a=1: None')
-        self.failIf(f == g)
+        self.assertNotEquals(f, g)
 
 
 def test_main():

Modified: python/branches/tlee-ast-optimize/Lib/test/test_platform.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_platform.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_platform.py	Sun May 25 10:45:18 2008
@@ -65,7 +65,14 @@
     def test_mac_ver(self):
         res = platform.mac_ver()
 
-        if os.uname()[0] == 'Darwin':
+        try:
+            import gestalt
+        except ImportError:
+            have_toolbox_glue = False
+        else:
+            have_toolbox_glue = True
+
+        if have_toolbox_glue and os.uname()[0] == 'Darwin':
             # We're on a MacOSX system, check that
             # the right version information is returned
             fd = os.popen('sw_vers', 'r')

Modified: python/branches/tlee-ast-optimize/Lib/test/test_py3kwarn.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_py3kwarn.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_py3kwarn.py	Sun May 25 10:45:18 2008
@@ -213,51 +213,9 @@
             self.assertEquals(str(w.message), msg)
 
 
-class TestStdlibRenames(unittest.TestCase):
-
-    renames = {'Queue': 'queue',
-               'SocketServer': 'socketserver',
-               'ConfigParser': 'configparser',
-               'repr': 'reprlib'}
-
-    def check_rename(self, module_name, new_module_name):
-        """Make sure that:
-        - A DeprecationWarning is raised when importing using the
-          old 2.x module name.
-        - The module can be imported using the new 3.x name.
-        - The warning message specify both names.
-        """
-        with CleanImport(module_name):
-            with catch_warning(record=False) as w:
-                warnings.filterwarnings("error", ".+ renamed to",
-                                        DeprecationWarning)
-                try:
-                    __import__(module_name, level=0)
-                except DeprecationWarning as exc:
-                    self.assert_(module_name in exc.args[0])
-                    self.assert_(new_module_name in exc.args[0])
-                else:
-                    self.fail("DeprecationWarning not raised for %s" %
-                              module_name)
-        with CleanImport(new_module_name):
-            try:
-                __import__(new_module_name, level=0)
-            except ImportError:
-                self.fail("cannot import %s with its 3.x name, %s" %
-                          module_name, new_module_name)
-            except DeprecationWarning:
-                self.fail("unexpected DeprecationWarning raised for %s" %
-                          module_name)
-
-    def test_module_renames(self):
-        for module_name, new_module_name in self.renames.items():
-            self.check_rename(module_name, new_module_name)
-
-
 def test_main():
     run_unittest(TestPy3KWarnings,
-                 TestStdlibRemovals,
-                 TestStdlibRenames)
+                 TestStdlibRemovals)
 
 if __name__ == '__main__':
     test_main()

Modified: python/branches/tlee-ast-optimize/Lib/test/test_pydoc.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_pydoc.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_pydoc.py	Sun May 25 10:45:18 2008
@@ -1,4 +1,5 @@
 import sys
+import os
 import difflib
 import subprocess
 import re
@@ -16,7 +17,7 @@
 
 FILE
     %s
-
+%s
 CLASSES
     __builtin__.object
         B
@@ -76,7 +77,7 @@
 <td valign=bottom>&nbsp;<br>
 <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="test.html"><font color="#ffffff">test</font></a>.pydoc_mod</strong></big></big> (version 1.2.3.4)</font></td
 ><td align=right valign=bottom
-><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:%s">%s</a></font></td></tr></table>
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:%s">%s</a>%s</font></td></tr></table>
     <p><tt>This&nbsp;is&nbsp;a&nbsp;test&nbsp;module&nbsp;for&nbsp;test_pydoc</tt></p>
 <p>
 <table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
@@ -163,6 +164,7 @@
 <td width="100%%">Nobody</td></tr></table>
 """.strip()
 
+
 # output pattern for missing module
 missing_pattern = "no Python documentation found for '%s'"
 
@@ -177,17 +179,26 @@
 
 def get_pydoc_html(module):
     "Returns pydoc generated output as html"
-    output = pydoc.HTMLDoc().docmodule(module)
-    return output.strip()
+    doc = pydoc.HTMLDoc()
+    output = doc.docmodule(module)
+    loc = doc.getdocloc(pydoc_mod) or ""
+    if loc:
+        loc = "<br><a href=\"" + loc + "\">Module Docs</a>"
+    return output.strip(), loc
 
 def get_pydoc_text(module):
     "Returns pydoc generated output as text"
-    output = pydoc.TextDoc().docmodule(module)
+    doc = pydoc.TextDoc()
+    loc = doc.getdocloc(pydoc_mod) or ""
+    if loc:
+        loc = "\nMODULE DOCS\n    " + loc + "\n"
+
+    output = doc.docmodule(module)
 
     # cleanup the extra text formatting that pydoc preforms
     patt = re.compile('\b.')
     output = patt.sub('', output)
-    return output.strip()
+    return output.strip(), loc
 
 def print_diffs(text1, text2):
     "Prints unified diffs for two texts"
@@ -201,16 +212,17 @@
 class PyDocDocTest(unittest.TestCase):
 
     def test_html_doc(self):
-        result = get_pydoc_html(pydoc_mod)
+        result, doc_loc = get_pydoc_html(pydoc_mod)
         mod_file = inspect.getabsfile(pydoc_mod)
-        expected_html = expected_html_pattern % (mod_file, mod_file)
+        expected_html = expected_html_pattern % (mod_file, mod_file, doc_loc)
         if result != expected_html:
             print_diffs(expected_html, result)
             self.fail("outputs are not equal, see diff above")
 
     def test_text_doc(self):
-        result = get_pydoc_text(pydoc_mod)
-        expected_text = expected_text_pattern % inspect.getabsfile(pydoc_mod)
+        result, doc_loc = get_pydoc_text(pydoc_mod)
+        expected_text = expected_text_pattern % \
+                        (inspect.getabsfile(pydoc_mod), doc_loc)
         if result != expected_text:
             print_diffs(expected_text, result)
             self.fail("outputs are not equal, see diff above")
@@ -236,8 +248,8 @@
         c = C()
         self.assertEqual(pydoc.describe(C), 'class C')
         self.assertEqual(pydoc.describe(c), 'instance of C')
-        self.assert_('instance of C in module test.test_pydoc'
-                        in pydoc.render_doc(c))
+        expected = 'instance of C in module %s' % __name__
+        self.assert_(expected in pydoc.render_doc(c))
 
     def test_class(self):
         class C(object): "New-style class"
@@ -245,8 +257,8 @@
 
         self.assertEqual(pydoc.describe(C), 'class C')
         self.assertEqual(pydoc.describe(c), 'C')
-        self.assert_('C in module test.test_pydoc object'
-                        in pydoc.render_doc(c))
+        expected = 'C in module %s object' % __name__
+        self.assert_(expected in pydoc.render_doc(c))
 
 
 def test_main():

Modified: python/branches/tlee-ast-optimize/Lib/test/test_queue.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_queue.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_queue.py	Sun May 25 10:45:18 2008
@@ -1,6 +1,6 @@
 # Some simple queue module tests, plus some failure conditions
 # to ensure the Queue locks remain stable.
-import queue
+import Queue
 import sys
 import threading
 import time
@@ -107,12 +107,12 @@
         try:
             q.put("full", block=0)
             self.fail("Didn't appear to block with a full queue")
-        except queue.Full:
+        except Queue.Full:
             pass
         try:
             q.put("full", timeout=0.01)
             self.fail("Didn't appear to time-out with a full queue")
-        except queue.Full:
+        except Queue.Full:
             pass
         # Test a blocking put
         self.do_blocking_test(q.put, ("full",), q.get, ())
@@ -124,12 +124,12 @@
         try:
             q.get(block=0)
             self.fail("Didn't appear to block with an empty queue")
-        except queue.Empty:
+        except Queue.Empty:
             pass
         try:
             q.get(timeout=0.01)
             self.fail("Didn't appear to time-out with an empty queue")
-        except queue.Empty:
+        except Queue.Empty:
             pass
         # Test a blocking get
         self.do_blocking_test(q.get, (), q.put, ('empty',))
@@ -191,13 +191,13 @@
 
 
 class QueueTest(BaseQueueTest):
-    type2test = queue.Queue
+    type2test = Queue.Queue
 
 class LifoQueueTest(BaseQueueTest):
-    type2test = queue.LifoQueue
+    type2test = Queue.LifoQueue
 
 class PriorityQueueTest(BaseQueueTest):
-    type2test = queue.PriorityQueue
+    type2test = Queue.PriorityQueue
 
 
 
@@ -205,21 +205,21 @@
 class FailingQueueException(Exception):
     pass
 
-class FailingQueue(queue.Queue):
+class FailingQueue(Queue.Queue):
     def __init__(self, *args):
         self.fail_next_put = False
         self.fail_next_get = False
-        queue.Queue.__init__(self, *args)
+        Queue.Queue.__init__(self, *args)
     def _put(self, item):
         if self.fail_next_put:
             self.fail_next_put = False
             raise FailingQueueException, "You Lose"
-        return queue.Queue._put(self, item)
+        return Queue.Queue._put(self, item)
     def _get(self):
         if self.fail_next_get:
             self.fail_next_get = False
             raise FailingQueueException, "You Lose"
-        return queue.Queue._get(self)
+        return Queue.Queue._get(self)
 
 class FailingQueueTest(unittest.TestCase, BlockingTestMixin):
 

Deleted: python/branches/tlee-ast-optimize/Lib/test/test_reprlib.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_reprlib.py	Sun May 25 10:45:18 2008
+++ (empty file)
@@ -1,327 +0,0 @@
-"""
-  Test cases for the repr module
-  Nick Mathewson
-"""
-
-import sys
-import os
-import shutil
-import unittest
-
-from test.test_support import run_unittest
-from reprlib import repr as r # Don't shadow builtin repr
-from reprlib import Repr
-
-
-def nestedTuple(nesting):
-    t = ()
-    for i in range(nesting):
-        t = (t,)
-    return t
-
-class ReprTests(unittest.TestCase):
-
-    def test_string(self):
-        eq = self.assertEquals
-        eq(r("abc"), "'abc'")
-        eq(r("abcdefghijklmnop"),"'abcdefghijklmnop'")
-
-        s = "a"*30+"b"*30
-        expected = repr(s)[:13] + "..." + repr(s)[-14:]
-        eq(r(s), expected)
-
-        eq(r("\"'"), repr("\"'"))
-        s = "\""*30+"'"*100
-        expected = repr(s)[:13] + "..." + repr(s)[-14:]
-        eq(r(s), expected)
-
-    def test_tuple(self):
-        eq = self.assertEquals
-        eq(r((1,)), "(1,)")
-
-        t3 = (1, 2, 3)
-        eq(r(t3), "(1, 2, 3)")
-
-        r2 = Repr()
-        r2.maxtuple = 2
-        expected = repr(t3)[:-2] + "...)"
-        eq(r2.repr(t3), expected)
-
-    def test_container(self):
-        from array import array
-        from collections import deque
-
-        eq = self.assertEquals
-        # Tuples give up after 6 elements
-        eq(r(()), "()")
-        eq(r((1,)), "(1,)")
-        eq(r((1, 2, 3)), "(1, 2, 3)")
-        eq(r((1, 2, 3, 4, 5, 6)), "(1, 2, 3, 4, 5, 6)")
-        eq(r((1, 2, 3, 4, 5, 6, 7)), "(1, 2, 3, 4, 5, 6, ...)")
-
-        # Lists give up after 6 as well
-        eq(r([]), "[]")
-        eq(r([1]), "[1]")
-        eq(r([1, 2, 3]), "[1, 2, 3]")
-        eq(r([1, 2, 3, 4, 5, 6]), "[1, 2, 3, 4, 5, 6]")
-        eq(r([1, 2, 3, 4, 5, 6, 7]), "[1, 2, 3, 4, 5, 6, ...]")
-
-        # Sets give up after 6 as well
-        eq(r(set([])), "set([])")
-        eq(r(set([1])), "set([1])")
-        eq(r(set([1, 2, 3])), "set([1, 2, 3])")
-        eq(r(set([1, 2, 3, 4, 5, 6])), "set([1, 2, 3, 4, 5, 6])")
-        eq(r(set([1, 2, 3, 4, 5, 6, 7])), "set([1, 2, 3, 4, 5, 6, ...])")
-
-        # Frozensets give up after 6 as well
-        eq(r(frozenset([])), "frozenset([])")
-        eq(r(frozenset([1])), "frozenset([1])")
-        eq(r(frozenset([1, 2, 3])), "frozenset([1, 2, 3])")
-        eq(r(frozenset([1, 2, 3, 4, 5, 6])), "frozenset([1, 2, 3, 4, 5, 6])")
-        eq(r(frozenset([1, 2, 3, 4, 5, 6, 7])), "frozenset([1, 2, 3, 4, 5, 6, ...])")
-
-        # collections.deque after 6
-        eq(r(deque([1, 2, 3, 4, 5, 6, 7])), "deque([1, 2, 3, 4, 5, 6, ...])")
-
-        # Dictionaries give up after 4.
-        eq(r({}), "{}")
-        d = {'alice': 1, 'bob': 2, 'charles': 3, 'dave': 4}
-        eq(r(d), "{'alice': 1, 'bob': 2, 'charles': 3, 'dave': 4}")
-        d['arthur'] = 1
-        eq(r(d), "{'alice': 1, 'arthur': 1, 'bob': 2, 'charles': 3, ...}")
-
-        # array.array after 5.
-        eq(r(array('i')), "array('i', [])")
-        eq(r(array('i', [1])), "array('i', [1])")
-        eq(r(array('i', [1, 2])), "array('i', [1, 2])")
-        eq(r(array('i', [1, 2, 3])), "array('i', [1, 2, 3])")
-        eq(r(array('i', [1, 2, 3, 4])), "array('i', [1, 2, 3, 4])")
-        eq(r(array('i', [1, 2, 3, 4, 5])), "array('i', [1, 2, 3, 4, 5])")
-        eq(r(array('i', [1, 2, 3, 4, 5, 6])),
-                   "array('i', [1, 2, 3, 4, 5, ...])")
-
-    def test_numbers(self):
-        eq = self.assertEquals
-        eq(r(123), repr(123))
-        eq(r(123L), repr(123L))
-        eq(r(1.0/3), repr(1.0/3))
-
-        n = 10L**100
-        expected = repr(n)[:18] + "..." + repr(n)[-19:]
-        eq(r(n), expected)
-
-    def test_instance(self):
-        eq = self.assertEquals
-        i1 = ClassWithRepr("a")
-        eq(r(i1), repr(i1))
-
-        i2 = ClassWithRepr("x"*1000)
-        expected = repr(i2)[:13] + "..." + repr(i2)[-14:]
-        eq(r(i2), expected)
-
-        i3 = ClassWithFailingRepr()
-        eq(r(i3), ("<ClassWithFailingRepr instance at %x>"%id(i3)))
-
-        s = r(ClassWithFailingRepr)
-        self.failUnless(s.startswith("<class "))
-        self.failUnless(s.endswith(">"))
-        self.failUnless(s.find("...") == 8)
-
-    def test_file(self):
-        fp = open(unittest.__file__)
-        self.failUnless(repr(fp).startswith(
-            "<open file '%s', mode 'r' at 0x" % unittest.__file__))
-        fp.close()
-        self.failUnless(repr(fp).startswith(
-            "<closed file '%s', mode 'r' at 0x" % unittest.__file__))
-
-    def test_lambda(self):
-        self.failUnless(repr(lambda x: x).startswith(
-            "<function <lambda"))
-        # XXX anonymous functions?  see func_repr
-
-    def test_builtin_function(self):
-        eq = self.assertEquals
-        # Functions
-        eq(repr(hash), '<built-in function hash>')
-        # Methods
-        self.failUnless(repr(''.split).startswith(
-            '<built-in method split of str object at 0x'))
-
-    def test_xrange(self):
-        eq = self.assertEquals
-        eq(repr(xrange(1)), 'xrange(1)')
-        eq(repr(xrange(1, 2)), 'xrange(1, 2)')
-        eq(repr(xrange(1, 2, 3)), 'xrange(1, 4, 3)')
-
-    def test_nesting(self):
-        eq = self.assertEquals
-        # everything is meant to give up after 6 levels.
-        eq(r([[[[[[[]]]]]]]), "[[[[[[[]]]]]]]")
-        eq(r([[[[[[[[]]]]]]]]), "[[[[[[[...]]]]]]]")
-
-        eq(r(nestedTuple(6)), "(((((((),),),),),),)")
-        eq(r(nestedTuple(7)), "(((((((...),),),),),),)")
-
-        eq(r({ nestedTuple(5) : nestedTuple(5) }),
-           "{((((((),),),),),): ((((((),),),),),)}")
-        eq(r({ nestedTuple(6) : nestedTuple(6) }),
-           "{((((((...),),),),),): ((((((...),),),),),)}")
-
-        eq(r([[[[[[{}]]]]]]), "[[[[[[{}]]]]]]")
-        eq(r([[[[[[[{}]]]]]]]), "[[[[[[[...]]]]]]]")
-
-    def test_buffer(self):
-        # XXX doesn't test buffers with no b_base or read-write buffers (see
-        # bufferobject.c).  The test is fairly incomplete too.  Sigh.
-        x = buffer('foo')
-        self.failUnless(repr(x).startswith('<read-only buffer for 0x'))
-
-    def test_cell(self):
-        # XXX Hmm? How to get at a cell object?
-        pass
-
-    def test_descriptors(self):
-        eq = self.assertEquals
-        # method descriptors
-        eq(repr(dict.items), "<method 'items' of 'dict' objects>")
-        # XXX member descriptors
-        # XXX attribute descriptors
-        # XXX slot descriptors
-        # static and class methods
-        class C:
-            def foo(cls): pass
-        x = staticmethod(C.foo)
-        self.failUnless(repr(x).startswith('<staticmethod object at 0x'))
-        x = classmethod(C.foo)
-        self.failUnless(repr(x).startswith('<classmethod object at 0x'))
-
-    def test_unsortable(self):
-        # Repr.repr() used to call sorted() on sets, frozensets and dicts
-        # without taking into account that not all objects are comparable
-        x = set([1j, 2j, 3j])
-        y = frozenset(x)
-        z = {1j: 1, 2j: 2}
-        r(x)
-        r(y)
-        r(z)
-
-def touch(path, text=''):
-    fp = open(path, 'w')
-    fp.write(text)
-    fp.close()
-
-class LongReprTest(unittest.TestCase):
-    def setUp(self):
-        longname = 'areallylongpackageandmodulenametotestreprtruncation'
-        self.pkgname = os.path.join(longname)
-        self.subpkgname = os.path.join(longname, longname)
-        # Make the package and subpackage
-        shutil.rmtree(self.pkgname, ignore_errors=True)
-        os.mkdir(self.pkgname)
-        touch(os.path.join(self.pkgname, '__init__'+os.extsep+'py'))
-        shutil.rmtree(self.subpkgname, ignore_errors=True)
-        os.mkdir(self.subpkgname)
-        touch(os.path.join(self.subpkgname, '__init__'+os.extsep+'py'))
-        # Remember where we are
-        self.here = os.getcwd()
-        sys.path.insert(0, self.here)
-
-    def tearDown(self):
-        actions = []
-        for dirpath, dirnames, filenames in os.walk(self.pkgname):
-            for name in dirnames + filenames:
-                actions.append(os.path.join(dirpath, name))
-        actions.append(self.pkgname)
-        actions.sort()
-        actions.reverse()
-        for p in actions:
-            if os.path.isdir(p):
-                os.rmdir(p)
-            else:
-                os.remove(p)
-        del sys.path[0]
-
-    def test_module(self):
-        eq = self.assertEquals
-        touch(os.path.join(self.subpkgname, self.pkgname + os.extsep + 'py'))
-        from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import areallylongpackageandmodulenametotestreprtruncation
-        eq(repr(areallylongpackageandmodulenametotestreprtruncation),
-           "<module '%s' from '%s'>" % (areallylongpackageandmodulenametotestreprtruncation.__name__, areallylongpackageandmodulenametotestreprtruncation.__file__))
-        eq(repr(sys), "<module 'sys' (built-in)>")
-
-    def test_type(self):
-        eq = self.assertEquals
-        touch(os.path.join(self.subpkgname, 'foo'+os.extsep+'py'), '''\
-class foo(object):
-    pass
-''')
-        from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import foo
-        eq(repr(foo.foo),
-               "<class '%s.foo'>" % foo.__name__)
-
-    def test_object(self):
-        # XXX Test the repr of a type with a really long tp_name but with no
-        # tp_repr.  WIBNI we had ::Inline? :)
-        pass
-
-    def test_class(self):
-        touch(os.path.join(self.subpkgname, 'bar'+os.extsep+'py'), '''\
-class bar:
-    pass
-''')
-        from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar
-        # Module name may be prefixed with "test.", depending on how run.
-        self.failUnless(repr(bar.bar).startswith(
-            "<class %s.bar at 0x" % bar.__name__))
-
-    def test_instance(self):
-        touch(os.path.join(self.subpkgname, 'baz'+os.extsep+'py'), '''\
-class baz:
-    pass
-''')
-        from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import baz
-        ibaz = baz.baz()
-        self.failUnless(repr(ibaz).startswith(
-            "<%s.baz instance at 0x" % baz.__name__))
-
-    def test_method(self):
-        eq = self.assertEquals
-        touch(os.path.join(self.subpkgname, 'qux'+os.extsep+'py'), '''\
-class aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
-    def amethod(self): pass
-''')
-        from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import qux
-        # Unbound methods first
-        eq(repr(qux.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.amethod),
-        '<unbound method aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.amethod>')
-        # Bound method next
-        iqux = qux.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()
-        self.failUnless(repr(iqux.amethod).startswith(
-            '<bound method aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.amethod of <%s.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa instance at 0x' \
-            % (qux.__name__,) ))
-
-    def test_builtin_function(self):
-        # XXX test built-in functions and methods with really long names
-        pass
-
-class ClassWithRepr:
-    def __init__(self, s):
-        self.s = s
-    def __repr__(self):
-        return "ClassWithLongRepr(%r)" % self.s
-
-
-class ClassWithFailingRepr:
-    def __repr__(self):
-        raise Exception("This should be caught by Repr.repr_instance")
-
-
-def test_main():
-    run_unittest(ReprTests)
-    if os.name != 'mac':
-        run_unittest(LongReprTest)
-
-
-if __name__ == "__main__":
-    test_main()

Modified: python/branches/tlee-ast-optimize/Lib/test/test_socket.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_socket.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_socket.py	Sun May 25 10:45:18 2008
@@ -9,7 +9,7 @@
 import thread, threading
 import time
 import traceback
-import queue
+import Queue
 import sys
 import os
 import array
@@ -96,7 +96,7 @@
         self.server_ready = threading.Event()
         self.client_ready = threading.Event()
         self.done = threading.Event()
-        self.queue = queue.Queue(1)
+        self.queue = Queue.Queue(1)
 
         # Do some munging to start the client test.
         methodname = self.id()

Modified: python/branches/tlee-ast-optimize/Lib/test/test_socketserver.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_socketserver.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_socketserver.py	Sun May 25 10:45:18 2008
@@ -1,5 +1,5 @@
 """
-Test suite for socketserver.
+Test suite for SocketServer.py.
 """
 
 import contextlib
@@ -13,7 +13,7 @@
 import threading
 import time
 import unittest
-import socketserver
+import SocketServer
 
 import test.test_support
 from test.test_support import reap_children, verbose, TestSkipped
@@ -40,12 +40,12 @@
         raise RuntimeError, "timed out on %r" % (sock,)
 
 if HAVE_UNIX_SOCKETS:
-    class ForkingUnixStreamServer(socketserver.ForkingMixIn,
-                                  socketserver.UnixStreamServer):
+    class ForkingUnixStreamServer(SocketServer.ForkingMixIn,
+                                  SocketServer.UnixStreamServer):
         pass
 
-    class ForkingUnixDatagramServer(socketserver.ForkingMixIn,
-                                    socketserver.UnixDatagramServer):
+    class ForkingUnixDatagramServer(SocketServer.ForkingMixIn,
+                                    SocketServer.UnixDatagramServer):
         pass
 
 
@@ -172,55 +172,55 @@
         s.close()
 
     def test_TCPServer(self):
-        self.run_server(socketserver.TCPServer,
-                        socketserver.StreamRequestHandler,
+        self.run_server(SocketServer.TCPServer,
+                        SocketServer.StreamRequestHandler,
                         self.stream_examine)
 
     def test_ThreadingTCPServer(self):
-        self.run_server(socketserver.ThreadingTCPServer,
-                        socketserver.StreamRequestHandler,
+        self.run_server(SocketServer.ThreadingTCPServer,
+                        SocketServer.StreamRequestHandler,
                         self.stream_examine)
 
     if HAVE_FORKING:
         def test_ForkingTCPServer(self):
             with simple_subprocess(self):
-                self.run_server(socketserver.ForkingTCPServer,
-                                socketserver.StreamRequestHandler,
+                self.run_server(SocketServer.ForkingTCPServer,
+                                SocketServer.StreamRequestHandler,
                                 self.stream_examine)
 
     if HAVE_UNIX_SOCKETS:
         def test_UnixStreamServer(self):
-            self.run_server(socketserver.UnixStreamServer,
-                            socketserver.StreamRequestHandler,
+            self.run_server(SocketServer.UnixStreamServer,
+                            SocketServer.StreamRequestHandler,
                             self.stream_examine)
 
         def test_ThreadingUnixStreamServer(self):
-            self.run_server(socketserver.ThreadingUnixStreamServer,
-                            socketserver.StreamRequestHandler,
+            self.run_server(SocketServer.ThreadingUnixStreamServer,
+                            SocketServer.StreamRequestHandler,
                             self.stream_examine)
 
         if HAVE_FORKING:
             def test_ForkingUnixStreamServer(self):
                 with simple_subprocess(self):
                     self.run_server(ForkingUnixStreamServer,
-                                    socketserver.StreamRequestHandler,
+                                    SocketServer.StreamRequestHandler,
                                     self.stream_examine)
 
     def test_UDPServer(self):
-        self.run_server(socketserver.UDPServer,
-                        socketserver.DatagramRequestHandler,
+        self.run_server(SocketServer.UDPServer,
+                        SocketServer.DatagramRequestHandler,
                         self.dgram_examine)
 
     def test_ThreadingUDPServer(self):
-        self.run_server(socketserver.ThreadingUDPServer,
-                        socketserver.DatagramRequestHandler,
+        self.run_server(SocketServer.ThreadingUDPServer,
+                        SocketServer.DatagramRequestHandler,
                         self.dgram_examine)
 
     if HAVE_FORKING:
         def test_ForkingUDPServer(self):
             with simple_subprocess(self):
-                self.run_server(socketserver.ForkingUDPServer,
-                                socketserver.DatagramRequestHandler,
+                self.run_server(SocketServer.ForkingUDPServer,
+                                SocketServer.DatagramRequestHandler,
                                 self.dgram_examine)
 
     # Alas, on Linux (at least) recvfrom() doesn't return a meaningful
@@ -228,19 +228,19 @@
 
     # if HAVE_UNIX_SOCKETS:
     #     def test_UnixDatagramServer(self):
-    #         self.run_server(socketserver.UnixDatagramServer,
-    #                         socketserver.DatagramRequestHandler,
+    #         self.run_server(SocketServer.UnixDatagramServer,
+    #                         SocketServer.DatagramRequestHandler,
     #                         self.dgram_examine)
     #
     #     def test_ThreadingUnixDatagramServer(self):
-    #         self.run_server(socketserver.ThreadingUnixDatagramServer,
-    #                         socketserver.DatagramRequestHandler,
+    #         self.run_server(SocketServer.ThreadingUnixDatagramServer,
+    #                         SocketServer.DatagramRequestHandler,
     #                         self.dgram_examine)
     #
     #     if HAVE_FORKING:
     #         def test_ForkingUnixDatagramServer(self):
-    #             self.run_server(socketserver.ForkingUnixDatagramServer,
-    #                             socketserver.DatagramRequestHandler,
+    #             self.run_server(SocketServer.ForkingUnixDatagramServer,
+    #                             SocketServer.DatagramRequestHandler,
     #                             self.dgram_examine)
 
 

Modified: python/branches/tlee-ast-optimize/Lib/test/test_wsgiref.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_wsgiref.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_wsgiref.py	Sun May 25 10:45:18 2008
@@ -8,7 +8,7 @@
 from wsgiref.simple_server import WSGIServer, WSGIRequestHandler, demo_app
 from wsgiref.simple_server import make_server
 from StringIO import StringIO
-from socketserver import BaseServer
+from SocketServer import BaseServer
 import re, sys
 
 from test import test_support

Modified: python/branches/tlee-ast-optimize/Lib/xml/dom/minidom.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/xml/dom/minidom.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/xml/dom/minidom.py	Sun May 25 10:45:18 2008
@@ -1128,6 +1128,8 @@
         self.data = self.nodeValue = data
 
     def writexml(self, writer, indent="", addindent="", newl=""):
+        if "--" in self.data:
+            raise ValueError("'--' is not allowed in a comment node")
         writer.write("%s<!--%s-->%s" % (indent, self.data, newl))
 
 

Modified: python/branches/tlee-ast-optimize/Misc/ACKS
==============================================================================
--- python/branches/tlee-ast-optimize/Misc/ACKS	(original)
+++ python/branches/tlee-ast-optimize/Misc/ACKS	Sun May 25 10:45:18 2008
@@ -228,6 +228,7 @@
 Lele Gaifax
 Santiago Gala
 Yitzchak Gale
+Quentin Gallet-Gilles
 Raymund Galvin
 Nitin Ganatra
 Fred Gansevles

Modified: python/branches/tlee-ast-optimize/Misc/NEWS
==============================================================================
--- python/branches/tlee-ast-optimize/Misc/NEWS	(original)
+++ python/branches/tlee-ast-optimize/Misc/NEWS	Sun May 25 10:45:18 2008
@@ -36,6 +36,9 @@
 Extension Modules
 -----------------
 
+- Issue #2819: add full-precision summation function to math module,
+  based on Hettinger's ASPN Python Cookbook recipe.
+
 - Issue #2592: delegate nb_index and the floor/truediv slots in
   weakref.proxy.
 
@@ -44,7 +47,8 @@
 
 - Support for Windows 9x has been removed from the winsound module.
 
-- bsddb module updated to version 4.6.4.
+- bsddb module updated to version 4.7.0.
+  http://www.jcea.es/programacion/pybsddb.htm#bsddb3-4.7.0
 
 - Issue #2858: Fix potential memory corruption when
   bsddb.db.DBEnv.lock_get and other bsddb.db object constructors
@@ -55,6 +59,9 @@
 Library
 -------
 
+- Issue #1390: Raise ValueError in toxml when an invalid comment would
+  otherwise be produced.
+
 - Issue #2914: TimedRotatingFileHandler now takes an optional keyword
   argument "utc" to use UTC time rather than local time.
 
@@ -72,9 +79,6 @@
   ctypes.util.find_library(name) now call this function when name is
   'm' or 'c'.
 
-- The repr module has been renamed 'reprlib'.  The old name is now
-  deprecated.
-
 - The statvfs module has been deprecated for removal in Python 3.0.
 
 - The sunaudiodev and SUNAUDIODEV modules have been deprecated for
@@ -131,9 +135,6 @@
 - The DEVICE, GL, gl, and cgen modules (which indirectly includes
   cgensupport) have been deprecated for removal in Python 3.0.
 
-- The ConfigParser module has been renamed 'configparser'.  The old
-  name is now deprecated.
-
 - The CL, CL_old, and cl modules for IRIX have been deprecated for
   removal in Python 3.0.
 
@@ -157,9 +158,6 @@
 
 - The multifile module has been deprecated as per PEP 4.
 
-- The SocketServer module has been renamed 'socketserver'.  The old
-  name is now deprecated.
-
 - The imageop module has been deprecated for removal in Python 3.0.
 
 - Issue #2250: Exceptions raised during evaluation of names in
@@ -223,6 +221,8 @@
 Build
 -----
 
+- Patch #1722225: Support QNX 6.
+
 - ``Lib/lib-old`` is now added to sys.path.
 
 
@@ -1901,13 +1901,13 @@
 Extension Modules
 -----------------
 
-- Patch #1657: added select.epoll and select.kqueue
+- Patch #1657: added select.epoll and select.kqueue.
 
 - Patch #1506171: added operator.methodcaller().
 
 - Patch #1826: operator.attrgetter() now supports dotted attribute paths.
 
-- Patch #1957: syslogmodule: Release GIL when calling syslog(3)
+- Patch #1957: syslogmodule: Release GIL when calling syslog(3).
 
 - Bug #2112: mmap.error is now a subclass of EnvironmentError and not
   a direct EnvironmentError.

Modified: python/branches/tlee-ast-optimize/Misc/cheatsheet
==============================================================================
--- python/branches/tlee-ast-optimize/Misc/cheatsheet	(original)
+++ python/branches/tlee-ast-optimize/Misc/cheatsheet	Sun May 25 10:45:18 2008
@@ -1044,7 +1044,7 @@
 super(type)         Create an unbound super object.  Used to call cooperative
                     superclass methods.
 sum(sequence,       Add the values in the sequence and return the sum.
-    [start]) 
+    [start])
 tuple(sequence)     Creates a tuple with same elements as sequence. If already
                     a tuple, return itself (not a copy).
                     Returns a type object [see module types] representing
@@ -1862,7 +1862,7 @@
 colorsys         Conversion functions between RGB and other color systems.
 commands         Tools for executing UNIX commands .
 compileall       Force "compilation" of all .py files in a directory.
-configparser     Configuration file parser (much like windows .ini files)
+ConfigParser     Configuration file parser (much like windows .ini files)
 copy             Generic shallow and deep copying operations.
 copy_reg         Helper to provide extensibility for pickle/cPickle.
 csv              Read and write files with comma separated values.
@@ -1952,7 +1952,7 @@
 pyexpat          Interface to the Expay XML parser.
 py_compile       Routine to "compile" a .py file to a .pyc file.
 pyclbr           Parse a Python file and retrieve classes and methods.
-queue            A multi-producer, multi-consumer queue.
+Queue            A multi-producer, multi-consumer queue.
 quopri           Conversions to/from quoted-printable transport encoding.
 rand             Don't use unless you want compatibility with C's rand().
 random           Random variable generators
@@ -1973,7 +1973,7 @@
                  sys.path.
 smtplib          SMTP Client class (RFC 821)
 sndhdr           Several routines that help recognizing sound.
-socketserver     Generic socket server classes.
+SocketServer     Generic socket server classes.
 stat             Constants and functions for interpreting stat/lstat struct.
 statcache        Maintain a cache of file stats.
 statvfs          Constants for interpreting statvfs struct as returned by

Modified: python/branches/tlee-ast-optimize/Modules/_bsddb.c
==============================================================================
--- python/branches/tlee-ast-optimize/Modules/_bsddb.c	(original)
+++ python/branches/tlee-ast-optimize/Modules/_bsddb.c	Sun May 25 10:45:18 2008
@@ -50,7 +50,7 @@
  *
  * Gregory P. Smith <greg at krypto.org> was once again the maintainer.
  *
- * Since January 2008, new maintainer is Jesus Cea <jcea at argo.es>.
+ * Since January 2008, new maintainer is Jesus Cea <jcea at jcea.es>.
  * Jesus Cea licenses this code to PSF under a Contributor Agreement.
  *
  * Use the pybsddb-users at lists.sf.net mailing list for all questions.
@@ -4129,6 +4129,26 @@
 }
 
 
+#if (DBVER >= 47)
+static PyObject*
+DBEnv_log_set_config(DBEnvObject* self, PyObject* args)
+{
+    int err, flags, onoff;
+
+    if (!PyArg_ParseTuple(args, "ii:log_set_config",
+                          &flags, &onoff))
+        return NULL;
+    CHECK_ENV_NOT_CLOSED(self);
+
+    MYDB_BEGIN_ALLOW_THREADS;
+    err = self->db_env->log_set_config(self->db_env, flags, onoff);
+    MYDB_END_ALLOW_THREADS;
+    RETURN_IF_ERR();
+    RETURN_NONE();
+}
+#endif /* DBVER >= 47 */
+
+
 static PyObject*
 DBEnv_set_data_dir(DBEnvObject* self, PyObject* args)
 {
@@ -4779,8 +4799,13 @@
     MAKE_ENTRY(objs_nowait);
     MAKE_ENTRY(lockers_wait);
     MAKE_ENTRY(lockers_nowait);
+#if (DBVER >= 47)
+    MAKE_ENTRY(lock_wait);
+    MAKE_ENTRY(lock_nowait);
+#else
     MAKE_ENTRY(locks_wait);
     MAKE_ENTRY(locks_nowait);
+#endif
     MAKE_ENTRY(hash_len);
 #endif
     MAKE_ENTRY(regsize);
@@ -4945,6 +4970,30 @@
 
 #if (DBVER >= 40)
 static PyObject*
+DBEnv_set_rpc_server(DBEnvObject* self, PyObject* args, PyObject* kwargs)
+{
+    int err;
+    char *host;
+    long cl_timeout=0, sv_timeout=0;
+
+    static char* kwnames[] = { "host", "cl_timeout", "sv_timeout", NULL};
+
+    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|ll:set_rpc_server", kwnames,
+                                     &host, &cl_timeout, &sv_timeout))
+        return NULL;
+    CHECK_ENV_NOT_CLOSED(self);
+
+    MYDB_BEGIN_ALLOW_THREADS;
+    err = self->db_env->set_rpc_server(self->db_env, NULL, host, cl_timeout,
+            sv_timeout, 0);
+    MYDB_END_ALLOW_THREADS;
+    RETURN_IF_ERR();
+    RETURN_NONE();
+}
+#endif
+
+#if (DBVER >= 40)
+static PyObject*
 DBEnv_set_verbose(DBEnvObject* self, PyObject* args)
 {
     int err;
@@ -5075,7 +5124,11 @@
 DBEnv_rep_get_nsites(DBEnvObject* self, PyObject* args)
 {
     int err;
+#if (DBVER >= 47)
+    u_int32_t nsites;
+#else
     int nsites;
+#endif
 
     if (!PyArg_ParseTuple(args, ":rep_get_nsites")) {
         return NULL;
@@ -5109,7 +5162,11 @@
 DBEnv_rep_get_priority(DBEnvObject* self, PyObject* args)
 {
     int err;
+#if (DBVER >= 47)
+    u_int32_t priority;
+#else
     int priority;
+#endif
 
     if (!PyArg_ParseTuple(args, ":rep_get_priority")) {
         return NULL;
@@ -6094,6 +6151,9 @@
     {"set_cachesize",   (PyCFunction)DBEnv_set_cachesize,    METH_VARARGS},
     {"set_data_dir",    (PyCFunction)DBEnv_set_data_dir,     METH_VARARGS},
     {"set_flags",       (PyCFunction)DBEnv_set_flags,        METH_VARARGS},
+#if (DBVER >= 47)
+    {"log_set_config",  (PyCFunction)DBEnv_log_set_config,   METH_VARARGS},
+#endif
     {"set_lg_bsize",    (PyCFunction)DBEnv_set_lg_bsize,     METH_VARARGS},
     {"set_lg_dir",      (PyCFunction)DBEnv_set_lg_dir,       METH_VARARGS},
     {"set_lg_max",      (PyCFunction)DBEnv_set_lg_max,       METH_VARARGS},
@@ -6140,6 +6200,10 @@
     {"txn_recover",     (PyCFunction)DBEnv_txn_recover,       METH_VARARGS},
 #endif
 #if (DBVER >= 40)
+    {"set_rpc_server",  (PyCFunction)DBEnv_set_rpc_server,
+        METH_VARARGS||METH_KEYWORDS},
+#endif
+#if (DBVER >= 40)
     {"set_verbose",     (PyCFunction)DBEnv_set_verbose,       METH_VARARGS},
 #if (DBVER >= 42)
     {"get_verbose",     (PyCFunction)DBEnv_get_verbose,       METH_VARARGS},
@@ -6760,6 +6824,7 @@
 #if (DBVER < 45)
     ADD_INT(d, DB_CACHED_COUNTS);
 #endif
+
 #if (DBVER >= 41)
     _addIntToDict(d, "DB_CHECKPOINT", 0);
 #else
@@ -6858,14 +6923,25 @@
     ADD_INT(d, DB_TIME_NOTGRANTED);
     ADD_INT(d, DB_TXN_NOT_DURABLE);
     ADD_INT(d, DB_TXN_WRITE_NOSYNC);
-    ADD_INT(d, DB_LOG_AUTOREMOVE);
-    ADD_INT(d, DB_DIRECT_LOG);
     ADD_INT(d, DB_DIRECT_DB);
     ADD_INT(d, DB_INIT_REP);
     ADD_INT(d, DB_ENCRYPT);
     ADD_INT(d, DB_CHKSUM);
 #endif
 
+#if (DBVER >= 42) && (DBVER < 47)
+    ADD_INT(d, DB_LOG_AUTOREMOVE);
+    ADD_INT(d, DB_DIRECT_LOG);
+#endif
+
+#if (DBVER >= 47)
+    ADD_INT(d, DB_LOG_DIRECT);
+    ADD_INT(d, DB_LOG_DSYNC);
+    ADD_INT(d, DB_LOG_IN_MEMORY);
+    ADD_INT(d, DB_LOG_AUTO_REMOVE);
+    ADD_INT(d, DB_LOG_ZERO);
+#endif
+
 #if (DBVER >= 44)
     ADD_INT(d, DB_DSYNC_DB);
 #endif
@@ -6935,14 +7011,17 @@
 #endif
 
 #if (DBVER >= 43)
-    ADD_INT(d, DB_DSYNC_LOG);
-    ADD_INT(d, DB_LOG_INMEMORY);
     ADD_INT(d, DB_BUFFER_SMALL);
     ADD_INT(d, DB_SEQ_DEC);
     ADD_INT(d, DB_SEQ_INC);
     ADD_INT(d, DB_SEQ_WRAP);
 #endif
 
+#if (DBVER >= 43) && (DBVER < 47)
+    ADD_INT(d, DB_LOG_INMEMORY);
+    ADD_INT(d, DB_DSYNC_LOG);
+#endif
+
 #if (DBVER >= 41)
     ADD_INT(d, DB_ENCRYPT_AES);
     ADD_INT(d, DB_AUTO_COMMIT);

Modified: python/branches/tlee-ast-optimize/Modules/_ctypes/libffi/configure
==============================================================================
--- python/branches/tlee-ast-optimize/Modules/_ctypes/libffi/configure	(original)
+++ python/branches/tlee-ast-optimize/Modules/_ctypes/libffi/configure	Sun May 25 10:45:18 2008
@@ -20406,6 +20406,9 @@
   i?86-*-solaris2.1[0-9]*)
 	TARGET=X86_64; TARGETDIR=x86
 	;;
+  i*86-*-nto-qnx*)
+        TARGET=X86; TARGETDIR=x86
+        ;;
   i?86-*-*)
 	TARGET=X86; TARGETDIR=x86
 	;;

Modified: python/branches/tlee-ast-optimize/Modules/_ctypes/libffi/configure.ac
==============================================================================
--- python/branches/tlee-ast-optimize/Modules/_ctypes/libffi/configure.ac	(original)
+++ python/branches/tlee-ast-optimize/Modules/_ctypes/libffi/configure.ac	Sun May 25 10:45:18 2008
@@ -86,6 +86,9 @@
   i?86-*-solaris2.1[[0-9]]*)
 	TARGET=X86_64; TARGETDIR=x86
 	;;
+  i*86-*-nto-qnx*) 
+        TARGET=X86; TARGETDIR=x86
+        ;;
   i?86-*-*)
 	TARGET=X86; TARGETDIR=x86
 	;;

Modified: python/branches/tlee-ast-optimize/Modules/_ctypes/malloc_closure.c
==============================================================================
--- python/branches/tlee-ast-optimize/Modules/_ctypes/malloc_closure.c	(original)
+++ python/branches/tlee-ast-optimize/Modules/_ctypes/malloc_closure.c	Sun May 25 10:45:18 2008
@@ -48,7 +48,11 @@
 	}
 #else
 	if (!_pagesize) {
+#ifdef _SC_PAGESIZE
+		_pagesize = sysconf(_SC_PAGESIZE);
+#else
 		_pagesize = getpagesize();
+#endif
 	}
 #endif
 

Modified: python/branches/tlee-ast-optimize/Modules/bsddb.h
==============================================================================
--- python/branches/tlee-ast-optimize/Modules/bsddb.h	(original)
+++ python/branches/tlee-ast-optimize/Modules/bsddb.h	Sun May 25 10:45:18 2008
@@ -105,7 +105,7 @@
 #error "eek! DBVER can't handle minor versions > 9"
 #endif
 
-#define PY_BSDDB_VERSION "4.6.5devel2"
+#define PY_BSDDB_VERSION "4.7.0"
 
 /* Python object definitions */
 

Modified: python/branches/tlee-ast-optimize/Modules/mathmodule.c
==============================================================================
--- python/branches/tlee-ast-optimize/Modules/mathmodule.c	(original)
+++ python/branches/tlee-ast-optimize/Modules/mathmodule.c	Sun May 25 10:45:18 2008
@@ -307,6 +307,199 @@
 FUNC1(tanh, tanh, 0,
       "tanh(x)\n\nReturn the hyperbolic tangent of x.")
 
+/* Precision summation function as msum() by Raymond Hettinger in
+   <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/393090>,
+   enhanced with the exact partials sum and roundoff from Mark
+   Dickinson's post at <http://bugs.python.org/file10357/msum4.py>.
+   See those links for more details, proofs and other references.
+
+   Note 1: IEEE 754R floating point semantics are assumed,
+   but the current implementation does not re-establish special
+   value semantics across iterations (i.e. handling -Inf + Inf).
+
+   Note 2:  No provision is made for intermediate overflow handling;
+   therefore, sum([1e+308, 1e-308, 1e+308]) returns result 1e+308 while
+   sum([1e+308, 1e+308, 1e-308]) raises an OverflowError due to the
+   overflow of the first partial sum.
+
+   Note 3: Aggressively optimizing compilers can potentially eliminate the
+   residual values needed for accurate summation. For instance, the statements
+   "hi = x + y; lo = y - (hi - x);" could be mis-transformed to
+   "hi = x + y; lo = 0.0;" which defeats the computation of residuals.
+
+   Note 4: A similar implementation is in Modules/cmathmodule.c.
+   Be sure to update both when making changes.
+
+   Note 5: The signature of math.sum() differs from __builtin__.sum()
+   because the start argument doesn't make sense in the context of
+   accurate summation.  Since the partials table is collapsed before
+   returning a result, sum(seq2, start=sum(seq1)) may not equal the
+   accurate result returned by sum(itertools.chain(seq1, seq2)).
+*/
+
+#define NUM_PARTIALS  32  /* initial partials array size, on stack */
+
+/* Extend the partials array p[] by doubling its size. */
+static int                          /* non-zero on error */
+_sum_realloc(double **p_ptr, Py_ssize_t  n,
+             double  *ps,    Py_ssize_t *m_ptr)
+{
+	void *v = NULL;
+	Py_ssize_t m = *m_ptr;
+
+	m += m;  /* double */
+	if (n < m && m < (PY_SSIZE_T_MAX / sizeof(double))) {
+		double *p = *p_ptr;
+		if (p == ps) {
+			v = PyMem_Malloc(sizeof(double) * m);
+			if (v != NULL)
+				memcpy(v, ps, sizeof(double) * n);
+		}
+		else
+			v = PyMem_Realloc(p, sizeof(double) * m);
+	}
+	if (v == NULL) {        /* size overflow or no memory */
+		PyErr_SetString(PyExc_MemoryError, "math sum partials");
+		return 1;
+	}
+	*p_ptr = (double*) v;
+	*m_ptr = m;
+	return 0;
+}
+
+/* Full precision summation of a sequence of floats.
+
+   def msum(iterable):
+       partials = []  # sorted, non-overlapping partial sums
+       for x in iterable:
+           i = 0
+           for y in partials:
+               if abs(x) < abs(y):
+                   x, y = y, x
+               hi = x + y
+               lo = y - (hi - x)
+               if lo:
+                   partials[i] = lo
+                   i += 1
+               x = hi
+           partials[i:] = [x]
+       return sum_exact(partials)
+
+   Rounded x+y stored in hi with the roundoff stored in lo.  Together hi+lo
+   are exactly equal to x+y.  The inner loop applies hi/lo summation to each
+   partial so that the list of partial sums remains exact.
+
+   Sum_exact() adds the partial sums exactly and correctly rounds the final
+   result (using the round-half-to-even rule).  The items in partials remain
+   non-zero, non-special, non-overlapping and strictly increasing in
+   magnitude, but possibly not all having the same sign.
+
+   Depends on IEEE 754 arithmetic guarantees and half-even rounding.
+*/
+
+static PyObject*
+math_sum(PyObject *self, PyObject *seq)
+{
+	PyObject *item, *iter, *sum = NULL;
+	Py_ssize_t i, j, n = 0, m = NUM_PARTIALS;
+	double x, y, hi, lo=0.0, ps[NUM_PARTIALS], *p = ps;
+
+	iter = PyObject_GetIter(seq);
+	if (iter == NULL)
+		return NULL;
+
+	PyFPE_START_PROTECT("sum", Py_DECREF(iter); return NULL)
+
+	for(;;) {           /* for x in iterable */
+		assert(0 <= n && n <= m);
+		assert((m == NUM_PARTIALS && p == ps) ||
+		       (m >  NUM_PARTIALS && p != NULL));
+
+		item = PyIter_Next(iter);
+		if (item == NULL) {
+			if (PyErr_Occurred())
+				goto _sum_error;
+			break;
+		}
+		x = PyFloat_AsDouble(item);
+		Py_DECREF(item);
+		if (PyErr_Occurred())
+			goto _sum_error;
+
+		for (i = j = 0; j < n; j++) {       /* for y in partials */
+			y = p[j];
+			hi = x + y;
+			lo = fabs(x) < fabs(y)
+			   ? x - (hi - y)
+			   : y - (hi - x);
+			if (lo != 0.0)
+				p[i++] = lo;
+			x = hi;
+		}
+		
+		n = i;                              /* ps[i:] = [x] */                   
+		if (x != 0.0) {
+			/* If non-finite, reset partials, effectively
+			   adding subsequent items without roundoff
+			   and yielding correct non-finite results,
+			   provided IEEE 754 rules are observed */
+			if (! Py_IS_FINITE(x))
+				n = 0;
+			else if (n >= m && _sum_realloc(&p, n, ps, &m))
+				goto _sum_error;
+			p[n++] = x;
+		}
+	}
+
+	if (n > 0) {
+		hi = p[--n];
+		if (Py_IS_FINITE(hi)) {
+			/* sum_exact(ps, hi) from the top, stop when the sum becomes inexact. */
+			while (n > 0) {
+				x = p[--n];
+				y = hi;
+				hi = x + y;
+				assert(fabs(x) < fabs(y));
+				lo = x - (hi - y);
+				if (lo != 0.0)
+					break;
+			}
+			/* Little dance to allow half-even rounding across multiple partials.
+                           Needed so that sum([1e-16, 1, 1e16]) will round-up to two instead
+                           of down to zero (the 1e16 makes the 1 slightly closer to two). */
+			if (n > 0 && ((lo < 0.0 && p[n-1] < 0.0) ||
+			              (lo > 0.0 && p[n-1] > 0.0))) {
+				y = lo * 2.0;
+				x = hi + y;
+				if (y == (x - hi))
+					hi = x;
+			}
+		}
+		else {  /* raise corresponding error */
+			errno = Py_IS_NAN(hi) ? EDOM : ERANGE;
+			if (is_error(hi))
+				goto _sum_error;
+		}
+	}
+	else  /* default */
+		hi = 0.0;
+	sum = PyFloat_FromDouble(hi);
+
+_sum_error:
+	PyFPE_END_PROTECT(hi)
+	Py_DECREF(iter);
+	if (p != ps)
+		PyMem_Free(p);
+	return sum;
+}
+
+#undef NUM_PARTIALS
+
+PyDoc_STRVAR(math_sum_doc,
+"sum(iterable)\n\n\
+Return an accurate floating point sum of values in the iterable.\n\
+Assumes IEEE-754 floating point arithmetic.");
+
 static PyObject *
 math_trunc(PyObject *self, PyObject *number)
 {
@@ -760,6 +953,7 @@
 	{"sin",		math_sin,	METH_O,		math_sin_doc},
 	{"sinh",	math_sinh,	METH_O,		math_sinh_doc},
 	{"sqrt",	math_sqrt,	METH_O,		math_sqrt_doc},
+	{"sum",		math_sum,	METH_O,		math_sum_doc},
 	{"tan",		math_tan,	METH_O,		math_tan_doc},
 	{"tanh",	math_tanh,	METH_O,		math_tanh_doc},
  	{"trunc",	math_trunc,	METH_O,		math_trunc_doc},

Modified: python/branches/tlee-ast-optimize/PCbuild/pyproject.vsprops
==============================================================================
--- python/branches/tlee-ast-optimize/PCbuild/pyproject.vsprops	(original)
+++ python/branches/tlee-ast-optimize/PCbuild/pyproject.vsprops	Sun May 25 10:45:18 2008
@@ -45,6 +45,10 @@
 		Value="$(SolutionDir)\python.exe"
 	/>
 	<UserMacro
+		Name="externalsDir"
+		Value="..\.."
+	/>
+	<UserMacro
 		Name="bsddbDir"
 		Value="$(bsddb44Dir)"
 	/>
@@ -54,7 +58,7 @@
 	/>
 	<UserMacro
 		Name="bsddb44Dir"
-		Value="..\..\db-4.4.20\build_win32"
+		Value="$(externalsDir)\db-4.4.20\build_win32"
 	/>
 	<UserMacro
 		Name="bsddb44DepLibs"
@@ -62,7 +66,7 @@
 	/>
 	<UserMacro
 		Name="bsddb45Dir"
-		Value="..\..\db-4.5.20.x\build_windows"
+		Value="$(externalsDir)\db-4.5.20.x\build_windows"
 	/>
 	<UserMacro
 		Name="bsddb45DepLibs"
@@ -70,23 +74,23 @@
 	/>
 	<UserMacro
 		Name="sqlite3Dir"
-		Value="..\..\sqlite-source-3.3.4"
+		Value="$(externalsDir)\sqlite-source-3.3.4"
 	/>
 	<UserMacro
 		Name="bz2Dir"
-		Value="..\..\bzip2-1.0.3"
+		Value="$(externalsDir)\bzip2-1.0.3"
 	/>
 	<UserMacro
 		Name="opensslDir"
-		Value="..\..\openssl-0.9.8g"
+		Value="$(externalsDir)\openssl-0.9.8g"
 	/>
 	<UserMacro
 		Name="tcltkDir"
-		Value="..\..\tcltk"
+		Value="$(externalsDir)\tcltk"
 	/>
 	<UserMacro
 		Name="tcltk64Dir"
-		Value="..\..\tcltk64"
+		Value="$(externalsDir)\tcltk64"
 	/>
 	<UserMacro
 		Name="tcltkLib"

Modified: python/branches/tlee-ast-optimize/Tools/webchecker/wsgui.py
==============================================================================
--- python/branches/tlee-ast-optimize/Tools/webchecker/wsgui.py	(original)
+++ python/branches/tlee-ast-optimize/Tools/webchecker/wsgui.py	Sun May 25 10:45:18 2008
@@ -10,7 +10,7 @@
 import websucker
 import os
 import threading
-import queue
+import Queue
 import time
 
 VERBOSE = 2
@@ -139,7 +139,7 @@
 
     def go(self, event=None):
         if not self.msgq:
-            self.msgq = queue.Queue(0)
+            self.msgq = Queue.Queue(0)
             self.check_msgq()
         if not self.sucker:
             self.sucker = SuckerThread(self.msgq)

Modified: python/branches/tlee-ast-optimize/configure
==============================================================================
--- python/branches/tlee-ast-optimize/configure	(original)
+++ python/branches/tlee-ast-optimize/configure	Sun May 25 10:45:18 2008
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 62499 .
+# From configure.in Revision: 63545 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for python 2.6.
 #
@@ -2078,6 +2078,11 @@
   Darwin/[789].*)
     define_xopen_source=no
     ;;
+  # On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
+  # defining NI_NUMERICHOST.
+  QNX/6.3.2)
+    define_xopen_source=no
+    ;;
 
 esac
 
@@ -3920,6 +3925,10 @@
 	   LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";;
 	Monterey64*)
 	   LINKCC="$LINKCC -L/usr/lib/ia64l64";;
+	QNX*)
+	   # qcc must be used because the other compilers do not
+	   # support -N.
+	   LINKCC=qcc;;
 	esac
 fi
 { echo "$as_me:$LINENO: result: $LINKCC" >&5
@@ -5461,6 +5470,7 @@
 
 
 
+
 for ac_header in asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
 fcntl.h grp.h \
 ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
@@ -5469,7 +5479,7 @@
 sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
 sys/lock.h sys/mkdev.h sys/modem.h \
 sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
-sys/time.h \
+sys/termio.h sys/time.h \
 sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
 sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
 bluetooth/bluetooth.h linux/tipc.h
@@ -12520,7 +12530,7 @@
 			fi
 		fi
 		;;
-	Linux*|GNU*) LDSHARED='$(CC) -shared';;
+	Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
 	BSD/OS*/4*) LDSHARED="gcc -shared";;
 	FreeBSD*)
 		if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
@@ -12648,6 +12658,13 @@
 		then
 			LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
 		fi;;
+	QNX*)
+		# -Wl,-E causes the symbols to be added to the dynamic
+		# symbol table so that they can be found when a module
+		# is loaded.  -N 2048K causes the stack size to be set
+		# to 2048 kilobytes so that the stack doesn't overflow
+		# when running test_compile.py.
+		LINKFORSHARED='-Wl,-E -N 2048K';;
 	esac
 fi
 { echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5

Modified: python/branches/tlee-ast-optimize/configure.in
==============================================================================
--- python/branches/tlee-ast-optimize/configure.in	(original)
+++ python/branches/tlee-ast-optimize/configure.in	Sun May 25 10:45:18 2008
@@ -262,6 +262,11 @@
   Darwin/@<:@789@:>@.*)
     define_xopen_source=no
     ;;
+  # On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
+  # defining NI_NUMERICHOST.
+  QNX/6.3.2)
+    define_xopen_source=no
+    ;;
 
 esac
 
@@ -586,6 +591,10 @@
 	   LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";;
 	Monterey64*)
 	   LINKCC="$LINKCC -L/usr/lib/ia64l64";;
+	QNX*)
+	   # qcc must be used because the other compilers do not
+	   # support -N.
+	   LINKCC=qcc;;
 	esac
 fi
 AC_MSG_RESULT($LINKCC)
@@ -1132,7 +1141,7 @@
 sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
 sys/lock.h sys/mkdev.h sys/modem.h \
 sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
-sys/time.h \
+sys/termio.h sys/time.h \
 sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
 sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
 bluetooth/bluetooth.h linux/tipc.h)
@@ -1576,7 +1585,7 @@
 			fi
 		fi
 		;;
-	Linux*|GNU*) LDSHARED='$(CC) -shared';;
+	Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
 	BSD/OS*/4*) LDSHARED="gcc -shared";;
 	FreeBSD*)
 		if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
@@ -1700,6 +1709,13 @@
 		then
 			LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
 		fi;;
+	QNX*)
+		# -Wl,-E causes the symbols to be added to the dynamic
+		# symbol table so that they can be found when a module
+		# is loaded.  -N 2048K causes the stack size to be set
+		# to 2048 kilobytes so that the stack doesn't overflow
+		# when running test_compile.py.
+		LINKFORSHARED='-Wl,-E -N 2048K';;
 	esac
 fi
 AC_MSG_RESULT($LINKFORSHARED)

Modified: python/branches/tlee-ast-optimize/pyconfig.h.in
==============================================================================
--- python/branches/tlee-ast-optimize/pyconfig.h.in	(original)
+++ python/branches/tlee-ast-optimize/pyconfig.h.in	Sun May 25 10:45:18 2008
@@ -688,6 +688,9 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
+/* Define to 1 if you have the <sys/termio.h> header file. */
+#undef HAVE_SYS_TERMIO_H
+
 /* Define to 1 if you have the <sys/times.h> header file. */
 #undef HAVE_SYS_TIMES_H
 

Modified: python/branches/tlee-ast-optimize/setup.py
==============================================================================
--- python/branches/tlee-ast-optimize/setup.py	(original)
+++ python/branches/tlee-ast-optimize/setup.py	Sun May 25 10:45:18 2008
@@ -815,9 +815,8 @@
                         if db_setup_debug: print "db lib: ", dblib, "not found"
 
         except db_found:
-            if db_setup_debug:
-                print "db lib: using", db_ver, dblib
-                print "db: lib dir", dblib_dir, "inc dir", db_incdir
+            print "bsddb using BerkeleyDB lib:", db_ver, dblib
+            print "bsddb lib dir:", dblib_dir, " inc dir:", db_incdir
             db_incs = [db_incdir]
             dblibs = [dblib]
             # We add the runtime_library_dirs argument because the
@@ -1009,7 +1008,7 @@
                 missing.append('resource')
 
             # Sun yellow pages. Some systems have the functions in libc.
-            if platform not in ['cygwin', 'atheos']:
+            if platform not in ['cygwin', 'atheos', 'qnx6']:
                 if (self.compiler.find_library_file(lib_dirs, 'nsl')):
                     libs = ['nsl']
                 else:


More information about the Python-checkins mailing list