[Python-checkins] r80100 - in python/branches/py3k-jit: .bzrignore .hgignore Doc/c-api/import.rst Doc/data/refcounts.dat Doc/distutils/apiref.rst Doc/distutils/examples.rst Doc/faq/windows.rst Doc/glossary.rst Doc/library/_thread.rst Doc/library/collections.rst Doc/library/difflib.rst Doc/library/functools.rst Doc/library/itertools.rst Doc/library/logging.rst Doc/library/math.rst Doc/library/multiprocessing.rst Doc/library/os.rst Doc/library/re.rst Doc/library/signal.rst Doc/library/socket.rst Doc/library/stdtypes.rst Doc/library/struct.rst Doc/library/subprocess.rst Doc/library/tarfile.rst Doc/library/test.rst Doc/library/threading.rst Doc/library/unittest.rst Doc/library/urllib.request.rst Doc/library/warnings.rst Doc/reference/expressions.rst Doc/using/cmdline.rst Doc/whatsnew/2.6.rst Doc/whatsnew/2.7.rst Include/Python.h Include/pythread.h LICENSE Lib/_dummy_thread.py Lib/collections.py Lib/difflib.py Lib/distutils/tests/support.py Lib/email/encoders.py Lib/email/message.py Lib/email/test/test_email.py Lib/functools.py Lib/locale.py Lib/logging/__init__.py Lib/logging/config.py Lib/logging/handlers.py Lib/multiprocessing/pool.py Lib/pickle.py Lib/pickletools.py Lib/site.py Lib/subprocess.py Lib/test/gdb_sample.py Lib/test/lock_tests.py Lib/test/pickletester.py Lib/test/regrtest.py Lib/test/support.py Lib/test/test_argparse.py Lib/test/test_difflib.py Lib/test/test_functools.py Lib/test/test_gdb.py Lib/test/test_logging.py Lib/test/test_os.py Lib/test/test_select.py Lib/test/test_urllib2net.py Lib/test/test_urlparse.py Lib/test/test_uuid.py Lib/test/test_warnings.py Lib/test/test_winsound.py Lib/test/win_console_handler.py Lib/threading.py Lib/tkinter/test/test_ttk/test_widgets.py Lib/unittest/case.py Lib/unittest/loader.py Lib/unittest/main.py Lib/unittest/result.py Lib/unittest/runner.py Lib/unittest/test/dummy.py Lib/unittest/test/test_assertions.py Lib/unittest/test/test_break.py Lib/unittest/test/test_discovery.py Lib/unittest/test/test_loader.py Lib/unittest/test/test_result.py Mac/Tools/pythonw.c Makefile.pre.in Misc/ACKS Misc/NEWS Misc/developers.txt Misc/maintainers.rst Misc/python.man Modules/_pickle.c Modules/_sre.c Modules/_ssl.c Modules/_threadmodule.c Modules/datetimemodule.c Modules/main.c Modules/posixmodule.c Modules/python.c Modules/selectmodule.c Modules/signalmodule.c Objects/longobject.c PC/_subprocess.c Python/thread_nt.h Python/thread_pthread.h Tools/README Tools/gdb Tools/i18n/makelocalealias.py configure configure.in

collin.winter python-checkins at python.org
Fri Apr 16 02:53:04 CEST 2010


Author: collin.winter
Date: Fri Apr 16 02:53:03 2010
New Revision: 80100

Log:
Merged revisions 79868,79873,79881-79882,79884,79886,79901,79906,79912,79922,79931,79933,79946,79948,79953,79955-79958,79960,79964-79976,79978,79980-79981,79983,79990,79992,79996-79997,79999,80002,80006,80008,80010,80016,80019-80020,80023,80027,80031,80036,80040,80044,80061,80066,80071,80075,80078,80083,80092 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r79868 | benjamin.peterson | 2010-04-06 14:55:16 -0700 (Tue, 06 Apr 2010) | 13 lines
  
  Merged revisions 79866-79867 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79866 | benjamin.peterson | 2010-04-06 16:37:06 -0500 (Tue, 06 Apr 2010) | 1 line
    
    use skip decorator
  ........
    r79867 | benjamin.peterson | 2010-04-06 16:50:00 -0500 (Tue, 06 Apr 2010) | 1 line
    
    remove a optimization that resulted in unexpected behavior #8929
  ........
................
  r79873 | mark.dickinson | 2010-04-06 15:13:37 -0700 (Tue, 06 Apr 2010) | 9 lines
  
  Merged revisions 79871 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79871 | mark.dickinson | 2010-04-06 23:10:55 +0100 (Tue, 06 Apr 2010) | 2 lines
    
    Use consistent spelling for nans (thanks Georg for noticing).
  ........
................
  r79881 | philip.jenvey | 2010-04-06 21:04:10 -0700 (Tue, 06 Apr 2010) | 19 lines
  
  Merged revisions 79878-79880 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79878 | philip.jenvey | 2010-04-06 16:24:45 -0700 (Tue, 06 Apr 2010) | 4 lines
    
    #7301: add the environment variable $PYTHONWARNINGS to supplement the -W
    command line option
    patch from Brian Curtin
  ........
    r79879 | benjamin.peterson | 2010-04-06 16:32:27 -0700 (Tue, 06 Apr 2010) | 1 line
    
    tell people to update python.man, too
  ........
    r79880 | philip.jenvey | 2010-04-06 16:38:57 -0700 (Tue, 06 Apr 2010) | 1 line
    
    document new PYTHONWARNINGS env var
  ........
................
  r79882 | ezio.melotti | 2010-04-06 21:27:14 -0700 (Tue, 06 Apr 2010) | 25 lines
  
  Merged revisions 79349,79381,79412,79801,79818 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79349 | andrew.kuchling | 2010-03-23 20:39:24 +0200 (Tue, 23 Mar 2010) | 1 line
    
    add some unittest items
  ........
    r79381 | andrew.kuchling | 2010-03-24 20:07:43 +0200 (Wed, 24 Mar 2010) | 1 line
    
    Various edits
  ........
    r79412 | andrew.kuchling | 2010-03-25 03:35:51 +0200 (Thu, 25 Mar 2010) | 1 line
    
    Add various items
  ........
    r79801 | tarek.ziade | 2010-04-05 17:58:14 +0300 (Mon, 05 Apr 2010) | 1 line
    
    added a note for Andrew, about distutils2
  ........
    r79818 | ezio.melotti | 2010-04-06 06:26:49 +0300 (Tue, 06 Apr 2010) | 1 line
    
    Fix several links and other mistakes.
  ........
................
  r79884 | philip.jenvey | 2010-04-06 22:19:21 -0700 (Tue, 06 Apr 2010) | 2 lines
  
  woops these strings aren't kept around, free them
................
  r79886 | stefan.krah | 2010-04-07 01:49:55 -0700 (Wed, 07 Apr 2010) | 9 lines
  
  Merged revisions 79885 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79885 | stefan.krah | 2010-04-07 10:24:44 +0200 (Wed, 07 Apr 2010) | 1 line
    
    Issue #8328: Silence Visual Studio warnings.
  ........
................
  r79901 | georg.brandl | 2010-04-07 23:33:16 -0700 (Wed, 07 Apr 2010) | 1 line
  
  Fix indentation.
................
  r79906 | brian.curtin | 2010-04-08 06:55:29 -0700 (Thu, 08 Apr 2010) | 2 lines
  
  Add MatchObject.groups which got messed up during a merge.
................
  r79912 | antoine.pitrou | 2010-04-09 13:42:09 -0700 (Fri, 09 Apr 2010) | 10 lines
  
  Merged revisions 79910 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79910 | antoine.pitrou | 2010-04-09 22:38:39 +0200 (ven., 09 avril 2010) | 4 lines
    
    SSL_MODE_AUTO_RETRY has been added in OpenSSL 0.9.6.  Fix compilation
    with earlier versions.
  ........
................
  r79922 | raymond.hettinger | 2010-04-10 00:09:53 -0700 (Sat, 10 Apr 2010) | 1 line
  
  Fixup new itertools recipes.
................
  r79931 | raymond.hettinger | 2010-04-10 09:59:03 -0700 (Sat, 10 Apr 2010) | 1 line
  
  Issue 8361: Remove assert from functools.total_ordering
................
  r79933 | benjamin.peterson | 2010-04-10 11:57:52 -0700 (Sat, 10 Apr 2010) | 20 lines
  
  Blocked revisions 79927-79928,79930,79932 via svnmerge
  
  ........
    r79927 | benjamin.peterson | 2010-04-10 11:22:05 -0500 (Sat, 10 Apr 2010) | 1 line
    
    bump version to 2.7b1
  ........
    r79928 | benjamin.peterson | 2010-04-10 11:28:34 -0500 (Sat, 10 Apr 2010) | 1 line
    
    update pydoc-topics
  ........
    r79930 | raymond.hettinger | 2010-04-10 11:57:36 -0500 (Sat, 10 Apr 2010) | 1 line
    
    Issue 8361: Remove assert from functools.total_ordering
  ........
    r79932 | benjamin.peterson | 2010-04-10 13:53:58 -0500 (Sat, 10 Apr 2010) | 1 line
    
    towards beta 2
  ........
................
  r79946 | benjamin.peterson | 2010-04-10 18:43:16 -0700 (Sat, 10 Apr 2010) | 9 lines
  
  Merged revisions 79944 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79944 | benjamin.peterson | 2010-04-10 20:40:32 -0500 (Sat, 10 Apr 2010) | 1 line
    
    add test for class with no operations defined
  ........
................
  r79948 | benjamin.peterson | 2010-04-10 19:17:08 -0700 (Sat, 10 Apr 2010) | 162 lines
  
  Blocked revisions 79285,79292,79384,79387,79480-79481,79483,79509,79511,79528,79549,79569,79575-79578,79625,79650-79651,79706,79710,79713,79722,79730,79744,79750,79755,79808,79915,79918,79920,79937,79939 via svnmerge
  
  ................
    r79285 | jesus.cea | 2010-03-22 09:22:26 -0500 (Mon, 22 Mar 2010) | 1 line
    
    pybsddb 4.8.4 integration. Please, comment in issue #8156
  ................
    r79292 | jesus.cea | 2010-03-22 10:18:46 -0500 (Mon, 22 Mar 2010) | 1 line
    
    Missing testsuite files
  ................
    r79384 | antoine.pitrou | 2010-03-24 16:55:12 -0500 (Wed, 24 Mar 2010) | 3 lines
    
    Trying to fix #8108.  Will watch the buildbot(s).
  ................
    r79387 | antoine.pitrou | 2010-03-24 17:12:15 -0500 (Wed, 24 Mar 2010) | 3 lines
    
    Revert r79384 (the fix failed).
  ................
    r79480 | raymond.hettinger | 2010-03-28 13:02:41 -0500 (Sun, 28 Mar 2010) | 1 line
    
    Update itertools recipes.
  ................
    r79481 | raymond.hettinger | 2010-03-28 13:08:15 -0500 (Sun, 28 Mar 2010) | 1 line
    
    Add a note on optimizing the itertools recipes for production.
  ................
    r79483 | raymond.hettinger | 2010-03-28 13:25:01 -0500 (Sun, 28 Mar 2010) | 1 line
    
    Update itertools recipe for consume().
  ................
    r79509 | thomas.heller | 2010-03-30 14:46:23 -0500 (Tue, 30 Mar 2010) | 24 lines
    
    Merged revisions 79115,79424,79491 via svnmerge from 
    svn+ssh://pythondev@svn.python.org/python/branches/branch_libffi-3_0_10-win
    
    ........
      r79115 | thomas.heller | 2010-03-19 22:14:47 +0100 (Fr, 19 Mrz 2010) | 7 lines
      
      Work in progress.  2 tests fail on x86/win32 because the stack
      checking code in ffi_call_win32 is not yet implemented.
      
      Remove most files from _ctypes/libffi_msvc, only two include files
      stay (updated from _ctypes/libffi/...).  Other files are used in the
      cross-platform _ctypes/libffi directory.
    ........
      r79424 | thomas.heller | 2010-03-25 19:28:02 +0100 (Do, 25 Mrz 2010) | 1 line
      
      Build _ctypes on Win64.
    ........
      r79491 | thomas.heller | 2010-03-29 21:30:33 +0200 (Mo, 29 Mrz 2010) | 4 lines
      
      On Windows, ctypes does no longer check the stack before and after
      calling a foreign function.
      This allows to use the unmodified libffi library.
    ........
  ................
    r79511 | thomas.heller | 2010-03-30 14:55:34 -0500 (Tue, 30 Mar 2010) | 3 lines
    
    Removed merge tracking for "svnmerge" for 
    svn+ssh://pythondev@svn.python.org/python/branches/branch_libffi-3_0_10-win
  ................
    r79528 | ezio.melotti | 2010-03-31 03:33:50 -0500 (Wed, 31 Mar 2010) | 1 line
    
    Silence a py3k warning.
  ................
    r79549 | raymond.hettinger | 2010-04-01 02:54:16 -0500 (Thu, 01 Apr 2010) | 1 line
    
    Document link to Sorting HowTo
  ................
    r79569 | raymond.hettinger | 2010-04-01 21:44:31 -0500 (Thu, 01 Apr 2010) | 1 line
    
    Add and update itertools recipes.
  ................
    r79575 | raymond.hettinger | 2010-04-02 01:23:12 -0500 (Fri, 02 Apr 2010) | 1 line
    
    Cleanup itertools recipes
  ................
    r79576 | florent.xicluna | 2010-04-02 02:24:52 -0500 (Fri, 02 Apr 2010) | 2 lines
    
    #7092: Fix additional "-3" warnings in the idlelib package, and convert to absolute imports.
  ................
    r79577 | florent.xicluna | 2010-04-02 03:15:26 -0500 (Fri, 02 Apr 2010) | 2 lines
    
    #7092: Drop the cmp argument.
  ................
    r79578 | florent.xicluna | 2010-04-02 03:30:21 -0500 (Fri, 02 Apr 2010) | 2 lines
    
    #7092: silence some py3k warnings
  ................
    r79625 | brian.curtin | 2010-04-02 16:51:37 -0500 (Fri, 02 Apr 2010) | 2 lines
    
    Add a line about #7347 to Misc\News
  ................
    r79650 | raymond.hettinger | 2010-04-02 22:14:28 -0500 (Fri, 02 Apr 2010) | 1 line
    
    Improve clear() method.  Keeps key/value refcnts >= 1 until final dict.clear() so that decrefs to zero won't trigger arbitrary code .  Also runs a bit faster.
  ................
    r79651 | raymond.hettinger | 2010-04-03 02:57:09 -0500 (Sat, 03 Apr 2010) | 1 line
    
    Factor-out constant expressions
  ................
    r79706 | benjamin.peterson | 2010-04-03 11:06:42 -0500 (Sat, 03 Apr 2010) | 1 line
    
    stop CObject deprecation warnings in test___all__
  ................
    r79710 | mark.dickinson | 2010-04-03 11:54:02 -0500 (Sat, 03 Apr 2010) | 1 line
    
    Replace backquotes with repr(), to silence a SyntaxWarning.
  ................
    r79713 | raymond.hettinger | 2010-04-03 13:10:37 -0500 (Sat, 03 Apr 2010) | 1 line
    
    Add count() method to collections.deque().
  ................
    r79722 | raymond.hettinger | 2010-04-03 17:34:15 -0500 (Sat, 03 Apr 2010) | 1 line
    
    Expand test coverage for deque.count().
  ................
    r79730 | raymond.hettinger | 2010-04-03 20:24:59 -0500 (Sat, 03 Apr 2010) | 1 line
    
    Issue 5479:  Add functools.total_ordering class decorator.
  ................
    r79744 | raymond.hettinger | 2010-04-04 02:33:46 -0500 (Sun, 04 Apr 2010) | 1 line
    
    Documentation nit
  ................
    r79750 | raymond.hettinger | 2010-04-04 13:34:45 -0500 (Sun, 04 Apr 2010) | 1 line
    
    Add functools.CmpToKey()
  ................
    r79755 | raymond.hettinger | 2010-04-04 16:45:01 -0500 (Sun, 04 Apr 2010) | 6 lines
    
    Add tests for cmp_to_key.
    Adopt PEP 8 compliant function name.
    Factor-out existing uses cmp_to_key.
    Update documentation to use internal pointers instead of external resource.
  ................
    r79808 | raymond.hettinger | 2010-04-05 13:53:43 -0500 (Mon, 05 Apr 2010) | 1 line
    
    Classes that override __eq__ also need to define __hash__.
  ................
    r79915 | antoine.pitrou | 2010-04-09 16:00:36 -0500 (Fri, 09 Apr 2010) | 3 lines
    
    Temporarily commit fix to issue #8108, to check for buildbot response
  ................
    r79918 | antoine.pitrou | 2010-04-09 17:41:31 -0500 (Fri, 09 Apr 2010) | 3 lines
    
    Revert r79915 (temporary commit to check for buildbots -> the fix was successful)
  ................
    r79920 | raymond.hettinger | 2010-04-10 02:01:32 -0500 (Sat, 10 Apr 2010) | 1 line
    
    Fixup new itertools recipes.
  ................
    r79937 | antoine.pitrou | 2010-04-10 17:43:05 -0500 (Sat, 10 Apr 2010) | 3 lines
    
    Temporary commit of fix to issue #5380 (in order to watch buildbot response)
  ................
    r79939 | raymond.hettinger | 2010-04-10 19:01:23 -0500 (Sat, 10 Apr 2010) | 1 line
    
    Add the sorting HOWTO to the main docs.
  ................
................
  r79953 | benjamin.peterson | 2010-04-11 07:49:17 -0700 (Sun, 11 Apr 2010) | 12 lines
  
  Blocked revisions 79938,79949 via svnmerge
  
  ........
    r79938 | antoine.pitrou | 2010-04-10 18:32:12 -0500 (Sat, 10 Apr 2010) | 3 lines
    
    Revert temporary commit in r79937
  ........
    r79949 | raymond.hettinger | 2010-04-11 03:14:45 -0500 (Sun, 11 Apr 2010) | 1 line
    
    Add descriptor howto to main documentation
  ........
................
  r79955 | benjamin.peterson | 2010-04-11 08:41:33 -0700 (Sun, 11 Apr 2010) | 20 lines
  
  Blocked revisions 79493,79515,79637,79760 via svnmerge
  
  ........
    r79493 | michael.foord | 2010-03-29 15:04:23 -0500 (Mon, 29 Mar 2010) | 1 line
    
    Backport of weakref.WeakSet and tests from Python 3.
  ........
    r79515 | thomas.heller | 2010-03-30 15:57:06 -0500 (Tue, 30 Mar 2010) | 1 line
    
    Revert rev. 79509; ctypes doesn't build on linux.
  ........
    r79637 | raymond.hettinger | 2010-04-02 19:39:26 -0500 (Fri, 02 Apr 2010) | 1 line
    
    Clear cyclical references in list based OrderedDict.
  ........
    r79760 | raymond.hettinger | 2010-04-04 17:24:03 -0500 (Sun, 04 Apr 2010) | 1 line
    
    Add tests for functools.total_ordering.
  ........
................
  r79956 | benjamin.peterson | 2010-04-11 09:12:57 -0700 (Sun, 11 Apr 2010) | 122 lines
  
  Merged revisions 79307,79408,79430,79533,79542,79579-79580,79585-79587,79607-79608,79622,79717,79820,79822,79828,79862,79875,79923-79924,79941-79943,79945,79947,79951-79952 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79307 | florent.xicluna | 2010-03-22 17:45:50 -0500 (Mon, 22 Mar 2010) | 2 lines
    
    #7667: Fix doctest failures with non-ASCII paths.
  ........
    r79408 | victor.stinner | 2010-03-24 20:18:38 -0500 (Wed, 24 Mar 2010) | 2 lines
    
    Fix a gcc warning introduced by r79397.
  ........
    r79430 | brian.curtin | 2010-03-25 18:48:54 -0500 (Thu, 25 Mar 2010) | 2 lines
    
    Fix #6538. Markup RegexObject and MatchObject as classes. Patch by Ryan Arana.
  ........
    r79533 | barry.warsaw | 2010-03-31 16:07:16 -0500 (Wed, 31 Mar 2010) | 6 lines
    
    - Issue #8233: When run as a script, py_compile.py optionally takes a single
      argument `-` which tells it to read files to compile from stdin.  Each line
      is read on demand and the named file is compiled immediately.  (Original
      patch by Piotr O?\197?\188arowski).
  ........
    r79542 | r.david.murray | 2010-03-31 20:28:39 -0500 (Wed, 31 Mar 2010) | 3 lines
    
    A couple small grammar fixes in test.rst, and rewrite the
    check_warnings docs to be clearer.
  ........
    r79579 | georg.brandl | 2010-04-02 03:34:41 -0500 (Fri, 02 Apr 2010) | 1 line
    
    Add 2.6.5.
  ........
    r79580 | georg.brandl | 2010-04-02 03:39:09 -0500 (Fri, 02 Apr 2010) | 1 line
    
    #2768: add a note on how to get a file descriptor.
  ........
    r79585 | georg.brandl | 2010-04-02 04:03:18 -0500 (Fri, 02 Apr 2010) | 1 line
    
    Remove col-spanning cells in logging docs.
  ........
    r79586 | georg.brandl | 2010-04-02 04:07:42 -0500 (Fri, 02 Apr 2010) | 1 line
    
    Document PyImport_ExecCodeModuleEx().
  ........
    r79587 | georg.brandl | 2010-04-02 04:11:49 -0500 (Fri, 02 Apr 2010) | 1 line
    
    #8012: clarification in generator glossary entry.
  ........
    r79607 | andrew.kuchling | 2010-04-02 12:48:23 -0500 (Fri, 02 Apr 2010) | 1 line
    
    #6647: document that catch_warnings is not thread-safe
  ........
    r79608 | andrew.kuchling | 2010-04-02 12:54:26 -0500 (Fri, 02 Apr 2010) | 1 line
    
    #6647: add note to two examples
  ........
    r79622 | tarek.ziade | 2010-04-02 16:34:19 -0500 (Fri, 02 Apr 2010) | 1 line
    
    removed documentation on code that was reverted and pushed into distutils2
  ........
    r79717 | antoine.pitrou | 2010-04-03 16:22:38 -0500 (Sat, 03 Apr 2010) | 4 lines
    
    Fix wording / typography, and a slightly misleading statement
    (memoryviews don't support complex structures right now)
  ........
    r79820 | benjamin.peterson | 2010-04-05 22:34:09 -0500 (Mon, 05 Apr 2010) | 1 line
    
    ready _sre types
  ........
    r79822 | georg.brandl | 2010-04-06 03:18:15 -0500 (Tue, 06 Apr 2010) | 1 line
    
    #8320: document return value of recv_into().
  ........
    r79828 | georg.brandl | 2010-04-06 09:33:44 -0500 (Tue, 06 Apr 2010) | 1 line
    
    Add JP.
  ........
    r79862 | georg.brandl | 2010-04-06 15:27:59 -0500 (Tue, 06 Apr 2010) | 1 line
    
    Fix syntax.
  ........
    r79875 | mark.dickinson | 2010-04-06 17:18:23 -0500 (Tue, 06 Apr 2010) | 1 line
    
    More NaN consistency doc fixes.
  ........
    r79923 | georg.brandl | 2010-04-10 06:15:24 -0500 (Sat, 10 Apr 2010) | 1 line
    
    #8360: skipTest was added in 2.7.
  ........
    r79924 | georg.brandl | 2010-04-10 06:16:59 -0500 (Sat, 10 Apr 2010) | 1 line
    
    #8346: update version.
  ........
    r79941 | andrew.kuchling | 2010-04-10 20:39:36 -0500 (Sat, 10 Apr 2010) | 1 line
    
    Two grammar fixes
  ........
    r79942 | andrew.kuchling | 2010-04-10 20:40:06 -0500 (Sat, 10 Apr 2010) | 1 line
    
    Punctuation fix
  ........
    r79943 | andrew.kuchling | 2010-04-10 20:40:30 -0500 (Sat, 10 Apr 2010) | 1 line
    
    Add various items
  ........
    r79945 | andrew.kuchling | 2010-04-10 20:40:49 -0500 (Sat, 10 Apr 2010) | 1 line
    
    name correct
  ........
    r79947 | andrew.kuchling | 2010-04-10 20:44:13 -0500 (Sat, 10 Apr 2010) | 1 line
    
    Remove distutils section
  ........
    r79951 | andrew.kuchling | 2010-04-11 07:48:08 -0500 (Sun, 11 Apr 2010) | 1 line
    
    Two typo fixes
  ........
    r79952 | andrew.kuchling | 2010-04-11 07:49:37 -0500 (Sun, 11 Apr 2010) | 1 line
    
    Add two items
  ........
................
  r79957 | benjamin.peterson | 2010-04-11 09:13:23 -0700 (Sun, 11 Apr 2010) | 1 line
  
  add 3.1.2
................
  r79958 | benjamin.peterson | 2010-04-11 09:25:06 -0700 (Sun, 11 Apr 2010) | 37 lines
  
  Merged revisions 79279,79284,79293,79373,79376,79379,79876,79888 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79279 | vinay.sajip | 2010-03-22 07:33:08 -0500 (Mon, 22 Mar 2010) | 1 line
    
    Issue #8200: logging: Handle errors when multiprocessing is not fully loaded when logging occurs.
  ........
    r79284 | vinay.sajip | 2010-03-22 08:02:28 -0500 (Mon, 22 Mar 2010) | 1 line
    
    Issue #8201: logging: Handle config errors when non-ASCII and Unicode logger names exist at the same time.
  ........
    r79293 | vinay.sajip | 2010-03-22 10:29:01 -0500 (Mon, 22 Mar 2010) | 1 line
    
    logging: Added getChild utility method to Logger and added isEnabledFor method to LoggerAdapter.
  ........
    r79373 | vinay.sajip | 2010-03-24 09:31:21 -0500 (Wed, 24 Mar 2010) | 1 line
    
    logging: Added LOG_FTP for SysLogHandler and updated documentation.
  ........
    r79376 | vinay.sajip | 2010-03-24 10:10:40 -0500 (Wed, 24 Mar 2010) | 1 line
    
    logging: Documentation tweak.
  ........
    r79379 | vinay.sajip | 2010-03-24 12:36:35 -0500 (Wed, 24 Mar 2010) | 1 line
    
    logging: Updated SysLogHandler documentation.
  ........
    r79876 | vinay.sajip | 2010-04-06 17:32:37 -0500 (Tue, 06 Apr 2010) | 1 line
    
    Issue #8327: logging: Clarification of propagation functionality in documentation.
  ........
    r79888 | vinay.sajip | 2010-04-07 04:40:52 -0500 (Wed, 07 Apr 2010) | 1 line
    
    Issue #8331: logging: fixed some grammatical errors in documentation.
  ........
................
  r79960 | stefan.krah | 2010-04-11 09:49:20 -0700 (Sun, 11 Apr 2010) | 22 lines
  
  Merged revisions 79954 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79954 | stefan.krah | 2010-04-11 17:15:54 +0200 (Sun, 11 Apr 2010) | 17 lines
    
    
    Fix for issues #3581, #1481 and #7650:
    
    1. The assumptions in check_node() were too restrictive:
    
         - Hardware addresses with universal_local_bit=1 are valid
           (locally administered).
    
         - Many of the tested functions (including uuid.getnode())
           may return valid RFC 4122 random node IDs. These are pretty
           much random 48-bit values with the multicast bit set to 1.
    
    2. _unixdll_getnode() calls _uuid_generate_time(), which may be None
       on some platforms. The resulting TypeError is now caught.
  ........
................
  r79964 | raymond.hettinger | 2010-04-11 13:41:56 -0700 (Sun, 11 Apr 2010) | 1 line
  
  Minor factoring
................
  r79965 | benjamin.peterson | 2010-04-11 13:43:16 -0700 (Sun, 11 Apr 2010) | 95 lines
  
  Merged revisions 79464,79471,79623,79626,79630,79632,79643,79648-79649,79679,79685,79711,79761,79774,79777,79792-79794,79877,79898-79900 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79464 | michael.foord | 2010-03-27 07:55:19 -0500 (Sat, 27 Mar 2010) | 1 line
    
    A fix for running unittest tests on platforms without the audioop module (e.g. jython and IronPython)
  ........
    r79471 | michael.foord | 2010-03-27 14:10:11 -0500 (Sat, 27 Mar 2010) | 4 lines
    
    Addition of delta keyword argument to unittest.TestCase.assertAlmostEquals and assertNotAlmostEquals
    
    This allows the comparison of objects by specifying a maximum difference; this includes the comparing of non-numeric objects that don't support rounding.
  ........
    r79623 | michael.foord | 2010-04-02 16:42:47 -0500 (Fri, 02 Apr 2010) | 1 line
    
    Addition of -b command line option to unittest for buffering stdout and stderr during test runs.
  ........
    r79626 | michael.foord | 2010-04-02 17:08:29 -0500 (Fri, 02 Apr 2010) | 1 line
    
    TestResult stores original sys.stdout and tests no longer use sys.__stdout__ (etc) in tests for unittest -b command line option
  ........
    r79630 | michael.foord | 2010-04-02 17:30:56 -0500 (Fri, 02 Apr 2010) | 1 line
    
    unittest tests no longer replace the sys.stdout put in place by regrtest
  ........
    r79632 | michael.foord | 2010-04-02 17:55:59 -0500 (Fri, 02 Apr 2010) | 1 line
    
    Issue #8038: Addition of unittest.TestCase.assertNotRegexpMatches
  ........
    r79643 | michael.foord | 2010-04-02 20:15:21 -0500 (Fri, 02 Apr 2010) | 1 line
    
    Support dotted module names for test discovery paths in unittest. Issue 8038.
  ........
    r79648 | michael.foord | 2010-04-02 21:21:39 -0500 (Fri, 02 Apr 2010) | 1 line
    
    Cross platform unittest.TestResult newline handling when buffering stdout / stderr.
  ........
    r79649 | michael.foord | 2010-04-02 21:33:55 -0500 (Fri, 02 Apr 2010) | 1 line
    
    Another attempt at a fix for unittest.test.test_result for windows line endings
  ........
    r79679 | michael.foord | 2010-04-03 09:52:18 -0500 (Sat, 03 Apr 2010) | 1 line
    
    Adding -b command line option to the unittest usage message.
  ........
    r79685 | michael.foord | 2010-04-03 10:20:00 -0500 (Sat, 03 Apr 2010) | 1 line
    
    Minor tweak to unittest command line usage message
  ........
    r79711 | michael.foord | 2010-04-03 12:03:11 -0500 (Sat, 03 Apr 2010) | 1 line
    
    Documenting new features in unittest
  ........
    r79761 | michael.foord | 2010-04-04 17:41:54 -0500 (Sun, 04 Apr 2010) | 1 line
    
    unittest documentation formatting changes
  ........
    r79774 | michael.foord | 2010-04-04 18:28:44 -0500 (Sun, 04 Apr 2010) | 1 line
    
    Adding documentation for new unittest.main() parameters
  ........
    r79777 | michael.foord | 2010-04-04 19:39:50 -0500 (Sun, 04 Apr 2010) | 1 line
    
    Document signal handling functions in unittest.rst
  ........
    r79792 | michael.foord | 2010-04-05 05:26:26 -0500 (Mon, 05 Apr 2010) | 1 line
    
    Documentation fixes for unittest
  ........
    r79793 | michael.foord | 2010-04-05 05:28:27 -0500 (Mon, 05 Apr 2010) | 1 line
    
    Furterh documentation fix for unittest.rst
  ........
    r79794 | michael.foord | 2010-04-05 05:30:14 -0500 (Mon, 05 Apr 2010) | 1 line
    
    Further documentation fix for unittest.rst
  ........
    r79877 | michael.foord | 2010-04-06 18:18:16 -0500 (Tue, 06 Apr 2010) | 1 line
    
    Fix module directory finding logic for dotted paths in unittest test discovery.
  ........
    r79898 | michael.foord | 2010-04-07 18:04:22 -0500 (Wed, 07 Apr 2010) | 1 line
    
    unittest.result.TestResult does not create its buffers until they're used. It uses StringIO not cStringIO. Issue 8333.
  ........
    r79899 | michael.foord | 2010-04-07 19:04:24 -0500 (Wed, 07 Apr 2010) | 1 line
    
    Switch regrtest to use StringIO instead of cStringIO for test_multiprocessing on Windows. Issue 8333.
  ........
    r79900 | michael.foord | 2010-04-07 23:33:20 -0500 (Wed, 07 Apr 2010) | 1 line
    
    Correction of unittest documentation typos and omissions
  ........
................
  r79966 | benjamin.peterson | 2010-04-11 13:49:42 -0700 (Sun, 11 Apr 2010) | 8 lines
  
  Blocked revisions 79962 via svnmerge
  
  ........
    r79962 | raymond.hettinger | 2010-04-11 15:39:28 -0500 (Sun, 11 Apr 2010) | 1 line
    
    Minor factoring
  ........
................
  r79967 | benjamin.peterson | 2010-04-11 14:03:55 -0700 (Sun, 11 Apr 2010) | 15 lines
  
  Blocked revisions 79935 via svnmerge
  
  ........
    r79935 | jean-paul.calderone | 2010-04-10 14:59:28 -0500 (Sat, 10 Apr 2010) | 9 lines
    
    Refactor a couple inspect module tests to remove duplicate code
    
    The test_classify_oldstyle and test_classify_newstyle methods of
    test.test_inspect.TestClassesAndFunctions were previously almost
    identical (aside from irrelevant whitespace and one semantic
    difference).  They now share a single helper.
    
    Fixes issue #8363.
  ........
................
  r79968 | benjamin.peterson | 2010-04-11 14:16:33 -0700 (Sun, 11 Apr 2010) | 10 lines
  
  Merged revisions 79936 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79936 | philip.jenvey | 2010-04-10 15:27:15 -0500 (Sat, 10 Apr 2010) | 3 lines
    
    fix PYTHONWARNINGS handling to not modify the original env value and improve
    its tests
  ........
................
  r79969 | benjamin.peterson | 2010-04-11 14:22:10 -0700 (Sun, 11 Apr 2010) | 9 lines
  
  Merged revisions 79934 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79934 | philip.jenvey | 2010-04-10 14:39:07 -0500 (Sat, 10 Apr 2010) | 1 line
    
    adjust gc_collect for Jython
  ........
................
  r79970 | benjamin.peterson | 2010-04-11 14:39:55 -0700 (Sun, 11 Apr 2010) | 3 lines
  
  Rolled back revisions 79307 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
................
  r79971 | benjamin.peterson | 2010-04-11 14:49:28 -0700 (Sun, 11 Apr 2010) | 50 lines
  
  Merged revisions 79548,79557,79616-79617,79716,79778,79795,79803,79896 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79548 | martin.v.loewis | 2010-04-01 02:40:51 -0500 (Thu, 01 Apr 2010) | 3 lines
    
    Issue #8032: For gdb7, a python-gdb.py file is added to the build,
    allowing to use advanced gdb features when debugging Python.
  ........
    r79557 | antoine.pitrou | 2010-04-01 12:56:57 -0500 (Thu, 01 Apr 2010) | 5 lines
    
    Issue #8281: rename test_gdb_sample.py to gdb_sample.py, otherwise it gets picked
    as a regular test by regrtest.py, and fails.
  ........
    r79616 | mark.dickinson | 2010-04-02 15:22:21 -0500 (Fri, 02 Apr 2010) | 1 line
    
    Add python.exe-gdb.py to svn:ignore, for the benefit of OS X developers.
  ........
    r79617 | mark.dickinson | 2010-04-02 15:34:26 -0500 (Fri, 02 Apr 2010) | 1 line
    
    Add python-gdb.py and python.exe-gdb.py to distclean target in Makefile.
  ........
    r79716 | martin.v.loewis | 2010-04-03 13:54:07 -0500 (Sat, 03 Apr 2010) | 2 lines
    
    Don't install python-gdb.py as an executable.
  ........
    r79778 | r.david.murray | 2010-04-04 20:34:50 -0500 (Sun, 04 Apr 2010) | 3 lines
    
    Issue 8287: try to fix the gdb-python install errors on Solaris
    and FreeBSD.  Patch by Dave Malcolm.
  ........
    r79795 | ronald.oussoren | 2010-04-05 06:21:21 -0500 (Mon, 05 Apr 2010) | 7 lines
    
    Ensure that the gdb hooks can be installed when
    srcdir != builddir.
    
    Without this patch it is no longer possible to
    build python when you don't run configure from
    the root of the source tree.
  ........
    r79803 | r.david.murray | 2010-04-05 11:28:49 -0500 (Mon, 05 Apr 2010) | 3 lines
    
    Issue 8316: make test_gdb robust in the face of differing terminal
    widths.  Patch by Dave Malcolm.
  ........
    r79896 | martin.v.loewis | 2010-04-07 14:11:32 -0500 (Wed, 07 Apr 2010) | 2 lines
    
    Issue #8337: Disable the remaining test also for now.
  ........
................
  r79972 | benjamin.peterson | 2010-04-11 14:56:02 -0700 (Sun, 11 Apr 2010) | 8 lines
  
  Blocked revisions 79307 via svnmerge
  
  ........
    r79307 | florent.xicluna | 2010-03-22 17:45:50 -0500 (Mon, 22 Mar 2010) | 2 lines
    
    #7667: Fix doctest failures with non-ASCII paths.
  ........
................
  r79973 | benjamin.peterson | 2010-04-11 14:59:57 -0700 (Sun, 11 Apr 2010) | 9 lines
  
  Merged revisions 79908 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79908 | martin.v.loewis | 2010-04-08 12:40:54 -0500 (Thu, 08 Apr 2010) | 2 lines
    
    Issue #8348: Fix test ftp url in test_urllib2net.
  ........
................
  r79974 | benjamin.peterson | 2010-04-11 15:04:51 -0700 (Sun, 11 Apr 2010) | 13 lines
  
  Merged revisions 79903,79907 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79903 | martin.v.loewis | 2010-04-08 04:47:40 -0500 (Thu, 08 Apr 2010) | 2 lines
    
    Issue #8344: Fix test_ttk bug on FreeBSD.
  ........
    r79907 | martin.v.loewis | 2010-04-08 12:38:32 -0500 (Thu, 08 Apr 2010) | 2 lines
    
    Issue #8204: Fix test_ttk notebook test by forcing focus.
  ........
................
  r79975 | benjamin.peterson | 2010-04-11 15:14:02 -0700 (Sun, 11 Apr 2010) | 15 lines
  
  Merged revisions 79902 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79902 | ronald.oussoren | 2010-04-08 03:13:31 -0500 (Thu, 08 Apr 2010) | 9 lines
    
    This check-in fixes two problems:
    
    1) A non-critical off-by-one error in pythonw
    
    2) A problem in the configure script that caused
       builds with '--enable-framework --enable-universalsdk=/'
       to fail on OSX 10.6.
  ........
................
  r79976 | benjamin.peterson | 2010-04-11 15:15:28 -0700 (Sun, 11 Apr 2010) | 1 line
  
  regen configure
................
  r79978 | antoine.pitrou | 2010-04-11 15:35:34 -0700 (Sun, 11 Apr 2010) | 10 lines
  
  Merged revisions 79977 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79977 | antoine.pitrou | 2010-04-12 00:32:39 +0200 (lun., 12 avril 2010) | 4 lines
    
    Issue #8374: Update the internal alias table in the :mod:`locale` module
    to cover recent locale changes and additions.
  ........
................
  r79980 | antoine.pitrou | 2010-04-11 15:47:34 -0700 (Sun, 11 Apr 2010) | 8 lines
  
  Blocked revisions 79979 via svnmerge
  
  ........
    r79979 | antoine.pitrou | 2010-04-12 00:45:47 +0200 (lun., 12 avril 2010) | 3 lines
    
    Fix misplaced items and incorrect title.
  ........
................
  r79981 | benjamin.peterson | 2010-04-11 16:51:24 -0700 (Sun, 11 Apr 2010) | 1 line
  
  compare with empty bytes
................
  r79983 | antoine.pitrou | 2010-04-11 17:16:50 -0700 (Sun, 11 Apr 2010) | 14 lines
  
  Merged revisions 79982 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79982 | antoine.pitrou | 2010-04-12 02:10:46 +0200 (lun., 12 avril 2010) | 8 lines
    
    It is possible to add extra testing options using EXTRATESTOPTS.
    When such extra options include "-x testname", subsequent arguments
    are all taken as test names to ignore. Therefore, standard options
    must be passed before *TESTOPTS.
    
    (witnessed on the ARM buildbots)
  ........
................
  r79990 | senthil.kumaran | 2010-04-12 00:03:17 -0700 (Mon, 12 Apr 2010) | 9 lines
  
  Merged revisions 79988 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79988 | senthil.kumaran | 2010-04-12 12:20:24 +0530 (Mon, 12 Apr 2010) | 3 lines
    
    Adding additional examples of valid urls as per RFC 3986 (for issue8339)
  ........
................
  r79992 | tarek.ziade | 2010-04-12 01:23:49 -0700 (Mon, 12 Apr 2010) | 1 line
  
  Fixed #8375 - test_distutils now checks what remains to be cleaned up during tearDown
................
  r79996 | r.david.murray | 2010-04-12 07:48:58 -0700 (Mon, 12 Apr 2010) | 15 lines
  
  Merged revisions 79994 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79994 | r.david.murray | 2010-04-12 10:26:06 -0400 (Mon, 12 Apr 2010) | 9 lines
    
    Issue #7472: ISO-2022 charsets now consistently use 7bit CTE.
    
    Fixed a typo in the email.encoders module so that messages output using
    an ISO-2022 character set will use a content-transfer-encoding of
    7bit consistently.  Previously if the input data had any eight bit
    characters the output data would get marked as 8bit even though it
    was actually 7bit.
  ........
................
  r79997 | barry.warsaw | 2010-04-12 07:50:57 -0700 (Mon, 12 Apr 2010) | 1 line
  
  typo
................
  r79999 | r.david.murray | 2010-04-12 08:19:03 -0700 (Mon, 12 Apr 2010) | 4 lines
  
  Kurt's roundup id is kbk, use that in maintainers.rst instead of
  his checkin id, since maintainers is for finding people to make
  nosy in the tracker.
................
  r80002 | stefan.krah | 2010-04-12 08:33:12 -0700 (Mon, 12 Apr 2010) | 9 lines
  
  Merged revisions 80000 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r80000 | stefan.krah | 2010-04-12 17:21:25 +0200 (Mon, 12 Apr 2010) | 3 lines
    
    Issue #8367: Fix spurious test failure on systems without a sound card.
  ........
................
  r80006 | r.david.murray | 2010-04-12 09:58:02 -0700 (Mon, 12 Apr 2010) | 19 lines
  
  Merged revisions 80004 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r80004 | r.david.murray | 2010-04-12 12:35:19 -0400 (Mon, 12 Apr 2010) | 13 lines
    
    Issue #7585: use tab between components in unified and context diff headers.
    
    Instead of spaces between the filename and date (or whatever the string
    is that follows the filename, if any) use tabs.  This is what the unix
    'diff' command does, for example, and difflib was intended to follow
    the 'standard' way of doing diffs.  This improves compatibility with
    patch tools.  The docs and examples are also changed to recommended that
    the date format used be the ISO 8601 format, which is what modern diff
    tools emit by default.
    
    Patch by Anatoly Techtonik.
  ........
................
  r80008 | brian.curtin | 2010-04-12 10:16:38 -0700 (Mon, 12 Apr 2010) | 2 lines
  
  Port #1220212 (os.kill for Win32) to py3k.
................
  r80010 | brian.curtin | 2010-04-12 11:10:10 -0700 (Mon, 12 Apr 2010) | 9 lines
  
  Merged revisions 80009 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r80009 | brian.curtin | 2010-04-12 13:07:21 -0500 (Mon, 12 Apr 2010) | 2 lines
    
    Update the Windows FAQ's text about os.kill (#1220212).
  ........
................
  r80016 | mark.dickinson | 2010-04-12 14:00:59 -0700 (Mon, 12 Apr 2010) | 29 lines
  
  Merged revisions 80013-80015 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r80013 | mark.dickinson | 2010-04-12 20:25:32 +0100 (Mon, 12 Apr 2010) | 14 lines
    
    Issue #7355: Various improvements to struct module documentation.
    
     - note early on that the result of struct.pack includes padding
       bytes by default
    
     - add examples showing how order of struct fields can affect size
       (due to padding)
    
     - better headers and references; introduction to format strings
    
     - integrate packing notes into table
    
    Many thanks to Meador Inge for the patch.
  ........
    r80014 | mark.dickinson | 2010-04-12 20:46:20 +0100 (Mon, 12 Apr 2010) | 1 line
    
    Rewrap some long lines in struct module doc source.
  ........
    r80015 | mark.dickinson | 2010-04-12 21:38:36 +0100 (Mon, 12 Apr 2010) | 1 line
    
    More struct doc tweaks.
  ........
................
  r80019 | benjamin.peterson | 2010-04-12 14:18:30 -0700 (Mon, 12 Apr 2010) | 8 lines
  
  Blocked revisions 80017 via svnmerge
  
  ........
    r80017 | raymond.hettinger | 2010-04-12 16:12:06 -0500 (Mon, 12 Apr 2010) | 1 line
    
    Add usage notes for collections.Counter().
  ........
................
  r80020 | raymond.hettinger | 2010-04-12 14:45:14 -0700 (Mon, 12 Apr 2010) | 1 line
  
  Add usage notes for collections.Counter()
................
  r80023 | brian.curtin | 2010-04-12 16:33:42 -0700 (Mon, 12 Apr 2010) | 9 lines
  
  Merged revisions 80022 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r80022 | brian.curtin | 2010-04-12 18:30:49 -0500 (Mon, 12 Apr 2010) | 2 lines
    
    Fix #8364. Update the setquit docstring and change a built-in to builtin.
  ........
................
  r80027 | brian.curtin | 2010-04-12 19:32:40 -0700 (Mon, 12 Apr 2010) | 11 lines
  
  Merged revisions 80026 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r80026 | brian.curtin | 2010-04-12 21:25:20 -0500 (Mon, 12 Apr 2010) | 4 lines
    
    Fix #7306. Add skips to test_winsound when no default sound is configured.
    
    These failures occur on a Windows Server 2003 machine I test on.
  ........
................
  r80031 | victor.stinner | 2010-04-13 04:07:24 -0700 (Tue, 13 Apr 2010) | 4 lines
  
  Issue #8383: pickle and pickletools use surrogatepass error handler when
  encoding unicode as utf8 to support lone surrogates and stay compatible with
  Python 2.x and 3.0
................
  r80036 | mark.dickinson | 2010-04-13 04:43:10 -0700 (Tue, 13 Apr 2010) | 9 lines
  
  Merged revisions 80035 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r80035 | mark.dickinson | 2010-04-13 12:37:23 +0100 (Tue, 13 Apr 2010) | 1 line
    
    In test_winsound, don't try to import _winreg until after checking that winsound is supported.
  ........
................
  r80040 | mark.dickinson | 2010-04-13 04:54:59 -0700 (Tue, 13 Apr 2010) | 1 line
  
  Fix invalid syntax.
................
  r80044 | brian.curtin | 2010-04-13 05:43:07 -0700 (Tue, 13 Apr 2010) | 2 lines
  
  Fixed extraneous _winreg (changed to winreg in py3k). Thanks, Tim Golden.
................
  r80061 | antoine.pitrou | 2010-04-13 10:37:01 -0700 (Tue, 13 Apr 2010) | 11 lines
  
  Merged revisions 80060 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r80060 | antoine.pitrou | 2010-04-13 19:36:07 +0200 (mar., 13 avril 2010) | 5 lines
    
    Fix overzealous patterns in .hgignore, which used to hide files containing e.g. "python".
    
    (also an occasional source of bugs on the hgsvn-generated hg mirrors)
  ........
................
  r80066 | philip.jenvey | 2010-04-13 20:01:39 -0700 (Tue, 13 Apr 2010) | 2 lines
  
  #7301: decode $PYTHONWARNINGS in the same way as argv, test non-ascii values
................
  r80071 | antoine.pitrou | 2010-04-14 08:44:10 -0700 (Wed, 14 Apr 2010) | 6 lines
  
  Issue #7316: the acquire() method of lock objects in the :mod:`threading`
  module now takes an optional timeout argument in seconds.  Timeout support
  relies on the system threading library, so as to avoid a semi-busy wait
  loop.
................
  r80075 | philip.jenvey | 2010-04-14 10:03:38 -0700 (Wed, 14 Apr 2010) | 2 lines
  
  strings from _Py_char2wchar need PyMem_Free
................
  r80078 | r.david.murray | 2010-04-14 11:59:18 -0700 (Wed, 14 Apr 2010) | 9 lines
  
  Merged revisions 80062 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r80062 | r.david.murray | 2010-04-13 16:57:40 -0400 (Tue, 13 Apr 2010) | 2 lines
    
    Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters.
  ........
................
  r80083 | georg.brandl | 2010-04-14 14:42:41 -0700 (Wed, 14 Apr 2010) | 8 lines
  
  Blocked revisions 80082 via svnmerge
  
  ........
    r80082 | georg.brandl | 2010-04-14 23:36:49 +0200 (Mi, 14 Apr 2010) | 1 line
    
    #8370: fix module name in backported doc addition.
  ........
................
  r80092 | senthil.kumaran | 2010-04-15 10:18:22 -0700 (Thu, 15 Apr 2010) | 2 lines
  
  Fix Issue5419 - explaining bytes return value of urlopen, use of .decode() to convert to str.
................


Added:
   python/branches/py3k-jit/Lib/test/gdb_sample.py
      - copied unchanged from r80092, /python/branches/py3k/Lib/test/gdb_sample.py
   python/branches/py3k-jit/Lib/test/test_gdb.py
      - copied unchanged from r80092, /python/branches/py3k/Lib/test/test_gdb.py
   python/branches/py3k-jit/Lib/test/win_console_handler.py
      - copied unchanged from r80092, /python/branches/py3k/Lib/test/win_console_handler.py
   python/branches/py3k-jit/Lib/unittest/test/dummy.py
      - copied unchanged from r80092, /python/branches/py3k/Lib/unittest/test/dummy.py
   python/branches/py3k-jit/Tools/gdb/
      - copied from r80092, /python/branches/py3k/Tools/gdb/
Modified:
   python/branches/py3k-jit/   (props changed)
   python/branches/py3k-jit/.bzrignore
   python/branches/py3k-jit/.hgignore
   python/branches/py3k-jit/Doc/c-api/import.rst
   python/branches/py3k-jit/Doc/data/refcounts.dat
   python/branches/py3k-jit/Doc/distutils/apiref.rst
   python/branches/py3k-jit/Doc/distutils/examples.rst
   python/branches/py3k-jit/Doc/faq/windows.rst
   python/branches/py3k-jit/Doc/glossary.rst
   python/branches/py3k-jit/Doc/library/_thread.rst
   python/branches/py3k-jit/Doc/library/collections.rst
   python/branches/py3k-jit/Doc/library/difflib.rst
   python/branches/py3k-jit/Doc/library/functools.rst
   python/branches/py3k-jit/Doc/library/itertools.rst
   python/branches/py3k-jit/Doc/library/logging.rst
   python/branches/py3k-jit/Doc/library/math.rst
   python/branches/py3k-jit/Doc/library/multiprocessing.rst
   python/branches/py3k-jit/Doc/library/os.rst
   python/branches/py3k-jit/Doc/library/re.rst
   python/branches/py3k-jit/Doc/library/signal.rst
   python/branches/py3k-jit/Doc/library/socket.rst
   python/branches/py3k-jit/Doc/library/stdtypes.rst
   python/branches/py3k-jit/Doc/library/struct.rst
   python/branches/py3k-jit/Doc/library/subprocess.rst
   python/branches/py3k-jit/Doc/library/tarfile.rst
   python/branches/py3k-jit/Doc/library/test.rst
   python/branches/py3k-jit/Doc/library/threading.rst
   python/branches/py3k-jit/Doc/library/unittest.rst
   python/branches/py3k-jit/Doc/library/urllib.request.rst
   python/branches/py3k-jit/Doc/library/warnings.rst
   python/branches/py3k-jit/Doc/reference/expressions.rst
   python/branches/py3k-jit/Doc/using/cmdline.rst
   python/branches/py3k-jit/Doc/whatsnew/2.6.rst
   python/branches/py3k-jit/Doc/whatsnew/2.7.rst
   python/branches/py3k-jit/Include/Python.h
   python/branches/py3k-jit/Include/pythread.h
   python/branches/py3k-jit/LICENSE
   python/branches/py3k-jit/Lib/_dummy_thread.py
   python/branches/py3k-jit/Lib/collections.py
   python/branches/py3k-jit/Lib/difflib.py
   python/branches/py3k-jit/Lib/distutils/tests/support.py
   python/branches/py3k-jit/Lib/email/encoders.py
   python/branches/py3k-jit/Lib/email/message.py
   python/branches/py3k-jit/Lib/email/test/test_email.py
   python/branches/py3k-jit/Lib/functools.py
   python/branches/py3k-jit/Lib/locale.py
   python/branches/py3k-jit/Lib/logging/__init__.py
   python/branches/py3k-jit/Lib/logging/config.py
   python/branches/py3k-jit/Lib/logging/handlers.py
   python/branches/py3k-jit/Lib/multiprocessing/pool.py
   python/branches/py3k-jit/Lib/pickle.py
   python/branches/py3k-jit/Lib/pickletools.py
   python/branches/py3k-jit/Lib/site.py
   python/branches/py3k-jit/Lib/subprocess.py
   python/branches/py3k-jit/Lib/test/lock_tests.py
   python/branches/py3k-jit/Lib/test/pickletester.py
   python/branches/py3k-jit/Lib/test/regrtest.py
   python/branches/py3k-jit/Lib/test/support.py
   python/branches/py3k-jit/Lib/test/test_argparse.py
   python/branches/py3k-jit/Lib/test/test_difflib.py
   python/branches/py3k-jit/Lib/test/test_functools.py
   python/branches/py3k-jit/Lib/test/test_logging.py
   python/branches/py3k-jit/Lib/test/test_os.py
   python/branches/py3k-jit/Lib/test/test_select.py
   python/branches/py3k-jit/Lib/test/test_urllib2net.py
   python/branches/py3k-jit/Lib/test/test_urlparse.py
   python/branches/py3k-jit/Lib/test/test_uuid.py
   python/branches/py3k-jit/Lib/test/test_warnings.py
   python/branches/py3k-jit/Lib/test/test_winsound.py
   python/branches/py3k-jit/Lib/threading.py
   python/branches/py3k-jit/Lib/tkinter/test/test_ttk/test_widgets.py
   python/branches/py3k-jit/Lib/unittest/case.py
   python/branches/py3k-jit/Lib/unittest/loader.py
   python/branches/py3k-jit/Lib/unittest/main.py
   python/branches/py3k-jit/Lib/unittest/result.py
   python/branches/py3k-jit/Lib/unittest/runner.py
   python/branches/py3k-jit/Lib/unittest/test/test_assertions.py
   python/branches/py3k-jit/Lib/unittest/test/test_break.py
   python/branches/py3k-jit/Lib/unittest/test/test_discovery.py
   python/branches/py3k-jit/Lib/unittest/test/test_loader.py
   python/branches/py3k-jit/Lib/unittest/test/test_result.py
   python/branches/py3k-jit/Mac/Tools/pythonw.c
   python/branches/py3k-jit/Makefile.pre.in
   python/branches/py3k-jit/Misc/ACKS
   python/branches/py3k-jit/Misc/NEWS
   python/branches/py3k-jit/Misc/developers.txt
   python/branches/py3k-jit/Misc/maintainers.rst
   python/branches/py3k-jit/Misc/python.man
   python/branches/py3k-jit/Modules/_pickle.c
   python/branches/py3k-jit/Modules/_sre.c
   python/branches/py3k-jit/Modules/_ssl.c
   python/branches/py3k-jit/Modules/_threadmodule.c
   python/branches/py3k-jit/Modules/datetimemodule.c
   python/branches/py3k-jit/Modules/main.c
   python/branches/py3k-jit/Modules/posixmodule.c
   python/branches/py3k-jit/Modules/python.c
   python/branches/py3k-jit/Modules/selectmodule.c
   python/branches/py3k-jit/Modules/signalmodule.c
   python/branches/py3k-jit/Objects/longobject.c
   python/branches/py3k-jit/PC/_subprocess.c
   python/branches/py3k-jit/Python/thread_nt.h
   python/branches/py3k-jit/Python/thread_pthread.h
   python/branches/py3k-jit/Tools/README
   python/branches/py3k-jit/Tools/i18n/makelocalealias.py
   python/branches/py3k-jit/configure
   python/branches/py3k-jit/configure.in

Modified: python/branches/py3k-jit/.bzrignore
==============================================================================
--- python/branches/py3k-jit/.bzrignore	(original)
+++ python/branches/py3k-jit/.bzrignore	Fri Apr 16 02:53:03 2010
@@ -14,6 +14,7 @@
 pyconfig.h
 libpython*.a
 python.exe
+python-gdb.py
 reflog.txt
 tags
 TAGS

Modified: python/branches/py3k-jit/.hgignore
==============================================================================
--- python/branches/py3k-jit/.hgignore	(original)
+++ python/branches/py3k-jit/.hgignore	Fri Apr 16 02:53:03 2010
@@ -1,23 +1,23 @@
 .gdb_history
 .purify
-.svn
+.svn/
 Makefile$
 Makefile.pre$
-TAGS
-autom4te.cache
-build
-buildno
+TAGS$
+autom4te.cache$
+build/
+buildno$
 config.cache
 config.log
 config.status
 config.status.lineno
 db_home
-platform
-pyconfig.h
-python
-python.exe
-reflog.txt
-tags
+platform$
+pyconfig.h$
+python$
+python.exe$
+reflog.txt$
+tags$
 Lib/plat-mac/errors.rsrc.df.rsrc
 Doc/tools/sphinx/
 Doc/tools/docutils/
@@ -25,12 +25,13 @@
 Doc/tools/jinja2/
 Doc/tools/pygments/
 Misc/python.pc
-Modules/Setup
+Modules/Setup$
 Modules/Setup.config
 Modules/Setup.local
 Modules/config.c
-Parser/pgen
-core
+Parser/pgen$
+^core
+^python-gdb.py
 
 syntax: glob
 libpython*.a

Modified: python/branches/py3k-jit/Doc/c-api/import.rst
==============================================================================
--- python/branches/py3k-jit/Doc/c-api/import.rst	(original)
+++ python/branches/py3k-jit/Doc/c-api/import.rst	Fri Apr 16 02:53:03 2010
@@ -115,6 +115,9 @@
    such modules have no way to know that the module object is an unknown (and
    probably damaged with respect to the module author's intents) state.
 
+   The module's :attr:`__file__` attribute will be set to the code object's
+   :cmember:`co_filename`.
+
    This function will reload the module if it was already imported.  See
    :cfunc:`PyImport_ReloadModule` for the intended way to reload a module.
 
@@ -122,6 +125,12 @@
    structures not already created will still not be created.
 
 
+.. cfunction:: PyObject* PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname)
+
+   Like :cfunc:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute of
+   the module object is set to *pathname* if it is non-``NULL``.
+
+
 .. cfunction:: long PyImport_GetMagicNumber()
 
    Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` and

Modified: python/branches/py3k-jit/Doc/data/refcounts.dat
==============================================================================
--- python/branches/py3k-jit/Doc/data/refcounts.dat	(original)
+++ python/branches/py3k-jit/Doc/data/refcounts.dat	Fri Apr 16 02:53:03 2010
@@ -499,6 +499,11 @@
 PyImport_ExecCodeModule:char*:name::
 PyImport_ExecCodeModule:PyObject*:co:0:
 
+PyImport_ExecCodeModuleEx:PyObject*::+1:
+PyImport_ExecCodeModuleEx:char*:name::
+PyImport_ExecCodeModuleEx:PyObject*:co:0:
+PyImport_ExecCodeModuleEx:char*:pathname::
+
 PyImport_GetMagicNumber:long:::
 
 PyImport_GetModuleDict:PyObject*::0:
@@ -518,6 +523,13 @@
 PyImport_ImportModuleEx:PyObject*:locals:0:???
 PyImport_ImportModuleEx:PyObject*:fromlist:0:???
 
+PyImport_ImportModuleLevel:PyObject*::+1:
+PyImport_ImportModuleLevel:char*:name::
+PyImport_ImportModuleLevel:PyObject*:globals:0:???
+PyImport_ImportModuleLevel:PyObject*:locals:0:???
+PyImport_ImportModuleLevel:PyObject*:fromlist:0:???
+PyImport_ImportModuleLevel:int:level::
+
 PyImport_ReloadModule:PyObject*::+1:
 PyImport_ReloadModule:PyObject*:m:0:
 

Modified: python/branches/py3k-jit/Doc/distutils/apiref.rst
==============================================================================
--- python/branches/py3k-jit/Doc/distutils/apiref.rst	(original)
+++ python/branches/py3k-jit/Doc/distutils/apiref.rst	Fri Apr 16 02:53:03 2010
@@ -1944,19 +1944,6 @@
 
 .. % todo
 
-:mod:`distutils.command.check` --- Check the meta-data of a package
-===================================================================
-
-.. module:: distutils.command.check
-   :synopsis: Check the metadata of a package
-
-
-The ``check`` command performs some tests on the meta-data of a package.
-For example, it verifies that all required meta-data are provided as
-the arguments passed to the :func:`setup` function.
-
-.. % todo
-
 
 Creating a new Distutils command
 ================================

Modified: python/branches/py3k-jit/Doc/distutils/examples.rst
==============================================================================
--- python/branches/py3k-jit/Doc/distutils/examples.rst	(original)
+++ python/branches/py3k-jit/Doc/distutils/examples.rst	Fri Apr 16 02:53:03 2010
@@ -233,103 +233,6 @@
          ext_modules=[Extension('foopkg.foo', ['foo.c'])],
          )
 
-Checking a package
-==================
-
-The ``check`` command allows you to verify if your package meta-data
-meet the minimum requirements to build a distribution.
-
-To run it, just call it using your :file:`setup.py` script. If something is
-missing, ``check`` will display a warning.
-
-Let's take an example with a simple script::
-
-    from distutils.core import setup
-
-    setup(name='foobar')
-
-Running the ``check`` command will display some warnings::
-
-    $ python setup.py check
-    running check
-    warning: check: missing required meta-data: version, url
-    warning: check: missing meta-data: either (author and author_email) or
-             (maintainer and maintainer_email) must be supplied
-
-
-If you use the reStructuredText syntax in the ``long_description`` field and
-`docutils <http://docutils.sourceforge.net/>`_ is installed you can check if
-the syntax is fine with the ``check`` command, using the ``restructuredtext``
-option.
-
-For example, if the :file:`setup.py` script is changed like this::
-
-    from distutils.core import setup
-
-    desc = """\
-    My description
-    =============
-
-    This is the description of the ``foobar`` package.
-    """
-
-    setup(name='foobar', version='1', author='tarek',
-        author_email='tarek at ziade.org',
-        url='http://example.com', long_description=desc)
-
-Where the long description is broken, ``check`` will be able to detect it
-by using the :mod:`docutils` parser::
-
-    $ pythontrunk setup.py check --restructuredtext
-    running check
-    warning: check: Title underline too short. (line 2)
-    warning: check: Could not finish the parsing.
-
-
-.. _reading-metadata:
-
-Reading the metadata
-====================
-
-The :func:`distutils.core.setup` function provides a command-line interface
-that allows you to query the metadata fields of a project through the
-:file:`setup.py` script of a given project::
-
-    $ python setup.py --name
-    distribute
-
-This call reads the ``name`` metadata by running the
-:func:`distutils.core.setup`  function. Although, when a source or binary
-distribution is created with Distutils, the metadata fields are written
-in a static file called :file:`PKG-INFO`. When a Distutils-based project is
-installed in Python, the :file:`PKG-INFO` file is copied alongside the modules
-and packages of the distribution under :file:`NAME-VERSION-pyX.X.egg-info`,
-where ``NAME`` is the name of the project, ``VERSION`` its version as defined
-in the Metadata, and ``pyX.X`` the major and minor version of Python like
-``2.7`` or ``3.2``.
-
-You can read back this static file, by using the
-:class:`distutils.dist.DistributionMetadata` class and its
-:func:`read_pkg_file` method::
-
-    >>> from distutils.dist import DistributionMetadata
-    >>> metadata = DistributionMetadata()
-    >>> metadata.read_pkg_file(open('distribute-0.6.8-py2.7.egg-info'))
-    >>> metadata.name
-    'distribute'
-    >>> metadata.version
-    '0.6.8'
-    >>> metadata.description
-    'Easily download, build, install, upgrade, and uninstall Python packages'
-
-Notice that the class can also be instanciated with a metadata file path to
-loads its values::
-
-    >>> pkg_info_path = 'distribute-0.6.8-py2.7.egg-info'
-    >>> DistributionMetadata(pkg_info_path).name
-    'distribute'
-
-
 .. % \section{Multiple extension modules}
 .. % \label{multiple-ext}
 

Modified: python/branches/py3k-jit/Doc/faq/windows.rst
==============================================================================
--- python/branches/py3k-jit/Doc/faq/windows.rst	(original)
+++ python/branches/py3k-jit/Doc/faq/windows.rst	Fri Apr 16 02:53:03 2010
@@ -445,7 +445,7 @@
 How do I emulate os.kill() in Windows?
 --------------------------------------
 
-To terminate a process, you can use ctypes::
+Prior to Python 2.7 and 3.2, to terminate a process, you can use :mod:`ctypes`::
 
    import ctypes
 
@@ -455,6 +455,11 @@
        handle = kernel32.OpenProcess(1, 0, pid)
        return (0 != kernel32.TerminateProcess(handle, 0))
 
+In 2.7 and 3.2, :func:`os.kill` is implemented similar to the above function,
+with the additional feature of being able to send CTRL+C and CTRL+BREAK
+to console subprocesses which are designed to handle those signals. See
+:func:`os.kill` for further details.
+
 
 Why does os.path.isdir() fail on NT shared directories?
 -------------------------------------------------------

Modified: python/branches/py3k-jit/Doc/glossary.rst
==============================================================================
--- python/branches/py3k-jit/Doc/glossary.rst	(original)
+++ python/branches/py3k-jit/Doc/glossary.rst	Fri Apr 16 02:53:03 2010
@@ -212,6 +212,8 @@
       performs garbage collection via reference counting and a cyclic garbage
       collector that is able to detect and break reference cycles.
 
+      .. index:: single: generator
+
    generator
       A function which returns an iterator.  It looks like a normal function
       except that values are returned to the caller using a :keyword:`yield`
@@ -225,7 +227,7 @@
       .. index:: single: generator expression
 
    generator expression
-      An expression that returns a generator.  It looks like a normal expression
+      An expression that returns an iterator.  It looks like a normal expression
       followed by a :keyword:`for` expression defining a loop variable, range,
       and an optional :keyword:`if` expression.  The combined expression
       generates values for an enclosing function::

Modified: python/branches/py3k-jit/Doc/library/_thread.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/_thread.rst	(original)
+++ python/branches/py3k-jit/Doc/library/_thread.rst	Fri Apr 16 02:53:03 2010
@@ -28,7 +28,7 @@
 :mod:`_dummy_thread` module is available. It duplicates this module's interface
 and can be used as a drop-in replacement.
 
-It defines the following constant and functions:
+It defines the following constants and functions:
 
 
 .. exception:: error
@@ -103,19 +103,34 @@
    Availability: Windows, systems with POSIX threads.
 
 
+.. data:: TIMEOUT_MAX
+
+   The maximum value allowed for the *timeout* parameter of
+   :meth:`Lock.acquire`. Specifiying a timeout greater than this value will
+   raise an :exc:`OverflowError`.
+
+
 Lock objects have the following methods:
 
 
-.. method:: lock.acquire([waitflag])
+.. method:: lock.acquire(waitflag=1, timeout=-1)
 
-   Without the optional argument, this method acquires the lock unconditionally, if
+   Without any optional argument, this method acquires the lock unconditionally, if
    necessary waiting until it is released by another thread (only one thread at a
-   time can acquire a lock --- that's their reason for existence).  If the integer
-   *waitflag* argument is present, the action depends on its value: if it is zero,
-   the lock is only acquired if it can be acquired immediately without waiting,
-   while if it is nonzero, the lock is acquired unconditionally as before.  The
-   return value is ``True`` if the lock is acquired successfully, ``False`` if not.
+   time can acquire a lock --- that's their reason for existence).
 
+   If the integer *waitflag* argument is present, the action depends on its
+   value: if it is zero, the lock is only acquired if it can be acquired
+   immediately without waiting, while if it is nonzero, the lock is acquired
+   unconditionally as above.
+
+   If the floating-point *timeout* argument is present and positive, it
+   specifies the maximum wait time in seconds before returning.  A negative
+   *timeout* argument specifies an unbounded wait.  You cannot specify
+   a *timeout* if *waitflag* is zero.
+
+   The return value is ``True`` if the lock is acquired successfully,
+   ``False`` if not.
 
 .. method:: lock.release()
 

Modified: python/branches/py3k-jit/Doc/library/collections.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/collections.rst	(original)
+++ python/branches/py3k-jit/Doc/library/collections.rst	Fri Apr 16 02:53:03 2010
@@ -271,6 +271,33 @@
     >>> c | d                       # union:  max(c[x], d[x])
     Counter({'a': 3, 'b': 2})
 
+.. note::
+
+   Counters were primarily designed to work with positive integers to represent
+   running counts; however, care was taken to not unnecessarily preclude use
+   cases needing other types or negative values.  To help with those use cases,
+   this section documents the minimum range and type restrictions.
+
+   * The :class:`Counter` class itself is a dictionary subclass with no
+     restrictions on its keys and values.  The values are intended to be numbers
+     representing counts, but you *could* store anything in the value field.
+
+   * The :meth:`most_common` method requires only that the values be orderable.
+
+   * For in-place operations such as ``c[key] += 1``, the value type need only
+     support addition and subtraction.  So fractions, floats, and decimals would
+     work and negative values are supported.  The same is also true for
+     :meth:`update` and :meth:`subtract` which allow negative and zero values
+     for both inputs and outputs.
+
+   * The multiset methods are designed only for use cases with positive values.
+     The inputs may be negative or zero, but only outputs with positive values
+     are created.  There are no type restrictions, but the value type needs to
+     support support addition, subtraction, and comparison.
+
+   * The :meth:`elements` method requires integer counts.  It ignores zero and
+     negative counts.
+
 .. seealso::
 
     * `Counter class <http://code.activestate.com/recipes/576611/>`_

Modified: python/branches/py3k-jit/Doc/library/difflib.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/difflib.rst	(original)
+++ python/branches/py3k-jit/Doc/library/difflib.rst	Fri Apr 16 02:53:03 2010
@@ -140,8 +140,8 @@
 
    The context diff format normally has a header for filenames and modification
    times.  Any or all of these may be specified using strings for *fromfile*,
-   *tofile*, *fromfiledate*, and *tofiledate*. The modification times are normally
-   expressed in the format returned by :func:`time.ctime`.  If not specified, the
+   *tofile*, *fromfiledate*, and *tofiledate*.  The modification times are normally
+   expressed in the ISO 8601 format. If not specified, the
    strings default to blanks.
 
       >>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
@@ -272,8 +272,8 @@
 
    The context diff format normally has a header for filenames and modification
    times.  Any or all of these may be specified using strings for *fromfile*,
-   *tofile*, *fromfiledate*, and *tofiledate*. The modification times are normally
-   expressed in the format returned by :func:`time.ctime`.  If not specified, the
+   *tofile*, *fromfiledate*, and *tofiledate*.  The modification times are normally
+   expressed in the ISO 8601 format. If not specified, the
    strings default to blanks.
 
 

Modified: python/branches/py3k-jit/Doc/library/functools.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/functools.rst	(original)
+++ python/branches/py3k-jit/Doc/library/functools.rst	Fri Apr 16 02:53:03 2010
@@ -40,7 +40,7 @@
 .. function:: total_ordering(cls)
 
    Given a class defining one or more rich comparison ordering methods, this
-   class decorator supplies the rest.  This simplies the effort involved
+   class decorator supplies the rest.  This simplifies the effort involved
    in specifying all of the possible rich comparison operations:
 
    The class must define one of :meth:`__lt__`, :meth:`__le__`,

Modified: python/branches/py3k-jit/Doc/library/itertools.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/itertools.rst	(original)
+++ python/branches/py3k-jit/Doc/library/itertools.rst	Fri Apr 16 02:53:03 2010
@@ -709,7 +709,7 @@
        pools = [tuple(pool) for pool in args] * repeat
        return tuple(random.choice(pool) for pool in pools)
 
-   def random_permuation(iterable, r=None):
+   def random_permutation(iterable, r=None):
        "Random selection from itertools.permutations(iterable, r)"
        pool = tuple(iterable)
        r = len(pool) if r is None else r
@@ -718,12 +718,16 @@
    def random_combination(iterable, r):
        "Random selection from itertools.combinations(iterable, r)"
        pool = tuple(iterable)
-       return tuple(sorted(random.sample(pool, r), key=pool.index))
+       n = len(pool)
+       indices = sorted(random.sample(range(n), r))
+       return tuple(pool[i] for i in indices)
 
    def random_combination_with_replacement(iterable, r):
        "Random selection from itertools.combinations_with_replacement(iterable, r)"
        pool = tuple(iterable)
-       return tuple(sorted(map(random.choice, repeat(pool, r)), key=pool.index))
+       n = len(pool)
+       indices = sorted(random.randrange(n) for i in range(r))
+       return tuple(pool[i] for i in indices)
 
 Note, many of the above recipes can be optimized by replacing global lookups
 with local variables defined as default values.  For example, the

Modified: python/branches/py3k-jit/Doc/library/logging.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/logging.rst	(original)
+++ python/branches/py3k-jit/Doc/library/logging.rst	Fri Apr 16 02:53:03 2010
@@ -244,16 +244,16 @@
   methods listed above, but this is how to log at custom log levels.
 
 :func:`getLogger` returns a reference to a logger instance with the specified
-if it it is provided, or ``root`` if not.  The names are period-separated
+if it is provided, or ``root`` if not.  The names are period-separated
 hierarchical structures.  Multiple calls to :func:`getLogger` with the same name
 will return a reference to the same logger object.  Loggers that are further
 down in the hierarchical list are children of loggers higher up in the list.
 For example, given a logger with a name of ``foo``, loggers with names of
-``foo.bar``, ``foo.bar.baz``, and ``foo.bam`` are all children of ``foo``.
-Child loggers propagate messages up to their parent loggers.  Because of this,
-it is unnecessary to define and configure all the loggers an application uses.
-It is sufficient to configure a top-level logger and create child loggers as
-needed.
+``foo.bar``, ``foo.bar.baz``, and ``foo.bam`` are all descendants of ``foo``.
+Child loggers propagate messages up to the handlers associated with their
+ancestor loggers.  Because of this, it is unnecessary to define and configure
+handlers for all the loggers an application uses. It is sufficient to
+configure handlers for a top-level logger and create child loggers as needed.
 
 
 Handlers
@@ -281,15 +281,16 @@
   are there two :func:`setLevel` methods?  The level set in the logger
   determines which severity of messages it will pass to its handlers.  The level
   set in each handler determines which messages that handler will send on.
-  :func:`setFormatter` selects a Formatter object for this handler to use.
+
+* :func:`setFormatter` selects a Formatter object for this handler to use.
 
 * :func:`addFilter` and :func:`removeFilter` respectively configure and
   deconfigure filter objects on handlers.
 
-Application code should not directly instantiate and use handlers.  Instead, the
-:class:`Handler` class is a base class that defines the interface that all
-Handlers should have and establishes some default behavior that child classes
-can use (or override).
+Application code should not directly instantiate and use instances of
+:class:`Handler`.  Instead, the :class:`Handler` class is a base class that
+defines the interface that all handlers should have and establishes some
+default behavior that child classes can use (or override).
 
 
 Formatters
@@ -521,7 +522,9 @@
 can have zero, one or more handlers associated with it (via the
 :meth:`addHandler` method of :class:`Logger`). In addition to any handlers
 directly associated with a logger, *all handlers associated with all ancestors
-of the logger* are called to dispatch the message.
+of the logger* are called to dispatch the message (unless the *propagate* flag
+for a logger is set to a false value, at which point the passing to ancestor
+handlers stops).
 
 Just as for loggers, handlers can have levels associated with them. A handler's
 level acts as a filter in the same way as a logger's level does. If a handler
@@ -849,8 +852,8 @@
 .. attribute:: Logger.propagate
 
    If this evaluates to false, logging messages are not passed by this logger or by
-   child loggers to higher level (ancestor) loggers. The constructor sets this
-   attribute to 1.
+   its child loggers to the handlers of higher level (ancestor) loggers. The
+   constructor sets this attribute to 1.
 
 
 .. method:: Logger.setLevel(lvl)
@@ -889,6 +892,16 @@
    :const:`NOTSET` is found, and that value is returned.
 
 
+.. method:: Logger.getChild(suffix)
+
+   Returns a logger which is a descendant to this logger, as determined by the suffix.
+   Thus, ``logging.getLogger('abc').getChild('def.ghi')`` would return the same
+   logger as would be returned by ``logging.getLogger('abc.def.ghi')``. This is a
+   convenience method, useful when the parent logger is named using e.g. ``__name__``
+   rather than a literal string.
+
+   .. versionadded:: 3.2
+
 .. method:: Logger.debug(msg, *args, **kwargs)
 
    Logs a message with level :const:`DEBUG` on this logger. The *msg* is the
@@ -2012,6 +2025,87 @@
       or integers - if strings are passed, internal mapping dictionaries are
       used to convert them to integers.
 
+      The symbolic ``LOG_`` values are defined in :class:`SysLogHandler` and
+      mirror the values defined in the ``sys/syslog.h`` header file.
+
+      +------------------------------------------+
+      | Priorities                               |
+      +--------------------------+---------------+
+      | Name (string)            | Symbolic value|
+      +==========================+===============+
+      | ``alert``                | LOG_ALERT     |
+      +--------------------------+---------------+
+      | ``crit`` or ``critical`` | LOG_CRIT      |
+      +--------------------------+---------------+
+      | ``debug``                | LOG_DEBUG     |
+      +--------------------------+---------------+
+      | ``emerg`` or ``panic``   | LOG_EMERG     |
+      +--------------------------+---------------+
+      | ``err`` or ``error``     | LOG_ERR       |
+      +--------------------------+---------------+
+      | ``info``                 | LOG_INFO      |
+      +--------------------------+---------------+
+      | ``notice``               | LOG_NOTICE    |
+      +--------------------------+---------------+
+      | ``warn`` or ``warning``  | LOG_WARNING   |
+      +--------------------------+---------------+
+
+      +-------------------------------+
+      | Facilities                    |
+      +---------------+---------------+
+      | Name (string) | Symbolic value|
+      +===============+===============+
+      | ``auth``      | LOG_AUTH      |
+      +---------------+---------------+
+      | ``authpriv``  | LOG_AUTHPRIV  |
+      +---------------+---------------+
+      | ``cron``      | LOG_CRON      |
+      +---------------+---------------+
+      | ``daemon``    | LOG_DAEMON    |
+      +---------------+---------------+
+      | ``ftp``       | LOG_FTP       |
+      +---------------+---------------+
+      | ``kern``      | LOG_KERN      |
+      +---------------+---------------+
+      | ``lpr``       | LOG_LPR       |
+      +---------------+---------------+
+      | ``mail``      | LOG_MAIL      |
+      +---------------+---------------+
+      | ``news``      | LOG_NEWS      |
+      +---------------+---------------+
+      | ``syslog``    | LOG_SYSLOG    |
+      +---------------+---------------+
+      | ``user``      | LOG_USER      |
+      +---------------+---------------+
+      | ``uucp``      | LOG_UUCP      |
+      +---------------+---------------+
+      | ``local0``    | LOG_LOCAL0    |
+      +---------------+---------------+
+      | ``local1``    | LOG_LOCAL1    |
+      +---------------+---------------+
+      | ``local2``    | LOG_LOCAL2    |
+      +---------------+---------------+
+      | ``local3``    | LOG_LOCAL3    |
+      +---------------+---------------+
+      | ``local4``    | LOG_LOCAL4    |
+      +---------------+---------------+
+      | ``local5``    | LOG_LOCAL5    |
+      +---------------+---------------+
+      | ``local6``    | LOG_LOCAL6    |
+      +---------------+---------------+
+      | ``local7``    | LOG_LOCAL7    |
+      +---------------+---------------+
+
+   .. method:: mapPriority(levelname)
+
+      Maps a logging level name to a syslog priority name.
+      You may need to override this if you are using custom levels, or
+      if the default algorithm is not suitable for your needs. The
+      default algorithm maps ``DEBUG``, ``INFO``, ``WARNING``, ``ERROR`` and
+      ``CRITICAL`` to the equivalent syslog names, and all other level
+      names to "warning".
+
+.. _nt-eventlog-handler:
 
 NTEventLogHandler
 ^^^^^^^^^^^^^^^^^
@@ -2403,6 +2497,11 @@
 methods have the same signatures as their counterparts in :class:`Logger`, so
 you can use the two types of instances interchangeably.
 
+.. versionchanged:: 2.7
+
+The :meth:`isEnabledFor` method was added to :class:`LoggerAdapter`. This method
+delegates to the underlying logger.
+
 
 Thread Safety
 -------------

Modified: python/branches/py3k-jit/Doc/library/math.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/math.rst	(original)
+++ python/branches/py3k-jit/Doc/library/math.rst	Fri Apr 16 02:53:03 2010
@@ -345,15 +345,15 @@
    :exc:`ValueError` for invalid operations like ``sqrt(-1.0)`` or ``log(0.0)``
    (where C99 Annex F recommends signaling invalid operation or divide-by-zero),
    and :exc:`OverflowError` for results that overflow (for example,
-   ``exp(1000.0)``).  A *NaN* will not be returned from any of the functions
-   above unless one or more of the input arguments was a *NaN*; in that case,
-   most functions will return a *NaN*, but (again following C99 Annex F) there
+   ``exp(1000.0)``).  A NaN will not be returned from any of the functions
+   above unless one or more of the input arguments was a NaN; in that case,
+   most functions will return a NaN, but (again following C99 Annex F) there
    are some exceptions to this rule, for example ``pow(float('nan'), 0.0)`` or
    ``hypot(float('nan'), float('inf'))``.
 
-   Note that Python makes no effort to distinguish signaling nans from
-   quiet nans, and behavior for signaling nans remains unspecified.
-   Typical behavior is to treat all nans as though they were quiet.
+   Note that Python makes no effort to distinguish signaling NaNs from
+   quiet NaNs, and behavior for signaling NaNs remains unspecified.
+   Typical behavior is to treat all NaNs as though they were quiet.
 
 
 .. seealso::

Modified: python/branches/py3k-jit/Doc/library/multiprocessing.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/multiprocessing.rst	(original)
+++ python/branches/py3k-jit/Doc/library/multiprocessing.rst	Fri Apr 16 02:53:03 2010
@@ -61,15 +61,15 @@
 follows the API of :class:`threading.Thread`.  A trivial example of a
 multiprocess program is ::
 
-    from multiprocessing import Process
+   from multiprocessing import Process
 
    def f(name):
        print('hello', name)
 
-    if __name__ == '__main__':
-        p = Process(target=f, args=('bob',))
-        p.start()
-        p.join()
+   if __name__ == '__main__':
+       p = Process(target=f, args=('bob',))
+       p.start()
+       p.join()
 
 To show the individual process IDs involved, here is an expanded example::
 

Modified: python/branches/py3k-jit/Doc/library/os.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/os.rst	(original)
+++ python/branches/py3k-jit/Doc/library/os.rst	Fri Apr 16 02:53:03 2010
@@ -437,6 +437,10 @@
 is slightly deceptive; on Unix platforms, sockets and pipes are also referenced
 by file descriptors.
 
+The :meth:`~file.fileno` method can be used to obtain the file descriptor
+associated with a file object when required.  Note that using the file
+descriptor directly will bypass the file object methods, ignoring aspects such
+as internal buffering of data.
 
 .. function:: close(fd)
 
@@ -1487,7 +1491,14 @@
 
    Send signal *sig* to the process *pid*.  Constants for the specific signals
    available on the host platform are defined in the :mod:`signal` module.
-   Availability: Unix.
+
+   Windows: The :data:`signal.CTRL_C_EVENT` and
+   :data:`signal.CTRL_BREAK_EVENT` signals are special signals which can
+   only be sent to console processes which share a common console window,
+   e.g., some subprocesses. Any other value for *sig* will cause the process
+   to be unconditionally killed by the TerminateProcess API, and the exit code
+   will be set to *sig*. The Windows version of :func:`kill` additionally takes
+   process handles to be killed.
 
 
 .. function:: killpg(pgid, sig)

Modified: python/branches/py3k-jit/Doc/library/re.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/re.rst	(original)
+++ python/branches/py3k-jit/Doc/library/re.rst	Fri Apr 16 02:53:03 2010
@@ -871,6 +871,9 @@
          >>> m.group(1)                        # Returns only the last match.
          'c3'
 
+
+   .. method:: MatchObject.groups(default=None)
+
       Return a tuple containing all the subgroups of the match, from 1 up to however
       many groups are in the pattern.  The *default* argument is used for groups that
       did not participate in the match; it defaults to ``None``.  (Incompatibility

Modified: python/branches/py3k-jit/Doc/library/signal.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/signal.rst	(original)
+++ python/branches/py3k-jit/Doc/library/signal.rst	Fri Apr 16 02:53:03 2010
@@ -74,6 +74,20 @@
    the system are defined by this module.
 
 
+.. data:: CTRL_C_EVENT
+
+   The signal corresponding to the CTRL+C keystroke event.
+
+   Availability: Windows.
+
+
+.. data:: CTRL_BREAK_EVENT
+
+   The signal corresponding to the CTRL+BREAK keystroke event.
+
+   Availability: Windows.
+
+
 .. data:: NSIG
 
    One more than the number of the highest signal number.

Modified: python/branches/py3k-jit/Doc/library/socket.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/socket.rst	(original)
+++ python/branches/py3k-jit/Doc/library/socket.rst	Fri Apr 16 02:53:03 2010
@@ -622,9 +622,9 @@
 
    Receive up to *nbytes* bytes from the socket, storing the data into a buffer
    rather than creating a new bytestring.  If *nbytes* is not specified (or 0),
-   receive up to the size available in the given buffer. See the Unix manual page
-   :manpage:`recv(2)` for the meaning of the optional argument *flags*; it defaults
-   to zero.
+   receive up to the size available in the given buffer.  Returns the number of
+   bytes received.  See the Unix manual page :manpage:`recv(2)` for the meaning
+   of the optional argument *flags*; it defaults to zero.
 
 
 .. method:: socket.send(bytes[, flags])

Modified: python/branches/py3k-jit/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/stdtypes.rst	(original)
+++ python/branches/py3k-jit/Doc/library/stdtypes.rst	Fri Apr 16 02:53:03 2010
@@ -2143,12 +2143,12 @@
 
 .. _typememoryview:
 
-memoryview Types
-================
+memoryview type
+===============
 
-:class:`memoryview`\s allow Python code to access the internal data of an object
-that supports the buffer protocol without copying.  Memory can be interpreted as
-simple bytes or complex data structures.
+:class:`memoryview` objects allow Python code to access the internal data
+of an object that supports the buffer protocol without copying.  Memory
+is generally interpreted as simple bytes.
 
 .. class:: memoryview(obj)
 

Modified: python/branches/py3k-jit/Doc/library/struct.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/struct.rst	(original)
+++ python/branches/py3k-jit/Doc/library/struct.rst	Fri Apr 16 02:53:03 2010
@@ -9,18 +9,31 @@
    triple: packing; binary; data
 
 This module performs conversions between Python values and C structs represented
-as Python :class:`bytes` objects.  It uses :dfn:`format strings` (explained
-below) as compact descriptions of the lay-out of the C structs and the
-intended conversion to/from Python values.  This can be used in handling
-binary data stored in files or from network connections, among other sources.
+as Python :class:`bytes` objects.  This can be used in handling binary data
+stored in files or from network connections, among other sources.  It uses
+:ref:`struct-format-strings` as compact descriptions of the layout of the C
+structs and the intended conversion to/from Python values.
+
+.. note::
+
+   By default, the result of packing a given C struct includes pad bytes in
+   order to maintain proper alignment for the C types involved; similarly,
+   alignment is taken into account when unpacking.  This behavior is chosen so
+   that the bytes of a packed struct correspond exactly to the layout in memory
+   of the corresponding C struct.  To omit pad bytes, use `standard` size and
+   alignment instead of `native` size and alignment: see :ref:`struct-alignment`
+   for details.
+
+Functions and Exceptions
+------------------------
 
 The module defines the following exception and functions:
 
 
 .. exception:: error
 
-   Exception raised on various occasions; argument is a string describing what is
-   wrong.
+   Exception raised on various occasions; argument is a string describing what
+   is wrong.
 
 
 .. function:: pack(fmt, v1, v2, ...)
@@ -32,25 +45,25 @@
 
 .. function:: pack_into(fmt, buffer, offset, v1, v2, ...)
 
-   Pack the values ``v1, v2, ...`` according to the given format, write the packed
-   bytes into the writable *buffer* starting at *offset*. Note that the offset is
-   a required argument.
+   Pack the values ``v1, v2, ...`` according to the given format, write the
+   packed bytes into the writable *buffer* starting at *offset*. Note that the
+   offset is a required argument.
 
 
 .. function:: unpack(fmt, bytes)
 
    Unpack the bytes (presumably packed by ``pack(fmt, ...)``) according to the
-   given format.  The result is a tuple even if it contains exactly one item.  The
-   bytes must contain exactly the amount of data required by the format
+   given format.  The result is a tuple even if it contains exactly one item.
+   The bytes must contain exactly the amount of data required by the format
    (``len(bytes)`` must equal ``calcsize(fmt)``).
 
 
 .. function:: unpack_from(fmt, buffer, offset=0)
 
    Unpack the *buffer* according to the given format. The result is a tuple even
-   if it contains exactly one item. The *buffer* must contain at least the amount
-   of data required by the format (``len(buffer[offset:])`` must be at least
-   ``calcsize(fmt)``).
+   if it contains exactly one item. The *buffer* must contain at least the
+   amount of data required by the format (``len(buffer[offset:])`` must be at
+   least ``calcsize(fmt)``).
 
 
 .. function:: calcsize(fmt)
@@ -58,49 +71,62 @@
    Return the size of the struct (and hence of the bytes) corresponding to the
    given format.
 
+.. _struct-format-strings:
+
+Format Strings
+--------------
+
+Format strings are the mechanism used to specify the expected layout when
+packing and unpacking data.  They are built up from format characters, which
+specify the type of data being packed/unpacked.  In addition, there are
+special characters for controlling the byte order, size, and alignment.
+
+Format Characters
+^^^^^^^^^^^^^^^^^
+
 Format characters have the following meaning; the conversion between C and
 Python values should be obvious given their types:
 
-+--------+-------------------------+--------------------+-------+
-| Format | C Type                  | Python             | Notes |
-+========+=========================+====================+=======+
-| ``x``  | pad byte                | no value           |       |
-+--------+-------------------------+--------------------+-------+
-| ``c``  | :ctype:`char`           | bytes of length 1  |       |
-+--------+-------------------------+--------------------+-------+
-| ``b``  | :ctype:`signed char`    | integer            | \(1)  |
-+--------+-------------------------+--------------------+-------+
-| ``B``  | :ctype:`unsigned char`  | integer            |       |
-+--------+-------------------------+--------------------+-------+
-| ``?``  | :ctype:`_Bool`          | bool               | \(2)  |
-+--------+-------------------------+--------------------+-------+
-| ``h``  | :ctype:`short`          | integer            |       |
-+--------+-------------------------+--------------------+-------+
-| ``H``  | :ctype:`unsigned short` | integer            |       |
-+--------+-------------------------+--------------------+-------+
-| ``i``  | :ctype:`int`            | integer            |       |
-+--------+-------------------------+--------------------+-------+
-| ``I``  | :ctype:`unsigned int`   | integer            |       |
-+--------+-------------------------+--------------------+-------+
-| ``l``  | :ctype:`long`           | integer            |       |
-+--------+-------------------------+--------------------+-------+
-| ``L``  | :ctype:`unsigned long`  | integer            |       |
-+--------+-------------------------+--------------------+-------+
-| ``q``  | :ctype:`long long`      | integer            | \(3)  |
-+--------+-------------------------+--------------------+-------+
-| ``Q``  | :ctype:`unsigned long   | integer            | \(3)  |
-|        | long`                   |                    |       |
-+--------+-------------------------+--------------------+-------+
-| ``f``  | :ctype:`float`          | float              |       |
-+--------+-------------------------+--------------------+-------+
-| ``d``  | :ctype:`double`         | float              |       |
-+--------+-------------------------+--------------------+-------+
-| ``s``  | :ctype:`char[]`         | bytes              | \(1)  |
-+--------+-------------------------+--------------------+-------+
-| ``p``  | :ctype:`char[]`         | bytes              | \(1)  |
-+--------+-------------------------+--------------------+-------+
-| ``P``  | :ctype:`void \*`        | integer            |       |
-+--------+-------------------------+--------------------+-------+
++--------+-------------------------+--------------------+------------+
+| Format | C Type                  | Python             | Notes      |
++========+=========================+====================+============+
+| ``x``  | pad byte                | no value           |            |
++--------+-------------------------+--------------------+------------+
+| ``c``  | :ctype:`char`           | bytes of length 1  |            |
++--------+-------------------------+--------------------+------------+
+| ``b``  | :ctype:`signed char`    | integer            | \(1),\(4)  |
++--------+-------------------------+--------------------+------------+
+| ``B``  | :ctype:`unsigned char`  | integer            | \(4)       |
++--------+-------------------------+--------------------+------------+
+| ``?``  | :ctype:`_Bool`          | bool               | \(2)       |
++--------+-------------------------+--------------------+------------+
+| ``h``  | :ctype:`short`          | integer            | \(4)       |
++--------+-------------------------+--------------------+------------+
+| ``H``  | :ctype:`unsigned short` | integer            | \(4)       |
++--------+-------------------------+--------------------+------------+
+| ``i``  | :ctype:`int`            | integer            | \(4)       |
++--------+-------------------------+--------------------+------------+
+| ``I``  | :ctype:`unsigned int`   | integer            | \(4)       |
++--------+-------------------------+--------------------+------------+
+| ``l``  | :ctype:`long`           | integer            | \(4)       |
++--------+-------------------------+--------------------+------------+
+| ``L``  | :ctype:`unsigned long`  | integer            | \(4)       |
++--------+-------------------------+--------------------+------------+
+| ``q``  | :ctype:`long long`      | integer            | \(3), \(4) |
++--------+-------------------------+--------------------+------------+
+| ``Q``  | :ctype:`unsigned long   | integer            | \(3), \(4) |
+|        | long`                   |                    |            |
++--------+-------------------------+--------------------+------------+
+| ``f``  | :ctype:`float`          | float              |            |
++--------+-------------------------+--------------------+------------+
+| ``d``  | :ctype:`double`         | float              |            |
++--------+-------------------------+--------------------+------------+
+| ``s``  | :ctype:`char[]`         | bytes              | \(1)       |
++--------+-------------------------+--------------------+------------+
+| ``p``  | :ctype:`char[]`         | bytes              | \(1)       |
++--------+-------------------------+--------------------+------------+
+| ``P``  | :ctype:`void \*`        | integer            |            |
++--------+-------------------------+--------------------+------------+
 
 Notes:
 
@@ -169,7 +195,13 @@
 Either 0 or 1 in the native or standard bool representation will be packed, and
 any non-zero value will be True when unpacking.
 
-By default, C numbers are represented in the machine's native format and byte
+
+.. _struct-alignment:
+
+Byte Order, Size, and Alignment
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+By default, C types are represented in the machine's native format and byte
 order, and properly aligned by skipping pad bytes if necessary (according to the
 rules used by the C compiler).
 
@@ -223,8 +255,29 @@
 the host system. The struct module does not interpret this as native ordering,
 so the ``'P'`` format is not available.
 
-Examples (all using native byte order, size and alignment, on a big-endian
-machine)::
+Notes:
+
+(1) Padding is only automatically added between successive structure members.
+    No padding is added at the beginning or the end of the encoded struct.
+
+(2) No padding is added when using non-native size and alignment, e.g.
+    with '<', '>', '=', and '!'.
+
+(3) To align the end of a structure to the alignment requirement of a
+    particular type, end the format with the code for that type with a repeat
+    count of zero.  See :ref:`struct-examples`.
+
+
+.. _struct-examples:
+
+Examples
+^^^^^^^^
+
+.. note::
+   All examples assume a native byte order, size, and alignment with a
+   big-endian machine.
+
+A basic example of packing/unpacking three integers::
 
    >>> from struct import *
    >>> pack('hhl', 1, 2, 3)
@@ -234,13 +287,6 @@
    >>> calcsize('hhl')
    8
 
-Hint: to align the end of a structure to the alignment requirement of a
-particular type, end the format with the code for that type with a repeat count
-of zero.  For example, the format ``'llh0l'`` specifies two pad bytes at the
-end, assuming longs are aligned on 4-byte boundaries.  This only works when
-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::
 
@@ -252,6 +298,28 @@
     >>> Student._make(unpack('<10sHHb', record))
     Student(name=b'raymond   ', serialnum=4658, school=264, gradelevel=8)
 
+The ordering of format characters may have an impact on size since the padding
+needed to satisfy alignment requirements is different::
+
+    >>> pack('ci', '*', 0x12131415)
+    b'*\x00\x00\x00\x12\x13\x14\x15'
+    >>> pack('ic', 0x12131415, '*')
+    b'\x12\x13\x14\x15*'
+    >>> calcsize('ci')
+    8
+    >>> calcsize('ic')
+    5
+
+The following format ``'llh0l'`` specifies two pad bytes at the end, assuming
+longs are aligned on 4-byte boundaries::
+
+    >>> pack('llh0l', 1, 2, 3)
+    b'\x00\x00\x00\x01\x00\x00\x00\x02\x00\x03\x00\x00'
+
+This only works when native size and alignment are in effect; standard size and
+alignment does not enforce any alignment.
+
+
 .. seealso::
 
    Module :mod:`array`
@@ -263,18 +331,18 @@
 
 .. _struct-objects:
 
-Struct Objects
---------------
+Objects
+-------
 
 The :mod:`struct` module also defines the following type:
 
 
 .. class:: Struct(format)
 
-   Return a new Struct object which writes and reads binary data according to the
-   format string *format*.  Creating a Struct object once and calling its methods
-   is more efficient than calling the :mod:`struct` functions with the same format
-   since the format string only needs to be compiled once.
+   Return a new Struct object which writes and reads binary data according to
+   the format string *format*.  Creating a Struct object once and calling its
+   methods is more efficient than calling the :mod:`struct` functions with the
+   same format since the format string only needs to be compiled once.
 
 
    Compiled Struct objects support the following methods and attributes:

Modified: python/branches/py3k-jit/Doc/library/subprocess.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/subprocess.rst	(original)
+++ python/branches/py3k-jit/Doc/library/subprocess.rst	Fri Apr 16 02:53:03 2010
@@ -373,8 +373,9 @@
 
    .. note::
 
-      On Windows only SIGTERM is supported so far. It's an alias for
-      :meth:`terminate`.
+      On Windows, SIGTERM is an alias for :meth:`terminate`. CTRL_C_EVENT and
+      CTRL_BREAK_EVENT can be sent to processes started with a `creationflags`
+      parameter which includes `CREATE_NEW_PROCESS_GROUP`.
 
 
 .. method:: Popen.terminate()

Modified: python/branches/py3k-jit/Doc/library/tarfile.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/tarfile.rst	(original)
+++ python/branches/py3k-jit/Doc/library/tarfile.rst	Fri Apr 16 02:53:03 2010
@@ -212,7 +212,7 @@
 A :class:`TarFile` object can be used as a context manager in a :keyword:`with`
 statement. It will automatically be closed when the block is completed. Please
 note that in the event of an exception an archive opened for writing will not
-be finalized, only the internally used file object will be closed. See the
+be finalized; only the internally used file object will be closed. See the
 :ref:`tar-examples` section for a use case.
 
 .. versionadded:: 3.2

Modified: python/branches/py3k-jit/Doc/library/test.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/test.rst	(original)
+++ python/branches/py3k-jit/Doc/library/test.rst	Fri Apr 16 02:53:03 2010
@@ -221,15 +221,15 @@
 
 .. data:: TESTFN
 
-   Set to the name that a temporary file could use. Any temporary file that is
-   created should be closed and unlinked (removed).
+   Set to a name that is safe to use as the name of a temporary file.  Any
+   temporary file that is created should be closed and unlinked (removed).
 
 The :mod:`test.support` module defines the following functions:
 
 
 .. function:: forget(module_name)
 
-   Remove the module named *module_name* from ``sys.modules`` and deletes any
+   Remove the module named *module_name* from ``sys.modules`` and delete any
    byte-compiled files of the module.
 
 
@@ -272,49 +272,55 @@
    This will run all tests defined in the named module.
 
 
-.. function:: check_warnings(*filters, quiet=None)
+.. function:: check_warnings(*filters, quiet=True)
 
-   A convenience wrapper for ``warnings.catch_warnings()`` that makes
-   it easier to test that a warning was correctly raised with a single
-   assertion. It is approximately equivalent to calling
-   ``warnings.catch_warnings(record=True)``.
-
-   It accepts 2-tuples ``("message regexp", WarningCategory)`` as positional
-   arguments. If there's some ``*filters`` defined, or if the optional keyword
-   argument ``quiet`` is :const:`False`, it checks if the warnings are
-   effective. If some filter did not catch any warning, the test fails. If some
-   warnings are not caught, the test fails, too. To disable these checks, set
-   argument ``quiet`` to :const:`True`.
+   A convenience wrapper for :func:`warnings.catch_warnings()` that makes it
+   easier to test that a warning was correctly raised.  It is approximately
+   equivalent to calling ``warnings.catch_warnings(record=True)`` with
+   :meth:`warnings.simplefilter` set to ``always`` and with the option to
+   automatically validate the results that are recorded.
+
+   ``check_warnings`` accepts 2-tuples of the form ``("message regexp",
+   WarningCategory)`` as positional arguments. If one or more *filters* are
+   provided, or if the optional keyword argument *quiet* is :const:`False`,
+   it checks to make sure the warnings are as expected:  each specified filter
+   must match at least one of the warnings raised by the enclosed code or the
+   test fails, and if any warnings are raised that do not match any of the
+   specified filters the test fails.  To disable the first of these checks,
+   set *quiet* to :const:`True`.
 
-   Without argument, it defaults to::
+   If no arguments are specified, it defaults to::
 
       check_warnings(("", Warning), quiet=True)
 
-   Additionally, on entry to the context manager, a :class:`WarningRecorder`
-   instance is returned. The underlying warnings list is available via the
-   recorder object's :attr:`warnings` attribute, while the attributes of the
-   last raised warning are also accessible directly on the object. If no
-   warning has been raised, then the latter attributes will all be
-   :const:`None`.
+   In this case all warnings are caught and no errors are raised.
 
-   A :meth:`reset` method is also provided on the recorder object. This
-   method simply clears the warnings list.
+   On entry to the context manager, a :class:`WarningRecorder` instance is
+   returned. The underlying warnings list from
+   :func:`~warnings.catch_warnings` is available via the recorder object's
+   :attr:`warnings` attribute.  As a convenience, the attributes of the object
+   representing the most recent warning can also be accessed directly through
+   the recorder object (see example below).  If no warning has been raised,
+   then any of the attributes that would otherwise be expected on an object
+   representing a warning will return :const:`None`.
 
-   The context manager may be used like this::
+   The recorder object also has a :meth:`reset` method, which clears the
+   warnings list.
 
-      import warnings
-
-      with check_warnings(quiet=False):
-          exec('assert(False, "Hey!")')
-          warnings.warn(UserWarning("Hide me!"))
+   The context manager is designed to be used like this::
 
       with check_warnings(("assertion is always true", SyntaxWarning),
                           ("", UserWarning)):
           exec('assert(False, "Hey!")')
           warnings.warn(UserWarning("Hide me!"))
 
+   In this case if either warning was not raised, or some other warning was
+   raised, :func:`check_warnings` would raise an error.
+
+   When a test needs to look more deeply into the warnings, rather than
+   just checking whether or not they occurred, code like this can be used::
+
       with check_warnings(quiet=True) as w:
-          warnings.simplefilter("always")
           warnings.warn("foo")
           assert str(w.args[0]) == "foo"
           warnings.warn("bar")
@@ -324,8 +330,12 @@
           w.reset()
           assert len(w.warnings) == 0
 
+
+   Here all warnings will be caught, and the test code tests the captured
+   warnings directly.
+
    .. versionchanged:: 3.2
-      New optional attributes ``*filters`` and ``quiet``.
+      New optional arguments *filters* and *quiet*.
 
 
 .. function:: captured_stdout()

Modified: python/branches/py3k-jit/Doc/library/threading.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/threading.rst	(original)
+++ python/branches/py3k-jit/Doc/library/threading.rst	Fri Apr 16 02:53:03 2010
@@ -155,6 +155,16 @@
    Availability: Windows, systems with POSIX threads.
 
 
+This module also defines the following constant:
+
+.. data:: TIMEOUT_MAX
+
+   The maximum value allowed for the *timeout* parameter of blocking functions
+   (:meth:`Lock.acquire`, :meth:`RLock.acquire`, :meth:`Condition.wait`, etc.).
+   Specifiying a timeout greater than this value will raise an
+   :exc:`OverflowError`.
+
+
 Detailed interfaces for the objects are documented below.
 
 The design of this module is loosely based on Java's threading model. However,
@@ -349,7 +359,7 @@
 All methods are executed atomically.
 
 
-.. method:: Lock.acquire(blocking=True)
+.. method:: Lock.acquire(blocking=True, timeout=-1)
 
    Acquire a lock, blocking or non-blocking.
 
@@ -363,6 +373,15 @@
    without an argument would block, return false immediately; otherwise, do the
    same thing as when called without arguments, and return true.
 
+   When invoked with the floating-point *timeout* argument set to a positive
+   value, block for at most the number of seconds specified by *timeout*
+   and as long as the lock cannot be acquired.  A negative *timeout* argument
+   specifies an unbounded wait.  It is forbidden to specify a *timeout*
+   when *blocking* is false.
+
+   The return value is ``True`` if the lock is acquired successfully,
+   ``False`` if not (for example if the *timeout* expired).
+
 
 .. method:: Lock.release()
 
@@ -396,7 +415,7 @@
 :meth:`acquire` to proceed.
 
 
-.. method:: RLock.acquire(blocking=True)
+.. method:: RLock.acquire(blocking=True, timeout=-1)
 
    Acquire a lock, blocking or non-blocking.
 
@@ -415,6 +434,11 @@
    without an argument would block, return false immediately; otherwise, do the
    same thing as when called without arguments, and return true.
 
+   When invoked with the floating-point *timeout* argument set to a positive
+   value, block for at most the number of seconds specified by *timeout*
+   and as long as the lock cannot be acquired.  Return true if the lock has
+   been acquired, false if the timeout has elapsed.
+
 
 .. method:: RLock.release()
 

Modified: python/branches/py3k-jit/Doc/library/unittest.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/unittest.rst	(original)
+++ python/branches/py3k-jit/Doc/library/unittest.rst	Fri Apr 16 02:53:03 2010
@@ -74,6 +74,11 @@
    Module :mod:`doctest`
       Another test-support module with a very different flavor.
 
+   `unittest2: A backport of new unittest features for Python 2.4-2.6 <http://pypi.python.org/pypi/unittest2>`_
+      Many new features were added to unittest in Python 2.7, including test
+      discovery. unittest2 allows you to use these features with earlier
+      versions of Python.
+
    `Simple Smalltalk Testing: With Patterns <http://www.XProgramming.com/testfram.htm>`_
       Kent Beck's original paper on testing frameworks using the pattern shared
       by :mod:`unittest`.
@@ -82,41 +87,13 @@
       Third-party unittest frameworks with a lighter-weight syntax for writing
       tests.  For example, ``assert func(10) == 42``.
 
-   `python-mock <http://python-mock.sourceforge.net/>`_ and `minimock <http://blog.ianbicking.org/minimock.html>`_
-      Tools for creating mock test objects (objects simulating external
-      resources).
-
-
-.. _unittest-command-line-interface:
-
-Command Line Interface
-----------------------
-
-The unittest module can be used from the command line to run tests from
-modules, classes or even individual test methods::
-
-   python -m unittest test_module1 test_module2
-   python -m unittest test_module.TestClass
-   python -m unittest test_module.TestClass.test_method
-
-You can pass in a list with any combination of module names, and fully
-qualified class or method names.
-
-You can run tests with more detail (higher verbosity) by passing in the -v flag::
-
-   python -m unittest -v test_module
-
-For a list of all the command line options::
-
-   python -m unittest -h
-
-.. versionchanged:: 3.2
-   In earlier versions it was only possible to run individual test methods and
-   not modules or classes.
-
-The command line can also be used for test discovery, for running all of the
-tests in a project or just a subset.
-
+   `The Python Testing Tools Taxonomy <http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy>`_
+      An extensive list of Python testing tools including functional testing
+      frameworks and mock object libraries.
+
+   `Testing in Python Mailing List <http://lists.idyll.org/listinfo/testing-in-python>`_
+      A special-interest-group for discussion of testing, and testing tools,
+      in Python.
 
 .. _unittest-test-discovery:
 
@@ -243,6 +220,100 @@
 are sufficient to meet many everyday testing needs.  The remainder of the
 documentation explores the full feature set from first principles.
 
+
+.. _unittest-command-line-interface:
+
+Command Line Interface
+----------------------
+
+The unittest module can be used from the command line to run tests from
+modules, classes or even individual test methods::
+
+   python -m unittest test_module1 test_module2
+   python -m unittest test_module.TestClass
+   python -m unittest test_module.TestClass.test_method
+
+You can pass in a list with any combination of module names, and fully
+qualified class or method names.
+
+You can run tests with more detail (higher verbosity) by passing in the -v flag::
+
+   python -m unittest -v test_module
+
+For a list of all the command line options::
+
+   python -m unittest -h
+
+..  versionchanged:: 3.2
+   In earlier versions it was only possible to run individual test methods and
+   not modules or classes.
+
+
+failfast, catch and buffer command line options
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+unittest supports three command options.
+
+* -f / --failfast
+
+  Stop the test run on the first error or failure.
+
+* -c / --catch
+
+  Control-c during the test run waits for the current test to end and then
+  reports all the results so far. A second control-c raises the normal
+  ``KeyboardInterrupt`` exception.
+
+  See `Signal Handling`_ for the functions that provide this functionality.
+
+* -b / --buffer
+
+  The standard out and standard error streams are buffered during the test
+  run. Output during a passing test is discarded. Output is echoed normally
+  on test fail or error and is added to the failure messages.
+
+..  versionadded:: 2.7
+   The command line options ``-c``, ``-b`` and ``-f`` where added.
+
+The command line can also be used for test discovery, for running all of the
+tests in a project or just a subset.
+
+
+.. _unittest-test-discovery:
+
+Test Discovery
+--------------
+
+.. versionadded:: 2.7
+
+Unittest supports simple test discovery. For a project's tests to be
+compatible with test discovery they must all be importable from the top level
+directory of the project (in other words, they must all be in Python packages).
+
+Test discovery is implemented in :meth:`TestLoader.discover`, but can also be
+used from the command line. The basic command line usage is::
+
+   cd project_directory
+   python -m unittest discover
+
+The ``discover`` sub-command has the following options:
+
+   -v, --verbose    Verbose output
+   -s directory     Directory to start discovery ('.' default)
+   -p pattern       Pattern to match test files ('test*.py' default)
+   -t directory     Top level directory of project (default to
+                    start directory)
+
+The -s, -p, & -t options can be passsed in as positional arguments. The
+following two command lines are equivalent::
+
+   python -m unittest discover -s project_directory -p '*_test.py'
+   python -m unittest discover project_directory '*_test.py'
+
+Test modules and packages can customize test loading and discovery by through
+the `load_tests protocol`_.
+
+
 .. _organizing-tests:
 
 Organizing test code
@@ -580,6 +651,9 @@
    Mark the test as an expected failure.  If the test fails when run, the test
    is not counted as a failure.
 
+Skipped tests will not have :meth:`setUp` or :meth:`tearDown` run around them.
+Skipped classes will not have :meth:`setUpClass` or :meth:`tearDownClass` run.
+
 
 .. _unittest-contents:
 
@@ -645,6 +719,36 @@
       the outcome of the test method. The default implementation does nothing.
 
 
+   .. method:: setUpClass()
+
+      A class method called before tests in an individual class run.
+      ``setUpClass`` is called with the class as the only argument
+      and must be decorated as a :func:`classmethod`::
+
+        @classmethod
+        def setUpClass(cls):
+            ...
+
+      See `Class and Module Fixtures`_ for more details.
+
+      .. versionadded:: 3.2
+
+
+   .. method:: tearDownClass()
+
+      A class method called after tests in an individual class have run.
+      ``tearDownClass`` is called with the class as the only argument
+      and must be decorated as a :meth:`classmethod`::
+
+        @classmethod
+        def tearDownClass(cls):
+            ...
+
+      See `Class and Module Fixtures`_ for more details.
+
+      .. versionadded:: 3.2
+
+
    .. method:: run(result=None)
 
       Run the test, collecting the result into the test result object passed as
@@ -661,6 +765,8 @@
       Calling this during the a test method or :meth:`setUp` skips the current
       test.  See :ref:`unittest-skipping` for more information.
 
+      .. versionadded:: 2.7
+
 
    .. method:: debug()
 
@@ -725,8 +831,8 @@
          :meth:`failIfEqual`; use :meth:`assertNotEqual`.
 
 
-   .. method:: assertAlmostEqual(first, second, *, places=7, msg=None)
-               failUnlessAlmostEqual(first, second, *, places=7, msg=None)
+   .. method:: assertAlmostEqual(first, second, *, places=7, msg=None, delta=None)
+               failUnlessAlmostEqual(first, second, *, places=7, msg=None, delta=None)
 
       Test that *first* and *second* are approximately equal by computing the
       difference, rounding to the given number of decimal *places* (default 7),
@@ -739,13 +845,14 @@
 
       .. versionchanged:: 3.2
          Objects that compare equal are automatically almost equal.
+         Added the ``delta`` keyword argument.
 
       .. deprecated:: 3.1
          :meth:`failUnlessAlmostEqual`; use :meth:`assertAlmostEqual`.
 
 
-   .. method:: assertNotAlmostEqual(first, second, *, places=7, msg=None)
-               failIfAlmostEqual(first, second, *, places=7, msg=None)
+   .. method:: assertNotAlmostEqual(first, second, *, places=7, msg=None, delta=None)
+               failIfAlmostEqual(first, second, *, places=7, msg=None, delta=None)
 
       Test that *first* and *second* are not approximately equal by computing
       the difference, rounding to the given number of decimal *places* (default
@@ -756,8 +863,14 @@
       compare equal, the test will fail with the explanation given by *msg*, or
       :const:`None`.
 
+      If *delta* is supplied instead of *places* then the the difference
+      between *first* and *second* must be more than *delta*.
+
+      Supplying both *delta* and *places* raises a ``TypeError``.
+
       .. versionchanged:: 3.2
          Objects that compare equal automatically fail.
+         Added the ``delta`` keyword argument.
 
       .. deprecated:: 3.1
          :meth:`failIfAlmostEqual`; use :meth:`assertNotAlmostEqual`.
@@ -800,6 +913,16 @@
       .. versionadded:: 3.1
 
 
+   .. method:: assertNotRegexpMatches(text, regexp, msg=None)
+
+      Verifies that a *regexp* search does not match *text*.  Fails with an error
+      message including the pattern and the *text*.  *regexp* may be
+      a regular expression object or a string containing a regular expression
+      suitable for use by :func:`re.search`.
+
+      .. versionadded:: 2.7
+
+
    .. method:: assertIn(first, second, msg=None)
                assertNotIn(first, second, msg=None)
 
@@ -1132,7 +1255,7 @@
 
    .. method:: doCleanups()
 
-      This method is called uncoditionally after :meth:`tearDown`, or
+      This method is called unconditionally after :meth:`tearDown`, or
       after :meth:`setUp` if :meth:`setUp` raises an exception.
 
       It is responsible for calling all the cleanup functions added by
@@ -1340,6 +1463,8 @@
       ``load_tests`` does not need to pass this argument in to
       ``loader.discover()``.
 
+      *start_dir* can be a dotted module name as well as a directory.
+
       .. versionadded:: 3.2
 
 
@@ -1431,6 +1556,24 @@
       The total number of tests run so far.
 
 
+   .. attribute:: buffer
+
+      If set to true, ``sys.stdout`` and ``sys.stderr`` will be buffered in between
+      :meth:`startTest` and :meth:`stopTest` being called. Collected output will
+      only be echoed onto the real ``sys.stdout`` and ``sys.stderr`` if the test
+      fails or errors. Any output is also attached to the failure / error message.
+
+      .. versionadded:: 2.7
+
+
+   .. attribute:: failfast
+
+      If set to true :meth:`stop` will be called on the first failure or error,
+      halting the test run.
+
+      .. versionadded:: 2.7
+
+
    .. method:: wasSuccessful()
 
       Return :const:`True` if all tests run so far have passed, otherwise returns
@@ -1459,18 +1602,11 @@
 
       Called when the test case *test* is about to be run.
 
-      The default implementation simply increments the instance's :attr:`testsRun`
-      counter.
-
-
    .. method:: stopTest(test)
 
       Called after the test case *test* has been executed, regardless of the
       outcome.
 
-      The default implementation does nothing.
-
-
    .. method:: startTestRun(test)
 
       Called once before any tests are executed.
@@ -1570,12 +1706,12 @@
 
       ``_makeResult()`` instantiates the class or callable passed in the
       ``TextTestRunner`` constructor as the ``resultclass`` argument. It
-      defaults to :class::`TextTestResult` if no ``resultclass`` is provided.
+      defaults to :class:`TextTestResult` if no ``resultclass`` is provided.
       The result class is instantiated with the following arguments::
 
         stream, descriptions, verbosity
 
-.. function:: main(module='__main__', defaultTest=None, argv=None, testRunner=None, testLoader=unittest.loader.defaultTestLoader, exit=True, verbosity=1)
+.. function:: main(module='__main__', defaultTest=None, argv=None, testRunner=None, testLoader=unittest.loader.defaultTestLoader, exit=True, verbosity=1, failfast=None, catchbreak=None, buffer=None)
 
    A command-line program that runs a set of tests; this is primarily for making
    test modules conveniently executable.  The simplest use for this function is to
@@ -1601,11 +1737,15 @@
       >>> from unittest import main
       >>> main(module='test_module', exit=False)
 
+   The ``failfast``, ``catchbreak`` and ``buffer`` parameters have the same
+   effect as the `failfast, catch and buffer command line options`_.
+
    Calling ``main`` actually returns an instance of the ``TestProgram`` class.
    This stores the result of the tests run as the ``result`` attribute.
 
    .. versionchanged:: 3.2
-      The ``exit`` and ``verbosity`` parameters were added.
+      The ``exit``, ``verbosity``, ``failfast``, ``catchbreak`` and ``buffer``
+      parameters were added.
 
 
 load_tests Protocol
@@ -1675,3 +1815,113 @@
         package_tests = loader.discover(start_dir=this_dir, pattern=pattern)
         standard_tests.addTests(package_tests)
         return standard_tests
+
+
+Class and Module Fixtures
+-------------------------
+
+Class and module level fixtures are implemented in :class:`TestSuite`. When
+the test suite encounters a test from a new class then :meth:`tearDownClass`
+from the previous class (if there is one) is called, followed by
+:meth:`setUpClass` from the new class.
+
+Similarly if a test is from a different module from the previous test then
+``tearDownModule`` from the previous module is run, followed by
+``setUpModule`` from the new module.
+
+After all the tests have run the final ``tearDownClass`` and
+``tearDownModule`` are run.
+
+Note that shared fixtures do not play well with [potential] features like test
+parallelization and they break test isolation. They should be used with care.
+
+The default ordering of tests created by the unittest test loaders is to group
+all tests from the same modules and classes together. This will lead to
+``setUpClass`` / ``setUpModule`` (etc) being called exactly once per class and
+module. If you randomize the order, so that tests from different modules and
+classes are adjacent to each other, then these shared fixture functions may be
+called multiple times in a single test run.
+
+Shared fixtures are not intended to work with suites with non-standard
+ordering. A ``BaseTestSuite`` still exists for frameworks that don't want to
+support shared fixtures.
+
+If there are any exceptions raised during one of the shared fixture functions
+the test is reported as an error. Because there is no corresponding test
+instance an ``_ErrorHolder`` object (that has the same interface as a
+:class:`TestCase`) is created to represent the error. If you are just using
+the standard unittest test runner then this detail doesn't matter, but if you
+are a framework author it may be relevant.
+
+
+setUpClass and tearDownClass
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+These must be implemented as class methods::
+
+    import unittest
+
+    class Test(unittest.TestCase):
+        @classmethod
+        def setUpClass(cls):
+            cls._connection = createExpensiveConnectionObject()
+
+        @classmethod
+        def tearDownClass(cls):
+            cls._connection.destroy()
+
+If you want the ``setUpClass`` and ``tearDownClass`` on base classes called
+then you must call up to them yourself. The implementations in
+:class:`TestCase` are empty.
+
+If an exception is raised during a ``setUpClass`` then the tests in the class
+are not run and the ``tearDownClass`` is not run. Skipped classes will not
+have ``setUpClass`` or ``tearDownClass`` run.
+
+
+setUpModule and tearDownModule
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+These should be implemented as functions::
+
+    def setUpModule():
+        createConnection()
+
+    def tearDownModule():
+        closeConnection()
+
+If an exception is raised in a ``setUpModule`` then none of the tests in the
+module will be run and the ``tearDownModule`` will not be run.
+
+
+Signal Handling
+---------------
+
+The -c / --catch command line option to unittest, along with the ``catchbreak``
+parameter to :func:`unittest.main()`, provide more friendly handling of
+control-c during a test run. With catch break behavior enabled control-c will
+allow the currently running test to complete, and the test run will then end
+and report all the results so far. A second control-c will raise a
+``KeyboardInterrupt`` in the usual way.
+
+There are a few utility functions for framework authors to enable this
+functionality within test frameworks.
+
+.. function:: installHandler()
+
+   Install the control-c handler. When a :const:`signal.SIGINT` is received
+   (usually in response to the user pressing control-c) all registered results
+   have :meth:`~TestResult.stop` called.
+
+.. function:: registerResult(result)
+
+   Register a :class:`TestResult` object for control-c handling. Registering a
+   result stores a weak reference to it, so it doesn't prevent the result from
+   being garbage collected.
+
+.. function:: removeResult(result)
+
+   Remove a registered result. Once a result has been removed then
+   :meth:`~TestResult.stop` will no longer be called on that result object in
+   response to a control-c.
+

Modified: python/branches/py3k-jit/Doc/library/urllib.request.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/urllib.request.rst	(original)
+++ python/branches/py3k-jit/Doc/library/urllib.request.rst	Fri Apr 16 02:53:03 2010
@@ -1073,23 +1073,39 @@
 --------
 
 This example gets the python.org main page and displays the first 100 bytes of
-it::
+it.::
 
    >>> import urllib.request
    >>> f = urllib.request.urlopen('http://www.python.org/')
    >>> print(f.read(100))
+   b'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+   <?xml-stylesheet href="./css/ht2html'
+
+Note that in Python 3, urlopen returns a bytes object by default. In many
+circumstances, you might expect the output of urlopen to be a string. This
+might be a carried over expectation from Python 2, where urlopen returned
+string or it might even the common usecase. In those cases, you should
+explicitly decode the bytes to string.
+
+In the examples below, we have chosen *utf-8* encoding for demonstration, you
+might choose the encoding which is suitable for the webpage you are
+requesting::
+
+   >>> import urllib.request
+   >>> f = urllib.request.urlopen('http://www.python.org/')
+   >>> print(f.read(100).decode('utf-8')
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <?xml-stylesheet href="./css/ht2html
 
-Here we are sending a data-stream to the stdin of a CGI and reading the data it
-returns to us. Note that this example will only work when the Python
-installation supports SSL. ::
+In the following example, we are sending a data-stream to the stdin of a CGI
+and reading the data it returns to us. Note that this example will only work
+when the Python installation supports SSL. ::
 
    >>> import urllib.request
    >>> req = urllib.request.Request(url='https://localhost/cgi-bin/test.cgi',
    ...                       data='This data is passed to stdin of the CGI')
    >>> f = urllib.request.urlopen(req)
-   >>> print(f.read())
+   >>> print(f.read().decode('utf-8'))
    Got Data: "This data is passed to stdin of the CGI"
 
 The code for the sample CGI used in the above example is::
@@ -1161,7 +1177,7 @@
    >>> import urllib.parse
    >>> params = urllib.parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
    >>> f = urllib.request.urlopen("http://www.musi-cal.com/cgi-bin/query?%s" % params)
-   >>> print(f.read())
+   >>> print(f.read().decode('utf-8'))
 
 The following example uses the ``POST`` method instead::
 
@@ -1169,7 +1185,7 @@
    >>> import urllib.parse
    >>> params = urllib.parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
    >>> f = urllib.request.urlopen("http://www.musi-cal.com/cgi-bin/query", params)
-   >>> print(f.read())
+   >>> print(f.read().decode('utf-8'))
 
 The following example uses an explicitly specified HTTP proxy, overriding
 environment settings::
@@ -1178,14 +1194,14 @@
    >>> proxies = {'http': 'http://proxy.example.com:8080/'}
    >>> opener = urllib.request.FancyURLopener(proxies)
    >>> f = opener.open("http://www.python.org")
-   >>> f.read()
+   >>> f.read().decode('utf-8')
 
 The following example uses no proxies at all, overriding environment settings::
 
    >>> import urllib.request
    >>> opener = urllib.request.FancyURLopener({})
    >>> f = opener.open("http://www.python.org/")
-   >>> f.read()
+   >>> f.read().decode('utf-8')
 
 
 :mod:`urllib.request` Restrictions

Modified: python/branches/py3k-jit/Doc/library/warnings.rst
==============================================================================
--- python/branches/py3k-jit/Doc/library/warnings.rst	(original)
+++ python/branches/py3k-jit/Doc/library/warnings.rst	Fri Apr 16 02:53:03 2010
@@ -180,7 +180,10 @@
 While within the context manager all warnings will simply be ignored. This
 allows you to use known-deprecated code without having to see the warning while
 not suppressing the warning for other code that might not be aware of its use
-of deprecated code.
+of deprecated code.  Note: this can only be guaranteed in a single-threaded
+application. If two or more threads use the :class:`catch_warnings` context
+manager at the same time, the behavior is undefined.
+
 
 
 .. _warning-testing:
@@ -218,7 +221,9 @@
 when the context was entered. This prevents tests from changing the warnings
 filter in unexpected ways between tests and leading to indeterminate test
 results. The :func:`showwarning` function in the module is also restored to
-its original value.
+its original value.  Note: this can only be guaranteed in a single-threaded
+application. If two or more threads use the :class:`catch_warnings` context
+manager at the same time, the behavior is undefined.
 
 When testing multiple operations that raise the same kind of warning, it
 is important to test them in a manner that confirms each operation is raising
@@ -337,3 +342,11 @@
     module returned when you import :mod:`warnings` whose filter will be
     protected. This argument exists primarily for testing the :mod:`warnings`
     module itself.
+
+    .. note::
+
+        The :class:`catch_warnings` manager works by replacing and
+        then later restoring the module's
+        :func:`showwarning` function and internal list of filter
+        specifications.  This means the context manager is modifying
+        global state and therefore is not thread-safe.

Modified: python/branches/py3k-jit/Doc/reference/expressions.rst
==============================================================================
--- python/branches/py3k-jit/Doc/reference/expressions.rst	(original)
+++ python/branches/py3k-jit/Doc/reference/expressions.rst	Fri Apr 16 02:53:03 2010
@@ -914,7 +914,9 @@
 A right shift by *n* bits is defined as division by ``pow(2,n)``.  A left shift
 by *n* bits is defined as multiplication with ``pow(2,n)``.
 
-.. note:: In the current implementation, the right-hand operand is required
+.. note::
+
+   In the current implementation, the right-hand operand is required
    to be at most :attr:`sys.maxsize`.  If the right-hand operand is larger than
    :attr:`sys.maxsize` an :exc:`OverflowError` exception is raised.
 

Modified: python/branches/py3k-jit/Doc/using/cmdline.rst
==============================================================================
--- python/branches/py3k-jit/Doc/using/cmdline.rst	(original)
+++ python/branches/py3k-jit/Doc/using/cmdline.rst	Fri Apr 16 02:53:03 2010
@@ -1,5 +1,8 @@
 .. highlightlang:: none
 
+.. ATTENTION: You probably should update Misc/python.man, too, if you modify
+.. this file.
+
 .. _using-on-general:
 
 Command line and environment
@@ -294,7 +297,7 @@
    the remaining fields.  Empty fields match all values; trailing empty fields
    may be omitted.  The *message* field matches the start of the warning message
    printed; this match is case-insensitive.  The *category* field matches the
-   warning category.  This must be a class name; the match test whether the
+   warning category.  This must be a class name; the match tests whether the
    actual warning category of the message is a subclass of the specified warning
    category.  The full class name must be given.  The *module* field matches the
    (fully-qualified) module name; this match is case-sensitive.  The *line*
@@ -306,6 +309,8 @@
 
       :pep:`230` -- Warning framework
 
+      :envvar:`PYTHONWARNINGS`
+
 
 .. cmdoption:: -x
 
@@ -469,6 +474,12 @@
    value instead of the value got through the C runtime.  Only works on
    Mac OS X.
 
+.. envvar:: PYTHONWARNINGS
+
+   This is equivalent to the :option:`-W` option. If set to a comma
+   separated string, it is equivalent to specifying :option:`-W` multiple
+   times.
+
 
 Debug-mode variables
 ~~~~~~~~~~~~~~~~~~~~

Modified: python/branches/py3k-jit/Doc/whatsnew/2.6.rst
==============================================================================
--- python/branches/py3k-jit/Doc/whatsnew/2.6.rst	(original)
+++ python/branches/py3k-jit/Doc/whatsnew/2.6.rst	Fri Apr 16 02:53:03 2010
@@ -1792,7 +1792,7 @@
   were applied.  (Maintained by Josiah Carlson; see :issue:`1736190` for
   one patch.)
 
-* The :mod:`bsddb` module also has a new maintainer, Jesús Cea, and the package
+* The :mod:`bsddb` module also has a new maintainer, Jesús Cea Avion, and the package
   is now available as a standalone package.  The web page for the package is
   `www.jcea.es/programacion/pybsddb.htm
   <http://www.jcea.es/programacion/pybsddb.htm>`__.

Modified: python/branches/py3k-jit/Doc/whatsnew/2.7.rst
==============================================================================
--- python/branches/py3k-jit/Doc/whatsnew/2.7.rst	(original)
+++ python/branches/py3k-jit/Doc/whatsnew/2.7.rst	Fri Apr 16 02:53:03 2010
@@ -8,6 +8,10 @@
 
 .. Fix accents on Kristjan Valur Jonsson, Fuerstenau
 
+.. Big jobs: argparse, ElementTree 1.3, pep 391, 3106, sysconfig
+..  unittest test discovery
+..  hyperlink all the methods & functions.
+
 .. $Id$
    Rules for maintenance:
 
@@ -37,7 +41,7 @@
    * 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
+   * 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.
@@ -106,11 +110,12 @@
 Over the years, a number of authors have written alternative implementations
 that remember the order that the keys were originally inserted.  Based on
 the experiences from those implementations, a new
-:class:`collections.OrderedDict` class has been introduced.
+:class:`~collections.OrderedDict` class has been introduced in the
+:mod:`collections` module.
 
-The :class:`OrderedDict` API is substantially the same as regular dictionaries
-but will iterate over keys and values in a guaranteed order depending on
-when a key was first inserted::
+The :class:`~collections.OrderedDict` API is substantially the same as regular
+dictionaries but will iterate over keys and values in a guaranteed order
+depending on when a key was first inserted::
 
     >>> from collections import OrderedDict
     >>> d = OrderedDict([('first', 1), ('second', 2),
@@ -132,8 +137,8 @@
     >>> d.items()
     [('first', 1), ('third', 3), ('second', 5)]
 
-The :meth:`popitem` method has an optional *last* argument
-that defaults to True.  If *last* is True, the most recently
+The :meth:`~collections.OrderedDict.popitem` method has an optional *last*
+argument that defaults to True.  If *last* is True, the most recently
 added key is returned and removed; if it's False, the
 oldest key is selected::
 
@@ -142,9 +147,9 @@
     (19, 0)
     >>> od.popitem()
     (18, 0)
-    >>> od.popitem(False)
+    >>> od.popitem(last=False)
     (0, 0)
-    >>> od.popitem(False)
+    >>> od.popitem(last=False)
     (1, 0)
 
 Comparing two ordered dictionaries checks both the keys and values,
@@ -154,31 +159,35 @@
     ...                    ('third', 3)])
     >>> od2 = OrderedDict([('third', 3), ('first', 1),
     ...                    ('second', 2)])
-    >>> od1==od2
+    >>> od1 == od2
     False
     >>> # Move 'third' key to the end
-    >>> del od2['third'] ; od2['third'] = 3
-    >>> od1==od2
+    >>> del od2['third']; od2['third'] = 3
+    >>> od1 == od2
     True
 
-Comparing an :class:`OrderedDict` with a regular dictionary
+Comparing an :class:`~collections.OrderedDict` with a regular dictionary
 ignores the insertion order and just compares the keys and values.
 
-How does the :class:`OrderedDict` work?  It maintains a doubly-linked
-list of keys, appending new keys to the list as they're inserted.  A
-secondary dictionary maps keys to their corresponding list node, so
+How does the :class:`~collections.OrderedDict` work?  It maintains a
+doubly-linked list of keys, appending new keys to the list as they're inserted.
+A secondary dictionary maps keys to their corresponding list node, so
 deletion doesn't have to traverse the entire linked list and therefore
 remains O(1).
 
 .. XXX check O(1)-ness with Raymond
+..     Also check if the 'somenamedtuple' in the collection module should
+..     be replaced/removed in order to use
+..     :meth:`~collections.namedtuple._asdict()` (see below)
 
 The standard library now supports use of ordered dictionaries in several
 modules.  The :mod:`configparser` module uses them by default.  This lets
 configuration files be read, modified, and then written back in their original
-order.  The *_asdict()* method for :func:`collections.namedtuple` now
-returns an ordered dictionary with the values appearing in the same order as
-the underlying tuple indicies.  The :mod:`json` module is being built-out with
-an *object_pairs_hook* to allow OrderedDicts to be built by the decoder.
+order.  The :meth:`~collections.somenamedtuple._asdict()` method for
+:func:`collections.namedtuple` now returns an ordered dictionary with the
+values appearing in the same order as the underlying tuple indices.
+The :mod:`json` module is being built-out with an *object_pairs_hook* to allow
+OrderedDicts to be built by the decoder.
 Support was also added for third-party tools like `PyYAML <http://pyyaml.org/>`_.
 
 .. seealso::
@@ -190,7 +199,7 @@
 .. _pep-0378:
 
 PEP 378: Format Specifier for Thousands Separator
-====================================================
+=================================================
 
 To make program output more readable, it can be useful to add
 separators to large numbers and render them as
@@ -203,7 +212,7 @@
 threads are producing output for different locales.
 
 Therefore, a simple comma-grouping mechanism has been added to the
-mini-language used by the string :meth:`format` method.  When
+mini-language used by the :meth:`str.format` method.  When
 formatting a floating-point number, simply include a comma between the
 width and the precision::
 
@@ -230,10 +239,33 @@
 PEP 389: The argparse Module for Parsing Command Lines
 ======================================================
 
-XXX write this section.
+The :mod:`argparse` module for parsing command-line arguments was
+added, intended as a more powerful replacement for the
+:mod:`optparse` module.
+
+This means Python now supports three different modules for parsing
+command-line arguments: :mod:`getopt`, :mod:`optparse`, and
+:mod:`argparse`.  The :mod:`getopt` module closely resembles the C
+:cfunc:`getopt` function, so it remains useful if you're writing a
+Python prototype that will eventually be rewritten in C.
+:mod:`optparse` becomes redundant, but there are no plans to remove it
+because there are many scripts still using it, and there's no
+automated way to update these scripts.  (Making the :mod:`argparse`
+API consistent with :mod:`optparse`'s interface was discussed but
+rejected as too messy and difficult.)
+
+To summarize, if you're writing a new script and don't need to worry
+about compatibility with earlier versions of Python, use
+:mod:`argparse` instead of :mod:`optparse`.
+
+XXX need an example
 
 .. seealso::
 
+   `argparse module documentation <http://docs.python.org/dev/library/argparse.html>`__
+
+   `Upgrading optparse code to use argparse <http://docs.python.org/dev/library/argparse.html#upgrading-optparse-code>`__
+
    :pep:`389` - argparse - New Command Line Parsing Module
      PEP written and implemented by Steven Bethard.
 
@@ -242,6 +274,20 @@
 
 XXX write this section.
 
+Two smaller enhancements to the logging module are:
+
+.. rev79293
+
+* :class:`Logger` instances gained a :meth:`getChild` that retrieves a
+  descendant logger using a relative path.  For example,
+  once you retrieve a logger by doing ``log = getLogger('app')``,
+  calling ``log.getChild('network.listen')`` is equivalent to
+  ``getLogger('app.network.listen')``.
+
+* The :class:`LoggerAdapter` class gained a :meth:`isEnabledFor` method
+  that takes a *level* and returns whether the underlying logger would
+  process a message of that level of importance.
+
 .. seealso::
 
    :pep:`391` - Dictionary-Based Configuration For Logging
@@ -273,9 +319,9 @@
 
     >>> {1,2,3,4,5}
     set([1, 2, 3, 4, 5])
-    >>> set()
+    >>> set() # empty set
     set([])
-    >>> {}
+    >>> {}    # empty dict
     {}
 
   Backported by Alexandre Vassalotti; :issue:`2335`.
@@ -321,7 +367,7 @@
   :mod:`marshal`, :mod:`pickle`
   and :mod:`json` modules;
   parsing of float and imaginary literals in Python code;
-  and :class:`Decimal`-to-float conversion.
+  and :class:`~decimal.Decimal`-to-float conversion.
 
   Related to this, the :func:`repr` of a floating-point number *x*
   now returns a result based on the shortest decimal string that's
@@ -329,6 +375,8 @@
   round-half-to-even rounding mode).  Previously it gave a string
   based on rounding x to 17 decimal digits.
 
+  .. maybe add an example?
+
   The rounding library responsible for this improvement works on
   Windows, and on Unix platforms using the gcc, icc, or suncc
   compilers.  There may be a small number of platforms where correct
@@ -356,11 +404,12 @@
   of them -- but you can mix auto-numbering and named fields, as in the second
   example above.  (Contributed by Eric Smith; :issue:`5237`.)
 
-  Complex numbers now correctly support usage with :func:`format`.
+  Complex numbers now correctly support usage with :func:`format`,
+  and default to being right-aligned.
   Specifying a precision or comma-separation applies to both the real
   and imaginary parts of the number, but a specified field width and
   alignment is applied to the whole of the resulting ``1.5+3j``
-  output.  (Contributed by Eric Smith; :issue:`1588`.)
+  output.  (Contributed by Eric Smith; :issue:`1588` and :issue:`7988`.)
 
   The 'F' format code now always formats its output using uppercase characters,
   so it will now produce 'INF' and 'NAN'.
@@ -371,7 +420,7 @@
   its argument in binary::
 
       >>> n = 37
-      >>> bin(37)
+      >>> bin(n)
       '0b100101'
       >>> n.bit_length()
       6
@@ -402,8 +451,7 @@
     >>> n = 295147905179352891391
     >>> float(n)
     2.9514790517935289e+20
-    >>> n-long(float(n)
-    ... )
+    >>> n - long(float(n))
     -1L
 
   (Implemented by Mark Dickinson; :issue:`3166`.)
@@ -411,10 +459,16 @@
   Integer division is also more accurate in its rounding behaviours.  (Also
   implemented by Mark Dickinson; :issue:`1811`.)
 
-* The :class:`bytearray` type's :meth:`translate` method now accepts
+* It's now possible for a subclass of the built-in :class:`unicode` type
+  to override the :meth:`__unicode__` method.  (Implemented by
+  Victor Stinner; :issue:`1583863`.)
+
+* The :class:`bytearray` type's :meth:`~bytearray.translate` method now accepts
   ``None`` as its first argument.  (Fixed by Georg Brandl;
   :issue:`4759`.)
 
+  .. bytearray doesn't seem to be documented
+
 * When using ``@classmethod`` and ``@staticmethod`` to wrap
   methods as class or static methods, the wrapper object now
   exposes the wrapped function as their :attr:`__func__` attribute.
@@ -448,6 +502,29 @@
 
 .. ======================================================================
 
+.. _new-27-interpreter:
+
+Interpreter Changes
+-------------------------------
+
+A new environment variable, :envvar:`PYTHONWARNINGS`,
+allows controlling warnings.  It should be set to a string
+containing warning settings, equivalent to those
+used with the :option:`-W` switch, separated by commas.
+(Contributed by Brian Curtin; :issue:`7301`.)
+
+For example, the following setting will print warnings every time
+they occur, but turn warnings from the :mod:`Cookie` module into an
+error.  (The exact syntax for setting an environment variable varies
+across operating systems and shells, so it may be different for you.)
+
+::
+
+  export PYTHONWARNINGS=all,error:::Cookie:0
+
+
+.. ======================================================================
+
 
 Optimizations
 -------------
@@ -473,7 +550,7 @@
   the middle generation has been collected 10 times and when the
   number of survivor objects from the middle generation exceeds 10% of
   the number of objects in the oldest generation.  (Suggested by Martin
-  von Loewis and implemented by Antoine Pitrou; :issue:`4074`.)
+  von Löwis and implemented by Antoine Pitrou; :issue:`4074`.)
 
 * The garbage collector tries to avoid tracking simple containers
   which can't be part of a cycle. In Python 2.7, this is now true for
@@ -495,7 +572,7 @@
 
   Apart from the performance improvements this change should be
   invisible to end users, with one exception: for testing and
-  debugging purposes there's a new structseq ``sys.long_info`` that
+  debugging purposes there's a new structseq :data:`sys.long_info` that
   provides information about the internal format, giving the number of
   bits per digit and the size in bytes of the C type used to store
   each digit::
@@ -561,7 +638,7 @@
 :file:`Misc/NEWS` file in the source tree for a more complete list of
 changes, or look through the Subversion logs for all the details.
 
-* The :mod:`bdb` module's base debugging class :class:`Bdb`
+* The :mod:`bdb` module's base debugging class :class:`~bdb.Bdb`
   gained a feature for skipping modules.  The constructor
   now takes an iterable containing glob-style patterns such as
   ``django.*``; the debugger will not step into stack frames
@@ -573,13 +650,21 @@
   used with :class:`memoryview` instances and other similar buffer objects.
   (Backported from 3.x by Florent Xicluna; :issue:`7703`.)
 
-* The :mod:`bz2` module's :class:`BZ2File` now supports the context
+* Updated module: the :mod:`bsddb` module has been updated from 4.7.2devel9
+  to version 4.8.4 of
+  `the pybsddb package <http://www.jcea.es/programacion/pybsddb.htm>`__.
+  The new version features better Python 3.x compatibility, various bug fixes,
+  and adds several new BerkeleyDB flags and methods.
+  (Updated by Jesús Cea Avión; :issue:`8156`.  The pybsddb
+  changelog can be browsed at http://hg.jcea.es/pybsddb/file/tip/ChangeLog.)
+
+* The :mod:`bz2` module's :class:`~bz2.BZ2File` now supports the context
   management protocol, so you can write ``with bz2.BZ2File(...) as f: ...``.
   (Contributed by Hagen Fuerstenau; :issue:`3860`.)
 
-* New class: the :class:`Counter` class in the :mod:`collections` module is
-  useful for tallying data.  :class:`Counter` instances behave mostly
-  like dictionaries but return zero for missing keys instead of
+* New class: the :class:`~collections.Counter` class in the :mod:`collections`
+  module is useful for tallying data.  :class:`~collections.Counter` instances
+  behave mostly like dictionaries but return zero for missing keys instead of
   raising a :exc:`KeyError`:
 
   .. doctest::
@@ -599,8 +684,9 @@
      >>> c['z']
      0
 
-  There are two additional :class:`Counter` methods: :meth:`most_common`
-  returns the N most common elements and their counts, and :meth:`elements`
+  There are two additional :class:`~collections.Counter` methods:
+  :meth:`~collections.Counter.most_common` returns the N most common elements
+  and their counts, and :meth:`~collections.Counter.elements`
   returns an iterator over the contained element, repeating each element
   as many times as its count::
 
@@ -612,12 +698,14 @@
        'h', 'h', 'm', 'l', 'l', 'o', 'n', 'p', 's',
        's', 's', 'r', 't', 't', 'x'
 
+  .. maybe it's better to use list(c.elements()) here
+
   Contributed by Raymond Hettinger; :issue:`1696199`.
 
-  The new `~collections.OrderedDict` class is described in the earlier section
-  :ref:`pep-0372`.
+  The new :class:`~collections.OrderedDict` class is described in the earlier
+  section :ref:`pep-0372`.
 
-  The :class:`namedtuple` class now has an optional *rename* parameter.
+  The :class:`~collections.namedtuple` class now has an optional *rename* parameter.
   If *rename* is true, field names that are invalid because they've
   been repeated or that aren't legal Python identifiers will be
   renamed to legal names that are derived from the field's
@@ -630,12 +718,15 @@
 
   (Added by Raymond Hettinger; :issue:`1818`.)
 
-  The :class:`deque` data type now exposes its maximum length as the
-  read-only :attr:`maxlen` attribute, and has a
-  :meth:`reverse` method that reverses the elements of the deque in-place.
-  (Added by Raymond Hettinger.)
+  The :class:`~collections.deque` data type now has a
+  :meth:`~collections.deque.count` method that returns the number of
+  contained elements equal to the supplied argument *x*, and a
+  :meth:`~collections.deque.reverse` method that reverses the elements
+  of the deque in-place.  :class:`deque` also exposes its maximum
+  length as the read-only :attr:`~collections.deque.maxlen` attribute.
+  (Both features added by Raymond Hettinger.)
 
-* The :mod:`copy` module's :func:`deepcopy` function will now
+* The :mod:`copy` module's :func:`~copy.deepcopy` function will now
   correctly copy bound instance methods.  (Implemented by
   Robert Collins; :issue:`1515`.)
 
@@ -646,13 +737,13 @@
   3.0.9, containing various fixes for different platforms.  (Updated
   by Matthias Klose; :issue:`8142`.)
 
-* New method: the :mod:`datetime` module's :class:`timedelta` class
-  gained a :meth:`total_seconds` method that returns the number of seconds
-  in the duration.  (Contributed by Brian Quinlan; :issue:`5788`.)
-
-* New method: the :class:`Decimal` class gained a
-  :meth:`from_float` class method that performs an exact conversion
-  of a floating-point number to a :class:`Decimal`.
+* New method: the :mod:`datetime` module's :class:`~datetime.timedelta` class
+  gained a :meth:`~datetime.timedelta.total_seconds` method that returns the
+  number of seconds in the duration.  (Contributed by Brian Quinlan; :issue:`5788`.)
+
+* New method: the :class:`~decimal.Decimal` class gained a
+  :meth:`~decimal.Decimal.from_float` class method that performs an exact
+  conversion of a floating-point number to a :class:`~decimal.Decimal`.
   Note that this is an **exact** conversion that strives for the
   closest decimal approximation to the floating-point representation's value;
   the resulting decimal value will therefore still include the inaccuracy,
@@ -661,32 +752,60 @@
   ``Decimal('0.1000000000000000055511151231257827021181583404541015625')``.
   (Implemented by Raymond Hettinger; :issue:`4796`.)
 
-  The constructor for :class:`Decimal` now accepts non-European
+  Most of the methods of the :class:`~decimal.Context` class now accept integers
+  as well as :class:`~decimal.Decimal` instances; the only exceptions are the
+  :meth:`~decimal.Context.canonical` and :meth:`~decimal.Context.is_canonical`
+  methods.  (Patch by Juan José Conti; :issue:`7633`.)
+
+  The constructor for :class:`~decimal.Decimal` now accepts non-European
   Unicode characters, such as Arabic-Indic digits.  (Contributed by
   Mark Dickinson; :issue:`6595`.)
 
-  When using :class:`Decimal` instances with a string's
-  :meth:`format` method, the default alignment was previously
+  When using :class:`~decimal.Decimal` instances with a string's
+  :meth:`~str.format` method, the default alignment was previously
   left-alignment.  This has been changed to right-alignment, which seems
   more sensible for numeric types.  (Changed by Mark Dickinson; :issue:`6857`.)
 
-* The :class:`Fraction` class now accepts two rational numbers
+* The :class:`~fractions.Fraction` class now accepts two rational numbers
   as arguments to its constructor.
   (Implemented by Mark Dickinson; :issue:`5812`.)
 
-* The :mod:`ftplib` module gained the ability to establish secure FTP
+  An oversight was fixed, making the :class:`Fraction` match the other
+  numeric types; ordering comparisons (``<``, ``<=``, ``>``, ``>=``) between
+  fractions and complex numbers now raise a :exc:`TypeError`.
+
+  .. revision 79455
+
+* New class: a new :class:`~ftplib.FTP_TLS` class in
+  the :mod:`ftplib` module provides secure FTP
   connections using TLS encapsulation of authentication as well as
-  subsequent control and data transfers.  This is provided by the new
-  :class:`ftplib.FTP_TLS` class.
-  (Contributed by Giampaolo Rodola', :issue:`2054`.)  The :meth:`storbinary`
-  method for binary uploads can now restart uploads thanks to an added
-  *rest* parameter (patch by Pablo Mouzo; :issue:`6845`.)
+  subsequent control and data transfers.
+  (Contributed by Giampaolo Rodola', :issue:`2054`.)
+
+  The :meth:`~ftplib.FTP.storbinary` method for binary uploads can now restart
+  uploads thanks to an added *rest* parameter (patch by Pablo Mouzo;
+  :issue:`6845`.)
+
+* New class decorator: :func:`total_ordering` in the :mod:`functools`
+  module takes a class that defines an :meth:`__eq__` method and one of
+  :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, or :meth:`__ge__`,
+  and generates the missing comparison methods.  Since the
+  :meth:`__cmp__` method is being deprecated in Python 3.x,
+  this decorator makes it easier to define ordered classes.
+  (Added by Raymond Hettinger; :issue:`5479`.)
+
+  New function: :func:`cmp_to_key` will take an old-style comparison
+  function that expects two arguments and return a new callable that
+  can be used as the *key* parameter to functions such as
+  :func:`sorted`, :func:`min` and :func:`max`, etc.  The primary
+  intended use is to help with making code compatible with Python 3.x.
+  (Added by Raymond Hettinger.)
 
-* New function: the :mod:`gc` module's :func:`is_tracked` returns
+* New function: the :mod:`gc` module's :func:`~gc.is_tracked` returns
   true if a given instance is tracked by the garbage collector, false
   otherwise. (Contributed by Antoine Pitrou; :issue:`4688`.)
 
-* The :mod:`gzip` module's :class:`GzipFile` now supports the context
+* The :mod:`gzip` module's :class:`~gzip.GzipFile` now supports the context
   management protocol, so you can write ``with gzip.GzipFile(...) as f: ...``
   (contributed by Hagen Fuerstenau; :issue:`3860`), and it now implements
   the :class:`io.BufferedIOBase` ABC, so you can wrap it with
@@ -700,11 +819,17 @@
   :mod:`gzip` module will now consume these trailing bytes.  (Fixed by
   Tadek Pietraszek and Brian Curtin; :issue:`2846`.)
 
-* The default :class:`HTTPResponse` class used by the :mod:`httplib` module now
+* New attribute: the :mod:`hashlib` module now has an :attr:`~hashlib.hashlib.algorithms`
+  attribute containing a tuple naming the supported algorithms.
+  In Python 2.7, ``hashlib.algorithms`` contains
+  ``('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512')``
+  (Contributed by Carl Chenet; :issue:`7418`.)
+
+* The default :class:`~httplib.HTTPResponse` class used by the :mod:`httplib` module now
   supports buffering, resulting in much faster reading of HTTP responses.
   (Contributed by Kristjan Valur Jonsson; :issue:`4879`.)
 
-  The :class:`HTTPConnection` and :class:`HTTPSConnection` classes
+  The :class:`~httplib.HTTPConnection` and :class:`~httplib.HTTPSConnection` classes
   now support a *source_address* parameter, a ``(host, port)`` 2-tuple
   giving the source address that will be used for the connection.
   (Contributed by Eldon Ziegler; :issue:`3972`.)
@@ -712,9 +837,9 @@
 * The :mod:`imaplib` module now supports IPv6 addresses.
   (Contributed by Derek Morr; :issue:`1655`.)
 
-* The :mod:`io` library has been upgraded to the version shipped with
+* Updated module: The :mod:`io` library has been upgraded to the version shipped with
   Python 3.1.  For 3.1, the I/O library was entirely rewritten in C
-  and is 2 to 20 times faster depending on the task at hand.  The
+  and is 2 to 20 times faster depending on the task being performed.  The
   original Python version was renamed to the :mod:`_pyio` module.
 
   One minor resulting change: the :class:`io.TextIOBase` class now
@@ -724,7 +849,7 @@
 
   The :class:`io.FileIO` class now raises an :exc:`OSError` when passed
   an invalid file descriptor.  (Implemented by Benjamin Peterson;
-  :issue:`4991`.)  The :meth:`truncate` method now preserves the
+  :issue:`4991`.)  The :meth:`~io.IOBase.truncate` method now preserves the
   file position; previously it would change the file position to the
   end of the new file.  (Fixed by Pascal Chambon; :issue:`6939`.)
 
@@ -735,9 +860,11 @@
     itertools.compress('ABCDEF', [1,0,1,0,1,1]) =>
       A, C, E, F
 
+  .. maybe here is better to use >>> list(itertools.compress(...)) instead
+
   New function: ``itertools.combinations_with_replacement(iter, r)``
   returns all the possible *r*-length combinations of elements from the
-  iterable *iter*.  Unlike :func:`combinations`, individual elements
+  iterable *iter*.  Unlike :func:`~itertools.combinations`, individual elements
   can be repeated in the generated combinations::
 
     itertools.combinations_with_replacement('abc', 2) =>
@@ -747,10 +874,10 @@
   Note that elements are treated as unique depending on their position
   in the input, not their actual values.
 
-  The :class:`itertools.count` function now has a *step* argument that
-  allows incrementing by values other than 1.  :func:`count` also
+  The :func:`itertools.count` function now has a *step* argument that
+  allows incrementing by values other than 1.  :func:`~itertools.count` also
   now allows keyword arguments, and using non-integer values such as
-  floats or :class:`Decimal` instances.  (Implemented by Raymond
+  floats or :class:`~decimal.Decimal` instances.  (Implemented by Raymond
   Hettinger; :issue:`5032`.)
 
   :func:`itertools.combinations` and :func:`itertools.product` were
@@ -758,22 +885,22 @@
   the input iterable.  This was deemed a specification error, so they
   now return an empty iterator.  (Fixed by Raymond Hettinger; :issue:`4816`.)
 
-* The :mod:`json` module was upgraded to version 2.0.9 of the
+* Updated module: The :mod:`json` module was upgraded to version 2.0.9 of the
   simplejson package, which includes a C extension that makes
   encoding and decoding faster.
   (Contributed by Bob Ippolito; :issue:`4136`.)
 
-  To support the new :class:`OrderedDict` type, :func:`json.load`
+  To support the new :class:`collections.OrderedDict` type, :func:`json.load`
   now has an optional *object_pairs_hook* parameter that will be called
   with any object literal that decodes to a list of pairs.
   (Contributed by Raymond Hettinger; :issue:`5381`.)
 
 * New functions: the :mod:`math` module gained
-  :func:`erf` and :func:`erfc` for the error function and the complementary error function,
-  :func:`expm1` which computes ``e**x - 1`` with more precision than
-  using :func:`exp` and subtracting 1,
-  :func:`gamma` for the Gamma function, and
-  :func:`lgamma` for the natural log of the Gamma function.
+  :func:`~math.erf` and :func:`~math.erfc` for the error function and the complementary error function,
+  :func:`~math.expm1` which computes ``e**x - 1`` with more precision than
+  using :func:`~math.exp` and subtracting 1,
+  :func:`~math.gamma` for the Gamma function, and
+  :func:`~math.lgamma` for the natural log of the Gamma function.
   (Contributed by Mark Dickinson and nirinA raseliarison; :issue:`3366`.)
 
 * The :mod:`multiprocessing` module's :class:`Manager*` classes
@@ -782,10 +909,10 @@
   passed to the callable.
   (Contributed by lekma; :issue:`5585`.)
 
-  The :class:`Pool` class, which controls a pool of worker processes,
+  The :class:`~multiprocessing.Pool` class, which controls a pool of worker processes,
   now has an optional *maxtasksperchild* parameter.  Worker processes
   will perform the specified number of tasks and then exit, causing the
-  :class:`Pool` to start a new worker.  This is useful if tasks may leak
+  :class:`~multiprocessing.Pool` to start a new worker.  This is useful if tasks may leak
   memory or other resources, or if some tasks will cause the worker to
   become very large.
   (Contributed by Charles Cazabon; :issue:`6963`.)
@@ -794,47 +921,50 @@
   (Contributed by Derek Morr; :issue:`1664`.)
 
 * New functions: the :mod:`os` module wraps the following POSIX system
-  calls: :func:`getresgid` and :func:`getresuid`, which return the
+  calls: :func:`~os.getresgid` and :func:`~os.getresuid`, which return the
   real, effective, and saved GIDs and UIDs;
-  :func:`setresgid` and :func:`setresuid`, which set
+  :func:`~os.setresgid` and :func:`~os.setresuid`, which set
   real, effective, and saved GIDs and UIDs to new values;
-  :func:`initgroups`.  (GID/UID functions
+  :func:`~os.initgroups`.  (GID/UID functions
   contributed by Travis H.; :issue:`6508`.  Support for initgroups added
   by Jean-Paul Calderone; :issue:`7333`.)
 
   The :func:`os.fork` function now re-initializes the import lock in
-  the child process; this fixes problems on Solaris when :func:`fork`
+  the child process; this fixes problems on Solaris when :func:`~os.fork`
   is called from a thread.  (Fixed by Zsolt Cserna; :issue:`7242`.)
 
-  The :func:`normpath` function now preserves Unicode; if its input path
+* In the :mod:`os.path` module, the :func:`~os.path.normpath` and
+  :func:`~os.path.abspath` functions now preserve Unicode; if their input path
   is a Unicode string, the return value is also a Unicode string.
-  (Fixed by Matt Giuca; :issue:`5827`.)
+  (:meth:`~os.path.normpath` fixed by Matt Giuca in :issue:`5827`;
+  :meth:`~os.path.abspath` fixed by Ezio Melotti in :issue:`3426`.)
 
 * The :mod:`pydoc` module now has help for the various symbols that Python
   uses.  You can now do ``help('<<')`` or ``help('@')``, for example.
   (Contributed by David Laban; :issue:`4739`.)
 
-* The :mod:`re` module's :func:`split`, :func:`sub`, and :func:`subn`
+* The :mod:`re` module's :func:`~re.split`, :func:`~re.sub`, and :func:`~re.subn`
   now accept an optional *flags* argument, for consistency with the
   other functions in the module.  (Added by Gregory P. Smith.)
 
-* The :mod:`shutil` module's :func:`copyfile` and :func:`copytree`
-  functions now raises a :exc:`SpecialFileError` exception when
+* New function: in the :mod:`shutil` module, :func:`~shutil.make_archive`
+  takes a filename, archive type (zip or tar-format), and a directory
+  path, and creates an archive containing the directory's contents.
+  (Added by Tarek Ziadé.)
+
+  :mod:`shutil`'s :func:`~shutil.copyfile` and :func:`~shutil.copytree`
+  functions now raise a :exc:`~shutil.SpecialFileError` exception when
   asked to copy a named pipe.  Previously the code would treat
   named pipes like a regular file by opening them for reading, and
   this would block indefinitely.  (Fixed by Antoine Pitrou; :issue:`3002`.)
 
-  New function: :func:`make_archive` takes a filename, archive type
-  (zip or tar-format), and a directory path, and creates an archive
-  containing the directory's contents.  (Added by Tarek Ziadé.)
-
 * New functions: in the :mod:`site` module, three new functions
   return various site- and user-specific paths.
-  :func:`getsitepackages` returns a list containing all
+  :func:`~site.getsitepackages` returns a list containing all
   global site-packages directories, and
-  :func:`getusersitepackages` returns the path of the user's
+  :func:`~site.getusersitepackages` returns the path of the user's
   site-packages directory.
-  :func:`getuserbase` returns the value of the :envvar:`USER_BASE`
+  :func:`~site.getuserbase` returns the value of the :envvar:`USER_BASE`
   environment variable, giving the path to a directory that can be used
   to store data.
   (Contributed by Tarek Ziadé; :issue:`6693`.)
@@ -844,32 +974,37 @@
   catch and swallow the :exc:`KeyboardInterrupt` exception.  (Fixed by
   Victor Stinner; :issue:`3137`.)
 
-* The :mod:`socket` module's :class:`SSL` objects now support the
+* The :mod:`socket` module's :class:`~ssl.SSL` objects now support the
   buffer API, which fixed a test suite failure.  (Fixed by Antoine
-  Pitrou; :issue:`7133`.)
+  Pitrou; :issue:`7133`.)  The version of OpenSSL being used is
+  now available as the module attributes
+  :attr:`OPENSSL_VERSION` (a string),
+  :attr:`OPENSSL_VERSION_INFO` (a 5-tuple), and
+  :attr:`OPENSSL_VERSION_NUMBER` (an integer).  (Added by Antoine Pitrou;
+  :issue:`8321`.)
 
-  The :func:`create_connection` function
+  The :func:`~socket.create_connection` function
   gained a *source_address* parameter, a ``(host, port)`` 2-tuple
   giving the source address that will be used for the connection.
   (Contributed by Eldon Ziegler; :issue:`3972`.)
 
-  The :meth:`recv_into` and :meth:`recvfrom_into` methods will now write
-  into objects that support the buffer API, most usefully
+  The :meth:`~socket.socket.recv_into` and :meth:`~socket.socket.recvfrom_into`
+  methods will now write into objects that support the buffer API, most usefully
   the :class:`bytearray` and :class:`memoryview` objects.  (Implemented by
   Antoine Pitrou; :issue:`8104`.)
 
-* The :mod:`SocketServer` module's :class:`TCPServer` class now
-  has a :attr:`disable_nagle_algorithm` class attribute.
+* The :mod:`SocketServer` module's :class:`~SocketServer.TCPServer` class now
+  has a :attr:`~SocketServer.TCPServer.disable_nagle_algorithm` class attribute.
   The default value is False; if overridden to be True,
   new request connections will have the TCP_NODELAY option set to
   prevent buffering many small sends into a single TCP packet.
   (Contributed by Kristjan Valur Jonsson; :issue:`6192`.)
 
-* Updated module: the :mod:`sqlite` module has been updated to
+* Updated module: the :mod:`sqlite3` module has been updated to
   version 2.6.0 of the `pysqlite package <http://code.google.com/p/pysqlite/>`__. Version 2.6.0 includes a number of bugfixes, and adds
   the ability to load SQLite extensions from shared libraries.
   Call the ``enable_load_extension(True)`` method to enable extensions,
-  and then call :meth:`load_extension` to load a particular shared library.
+  and then call :meth:`~sqlite3.Connection.load_extension` to load a particular shared library.
   (Updated by Gerhard Häring.)
 
 * The :mod:`struct` module will no longer silently ignore overflow
@@ -879,9 +1014,9 @@
   :issue:`1523`.)
 
 * New function: the :mod:`subprocess` module's
-  :func:`check_output` runs a command with a specified set of arguments
+  :func:`~subprocess.check_output` runs a command with a specified set of arguments
   and returns the command's output as a string when the command runs without
-  error, or raises a :exc:`CalledProcessError` exception otherwise.
+  error, or raises a :exc:`~subprocess.CalledProcessError` exception otherwise.
 
   ::
 
@@ -895,7 +1030,11 @@
 
   (Contributed by Gregory P. Smith.)
 
-* New function: :func:`is_declared_global` in the :mod:`symtable` module
+  The :mod:`subprocess` module will now retry its internal system calls
+  on receiving an :const:`EINTR` signal.  (Reported by several people; final
+  patch by Gregory P. Smith in :issue:`1068268`.)
+
+* New function: :func:`~symtable.is_declared_global` in the :mod:`symtable` module
   returns true for variables that are explicitly declared to be global,
   false for ones that are implicitly global.
   (Contributed by Jeremy Hylton.)
@@ -919,65 +1058,61 @@
   which raises an exception if there's an error.
   (Changed by Lars Gustäbel; :issue:`7357`.)
 
-  :mod:`tarfile` now supports filtering the :class:`TarInfo`
-  objects being added to a tar file.  When you call :meth:`TarFile.add`,
+  :mod:`tarfile` now supports filtering the :class:`~tarfile.TarInfo`
+  objects being added to a tar file.  When you call :meth:`~tarfile.TarFile.add`,
   instance, you may supply an optional *filter* argument
   that's a callable.  The *filter* callable will be passed the
-  :class:`TarInfo` for every file being added, and can modify and return it.
+  :class:`~tarfile.TarInfo` for every file being added, and can modify and return it.
   If the callable returns ``None``, the file will be excluded from the
   resulting archive.  This is more powerful than the existing
   *exclude* argument, which has therefore been deprecated.
   (Added by Lars Gustäbel; :issue:`6856`.)
-  The :class:`TarFile` class also now supports the context manager protocol.
+  The :class:`~tarfile.TarFile` class also now supports the context manager protocol.
   (Added by Lars Gustäbel; :issue:`7232`.)
 
-* The :mod:`threading` module's :meth:`Event.wait` method now returns
-  the internal flag on exit.  This means the method will usually
-  return true because :meth:`wait` is supposed to block until the
+* The :meth:`~threading.Event.wait` method of the :class:`threading.Event` class
+  now returns the internal flag on exit.  This means the method will usually
+  return true because :meth:`~threading.Event.wait` is supposed to block until the
   internal flag becomes true.  The return value will only be false if
   a timeout was provided and the operation timed out.
   (Contributed by Tim Lesher; :issue:`1674032`.)
 
-* The Unicode database has been updated to the version 5.2.0.
-  (Updated by Florent Xicluna; :issue:`8024`.)
+* The Unicode database provided by the :mod:`unicodedata` module is
+  now used internally to determine which characters are numeric,
+  whitespace, or represent line breaks.  The database also
+  includes information from the :file:`Unihan.txt` data file (patch
+  by Anders Chrigström and Amaury Forgeot d'Arc; :issue:`1571184`)
+  and has been updated to version 5.2.0 (updated by
+  Florent Xicluna; :issue:`8024`).
 
-* The Unicode database provided by the :mod:`unicodedata` is used
-  internally to determine which characters are numeric, whitespace,
-  or represent line breaks.  The database also now includes information
-  from the :file:`Unihan.txt` data file.  (Patch by Anders Chrigström
-  and Amaury Forgeot d'Arc; :issue:`1571184`.)
-
-* The :class:`UserDict` class is now a new-style class.  (Changed by
+* The :class:`~UserDict.UserDict` class is now a new-style class.  (Changed by
   Benjamin Peterson.)
 
 * The ElementTree library, :mod:`xml.etree`, no longer escapes
   ampersands and angle brackets when outputting an XML processing
-  instruction (which looks like `<?xml-stylesheet href="#style1"?>`)
-  or comment (which looks like `<!-- comment -->`).
+  instruction (which looks like ``<?xml-stylesheet href="#style1"?>``)
+  or comment (which looks like ``<!-- comment -->``).
   (Patch by Neil Muller; :issue:`2746`.)
 
-* The :mod:`zipfile` module's :class:`ZipFile` now supports the context
+* The :mod:`zipfile` module's :class:`~zipfile.ZipFile` now supports the context
   management protocol, so you can write ``with zipfile.ZipFile(...) as f: ...``.
   (Contributed by Brian Curtin; :issue:`5511`.)
 
   :mod:`zipfile` now supports archiving empty directories and
   extracts them correctly.  (Fixed by Kuba Wieczorek; :issue:`4710`.)
   Reading files out of an archive is now faster, and interleaving
-  :meth:`read` and :meth:`readline` now works correctly.
+  :meth:`~zipfile.ZipFile.read` and :meth:`~zipfile.ZipFile.readline` now works correctly.
   (Contributed by Nir Aides; :issue:`7610`.)
 
-  The :func:`is_zipfile` function in the module now
+  The :func:`~zipfile.is_zipfile` function now
   accepts a file object, in addition to the path names accepted in earlier
   versions.  (Contributed by Gabriel Genellina; :issue:`4756`.)
 
-  The :meth:`writestr` method now has an optional *compress_type* parameter
+  The :meth:`~zipfile.ZipFile.writestr` method now has an optional *compress_type* parameter
   that lets you override the default compression method specified in the
-  :class:`ZipFile` constructor.  (Contributed by Ronald Oussoren;
+  :class:`~zipfile.ZipFile` constructor.  (Contributed by Ronald Oussoren;
   :issue:`6003`.)
 
-* XXX the :mod:`shutil` module has now a :func:`make_archive` function
-  (see the module doc, contributed by Tarek)
-
 
 New module: sysconfig
 ---------------------------------
@@ -998,55 +1133,6 @@
 .. whole new modules get described in subsections here
 
 
-Distutils Enhancements
----------------------------------
-
-Distutils is being more actively developed, thanks to Tarek Ziadé
-who has taken over maintenance of the package, so there are a number
-of fixes and improvements.
-
-A new :file:`setup.py` subcommand, ``check``, will check that the
-arguments being passed to the :func:`setup` function are complete
-and correct (:issue:`5732`).
-
-Byte-compilation by the ``install_lib``  subcommand is now only done
-if the ``sys.dont_write_bytecode`` setting allows it (:issue:`7071`).
-
-:func:`distutils.sdist.add_defaults` now uses
-*package_dir* and *data_files* to create the MANIFEST file.
-:mod:`distutils.sysconfig` now reads the :envvar:`AR` and
-:envvar:`ARFLAGS` environment variables.
-
-.. ARFLAGS done in #5941
-
-It is no longer mandatory to store clear-text passwords in the
-:file:`.pypirc` file when registering and uploading packages to PyPI. As long
-as the username is present in that file, the :mod:`distutils` package will
-prompt for the password if not present.  (Added by Tarek Ziadé,
-based on an initial contribution by Nathan Van Gheem; :issue:`4394`.)
-
-A Distutils setup can now specify that a C extension is optional by
-setting the *optional* option setting to true.  If this optional is
-supplied, failure to build the extension will not abort the build
-process, but instead simply not install the failing extension.
-(Contributed by Georg Brandl; :issue:`5583`.)
-
-The :class:`distutils.dist.DistributionMetadata` class'
-:meth:`read_pkg_file` method will read the contents of a package's
-:file:`PKG-INFO` metadata file.  For an example of its use, see
-:ref:`reading-metadata`.
-(Contributed by Tarek Ziadé; :issue:`7457`.)
-
-:file:`setup.py` files will now accept a :option:`--no-user-cfg` switch
-to skip reading the :file:`~/.pydistutils.cfg` file.  (Suggested by
-by Michael Hoffman, and implemented by Paul Winkler; :issue:`1180`.)
-
-When creating a tar-format archive, the ``sdist`` subcommand now
-allows specifying the user id and group that will own the files in the
-archives using the :option:`--owner` and :option:`--group` switches
-(:issue:`6516`).
-
-
 Unit Testing Enhancements
 ---------------------------------
 
@@ -1054,111 +1140,135 @@
 The progress messages now shows 'x' for expected failures
 and 'u' for unexpected successes when run in verbose mode.
 (Contributed by Benjamin Peterson.)
-Test cases can raise the :exc:`SkipTest` exception to skip a test.
+Test cases can raise the :exc:`~unittest.SkipTest` exception to skip a test.
 (:issue:`1034053`.)
 
 .. XXX describe test discovery (Contributed by Michael Foord; :issue:`6001`.)
 
-The error messages for :meth:`assertEqual`,
-:meth:`assertTrue`, and :meth:`assertFalse`
+The error messages for :meth:`~unittest.TestCase.assertEqual`,
+:meth:`~unittest.TestCase.assertTrue`, and :meth:`~unittest.TestCase.assertFalse`
 failures now provide more information.  If you set the
-:attr:`longMessage` attribute of your :class:`TestCase` classes to
-true, both the standard error message and any additional message you
+:attr:`~unittest.TestCase.longMessage` attribute of your :class:`~unittest.TestCase` classes to
+True, both the standard error message and any additional message you
 provide will be printed for failures.  (Added by Michael Foord; :issue:`5663`.)
 
-The :meth:`assertRaises` and :meth:`failUnlessRaises` methods now
+The :meth:`~unittest.TestCase.assertRaises` method now
 return a context handler when called without providing a callable
 object to run.  For example, you can write this::
 
   with self.assertRaises(KeyError):
-      raise ValueError
+      {}['foo']
 
 (Implemented by Antoine Pitrou; :issue:`4444`.)
 
-The methods :meth:`addCleanup` and :meth:`doCleanups` were added.
-:meth:`addCleanup` allows you to add cleanup functions that
-will be called unconditionally (after :meth:`setUp` if
-:meth:`setUp` fails, otherwise after :meth:`tearDown`). This allows
-for much simpler resource allocation and deallocation during tests.
-:issue:`5679`
+.. rev 78774
+
+Module- and class-level setup and teardown fixtures are now supported.
+Modules can contain :func:`~unittest.setUpModule` and :func:`~unittest.tearDownModule`
+functions.  Classes can have :meth:`~unittest.TestCase.setUpClass` and
+:meth:`~unittest.TestCase.tearDownClass` methods that must be defined as class methods
+(using ``@classmethod`` or equivalent).  These functions and
+methods are invoked when the test runner switches to a test case in a
+different module or class.
+
+The methods :meth:`~unittest.TestCase.addCleanup` and
+:meth:`~unittest.TestCase.doCleanups` were added.
+:meth:`~unittest.TestCase.addCleanup` allows you to add cleanup functions that
+will be called unconditionally (after :meth:`~unittest.TestCase.setUp` if
+:meth:`~unittest.TestCase.setUp` fails, otherwise after :meth:`~unittest.TestCase.tearDown`). This allows
+for much simpler resource allocation and deallocation during tests
+(:issue:`5679`).
 
 A number of new methods were added that provide more specialized
 tests.  Many of these methods were written by Google engineers
 for use in their test suites; Gregory P. Smith, Michael Foord, and
 GvR worked on merging them into Python's version of :mod:`unittest`.
 
-* :meth:`assertIsNone` and :meth:`assertIsNotNone` take one
+* :meth:`~unittest.TestCase.assertIsNone` and :meth:`~unittest.TestCase.assertIsNotNone` take one
   expression and verify that the result is or is not ``None``.
 
-* :meth:`assertIs` and :meth:`assertIsNot` take two values and check
-  whether the two values evaluate to the same object or not.
+* :meth:`~unittest.TestCase.assertIs` and :meth:`~unittest.TestCase.assertIsNot`
+  take two values and check whether the two values evaluate to the same object or not.
   (Added by Michael Foord; :issue:`2578`.)
 
-* :meth:`assertIsInstance` and :meth:`assertNotIsInstance` check whether
+* :meth:`~unittest.TestCase.assertIsInstance` and
+  :meth:`~unittest.TestCase.assertNotIsInstance` check whether
   the resulting object is an instance of a particular class, or of
   one of a tuple of classes.  (Added by Georg Brandl; :issue:`7031`.)
 
-* :meth:`assertGreater`, :meth:`assertGreaterEqual`,
-  :meth:`assertLess`, and :meth:`assertLessEqual` compare
+* :meth:`~unittest.TestCase.assertGreater`, :meth:`~unittest.TestCase.assertGreaterEqual`,
+  :meth:`~unittest.TestCase.assertLess`, and :meth:`~unittest.TestCase.assertLessEqual` compare
   two quantities.
 
-* :meth:`assertMultiLineEqual` compares two strings, and if they're
+* :meth:`~unittest.TestCase.assertMultiLineEqual` compares two strings, and if they're
   not equal, displays a helpful comparison that highlights the
   differences in the two strings.  This comparison is now used by
-  default when Unicode strings are compared with :meth:`assertEqual`.)
+  default when Unicode strings are compared with :meth:`~unittest.TestCase.assertEqual`.
 
-* :meth:`assertRegexpMatches` checks whether its first argument is a
+* :meth:`~unittest.TestCase.assertRegexpMatches` checks whether its first argument is a
   string matching a regular expression provided as its second argument.
 
-* :meth:`assertRaisesRegexp` checks whether a particular exception
+  .. XXX add assertNotRegexpMatches see issue 8038
+
+* :meth:`~unittest.TestCase.assertRaisesRegexp` checks whether a particular exception
   is raised, and then also checks that the string representation of
   the exception matches the provided regular expression.
 
-* :meth:`assertIn` and :meth:`assertNotIn` tests whether
-  *first* is or is not in  *second*.
+* :meth:`~unittest.TestCase.assertIn` and :meth:`~unittest.TestCase.assertNotIn`
+  tests whether *first* is or is not in  *second*.
 
-* :meth:`assertItemsEqual` tests whether two provided sequences
+* :meth:`~unittest.TestCase.assertItemsEqual` tests whether two provided sequences
   contain the same elements.
 
-* :meth:`assertSetEqual` compares whether two sets are equal, and
+* :meth:`~unittest.TestCase.assertSetEqual` compares whether two sets are equal, and
   only reports the differences between the sets in case of error.
 
-* Similarly, :meth:`assertListEqual` and :meth:`assertTupleEqual`
+* Similarly, :meth:`~unittest.TestCase.assertListEqual` and :meth:`~unittest.TestCase.assertTupleEqual`
   compare the specified types and explain any differences without necessarily
   printing their full values; these methods are now used by default
-  when comparing lists and tuples using :meth:`assertEqual`.
-  More generally, :meth:`assertSequenceEqual` compares two sequences
+  when comparing lists and tuples using :meth:`~unittest.TestCase.assertEqual`.
+  More generally, :meth:`~unittest.TestCase.assertSequenceEqual` compares two sequences
   and can optionally check whether both sequences are of a
   particular type.
 
-* :meth:`assertDictEqual` compares two dictionaries and reports the
+* :meth:`~unittest.TestCase.assertDictEqual` compares two dictionaries and reports the
   differences; it's now used by default when you compare two dictionaries
-  using :meth:`assertEqual`.  :meth:`assertDictContainsSubset` checks whether
+  using :meth:`~unittest.TestCase.assertEqual`.  :meth:`~unittest.TestCase.assertDictContainsSubset` checks whether
   all of the key/value pairs in *first* are found in *second*.
 
-* :meth:`assertAlmostEqual` and :meth:`assertNotAlmostEqual` test
+* :meth:`~unittest.TestCase.assertAlmostEqual` and :meth:`~unittest.TestCase.assertNotAlmostEqual` test
   whether *first* and *second* are approximately equal by computing
   their difference, rounding the result to an optionally-specified number
   of *places* (the default is 7), and comparing to zero.
 
-* :meth:`loadTestsFromName` properly honors the ``suiteClass`` attribute of
-  the :class:`TestLoader`. (Fixed by Mark Roddy; :issue:`6866`.)
-
-* A new hook, :meth:`addTypeEqualityFunc` takes a type object and a
-  function.  The :meth:`assertEqual` method will use the function
-  when both of the objects being compared are of the specified type.
-  This function should compare the two objects and raise an
-  exception if they don't match; it's a good idea for the function
-  to provide additional information about why the two objects are
-  matching, much as the new sequence comparison methods do.
-
-:func:`unittest.main` now takes an optional ``exit`` argument.
-If False ``main`` doesn't call :func:`sys.exit` allowing it to
-be used from the interactive interpreter. :issue:`3379`.
-
-:class:`TestResult` has new :meth:`startTestRun` and
-:meth:`stopTestRun` methods; called immediately before
-and after a test run. :issue:`5728` by Robert Collins.
+* :meth:`~unittest.TestLoader.loadTestsFromName` properly honors the
+  :attr:`~unittest.TestLoader.suiteClass` attribute of
+  the :class:`~unittest.TestLoader`. (Fixed by Mark Roddy; :issue:`6866`.)
+
+* A new hook lets you extend the :meth:`~unittest.TestCase.assertEqual` method to handle
+  new data types.  The :meth:`~unittest.TestCase.addTypeEqualityFunc` method takes a type
+  object and a function. The function will be used when both of the
+  objects being compared are of the specified type.  This function
+  should compare the two objects and raise an exception if they don't
+  match; it's a good idea for the function to provide additional
+  information about why the two objects are matching, much as the new
+  sequence comparison methods do.
+
+:func:`unittest.main` now takes an optional ``exit`` argument.  If
+False, :func:`~unittest.main` doesn't call :func:`sys.exit`, allowing it to be
+used from the interactive interpreter. (Contributed by J. Pablo
+Fernández; :issue:`3379`.)
+
+A new command-line switch, :option:`-f` or :option:`--failfast`, makes
+test execution stop immediately when a test fails instead of
+continuing to execute further tests.  (Suggested by Cliff Dyer and
+implemented by Michael Foord; :issue:`8074`.)
+
+.. XXX document the other new switches
+
+:class:`~unittest.TestResult` has new :meth:`~unittest.TestResult.startTestRun` and
+:meth:`~unittest.TestResult.stopTestRun` methods that are called immediately before
+and after a test run.  (Contributed by Robert Collins; :issue:`5728`.)
 
 With all these changes, the :file:`unittest.py` was becoming awkwardly
 large, so the module was turned into a package and the code split into
@@ -1177,7 +1287,7 @@
 to users who wish to write new importers that can participate in the
 import process.  Python 2.7 doesn't contain the complete
 :mod:`importlib` package, but instead has a tiny subset that contains
-a single function, :func:`import_module`.
+a single function, :func:`~importlib.import_module`.
 
 ``import_module(name, package=None)`` imports a module.  *name* is
 a string containing the module or package's name.  It's possible to do
@@ -1185,7 +1295,7 @@
 character, such as ``..utils.errors``.  For relative imports, the
 *package* argument must be provided and is the name of the package that
 will be used as the anchor for
-the relative import.  :func:`import_module` both inserts the imported
+the relative import.  :func:`~importlib.import_module` both inserts the imported
 module into ``sys.modules`` and returns the module object.
 
 Here are some examples::

Modified: python/branches/py3k-jit/Include/Python.h
==============================================================================
--- python/branches/py3k-jit/Include/Python.h	(original)
+++ python/branches/py3k-jit/Include/Python.h	Fri Apr 16 02:53:03 2010
@@ -123,6 +123,9 @@
 /* _Py_Mangle is defined in compile.c */
 PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
 
+/* _Py_char2wchar lives in python.c */
+PyAPI_FUNC(wchar_t *) _Py_char2wchar(char *);
+
 /* Convert a possibly signed character to a nonnegative int */
 /* XXX This assumes characters are 8 bits wide */
 #ifdef __CHAR_UNSIGNED__

Modified: python/branches/py3k-jit/Include/pythread.h
==============================================================================
--- python/branches/py3k-jit/Include/pythread.h	(original)
+++ python/branches/py3k-jit/Include/pythread.h	Fri Apr 16 02:53:03 2010
@@ -19,6 +19,41 @@
 PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock, int);
 #define WAIT_LOCK	1
 #define NOWAIT_LOCK	0
+
+/* PY_TIMEOUT_T is the integral type used to specify timeouts when waiting
+   on a lock (see PyThread_acquire_lock_timed() below).
+   PY_TIMEOUT_MAX is the highest usable value (in microseconds) of that
+   type, and depends on the system threading API.
+   
+   NOTE: this isn't the same value as `_thread.TIMEOUT_MAX`.  The _thread
+   module exposes a higher-level API, with timeouts expressed in seconds
+   and floating-point numbers allowed.
+*/
+#if defined(HAVE_LONG_LONG)
+#define PY_TIMEOUT_T PY_LONG_LONG
+#define PY_TIMEOUT_MAX PY_LLONG_MAX
+#else
+#define PY_TIMEOUT_T long
+#define PY_TIMEOUT_MAX LONG_MAX
+#endif
+
+/* In the NT API, the timeout is a DWORD and is expressed in milliseconds */
+#if defined (NT_THREADS)
+#if (0xFFFFFFFFLL * 1000 < PY_TIMEOUT_MAX)
+#undef PY_TIMEOUT_MAX
+#define PY_TIMEOUT_MAX (0xFFFFFFFFLL * 1000)
+#endif
+#endif
+
+/* If microseconds == 0, the call is non-blocking: it returns immediately
+   even when the lock can't be acquired.
+   If microseconds > 0, the call waits up to the specified duration.
+   If microseconds < 0, the call waits until success (or abnormal failure)
+   
+   microseconds must be less than PY_TIMEOUT_MAX. Behaviour otherwise is
+   undefined. */
+PyAPI_FUNC(int) PyThread_acquire_lock_timed(PyThread_type_lock,
+					    PY_TIMEOUT_T microseconds);
 PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock);
 
 PyAPI_FUNC(size_t) PyThread_get_stacksize(void);

Modified: python/branches/py3k-jit/LICENSE
==============================================================================
--- python/branches/py3k-jit/LICENSE	(original)
+++ python/branches/py3k-jit/LICENSE	Fri Apr 16 02:53:03 2010
@@ -62,10 +62,12 @@
     2.6.2           2.6.1       2009        PSF         yes
     2.6.3           2.6.2       2009        PSF         yes
     2.6.4           2.6.3       2009        PSF         yes
+    2.6.5           2.6.4       2010        PSF         yes
     3.0             2.6         2008        PSF         yes
     3.0.1           3.0         2009        PSF         yes
     3.1             3.0.1       2009        PSF         yes
     3.1.1           3.1         2009        PSF         yes
+    3.1.2           3.1         2010        PSF         yes
 
 Footnotes:
 

Modified: python/branches/py3k-jit/Lib/_dummy_thread.py
==============================================================================
--- python/branches/py3k-jit/Lib/_dummy_thread.py	(original)
+++ python/branches/py3k-jit/Lib/_dummy_thread.py	Fri Apr 16 02:53:03 2010
@@ -17,6 +17,10 @@
            'interrupt_main', 'LockType']
 
 import traceback as _traceback
+import time
+
+# A dummy value
+TIMEOUT_MAX = 2**31
 
 class error(Exception):
     """Dummy implementation of _thread.error."""
@@ -92,7 +96,7 @@
     def __init__(self):
         self.locked_status = False
 
-    def acquire(self, waitflag=None):
+    def acquire(self, waitflag=None, timeout=-1):
         """Dummy implementation of acquire().
 
         For blocking calls, self.locked_status is automatically set to
@@ -111,6 +115,8 @@
                 self.locked_status = True
                 return True
             else:
+                if timeout > 0:
+                    time.sleep(timeout)
                 return False
 
     __enter__ = acquire

Modified: python/branches/py3k-jit/Lib/collections.py
==============================================================================
--- python/branches/py3k-jit/Lib/collections.py	(original)
+++ python/branches/py3k-jit/Lib/collections.py	Fri Apr 16 02:53:03 2010
@@ -453,12 +453,11 @@
 
         '''
         if iterable is not None:
+            self_get = self.get
             if isinstance(iterable, Mapping):
-                self_get = self.get
                 for elem, count in iterable.items():
                     self[elem] = self_get(elem, 0) - count
             else:
-                self_get = self.get
                 for elem in iterable:
                     self[elem] = self_get(elem, 0) - 1
         if kwds:

Modified: python/branches/py3k-jit/Lib/difflib.py
==============================================================================
--- python/branches/py3k-jit/Lib/difflib.py	(original)
+++ python/branches/py3k-jit/Lib/difflib.py	Fri Apr 16 02:53:03 2010
@@ -1160,18 +1160,18 @@
 
     The unidiff format normally has a header for filenames and modification
     times.  Any or all of these may be specified using strings for
-    'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.  The modification
-    times are normally expressed in the format returned by time.ctime().
+    'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
+    The modification times are normally expressed in the ISO 8601 format.
 
     Example:
 
     >>> for line in unified_diff('one two three four'.split(),
     ...             'zero one tree four'.split(), 'Original', 'Current',
-    ...             'Sat Jan 26 23:30:50 1991', 'Fri Jun 06 10:20:52 2003',
+    ...             '2005-01-26 23:30:50', '2010-04-02 10:20:52',
     ...             lineterm=''):
-    ...     print(line)
-    --- Original Sat Jan 26 23:30:50 1991
-    +++ Current Fri Jun 06 10:20:52 2003
+    ...     print(line)                 # doctest: +NORMALIZE_WHITESPACE
+    --- Original        2005-01-26 23:30:50
+    +++ Current         2010-04-02 10:20:52
     @@ -1,4 +1,4 @@
     +zero
      one
@@ -1184,8 +1184,10 @@
     started = False
     for group in SequenceMatcher(None,a,b).get_grouped_opcodes(n):
         if not started:
-            yield '--- %s %s%s' % (fromfile, fromfiledate, lineterm)
-            yield '+++ %s %s%s' % (tofile, tofiledate, lineterm)
+            fromdate = '\t%s' % fromfiledate if fromfiledate else ''
+            todate = '\t%s' % tofiledate if tofiledate else ''
+            yield '--- %s%s%s' % (fromfile, fromdate, lineterm)
+            yield '+++ %s%s%s' % (tofile, todate, lineterm)
             started = True
         i1, i2, j1, j2 = group[0][1], group[-1][2], group[0][3], group[-1][4]
         yield "@@ -%d,%d +%d,%d @@%s" % (i1+1, i2-i1, j1+1, j2-j1, lineterm)
@@ -1223,17 +1225,16 @@
     The context diff format normally has a header for filenames and
     modification times.  Any or all of these may be specified using
     strings for 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
-    The modification times are normally expressed in the format returned
-    by time.ctime().  If not specified, the strings default to blanks.
+    The modification times are normally expressed in the ISO 8601 format.
+    If not specified, the strings default to blanks.
 
     Example:
 
     >>> print(''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(1),
-    ...       'zero\none\ntree\nfour\n'.splitlines(1), 'Original', 'Current',
-    ...       'Sat Jan 26 23:30:50 1991', 'Fri Jun 06 10:22:46 2003')),
+    ...       'zero\none\ntree\nfour\n'.splitlines(1), 'Original', 'Current')),
     ...       end="")
-    *** Original Sat Jan 26 23:30:50 1991
-    --- Current Fri Jun 06 10:22:46 2003
+    *** Original
+    --- Current
     ***************
     *** 1,4 ****
       one
@@ -1251,8 +1252,10 @@
     prefixmap = {'insert':'+ ', 'delete':'- ', 'replace':'! ', 'equal':'  '}
     for group in SequenceMatcher(None,a,b).get_grouped_opcodes(n):
         if not started:
-            yield '*** %s %s%s' % (fromfile, fromfiledate, lineterm)
-            yield '--- %s %s%s' % (tofile, tofiledate, lineterm)
+            fromdate = '\t%s' % fromfiledate if fromfiledate else ''
+            todate = '\t%s' % tofiledate if tofiledate else ''
+            yield '*** %s%s%s' % (fromfile, fromdate, lineterm)
+            yield '--- %s%s%s' % (tofile, todate, lineterm)
             started = True
 
         yield '***************%s' % (lineterm,)

Modified: python/branches/py3k-jit/Lib/distutils/tests/support.py
==============================================================================
--- python/branches/py3k-jit/Lib/distutils/tests/support.py	(original)
+++ python/branches/py3k-jit/Lib/distutils/tests/support.py	Fri Apr 16 02:53:03 2010
@@ -63,6 +63,8 @@
         super().tearDown()
         while self.tempdirs:
             d = self.tempdirs.pop()
+            if not os.path.exists(d):
+                continue
             shutil.rmtree(d, os.name in ('nt', 'cygwin'))
 
     def mkdtemp(self):

Modified: python/branches/py3k-jit/Lib/email/encoders.py
==============================================================================
--- python/branches/py3k-jit/Lib/email/encoders.py	(original)
+++ python/branches/py3k-jit/Lib/email/encoders.py	Fri Apr 16 02:53:03 2010
@@ -62,7 +62,7 @@
         # iso-2022-* is non-ASCII but still 7-bit
         charset = msg.get_charset()
         output_cset = charset and charset.output_charset
-        if output_cset and output_cset.lower().startswith('iso-2202-'):
+        if output_cset and output_cset.lower().startswith('iso-2022-'):
             msg['Content-Transfer-Encoding'] = '7bit'
         else:
             msg['Content-Transfer-Encoding'] = '8bit'

Modified: python/branches/py3k-jit/Lib/email/message.py
==============================================================================
--- python/branches/py3k-jit/Lib/email/message.py	(original)
+++ python/branches/py3k-jit/Lib/email/message.py	Fri Apr 16 02:53:03 2010
@@ -63,7 +63,7 @@
     while s[:1] == ';':
         s = s[1:]
         end = s.find(';')
-        while end > 0 and s.count('"', 0, end) % 2:
+        while end > 0 and (s.count('"', 0, end) - s.count('\\"', 0, end)) % 2:
             end = s.find(';', end + 1)
         if end < 0:
             end = len(s)

Modified: python/branches/py3k-jit/Lib/email/test/test_email.py
==============================================================================
--- python/branches/py3k-jit/Lib/email/test/test_email.py	(original)
+++ python/branches/py3k-jit/Lib/email/test/test_email.py	Fri Apr 16 02:53:03 2010
@@ -322,6 +322,14 @@
         self.assertEqual(msg.get_param('name', unquote=False),
                          '"Jim&amp;&amp;Jill"')
 
+    def test_get_param_with_quotes(self):
+        msg = email.message_from_string(
+            'Content-Type: foo; bar*0="baz\\"foobar"; bar*1="\\"baz"')
+        self.assertEqual(msg.get_param('bar'), 'baz"foobar"baz')
+        msg = email.message_from_string(
+            "Content-Type: foo; bar*0=\"baz\\\"foobar\"; bar*1=\"\\\"baz\"")
+        self.assertEqual(msg.get_param('bar'), 'baz"foobar"baz')
+
     def test_field_containment(self):
         unless = self.assertTrue
         msg = email.message_from_string('Header: exists')

Modified: python/branches/py3k-jit/Lib/functools.py
==============================================================================
--- python/branches/py3k-jit/Lib/functools.py	(original)
+++ python/branches/py3k-jit/Lib/functools.py	Fri Apr 16 02:53:03 2010
@@ -67,8 +67,9 @@
                    ('__lt__', lambda self, other: not self >= other)]
     }
     roots = set(dir(cls)) & set(convert)
-    assert roots, 'must define at least one ordering operation: < > <= >='
-    root = max(roots)       # prefer __lt __ to __le__ to __gt__ to __ge__
+    if not roots:
+        raise ValueError('must define at least one ordering operation: < > <= >=')
+    root = max(roots)       # prefer __lt__ to __le__ to __gt__ to __ge__
     for opname, opfunc in convert[root]:
         if opname not in roots:
             opfunc.__name__ = opname

Modified: python/branches/py3k-jit/Lib/locale.py
==============================================================================
--- python/branches/py3k-jit/Lib/locale.py	(original)
+++ python/branches/py3k-jit/Lib/locale.py	Fri Apr 16 02:53:03 2010
@@ -710,6 +710,28 @@
 #    updated 'sr_yu.microsoftcp1251 at cyrillic' -> 'sr_YU.CP1251' to 'sr_CS.CP1251'
 #    updated 'sr_yu.utf8 at cyrillic' -> 'sr_YU.UTF-8' to 'sr_CS.UTF-8'
 #    updated 'sr_yu at cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
+#
+# AP 2010-04-12:
+# Updated alias mapping to most recent locale.alias file
+# from X.org distribution using makelocalealias.py.
+#
+# These are the differences compared to the old mapping (Python 2.6.5
+# and older):
+#
+#    updated 'ru' -> 'ru_RU.ISO8859-5' to 'ru_RU.UTF-8'
+#    updated 'ru_ru' -> 'ru_RU.ISO8859-5' to 'ru_RU.UTF-8'
+#    updated 'serbocroatian' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8 at latin'
+#    updated 'sh' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8 at latin'
+#    updated 'sh_yu' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8 at latin'
+#    updated 'sr' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
+#    updated 'sr at cyrillic' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
+#    updated 'sr at latn' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8 at latin'
+#    updated 'sr_cs.utf8 at latn' -> 'sr_CS.UTF-8' to 'sr_RS.UTF-8 at latin'
+#    updated 'sr_cs at latn' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8 at latin'
+#    updated 'sr_yu' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8 at latin'
+#    updated 'sr_yu.utf8 at cyrillic' -> 'sr_CS.UTF-8' to 'sr_RS.UTF-8'
+#    updated 'sr_yu at cyrillic' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
+#
 
 locale_alias = {
     'a3':                                   'a3_AZ.KOI8-C',
@@ -761,13 +783,17 @@
     'ar_ye.iso88596':                       'ar_YE.ISO8859-6',
     'arabic':                               'ar_AA.ISO8859-6',
     'arabic.iso88596':                      'ar_AA.ISO8859-6',
+    'as':                                   'as_IN.UTF-8',
     'az':                                   'az_AZ.ISO8859-9E',
     'az_az':                                'az_AZ.ISO8859-9E',
     'az_az.iso88599e':                      'az_AZ.ISO8859-9E',
     'be':                                   'be_BY.CP1251',
+    'be at latin':                             'be_BY.UTF-8 at latin',
     'be_by':                                'be_BY.CP1251',
     'be_by.cp1251':                         'be_BY.CP1251',
     'be_by.microsoftcp1251':                'be_BY.CP1251',
+    'be_by.utf8 at latin':                     'be_BY.UTF-8 at latin',
+    'be_by at latin':                          'be_BY.UTF-8 at latin',
     'bg':                                   'bg_BG.CP1251',
     'bg_bg':                                'bg_BG.CP1251',
     'bg_bg.cp1251':                         'bg_BG.CP1251',
@@ -797,12 +823,30 @@
     'c_c':                                  'C',
     'c_c.c':                                'C',
     'ca':                                   'ca_ES.ISO8859-1',
+    'ca_ad':                                'ca_AD.ISO8859-1',
+    'ca_ad.iso88591':                       'ca_AD.ISO8859-1',
+    'ca_ad.iso885915':                      'ca_AD.ISO8859-15',
+    'ca_ad.iso885915 at euro':                 'ca_AD.ISO8859-15',
+    'ca_ad.utf8 at euro':                      'ca_AD.UTF-8',
+    'ca_ad at euro':                           'ca_AD.ISO8859-15',
     'ca_es':                                'ca_ES.ISO8859-1',
     'ca_es.iso88591':                       'ca_ES.ISO8859-1',
     'ca_es.iso885915':                      'ca_ES.ISO8859-15',
     'ca_es.iso885915 at euro':                 'ca_ES.ISO8859-15',
     'ca_es.utf8 at euro':                      'ca_ES.UTF-8',
     'ca_es at euro':                           'ca_ES.ISO8859-15',
+    'ca_fr':                                'ca_FR.ISO8859-1',
+    'ca_fr.iso88591':                       'ca_FR.ISO8859-1',
+    'ca_fr.iso885915':                      'ca_FR.ISO8859-15',
+    'ca_fr.iso885915 at euro':                 'ca_FR.ISO8859-15',
+    'ca_fr.utf8 at euro':                      'ca_FR.UTF-8',
+    'ca_fr at euro':                           'ca_FR.ISO8859-15',
+    'ca_it':                                'ca_IT.ISO8859-1',
+    'ca_it.iso88591':                       'ca_IT.ISO8859-1',
+    'ca_it.iso885915':                      'ca_IT.ISO8859-15',
+    'ca_it.iso885915 at euro':                 'ca_IT.ISO8859-15',
+    'ca_it.utf8 at euro':                      'ca_IT.UTF-8',
+    'ca_it at euro':                           'ca_IT.ISO8859-15',
     'catalan':                              'ca_ES.ISO8859-1',
     'cextend':                              'en_US.ISO8859-1',
     'cextend.en':                           'en_US.ISO8859-1',
@@ -824,6 +868,7 @@
     'cz_cz':                                'cs_CZ.ISO8859-2',
     'czech':                                'cs_CZ.ISO8859-2',
     'da':                                   'da_DK.ISO8859-1',
+    'da.iso885915':                         'da_DK.ISO8859-15',
     'da_dk':                                'da_DK.ISO8859-1',
     'da_dk.88591':                          'da_DK.ISO8859-1',
     'da_dk.885915':                         'da_DK.ISO8859-15',
@@ -834,6 +879,7 @@
     'danish.iso88591':                      'da_DK.ISO8859-1',
     'dansk':                                'da_DK.ISO8859-1',
     'de':                                   'de_DE.ISO8859-1',
+    'de.iso885915':                         'de_DE.ISO8859-15',
     'de_at':                                'de_AT.ISO8859-1',
     'de_at.iso88591':                       'de_AT.ISO8859-1',
     'de_at.iso885915':                      'de_AT.ISO8859-15',
@@ -1015,6 +1061,7 @@
     'fa_ir':                                'fa_IR.UTF-8',
     'fa_ir.isiri3342':                      'fa_IR.ISIRI-3342',
     'fi':                                   'fi_FI.ISO8859-15',
+    'fi.iso885915':                         'fi_FI.ISO8859-15',
     'fi_fi':                                'fi_FI.ISO8859-15',
     'fi_fi.88591':                          'fi_FI.ISO8859-1',
     'fi_fi.iso88591':                       'fi_FI.ISO8859-1',
@@ -1030,6 +1077,7 @@
     'fo_fo.iso885915':                      'fo_FO.ISO8859-15',
     'fo_fo at euro':                           'fo_FO.ISO8859-15',
     'fr':                                   'fr_FR.ISO8859-1',
+    'fr.iso885915':                         'fr_FR.ISO8859-15',
     'fr_be':                                'fr_BE.ISO8859-1',
     'fr_be.88591':                          'fr_BE.ISO8859-1',
     'fr_be.iso88591':                       'fr_BE.ISO8859-1',
@@ -1116,6 +1164,7 @@
     'hi':                                   'hi_IN.ISCII-DEV',
     'hi_in':                                'hi_IN.ISCII-DEV',
     'hi_in.isciidev':                       'hi_IN.ISCII-DEV',
+    'hne':                                  'hne_IN.UTF-8',
     'hr':                                   'hr_HR.ISO8859-2',
     'hr_hr':                                'hr_HR.ISO8859-2',
     'hr_hr.iso88592':                       'hr_HR.ISO8859-2',
@@ -1142,6 +1191,7 @@
     'iso_8859_1':                           'en_US.ISO8859-1',
     'iso_8859_15':                          'en_US.ISO8859-15',
     'it':                                   'it_IT.ISO8859-1',
+    'it.iso885915':                         'it_IT.ISO8859-15',
     'it_ch':                                'it_CH.ISO8859-1',
     'it_ch.iso88591':                       'it_CH.ISO8859-1',
     'it_ch.iso885915':                      'it_CH.ISO8859-15',
@@ -1173,6 +1223,7 @@
     'ja_jp.jis':                            'ja_JP.JIS7',
     'ja_jp.jis7':                           'ja_JP.JIS7',
     'ja_jp.mscode':                         'ja_JP.SJIS',
+    'ja_jp.pck':                            'ja_JP.SJIS',
     'ja_jp.sjis':                           'ja_JP.SJIS',
     'ja_jp.ujis':                           'ja_JP.eucJP',
     'japan':                                'ja_JP.eucJP',
@@ -1192,6 +1243,7 @@
     'kl_gl.iso885915':                      'kl_GL.ISO8859-15',
     'kl_gl at euro':                           'kl_GL.ISO8859-15',
     'km_kh':                                'km_KH.UTF-8',
+    'kn':                                   'kn_IN.UTF-8',
     'kn_in':                                'kn_IN.UTF-8',
     'ko':                                   'ko_KR.eucKR',
     'ko_kr':                                'ko_KR.eucKR',
@@ -1199,6 +1251,8 @@
     'ko_kr.euckr':                          'ko_KR.eucKR',
     'korean':                               'ko_KR.eucKR',
     'korean.euc':                           'ko_KR.eucKR',
+    'ks':                                   'ks_IN.UTF-8',
+    'ks_in at devanagari':                     'ks_IN at devanagari.UTF-8',
     'kw':                                   'kw_GB.ISO8859-1',
     'kw_gb':                                'kw_GB.ISO8859-1',
     'kw_gb.iso88591':                       'kw_GB.ISO8859-1',
@@ -1221,6 +1275,7 @@
     'lv_lv':                                'lv_LV.ISO8859-13',
     'lv_lv.iso885913':                      'lv_LV.ISO8859-13',
     'lv_lv.iso88594':                       'lv_LV.ISO8859-4',
+    'mai':                                  'mai_IN.UTF-8',
     'mi':                                   'mi_NZ.ISO8859-1',
     'mi_nz':                                'mi_NZ.ISO8859-1',
     'mi_nz.iso88591':                       'mi_NZ.ISO8859-1',
@@ -1229,6 +1284,8 @@
     'mk_mk.cp1251':                         'mk_MK.CP1251',
     'mk_mk.iso88595':                       'mk_MK.ISO8859-5',
     'mk_mk.microsoftcp1251':                'mk_MK.CP1251',
+    'ml':                                   'ml_IN.UTF-8',
+    'mr':                                   'mr_IN.UTF-8',
     'mr_in':                                'mr_IN.UTF-8',
     'ms':                                   'ms_MY.ISO8859-1',
     'ms_my':                                'ms_MY.ISO8859-1',
@@ -1243,6 +1300,7 @@
     'nb_no.iso885915':                      'nb_NO.ISO8859-15',
     'nb_no at euro':                           'nb_NO.ISO8859-15',
     'nl':                                   'nl_NL.ISO8859-1',
+    'nl.iso885915':                         'nl_NL.ISO8859-15',
     'nl_be':                                'nl_BE.ISO8859-1',
     'nl_be.88591':                          'nl_BE.ISO8859-1',
     'nl_be.iso88591':                       'nl_BE.ISO8859-1',
@@ -1269,6 +1327,8 @@
     'no_no.88591':                          'no_NO.ISO8859-1',
     'no_no.iso88591':                       'no_NO.ISO8859-1',
     'no_no.iso885915':                      'no_NO.ISO8859-15',
+    'no_no.iso88591 at bokmal':                'no_NO.ISO8859-1',
+    'no_no.iso88591 at nynorsk':               'no_NO.ISO8859-1',
     'no_no at euro':                           'no_NO.ISO8859-15',
     'norwegian':                            'no_NO.ISO8859-1',
     'norwegian.iso88591':                   'no_NO.ISO8859-1',
@@ -1290,6 +1350,8 @@
     'oc_fr.iso88591':                       'oc_FR.ISO8859-1',
     'oc_fr.iso885915':                      'oc_FR.ISO8859-15',
     'oc_fr at euro':                           'oc_FR.ISO8859-15',
+    'or':                                   'or_IN.UTF-8',
+    'pa':                                   'pa_IN.UTF-8',
     'pa_in':                                'pa_IN.UTF-8',
     'pd':                                   'pd_US.ISO8859-1',
     'pd_de':                                'pd_DE.ISO8859-1',
@@ -1317,6 +1379,7 @@
     'pp_an':                                'pp_AN.ISO8859-1',
     'pp_an.iso88591':                       'pp_AN.ISO8859-1',
     'pt':                                   'pt_PT.ISO8859-1',
+    'pt.iso885915':                         'pt_PT.ISO8859-15',
     'pt_br':                                'pt_BR.ISO8859-1',
     'pt_br.88591':                          'pt_BR.ISO8859-1',
     'pt_br.iso88591':                       'pt_BR.ISO8859-1',
@@ -1333,8 +1396,9 @@
     'ro_ro':                                'ro_RO.ISO8859-2',
     'ro_ro.iso88592':                       'ro_RO.ISO8859-2',
     'romanian':                             'ro_RO.ISO8859-2',
-    'ru':                                   'ru_RU.ISO8859-5',
-    'ru_ru':                                'ru_RU.ISO8859-5',
+    'ru':                                   'ru_RU.UTF-8',
+    'ru.koi8r':                             'ru_RU.KOI8-R',
+    'ru_ru':                                'ru_RU.UTF-8',
     'ru_ru.cp1251':                         'ru_RU.CP1251',
     'ru_ru.iso88595':                       'ru_RU.ISO8859-5',
     'ru_ru.koi8r':                          'ru_RU.KOI8-R',
@@ -1348,13 +1412,15 @@
     'rw':                                   'rw_RW.ISO8859-1',
     'rw_rw':                                'rw_RW.ISO8859-1',
     'rw_rw.iso88591':                       'rw_RW.ISO8859-1',
+    'sd':                                   'sd_IN at devanagari.UTF-8',
     'se_no':                                'se_NO.UTF-8',
-    'serbocroatian':                        'sr_CS.ISO8859-2',
-    'sh':                                   'sr_CS.ISO8859-2',
+    'serbocroatian':                        'sr_RS.UTF-8 at latin',
+    'sh':                                   'sr_RS.UTF-8 at latin',
+    'sh_ba.iso88592 at bosnia':                'sr_CS.ISO8859-2',
     'sh_hr':                                'sh_HR.ISO8859-2',
     'sh_hr.iso88592':                       'hr_HR.ISO8859-2',
     'sh_sp':                                'sr_CS.ISO8859-2',
-    'sh_yu':                                'sr_CS.ISO8859-2',
+    'sh_yu':                                'sr_RS.UTF-8 at latin',
     'si':                                   'si_LK.UTF-8',
     'si_lk':                                'si_LK.UTF-8',
     'sinhala':                              'si_LK.UTF-8',
@@ -1377,23 +1443,30 @@
     'sq':                                   'sq_AL.ISO8859-2',
     'sq_al':                                'sq_AL.ISO8859-2',
     'sq_al.iso88592':                       'sq_AL.ISO8859-2',
-    'sr':                                   'sr_CS.ISO8859-5',
-    'sr at cyrillic':                          'sr_CS.ISO8859-5',
-    'sr at latn':                              'sr_CS.ISO8859-2',
+    'sr':                                   'sr_RS.UTF-8',
+    'sr at cyrillic':                          'sr_RS.UTF-8',
+    'sr at latin':                             'sr_RS.UTF-8 at latin',
+    'sr at latn':                              'sr_RS.UTF-8 at latin',
+    'sr_cs':                                'sr_RS.UTF-8',
     'sr_cs.iso88592':                       'sr_CS.ISO8859-2',
     'sr_cs.iso88592 at latn':                  'sr_CS.ISO8859-2',
     'sr_cs.iso88595':                       'sr_CS.ISO8859-5',
-    'sr_cs.utf8 at latn':                      'sr_CS.UTF-8',
-    'sr_cs at latn':                           'sr_CS.ISO8859-2',
+    'sr_cs.utf8 at latn':                      'sr_RS.UTF-8 at latin',
+    'sr_cs at latn':                           'sr_RS.UTF-8 at latin',
+    'sr_me':                                'sr_ME.UTF-8',
+    'sr_rs':                                'sr_RS.UTF-8',
+    'sr_rs.utf8 at latn':                      'sr_RS.UTF-8 at latin',
+    'sr_rs at latin':                          'sr_RS.UTF-8 at latin',
+    'sr_rs at latn':                           'sr_RS.UTF-8 at latin',
     'sr_sp':                                'sr_CS.ISO8859-2',
-    'sr_yu':                                'sr_CS.ISO8859-5',
+    'sr_yu':                                'sr_RS.UTF-8 at latin',
     'sr_yu.cp1251 at cyrillic':                'sr_CS.CP1251',
     'sr_yu.iso88592':                       'sr_CS.ISO8859-2',
     'sr_yu.iso88595':                       'sr_CS.ISO8859-5',
     'sr_yu.iso88595 at cyrillic':              'sr_CS.ISO8859-5',
     'sr_yu.microsoftcp1251 at cyrillic':       'sr_CS.CP1251',
-    'sr_yu.utf8 at cyrillic':                  'sr_CS.UTF-8',
-    'sr_yu at cyrillic':                       'sr_CS.ISO8859-5',
+    'sr_yu.utf8 at cyrillic':                  'sr_RS.UTF-8',
+    'sr_yu at cyrillic':                       'sr_RS.UTF-8',
     'ss':                                   'ss_ZA.ISO8859-1',
     'ss_za':                                'ss_ZA.ISO8859-1',
     'ss_za.iso88591':                       'ss_ZA.ISO8859-1',
@@ -1401,6 +1474,7 @@
     'st_za':                                'st_ZA.ISO8859-1',
     'st_za.iso88591':                       'st_ZA.ISO8859-1',
     'sv':                                   'sv_SE.ISO8859-1',
+    'sv.iso885915':                         'sv_SE.ISO8859-15',
     'sv_fi':                                'sv_FI.ISO8859-1',
     'sv_fi.iso88591':                       'sv_FI.ISO8859-1',
     'sv_fi.iso885915':                      'sv_FI.ISO8859-15',
@@ -1418,6 +1492,7 @@
     'ta_in':                                'ta_IN.TSCII-0',
     'ta_in.tscii':                          'ta_IN.TSCII-0',
     'ta_in.tscii0':                         'ta_IN.TSCII-0',
+    'te':                                   'te_IN.UTF-8',
     'tg':                                   'tg_TJ.KOI8-C',
     'tg_tj':                                'tg_TJ.KOI8-C',
     'tg_tj.koi8c':                          'tg_TJ.KOI8-C',
@@ -1493,6 +1568,7 @@
     'zh_cn.gbk':                            'zh_CN.gbk',
     'zh_hk':                                'zh_HK.big5hkscs',
     'zh_hk.big5':                           'zh_HK.big5',
+    'zh_hk.big5hk':                         'zh_HK.big5hkscs',
     'zh_hk.big5hkscs':                      'zh_HK.big5hkscs',
     'zh_tw':                                'zh_TW.big5',
     'zh_tw.big5':                           'zh_TW.big5',

Modified: python/branches/py3k-jit/Lib/logging/__init__.py
==============================================================================
--- python/branches/py3k-jit/Lib/logging/__init__.py	(original)
+++ python/branches/py3k-jit/Lib/logging/__init__.py	Fri Apr 16 02:53:03 2010
@@ -285,10 +285,18 @@
             self.threadName = None
         if not logMultiprocessing:
             self.processName = None
-        elif 'multiprocessing' not in sys.modules:
-            self.processName = 'MainProcess'
         else:
-            self.processName = sys.modules['multiprocessing'].current_process().name
+            self.processName = 'MainProcess'
+            mp = sys.modules.get('multiprocessing')
+            if mp is not None:
+                # Errors may occur if multiprocessing has not finished loading
+                # yet - e.g. if a custom import hook causes third-party code
+                # to run when multiprocessing calls import. See issue 8200
+                # for an example
+                try:
+                    self.processName = mp.current_process().name
+                except StandardError:
+                    pass
         if logProcesses and hasattr(os, 'getpid'):
             self.process = os.getpid()
         else:
@@ -1306,6 +1314,25 @@
             return 0
         return level >= self.getEffectiveLevel()
 
+    def getChild(self, suffix):
+        """
+        Get a logger which is a descendant to this one.
+
+        This is a convenience method, such that
+
+        logging.getLogger('abc').getChild('def.ghi')
+
+        is the same as
+
+        logging.getLogger('abc.def.ghi')
+
+        It's useful, for example, when the parent logger is named using
+        __name__ rather than a literal string.
+        """
+        if self.root is not self:
+            suffix = '.'.join((self.name, suffix))
+        return self.manager.getLogger(suffix)
+
 class RootLogger(Logger):
     """
     A root logger is not that different to any other logger, except that
@@ -1410,6 +1437,12 @@
         msg, kwargs = self.process(msg, kwargs)
         self.logger.log(level, msg, *args, **kwargs)
 
+    def isEnabledFor(self, level):
+        """
+        See if the underlying logger is enabled for the specified level.
+        """
+        return self.logger.isEnabledFor(level)
+
 root = RootLogger(WARNING)
 Logger.root = root
 Logger.manager = Manager(Logger.root)

Modified: python/branches/py3k-jit/Lib/logging/config.py
==============================================================================
--- python/branches/py3k-jit/Lib/logging/config.py	(original)
+++ python/branches/py3k-jit/Lib/logging/config.py	Fri Apr 16 02:53:03 2010
@@ -98,6 +98,9 @@
 def _strip_spaces(alist):
     return map(lambda x: x.strip(), alist)
 
+def _encoded(s):
+    return s if isinstance(s, str) else s.encode('utf-8')
+
 def _create_formatters(cp):
     """Create and return formatters"""
     flist = cp.get("formatters", "keys")
@@ -208,7 +211,7 @@
     #avoid disabling child loggers of explicitly
     #named loggers. With a sorted list it is easier
     #to find the child loggers.
-    existing.sort()
+    existing.sort(key=_encoded)
     #We'll keep the list of existing loggers
     #which are children of named loggers here...
     child_loggers = []
@@ -579,7 +582,7 @@
                 #avoid disabling child loggers of explicitly
                 #named loggers. With a sorted list it is easier
                 #to find the child loggers.
-                existing.sort()
+                existing.sort(key=_encoded)
                 #We'll keep the list of existing loggers
                 #which are children of named loggers here...
                 child_loggers = []

Modified: python/branches/py3k-jit/Lib/logging/handlers.py
==============================================================================
--- python/branches/py3k-jit/Lib/logging/handlers.py	(original)
+++ python/branches/py3k-jit/Lib/logging/handlers.py	Fri Apr 16 02:53:03 2010
@@ -633,7 +633,8 @@
     LOG_NEWS      = 7       #  network news subsystem
     LOG_UUCP      = 8       #  UUCP subsystem
     LOG_CRON      = 9       #  clock daemon
-    LOG_AUTHPRIV  = 10  #  security/authorization messages (private)
+    LOG_AUTHPRIV  = 10      #  security/authorization messages (private)
+    LOG_FTP       = 11      #  FTP daemon
 
     #  other codes through 15 reserved for system use
     LOG_LOCAL0    = 16      #  reserved for local use
@@ -665,6 +666,7 @@
         "authpriv": LOG_AUTHPRIV,
         "cron":     LOG_CRON,
         "daemon":   LOG_DAEMON,
+        "ftp":      LOG_FTP,
         "kern":     LOG_KERN,
         "lpr":      LOG_LPR,
         "mail":     LOG_MAIL,

Modified: python/branches/py3k-jit/Lib/multiprocessing/pool.py
==============================================================================
--- python/branches/py3k-jit/Lib/multiprocessing/pool.py	(original)
+++ python/branches/py3k-jit/Lib/multiprocessing/pool.py	Fri Apr 16 02:53:03 2010
@@ -440,10 +440,10 @@
                     p.terminate()
 
         debug('joining task handler')
-        task_handler.join(1e100)
+        task_handler.join()
 
         debug('joining result handler')
-        result_handler.join(1e100)
+        task_handler.join()
 
         if pool and hasattr(pool[0], 'terminate'):
             debug('joining pool workers')

Modified: python/branches/py3k-jit/Lib/pickle.py
==============================================================================
--- python/branches/py3k-jit/Lib/pickle.py	(original)
+++ python/branches/py3k-jit/Lib/pickle.py	Fri Apr 16 02:53:03 2010
@@ -499,7 +499,7 @@
 
     def save_str(self, obj, pack=struct.pack):
         if self.bin:
-            encoded = obj.encode('utf-8')
+            encoded = obj.encode('utf-8', 'surrogatepass')
             n = len(encoded)
             self.write(BINUNICODE + pack("<i", n) + encoded)
         else:
@@ -966,7 +966,7 @@
 
     def load_binunicode(self):
         len = mloads(b'i' + self.read(4))
-        self.append(str(self.read(len), 'utf-8'))
+        self.append(str(self.read(len), 'utf-8', 'surrogatepass'))
     dispatch[BINUNICODE[0]] = load_binunicode
 
     def load_short_binstring(self):

Modified: python/branches/py3k-jit/Lib/pickletools.py
==============================================================================
--- python/branches/py3k-jit/Lib/pickletools.py	(original)
+++ python/branches/py3k-jit/Lib/pickletools.py	Fri Apr 16 02:53:03 2010
@@ -469,7 +469,7 @@
         raise ValueError("unicodestring4 byte count < 0: %d" % n)
     data = f.read(n)
     if len(data) == n:
-        return str(data, 'utf-8')
+        return str(data, 'utf-8', 'surrogatepass')
     raise ValueError("expected %d bytes in a unicodestring4, but only %d "
                      "remain" % (n, len(data)))
 

Modified: python/branches/py3k-jit/Lib/site.py
==============================================================================
--- python/branches/py3k-jit/Lib/site.py	(original)
+++ python/branches/py3k-jit/Lib/site.py	Fri Apr 16 02:53:03 2010
@@ -318,8 +318,10 @@
 
 
 def setquit():
-    """Define new built-ins 'quit' and 'exit'.
-    These are simply strings that display a hint on how to exit.
+    """Define new builtins 'quit' and 'exit'.
+
+    These are objects which make the interpreter exit when called.
+    The repr of each object contains a hint at how it works.
 
     """
     if os.sep == ':':
@@ -431,7 +433,7 @@
 
 
 class _Helper(object):
-    """Define the built-in 'help'.
+    """Define the builtin 'help'.
     This is a wrapper around pydoc.help (with a twist).
 
     """

Modified: python/branches/py3k-jit/Lib/subprocess.py
==============================================================================
--- python/branches/py3k-jit/Lib/subprocess.py	(original)
+++ python/branches/py3k-jit/Lib/subprocess.py	Fri Apr 16 02:53:03 2010
@@ -980,6 +980,10 @@
             """
             if sig == signal.SIGTERM:
                 self.terminate()
+            elif sig == signal.CTRL_C_EVENT:
+                os.kill(self.pid, signal.CTRL_C_EVENT)
+            elif sig == signal.CTRL_BREAK_EVENT:
+                os.kill(self.pid, signal.CTRL_BREAK_EVENT)
             else:
                 raise ValueError("Only SIGTERM is supported on Windows")
 

Modified: python/branches/py3k-jit/Lib/test/lock_tests.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/lock_tests.py	(original)
+++ python/branches/py3k-jit/Lib/test/lock_tests.py	Fri Apr 16 02:53:03 2010
@@ -4,7 +4,7 @@
 
 import sys
 import time
-from _thread import start_new_thread, get_ident
+from _thread import start_new_thread, get_ident, TIMEOUT_MAX
 import threading
 import unittest
 
@@ -62,6 +62,14 @@
         support.threading_cleanup(*self._threads)
         support.reap_children()
 
+    def assertTimeout(self, actual, expected):
+        # The waiting and/or time.time() can be imprecise, which
+        # is why comparing to the expected value would sometimes fail
+        # (especially under Windows).
+        self.assertGreaterEqual(actual, expected * 0.6)
+        # Test nothing insane happened
+        self.assertLess(actual, expected * 10.0)
+
 
 class BaseLockTests(BaseTestCase):
     """
@@ -143,6 +151,32 @@
         Bunch(f, 15).wait_for_finished()
         self.assertEqual(n, len(threading.enumerate()))
 
+    def test_timeout(self):
+        lock = self.locktype()
+        # Can't set timeout if not blocking
+        self.assertRaises(ValueError, lock.acquire, 0, 1)
+        # Invalid timeout values
+        self.assertRaises(ValueError, lock.acquire, timeout=-100)
+        self.assertRaises(OverflowError, lock.acquire, timeout=1e100)
+        self.assertRaises(OverflowError, lock.acquire, timeout=TIMEOUT_MAX + 1)
+        # TIMEOUT_MAX is ok
+        lock.acquire(timeout=TIMEOUT_MAX)
+        lock.release()
+        t1 = time.time()
+        self.assertTrue(lock.acquire(timeout=5))
+        t2 = time.time()
+        # Just a sanity test that it didn't actually wait for the timeout.
+        self.assertLess(t2 - t1, 5)
+        results = []
+        def f():
+            t1 = time.time()
+            results.append(lock.acquire(timeout=0.5))
+            t2 = time.time()
+            results.append(t2 - t1)
+        Bunch(f, 1).wait_for_finished()
+        self.assertFalse(results[0])
+        self.assertTimeout(results[1], 0.5)
+
 
 class LockTests(BaseLockTests):
     """
@@ -284,14 +318,14 @@
         def f():
             results1.append(evt.wait(0.0))
             t1 = time.time()
-            r = evt.wait(0.2)
+            r = evt.wait(0.5)
             t2 = time.time()
             results2.append((r, t2 - t1))
         Bunch(f, N).wait_for_finished()
         self.assertEqual(results1, [False] * N)
         for r, dt in results2:
             self.assertFalse(r)
-            self.assertTrue(dt >= 0.2, dt)
+            self.assertTimeout(dt, 0.5)
         # The event is set
         results1 = []
         results2 = []
@@ -397,14 +431,14 @@
         def f():
             cond.acquire()
             t1 = time.time()
-            cond.wait(0.2)
+            cond.wait(0.5)
             t2 = time.time()
             cond.release()
             results.append(t2 - t1)
         Bunch(f, N).wait_for_finished()
         self.assertEqual(len(results), 5)
         for dt in results:
-            self.assertTrue(dt >= 0.2, dt)
+            self.assertTimeout(dt, 0.5)
 
 
 class BaseSemaphoreTests(BaseTestCase):

Modified: python/branches/py3k-jit/Lib/test/pickletester.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/pickletester.py	(original)
+++ python/branches/py3k-jit/Lib/test/pickletester.py	Fri Apr 16 02:53:03 2010
@@ -515,7 +515,9 @@
 
     def test_unicode(self):
         endcases = ['', '<\\u>', '<\\\u1234>', '<\n>',
-                    '<\\>', '<\\\U00012345>']
+                    '<\\>', '<\\\U00012345>',
+                    # surrogates
+                    '<\udc80>']
         for proto in protocols:
             for u in endcases:
                 p = self.dumps(u, proto)

Modified: python/branches/py3k-jit/Lib/test/regrtest.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/regrtest.py	(original)
+++ python/branches/py3k-jit/Lib/test/regrtest.py	Fri Apr 16 02:53:03 2010
@@ -880,6 +880,10 @@
                   testdir=None, huntrleaks=False, debug=False):
     support.unload(test)
     testdir = findtestdir(testdir)
+    if verbose:
+        capture_stdout = None
+    else:
+        capture_stdout = io.StringIO()
 
     test_time = 0.0
     refleak = False  # True if the test leaked references.

Modified: python/branches/py3k-jit/Lib/test/support.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/support.py	(original)
+++ python/branches/py3k-jit/Lib/test/support.py	Fri Apr 16 02:53:03 2010
@@ -17,6 +17,7 @@
 import importlib
 import collections
 import re
+import time
 
 __all__ = ["Error", "TestFailed", "ResourceDenied", "import_module",
            "verbose", "use_resources", "max_memuse", "record_original_stdout",
@@ -750,6 +751,8 @@
     objects to disappear.
     """
     gc.collect()
+    if is_jython:
+        time.sleep(0.1)
     gc.collect()
     gc.collect()
 
@@ -1064,7 +1067,6 @@
 
 def threading_cleanup(nb_threads):
     import _thread
-    import time
 
     _MAX_COUNT = 10
     for count in range(_MAX_COUNT):

Modified: python/branches/py3k-jit/Lib/test/test_argparse.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/test_argparse.py	(original)
+++ python/branches/py3k-jit/Lib/test/test_argparse.py	Fri Apr 16 02:53:03 2010
@@ -12,6 +12,8 @@
 from io import StringIO
 
 from test import support
+class StdIOBuffer(StringIO):
+    pass
 
 class TestCase(unittest.TestCase):
 
@@ -25,6 +27,7 @@
         super(TestCase, self).assertEqual(obj1, obj2)
 
 
+
 class TempDirMixin(object):
 
     def setUp(self):
@@ -81,15 +84,15 @@
     # if this is being called recursively and stderr or stdout is already being
     # redirected, simply call the function and let the enclosing function
     # catch the exception
-    if isinstance(sys.stderr, StringIO) or isinstance(sys.stdout, StringIO):
+    if isinstance(sys.stderr, StdIOBuffer) or isinstance(sys.stdout, StdIOBuffer):
         return parse_args(*args, **kwargs)
 
     # if this is not being called recursively, redirect stderr and
     # use it as the ArgumentParserError message
     old_stdout = sys.stdout
     old_stderr = sys.stderr
-    sys.stdout = StringIO()
-    sys.stderr = StringIO()
+    sys.stdout = StdIOBuffer()
+    sys.stderr = StdIOBuffer()
     try:
         try:
             result = parse_args(*args, **kwargs)
@@ -2634,7 +2637,7 @@
                 parser = self._get_parser(tester)
                 print_ = getattr(parser, 'print_%s' % self.func_suffix)
                 old_stream = getattr(sys, self.std_name)
-                setattr(sys, self.std_name, StringIO())
+                setattr(sys, self.std_name, StdIOBuffer())
                 try:
                     print_()
                     parser_text = getattr(sys, self.std_name).getvalue()
@@ -2645,7 +2648,7 @@
             def test_print_file(self, tester):
                 parser = self._get_parser(tester)
                 print_ = getattr(parser, 'print_%s' % self.func_suffix)
-                sfile = StringIO()
+                sfile = StdIOBuffer()
                 print_(sfile)
                 parser_text = sfile.getvalue()
                 self._test(tester, parser_text)

Modified: python/branches/py3k-jit/Lib/test/test_difflib.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/test_difflib.py	(original)
+++ python/branches/py3k-jit/Lib/test/test_difflib.py	Fri Apr 16 02:53:03 2010
@@ -159,10 +159,32 @@
         difflib.SequenceMatcher(None, old, new).get_opcodes()
 
 
+class TestOutputFormat(unittest.TestCase):
+    def test_tab_delimiter(self):
+        args = ['one', 'two', 'Original', 'Current',
+            '2005-01-26 23:30:50', '2010-04-02 10:20:52']
+        ud = difflib.unified_diff(*args, lineterm='')
+        self.assertEqual(list(ud)[0:2], [
+                           "--- Original\t2005-01-26 23:30:50",
+                           "+++ Current\t2010-04-02 10:20:52"])
+        cd = difflib.context_diff(*args, lineterm='')
+        self.assertEqual(list(cd)[0:2], [
+                           "*** Original\t2005-01-26 23:30:50",
+                           "--- Current\t2010-04-02 10:20:52"])
+
+    def test_no_trailing_tab_on_empty_filedate(self):
+        args = ['one', 'two', 'Original', 'Current']
+        ud = difflib.unified_diff(*args, lineterm='')
+        self.assertEqual(list(ud)[0:2], ["--- Original", "+++ Current"])
+
+        cd = difflib.context_diff(*args, lineterm='')
+        self.assertEqual(list(cd)[0:2], ["*** Original", "--- Current"])
+
+
 def test_main():
     difflib.HtmlDiff._default_prefix = 0
     Doctests = doctest.DocTestSuite(difflib)
-    run_unittest(TestSFpatches, TestSFbugs, Doctests)
+    run_unittest(TestSFpatches, TestSFbugs, TestOutputFormat, Doctests)
 
 if __name__ == '__main__':
     test_main()

Modified: python/branches/py3k-jit/Lib/test/test_functools.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/test_functools.py	(original)
+++ python/branches/py3k-jit/Lib/test/test_functools.py	Fri Apr 16 02:53:03 2010
@@ -448,6 +448,11 @@
         self.assert_(A(2) <= A(2))
         self.assert_(A(2) >= A(2))
 
+    def test_no_operations_defined(self):
+        with self.assertRaises(ValueError):
+            @functools.total_ordering
+            class A:
+                pass
 
 def test_main(verbose=None):
     test_classes = (

Modified: python/branches/py3k-jit/Lib/test/test_logging.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/test_logging.py	(original)
+++ python/branches/py3k-jit/Lib/test/test_logging.py	Fri Apr 16 02:53:03 2010
@@ -68,6 +68,12 @@
         finally:
             logging._releaseLock()
 
+        # Set two unused loggers: one non-ASCII and one Unicode.
+        # This is to test correct operation when sorting existing
+        # loggers in the configuration code. See issue 8201.
+        logging.getLogger("\xab\xd7\xbb")
+        logging.getLogger("\u013f\u00d6\u0047")
+
         self.root_logger = logging.getLogger("")
         self.original_logging_level = self.root_logger.getEffectiveLevel()
 
@@ -1731,6 +1737,23 @@
         self.assertEqual(logged, ['should appear in logged'])
 
 
+class ChildLoggerTest(BaseTest):
+    def test_child_loggers(self):
+        r = logging.getLogger()
+        l1 = logging.getLogger('abc')
+        l2 = logging.getLogger('def.ghi')
+        c1 = r.getChild('xyz')
+        c2 = r.getChild('uvw.xyz')
+        self.assertTrue(c1 is logging.getLogger('xyz'))
+        self.assertTrue(c2 is logging.getLogger('uvw.xyz'))
+        c1 = l1.getChild('def')
+        c2 = c1.getChild('ghi')
+        c3 = l1.getChild('def.ghi')
+        self.assertTrue(c1 is logging.getLogger('abc.def'))
+        self.assertTrue(c2 is logging.getLogger('abc.def.ghi'))
+        self.assertTrue(c2 is c3)
+
+
 # Set the locale to the platform-dependent default.  I have no idea
 # why the test does this, but in any case we save the current locale
 # first and restore it at the end.
@@ -1739,7 +1762,8 @@
     run_unittest(BuiltinLevelsTest, BasicFilterTest,
                  CustomLevelsAndFiltersTest, MemoryHandlerTest,
                  ConfigFileTest, SocketHandlerTest, MemoryTest,
-                 EncodingTest, WarningsTest, ConfigDictTest, ManagerTest)
+                 EncodingTest, WarningsTest, ConfigDictTest, ManagerTest,
+                 ChildLoggerTest)
 
 if __name__ == "__main__":
     test_main()

Modified: python/branches/py3k-jit/Lib/test/test_os.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/test_os.py	(original)
+++ python/branches/py3k-jit/Lib/test/test_os.py	Fri Apr 16 02:53:03 2010
@@ -7,9 +7,13 @@
 import unittest
 import warnings
 import sys
+import signal
+import subprocess
+import time
 import shutil
 from test import support
 
+
 # Tests creating TESTFN
 class FileTests(unittest.TestCase):
     def setUp(self):
@@ -739,7 +743,6 @@
             def test_setreuid_neg1(self):
                 # Needs to accept -1.  We run this in a subprocess to avoid
                 # altering the test runner's process state (issue8045).
-                import subprocess
                 subprocess.check_call([
                         sys.executable, '-c',
                         'import os,sys;os.setreuid(-1,-1);sys.exit(0)'])
@@ -754,7 +757,6 @@
             def test_setregid_neg1(self):
                 # Needs to accept -1.  We run this in a subprocess to avoid
                 # altering the test runner's process state (issue8045).
-                import subprocess
                 subprocess.check_call([
                         sys.executable, '-c',
                         'import os,sys;os.setregid(-1,-1);sys.exit(0)'])
@@ -798,6 +800,63 @@
     class Pep383Tests(unittest.TestCase):
         pass
 
+ at unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
+class Win32KillTests(unittest.TestCase):
+    def _kill(self, sig, *args):
+        # Send a subprocess a signal (or in some cases, just an int to be
+        # the return value)
+        proc = subprocess.Popen(*args)
+        os.kill(proc.pid, sig)
+        self.assertEqual(proc.wait(), sig)
+
+    def test_kill_sigterm(self):
+        # SIGTERM doesn't mean anything special, but make sure it works
+        self._kill(signal.SIGTERM, [sys.executable])
+
+    def test_kill_int(self):
+        # os.kill on Windows can take an int which gets set as the exit code
+        self._kill(100, [sys.executable])
+
+    def _kill_with_event(self, event, name):
+        # Run a script which has console control handling enabled.
+        proc = subprocess.Popen([sys.executable,
+                   os.path.join(os.path.dirname(__file__),
+                                "win_console_handler.py")],
+                   creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
+        # Let the interpreter startup before we send signals. See #3137.
+        time.sleep(0.5)
+        os.kill(proc.pid, event)
+        # proc.send_signal(event) could also be done here.
+        # Allow time for the signal to be passed and the process to exit.
+        time.sleep(0.5)
+        if not proc.poll():
+            # Forcefully kill the process if we weren't able to signal it.
+            os.kill(proc.pid, signal.SIGINT)
+            self.fail("subprocess did not stop on {}".format(name))
+
+    @unittest.skip("subprocesses aren't inheriting CTRL+C property")
+    def test_CTRL_C_EVENT(self):
+        from ctypes import wintypes
+        import ctypes
+
+        # Make a NULL value by creating a pointer with no argument.
+        NULL = ctypes.POINTER(ctypes.c_int)()
+        SetConsoleCtrlHandler = ctypes.windll.kernel32.SetConsoleCtrlHandler
+        SetConsoleCtrlHandler.argtypes = (ctypes.POINTER(ctypes.c_int),
+                                          wintypes.BOOL)
+        SetConsoleCtrlHandler.restype = wintypes.BOOL
+
+        # Calling this with NULL and FALSE causes the calling process to
+        # handle CTRL+C, rather than ignore it. This property is inherited
+        # by subprocesses.
+        SetConsoleCtrlHandler(NULL, 0)
+
+        self._kill_with_event(signal.CTRL_C_EVENT, "CTRL_C_EVENT")
+
+    def test_CTRL_BREAK_EVENT(self):
+        self._kill_with_event(signal.CTRL_BREAK_EVENT, "CTRL_BREAK_EVENT")
+
+
 def test_main():
     support.run_unittest(
         ArgTests,
@@ -812,7 +871,8 @@
         Win32ErrorTests,
         TestInvalidFD,
         PosixUidGidTests,
-        Pep383Tests
+        Pep383Tests,
+        Win32KillTests
     )
 
 if __name__ == "__main__":

Modified: python/branches/py3k-jit/Lib/test/test_select.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/test_select.py	(original)
+++ python/branches/py3k-jit/Lib/test/test_select.py	Fri Apr 16 02:53:03 2010
@@ -4,6 +4,8 @@
 import os
 import sys
 
+ at unittest.skipIf(sys.platform[:3] in ('win', 'mac', 'os2', 'riscos'),
+                 "can't easily test on this system")
 class SelectTestCase(unittest.TestCase):
 
     class Nope:
@@ -19,11 +21,14 @@
         self.assertRaises(TypeError, select.select, [self.Almost()], [], [])
         self.assertRaises(TypeError, select.select, [], [], [], "not a number")
 
+    def test_returned_list_identity(self):
+        # See issue #8329
+        r, w, x = select.select([], [], [], 1)
+        self.assertIsNot(r, w)
+        self.assertIsNot(r, x)
+        self.assertIsNot(w, x)
+
     def test_select(self):
-        if sys.platform[:3] in ('win', 'mac', 'os2', 'riscos'):
-            if support.verbose:
-                print("Can't test select easily on", sys.platform)
-            return
         cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done'
         p = os.popen(cmd, 'r')
         for tout in (0, 1, 2, 4, 8, 16) + (None,)*10:

Modified: python/branches/py3k-jit/Lib/test/test_urllib2net.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/test_urllib2net.py	(original)
+++ python/branches/py3k-jit/Lib/test/test_urllib2net.py	Fri Apr 16 02:53:03 2010
@@ -217,7 +217,7 @@
         u = _urlopen_with_retry("http://www.python.org", timeout=120)
         self.assertEqual(u.fp.raw._sock.gettimeout(), 120)
 
-    FTP_HOST = "ftp://ftp.mirror.nl/pub/mirror/gnu/"
+    FTP_HOST = "ftp://ftp.mirror.nl/pub/gnu/"
 
     def test_ftp_basic(self):
         self.assertTrue(socket.getdefaulttimeout() is None)

Modified: python/branches/py3k-jit/Lib/test/test_urlparse.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/test_urlparse.py	(original)
+++ python/branches/py3k-jit/Lib/test/test_urlparse.py	Fri Apr 16 02:53:03 2010
@@ -142,7 +142,7 @@
                          (base, relurl, expected))
 
     def test_unparse_parse(self):
-        for u in ['Python', './Python', 'x-newscheme://foo.com/stuff']:
+        for u in ['Python', './Python','x-newscheme://foo.com/stuff','x://y','x:/y','x:/','/',]:
             self.assertEqual(urllib.parse.urlunsplit(urllib.parse.urlsplit(u)), u)
             self.assertEqual(urllib.parse.urlunparse(urllib.parse.urlparse(u)), u)
 

Modified: python/branches/py3k-jit/Lib/test/test_uuid.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/test_uuid.py	(original)
+++ python/branches/py3k-jit/Lib/test/test_uuid.py	Fri Apr 16 02:53:03 2010
@@ -292,14 +292,8 @@
         badtype(lambda: setattr(u, 'node', 0))
 
     def check_node(self, node, source):
-        individual_group_bit = (node >> 40) & 1
-        universal_local_bit = (node >> 40) & 2
-        message = "%012x doesn't look like a real MAC address" % node
-        self.assertEqual(individual_group_bit, 0, message)
-        self.assertEqual(universal_local_bit, 0, message)
-        self.assertNotEqual(node, 0, message)
-        self.assertNotEqual(node, 0xffffffffffff, message)
-        self.assertTrue(0 <= node, message)
+        message = "%012x is not an RFC 4122 node ID" % node
+        self.assertTrue(0 < node, message)
         self.assertTrue(node < (1 << 48), message)
 
         TestUUID.source2node[source] = node
@@ -318,10 +312,6 @@
 
     def test_ifconfig_getnode(self):
         import sys
-        print("""    WARNING: uuid._ifconfig_getnode is unreliable on many platforms.
-        It is disabled until the code and/or test can be fixed properly.""", file=sys.__stdout__)
-        return
-
         import os
         if os.name == 'posix':
             node = uuid._ifconfig_getnode()
@@ -341,18 +331,18 @@
 
     def test_random_getnode(self):
         node = uuid._random_getnode()
-        self.assertTrue(0 <= node)
-        self.assertTrue(node < (1 <<48))
+        # Least significant bit of first octet must be set.
+        self.assertTrue(node & 0x010000000000)
+        self.assertTrue(node < (1 << 48))
 
     def test_unixdll_getnode(self):
         import sys
-        print("""    WARNING: uuid._unixdll_getnode is unreliable on many platforms.
-        It is disabled until the code and/or test can be fixed properly.""", file=sys.__stdout__)
-        return
-
         import os
         if importable('ctypes') and os.name == 'posix':
-            self.check_node(uuid._unixdll_getnode(), 'unixdll')
+            try: # Issues 1481, 3581: _uuid_generate_time() might be None.
+                self.check_node(uuid._unixdll_getnode(), 'unixdll')
+            except TypeError:
+                pass
 
     def test_windll_getnode(self):
         import os
@@ -361,10 +351,6 @@
 
     def test_getnode(self):
         import sys
-        print("""    WARNING: uuid.getnode is unreliable on many platforms.
-        It is disabled until the code and/or test can be fixed properly.""", file=sys.__stdout__)
-        return
-
         node1 = uuid.getnode()
         self.check_node(node1, "getnode1")
 

Modified: python/branches/py3k-jit/Lib/test/test_warnings.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/test_warnings.py	(original)
+++ python/branches/py3k-jit/Lib/test/test_warnings.py	Fri Apr 16 02:53:03 2010
@@ -4,6 +4,7 @@
 from io import StringIO
 import sys
 import unittest
+import subprocess
 from test import support
 
 from test import warning_tests
@@ -685,6 +686,58 @@
     module = py_warnings
 
 
+class EnvironmentVariableTests(BaseTest):
+
+    def test_single_warning(self):
+        newenv = os.environ.copy()
+        newenv["PYTHONWARNINGS"] = "ignore::DeprecationWarning"
+        p = subprocess.Popen([sys.executable,
+                "-c", "import sys; sys.stdout.write(str(sys.warnoptions))"],
+                stdout=subprocess.PIPE, env=newenv)
+        self.assertEqual(p.communicate()[0], b"['ignore::DeprecationWarning']")
+        self.assertEqual(p.wait(), 0)
+
+    def test_comma_separated_warnings(self):
+        newenv = os.environ.copy()
+        newenv["PYTHONWARNINGS"] = ("ignore::DeprecationWarning,"
+                                    "ignore::UnicodeWarning")
+        p = subprocess.Popen([sys.executable,
+                "-c", "import sys; sys.stdout.write(str(sys.warnoptions))"],
+                stdout=subprocess.PIPE, env=newenv)
+        self.assertEqual(p.communicate()[0],
+                b"['ignore::DeprecationWarning', 'ignore::UnicodeWarning']")
+        self.assertEqual(p.wait(), 0)
+
+    def test_envvar_and_command_line(self):
+        newenv = os.environ.copy()
+        newenv["PYTHONWARNINGS"] = "ignore::DeprecationWarning"
+        p = subprocess.Popen([sys.executable, "-W" "ignore::UnicodeWarning",
+                "-c", "import sys; sys.stdout.write(str(sys.warnoptions))"],
+                stdout=subprocess.PIPE, env=newenv)
+        self.assertEqual(p.communicate()[0],
+                b"['ignore::UnicodeWarning', 'ignore::DeprecationWarning']")
+        self.assertEqual(p.wait(), 0)
+
+    @unittest.skipUnless(sys.getfilesystemencoding() != 'ascii',
+                         'requires non-ascii filesystemencoding')
+    def test_nonascii(self):
+        newenv = os.environ.copy()
+        newenv["PYTHONWARNINGS"] = "ignore:DeprecaciónWarning"
+        newenv["PYTHONIOENCODING"] = "utf-8"
+        p = subprocess.Popen([sys.executable,
+                "-c", "import sys; sys.stdout.write(str(sys.warnoptions))"],
+                stdout=subprocess.PIPE, env=newenv)
+        self.assertEqual(p.communicate()[0],
+                "['ignore:DeprecaciónWarning']".encode('utf-8'))
+        self.assertEqual(p.wait(), 0)
+
+class CEnvironmentVariableTests(EnvironmentVariableTests):
+    module = c_warnings
+
+class PyEnvironmentVariableTests(EnvironmentVariableTests):
+    module = py_warnings
+
+
 def test_main():
     py_warnings.onceregistry.clear()
     c_warnings.onceregistry.clear()
@@ -696,6 +749,8 @@
                                 _WarningsTests,
                                 CWarningsDisplayTests, PyWarningsDisplayTests,
                                 CCatchWarningTests, PyCatchWarningTests,
+                                CEnvironmentVariableTests,
+                                PyEnvironmentVariableTests
                              )
 
 

Modified: python/branches/py3k-jit/Lib/test/test_winsound.py
==============================================================================
--- python/branches/py3k-jit/Lib/test/test_winsound.py	(original)
+++ python/branches/py3k-jit/Lib/test/test_winsound.py	Fri Apr 16 02:53:03 2010
@@ -8,7 +8,20 @@
 import subprocess
 
 winsound = support.import_module('winsound')
+import winreg
 
+def has_sound(sound):
+    """Find out if a particular event is configured with a default sound"""
+    try:
+        key = winreg.OpenKeyEx(winreg.HKEY_CURRENT_USER,
+                "AppEvents\Schemes\Apps\.Default\{0}\.Default".format(sound))
+        value = winreg.EnumValue(key, 0)[1]
+        if value is not "":
+            return True
+        else:
+            return False
+    except WindowsError:
+        return False
 
 class BeepTest(unittest.TestCase):
     # As with PlaySoundTest, incorporate the _have_soundcard() check
@@ -84,6 +97,8 @@
             "none", winsound.SND_ASYNC | winsound.SND_MEMORY
         )
 
+    @unittest.skipUnless(has_sound("SystemAsterisk"),
+                         "No default SystemAsterisk")
     def test_alias_asterisk(self):
         if _have_soundcard():
             winsound.PlaySound('SystemAsterisk', winsound.SND_ALIAS)
@@ -94,6 +109,8 @@
                 'SystemAsterisk', winsound.SND_ALIAS
             )
 
+    @unittest.skipUnless(has_sound("SystemExclamation"),
+                         "No default SystemExclamation")
     def test_alias_exclamation(self):
         if _have_soundcard():
             winsound.PlaySound('SystemExclamation', winsound.SND_ALIAS)
@@ -104,6 +121,7 @@
                 'SystemExclamation', winsound.SND_ALIAS
             )
 
+    @unittest.skipUnless(has_sound("SystemExit"), "No default SystemExit")
     def test_alias_exit(self):
         if _have_soundcard():
             winsound.PlaySound('SystemExit', winsound.SND_ALIAS)
@@ -114,6 +132,7 @@
                 'SystemExit', winsound.SND_ALIAS
             )
 
+    @unittest.skipUnless(has_sound("SystemHand"), "No default SystemHand")
     def test_alias_hand(self):
         if _have_soundcard():
             winsound.PlaySound('SystemHand', winsound.SND_ALIAS)
@@ -124,6 +143,8 @@
                 'SystemHand', winsound.SND_ALIAS
             )
 
+    @unittest.skipUnless(has_sound("SystemQuestion"),
+                         "No default SystemQuestion")
     def test_alias_question(self):
         if _have_soundcard():
             winsound.PlaySound('SystemQuestion', winsound.SND_ALIAS)
@@ -194,11 +215,9 @@
                 pass
             winsound.PlaySound(None, winsound.SND_PURGE)
         else:
-            self.assertRaises(
-                RuntimeError,
-                winsound.PlaySound,
-                None, winsound.SND_PURGE
-            )
+            # Issue 8367: PlaySound(None, winsound.SND_PURGE)
+            # does not raise on systems without a sound card.
+            pass
 
 
 def _get_cscript_path():

Modified: python/branches/py3k-jit/Lib/threading.py
==============================================================================
--- python/branches/py3k-jit/Lib/threading.py	(original)
+++ python/branches/py3k-jit/Lib/threading.py	Fri Apr 16 02:53:03 2010
@@ -31,6 +31,7 @@
     _CRLock = _thread.RLock
 except AttributeError:
     _CRLock = None
+TIMEOUT_MAX = _thread.TIMEOUT_MAX
 del _thread
 
 
@@ -107,14 +108,14 @@
         return "<%s owner=%r count=%d>" % (
                 self.__class__.__name__, owner, self._count)
 
-    def acquire(self, blocking=True):
+    def acquire(self, blocking=True, timeout=-1):
         me = _get_ident()
         if self._owner == me:
             self._count = self._count + 1
             if __debug__:
                 self._note("%s.acquire(%s): recursive success", self, blocking)
             return 1
-        rc = self._block.acquire(blocking)
+        rc = self._block.acquire(blocking, timeout)
         if rc:
             self._owner = me
             self._count = 1
@@ -234,22 +235,10 @@
                 if __debug__:
                     self._note("%s.wait(): got it", self)
             else:
-                # Balancing act:  We can't afford a pure busy loop, so we
-                # have to sleep; but if we sleep the whole timeout time,
-                # we'll be unresponsive.  The scheme here sleeps very
-                # little at first, longer as time goes on, but never longer
-                # than 20 times per second (or the timeout time remaining).
-                endtime = _time() + timeout
-                delay = 0.0005 # 500 us -> initial delay of 1 ms
-                while True:
-                    gotit = waiter.acquire(0)
-                    if gotit:
-                        break
-                    remaining = endtime - _time()
-                    if remaining <= 0:
-                        break
-                    delay = min(delay * 2, remaining, .05)
-                    _sleep(delay)
+                if timeout > 0:
+                    gotit = waiter.acquire(True, timeout)
+                else:
+                    gotit = waiter.acquire(False)
                 if not gotit:
                     if __debug__:
                         self._note("%s.wait(%s): timed out", self, timeout)

Modified: python/branches/py3k-jit/Lib/tkinter/test/test_ttk/test_widgets.py
==============================================================================
--- python/branches/py3k-jit/Lib/tkinter/test/test_ttk/test_widgets.py	(original)
+++ python/branches/py3k-jit/Lib/tkinter/test/test_ttk/test_widgets.py	Fri Apr 16 02:53:03 2010
@@ -704,15 +704,19 @@
         self.nb.select(0)
 
         support.simulate_mouse_click(self.nb, 5, 5)
+        self.nb.focus_force()
         self.nb.event_generate('<Control-Tab>')
         self.assertEqual(self.nb.select(), str(self.child2))
+        self.nb.focus_force()
         self.nb.event_generate('<Shift-Control-Tab>')
         self.assertEqual(self.nb.select(), str(self.child1))
+        self.nb.focus_force()
         self.nb.event_generate('<Shift-Control-Tab>')
         self.assertEqual(self.nb.select(), str(self.child2))
 
         self.nb.tab(self.child1, text='a', underline=0)
         self.nb.enable_traversal()
+        self.nb.focus_force()
         self.nb.event_generate('<Alt-a>')
         self.assertEqual(self.nb.select(), str(self.child1))
 
@@ -1112,9 +1116,9 @@
         self.assertRaises(tkinter.TclError, self.tv.tag_configure,
             'test', sky='blue')
         self.tv.tag_configure('test', foreground='blue')
-        self.assertEqual(self.tv.tag_configure('test', 'foreground'),
+        self.assertEqual(str(self.tv.tag_configure('test', 'foreground')),
             'blue')
-        self.assertEqual(self.tv.tag_configure('test', foreground=None),
+        self.assertEqual(str(self.tv.tag_configure('test', foreground=None)),
             'blue')
         self.assertTrue(isinstance(self.tv.tag_configure('test'), dict))
 

Modified: python/branches/py3k-jit/Lib/unittest/case.py
==============================================================================
--- python/branches/py3k-jit/Lib/unittest/case.py	(original)
+++ python/branches/py3k-jit/Lib/unittest/case.py	Fri Apr 16 02:53:03 2010
@@ -502,10 +502,12 @@
                                                           safe_repr(second)))
             raise self.failureException(msg)
 
-    def assertAlmostEqual(self, first, second, *, places=7, msg=None):
+    def assertAlmostEqual(self, first, second, *, places=None, msg=None,
+                          delta=None):
         """Fail if the two objects are unequal as determined by their
            difference rounded to the given number of decimal places
-           (default 7) and comparing to zero.
+           (default 7) and comparing to zero, or by comparing that the
+           between the two objects is more than the given delta.
 
            Note that decimal places (from zero) are usually not the same
            as significant digits (measured from the most signficant digit).
@@ -514,31 +516,62 @@
            compare almost equal.
         """
         if first == second:
-            # shortcut for inf
+            # shortcut
             return
-        if round(abs(second-first), places) != 0:
+        if delta is not None and places is not None:
+            raise TypeError("specify delta or places not both")
+
+        if delta is not None:
+            if abs(first - second) <= delta:
+                return
+
+            standardMsg = '%s != %s within %s delta' % (safe_repr(first),
+                                                        safe_repr(second),
+                                                        safe_repr(delta))
+        else:
+            if places is None:
+                places = 7
+
+            if round(abs(second-first), places) == 0:
+                return
+
             standardMsg = '%s != %s within %r places' % (safe_repr(first),
                                                           safe_repr(second),
                                                           places)
-            msg = self._formatMessage(msg, standardMsg)
-            raise self.failureException(msg)
+        msg = self._formatMessage(msg, standardMsg)
+        raise self.failureException(msg)
 
-    def assertNotAlmostEqual(self, first, second, *, places=7, msg=None):
+    def assertNotAlmostEqual(self, first, second, *, places=None, msg=None,
+                             delta=None):
         """Fail if the two objects are equal as determined by their
            difference rounded to the given number of decimal places
-           (default 7) and comparing to zero.
+           (default 7) and comparing to zero, or by comparing that the
+           between the two objects is less than the given delta.
 
            Note that decimal places (from zero) are usually not the same
            as significant digits (measured from the most signficant digit).
 
            Objects that are equal automatically fail.
         """
-        if (first == second) or round(abs(second-first), places) == 0:
+        if delta is not None and places is not None:
+            raise TypeError("specify delta or places not both")
+        if delta is not None:
+            if not (first == second) and abs(first - second) > delta:
+                return
+            standardMsg = '%s == %s within %s delta' % (safe_repr(first),
+                                                        safe_repr(second),
+                                                        safe_repr(delta))
+        else:
+            if places is None:
+                places = 7
+            if not (first == second) and round(abs(second-first), places) != 0:
+                return
             standardMsg = '%s == %s within %r places' % (safe_repr(first),
-                                                          safe_repr(second),
-                                                          places)
-            msg = self._formatMessage(msg, standardMsg)
-            raise self.failureException(msg)
+                                                         safe_repr(second),
+                                                         places)
+
+        msg = self._formatMessage(msg, standardMsg)
+        raise self.failureException(msg)
 
     # Synonyms for assertion methods
 
@@ -967,6 +1000,18 @@
             msg = '%s: %r not found in %r' % (msg, expected_regexp.pattern, text)
             raise self.failureException(msg)
 
+    def assertNotRegexpMatches(self, text, unexpected_regexp, msg=None):
+        if isinstance(unexpected_regexp, (str, bytes)):
+            unexpected_regexp = re.compile(unexpected_regexp)
+        match = unexpected_regexp.search(text)
+        if match:
+            msg = msg or "Regexp matched"
+            msg = '%s: %r matches %r in %r' % (msg,
+                                               text[match.start():match.end()],
+                                               unexpected_regexp.pattern,
+                                               text)
+            raise self.failureException(msg)
+
 
 class FunctionTestCase(TestCase):
     """A test case that wraps a test function.

Modified: python/branches/py3k-jit/Lib/unittest/loader.py
==============================================================================
--- python/branches/py3k-jit/Lib/unittest/loader.py	(original)
+++ python/branches/py3k-jit/Lib/unittest/loader.py	Fri Apr 16 02:53:03 2010
@@ -166,27 +166,58 @@
         packages can continue discovery themselves. top_level_dir is stored so
         load_tests does not need to pass this argument in to loader.discover().
         """
+        set_implicit_top = False
         if top_level_dir is None and self._top_level_dir is not None:
             # make top_level_dir optional if called from load_tests in a package
             top_level_dir = self._top_level_dir
         elif top_level_dir is None:
+            set_implicit_top = True
             top_level_dir = start_dir
 
-        top_level_dir = os.path.abspath(os.path.normpath(top_level_dir))
-        start_dir = os.path.abspath(os.path.normpath(start_dir))
+        top_level_dir = os.path.abspath(top_level_dir)
 
         if not top_level_dir in sys.path:
             # all test modules must be importable from the top level directory
             sys.path.append(top_level_dir)
         self._top_level_dir = top_level_dir
 
-        if start_dir != top_level_dir and not os.path.isfile(os.path.join(start_dir, '__init__.py')):
-            # what about __init__.pyc or pyo (etc)
+        is_not_importable = False
+        if os.path.isdir(os.path.abspath(start_dir)):
+            start_dir = os.path.abspath(start_dir)
+            if start_dir != top_level_dir:
+                is_not_importable = not os.path.isfile(os.path.join(start_dir, '__init__.py'))
+        else:
+            # support for discovery from dotted module names
+            try:
+                __import__(start_dir)
+            except ImportError:
+                is_not_importable = True
+            else:
+                the_module = sys.modules[start_dir]
+                top_part = start_dir.split('.')[0]
+                start_dir = os.path.abspath(os.path.dirname((the_module.__file__)))
+                if set_implicit_top:
+                    self._top_level_dir = self._get_directory_containing_module(top_part)
+                    sys.path.remove(top_level_dir)
+
+        if is_not_importable:
             raise ImportError('Start directory is not importable: %r' % start_dir)
 
         tests = list(self._find_tests(start_dir, pattern))
         return self.suiteClass(tests)
 
+    def _get_directory_containing_module(self, module_name):
+        module = sys.modules[module_name]
+        full_path = os.path.abspath(module.__file__)
+
+        if os.path.basename(full_path).lower().startswith('__init__.py'):
+            return os.path.dirname(os.path.dirname(full_path))
+        else:
+            # here we have been given a module rather than a package - so
+            # all we can do is search the *same* directory the module is in
+            # should an exception be raised instead
+            return os.path.dirname(full_path)
+
     def _get_name_from_path(self, path):
         path = os.path.splitext(os.path.normpath(path))[0]
 

Modified: python/branches/py3k-jit/Lib/unittest/main.py
==============================================================================
--- python/branches/py3k-jit/Lib/unittest/main.py	(original)
+++ python/branches/py3k-jit/Lib/unittest/main.py	Fri Apr 16 02:53:03 2010
@@ -9,9 +9,9 @@
 
 __unittest = True
 
-
-FAILFAST = "  -f, --failfast   Stop on first failure\n"
-CATCHBREAK = "  -c, --catch      Catch control-C and display results\n"
+FAILFAST     = "  -f, --failfast   Stop on first failure\n"
+CATCHBREAK   = "  -c, --catch      Catch control-C and display results\n"
+BUFFEROUTPUT = "  -b, --buffer     Buffer stdout and stderr during test runs\n"
 
 USAGE_AS_MAIN = """\
 Usage: %(progName)s [options] [tests]
@@ -20,7 +20,7 @@
   -h, --help       Show this message
   -v, --verbose    Verbose output
   -q, --quiet      Minimal output
-%(failfast)s%(catchbreak)s
+%(failfast)s%(catchbreak)s%(buffer)s
 Examples:
   %(progName)s test_module                       - run tests from test_module
   %(progName)s test_module.TestClass             - run tests from
@@ -34,7 +34,7 @@
 
 Options:
   -v, --verbose    Verbose output
-%(failfast)s%(catchbreak)s  -s directory     Directory to start discovery ('.' default)
+%(failfast)s%(catchbreak)s%(buffer)s  -s directory     Directory to start discovery ('.' default)
   -p pattern       Pattern to match test files ('test*.py' default)
   -t directory     Top level directory of project (default to
                    start directory)
@@ -50,7 +50,7 @@
   -h, --help       Show this message
   -v, --verbose    Verbose output
   -q, --quiet      Minimal output
-%(failfast)s%(catchbreak)s
+%(failfast)s%(catchbreak)s%(buffer)s
 Examples:
   %(progName)s                               - run default set of tests
   %(progName)s MyTestSuite                   - run suite 'MyTestSuite'
@@ -68,12 +68,12 @@
     USAGE = USAGE_FROM_MODULE
 
     # defaults for testing
-    failfast = catchbreak = None
+    failfast = catchbreak = buffer = None
 
     def __init__(self, module='__main__', defaultTest=None,
                  argv=None, testRunner=None,
                  testLoader=loader.defaultTestLoader, exit=True,
-                 verbosity=1, failfast=None, catchbreak=None):
+                 verbosity=1, failfast=None, catchbreak=None, buffer=None):
         if isinstance(module, str):
             self.module = __import__(module)
             for part in module.split('.')[1:]:
@@ -87,6 +87,7 @@
         self.failfast = failfast
         self.catchbreak = catchbreak
         self.verbosity = verbosity
+        self.buffer = buffer
         self.defaultTest = defaultTest
         self.testRunner = testRunner
         self.testLoader = testLoader
@@ -97,11 +98,14 @@
     def usageExit(self, msg=None):
         if msg:
             print(msg)
-        usage = {'progName': self.progName, 'catchbreak': '', 'failfast': ''}
+        usage = {'progName': self.progName, 'catchbreak': '', 'failfast': '',
+                 'buffer': ''}
         if self.failfast != False:
             usage['failfast'] = FAILFAST
         if self.catchbreak != False:
             usage['catchbreak'] = CATCHBREAK
+        if self.buffer != False:
+            usage['buffer'] = BUFFEROUTPUT
         print(self.USAGE % usage)
         sys.exit(2)
 
@@ -111,9 +115,9 @@
             return
 
         import getopt
-        long_opts = ['help', 'verbose', 'quiet', 'failfast', 'catch']
+        long_opts = ['help', 'verbose', 'quiet', 'failfast', 'catch', 'buffer']
         try:
-            options, args = getopt.getopt(argv[1:], 'hHvqfc', long_opts)
+            options, args = getopt.getopt(argv[1:], 'hHvqfcb', long_opts)
             for opt, value in options:
                 if opt in ('-h','-H','--help'):
                     self.usageExit()
@@ -129,6 +133,10 @@
                     if self.catchbreak is None:
                         self.catchbreak = True
                     # Should this raise an exception if -c is not valid?
+                if opt in ('-b','--buffer'):
+                    if self.buffer is None:
+                        self.buffer = True
+                    # Should this raise an exception if -b is not valid?
             if len(args) == 0 and self.defaultTest is None:
                 # createTests will load tests from self.module
                 self.testNames = None
@@ -164,6 +172,10 @@
             parser.add_option('-c', '--catch', dest='catchbreak', default=False,
                               help='Catch ctrl-C and display results so far',
                               action='store_true')
+        if self.buffer != False:
+            parser.add_option('-b', '--buffer', dest='buffer', default=False,
+                              help='Buffer stdout and stderr during tests',
+                              action='store_true')
         parser.add_option('-s', '--start-directory', dest='start', default='.',
                           help="Directory to start discovery ('.' default)")
         parser.add_option('-p', '--pattern', dest='pattern', default='test*.py',
@@ -184,6 +196,8 @@
             self.failfast = options.failfast
         if self.catchbreak is None:
             self.catchbreak = options.catchbreak
+        if self.buffer is None:
+            self.buffer = options.buffer
 
         if options.verbose:
             self.verbosity = 2
@@ -203,9 +217,10 @@
         if isinstance(self.testRunner, type):
             try:
                 testRunner = self.testRunner(verbosity=self.verbosity,
-                                             failfast=self.failfast)
+                                             failfast=self.failfast,
+                                             buffer=self.buffer)
             except TypeError:
-                # didn't accept the verbosity or failfast arguments
+                # didn't accept the verbosity, buffer or failfast arguments
                 testRunner = self.testRunner()
         else:
             # it is assumed to be a TestRunner instance

Modified: python/branches/py3k-jit/Lib/unittest/result.py
==============================================================================
--- python/branches/py3k-jit/Lib/unittest/result.py	(original)
+++ python/branches/py3k-jit/Lib/unittest/result.py	Fri Apr 16 02:53:03 2010
@@ -1,5 +1,8 @@
 """Test result object"""
 
+import os
+import io
+import sys
 import traceback
 
 from . import util
@@ -15,6 +18,10 @@
         return method(self, *args, **kw)
     return inner
 
+STDOUT_LINE = '\nStdout:\n%s'
+STDERR_LINE = '\nStderr:\n%s'
+
+
 class TestResult(object):
     """Holder for test result information.
 
@@ -37,6 +44,12 @@
         self.expectedFailures = []
         self.unexpectedSuccesses = []
         self.shouldStop = False
+        self.buffer = False
+        self._stdout_buffer = None
+        self._stderr_buffer = None
+        self._original_stdout = sys.stdout
+        self._original_stderr = sys.stderr
+        self._mirrorOutput = False
 
     def printErrors(self):
         "Called by TestRunner after test run"
@@ -44,6 +57,13 @@
     def startTest(self, test):
         "Called when the given test is about to be run"
         self.testsRun += 1
+        self._mirrorOutput = False
+        if self.buffer:
+            if self._stderr_buffer is None:
+                self._stderr_buffer = io.StringIO()
+                self._stdout_buffer = io.StringIO()
+            sys.stdout = self._stdout_buffer
+            sys.stderr = self._stderr_buffer
 
     def startTestRun(self):
         """Called once before any tests are executed.
@@ -53,6 +73,26 @@
 
     def stopTest(self, test):
         """Called when the given test has been run"""
+        if self.buffer:
+            if self._mirrorOutput:
+                output = sys.stdout.getvalue()
+                error = sys.stderr.getvalue()
+                if output:
+                    if not output.endswith('\n'):
+                        output += '\n'
+                    self._original_stdout.write(STDOUT_LINE % output)
+                if error:
+                    if not error.endswith('\n'):
+                        error += '\n'
+                    self._original_stderr.write(STDERR_LINE % error)
+
+            sys.stdout = self._original_stdout
+            sys.stderr = self._original_stderr
+            self._stdout_buffer.seek(0)
+            self._stdout_buffer.truncate()
+            self._stderr_buffer.seek(0)
+            self._stderr_buffer.truncate()
+        self._mirrorOutput = False
 
     def stopTestRun(self):
         """Called once after all tests are executed.
@@ -66,12 +106,14 @@
         returned by sys.exc_info().
         """
         self.errors.append((test, self._exc_info_to_string(err, test)))
+        self._mirrorOutput = True
 
     @failfast
     def addFailure(self, test, err):
         """Called when an error has occurred. 'err' is a tuple of values as
         returned by sys.exc_info()."""
         self.failures.append((test, self._exc_info_to_string(err, test)))
+        self._mirrorOutput = True
 
     def addSuccess(self, test):
         "Called when a test has completed successfully"
@@ -105,11 +147,29 @@
         # Skip test runner traceback levels
         while tb and self._is_relevant_tb_level(tb):
             tb = tb.tb_next
+
         if exctype is test.failureException:
             # Skip assert*() traceback levels
             length = self._count_relevant_tb_levels(tb)
-            return ''.join(traceback.format_exception(exctype, value, tb, length))
-        return ''.join(traceback.format_exception(exctype, value, tb))
+            msgLines = traceback.format_exception(exctype, value, tb, length)
+        else:
+            chain = exctype is not None
+            msgLines = traceback.format_exception(exctype, value, tb,
+                                                  chain=chain)
+
+        if self.buffer:
+            output = sys.stdout.getvalue()
+            error = sys.stderr.getvalue()
+            if output:
+                if not output.endswith('\n'):
+                    output += '\n'
+                msgLines.append(STDOUT_LINE % output)
+            if error:
+                if not error.endswith('\n'):
+                    error += '\n'
+                msgLines.append(STDERR_LINE % error)
+        return ''.join(msgLines)
+
 
     def _is_relevant_tb_level(self, tb):
         return '__unittest' in tb.tb_frame.f_globals

Modified: python/branches/py3k-jit/Lib/unittest/runner.py
==============================================================================
--- python/branches/py3k-jit/Lib/unittest/runner.py	(original)
+++ python/branches/py3k-jit/Lib/unittest/runner.py	Fri Apr 16 02:53:03 2010
@@ -125,11 +125,12 @@
     resultclass = TextTestResult
 
     def __init__(self, stream=sys.stderr, descriptions=True, verbosity=1,
-                 failfast=False, resultclass=None):
+                 failfast=False, buffer=False, resultclass=None):
         self.stream = _WritelnDecorator(stream)
         self.descriptions = descriptions
         self.verbosity = verbosity
         self.failfast = failfast
+        self.buffer = buffer
         if resultclass is not None:
             self.resultclass = resultclass
 
@@ -141,6 +142,7 @@
         result = self._makeResult()
         registerResult(result)
         result.failfast = self.failfast
+        result.buffer = self.buffer
         startTime = time.time()
         startTestRun = getattr(result, 'startTestRun', None)
         if startTestRun is not None:

Modified: python/branches/py3k-jit/Lib/unittest/test/test_assertions.py
==============================================================================
--- python/branches/py3k-jit/Lib/unittest/test/test_assertions.py	(original)
+++ python/branches/py3k-jit/Lib/unittest/test/test_assertions.py	Fri Apr 16 02:53:03 2010
@@ -1,3 +1,5 @@
+import datetime
+
 import unittest
 
 
@@ -25,6 +27,28 @@
         self.assertRaises(self.failureException, self.assertNotAlmostEqual,
                           float('inf'), float('inf'))
 
+    def test_AmostEqualWithDelta(self):
+        self.assertAlmostEqual(1.1, 1.0, delta=0.5)
+        self.assertAlmostEqual(1.0, 1.1, delta=0.5)
+        self.assertNotAlmostEqual(1.1, 1.0, delta=0.05)
+        self.assertNotAlmostEqual(1.0, 1.1, delta=0.05)
+
+        self.assertRaises(self.failureException, self.assertAlmostEqual,
+                          1.1, 1.0, delta=0.05)
+        self.assertRaises(self.failureException, self.assertNotAlmostEqual,
+                          1.1, 1.0, delta=0.5)
+
+        self.assertRaises(TypeError, self.assertAlmostEqual,
+                          1.1, 1.0, places=2, delta=2)
+        self.assertRaises(TypeError, self.assertNotAlmostEqual,
+                          1.1, 1.0, places=2, delta=2)
+
+        first = datetime.datetime.now()
+        second = first + datetime.timedelta(seconds=10)
+        self.assertAlmostEqual(first, second,
+                               delta=datetime.timedelta(seconds=20))
+        self.assertNotAlmostEqual(first, second,
+                                  delta=datetime.timedelta(seconds=5))
 
     def test_assertRaises(self):
         def _raise(e):
@@ -68,6 +92,16 @@
         else:
             self.fail("assertRaises() didn't let exception pass through")
 
+    def testAssertNotRegexpMatches(self):
+        self.assertNotRegexpMatches('Ala ma kota', r'r+')
+        try:
+            self.assertNotRegexpMatches('Ala ma kota', r'k.t', 'Message')
+        except self.failureException as e:
+            self.assertIn("'kot'", e.args[0])
+            self.assertIn('Message', e.args[0])
+        else:
+            self.fail('assertNotRegexpMatches should have failed.')
+
 
 class TestLongMessage(unittest.TestCase):
     """Test that the individual asserts honour longMessage.

Modified: python/branches/py3k-jit/Lib/unittest/test/test_break.py
==============================================================================
--- python/branches/py3k-jit/Lib/unittest/test/test_break.py	(original)
+++ python/branches/py3k-jit/Lib/unittest/test/test_break.py	Fri Apr 16 02:53:03 2010
@@ -1,6 +1,7 @@
 import gc
 import io
 import os
+import sys
 import signal
 import weakref
 
@@ -8,6 +9,7 @@
 
 
 @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
+ at unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
 class TestBreak(unittest.TestCase):
 
     def setUp(self):
@@ -203,8 +205,9 @@
         p = Program(False)
         p.runTests()
 
-        self.assertEqual(FakeRunner.initArgs, [((), {'verbosity': verbosity,
-                                                'failfast': failfast})])
+        self.assertEqual(FakeRunner.initArgs, [((), {'buffer': None,
+                                                     'verbosity': verbosity,
+                                                     'failfast': failfast})])
         self.assertEqual(FakeRunner.runArgs, [test])
         self.assertEqual(p.result, result)
 
@@ -215,8 +218,9 @@
         p = Program(True)
         p.runTests()
 
-        self.assertEqual(FakeRunner.initArgs, [((), {'verbosity': verbosity,
-                                                'failfast': failfast})])
+        self.assertEqual(FakeRunner.initArgs, [((), {'buffer': None,
+                                                     'verbosity': verbosity,
+                                                     'failfast': failfast})])
         self.assertEqual(FakeRunner.runArgs, [test])
         self.assertEqual(p.result, result)
 

Modified: python/branches/py3k-jit/Lib/unittest/test/test_discovery.py
==============================================================================
--- python/branches/py3k-jit/Lib/unittest/test/test_discovery.py	(original)
+++ python/branches/py3k-jit/Lib/unittest/test/test_discovery.py	Fri Apr 16 02:53:03 2010
@@ -128,6 +128,7 @@
         loader = unittest.TestLoader()
 
         original_isfile = os.path.isfile
+        original_isdir = os.path.isdir
         def restore_isfile():
             os.path.isfile = original_isfile
 
@@ -147,6 +148,12 @@
         self.assertIn(full_path, sys.path)
 
         os.path.isfile = lambda path: True
+        os.path.isdir = lambda path: True
+
+        def restore_isdir():
+            os.path.isdir = original_isdir
+        self.addCleanup(restore_isdir)
+
         _find_tests_args = []
         def _find_tests(start_dir, pattern):
             _find_tests_args.append((start_dir, pattern))
@@ -156,8 +163,8 @@
 
         suite = loader.discover('/foo/bar/baz', 'pattern', '/foo/bar')
 
-        top_level_dir = os.path.abspath(os.path.normpath('/foo/bar'))
-        start_dir = os.path.abspath(os.path.normpath('/foo/bar/baz'))
+        top_level_dir = os.path.abspath('/foo/bar')
+        start_dir = os.path.abspath('/foo/bar/baz')
         self.assertEqual(suite, "['tests']")
         self.assertEqual(loader._top_level_dir, top_level_dir)
         self.assertEqual(_find_tests_args, [(start_dir, 'pattern')])

Modified: python/branches/py3k-jit/Lib/unittest/test/test_loader.py
==============================================================================
--- python/branches/py3k-jit/Lib/unittest/test/test_loader.py	(original)
+++ python/branches/py3k-jit/Lib/unittest/test/test_loader.py	Fri Apr 16 02:53:03 2010
@@ -524,12 +524,8 @@
         # We're going to try to load this module as a side-effect, so it
         # better not be loaded before we try.
         #
-        # Why pick audioop? Google shows it isn't used very often, so there's
-        # a good chance that it won't be imported when this test is run
-        module_name = 'audioop'
-
-        if module_name in sys.modules:
-            del sys.modules[module_name]
+        module_name = 'unittest.test.dummy'
+        sys.modules.pop(module_name, None)
 
         loader = unittest.TestLoader()
         try:
@@ -538,7 +534,7 @@
             self.assertIsInstance(suite, loader.suiteClass)
             self.assertEqual(list(suite), [])
 
-            # audioop should now be loaded, thanks to loadTestsFromName()
+            # module should now be loaded, thanks to loadTestsFromName()
             self.assertIn(module_name, sys.modules)
         finally:
             if module_name in sys.modules:
@@ -911,12 +907,8 @@
         # We're going to try to load this module as a side-effect, so it
         # better not be loaded before we try.
         #
-        # Why pick audioop? Google shows it isn't used very often, so there's
-        # a good chance that it won't be imported when this test is run
-        module_name = 'audioop'
-
-        if module_name in sys.modules:
-            del sys.modules[module_name]
+        module_name = 'unittest.test.dummy'
+        sys.modules.pop(module_name, None)
 
         loader = unittest.TestLoader()
         try:
@@ -925,7 +917,7 @@
             self.assertIsInstance(suite, loader.suiteClass)
             self.assertEqual(list(suite), [unittest.TestSuite()])
 
-            # audioop should now be loaded, thanks to loadTestsFromName()
+            # module should now be loaded, thanks to loadTestsFromName()
             self.assertIn(module_name, sys.modules)
         finally:
             if module_name in sys.modules:

Modified: python/branches/py3k-jit/Lib/unittest/test/test_result.py
==============================================================================
--- python/branches/py3k-jit/Lib/unittest/test/test_result.py	(original)
+++ python/branches/py3k-jit/Lib/unittest/test/test_result.py	Fri Apr 16 02:53:03 2010
@@ -1,6 +1,6 @@
 import io
 import sys
-import warnings
+import textwrap
 
 from test import support
 
@@ -25,6 +25,8 @@
         self.assertEqual(len(result.failures), 0)
         self.assertEqual(result.testsRun, 0)
         self.assertEqual(result.shouldStop, False)
+        self.assertIsNone(result._stdout_buffer)
+        self.assertIsNone(result._stderr_buffer)
 
     # "This method can be called to signal that the set of tests being
     # run should be aborted by setting the TestResult's shouldStop
@@ -302,6 +304,8 @@
     self.errors = []
     self.testsRun = 0
     self.shouldStop = False
+    self.buffer = False
+
 classDict['__init__'] = __init__
 OldResult = type('OldResult', (object,), classDict)
 
@@ -355,3 +359,129 @@
         # This will raise an exception if TextTestRunner can't handle old
         # test result objects
         runner.run(Test('testFoo'))
+
+
+class TestOutputBuffering(unittest.TestCase):
+
+    def setUp(self):
+        self._real_out = sys.stdout
+        self._real_err = sys.stderr
+
+    def tearDown(self):
+        sys.stdout = self._real_out
+        sys.stderr = self._real_err
+
+    def testBufferOutputOff(self):
+        real_out = self._real_out
+        real_err = self._real_err
+
+        result = unittest.TestResult()
+        self.assertFalse(result.buffer)
+
+        self.assertIs(real_out, sys.stdout)
+        self.assertIs(real_err, sys.stderr)
+
+        result.startTest(self)
+
+        self.assertIs(real_out, sys.stdout)
+        self.assertIs(real_err, sys.stderr)
+
+    def testBufferOutputStartTestAddSuccess(self):
+        real_out = self._real_out
+        real_err = self._real_err
+
+        result = unittest.TestResult()
+        self.assertFalse(result.buffer)
+
+        result.buffer = True
+
+        self.assertIs(real_out, sys.stdout)
+        self.assertIs(real_err, sys.stderr)
+
+        result.startTest(self)
+
+        self.assertIsNot(real_out, sys.stdout)
+        self.assertIsNot(real_err, sys.stderr)
+        self.assertIsInstance(sys.stdout, io.StringIO)
+        self.assertIsInstance(sys.stderr, io.StringIO)
+        self.assertIsNot(sys.stdout, sys.stderr)
+
+        out_stream = sys.stdout
+        err_stream = sys.stderr
+
+        result._original_stdout = io.StringIO()
+        result._original_stderr = io.StringIO()
+
+        print('foo')
+        print('bar', file=sys.stderr)
+
+        self.assertEqual(out_stream.getvalue(), 'foo\n')
+        self.assertEqual(err_stream.getvalue(), 'bar\n')
+
+        self.assertEqual(result._original_stdout.getvalue(), '')
+        self.assertEqual(result._original_stderr.getvalue(), '')
+
+        result.addSuccess(self)
+        result.stopTest(self)
+
+        self.assertIs(sys.stdout, result._original_stdout)
+        self.assertIs(sys.stderr, result._original_stderr)
+
+        self.assertEqual(result._original_stdout.getvalue(), '')
+        self.assertEqual(result._original_stderr.getvalue(), '')
+
+        self.assertEqual(out_stream.getvalue(), '')
+        self.assertEqual(err_stream.getvalue(), '')
+
+
+    def getStartedResult(self):
+        result = unittest.TestResult()
+        result.buffer = True
+        result.startTest(self)
+        return result
+
+    def testBufferOutputAddErrorOrFailure(self):
+        for message_attr, add_attr, include_error in [
+            ('errors', 'addError', True),
+            ('failures', 'addFailure', False),
+            ('errors', 'addError', True),
+            ('failures', 'addFailure', False)
+        ]:
+            result = self.getStartedResult()
+            buffered_out = sys.stdout
+            buffered_err = sys.stderr
+            result._original_stdout = io.StringIO()
+            result._original_stderr = io.StringIO()
+
+            print('foo', file=sys.stdout)
+            if include_error:
+                print('bar', file=sys.stderr)
+
+
+            addFunction = getattr(result, add_attr)
+            addFunction(self, (None, None, None))
+            result.stopTest(self)
+
+            result_list = getattr(result, message_attr)
+            self.assertEqual(len(result_list), 1)
+
+            test, message = result_list[0]
+            expectedOutMessage = textwrap.dedent("""
+                Stdout:
+                foo
+            """)
+            expectedErrMessage = ''
+            if include_error:
+                expectedErrMessage = textwrap.dedent("""
+                Stderr:
+                bar
+            """)
+            expectedFullMessage = 'NoneType\n%s%s' % (expectedOutMessage, expectedErrMessage)
+
+            self.assertIs(test, self)
+            self.assertEqual(result._original_stdout.getvalue(), expectedOutMessage)
+            self.assertEqual(result._original_stderr.getvalue(), expectedErrMessage)
+            self.assertMultiLineEqual(message, expectedFullMessage)
+
+if __name__ == '__main__':
+    unittest.main()

Modified: python/branches/py3k-jit/Mac/Tools/pythonw.c
==============================================================================
--- python/branches/py3k-jit/Mac/Tools/pythonw.c	(original)
+++ python/branches/py3k-jit/Mac/Tools/pythonw.c	Fri Apr 16 02:53:03 2010
@@ -78,7 +78,7 @@
 		end --;
 	}
 	end++;
-	if (end[1] == '.') {
+	if (*end == '.') {
 		end++;
 	}
 	strcpy(end, "Resources/Python.app/Contents/MacOS/" PYTHONFRAMEWORK);
@@ -161,7 +161,7 @@
 		setup_spawnattr(&spawnattr);		
 		posix_spawn(NULL, exec_path, NULL,
 			&spawnattr, argv, environ);
-		err(1, "posix_spawn: %s", argv[0]);
+		err(1, "posix_spawn: %s", exec_path);
 	}
 #endif
 	execve(exec_path, argv, environ);

Modified: python/branches/py3k-jit/Makefile.pre.in
==============================================================================
--- python/branches/py3k-jit/Makefile.pre.in	(original)
+++ python/branches/py3k-jit/Makefile.pre.in	Fri Apr 16 02:53:03 2010
@@ -378,7 +378,7 @@
 
 # Default target
 all:		build_all
-build_all:	$(BUILDPYTHON) oldsharedmods sharedmods
+build_all:	$(BUILDPYTHON) oldsharedmods sharedmods gdbhooks
 
 # Compile a binary with gcc profile guided optimization.
 profile-opt:
@@ -451,6 +451,17 @@
 libpython$(VERSION).sl: $(LIBRARY_OBJS)
 	$(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST)
 
+# Copy up the gdb python hooks into a position where they can be automatically
+# loaded by gdb during Lib/test/test_gdb.py
+#
+# Distributors are likely to want to install this somewhere else e.g. relative
+# to the stripped DWARF data for the shared library.
+gdbhooks: $(BUILDPYTHON)-gdb.py
+
+SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py
+$(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
+	$(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
+
 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
 # minimal framework (not including the Lib directory and such) in the current
 # directory.
@@ -748,8 +759,8 @@
 		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
 		$(TESTPYTHON) $(srcdir)/Lib/compileall.py
 		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
-		-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
-		$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
+		-$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
+		$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
 
 #  Run the unitests for both architectures in a Universal build on OSX
 #  Must be run on an Intel box.
@@ -759,9 +770,9 @@
 			exit 1 ;\
 		fi
 		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
-		-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
-		$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
-		$(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E $(TESTPROG) $(TESTOPTS) -uall
+		-$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
+		$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
+		$(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E $(TESTPROG) -uall $(TESTOPTS)
 
 
 # Like testall, but with a single pass only
@@ -770,7 +781,7 @@
 		- at if which pybuildbot.identify >/dev/null 2>&1; then \
 			pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
 		fi
-		$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall -rwW
+		$(TESTPYTHON) $(TESTPROG) -uall -rwW $(TESTOPTS)
 
 QUICKTESTOPTS=	$(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
 		test_multibytecodec test_urllib2_localnet test_itertools \
@@ -1217,6 +1228,7 @@
 	-rm -f core Makefile Makefile.pre config.status \
 		Modules/Setup Modules/Setup.local Modules/Setup.config \
 		Misc/python.pc
+	-rm -f python*-gdb.py
 	find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
 			   -o -name '[@,#]*' -o -name '*.old' \
 			   -o -name '*.orig' -o -name '*.rej' \
@@ -1280,5 +1292,6 @@
 .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
 .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean 
 .PHONY: smelly funny patchcheck
+.PHONY: gdbhooks
 
 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY

Modified: python/branches/py3k-jit/Misc/ACKS
==============================================================================
--- python/branches/py3k-jit/Misc/ACKS	(original)
+++ python/branches/py3k-jit/Misc/ACKS	Fri Apr 16 02:53:03 2010
@@ -164,6 +164,7 @@
 Steve Cousins
 Alex Coventry
 Matthew Dixon Cowles
+Ryan Coyner
 Christopher A. Craig
 Laura Creighton
 Simon Cross
@@ -491,7 +492,7 @@
 Don MacMillen
 Steve Majewski
 Grzegorz Makarewicz
-Dave Malcolm
+David Malcolm
 Ken Manheimer
 Vladimir Marangozov
 David Marek
@@ -677,6 +678,7 @@
 Rich Salz
 Kevin Samborn
 Ilya Sandler
+Mark Sapiro
 Ty Sarna
 Ben Sayer
 Michael Scharf
@@ -762,6 +764,7 @@
 Steven Taschuk
 Monty Taylor
 Amy Taylor
+Anatoly Techtonik
 Tobias Thelen
 James Thomas
 Robin Thomas

Modified: python/branches/py3k-jit/Misc/NEWS
==============================================================================
--- python/branches/py3k-jit/Misc/NEWS	(original)
+++ python/branches/py3k-jit/Misc/NEWS	Fri Apr 16 02:53:03 2010
@@ -12,6 +12,11 @@
 Core and Builtins
 -----------------
 
+- Issue #7301: Add environment variable $PYTHONWARNINGS.
+
+- Issue #8329: Don't return the same lists from select.select when no fds are
+  changed.
+
 - Issue #8259: 1L << (2**31) no longer produces an 'outrageous shift error'
   on 64-bit machines.  The shift count for either left or right shift is
   permitted to be up to sys.maxsize.
@@ -307,6 +312,31 @@
 Library
 -------
 
+- Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters.
+
+- Issue #7316: the acquire() method of lock objects in the :mod:`threading`
+  module now takes an optional timeout argument in seconds.  Timeout support
+  relies on the system threading library, so as to avoid a semi-busy wait
+  loop.
+
+- Issue #8383: pickle and pickletools use surrogatepass error handler when
+  encoding unicode as utf8 to support lone surrogates and stay compatible with
+  Python 2.x and 3.0
+
+- Issue #7585: difflib context and unified diffs now place a tab between
+  filename and date, conforming to the 'standards' they were originally
+  designed to follow.  This improves compatibility with patch tools.
+
+- Issue #7472: Fixed typo in email.encoders module; messages using ISO-2022
+  character sets will now consistently use a Content-Transfer-Encoding of
+  7bit rather than sometimes being marked as 8bit.
+
+- Issue #8375: test_distutils now checks if the temporary directory are still
+  present before it cleans them.
+
+- Issue #8374: Update the internal alias table in the :mod:`locale` module
+  to cover recent locale changes and additions.
+
 - Issue #8321: Give access to OpenSSL version numbers from the `ssl` module,
   using the new attributes `ssl.OPENSSL_VERSION`, `ssl.OPENSSL_VERSION_INFO`
   and `ssl.OPENSSL_VERSION_NUMBER`.

Modified: python/branches/py3k-jit/Misc/developers.txt
==============================================================================
--- python/branches/py3k-jit/Misc/developers.txt	(original)
+++ python/branches/py3k-jit/Misc/developers.txt	Fri Apr 16 02:53:03 2010
@@ -20,7 +20,10 @@
 Permissions History
 -------------------
 
-- Brian Curtin was given commit access on March 24 by MvL.
+- Jean-Paul Calderone was given commit access on April 6 2010 by
+  GFB, at suggestion of Michael Foord and others.
+
+- Brian Curtin was given commit access on March 24 2010 by MvL.
 
 - Florent Xicluna was given commit access on February 25 2010 by
   MvL, based on Antoine Pitrou's recommendation.

Modified: python/branches/py3k-jit/Misc/maintainers.rst
==============================================================================
--- python/branches/py3k-jit/Misc/maintainers.rst	(original)
+++ python/branches/py3k-jit/Misc/maintainers.rst	Fri Apr 16 02:53:03 2010
@@ -113,7 +113,7 @@
 hmac
 html
 http
-idlelib             kurt.kaiser
+idlelib             kbk
 imaplib
 imghdr
 imp

Modified: python/branches/py3k-jit/Misc/python.man
==============================================================================
--- python/branches/py3k-jit/Misc/python.man	(original)
+++ python/branches/py3k-jit/Misc/python.man	Fri Apr 16 02:53:03 2010
@@ -394,6 +394,9 @@
 If this is set to a non-empty string it is equivalent to specifying
 the \fB\-v\fP option. If set to an integer, it is equivalent to
 specifying \fB\-v\fP multiple times. 
+.IP PYTHONWARNINGS
+If this is set to a comma-separated string it is equivalent to
+specifying the \fB\-W\fP option for each separate value.
 .SH AUTHOR
 The Python Software Foundation: http://www.python.org/psf
 .SH INTERNET RESOURCES

Modified: python/branches/py3k-jit/Modules/_pickle.c
==============================================================================
--- python/branches/py3k-jit/Modules/_pickle.c	(original)
+++ python/branches/py3k-jit/Modules/_pickle.c	Fri Apr 16 02:53:03 2010
@@ -1227,7 +1227,9 @@
     if (self->bin) {
         char pdata[5];
 
-        encoded = PyUnicode_AsUTF8String(obj);
+        encoded = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(obj),
+                                    PyUnicode_GET_SIZE(obj),
+                                    "surrogatepass");
         if (encoded == NULL)
             goto error;
 
@@ -3352,7 +3354,7 @@
     if (unpickler_read(self, &s, size) < 0)
         return -1;
 
-    str = PyUnicode_DecodeUTF8(s, size, NULL);
+    str = PyUnicode_DecodeUTF8(s, size, "surrogatepass");
     if (str == NULL)
         return -1;
 

Modified: python/branches/py3k-jit/Modules/_sre.c
==============================================================================
--- python/branches/py3k-jit/Modules/_sre.c	(original)
+++ python/branches/py3k-jit/Modules/_sre.c	Fri Apr 16 02:53:03 2010
@@ -3903,12 +3903,9 @@
     PyObject* d;
     PyObject* x;
 
-    /* Initialize object types */
-    if (PyType_Ready(&Pattern_Type) < 0)
-        return NULL;
-    if (PyType_Ready(&Match_Type) < 0)
-        return NULL;
-    if (PyType_Ready(&Scanner_Type) < 0)
+    /* Patch object types */
+    if (PyType_Ready(&Pattern_Type) || PyType_Ready(&Match_Type) ||
+        PyType_Ready(&Scanner_Type))
         return NULL;
 
     m = PyModule_Create(&sremodule);

Modified: python/branches/py3k-jit/Modules/_ssl.c
==============================================================================
--- python/branches/py3k-jit/Modules/_ssl.c	(original)
+++ python/branches/py3k-jit/Modules/_ssl.c	Fri Apr 16 02:53:03 2010
@@ -369,7 +369,9 @@
 	self->ssl = SSL_new(self->ctx); /* New ssl struct */
 	PySSL_END_ALLOW_THREADS
 	SSL_set_fd(self->ssl, Sock->sock_fd);	/* Set the socket for SSL */
+#ifdef SSL_MODE_AUTO_RETRY
 	SSL_set_mode(self->ssl, SSL_MODE_AUTO_RETRY);
+#endif
 
 	/* If the socket is in non-blocking mode or timeout mode, set the BIO
 	 * to non-blocking mode (blocking is the default)

Modified: python/branches/py3k-jit/Modules/_threadmodule.c
==============================================================================
--- python/branches/py3k-jit/Modules/_threadmodule.c	(original)
+++ python/branches/py3k-jit/Modules/_threadmodule.c	Fri Apr 16 02:53:03 2010
@@ -40,18 +40,47 @@
 }
 
 static PyObject *
-lock_PyThread_acquire_lock(lockobject *self, PyObject *args)
+lock_PyThread_acquire_lock(lockobject *self, PyObject *args, PyObject *kwds)
 {
-	int i = 1;
+	char *kwlist[] = {"blocking", "timeout", NULL};
+	int blocking = 1;
+	double timeout = -1;
+	PY_TIMEOUT_T microseconds;
+	int r;
 
-	if (!PyArg_ParseTuple(args, "|i:acquire", &i))
+	if (!PyArg_ParseTupleAndKeywords(args, kwds, "|id:acquire", kwlist,
+					 &blocking, &timeout))
 		return NULL;
 
+	if (!blocking && timeout != -1) {
+		PyErr_SetString(PyExc_ValueError, "can't specify a timeout "
+				"for a non-blocking call");
+		return NULL;
+	}
+	if (timeout < 0 && timeout != -1) {
+		PyErr_SetString(PyExc_ValueError, "timeout value must be "
+				"strictly positive");
+		return NULL;
+	}
+	if (!blocking)
+		microseconds = 0;
+	else if (timeout == -1)
+		microseconds = -1;
+	else {
+		timeout *= 1e6;
+		if (timeout >= (double) PY_TIMEOUT_MAX) {
+			PyErr_SetString(PyExc_OverflowError,
+					"timeout value is too large");
+			return NULL;
+		}
+		microseconds = (PY_TIMEOUT_T) timeout;
+	}
+	
 	Py_BEGIN_ALLOW_THREADS
-	i = PyThread_acquire_lock(self->lock_lock, i);
+	r = PyThread_acquire_lock_timed(self->lock_lock, microseconds);
 	Py_END_ALLOW_THREADS
 
-	return PyBool_FromLong((long)i);
+	return PyBool_FromLong(r);
 }
 
 PyDoc_STRVAR(acquire_doc,
@@ -106,9 +135,9 @@
 
 static PyMethodDef lock_methods[] = {
 	{"acquire_lock", (PyCFunction)lock_PyThread_acquire_lock, 
-	 METH_VARARGS, acquire_doc},
+	 METH_VARARGS | METH_KEYWORDS, acquire_doc},
 	{"acquire",      (PyCFunction)lock_PyThread_acquire_lock, 
-	 METH_VARARGS, acquire_doc},
+	 METH_VARARGS | METH_KEYWORDS, acquire_doc},
 	{"release_lock", (PyCFunction)lock_PyThread_release_lock, 
 	 METH_NOARGS, release_doc},
 	{"release",      (PyCFunction)lock_PyThread_release_lock, 
@@ -118,7 +147,7 @@
 	{"locked",       (PyCFunction)lock_locked_lock,  
 	 METH_NOARGS, locked_doc},
 	{"__enter__",    (PyCFunction)lock_PyThread_acquire_lock,
-	 METH_VARARGS, acquire_doc},
+	 METH_VARARGS | METH_KEYWORDS, acquire_doc},
 	{"__exit__",    (PyCFunction)lock_PyThread_release_lock,
 	 METH_VARARGS, release_doc},
 	{NULL,           NULL}		/* sentinel */
@@ -183,15 +212,41 @@
 static PyObject *
 rlock_acquire(rlockobject *self, PyObject *args, PyObject *kwds)
 {
-	char *kwlist[] = {"blocking", NULL};
+	char *kwlist[] = {"blocking", "timeout", NULL};
 	int blocking = 1;
+	double timeout = -1;
+	PY_TIMEOUT_T microseconds;
 	long tid;
 	int r = 1;
 
-	if (!PyArg_ParseTupleAndKeywords(args, kwds, "|i:acquire", kwlist,
-				         &blocking))
+	if (!PyArg_ParseTupleAndKeywords(args, kwds, "|id:acquire", kwlist,
+					 &blocking, &timeout))
 		return NULL;
 
+	if (!blocking && timeout != -1) {
+		PyErr_SetString(PyExc_ValueError, "can't specify a timeout "
+				"for a non-blocking call");
+		return NULL;
+	}
+	if (timeout < 0 && timeout != -1) {
+		PyErr_SetString(PyExc_ValueError, "timeout value must be "
+				"strictly positive");
+		return NULL;
+	}
+	if (!blocking)
+		microseconds = 0;
+	else if (timeout == -1)
+		microseconds = -1;
+	else {
+		timeout *= 1e6;
+		if (timeout >= (double) PY_TIMEOUT_MAX) {
+			PyErr_SetString(PyExc_OverflowError,
+					"timeout value is too large");
+			return NULL;
+		}
+		microseconds = (PY_TIMEOUT_T) timeout;
+	}
+	
 	tid = PyThread_get_thread_ident();
 	if (self->rlock_count > 0 && tid == self->rlock_owner) {
 		unsigned long count = self->rlock_count + 1;
@@ -206,11 +261,11 @@
 
 	if (self->rlock_count > 0 ||
 	    !PyThread_acquire_lock(self->rlock_lock, 0)) {
-		if (!blocking) {
+		if (microseconds == 0) {
 			Py_RETURN_FALSE;
 		}
 		Py_BEGIN_ALLOW_THREADS
-		r = PyThread_acquire_lock(self->rlock_lock, blocking);
+		r = PyThread_acquire_lock_timed(self->rlock_lock, microseconds);
 		Py_END_ALLOW_THREADS
 	}
 	if (r) {
@@ -1005,7 +1060,7 @@
 PyMODINIT_FUNC
 PyInit__thread(void)
 {
-	PyObject *m, *d;
+	PyObject *m, *d, *timeout_max;
 	
 	/* Initialize types: */
 	if (PyType_Ready(&localtype) < 0)
@@ -1020,6 +1075,12 @@
 	if (m == NULL)
 		return NULL;
 
+	timeout_max = PyFloat_FromDouble(PY_TIMEOUT_MAX / 1000000);
+	if (!timeout_max)
+		return NULL;
+	if (PyModule_AddObject(m, "TIMEOUT_MAX", timeout_max) < 0)
+		return NULL;
+
 	/* Add a symbolic constant */
 	d = PyModule_GetDict(m);
 	ThreadError = PyErr_NewException("_thread.error", NULL, NULL);

Modified: python/branches/py3k-jit/Modules/datetimemodule.c
==============================================================================
--- python/branches/py3k-jit/Modules/datetimemodule.c	(original)
+++ python/branches/py3k-jit/Modules/datetimemodule.c	Fri Apr 16 02:53:03 2010
@@ -4803,10 +4803,10 @@
 	Py_INCREF(&PyDateTime_TZInfoType);
 	PyModule_AddObject(m, "tzinfo", (PyObject *) &PyDateTime_TZInfoType);
 
-    x = PyCapsule_New(&CAPI, PyDateTime_CAPSULE_NAME, NULL);
-    if (x == NULL)
-        return NULL;
-    PyModule_AddObject(m, "datetime_CAPI", x);
+	x = PyCapsule_New(&CAPI, PyDateTime_CAPSULE_NAME, NULL);
+	if (x == NULL)
+		return NULL;
+	PyModule_AddObject(m, "datetime_CAPI", x);
 
 	/* A 4-year cycle has an extra leap day over what we'd get from
 	 * pasting together 4 single years.

Modified: python/branches/py3k-jit/Modules/main.c
==============================================================================
--- python/branches/py3k-jit/Modules/main.c	(original)
+++ python/branches/py3k-jit/Modules/main.c	Fri Apr 16 02:53:03 2010
@@ -82,6 +82,7 @@
          can be supplied multiple times to increase verbosity\n\
 -V     : print the Python version number and exit (also --version)\n\
 -W arg : warning control; arg is action:message:category:module:lineno\n\
+         also PYTHONWARNINGS=arg\n\
 -x     : skip first line of source, allowing use of non-Unix forms of #!cmd\n\
 ";
 static char *usage_4 = "\
@@ -265,6 +266,9 @@
 	wchar_t *module = NULL;
 	FILE *fp = stdin;
 	char *p;
+#ifdef MS_WINDOWS
+	wchar_t *wp;
+#endif
 	int skipfirstline = 0;
 	int stdin_is_interactive = 0;
 	int help = 0;
@@ -401,6 +405,49 @@
 	    (p = Py_GETENV("PYTHONNOUSERSITE")) && *p != '\0')
 		Py_NoUserSiteDirectory = 1;
 
+#ifdef MS_WINDOWS
+	if (!Py_IgnoreEnvironmentFlag && (wp = _wgetenv(L"PYTHONWARNINGS")) &&
+	    *wp != L'\0') {
+		wchar_t *buf, *warning;
+
+		buf = (wchar_t *)malloc((wcslen(wp) + 1) * sizeof(wchar_t));
+		if (buf == NULL)
+			Py_FatalError(
+			   "not enough memory to copy PYTHONWARNINGS");
+		wcscpy(buf, wp);
+		for (warning = wcstok(buf, L",");
+		     warning != NULL;
+		     warning = wcstok(NULL, L",")) {
+			PySys_AddWarnOption(warning);
+		}
+		free(buf);
+	}
+#else
+	if ((p = Py_GETENV("PYTHONWARNINGS")) && *p != '\0') {
+		char *buf, *oldloc;
+		wchar_t *warning;
+
+		/* settle for strtok here as there's no one standard
+		   C89 wcstok */
+		buf = (char *)malloc(strlen(p) + 1);
+		if (buf == NULL)
+			Py_FatalError(
+			   "not enough memory to copy PYTHONWARNINGS");
+		strcpy(buf, p);
+		oldloc = strdup(setlocale(LC_ALL, NULL));
+		setlocale(LC_ALL, "");
+		for (p = strtok(buf, ","); p != NULL; p = strtok(NULL, ",")) {
+			if ((warning = _Py_char2wchar(p)) != NULL) {
+				PySys_AddWarnOption(warning);
+				PyMem_Free(warning);
+			}
+		}
+		setlocale(LC_ALL, oldloc);
+		free(oldloc);
+		free(buf);
+	}
+#endif
+
 	if (command == NULL && module == NULL && _PyOS_optind < argc &&
 	    wcscmp(argv[_PyOS_optind], L"-") != 0)
 	{

Modified: python/branches/py3k-jit/Modules/posixmodule.c
==============================================================================
--- python/branches/py3k-jit/Modules/posixmodule.c	(original)
+++ python/branches/py3k-jit/Modules/posixmodule.c	Fri Apr 16 02:53:03 2010
@@ -4171,6 +4171,53 @@
 }
 #endif
 
+#ifdef MS_WINDOWS
+PyDoc_STRVAR(win32_kill__doc__,
+"kill(pid, sig)\n\n\
+Kill a process with a signal.");
+
+static PyObject *
+win32_kill(PyObject *self, PyObject *args)
+{
+	PyObject *result, handle_obj;
+	DWORD pid, sig, err;
+	HANDLE handle;
+
+	if (!PyArg_ParseTuple(args, "kk:kill", &pid, &sig))
+		return NULL;
+
+	/* Console processes which share a common console can be sent CTRL+C or
+	   CTRL+BREAK events, provided they handle said events. */
+	if (sig == CTRL_C_EVENT || sig == CTRL_BREAK_EVENT) {
+		if (GenerateConsoleCtrlEvent(sig, pid) == 0) {
+			err = GetLastError();
+			PyErr_SetFromWindowsErr(err);
+		}
+		else
+			Py_RETURN_NONE;
+	}
+
+	/* If the signal is outside of what GenerateConsoleCtrlEvent can use,
+	   attempt to open and terminate the process. */
+	handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
+	if (handle == NULL) {
+		err = GetLastError();
+		return PyErr_SetFromWindowsErr(err);
+	}
+
+	if (TerminateProcess(handle, sig) == 0) {
+		err = GetLastError();
+		result = PyErr_SetFromWindowsErr(err);
+	} else {
+		Py_INCREF(Py_None);
+		result = Py_None;
+	}
+
+	CloseHandle(handle);
+	return result;
+}
+#endif /* MS_WINDOWS */
+
 #ifdef HAVE_PLOCK
 
 #ifdef HAVE_SYS_LOCK_H
@@ -7200,6 +7247,7 @@
 #endif /* HAVE_PLOCK */
 #ifdef MS_WINDOWS
 	{"startfile",	win32_startfile, METH_VARARGS, win32_startfile__doc__},
+	{"kill",    win32_kill, METH_VARARGS, win32_kill__doc__},
 #endif
 #ifdef HAVE_SETUID
 	{"setuid",	posix_setuid, METH_VARARGS, posix_setuid__doc__},

Modified: python/branches/py3k-jit/Modules/python.c
==============================================================================
--- python/branches/py3k-jit/Modules/python.c	(original)
+++ python/branches/py3k-jit/Modules/python.c	Fri Apr 16 02:53:03 2010
@@ -14,8 +14,8 @@
 	return Py_Main(argc, argv);
 }
 #else
-static wchar_t*
-char2wchar(char* arg)
+wchar_t*
+_Py_char2wchar(char* arg)
 {
 	wchar_t *res;
 #ifdef HAVE_BROKEN_MBSTOWCS
@@ -143,7 +143,7 @@
 	oldloc = strdup(setlocale(LC_ALL, NULL));
 	setlocale(LC_ALL, "");
 	for (i = 0; i < argc; i++) {
-		argv_copy2[i] = argv_copy[i] = char2wchar(argv[i]);
+		argv_copy2[i] = argv_copy[i] = _Py_char2wchar(argv[i]);
 		if (!argv_copy[i])
 			return 1;
 	}

Modified: python/branches/py3k-jit/Modules/selectmodule.c
==============================================================================
--- python/branches/py3k-jit/Modules/selectmodule.c	(original)
+++ python/branches/py3k-jit/Modules/selectmodule.c	Fri Apr 16 02:53:03 2010
@@ -284,14 +284,6 @@
 		PyErr_SetFromErrno(SelectError);
 	}
 #endif
-	else if (n == 0) {
-                /* optimization */
-		ifdlist = PyList_New(0);
-		if (ifdlist) {
-			ret = PyTuple_Pack(3, ifdlist, ifdlist, ifdlist);
-			Py_DECREF(ifdlist);
-		}
-	}
 	else {
 		/* any of these three calls can raise an exception.  it's more
 		   convenient to test for this after all three calls... but

Modified: python/branches/py3k-jit/Modules/signalmodule.c
==============================================================================
--- python/branches/py3k-jit/Modules/signalmodule.c	(original)
+++ python/branches/py3k-jit/Modules/signalmodule.c	Fri Apr 16 02:53:03 2010
@@ -7,6 +7,7 @@
 #include "intrcheck.h"
 
 #ifdef MS_WINDOWS
+#include <Windows.h>
 #ifdef HAVE_PROCESS_H
 #include <process.h>
 #endif
@@ -805,6 +806,18 @@
     	PyDict_SetItemString(d, "ItimerError", ItimerError);
 #endif
 
+#ifdef CTRL_C_EVENT
+    x = PyLong_FromLong(CTRL_C_EVENT);
+    PyDict_SetItemString(d, "CTRL_C_EVENT", x);
+    Py_DECREF(x);
+#endif
+
+#ifdef CTRL_BREAK_EVENT
+    x = PyLong_FromLong(CTRL_BREAK_EVENT);
+    PyDict_SetItemString(d, "CTRL_BREAK_EVENT", x);
+    Py_DECREF(x);
+#endif
+
     if (PyErr_Occurred()) {
 	    Py_DECREF(m);
 	    m = NULL;

Modified: python/branches/py3k-jit/Objects/longobject.c
==============================================================================
--- python/branches/py3k-jit/Objects/longobject.c	(original)
+++ python/branches/py3k-jit/Objects/longobject.c	Fri Apr 16 02:53:03 2010
@@ -1111,7 +1111,7 @@
 	int ndigits = 0;
 
 	if (ival < PyLong_BASE)
-		return PyLong_FromLong(ival);
+		return PyLong_FromLong((long)ival);
 	/* Count the number of Python digits. */
 	t = ival;
 	while (t) {
@@ -2405,7 +2405,7 @@
 		while (x_size < shift_digits)
 			x_digits[x_size++] = 0;
 		rem = v_lshift(x_digits + x_size, a->ob_digit, a_size,
-			       shift_bits);
+			       (int)shift_bits);
 		x_size += a_size;
 		x_digits[x_size++] = rem;
 	}
@@ -2413,7 +2413,7 @@
 		shift_digits = (a_bits - DBL_MANT_DIG - 2) / PyLong_SHIFT;
 		shift_bits = (a_bits - DBL_MANT_DIG - 2) % PyLong_SHIFT;
 		rem = v_rshift(x_digits, a->ob_digit + shift_digits,
-			       a_size - shift_digits, shift_bits);
+			       a_size - shift_digits, (int)shift_bits);
 		x_size = a_size - shift_digits;
 		/* For correct rounding below, we need the least significant
 		   bit of x to be 'sticky' for this shift: if any of the bits
@@ -2475,7 +2475,7 @@
 				"long int too large to convert to float");
 		return -1.0;
 	}
-	return ldexp(x, exponent);
+	return ldexp(x, (int)exponent);
 }
 
 /* Methods */
@@ -3492,9 +3492,9 @@
 
 	/* Check whether ldexp result will overflow a double. */
 	if (shift + x_bits >= DBL_MAX_EXP &&
-	    (shift + x_bits > DBL_MAX_EXP || dx == ldexp(1.0, x_bits)))
+	    (shift + x_bits > DBL_MAX_EXP || dx == ldexp(1.0, (int)x_bits)))
 		goto overflow;
-	result = ldexp(dx, shift);
+	result = ldexp(dx, (int)shift);
 
   success:
 	return PyFloat_FromDouble(negate ? -result : result);
@@ -4362,7 +4362,7 @@
 	Py_DECREF(result);
 	result = y;
 
-	x = (PyLongObject *)PyLong_FromLong(msd_bits);
+	x = (PyLongObject *)PyLong_FromLong((long)msd_bits);
 	if (x == NULL)
 		goto error;
 	y = (PyLongObject *)long_add(result, x);

Modified: python/branches/py3k-jit/PC/_subprocess.c
==============================================================================
--- python/branches/py3k-jit/PC/_subprocess.c	(original)
+++ python/branches/py3k-jit/PC/_subprocess.c	Fri Apr 16 02:53:03 2010
@@ -599,5 +599,7 @@
 	defint(d, "INFINITE", INFINITE);
 	defint(d, "WAIT_OBJECT_0", WAIT_OBJECT_0);
 	defint(d, "CREATE_NEW_CONSOLE", CREATE_NEW_CONSOLE);
+	defint(d, "CREATE_NEW_PROCESS_GROUP", CREATE_NEW_PROCESS_GROUP);
+
 	return m;
 }

Modified: python/branches/py3k-jit/Python/thread_nt.h
==============================================================================
--- python/branches/py3k-jit/Python/thread_nt.h	(original)
+++ python/branches/py3k-jit/Python/thread_nt.h	Fri Apr 16 02:53:03 2010
@@ -34,13 +34,13 @@
 }
 
 DWORD
-EnterNonRecursiveMutex(PNRMUTEX mutex, BOOL wait)
+EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds)
 {
 	/* Assume that the thread waits successfully */
 	DWORD ret ;
 
 	/* InterlockedIncrement(&mutex->owned) == 0 means that no thread currently owns the mutex */
-	if (!wait)
+	if (milliseconds == 0)
 	{
 		if (InterlockedCompareExchange(&mutex->owned, 0, -1) != -1)
 			return WAIT_TIMEOUT ;
@@ -49,7 +49,7 @@
 	else
 		ret = InterlockedIncrement(&mutex->owned) ?
 			/* Some thread owns the mutex, let's wait... */
-			WaitForSingleObject(mutex->hevent, INFINITE) : WAIT_OBJECT_0 ;
+			WaitForSingleObject(mutex->hevent, milliseconds) : WAIT_OBJECT_0 ;
 
 	mutex->thread_id = GetCurrentThreadId() ; /* We own it */
 	return ret ;
@@ -239,18 +239,37 @@
  * if the lock has already been acquired by this thread!
  */
 int
-PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
+PyThread_acquire_lock_timed(PyThread_type_lock aLock, PY_TIMEOUT_T microseconds)
 {
 	int success ;
+	PY_TIMEOUT_T milliseconds;
+
+	if (microseconds >= 0) {
+		milliseconds = microseconds / 1000;
+		if (microseconds % 1000 > 0)
+			++milliseconds;
+		if ((DWORD) milliseconds != milliseconds)
+			Py_FatalError("Timeout too large for a DWORD, "
+				       "please check PY_TIMEOUT_MAX");
+	}
+	else
+		milliseconds = INFINITE;
 
-	dprintf(("%ld: PyThread_acquire_lock(%p, %d) called\n", PyThread_get_thread_ident(),aLock, waitflag));
+	dprintf(("%ld: PyThread_acquire_lock_timed(%p, %lld) called\n",
+		 PyThread_get_thread_ident(), aLock, microseconds));
 
-	success = aLock && EnterNonRecursiveMutex((PNRMUTEX) aLock, (waitflag ? INFINITE : 0)) == WAIT_OBJECT_0 ;
+	success = aLock && EnterNonRecursiveMutex((PNRMUTEX) aLock, (DWORD) milliseconds) == WAIT_OBJECT_0 ;
 
-	dprintf(("%ld: PyThread_acquire_lock(%p, %d) -> %d\n", PyThread_get_thread_ident(),aLock, waitflag, success));
+	dprintf(("%ld: PyThread_acquire_lock(%p, %lld) -> %d\n",
+		 PyThread_get_thread_ident(), aLock, microseconds, success));
 
 	return success;
 }
+int
+PyThread_acquire_lock(PyThread_type_lock aLock, int waitflag)
+{
+	return PyThread_acquire_lock_timed(aLock, waitflag ? -1 : 0);
+}
 
 void
 PyThread_release_lock(PyThread_type_lock aLock)

Modified: python/branches/py3k-jit/Python/thread_pthread.h
==============================================================================
--- python/branches/py3k-jit/Python/thread_pthread.h	(original)
+++ python/branches/py3k-jit/Python/thread_pthread.h	Fri Apr 16 02:53:03 2010
@@ -83,6 +83,26 @@
 #endif
 
 
+/* We assume all modern POSIX systems have gettimeofday() */
+#ifdef GETTIMEOFDAY_NO_TZ
+#define GETTIMEOFDAY(ptv) gettimeofday(ptv)
+#else
+#define GETTIMEOFDAY(ptv) gettimeofday(ptv, (struct timezone *)NULL)
+#endif
+
+#define MICROSECONDS_TO_TIMESPEC(microseconds, ts) \
+do { \
+	struct timeval tv; \
+	GETTIMEOFDAY(&tv); \
+	tv.tv_usec += microseconds % 1000000; \
+	tv.tv_sec += microseconds / 1000000; \
+	tv.tv_sec += tv.tv_usec / 1000000; \
+	tv.tv_usec %= 1000000; \
+	ts.tv_sec = tv.tv_sec; \
+	ts.tv_nsec = tv.tv_usec * 1000; \
+} while(0)
+
+
 /* A pthread mutex isn't sufficient to model the Python lock type
  * because, according to Draft 5 of the docs (P1003.4a/D5), both of the
  * following are undefined:
@@ -295,34 +315,53 @@
 	return (status == -1) ? errno : status;
 }
 
-int 
-PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
+int
+PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds)
 {
 	int success;
 	sem_t *thelock = (sem_t *)lock;
 	int status, error = 0;
+	struct timespec ts;
 
-	dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
+	dprintf(("PyThread_acquire_lock_timed(%p, %lld) called\n",
+		 lock, microseconds));
 
+	if (microseconds > 0)
+		MICROSECONDS_TO_TIMESPEC(microseconds, ts);
 	do {
-		if (waitflag)
-			status = fix_status(sem_wait(thelock));
-		else
+		if (microseconds > 0)
+			status = fix_status(sem_timedwait(thelock, &ts));
+		else if (microseconds == 0)
 			status = fix_status(sem_trywait(thelock));
+		else
+			status = fix_status(sem_wait(thelock));
 	} while (status == EINTR); /* Retry if interrupted by a signal */
 
-	if (waitflag) {
+	if (microseconds > 0) {
+		if (status != ETIMEDOUT)
+			CHECK_STATUS("sem_timedwait");
+	}
+	else if (microseconds == 0) {
+		if (status != EAGAIN)
+			CHECK_STATUS("sem_trywait");
+	}
+	else {
 		CHECK_STATUS("sem_wait");
-	} else if (status != EAGAIN) {
-		CHECK_STATUS("sem_trywait");
 	}
 	
 	success = (status == 0) ? 1 : 0;
 
-	dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));
+	dprintf(("PyThread_acquire_lock_timed(%p, %lld) -> %d\n",
+		 lock, microseconds, success));
 	return success;
 }
 
+int 
+PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
+{
+	return PyThread_acquire_lock_timed(lock, waitflag ? -1 : 0);
+}
+
 void 
 PyThread_release_lock(PyThread_type_lock lock)
 {
@@ -390,40 +429,62 @@
 	free((void *)thelock);
 }
 
-int 
-PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
+int
+PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds)
 {
 	int success;
 	pthread_lock *thelock = (pthread_lock *)lock;
 	int status, error = 0;
 
-	dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
+	dprintf(("PyThread_acquire_lock_timed(%p, %lld) called\n",
+		 lock, microseconds));
 
 	status = pthread_mutex_lock( &thelock->mut );
 	CHECK_STATUS("pthread_mutex_lock[1]");
 	success = thelock->locked == 0;
 
-	if ( !success && waitflag ) {
+	if (!success && microseconds != 0) {
+		struct timespec ts;
+		if (microseconds > 0)
+			MICROSECONDS_TO_TIMESPEC(microseconds, ts);
 		/* continue trying until we get the lock */
 
 		/* mut must be locked by me -- part of the condition
 		 * protocol */
-		while ( thelock->locked ) {
-			status = pthread_cond_wait(&thelock->lock_released,
-						   &thelock->mut);
-			CHECK_STATUS("pthread_cond_wait");
+		while (thelock->locked) {
+			if (microseconds > 0) {
+				status = pthread_cond_timedwait(
+					&thelock->lock_released,
+					&thelock->mut, &ts);
+				if (status == ETIMEDOUT)
+					break;
+				CHECK_STATUS("pthread_cond_timed_wait");
+			}
+			else {
+				status = pthread_cond_wait(
+					&thelock->lock_released,
+					&thelock->mut);
+				CHECK_STATUS("pthread_cond_wait");
+			}
 		}
-		success = 1;
+		success = (status == 0);
 	}
 	if (success) thelock->locked = 1;
 	status = pthread_mutex_unlock( &thelock->mut );
 	CHECK_STATUS("pthread_mutex_unlock[1]");
 
 	if (error) success = 0;
-	dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));
+	dprintf(("PyThread_acquire_lock_timed(%p, %lld) -> %d\n",
+		 lock, microseconds, success));
 	return success;
 }
 
+int 
+PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
+{
+	return PyThread_acquire_lock_timed(lock, waitflag ? -1 : 0);
+}
+
 void 
 PyThread_release_lock(PyThread_type_lock lock)
 {

Modified: python/branches/py3k-jit/Tools/README
==============================================================================
--- python/branches/py3k-jit/Tools/README	(original)
+++ python/branches/py3k-jit/Tools/README	Fri Apr 16 02:53:03 2010
@@ -16,6 +16,9 @@
 
 freeze		Create a stand-alone executable from a Python program.
 
+gdb             Python code to be run inside gdb, to make it easier to
+                debug Python itself (by David Malcolm).
+
 i18n		Tools for internationalization. pygettext.py 
 		parses Python source code and generates .pot files,
 		and msgfmt.py generates a binary message catalog 

Modified: python/branches/py3k-jit/Tools/i18n/makelocalealias.py
==============================================================================
--- python/branches/py3k-jit/Tools/i18n/makelocalealias.py	(original)
+++ python/branches/py3k-jit/Tools/i18n/makelocalealias.py	Fri Apr 16 02:53:03 2010
@@ -9,7 +9,7 @@
 import locale
 
 # Location of the alias file
-LOCALE_ALIAS = '/usr/lib/X11/locale/locale.alias'
+LOCALE_ALIAS = '/usr/share/X11/locale/locale.alias'
 
 def parse(filename):
 

Modified: python/branches/py3k-jit/configure
==============================================================================
--- python/branches/py3k-jit/configure	(original)
+++ python/branches/py3k-jit/configure	Fri Apr 16 02:53:03 2010
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 79355 .
+# From configure.in Revision: 79975 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for python 3.2.
 #
@@ -710,6 +710,7 @@
 LIBTOOL_CRUFT
 SO
 LDSHARED
+LDCXXSHARED
 BLDSHARED
 CCSHARED
 LINKFORSHARED
@@ -4699,40 +4700,7 @@
 	        if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
 		   UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
 		   ARCH_RUN_32BIT=""
-		   LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
-
-                   # You have to use different flags on various versions of
-		   # OSX to extract PPC code from an universal binary, basically
-                   # '-arch ppc' on OSX 10.4 and '-arch ppc7400' on anything
-                   # newer.
-                   # Because '-arch pp7400' works on OSX 10.5 or higher this
-                   # test is only present in the '32-bit' branch, all other
-                   # branches require OSX 10.5 to compile.
-
-		   { echo "$as_me:$LINENO: checking lipo flag for extracting ppc code" >&5
-echo $ECHO_N "checking lipo flag for extracting ppc code... $ECHO_C" >&6; }
-		   FN="test.$$"
-		   cat >${FN}.c <<-EOF
-		        int main() { return 0; }
-EOF
-		   ${CC} ${CFLAGS} -arch ppc -arch i386 -o ${FN} ${FN}.c -isysroot ${UNIVERSALSDK}
-		   if test $? != 0 ; then
-			   rm ${FN} ${FN}.c
-			   { echo "$as_me:$LINENO: result: failed, assumee -extract ppc7400" >&5
-echo "${ECHO_T}failed, assumee -extract ppc7400" >&6; }
-		   else
-			   lipo "${FN}" -extract ppc7400 -output "${FN}.out" 2>/dev/null
-			   if test $? != 0 ; then
-			       LIPO_32BIT_FLAGS="-extract ppc -extract i386"
-			       { echo "$as_me:$LINENO: result: \"'-extract ppc'\"" >&5
-echo "${ECHO_T}\"'-extract ppc'\"" >&6; }
-			   else
-			       { echo "$as_me:$LINENO: result: \"'-extract ppc7400'\"" >&5
-echo "${ECHO_T}\"'-extract ppc7400'\"" >&6; }
-			   fi
-			   rm -f ${FN} ${FN}.c ${FN}.out
-		   fi
-
+		   LIPO_32BIT_FLAGS=""
 	         elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
 		   UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
 		   LIPO_32BIT_FLAGS=""
@@ -14663,6 +14631,7 @@
 
 
 
+
 # SO is the extension of shared libraries `(including the dot!)
 # -- usually .so, .sl on HP-UX, .dll on Cygwin
 { echo "$as_me:$LINENO: checking SO" >&5
@@ -14715,36 +14684,47 @@
 	IRIX/5*) LDSHARED="ld -shared";;
 	IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
 	SunOS/5*)
-		if test "$GCC" = "yes"
-		then LDSHARED='$(CC) -shared'
-		else LDSHARED='$(CC) -G';
+		if test "$GCC" = "yes" ; then
+			LDSHARED='$(CC) -shared'
+			LDCXXSHARED='$(CXX) -shared'
+		else
+			LDSHARED='$(CC) -G'
+			LDCXXSHARED='$(CXX) -G'
 		fi ;;
 	hp*|HP*)
-		if test "$GCC" = "yes"
-		then LDSHARED='$(CC) -shared'
-		else LDSHARED='ld -b';
+		if test "$GCC" = "yes" ; then
+			LDSHARED='$(CC) -shared'
+			LDCXXSHARED='$(CXX) -shared'
+		else
+			LDSHARED='ld -b'
 		fi ;;
 	OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
 	Darwin/1.3*)
 		LDSHARED='$(CC) $(LDFLAGS) -bundle'
+		LDCXXSHARED='$(CXX) $(LDFLAGS) -bundle'
 		if test "$enable_framework" ; then
 			# Link against the framework. All externals should be defined.
 			BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
 			LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+			LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
 		else
 			# No framework. Ignore undefined symbols, assuming they come from Python
 			LDSHARED="$LDSHARED -undefined suppress"
+			LDCXXSHARED="$LDCXXSHARED -undefined suppress"
 		fi ;;
 	Darwin/1.4*|Darwin/5.*|Darwin/6.*)
 		LDSHARED='$(CC) $(LDFLAGS) -bundle'
+		LDCXXSHARED='$(CXX) $(LDFLAGS) -bundle'
 		if test "$enable_framework" ; then
 			# Link against the framework. All externals should be defined.
 			BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
 			LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+			LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
 		else
 			# No framework, use the Python app as bundle-loader
 			BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
 			LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+			LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
 		fi ;;
 	Darwin/*)
 		# Use -undefined dynamic_lookup whenever possible (10.3 and later).
@@ -14756,26 +14736,35 @@
 				LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
 			fi
 			LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
+			LDCXXSHARED='$(CXX) $(LDFLAGS) -bundle -undefined dynamic_lookup'
 			BLDSHARED="$LDSHARED"
 		else
 			LDSHARED='$(CC) $(LDFLAGS) -bundle'
+			LDCXXSHARED='$(CXX) $(LDFLAGS) -bundle'
 			if test "$enable_framework" ; then
 				# Link against the framework. All externals should be defined.
 				BLDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
 				LDSHARED="$LDSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
+				LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
 			else
 				# No framework, use the Python app as bundle-loader
 				BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
 				LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+				LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
 			fi
 		fi
 		;;
-	Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
-	BSD/OS*/4*) LDSHARED="gcc -shared";;
+	Linux*|GNU*|QNX*)
+		LDSHARED='$(CC) -shared'
+		LDCXXSHARED='$(CXX) -shared';;
+	BSD/OS*/4*)
+		LDSHARED="gcc -shared"
+		LDCXXSHARED="g++ -shared";;
 	FreeBSD*)
 		if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
 		then
 			LDSHARED='$(CC) -shared ${LDFLAGS}'
+			LDCXXSHARED='$(CXX) -shared ${LDFLAGS}'
 		else
 			LDSHARED="ld -Bshareable ${LDFLAGS}"
 		fi;;
@@ -14783,6 +14772,7 @@
 		if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
 		then
 				LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
+				LDCXXSHARED='$(CXX) -shared $(CCSHARED) ${LDFLAGS}'
 		else
 				case `uname -r` in
 				[01].* | 2.[0-7] | 2.[0-7].*)
@@ -14790,22 +14780,33 @@
 				   ;;
 				*)
 				   LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
+				   LDCXXSHARED='$(CXX) -shared $(CCSHARED) ${LDFLAGS}'
 				   ;;
 				esac
 		fi;;
-	NetBSD*|DragonFly*) LDSHARED="cc -shared ${LDFLAGS}";;
+	NetBSD*|DragonFly*)
+		LDSHARED="cc -shared ${LDFLAGS}"
+		LDCXXSHARED="c++ -shared ${LDFLAGS}";;
 	OpenUNIX*|UnixWare*)
-		if test "$GCC" = "yes"
-		then LDSHARED='$(CC) -shared'
-		else LDSHARED='$(CC) -G'
+		if test "$GCC" = "yes" ; then
+			LDSHARED='$(CC) -shared'
+			LDCXXSHARED='$(CXX) -shared'
+		else
+			LDSHARED='$(CC) -G'
+			LDCXXSHARED='$(CXX) -G'
 		fi;;
-	SCO_SV*) LDSHARED='$(CC) -Wl,-G,-Bexport';;
-	CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";;
+	SCO_SV*)
+		LDSHARED='$(CC) -Wl,-G,-Bexport'
+		LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';;
+	CYGWIN*)
+		LDSHARED="gcc -shared -Wl,--enable-auto-image-base"
+		LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";;
 	*)	LDSHARED="ld";;
 	esac
 fi
 { echo "$as_me:$LINENO: result: $LDSHARED" >&5
 echo "${ECHO_T}$LDSHARED" >&6; }
+LDCXXSHARED=${LDCXXSHARED-$LDSHARED}
 BLDSHARED=${BLDSHARED-$LDSHARED}
 # CCSHARED are the C *flags* used to create objects to go into a shared
 # library (module) -- this is only needed for a few systems
@@ -28088,9 +28089,9 @@
 LIBTOOL_CRUFT!$LIBTOOL_CRUFT$ac_delim
 SO!$SO$ac_delim
 LDSHARED!$LDSHARED$ac_delim
+LDCXXSHARED!$LDCXXSHARED$ac_delim
 BLDSHARED!$BLDSHARED$ac_delim
 CCSHARED!$CCSHARED$ac_delim
-LINKFORSHARED!$LINKFORSHARED$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -28132,6 +28133,7 @@
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+LINKFORSHARED!$LINKFORSHARED$ac_delim
 CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim
 SHLIBS!$SHLIBS$ac_delim
 PKG_CONFIG!$PKG_CONFIG$ac_delim
@@ -28158,7 +28160,7 @@
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 24; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 25; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

Modified: python/branches/py3k-jit/configure.in
==============================================================================
--- python/branches/py3k-jit/configure.in	(original)
+++ python/branches/py3k-jit/configure.in	Fri Apr 16 02:53:03 2010
@@ -915,36 +915,7 @@
 	        if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
 		   UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
 		   ARCH_RUN_32BIT=""
-		   LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
-
-                   # You have to use different flags on various versions of
-		   # OSX to extract PPC code from an universal binary, basically
-                   # '-arch ppc' on OSX 10.4 and '-arch ppc7400' on anything                   
-                   # newer. 
-                   # Because '-arch pp7400' works on OSX 10.5 or higher this
-                   # test is only present in the '32-bit' branch, all other
-                   # branches require OSX 10.5 to compile.
-
-		   AC_MSG_CHECKING(lipo flag for extracting ppc code)
-		   FN="test.$$"
-		   cat >${FN}.c <<-EOF
-		        int main() { return 0; }
-EOF
-		   ${CC} ${CFLAGS} -arch ppc -arch i386 -o ${FN} ${FN}.c -isysroot ${UNIVERSALSDK}
-		   if test $? != 0 ; then
-			   rm ${FN} ${FN}.c
-			   AC_MSG_RESULT([failed, assumee -extract ppc7400])
-		   else
-			   lipo "${FN}" -extract ppc7400 -output "${FN}.out" 2>/dev/null
-			   if test $? != 0 ; then
-			       LIPO_32BIT_FLAGS="-extract ppc -extract i386"
-			       AC_MSG_RESULT("'-extract ppc'")
-			   else
-			       AC_MSG_RESULT("'-extract ppc7400'")
-			   fi
-			   rm -f ${FN} ${FN}.c ${FN}.out
-		   fi
-
+		   LIPO_32BIT_FLAGS=""
 	         elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
 		   UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
 		   LIPO_32BIT_FLAGS=""


More information about the Python-checkins mailing list