[Python-checkins] r74695 - in python/branches/tk_and_idle_maintenance: Doc/c-api/buffer.rst Doc/conf.py Doc/library/codecs.rst Doc/library/constants.rst Doc/library/ctypes.rst Doc/library/ftplib.rst Doc/library/marshal.rst Doc/library/math.rst Doc/library/optparse.rst Doc/library/os.rst Doc/library/signal.rst Doc/library/socketserver.rst Doc/library/stdtypes.rst Doc/library/string.rst Doc/library/thread.rst Doc/library/unittest.rst Doc/library/urllib.rst Doc/library/warnings.rst Doc/reference/datamodel.rst Doc/tutorial/classes.rst Doc/tutorial/errors.rst Doc/tutorial/inputoutput.rst Doc/tutorial/introduction.rst Lib/Cookie.py Lib/SimpleXMLRPCServer.py Lib/decimal.py Lib/httplib.py Lib/new.py Lib/plat-mac/aepack.py Lib/plat-mac/applesingle.py Lib/plat-mac/buildtools.py Lib/plat-mac/bundlebuilder.py Lib/plat-mac/macresource.py Lib/tarfile.py Lib/test/decimaltestdata/extra.decTest Lib/test/test_aepack.py Lib/test/test_bytes.py Lib/test/test_descr.py Lib/test/test_funcattrs.py Lib/test/test_io.py Lib/test/test_platform.py Lib/test/test_tarfile.py Lib/test/test_unittest.py Lib/test/test_xmlrpc.py Lib/types.py Lib/unittest/case.py Lib/webbrowser.py Lib/xmlrpclib.py Mac/scripts/BuildApplet.py Makefile.pre.in Misc/ACKS Misc/NEWS Modules/_io/textio.c Objects/bytearrayobject.c Objects/classobject.c Objects/funcobject.c Objects/stringobject.c Objects/unicodeobject.c README configure configure.in pyconfig.h.in

guilherme.polo python-checkins at python.org
Sun Sep 6 23:23:19 CEST 2009


Author: guilherme.polo
Date: Sun Sep  6 23:23:17 2009
New Revision: 74695

Log:
Merged revisions 74542-74550,74553-74556,74558,74564,74569-74571,74575,74578,74581,74588,74590,74603-74604,74608,74614,74616-74618,74621,74625,74631-74633,74635-74637,74640,74643-74644,74647,74650,74652-74653,74655-74656,74666-74667,74671-74673,74677,74684 via svnmerge from 
svn+ssh://pythondev/python/trunk

........
  r74542 | georg.brandl | 2009-08-23 18:28:56 -0300 (Sun, 23 Aug 2009) | 1 line
  
  Restore alphabetic order.
........
  r74543 | kristjan.jonsson | 2009-08-24 08:39:31 -0300 (Mon, 24 Aug 2009) | 2 lines
  
  issue 6769
  fix a mistake in instantiatiating the HTTPSConnection class.
........
  r74544 | georg.brandl | 2009-08-24 14:12:30 -0300 (Mon, 24 Aug 2009) | 1 line
  
  #6775: fix python.org URLs in README.
........
  r74545 | georg.brandl | 2009-08-24 14:14:29 -0300 (Mon, 24 Aug 2009) | 1 line
  
  #6772: mention utf-8 as utf8 alias.
........
  r74546 | georg.brandl | 2009-08-24 14:20:40 -0300 (Mon, 24 Aug 2009) | 1 line
  
  #6725: spell "namespace" consistently.
........
  r74547 | georg.brandl | 2009-08-24 14:22:05 -0300 (Mon, 24 Aug 2009) | 1 line
  
  #6718: fix example.
........
  r74548 | georg.brandl | 2009-08-24 14:24:27 -0300 (Mon, 24 Aug 2009) | 1 line
  
  #6677: mention "deleting" as an alias for removing files.
........
  r74549 | benjamin.peterson | 2009-08-24 14:42:36 -0300 (Mon, 24 Aug 2009) | 1 line
  
  fix pdf building by teaching latex the right encoding package
........
  r74550 | georg.brandl | 2009-08-24 14:48:40 -0300 (Mon, 24 Aug 2009) | 1 line
  
  #6677: note that rmdir only removes empty directories.
........
  r74553 | r.david.murray | 2009-08-26 22:04:59 -0300 (Wed, 26 Aug 2009) | 2 lines
  
  Remove leftover text from end of sentence.
........
  r74554 | georg.brandl | 2009-08-27 15:59:02 -0300 (Thu, 27 Aug 2009) | 1 line
  
  Typo fix.
........
  r74555 | georg.brandl | 2009-08-27 16:02:43 -0300 (Thu, 27 Aug 2009) | 1 line
  
  #6787: reference fix.
........
  r74556 | kristjan.jonsson | 2009-08-27 19:20:21 -0300 (Thu, 27 Aug 2009) | 2 lines
  
  issue 6275
  Add an "exc_value" attribute to the _AssertRaisesContext context manager in the unittest package.  This allows further tests on the exception that was raised after the context manager exits.
........
  r74558 | kristjan.jonsson | 2009-08-27 20:13:18 -0300 (Thu, 27 Aug 2009) | 2 lines
  
  Issue 6654
  Allow the XML-RPC server to use the HTTP request path when dispatching.  Added a MultiPathXMLRPCServer class that uses the feature, plus unit tests.
........
  r74564 | mark.dickinson | 2009-08-28 10:25:02 -0300 (Fri, 28 Aug 2009) | 3 lines
  
  Issue #6794:  Fix handling of NaNs in Decimal.compare_total and
  Decimal.compare_total_mag.
........
  r74569 | benjamin.peterson | 2009-08-28 13:48:03 -0300 (Fri, 28 Aug 2009) | 1 line
  
  restricted environments are no more
........
  r74570 | benjamin.peterson | 2009-08-28 13:49:56 -0300 (Fri, 28 Aug 2009) | 1 line
  
  remove more code for restricted execution
........
  r74571 | lars.gustaebel | 2009-08-28 16:23:44 -0300 (Fri, 28 Aug 2009) | 7 lines
  
  Issue #6054: Do not normalize stored pathnames.
  
  No longer use tarfile.normpath() on pathnames. Store pathnames
  unchanged, i.e. do not remove "./", "../" and "//" occurrences.
  However, still convert absolute to relative paths.
........
  r74575 | mark.dickinson | 2009-08-28 17:46:24 -0300 (Fri, 28 Aug 2009) | 1 line
  
  Silence gcc 'comparison always false' warning
........
  r74578 | tarek.ziade | 2009-08-29 10:33:21 -0300 (Sat, 29 Aug 2009) | 1 line
  
  fixed #6801: symmetric_difference_update also accepts pipe
........
  r74581 | amaury.forgeotdarc | 2009-08-29 15:14:40 -0300 (Sat, 29 Aug 2009) | 3 lines
  
  #6750: TextIOWrapped could duplicate output when several threads write to it.
  this affect text files opened with io.open(), and the print() function of py3k
........
  r74588 | georg.brandl | 2009-08-30 05:35:01 -0300 (Sun, 30 Aug 2009) | 1 line
  
  #6803: fix old name.
........
  r74590 | georg.brandl | 2009-08-30 08:51:53 -0300 (Sun, 30 Aug 2009) | 1 line
  
  #6801: fix copy-paste oversight.
........
  r74603 | georg.brandl | 2009-08-31 03:38:29 -0300 (Mon, 31 Aug 2009) | 1 line
  
  other -> others where multiple arguments are accepted.
........
  r74604 | mark.dickinson | 2009-08-31 11:46:07 -0300 (Mon, 31 Aug 2009) | 1 line
  
  Issue #6297: Add autogenerated Misc/python.pc file to make distclean target.  Thanks Jerry Chen.
........
  r74608 | senthil.kumaran | 2009-08-31 13:40:27 -0300 (Mon, 31 Aug 2009) | 3 lines
  
  Doc fix for the issue2637.
........
  r74614 | georg.brandl | 2009-09-01 04:40:54 -0300 (Tue, 01 Sep 2009) | 1 line
  
  #6813: better documentation for numberless string formats.
........
  r74616 | georg.brandl | 2009-09-01 04:46:26 -0300 (Tue, 01 Sep 2009) | 1 line
  
  #6808: clarification.
........
  r74617 | georg.brandl | 2009-09-01 04:53:37 -0300 (Tue, 01 Sep 2009) | 1 line
  
  #6765: hint that log(x, base) is not very sophisticated.
........
  r74618 | georg.brandl | 2009-09-01 05:00:47 -0300 (Tue, 01 Sep 2009) | 1 line
  
  #6810: add a link to the section about frame objects instead of just a description where to find it.
........
  r74621 | georg.brandl | 2009-09-01 05:06:03 -0300 (Tue, 01 Sep 2009) | 1 line
  
  #6638: fix wrong parameter name and markup a class.
........
  r74625 | benjamin.peterson | 2009-09-01 19:27:57 -0300 (Tue, 01 Sep 2009) | 1 line
  
  remove the check that classmethod's argument is a callable
........
  r74631 | georg.brandl | 2009-09-02 17:37:16 -0300 (Wed, 02 Sep 2009) | 1 line
  
  #6821: fix signature of PyBuffer_Release().
........
  r74632 | georg.brandl | 2009-09-03 04:27:26 -0300 (Thu, 03 Sep 2009) | 1 line
  
  #6828: fix wrongly highlighted blocks.
........
  r74633 | georg.brandl | 2009-09-03 09:31:39 -0300 (Thu, 03 Sep 2009) | 1 line
  
  #6757: complete the list of types that marshal can serialize.
........
  r74635 | armin.rigo | 2009-09-03 16:40:07 -0300 (Thu, 03 Sep 2009) | 2 lines
  
  Found the next crasher by thinking about this logic in PyPy.
........
  r74636 | armin.rigo | 2009-09-03 16:42:03 -0300 (Thu, 03 Sep 2009) | 3 lines
  
  Does not terminate: consume all memory without responding to Ctrl-C.
  I am not too sure why, but you can surely find out by gdb'ing a bit...
........
  r74637 | armin.rigo | 2009-09-03 16:45:27 -0300 (Thu, 03 Sep 2009) | 4 lines
  
  Sorry, sorry!  Ignore my previous two commits.  I mixed up the version
  of python with which I tried running the crashers.  They don't crash
  the current HEAD.
........
  r74640 | brett.cannon | 2009-09-03 18:25:21 -0300 (Thu, 03 Sep 2009) | 7 lines
  
  test_platform fails on OS X Snow Leopard because the UNIX command to get the
  canonical version, sw_vers, leaves off trailing zeros in the version number
  (e.g. 10.6 instead of 10.6.0). Test now compensates by tacking on extra zeros
  for the test comparison.
  
  Fixes issue #6806.
........
  r74643 | georg.brandl | 2009-09-04 03:59:20 -0300 (Fri, 04 Sep 2009) | 2 lines
  
  Issue #2666: Handle BROWSER environment variable properly for unknown browser names in the webbrowser module.
........
  r74644 | georg.brandl | 2009-09-04 04:55:14 -0300 (Fri, 04 Sep 2009) | 1 line
  
  #5047: remove Monterey support from configure.
........
  r74647 | georg.brandl | 2009-09-04 05:17:04 -0300 (Fri, 04 Sep 2009) | 2 lines
  
  Issue #5275: In Cookie's Cookie.load(), properly handle non-string arguments as documented.
........
  r74650 | georg.brandl | 2009-09-04 08:19:34 -0300 (Fri, 04 Sep 2009) | 1 line
  
  #5101: add back tests to test_funcattrs that were lost during unittest conversion, and make some PEP8 cleanups.
........
  r74652 | georg.brandl | 2009-09-04 08:25:37 -0300 (Fri, 04 Sep 2009) | 1 line
  
  #6756: add some info about the "acct" parameter.
........
  r74653 | georg.brandl | 2009-09-04 08:32:18 -0300 (Fri, 04 Sep 2009) | 1 line
  
  #6777: dont discourage usage of Exception.args or promote usage of Exception.message.
........
  r74655 | chris.withers | 2009-09-04 13:12:32 -0300 (Fri, 04 Sep 2009) | 2 lines
  
  Fixes issue #6838: use a list to accumulate the value instead of repeatedly concatenating strings.
........
  r74656 | chris.withers | 2009-09-04 13:32:22 -0300 (Fri, 04 Sep 2009) | 1 line
  
  news entry matching r74655
........
  r74666 | georg.brandl | 2009-09-05 06:04:09 -0300 (Sat, 05 Sep 2009) | 1 line
  
  #6841: remove duplicated word.
........
  r74667 | mark.dickinson | 2009-09-05 07:27:00 -0300 (Sat, 05 Sep 2009) | 2 lines
  
  Add configure-time checks for gamma and error functions.
........
  r74671 | georg.brandl | 2009-09-05 13:47:17 -0300 (Sat, 05 Sep 2009) | 1 line
  
  #6843: add link from filterwarnings to where the meaning of the arguments is covered.
........
  r74672 | ronald.oussoren | 2009-09-06 07:00:26 -0300 (Sun, 06 Sep 2009) | 1 line
  
  Fix build issues on OSX 10.6 (issue 6802)
........
  r74673 | mark.dickinson | 2009-09-06 07:03:31 -0300 (Sun, 06 Sep 2009) | 3 lines
  
  Issue #6846: bytearray.pop was returning ints in the range [-128, 128)
  instead of [0, 256).  Thanks Hagen Fürstenau for the report and fix.
........
  r74677 | mark.dickinson | 2009-09-06 07:32:21 -0300 (Sun, 06 Sep 2009) | 1 line
  
  Issue #6847: s/bytes/bytearray/ in some bytearray error messages.  Thanks Hagen Fürstenau.
........
  r74684 | ronald.oussoren | 2009-09-06 09:23:18 -0300 (Sun, 06 Sep 2009) | 2 lines
  
  Fix for issue 4937
........


Modified:
   python/branches/tk_and_idle_maintenance/   (props changed)
   python/branches/tk_and_idle_maintenance/Doc/c-api/buffer.rst
   python/branches/tk_and_idle_maintenance/Doc/conf.py
   python/branches/tk_and_idle_maintenance/Doc/library/codecs.rst
   python/branches/tk_and_idle_maintenance/Doc/library/constants.rst
   python/branches/tk_and_idle_maintenance/Doc/library/ctypes.rst
   python/branches/tk_and_idle_maintenance/Doc/library/ftplib.rst
   python/branches/tk_and_idle_maintenance/Doc/library/marshal.rst
   python/branches/tk_and_idle_maintenance/Doc/library/math.rst
   python/branches/tk_and_idle_maintenance/Doc/library/optparse.rst
   python/branches/tk_and_idle_maintenance/Doc/library/os.rst
   python/branches/tk_and_idle_maintenance/Doc/library/signal.rst
   python/branches/tk_and_idle_maintenance/Doc/library/socketserver.rst
   python/branches/tk_and_idle_maintenance/Doc/library/stdtypes.rst
   python/branches/tk_and_idle_maintenance/Doc/library/string.rst
   python/branches/tk_and_idle_maintenance/Doc/library/thread.rst
   python/branches/tk_and_idle_maintenance/Doc/library/unittest.rst
   python/branches/tk_and_idle_maintenance/Doc/library/urllib.rst
   python/branches/tk_and_idle_maintenance/Doc/library/warnings.rst
   python/branches/tk_and_idle_maintenance/Doc/reference/datamodel.rst
   python/branches/tk_and_idle_maintenance/Doc/tutorial/classes.rst
   python/branches/tk_and_idle_maintenance/Doc/tutorial/errors.rst
   python/branches/tk_and_idle_maintenance/Doc/tutorial/inputoutput.rst
   python/branches/tk_and_idle_maintenance/Doc/tutorial/introduction.rst
   python/branches/tk_and_idle_maintenance/Lib/Cookie.py
   python/branches/tk_and_idle_maintenance/Lib/SimpleXMLRPCServer.py
   python/branches/tk_and_idle_maintenance/Lib/decimal.py
   python/branches/tk_and_idle_maintenance/Lib/httplib.py
   python/branches/tk_and_idle_maintenance/Lib/new.py
   python/branches/tk_and_idle_maintenance/Lib/plat-mac/aepack.py
   python/branches/tk_and_idle_maintenance/Lib/plat-mac/applesingle.py
   python/branches/tk_and_idle_maintenance/Lib/plat-mac/buildtools.py
   python/branches/tk_and_idle_maintenance/Lib/plat-mac/bundlebuilder.py
   python/branches/tk_and_idle_maintenance/Lib/plat-mac/macresource.py
   python/branches/tk_and_idle_maintenance/Lib/tarfile.py
   python/branches/tk_and_idle_maintenance/Lib/test/decimaltestdata/extra.decTest
   python/branches/tk_and_idle_maintenance/Lib/test/test_aepack.py
   python/branches/tk_and_idle_maintenance/Lib/test/test_bytes.py
   python/branches/tk_and_idle_maintenance/Lib/test/test_descr.py
   python/branches/tk_and_idle_maintenance/Lib/test/test_funcattrs.py
   python/branches/tk_and_idle_maintenance/Lib/test/test_io.py
   python/branches/tk_and_idle_maintenance/Lib/test/test_platform.py
   python/branches/tk_and_idle_maintenance/Lib/test/test_tarfile.py
   python/branches/tk_and_idle_maintenance/Lib/test/test_unittest.py
   python/branches/tk_and_idle_maintenance/Lib/test/test_xmlrpc.py
   python/branches/tk_and_idle_maintenance/Lib/types.py
   python/branches/tk_and_idle_maintenance/Lib/unittest/case.py
   python/branches/tk_and_idle_maintenance/Lib/webbrowser.py
   python/branches/tk_and_idle_maintenance/Lib/xmlrpclib.py
   python/branches/tk_and_idle_maintenance/Mac/scripts/BuildApplet.py
   python/branches/tk_and_idle_maintenance/Makefile.pre.in
   python/branches/tk_and_idle_maintenance/Misc/ACKS
   python/branches/tk_and_idle_maintenance/Misc/NEWS
   python/branches/tk_and_idle_maintenance/Modules/_io/textio.c
   python/branches/tk_and_idle_maintenance/Objects/bytearrayobject.c
   python/branches/tk_and_idle_maintenance/Objects/classobject.c
   python/branches/tk_and_idle_maintenance/Objects/funcobject.c
   python/branches/tk_and_idle_maintenance/Objects/stringobject.c
   python/branches/tk_and_idle_maintenance/Objects/unicodeobject.c
   python/branches/tk_and_idle_maintenance/README
   python/branches/tk_and_idle_maintenance/configure
   python/branches/tk_and_idle_maintenance/configure.in
   python/branches/tk_and_idle_maintenance/pyconfig.h.in

Modified: python/branches/tk_and_idle_maintenance/Doc/c-api/buffer.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/c-api/buffer.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/c-api/buffer.rst	Sun Sep  6 23:23:17 2009
@@ -254,9 +254,9 @@
       +------------------------------+---------------------------------------------------+
 
 
-.. cfunction:: void PyBuffer_Release(PyObject *obj, Py_buffer *view)
+.. cfunction:: void PyBuffer_Release(Py_buffer *view)
 
-   Release the buffer *view* over *obj*.  This should be called when the buffer
+   Release the buffer *view*.  This should be called when the buffer
    is no longer being used as it may free memory from it.
 
 

Modified: python/branches/tk_and_idle_maintenance/Doc/conf.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/conf.py	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/conf.py	Sun Sep  6 23:23:17 2009
@@ -148,6 +148,9 @@
 # Documents to append as an appendix to all manuals.
 latex_appendices = ['glossary', 'about', 'license', 'copyright']
 
+# Get LaTeX to handle Unicode correctly
+latex_elements = {'inputenc': r'\usepackage[utf8x]{inputenc}'}
+
 # Options for the coverage checker
 # --------------------------------
 

Modified: python/branches/tk_and_idle_maintenance/Doc/library/codecs.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/codecs.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/codecs.rst	Sun Sep  6 23:23:17 2009
@@ -863,7 +863,8 @@
 name, together with a few common aliases, and the languages for which the
 encoding is likely used. Neither the list of aliases nor the list of languages
 is meant to be exhaustive. Notice that spelling alternatives that only differ in
-case or use a hyphen instead of an underscore are also valid aliases.
+case or use a hyphen instead of an underscore are also valid aliases; therefore,
+e.g. ``'utf-8'`` is a valid alias for the ``'utf_8'`` codec.
 
 Many of the character sets support the same languages. They vary in individual
 characters (e.g. whether the EURO SIGN is supported or not), and in the

Modified: python/branches/tk_and_idle_maintenance/Doc/library/constants.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/constants.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/constants.rst	Sun Sep  6 23:23:17 2009
@@ -62,7 +62,7 @@
 
    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
-   specified exit code, and when .
+   specified exit code.
 
 .. data:: copyright
           license

Modified: python/branches/tk_and_idle_maintenance/Doc/library/ctypes.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/ctypes.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/ctypes.rst	Sun Sep  6 23:23:17 2009
@@ -1601,7 +1601,7 @@
    The returned function prototype creates functions that use the standard C
    calling convention.  The function will release the GIL during the call.  If
    *use_errno* is set to True, the ctypes private copy of the system
-   :data:`errno` variable is exchanged with the real :data:`errno` value bafore
+   :data:`errno` variable is exchanged with the real :data:`errno` value before
    and after the call; *use_last_error* does the same for the Windows error
    code.
 

Modified: python/branches/tk_and_idle_maintenance/Doc/library/ftplib.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/ftplib.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/ftplib.rst	Sun Sep  6 23:23:17 2009
@@ -147,7 +147,8 @@
    ``'anonymous@'``.  This function should be called only once for each instance,
    after a connection has been established; it should not be called at all if a
    host and user were given when the instance was created.  Most FTP commands are
-   only allowed after the client has logged in.
+   only allowed after the client has logged in.  The *acct* parameter supplies
+   "accounting information"; few systems implement this.
 
 
 .. method:: FTP.abort()

Modified: python/branches/tk_and_idle_maintenance/Doc/library/marshal.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/marshal.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/marshal.rst	Sun Sep  6 23:23:17 2009
@@ -37,12 +37,14 @@
 
 Not all Python object types are supported; in general, only objects whose value
 is independent from a particular invocation of Python can be written and read by
-this module.  The following types are supported: ``None``, integers, long
-integers, floating point numbers, strings, Unicode objects, tuples, lists, sets,
-dictionaries, and code objects, where it should be understood that tuples, lists
-and dictionaries are only supported as long as the values contained therein are
-themselves supported; and recursive lists and dictionaries should not be written
-(they will cause infinite loops).
+this module.  The following types are supported: booleans, integers, long
+integers, floating point numbers, complex numbers, strings, Unicode objects,
+tuples, lists, sets, frozensets, dictionaries, and code objects, where it should
+be understood that tuples, lists, sets, frozensets and dictionaries are only
+supported as long as the values contained therein are themselves supported; and
+recursive lists, sets and dictionaries should not be written (they will cause
+infinite loops).  The singletons :const:`None`, :const:`Ellipsis` and
+:exc:`StopIteration` can also be marshalled and unmarshalled.
 
 .. warning::
 

Modified: python/branches/tk_and_idle_maintenance/Doc/library/math.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/math.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/math.rst	Sun Sep  6 23:23:17 2009
@@ -166,8 +166,10 @@
 
 .. function:: log(x[, base])
 
-   Return the logarithm of *x* to the given *base*. If the *base* is not specified,
-   return the natural logarithm of *x* (that is, the logarithm to base *e*).
+   With one argument, return the natural logarithm of *x* (to base *e*).
+
+   With two arguments, return the logarithm of *x* to the given *base*,
+   calculated as ``log(x)/log(base)``.
 
    .. versionchanged:: 2.3
       *base* argument added.
@@ -183,7 +185,8 @@
 
 .. function:: log10(x)
 
-   Return the base-10 logarithm of *x*.
+   Return the base-10 logarithm of *x*.  This is usually more accurate
+   than ``log(x, 10)``.
 
 
 .. function:: pow(x, y)

Modified: python/branches/tk_and_idle_maintenance/Doc/library/optparse.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/optparse.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/optparse.rst	Sun Sep  6 23:23:17 2009
@@ -1171,19 +1171,20 @@
    the list of arguments to process (default: ``sys.argv[1:]``)
 
 ``values``
-   object to store option arguments in (default: a new instance of optparse.Values)
+   object to store option arguments in (default: a new instance of
+   :class:`optparse.Values`)
 
 and the return values are
 
 ``options``
-   the same object that was passed in as ``options``, or the optparse.Values
+   the same object that was passed in as ``values``, or the optparse.Values
    instance created by :mod:`optparse`
 
 ``args``
    the leftover positional arguments after all options have been processed
 
 The most common usage is to supply neither keyword argument.  If you supply
-``options``, it will be modified with repeated ``setattr()`` calls (roughly one
+``values``, it will be modified with repeated ``setattr()`` calls (roughly one
 for every option argument stored to an option destination) and returned by
 :meth:`parse_args`.
 

Modified: python/branches/tk_and_idle_maintenance/Doc/library/os.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/os.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/os.rst	Sun Sep  6 23:23:17 2009
@@ -1067,12 +1067,12 @@
 
 .. function:: remove(path)
 
-   Remove the file *path*.  If *path* is a directory, :exc:`OSError` is raised; see
-   :func:`rmdir` below to remove a directory.  This is identical to the
-   :func:`unlink` function documented below.  On Windows, attempting to remove a
-   file that is in use causes an exception to be raised; on Unix, the directory
-   entry is removed but the storage allocated to the file is not made available
-   until the original file is no longer in use. Availability: Unix,
+   Remove (delete) the file *path*.  If *path* is a directory, :exc:`OSError` is
+   raised; see :func:`rmdir` below to remove a directory.  This is identical to
+   the :func:`unlink` function documented below.  On Windows, attempting to
+   remove a file that is in use causes an exception to be raised; on Unix, the
+   directory entry is removed but the storage allocated to the file is not made
+   available until the original file is no longer in use. Availability: Unix,
    Windows.
 
 
@@ -1121,7 +1121,10 @@
 
 .. function:: rmdir(path)
 
-   Remove the directory *path*. Availability: Unix, Windows.
+   Remove (delete) the directory *path*.  Only works when the directory is
+   empty, otherwise, :exc:`OSError` is raised.  In order to remove whole
+   directory trees, :func:`shutil.rmtree` can be used.  Availability: Unix,
+   Windows.
 
 
 .. function:: stat(path)
@@ -1297,9 +1300,9 @@
 
 .. function:: unlink(path)
 
-   Remove the file *path*.  This is the same function as :func:`remove`; the
-   :func:`unlink` name is its traditional Unix name. Availability: Unix,
-   Windows.
+   Remove (delete) the file *path*.  This is the same function as
+   :func:`remove`; the :func:`unlink` name is its traditional Unix
+   name. Availability: Unix, Windows.
 
 
 .. function:: utime(path, times)

Modified: python/branches/tk_and_idle_maintenance/Doc/library/signal.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/signal.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/signal.rst	Sun Sep  6 23:23:17 2009
@@ -211,9 +211,9 @@
    exception to be raised.
 
    The *handler* is called with two arguments: the signal number and the current
-   stack frame (``None`` or a frame object; for a description of frame objects, see
-   the reference manual section on the standard type hierarchy or see the attribute
-   descriptions in the :mod:`inspect` module).
+   stack frame (``None`` or a frame object; for a description of frame objects,
+   see the :ref:`description in the type hierarchy <frame-objects>` or see the
+   attribute descriptions in the :mod:`inspect` module).
 
 
 .. _signal-example:

Modified: python/branches/tk_and_idle_maintenance/Doc/library/socketserver.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/socketserver.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/socketserver.rst	Sun Sep  6 23:23:17 2009
@@ -464,7 +464,7 @@
    import socket
    import sys
 
-   HOST, PORT = "localhost"
+   HOST, PORT = "localhost", 9999
    data = " ".join(sys.argv[1:])
 
    # SOCK_DGRAM is the socket type to use for UDP sockets

Modified: python/branches/tk_and_idle_maintenance/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/stdtypes.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/stdtypes.rst	Sun Sep  6 23:23:17 2009
@@ -1765,7 +1765,7 @@
    .. method:: update(other, ...)
                set |= other | ...
 
-      Update the set, adding elements from *other*.
+      Update the set, adding elements from all others.
 
       .. versionchanged:: 2.6
          Accepts multiple input iterables.
@@ -1773,7 +1773,7 @@
    .. method:: intersection_update(other, ...)
                set &= other & ...
 
-      Update the set, keeping only elements found in it and *other*.
+      Update the set, keeping only elements found in it and all others.
 
       .. versionchanged:: 2.6
          Accepts multiple input iterables.
@@ -2061,7 +2061,7 @@
 
       :func:`update` accepts either another dictionary object or an iterable of
       key/value pairs (as a tuple or other iterable of length two).  If keyword
-      arguments are specified, the dictionary is then is updated with those
+      arguments are specified, the dictionary is then updated with those
       key/value pairs: ``d.update(red=1, blue=2)``.
 
       .. versionchanged:: 2.4
@@ -2549,9 +2549,9 @@
 their implementation of the context management protocol. See the
 :mod:`contextlib` module for some examples.
 
-Python's :term:`generator`\s and the ``contextlib.contextfactory`` :term:`decorator`
+Python's :term:`generator`\s and the ``contextlib.contextmanager`` :term:`decorator`
 provide a convenient way to implement these protocols.  If a generator function is
-decorated with the ``contextlib.contextfactory`` decorator, it will return a
+decorated with the ``contextlib.contextmanager`` decorator, it will return a
 context manager implementing the necessary :meth:`__enter__` and
 :meth:`__exit__` methods, rather than the iterator produced by an undecorated
 generator function.

Modified: python/branches/tk_and_idle_maintenance/Doc/library/string.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/string.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/string.rst	Sun Sep  6 23:23:17 2009
@@ -220,7 +220,7 @@
 The grammar for a replacement field is as follows:
 
    .. productionlist:: sf
-      replacement_field: "{" `field_name` ["!" `conversion`] [":" `format_spec`] "}"
+      replacement_field: "{" [`field_name`] ["!" `conversion`] [":" `format_spec`] "}"
       field_name: arg_name ("." `attribute_name` | "[" `element_index` "]")*
       arg_name: (`identifier` | `integer`)?
       attribute_name: `identifier`
@@ -228,7 +228,7 @@
       conversion: "r" | "s"
       format_spec: <described in the next section>
 
-In less formal terms, the replacement field starts with a *field_name* that specifies
+In less formal terms, the replacement field can start with a *field_name* that specifies
 the object whose value is to be formatted and inserted
 into the output instead of the replacement field.
 The *field_name* is optionally followed by a  *conversion* field, which is
@@ -249,7 +249,7 @@
 
    "First, thou shalt count to {0}" # References first positional argument
    "Bring me a {}"                  # Implicitly references the first positional argument
-   "From {} to {}"                  # Same as "From {0] to {1}"
+   "From {} to {}"                  # Same as "From {0} to {1}"
    "My quest is {name}"             # References keyword argument 'name'
    "Weight in tons {0.weight}"      # 'weight' attribute of first positional arg
    "Units destroyed: {players[0]}"  # First element of keyword argument 'players'.

Modified: python/branches/tk_and_idle_maintenance/Doc/library/thread.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/thread.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/thread.rst	Sun Sep  6 23:23:17 2009
@@ -156,7 +156,7 @@
   module is available, interrupts always go to the main thread.)
 
 * Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is
-  equivalent to calling :func:`exit`.
+  equivalent to calling :func:`thread.exit`.
 
 * Not all built-in functions that may block waiting for I/O allow other threads
   to run.  (The most popular ones (:func:`time.sleep`, :meth:`file.read`,

Modified: python/branches/tk_and_idle_maintenance/Doc/library/unittest.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/unittest.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/unittest.rst	Sun Sep  6 23:23:17 2009
@@ -888,6 +888,10 @@
          with self.failUnlessRaises(some_error_class):
              do_something()
 
+      The context manager will store the caught exception object in its
+      :attr:`exc_value` attribute.  This can be useful if the intention
+      is to perform additional checks on the exception raised.
+
       .. versionchanged:: 2.7
          Added the ability to use :meth:`assertRaises` as a context manager.
 

Modified: python/branches/tk_and_idle_maintenance/Doc/library/urllib.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/urllib.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/urllib.rst	Sun Sep  6 23:23:17 2009
@@ -203,9 +203,10 @@
 .. function:: quote(string[, safe])
 
    Replace special characters in *string* using the ``%xx`` escape. Letters,
-   digits, and the characters ``'_.-'`` are never quoted. The optional *safe*
-   parameter specifies additional characters that should not be quoted --- its
-   default value is ``'/'``.
+   digits, and the characters ``'_.-'`` are never quoted. By default, this
+   function is intended for quoting the path section of the URL.The optional
+   *safe* parameter specifies additional characters that should not be quoted
+   --- its default value is ``'/'``.
 
    Example: ``quote('/~connolly/')`` yields ``'/%7econnolly/'``.
 

Modified: python/branches/tk_and_idle_maintenance/Doc/library/warnings.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/library/warnings.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/library/warnings.rst	Sun Sep  6 23:23:17 2009
@@ -1,4 +1,3 @@
-
 :mod:`warnings` --- Warning control
 ===================================
 
@@ -129,16 +128,16 @@
   +---------------+----------------------------------------------+
 
 * *message* is a string containing a regular expression that the warning message
-  must match (the match is compiled to always be  case-insensitive)
+  must match (the match is compiled to always be case-insensitive).
 
 * *category* is a class (a subclass of :exc:`Warning`) of which the warning
-  category must be a subclass in order to match
+  category must be a subclass in order to match.
 
 * *module* is a string containing a regular expression that the module name must
-  match (the match is compiled to be case-sensitive)
+  match (the match is compiled to be case-sensitive).
 
 * *lineno* is an integer that the line number where the warning occurred must
-  match, or ``0`` to match all line numbers
+  match, or ``0`` to match all line numbers.
 
 Since the :exc:`Warning` class is derived from the built-in :exc:`Exception`
 class, to turn a warning into an error we simply raise ``category(message)``.
@@ -299,10 +298,11 @@
 
 .. function:: formatwarning(message, category, filename, lineno[, line])
 
-   Format a warning the standard way.  This returns a string  which may contain
-   embedded newlines and ends in a newline.  *line* is
-   a line of source code to be included in the warning message; if *line* is not supplied,
-   :func:`formatwarning` will try to read the line specified by *filename* and *lineno*.
+   Format a warning the standard way.  This returns a string which may contain
+   embedded newlines and ends in a newline.  *line* is a line of source code to
+   be included in the warning message; if *line* is not supplied,
+   :func:`formatwarning` will try to read the line specified by *filename* and
+   *lineno*.
 
    .. versionchanged:: 2.6
       Added the *line* argument.
@@ -310,10 +310,11 @@
 
 .. function:: filterwarnings(action[, message[, category[, module[, lineno[, append]]]]])
 
-   Insert an entry into the list of warnings filters.  The entry is inserted at the
-   front by default; if *append* is true, it is inserted at the end. This checks
-   the types of the arguments, compiles the message and module regular expressions,
-   and inserts them as a tuple in the  list of warnings filters.  Entries closer to
+   Insert an entry into the list of :ref:`warnings filter specifications
+   <warning-filter>`.  The entry is inserted at the front by default; if
+   *append* is true, it is inserted at the end.  This checks the types of the
+   arguments, compiles the *message* and *module* regular expressions, and
+   inserts them as a tuple in the list of warnings filters.  Entries closer to
    the front of the list override entries later in the list, if both match a
    particular warning.  Omitted arguments default to a value that matches
    everything.
@@ -321,10 +322,11 @@
 
 .. function:: simplefilter(action[, category[, lineno[, append]]])
 
-   Insert a simple entry into the list of warnings filters. The meaning of the
-   function parameters is as for :func:`filterwarnings`, but regular expressions
-   are not needed as the filter inserted always matches any message in any module
-   as long as the category and line number match.
+   Insert a simple entry into the list of :ref:`warnings filter specifications
+   <warning-filter>`.  The meaning of the function parameters is as for
+   :func:`filterwarnings`, but regular expressions are not needed as the filter
+   inserted always matches any message in any module as long as the category and
+   line number match.
 
 
 .. function:: resetwarnings()

Modified: python/branches/tk_and_idle_maintenance/Doc/reference/datamodel.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/reference/datamodel.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/reference/datamodel.rst	Sun Sep  6 23:23:17 2009
@@ -959,6 +959,8 @@
       If a code object represents a function, the first item in :attr:`co_consts` is
       the documentation string of the function, or ``None`` if undefined.
 
+   .. _frame-objects:
+
    Frame objects
       .. index:: object: frame
 

Modified: python/branches/tk_and_idle_maintenance/Doc/tutorial/classes.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/tutorial/classes.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/tutorial/classes.rst	Sun Sep  6 23:23:17 2009
@@ -50,8 +50,8 @@
 
 .. _tut-scopes:
 
-Python Scopes and Name Spaces
-=============================
+Python Scopes and Namespaces
+============================
 
 Before introducing classes, I first have to tell you something about Python's
 scope rules.  Class definitions play some neat tricks with namespaces, and you
@@ -86,7 +86,7 @@
 :keyword:`del` statement.  For example, ``del modname.the_answer`` will remove
 the attribute :attr:`the_answer` from the object named by ``modname``.
 
-Name spaces are created at different moments and have different lifetimes.  The
+Namespaces are created at different moments and have different lifetimes.  The
 namespace containing the built-in names is created when the Python interpreter
 starts up, and is never deleted.  The global namespace for a module is created
 when the module definition is read in; normally, module namespaces also last
@@ -331,9 +331,9 @@
 attribute that is a function object, a method object is created by packing
 (pointers to) the instance object and the function object just found together in
 an abstract object: this is the method object.  When the method object is called
-with an argument list, it is unpacked again, a new argument list is constructed
-from the instance object and the original argument list, and the function object
-is called with this new argument list.
+with an argument list, a new argument list is constructed from the instance
+object and the argument list, and the function object is called with this new
+argument list.
 
 
 .. _tut-remarks:

Modified: python/branches/tk_and_idle_maintenance/Doc/tutorial/errors.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/tutorial/errors.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/tutorial/errors.rst	Sun Sep  6 23:23:17 2009
@@ -165,14 +165,11 @@
 The except clause may specify a variable after the exception name (or tuple).
 The variable is bound to an exception instance with the arguments stored in
 ``instance.args``.  For convenience, the exception instance defines
-:meth:`__getitem__` and :meth:`__str__` so the arguments can be accessed or
-printed directly without having to reference ``.args``.
+:meth:`__str__` so the arguments can be printed directly without having to
+reference ``.args``.
 
-But use of ``.args`` is discouraged.  Instead, the preferred use is to pass a
-single argument to an exception (which can be a tuple if multiple arguments are
-needed) and have it bound to the ``message`` attribute.  One may also
-instantiate an exception first before raising it and add any attributes to it as
-desired. ::
+One may also instantiate an exception first before raising it and add any
+attributes to it as desired. ::
 
    >>> try:
    ...    raise Exception('spam', 'eggs')
@@ -288,28 +285,28 @@
        """Exception raised for errors in the input.
 
        Attributes:
-           expression -- input expression in which the error occurred
-           message -- explanation of the error
+           expr -- input expression in which the error occurred
+           msg  -- explanation of the error
        """
 
-       def __init__(self, expression, message):
-           self.expression = expression
-           self.message = message
+       def __init__(self, expr, msg):
+           self.expr = expr
+           self.msg = msg
 
    class TransitionError(Error):
        """Raised when an operation attempts a state transition that's not
        allowed.
 
        Attributes:
-           previous -- state at beginning of transition
+           prev -- state at beginning of transition
            next -- attempted new state
-           message -- explanation of why the specific transition is not allowed
+           msg  -- explanation of why the specific transition is not allowed
        """
 
-       def __init__(self, previous, next, message):
-           self.previous = previous
+       def __init__(self, prev, next, msg):
+           self.prev = prev
            self.next = next
-           self.message = message
+           self.msg = msg
 
 Most exceptions are defined with names that end in "Error," similar to the
 naming of the standard exceptions.

Modified: python/branches/tk_and_idle_maintenance/Doc/tutorial/inputoutput.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/tutorial/inputoutput.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/tutorial/inputoutput.rst	Sun Sep  6 23:23:17 2009
@@ -123,11 +123,11 @@
 
 Basic usage of the :meth:`str.format` method looks like this::
 
-   >>> print 'We are the {0} who say "{1}!"'.format('knights', 'Ni')
+   >>> print 'We are the {} who say "{}!"'.format('knights', 'Ni')
    We are the knights who say "Ni!"
 
 The brackets and characters within them (called format fields) are replaced with
-the objects passed into the :meth:`~str.format` method.  The number in the
+the objects passed into the :meth:`~str.format` method.  A number in the
 brackets refers to the position of the object passed into the
 :meth:`~str.format` method. ::
 
@@ -149,6 +149,15 @@
    ...                                                    other='Georg')
    The story of Bill, Manfred, and Georg.
 
+``'!s'`` (apply :func:`str`) and ``'!r'`` (apply :func:`repr`) can be used to
+convert the value before it is formatted. ::
+
+   >>> import math
+   >>> print 'The value of PI is approximately {}.'.format(math.pi)
+   The value of PI is approximately 3.14159265359.
+   >>> print 'The value of PI is approximately {!r}.'.format(math.pi)
+   The value of PI is approximately 3.141592653589793.
+
 An optional ``':'`` and format specifier can follow the field name. This allows
 greater control over how the value is formatted.  The following example
 truncates Pi to three places after the decimal.

Modified: python/branches/tk_and_idle_maintenance/Doc/tutorial/introduction.rst
==============================================================================
--- python/branches/tk_and_idle_maintenance/Doc/tutorial/introduction.rst	(original)
+++ python/branches/tk_and_idle_maintenance/Doc/tutorial/introduction.rst	Sun Sep  6 23:23:17 2009
@@ -138,7 +138,6 @@
    4.0
    >>> abs(a)  # sqrt(a.real**2 + a.imag**2)
    5.0
-   >>>
 
 In interactive mode, the last printed expression is assigned to the variable
 ``_``.  This means that when you are using Python as a desk calculator, it is
@@ -152,7 +151,6 @@
    113.0625
    >>> round(_, 2)
    113.06
-   >>>
 
 This variable should be treated as read-only by the user.  Don't explicitly
 assign a value to it --- you would create an independent local variable with the
@@ -193,7 +191,9 @@
 
 Note that newlines still need to be embedded in the string using ``\n``; the
 newline following the trailing backslash is discarded.  This example would print
-the following::
+the following:
+
+.. code-block:: text
 
    This is a rather long string containing
    several lines of text just as you would do in C.
@@ -209,7 +209,9 @@
         -H hostname               Hostname to connect to
    """
 
-produces the following output::
+produces the following output:
+
+.. code-block:: text
 
    Usage: thingy [OPTIONS]
         -h                        Display this usage message
@@ -224,7 +226,9 @@
 
    print hello
 
-would print::
+would print:
+
+.. code-block:: text
 
    This is a rather long string containing\n\
    several lines of text much as you would do in C.

Modified: python/branches/tk_and_idle_maintenance/Lib/Cookie.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/Cookie.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/Cookie.py	Sun Sep  6 23:23:17 2009
@@ -624,7 +624,9 @@
         if type(rawdata) == type(""):
             self.__ParseString(rawdata)
         else:
-            self.update(rawdata)
+            # self.update() wouldn't call our custom __setitem__
+            for k, v in rawdata.items():
+                self[k] = v
         return
     # end load()
 

Modified: python/branches/tk_and_idle_maintenance/Lib/SimpleXMLRPCServer.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/SimpleXMLRPCServer.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/SimpleXMLRPCServer.py	Sun Sep  6 23:23:17 2009
@@ -161,8 +161,9 @@
     """Mix-in class that dispatches XML-RPC requests.
 
     This class is used to register XML-RPC method handlers
-    and then to dispatch them. There should never be any
-    reason to instantiate this class directly.
+    and then to dispatch them. This class doesn't need to be
+    instanced directly when used by SimpleXMLRPCServer but it
+    can be instanced when used by the MultiPathXMLRPCServer
     """
 
     def __init__(self, allow_none=False, encoding=None):
@@ -237,7 +238,7 @@
 
         self.funcs.update({'system.multicall' : self.system_multicall})
 
-    def _marshaled_dispatch(self, data, dispatch_method = None):
+    def _marshaled_dispatch(self, data, dispatch_method = None, path = None):
         """Dispatches an XML-RPC method from marshalled (XML) data.
 
         XML-RPC methods are dispatched from the marshalled (XML) data
@@ -499,7 +500,7 @@
             # check to see if a subclass implements _dispatch and dispatch
             # using that method if present.
             response = self.server._marshaled_dispatch(
-                    data, getattr(self, '_dispatch', None)
+                    data, getattr(self, '_dispatch', None), self.path
                 )
         except Exception, e: # This should only happen if the module is buggy
             # internal error, report as HTTP server error
@@ -596,6 +597,44 @@
             flags |= fcntl.FD_CLOEXEC
             fcntl.fcntl(self.fileno(), fcntl.F_SETFD, flags)
 
+class MultiPathXMLRPCServer(SimpleXMLRPCServer):
+    """Multipath XML-RPC Server
+    This specialization of SimpleXMLRPCServer allows the user to create
+    multiple Dispatcher instances and assign them to different
+    HTTP request paths.  This makes it possible to run two or more
+    'virtual XML-RPC servers' at the same port.
+    Make sure that the requestHandler accepts the paths in question.
+    """
+    def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler,
+                 logRequests=True, allow_none=False, encoding=None, bind_and_activate=True):
+
+        SimpleXMLRPCServer.__init__(self, addr, requestHandler, logRequests, allow_none,
+                                    encoding, bind_and_activate)
+        self.dispatchers = {}
+        self.allow_none = allow_none
+        self.encoding = encoding
+
+    def add_dispatcher(self, path, dispatcher):
+        self.dispatchers[path] = dispatcher
+        return dispatcher
+
+    def get_dispatcher(self, path):
+        return self.dispatchers[path]
+
+    def _marshaled_dispatch(self, data, dispatch_method = None, path = None):
+        try:
+            response = self.dispatchers[path]._marshaled_dispatch(
+               data, dispatch_method, path)
+        except:
+            # report low level exception back to server
+            # (each dispatcher should have handled their own
+            # exceptions)
+            exc_type, exc_value = sys.exc_info()[:2]
+            response = xmlrpclib.dumps(
+                xmlrpclib.Fault(1, "%s:%s" % (exc_type, exc_value)),
+                encoding=self.encoding, allow_none=self.allow_none)
+        return response
+
 class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher):
     """Simple handler for XML-RPC data passed through CGI."""
 

Modified: python/branches/tk_and_idle_maintenance/Lib/decimal.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/decimal.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/decimal.py	Sun Sep  6 23:23:17 2009
@@ -2736,12 +2736,15 @@
         other_nan = other._isnan()
         if self_nan or other_nan:
             if self_nan == other_nan:
-                if self._int < other._int:
+                # compare payloads as though they're integers
+                self_key = len(self._int), self._int
+                other_key = len(other._int), other._int
+                if self_key < other_key:
                     if sign:
                         return _One
                     else:
                         return _NegativeOne
-                if self._int > other._int:
+                if self_key > other_key:
                     if sign:
                         return _NegativeOne
                     else:

Modified: python/branches/tk_and_idle_maintenance/Lib/httplib.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/httplib.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/httplib.py	Sun Sep  6 23:23:17 2009
@@ -554,10 +554,7 @@
     def _read_chunked(self, amt):
         assert self.chunked != _UNKNOWN
         chunk_left = self.chunk_left
-        value = ''
-
-        # XXX This accumulates chunks by repeated string concatenation,
-        # which is not efficient as the number or size of chunks gets big.
+        value = []
         while True:
             if chunk_left is None:
                 line = self.fp.readline()
@@ -570,22 +567,22 @@
                     # close the connection as protocol synchronisation is
                     # probably lost
                     self.close()
-                    raise IncompleteRead(value)
+                    raise IncompleteRead(''.join(value))
                 if chunk_left == 0:
                     break
             if amt is None:
-                value += self._safe_read(chunk_left)
+                value.append(self._safe_read(chunk_left))
             elif amt < chunk_left:
-                value += self._safe_read(amt)
+                value.append(self._safe_read(amt))
                 self.chunk_left = chunk_left - amt
-                return value
+                return ''.join(value)
             elif amt == chunk_left:
-                value += self._safe_read(amt)
+                value.append(self._safe_read(amt))
                 self._safe_read(2)  # toss the CRLF at the end of the chunk
                 self.chunk_left = None
-                return value
+                return ''.join(value)
             else:
-                value += self._safe_read(chunk_left)
+                value.append(self._safe_read(chunk_left))
                 amt -= chunk_left
 
             # we read the whole chunk, get another
@@ -606,7 +603,7 @@
         # we read everything; close the "file"
         self.close()
 
-        return value
+        return ''.join(value)
 
     def _safe_read(self, amt):
         """Read the number of bytes requested, compensating for partial reads.

Modified: python/branches/tk_and_idle_maintenance/Lib/new.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/new.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/new.py	Sun Sep  6 23:23:17 2009
@@ -14,8 +14,4 @@
 from types import MethodType as instancemethod
 from types import ModuleType as module
 
-# CodeType is not accessible in restricted execution mode
-try:
-    from types import CodeType as code
-except ImportError:
-    pass
+from types import CodeType as code

Modified: python/branches/tk_and_idle_maintenance/Lib/plat-mac/aepack.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/plat-mac/aepack.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/plat-mac/aepack.py	Sun Sep  6 23:23:17 2009
@@ -58,7 +58,11 @@
 # Some python types we need in the packer:
 #
 AEDescType = AE.AEDescType
-FSSType = Carbon.File.FSSpecType
+try:
+    FSSType = Carbon.File.FSSpecType
+except AttributeError:
+    class FSSType:
+        pass
 FSRefType = Carbon.File.FSRefType
 AliasType = Carbon.File.AliasType
 

Modified: python/branches/tk_and_idle_maintenance/Lib/plat-mac/applesingle.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/plat-mac/applesingle.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/plat-mac/applesingle.py	Sun Sep  6 23:23:17 2009
@@ -119,8 +119,13 @@
     if not hasattr(infile, 'read'):
         if isinstance(infile, Carbon.File.Alias):
             infile = infile.ResolveAlias()[0]
-        if isinstance(infile, (Carbon.File.FSSpec, Carbon.File.FSRef)):
-            infile = infile.as_pathname()
+
+        if hasattr(Carbon.File, "FSSpec"):
+            if isinstance(infile, (Carbon.File.FSSpec, Carbon.File.FSRef)):
+                infile = infile.as_pathname()
+        else:
+            if isinstance(infile, Carbon.File.FSRef):
+                infile = infile.as_pathname()
         infile = open(infile, 'rb')
 
     asfile = AppleSingle(infile, verbose=verbose)

Modified: python/branches/tk_and_idle_maintenance/Lib/plat-mac/buildtools.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/plat-mac/buildtools.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/plat-mac/buildtools.py	Sun Sep  6 23:23:17 2009
@@ -15,7 +15,10 @@
 import MacOS
 import macostools
 import macresource
-import EasyDialogs
+try:
+    import EasyDialogs
+except ImportError:
+    EasyDialogs = None
 import shutil
 
 
@@ -67,9 +70,13 @@
         rsrcname=None, others=[], raw=0, progress="default", destroot=""):
 
     if progress == "default":
-        progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120)
-        progress.label("Compiling...")
-        progress.inc(0)
+        if EasyDialogs is None:
+            print "Compiling %s"%(os.path.split(filename)[1],)
+            process = None
+        else:
+            progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120)
+            progress.label("Compiling...")
+            progress.inc(0)
     # check for the script name being longer than 32 chars. This may trigger a bug
     # on OSX that can destroy your sourcefile.
     if '#' in os.path.split(filename)[1]:
@@ -119,7 +126,11 @@
     if MacOS.runtimemodel == 'macho':
         raise BuildError, "No updating yet for MachO applets"
     if progress:
-        progress = EasyDialogs.ProgressBar("Updating %s..."%os.path.split(filename)[1], 120)
+        if EasyDialogs is None:
+            print "Updating %s"%(os.path.split(filename)[1],)
+            progress = None
+        else:
+            progress = EasyDialogs.ProgressBar("Updating %s..."%os.path.split(filename)[1], 120)
     else:
         progress = None
     if not output:

Modified: python/branches/tk_and_idle_maintenance/Lib/plat-mac/bundlebuilder.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/plat-mac/bundlebuilder.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/plat-mac/bundlebuilder.py	Sun Sep  6 23:23:17 2009
@@ -341,7 +341,6 @@
     "Python",  # the Python core library
     "Resources/English.lproj",
     "Resources/Info.plist",
-    "Resources/version.plist",
 ]
 
 def isFramework():

Modified: python/branches/tk_and_idle_maintenance/Lib/plat-mac/macresource.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/plat-mac/macresource.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/plat-mac/macresource.py	Sun Sep  6 23:23:17 2009
@@ -77,52 +77,38 @@
 def open_pathname(pathname, verbose=0):
     """Open a resource file given by pathname, possibly decoding an
     AppleSingle file"""
+    # No resource fork. We may be on OSX, and this may be either
+    # a data-fork based resource file or a AppleSingle file
+    # from the CVS repository.
     try:
-        refno = Res.FSpOpenResFile(pathname, 1)
+        refno = Res.FSOpenResourceFile(pathname, u'', 1)
     except Res.Error, arg:
-        if arg[0] in (-37, -39):
-            # No resource fork. We may be on OSX, and this may be either
-            # a data-fork based resource file or a AppleSingle file
-            # from the CVS repository.
-            try:
-                refno = Res.FSOpenResourceFile(pathname, u'', 1)
-            except Res.Error, arg:
-                if arg[0] != -199:
-                    # -199 is "bad resource map"
-                    raise
-            else:
-                return refno
-            # Finally try decoding an AppleSingle file
-            pathname = _decode(pathname, verbose=verbose)
-            refno = Res.FSOpenResourceFile(pathname, u'', 1)
-        else:
+        if arg[0] != -199:
+            # -199 is "bad resource map"
             raise
-    return refno
+    else:
+        return refno
+    # Finally try decoding an AppleSingle file
+    pathname = _decode(pathname, verbose=verbose)
+    refno = Res.FSOpenResourceFile(pathname, u'', 1)
 
 def resource_pathname(pathname, verbose=0):
     """Return the pathname for a resource file (either DF or RF based).
     If the pathname given already refers to such a file simply return it,
     otherwise first decode it."""
+    # No resource fork. We may be on OSX, and this may be either
+    # a data-fork based resource file or a AppleSingle file
+    # from the CVS repository.
     try:
-        refno = Res.FSpOpenResFile(pathname, 1)
-        Res.CloseResFile(refno)
+        refno = Res.FSOpenResourceFile(pathname, u'', 1)
     except Res.Error, arg:
-        if arg[0] in (-37, -39):
-            # No resource fork. We may be on OSX, and this may be either
-            # a data-fork based resource file or a AppleSingle file
-            # from the CVS repository.
-            try:
-                refno = Res.FSOpenResourceFile(pathname, u'', 1)
-            except Res.Error, arg:
-                if arg[0] != -199:
-                    # -199 is "bad resource map"
-                    raise
-            else:
-                return refno
-            # Finally try decoding an AppleSingle file
-            pathname = _decode(pathname, verbose=verbose)
-        else:
+        if arg[0] != -199:
+            # -199 is "bad resource map"
             raise
+    else:
+        return refno
+    # Finally try decoding an AppleSingle file
+    pathname = _decode(pathname, verbose=verbose)
     return pathname
 
 def open_error_resource():

Modified: python/branches/tk_and_idle_maintenance/Lib/tarfile.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/tarfile.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/tarfile.py	Sun Sep  6 23:23:17 2009
@@ -330,11 +330,6 @@
             perm.append("-")
     return "".join(perm)
 
-if os.sep != "/":
-    normpath = lambda path: os.path.normpath(path).replace(os.sep, "/")
-else:
-    normpath = os.path.normpath
-
 class TarError(Exception):
     """Base exception."""
     pass
@@ -956,7 +951,7 @@
         """Return the TarInfo's attributes as a dictionary.
         """
         info = {
-            "name":     normpath(self.name),
+            "name":     self.name,
             "mode":     self.mode & 07777,
             "uid":      self.uid,
             "gid":      self.gid,
@@ -964,7 +959,7 @@
             "mtime":    self.mtime,
             "chksum":   self.chksum,
             "type":     self.type,
-            "linkname": normpath(self.linkname) if self.linkname else "",
+            "linkname": self.linkname,
             "uname":    self.uname,
             "gname":    self.gname,
             "devmajor": self.devmajor,
@@ -1815,10 +1810,9 @@
         # Absolute paths are turned to relative paths.
         if arcname is None:
             arcname = name
-        arcname = normpath(arcname)
         drv, arcname = os.path.splitdrive(arcname)
-        while arcname[0:1] == "/":
-            arcname = arcname[1:]
+        arcname = arcname.replace(os.sep, "/")
+        arcname = arcname.lstrip("/")
 
         # Now, fill the TarInfo object with
         # information specific for the file.
@@ -1947,16 +1941,6 @@
             self._dbg(2, "tarfile: Skipped %r" % name)
             return
 
-        # Special case: The user wants to add the current
-        # working directory.
-        if name == ".":
-            if recursive:
-                if arcname == ".":
-                    arcname = ""
-                for f in os.listdir(name):
-                    self.add(f, os.path.join(arcname, f), recursive, exclude)
-            return
-
         self._dbg(1, name)
 
         # Create a TarInfo object from the file.
@@ -2123,9 +2107,8 @@
         # Fetch the TarInfo object for the given name
         # and build the destination pathname, replacing
         # forward slashes to platform specific separators.
-        if targetpath[-1:] == "/":
-            targetpath = targetpath[:-1]
-        targetpath = os.path.normpath(targetpath)
+        targetpath = targetpath.rstrip("/")
+        targetpath = targetpath.replace("/", os.sep)
 
         # Create all upper directories.
         upperdirs = os.path.dirname(targetpath)
@@ -2220,23 +2203,23 @@
           (platform limitation), we try to make a copy of the referenced file
           instead of a link.
         """
-        linkpath = tarinfo.linkname
         try:
             if tarinfo.issym():
-                os.symlink(linkpath, targetpath)
+                os.symlink(tarinfo.linkname, targetpath)
             else:
                 # See extract().
                 os.link(tarinfo._link_target, targetpath)
         except AttributeError:
             if tarinfo.issym():
-                linkpath = os.path.join(os.path.dirname(tarinfo.name),
-                                        linkpath)
-                linkpath = normpath(linkpath)
+                linkpath = os.path.dirname(tarinfo.name) + "/" + \
+                                        tarinfo.linkname
+            else:
+                linkpath = tarinfo.linkname
 
             try:
                 self._extract_member(self.getmember(linkpath), targetpath)
             except (EnvironmentError, KeyError), e:
-                linkpath = os.path.normpath(linkpath)
+                linkpath = linkpath.replace("/", os.sep)
                 try:
                     shutil.copy2(linkpath, targetpath)
                 except EnvironmentError, e:

Modified: python/branches/tk_and_idle_maintenance/Lib/test/decimaltestdata/extra.decTest
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/test/decimaltestdata/extra.decTest	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/test/decimaltestdata/extra.decTest	Sun Sep  6 23:23:17 2009
@@ -154,6 +154,22 @@
 extr1302 fma 0E123 -Inf sNaN789 -> NaN Invalid_operation
 extr1302 fma -Inf 0E-456 sNaN148 -> NaN Invalid_operation
 
+-- Issue #6794: when comparing NaNs using compare_total, payloads
+-- should be compared as though positive integers; not
+-- lexicographically as strings.
+extr1400 comparetotal NaN123 NaN45 -> 1
+extr1401 comparetotal sNaN123 sNaN45 -> 1
+extr1402 comparetotal -NaN123 -NaN45 -> -1
+extr1403 comparetotal -sNaN123 -sNaN45 -> -1
+extr1404 comparetotal NaN45 NaN123 -> -1
+extr1405 comparetotal sNaN45 sNaN123 -> -1
+extr1406 comparetotal -NaN45 -NaN123 -> 1
+extr1407 comparetotal -sNaN45 -sNaN123 -> 1
+
+extr1410 comparetotal -sNaN63450748854172416 -sNaN911993 -> -1
+extr1411 comparetotmag NaN1222222222222 -NaN999999 -> 1
+
+
 -- max/min/max_mag/min_mag bug in 2.5.2/2.6/3.0: max(NaN, finite) gave
 -- incorrect answers when the finite number required rounding; similarly
 -- for the other thre functions

Modified: python/branches/tk_and_idle_maintenance/Lib/test/test_aepack.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/test/test_aepack.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/test/test_aepack.py	Sun Sep  6 23:23:17 2009
@@ -60,6 +60,9 @@
             import Carbon.File
         except:
             return
+
+        if not hasattr(Carbon.File, "FSSpec"):
+            return
         o = Carbon.File.FSSpec(os.curdir)
         packed = aepack.pack(o)
         unpacked = aepack.unpack(packed)
@@ -70,6 +73,8 @@
             import Carbon.File
         except:
             return
+        if not hasattr(Carbon.File, "FSSpec"):
+            return
         o = Carbon.File.FSSpec(os.curdir).NewAliasMinimal()
         packed = aepack.pack(o)
         unpacked = aepack.unpack(packed)

Modified: python/branches/tk_and_idle_maintenance/Lib/test/test_bytes.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/test/test_bytes.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/test/test_bytes.py	Sun Sep  6 23:23:17 2009
@@ -690,6 +690,8 @@
         self.assertEqual(b.pop(-2), ord('r'))
         self.assertRaises(IndexError, lambda: b.pop(10))
         self.assertRaises(OverflowError, lambda: bytearray().pop())
+        # test for issue #6846
+        self.assertEqual(bytearray(b'\xff').pop(), 0xff)
 
     def test_nosort(self):
         self.assertRaises(AttributeError, lambda: bytearray().sort())

Modified: python/branches/tk_and_idle_maintenance/Lib/test/test_descr.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/test/test_descr.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/test/test_descr.py	Sun Sep  6 23:23:17 2009
@@ -1391,13 +1391,9 @@
         self.assertEqual(super(D,D).goo(), (D,))
         self.assertEqual(super(D,d).goo(), (D,))
 
-        # Verify that argument is checked for callability (SF bug 753451)
-        try:
-            classmethod(1).__get__(1)
-        except TypeError:
-            pass
-        else:
-            self.fail("classmethod should check for callability")
+        # Verify that a non-callable will raise
+        meth = classmethod(1).__get__(1)
+        self.assertRaises(TypeError, meth)
 
         # Verify that classmethod() doesn't allow keyword args
         try:

Modified: python/branches/tk_and_idle_maintenance/Lib/test/test_funcattrs.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/test/test_funcattrs.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/test/test_funcattrs.py	Sun Sep  6 23:23:17 2009
@@ -13,15 +13,20 @@
         self.fi = F()
         self.b = b
 
-    def cannot_set_attr(self,obj, name, value, exceptions):
-        # This method is not called as a test (name doesn't start with 'test'),
-        # but may be used by other tests.
-        try: setattr(obj, name, value)
-        except exceptions: pass
-        else: self.fail("shouldn't be able to set %s to %r" % (name, value))
-        try: delattr(obj, name)
-        except exceptions: pass
-        else: self.fail("shouldn't be able to del %s" % name)
+    def cannot_set_attr(self, obj, name, value, exceptions):
+        # Helper method for other tests.
+        try:
+            setattr(obj, name, value)
+        except exceptions:
+            pass
+        else:
+            self.fail("shouldn't be able to set %s to %r" % (name, value))
+        try:
+            delattr(obj, name)
+        except exceptions:
+            pass
+        else:
+            self.fail("shouldn't be able to del %s" % name)
 
 
 class FunctionPropertiesTest(FuncAttrsTest):
@@ -32,15 +37,15 @@
     def test_dir_includes_correct_attrs(self):
         self.b.known_attr = 7
         self.assertTrue('known_attr' in dir(self.b),
-            "set attributes not in dir listing of method")
+                        "set attributes not in dir listing of method")
         # Test on underlying function object of method
         self.f.a.im_func.known_attr = 7
         self.assertTrue('known_attr' in dir(self.f.a),
-            "set attribute on unbound method implementation in class not in "
-                     "dir")
+                        "set attribute on unbound method implementation in "
+                        "class not in dir")
         self.assertTrue('known_attr' in dir(self.fi.a),
-            "set attribute on unbound method implementations, should show up"
-                     " in next dir")
+                        "set attribute on unbound method implementations, "
+                        "should show up in next dir")
 
     def test_duplicate_function_equality(self):
         # Body of `duplicate' is the exact same as self.b
@@ -56,9 +61,29 @@
         self.assertEqual(test(), 3) # self.b always returns 3, arbitrarily
 
     def test_func_globals(self):
-        self.assertEqual(self.b.func_globals, globals())
+        self.assertIs(self.b.func_globals, globals())
         self.cannot_set_attr(self.b, 'func_globals', 2, TypeError)
 
+    def test_func_closure(self):
+        a = 12
+        def f(): print a
+        c = f.func_closure
+        self.assertTrue(isinstance(c, tuple))
+        self.assertEqual(len(c), 1)
+        # don't have a type object handy
+        self.assertEqual(c[0].__class__.__name__, "cell")
+        self.cannot_set_attr(f, "func_closure", c, TypeError)
+
+    def test_empty_cell(self):
+        def f(): print a
+        try:
+            f.func_closure[0].cell_contents
+        except ValueError:
+            pass
+        else:
+            self.fail("shouldn't be able to read an empty cell")
+        a = 12
+
     def test_func_name(self):
         self.assertEqual(self.b.__name__, 'b')
         self.assertEqual(self.b.func_name, 'b')
@@ -96,16 +121,20 @@
         self.assertEqual(c.func_code, d.func_code)
         self.assertEqual(c(), 7)
         # self.assertEqual(d(), 7)
-        try: b.func_code = c.func_code
-        except ValueError: pass
-        else: self.fail(
-            "func_code with different numbers of free vars should not be "
-            "possible")
-        try: e.func_code = d.func_code
-        except ValueError: pass
-        else: self.fail(
-            "func_code with different numbers of free vars should not be "
-            "possible")
+        try:
+            b.func_code = c.func_code
+        except ValueError:
+            pass
+        else:
+            self.fail("func_code with different numbers of free vars should "
+                      "not be possible")
+        try:
+            e.func_code = d.func_code
+        except ValueError:
+            pass
+        else:
+            self.fail("func_code with different numbers of free vars should "
+                      "not be possible")
 
     def test_blank_func_defaults(self):
         self.assertEqual(self.b.func_defaults, None)
@@ -126,13 +155,16 @@
         self.assertEqual(first_func(3, 5), 8)
         del second_func.func_defaults
         self.assertEqual(second_func.func_defaults, None)
-        try: second_func()
-        except TypeError: pass
-        else: self.fail(
-            "func_defaults does not update; deleting it does not remove "
-            "requirement")
+        try:
+            second_func()
+        except TypeError:
+            pass
+        else:
+            self.fail("func_defaults does not update; deleting it does not "
+                      "remove requirement")
 
-class ImplicitReferencesTest(FuncAttrsTest):
+
+class InstancemethodAttrTest(FuncAttrsTest):
     def test_im_class(self):
         self.assertEqual(self.f.a.im_class, self.f)
         self.assertEqual(self.fi.a.im_class, self.f)
@@ -159,9 +191,12 @@
         self.assertEqual(self.fi.id(), id(self.fi))
         self.assertNotEqual(self.fi.id(), id(self.f))
         # Test usage
-        try: self.f.id.unknown_attr
-        except AttributeError: pass
-        else: self.fail("using unknown attributes should raise AttributeError")
+        try:
+            self.f.id.unknown_attr
+        except AttributeError:
+            pass
+        else:
+            self.fail("using unknown attributes should raise AttributeError")
         # Test assignment and deletion
         self.cannot_set_attr(self.f.id, 'unknown_attr', 2, AttributeError)
         self.cannot_set_attr(self.fi.id, 'unknown_attr', 2, AttributeError)
@@ -171,35 +206,50 @@
         self.assertEqual(self.f.a.known_attr, 7)
         self.assertEqual(self.fi.a.known_attr, 7)
 
+
 class ArbitraryFunctionAttrTest(FuncAttrsTest):
     def test_set_attr(self):
+        # setting attributes only works on function objects
         self.b.known_attr = 7
         self.assertEqual(self.b.known_attr, 7)
         for func in [self.f.a, self.fi.a]:
-            try: func.known_attr = 7
-            except AttributeError: pass
-            else: self.fail("setting attributes on methods should raise error")
+            try:
+                func.known_attr = 7
+            except AttributeError:
+                pass
+            else:
+                self.fail("setting attributes on methods should raise error")
 
     def test_delete_unknown_attr(self):
-        try: del self.b.unknown_attr
-        except AttributeError: pass
-        else: self.fail("deleting unknown attribute should raise TypeError")
+        try:
+            del self.b.unknown_attr
+        except AttributeError:
+            pass
+        else:
+            self.fail("deleting unknown attribute should raise TypeError")
 
     def test_setting_attrs_duplicates(self):
-        try: self.f.a.klass = self.f
-        except AttributeError: pass
-        else: self.fail("setting arbitrary attribute in unbound function "
-                        " should raise AttributeError")
+        try:
+            self.f.a.klass = self.f
+        except AttributeError:
+            pass
+        else:
+            self.fail("setting arbitrary attribute in unbound function "
+                      " should raise AttributeError")
         self.f.a.im_func.klass = self.f
         for method in [self.f.a, self.fi.a, self.fi.a.im_func]:
             self.assertEqual(method.klass, self.f)
 
     def test_unset_attr(self):
         for func in [self.b, self.f.a, self.fi.a]:
-            try:  func.non_existent_attr
-            except AttributeError: pass
-            else: self.fail("using unknown attributes should raise "
-                            "AttributeError")
+            try:
+                func.non_existent_attr
+            except AttributeError:
+                pass
+            else:
+                self.fail("using unknown attributes should raise "
+                          "AttributeError")
+
 
 class FunctionDictsTest(FuncAttrsTest):
     def test_setting_dict_to_invalid(self):
@@ -216,13 +266,13 @@
         # Setting dict is only possible on the underlying function objects
         self.f.a.im_func.__dict__ = d
         # Test assignment
-        self.assertEqual(d, self.b.__dict__)
-        self.assertEqual(d, self.b.func_dict)
+        self.assertIs(d, self.b.__dict__)
+        self.assertIs(d, self.b.func_dict)
         # ... and on all the different ways of referencing the method's func
-        self.assertEqual(d, self.f.a.im_func.__dict__)
-        self.assertEqual(d, self.f.a.__dict__)
-        self.assertEqual(d, self.fi.a.im_func.__dict__)
-        self.assertEqual(d, self.fi.a.__dict__)
+        self.assertIs(d, self.f.a.im_func.__dict__)
+        self.assertIs(d, self.f.a.__dict__)
+        self.assertIs(d, self.fi.a.im_func.__dict__)
+        self.assertIs(d, self.fi.a.__dict__)
         # Test value
         self.assertEqual(self.b.known_attr, 7)
         self.assertEqual(self.b.__dict__['known_attr'], 7)
@@ -234,12 +284,18 @@
         self.assertEqual(self.fi.a.known_attr, 7)
 
     def test_delete_func_dict(self):
-        try: del self.b.__dict__
-        except TypeError: pass
-        else: self.fail("deleting function dictionary should raise TypeError")
-        try: del self.b.func_dict
-        except TypeError: pass
-        else: self.fail("deleting function dictionary should raise TypeError")
+        try:
+            del self.b.__dict__
+        except TypeError:
+            pass
+        else:
+            self.fail("deleting function dictionary should raise TypeError")
+        try:
+            del self.b.func_dict
+        except TypeError:
+            pass
+        else:
+            self.fail("deleting function dictionary should raise TypeError")
 
     def test_unassigned_dict(self):
         self.assertEqual(self.b.__dict__, {})
@@ -250,6 +306,7 @@
         d[self.b] = value
         self.assertEqual(d[self.b], value)
 
+
 class FunctionDocstringTest(FuncAttrsTest):
     def test_set_docstring_attr(self):
         self.assertEqual(self.b.__doc__, None)
@@ -273,6 +330,7 @@
         self.assertEqual(self.b.__doc__, None)
         self.assertEqual(self.b.func_doc, None)
 
+
 class StaticMethodAttrsTest(unittest.TestCase):
     def test_func_attribute(self):
         def f():
@@ -286,7 +344,7 @@
 
 
 def test_main():
-    test_support.run_unittest(FunctionPropertiesTest, ImplicitReferencesTest,
+    test_support.run_unittest(FunctionPropertiesTest, InstancemethodAttrTest,
                               ArbitraryFunctionAttrTest, FunctionDictsTest,
                               FunctionDocstringTest,
                               StaticMethodAttrsTest)

Modified: python/branches/tk_and_idle_maintenance/Lib/test/test_io.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/test/test_io.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/test/test_io.py	Sun Sep  6 23:23:17 2009
@@ -2061,6 +2061,27 @@
             self.assertEqual(f.errors, "replace")
 
 
+    def test_threads_write(self):
+        # Issue6750: concurrent writes could duplicate data
+        event = threading.Event()
+        with self.open(support.TESTFN, "w", buffering=1) as f:
+            def run(n):
+                text = "Thread%03d\n" % n
+                event.wait()
+                f.write(text)
+            threads = [threading.Thread(target=lambda n=x: run(n))
+                       for x in range(20)]
+            for t in threads:
+                t.start()
+            time.sleep(0.02)
+            event.set()
+            for t in threads:
+                t.join()
+        with self.open(support.TESTFN) as f:
+            content = f.read()
+            for n in range(20):
+                self.assertEquals(content.count("Thread%03d\n" % n), 1)
+
 class CTextIOWrapperTest(TextIOWrapperTest):
 
     def test_initialization(self):

Modified: python/branches/tk_and_idle_maintenance/Lib/test/test_platform.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/test/test_platform.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/test/test_platform.py	Sun Sep  6 23:23:17 2009
@@ -156,7 +156,13 @@
                     break
             fd.close()
             self.assertFalse(real_ver is None)
-            self.assertEquals(res[0], real_ver)
+            result_list = res[0].split('.')
+            expect_list = real_ver.split('.')
+            len_diff = len(result_list) - len(expect_list)
+            # On Snow Leopard, sw_vers reports 10.6.0 as 10.6
+            if len_diff > 0:
+                expect_list.extend(['0'] * len_diff)
+            self.assertEquals(result_list, expect_list)
 
             # res[1] claims to contain
             # (version, dev_stage, non_release_version)

Modified: python/branches/tk_and_idle_maintenance/Lib/test/test_tarfile.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/test/test_tarfile.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/test/test_tarfile.py	Sun Sep  6 23:23:17 2009
@@ -660,6 +660,76 @@
         finally:
             shutil.rmtree(tempdir)
 
+    # Guarantee that stored pathnames are not modified. Don't
+    # remove ./ or ../ or double slashes. Still make absolute
+    # pathnames relative.
+    # For details see bug #6054.
+    def _test_pathname(self, path, cmp_path=None, dir=False):
+        # Create a tarfile with an empty member named path
+        # and compare the stored name with the original.
+        foo = os.path.join(TEMPDIR, "foo")
+        if not dir:
+            open(foo, "w").close()
+        else:
+            os.mkdir(foo)
+
+        tar = tarfile.open(tmpname, self.mode)
+        tar.add(foo, arcname=path)
+        tar.close()
+
+        tar = tarfile.open(tmpname, "r")
+        t = tar.next()
+        tar.close()
+
+        if not dir:
+            os.remove(foo)
+        else:
+            os.rmdir(foo)
+
+        self.assertEqual(t.name, cmp_path or path.replace(os.sep, "/"))
+
+    def test_pathnames(self):
+        self._test_pathname("foo")
+        self._test_pathname(os.path.join("foo", ".", "bar"))
+        self._test_pathname(os.path.join("foo", "..", "bar"))
+        self._test_pathname(os.path.join(".", "foo"))
+        self._test_pathname(os.path.join(".", "foo", "."))
+        self._test_pathname(os.path.join(".", "foo", ".", "bar"))
+        self._test_pathname(os.path.join(".", "foo", "..", "bar"))
+        self._test_pathname(os.path.join(".", "foo", "..", "bar"))
+        self._test_pathname(os.path.join("..", "foo"))
+        self._test_pathname(os.path.join("..", "foo", ".."))
+        self._test_pathname(os.path.join("..", "foo", ".", "bar"))
+        self._test_pathname(os.path.join("..", "foo", "..", "bar"))
+
+        self._test_pathname("foo" + os.sep + os.sep + "bar")
+        self._test_pathname("foo" + os.sep + os.sep, "foo", dir=True)
+
+    def test_abs_pathnames(self):
+        if sys.platform == "win32":
+            self._test_pathname("C:\\foo", "foo")
+        else:
+            self._test_pathname("/foo", "foo")
+            self._test_pathname("///foo", "foo")
+
+    def test_cwd(self):
+        # Test adding the current working directory.
+        cwd = os.getcwd()
+        os.chdir(TEMPDIR)
+        try:
+            open("foo", "w").close()
+
+            tar = tarfile.open(tmpname, self.mode)
+            tar.add(".")
+            tar.close()
+
+            tar = tarfile.open(tmpname, "r")
+            for t in tar:
+                self.assert_(t.name == "." or t.name.startswith("./"))
+            tar.close()
+        finally:
+            os.chdir(cwd)
+
 
 class StreamWriteTest(WriteTestBase):
 

Modified: python/branches/tk_and_idle_maintenance/Lib/test/test_unittest.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/test/test_unittest.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/test/test_unittest.py	Sun Sep  6 23:23:17 2009
@@ -2821,6 +2821,21 @@
                 self.assertRaisesRegexp, Exception,
                 re.compile('^Expected$'), Stub)
 
+    def testAssertRaisesExcValue(self):
+        class ExceptionMock(Exception):
+            pass
+
+        def Stub(foo):
+            raise ExceptionMock(foo)
+        v = "particular value"
+
+        ctx = self.assertRaises(ExceptionMock)
+        with ctx:
+            Stub(v)
+        e = ctx.exc_value
+        self.assertTrue(isinstance(e, ExceptionMock))
+        self.assertEqual(e.args[0], v)
+
     def testSynonymAssertMethodNames(self):
         """Test undocumented method name synonyms.
 

Modified: python/branches/tk_and_idle_maintenance/Lib/test/test_xmlrpc.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/test/test_xmlrpc.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/test/test_xmlrpc.py	Sun Sep  6 23:23:17 2009
@@ -329,6 +329,66 @@
         PORT = None
         evt.set()
 
+def http_multi_server(evt, numrequests, requestHandler=None):
+    class TestInstanceClass:
+        def div(self, x, y):
+            return x // y
+
+        def _methodHelp(self, name):
+            if name == 'div':
+                return 'This is the div function'
+
+    def my_function():
+        '''This is my function'''
+        return True
+
+    class MyXMLRPCServer(SimpleXMLRPCServer.MultiPathXMLRPCServer):
+        def get_request(self):
+            # Ensure the socket is always non-blocking.  On Linux, socket
+            # attributes are not inherited like they are on *BSD and Windows.
+            s, port = self.socket.accept()
+            s.setblocking(True)
+            return s, port
+
+    if not requestHandler:
+        requestHandler = SimpleXMLRPCServer.SimpleXMLRPCRequestHandler
+    class MyRequestHandler(requestHandler):
+        rpc_paths = []
+
+    serv = MyXMLRPCServer(("localhost", 0), MyRequestHandler,
+                          logRequests=False, bind_and_activate=False)
+    serv.socket.settimeout(3)
+    serv.server_bind()
+    try:
+        global ADDR, PORT, URL
+        ADDR, PORT = serv.socket.getsockname()
+        #connect to IP address directly.  This avoids socket.create_connection()
+        #trying to connect to to "localhost" using all address families, which
+        #causes slowdown e.g. on vista which supports AF_INET6.  The server listens
+        #on AF_INET only.
+        URL = "http://%s:%d"%(ADDR, PORT)
+        serv.server_activate()
+        paths = ["/foo", "/foo/bar"]
+        for path in paths:
+            d = serv.add_dispatcher(path, SimpleXMLRPCServer.SimpleXMLRPCDispatcher())
+            d.register_introspection_functions()
+            d.register_multicall_functions()
+        serv.get_dispatcher(paths[0]).register_function(pow)
+        serv.get_dispatcher(paths[1]).register_function(lambda x,y: x+y, 'add')
+        evt.set()
+
+        # handle up to 'numrequests' requests
+        while numrequests > 0:
+            serv.handle_request()
+            numrequests -= 1
+
+    except socket.timeout:
+        pass
+    finally:
+        serv.socket.close()
+        PORT = None
+        evt.set()
+
 # This function prevents errors like:
 #    <ProtocolError for localhost:57527/RPC2: 500 Internal Server Error>
 def is_unavailable_exception(e):
@@ -353,6 +413,7 @@
 class BaseServerTestCase(unittest.TestCase):
     requestHandler = None
     request_count = 1
+    threadFunc = staticmethod(http_server)
     def setUp(self):
         # enable traceback reporting
         SimpleXMLRPCServer.SimpleXMLRPCServer._send_traceback_header = True
@@ -360,7 +421,7 @@
         self.evt = threading.Event()
         # start server thread to handle requests
         serv_args = (self.evt, self.request_count, self.requestHandler)
-        threading.Thread(target=http_server, args=serv_args).start()
+        threading.Thread(target=self.threadFunc, args=serv_args).start()
 
         # wait for the server to be ready
         self.evt.wait(10)
@@ -517,6 +578,18 @@
         # This avoids waiting for the socket timeout.
         self.test_simple1()
 
+class MultiPathServerTestCase(BaseServerTestCase):
+    threadFunc = staticmethod(http_multi_server)
+    request_count = 2
+    def test_path1(self):
+        p = xmlrpclib.ServerProxy(URL+"/foo")
+        self.assertEqual(p.pow(6,8), 6**8)
+        self.assertRaises(xmlrpclib.Fault, p.add, 6, 8)
+    def test_path2(self):
+        p = xmlrpclib.ServerProxy(URL+"/foo/bar")
+        self.assertEqual(p.add(6,8), 6+8)
+        self.assertRaises(xmlrpclib.Fault, p.pow, 6, 8)
+
 #A test case that verifies that a server using the HTTP/1.1 keep-alive mechanism
 #does indeed serve subsequent requests on the same connection
 class BaseKeepaliveServerTestCase(BaseServerTestCase):
@@ -923,6 +996,7 @@
         xmlrpc_tests.append(GzipServerTestCase)
     except ImportError:
         pass #gzip not supported in this build
+    xmlrpc_tests.append(MultiPathServerTestCase)
     xmlrpc_tests.append(ServerProxyTestCase)
     xmlrpc_tests.append(FailingServerTestCase)
     xmlrpc_tests.append(CGIHandlerTestCase)

Modified: python/branches/tk_and_idle_maintenance/Lib/types.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/types.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/types.py	Sun Sep  6 23:23:17 2009
@@ -42,11 +42,7 @@
 def _f(): pass
 FunctionType = type(_f)
 LambdaType = type(lambda: None)         # Same as FunctionType
-try:
-    CodeType = type(_f.func_code)
-except RuntimeError:
-    # Execution in restricted environment
-    pass
+CodeType = type(_f.func_code)
 
 def _g():
     yield 1
@@ -70,15 +66,10 @@
 try:
     raise TypeError
 except TypeError:
-    try:
-        tb = sys.exc_info()[2]
-        TracebackType = type(tb)
-        FrameType = type(tb.tb_frame)
-    except AttributeError:
-        # In the restricted environment, exc_info returns (None, None,
-        # None) Then, tb.tb_frame gives an attribute error
-        pass
-    tb = None; del tb
+    tb = sys.exc_info()[2]
+    TracebackType = type(tb)
+    FrameType = type(tb.tb_frame)
+    del tb
 
 SliceType = slice
 EllipsisType = type(Ellipsis)

Modified: python/branches/tk_and_idle_maintenance/Lib/unittest/case.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/unittest/case.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/unittest/case.py	Sun Sep  6 23:23:17 2009
@@ -104,6 +104,7 @@
         if not issubclass(exc_type, self.expected):
             # let unexpected exceptions pass through
             return False
+        self.exc_value = exc_value #store for later retrieval
         if self.expected_regex is None:
             return True
 

Modified: python/branches/tk_and_idle_maintenance/Lib/webbrowser.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/webbrowser.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/webbrowser.py	Sun Sep  6 23:23:17 2009
@@ -625,7 +625,9 @@
     # and prepend to _tryorder
     for cmdline in _userchoices:
         if cmdline != '':
-            _synthesize(cmdline, -1)
+            cmd = _synthesize(cmdline, -1)
+            if cmd[1] is None:
+                register(cmdline, None, GenericBrowser(cmdline), -1)
     cmdline = None # to make del work if _userchoices was empty
     del cmdline
     del _userchoices

Modified: python/branches/tk_and_idle_maintenance/Lib/xmlrpclib.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/xmlrpclib.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/xmlrpclib.py	Sun Sep  6 23:23:17 2009
@@ -1488,7 +1488,7 @@
                 )
         else:
             chost, self._extra_headers, x509 = self.get_host_info(host)
-            self._connection = host, HTTPSConnection(chost, None, **(x509 or {}))
+            self._connection = host, HTTPS(chost, None, **(x509 or {}))
             return self._connection[1]
 
 ##

Modified: python/branches/tk_and_idle_maintenance/Mac/scripts/BuildApplet.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Mac/scripts/BuildApplet.py	(original)
+++ python/branches/tk_and_idle_maintenance/Mac/scripts/BuildApplet.py	Sun Sep  6 23:23:17 2009
@@ -12,7 +12,10 @@
 
 import os
 import MacOS
-import EasyDialogs
+try:
+    import EasyDialogs
+except ImportError:
+    EasyDialogs = None
 import buildtools
 import getopt
 
@@ -32,7 +35,10 @@
     try:
         buildapplet()
     except buildtools.BuildError, detail:
-        EasyDialogs.Message(detail)
+        if EasyDialogs is None:
+            print detail
+        else:
+            EasyDialogs.Message(detail)
 
 
 def buildapplet():
@@ -46,6 +52,10 @@
     # Ask for source text if not specified in sys.argv[1:]
 
     if not sys.argv[1:]:
+        if EasyDialogs is None:
+            usage()
+            sys.exit(1)
+
         filename = EasyDialogs.AskFileForOpen(message='Select Python source or applet:',
                 typeList=('TEXT', 'APPL'))
         if not filename:

Modified: python/branches/tk_and_idle_maintenance/Makefile.pre.in
==============================================================================
--- python/branches/tk_and_idle_maintenance/Makefile.pre.in	(original)
+++ python/branches/tk_and_idle_maintenance/Makefile.pre.in	Sun Sep  6 23:23:17 2009
@@ -770,6 +770,7 @@
 	(cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
 	-rm -f $(DESTDIR)$(BINDIR)/python-config
 	(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
+	-test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
 	-rm -f $(DESTDIR)$(LIBPC)/python.pc
 	(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python.pc)
 
@@ -1176,7 +1177,8 @@
 distclean: clobber
 	-rm -f Lib/test/data/*
 	-rm -f core Makefile Makefile.pre config.status \
-		Modules/Setup Modules/Setup.local Modules/Setup.config
+		Modules/Setup Modules/Setup.local Modules/Setup.config \
+		Misc/python.pc
 	find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
 			   -o -name '[@,#]*' -o -name '*.old' \
 			   -o -name '*.orig' -o -name '*.rej' \

Modified: python/branches/tk_and_idle_maintenance/Misc/ACKS
==============================================================================
--- python/branches/tk_and_idle_maintenance/Misc/ACKS	(original)
+++ python/branches/tk_and_idle_maintenance/Misc/ACKS	Sun Sep  6 23:23:17 2009
@@ -783,6 +783,7 @@
 Truida Wiedijk
 Felix Wiemann
 Gerry Wiener
+Frank Wierzbicki
 Bryce "Zooko" Wilcox-O'Hearn
 John Williams
 Sue Williams
@@ -794,7 +795,6 @@
 Dik Winter
 Blake Winton
 Jean-Claude Wippler
-Frank Wierzbicki
 Lars Wirzenius
 Chris Withers
 Stefan Witzel

Modified: python/branches/tk_and_idle_maintenance/Misc/NEWS
==============================================================================
--- python/branches/tk_and_idle_maintenance/Misc/NEWS	(original)
+++ python/branches/tk_and_idle_maintenance/Misc/NEWS	Sun Sep  6 23:23:17 2009
@@ -12,6 +12,13 @@
 Core and Builtins
 -----------------
 
+- Issue #6846: Fix bug where bytearray.pop() returns negative integers.
+
+- classmethod no longer checks if its argument is callable.
+
+- Issue #6750: A text file opened with io.open() could duplicate its output
+  when writing from multiple threads at the same time.
+
 - Issue #6704: Improve the col_offset in AST for "for" statements with
   a target of tuple unpacking.
 
@@ -359,6 +366,24 @@
 Library
 -------
 
+- Issue #4937: plat-mac/bundlebuilder revers to non-existing version.plist
+
+- Issue #6838: Use a list to accumulate the value instead of
+  repeatedly concatenating strings in httplib's
+  HTTPResponse._read_chunked providing a significant speed increase
+  when downloading large files servend with a Transfer-Encoding of 'chunked'.
+
+- Issue #5275: In Cookie's Cookie.load(), properly handle non-string arguments
+  as documented.
+
+- Issue #2666: Handle BROWSER environment variable properly for unknown browser
+  names in the webbrowser module.
+
+- Issue #6054: Do not normalize stored pathnames in tarfile.
+
+- Issue #6794: Fix Decimal.compare_total and Decimal.compare_total_mag: NaN
+  payloads are now ordered by integer value rather than lexicographically.
+
 - Issue #6693: New functions in site.py to get user/global site packages paths.
 
 - The thread.lock type now supports weak references.
@@ -1168,6 +1193,13 @@
 Build
 -----
 
+- Add 2 new options to ``--with-universal-archs`` on MacOSX: 
+  ``intel`` builds a distribution with ``i386`` and ``x86_64`` architectures,
+  while ``3-way`` builds a distribution with the ``ppc``, ``i386`` 
+  and ``x86_64`` architectures. 
+  
+- Issue #6802: Fix build issues on MacOSX 10.6
+
 - Issue #6244: Allow detect_tkinter to look for Tcl/Tk 8.6.
 
 - Issue 5390: Add uninstall icon independent of whether file
@@ -1224,6 +1256,9 @@
 - Issue #6556: Fixed the Distutils configuration files location explanation
   for Windows.
 
+- Issue #6801 : symmetric_difference_update also accepts |.
+  Thanks to Carl Chenet. 
+
 C-API
 -----
 
@@ -1315,6 +1350,9 @@
 Tests
 -----
 
+- Issue #6806: test_platform failed under OS X 10.6.0 because ``sw_ver`` leaves
+  off the trailing 0 in the version number.
+
 - Issue #5450: Moved tests involving loading tk from Lib/test/test_tcl to
   Lib/lib-tk/test/test_tkinter/test_loadtk. With this, these tests demonstrate
   the same behaviour as test_ttkguionly (and now also test_tk) which is to

Modified: python/branches/tk_and_idle_maintenance/Modules/_io/textio.c
==============================================================================
--- python/branches/tk_and_idle_maintenance/Modules/_io/textio.c	(original)
+++ python/branches/tk_and_idle_maintenance/Modules/_io/textio.c	Sun Sep  6 23:23:17 2009
@@ -1189,11 +1189,18 @@
 static int
 _textiowrapper_writeflush(textio *self)
 {
-    PyObject *b, *ret;
+    PyObject *pending, *b, *ret;
 
     if (self->pending_bytes == NULL)
         return 0;
-    b = _PyBytes_Join(_PyIO_empty_bytes, self->pending_bytes);
+
+    pending = self->pending_bytes;
+    Py_INCREF(pending);
+    self->pending_bytes_count = 0;
+    Py_CLEAR(self->pending_bytes);
+
+    b = _PyBytes_Join(_PyIO_empty_bytes, pending);
+    Py_DECREF(pending);
     if (b == NULL)
         return -1;
     ret = PyObject_CallMethodObjArgs(self->buffer,
@@ -1202,8 +1209,6 @@
     if (ret == NULL)
         return -1;
     Py_DECREF(ret);
-    Py_CLEAR(self->pending_bytes);
-    self->pending_bytes_count = 0;
     return 0;
 }
 

Modified: python/branches/tk_and_idle_maintenance/Objects/bytearrayobject.c
==============================================================================
--- python/branches/tk_and_idle_maintenance/Objects/bytearrayobject.c	(original)
+++ python/branches/tk_and_idle_maintenance/Objects/bytearrayobject.c	Sun Sep  6 23:23:17 2009
@@ -2620,7 +2620,7 @@
 
     if (n == PY_SSIZE_T_MAX) {
         PyErr_SetString(PyExc_OverflowError,
-                        "cannot add more objects to bytes");
+                        "cannot add more objects to bytearray");
         return NULL;
     }
     if (!_getbytevalue(value, &ival))
@@ -2655,7 +2655,7 @@
         return NULL;
     if (n == PY_SSIZE_T_MAX) {
         PyErr_SetString(PyExc_OverflowError,
-                        "cannot add more objects to bytes");
+                        "cannot add more objects to bytearray");
         return NULL;
     }
     if (PyByteArray_Resize((PyObject *)self, n + 1) < 0)
@@ -2756,7 +2756,7 @@
 
     if (n == 0) {
         PyErr_SetString(PyExc_OverflowError,
-                        "cannot pop an empty bytes");
+                        "cannot pop an empty bytearray");
         return NULL;
     }
     if (where < 0)
@@ -2773,7 +2773,7 @@
     if (PyByteArray_Resize((PyObject *)self, n - 1) < 0)
         return NULL;
 
-    return PyInt_FromLong(value);
+    return PyInt_FromLong((unsigned char)value);
 }
 
 PyDoc_STRVAR(remove__doc__,
@@ -2794,7 +2794,7 @@
             break;
     }
     if (where == n) {
-        PyErr_SetString(PyExc_ValueError, "value not found in bytes");
+        PyErr_SetString(PyExc_ValueError, "value not found in bytearray");
         return NULL;
     }
     if (!_canresize(self))

Modified: python/branches/tk_and_idle_maintenance/Objects/classobject.c
==============================================================================
--- python/branches/tk_and_idle_maintenance/Objects/classobject.c	(original)
+++ python/branches/tk_and_idle_maintenance/Objects/classobject.c	Sun Sep  6 23:23:17 2009
@@ -2226,10 +2226,6 @@
 PyMethod_New(PyObject *func, PyObject *self, PyObject *klass)
 {
 	register PyMethodObject *im;
-	if (!PyCallable_Check(func)) {
-		PyErr_BadInternalCall();
-		return NULL;
-	}
 	im = free_list;
 	if (im != NULL) {
 		free_list = (PyMethodObject *)(im->im_self);

Modified: python/branches/tk_and_idle_maintenance/Objects/funcobject.c
==============================================================================
--- python/branches/tk_and_idle_maintenance/Objects/funcobject.c	(original)
+++ python/branches/tk_and_idle_maintenance/Objects/funcobject.c	Sun Sep  6 23:23:17 2009
@@ -659,12 +659,6 @@
 		return -1;
 	if (!_PyArg_NoKeywords("classmethod", kwds))
 		return -1;
-	if (!PyCallable_Check(callable)) {
-		PyErr_Format(PyExc_TypeError, "'%s' object is not callable",
-		     callable->ob_type->tp_name);
-		return -1;
-	}
-	
 	Py_INCREF(callable);
 	cm->cm_callable = callable;
 	return 0;

Modified: python/branches/tk_and_idle_maintenance/Objects/stringobject.c
==============================================================================
--- python/branches/tk_and_idle_maintenance/Objects/stringobject.c	(original)
+++ python/branches/tk_and_idle_maintenance/Objects/stringobject.c	Sun Sep  6 23:23:17 2009
@@ -4341,14 +4341,16 @@
 	}
 	if (prec < 0)
 		prec = 6;
+#if SIZEOF_INT > 4
 	/* make sure that the decimal representation of precision really does
 	   need at most 10 digits: platforms with sizeof(int) == 8 exist! */
-	if (prec > 0x7fffffffL) {
+	if (prec > 0x7fffffff) {
 		PyErr_SetString(PyExc_OverflowError,
 				"outrageously large precision "
 				"for formatted float");
 		return -1;
 	}
+#endif
 
 	if (type == 'f' && fabs(x) >= 1e50)
 		type = 'g';

Modified: python/branches/tk_and_idle_maintenance/Objects/unicodeobject.c
==============================================================================
--- python/branches/tk_and_idle_maintenance/Objects/unicodeobject.c	(original)
+++ python/branches/tk_and_idle_maintenance/Objects/unicodeobject.c	Sun Sep  6 23:23:17 2009
@@ -8325,14 +8325,16 @@
         return -1;
     if (prec < 0)
         prec = 6;
+#if SIZEOF_INT > 4
     /* make sure that the decimal representation of precision really does
        need at most 10 digits: platforms with sizeof(int) == 8 exist! */
-    if (prec > 0x7fffffffL) {
+    if (prec > 0x7fffffff) {
         PyErr_SetString(PyExc_OverflowError,
                         "outrageously large precision "
                         "for formatted float");
         return -1;
     }
+#endif
 
     if (type == 'f' && fabs(x) >= 1e50)
         type = 'g';

Modified: python/branches/tk_and_idle_maintenance/README
==============================================================================
--- python/branches/tk_and_idle_maintenance/README	(original)
+++ python/branches/tk_and_idle_maintenance/README	Sun Sep  6 23:23:17 2009
@@ -104,26 +104,26 @@
 Read comp.lang.python, a high-volume discussion newsgroup about
 Python, or comp.lang.python.announce, a low-volume moderated newsgroup
 for Python-related announcements.  These are also accessible as
-mailing lists: see http://www.python.org/community/lists.html for an
+mailing lists: see http://www.python.org/community/lists/ for an
 overview of these and many other Python-related mailing lists.
 
 Archives are accessible via the Google Groups Usenet archive; see
 http://groups.google.com/.  The mailing lists are also archived, see
-http://www.python.org/community/lists.html for details.
+http://www.python.org/community/lists/ for details.
 
 
 Bug reports
 -----------
 
 To report or search for bugs, please use the Python Bug
-Tracker at http://bugs.python.org.
+Tracker at http://bugs.python.org/.
 
 
 Patches and contributions
 -------------------------
 
 To submit a patch or other contribution, please use the Python Patch
-Manager at http://bugs.python.org.  Guidelines
+Manager at http://bugs.python.org/.  Guidelines
 for patch submission may be found at http://www.python.org/dev/patches/.
 
 If you have a proposal to change Python, you may want to send an email to the
@@ -185,7 +185,7 @@
 See also the platform specific notes in the next section.
 
 If you run into other trouble, see the FAQ
-(http://www.python.org/doc/faq) for hints on what can go wrong, and
+(http://www.python.org/doc/faq/) for hints on what can go wrong, and
 how to fix it.
 
 If you rerun the configure script with different options, remove all
@@ -386,7 +386,7 @@
 HP-UX ia64: When building on the ia64 (Itanium) platform using HP's
         compiler, some experience has shown that the compiler's
         optimiser produces a completely broken version of python
-        (see http://www.python.org/sf/814976). To work around this,
+        (see http://bugs.python.org/814976). To work around this,
         edit the Makefile and remove -O from the OPT line.
 
         To build a 64-bit executable on an Itanium 2 system using HP's
@@ -406,7 +406,7 @@
         if it remains set.)  You still have to edit the Makefile and
         remove -O from the OPT line.
 
-HP PA-RISC 2.0: A recent bug report (http://www.python.org/sf/546117)
+HP PA-RISC 2.0: A recent bug report (http://bugs.python.org/546117)
         suggests that the C compiler in this 64-bit system has bugs
         in the optimizer that break Python.  Compiling without
         optimization solves the problems.
@@ -532,14 +532,6 @@
         and type NMAKE.  Threading and sockets are supported by default
         in the resulting binaries of PYTHON15.DLL and PYTHON.EXE.
 
-Monterey (64-bit AIX): The current Monterey C compiler (Visual Age)
-        uses the OBJECT_MODE={32|64} environment variable to set the
-        compilation mode to either 32-bit or 64-bit (32-bit mode is
-        the default).  Presumably you want 64-bit compilation mode for
-        this 64-bit OS.  As a result you must first set OBJECT_MODE=64
-        in your environment before configuring (./configure) or
-        building (make) Python on Monterey.
-
 Reliant UNIX: The thread support does not compile on Reliant UNIX, and
         there is a (minor) problem in the configure script for that
         platform as well.  This should be resolved in time for a
@@ -1159,9 +1151,9 @@
 is now maintained by the equally famous Barry Warsaw (it's no
 coincidence that they now both work on the same team).  The latest
 version, along with various other contributed Python-related Emacs
-goodies, is online at http://www.python.org/emacs/python-mode.  And
+goodies, is online at http://www.python.org/emacs/python-mode/.  And
 if you are planning to edit the Python C code, please pick up the
-latest version of CC Mode http://www.python.org/emacs/cc-mode; it
+latest version of CC Mode http://www.python.org/emacs/cc-mode/; it
 contains a "python" style used throughout most of the Python C source
 files.  (Newer versions of Emacs or XEmacs may already come with the
 latest version of python-mode.)

Modified: python/branches/tk_and_idle_maintenance/configure
==============================================================================
--- python/branches/tk_and_idle_maintenance/configure	(original)
+++ python/branches/tk_and_idle_maintenance/configure	Sun Sep  6 23:23:17 2009
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 74044 .
+# From configure.in Revision: 74667 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for python 2.7.
 #
@@ -1911,7 +1911,6 @@
 
 
 
-ARCH_RUN_32BIT=
 
 
 UNIVERSAL_ARCHS="32-bit"
@@ -2057,7 +2056,7 @@
 if test -z "$MACHDEP"
 then
 	ac_sys_system=`uname -s`
-	if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
+	if test "$ac_sys_system" = "AIX" \
 	-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
 		ac_sys_release=`uname -v`
 	else
@@ -2306,9 +2305,6 @@
 		AR="\$(srcdir)/Modules/ar_beos"
 		RANLIB=:
 		;;
-    Monterey*)
-        RANLIB=:
-        without_gcc=;;
 	*)	without_gcc=no;;
 	esac
 fi
@@ -3855,7 +3851,7 @@
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 
 
@@ -3917,10 +3913,6 @@
     case $CC in
     cc|*/cc) CC="$CC -Ae";;
     esac;;
-Monterey*)
-    case $CC in
-    cc) CC="$CC -Wl,-Bexport";;
-    esac;;
 SunOS*)
     # Some functions have a prototype only with that define, e.g. confstr
 
@@ -3988,8 +3980,6 @@
 	       exp_extra="."
 	   fi
 	   LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";;
-	Monterey64*)
-	   LINKCC="$LINKCC -L/usr/lib/ia64l64";;
 	QNX*)
 	   # qcc must be used because the other compilers do not
 	   # support -N.
@@ -4596,15 +4586,6 @@
 	OPT="-O"
 	;;
     esac
-
-    # The current (beta) Monterey compiler dies with optimizations
-    # XXX what is Monterey? Does it still die w/ -O? Can we get rid of this?
-    case $ac_sys_system in
-	Monterey*)
-	    OPT=""
-	    ;;
-    esac
-
 fi
 
 
@@ -4707,6 +4688,7 @@
 
 	         elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
 		   UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
+		   ARCH_RUN_32BIT="true"
 
 	         elif test "$UNIVERSAL_ARCHS" = "all" ; then
 		   UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
@@ -4732,12 +4714,22 @@
 	    cur_target=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'`
 	    if test ${cur_target} '>' 10.2; then
 		    cur_target=10.3
-	    fi
-	    if test "${UNIVERSAL_ARCHS}" = "all"; then
-		    # Ensure that the default platform for a 4-way
-		    # universal build is OSX 10.5, that's the first
-		    # OS release where 4-way builds make sense.
-		    cur_target='10.5'
+		    if test ${enable_universalsdk}; then
+			    if test "${UNIVERSAL_ARCHS}" = "all"; then
+				    # Ensure that the default platform for a
+				    # 4-way universal build is OSX 10.5,
+				    # that's the first OS release where
+				    # 4-way builds make sense.
+				    cur_target='10.5'
+			    fi
+		    else
+			    if test `arch` = "i386"; then
+				    # On Intel macs default to a deployment
+				    # target of 10.4, that's the first OSX
+				    # release with Intel support.
+				    cur_target="10.4"
+			    fi
+		    fi
 	    fi
 	    CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
 
@@ -5399,7 +5391,7 @@
 else
   ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 
@@ -5420,7 +5412,7 @@
 else
   ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 
@@ -6518,7 +6510,7 @@
 
 
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 { echo "$as_me:$LINENO: result: $was_it_defined" >&5
 echo "${ECHO_T}$was_it_defined" >&6; }
@@ -7048,7 +7040,7 @@
 else
   ac_cv_type_uid_t=no
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
@@ -14475,13 +14467,15 @@
 esac
 
 
+ARCH_RUN_32BIT=""
+
 case $ac_sys_system/$ac_sys_release in
   Darwin/[01567]\..*)
     LIBTOOL_CRUFT="-framework System -lcc_dynamic"
     if test "${enable_universalsdk}"; then
 	    :
     else
-	LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
+        LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
     fi
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
@@ -14493,7 +14487,93 @@
         else
             LIBTOOL_CRUFT=""
     fi
-    LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only `arch`"
+    if test "$cross_compiling" = yes; then
+  ac_osx_32bit=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+[
+    #include <unistd.h>
+    int main(int argc, char*argv[])
+    {
+      if (sizeof(long) == 4) {
+    	  return 0;
+      } else {
+      	  return 1;
+      }
+    ]
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_osx_32bit=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_osx_32bit=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+
+    if test "${ac_osx_32bit}" = "yes"; then
+    	case `arch` in
+    	i386)
+    		MACOSX_DEFAULT_ARCH="i386"
+    		;;
+    	ppc)
+    		MACOSX_DEFAULT_ARCH="ppc"
+    		;;
+    	*)
+    		{ { echo "$as_me:$LINENO: error: Unexpected output of 'arch' on OSX" >&5
+echo "$as_me: error: Unexpected output of 'arch' on OSX" >&2;}
+   { (exit 1); exit 1; }; }
+    		;;
+    	esac
+    else
+    	case `arch` in
+    	i386)
+    		MACOSX_DEFAULT_ARCH="x86_64"
+    		;;
+    	ppc)
+    		MACOSX_DEFAULT_ARCH="ppc64"
+    		;;
+    	*)
+    		{ { echo "$as_me:$LINENO: error: Unexpected output of 'arch' on OSX" >&5
+echo "$as_me: error: Unexpected output of 'arch' on OSX" >&2;}
+   { (exit 1); exit 1; }; }
+    		;;
+    	esac
+
+	#ARCH_RUN_32BIT="true"
+    fi
+
+    LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
 esac
@@ -14688,7 +14768,6 @@
 		else LDSHARED='$(CC) -G'
 		fi;;
 	SCO_SV*) LDSHARED='$(CC) -Wl,-G,-Bexport';;
-	Monterey*) LDSHARED="cc -G -dy -Bdynamic -Bexport -L/usr/lib/ia64l64";;
 	CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";;
 	atheos*) LDSHARED="gcc -shared";;
 	*)	LDSHARED="ld";;
@@ -14727,7 +14806,6 @@
 		then CCSHARED="-fPIC"
 		else CCSHARED="-Kpic -belf"
 		fi;;
-	Monterey*) CCSHARED="-G";;
 	IRIX*/6*)  case $CC in
 		   *gcc*) CCSHARED="-shared";;
 		   *) CCSHARED="";;
@@ -15621,7 +15699,7 @@
 else
   unistd_defines_pthreads=no
 fi
-rm -f conftest*
+rm -f -r conftest*
 
     { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5
 echo "${ECHO_T}$unistd_defines_pthreads" >&6; }
@@ -17235,7 +17313,7 @@
   $EGREP "yes" >/dev/null 2>&1; then
   ipv6type=$i
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 			;;
 		kame)
@@ -17258,7 +17336,7 @@
 				ipv6libdir=/usr/local/v6/lib
 				ipv6trylibc=yes
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 			;;
 		linux-glibc)
@@ -17279,7 +17357,7 @@
   ipv6type=$i;
 				ipv6trylibc=yes
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 			;;
 		linux-inet6)
@@ -17317,7 +17395,7 @@
 				ipv6lib=inet6;
 				ipv6libdir=/usr/local/v6/lib
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 			;;
 		v6d)
@@ -17340,7 +17418,7 @@
 				ipv6libdir=/usr/local/v6/lib;
 				BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 			;;
 		zeta)
@@ -17362,7 +17440,7 @@
 				ipv6lib=inet6;
 				ipv6libdir=/usr/local/v6/lib
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 			;;
 		esac
@@ -23386,7 +23464,105 @@
 
 
 
-for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p round
+for ac_func in acosh asinh atanh copysign erf erfc expm1 finite gamma
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+
+for ac_func in hypot lgamma log1p round tgamma
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -25081,7 +25257,7 @@
 _ACEOF
 
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 
@@ -25351,7 +25527,7 @@
 _ACEOF
 
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 

Modified: python/branches/tk_and_idle_maintenance/configure.in
==============================================================================
--- python/branches/tk_and_idle_maintenance/configure.in	(original)
+++ python/branches/tk_and_idle_maintenance/configure.in	Sun Sep  6 23:23:17 2009
@@ -109,7 +109,6 @@
 ])
 AC_SUBST(UNIVERSALSDK)
 
-ARCH_RUN_32BIT=
 AC_SUBST(ARCH_RUN_32BIT)
 
 UNIVERSAL_ARCHS="32-bit"
@@ -235,7 +234,7 @@
 if test -z "$MACHDEP"
 then
 	ac_sys_system=`uname -s`
-	if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
+	if test "$ac_sys_system" = "AIX" \
 	-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
 		ac_sys_release=`uname -v`
 	else
@@ -457,9 +456,6 @@
 		AR="\$(srcdir)/Modules/ar_beos"
 		RANLIB=:
 		;;
-    Monterey*)
-        RANLIB=:
-        without_gcc=;;
 	*)	without_gcc=no;;
 	esac])
 AC_MSG_RESULT($without_gcc)
@@ -581,10 +577,6 @@
     case $CC in
     cc|*/cc) CC="$CC -Ae";;
     esac;;
-Monterey*)
-    case $CC in
-    cc) CC="$CC -Wl,-Bexport";;
-    esac;;
 SunOS*)
     # Some functions have a prototype only with that define, e.g. confstr
     AC_DEFINE(__EXTENSIONS__, 1, [Defined on Solaris to see additional function prototypes.])
@@ -645,8 +637,6 @@
 	       exp_extra="."
 	   fi
 	   LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";;
-	Monterey64*)
-	   LINKCC="$LINKCC -L/usr/lib/ia64l64";;
 	QNX*)
 	   # qcc must be used because the other compilers do not
 	   # support -N.
@@ -900,15 +890,6 @@
 	OPT="-O"
 	;;
     esac
-
-    # The current (beta) Monterey compiler dies with optimizations
-    # XXX what is Monterey? Does it still die w/ -O? Can we get rid of this?
-    case $ac_sys_system in
-	Monterey*)
-	    OPT=""
-	    ;;
-    esac
-
 fi
 
 AC_SUBST(BASECFLAGS)
@@ -965,6 +946,7 @@
 
 	         elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
 		   UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
+		   ARCH_RUN_32BIT="true"
 
 	         elif test "$UNIVERSAL_ARCHS" = "all" ; then
 		   UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
@@ -988,12 +970,22 @@
 	    cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
 	    if test ${cur_target} '>' 10.2; then
 		    cur_target=10.3
-	    fi
-	    if test "${UNIVERSAL_ARCHS}" = "all"; then
-		    # Ensure that the default platform for a 4-way
-		    # universal build is OSX 10.5, that's the first
-		    # OS release where 4-way builds make sense.
-		    cur_target='10.5'
+		    if test ${enable_universalsdk}; then
+			    if test "${UNIVERSAL_ARCHS}" = "all"; then
+				    # Ensure that the default platform for a 
+				    # 4-way universal build is OSX 10.5, 
+				    # that's the first OS release where 
+				    # 4-way builds make sense.
+				    cur_target='10.5'
+			    fi
+		    else
+			    if test `arch` = "i386"; then
+				    # On Intel macs default to a deployment
+				    # target of 10.4, that's the first OSX
+				    # release with Intel support.
+				    cur_target="10.4"
+			    fi
+		    fi
 	    fi
 	    CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
 	    
@@ -1526,6 +1518,8 @@
     ;;
 esac
 
+
+ARCH_RUN_32BIT=""
 AC_SUBST(LIBTOOL_CRUFT)
 case $ac_sys_system/$ac_sys_release in
   Darwin/@<:@01567@:>@\..*) 
@@ -1533,7 +1527,7 @@
     if test "${enable_universalsdk}"; then
 	    :
     else
-	LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
+        LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
     fi
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
@@ -1545,7 +1539,48 @@
         else 
             LIBTOOL_CRUFT=""
     fi
-    LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only `arch`"
+    AC_TRY_RUN([[
+    #include <unistd.h>
+    int main(int argc, char*argv[])
+    {
+      if (sizeof(long) == 4) {
+    	  return 0;
+      } else {
+      	  return 1;
+      }
+    ]], ac_osx_32bit=yes,
+       ac_osx_32bit=no,
+       ac_osx_32bit=no)
+    
+    if test "${ac_osx_32bit}" = "yes"; then
+    	case `arch` in
+    	i386) 
+    		MACOSX_DEFAULT_ARCH="i386" 
+    		;;
+    	ppc) 
+    		MACOSX_DEFAULT_ARCH="ppc" 
+    		;;
+    	*)
+    		AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
+    		;;
+    	esac
+    else
+    	case `arch` in
+    	i386) 
+    		MACOSX_DEFAULT_ARCH="x86_64" 
+    		;;
+    	ppc) 
+    		MACOSX_DEFAULT_ARCH="ppc64" 
+    		;;
+    	*)
+    		AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
+    		;;
+    	esac
+
+	#ARCH_RUN_32BIT="true"
+    fi
+
+    LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
 esac
@@ -1722,7 +1757,6 @@
 		else LDSHARED='$(CC) -G'
 		fi;;
 	SCO_SV*) LDSHARED='$(CC) -Wl,-G,-Bexport';;
-	Monterey*) LDSHARED="cc -G -dy -Bdynamic -Bexport -L/usr/lib/ia64l64";;
 	CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";;
 	atheos*) LDSHARED="gcc -shared";;
 	*)	LDSHARED="ld";;
@@ -1759,7 +1793,6 @@
 		then CCSHARED="-fPIC"
 		else CCSHARED="-Kpic -belf"
 		fi;;
-	Monterey*) CCSHARED="-G";;
 	IRIX*/6*)  case $CC in
 		   *gcc*) CCSHARED="-shared";;
 		   *) CCSHARED="";;
@@ -3283,7 +3316,8 @@
   [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros])
 fi
 
-AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot log1p round])
+AC_CHECK_FUNCS([acosh asinh atanh copysign erf erfc expm1 finite gamma])
+AC_CHECK_FUNCS([hypot lgamma log1p round tgamma])
 AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]])
 
 LIBS=$LIBS_SAVE

Modified: python/branches/tk_and_idle_maintenance/pyconfig.h.in
==============================================================================
--- python/branches/tk_and_idle_maintenance/pyconfig.h.in	(original)
+++ python/branches/tk_and_idle_maintenance/pyconfig.h.in	Sun Sep  6 23:23:17 2009
@@ -165,6 +165,12 @@
 /* Define if you have the 'epoll' functions. */
 #undef HAVE_EPOLL
 
+/* Define to 1 if you have the `erf' function. */
+#undef HAVE_ERF
+
+/* Define to 1 if you have the `erfc' function. */
+#undef HAVE_ERFC
+
 /* Define to 1 if you have the <errno.h> header file. */
 #undef HAVE_ERRNO_H
 
@@ -231,6 +237,9 @@
 /* Define to 1 if you have the `gai_strerror' function. */
 #undef HAVE_GAI_STRERROR
 
+/* Define to 1 if you have the `gamma' function. */
+#undef HAVE_GAMMA
+
 /* Define if you have the getaddrinfo function. */
 #undef HAVE_GETADDRINFO
 
@@ -357,6 +366,9 @@
 /* Define to 1 if you have the `lchown' function. */
 #undef HAVE_LCHOWN
 
+/* Define to 1 if you have the `lgamma' function. */
+#undef HAVE_LGAMMA
+
 /* Define to 1 if you have the `dl' library (-ldl). */
 #undef HAVE_LIBDL
 
@@ -751,6 +763,9 @@
 /* Define to 1 if you have the <term.h> header file. */
 #undef HAVE_TERM_H
 
+/* Define to 1 if you have the `tgamma' function. */
+#undef HAVE_TGAMMA
+
 /* Define to 1 if you have the <thread.h> header file. */
 #undef HAVE_THREAD_H
 


More information about the Python-checkins mailing list