[Python-checkins] r71578 - in python/branches/py3k-short-float-repr: Doc/c-api/buffer.rst Doc/c-api/init.rst Doc/distutils/apiref.rst Doc/distutils/examples.rst Doc/distutils/setupscript.rst Doc/library/asyncore.rst Doc/library/codeop.rst Doc/library/collections.rst Doc/library/compileall.rst Doc/library/configparser.rst Doc/library/constants.rst Doc/library/copyreg.rst Doc/library/csv.rst Doc/library/curses.rst Doc/library/datetime.rst Doc/library/dbm.rst Doc/library/decimal.rst Doc/library/difflib.rst Doc/library/dis.rst Doc/library/doctest.rst Doc/library/io.rst Doc/library/itertools.rst Doc/library/json.rst Doc/library/multiprocessing.rst Doc/library/stdtypes.rst Doc/library/string.rst Doc/library/sys.rst Doc/library/test.rst Doc/library/threading.rst Doc/library/tkinter.ttk.rst Doc/library/unittest.rst Doc/make.bat Doc/reference/expressions.rst Doc/tools/sphinxext/static/basic.css Doc/tools/sphinxext/susp-ignored.csv Doc/whatsnew/2.7.rst Doc/whatsnew/3.1.rst Include/bytes_methods.h Include/object.h Lib/asyncore.py Lib/cgitb.py Lib/collections.py Lib/distutils/command/__init__.py Lib/distutils/command/bdist_wininst.py Lib/distutils/command/check.py Lib/distutils/command/config.py Lib/distutils/tests/test_bdist_wininst.py Lib/distutils/tests/test_check.py Lib/distutils/tests/test_config_cmd.py Lib/distutils/tests/test_spawn.py Lib/distutils/tests/test_util.py Lib/http/server.py Lib/multiprocessing/managers.py Lib/multiprocessing/pool.py Lib/plistlib.py Lib/posixpath.py Lib/pydoc.py Lib/socket.py Lib/string.py Lib/telnetlib.py Lib/test/support.py Lib/test/test_asyncore.py Lib/test/test_bigmem.py Lib/test/test_bytes.py Lib/test/test_heapq.py Lib/test/test_httpservers.py Lib/test/test_minidom.py Lib/test/test_mmap.py Lib/test/test_multiprocessing.py Lib/test/test_os.py Lib/test/test_posixpath.py Lib/test/test_string.py Lib/test/test_sys.py Lib/test/test_telnetlib.py Lib/test/test_unittest.py Lib/test/test_warnings.py Lib/unittest.py Lib/xml/dom/minidom.py Lib/xmlrpc/server.py Makefile.pre.in Misc Misc/NEWS Misc/README Misc/build.sh Misc/gdbinit Misc/python-wing.wpr Modules/_io/bufferedio.c Modules/_tkinter.c Modules/mmapmodule.c Modules/posixmodule.c Modules/readline.c Modules/tkinter.h Objects/bytearrayobject.c Objects/bytes_methods.c Objects/bytesobject.c Objects/unicodeobject.c Parser/asdl.py Python/atof.c Python/errors.c Python/getargs.c Python/mysnprintf.c Python/strtod.c Tools/msi/msilib.py setup.py

mark.dickinson python-checkins at python.org
Mon Apr 13 18:30:56 CEST 2009


Author: mark.dickinson
Date: Mon Apr 13 18:30:54 2009
New Revision: 71578

Log:
Merged revisions 71354-71357,71368,71372,71374,71376,71378-71379,71383-71384,71386-71388,71390-71391,71393-71394,71399-71404,71415-71416,71420-71421,71431,71434,71436-71437,71442,71444-71446,71451,71454,71457,71469,71471,71475,71480,71483,71491,71493,71495-71497,71500-71502,71505-71506,71511,71515,71518,71520-71521,71525,71530,71535,71541,71556,71559,71565,71568,71571 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r71354 | mark.dickinson | 2009-04-07 12:53:52 +0100 (Tue, 07 Apr 2009) | 4 lines
  
  Revert removal of atof.c and strtod.c in r71341.  We're not quite
  ready for this yet---this removal should happen as part of the
  py3k-short-float-repr merge.
................
  r71355 | matthias.klose | 2009-04-07 14:13:10 +0100 (Tue, 07 Apr 2009) | 10 lines
  
  Merged revisions 71268 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71268 | matthias.klose | 2009-04-05 23:00:48 +0200 (So, 05 Apr 2009) | 3 lines
    
    - Issue #2703: SimpleXMLRPCDispatcher.__init__: Provide default values for
      new arguments introduced in 2.5.
  ........
................
  r71356 | matthias.klose | 2009-04-07 14:24:27 +0100 (Tue, 07 Apr 2009) | 15 lines
  
  Merged revisions 71229,71271 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71229 | matthias.klose | 2009-04-05 14:43:08 +0200 (So, 05 Apr 2009) | 3 lines
    
    - Py_DECREF: Add `do { ... } while (0)' to avoid compiler warnings.
      (avoiding brown paper typo this time)
  ........
    r71271 | matthias.klose | 2009-04-05 23:19:13 +0200 (So, 05 Apr 2009) | 3 lines
    
    Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add `do { ... } while (0)'
    to avoid compiler warnings.
  ........
................
  r71357 | matthias.klose | 2009-04-07 14:49:45 +0100 (Tue, 07 Apr 2009) | 3 lines
  
  - Issue #5359: Readd the Berkley-DB detection code to allow _dbm be built
    using Berkley-DB.
................
  r71368 | matthias.klose | 2009-04-07 17:08:29 +0100 (Tue, 07 Apr 2009) | 4 lines
  
  Don't check for broken Berkley-DB versions on some platforms; the
  test was required for the _bsddb3 extension, not necessary for the
  _dbm extension.
................
  r71372 | benjamin.peterson | 2009-04-07 20:27:32 +0100 (Tue, 07 Apr 2009) | 1 line
  
  don't install extras like pydoc and idle in altinstall, possibly overwriting the 2.x ones #1590
................
  r71374 | benjamin.peterson | 2009-04-07 20:34:08 +0100 (Tue, 07 Apr 2009) | 9 lines
  
  Merged revisions 71335 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71335 | benjamin.peterson | 2009-04-06 17:53:29 -0500 (Mon, 06 Apr 2009) | 1 line
    
    see if this helps the doc builds
  ........
................
  r71376 | benjamin.peterson | 2009-04-07 20:43:57 +0100 (Tue, 07 Apr 2009) | 1 line
  
  install as python3 #5461
................
  r71378 | raymond.hettinger | 2009-04-07 22:19:16 +0100 (Tue, 07 Apr 2009) | 1 line
  
  Fix make.bat to match makefile changes
................
  r71379 | georg.brandl | 2009-04-07 22:27:29 +0100 (Tue, 07 Apr 2009) | 1 line
  
  Revert 3k change to msilib, which is executed with Python 2.x.
................
  r71383 | eric.smith | 2009-04-07 23:55:31 +0100 (Tue, 07 Apr 2009) | 1 line
  
  Removed unused #include.
................
  r71384 | raymond.hettinger | 2009-04-08 00:10:59 +0100 (Wed, 08 Apr 2009) | 1 line
  
  Add link.
................
  r71386 | raymond.hettinger | 2009-04-08 01:09:26 +0100 (Wed, 08 Apr 2009) | 1 line
  
  Fix-up attribution per IRC discussion with GPolo.
................
  r71387 | raymond.hettinger | 2009-04-08 02:15:02 +0100 (Wed, 08 Apr 2009) | 1 line
  
  Add docstrings.
................
  r71388 | raymond.hettinger | 2009-04-08 02:16:27 +0100 (Wed, 08 Apr 2009) | 1 line
  
  Typo.
................
  r71390 | raymond.hettinger | 2009-04-08 08:49:03 +0100 (Wed, 08 Apr 2009) | 1 line
  
  Add example for auto-renaming.
................
  r71391 | raymond.hettinger | 2009-04-08 09:23:44 +0100 (Wed, 08 Apr 2009) | 1 line
  
  Perform minor copy edits
................
  r71393 | raymond.hettinger | 2009-04-08 09:28:28 +0100 (Wed, 08 Apr 2009) | 1 line
  
  Minor factoring.
................
  r71394 | raymond.hettinger | 2009-04-08 10:38:32 +0100 (Wed, 08 Apr 2009) | 1 line
  
  Remove bits that pertained to earlier releases.
................
  r71399 | benjamin.peterson | 2009-04-08 22:35:52 +0100 (Wed, 08 Apr 2009) | 1 line
  
  fix installing of extension modules
................
  r71400 | benjamin.peterson | 2009-04-08 22:40:01 +0100 (Wed, 08 Apr 2009) | 1 line
  
  don't install scripts which will overwrite 2.x ones #1590
................
  r71401 | benjamin.peterson | 2009-04-08 22:41:45 +0100 (Wed, 08 Apr 2009) | 1 line
  
  fix building
................
  r71402 | raymond.hettinger | 2009-04-08 23:50:09 +0100 (Wed, 08 Apr 2009) | 1 line
  
  Clean-up an example.
................
  r71403 | raymond.hettinger | 2009-04-09 01:08:24 +0100 (Thu, 09 Apr 2009) | 1 line
  
  Update whatsnew based on doc search.
................
  r71404 | raymond.hettinger | 2009-04-09 01:18:29 +0100 (Thu, 09 Apr 2009) | 1 line
  
  Fix markup
................
  r71415 | tarek.ziade | 2009-04-09 23:02:39 +0100 (Thu, 09 Apr 2009) | 9 lines
  
  Merged revisions 71413 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71413 | tarek.ziade | 2009-04-09 23:36:44 +0200 (Thu, 09 Apr 2009) | 1 line
    
    Fixed #5731: Distutils bdist_wininst no longer worked on non-Windows platforms
  ........
................
  r71416 | r.david.murray | 2009-04-09 23:16:43 +0100 (Thu, 09 Apr 2009) | 10 lines
  
  Merged revisions 71414 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71414 | r.david.murray | 2009-04-09 17:54:50 -0400 (Thu, 09 Apr 2009) | 3 lines
    
    Issue #2170: refactored xml.dom.minidom.normalize, increasing both
    its clarity and its speed.
  ........
................
  r71420 | raymond.hettinger | 2009-04-09 23:34:23 +0100 (Thu, 09 Apr 2009) | 1 line
  
  Add note on using keyword arguments with OrderedDict.
................
  r71421 | raymond.hettinger | 2009-04-09 23:34:46 +0100 (Thu, 09 Apr 2009) | 1 line
  
  Fix link
................
  r71431 | raymond.hettinger | 2009-04-10 05:27:37 +0100 (Fri, 10 Apr 2009) | 1 line
  
  Clarify the table entries for combinatorics.
................
  r71434 | jack.diederich | 2009-04-10 06:33:26 +0100 (Fri, 10 Apr 2009) | 23 lines
  
  -fixes telnetlib constants to be one-length byte arrays instead of ints
  -this fixes telnet negotiation (broken in 3.0)
  -merged/ported telnetlib tests from trunk (below)
  
  Merged revisions 71302,71377,71385 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71302 | jack.diederich | 2009-04-05 22:08:44 -0400 (Sun, 05 Apr 2009) | 1 line
    
    test the telnetlib.Telnet interface more thoroughly
  ........
    r71377 | jack.diederich | 2009-04-07 16:22:59 -0400 (Tue, 07 Apr 2009) | 1 line
    
    eliminate more race conditions in telnetlib tests
  ........
    r71385 | jack.diederich | 2009-04-07 19:56:57 -0400 (Tue, 07 Apr 2009) | 4 lines
    
    - Make timing assertions very generous (a la test_timeout.py)
    - Break the gc cycle in negotiation tests
    - test the different guarantees of read_lazy and read_very_lazy
  ........
................
  r71436 | georg.brandl | 2009-04-10 08:01:52 +0100 (Fri, 10 Apr 2009) | 9 lines
  
  Merged revisions 71409 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71409 | georg.brandl | 2009-04-09 21:01:04 +0200 (Do, 09 Apr 2009) | 1 line
    
    Add a custom stylesheet with better table formatting.
  ........
................
  r71437 | georg.brandl | 2009-04-10 08:02:56 +0100 (Fri, 10 Apr 2009) | 21 lines
  
  Merged revisions 71424-71425,71428-71429 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71424 | raymond.hettinger | 2009-04-10 01:25:30 +0200 (Fr, 10 Apr 2009) | 1 line
    
    More table formatting.
  ........
    r71425 | raymond.hettinger | 2009-04-10 01:34:14 +0200 (Fr, 10 Apr 2009) | 1 line
    
    Center table headings.
  ........
    r71428 | raymond.hettinger | 2009-04-10 02:49:41 +0200 (Fr, 10 Apr 2009) | 1 line
    
    More table clean-up
  ........
    r71429 | raymond.hettinger | 2009-04-10 04:01:21 +0200 (Fr, 10 Apr 2009) | 1 line
    
    IE needs the border-left:0 for some reason.
  ........
................
  r71442 | georg.brandl | 2009-04-10 09:17:21 +0100 (Fri, 10 Apr 2009) | 9 lines
  
  Merged revisions 71441 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71441 | georg.brandl | 2009-04-10 10:16:47 +0200 (Fr, 10 Apr 2009) | 1 line
    
    Let "lambda" point to the correct heading.
  ........
................
  r71444 | georg.brandl | 2009-04-10 09:28:28 +0100 (Fri, 10 Apr 2009) | 9 lines
  
  Merged revisions 71443 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71443 | georg.brandl | 2009-04-10 10:20:23 +0200 (Fr, 10 Apr 2009) | 1 line
    
    #5698: Fix casing of !DOCTYPE to conform to W3C specs.
  ........
................
  r71445 | georg.brandl | 2009-04-10 09:31:48 +0100 (Fri, 10 Apr 2009) | 1 line
  
  #5698, part 2: generate a meta info in pydoc HTML pages indicating the encoding, and fix the -w option to use the correct encoding.
................
  r71446 | georg.brandl | 2009-04-10 10:03:43 +0100 (Fri, 10 Apr 2009) | 1 line
  
  Update signature style for optional arguments, part 3.
................
  r71451 | raymond.hettinger | 2009-04-10 20:02:36 +0100 (Fri, 10 Apr 2009) | 1 line
  
  Add examples.
................
  r71454 | raymond.hettinger | 2009-04-10 20:43:50 +0100 (Fri, 10 Apr 2009) | 1 line
  
  Fix alignment
................
  r71457 | guilherme.polo | 2009-04-10 23:19:09 +0100 (Fri, 10 Apr 2009) | 9 lines
  
  Merged revisions 71210 via svnmerge from 
  svn+ssh://pythondev/python/trunk
  
  ........
    r71210 | guilherme.polo | 2009-04-04 23:11:19 -0300 (Sat, 04 Apr 2009) | 1 line
    
    Include tkinter.h only after including tk.h (or the equivalent for another platform).
  ........
................
  r71469 | nick.coghlan | 2009-04-11 15:30:59 +0100 (Sat, 11 Apr 2009) | 9 lines
  
  Merged revisions 71465 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71465 | nick.coghlan | 2009-04-11 23:31:31 +1000 (Sat, 11 Apr 2009) | 1 line
    
    Issue 5354: Provide a standardised testing mechanism for doing fresh imports of modules, including the ability to block extension modules in order to test the pure Python fallbacks
  ........
................
  r71471 | tarek.ziade | 2009-04-11 15:32:37 +0100 (Sat, 11 Apr 2009) | 9 lines
  
  Merged revisions 71467 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71467 | tarek.ziade | 2009-04-11 15:59:05 +0200 (Sat, 11 Apr 2009) | 1 line
    
    fixed link
  ........
................
  r71475 | tarek.ziade | 2009-04-11 16:00:43 +0100 (Sat, 11 Apr 2009) | 9 lines
  
  Merged revisions 71473 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71473 | tarek.ziade | 2009-04-11 16:55:07 +0200 (Sat, 11 Apr 2009) | 1 line
    
    #5732: added the check command into Distutils
  ........
................
  r71480 | tarek.ziade | 2009-04-11 16:17:04 +0100 (Sat, 11 Apr 2009) | 9 lines
  
  Merged revisions 71478 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71478 | tarek.ziade | 2009-04-11 17:14:17 +0200 (Sat, 11 Apr 2009) | 1 line
    
    testing a full check case
  ........
................
  r71483 | antoine.pitrou | 2009-04-11 16:39:24 +0100 (Sat, 11 Apr 2009) | 4 lines
  
  #5502: accelerate binary buffered IO (especially small operations).
  On a suggestion by Victor Stinner.
................
  r71491 | georg.brandl | 2009-04-11 19:18:16 +0100 (Sat, 11 Apr 2009) | 1 line
  
  Remove mentions of "long".
................
  r71493 | benjamin.peterson | 2009-04-11 20:16:27 +0100 (Sat, 11 Apr 2009) | 96 lines
  
  Blocked revisions 70807,70986,70993-70994,71127,71300,71302,71361,71365,71367,71370,71377,71380,71385,71389,71392,71419,71430,71435,71448,71462,71490 via svnmerge
  
  ........
    r70807 | jeremy.hylton | 2009-03-31 08:31:00 -0500 (Tue, 31 Mar 2009) | 2 lines
    
    Update quicktest to match Python 3 branch
  ........
    r70986 | raymond.hettinger | 2009-04-01 15:50:58 -0500 (Wed, 01 Apr 2009) | 1 line
    
    Add link to an alternative generator with a long-period.
  ........
    r70993 | georg.brandl | 2009-04-01 16:05:44 -0500 (Wed, 01 Apr 2009) | 1 line
    
    Add NEWS item.
  ........
    r70994 | georg.brandl | 2009-04-01 16:06:30 -0500 (Wed, 01 Apr 2009) | 1 line
    
    Revert accidental checkin.
  ........
    r71127 | raymond.hettinger | 2009-04-04 03:46:58 -0500 (Sat, 04 Apr 2009) | 1 line
    
    Replace the localized min/max calls with normal if/else
  ........
    r71300 | gregory.p.smith | 2009-04-05 18:48:26 -0500 (Sun, 05 Apr 2009) | 2 lines
    
    news entry for r71299.
  ........
    r71302 | jack.diederich | 2009-04-05 21:08:44 -0500 (Sun, 05 Apr 2009) | 1 line
    
    test the telnetlib.Telnet interface more thoroughly
  ........
    r71361 | benjamin.peterson | 2009-04-07 10:15:04 -0500 (Tue, 07 Apr 2009) | 1 line
    
    fix syntax tests after formatting change
  ........
    r71365 | benjamin.peterson | 2009-04-07 10:52:05 -0500 (Tue, 07 Apr 2009) | 1 line
    
    fix since difference formating of SyntaxErrors
  ........
    r71367 | benjamin.peterson | 2009-04-07 11:03:04 -0500 (Tue, 07 Apr 2009) | 1 line
    
    revert unrelated change to test_telnetlib
  ........
    r71370 | vinay.sajip | 2009-04-07 12:18:24 -0500 (Tue, 07 Apr 2009) | 1 line
    
    Issue #5695: Minor tweak to improve the code as suggested by Brett Cannon and as implemented in the Py3K branch.
  ........
    r71377 | jack.diederich | 2009-04-07 15:22:59 -0500 (Tue, 07 Apr 2009) | 1 line
    
    eliminate more race conditions in telnetlib tests
  ........
    r71380 | raymond.hettinger | 2009-04-07 16:43:51 -0500 (Tue, 07 Apr 2009) | 1 line
    
    Fix make.bat to match makefile changes
  ........
    r71385 | jack.diederich | 2009-04-07 18:56:57 -0500 (Tue, 07 Apr 2009) | 4 lines
    
    - Make timing assertions very generous (a la test_timeout.py)
    - Break the gc cycle in negotiation tests
    - test the different guarantees of read_lazy and read_very_lazy
  ........
    r71389 | raymond.hettinger | 2009-04-08 00:39:38 -0500 (Wed, 08 Apr 2009) | 1 line
    
    Add docstrings.
  ........
    r71392 | raymond.hettinger | 2009-04-08 03:26:55 -0500 (Wed, 08 Apr 2009) | 1 line
    
    Minor factoring.
  ........
    r71419 | raymond.hettinger | 2009-04-09 17:31:51 -0500 (Thu, 09 Apr 2009) | 1 line
    
    Add note on using keyword arguments with OrderedDict.
  ........
    r71430 | raymond.hettinger | 2009-04-09 23:25:45 -0500 (Thu, 09 Apr 2009) | 1 line
    
    Clarify the table entries for combinatorics.
  ........
    r71435 | raymond.hettinger | 2009-04-10 01:38:39 -0500 (Fri, 10 Apr 2009) | 1 line
    
    Fix the count of datatypes.
  ........
    r71448 | raymond.hettinger | 2009-04-10 08:16:50 -0500 (Fri, 10 Apr 2009) | 1 line
    
    Add examples.
  ........
    r71462 | chris.withers | 2009-04-11 06:22:19 -0500 (Sat, 11 Apr 2009) | 2 lines
    
    remove unpleasant exec
  ........
    r71490 | r.david.murray | 2009-04-11 12:52:56 -0500 (Sat, 11 Apr 2009) | 4 lines
    
    Make test_asyncore tests match code changes introduced by the
    fix to Issue1161031, refactoring the test to simplify it in
    the process.
  ........
................
  r71495 | benjamin.peterson | 2009-04-11 20:48:14 +0100 (Sat, 11 Apr 2009) | 67 lines
  
  Merged revisions 70980,71059,71225,71234,71241,71243,71249,71251,71255,71266,71299,71329,71397-71398,71486 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r70980 | jack.diederich | 2009-04-01 15:26:13 -0500 (Wed, 01 Apr 2009) | 3 lines
    
    bounds check arguments to mmap.move().  All of them.  Really.
    fixes crasher on OS X 10.5
  ........
    r71059 | mark.dickinson | 2009-04-02 13:39:37 -0500 (Thu, 02 Apr 2009) | 2 lines
    
    sys.long_info attributes should be ints, not longs
  ........
    r71225 | georg.brandl | 2009-04-05 06:54:07 -0500 (Sun, 05 Apr 2009) | 1 line
    
    #5580: no need to use parentheses when converterr() argument is actually a type description.
  ........
    r71234 | georg.brandl | 2009-04-05 08:16:35 -0500 (Sun, 05 Apr 2009) | 1 line
    
    Whitespace normalization.
  ........
    r71241 | georg.brandl | 2009-04-05 09:48:49 -0500 (Sun, 05 Apr 2009) | 1 line
    
    #5471: fix expanduser() for $HOME set to "/".
  ........
    r71243 | georg.brandl | 2009-04-05 10:14:29 -0500 (Sun, 05 Apr 2009) | 1 line
    
    #5432: make plistlib docstring a raw string, since it contains examples with backslash escapes.
  ........
    r71249 | georg.brandl | 2009-04-05 11:30:43 -0500 (Sun, 05 Apr 2009) | 1 line
    
    #5444: adapt make.bat to new htmlhelp output file name.
  ........
    r71251 | georg.brandl | 2009-04-05 12:17:42 -0500 (Sun, 05 Apr 2009) | 1 line
    
    #5298: clarify docs about GIL by using more consistent wording.
  ........
    r71255 | georg.brandl | 2009-04-05 13:34:58 -0500 (Sun, 05 Apr 2009) | 1 line
    
    #602893: add indicator for current line in cgitb that doesnt rely on styling alone.
  ........
    r71266 | georg.brandl | 2009-04-05 15:23:13 -0500 (Sun, 05 Apr 2009) | 1 line
    
    Normalize issue referencing style.
  ........
    r71299 | gregory.p.smith | 2009-04-05 18:43:58 -0500 (Sun, 05 Apr 2009) | 3 lines
    
    Fixes issue5705: os.setuid() and friends did not accept the same range of
    values that pwd.getpwnam() returns.
  ........
    r71329 | benjamin.peterson | 2009-04-06 16:53:33 -0500 (Mon, 06 Apr 2009) | 1 line
    
    add create_connection to __all__ #5711
  ........
    r71397 | georg.brandl | 2009-04-08 11:36:39 -0500 (Wed, 08 Apr 2009) | 1 line
    
    Remove redundant backtick.
  ........
    r71398 | georg.brandl | 2009-04-08 11:39:04 -0500 (Wed, 08 Apr 2009) | 1 line
    
    Update ignore file for suspicious builder.
  ........
    r71486 | andrew.kuchling | 2009-04-11 11:18:14 -0500 (Sat, 11 Apr 2009) | 1 line
    
    Re-word
  ........
................
  r71496 | benjamin.peterson | 2009-04-11 21:12:10 +0100 (Sat, 11 Apr 2009) | 10 lines
  
  Merged revisions 71303 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71303 | gregory.p.smith | 2009-04-06 01:33:26 -0500 (Mon, 06 Apr 2009) | 3 lines
    
    - Issue #2254: Fix CGIHTTPServer information disclosure.  Relative paths are
      now collapsed within the url properly before looking in cgi_directories.
  ........
................
  r71497 | benjamin.peterson | 2009-04-11 21:14:54 +0100 (Sat, 11 Apr 2009) | 28 lines
  
  Blocked revisions 70757,70981,71029,71031,71082 via svnmerge
  
  ........
    r70757 | senthil.kumaran | 2009-03-30 16:51:50 -0500 (Mon, 30 Mar 2009) | 3 lines
    
    Fix for bugs: Issue4675 and Issue4962.
  ........
    r70981 | senthil.kumaran | 2009-04-01 15:26:33 -0500 (Wed, 01 Apr 2009) | 3 lines
    
    Fix for issue5040. Adding test for Content-Length
  ........
    r71029 | senthil.kumaran | 2009-04-01 22:00:34 -0500 (Wed, 01 Apr 2009) | 3 lines
    
    Fixing the issue4860. Escaping embedded '"' character in js_output() method of Morsel.
  ........
    r71031 | brett.cannon | 2009-04-01 22:17:39 -0500 (Wed, 01 Apr 2009) | 6 lines
    
    PyImport_AppendInittab() took a char * as a first argument even though that
    string was stored beyond the life of the call. Changed the signature to be
    const char * to help make this point.
    
    Closes issue #1419652.
  ........
    r71082 | hirokazu.yamamoto | 2009-04-02 22:54:08 -0500 (Thu, 02 Apr 2009) | 1 line
    
    Fixed compile error on windows.
  ........
................
  r71500 | benjamin.peterson | 2009-04-11 21:45:40 +0100 (Sat, 11 Apr 2009) | 70 lines
  
  Merged revisions 70912,70944,70968,71033,71041,71208,71263,71286,71395-71396,71405-71406,71485,71492,71494 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r70912 | georg.brandl | 2009-03-31 17:35:46 -0500 (Tue, 31 Mar 2009) | 1 line
    
    #5617: add a handy function to print a unicode string to gdbinit.
  ........
    r70944 | georg.brandl | 2009-03-31 23:32:39 -0500 (Tue, 31 Mar 2009) | 1 line
    
    #5631: add upload to list of possible commands, which is presented in --help-commands.
  ........
    r70968 | michael.foord | 2009-04-01 13:25:38 -0500 (Wed, 01 Apr 2009) | 1 line
    
    Adding Wing project file
  ........
    r71033 | brett.cannon | 2009-04-01 22:34:53 -0500 (Wed, 01 Apr 2009) | 3 lines
    
    Fix two issues introduced by issue #71031 by changing the signature of
    PyImport_AppendInittab() to take a const char *.
  ........
    r71041 | jesse.noller | 2009-04-02 00:17:26 -0500 (Thu, 02 Apr 2009) | 1 line
    
    Add custom initializer argument to multiprocess.Manager*, courtesy of lekma
  ........
    r71208 | michael.foord | 2009-04-04 20:15:01 -0500 (Sat, 04 Apr 2009) | 4 lines
    
    Change the way unittest.TestSuite use their tests to always access them through iteration. Non behavior changing, this allows you to create custom subclasses that override __iter__.
    
    Issue #5693
  ........
    r71263 | michael.foord | 2009-04-05 14:19:28 -0500 (Sun, 05 Apr 2009) | 4 lines
    
    Adding assertIs and assertIsNot methods to unittest.TestCase
    
    Issue #2578
  ........
    r71286 | tarek.ziade | 2009-04-05 17:04:38 -0500 (Sun, 05 Apr 2009) | 1 line
    
    added a simplest test to distutils.spawn._nt_quote_args
  ........
    r71395 | benjamin.peterson | 2009-04-08 08:27:29 -0500 (Wed, 08 Apr 2009) | 1 line
    
    these must be installed to correctly run tests
  ........
    r71396 | benjamin.peterson | 2009-04-08 08:29:41 -0500 (Wed, 08 Apr 2009) | 1 line
    
    fix syntax
  ........
    r71405 | andrew.kuchling | 2009-04-09 06:22:47 -0500 (Thu, 09 Apr 2009) | 1 line
    
    Add items
  ........
    r71406 | andrew.kuchling | 2009-04-09 06:23:36 -0500 (Thu, 09 Apr 2009) | 1 line
    
    Typo fixes
  ........
    r71485 | andrew.kuchling | 2009-04-11 11:12:23 -0500 (Sat, 11 Apr 2009) | 1 line
    
    Add various items
  ........
    r71492 | georg.brandl | 2009-04-11 13:19:27 -0500 (Sat, 11 Apr 2009) | 1 line
    
    Take credit for a patch of mine.
  ........
    r71494 | benjamin.peterson | 2009-04-11 14:31:00 -0500 (Sat, 11 Apr 2009) | 1 line
    
    ignore py3_test_grammar when compiling the library
  ........
................
  r71501 | benjamin.peterson | 2009-04-11 21:58:12 +0100 (Sat, 11 Apr 2009) | 9 lines
  
  Merged revisions 71498 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71498 | benjamin.peterson | 2009-04-11 15:27:15 -0500 (Sat, 11 Apr 2009) | 1 line
    
    fix markup
  ........
................
  r71502 | georg.brandl | 2009-04-11 22:24:37 +0100 (Sat, 11 Apr 2009) | 16 lines
  
  Merged revisions 71024,71058 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71024 | georg.brandl | 2009-04-02 04:47:44 +0200 (Do, 02 Apr 2009) | 4 lines
    
    In PyErr_GivenExceptionMatches, temporarily bump the recursion
    limit, so that in the most common case PyObject_IsSubclass will
    not raise a recursion error we have to ignore anyway.
  ........
    r71058 | georg.brandl | 2009-04-02 20:09:04 +0200 (Do, 02 Apr 2009) | 3 lines
    
    PyErr_NormalizeException may not set an error, so convert the PyErr_SetObject
    call on hitting the recursion limit into just assigning it to the arguments provided.
  ........
................
  r71505 | georg.brandl | 2009-04-12 12:34:13 +0100 (Sun, 12 Apr 2009) | 1 line
  
  #2725: Fix missing local, and handle errors without tracebacks.
................
  r71506 | georg.brandl | 2009-04-12 13:01:50 +0100 (Sun, 12 Apr 2009) | 1 line
  
  #5708: a bit of streamlining in unicode_repeat().
................
  r71511 | tarek.ziade | 2009-04-12 15:57:46 +0100 (Sun, 12 Apr 2009) | 9 lines
  
  Merged revisions 71509 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71509 | tarek.ziade | 2009-04-12 16:53:51 +0200 (Sun, 12 Apr 2009) | 1 line
    
    removed the print statements and added a test
  ........
................
  r71515 | tarek.ziade | 2009-04-12 16:07:31 +0100 (Sun, 12 Apr 2009) | 9 lines
  
  Merged revisions 71513 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71513 | tarek.ziade | 2009-04-12 17:03:50 +0200 (Sun, 12 Apr 2009) | 1 line
    
    pep8-fied the module before adding tests
  ........
................
  r71518 | r.david.murray | 2009-04-12 16:21:36 +0100 (Sun, 12 Apr 2009) | 2 lines
  
  Unblock most recent asyncore commits in preparation for py3k integration.
................
  r71520 | r.david.murray | 2009-04-12 16:35:44 +0100 (Sun, 12 Apr 2009) | 24 lines
  
  Merged revisions 70873,70904,70934,71490 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r70873 | josiah.carlson | 2009-03-31 15:32:34 -0400 (Tue, 31 Mar 2009) | 2 lines
    
    This resolves issue 1161031.  Tests pass.
  ........
    r70904 | josiah.carlson | 2009-03-31 17:49:36 -0400 (Tue, 31 Mar 2009) | 3 lines
    
    Made handle_expt_event() be called last, so that we don't accidentally read
    after closing the socket.
  ........
    r70934 | josiah.carlson | 2009-03-31 21:28:11 -0400 (Tue, 31 Mar 2009) | 2 lines
    
    Fix for failing asyncore tests.
  ........
    r71490 | r.david.murray | 2009-04-11 13:52:56 -0400 (Sat, 11 Apr 2009) | 4 lines
    
    Make test_asyncore tests match code changes introduced by the
    fix to Issue1161031, refactoring the test to simplify it in
    the process.
  ........
................
  r71521 | georg.brandl | 2009-04-12 16:51:51 +0100 (Sun, 12 Apr 2009) | 4 lines
  
  Add bytes/bytearray.maketrans() to mirror str.maketrans(), and deprecate
  string.maketrans() which actually works on bytes.  (Also closes #5675.)
................
  r71525 | tarek.ziade | 2009-04-12 17:34:34 +0100 (Sun, 12 Apr 2009) | 9 lines
  
  Merged revisions 71523 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71523 | tarek.ziade | 2009-04-12 18:31:24 +0200 (Sun, 12 Apr 2009) | 1 line
    
    added a simple test for search_cpp
  ........
................
  r71530 | tarek.ziade | 2009-04-12 17:49:20 +0100 (Sun, 12 Apr 2009) | 9 lines
  
  Merged revisions 71528 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71528 | tarek.ziade | 2009-04-12 18:45:32 +0200 (Sun, 12 Apr 2009) | 1 line
    
    added a test for finalize_options
  ........
................
  r71535 | tarek.ziade | 2009-04-12 18:04:39 +0100 (Sun, 12 Apr 2009) | 9 lines
  
  Merged revisions 71533 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71533 | tarek.ziade | 2009-04-12 19:02:08 +0200 (Sun, 12 Apr 2009) | 1 line
    
    removed string usage and added a test for _clean
  ........
................
  r71541 | benjamin.peterson | 2009-04-12 21:32:11 +0100 (Sun, 12 Apr 2009) | 9 lines
  
  Merged revisions 71539 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71539 | benjamin.peterson | 2009-04-12 15:24:56 -0500 (Sun, 12 Apr 2009) | 1 line
    
    remove useless import
  ........
................
  r71556 | r.david.murray | 2009-04-13 02:22:04 +0100 (Mon, 13 Apr 2009) | 10 lines
  
  Merged revisions 71553 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71553 | r.david.murray | 2009-04-12 21:06:46 -0400 (Sun, 12 Apr 2009) | 3 lines
    
    Adjust test_asyncore to account for intentional asyncore behavior change
    introduced by r70934 that was causing a test failure when run under -O.
  ........
................
  r71559 | kristjan.jonsson | 2009-04-13 11:16:14 +0100 (Mon, 13 Apr 2009) | 2 lines
  
  Merging r70958 from the trunk, regarding http://bugs.python.org/issue5623
................
  r71565 | tarek.ziade | 2009-04-13 13:37:57 +0100 (Mon, 13 Apr 2009) | 9 lines
  
  Merged revisions 71560 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71560 | tarek.ziade | 2009-04-13 14:34:01 +0200 (Mon, 13 Apr 2009) | 1 line
    
    Fixed #5607: Distutils test_get_platform was failing fo Mac OS X fat binaries.
  ........
................
  r71568 | georg.brandl | 2009-04-13 13:40:42 +0100 (Mon, 13 Apr 2009) | 10 lines
  
  Blocked revisions 70958 via svnmerge (merged manually)
  
  ........
    r70958 | kristjan.jonsson | 2009-04-01 16:08:34 +0000 (Mi, 01 Apr 2009) | 3 lines
    
    http://bugs.python.org/issue5623
    Dynamically discoverd the size of the ioinfo struct used by the crt for its file descriptors.  This should work across all flavors of the CRT.  Thanks to Amaury Forgeot d'Arc
    Needs porting to 3.1
  ........
................
  r71571 | tarek.ziade | 2009-04-13 13:59:03 +0100 (Mon, 13 Apr 2009) | 9 lines
  
  Merged revisions 71569 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r71569 | tarek.ziade | 2009-04-13 14:42:26 +0200 (Mon, 13 Apr 2009) | 1 line
    
    deactivate test_search_cpp under win32
  ........
................


Added:
   python/branches/py3k-short-float-repr/Doc/tools/sphinxext/static/basic.css
      - copied unchanged from r71541, /python/branches/py3k/Doc/tools/sphinxext/static/basic.css
   python/branches/py3k-short-float-repr/Lib/distutils/command/check.py
      - copied unchanged from r71541, /python/branches/py3k/Lib/distutils/command/check.py
   python/branches/py3k-short-float-repr/Lib/distutils/tests/test_bdist_wininst.py
      - copied unchanged from r71541, /python/branches/py3k/Lib/distutils/tests/test_bdist_wininst.py
   python/branches/py3k-short-float-repr/Lib/distutils/tests/test_check.py
      - copied unchanged from r71541, /python/branches/py3k/Lib/distutils/tests/test_check.py
   python/branches/py3k-short-float-repr/Lib/distutils/tests/test_config_cmd.py
      - copied, changed from r71541, /python/branches/py3k/Lib/distutils/tests/test_config_cmd.py
   python/branches/py3k-short-float-repr/Lib/distutils/tests/test_spawn.py
      - copied unchanged from r71541, /python/branches/py3k/Lib/distutils/tests/test_spawn.py
   python/branches/py3k-short-float-repr/Misc/python-wing.wpr
      - copied unchanged from r71541, /python/branches/py3k/Misc/python-wing.wpr
   python/branches/py3k-short-float-repr/Python/atof.c
      - copied unchanged from r71541, /python/branches/py3k/Python/atof.c
   python/branches/py3k-short-float-repr/Python/strtod.c
      - copied unchanged from r71541, /python/branches/py3k/Python/strtod.c
Modified:
   python/branches/py3k-short-float-repr/   (props changed)
   python/branches/py3k-short-float-repr/Doc/c-api/buffer.rst
   python/branches/py3k-short-float-repr/Doc/c-api/init.rst
   python/branches/py3k-short-float-repr/Doc/distutils/apiref.rst
   python/branches/py3k-short-float-repr/Doc/distutils/examples.rst
   python/branches/py3k-short-float-repr/Doc/distutils/setupscript.rst
   python/branches/py3k-short-float-repr/Doc/library/asyncore.rst
   python/branches/py3k-short-float-repr/Doc/library/codeop.rst
   python/branches/py3k-short-float-repr/Doc/library/collections.rst
   python/branches/py3k-short-float-repr/Doc/library/compileall.rst
   python/branches/py3k-short-float-repr/Doc/library/configparser.rst
   python/branches/py3k-short-float-repr/Doc/library/constants.rst
   python/branches/py3k-short-float-repr/Doc/library/copyreg.rst
   python/branches/py3k-short-float-repr/Doc/library/csv.rst
   python/branches/py3k-short-float-repr/Doc/library/curses.rst
   python/branches/py3k-short-float-repr/Doc/library/datetime.rst
   python/branches/py3k-short-float-repr/Doc/library/dbm.rst
   python/branches/py3k-short-float-repr/Doc/library/decimal.rst
   python/branches/py3k-short-float-repr/Doc/library/difflib.rst
   python/branches/py3k-short-float-repr/Doc/library/dis.rst
   python/branches/py3k-short-float-repr/Doc/library/doctest.rst
   python/branches/py3k-short-float-repr/Doc/library/io.rst
   python/branches/py3k-short-float-repr/Doc/library/itertools.rst
   python/branches/py3k-short-float-repr/Doc/library/json.rst
   python/branches/py3k-short-float-repr/Doc/library/multiprocessing.rst
   python/branches/py3k-short-float-repr/Doc/library/stdtypes.rst
   python/branches/py3k-short-float-repr/Doc/library/string.rst
   python/branches/py3k-short-float-repr/Doc/library/sys.rst
   python/branches/py3k-short-float-repr/Doc/library/test.rst
   python/branches/py3k-short-float-repr/Doc/library/threading.rst
   python/branches/py3k-short-float-repr/Doc/library/tkinter.ttk.rst
   python/branches/py3k-short-float-repr/Doc/library/unittest.rst
   python/branches/py3k-short-float-repr/Doc/make.bat
   python/branches/py3k-short-float-repr/Doc/reference/expressions.rst
   python/branches/py3k-short-float-repr/Doc/tools/sphinxext/susp-ignored.csv
   python/branches/py3k-short-float-repr/Doc/whatsnew/2.7.rst
   python/branches/py3k-short-float-repr/Doc/whatsnew/3.1.rst
   python/branches/py3k-short-float-repr/Include/bytes_methods.h
   python/branches/py3k-short-float-repr/Include/object.h
   python/branches/py3k-short-float-repr/Lib/asyncore.py
   python/branches/py3k-short-float-repr/Lib/cgitb.py
   python/branches/py3k-short-float-repr/Lib/collections.py
   python/branches/py3k-short-float-repr/Lib/distutils/command/__init__.py
   python/branches/py3k-short-float-repr/Lib/distutils/command/bdist_wininst.py
   python/branches/py3k-short-float-repr/Lib/distutils/command/config.py
   python/branches/py3k-short-float-repr/Lib/distutils/tests/test_util.py
   python/branches/py3k-short-float-repr/Lib/http/server.py
   python/branches/py3k-short-float-repr/Lib/multiprocessing/managers.py
   python/branches/py3k-short-float-repr/Lib/multiprocessing/pool.py
   python/branches/py3k-short-float-repr/Lib/plistlib.py
   python/branches/py3k-short-float-repr/Lib/posixpath.py
   python/branches/py3k-short-float-repr/Lib/pydoc.py
   python/branches/py3k-short-float-repr/Lib/socket.py
   python/branches/py3k-short-float-repr/Lib/string.py
   python/branches/py3k-short-float-repr/Lib/telnetlib.py
   python/branches/py3k-short-float-repr/Lib/test/support.py
   python/branches/py3k-short-float-repr/Lib/test/test_asyncore.py
   python/branches/py3k-short-float-repr/Lib/test/test_bigmem.py
   python/branches/py3k-short-float-repr/Lib/test/test_bytes.py
   python/branches/py3k-short-float-repr/Lib/test/test_heapq.py
   python/branches/py3k-short-float-repr/Lib/test/test_httpservers.py
   python/branches/py3k-short-float-repr/Lib/test/test_minidom.py
   python/branches/py3k-short-float-repr/Lib/test/test_mmap.py
   python/branches/py3k-short-float-repr/Lib/test/test_multiprocessing.py
   python/branches/py3k-short-float-repr/Lib/test/test_os.py
   python/branches/py3k-short-float-repr/Lib/test/test_posixpath.py
   python/branches/py3k-short-float-repr/Lib/test/test_string.py
   python/branches/py3k-short-float-repr/Lib/test/test_sys.py
   python/branches/py3k-short-float-repr/Lib/test/test_telnetlib.py
   python/branches/py3k-short-float-repr/Lib/test/test_unittest.py
   python/branches/py3k-short-float-repr/Lib/test/test_warnings.py
   python/branches/py3k-short-float-repr/Lib/unittest.py
   python/branches/py3k-short-float-repr/Lib/xml/dom/minidom.py
   python/branches/py3k-short-float-repr/Lib/xmlrpc/server.py
   python/branches/py3k-short-float-repr/Makefile.pre.in
   python/branches/py3k-short-float-repr/Misc/   (props changed)
   python/branches/py3k-short-float-repr/Misc/NEWS
   python/branches/py3k-short-float-repr/Misc/README
   python/branches/py3k-short-float-repr/Misc/build.sh
   python/branches/py3k-short-float-repr/Misc/gdbinit
   python/branches/py3k-short-float-repr/Modules/_io/bufferedio.c
   python/branches/py3k-short-float-repr/Modules/_tkinter.c
   python/branches/py3k-short-float-repr/Modules/mmapmodule.c
   python/branches/py3k-short-float-repr/Modules/posixmodule.c
   python/branches/py3k-short-float-repr/Modules/readline.c
   python/branches/py3k-short-float-repr/Modules/tkinter.h
   python/branches/py3k-short-float-repr/Objects/bytearrayobject.c
   python/branches/py3k-short-float-repr/Objects/bytes_methods.c
   python/branches/py3k-short-float-repr/Objects/bytesobject.c
   python/branches/py3k-short-float-repr/Objects/unicodeobject.c
   python/branches/py3k-short-float-repr/Parser/asdl.py
   python/branches/py3k-short-float-repr/Python/errors.c
   python/branches/py3k-short-float-repr/Python/getargs.c
   python/branches/py3k-short-float-repr/Python/mysnprintf.c
   python/branches/py3k-short-float-repr/Tools/msi/msilib.py
   python/branches/py3k-short-float-repr/setup.py

Modified: python/branches/py3k-short-float-repr/Doc/c-api/buffer.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/c-api/buffer.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/c-api/buffer.rst	Mon Apr 13 18:30:54 2009
@@ -239,7 +239,7 @@
       | :cmacro:`PyBUF_FULL`         | This is equivalent to ``(PyBUF_INDIRECT |         |
       |                              | PyBUF_FORMAT | PyBUF_WRITABLE)``.                 |
       +------------------------------+---------------------------------------------------+
-      | :cmacro:`PyBUF_FULL_RO``     | This is equivalent to ``(PyBUF_INDIRECT |         |
+      | :cmacro:`PyBUF_FULL_RO`      | This is equivalent to ``(PyBUF_INDIRECT |         |
       |                              | PyBUF_FORMAT)``.                                  |
       +------------------------------+---------------------------------------------------+
       | :cmacro:`PyBUF_CONTIG`       | This is equivalent to ``(PyBUF_ND |               |

Modified: python/branches/py3k-short-float-repr/Doc/c-api/init.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/c-api/init.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/c-api/init.rst	Mon Apr 13 18:30:54 2009
@@ -391,12 +391,12 @@
    single: lock, interpreter
 
 The Python interpreter is not fully thread safe.  In order to support
-multi-threaded Python programs, there's a global lock that must be held by the
-current thread before it can safely access Python objects. Without the lock,
-even the simplest operations could cause problems in a multi-threaded program:
-for example, when two threads simultaneously increment the reference count of
-the same object, the reference count could end up being incremented only once
-instead of twice.
+multi-threaded Python programs, there's a global lock, called the :dfn:`global
+interpreter lock` or :dfn:`GIL`, that must be held by the current thread before
+it can safely access Python objects. Without the lock, even the simplest
+operations could cause problems in a multi-threaded program: for example, when
+two threads simultaneously increment the reference count of the same object, the
+reference count could end up being incremented only once instead of twice.
 
 .. index:: single: setcheckinterval() (in module sys)
 
@@ -425,9 +425,9 @@
 interpreter lock has the following simple structure::
 
    Save the thread state in a local variable.
-   Release the interpreter lock.
+   Release the global interpreter lock.
    ...Do some blocking I/O operation...
-   Reacquire the interpreter lock.
+   Reacquire the global interpreter lock.
    Restore the thread state from the local variable.
 
 This is so common that a pair of macros exists to simplify it::
@@ -444,7 +444,7 @@
 hidden local variable; the :cmacro:`Py_END_ALLOW_THREADS` macro closes the
 block.  Another advantage of using these two macros is that when Python is
 compiled without thread support, they are defined empty, thus saving the thread
-state and lock manipulations.
+state and GIL manipulations.
 
 When thread support is enabled, the block above expands to the following code::
 
@@ -476,7 +476,7 @@
 saves and restores the value of the  global variable :cdata:`errno`, since the
 lock manipulation does not guarantee that :cdata:`errno` is left alone.  Also,
 when thread support is disabled, :cfunc:`PyEval_SaveThread` and
-:cfunc:`PyEval_RestoreThread` don't manipulate the lock; in this case,
+:cfunc:`PyEval_RestoreThread` don't manipulate the GIL; in this case,
 :cfunc:`PyEval_ReleaseLock` and :cfunc:`PyEval_AcquireLock` are not available.
 This is done so that dynamically loaded extensions compiled with thread support
 enabled can be loaded by an interpreter that was compiled with disabled thread
@@ -559,16 +559,16 @@
 
    .. index:: module: _thread
 
-   When only the main thread exists, no lock operations are needed. This is a
+   When only the main thread exists, no GIL operations are needed. This is a
    common situation (most Python programs do not use threads), and the lock
-   operations slow the interpreter down a bit. Therefore, the lock is not created
-   initially.  This situation is equivalent to having acquired the lock:  when
-   there is only a single thread, all object accesses are safe.  Therefore, when
-   this function initializes the lock, it also acquires it.  Before the Python
-   :mod:`_thread` module creates a new thread, knowing that either it has the lock
-   or the lock hasn't been created yet, it calls :cfunc:`PyEval_InitThreads`.  When
-   this call returns, it is guaranteed that the lock has been created and that the
-   calling thread has acquired it.
+   operations slow the interpreter down a bit. Therefore, the lock is not
+   created initially.  This situation is equivalent to having acquired the lock:
+   when there is only a single thread, all object accesses are safe.  Therefore,
+   when this function initializes the global interpreter lock, it also acquires
+   it.  Before the Python :mod:`_thread` module creates a new thread, knowing
+   that either it has the lock or the lock hasn't been created yet, it calls
+   :cfunc:`PyEval_InitThreads`.  When this call returns, it is guaranteed that
+   the lock has been created and that the calling thread has acquired it.
 
    It is **not** safe to call this function when it is unknown which thread (if
    any) currently has the global interpreter lock.
@@ -579,7 +579,7 @@
 .. cfunction:: int PyEval_ThreadsInitialized()
 
    Returns a non-zero value if :cfunc:`PyEval_InitThreads` has been called.  This
-   function can be called without holding the lock, and therefore can be used to
+   function can be called without holding the GIL, and therefore can be used to
    avoid calls to the locking API when running single-threaded.  This function is
    not available when thread support is disabled at compile time.
 
@@ -617,20 +617,20 @@
 
 .. cfunction:: PyThreadState* PyEval_SaveThread()
 
-   Release the interpreter lock (if it has been created and thread support is
-   enabled) and reset the thread state to *NULL*, returning the previous thread
-   state (which is not *NULL*).  If the lock has been created, the current thread
-   must have acquired it.  (This function is available even when thread support is
-   disabled at compile time.)
+   Release the global interpreter lock (if it has been created and thread
+   support is enabled) and reset the thread state to *NULL*, returning the
+   previous thread state (which is not *NULL*).  If the lock has been created,
+   the current thread must have acquired it.  (This function is available even
+   when thread support is disabled at compile time.)
 
 
 .. cfunction:: void PyEval_RestoreThread(PyThreadState *tstate)
 
-   Acquire the interpreter lock (if it has been created and thread support is
-   enabled) and set the thread state to *tstate*, which must not be *NULL*.  If the
-   lock has been created, the current thread must not have acquired it, otherwise
-   deadlock ensues.  (This function is available even when thread support is
-   disabled at compile time.)
+   Acquire the global interpreter lock (if it has been created and thread
+   support is enabled) and set the thread state to *tstate*, which must not be
+   *NULL*.  If the lock has been created, the current thread must not have
+   acquired it, otherwise deadlock ensues.  (This function is available even
+   when thread support is disabled at compile time.)
 
 
 .. cfunction:: void PyEval_ReInitThreads()
@@ -674,60 +674,61 @@
    declaration.  It is a no-op when thread support is disabled at compile time.
 
 All of the following functions are only available when thread support is enabled
-at compile time, and must be called only when the interpreter lock has been
-created.
+at compile time, and must be called only when the global interpreter lock has
+been created.
 
 
 .. cfunction:: PyInterpreterState* PyInterpreterState_New()
 
-   Create a new interpreter state object.  The interpreter lock need not be held,
-   but may be held if it is necessary to serialize calls to this function.
+   Create a new interpreter state object.  The global interpreter lock need not
+   be held, but may be held if it is necessary to serialize calls to this
+   function.
 
 
 .. cfunction:: void PyInterpreterState_Clear(PyInterpreterState *interp)
 
-   Reset all information in an interpreter state object.  The interpreter lock must
-   be held.
+   Reset all information in an interpreter state object.  The global interpreter
+   lock must be held.
 
 
 .. cfunction:: void PyInterpreterState_Delete(PyInterpreterState *interp)
 
-   Destroy an interpreter state object.  The interpreter lock need not be held.
-   The interpreter state must have been reset with a previous call to
+   Destroy an interpreter state object.  The global interpreter lock need not be
+   held.  The interpreter state must have been reset with a previous call to
    :cfunc:`PyInterpreterState_Clear`.
 
 
 .. cfunction:: PyThreadState* PyThreadState_New(PyInterpreterState *interp)
 
-   Create a new thread state object belonging to the given interpreter object.  The
-   interpreter lock need not be held, but may be held if it is necessary to
-   serialize calls to this function.
+   Create a new thread state object belonging to the given interpreter object.
+   The global interpreter lock need not be held, but may be held if it is
+   necessary to serialize calls to this function.
 
 
 .. cfunction:: void PyThreadState_Clear(PyThreadState *tstate)
 
-   Reset all information in a thread state object.  The interpreter lock must be
-   held.
+   Reset all information in a thread state object.  The global interpreter lock
+   must be held.
 
 
 .. cfunction:: void PyThreadState_Delete(PyThreadState *tstate)
 
-   Destroy a thread state object.  The interpreter lock need not be held.  The
-   thread state must have been reset with a previous call to
+   Destroy a thread state object.  The global interpreter lock need not be held.
+   The thread state must have been reset with a previous call to
    :cfunc:`PyThreadState_Clear`.
 
 
 .. cfunction:: PyThreadState* PyThreadState_Get()
 
-   Return the current thread state.  The interpreter lock must be held.  When the
-   current thread state is *NULL*, this issues a fatal error (so that the caller
-   needn't check for *NULL*).
+   Return the current thread state.  The global interpreter lock must be held.
+   When the current thread state is *NULL*, this issues a fatal error (so that
+   the caller needn't check for *NULL*).
 
 
 .. cfunction:: PyThreadState* PyThreadState_Swap(PyThreadState *tstate)
 
    Swap the current thread state with the thread state given by the argument
-   *tstate*, which may be *NULL*.  The interpreter lock must be held.
+   *tstate*, which may be *NULL*.  The global interpreter lock must be held.
 
 
 .. cfunction:: PyObject* PyThreadState_GetDict()
@@ -752,14 +753,15 @@
 
 .. cfunction:: PyGILState_STATE PyGILState_Ensure()
 
-   Ensure that the current thread is ready to call the Python C API regardless of
-   the current state of Python, or of its thread lock. This may be called as many
-   times as desired by a thread as long as each call is matched with a call to
-   :cfunc:`PyGILState_Release`. In general, other thread-related APIs may be used
-   between :cfunc:`PyGILState_Ensure` and :cfunc:`PyGILState_Release` calls as long
-   as the thread state is restored to its previous state before the Release().  For
-   example, normal usage of the :cmacro:`Py_BEGIN_ALLOW_THREADS` and
-   :cmacro:`Py_END_ALLOW_THREADS` macros is acceptable.
+   Ensure that the current thread is ready to call the Python C API regardless
+   of the current state of Python, or of the global interpreter lock. This may
+   be called as many times as desired by a thread as long as each call is
+   matched with a call to :cfunc:`PyGILState_Release`. In general, other
+   thread-related APIs may be used between :cfunc:`PyGILState_Ensure` and
+   :cfunc:`PyGILState_Release` calls as long as the thread state is restored to
+   its previous state before the Release().  For example, normal usage of the
+   :cmacro:`Py_BEGIN_ALLOW_THREADS` and :cmacro:`Py_END_ALLOW_THREADS` macros is
+   acceptable.
 
    The return value is an opaque "handle" to the thread state when
    :cfunc:`PyGILState_Ensure` was called, and must be passed to
@@ -793,35 +795,34 @@
 
 .. index:: single: setcheckinterval() (in module sys)
 
-Every check interval, when the interpreter lock is released and reacquired,
-python will also call any such provided functions.  This can be used for
-example by asynchronous IO handlers.  The notification can be scheduled
-from a worker thread and the actual call than made at the earliest
-convenience by the main thread where it has possession of the global
-interpreter lock and can perform any Python API calls.
+Every check interval, when the global interpreter lock is released and
+reacquired, python will also call any such provided functions.  This can be used
+for example by asynchronous IO handlers.  The notification can be scheduled from
+a worker thread and the actual call than made at the earliest convenience by the
+main thread where it has possession of the global interpreter lock and can
+perform any Python API calls.
 
 .. cfunction:: void Py_AddPendingCall( int (*func)(void *, void *arg) )
 
    .. index:: single: Py_AddPendingCall()
 
-   Post a notification to the Python main thread.  If successful,
-   *func* will be called with the argument *arg* at the earliest
-   convenience.  *func* will be called having the global interpreter
-   lock held and can thus use the full Python API and can take any
-   action such as setting object attributes to signal IO completion.
-   It must return 0 on success, or -1 signalling an exception.
-   The notification function won't be interrupted to perform another
-   asynchronous notification recursively,
-   but it can still be interrupted to switch threads if the interpreter
-   lock is released, for example, if it calls back into python code.
+   Post a notification to the Python main thread.  If successful, *func* will be
+   called with the argument *arg* at the earliest convenience.  *func* will be
+   called having the global interpreter lock held and can thus use the full
+   Python API and can take any action such as setting object attributes to
+   signal IO completion.  It must return 0 on success, or -1 signalling an
+   exception.  The notification function won't be interrupted to perform another
+   asynchronous notification recursively, but it can still be interrupted to
+   switch threads if the global interpreter lock is released, for example, if it
+   calls back into python code.
 
    This function returns 0 on success in which case the notification has been
-   scheduled.  Otherwise, for example if the notification buffer is full,
-   it returns -1 without setting any exception.
+   scheduled.  Otherwise, for example if the notification buffer is full, it
+   returns -1 without setting any exception.
 
-   This function can be called on any thread, be it a Python thread or
-   some other system thread.  If it is a Python thread, it doesn't matter if
-   it holds the global interpreter lock or not.
+   This function can be called on any thread, be it a Python thread or some
+   other system thread.  If it is a Python thread, it doesn't matter if it holds
+   the global interpreter lock or not.
 
    .. versionadded:: 2.7
 

Modified: python/branches/py3k-short-float-repr/Doc/distutils/apiref.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/distutils/apiref.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/distutils/apiref.rst	Mon Apr 13 18:30:54 2009
@@ -1950,6 +1950,19 @@
 
 .. % 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.
+It makes sure for example that all required meta-data are provided through
+the arguments passed to the :func:`setup` function.
+
+.. % todo
+
 
 Creating a new Distutils command
 ================================

Modified: python/branches/py3k-short-float-repr/Doc/distutils/examples.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/distutils/examples.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/distutils/examples.rst	Mon Apr 13 18:30:54 2009
@@ -11,7 +11,7 @@
 
 .. seealso::
 
-   `Distutils Cookbook <http://wiki.python.org/moin/DistutilsCookbook>`_
+   `Distutils Cookbook <http://wiki.python.org/moin/Distutils/Cookbook>`_
       Collection of recipes showing how to achieve more control over distutils.
 
 
@@ -233,6 +233,58 @@
          ext_modules=[Extension('foopkg.foo', ['foo.c'])],
          )
 
+Checking a package
+==================
+
+The ``check`` command allows you to verify if your package meta-data are
+meeting the minimum requirements to build a distribution.
+
+To run it, just call it over 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 `docutils` parser::
+
+    $ pythontrunk setup.py check --restructuredtext
+    running check
+    warning: check: Title underline too short. (line 2)
+    warning: check: Could not finish the parsing.
+
 .. % \section{Multiple extension modules}
 .. % \label{multiple-ext}
 

Modified: python/branches/py3k-short-float-repr/Doc/distutils/setupscript.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/distutils/setupscript.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/distutils/setupscript.rst	Mon Apr 13 18:30:54 2009
@@ -334,9 +334,9 @@
 
 There are still some other options which can be used to handle special cases.
 
-The :option:`optional` option is a boolean; if it is true, that specifies that
-a build failure in the extension should not abort the build process, but simply
-not install the failing extension.
+The :option:`optional` option is a boolean; if it is true,
+a build failure in the extension will not abort the build process, but
+instead simply not install the failing extension.
 
 The :option:`extra_objects` option is a list of object files to be passed to the
 linker. These files must not have extensions, as the default extension for the

Modified: python/branches/py3k-short-float-repr/Doc/library/asyncore.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/asyncore.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/asyncore.rst	Mon Apr 13 18:30:54 2009
@@ -81,7 +81,8 @@
    +----------------------+----------------------------------------+
    | Event                | Description                            |
    +======================+========================================+
-   | ``handle_connect()`` | Implied by the first write event       |
+   | ``handle_connect()`` | Implied by the first read or write     |
+   |                      | event                                  |
    +----------------------+----------------------------------------+
    | ``handle_close()``   | Implied by a read event with no data   |
    |                      | available                              |

Modified: python/branches/py3k-short-float-repr/Doc/library/codeop.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/codeop.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/codeop.rst	Mon Apr 13 18:30:54 2009
@@ -26,7 +26,7 @@
 
 To do just the former:
 
-.. function:: compile_command(source[, filename[, symbol]])
+.. function:: compile_command(source, filename="<input>", symbol="single")
 
    Tries to compile *source*, which should be a string of Python code and return a
    code object if *source* is valid Python code. In that case, the filename

Modified: python/branches/py3k-short-float-repr/Doc/library/collections.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/collections.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/collections.rst	Mon Apr 13 18:30:54 2009
@@ -286,7 +286,7 @@
 :class:`deque` objects
 ----------------------
 
-.. class:: deque([iterable[, maxlen]])
+.. class:: deque([iterable, [maxlen]])
 
    Returns a new deque object initialized left-to-right (using :meth:`append`) with
    data from *iterable*.  If *iterable* is not specified, the new deque is empty.
@@ -605,7 +605,7 @@
 self-documenting code.  They can be used wherever regular tuples are used, and
 they add the ability to access fields by name instead of position index.
 
-.. function:: namedtuple(typename, field_names, [verbose], [rename])
+.. function:: namedtuple(typename, field_names, verbose=False, rename=False)
 
    Returns a new tuple subclass named *typename*.  The new subclass is used to
    create tuple-like objects that have fields accessible by attribute lookup as
@@ -852,6 +852,10 @@
 This allows :class:`OrderedDict` objects to be substituted anywhere a
 regular dictionary is used.
 
+The :class:`OrderedDict` constructor and :meth:`update` method both accept
+keyword arguments, but their order is lost because Python's function call
+semantics pass-in keyword arguments using a regular unordered dictionary.
+
 .. seealso::
 
    `Equivalent OrderedDict recipe <http://code.activestate.com/recipes/576693/>`_

Modified: python/branches/py3k-short-float-repr/Doc/library/compileall.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/compileall.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/compileall.rst	Mon Apr 13 18:30:54 2009
@@ -20,7 +20,7 @@
 expression argument.  All files that match the expression will be skipped.
 
 
-.. function:: compile_dir(dir[, maxlevels[, ddir[, force[,  rx[, quiet]]]]])
+.. function:: compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, quiet=False)
 
    Recursively descend the directory tree named by *dir*, compiling all :file:`.py`
    files along the way.  The *maxlevels* parameter is used to limit the depth of
@@ -36,7 +36,7 @@
    operation.
 
 
-.. function:: compile_path([skip_curdir[, maxlevels[, force]]])
+.. function:: compile_path(skip_curdir=True, maxlevels=0, force=False)
 
    Byte-compile all the :file:`.py` files found along ``sys.path``. If
    *skip_curdir* is true (the default), the current directory is not included in

Modified: python/branches/py3k-short-float-repr/Doc/library/configparser.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/configparser.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/configparser.rst	Mon Apr 13 18:30:54 2009
@@ -56,7 +56,7 @@
 write-back, as will be the keys within each section.
 
 
-.. class:: RawConfigParser([defaults[, dict_type]])
+.. class:: RawConfigParser(defaults=None, dict_type=collections.OrderedDict)
 
    The basic configuration object.  When *defaults* is given, it is initialized
    into the dictionary of intrinsic defaults.  When *dict_type* is given, it will
@@ -68,7 +68,7 @@
       The default *dict_type* is :class:`collections.OrderedDict`.
 
 
-.. class:: ConfigParser([defaults[, dict_type]])
+.. class:: ConfigParser(defaults=None, dict_type=collections.OrderedDict)
 
    Derived class of :class:`RawConfigParser` that implements the magical
    interpolation feature and adds optional arguments to the :meth:`get` and
@@ -87,7 +87,7 @@
       The default *dict_type* is :class:`collections.OrderedDict`.
 
 
-.. class:: SafeConfigParser([defaults[, dict_type]])
+.. class:: SafeConfigParser(defaults=None, dict_type=collections.OrderedDict)
 
    Derived class of :class:`ConfigParser` that implements a more-sane variant of
    the magical interpolation feature.  This implementation is more predictable as
@@ -228,7 +228,7 @@
       config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')])
 
 
-.. method:: RawConfigParser.readfp(fp[, filename])
+.. method:: RawConfigParser.readfp(fp, filename=None)
 
    Read and parse configuration data from the file or file-like object in *fp*
    (only the :meth:`readline` method is used).  If *filename* is omitted and *fp*
@@ -315,7 +315,7 @@
 :class:`RawConfigParser` interface, adding some optional arguments.
 
 
-.. method:: ConfigParser.get(section, option[, raw[, vars]])
+.. method:: ConfigParser.get(section, option, raw=False, vars=None)
 
    Get an *option* value for the named *section*.  All the ``'%'`` interpolations
    are expanded in the return values, based on the defaults passed into the
@@ -323,7 +323,7 @@
    is true.
 
 
-.. method:: ConfigParser.items(section[, raw[, vars]])
+.. method:: ConfigParser.items(section, raw=False, vars=None)
 
    Return a list of ``(name, value)`` pairs for each option in the given *section*.
    Optional arguments have the same meaning as for the :meth:`get` method.

Modified: python/branches/py3k-short-float-repr/Doc/library/constants.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/constants.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/constants.rst	Mon Apr 13 18:30:54 2009
@@ -61,8 +61,8 @@
 built-in namespace.  They are useful for the interactive interpreter shell and
 should not be used in programs.
 
-.. data:: quit([code=None])
-          exit([code=None])
+.. data:: quit(code=None)
+          exit(code=None)
 
    Objects that when printed, print a message like "Use quit() or Ctrl-D
    (i.e. EOF) to exit", and when called, raise :exc:`SystemExit` with the

Modified: python/branches/py3k-short-float-repr/Doc/library/copyreg.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/copyreg.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/copyreg.rst	Mon Apr 13 18:30:54 2009
@@ -24,7 +24,7 @@
    hence not valid as a constructor), raises :exc:`TypeError`.
 
 
-.. function:: pickle(type, function[, constructor])
+.. function:: pickle(type, function, constructor=None)
 
    Declares that *function* should be used as a "reduction" function for objects
    of type *type*.  *function* should return either a string or a tuple

Modified: python/branches/py3k-short-float-repr/Doc/library/csv.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/csv.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/csv.rst	Mon Apr 13 18:30:54 2009
@@ -47,7 +47,7 @@
 The :mod:`csv` module defines the following functions:
 
 
-.. function:: reader(csvfile[, dialect='excel'][, fmtparam])
+.. function:: reader(csvfile, dialect='excel', **fmtparams)
 
    Return a reader object which will iterate over lines in the given *csvfile*.
    *csvfile* can be any object which supports the :term:`iterator` protocol and returns a
@@ -57,7 +57,7 @@
    *dialect* parameter can be given which is used to define a set of parameters
    specific to a particular CSV dialect.  It may be an instance of a subclass of
    the :class:`Dialect` class or one of the strings returned by the
-   :func:`list_dialects` function.  The other optional *fmtparam* keyword arguments
+   :func:`list_dialects` function.  The other optional *fmtparams* keyword arguments
    can be given to override individual formatting parameters in the current
    dialect.  For full details about the dialect and formatting parameters, see
    section :ref:`csv-fmt-params`.
@@ -76,7 +76,7 @@
       Spam, Lovely Spam, Wonderful Spam
 
 
-.. function:: writer(csvfile[, dialect='excel'][, fmtparam])
+.. function:: writer(csvfile, dialect='excel', **fmtparams)
 
    Return a writer object responsible for converting the user's data into delimited
    strings on the given file-like object.  *csvfile* can be any object with a
@@ -84,7 +84,7 @@
    parameter can be given which is used to define a set of parameters specific to a
    particular CSV dialect.  It may be an instance of a subclass of the
    :class:`Dialect` class or one of the strings returned by the
-   :func:`list_dialects` function.  The other optional *fmtparam* keyword arguments
+   :func:`list_dialects` function.  The other optional *fmtparams* keyword arguments
    can be given to override individual formatting parameters in the current
    dialect.  For full details about the dialect and formatting parameters, see
    section :ref:`csv-fmt-params`. To make it
@@ -103,11 +103,11 @@
       >>> spamWriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])
 
 
-.. function:: register_dialect(name[, dialect][, fmtparam])
+.. function:: register_dialect(name[, dialect], **fmtparams)
 
    Associate *dialect* with *name*.  *name* must be a string. The
    dialect can be specified either by passing a sub-class of :class:`Dialect`, or
-   by *fmtparam* keyword arguments, or both, with keyword arguments overriding
+   by *fmtparams* keyword arguments, or both, with keyword arguments overriding
    parameters of the dialect. For full details about the dialect and formatting
    parameters, see section :ref:`csv-fmt-params`.
 
@@ -137,7 +137,7 @@
 
 The :mod:`csv` module defines the following classes:
 
-.. class:: DictReader(csvfile[, fieldnames=None[, restkey=None[, restval=None[, dialect='excel'[, *args, **kwds]]]]])
+.. class:: DictReader(csvfile, fieldnames=None, restkey=None, restval=None, dialect='excel', *args, **kwds)
 
    Create an object which operates like a regular reader but maps the information
    read into a dict whose keys are given by the optional  *fieldnames* parameter.
@@ -151,7 +151,7 @@
    arguments are passed to the underlying :class:`reader` instance.
 
 
-.. class:: DictWriter(csvfile, fieldnames[, restval=''[, extrasaction='raise'[, dialect='excel'[, *args, **kwds]]]])
+.. class:: DictWriter(csvfile, fieldnames, restval='', extrasaction='raise', dialect='excel', *args, **kwds)
 
    Create an object which operates like a regular writer but maps dictionaries onto
    output rows.  The *fieldnames* parameter identifies the order in which values in
@@ -195,7 +195,7 @@
 
    The :class:`Sniffer` class provides two methods:
 
-   .. method:: sniff(sample[, delimiters=None])
+   .. method:: sniff(sample, delimiters=None)
 
       Analyze the given *sample* and return a :class:`Dialect` subclass
       reflecting the parameters found.  If the optional *delimiters* parameter

Modified: python/branches/py3k-short-float-repr/Doc/library/curses.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/curses.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/curses.rst	Mon Apr 13 18:30:54 2009
@@ -531,7 +531,7 @@
    capability, or is canceled or absent from the terminal description.
 
 
-.. function:: tparm(str[,...])
+.. function:: tparm(str[, ...])
 
    Instantiates the string *str* with the supplied parameters, where  *str* should
    be a parameterized string obtained from the terminfo  database.  E.g.

Modified: python/branches/py3k-short-float-repr/Doc/library/datetime.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/datetime.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/datetime.rst	Mon Apr 13 18:30:54 2009
@@ -128,7 +128,7 @@
 dates or times.
 
 
-.. class:: timedelta([days[, seconds[, microseconds[, milliseconds[, minutes[, hours[, weeks]]]]]]])
+.. class:: timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)
 
    All arguments are optional and default to ``0``.  Arguments may be integers
    or floats, and may be positive or negative.
@@ -570,7 +570,7 @@
 Constructor:
 
 
-.. class:: datetime(year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
+.. class:: datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None)
 
    The year, month and day arguments are required.  *tzinfo* may be ``None``, or an
    instance of a :class:`tzinfo` subclass.  The remaining arguments may be integers,
@@ -596,7 +596,7 @@
    :meth:`fromtimestamp`.
 
 
-.. method:: datetime.now([tz])
+.. method:: datetime.now(tz=None)
 
    Return the current local date and time.  If optional argument *tz* is ``None``
    or not specified, this is like :meth:`today`, but, if possible, supplies more
@@ -617,7 +617,7 @@
    :class:`datetime` object. See also :meth:`now`.
 
 
-.. method:: datetime.fromtimestamp(timestamp[, tz])
+.. method:: datetime.fromtimestamp(timestamp, tz=None)
 
    Return the local date and time corresponding to the POSIX timestamp, such as is
    returned by :func:`time.time`. If optional argument *tz* is ``None`` or not
@@ -947,7 +947,7 @@
    ``self.date().isocalendar()``.
 
 
-.. method:: datetime.isoformat([sep])
+.. method:: datetime.isoformat(sep='T')
 
    Return a string representing the date and time in ISO 8601 format,
    YYYY-MM-DDTHH:MM:SS.mmmmmm or, if :attr:`microsecond` is 0,
@@ -1101,7 +1101,7 @@
 day, and subject to adjustment via a :class:`tzinfo` object.
 
 
-.. class:: time(hour[, minute[, second[, microsecond[, tzinfo]]]])
+.. class:: time(hour=0, minute=0, second=0, microsecond=0, tzinfo=None)
 
    All arguments are optional.  *tzinfo* may be ``None``, or an instance of a
    :class:`tzinfo` subclass.  The remaining arguments may be integers, in the

Modified: python/branches/py3k-short-float-repr/Doc/library/dbm.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/dbm.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/dbm.rst	Mon Apr 13 18:30:54 2009
@@ -30,7 +30,7 @@
    name, such as ``'dbm.ndbm'`` or ``'dbm.gnu'``.
 
 
-.. function:: open(filename[, flag[, mode]])
+.. function:: open(filename, flag='r', mode=0o666)
 
    Open the database file *filename* and return a corresponding object.
 
@@ -121,7 +121,7 @@
    raised for general mapping errors like specifying an incorrect key.
 
 
-.. function:: open(filename, [flag, [mode]])
+.. function:: open(filename[, flag[, mode]])
 
    Open a ``gdbm`` database and return a :class:`gdbm` object.  The *filename*
    argument is the name of the database file.

Modified: python/branches/py3k-short-float-repr/Doc/library/decimal.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/decimal.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/decimal.rst	Mon Apr 13 18:30:54 2009
@@ -305,7 +305,7 @@
 ---------------
 
 
-.. class:: Decimal([value [, context]])
+.. class:: Decimal(value="0", context=None)
 
    Construct a new :class:`Decimal` object based from *value*.
 

Modified: python/branches/py3k-short-float-repr/Doc/library/difflib.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/difflib.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/difflib.rst	Mon Apr 13 18:30:54 2009
@@ -72,7 +72,7 @@
    The constructor for this class is:
 
 
-   .. function:: __init__([tabsize][, wrapcolumn][, linejunk][, charjunk])
+   .. method:: __init__(tabsize=8, wrapcolumn=None, linejunk=None, charjunk=IS_CHARACTER_JUNK)
 
       Initializes instance of :class:`HtmlDiff`.
 
@@ -88,8 +88,7 @@
 
    The following methods are public:
 
-
-   .. function:: make_file(fromlines, tolines [, fromdesc][, todesc][, context][, numlines])
+   .. method:: make_file(fromlines, tolines, fromdesc='', todesc='', context=False, numlines=5)
 
       Compares *fromlines* and *tolines* (lists of strings) and returns a string which
       is a complete HTML file containing a table showing line by line differences with
@@ -108,8 +107,7 @@
       the next difference highlight at the top of the browser without any leading
       context).
 
-
-   .. function:: make_table(fromlines, tolines [, fromdesc][, todesc][, context][, numlines])
+   .. method:: make_table(fromlines, tolines, fromdesc='', todesc='', context=False, numlines=5)
 
       Compares *fromlines* and *tolines* (lists of strings) and returns a string which
       is a complete HTML table showing line by line differences with inter-line and
@@ -122,7 +120,7 @@
    contains a good example of its use.
 
 
-.. function:: context_diff(a, b[, fromfile][, tofile][, fromfiledate][, tofiledate][, n][, lineterm])
+.. function:: context_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\\n')
 
    Compare *a* and *b* (lists of strings); return a delta (a :term:`generator`
    generating the delta lines) in context diff format.
@@ -167,7 +165,7 @@
    See :ref:`difflib-interface` for a more detailed example.
 
 
-.. function:: get_close_matches(word, possibilities[, n][, cutoff])
+.. function:: get_close_matches(word, possibilities, n=3, cutoff=0.6)
 
    Return a list of the best "good enough" matches.  *word* is a sequence for which
    close matches are desired (typically a string), and *possibilities* is a list of
@@ -193,7 +191,7 @@
       ['except']
 
 
-.. function:: ndiff(a, b[, linejunk][, charjunk])
+.. function:: ndiff(a, b, linejunk=None, charjunk=IS_CHARACTER_JUNK)
 
    Compare *a* and *b* (lists of strings); return a :class:`Differ`\ -style
    delta (a :term:`generator` generating the delta lines).
@@ -253,7 +251,7 @@
       emu
 
 
-.. function:: unified_diff(a, b[, fromfile][, tofile][, fromfiledate][, tofiledate][, n][, lineterm])
+.. function:: unified_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\\n')
 
    Compare *a* and *b* (lists of strings); return a delta (a :term:`generator`
    generating the delta lines) in unified diff format.
@@ -326,7 +324,7 @@
 The :class:`SequenceMatcher` class has this constructor:
 
 
-.. class:: SequenceMatcher([isjunk[, a[, b]]])
+.. class:: SequenceMatcher(isjunk=None, a='', b='')
 
    Optional argument *isjunk* must be ``None`` (the default) or a one-argument
    function that takes a sequence element and returns true if and only if the
@@ -467,7 +465,7 @@
          insert a[6:6] () b[5:6] (f)
 
 
-   .. method:: get_grouped_opcodes([n])
+   .. method:: get_grouped_opcodes(n=3)
 
       Return a :term:`generator` of groups with up to *n* lines of context.
 
@@ -580,7 +578,7 @@
 The :class:`Differ` class has this constructor:
 
 
-.. class:: Differ([linejunk[, charjunk]])
+.. class:: Differ(linejunk=None, charjunk=None)
 
    Optional keyword parameters *linejunk* and *charjunk* are for filter functions
    (or ``None``):

Modified: python/branches/py3k-short-float-repr/Doc/library/dis.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/dis.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/dis.rst	Mon Apr 13 18:30:54 2009
@@ -30,22 +30,23 @@
 The :mod:`dis` module defines the following functions and constants:
 
 
-.. function:: dis([bytesource])
+.. function:: dis(x=None)
 
-   Disassemble the *bytesource* object. *bytesource* can denote either a module, a
+   Disassemble the *x* object. *x* can denote either a module, a
    class, a method, a function, or a code object.   For a module, it disassembles
    all functions.  For a class, it disassembles all methods.  For a single code
    sequence, it prints one line per bytecode instruction.  If no object is
    provided, it disassembles the last traceback.
 
 
-.. function:: distb([tb])
+.. function:: distb(tb=None)
 
    Disassembles the top-of-stack function of a traceback, using the last traceback
    if none was passed.  The instruction causing the exception is indicated.
 
 
-.. function:: disassemble(code[, lasti])
+.. function:: disassemble(code, lasti=-1)
+              disco(code, lasti=-1)
 
    Disassembles a code object, indicating the last instruction if *lasti* was
    provided.  The output is divided in the following columns:
@@ -62,12 +63,6 @@
    constant values, branch targets, and compare operators.
 
 
-.. function:: disco(code[, lasti])
-
-   A synonym for :func:`disassemble`.  It is more convenient to type, and kept
-   for compatibility with earlier Python releases.
-
-
 .. function:: findlinestarts(code)
 
    This generator function uses the ``co_firstlineno`` and ``co_lnotab``

Modified: python/branches/py3k-short-float-repr/Doc/library/doctest.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/doctest.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/doctest.rst	Mon Apr 13 18:30:54 2009
@@ -753,7 +753,7 @@
 and :ref:`doctest-simple-testfile`.
 
 
-.. function:: testfile(filename[, module_relative][, name][, package][, globs][, verbose][, report][, optionflags][, extraglobs][, raise_on_error][, parser][, encoding])
+.. function:: testfile(filename, module_relative=True, name=None, package=None, globs=None, verbose=None, report=True, optionflags=0, extraglobs=None, raise_on_error=False, parser=DocTestParser(), encoding=None)
 
    All arguments except *filename* are optional, and should be specified in keyword
    form.
@@ -822,7 +822,7 @@
    convert the file to unicode.
 
 
-.. function:: testmod([m][, name][, globs][, verbose][, report][, optionflags][, extraglobs][, raise_on_error][, exclude_empty])
+.. function:: testmod(m=None, name=None, globs=None, verbose=None, report=True, optionflags=0, extraglobs=None, raise_on_error=False, exclude_empty=False)
 
    All arguments are optional, and all except for *m* should be specified in
    keyword form.
@@ -860,7 +860,7 @@
 deprecate it, but it's rarely useful:
 
 
-.. function:: run_docstring_examples(f, globs[, verbose][, name][, compileflags][, optionflags])
+.. function:: run_docstring_examples(f, globs, verbose=False, name="NoName", compileflags=None, optionflags=0)
 
    Test examples associated with object *f*; for example, *f* may be a module,
    function, or class object.
@@ -905,7 +905,7 @@
 from text files and modules with doctests:
 
 
-.. function:: DocFileSuite(*paths, [module_relative][, package][, setUp][, tearDown][, globs][, optionflags][, parser][, encoding])
+.. function:: DocFileSuite(*paths, module_relative=True, package=None, setUp=None, tearDown=None, globs=None, optionflags=0, parser=DocTestParser(), encoding=None)
 
    Convert doctest tests from one or more text files to a
    :class:`unittest.TestSuite`.
@@ -972,7 +972,7 @@
    from a text file using :func:`DocFileSuite`.
 
 
-.. function:: DocTestSuite([module][, globs][, extraglobs][, test_finder][, setUp][, tearDown][, checker])
+.. function:: DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None, setUp=None, tearDown=None, checker=None)
 
    Convert doctest tests for a module to a :class:`unittest.TestSuite`.
 
@@ -1158,7 +1158,7 @@
 ^^^^^^^^^^^^^^^
 
 
-.. class:: Example(source, want[, exc_msg][, lineno][, indent][, options])
+.. class:: Example(source, want, exc_msg=None, lineno=0, indent=0, options=None)
 
    A single interactive example, consisting of a Python statement and its expected
    output.  The constructor arguments are used to initialize the member variables
@@ -1220,7 +1220,7 @@
 ^^^^^^^^^^^^^^^^^^^^^
 
 
-.. class:: DocTestFinder([verbose][, parser][, recurse][, exclude_empty])
+.. class:: DocTestFinder(verbose=False, parser=DocTestParser(), recurse=True, exclude_empty=True)
 
    A processing class used to extract the :class:`DocTest`\ s that are relevant to
    a given object, from its docstring and the docstrings of its contained objects.
@@ -1306,14 +1306,14 @@
       information.
 
 
-   .. method:: get_examples(string[, name])
+   .. method:: get_examples(string, name='<string>')
 
       Extract all doctest examples from the given string, and return them as a list
       of :class:`Example` objects.  Line numbers are 0-based.  The optional argument
       *name* is a name identifying this string, and is only used for error messages.
 
 
-   .. method:: parse(string[, name])
+   .. method:: parse(string, name='<string>')
 
       Divide the given string into examples and intervening text, and return them as
       a list of alternating :class:`Example`\ s and strings. Line numbers for the
@@ -1327,7 +1327,7 @@
 ^^^^^^^^^^^^^^^^^^^^^
 
 
-.. class:: DocTestRunner([checker][, verbose][, optionflags])
+.. class:: DocTestRunner(checker=None, verbose=None, optionflags=0)
 
    A processing class used to execute and verify the interactive examples in a
    :class:`DocTest`.
@@ -1409,7 +1409,7 @@
       output function that was passed to :meth:`DocTestRunner.run`.
 
 
-   .. method:: run(test[, compileflags][, out][, clear_globs])
+   .. method:: run(test, compileflags=None, out=None, clear_globs=True)
 
       Run the examples in *test* (a :class:`DocTest` object), and display the
       results using the writer function *out*.
@@ -1428,7 +1428,7 @@
       :meth:`DocTestRunner.report_\*` methods.
 
 
-   .. method:: summarize([verbose])
+   .. method:: summarize(verbose=None)
 
       Print a summary of all the test cases that have been run by this DocTestRunner,
       and return a :term:`named tuple` ``TestResults(failed, attempted)``.
@@ -1592,7 +1592,7 @@
    converted to code, and the rest placed in comments.
 
 
-.. function:: debug(module, name[, pm])
+.. function:: debug(module, name, pm=False)
 
    Debug the doctests for an object.
 
@@ -1613,7 +1613,7 @@
    passing an appropriate :func:`exec` call to :func:`pdb.run`.
 
 
-.. function:: debug_src(src[, pm][, globs])
+.. function:: debug_src(src, pm=False, globs=None)
 
    Debug the doctests in a string.
 
@@ -1633,7 +1633,7 @@
 doctest!) for more details:
 
 
-.. class:: DebugRunner([checker][, verbose][, optionflags])
+.. class:: DebugRunner(checker=None, verbose=None, optionflags=0)
 
    A subclass of :class:`DocTestRunner` that raises an exception as soon as a
    failure is encountered.  If an unexpected exception occurs, an

Modified: python/branches/py3k-short-float-repr/Doc/library/io.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/io.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/io.rst	Mon Apr 13 18:30:54 2009
@@ -279,7 +279,7 @@
 
       Return the new absolute position.
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
          The ``SEEK_*`` constants
 
    .. method:: seekable()

Modified: python/branches/py3k-short-float-repr/Doc/library/itertools.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/itertools.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/itertools.rst	Mon Apr 13 18:30:54 2009
@@ -34,41 +34,46 @@
 
 **Infinite Iterators:**
 
-    ==================  =================       =================================================
-    Iterator            Arguments               Results
-    ==================  =================       =================================================
-    :func:`count`       start, [step]           start, start+step, start+2*step, ...
-    :func:`cycle`       p                       p0, p1, ... plast, p0, p1, ...
-    :func:`repeat`      elem [,n]               elem, elem, elem, ... endlessly or up to n times
-    ==================  =================       =================================================
+==================  =================       =================================================               =========================================
+Iterator            Arguments               Results                                                         Example
+==================  =================       =================================================               =========================================
+:func:`count`       start, [step]           start, start+step, start+2*step, ...                            ``count(10) --> 10 11 12 13 14 ...``
+:func:`cycle`       p                       p0, p1, ... plast, p0, p1, ...                                  ``cycle('ABCD') --> A B C D A B C D ...``
+:func:`repeat`      elem [,n]               elem, elem, elem, ... endlessly or up to n times                ``repeat(10, 3) --> 10 10 10``
+==================  =================       =================================================               =========================================
 
 **Iterators terminating on the shortest input sequence:**
 
-    ====================    ============================    =================================================
-    Iterator                Arguments                       Results
-    ====================    ============================    =================================================
-    :func:`chain`           p, q, ...                       p0, p1, ... plast, q0, q1, ...
-    :func:`compress`        data, selectors                 (d[0] if s[0]), (d[1] if s[1]), ...
-    :func:`dropwhile`       pred, seq                       seq[n], seq[n+1], starting when pred fails
-    :func:`filterfalse`     pred, seq                       elements of seq where pred(elem) is False
-    :func:`groupby`         iterable[, keyfunc]             sub-iterators grouped by value of keyfunc(v)
-    :func:`islice`          seq, [start,] stop [, step]     elements from seq[start:stop:step]
-    :func:`starmap`         func, seq                       func(\*seq[0]), func(\*seq[1]), ...
-    :func:`tee`             it, n                           it1, it2 , ... itn  splits one iterator into n
-    :func:`takewhile`       pred, seq                       seq[0], seq[1], until pred fails
-    :func:`zip_longest`     p, q, ...                       (p[0], q[0]), (p[1], q[1]), ...
-    ====================    ============================    =================================================
+====================    ============================    =================================================   =============================================================
+Iterator                Arguments                       Results                                             Example
+====================    ============================    =================================================   =============================================================
+:func:`chain`           p, q, ...                       p0, p1, ... plast, q0, q1, ...                      ``chain('ABC', 'DEF') --> A B C D E F``
+:func:`compress`        data, selectors                 (d[0] if s[0]), (d[1] if s[1]), ...                 ``compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F``
+:func:`dropwhile`       pred, seq                       seq[n], seq[n+1], starting when pred fails          ``dropwhile(lambda x: x<5, [1,4,6,4,1]) --> 6 4 1``
+:func:`filterfalse`     pred, seq                       elements of seq where pred(elem) is False           ``ifilterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8``
+:func:`groupby`         iterable[, keyfunc]             sub-iterators grouped by value of keyfunc(v)
+:func:`islice`          seq, [start,] stop [, step]     elements from seq[start:stop:step]                  ``islice('ABCDEFG', 2, None) --> C D E F G``
+:func:`starmap`         func, seq                       func(\*seq[0]), func(\*seq[1]), ...                 ``starmap(pow, [(2,5), (3,2), (10,3)]) --> 32 9 1000``
+:func:`takewhile`       pred, seq                       seq[0], seq[1], until pred fails                    ``takewhile(lambda x: x<5, [1,4,6,4,1]) --> 1 4``
+:func:`tee`             it, n                           it1, it2 , ... itn  splits one iterator into n
+:func:`zip_longest`     p, q, ...                       (p[0], q[0]), (p[1], q[1]), ...                     ``izip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D-``
+====================    ============================    =================================================   =============================================================
 
 **Combinatoric generators:**
 
-    =====================================   ====================       =================================================
-    Iterator                                Arguments                  Results
-    =====================================   ====================       =================================================
-    :func:`product`                         p, q, ... [repeat=1]       cartesian product
-    :func:`permutations`                    p[, r]                     r-length permutations (without repeated elements)
-    :func:`combinations`                    p[, r]                     r-length combinations (sorted and no repeats)
-    :func:`combinations_with_replacement`   p[, r]                     r-length combinations (sorted but with repeats)
-    =====================================   ====================       =================================================
+==============================================   ====================       =============================================================
+Iterator                                         Arguments                  Results
+==============================================   ====================       =============================================================
+:func:`product`                                  p, q, ... [repeat=1]       cartesian product, equivalent to a nested for-loop
+:func:`permutations`                             p[, r]                     r-length tuples, all possible orderings, no repeated elements
+:func:`combinations`                             p[, r]                     r-length tuples, in sorted order, no repeated elements
+:func:`combinations_with_replacement`            p[, r]                     r-length tuples, in sorted order, with repeated elements
+|
+``product('ABCD', repeat=2)``                                               ``AA AB AC AD BA BB BC BD CA CB CC CD DA DB DC DD``
+``permutations('ABCD', 2)``                                                 ``AB AC AD BA BC BD CA CB CD DA DB DC``
+``combinations('ABCD', 2)``                                                 ``AB AC AD BC BD CD``
+``combinations_with_replacement('ABCD', 2)``                                ``AA AB AC AD BB BC BD CC CD DD``
+==============================================   ====================       =============================================================
 
 
 .. _itertools-functions:
@@ -550,43 +555,6 @@
    *fillvalue* defaults to ``None``.
 
 
-.. _itertools-example:
-
-Examples
---------
-
-The following examples show common uses for each tool and demonstrate ways they
-can be combined.
-
-.. doctest::
-
-   >>> # Show a dictionary sorted and grouped by value
-   >>> from operator import itemgetter
-   >>> d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3)
-   >>> di = sorted(d.items(), key=itemgetter(1))
-   >>> for k, g in groupby(di, key=itemgetter(1)):
-   ...     print(k, map(itemgetter(0), g))
-   ...
-   1 ['a', 'c', 'e']
-   2 ['b', 'd', 'f']
-   3 ['g']
-
-   >>> # Find runs of consecutive numbers using groupby.  The key to the solution
-   >>> # is differencing with a range so that consecutive numbers all appear in
-   >>> # same group.
-   >>> data = [ 1,  4,5,6, 10, 15,16,17,18, 22, 25,26,27,28]
-   >>> for k, g in groupby(enumerate(data), lambda t:t[0]-t[1]):
-   ...     print(map(operator.itemgetter(1), g))
-   ...
-   [1]
-   [4, 5, 6]
-   [10]
-   [15, 16, 17, 18]
-   [22]
-   [25, 26, 27, 28]
-
-
-
 .. _itertools-recipes:
 
 Recipes

Modified: python/branches/py3k-short-float-repr/Doc/library/json.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/json.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/json.rst	Mon Apr 13 18:30:54 2009
@@ -118,7 +118,7 @@
    file-like object).
 
    If *skipkeys* is ``True`` (default: ``False``), then dict keys that are not
-   of a basic type (:class:`str`, :class:`unicode`, :class:`int`, :class:`long`,
+   of a basic type (:class:`str`, :class:`unicode`, :class:`int`,
    :class:`float`, :class:`bool`, ``None``) will be skipped instead of raising a
    :exc:`TypeError`.
 
@@ -232,7 +232,7 @@
    +---------------+-------------------+
    | string        | unicode           |
    +---------------+-------------------+
-   | number (int)  | int, long         |
+   | number (int)  | int               |
    +---------------+-------------------+
    | number (real) | float             |
    +---------------+-------------------+
@@ -304,7 +304,7 @@
    +-------------------+---------------+
    | str, unicode      | string        |
    +-------------------+---------------+
-   | int, long, float  | number        |
+   | int, float        | number        |
    +-------------------+---------------+
    | True              | true          |
    +-------------------+---------------+
@@ -319,7 +319,7 @@
    (to raise :exc:`TypeError`).
 
    If *skipkeys* is ``False`` (the default), then it is a :exc:`TypeError` to
-   attempt encoding of keys that are not str, int, long, float or None.  If
+   attempt encoding of keys that are not str, int, float or None.  If
    *skipkeys* is ``True``, such items are simply skipped.
 
    If *ensure_ascii* is ``True`` (the default), the output is guaranteed to be

Modified: python/branches/py3k-short-float-repr/Doc/library/multiprocessing.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/multiprocessing.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/multiprocessing.rst	Mon Apr 13 18:30:54 2009
@@ -841,7 +841,7 @@
    will always return ``True`` except if a timeout is given and the operation
    times out.
 
-   .. versionchanged:: 2.7
+   .. versionchanged:: 3.1
       Previously, the method always returned ``None``.
 
 .. class:: Lock()
@@ -1128,9 +1128,10 @@
    ``current_process().authkey``.  Otherwise *authkey* is used and it
    must be a string.
 
-   .. method:: start()
+   .. method:: start([initializer[, initargs]])
 
-      Start a subprocess to start the manager.
+      Start a subprocess to start the manager.  If *initializer* is not ``None``
+      then the subprocess will call ``initializer(*initargs)`` when it starts.
 
    .. method:: serve_forever()
 

Modified: python/branches/py3k-short-float-repr/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/stdtypes.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/stdtypes.rst	Mon Apr 13 18:30:54 2009
@@ -479,7 +479,7 @@
    exponent.
 
 
-.. method:: float.fromhex(s)
+.. classmethod:: float.fromhex(s)
 
    Class method to return the float represented by a hexadecimal
    string *s*.  The string *s* may have leading and trailing
@@ -967,7 +967,7 @@
       'example.com'
 
 
-.. method:: str.maketrans(x[, y[, z]])
+.. staticmethod:: str.maketrans(x[, y[, z]])
 
    This static method returns a translation table usable for :meth:`str.translate`.
 
@@ -1514,8 +1514,8 @@
 
 The bytes and bytearray types have an additional class method:
 
-.. method:: bytes.fromhex(string)
-            bytearray.fromhex(string)
+.. classmethod:: bytes.fromhex(string)
+                 bytearray.fromhex(string)
 
    This :class:`bytes` class method returns a bytes or bytearray object,
    decoding the given string object.  The string must contain two hexadecimal
@@ -1524,7 +1524,9 @@
    >>> bytes.fromhex('f0 f1f2  ')
    b'\xf0\xf1\xf2'
 
-The translate method differs in semantics from the version available on strings:
+
+The maketrans and translate methods differ in semantics from the versions
+available on strings:
 
 .. method:: bytes.translate(table[, delete])
 
@@ -1533,8 +1535,7 @@
    mapped through the given translation table, which must be a bytes object of
    length 256.
 
-   You can use the :func:`string.maketrans` helper function to create a
-   translation table.
+   You can use the :func:`bytes.maketrans` method to create a translation table.
 
    Set the *table* argument to ``None`` for translations that only delete
    characters::
@@ -1543,6 +1544,16 @@
       b'rd ths shrt txt'
 
 
+.. staticmethod:: bytes.maketrans(from, to)
+
+   This static method returns a translation table usable for
+   :meth:`bytes.translate` that will map each character in *from* into the
+   character at the same position in *to*; *from* and *to* must be bytes objects
+   and have the same length.
+
+   .. versionadded:: 3.1
+
+
 .. _types-set:
 
 Set Types --- :class:`set`, :class:`frozenset`
@@ -1847,7 +1858,7 @@
 
       Return a shallow copy of the dictionary.
 
-   .. method:: fromkeys(seq[, value])
+   .. classmethod:: fromkeys(seq[, value])
 
       Create a new dictionary with keys from *seq* and values set to *value*.
 

Modified: python/branches/py3k-short-float-repr/Doc/library/string.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/string.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/string.rst	Mon Apr 13 18:30:54 2009
@@ -548,13 +548,9 @@
   delimiter), and it should appear last in the regular expression.
 
 
-String functions
+Helper functions
 ----------------
 
-The following functions are available to operate on string objects.
-They are not available as string methods.
-
-
 .. function:: capwords(s)
 
    Split the argument into words using :func:`split`, capitalize each word using
@@ -568,3 +564,6 @@
    Return a translation table suitable for passing to :meth:`bytes.translate`,
    that will map each character in *from* into the character at the same
    position in *to*; *from* and *to* must have the same length.
+
+   .. deprecated:: 3.1
+      Use the :meth:`bytes.maketrans` static method instead.

Modified: python/branches/py3k-short-float-repr/Doc/library/sys.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/sys.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/sys.rst	Mon Apr 13 18:30:54 2009
@@ -833,7 +833,7 @@
    so ``sys.version_info[0]`` is equivalent to ``sys.version_info.major``
    and so on.
 
-   .. versionchanged:: 2.7
+   .. versionchanged:: 3.1
       Added named component attributes
 
 .. data:: warnoptions

Modified: python/branches/py3k-short-float-repr/Doc/library/test.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/test.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/test.rst	Mon Apr 13 18:30:54 2009
@@ -322,6 +322,30 @@
       assert s.getvalue() == "hello"
 
 
+.. function:: import_module(name, deprecated=False)
+
+   This function imports and returns the named module. Unlike a normal
+   import, this function raises :exc:`unittest.SkipTest` if the module
+   cannot be imported.
+
+   Module and package deprecation messages are suppressed during this import
+   if *deprecated* is :const:`True`.
+
+   .. versionadded:: 3.1
+
+
+.. function:: import_fresh_module(name, blocked_names=None, deprecated=False)
+
+   This function imports and returns a fresh copy of the named Python module. The
+   ``sys.modules`` cache is bypassed temporarily, and the ability to import the
+   modules named in *blocked_names* is suppressed for the duration of the import.
+
+   Module and package deprecation messages are suppressed during this import
+   if *deprecated* is :const:`True`.
+
+   .. versionadded:: 3.1
+
+
 The :mod:`test.support` module defines the following classes:
 
 .. class:: TransientResource(exc[, **kwargs])

Modified: python/branches/py3k-short-float-repr/Doc/library/threading.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/threading.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/threading.rst	Mon Apr 13 18:30:54 2009
@@ -687,7 +687,7 @@
    This method returns the internal flag on exit, so it will always return
    ``True`` except if a timeout is given and the operation times out.
 
-   .. versionchanged:: 2.7
+   .. versionchanged:: 3.1
       Previously, the method always returned ``None``.
 
 

Modified: python/branches/py3k-short-float-repr/Doc/library/tkinter.ttk.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/tkinter.ttk.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/tkinter.ttk.rst	Mon Apr 13 18:30:54 2009
@@ -9,13 +9,13 @@
 .. index:: single: ttk
 
 The :mod:`tkinter.ttk` module provides access to the Tk themed widget set,
-which has been introduced in Tk 8.5. If you do not have Python compiled against
-Tk 8.5 you may still use this module as long as you have Tile installed, but
-then you will miss some features provided by the new Tk, like anti-aliased font
-rendering under X11, window transparency (on X11 you will need a composition
-window manager) and others.
+introduced in Tk 8.5. If Python has not been compiled against Tk 8.5, this
+module can still be accessed if *Tile* has been installed.  The former
+method using Tk 8.5 provides additional benefits including anti-aliased font
+rendering under X11 and window transparency (requiring a composition
+window manager on X11).
 
-The basic idea of :mod:`tkinter.ttk` is to separate, to the extent possible,
+The basic idea for :mod:`tkinter.ttk` is to separate, to the extent possible,
 the code implementing a widget's behavior from the code implementing its
 appearance.
 
@@ -23,58 +23,55 @@
 .. seealso::
 
    `Tk Widget Styling Support <http://www.tcl.tk/cgi-bin/tct/tip/48>`_
-      The document which brought up theming support for Tk
+      A document introducing theming support for Tk
 
 
 Using Ttk
 ---------
 
-Basically, to start using Ttk, you have to import its module::
+To start using Ttk, import its module::
 
    from tkinter import ttk
 
-But if you already have some code that does::
-
-   from tkinter import *
-
-You may optionally want to use::
+To override the basic Tk widgets, the import should follow the Tk import::
 
    from tkinter import *
    from tkinter.ttk import *
 
-And then several :mod:`tkinter.ttk` widgets (:class:`Button`,
+That code causes several :mod:`tkinter.ttk` widgets (:class:`Button`,
 :class:`Checkbutton`, :class:`Entry`, :class:`Frame`, :class:`Label`,
 :class:`LabelFrame`, :class:`Menubutton`, :class:`PanedWindow`,
-:class:`Radiobutton`, :class:`Scale` and :class:`Scrollbar`) will
-automatically substitute the Tk widgets.
+:class:`Radiobutton`, :class:`Scale` and :class:`Scrollbar`) to
+automatically replace the Tk widgets.
+
+This has the direct benefit of using the new widgets which gives a better
+look and feel across platforms; however, the replacement widgets are not
+completely compatible. The main difference is that widget options such as
+"fg", "bg" and others related to widget styling are no
+longer present in Ttk widgets.  Instead, use  the :class:`ttk.Style` class
+for improved styling effects.
 
-This has the direct benefit of using the new widgets which gives better
-look & feel across platforms, but you should be aware that they are not
-totally compatible. The main difference you will find out is that widget
-options such as "fg", "bg" and others related to widget styling are no
-longer present in Ttk widgets, instead you will have to use :class:`ttk.Style`
-to achieve the same (or better) styling.
 
 .. seealso::
 
-   `Converting existing applications to use the Tile widgets <http://tktable.sourceforge.net/tile/doc/converting.txt>`_
-     A text which talks in Tcl terms about differences typically found when
-     moving applications to use the new widgets.
+   `Converting existing applications to use Tile widgets <http://tktable.sourceforge.net/tile/doc/converting.txt>`_
+     A monograph (using Tcl terminology) about differences typically
+     encountered when moving applications to use the new widgets.
 
 
 Ttk Widgets
 -----------
 
-Ttk comes with 17 widgets, where 11 of these already existed in tkinter:
+Ttk comes with 17 widgets, eleven of which already existed in tkinter:
 :class:`Button`, :class:`Checkbutton`, :class:`Entry`, :class:`Frame`,
 :class:`Label`, :class:`LabelFrame`, :class:`Menubutton`, :class:`PanedWindow`,
-:class:`Radiobutton`, :class:`Scale` and :class:`Scrollbar`. The others 6 are
+:class:`Radiobutton`, :class:`Scale` and :class:`Scrollbar`. The other six are
 new: :class:`Combobox`, :class:`Notebook`, :class:`Progressbar`,
 :class:`Separator`, :class:`Sizegrip` and :class:`Treeview`. And all them are
 subclasses of :class:`Widget`.
 
-Like it was told before, you will notice changes in look & feel as well in the
-styling code. To demonstrate the latter, a very simple example is shown below.
+Using the Ttk widgets gives the application an improved look and feel.
+As discussed above, there are differences in how the styling is coded.
 
 Tk code::
 
@@ -90,7 +87,7 @@
    l1 = ttk.Label(text="Test", style="BW.TLabel")
    l2 = ttk.Label(text="Test", style="BW.TLabel")
 
-For more information about TtkStyling_ read the :class:`Style` class
+For more information about TtkStyling_, see the :class:`Style` class
 documentation.
 
 Widget
@@ -554,10 +551,10 @@
 -----------
 
 The :class:`ttk.Progressbar` widget shows the status of a long-running
-operation. It can operate in two modes: determinate mode shows the amount
-completed relative to the total amount of work to be done, and indeterminate
-mode provides an animated display to let the user know that something is
-happening.
+operation. It can operate in two modes:  1) the determinate mode which shows the
+amount completed relative to the total amount of work to be done and 2) the
+indeterminate mode which provides an animated display to let the user know that
+work is progressing.
 
 
 Options
@@ -1164,7 +1161,7 @@
       the value for that option.
 
       For example, to change every default button to be a flat button with
-      some padding and a different background color you could do::
+      some padding and a different background color::
 
          from tkinter import ttk
          import tkinter
@@ -1186,7 +1183,7 @@
 
       Each key in *kw* is an option and each value should be a list or a
       tuple (usually) containing statespecs grouped in tuples, lists, or
-      something else of your preference. A statespec is a compound of one
+      some other preference. A statespec is a compound of one
       or more states and then a value.
 
       An example may make it more understandable::
@@ -1208,9 +1205,9 @@
 
 
       Note that the order of the (states, value) sequences for an option does
-      matter, if you changed the order to ``[('active', 'blue'), ('pressed',
-      'red')]`` in the foreground option, for example, you would get a blue
-      foreground when the widget were in active or pressed states.
+      matter, if the order is changed to ``[('active', 'blue'), ('pressed',
+      'red')]`` in the foreground option, for example, the result would be a
+      blue foreground when the widget were in active or pressed states.
 
 
    .. method:: lookup(style, option[, state=None[, default=None]])
@@ -1221,7 +1218,7 @@
       states. If the *default* argument is set, it is used as a fallback value
       in case no specification for option is found.
 
-      To check what font a Button uses by default, you would do::
+      To check what font a Button uses by default::
 
          from tkinter import ttk
 

Modified: python/branches/py3k-short-float-repr/Doc/library/unittest.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/library/unittest.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/library/unittest.rst	Mon Apr 13 18:30:54 2009
@@ -611,7 +611,7 @@
       Signal a test failure if *expr* is false; the explanation for the error
       will be *msg* if given, otherwise it will be :const:`None`.
 
-      .. deprecated:: 2.7
+      .. deprecated:: 3.1
          :meth:`failUnless`.
 
 
@@ -630,10 +630,10 @@
       registers :meth:`addTypeEqualityFunc` the type specific equality function
       will be called in order to generate a more useful default error message.
 
-      .. versionchanged:: 2.7
+      .. versionchanged:: 3.1
          Added the automatic calling of type specific equality function.
 
-      .. deprecated:: 2.7
+      .. deprecated:: 3.1
          :meth:`failUnlessEqual`.
 
 
@@ -647,7 +647,7 @@
       default value for *msg* can be computed to include representations of both
       *first* and *second*.
 
-      .. deprecated:: 2.7
+      .. deprecated:: 3.1
          :meth:`failIfEqual`.
 
 
@@ -663,7 +663,7 @@
       compare equal, the test will fail with the explanation given by *msg*, or
       :const:`None`.
 
-      .. deprecated:: 2.7
+      .. deprecated:: 3.1
          :meth:`failUnlessAlmostEqual`.
 
 
@@ -679,7 +679,7 @@
       compare equal, the test will fail with the explanation given by *msg*, or
       :const:`None`.
 
-      .. deprecated:: 2.7
+      .. deprecated:: 3.1
          :meth:`failIfAlmostEqual`.
 
 
@@ -689,13 +689,13 @@
                assertLessEqual(first, second, msg=None)
 
       Test that *first* is respectively >, >=, < or <= than *second* depending
-      on the method name.  If not, the test will fail with the nice explanation
+      on the method name.  If not, the test will fail with an explanation
       or with the explanation given by *msg*::
 
          >>> self.assertGreaterEqual(3, 4)
          AssertionError: "3" unexpectedly not greater than or equal to "4"
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
    .. method:: assertMultiLineEqual(self, first, second, msg=None)
@@ -706,7 +706,7 @@
 
       If specified *msg* will be used as the error message on failure.
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
    .. method:: assertRegexpMatches(text, regexp[, msg=None]):
@@ -716,18 +716,18 @@
       a regular expression object or a string containing a regular expression
       suitable for use by :func:`re.search`.
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
    .. method:: assertIn(first, second, msg=None)
                assertNotIn(first, second, msg=None)
 
-      Tests that *first* is or is not in *second* with a nice explanitory error
+      Tests that *first* is or is not in *second* with an explanatory error
       message as appropriate.
 
       If specified *msg* will be used as the error message on failure.
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
    .. method:: assertSameElements(expected, actual, msg=None)
@@ -738,7 +738,7 @@
 
       If specified *msg* will be used as the error message on failure.
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
    .. method:: assertSetEqual(set1, set2, msg=None)
@@ -751,7 +751,7 @@
 
       If specified *msg* will be used as the error message on failure.
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
    .. method:: assertDictEqual(expected, actual, msg=None)
@@ -761,18 +761,18 @@
 
       If specified *msg* will be used as the error message on failure.
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
    .. method:: assertDictContainsSubset(expected, actual, msg=None)
 
-      Tests whether the key value pairs in dictionary *actual* are a
+      Tests whether the key/value pairs in dictionary *actual* are a
       superset of those in *expected*.  If not, an error message listing
       the missing keys and mismatched values is generated.
 
       If specified *msg* will be used as the error message on failure.
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
    .. method:: assertListEqual(list1, list2, msg=None)
@@ -784,7 +784,7 @@
 
       If specified *msg* will be used as the error message on failure.
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
    .. method:: assertSequenceEqual(seq1, seq2, msg=None, seq_type=None)
@@ -799,7 +799,7 @@
       This method is used to implement :meth:`assertListEqual` and
       :meth:`assertTupleEqual`.
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
    .. method:: assertRaises(exception[, callable, ...])
@@ -821,7 +821,7 @@
       .. versionchanged:: 3.1
          Added the ability to use :meth:`assertRaises` as a context manager.
 
-      .. deprecated:: 2.7
+      .. deprecated:: 3.1
          :meth:`failUnlessRaises`.
 
 
@@ -840,14 +840,14 @@
          with self.assertRaisesRegexp(ValueError, 'literal'):
             int('XYZ')
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
    .. method:: assertIsNone(expr[, msg])
 
       This signals a test failure if *expr* is not None.
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
    .. method:: assertIsNotNone(expr[, msg])
@@ -855,6 +855,23 @@
       The inverse of the :meth:`assertIsNone` method.
       This signals a test failure if *expr* is None.
 
+      .. versionadded:: 3.1
+
+
+   .. method:: assertIs(expr1, expr2[, msg])
+
+      This signals a test failure if *expr1* and *expr2* don't evaluate to the same
+      object.
+
+      .. versionadded:: 2.7
+
+
+   .. method:: assertIsNot(expr1, expr2[, msg])
+
+      The inverse of the :meth:`assertIs` method.
+      This signals a test failure if *expr1* and *expr2* evaluate to the same
+      object.
+
       .. versionadded:: 2.7
 
 
@@ -865,7 +882,7 @@
       This signals a test failure if *expr* is true, with *msg* or :const:`None`
       for the error message.
 
-      .. deprecated:: 2.7
+      .. deprecated:: 3.1
          :meth:`failIf`.
 
 
@@ -899,7 +916,7 @@
       The class setting can be overridden in individual tests by assigning an
       instance attribute to True or False before calling the assert methods.
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
    Testing frameworks can use the following methods to collect information on
@@ -936,7 +953,7 @@
       returns the first line of the test method's docstring, if available,
       along with the method name.
 
-      .. versionchanged:: 2.7
+      .. versionchanged:: 3.1
 
          In earlier versions this only returned the first line of the test
          method's docstring, if available or the :const:`None`.  That led to
@@ -951,14 +968,14 @@
       been asked to compare are exactly *typeobj* (not subclasses).
       *function* must take two positional arguments and a third msg=None
       keyword argument just as :meth:`assertEqual` does.  It must raise
-      self.failureException when inequality between the first two
+      ``self.failureException`` when inequality between the first two
       parameters is detected.
 
       One good use of custom equality checking functions for a type
-      is to raise self.failureException with an error message useful
-      for debugging the by explaining the inequalities in detail.
+      is to raise ``self.failureException`` with an error message useful
+      for debugging the problem by explaining the inequalities in detail.
 
-      .. versionadded:: 2.7
+      .. versionadded:: 3.1
 
 
 .. class:: FunctionTestCase(testFunc[, setUp[, tearDown[, description]]])

Modified: python/branches/py3k-short-float-repr/Doc/make.bat
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/make.bat	(original)
+++ python/branches/py3k-short-float-repr/Doc/make.bat	Mon Apr 13 18:30:54 2009
@@ -4,6 +4,7 @@
 set SVNROOT=http://svn.python.org/projects
 if "%PYTHON%" EQU "" set PYTHON=..\pcbuild\python
 if "%HTMLHELP%" EQU "" set HTMLHELP=%ProgramFiles%\HTML Help Workshop\hhc.exe
+if "%DISTVERSION%" EQU "" for /f "usebackq" %%v in (`%PYTHON% tools/sphinxext/patchlevel.py`) do set DISTVERSION=%%v
 
 if "%1" EQU "" goto help
 if "%1" EQU "html" goto build
@@ -33,7 +34,7 @@
 goto end
 
 :checkout
-svn co %SVNROOT%/doctools/trunk/sphinx tools/sphinx
+svn co %SVNROOT%/external/Sphinx-0.6.1/sphinx tools/sphinx
 svn co %SVNROOT%/external/docutils-0.5/docutils tools/docutils
 svn co %SVNROOT%/external/Jinja-2.1.1/jinja2 tools/jinja2
 svn co %SVNROOT%/external/Pygments-0.11.1/pygments tools/pygments
@@ -50,8 +51,9 @@
 if not exist build mkdir build
 if not exist build\%1 mkdir build\%1
 if not exist build\doctrees mkdir build\doctrees
+cmd /C %PYTHON% --version
 cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%*
-if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\pydoc.hhp
+if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\python%DISTVERSION:.=%.hhp
 goto end
 
 :end

Modified: python/branches/py3k-short-float-repr/Doc/reference/expressions.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/reference/expressions.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/reference/expressions.rst	Mon Apr 13 18:30:54 2009
@@ -1152,6 +1152,7 @@
 
 
 .. _lambdas:
+.. _lambda:
 
 Lambdas
 =======
@@ -1176,8 +1177,6 @@
 See section :ref:`function` for the syntax of parameter lists.  Note that
 functions created with lambda forms cannot contain statements or annotations.
 
-.. _lambda:
-
 
 .. _exprlists:
 

Modified: python/branches/py3k-short-float-repr/Doc/tools/sphinxext/susp-ignored.csv
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/tools/sphinxext/susp-ignored.csv	(original)
+++ python/branches/py3k-short-float-repr/Doc/tools/sphinxext/susp-ignored.csv	Mon Apr 13 18:30:54 2009
@@ -48,6 +48,8 @@
 library/httplib,,:port,host:port
 library/imaplib,,:MM,"""DD-Mmm-YYYY HH:MM:SS +HHMM"""
 library/imaplib,,:SS,"""DD-Mmm-YYYY HH:MM:SS +HHMM"""
+library/itertools,,:stop,elements from seq[start:stop:step]
+library/itertools,,:step,elements from seq[start:stop:step]
 library/linecache,,:sys,"sys:x:3:3:sys:/dev:/bin/sh"
 library/logging,,:And,
 library/logging,,:package1,

Modified: python/branches/py3k-short-float-repr/Doc/whatsnew/2.7.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/whatsnew/2.7.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/whatsnew/2.7.rst	Mon Apr 13 18:30:54 2009
@@ -88,6 +88,22 @@
 
 Some smaller changes made to the core Python language are:
 
+* :meth:`str.format` method now supports automatic numbering of the replacement
+  fields.  This makes using :meth:`str.format` more closely resemble using
+  ``%s`` formatting::
+
+    >>> '{}:{}:{}'.format(2009, 04, 'Sunday')
+    '2009:4:Sunday'
+    >>> '{}:{}:{day}'.format(2009, 4, day='Sunday')
+    '2009:4:Sunday'
+
+  The auto-numbering takes the fields from left to right, so the first ``{...}``
+  specifier will use the first argument to :meth:`str.format`, the next
+  specifier will use the next argument, and so on.  You can't mix auto-numbering
+  and explicit numbering -- either number all of your specifier fields or none
+  of them -- but you can mix auto-numbering and named fields, as in the second
+  example above.  (Contributed by XXX; :issue`5237`.)
+
 * The :func:`int` and :func:`long` types gained a ``bit_length``
   method that returns the number of bits necessary to represent
   its argument in binary::
@@ -106,7 +122,7 @@
   (Contributed by Fredrik Johansson and Victor Stinner; :issue:`3439`.)
 
 * The :class:`bytearray` type's :meth:`translate` method will
-  now accept None as its first argument.  (Fixed by Georg Brandl;
+  now accept ``None`` as its first argument.  (Fixed by Georg Brandl;
   :issue:`4759`.)
 
 .. ======================================================================
@@ -201,7 +217,7 @@
   management protocol, so you can write ``with bz2.BZ2File(...) as f: ...``.
   (Contributed by Hagen Fuerstenau; :issue:`3860`.)
 
-* A new :class:`Counter` class in the :mod:`collections` module is
+* 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
   raising a :exc:`KeyError`::
@@ -236,7 +252,7 @@
   Contributed by Raymond Hettinger; :issue:`1696199`.
 
   The :class:`namedtuple` class now has an optional *rename* parameter.
-  If *rename* is True, field names that are invalid because they've
+  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
   position within the list of fields:
@@ -247,8 +263,13 @@
 
   (Added by Raymond Hettinger; :issue:`1818`.)
 
+  The :class:`deque` data type now exposes its maximum length as the
+  read-only :attr:`maxlen` attribute.  (Added by Raymond Hettinger.)
+
 * In Distutils, :func:`distutils.sdist.add_defaults` now uses
   *package_dir* and *data_files* to create the MANIFEST file.
+  :mod:`distutils.sysconfig` will now read the :envvar:`AR`
+  environment variable.
 
   It is no longer mandatory to store clear-text passwords in the
   :file:`.pypirc` file when registering and uploading packages to PyPI. As long
@@ -256,6 +277,12 @@
   prompt for the password if not present.  (Added by Tarek Ziade,
   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`.)
+
 * 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`.
@@ -267,8 +294,8 @@
   ``Decimal('0.1000000000000000055511151231257827021181583404541015625')``.
   (Implemented by Raymond Hettinger; :issue:`4796`.)
 
-* A new function in the :mod:`gc` module, :func:`is_tracked`, returns
-  True if a given instance is tracked by the garbage collector, False
+* New function: the :mod:`gc` module's :func:`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
@@ -284,7 +311,7 @@
 
 * New function: ``itertools.compress(*data*, *selectors*)`` takes two
   iterators.  Elements of *data* are returned if the corresponding
-  value in *selectors* is True::
+  value in *selectors* is true::
 
     itertools.compress('ABCDEF', [1,0,1,0,1,1]) =>
       A, C, E, F
@@ -322,12 +349,22 @@
   with any object literal that decodes to a list of pairs.
   (Contributed by Raymond Hettinger; :issue:`5381`.)
 
+* The :mod:`multiprocessing` module's :class:`Manager*` classes
+  can now be passed a callable that will be called whenever
+  a subprocess is started, along with a set of arguments that will be
+  passed to the callable.
+  (Contributed by lekma; :issue:`5585`.)
+
 * 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`.)
 
-* A new function in the :mod:`subprocess` module,
-  :func:`check_output`, runs a command with a specified set of arguments
+* The :mod:`re` module's :func:`split`, :func:`sub`, and :func:`subn`
+  now accept an optional *flags* argument, for consistency with the
+  other functions in the module.  (Added by Gregory P. Smith.)
+
+* New function: the :mod:`subprocess` module's
+  :func:`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.
 
@@ -343,26 +380,99 @@
 
   (Contributed by Gregory P. Smith.)
 
+* New function: :func:`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.)
+
 * The ``sys.version_info`` value is now a named tuple, with attributes
   named ``major``, ``minor``, ``micro``, ``releaselevel``, and ``serial``.
   (Contributed by Ross Light; :issue:`4285`.)
 
+* 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
+  internal flag becomes true.  The return value will only be false if
+  a timeout was provided and the operation timed out.
+  (Contributed by XXX; :issue:`1674032`.)
+
 * The :mod:`unittest` module was enhanced in several ways.
+  The progress messages will now show '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.
   (:issue:`1034053`.)
-  It will now use 'x' for expected failures
-  and 'u' for unexpected successes when run in its verbose mode.
-  (Contributed by Benjamin Peterson.)
+
+  The error messages for :meth:`assertEqual`,
+  :meth:`assertTrue`, and :meth:`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
+  provide will be printed for failures.  (Added by Michael Foord; :issue:`5663`.)
 
   The :meth:`assertRaises` and :meth:`failUnlessRaises` methods 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
+    with self.assertRaises(KeyError):
+        raise ValueError
 
   (Implemented by Antoine Pitrou; :issue:`4444`.)
 
+  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
+    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.
+    (Added by Michael Foord; :issue:`2578`.)
+
+  * :meth:`assertGreater`, :meth:`assertGreaterEqual`,
+    :meth:`assertLess`, and :meth:`assertLessEqual` compare
+    two quantities.
+
+  * :meth:`assertMultiLineEqual` compares two strings, and if they're
+    not equal, displays a helpful comparison that highlights the
+    differences in the two strings.
+
+  * :meth:`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
+    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:`assertSameElements` tests whether two provided sequences
+    contain the same elements.
+
+  * :meth:`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`
+    compare the specified types and explain the differences.
+    More generally, :meth:`assertSequenceEqual` compares two sequences
+    and can optionally check whether both sequences are of a
+    particular type.
+
+  * :meth:`assertDictEqual` compares two dictionaries and reports the
+    differences.  :meth:`assertDictContainsSubset` checks whether
+    all of the key/value pairs in *first* are found in *second*.
+
+  * 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.
+
 * The :func:`is_zipfile` function in the :mod:`zipfile` module will now
   accept a file object, in addition to the path names accepted in earlier
   versions.  (Contributed by Gabriel Genellina; :issue:`4756`.)
@@ -376,7 +486,37 @@
 importlib: Importing Modules
 ------------------------------
 
-XXX write this
+Python 3.1 includes the :mod:`importlib` package, a re-implementation
+of the logic underlying Python's :keyword:`import` statement.
+:mod:`importlib` is useful for implementors of Python interpreters and
+to user 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`.
+
+``import_module(*name*, *package*=None)`` imports a module.  *name* is
+a string containing the module or package's name.  It's possible to do
+relative imports by providing a string that begins with a ``.``
+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
+module into ``sys.modules`` and returns the module object.
+
+Here are some examples::
+
+    >>> from importlib import import_module
+    >>> anydbm = import_module('anydbm')  # Standard absolute import
+    >>> anydbm
+    <module 'anydbm' from '/p/python/Lib/anydbm.py'>
+    >>> # Relative import
+    >>> sysconfig = import_module('..sysconfig', 'distutils.command')
+    >>> sysconfig
+    <module 'distutils.sysconfig' from '/p/python/Lib/distutils/sysconfig.pyc'>
+
+:mod:`importlib` was implemented by Brett Cannon and introduced in
+Python 3.1.
+
 
 ttk: Themed Widgets for Tk
 --------------------------

Modified: python/branches/py3k-short-float-repr/Doc/whatsnew/3.1.rst
==============================================================================
--- python/branches/py3k-short-float-repr/Doc/whatsnew/3.1.rst	(original)
+++ python/branches/py3k-short-float-repr/Doc/whatsnew/3.1.rst	Mon Apr 13 18:30:54 2009
@@ -2,8 +2,6 @@
   What's New In Python 3.1
 ****************************
 
-.. XXX Add trademark info for Apple, Microsoft.
-
 :Author: Raymond Hettinger
 :Release: |release|
 :Date: |today|
@@ -17,8 +15,7 @@
 
    * The maintainer will go through Misc/NEWS periodically and add
    changes; it's therefore more important to add your changes to
-   Misc/NEWS than to this file.  (Note: I didn't get to this for 3.0.
-   GvR.)
+   Misc/NEWS than to this file.
 
    * This is not a complete list of every single change; completeness
    is the purpose of Misc/NEWS.  Some changes I consider too small
@@ -39,8 +36,7 @@
    necessary (especially when a final release is some months away).
 
    * Credit the author of a patch or bugfix.   Just the name is
-   sufficient; the e-mail address isn't necessary.  (Due to time
-   constraints I haven't managed to do this for 3.0.  GvR.)
+   sufficient; the e-mail address isn't necessary.
 
    * It's helpful to add the bug/patch number as a comment:
 
@@ -50,21 +46,10 @@
    (Contributed by P.Y. Developer.)
 
    This saves the maintainer the effort of going through the SVN log
-   when researching a change.  (Again, I didn't get to this for 3.0.
-   GvR.)
+   when researching a change.
 
 This article explains the new features in Python 3.1, compared to 3.0.
 
-.. Compare with previous release in 2 - 3 sentences here.
-.. add hyperlink when the documentation becomes available online.
-
-.. ======================================================================
-.. Large, PEP-level features and changes should be described here.
-.. Should there be a new section here for 3k migration?
-.. Or perhaps a more general section describing module changes/deprecation?
-.. sets module deprecated
-.. ======================================================================
-
 
 PEP 372: Ordered Dictionaries
 =============================
@@ -88,7 +73,7 @@
 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.
-Support was also added for third-party tools like PyYAML.
+Support was also added for third-party tools like `PyYAML <http://pyyaml.org/>`_.
 
 .. seealso::
 
@@ -96,6 +81,7 @@
       PEP written by Armin Ronacher and Raymond Hettinger.  Implementation
       written by Raymond Hettinger.
 
+
 PEP 378: Format Specifier for Thousands Separator
 =================================================
 
@@ -162,7 +148,6 @@
 
   (Contributed by Mark Dickinson; :issue:`4707`.)
 
-.. ======================================================================
 
 New, Improved, and Deprecated Modules
 =====================================
@@ -179,8 +164,7 @@
   The basic idea of ttk is to separate, to the extent possible, the code
   implementing a widget's behavior from the code implementing its appearance.
 
-  (Contributed by Kevin Walzer and Guilherme Polo; :issue:`2618` and
-  :issue:`2983`.)
+  (Contributed by Guilherme Polo; :issue:`2983`.)
 
 * The :class:`gzip.GzipFile` and :class:`bz2.BZ2File` classes now support
   the context manager protocol::
@@ -191,7 +175,7 @@
 
   (Contributed by Antoine Pitrou.)
 
-* The :mod:`decimal.Decimal` module now supports methods for creating a
+* The :mod:`decimal` module now supports methods for creating a
   decimal object from a binary :class:`float`.  The conversion is
   exact but can sometimes be surprising::
 
@@ -229,7 +213,18 @@
   *rename* which lets invalid fieldnames be automatically converted to
   positional names in the form _0, _1, etc.  This is useful when
   the field names are being created by an external source such as a
-  CSV header, SQL field list, or user input.
+  CSV header, SQL field list, or user input::
+
+    >>> query = input()
+    SELECT region, dept, count(*) FROM main GROUPBY region, dept
+
+    >>> cursor.execute(query)
+    >>> query_fields = [desc[0] for desc in cursor.description]
+    >>> UserQuery = namedtuple('UserQuery', query_fields, rename=True)
+    >>> pprint.pprint([UserQuery(*row) for row in cursor])
+    [UserQuery(region='South', dept='Shipping', _2=185),
+     UserQuery(region='North', dept='Accounting', _2=37),
+     UserQuery(region='West', dept='Sales', _2=419)]
 
   (Contributed by Raymond Hettinger; :issue:`1818`.)
 
@@ -238,6 +233,16 @@
 
   (Contributed by Gregory Smith.)
 
+* The :mod:`logging` module now implements a simple :class:`NullHandler`
+  class for applications that are not using logging but are calling
+  library code that does.  Setting-up a null handler will suppress
+  spurious warnings like "No handlers could be found for logger X.Y.Z"::
+
+    >>> h = logging.NullHandler()
+    >>> logging.getLogger("foo").addHandler(h)
+
+  (Contributed by Vinay Sajip; issue:`4384`).
+
 * The :mod:`runpy` module which supports the ``-m`` command line switch
   now supports the execution of packages by looking for and executing
   a ``__main__`` submodule when a package name is supplied.
@@ -274,7 +279,30 @@
         def test_gimzo_without_required_library(self):
             ...
 
-  (Contributed by Benjamin Peterson.)
+  Also, tests for exceptions have been builtout to work with context managers::
+
+      def test_division_by_zero(self):
+          with self.assertRaises(ZeroDivisionError):
+              x / 0
+
+  In addition, several new assertion methods were added including
+  :func:`assertSetEqual`, :func:`assertDictEqual`,
+  :func:`assertDictContainsSubset`, :func:`assertListEqual`,
+  :func:`assertTupleEqual`, :func:`assertSequenceEqual`,
+  :func:`assertRaisesRegexp`, :func:`assertIsNone`,
+  and :func:`assertIsNotNot`.
+
+  (Contributed by Benjamin Peterson and Antoine Pitrou.)
+
+* The :mod:`io` module has three new constants for the :meth:`seek`
+  method :data:`SEEK_SET`, :data:`SEEK_CUR`, and :data:`SEEK_END`.
+
+* The :attr:`sys.version_info` tuple is now a named tuple::
+
+    >>> sys.version_info
+    sys.version_info(major=3, minor=1, micro=0, releaselevel='alpha', serial=2)
+
+  (Contributed by Ross Light; :issue:`4285`.)
 
 * A new module, :mod:`importlib` was added.  It provides a complete, portable,
   pure Python reference implementation of the *import* statement and its
@@ -284,8 +312,6 @@
 
   (Contributed by Brett Cannon.)
 
-.. ======================================================================
-
 
 Optimizations
 =============
@@ -326,7 +352,13 @@
   its performance.  The code is expected to be added in-time for the beta
   release.
 
-  (Contributed by Bob Ippolito.)
+  (Contributed by Bob Ippolito and converted to Py3.1 by Antoine Pitrou;
+  :issue:`4136`.)
+
+Build and C API Changes
+=======================
+
+Changes to Python's build process and to the C API include:
 
 * Integers are now stored internally either in base 2**15 or in base
   2**30, the base being determined at build time.  Previously, they
@@ -349,4 +381,11 @@
 
   (Contributed by Mark Dickinson; :issue:`4258`.)
 
-.. ======================================================================
+* The :cfunc:`PyLong_AsUnsignedLongLong()` function now handles a negative
+  *pylong* by raising :exc:`OverflowError` instead of :exc:`TypeError`.
+
+  (Contributed by Mark Dickinson and Lisandro Dalcrin; :issue:`5175`.)
+
+* Deprecated :cfunc:`PyNumber_Int`.  Use :cfunc:`PyNumber_Long` instead.
+
+  (Contributed by Mark Dickinson; :issue:`4910`.)

Modified: python/branches/py3k-short-float-repr/Include/bytes_methods.h
==============================================================================
--- python/branches/py3k-short-float-repr/Include/bytes_methods.h	(original)
+++ python/branches/py3k-short-float-repr/Include/bytes_methods.h	Mon Apr 13 18:30:54 2009
@@ -20,6 +20,9 @@
 extern void _Py_bytes_capitalize(char *result, char *s, Py_ssize_t len);
 extern void _Py_bytes_swapcase(char *result, char *s, Py_ssize_t len);
 
+/* This one gets the raw argument list. */
+extern PyObject* _Py_bytes_maketrans(PyObject *args);
+
 /* Shared __doc__ strings. */
 extern const char _Py_isspace__doc__[];
 extern const char _Py_isalpha__doc__[];
@@ -33,6 +36,7 @@
 extern const char _Py_title__doc__[];
 extern const char _Py_capitalize__doc__[];
 extern const char _Py_swapcase__doc__[];
+extern const char _Py_maketrans__doc__[];
 
 #define FLAG_LOWER  0x01
 #define FLAG_UPPER  0x02

Modified: python/branches/py3k-short-float-repr/Include/object.h
==============================================================================
--- python/branches/py3k-short-float-repr/Include/object.h	(original)
+++ python/branches/py3k-short-float-repr/Include/object.h	Mon Apr 13 18:30:54 2009
@@ -651,11 +651,13 @@
 	((PyObject*)(op))->ob_refcnt++)
 
 #define Py_DECREF(op)					\
-	if (_Py_DEC_REFTOTAL  _Py_REF_DEBUG_COMMA	\
-	    --((PyObject*)(op))->ob_refcnt != 0)		\
-		_Py_CHECK_REFCNT(op)			\
-	else						\
-		_Py_Dealloc((PyObject *)(op))
+	do {						\
+	    if (_Py_DEC_REFTOTAL  _Py_REF_DEBUG_COMMA	\
+		--((PyObject*)(op))->ob_refcnt != 0)	\
+		    _Py_CHECK_REFCNT(op)		\
+	    else					\
+		_Py_Dealloc((PyObject *)(op));		\
+        } while (0)
 
 /* Safely decref `op` and set `op` to NULL, especially useful in tp_clear
  * and tp_dealloc implementatons.
@@ -701,8 +703,8 @@
         } while (0)
 
 /* Macros to use in case the object pointer may be NULL: */
-#define Py_XINCREF(op) if ((op) == NULL) ; else Py_INCREF(op)
-#define Py_XDECREF(op) if ((op) == NULL) ; else Py_DECREF(op)
+#define Py_XINCREF(op) do { if ((op) == NULL) ; else Py_INCREF(op); } while (0)
+#define Py_XDECREF(op) do { if ((op) == NULL) ; else Py_DECREF(op); } while (0)
 
 /*
 These are provided as conveniences to Python runtime embedders, so that

Modified: python/branches/py3k-short-float-repr/Lib/asyncore.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/asyncore.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/asyncore.py	Mon Apr 13 18:30:54 2009
@@ -68,10 +68,12 @@
 class ExitNow(Exception):
     pass
 
+_reraised_exceptions = (ExitNow, KeyboardInterrupt, SystemExit)
+
 def read(obj):
     try:
         obj.handle_read_event()
-    except (ExitNow, KeyboardInterrupt, SystemExit):
+    except _reraised_exceptions:
         raise
     except:
         obj.handle_error()
@@ -79,7 +81,7 @@
 def write(obj):
     try:
         obj.handle_write_event()
-    except (ExitNow, KeyboardInterrupt, SystemExit):
+    except _reraised_exceptions:
         raise
     except:
         obj.handle_error()
@@ -87,22 +89,22 @@
 def _exception(obj):
     try:
         obj.handle_expt_event()
-    except (ExitNow, KeyboardInterrupt, SystemExit):
+    except _reraised_exceptions:
         raise
     except:
         obj.handle_error()
 
 def readwrite(obj, flags):
     try:
-        if flags & (select.POLLIN | select.POLLPRI):
+        if flags & select.POLLIN:
             obj.handle_read_event()
         if flags & select.POLLOUT:
             obj.handle_write_event()
-        if flags & (select.POLLERR | select.POLLNVAL):
-            obj.handle_expt_event()
-        if flags & select.POLLHUP:
+        if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
             obj.handle_close()
-    except (ExitNow, KeyboardInterrupt, SystemExit):
+        if flags & select.POLLPRI:
+            obj.handle_expt_event()
+    except _reraised_exceptions:
         raise
     except:
         obj.handle_error()
@@ -210,6 +212,7 @@
     accepting = False
     closing = False
     addr = None
+    ignore_log_types = frozenset(['warning'])
 
     def __init__(self, sock=None, map=None):
         if map is None:
@@ -397,7 +400,7 @@
         sys.stderr.write('log: %s\n' % str(message))
 
     def log_info(self, message, type='info'):
-        if __debug__ or type != 'info':
+        if type not in self.ignore_log_types:
             print('%s: %s' % (type, message))
 
     def handle_read_event(self):
@@ -431,22 +434,17 @@
         self.handle_write()
 
     def handle_expt_event(self):
-        # if the handle_expt is the same default worthless method,
-        # we'll not even bother calling it, we'll instead generate
-        # a useful error
-        x = True
-        try:
-            y1 = self.handle_expt.__func__
-            y2 = dispatcher.handle_expt
-            x = y1 is y2
-        except AttributeError:
-            pass
-
-        if x:
-            err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
-            msg = _strerror(err)
-
-            raise socket.error(err, msg)
+        # handle_expt_event() is called if there might be an error on the
+        # socket, or if there is OOB data
+        # check for the error condition first
+        err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
+        if err != 0:
+            # we can get here when select.select() says that there is an
+            # exceptional condition on the socket
+            # since there is an error, we'll go ahead and close the socket
+            # like we would in a subclassed handle_read() that received no
+            # data
+            self.handle_close()
         else:
             self.handle_expt()
 
@@ -471,7 +469,7 @@
         self.handle_close()
 
     def handle_expt(self):
-        self.log_info('unhandled exception', 'warning')
+        self.log_info('unhandled incoming priority event', 'warning')
 
     def handle_read(self):
         self.log_info('unhandled read event', 'warning')
@@ -552,7 +550,7 @@
                 pass
             elif not ignore_all:
                 raise
-        except (ExitNow, KeyboardInterrupt, SystemExit):
+        except _reraised_exceptions:
             raise
         except:
             if not ignore_all:

Modified: python/branches/py3k-short-float-repr/Lib/cgitb.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/cgitb.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/cgitb.py	Mon Apr 13 18:30:54 2009
@@ -142,10 +142,11 @@
             i = lnum - index
             for line in lines:
                 num = small('&nbsp;' * (5-len(str(i))) + str(i)) + '&nbsp;'
-                line = '<tt>%s%s</tt>' % (num, pydoc.html.preformat(line))
                 if i in highlight:
+                    line = '<tt>=&gt;%s%s</tt>' % (num, pydoc.html.preformat(line))
                     rows.append('<tr><td bgcolor="#ffccee">%s</td></tr>' % line)
                 else:
+                    line = '<tt>&nbsp;&nbsp;%s%s</tt>' % (num, pydoc.html.preformat(line))
                     rows.append('<tr><td>%s</td></tr>' % grey(line))
                 i += 1
 

Modified: python/branches/py3k-short-float-repr/Lib/collections.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/collections.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/collections.py	Mon Apr 13 18:30:54 2009
@@ -36,6 +36,11 @@
     # Those hard references disappear when a key is deleted from an OrderedDict.
 
     def __init__(self, *args, **kwds):
+        '''Initialize an ordered dictionary.  Signature is the same as for
+        regular dictionaries, but keyword arguments are not recommended
+        because their insertion order is arbitrary.
+
+        '''
         if len(args) > 1:
             raise TypeError('expected at most 1 arguments, got %d' % len(args))
         try:
@@ -47,12 +52,14 @@
         self.update(*args, **kwds)
 
     def clear(self):
+        'od.clear() -> None.  Remove all items from od.'
         root = self.__root
         root.prev = root.next = root
         self.__map.clear()
         dict.clear(self)
 
     def __setitem__(self, key, value):
+        'od.__setitem__(i, y) <==> od[i]=y'
         # Setting a new item creates a new link which goes at the end of the linked
         # list, and the inherited dictionary is updated with the new key/value pair.
         if key not in self:
@@ -64,6 +71,7 @@
         dict.__setitem__(self, key, value)
 
     def __delitem__(self, key):
+        'od.__delitem__(y) <==> del od[y]'
         # Deleting an existing item uses self.__map to find the link which is
         # then removed by updating the links in the predecessor and successor nodes.
         dict.__delitem__(self, key)
@@ -72,6 +80,7 @@
         link.next.prev = link.prev
 
     def __iter__(self):
+        'od.__iter__() <==> iter(od)'
         # Traverse the linked list in order.
         root = self.__root
         curr = root.next
@@ -80,6 +89,7 @@
             curr = curr.next
 
     def __reversed__(self):
+        'od.__reversed__() <==> reversed(od)'
         # Traverse the linked list in reverse order.
         root = self.__root
         curr = root.prev
@@ -88,6 +98,7 @@
             curr = curr.prev
 
     def __reduce__(self):
+        'Return state information for pickling'
         items = [[k, self[k]] for k in self]
         tmp = self.__map, self.__root
         del self.__map, self.__root
@@ -105,34 +116,52 @@
     items = MutableMapping.items
 
     def popitem(self, last=True):
+        '''od.popitem() -> (k, v), return and remove a (key, value) pair.
+        Pairs are returned in LIFO order if last is true or FIFO order if false.
+
+        '''
         if not self:
             raise KeyError('dictionary is empty')
-        key = next(reversed(self)) if last else next(iter(self))
+        key = next(reversed(self) if last else iter(self))
         value = self.pop(key)
         return key, value
 
     def __repr__(self):
+        'od.__repr__() <==> repr(od)'
         if not self:
             return '%s()' % (self.__class__.__name__,)
         return '%s(%r)' % (self.__class__.__name__, list(self.items()))
 
     def copy(self):
+        'od.copy() -> a shallow copy of od'
         return self.__class__(self)
 
     @classmethod
     def fromkeys(cls, iterable, value=None):
+        '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S
+        and values equal to v (which defaults to None).
+
+        '''
         d = cls()
         for key in iterable:
             d[key] = value
         return d
 
     def __eq__(self, other):
+        '''od.__eq__(y) <==> od==y.  Comparison to another OD is order-sensitive
+        while comparison to a regular mapping is order-insensitive.
+
+        '''
         if isinstance(other, OrderedDict):
             return len(self)==len(other) and \
                    all(p==q for p, q in zip(self.items(), other.items()))
         return dict.__eq__(self, other)
 
     def __ne__(self, other):
+        '''od.__ne__(y) <==> od!=y.  Comparison to another OD is order-sensitive
+        while comparison to a regular mapping is order-insensitive.
+
+        '''
         return not self == other
 
 

Modified: python/branches/py3k-short-float-repr/Lib/distutils/command/__init__.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/distutils/command/__init__.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/distutils/command/__init__.py	Mon Apr 13 18:30:54 2009
@@ -22,6 +22,8 @@
            'bdist_dumb',
            'bdist_rpm',
            'bdist_wininst',
+           'check',
+           'upload',
            # These two are reserved for future use:
            #'bdist_sdux',
            #'bdist_pkgtool',

Modified: python/branches/py3k-short-float-repr/Lib/distutils/command/bdist_wininst.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/distutils/command/bdist_wininst.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/distutils/command/bdist_wininst.py	Mon Apr 13 18:30:54 2009
@@ -330,9 +330,14 @@
         directory = os.path.dirname(__file__)
         # we must use a wininst-x.y.exe built with the same C compiler
         # used for python.  XXX What about mingw, borland, and so on?
-        if self.plat_name == 'win32':
-            sfix = ''
+
+        # if plat_name starts with "win" but is not "win32"
+        # we want to strip "win" and leave the rest (e.g. -amd64)
+        # for all other cases, we don't want any suffix
+        if self.plat_name != 'win32' and self.plat_name[:3] == 'win':
+            sfix = self.plat_name[3:]
         else:
-            sfix = self.plat_name[3:] # strip 'win' - leaves eg '-amd64'
+            sfix = ''
+
         filename = os.path.join(directory, "wininst-%.1f%s.exe" % (bv, sfix))
         return open(filename, "rb").read()

Modified: python/branches/py3k-short-float-repr/Lib/distutils/command/config.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/distutils/command/config.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/distutils/command/config.py	Mon Apr 13 18:30:54 2009
@@ -12,6 +12,7 @@
 __revision__ = "$Id$"
 
 import sys, os, re
+
 from distutils.core import Command
 from distutils.errors import DistutilsExecError
 from distutils.sysconfig import customize_compiler
@@ -53,8 +54,6 @@
         self.compiler = None
         self.cc = None
         self.include_dirs = None
-        #self.define = None
-        #self.undef = None
         self.libraries = None
         self.library_dirs = None
 
@@ -136,8 +135,8 @@
         self.compiler.compile([src], include_dirs=include_dirs)
         return (src, obj)
 
-    def _link(self, body, headers, include_dirs, libraries,
-              library_dirs, lang):
+    def _link(self, body, headers, include_dirs, libraries, library_dirs,
+              lang):
         (src, obj) = self._compile(body, headers, include_dirs, lang)
         prog = os.path.splitext(os.path.basename(src))[0]
         self.compiler.link_executable([obj], prog,
@@ -191,8 +190,8 @@
         self._clean()
         return ok
 
-    def search_cpp(self, pattern, body=None, headers=None,
-                   include_dirs=None, lang="c"):
+    def search_cpp(self, pattern, body=None, headers=None, include_dirs=None,
+                   lang="c"):
         """Construct a source file (just like 'try_cpp()'), run it through
         the preprocessor, and return true if any line of the output matches
         'pattern'.  'pattern' should either be a compiled regex object or a
@@ -200,9 +199,8 @@
         preprocesses an empty file -- which can be useful to determine the
         symbols the preprocessor and compiler set by default.
         """
-
         self._check_compiler()
-        (src, out) = self._preprocess(body, headers, include_dirs, lang)
+        src, out = self._preprocess(body, headers, include_dirs, lang)
 
         if isinstance(pattern, str):
             pattern = re.compile(pattern)
@@ -237,8 +235,8 @@
         self._clean()
         return ok
 
-    def try_link(self, body, headers=None, include_dirs=None,
-                 libraries=None, library_dirs=None, lang="c"):
+    def try_link(self, body, headers=None, include_dirs=None, libraries=None,
+                 library_dirs=None, lang="c"):
         """Try to compile and link a source file, built from 'body' and
         'headers', to executable form.  Return true on success, false
         otherwise.
@@ -256,8 +254,8 @@
         self._clean()
         return ok
 
-    def try_run(self, body, headers=None, include_dirs=None,
-                libraries=None, library_dirs=None, lang="c"):
+    def try_run(self, body, headers=None, include_dirs=None, libraries=None,
+                library_dirs=None, lang="c"):
         """Try to compile, link to an executable, and run a program
         built from 'body' and 'headers'.  Return true on success, false
         otherwise.
@@ -336,11 +334,16 @@
 
 
 def dump_file(filename, head=None):
+    """Dumps a file content into log.info.
+
+    If head is not None, will be dumped before the file content.
+    """
     if head is None:
-        print(filename + ":")
+        log.info('%s' % filename)
     else:
-        print(head)
-
+        log.info(head)
     file = open(filename)
-    sys.stdout.write(file.read())
-    file.close()
+    try:
+        log.info(file.read())
+    finally:
+        file.close()

Copied: python/branches/py3k-short-float-repr/Lib/distutils/tests/test_config_cmd.py (from r71541, /python/branches/py3k/Lib/distutils/tests/test_config_cmd.py)
==============================================================================
--- /python/branches/py3k/Lib/distutils/tests/test_config_cmd.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/distutils/tests/test_config_cmd.py	Mon Apr 13 18:30:54 2009
@@ -1,6 +1,7 @@
 """Tests for distutils.command.config."""
 import unittest
 import os
+import sys
 
 from distutils.command.config import dump_file, config
 from distutils.tests import support
@@ -36,6 +37,8 @@
         self.assertEquals(len(self._logs), numlines+1)
 
     def test_search_cpp(self):
+        if sys.platform == 'win32':
+            return
         pkg_dir, dist = self.create_dist()
         cmd = config(dist)
 

Modified: python/branches/py3k-short-float-repr/Lib/distutils/tests/test_util.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/distutils/tests/test_util.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/distutils/tests/test_util.py	Mon Apr 13 18:30:54 2009
@@ -5,6 +5,7 @@
 import os
 import sys
 import unittest
+from copy import copy
 
 from distutils.errors import DistutilsPlatformError
 
@@ -17,6 +18,7 @@
 from distutils.util import rfc822_escape
 
 from distutils import util # used to patch _environ_checked
+from distutils.sysconfig import get_config_vars, _config_vars
 
 class utilTestCase(unittest.TestCase):
 
@@ -30,6 +32,7 @@
         self.join = os.path.join
         self.isabs = os.path.isabs
         self.splitdrive = os.path.splitdrive
+        self._config_vars = copy(_config_vars)
 
         # patching os.uname
         if hasattr(os, 'uname'):
@@ -42,7 +45,7 @@
         os.uname = self._get_uname
 
     def tearDown(self):
-        # getting back tne environment
+        # getting back the environment
         os.name = self.name
         sys.platform = self.platform
         sys.version = self.version
@@ -55,6 +58,7 @@
             os.uname = self.uname
         else:
             del os.uname
+        _config_vars = copy(self._config_vars)
 
     def _set_uname(self, uname):
         self._uname = uname
@@ -96,8 +100,34 @@
                     'root:xnu-792.25.20~1/RELEASE_I386'), 'i386'))
         os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
 
+        get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
+                                       '-fwrapv -O3 -Wall -Wstrict-prototypes')
+
         self.assertEquals(get_platform(), 'macosx-10.3-i386')
 
+        # macbook with fat binaries (fat, universal or fat64)
+        os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.4'
+        get_config_vars()['CFLAGS'] = ('-arch ppc -arch i386 -isysroot '
+                                       '/Developer/SDKs/MacOSX10.4u.sdk  '
+                                       '-fno-strict-aliasing -fno-common '
+                                       '-dynamic -DNDEBUG -g -O3')
+
+        self.assertEquals(get_platform(), 'macosx-10.4-fat')
+
+        get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch i386 -isysroot '
+                                       '/Developer/SDKs/MacOSX10.4u.sdk  '
+                                       '-fno-strict-aliasing -fno-common '
+                                       '-dynamic -DNDEBUG -g -O3')
+
+        self.assertEquals(get_platform(), 'macosx-10.4-universal')
+
+        get_config_vars()['CFLAGS'] = ('-arch x86_64 -isysroot '
+                                       '/Developer/SDKs/MacOSX10.4u.sdk  '
+                                       '-fno-strict-aliasing -fno-common '
+                                       '-dynamic -DNDEBUG -g -O3')
+
+        self.assertEquals(get_platform(), 'macosx-10.4-fat64')
+
         # linux debian sarge
         os.name = 'posix'
         sys.version = ('2.3.5 (#1, Jul  4 2007, 17:28:59) '

Modified: python/branches/py3k-short-float-repr/Lib/http/server.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/http/server.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/http/server.py	Mon Apr 13 18:30:54 2009
@@ -773,6 +773,46 @@
 
 # Utilities for CGIHTTPRequestHandler
 
+# TODO(gregory.p.smith): Move this into an appropriate library.
+def _url_collapse_path_split(path):
+    """
+    Given a URL path, remove extra '/'s and '.' path elements and collapse
+    any '..' references.
+
+    Implements something akin to RFC-2396 5.2 step 6 to parse relative paths.
+
+    Returns: A tuple of (head, tail) where tail is everything after the final /
+    and head is everything before it.  Head will always start with a '/' and,
+    if it contains anything else, never have a trailing '/'.
+
+    Raises: IndexError if too many '..' occur within the path.
+    """
+    # Similar to os.path.split(os.path.normpath(path)) but specific to URL
+    # path semantics rather than local operating system semantics.
+    path_parts = []
+    for part in path.split('/'):
+        if part == '.':
+            path_parts.append('')
+        else:
+            path_parts.append(part)
+    # Filter out blank non trailing parts before consuming the '..'.
+    path_parts = [part for part in path_parts[:-1] if part] + path_parts[-1:]
+    if path_parts:
+        tail_part = path_parts.pop()
+    else:
+        tail_part = ''
+    head_parts = []
+    for part in path_parts:
+        if part == '..':
+            head_parts.pop()
+        else:
+            head_parts.append(part)
+    if tail_part and tail_part == '..':
+        head_parts.pop()
+        tail_part = ''
+    return ('/' + '/'.join(head_parts), tail_part)
+
+
 nobody = None
 
 def nobody_uid():
@@ -839,24 +879,20 @@
     def is_cgi(self):
         """Test whether self.path corresponds to a CGI script.
 
-        Return a tuple (dir, rest) if self.path requires running a
-        CGI script, None if not.  Note that rest begins with a
-        slash if it is not empty.
-
-        The default implementation tests whether the path
-        begins with one of the strings in the list
-        self.cgi_directories (and the next character is a '/'
-        or the end of the string).
+        Returns True and updates the cgi_info attribute to the tuple
+        (dir, rest) if self.path requires running a CGI script.
+        Returns False otherwise.
+
+        The default implementation tests whether the normalized url
+        path begins with one of the strings in self.cgi_directories
+        (and the next character is a '/' or the end of the string).
 
         """
 
-        path = self.path
-
-        for x in self.cgi_directories:
-            i = len(x)
-            if path[:i] == x and (not path[i:] or path[i] == '/'):
-                self.cgi_info = path[:i], path[i+1:]
-                return True
+        splitpath = _url_collapse_path_split(self.path)
+        if splitpath[0] in self.cgi_directories:
+            self.cgi_info = splitpath
+            return True
         return False
 
     cgi_directories = ['/cgi-bin', '/htbin']

Modified: python/branches/py3k-short-float-repr/Lib/multiprocessing/managers.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/multiprocessing/managers.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/multiprocessing/managers.py	Mon Apr 13 18:30:54 2009
@@ -478,12 +478,15 @@
         dispatch(conn, None, 'dummy')
         self._state.value = State.STARTED
 
-    def start(self):
+    def start(self, initializer=None, initargs=()):
         '''
         Spawn a server process for this manager object
         '''
         assert self._state.value == State.INITIAL
 
+        if initializer is not None and not hasattr(initializer, '__call__'):
+            raise TypeError('initializer must be a callable')
+
         # pipe over which we will retrieve address of server
         reader, writer = connection.Pipe(duplex=False)
 
@@ -491,7 +494,7 @@
         self._process = Process(
             target=type(self)._run_server,
             args=(self._registry, self._address, self._authkey,
-                  self._serializer, writer),
+                  self._serializer, writer, initializer, initargs),
             )
         ident = ':'.join(str(i) for i in self._process._identity)
         self._process.name = type(self).__name__  + '-' + ident
@@ -512,10 +515,14 @@
             )
 
     @classmethod
-    def _run_server(cls, registry, address, authkey, serializer, writer):
+    def _run_server(cls, registry, address, authkey, serializer, writer,
+                    initializer=None, initargs=()):
         '''
         Create a server, report its address and run it
         '''
+        if initializer is not None:
+            initializer(*initargs)
+
         # create server
         server = cls._Server(registry, address, authkey, serializer)
 

Modified: python/branches/py3k-short-float-repr/Lib/multiprocessing/pool.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/multiprocessing/pool.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/multiprocessing/pool.py	Mon Apr 13 18:30:54 2009
@@ -92,6 +92,9 @@
             except NotImplementedError:
                 processes = 1
 
+        if initializer is not None and not hasattr(initializer, '__call__'):
+            raise TypeError('initializer must be a callable')
+
         self._pool = []
         for i in range(processes):
             w = self.Process(

Modified: python/branches/py3k-short-float-repr/Lib/plistlib.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/plistlib.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/plistlib.py	Mon Apr 13 18:30:54 2009
@@ -1,4 +1,4 @@
-"""plistlib.py -- a tool to generate and parse MacOSX .plist files.
+r"""plistlib.py -- a tool to generate and parse MacOSX .plist files.
 
 The PropertList (.plist) file format is a simple XML pickle supporting
 basic object types, like dictionaries, lists, numbers and strings.

Modified: python/branches/py3k-short-float-repr/Lib/posixpath.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/posixpath.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/posixpath.py	Mon Apr 13 18:30:54 2009
@@ -257,7 +257,10 @@
         userhome = pwent.pw_dir
     if isinstance(path, bytes):
         userhome = userhome.encode(sys.getfilesystemencoding())
-    userhome = userhome.rstrip(sep)
+        root = b'/'
+    else:
+        root = '/'
+    userhome = userhome.rstrip(root) or userhome
     return userhome + path[i:]
 
 

Modified: python/branches/py3k-short-float-repr/Lib/pydoc.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/pydoc.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/pydoc.py	Mon Apr 13 18:30:54 2009
@@ -414,9 +414,10 @@
 
     def page(self, title, contents):
         """Format an HTML page."""
-        return '''
-<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+        return '''\
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <html><head><title>Python: %s</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 </head><body bgcolor="#f0f0f8">
 %s
 </body></html>''' % (title, contents)
@@ -1510,7 +1511,7 @@
     try:
         object, name = resolve(thing, forceload)
         page = html.page(describe(object), html.document(object, name))
-        file = open(name + '.html', 'w')
+        file = open(name + '.html', 'w', encoding='utf-8')
         file.write(page)
         file.close()
         print('wrote', name + '.html')

Modified: python/branches/py3k-short-float-repr/Lib/socket.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/socket.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/socket.py	Mon Apr 13 18:30:54 2009
@@ -52,7 +52,7 @@
 except ImportError:
     EBADF = 9
 
-__all__ = ["getfqdn"]
+__all__ = ["getfqdn", "create_connection"]
 __all__.extend(os._get_exports_list(_socket))
 
 

Modified: python/branches/py3k-short-float-repr/Lib/string.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/string.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/string.py	Mon Apr 13 18:30:54 2009
@@ -49,6 +49,9 @@
     mapped to the byte at the same position in to.
     The strings frm and to must be of the same length.
     """
+    import warnings
+    warnings.warn("string.maketrans is deprecated, use bytes.maketrans instead",
+                  DeprecationWarning)
     if len(frm) != len(to):
         raise ValueError("maketrans arguments must have same length")
     if not (isinstance(frm, bytes) and isinstance(to, bytes)):

Modified: python/branches/py3k-short-float-repr/Lib/telnetlib.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/telnetlib.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/telnetlib.py	Mon Apr 13 18:30:54 2009
@@ -47,87 +47,87 @@
 TELNET_PORT = 23
 
 # Telnet protocol characters (don't change)
-IAC  = 255 # "Interpret As Command"
-DONT = 254
-DO   = 253
-WONT = 252
-WILL = 251
-theNULL = 0
-
-SE  = 240  # Subnegotiation End
-NOP = 241  # No Operation
-DM  = 242  # Data Mark
-BRK = 243  # Break
-IP  = 244  # Interrupt process
-AO  = 245  # Abort output
-AYT = 246  # Are You There
-EC  = 247  # Erase Character
-EL  = 248  # Erase Line
-GA  = 249  # Go Ahead
-SB =  250  # Subnegotiation Begin
+IAC  = bytes([255]) # "Interpret As Command"
+DONT = bytes([254])
+DO   = bytes([253])
+WONT = bytes([252])
+WILL = bytes([251])
+theNULL = bytes([0])
+
+SE  = bytes([240])  # Subnegotiation End
+NOP = bytes([241])  # No Operation
+DM  = bytes([242])  # Data Mark
+BRK = bytes([243])  # Break
+IP  = bytes([244])  # Interrupt process
+AO  = bytes([245])  # Abort output
+AYT = bytes([246])  # Are You There
+EC  = bytes([247])  # Erase Character
+EL  = bytes([248])  # Erase Line
+GA  = bytes([249])  # Go Ahead
+SB =  bytes([250])  # Subnegotiation Begin
 
 
 # Telnet protocol options code (don't change)
 # These ones all come from arpa/telnet.h
-BINARY = 0 # 8-bit data path
-ECHO = 1 # echo
-RCP = 2 # prepare to reconnect
-SGA = 3 # suppress go ahead
-NAMS = 4 # approximate message size
-STATUS = 5 # give status
-TM = 6 # timing mark
-RCTE = 7 # remote controlled transmission and echo
-NAOL = 8 # negotiate about output line width
-NAOP = 9 # negotiate about output page size
-NAOCRD = 10 # negotiate about CR disposition
-NAOHTS = 11 # negotiate about horizontal tabstops
-NAOHTD = 12 # negotiate about horizontal tab disposition
-NAOFFD = 13 # negotiate about formfeed disposition
-NAOVTS = 14 # negotiate about vertical tab stops
-NAOVTD = 15 # negotiate about vertical tab disposition
-NAOLFD = 16 # negotiate about output LF disposition
-XASCII = 17 # extended ascii character set
-LOGOUT = 18 # force logout
-BM = 19 # byte macro
-DET = 20 # data entry terminal
-SUPDUP = 21 # supdup protocol
-SUPDUPOUTPUT = 22 # supdup output
-SNDLOC = 23 # send location
-TTYPE = 24 # terminal type
-EOR = 25 # end or record
-TUID = 26 # TACACS user identification
-OUTMRK = 27 # output marking
-TTYLOC = 28 # terminal location number
-VT3270REGIME = 29 # 3270 regime
-X3PAD = 30 # X.3 PAD
-NAWS = 31 # window size
-TSPEED = 32 # terminal speed
-LFLOW = 33 # remote flow control
-LINEMODE = 34 # Linemode option
-XDISPLOC = 35 # X Display Location
-OLD_ENVIRON = 36 # Old - Environment variables
-AUTHENTICATION = 37 # Authenticate
-ENCRYPT = 38 # Encryption option
-NEW_ENVIRON = 39 # New - Environment variables
+BINARY = bytes([0]) # 8-bit data path
+ECHO = bytes([1]) # echo
+RCP = bytes([2]) # prepare to reconnect
+SGA = bytes([3]) # suppress go ahead
+NAMS = bytes([4]) # approximate message size
+STATUS = bytes([5]) # give status
+TM = bytes([6]) # timing mark
+RCTE = bytes([7]) # remote controlled transmission and echo
+NAOL = bytes([8]) # negotiate about output line width
+NAOP = bytes([9]) # negotiate about output page size
+NAOCRD = bytes([10]) # negotiate about CR disposition
+NAOHTS = bytes([11]) # negotiate about horizontal tabstops
+NAOHTD = bytes([12]) # negotiate about horizontal tab disposition
+NAOFFD = bytes([13]) # negotiate about formfeed disposition
+NAOVTS = bytes([14]) # negotiate about vertical tab stops
+NAOVTD = bytes([15]) # negotiate about vertical tab disposition
+NAOLFD = bytes([16]) # negotiate about output LF disposition
+XASCII = bytes([17]) # extended ascii character set
+LOGOUT = bytes([18]) # force logout
+BM = bytes([19]) # byte macro
+DET = bytes([20]) # data entry terminal
+SUPDUP = bytes([21]) # supdup protocol
+SUPDUPOUTPUT = bytes([22]) # supdup output
+SNDLOC = bytes([23]) # send location
+TTYPE = bytes([24]) # terminal type
+EOR = bytes([25]) # end or record
+TUID = bytes([26]) # TACACS user identification
+OUTMRK = bytes([27]) # output marking
+TTYLOC = bytes([28]) # terminal location number
+VT3270REGIME = bytes([29]) # 3270 regime
+X3PAD = bytes([30]) # X.3 PAD
+NAWS = bytes([31]) # window size
+TSPEED = bytes([32]) # terminal speed
+LFLOW = bytes([33]) # remote flow control
+LINEMODE = bytes([34]) # Linemode option
+XDISPLOC = bytes([35]) # X Display Location
+OLD_ENVIRON = bytes([36]) # Old - Environment variables
+AUTHENTICATION = bytes([37]) # Authenticate
+ENCRYPT = bytes([38]) # Encryption option
+NEW_ENVIRON = bytes([39]) # New - Environment variables
 # the following ones come from
 # http://www.iana.org/assignments/telnet-options
 # Unfortunately, that document does not assign identifiers
 # to all of them, so we are making them up
-TN3270E = 40 # TN3270E
-XAUTH = 41 # XAUTH
-CHARSET = 42 # CHARSET
-RSP = 43 # Telnet Remote Serial Port
-COM_PORT_OPTION = 44 # Com Port Control Option
-SUPPRESS_LOCAL_ECHO = 45 # Telnet Suppress Local Echo
-TLS = 46 # Telnet Start TLS
-KERMIT = 47 # KERMIT
-SEND_URL = 48 # SEND-URL
-FORWARD_X = 49 # FORWARD_X
-PRAGMA_LOGON = 138 # TELOPT PRAGMA LOGON
-SSPI_LOGON = 139 # TELOPT SSPI LOGON
-PRAGMA_HEARTBEAT = 140 # TELOPT PRAGMA HEARTBEAT
-EXOPL = 255 # Extended-Options-List
-NOOPT = 0
+TN3270E = bytes([40]) # TN3270E
+XAUTH = bytes([41]) # XAUTH
+CHARSET = bytes([42]) # CHARSET
+RSP = bytes([43]) # Telnet Remote Serial Port
+COM_PORT_OPTION = bytes([44]) # Com Port Control Option
+SUPPRESS_LOCAL_ECHO = bytes([45]) # Telnet Suppress Local Echo
+TLS = bytes([46]) # Telnet Start TLS
+KERMIT = bytes([47]) # KERMIT
+SEND_URL = bytes([48]) # SEND-URL
+FORWARD_X = bytes([49]) # FORWARD_X
+PRAGMA_LOGON = bytes([138]) # TELOPT PRAGMA LOGON
+SSPI_LOGON = bytes([139]) # TELOPT SSPI LOGON
+PRAGMA_HEARTBEAT = bytes([140]) # TELOPT PRAGMA HEARTBEAT
+EXOPL = bytes([255]) # Extended-Options-List
+NOOPT = bytes([0])
 
 class Telnet:
 

Modified: python/branches/py3k-short-float-repr/Lib/test/support.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/support.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/support.py	Mon Apr 13 18:30:54 2009
@@ -41,22 +41,63 @@
     and unexpected skips.
     """
 
+ at contextlib.contextmanager
+def _ignore_deprecated_imports(ignore=True):
+    """Context manager to suppress package and module deprecation
+    warnings when importing them.
+
+    If ignore is False, this context manager has no effect."""
+    if ignore:
+        with warnings.catch_warnings():
+            warnings.filterwarnings("ignore", ".+ (module|package)",
+                                    DeprecationWarning)
+            yield
+    else:
+        yield
+
+
 def import_module(name, deprecated=False):
     """Import and return the module to be tested, raising SkipTest if
     it is not available.
 
     If deprecated is True, any module or package deprecation messages
     will be suppressed."""
-    with warnings.catch_warnings():
-        if deprecated:
-            warnings.filterwarnings("ignore", ".+ (module|package)",
-                                    DeprecationWarning)
+    with _ignore_deprecated_imports(deprecated):
         try:
-            module = importlib.import_module(name)
+            return importlib.import_module(name)
         except ImportError as msg:
             raise unittest.SkipTest(str(msg))
-        else:
-            return module
+
+
+def import_fresh_module(name, blocked_names=None, deprecated=False):
+    """Imports and returns a module, deliberately bypassing the sys.modules cache
+    and importing a fresh copy of the module. Once the import is complete,
+    the sys.modules cache is restored to its original state.
+
+    Importing of modules named in blocked_names is prevented while the fresh import
+    takes place.
+
+    If deprecated is True, any module or package deprecation messages
+    will be suppressed."""
+    # NOTE: test_heapq and test_warnings include extra sanity checks to make
+    # sure that this utility function is working as expected
+    with _ignore_deprecated_imports(deprecated):
+        if blocked_names is None:
+            blocked_names = ()
+        orig_modules = {}
+        if name in sys.modules:
+            orig_modules[name] = sys.modules[name]
+            del sys.modules[name]
+        try:
+            for blocked in blocked_names:
+                orig_modules[blocked] = sys.modules[blocked]
+                sys.modules[blocked] = 0
+            py_module = importlib.import_module(name)
+        finally:
+            for blocked, module in orig_modules.items():
+                sys.modules[blocked] = module
+        return py_module
+
 
 def get_attribute(obj, name):
     """Get an attribute, raising SkipTest if AttributeError is raised."""

Modified: python/branches/py3k-short-float-repr/Lib/test/test_asyncore.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_asyncore.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_asyncore.py	Mon Apr 13 18:30:54 2009
@@ -116,12 +116,24 @@
         def test_readwrite(self):
             # Check that correct methods are called by readwrite()
 
+            attributes = ('read', 'expt', 'write', 'closed', 'error_handled')
+
+            expected = (
+                (select.POLLIN, 'read'),
+                (select.POLLPRI, 'expt'),
+                (select.POLLOUT, 'write'),
+                (select.POLLERR, 'closed'),
+                (select.POLLHUP, 'closed'),
+                (select.POLLNVAL, 'closed'),
+                )
+
             class testobj:
                 def __init__(self):
                     self.read = False
                     self.write = False
                     self.closed = False
                     self.expt = False
+                    self.error_handled = False
 
                 def handle_read_event(self):
                     self.read = True
@@ -138,54 +150,25 @@
                 def handle_error(self):
                     self.error_handled = True
 
-            for flag in (select.POLLIN, select.POLLPRI):
+            for flag, expectedattr in expected:
                 tobj = testobj()
-                self.assertEqual(tobj.read, False)
+                self.assertEqual(getattr(tobj, expectedattr), False)
                 asyncore.readwrite(tobj, flag)
-                self.assertEqual(tobj.read, True)
-
-                # check that ExitNow exceptions in the object handler method
-                # bubbles all the way up through asyncore readwrite call
-                tr1 = exitingdummy()
-                self.assertRaises(asyncore.ExitNow, asyncore.readwrite, tr1, flag)
-
-                # check that an exception other than ExitNow in the object handler
-                # method causes the handle_error method to get called
-                tr2 = crashingdummy()
-                asyncore.readwrite(tr2, flag)
-                self.assertEqual(tr2.error_handled, True)
 
-            tobj = testobj()
-            self.assertEqual(tobj.write, False)
-            asyncore.readwrite(tobj, select.POLLOUT)
-            self.assertEqual(tobj.write, True)
-
-            # check that ExitNow exceptions in the object handler method
-            # bubbles all the way up through asyncore readwrite call
-            tr1 = exitingdummy()
-            self.assertRaises(asyncore.ExitNow, asyncore.readwrite, tr1,
-                              select.POLLOUT)
-
-            # check that an exception other than ExitNow in the object handler
-            # method causes the handle_error method to get called
-            tr2 = crashingdummy()
-            asyncore.readwrite(tr2, select.POLLOUT)
-            self.assertEqual(tr2.error_handled, True)
-
-            for flag in (select.POLLERR, select.POLLHUP, select.POLLNVAL):
-                tobj = testobj()
-                self.assertEqual((tobj.expt, tobj.closed)[flag == select.POLLHUP], False)
-                asyncore.readwrite(tobj, flag)
-                self.assertEqual((tobj.expt, tobj.closed)[flag == select.POLLHUP], True)
+                # Only the attribute modified by the routine we expect to be
+                # called should be True.
+                for attr in attributes:
+                    self.assertEqual(getattr(tobj, attr), attr==expectedattr)
 
                 # check that ExitNow exceptions in the object handler method
-                # bubbles all the way up through asyncore readwrite calls
+                # bubbles all the way up through asyncore readwrite call
                 tr1 = exitingdummy()
                 self.assertRaises(asyncore.ExitNow, asyncore.readwrite, tr1, flag)
 
                 # check that an exception other than ExitNow in the object handler
                 # method causes the handle_error method to get called
                 tr2 = crashingdummy()
+                self.assertEqual(tr2.error_handled, False)
                 asyncore.readwrite(tr2, flag)
                 self.assertEqual(tr2.error_handled, True)
 
@@ -290,15 +273,13 @@
             sys.stdout = stdout
 
         lines = fp.getvalue().splitlines()
-        if __debug__:
-            expected = ['EGGS: %s' % l1, 'info: %s' % l2, 'SPAM: %s' % l3]
-        else:
-            expected = ['EGGS: %s' % l1, 'SPAM: %s' % l3]
+        expected = ['EGGS: %s' % l1, 'info: %s' % l2, 'SPAM: %s' % l3]
 
         self.assertEquals(lines, expected)
 
     def test_unhandled(self):
         d = asyncore.dispatcher()
+        d.ignore_log_types = ()
 
         # capture output of dispatcher.log_info() (to stdout via print)
         fp = StringIO()
@@ -314,7 +295,7 @@
             sys.stdout = stdout
 
         lines = fp.getvalue().splitlines()
-        expected = ['warning: unhandled exception',
+        expected = ['warning: unhandled incoming priority event',
                     'warning: unhandled read event',
                     'warning: unhandled write event',
                     'warning: unhandled connect event',

Modified: python/branches/py3k-short-float-repr/Lib/test/test_bigmem.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_bigmem.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_bigmem.py	Mon Apr 13 18:30:54 2009
@@ -418,18 +418,15 @@
     @bigmemtest(minsize=_2G, memuse=2)
     def test_translate(self, size):
         _ = self.from_latin1
-        trans = {
-            ord(_('.')): _('-'),
-            ord(_('a')): _('!'),
-            ord(_('Z')): _('$'),
-        }
         SUBSTR = _('aZz.z.Aaz.')
-        if not isinstance(SUBSTR, str):
-            # Workaround the inexistence of bytes.maketrans()
-            chars = bytearray(range(256))
-            for k, v in trans.items():
-                chars[k] = ord(v)
-            trans = chars
+        if isinstance(SUBSTR, str):
+            trans = {
+                ord(_('.')): _('-'),
+                ord(_('a')): _('!'),
+                ord(_('Z')): _('$'),
+            }
+        else:
+            trans = bytes.maketrans(b'.aZ', b'-!$')
         sublen = len(SUBSTR)
         repeats = size // sublen + 2
         s = SUBSTR * repeats

Modified: python/branches/py3k-short-float-repr/Lib/test/test_bytes.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_bytes.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_bytes.py	Mon Apr 13 18:30:54 2009
@@ -450,6 +450,13 @@
         self.assertEqual([ord(b[i:i+1]) for i in range(len(b))],
                          [0, 65, 127, 128, 255])
 
+    def test_maketrans(self):
+        transtable = b'\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`xyzdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377'
+
+        self.assertEqual(self.type2test.maketrans(b'abc', b'xyz'), transtable)
+        self.assertRaises(ValueError, self.type2test.maketrans, b'abc', b'xyzq')
+        self.assertRaises(TypeError, self.type2test.maketrans, 'abc', 'def')
+
 
 class BytesTest(BaseBytesTest):
     type2test = bytes

Modified: python/branches/py3k-short-float-repr/Lib/test/test_heapq.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_heapq.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_heapq.py	Mon Apr 13 18:30:54 2009
@@ -7,23 +7,8 @@
 
 # We do a bit of trickery here to be able to test both the C implementation
 # and the Python implementation of the module.
-
-# Make it impossible to import the C implementation anymore.
-sys.modules['_heapq'] = 0
-# We must also handle the case that heapq was imported before.
-if 'heapq' in sys.modules:
-    del sys.modules['heapq']
-
-# Now we can import the module and get the pure Python implementation.
-import heapq as py_heapq
-
-# Restore everything to normal.
-del sys.modules['_heapq']
-del sys.modules['heapq']
-
-# This is now the module with the C implementation.
 import heapq as c_heapq
-
+py_heapq = support.import_fresh_module('heapq', ['_heapq'])
 
 class TestHeap(unittest.TestCase):
     module = None
@@ -194,6 +179,13 @@
 class TestHeapPython(TestHeap):
     module = py_heapq
 
+    # As an early adopter, we sanity check the
+    # test.support.import_fresh_module utility function
+    def test_pure_python(self):
+        self.assertFalse(sys.modules['heapq'] is self.module)
+        self.assertTrue(hasattr(self.module.heapify, '__code__'))
+
+
 class TestHeapC(TestHeap):
     module = c_heapq
 
@@ -219,6 +211,12 @@
         self.assertEqual(hsort(data, LT), target)
         self.assertRaises(TypeError, data, LE)
 
+    # As an early adopter, we sanity check the
+    # test.support.import_fresh_module utility function
+    def test_accelerated(self):
+        self.assertTrue(sys.modules['heapq'] is self.module)
+        self.assertFalse(hasattr(self.module.heapify, '__code__'))
+
 
 #==============================================================================
 

Modified: python/branches/py3k-short-float-repr/Lib/test/test_httpservers.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_httpservers.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_httpservers.py	Mon Apr 13 18:30:54 2009
@@ -6,6 +6,7 @@
 
 from http.server import BaseHTTPRequestHandler, HTTPServer, \
      SimpleHTTPRequestHandler, CGIHTTPRequestHandler
+from http import server
 
 import os
 import sys
@@ -316,6 +317,45 @@
         finally:
             BaseTestCase.tearDown(self)
 
+    def test_url_collapse_path_split(self):
+        test_vectors = {
+            '': ('/', ''),
+            '..': IndexError,
+            '/.//..': IndexError,
+            '/': ('/', ''),
+            '//': ('/', ''),
+            '/\\': ('/', '\\'),
+            '/.//': ('/', ''),
+            'cgi-bin/file1.py': ('/cgi-bin', 'file1.py'),
+            '/cgi-bin/file1.py': ('/cgi-bin', 'file1.py'),
+            'a': ('/', 'a'),
+            '/a': ('/', 'a'),
+            '//a': ('/', 'a'),
+            './a': ('/', 'a'),
+            './C:/': ('/C:', ''),
+            '/a/b': ('/a', 'b'),
+            '/a/b/': ('/a/b', ''),
+            '/a/b/c/..': ('/a/b', ''),
+            '/a/b/c/../d': ('/a/b', 'd'),
+            '/a/b/c/../d/e/../f': ('/a/b/d', 'f'),
+            '/a/b/c/../d/e/../../f': ('/a/b', 'f'),
+            '/a/b/c/../d/e/.././././..//f': ('/a/b', 'f'),
+            '../a/b/c/../d/e/.././././..//f': IndexError,
+            '/a/b/c/../d/e/../../../f': ('/a', 'f'),
+            '/a/b/c/../d/e/../../../../f': ('/', 'f'),
+            '/a/b/c/../d/e/../../../../../f': IndexError,
+            '/a/b/c/../d/e/../../../../f/..': ('/', ''),
+        }
+        for path, expected in test_vectors.items():
+            if isinstance(expected, type) and issubclass(expected, Exception):
+                self.assertRaises(expected,
+                                  server._url_collapse_path_split, path)
+            else:
+                actual = server._url_collapse_path_split(path)
+                self.assertEquals(expected, actual,
+                                  msg='path = %r\nGot:    %r\nWanted: %r' % (
+                                  path, actual, expected))
+
     def test_headers_and_content(self):
         res = self.request('/cgi-bin/file1.py')
         self.assertEquals((b'Hello World\n', 'text/html', 200), \
@@ -341,6 +381,12 @@
         self.assertEquals((b'Hello World\n', 'text/html', 200), \
              (res.read(), res.getheader('Content-type'), res.status))
 
+    def test_no_leading_slash(self):
+        # http://bugs.python.org/issue2254
+        res = self.request('cgi-bin/file1.py')
+        self.assertEquals((b'Hello World\n', 'text/html', 200),
+             (res.read(), res.getheader('Content-type'), res.status))
+
 
 def test_main(verbose=None):
     try:

Modified: python/branches/py3k-short-float-repr/Lib/test/test_minidom.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_minidom.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_minidom.py	Mon Apr 13 18:30:54 2009
@@ -789,6 +789,167 @@
                 "testNormalize -- single empty node removed")
         doc.unlink()
 
+    def testNormalizeCombineAndNextSibling(self):
+        doc = parseString("<doc/>")
+        root = doc.documentElement
+        root.appendChild(doc.createTextNode("first"))
+        root.appendChild(doc.createTextNode("second"))
+        root.appendChild(doc.createElement("i"))
+        self.confirm(len(root.childNodes) == 3
+                and root.childNodes.length == 3,
+                "testNormalizeCombineAndNextSibling -- preparation")
+        doc.normalize()
+        self.confirm(len(root.childNodes) == 2
+                and root.childNodes.length == 2
+                and root.firstChild.data == "firstsecond"
+                and root.firstChild is not root.lastChild
+                and root.firstChild.nextSibling is root.lastChild
+                and root.firstChild.previousSibling is None
+                and root.lastChild.previousSibling is root.firstChild
+                and root.lastChild.nextSibling is None
+                , "testNormalizeCombinedAndNextSibling -- result")
+        doc.unlink()
+
+    def testNormalizeDeleteWithPrevSibling(self):
+        doc = parseString("<doc/>")
+        root = doc.documentElement
+        root.appendChild(doc.createTextNode("first"))
+        root.appendChild(doc.createTextNode(""))
+        self.confirm(len(root.childNodes) == 2
+                and root.childNodes.length == 2,
+                "testNormalizeDeleteWithPrevSibling -- preparation")
+        doc.normalize()
+        self.confirm(len(root.childNodes) == 1
+                and root.childNodes.length == 1
+                and root.firstChild.data == "first"
+                and root.firstChild is root.lastChild
+                and root.firstChild.nextSibling is None
+                and root.firstChild.previousSibling is None
+                , "testNormalizeDeleteWithPrevSibling -- result")
+        doc.unlink()
+
+    def testNormalizeDeleteWithNextSibling(self):
+        doc = parseString("<doc/>")
+        root = doc.documentElement
+        root.appendChild(doc.createTextNode(""))
+        root.appendChild(doc.createTextNode("second"))
+        self.confirm(len(root.childNodes) == 2
+                and root.childNodes.length == 2,
+                "testNormalizeDeleteWithNextSibling -- preparation")
+        doc.normalize()
+        self.confirm(len(root.childNodes) == 1
+                and root.childNodes.length == 1
+                and root.firstChild.data == "second"
+                and root.firstChild is root.lastChild
+                and root.firstChild.nextSibling is None
+                and root.firstChild.previousSibling is None
+                , "testNormalizeDeleteWithNextSibling -- result")
+        doc.unlink()
+
+    def testNormalizeDeleteWithTwoNonTextSiblings(self):
+        doc = parseString("<doc/>")
+        root = doc.documentElement
+        root.appendChild(doc.createElement("i"))
+        root.appendChild(doc.createTextNode(""))
+        root.appendChild(doc.createElement("i"))
+        self.confirm(len(root.childNodes) == 3
+                and root.childNodes.length == 3,
+                "testNormalizeDeleteWithTwoSiblings -- preparation")
+        doc.normalize()
+        self.confirm(len(root.childNodes) == 2
+                and root.childNodes.length == 2
+                and root.firstChild is not root.lastChild
+                and root.firstChild.nextSibling is root.lastChild
+                and root.firstChild.previousSibling is None
+                and root.lastChild.previousSibling is root.firstChild
+                and root.lastChild.nextSibling is None
+                , "testNormalizeDeleteWithTwoSiblings -- result")
+        doc.unlink()
+
+    def testNormalizeDeleteAndCombine(self):
+        doc = parseString("<doc/>")
+        root = doc.documentElement
+        root.appendChild(doc.createTextNode(""))
+        root.appendChild(doc.createTextNode("second"))
+        root.appendChild(doc.createTextNode(""))
+        root.appendChild(doc.createTextNode("fourth"))
+        root.appendChild(doc.createTextNode(""))
+        self.confirm(len(root.childNodes) == 5
+                and root.childNodes.length == 5,
+                "testNormalizeDeleteAndCombine -- preparation")
+        doc.normalize()
+        self.confirm(len(root.childNodes) == 1
+                and root.childNodes.length == 1
+                and root.firstChild is root.lastChild
+                and root.firstChild.data == "secondfourth"
+                and root.firstChild.previousSibling is None
+                and root.firstChild.nextSibling is None
+                , "testNormalizeDeleteAndCombine -- result")
+        doc.unlink()
+
+    def testNormalizeRecursion(self):
+        doc = parseString("<doc>"
+                            "<o>"
+                              "<i/>"
+                              "t"
+                              #
+                              #x
+                            "</o>"
+                            "<o>"
+                              "<o>"
+                                "t2"
+                                #x2
+                              "</o>"
+                              "t3"
+                              #x3
+                            "</o>"
+                            #
+                          "</doc>")
+        root = doc.documentElement
+        root.childNodes[0].appendChild(doc.createTextNode(""))
+        root.childNodes[0].appendChild(doc.createTextNode("x"))
+        root.childNodes[1].childNodes[0].appendChild(doc.createTextNode("x2"))
+        root.childNodes[1].appendChild(doc.createTextNode("x3"))
+        root.appendChild(doc.createTextNode(""))
+        self.confirm(len(root.childNodes) == 3
+                and root.childNodes.length == 3
+                and len(root.childNodes[0].childNodes) == 4
+                and root.childNodes[0].childNodes.length == 4
+                and len(root.childNodes[1].childNodes) == 3
+                and root.childNodes[1].childNodes.length == 3
+                and len(root.childNodes[1].childNodes[0].childNodes) == 2
+                and root.childNodes[1].childNodes[0].childNodes.length == 2
+                , "testNormalize2 -- preparation")
+        doc.normalize()
+        self.confirm(len(root.childNodes) == 2
+                and root.childNodes.length == 2
+                and len(root.childNodes[0].childNodes) == 2
+                and root.childNodes[0].childNodes.length == 2
+                and len(root.childNodes[1].childNodes) == 2
+                and root.childNodes[1].childNodes.length == 2
+                and len(root.childNodes[1].childNodes[0].childNodes) == 1
+                and root.childNodes[1].childNodes[0].childNodes.length == 1
+                , "testNormalize2 -- childNodes lengths")
+        self.confirm(root.childNodes[0].childNodes[1].data == "tx"
+                and root.childNodes[1].childNodes[0].childNodes[0].data == "t2x2"
+                and root.childNodes[1].childNodes[1].data == "t3x3"
+                , "testNormalize2 -- joined text fields")
+        self.confirm(root.childNodes[0].childNodes[1].nextSibling is None
+                and root.childNodes[0].childNodes[1].previousSibling
+                        is root.childNodes[0].childNodes[0]
+                and root.childNodes[0].childNodes[0].previousSibling is None
+                and root.childNodes[0].childNodes[0].nextSibling
+                        is root.childNodes[0].childNodes[1]
+                and root.childNodes[1].childNodes[1].nextSibling is None
+                and root.childNodes[1].childNodes[1].previousSibling
+                        is root.childNodes[1].childNodes[0]
+                and root.childNodes[1].childNodes[0].previousSibling is None
+                and root.childNodes[1].childNodes[0].nextSibling
+                        is root.childNodes[1].childNodes[1]
+                , "testNormalize2 -- sibling pointers")
+        doc.unlink()
+
+
     def testBug1433694(self):
         doc = parseString("<o><i/>t</o>")
         node = doc.documentElement

Modified: python/branches/py3k-short-float-repr/Lib/test/test_mmap.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_mmap.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_mmap.py	Mon Apr 13 18:30:54 2009
@@ -357,15 +357,22 @@
                 m.move(source, dest, size)
             except ValueError:
                 pass
-        self.assertRaises(ValueError, m.move, -1, -1, -1)
-        self.assertRaises(ValueError, m.move, -1, -1, 0)
-        self.assertRaises(ValueError, m.move, -1, 0, -1)
-        self.assertRaises(ValueError, m.move, 0, -1, -1)
-        self.assertRaises(ValueError, m.move, -1, 0, 0)
-        self.assertRaises(ValueError, m.move, 0, -1, 0)
-        self.assertRaises(ValueError, m.move, 0, 0, -1)
+
+        offsets = [(-1, -1, -1), (-1, -1, 0), (-1, 0, -1), (0, -1, -1),
+                   (-1, 0, 0), (0, -1, 0), (0, 0, -1)]
+        for source, dest, size in offsets:
+            self.assertRaises(ValueError, m.move, source, dest, size)
+
         m.close()
 
+        m = mmap.mmap(-1, 1) # single byte
+        self.assertRaises(ValueError, m.move, 0, 0, 2)
+        self.assertRaises(ValueError, m.move, 1, 0, 1)
+        self.assertRaises(ValueError, m.move, 0, 1, 1)
+        m.move(0, 0, 1)
+        m.move(0, 0, 0)
+
+
     def test_anonymous(self):
         # anonymous mmap.mmap(-1, PAGE)
         m = mmap.mmap(-1, PAGESIZE)

Modified: python/branches/py3k-short-float-repr/Lib/test/test_multiprocessing.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_multiprocessing.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_multiprocessing.py	Mon Apr 13 18:30:54 2009
@@ -1832,7 +1832,37 @@
                           multiprocessing.connection.answer_challenge,
                           _FakeConnection(), b'abc')
 
-testcases_other = [OtherTest, TestInvalidHandle]
+#
+# Test Manager.start()/Pool.__init__() initializer feature - see issue 5585
+#
+
+def initializer(ns):
+    ns.test += 1
+
+class TestInitializers(unittest.TestCase):
+    def setUp(self):
+        self.mgr = multiprocessing.Manager()
+        self.ns = self.mgr.Namespace()
+        self.ns.test = 0
+
+    def tearDown(self):
+        self.mgr.shutdown()
+
+    def test_manager_initializer(self):
+        m = multiprocessing.managers.SyncManager()
+        self.assertRaises(TypeError, m.start, 1)
+        m.start(initializer, (self.ns,))
+        self.assertEqual(self.ns.test, 1)
+        m.shutdown()
+
+    def test_pool_initializer(self):
+        self.assertRaises(TypeError, multiprocessing.Pool, initializer=1)
+        p = multiprocessing.Pool(1, initializer, (self.ns,))
+        p.close()
+        p.join()
+        self.assertEqual(self.ns.test, 1)
+
+testcases_other = [OtherTest, TestInvalidHandle, TestInitializers]
 
 #
 #
@@ -1843,7 +1873,6 @@
         try:
             lock = multiprocessing.RLock()
         except OSError:
-            from test.support import TestSkipped
             raise unittest.SkipTest("OSError raises on RLock creation, see issue 3111!")
 
     if run is None:

Modified: python/branches/py3k-short-float-repr/Lib/test/test_os.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_os.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_os.py	Mon Apr 13 18:30:54 2009
@@ -660,6 +660,48 @@
     class Win32ErrorTests(unittest.TestCase):
         pass
 
+    class PosixUidGidTests(unittest.TestCase):
+        if hasattr(os, 'setuid'):
+            def test_setuid(self):
+                if os.getuid() != 0:
+                    self.assertRaises(os.error, os.setuid, 0)
+                self.assertRaises(OverflowError, os.setuid, 1<<32)
+
+        if hasattr(os, 'setgid'):
+            def test_setgid(self):
+                if os.getuid() != 0:
+                    self.assertRaises(os.error, os.setgid, 0)
+                self.assertRaises(OverflowError, os.setgid, 1<<32)
+
+        if hasattr(os, 'seteuid'):
+            def test_seteuid(self):
+                if os.getuid() != 0:
+                    self.assertRaises(os.error, os.seteuid, 0)
+                self.assertRaises(OverflowError, os.seteuid, 1<<32)
+
+        if hasattr(os, 'setegid'):
+            def test_setegid(self):
+                if os.getuid() != 0:
+                    self.assertRaises(os.error, os.setegid, 0)
+                self.assertRaises(OverflowError, os.setegid, 1<<32)
+
+        if hasattr(os, 'setreuid'):
+            def test_setreuid(self):
+                if os.getuid() != 0:
+                    self.assertRaises(os.error, os.setreuid, 0, 0)
+                self.assertRaises(OverflowError, os.setreuid, 1<<32, 0)
+                self.assertRaises(OverflowError, os.setreuid, 0, 1<<32)
+
+        if hasattr(os, 'setregid'):
+            def test_setregid(self):
+                if os.getuid() != 0:
+                    self.assertRaises(os.error, os.setregid, 0, 0)
+                self.assertRaises(OverflowError, os.setregid, 1<<32, 0)
+                self.assertRaises(OverflowError, os.setregid, 0, 1<<32)
+else:
+    class PosixUidGidTests(unittest.TestCase):
+        pass
+
 def test_main():
     support.run_unittest(
         FileTests,
@@ -671,7 +713,8 @@
         URandomTests,
         ExecTests,
         Win32ErrorTests,
-        TestInvalidFD
+        TestInvalidFD,
+        PosixUidGidTests
     )
 
 if __name__ == "__main__":

Modified: python/branches/py3k-short-float-repr/Lib/test/test_posixpath.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_posixpath.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_posixpath.py	Mon Apr 13 18:30:54 2009
@@ -419,6 +419,11 @@
             self.assert_(isinstance(posixpath.expanduser(b"~root/"), bytes))
             self.assert_(isinstance(posixpath.expanduser(b"~foo/"), bytes))
 
+            orig_home = os.environ['HOME']
+            os.environ['HOME'] = '/'
+            self.assertEqual(posixpath.expanduser("~"), "/")
+            os.environ['HOME'] = orig_home
+
         self.assertRaises(TypeError, posixpath.expanduser)
 
     def test_expandvars(self):

Modified: python/branches/py3k-short-float-repr/Lib/test/test_string.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_string.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_string.py	Mon Apr 13 18:30:54 2009
@@ -101,14 +101,6 @@
         self.assertRaises(ValueError, fmt.format, "{0}", 10, 20, i=100)
         self.assertRaises(ValueError, fmt.format, "{i}", 10, 20, i=100)
 
-
-    def test_maketrans(self):
-        transtable = b'\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`xyzdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377'
-
-        self.assertEqual(string.maketrans(b'abc', b'xyz'), transtable)
-        self.assertRaises(ValueError, string.maketrans, b'abc', b'xyzq')
-        self.assertRaises(TypeError, string.maketrans, 'abc', 'def')
-
 def test_main():
     support.run_unittest(ModuleTest)
 

Modified: python/branches/py3k-short-float-repr/Lib/test/test_sys.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_sys.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_sys.py	Mon Apr 13 18:30:54 2009
@@ -344,6 +344,8 @@
         self.assertEqual(len(sys.int_info), 2)
         self.assert_(sys.int_info.bits_per_digit % 5 == 0)
         self.assert_(sys.int_info.sizeof_digit >= 1)
+        self.assertEqual(type(sys.int_info.bits_per_digit), int)
+        self.assertEqual(type(sys.int_info.sizeof_digit), int)
         self.assert_(isinstance(sys.hexversion, int))
         self.assert_(isinstance(sys.maxsize, int))
         self.assert_(isinstance(sys.maxunicode, int))
@@ -622,9 +624,9 @@
         check(1, size(vh) + self.longdigit)
         check(-1, size(vh) + self.longdigit)
         PyLong_BASE = 2**sys.int_info.bits_per_digit
-        check(PyLong_BASE, size(vh) + 2*self.longdigit)
-        check(PyLong_BASE**2-1, size(vh) + 2*self.longdigit)
-        check(PyLong_BASE**2, size(vh) + 3*self.longdigit)
+        check(int(PyLong_BASE), size(vh) + 2*self.longdigit)
+        check(int(PyLong_BASE**2-1), size(vh) + 2*self.longdigit)
+        check(int(PyLong_BASE**2), size(vh) + 3*self.longdigit)
         # memory
         check(memoryview(b''), size(h + 'P PP2P2i7P'))
         # module

Modified: python/branches/py3k-short-float-repr/Lib/test/test_telnetlib.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_telnetlib.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_telnetlib.py	Mon Apr 13 18:30:54 2009
@@ -2,17 +2,38 @@
 import threading
 import telnetlib
 import time
+import queue
 
 from unittest import TestCase
 from test import support
 
 HOST = support.HOST
+EOF_sigil = object()
 
-def server(evt, serv):
+def server(evt, serv, dataq=None):
+    """ Open a tcp server in three steps
+        1) set evt to true to let the parent know we are ready
+        2) [optional] if is not False, write the list of data from dataq.get()
+           to the socket.
+        3) set evt to true to let the parent know we're done
+    """
     serv.listen(5)
     evt.set()
     try:
         conn, addr = serv.accept()
+        if dataq:
+            data = b''
+            new_data = dataq.get(True, 0.5)
+            dataq.task_done()
+            for item in new_data:
+                if item == EOF_sigil:
+                    break
+                if type(item) in [int, float]:
+                    time.sleep(item)
+                else:
+                    data += item
+                written = conn.send(data)
+                data = data[written:]
     except socket.timeout:
         pass
     finally:
@@ -26,13 +47,15 @@
         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         self.sock.settimeout(3)
         self.port = support.bind_port(self.sock)
-        threading.Thread(target=server, args=(self.evt,self.sock)).start()
+        self.thread = threading.Thread(target=server, args=(self.evt,self.sock))
+        self.thread.start()
         self.evt.wait()
         self.evt.clear()
         time.sleep(.1)
 
     def tearDown(self):
         self.evt.wait()
+        self.thread.join()
 
     def testBasic(self):
         # connects
@@ -71,9 +94,277 @@
         self.assertEqual(telnet.sock.gettimeout(), 30)
         telnet.sock.close()
 
+def _read_setUp(self):
+    self.evt = threading.Event()
+    self.dataq = queue.Queue()
+    self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    self.sock.settimeout(3)
+    self.port = support.bind_port(self.sock)
+    self.thread = threading.Thread(target=server, args=(self.evt,self.sock, self.dataq))
+    self.thread.start()
+    self.evt.wait()
+    self.evt.clear()
+    time.sleep(.1)
+
+def _read_tearDown(self):
+    self.evt.wait()
+    self.thread.join()
+
+class ReadTests(TestCase):
+    setUp = _read_setUp
+    tearDown = _read_tearDown
+
+    # use a similar approach to testing timeouts as test_timeout.py
+    # these will never pass 100% but make the fuzz big enough that it is rare
+    block_long = 0.6
+    block_short = 0.3
+    def test_read_until_A(self):
+        """
+        read_until(expected, [timeout])
+          Read until the expected string has been seen, or a timeout is
+          hit (default is no timeout); may block.
+        """
+        want = [b'x' * 10, b'match', b'y' * 10, EOF_sigil]
+        self.dataq.put(want)
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        data = telnet.read_until(b'match')
+        self.assertEqual(data, b''.join(want[:-2]))
+
+    def test_read_until_B(self):
+        # test the timeout - it does NOT raise socket.timeout
+        want = [b'hello', self.block_long, b'not seen', EOF_sigil]
+        self.dataq.put(want)
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        data = telnet.read_until(b'not seen', self.block_short)
+        self.assertEqual(data, want[0])
+        self.assertEqual(telnet.read_all(), b'not seen')
+
+    def test_read_all_A(self):
+        """
+        read_all()
+          Read all data until EOF; may block.
+        """
+        want = [b'x' * 500, b'y' * 500, b'z' * 500, EOF_sigil]
+        self.dataq.put(want)
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        data = telnet.read_all()
+        self.assertEqual(data, b''.join(want[:-1]))
+        return
+
+    def _test_blocking(self, func):
+        self.dataq.put([self.block_long, EOF_sigil])
+        self.dataq.join()
+        start = time.time()
+        data = func()
+        self.assertTrue(self.block_short <= time.time() - start)
+
+    def test_read_all_B(self):
+        self._test_blocking(telnetlib.Telnet(HOST, self.port).read_all)
+
+    def test_read_all_C(self):
+        self.dataq.put([EOF_sigil])
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        telnet.read_all()
+        telnet.read_all() # shouldn't raise
+
+    def test_read_some_A(self):
+        """
+        read_some()
+          Read at least one byte or EOF; may block.
+        """
+        # test 'at least one byte'
+        want = [b'x' * 500, EOF_sigil]
+        self.dataq.put(want)
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        data = telnet.read_all()
+        self.assertTrue(len(data) >= 1)
+
+    def test_read_some_B(self):
+        # test EOF
+        self.dataq.put([EOF_sigil])
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        self.assertEqual(b'', telnet.read_some())
+
+    def test_read_some_C(self):
+        self._test_blocking(telnetlib.Telnet(HOST, self.port).read_some)
+
+    def _test_read_any_eager_A(self, func_name):
+        """
+        read_very_eager()
+          Read all data available already queued or on the socket,
+          without blocking.
+        """
+        want = [self.block_long, b'x' * 100, b'y' * 100, EOF_sigil]
+        expects = want[1] + want[2]
+        self.dataq.put(want)
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        func = getattr(telnet, func_name)
+        data = b''
+        while True:
+            try:
+                data += func()
+                self.assertTrue(expects.startswith(data))
+            except EOFError:
+                break
+        self.assertEqual(expects, data)
+
+    def _test_read_any_eager_B(self, func_name):
+        # test EOF
+        self.dataq.put([EOF_sigil])
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        time.sleep(self.block_short)
+        func = getattr(telnet, func_name)
+        self.assertRaises(EOFError, func)
+
+    # read_eager and read_very_eager make the same gaurantees
+    # (they behave differently but we only test the gaurantees)
+    def test_read_very_eager_A(self):
+        self._test_read_any_eager_A('read_very_eager')
+    def test_read_very_eager_B(self):
+        self._test_read_any_eager_B('read_very_eager')
+    def test_read_eager_A(self):
+        self._test_read_any_eager_A('read_eager')
+    def test_read_eager_B(self):
+        self._test_read_any_eager_B('read_eager')
+    # NB -- we need to test the IAC block which is mentioned in the docstring
+    # but not in the module docs
+
+    def _test_read_any_lazy_B(self, func_name):
+        self.dataq.put([EOF_sigil])
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        func = getattr(telnet, func_name)
+        telnet.fill_rawq()
+        self.assertRaises(EOFError, func)
+
+    def test_read_lazy_A(self):
+        want = [b'x' * 100, EOF_sigil]
+        self.dataq.put(want)
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        time.sleep(self.block_short)
+        self.assertEqual(b'', telnet.read_lazy())
+        data = b''
+        while True:
+            try:
+                read_data = telnet.read_lazy()
+                data += read_data
+                if not read_data:
+                    telnet.fill_rawq()
+            except EOFError:
+                break
+            self.assertTrue(want[0].startswith(data))
+        self.assertEqual(data, want[0])
+
+    def test_read_lazy_B(self):
+        self._test_read_any_lazy_B('read_lazy')
+
+    def test_read_very_lazy_A(self):
+        want = [b'x' * 100, EOF_sigil]
+        self.dataq.put(want)
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        time.sleep(self.block_short)
+        self.assertEqual(b'', telnet.read_very_lazy())
+        data = b''
+        while True:
+            try:
+                read_data = telnet.read_very_lazy()
+            except EOFError:
+                break
+            data += read_data
+            if not read_data:
+                telnet.fill_rawq()
+                self.assertEqual(b'', telnet.cookedq)
+                telnet.process_rawq()
+            self.assertTrue(want[0].startswith(data))
+        self.assertEqual(data, want[0])
+
+    def test_read_very_lazy_B(self):
+        self._test_read_any_lazy_B('read_very_lazy')
+
+class nego_collector(object):
+    def __init__(self, sb_getter=None):
+        self.seen = b''
+        self.sb_getter = sb_getter
+        self.sb_seen = b''
+
+    def do_nego(self, sock, cmd, opt):
+        self.seen += cmd + opt
+        if cmd == tl.SE and self.sb_getter:
+            sb_data = self.sb_getter()
+            self.sb_seen += sb_data
+
+tl = telnetlib
+class OptionTests(TestCase):
+    setUp = _read_setUp
+    tearDown = _read_tearDown
+    # RFC 854 commands
+    cmds = [tl.AO, tl.AYT, tl.BRK, tl.EC, tl.EL, tl.GA, tl.IP, tl.NOP]
+
+    def _test_command(self, data):
+        """ helper for testing IAC + cmd """
+        self.setUp()
+        self.dataq.put(data)
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        nego = nego_collector()
+        telnet.set_option_negotiation_callback(nego.do_nego)
+        txt = telnet.read_all()
+        cmd = nego.seen
+        self.assertTrue(len(cmd) > 0) # we expect at least one command
+        self.assertTrue(cmd[:1] in self.cmds)
+        self.assertEqual(cmd[1:2], tl.NOOPT)
+        self.assertEqual(len(b''.join(data[:-1])), len(txt + cmd))
+        nego.sb_getter = None # break the nego => telnet cycle
+        self.tearDown()
+
+    def test_IAC_commands(self):
+        # reset our setup
+        self.dataq.put([EOF_sigil])
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        self.tearDown()
+
+        for cmd in self.cmds:
+            self._test_command([tl.IAC, cmd, EOF_sigil])
+            self._test_command([b'x' * 100, tl.IAC, cmd, b'y'*100, EOF_sigil])
+            self._test_command([b'x' * 10, tl.IAC, cmd, b'y'*10, EOF_sigil])
+        # all at once
+        self._test_command([tl.IAC + cmd for (cmd) in self.cmds] + [EOF_sigil])
+        self.assertEqual(b'', telnet.read_sb_data())
+
+    def test_SB_commands(self):
+        # RFC 855, subnegotiations portion
+        send = [tl.IAC + tl.SB + tl.IAC + tl.SE,
+                tl.IAC + tl.SB + tl.IAC + tl.IAC + tl.IAC + tl.SE,
+                tl.IAC + tl.SB + tl.IAC + tl.IAC + b'aa' + tl.IAC + tl.SE,
+                tl.IAC + tl.SB + b'bb' + tl.IAC + tl.IAC + tl.IAC + tl.SE,
+                tl.IAC + tl.SB + b'cc' + tl.IAC + tl.IAC + b'dd' + tl.IAC + tl.SE,
+                EOF_sigil,
+               ]
+        self.dataq.put(send)
+        telnet = telnetlib.Telnet(HOST, self.port)
+        self.dataq.join()
+        nego = nego_collector(telnet.read_sb_data)
+        telnet.set_option_negotiation_callback(nego.do_nego)
+        txt = telnet.read_all()
+        self.assertEqual(txt, b'')
+        want_sb_data = tl.IAC + tl.IAC + b'aabb' + tl.IAC + b'cc' + tl.IAC + b'dd'
+        self.assertEqual(nego.sb_seen, want_sb_data)
+        self.assertEqual(b'', telnet.read_sb_data())
+        nego.sb_getter = None # break the nego => telnet cycle
 
 def test_main(verbose=None):
-    support.run_unittest(GeneralTests)
+    support.run_unittest(GeneralTests, ReadTests, OptionTests)
 
 if __name__ == '__main__':
     test_main()

Modified: python/branches/py3k-short-float-repr/Lib/test/test_unittest.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_unittest.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_unittest.py	Mon Apr 13 18:30:54 2009
@@ -2311,6 +2311,16 @@
         # from this TestCase instance but since its a local nothing else
         # will ever notice that.
 
+    def testAssertIs(self):
+        thing = object()
+        self.assertIs(thing, thing)
+        self.assertRaises(self.failureException, self.assertIs, thing, object())
+
+    def testAssertIsNot(self):
+        thing = object()
+        self.assertIsNot(thing, object())
+        self.assertRaises(self.failureException, self.assertIsNot, thing, thing)
+
     def testAssertIn(self):
         animals = {'monkey': 'banana', 'cow': 'grass', 'seal': 'fish'}
 
@@ -2454,6 +2464,7 @@
 
         # Test that sequences of unhashable objects can be tested for sameness:
         self.assertSameElements([[1, 2], [3, 4]], [[3, 4], [1, 2]])
+
         self.assertSameElements([{'a': 1}, {'b': 2}], [{'b': 2}, {'a': 1}])
         self.assertRaises(self.failureException, self.assertSameElements,
                           [[1]], [[2]])
@@ -2988,6 +2999,18 @@
                              "^unexpectedly None$",
                              "^unexpectedly None : oops$"])
 
+    def testAssertIs(self):
+        self.assertMessages('assertIs', (None, 'foo'),
+                            ["^None is not 'foo'$", "^oops$",
+                             "^None is not 'foo'$",
+                             "^None is not 'foo' : oops$"])
+
+    def testAssertIsNot(self):
+        self.assertMessages('assertIsNot', (None, None),
+                            ["^unexpectedly identical: None$", "^oops$",
+                             "^unexpectedly identical: None$",
+                             "^unexpectedly identical: None : oops$"])
+
 
 ######################################################################
 ## Main

Modified: python/branches/py3k-short-float-repr/Lib/test/test_warnings.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/test/test_warnings.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/test/test_warnings.py	Mon Apr 13 18:30:54 2009
@@ -10,18 +10,14 @@
 
 import warnings as original_warnings
 
-sys.modules['_warnings'] = 0
-del sys.modules['warnings']
-
-import warnings as py_warnings
-
+py_warnings = support.import_fresh_module('warnings', ['_warnings'])
+# XXX (ncoghlan 20090412):
+# Something in Py3k doesn't like sharing the same instance of
+# _warnings between original_warnings and c_warnings
+# Will leave issue 5354 open until I understand why 3.x breaks
+# without the next line, while 2.x doesn't care
 del sys.modules['_warnings']
-del sys.modules['warnings']
-
-import warnings as c_warnings
-
-sys.modules['warnings'] = original_warnings
-
+c_warnings = support.import_fresh_module('warnings')
 
 @contextmanager
 def warnings_state(module):
@@ -351,9 +347,21 @@
 class CWarnTests(BaseTest, WarnTests):
     module = c_warnings
 
+    # As an early adopter, we sanity check the
+    # test.support.import_fresh_module utility function
+    def test_accelerated(self):
+        self.assertFalse(original_warnings is self.module)
+        self.assertFalse(hasattr(self.module.warn, '__code__'))
+
 class PyWarnTests(BaseTest, WarnTests):
     module = py_warnings
 
+    # As an early adopter, we sanity check the
+    # test.support.import_fresh_module utility function
+    def test_pure_python(self):
+        self.assertFalse(original_warnings is self.module)
+        self.assertTrue(hasattr(self.module.warn, '__code__'))
+
 
 class WCmdLineTests(unittest.TestCase):
 

Modified: python/branches/py3k-short-float-repr/Lib/unittest.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/unittest.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/unittest.py	Mon Apr 13 18:30:54 2009
@@ -807,6 +807,18 @@
             standardMsg = '%r unexpectedly found in %r' % (member, container)
             self.fail(self._formatMessage(msg, standardMsg))
 
+    def assertIs(self, expr1, expr2, msg=None):
+        """Just like self.assertTrue(a is b), but with a nicer default message."""
+        if expr1 is not expr2:
+            standardMsg = '%r is not %r' % (expr1, expr2)
+            self.fail(self._formatMessage(msg, standardMsg))
+
+    def assertIsNot(self, expr1, expr2, msg=None):
+        """Just like self.assertTrue(a is not b), but with a nicer default message."""
+        if expr1 is expr2:
+            standardMsg = 'unexpectedly identical: %r' % (expr1,)
+            self.fail(self._formatMessage(msg, standardMsg))
+
     def assertDictEqual(self, d1, d2, msg=None):
         self.assert_(isinstance(d1, dict), 'First argument is not a dictionary')
         self.assert_(isinstance(d2, dict), 'Second argument is not a dictionary')
@@ -1020,7 +1032,7 @@
         self.addTests(tests)
 
     def __repr__(self):
-        return "<%s tests=%s>" % (_strclass(self.__class__), self._tests)
+        return "<%s tests=%s>" % (_strclass(self.__class__), list(self))
 
     def __eq__(self, other):
         if not isinstance(other, self.__class__):
@@ -1035,7 +1047,7 @@
 
     def countTestCases(self):
         cases = 0
-        for test in self._tests:
+        for test in self:
             cases += test.countTestCases()
         return cases
 
@@ -1055,7 +1067,7 @@
             self.addTest(test)
 
     def run(self, result):
-        for test in self._tests:
+        for test in self:
             if result.shouldStop:
                 break
             test(result)
@@ -1066,7 +1078,7 @@
 
     def debug(self):
         """Run the tests without collecting errors in a TestResult"""
-        for test in self._tests:
+        for test in self:
             test.debug()
 
 

Modified: python/branches/py3k-short-float-repr/Lib/xml/dom/minidom.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/xml/dom/minidom.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/xml/dom/minidom.py	Mon Apr 13 18:30:54 2009
@@ -179,34 +179,27 @@
         L = []
         for child in self.childNodes:
             if child.nodeType == Node.TEXT_NODE:
-                data = child.data
-                if data and L and L[-1].nodeType == child.nodeType:
+                if not child.data:
+                    # empty text node; discard
+                    if L:
+                        L[-1].nextSibling = child.nextSibling
+                    if child.nextSibling:
+                        child.nextSibling.previousSibling = child.previousSibling
+                    child.unlink()
+                elif L and L[-1].nodeType == child.nodeType:
                     # collapse text node
                     node = L[-1]
                     node.data = node.data + child.data
                     node.nextSibling = child.nextSibling
+                    if child.nextSibling:
+                        child.nextSibling.previousSibling = node
                     child.unlink()
-                elif data:
-                    if L:
-                        L[-1].nextSibling = child
-                        child.previousSibling = L[-1]
-                    else:
-                        child.previousSibling = None
-                    L.append(child)
                 else:
-                    # empty text node; discard
-                    child.unlink()
+                    L.append(child)
             else:
-                if L:
-                    L[-1].nextSibling = child
-                    child.previousSibling = L[-1]
-                else:
-                    child.previousSibling = None
                 L.append(child)
                 if child.nodeType == Node.ELEMENT_NODE:
                     child.normalize()
-        if L:
-            L[-1].nextSibling = None
         self.childNodes[:] = L
 
     def cloneNode(self, deep):

Modified: python/branches/py3k-short-float-repr/Lib/xmlrpc/server.py
==============================================================================
--- python/branches/py3k-short-float-repr/Lib/xmlrpc/server.py	(original)
+++ python/branches/py3k-short-float-repr/Lib/xmlrpc/server.py	Mon Apr 13 18:30:54 2009
@@ -159,7 +159,7 @@
     reason to instantiate this class directly.
     """
 
-    def __init__(self, allow_none, encoding):
+    def __init__(self, allow_none=False, encoding=None):
         self.funcs = {}
         self.instance = None
         self.allow_none = allow_none

Modified: python/branches/py3k-short-float-repr/Makefile.pre.in
==============================================================================
--- python/branches/py3k-short-float-repr/Makefile.pre.in	(original)
+++ python/branches/py3k-short-float-repr/Makefile.pre.in	Mon Apr 13 18:30:54 2009
@@ -788,7 +788,7 @@
 	then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
 	else true; \
 	fi
-	(cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
+	(cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)3)
 	-rm -f $(DESTDIR)$(BINDIR)/python-config
 	(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
 
@@ -842,6 +842,7 @@
 		sqlite3 sqlite3/test \
 		logging bsddb bsddb/test csv wsgiref urllib \
 		lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
+		lib2to3/tests/data lib2to3/tests/data/fixes lib2to3/tests/data/fixers/myfixes \
 		ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \
 		distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
 		importlib importlib/test importlib/test/builtin \
@@ -909,11 +910,13 @@
 	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
 		./$(BUILDPYTHON) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
 		-d $(LIBDEST) -f \
-		-x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
+		-x 'bad_coding|badsyntax|site-packages|py2_test_grammar' \
+		$(DESTDIR)$(LIBDEST)
 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
 		./$(BUILDPYTHON) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
 		-d $(LIBDEST) -f \
-		-x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
+		-x 'bad_coding|badsyntax|site-packages|py2_test_grammar' \
+		$(DESTDIR)$(LIBDEST)
 	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
 		./$(BUILDPYTHON) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
 		-d $(LIBDEST)/site-packages -f \

Modified: python/branches/py3k-short-float-repr/Misc/NEWS
==============================================================================
--- python/branches/py3k-short-float-repr/Misc/NEWS	(original)
+++ python/branches/py3k-short-float-repr/Misc/NEWS	Mon Apr 13 18:30:54 2009
@@ -12,9 +12,29 @@
 Core and Builtins
 -----------------
 
+- The string.maketrans() function is deprecated; there is a new static method
+  maketrans() on the bytes and bytearray classes.  This removes confusion about
+  the types string.maketrans() is supposed to work with, and mirrors the
+  methods available on the str class.
+
+- Issue #2170: refactored xml.dom.minidom.normalize, increasing both
+  its clarity and its speed.
+
+- Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add `do { ... } while (0)'
+  to avoid compiler warnings.
+
 Library
 -------
 
+- Issue #2703: SimpleXMLRPCDispatcher.__init__: Provide default values for
+  new arguments introduced in 2.5.
+
+Extension Modules
+-----------------
+
+- Issue #5359: Readd the Berkley-DB detection code to allow _dbm be built
+  using Berkley-DB.
+
 
 What's New in Python 3.1 alpha 2?
 =================================
@@ -32,6 +52,9 @@
 - Issue #5499: The 'c' code for argument parsing functions now only accepts a
   byte, and the 'C' code only accepts a unicode character.
 
+- Fix a problem in PyErr_NormalizeException that leads to "undetected errors"
+  when hitting the recursion limit under certain circumstances.
+
 - Issue #1665206: Remove the last eager import in _warnings.c and make it lazy.
 
 - Fix a segfault when running test_exceptions with coverage, caused by
@@ -75,8 +98,6 @@
 - Issue #3845: In PyRun_SimpleFileExFlags avoid invalid memory access with
   short file names.
 
-- Py_DECREF: Add `do { ... } while (0)' to avoid compiler warnings.
-
 Library
 -------
 
@@ -327,6 +348,13 @@
 Library
 -------
 
+- Issue #5607: fixed Distutils test_get_platform for Mac OS X fat binaries.
+
+- Issue #5732: added a new command in Distutils: check.
+
+- Issue #5731: Distutils bdist_wininst no longer worked on non-Windows 
+  platforms. Initial patch by Paul Moore.
+
 - Issue #5095: Added bdist_msi to the list of bdist supported formats.
   Initial fix by Steven Bethard.
 

Modified: python/branches/py3k-short-float-repr/Misc/README
==============================================================================
--- python/branches/py3k-short-float-repr/Misc/README	(original)
+++ python/branches/py3k-short-float-repr/Misc/README	Mon Apr 13 18:30:54 2009
@@ -21,6 +21,7 @@
 pymemcompat.h	Memory interface compatibility file.
 python.man	UNIX man page for the python interpreter
 python-mode.el	Emacs mode for editing Python programs
+python-wing.wpr Wing IDE project file
 README		The file you're reading now
 README.valgrind	Information for Valgrind users, see valgrind-python.supp
 RFD		Request For Discussion about a Python newsgroup

Modified: python/branches/py3k-short-float-repr/Misc/build.sh
==============================================================================
--- python/branches/py3k-short-float-repr/Misc/build.sh	(original)
+++ python/branches/py3k-short-float-repr/Misc/build.sh	Mon Apr 13 18:30:54 2009
@@ -259,6 +259,7 @@
 # which will definitely fail with a conflict. 
 #CONFLICTED_FILE=commontex/boilerplate.tex
 #conflict_count=`grep -c "<<<" $CONFLICTED_FILE`
+make clean
 conflict_count=0
 if [ $conflict_count != 0 ]; then
     echo "Conflict detected in $CONFLICTED_FILE.  Doc build skipped." > ../build/$F

Modified: python/branches/py3k-short-float-repr/Misc/gdbinit
==============================================================================
--- python/branches/py3k-short-float-repr/Misc/gdbinit	(original)
+++ python/branches/py3k-short-float-repr/Misc/gdbinit	Mon Apr 13 18:30:54 2009
@@ -138,3 +138,16 @@
     end
     select-frame 0
 end
+
+# generally useful macro to print a Unicode string
+def pu
+  set $uni = $arg0 
+  set $i = 0
+  while (*$uni && $i++<100)
+    if (*$uni < 0x80) 
+      print *(char*)$uni++
+    else
+      print /x *(short*)$uni++
+    end
+  end
+end

Modified: python/branches/py3k-short-float-repr/Modules/_io/bufferedio.c
==============================================================================
--- python/branches/py3k-short-float-repr/Modules/_io/bufferedio.c	(original)
+++ python/branches/py3k-short-float-repr/Modules/_io/bufferedio.c	Mon Apr 13 18:30:54 2009
@@ -174,7 +174,7 @@
     0,                          /* tp_alloc */
     0,                          /* tp_new */
 };
-
+
 
 typedef struct {
     PyObject_HEAD
@@ -183,6 +183,10 @@
     int ok;    /* Initialized? */
     int readable;
     int writable;
+    
+    /* True if this is a vanilla Buffered object (rather than a user derived
+       class) *and* the raw stream is a vanilla FileIO object. */
+    int fast_closed_checks;
 
     /* Absolute position inside the raw stream (-1 if unknown). */
     Py_off_t abs_pos;
@@ -268,6 +272,18 @@
         return -1; \
     }
 
+#define IS_CLOSED(self) \
+    (self->fast_closed_checks \
+     ? _PyFileIO_closed(self->raw) \
+     : BufferedIOMixin_closed(self))
+
+#define CHECK_CLOSED(self, error_msg) \
+    if (IS_CLOSED(self)) { \
+        PyErr_SetString(PyExc_ValueError, error_msg); \
+        return NULL; \
+    }
+
+
 #define VALID_READ_BUFFER(self) \
     (self->readable && self->read_end != -1)
 
@@ -466,8 +482,8 @@
     CHECK_INITIALIZED(self)
     return PyObject_CallMethodObjArgs(self->raw, _PyIO_str_isatty, NULL);
 }
-
-
+
+
 /* Forward decls */
 static PyObject *
 _BufferedWriter_flush_unlocked(BufferedObject *, int);
@@ -480,7 +496,11 @@
 static PyObject *
 _BufferedReader_peek_unlocked(BufferedObject *self, Py_ssize_t);
 static PyObject *
-_BufferedReader_read_unlocked(BufferedObject *self, Py_ssize_t);
+_BufferedReader_read_all(BufferedObject *self);
+static PyObject *
+_BufferedReader_read_fast(BufferedObject *self, Py_ssize_t);
+static PyObject *
+_BufferedReader_read_generic(BufferedObject *self, Py_ssize_t);
 
 
 /*
@@ -509,8 +529,8 @@
 static Py_off_t
 _Buffered_raw_tell(BufferedObject *self)
 {
-    PyObject *res;
     Py_off_t n;
+    PyObject *res;
     res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_tell, NULL);
     if (res == NULL)
         return -1;
@@ -604,10 +624,7 @@
     PyObject *res;
 
     CHECK_INITIALIZED(self)
-    if (BufferedIOMixin_closed(self)) {
-        PyErr_SetString(PyExc_ValueError, "flush of closed file");
-        return NULL;
-    }
+    CHECK_CLOSED(self, "flush of closed file")
 
     ENTER_BUFFERED(self)
     res = _BufferedWriter_flush_unlocked(self, 0);
@@ -667,14 +684,23 @@
         return NULL;
     }
 
-    if (BufferedIOMixin_closed(self)) {
-        PyErr_SetString(PyExc_ValueError, "read of closed file");
-        return NULL;
-    }
+    CHECK_CLOSED(self, "read of closed file")
 
-    ENTER_BUFFERED(self)
-    res = _BufferedReader_read_unlocked(self, n);
-    LEAVE_BUFFERED(self)
+    if (n == -1) {
+        /* The number of bytes is unspecified, read until the end of stream */
+        ENTER_BUFFERED(self)
+        res = _BufferedReader_read_all(self);
+        LEAVE_BUFFERED(self)
+    }
+    else {
+        res = _BufferedReader_read_fast(self, n);
+        if (res == Py_None) {
+            Py_DECREF(res);
+            ENTER_BUFFERED(self)
+            res = _BufferedReader_read_generic(self, n);
+            LEAVE_BUFFERED(self)
+        }
+    }
 
     return res;
 }
@@ -775,35 +801,31 @@
     Py_ssize_t n, written = 0;
     const char *start, *s, *end;
 
-    if (BufferedIOMixin_closed(self)) {
-        PyErr_SetString(PyExc_ValueError, "readline of closed file");
-        return NULL;
-    }
-
-    ENTER_BUFFERED(self)
+    CHECK_CLOSED(self, "readline of closed file")
 
-    /* First, try to find a line in the buffer */
+    /* First, try to find a line in the buffer. This can run unlocked because
+       the calls to the C API are simple enough that they can't trigger
+       any thread switch. */
     n = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t);
     if (limit >= 0 && n > limit)
         n = limit;
     start = self->buffer + self->pos;
-    end = start + n;
-    s = start;
-    while (s < end) {
-        if (*s++ == '\n') {
-            res = PyBytes_FromStringAndSize(start, s - start);
-            if (res != NULL)
-                self->pos += s - start;
-            goto end;
-        }
+    s = memchr(start, '\n', n);
+    if (s != NULL) {
+        res = PyBytes_FromStringAndSize(start, s - start + 1);
+        if (res != NULL)
+            self->pos += s - start + 1;
+        goto end_unlocked;
     }
     if (n == limit) {
         res = PyBytes_FromStringAndSize(start, n);
         if (res != NULL)
             self->pos += n;
-        goto end;
+        goto end_unlocked;
     }
 
+    ENTER_BUFFERED(self)
+
     /* Now we try to get some more from the raw stream */
     if (self->writable) {
         res = _BufferedWriter_flush_unlocked(self, 1);
@@ -875,6 +897,7 @@
 
 end:
     LEAVE_BUFFERED(self)
+end_unlocked:
     Py_XDECREF(chunks);
     return res;
 }
@@ -918,23 +941,26 @@
     if (!PyArg_ParseTuple(args, "O|i:seek", &targetobj, &whence)) {
         return NULL;
     }
-    
     if (whence < 0 || whence > 2) {
         PyErr_Format(PyExc_ValueError,
                      "whence must be between 0 and 2, not %d", whence);
         return NULL;
     }
+
+    CHECK_CLOSED(self, "seek of closed file")
+
     target = PyNumber_AsOff_t(targetobj, PyExc_ValueError);
     if (target == -1 && PyErr_Occurred())
         return NULL;
 
-    ENTER_BUFFERED(self)
-
     if (whence != 2 && self->readable) {
         Py_off_t current, avail;
         /* Check if seeking leaves us inside the current buffer,
-           so as to return quickly if possible.
+           so as to return quickly if possible. Also, we needn't take the
+           lock in this fast path.
            Don't know how to do that when whence == 2, though. */
+        /* NOTE: RAW_TELL() can release the GIL but the object is in a stable
+           state at this point. */
         current = RAW_TELL(self);
         avail = READAHEAD(self);
         if (avail > 0) {
@@ -945,12 +971,13 @@
                 offset = target;
             if (offset >= -self->pos && offset <= avail) {
                 self->pos += offset;
-                res = PyLong_FromOff_t(current - avail + offset);
-                goto end;
+                return PyLong_FromOff_t(current - avail + offset);
             }
         }
     }
 
+    ENTER_BUFFERED(self)
+
     /* Fallback: invoke raw seek() method and clear buffer */
     if (self->writable) {
         res = _BufferedWriter_flush_unlocked(self, 0);
@@ -1094,6 +1121,9 @@
         return -1;
     _BufferedReader_reset_buf(self);
 
+    self->fast_closed_checks = (Py_TYPE(self) == &PyBufferedReader_Type &&
+                                Py_TYPE(raw) == &PyFileIO_Type);
+
     self->ok = 1;
     return 0;
 }
@@ -1150,93 +1180,107 @@
 }
 
 static PyObject *
-_BufferedReader_read_unlocked(BufferedObject *self, Py_ssize_t n)
+_BufferedReader_read_all(BufferedObject *self)
 {
-    PyObject *data, *res = NULL;
-    Py_ssize_t current_size, remaining, written;
-    char *out;
+    Py_ssize_t current_size;
+    PyObject *res, *data = NULL;
+    PyObject *chunks = PyList_New(0);
 
-    /* Special case for when the number of bytes to read is unspecified. */
-    if (n == -1) {
-        PyObject *chunks = PyList_New(0);
-        if (chunks == NULL)
-            return NULL;
+    if (chunks == NULL)
+        return NULL;
 
-        /* First copy what we have in the current buffer. */
-        current_size = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t);
-        data = NULL;
-        if (current_size) {
-            data = PyBytes_FromStringAndSize(
-                self->buffer + self->pos, current_size);
-            if (data == NULL) {
-                Py_DECREF(chunks);
-                return NULL;
-            }
+    /* First copy what we have in the current buffer. */
+    current_size = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t);
+    if (current_size) {
+        data = PyBytes_FromStringAndSize(
+            self->buffer + self->pos, current_size);
+        if (data == NULL) {
+            Py_DECREF(chunks);
+            return NULL;
         }
-        _BufferedReader_reset_buf(self);
-        /* We're going past the buffer's bounds, flush it */
-        if (self->writable) {
-            res = _BufferedWriter_flush_unlocked(self, 1);
-            if (res == NULL) {
+    }
+    _BufferedReader_reset_buf(self);
+    /* We're going past the buffer's bounds, flush it */
+    if (self->writable) {
+        res = _BufferedWriter_flush_unlocked(self, 1);
+        if (res == NULL) {
+            Py_DECREF(chunks);
+            return NULL;
+        }
+        Py_CLEAR(res);
+    }
+    while (1) {
+        if (data) {
+            if (PyList_Append(chunks, data) < 0) {
+                Py_DECREF(data);
                 Py_DECREF(chunks);
                 return NULL;
             }
-            Py_CLEAR(res);
+            Py_DECREF(data);
         }
-        while (1) {
-            if (data) {
-                if (PyList_Append(chunks, data) < 0) {
-                    Py_DECREF(data);
-                    Py_DECREF(chunks);
-                    return NULL;
-                }
-                Py_DECREF(data);
-            }
 
-            /* Read until EOF or until read() would block. */
-            data = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_read, NULL);
-            if (data == NULL) {
+        /* Read until EOF or until read() would block. */
+        data = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_read, NULL);
+        if (data == NULL) {
+            Py_DECREF(chunks);
+            return NULL;
+        }
+        if (data != Py_None && !PyBytes_Check(data)) {
+            Py_DECREF(data);
+            Py_DECREF(chunks);
+            PyErr_SetString(PyExc_TypeError, "read() should return bytes");
+            return NULL;
+        }
+        if (data == Py_None || PyBytes_GET_SIZE(data) == 0) {
+            if (current_size == 0) {
                 Py_DECREF(chunks);
-                return NULL;
+                return data;
             }
-            if (data != Py_None && !PyBytes_Check(data)) {
+            else {
+                res = _PyBytes_Join(_PyIO_empty_bytes, chunks);
                 Py_DECREF(data);
                 Py_DECREF(chunks);
-                PyErr_SetString(PyExc_TypeError, "read() should return bytes");
-                return NULL;
-            }
-            if (data == Py_None || PyBytes_GET_SIZE(data) == 0) {
-                if (current_size == 0) {
-                    Py_DECREF(chunks);
-                    return data;
-                }
-                else {
-                    res = _PyBytes_Join(_PyIO_empty_bytes, chunks);
-                    Py_DECREF(data);
-                    Py_DECREF(chunks);
-                    return res;
-                }
+                return res;
             }
-            current_size += PyBytes_GET_SIZE(data);
-            if (self->abs_pos != -1)
-                self->abs_pos += PyBytes_GET_SIZE(data);
         }
+        current_size += PyBytes_GET_SIZE(data);
+        if (self->abs_pos != -1)
+            self->abs_pos += PyBytes_GET_SIZE(data);
     }
+}
+
+/* Read n bytes from the buffer if it can, otherwise return None.
+   This function is simple enough that it can run unlocked. */
+static PyObject *
+_BufferedReader_read_fast(BufferedObject *self, Py_ssize_t n)
+{
+    Py_ssize_t current_size;
 
-    /* The number of bytes to read is specified, return at most n bytes. */
     current_size = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t);
     if (n <= current_size) {
         /* Fast path: the data to read is fully buffered. */
-        res = PyBytes_FromStringAndSize(self->buffer + self->pos, n);
-        if (res == NULL)
-            goto error;
-        self->pos += n;
+        PyObject *res = PyBytes_FromStringAndSize(self->buffer + self->pos, n);
+        if (res != NULL)
+            self->pos += n;
         return res;
     }
+    Py_RETURN_NONE;
+}
+
+/* Generic read function: read from the stream until enough bytes are read,
+ * or until an EOF occurs or until read() would block.
+ */
+static PyObject *
+_BufferedReader_read_generic(BufferedObject *self, Py_ssize_t n)
+{
+    PyObject *res = NULL;
+    Py_ssize_t current_size, remaining, written;
+    char *out;
+
+    current_size = Py_SAFE_DOWNCAST(READAHEAD(self), Py_off_t, Py_ssize_t);
+    if (n <= current_size)
+        return _BufferedReader_read_fast(self, n);
 
-    /* Slow path: read from the stream until enough bytes are read,
-     * or until an EOF occurs or until read() would block.
-     */
     res = PyBytes_FromStringAndSize(NULL, n);
     if (res == NULL)
         goto error;
@@ -1479,6 +1523,9 @@
     _BufferedWriter_reset_buf(self);
     self->pos = 0;
 
+    self->fast_closed_checks = (Py_TYPE(self) == &PyBufferedWriter_Type &&
+                                Py_TYPE(raw) == &PyFileIO_Type);
+
     self->ok = 1;
     return 0;
 }
@@ -1583,7 +1630,7 @@
         return NULL;
     }
 
-    if (BufferedIOMixin_closed(self)) {
+    if (IS_CLOSED(self)) {
         PyErr_SetString(PyExc_ValueError, "write to closed file");
         PyBuffer_Release(&buf);
         return NULL;
@@ -2066,6 +2113,9 @@
     _BufferedWriter_reset_buf(self);
     self->pos = 0;
 
+    self->fast_closed_checks = (Py_TYPE(self) == &PyBufferedRandom_Type &&
+                                Py_TYPE(raw) == &PyFileIO_Type);
+
     self->ok = 1;
     return 0;
 }

Modified: python/branches/py3k-short-float-repr/Modules/_tkinter.c
==============================================================================
--- python/branches/py3k-short-float-repr/Modules/_tkinter.c	(original)
+++ python/branches/py3k-short-float-repr/Modules/_tkinter.c	Mon Apr 13 18:30:54 2009
@@ -33,8 +33,6 @@
 #include <windows.h>
 #endif
 
-#include "tkinter.h"
-
 /* Allow using this code in Python 2.[12] */
 #ifndef PyDoc_STRVAR
 #define PyDoc_STRVAR(name,str) static char name[] = str
@@ -69,6 +67,8 @@
 #include <tk.h>
 #endif
 
+#include "tkinter.h"
+
 /* For Tcl 8.2 and 8.3, CONST* is not defined (except on Cygwin). */
 #ifndef CONST84_RETURN
 #define CONST84_RETURN

Modified: python/branches/py3k-short-float-repr/Modules/mmapmodule.c
==============================================================================
--- python/branches/py3k-short-float-repr/Modules/mmapmodule.c	(original)
+++ python/branches/py3k-short-float-repr/Modules/mmapmodule.c	Mon Apr 13 18:30:54 2009
@@ -620,23 +620,23 @@
 static PyObject *
 mmap_move_method(mmap_object *self, PyObject *args)
 {
-	unsigned long dest, src, count;
+	unsigned long dest, src, cnt;
 	CHECK_VALID(NULL);
-	if (!PyArg_ParseTuple(args, "kkk:move", &dest, &src, &count) ||
+	if (!PyArg_ParseTuple(args, "kkk:move", &dest, &src, &cnt) ||
 	    !is_writable(self)) {
 		return NULL;
 	} else {
 		/* bounds check the values */
-		unsigned long pos = src > dest ? src : dest;
-		if (self->size < pos || count > self->size - pos) {
+		if (cnt < 0 || (cnt + dest) < cnt || (cnt + src) < cnt ||
+		   src < 0 || src > self->size || (src + cnt) > self->size ||
+		   dest < 0 || dest > self->size || (dest + cnt) > self->size) {
 			PyErr_SetString(PyExc_ValueError,
-					"source or destination out of range");
+				"source, destination, or count out of range");
 			return NULL;
-		} else {
-			memmove(self->data+dest, self->data+src, count);
-			Py_INCREF(Py_None);
-			return Py_None;
 		}
+		memmove(self->data+dest, self->data+src, cnt);
+		Py_INCREF(Py_None);
+		return Py_None;
 	}
 }
 

Modified: python/branches/py3k-short-float-repr/Modules/posixmodule.c
==============================================================================
--- python/branches/py3k-short-float-repr/Modules/posixmodule.c	(original)
+++ python/branches/py3k-short-float-repr/Modules/posixmodule.c	Mon Apr 13 18:30:54 2009
@@ -263,6 +263,7 @@
 #include <process.h>
 #endif
 #include "osdefs.h"
+#include <malloc.h>
 #include <windows.h>
 #include <shellapi.h>	/* for ShellExecute() */
 #endif /* _MSC_VER */
@@ -352,47 +353,15 @@
  * (all of this is to avoid globally modifying the CRT behaviour using
  * _set_invalid_parameter_handler() and _CrtSetReportMode())
  */
-#if _MSC_VER >= 1500 /* VS 2008 */
-typedef struct {
-        intptr_t osfhnd;
-        char osfile;
-        char pipech;
-        int lockinitflag;
-        CRITICAL_SECTION lock;
-#ifndef _SAFECRT_IMPL
-        char textmode : 7;
-        char unicode : 1;
-        char pipech2[2];
-        __int64 startpos;
-        BOOL utf8translations;
-        char dbcsBuffer;
-        BOOL dbcsBufferUsed;
-#endif  /* _SAFECRT_IMPL */
-    }   ioinfo;
-#elif _MSC_VER >= 1400  /* VS 2005 */
+/* The actual size of the structure is determined at runtime.
+ * Only the first items must be present.
+ */
 typedef struct {
         intptr_t osfhnd;
         char osfile;
-        char pipech;
-        int lockinitflag;
-        CRITICAL_SECTION lock;
-#ifndef _SAFECRT_IMPL
-        char textmode : 7;
-        char unicode : 1;
-        char pipech2[2];
-        __int64 startpos;
-        BOOL utf8translations;
-#ifndef _DEBUG
-        /* padding hack.  8 byte extra length observed at
-         * runtime, for 32 and 64 bits when not in _DEBUG
-         */
-        __int32 _padding[2];
-#endif
-#endif  /* _SAFECRT_IMPL */
-    }   ioinfo;
-#endif
+} my_ioinfo;
 
-extern __declspec(dllimport) ioinfo * __pioinfo[];
+extern __declspec(dllimport) char * __pioinfo[];
 #define IOINFO_L2E 5
 #define IOINFO_ARRAY_ELTS   (1 << IOINFO_L2E)
 #define IOINFO_ARRAYS 64
@@ -406,6 +375,19 @@
 {
 	const int i1 = fd >> IOINFO_L2E;
 	const int i2 = fd & ((1 << IOINFO_L2E) - 1);
+    
+	static int sizeof_ioinfo = 0;
+
+	/* Determine the actual size of the ioinfo structure, 
+	 * as used by the CRT loaded in memory
+	 */
+	if (sizeof_ioinfo == 0 && __pioinfo[0] != NULL) {
+		sizeof_ioinfo = _msize(__pioinfo[0]) / IOINFO_ARRAY_ELTS;
+	}
+	if (sizeof_ioinfo == 0) {
+		/* This should not happen... */
+		goto fail;
+	}
 
 	/* See that it isn't a special CLEAR fileno */
 	if (fd != _NO_CONSOLE_FILENO) {
@@ -414,10 +396,13 @@
 		 */
 		if (0 <= i1 && i1 < IOINFO_ARRAYS && __pioinfo[i1] != NULL) {
 			/* finally, check that the file is open */
-			if (__pioinfo[i1][i2].osfile & FOPEN)
+			my_ioinfo* info = (my_ioinfo*)(__pioinfo[i1] + i2 * sizeof_ioinfo);
+			if (info->osfile & FOPEN) {
 				return 1;
+			}
 		}
 	}
+  fail:
 	errno = EBADF;
 	return 0;
 }
@@ -4168,9 +4153,15 @@
 static PyObject *
 posix_setuid(PyObject *self, PyObject *args)
 {
-	int uid;
-	if (!PyArg_ParseTuple(args, "i:setuid", &uid))
+	long uid_arg;
+	uid_t uid;
+	if (!PyArg_ParseTuple(args, "l:setuid", &uid_arg))
+		return NULL;
+	uid = uid_arg;
+	if (uid != uid_arg) {
+		PyErr_SetString(PyExc_OverflowError, "user id too big");
 		return NULL;
+	}
 	if (setuid(uid) < 0)
 		return posix_error();
 	Py_INCREF(Py_None);
@@ -4187,10 +4178,16 @@
 static PyObject *
 posix_seteuid (PyObject *self, PyObject *args)
 {
-	int euid;
-	if (!PyArg_ParseTuple(args, "i", &euid)) {
+	long euid_arg;
+	uid_t euid;
+	if (!PyArg_ParseTuple(args, "l", &euid_arg))
+		return NULL;
+	euid = euid_arg;
+	if (euid != euid_arg) {
+		PyErr_SetString(PyExc_OverflowError, "user id too big");
 		return NULL;
-	} else if (seteuid(euid) < 0) {
+	}
+	if (seteuid(euid) < 0) {
 		return posix_error();
 	} else {
 		Py_INCREF(Py_None);
@@ -4207,10 +4204,16 @@
 static PyObject *
 posix_setegid (PyObject *self, PyObject *args)
 {
-	int egid;
-	if (!PyArg_ParseTuple(args, "i", &egid)) {
+	long egid_arg;
+	gid_t egid;
+	if (!PyArg_ParseTuple(args, "l", &egid_arg))
+		return NULL;
+	egid = egid_arg;
+	if (egid != egid_arg) {
+		PyErr_SetString(PyExc_OverflowError, "group id too big");
 		return NULL;
-	} else if (setegid(egid) < 0) {
+	}
+	if (setegid(egid) < 0) {
 		return posix_error();
 	} else {
 		Py_INCREF(Py_None);
@@ -4227,10 +4230,17 @@
 static PyObject *
 posix_setreuid (PyObject *self, PyObject *args)
 {
-	int ruid, euid;
-	if (!PyArg_ParseTuple(args, "ii", &ruid, &euid)) {
+	long ruid_arg, euid_arg;
+	uid_t ruid, euid;
+	if (!PyArg_ParseTuple(args, "ll", &ruid_arg, &euid_arg))
 		return NULL;
-	} else if (setreuid(ruid, euid) < 0) {
+	ruid = ruid_arg;
+	euid = euid_arg;
+	if (euid != euid_arg || ruid != ruid_arg) {
+		PyErr_SetString(PyExc_OverflowError, "user id too big");
+		return NULL;
+	}
+	if (setreuid(ruid, euid) < 0) {
 		return posix_error();
 	} else {
 		Py_INCREF(Py_None);
@@ -4247,10 +4257,17 @@
 static PyObject *
 posix_setregid (PyObject *self, PyObject *args)
 {
-	int rgid, egid;
-	if (!PyArg_ParseTuple(args, "ii", &rgid, &egid)) {
+	long rgid_arg, egid_arg;
+	gid_t rgid, egid;
+	if (!PyArg_ParseTuple(args, "ll", &rgid_arg, &egid_arg))
+		return NULL;
+	rgid = rgid_arg;
+	egid = egid_arg;
+	if (egid != egid_arg || rgid != rgid_arg) {
+		PyErr_SetString(PyExc_OverflowError, "group id too big");
 		return NULL;
-	} else if (setregid(rgid, egid) < 0) {
+	}
+	if (setregid(rgid, egid) < 0) {
 		return posix_error();
 	} else {
 		Py_INCREF(Py_None);
@@ -4267,9 +4284,15 @@
 static PyObject *
 posix_setgid(PyObject *self, PyObject *args)
 {
-	int gid;
-	if (!PyArg_ParseTuple(args, "i:setgid", &gid))
+	long gid_arg;
+	gid_t gid;
+	if (!PyArg_ParseTuple(args, "l:setgid", &gid_arg))
+		return NULL;
+	gid = gid_arg;
+	if (gid != gid_arg) {
+		PyErr_SetString(PyExc_OverflowError, "group id too big");
 		return NULL;
+	}
 	if (setgid(gid) < 0)
 		return posix_error();
 	Py_INCREF(Py_None);

Modified: python/branches/py3k-short-float-repr/Modules/readline.c
==============================================================================
--- python/branches/py3k-short-float-repr/Modules/readline.c	(original)
+++ python/branches/py3k-short-float-repr/Modules/readline.c	Mon Apr 13 18:30:54 2009
@@ -693,13 +693,13 @@
 	r = PyObject_CallFunction(completion_display_matches_hook,
 				  "sOi", matches[0], m, max_length);
 
-	Py_DECREF(m), m=NULL;
+	Py_DECREF(m); m=NULL;
 	
 	if (r == NULL ||
 		(r != Py_None && PyLong_AsLong(r) == -1 && PyErr_Occurred())) {
 		goto error;
 	}
-	Py_XDECREF(r), r=NULL;
+	Py_XDECREF(r); r=NULL;
 
 	if (0) {
 	error:

Modified: python/branches/py3k-short-float-repr/Modules/tkinter.h
==============================================================================
--- python/branches/py3k-short-float-repr/Modules/tkinter.h	(original)
+++ python/branches/py3k-short-float-repr/Modules/tkinter.h	Mon Apr 13 18:30:54 2009
@@ -2,7 +2,9 @@
 #define TKINTER_H
 
 /* This header is used to share some macros between _tkinter.c and
- * tkappinit.c */
+ * tkappinit.c.
+ * Be sure to include tk.h before including this header so
+ * TK_VERSION_HEX is properly defined. */
 
 /* TK_RELEASE_LEVEL is always one of the following:
  *	TCL_ALPHA_RELEASE   0

Modified: python/branches/py3k-short-float-repr/Objects/bytearrayobject.c
==============================================================================
--- python/branches/py3k-short-float-repr/Objects/bytearrayobject.c	(original)
+++ python/branches/py3k-short-float-repr/Objects/bytearrayobject.c	Mon Apr 13 18:30:54 2009
@@ -1021,7 +1021,7 @@
 {
     if (self->ob_exports > 0) {
         PyErr_SetString(PyExc_SystemError,
-			"deallocated bytearray object has exported buffers");
+                        "deallocated bytearray object has exported buffers");
         PyErr_Print();
     }
     if (self->ob_bytes != 0) {
@@ -1451,6 +1451,13 @@
 }
 
 
+static PyObject *
+bytes_maketrans(PyObject *null, PyObject *args)
+{
+	return _Py_bytes_maketrans(args);
+}
+
+
 #define FORWARD 1
 #define REVERSE -1
 
@@ -2616,10 +2623,10 @@
 
     /* Try to determine the length of the argument. 32 is abitrary. */
     buf_size = _PyObject_LengthHint(arg, 32);
-	if (buf_size == -1) {
-		Py_DECREF(it);
-		return NULL;
-	}
+    if (buf_size == -1) {
+        Py_DECREF(it);
+        return NULL;
+    }
 
     bytes_obj = PyByteArray_FromStringAndSize(NULL, buf_size);
     if (bytes_obj == NULL)
@@ -3063,10 +3070,10 @@
 static PyObject *
 bytes_sizeof(PyByteArrayObject *self)
 {
-	Py_ssize_t res;
+    Py_ssize_t res;
 
-	res = sizeof(PyByteArrayObject) + self->ob_alloc * sizeof(char);
-	return PyLong_FromSsize_t(res);
+    res = sizeof(PyByteArrayObject) + self->ob_alloc * sizeof(char);
+    return PyLong_FromSsize_t(res);
 }
 
 static PySequenceMethods bytes_as_sequence = {
@@ -3131,6 +3138,8 @@
     {"ljust", (PyCFunction)stringlib_ljust, METH_VARARGS, ljust__doc__},
     {"lower", (PyCFunction)stringlib_lower, METH_NOARGS, _Py_lower__doc__},
     {"lstrip", (PyCFunction)bytes_lstrip, METH_VARARGS, lstrip__doc__},
+    {"maketrans", (PyCFunction)bytes_maketrans, METH_VARARGS|METH_STATIC,
+     _Py_maketrans__doc__},
     {"partition", (PyCFunction)bytes_partition, METH_O, partition__doc__},
     {"pop", (PyCFunction)bytes_pop, METH_VARARGS, pop__doc__},
     {"remove", (PyCFunction)bytes_remove, METH_O, remove__doc__},

Modified: python/branches/py3k-short-float-repr/Objects/bytes_methods.c
==============================================================================
--- python/branches/py3k-short-float-repr/Objects/bytes_methods.c	(original)
+++ python/branches/py3k-short-float-repr/Objects/bytes_methods.c	Mon Apr 13 18:30:54 2009
@@ -608,3 +608,70 @@
 	}
 }
 
+
+PyDoc_STRVAR_shared(_Py_maketrans__doc__,
+"B.maketrans(frm, to) -> translation table\n\
+\n\
+Return a translation table (a bytes object of length 256)\n\
+suitable for use in bytes.translate where each byte in frm is\n\
+mapped to the byte at the same position in to.\n\
+The strings frm and to must be of the same length.");
+
+static Py_ssize_t
+_getbuffer(PyObject *obj, Py_buffer *view)
+{
+    PyBufferProcs *buffer = Py_TYPE(obj)->tp_as_buffer;
+
+    if (buffer == NULL || buffer->bf_getbuffer == NULL)
+    {
+        PyErr_Format(PyExc_TypeError,
+                     "Type %.100s doesn't support the buffer API",
+                     Py_TYPE(obj)->tp_name);
+        return -1;
+    }
+
+    if (buffer->bf_getbuffer(obj, view, PyBUF_SIMPLE) < 0)
+            return -1;
+    return view->len;
+}
+
+PyObject *
+_Py_bytes_maketrans(PyObject *args)
+{
+	PyObject *frm, *to, *res = NULL;
+	Py_buffer bfrm, bto;
+	int i;
+	char *p;
+
+	bfrm.len = -1;
+	bto.len = -1;
+	
+	if (!PyArg_ParseTuple(args, "OO:maketrans", &frm, &to))
+		return NULL;
+	if (_getbuffer(frm, &bfrm) < 0)
+		return NULL;
+	if (_getbuffer(to, &bto) < 0)
+		goto done;
+	if (bfrm.len != bto.len) {
+		PyErr_Format(PyExc_ValueError,
+			     "maketrans arguments must have same length");
+		goto done;
+	}
+	res = PyBytes_FromStringAndSize(NULL, 256);
+	if (!res) {
+		goto done;
+	}
+	p = PyBytes_AS_STRING(res);
+	for (i = 0; i < 256; i++)
+		p[i] = i;
+	for (i = 0; i < bfrm.len; i++) {
+		p[(int)((char *)bfrm.buf)[i]] = ((char *)bto.buf)[i];
+	}
+
+  done:
+	if (bfrm.len != -1)
+		PyBuffer_Release(&bfrm);
+	if (bto.len != -1)
+		PyBuffer_Release(&bto);
+	return res;
+}

Modified: python/branches/py3k-short-float-repr/Objects/bytesobject.c
==============================================================================
--- python/branches/py3k-short-float-repr/Objects/bytesobject.c	(original)
+++ python/branches/py3k-short-float-repr/Objects/bytesobject.c	Mon Apr 13 18:30:54 2009
@@ -1951,6 +1951,12 @@
 }
 
 
+static PyObject *
+string_maketrans(PyObject *null, PyObject *args)
+{
+	return _Py_bytes_maketrans(args);
+}
+
 #define FORWARD 1
 #define REVERSE -1
 
@@ -2852,6 +2858,8 @@
 	{"ljust", (PyCFunction)stringlib_ljust, METH_VARARGS, ljust__doc__},
 	{"lower", (PyCFunction)stringlib_lower, METH_NOARGS, _Py_lower__doc__},
 	{"lstrip", (PyCFunction)string_lstrip, METH_VARARGS, lstrip__doc__},
+	{"maketrans", (PyCFunction)string_maketrans, METH_VARARGS|METH_STATIC,
+	 _Py_maketrans__doc__},
 	{"partition", (PyCFunction)string_partition, METH_O, partition__doc__},
 	{"replace", (PyCFunction)string_replace, METH_VARARGS, replace__doc__},
 	{"rfind", (PyCFunction)string_rfind, METH_VARARGS, rfind__doc__},

Modified: python/branches/py3k-short-float-repr/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k-short-float-repr/Objects/unicodeobject.c	(original)
+++ python/branches/py3k-short-float-repr/Objects/unicodeobject.c	Mon Apr 13 18:30:54 2009
@@ -7738,8 +7738,10 @@
     Py_ssize_t nchars;
     size_t nbytes;
 
-    if (len < 0)
-        len = 0;
+    if (len < 1) {
+        Py_INCREF(unicode_empty);
+        return (PyObject *)unicode_empty;
+    }
 
     if (len == 1 && PyUnicode_CheckExact(str)) {
         /* no repeat, return original string */
@@ -7751,7 +7753,7 @@
      * needed doesn't overflow size_t
      */
     nchars = len * str->length;
-    if (len && nchars / len != str->length) {
+    if (nchars / len != str->length) {
         PyErr_SetString(PyExc_OverflowError,
                         "repeated string is too long");
         return NULL;
@@ -7768,14 +7770,11 @@
 
     p = u->str;
 
-    if (str->length == 1 && len > 0) {
+    if (str->length == 1) {
         Py_UNICODE_FILL(p, str->str[0], len);
     } else {
-        Py_ssize_t done = 0; /* number of characters copied this far */
-        if (done < nchars) {
-            Py_UNICODE_COPY(p, str->str, str->length);
-            done = str->length;
-        }
+        Py_ssize_t done = str->length; /* number of characters copied this far */
+        Py_UNICODE_COPY(p, str->str, str->length);
         while (done < nchars) {
             Py_ssize_t n = (done <= nchars-done) ? done : nchars-done;
             Py_UNICODE_COPY(p+done, p, n);

Modified: python/branches/py3k-short-float-repr/Parser/asdl.py
==============================================================================
--- python/branches/py3k-short-float-repr/Parser/asdl.py	(original)
+++ python/branches/py3k-short-float-repr/Parser/asdl.py	Mon Apr 13 18:30:54 2009
@@ -405,7 +405,8 @@
     try:
         return parser.parse(tokens)
     except ASDLSyntaxError:
-        output(sys.exc_info()[1])
+        err = sys.exc_info()[1]
+        output(str(err))
         lines = buf.split("\n")
         output(lines[err.lineno - 1]) # lines starts at 0, files at 1
 
@@ -422,6 +423,8 @@
     for file in files:
         output(file)
         mod = parse(file)
+        if not mod:
+            break
         output("module", mod.name)
         output(len(mod.dfns), "definitions")
         if not check(mod):

Modified: python/branches/py3k-short-float-repr/Python/errors.c
==============================================================================
--- python/branches/py3k-short-float-repr/Python/errors.c	(original)
+++ python/branches/py3k-short-float-repr/Python/errors.c	Mon Apr 13 18:30:54 2009
@@ -279,7 +279,15 @@
 	tstate = PyThreadState_GET();
 	if (++tstate->recursion_depth > Py_GetRecursionLimit()) {
 	    --tstate->recursion_depth;
-	    PyErr_SetObject(PyExc_RuntimeError, PyExc_RecursionErrorInst);
+	    /* throw away the old exception... */
+	    Py_DECREF(*exc);
+	    Py_DECREF(*val);
+	    /* ... and use the recursion error instead */
+	    *exc = PyExc_RuntimeError;
+	    *val = PyExc_RecursionErrorInst;
+	    Py_INCREF(*exc);
+	    Py_INCREF(*val);
+	    /* just keeping the old traceback */
 	    return;
 	}
 	PyErr_NormalizeException(exc, val, tb);

Modified: python/branches/py3k-short-float-repr/Python/getargs.c
==============================================================================
--- python/branches/py3k-short-float-repr/Python/getargs.c	(original)
+++ python/branches/py3k-short-float-repr/Python/getargs.c	Mon Apr 13 18:30:54 2009
@@ -1147,7 +1147,7 @@
 			if ((Py_ssize_t)strlen(ptr) != size) {
 				Py_DECREF(s);
 				return converterr(
-					"(encoded string without NULL bytes)",
+					"encoded string without NULL bytes",
 					arg, msgbuf, bufsize);
 			}
 			*buffer = PyMem_NEW(char, size + 1);

Modified: python/branches/py3k-short-float-repr/Python/mysnprintf.c
==============================================================================
--- python/branches/py3k-short-float-repr/Python/mysnprintf.c	(original)
+++ python/branches/py3k-short-float-repr/Python/mysnprintf.c	Mon Apr 13 18:30:54 2009
@@ -1,5 +1,4 @@
 #include "Python.h"
-#include <ctype.h>
 
 /* snprintf() wrappers.  If the platform has vsnprintf, we use it, else we
    emulate it in a half-hearted way.  Even if the platform has it, we wrap

Modified: python/branches/py3k-short-float-repr/Tools/msi/msilib.py
==============================================================================
--- python/branches/py3k-short-float-repr/Tools/msi/msilib.py	(original)
+++ python/branches/py3k-short-float-repr/Tools/msi/msilib.py	Mon Apr 13 18:30:54 2009
@@ -5,7 +5,7 @@
 import win32com.client
 import pythoncom, pywintypes
 from win32com.client import constants
-import re, string, os, sets, glob, subprocess, sys, winreg, struct
+import re, string, os, sets, glob, subprocess, sys, _winreg, struct
 
 try:
     basestring
@@ -387,9 +387,9 @@
                      (r"Software\Microsoft\Win32SDK\Directories", "Install Dir"),
                     ]:
             try:
-                key = winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, k)
-                dir = winreg.QueryValueEx(key, v)[0]
-                winreg.CloseKey(key)
+                key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, k)
+                dir = _winreg.QueryValueEx(key, v)[0]
+                _winreg.CloseKey(key)
             except (WindowsError, IndexError):
                 continue
             cabarc = os.path.join(dir, r"Bin", "cabarc.exe")

Modified: python/branches/py3k-short-float-repr/setup.py
==============================================================================
--- python/branches/py3k-short-float-repr/setup.py	(original)
+++ python/branches/py3k-short-float-repr/setup.py	Mon Apr 13 18:30:54 2009
@@ -650,6 +650,42 @@
         # implementation independent wrapper for these; dbm/dumb.py provides
         # similar functionality (but slower of course) implemented in Python.
 
+        # Sleepycat^WOracle Berkeley DB interface.
+        #  http://www.oracle.com/database/berkeley-db/db/index.html
+        #
+        # This requires the Sleepycat^WOracle DB code. The supported versions
+        # are set below.  Visit the URL above to download
+        # a release.  Most open source OSes come with one or more
+        # versions of BerkeleyDB already installed.
+
+        max_db_ver = (4, 7)
+        min_db_ver = (3, 3)
+        db_setup_debug = False   # verbose debug prints from this script?
+
+        def allow_db_ver(db_ver):
+            """Returns a boolean if the given BerkeleyDB version is acceptable.
+
+            Args:
+              db_ver: A tuple of the version to verify.
+            """
+            if not (min_db_ver <= db_ver <= max_db_ver):
+                return False
+            return True
+
+        def gen_db_minor_ver_nums(major):
+            if major == 4:
+                for x in range(max_db_ver[1]+1):
+                    if allow_db_ver((4, x)):
+                        yield x
+            elif major == 3:
+                for x in (3,):
+                    if allow_db_ver((3, x)):
+                        yield x
+            else:
+                raise ValueError("unknown major BerkeleyDB version", major)
+
+        # construct a list of paths to look for the header file in on
+        # top of the normal inc_dirs.
         db_inc_paths = [
             '/usr/include/db4',
             '/usr/local/include/db4',
@@ -661,8 +697,124 @@
             '/sw/include/db4',
             '/sw/include/db3',
         ]
+        # 4.x minor number specific paths
+        for x in gen_db_minor_ver_nums(4):
+            db_inc_paths.append('/usr/include/db4%d' % x)
+            db_inc_paths.append('/usr/include/db4.%d' % x)
+            db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
+            db_inc_paths.append('/usr/local/include/db4%d' % x)
+            db_inc_paths.append('/pkg/db-4.%d/include' % x)
+            db_inc_paths.append('/opt/db-4.%d/include' % x)
+            # MacPorts default (http://www.macports.org/)
+            db_inc_paths.append('/opt/local/include/db4%d' % x)
+        # 3.x minor number specific paths
+        for x in gen_db_minor_ver_nums(3):
+            db_inc_paths.append('/usr/include/db3%d' % x)
+            db_inc_paths.append('/usr/local/BerkeleyDB.3.%d/include' % x)
+            db_inc_paths.append('/usr/local/include/db3%d' % x)
+            db_inc_paths.append('/pkg/db-3.%d/include' % x)
+            db_inc_paths.append('/opt/db-3.%d/include' % x)
+
+        # Add some common subdirectories for Sleepycat DB to the list,
+        # based on the standard include directories. This way DB3/4 gets
+        # picked up when it is installed in a non-standard prefix and
+        # the user has added that prefix into inc_dirs.
+        std_variants = []
+        for dn in inc_dirs:
+            std_variants.append(os.path.join(dn, 'db3'))
+            std_variants.append(os.path.join(dn, 'db4'))
+            for x in gen_db_minor_ver_nums(4):
+                std_variants.append(os.path.join(dn, "db4%d"%x))
+                std_variants.append(os.path.join(dn, "db4.%d"%x))
+            for x in gen_db_minor_ver_nums(3):
+                std_variants.append(os.path.join(dn, "db3%d"%x))
+                std_variants.append(os.path.join(dn, "db3.%d"%x))
+
+        db_inc_paths = std_variants + db_inc_paths
+        db_inc_paths = [p for p in db_inc_paths if os.path.exists(p)]
+
+        db_ver_inc_map = {}
+
+        class db_found(Exception): pass
+        try:
+            # See whether there is a Sleepycat header in the standard
+            # search path.
+            for d in inc_dirs + db_inc_paths:
+                f = os.path.join(d, "db.h")
+                if db_setup_debug: print("db: looking for db.h in", f)
+                if os.path.exists(f):
+                    f = open(f).read()
+                    m = re.search(r"#define\WDB_VERSION_MAJOR\W(\d+)", f)
+                    if m:
+                        db_major = int(m.group(1))
+                        m = re.search(r"#define\WDB_VERSION_MINOR\W(\d+)", f)
+                        db_minor = int(m.group(1))
+                        db_ver = (db_major, db_minor)
+
+                        # Avoid 4.6 prior to 4.6.21 due to a BerkeleyDB bug
+                        if db_ver == (4, 6):
+                            m = re.search(r"#define\WDB_VERSION_PATCH\W(\d+)", f)
+                            db_patch = int(m.group(1))
+                            if db_patch < 21:
+                                print("db.h:", db_ver, "patch", db_patch,
+                                      "being ignored (4.6.x must be >= 4.6.21)")
+                                continue
+
+                        if ( (db_ver not in db_ver_inc_map) and
+                            allow_db_ver(db_ver) ):
+                            # save the include directory with the db.h version
+                            # (first occurrence only)
+                            db_ver_inc_map[db_ver] = d
+                            if db_setup_debug:
+                                print("db.h: found", db_ver, "in", d)
+                        else:
+                            # we already found a header for this library version
+                            if db_setup_debug: print("db.h: ignoring", d)
+                    else:
+                        # ignore this header, it didn't contain a version number
+                        if db_setup_debug:
+                            print("db.h: no version number version in", d)
+
+            db_found_vers = list(db_ver_inc_map.keys())
+            db_found_vers.sort()
+
+            while db_found_vers:
+                db_ver = db_found_vers.pop()
+                db_incdir = db_ver_inc_map[db_ver]
+
+                # check lib directories parallel to the location of the header
+                db_dirs_to_check = [
+                    db_incdir.replace("include", 'lib64'),
+                    db_incdir.replace("include", 'lib'),
+                ]
+                db_dirs_to_check = list(filter(os.path.isdir, db_dirs_to_check))
+
+                # Look for a version specific db-X.Y before an ambiguoius dbX
+                # XXX should we -ever- look for a dbX name?  Do any
+                # systems really not name their library by version and
+                # symlink to more general names?
+                for dblib in (('db-%d.%d' % db_ver),
+                              ('db%d%d' % db_ver),
+                              ('db%d' % db_ver[0])):
+                    dblib_file = self.compiler.find_library_file(
+                                    db_dirs_to_check + lib_dirs, dblib )
+                    if dblib_file:
+                        dblib_dir = [ os.path.abspath(os.path.dirname(dblib_file)) ]
+                        raise db_found
+                    else:
+                        if db_setup_debug: print("db lib: ", dblib, "not found")
 
-        db_incs = None
+        except db_found:
+            if db_setup_debug:
+                print("bsddb using BerkeleyDB lib:", db_ver, dblib)
+                print("bsddb lib dir:", dblib_dir, " inc dir:", db_incdir)
+            db_incs = [db_incdir]
+            dblibs = [dblib]
+        else:
+            if db_setup_debug: print("db: no appropriate library found")
+            db_incs = None
+            dblibs = []
+            dblib_dir = None
 
         # The sqlite interface
         sqlite_setup_debug = False   # verbose debug prints from this script?
@@ -1501,9 +1653,12 @@
           ext_modules=[Extension('_struct', ['_struct.c'])],
 
           # Scripts to install
-          scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
-                     'Tools/scripts/2to3',
-                     'Lib/smtpd.py']
+          # Commented out because we don't want them to override the 2.x
+          # ones. See #1590.
+          scripts = []
+          #scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
+          #           'Tools/scripts/2to3',
+          #           'Lib/smtpd.py']
         )
 
 # --install-platlib


More information about the Python-checkins mailing list