From python-checkins at python.org Sat Jan 1 00:00:06 2011 From: python-checkins at python.org (georg.brandl) Date: Sat, 1 Jan 2011 00:00:06 +0100 (CET) Subject: [Python-checkins] r87593 - in python/branches/py3k: Doc/README.txt Doc/copyright.rst Doc/license.rst LICENSE PC/python_nt.rc README Message-ID: <20101231230006.1D430EE9E1@mail.python.org> Author: georg.brandl Date: Sat Jan 1 00:00:03 2011 New Revision: 87593 Log: Happy New Year! (CET edition) Modified: python/branches/py3k/Doc/README.txt python/branches/py3k/Doc/copyright.rst python/branches/py3k/Doc/license.rst python/branches/py3k/LICENSE python/branches/py3k/PC/python_nt.rc python/branches/py3k/README Modified: python/branches/py3k/Doc/README.txt ============================================================================== --- python/branches/py3k/Doc/README.txt (original) +++ python/branches/py3k/Doc/README.txt Sat Jan 1 00:00:03 2011 @@ -132,7 +132,7 @@ as long as you don't change or remove the copyright notice: ---------------------------------------------------------------------- -Copyright (c) 2000-2010 Python Software Foundation. +Copyright (c) 2000-2011 Python Software Foundation. All rights reserved. Copyright (c) 2000 BeOpen.com. Modified: python/branches/py3k/Doc/copyright.rst ============================================================================== --- python/branches/py3k/Doc/copyright.rst (original) +++ python/branches/py3k/Doc/copyright.rst Sat Jan 1 00:00:03 2011 @@ -4,7 +4,7 @@ Python and this documentation is: -Copyright ?? 2001-2010 Python Software Foundation. All rights reserved. +Copyright ?? 2001-2011 Python Software Foundation. All rights reserved. Copyright ?? 2000 BeOpen.com. All rights reserved. Modified: python/branches/py3k/Doc/license.rst ============================================================================== --- python/branches/py3k/Doc/license.rst (original) +++ python/branches/py3k/Doc/license.rst Sat Jan 1 00:00:03 2011 @@ -108,7 +108,7 @@ +----------------+--------------+------------+------------+-----------------+ | 3.1.2 | 3.1 | 2010 | PSF | yes | +----------------+--------------+------------+------------+-----------------+ -| 3.2 | 3.1 | 2010 | PSF | yes | +| 3.2 | 3.1 | 2011 | PSF | yes | +----------------+--------------+------------+------------+-----------------+ .. note:: @@ -138,7 +138,7 @@ analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python |release| alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of - copyright, i.e., "Copyright ?? 2001-2010 Python Software Foundation; All Rights + copyright, i.e., "Copyright ?? 2001-2011 Python Software Foundation; All Rights Reserved" are retained in Python |release| alone or in any derivative version prepared by Licensee. @@ -906,7 +906,7 @@ sources unless the zlib version found on the system is too old to be used for the build:: - Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2011 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages Modified: python/branches/py3k/LICENSE ============================================================================== --- python/branches/py3k/LICENSE (original) +++ python/branches/py3k/LICENSE Sat Jan 1 00:00:03 2011 @@ -68,7 +68,7 @@ 3.1 3.0.1 2009 PSF yes 3.1.1 3.1 2009 PSF yes 3.1.2 3.1 2010 PSF yes - 3.2 3.1 2010 PSF yes + 3.2 3.1 2011 PSF yes Footnotes: @@ -103,9 +103,9 @@ analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of copyright, -i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -Python Software Foundation; All Rights Reserved" are retained in Python alone or -in any derivative version prepared by Licensee. +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011 Python Software Foundation; All Rights Reserved" are retained in Python +alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof, and wants to make Modified: python/branches/py3k/PC/python_nt.rc ============================================================================== --- python/branches/py3k/PC/python_nt.rc (original) +++ python/branches/py3k/PC/python_nt.rc Sat Jan 1 00:00:03 2011 @@ -61,7 +61,7 @@ VALUE "FileDescription", "Python Core\0" VALUE "FileVersion", PYTHON_VERSION VALUE "InternalName", "Python DLL\0" - VALUE "LegalCopyright", "Copyright ? 2001-2010 Python Software Foundation. Copyright ? 2000 BeOpen.com. Copyright ? 1995-2001 CNRI. Copyright ? 1991-1995 SMC.\0" + VALUE "LegalCopyright", "Copyright ? 2001-2011 Python Software Foundation. Copyright ? 2000 BeOpen.com. Copyright ? 1995-2001 CNRI. Copyright ? 1991-1995 SMC.\0" VALUE "OriginalFilename", PYTHON_DLL_NAME "\0" VALUE "ProductName", "Python\0" VALUE "ProductVersion", PYTHON_VERSION Modified: python/branches/py3k/README ============================================================================== --- python/branches/py3k/README (original) +++ python/branches/py3k/README Sat Jan 1 00:00:03 2011 @@ -1,7 +1,7 @@ This is Python version 3.2 beta 2 ================================= -Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Python Software Foundation. All rights reserved. From python-checkins at python.org Sat Jan 1 00:16:17 2011 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 1 Jan 2011 00:16:17 +0100 (CET) Subject: [Python-checkins] r87594 - in python/branches/py3k: Lib/collections.py Lib/test/test_collections.py Misc/NEWS Message-ID: <20101231231617.C148CEE9C5@mail.python.org> Author: raymond.hettinger Date: Sat Jan 1 00:16:17 2011 New Revision: 87594 Log: Fix OrderedDict.setdefault() to work for subclasses that define __missing__(). Modified: python/branches/py3k/Lib/collections.py python/branches/py3k/Lib/test/test_collections.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Sat Jan 1 00:16:17 2011 @@ -171,7 +171,6 @@ size += sizeof(self.__root) * n # proxy objects return size - setdefault = MutableMapping.setdefault update = MutableMapping.update pop = MutableMapping.pop keys = MutableMapping.keys @@ -179,6 +178,13 @@ items = MutableMapping.items __ne__ = MutableMapping.__ne__ + def setdefault(self, key, default=None): + 'OD.setdefault(k[,d]) -> OD.get(k,d), also set OD[k]=d if k not in OD' + if key in self: + return self[key] + self[key] = default + return default + @_recursive_repr() def __repr__(self): 'od.__repr__() <==> repr(od)' Modified: python/branches/py3k/Lib/test/test_collections.py ============================================================================== --- python/branches/py3k/Lib/test/test_collections.py (original) +++ python/branches/py3k/Lib/test/test_collections.py Sat Jan 1 00:16:17 2011 @@ -976,6 +976,12 @@ # make sure 'x' is added to the end self.assertEqual(list(od.items())[-1], ('x', 10)) + # make sure setdefault still works when __missing__ is defined + class Missing(OrderedDict): + def __missing__(self, key): + return 0 + self.assertEqual(Missing().setdefault(5, 9), 9) + def test_reinsert(self): # Given insert a, insert b, delete a, re-insert a, # verify that a is now later than b. Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 1 00:16:17 2011 @@ -20,6 +20,9 @@ Library ------- +- Fix collections.OrderedDict.setdefault() so that it works in + subclasses that define __missing__(). + - Issue 10786: unittest.TextTestRunner default stream no longer bound at import time. `sys.stderr` now looked up at instantiation time. Fix contributed by Mark Roddy. From python-checkins at python.org Sat Jan 1 00:23:06 2011 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 1 Jan 2011 00:23:06 +0100 (CET) Subject: [Python-checkins] r87595 - python/branches/py3k/Misc/NEWS Message-ID: <20101231232306.E8C3EEE9C5@mail.python.org> Author: raymond.hettinger Date: Sat Jan 1 00:23:06 2011 New Revision: 87595 Log: Typo. Modified: python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 1 00:23:06 2011 @@ -74,7 +74,7 @@ - Issue #10750: The ``raw`` attribute of buffered IO objects is now read-only. -- Deprecated assertDictContainsSubclass() in the unittest module. +- Deprecated assertDictContainsSubset() in the unittest module. Build ----- From python-checkins at python.org Sat Jan 1 01:29:59 2011 From: python-checkins at python.org (terry.reedy) Date: Sat, 1 Jan 2011 01:29:59 +0100 (CET) Subject: [Python-checkins] r87596 - python/branches/release31-maint/Doc/library/threading.rst Message-ID: <20110101002959.BB195EE99B@mail.python.org> Author: terry.reedy Date: Sat Jan 1 01:29:59 2011 New Revision: 87596 Log: Issue 10789: Correct threading.Lock.acquire signature. Modified: python/branches/release31-maint/Doc/library/threading.rst Modified: python/branches/release31-maint/Doc/library/threading.rst ============================================================================== --- python/branches/release31-maint/Doc/library/threading.rst (original) +++ python/branches/release31-maint/Doc/library/threading.rst Sat Jan 1 01:29:59 2011 @@ -365,7 +365,7 @@ All methods are executed atomically. -.. method:: Lock.acquire(blocking=True) +.. method:: Lock.acquire([blocking]) Acquire a lock, blocking or non-blocking. From python-checkins at python.org Sat Jan 1 01:36:18 2011 From: python-checkins at python.org (terry.reedy) Date: Sat, 1 Jan 2011 01:36:18 +0100 (CET) Subject: [Python-checkins] r87597 - python/branches/release27-maint/Doc/library/threading.rst Message-ID: <20110101003618.2D1F6EE99B@mail.python.org> Author: terry.reedy Date: Sat Jan 1 01:36:18 2011 New Revision: 87597 Log: Issue 10789: Correct threading.Lock.acquire signature. Modified: python/branches/release27-maint/Doc/library/threading.rst Modified: python/branches/release27-maint/Doc/library/threading.rst ============================================================================== --- python/branches/release27-maint/Doc/library/threading.rst (original) +++ python/branches/release27-maint/Doc/library/threading.rst Sat Jan 1 01:36:18 2011 @@ -388,7 +388,7 @@ All methods are executed atomically. -.. method:: Lock.acquire([blocking=1]) +.. method:: Lock.acquire([blocking]) Acquire a lock, blocking or non-blocking. From nnorwitz at gmail.com Sat Jan 1 01:39:33 2011 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 31 Dec 2010 19:39:33 -0500 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20110101003933.GA2910@kbk-i386-bb.dyndns.org> 352 tests OK. 1 test failed: test_sqlite 28 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_epoll test_gdb test_gl test_imgfile test_ioctl test_kqueue test_macos test_macostools test_multiprocessing test_pep277 test_py3kwarn test_scriptpackages test_startfile test_sunaudiodev test_tcl test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_winreg test_winsound test_zipfile64 7 skips unexpected on linux2: test_epoll test_gdb test_ioctl test_multiprocessing test_tk test_ttk_guionly test_ttk_textonly == CPython 2.7 (trunk:87592M, Dec 31 2010, 16:04:00) [GCC 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)] == Linux-2.6.9-gentoo-r1-i686-AMD_Athlon-tm-_XP_3000+-with-gentoo-1.4.16 little-endian == /tmp/test_python_27021 test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aetypes test_aifc test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named MacOS test_argparse test_array test_ascii_formatd test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 Sleepycat Software: Berkeley DB 4.1.25: (December 19, 2002) Test path prefix: /tmp/z-test_bsddb3-27021 test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compileall test_compiler testCompileLibrary still working, be patient... test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_dictcomps test_dictviews test_difflib test_dircache test_dis test_distutils [19643 refs] test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_file2k test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future5 test_future_builtins test_gc test_gdb test_gdb skipped -- gdb versions before 7.0 didn't support python embedding Saw: GNU gdb 6.2.1 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-pc-linux-gnu". test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [15648 refs] [15648 refs] [15648 refs] [25315 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_importlib test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_linecache test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named MacOS test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_memoryview test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770. test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os [15648 refs] [15648 refs] test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_pdb test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- only NT+ and systems with Unicode-friendly filesystem encoding test_pep292 test_pep352 test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [17044 refs] [17044 refs] test_plistlib test_poll test_popen [15653 refs] [15653 refs] [15653 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [20862 refs] [20862 refs] [20862 refs] [20862 refs] [20862 refs] [20861 refs] [20861 refs] test_pyexpat test_queue test_quopri [18479 refs] [18479 refs] test_random test_re test_readline test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_setcomps test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [15648 refs] [15648 refs] [15648 refs] [15648 refs] test_slice test_smtplib test_smtpnet test_socket test_socketserver test_softspace test_sort test_sqlite test test_sqlite failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/sqlite3/test/types.py", line 388, in CheckSqlTimestamp self.assertEqual(ts.year, now.year) AssertionError: 2011 != 2010 Re-running test 'test_sqlite' in verbose mode CheckAPILevel (sqlite3.test.dbapi.ModuleTests) ... ok CheckDataError (sqlite3.test.dbapi.ModuleTests) ... ok CheckDatabaseError (sqlite3.test.dbapi.ModuleTests) ... ok CheckError (sqlite3.test.dbapi.ModuleTests) ... ok CheckIntegrityError (sqlite3.test.dbapi.ModuleTests) ... ok CheckInterfaceError (sqlite3.test.dbapi.ModuleTests) ... ok CheckInternalError (sqlite3.test.dbapi.ModuleTests) ... ok CheckNotSupportedError (sqlite3.test.dbapi.ModuleTests) ... ok CheckOperationalError (sqlite3.test.dbapi.ModuleTests) ... ok CheckParamStyle (sqlite3.test.dbapi.ModuleTests) ... ok CheckProgrammingError (sqlite3.test.dbapi.ModuleTests) ... ok CheckThreadSafety (sqlite3.test.dbapi.ModuleTests) ... ok CheckWarning (sqlite3.test.dbapi.ModuleTests) ... ok CheckClose (sqlite3.test.dbapi.ConnectionTests) ... ok CheckCommit (sqlite3.test.dbapi.ConnectionTests) ... ok CheckCommitAfterNoChanges (sqlite3.test.dbapi.ConnectionTests) ... ok CheckCursor (sqlite3.test.dbapi.ConnectionTests) ... ok CheckExceptions (sqlite3.test.dbapi.ConnectionTests) ... ok CheckFailedOpen (sqlite3.test.dbapi.ConnectionTests) ... ok CheckRollback (sqlite3.test.dbapi.ConnectionTests) ... ok CheckRollbackAfterNoChanges (sqlite3.test.dbapi.ConnectionTests) ... ok CheckArraySize (sqlite3.test.dbapi.CursorTests) ... ok CheckClose (sqlite3.test.dbapi.CursorTests) ... ok CheckCursorConnection (sqlite3.test.dbapi.CursorTests) ... ok CheckCursorWrongClass (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteArgFloat (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteArgInt (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteArgString (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteDictMapping (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteDictMappingNoArgs (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteDictMappingTooLittleArgs (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteDictMappingUnnamed (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteDictMapping_Mapping (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteIllegalSql (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteManyGenerator (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteManyIterator (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteManyNotIterable (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteManySelect (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteManySequence (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteManyWrongSqlArg (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteNoArgs (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteParamList (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteParamSequence (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteTooMuchSql (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteTooMuchSql2 (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteTooMuchSql3 (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteWrongNoOfArgs1 (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteWrongNoOfArgs2 (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteWrongNoOfArgs3 (sqlite3.test.dbapi.CursorTests) ... ok CheckExecuteWrongSqlArg (sqlite3.test.dbapi.CursorTests) ... ok CheckFetchIter (sqlite3.test.dbapi.CursorTests) ... ok CheckFetchall (sqlite3.test.dbapi.CursorTests) ... ok CheckFetchmany (sqlite3.test.dbapi.CursorTests) ... ok CheckFetchmanyKwArg (sqlite3.test.dbapi.CursorTests) Checks if fetchmany works with keyword arguments ... ok CheckFetchone (sqlite3.test.dbapi.CursorTests) ... ok CheckFetchoneNoStatement (sqlite3.test.dbapi.CursorTests) ... ok CheckRowcountExecute (sqlite3.test.dbapi.CursorTests) ... ok CheckRowcountExecutemany (sqlite3.test.dbapi.CursorTests) ... ok CheckRowcountSelect (sqlite3.test.dbapi.CursorTests) ... ok CheckSetinputsizes (sqlite3.test.dbapi.CursorTests) ... ok CheckSetoutputsize (sqlite3.test.dbapi.CursorTests) ... ok CheckSetoutputsizeNoColumn (sqlite3.test.dbapi.CursorTests) ... ok CheckTotalChanges (sqlite3.test.dbapi.CursorTests) ... ok CheckWrongCursorCallable (sqlite3.test.dbapi.CursorTests) ... ok CheckConClose (sqlite3.test.dbapi.ThreadTests) ... ok CheckConCommit (sqlite3.test.dbapi.ThreadTests) ... ok CheckConCursor (sqlite3.test.dbapi.ThreadTests) ... ok CheckConRollback (sqlite3.test.dbapi.ThreadTests) ... ok CheckCurClose (sqlite3.test.dbapi.ThreadTests) ... ok CheckCurExecute (sqlite3.test.dbapi.ThreadTests) ... ok CheckCurImplicitBegin (sqlite3.test.dbapi.ThreadTests) ... ok CheckCurIterNext (sqlite3.test.dbapi.ThreadTests) ... ok CheckBinary (sqlite3.test.dbapi.ConstructorTests) ... ok CheckDate (sqlite3.test.dbapi.ConstructorTests) ... ok CheckDateFromTicks (sqlite3.test.dbapi.ConstructorTests) ... ok CheckTime (sqlite3.test.dbapi.ConstructorTests) ... ok CheckTimeFromTicks (sqlite3.test.dbapi.ConstructorTests) ... ok CheckTimestamp (sqlite3.test.dbapi.ConstructorTests) ... ok CheckTimestampFromTicks (sqlite3.test.dbapi.ConstructorTests) ... ok CheckConnectionExecute (sqlite3.test.dbapi.ExtensionTests) ... ok CheckConnectionExecutemany (sqlite3.test.dbapi.ExtensionTests) ... ok CheckConnectionExecutescript (sqlite3.test.dbapi.ExtensionTests) ... ok CheckScriptErrorNormal (sqlite3.test.dbapi.ExtensionTests) ... ok CheckScriptStringSql (sqlite3.test.dbapi.ExtensionTests) ... ok CheckScriptStringUnicode (sqlite3.test.dbapi.ExtensionTests) ... ok CheckScriptSyntaxError (sqlite3.test.dbapi.ExtensionTests) ... ok CheckClosedCall (sqlite3.test.dbapi.ClosedConTests) ... ok CheckClosedConCommit (sqlite3.test.dbapi.ClosedConTests) ... ok CheckClosedConCursor (sqlite3.test.dbapi.ClosedConTests) ... ok CheckClosedConRollback (sqlite3.test.dbapi.ClosedConTests) ... ok CheckClosedCreateAggregate (sqlite3.test.dbapi.ClosedConTests) ... ok CheckClosedCreateFunction (sqlite3.test.dbapi.ClosedConTests) ... ok CheckClosedCurExecute (sqlite3.test.dbapi.ClosedConTests) ... ok CheckClosedSetAuthorizer (sqlite3.test.dbapi.ClosedConTests) ... ok CheckClosedSetProgressCallback (sqlite3.test.dbapi.ClosedConTests) ... ok CheckClosed (sqlite3.test.dbapi.ClosedCurTests) ... ok CheckBlob (sqlite3.test.types.SqliteTypeTests) ... ok CheckFloat (sqlite3.test.types.SqliteTypeTests) ... ok CheckLargeInt (sqlite3.test.types.SqliteTypeTests) ... ok CheckNonUtf8_Default (sqlite3.test.types.SqliteTypeTests) ... ok CheckNonUtf8_TextFactoryOptimizedUnicode (sqlite3.test.types.SqliteTypeTests) ... ok CheckNonUtf8_TextFactoryString (sqlite3.test.types.SqliteTypeTests) ... ok CheckSmallInt (sqlite3.test.types.SqliteTypeTests) ... ok CheckString (sqlite3.test.types.SqliteTypeTests) ... ok CheckUnicodeExecute (sqlite3.test.types.SqliteTypeTests) ... ok CheckBlob (sqlite3.test.types.DeclTypesTests) ... ok CheckBool (sqlite3.test.types.DeclTypesTests) ... ok CheckFloat (sqlite3.test.types.DeclTypesTests) ... ok CheckFoo (sqlite3.test.types.DeclTypesTests) ... ok CheckLargeInt (sqlite3.test.types.DeclTypesTests) ... ok CheckNumber1 (sqlite3.test.types.DeclTypesTests) ... ok CheckNumber2 (sqlite3.test.types.DeclTypesTests) Checks wether converter names are cut off at '(' characters ... ok CheckSmallInt (sqlite3.test.types.DeclTypesTests) ... ok CheckString (sqlite3.test.types.DeclTypesTests) ... ok CheckUnicode (sqlite3.test.types.DeclTypesTests) ... ok CheckUnsupportedDict (sqlite3.test.types.DeclTypesTests) ... ok CheckUnsupportedSeq (sqlite3.test.types.DeclTypesTests) ... ok CheckCaseInConverterName (sqlite3.test.types.ColNamesTests) ... ok CheckColName (sqlite3.test.types.ColNamesTests) ... ok CheckCursorDescriptionNoRow (sqlite3.test.types.ColNamesTests) ... ok CheckDeclTypeNotUsed (sqlite3.test.types.ColNamesTests) ... ok CheckNone (sqlite3.test.types.ColNamesTests) ... ok CheckCasterIsUsed (sqlite3.test.types.ObjectAdaptationTests) ... ok CheckBinaryInputForConverter (sqlite3.test.types.BinaryConverterTests) ... ok CheckDateTimeSubSeconds (sqlite3.test.types.DateTimeTests) ... ok CheckDateTimeSubSecondsFloatingPoint (sqlite3.test.types.DateTimeTests) ... ok CheckSqlTimestamp (sqlite3.test.types.DateTimeTests) ... FAIL CheckSqliteDate (sqlite3.test.types.DateTimeTests) ... ok CheckSqliteTimestamp (sqlite3.test.types.DateTimeTests) ... ok CheckFuncErrorOnCreate (sqlite3.test.userfunctions.FunctionTests) ... ok CheckFuncException (sqlite3.test.userfunctions.FunctionTests) ... ok CheckFuncRefCount (sqlite3.test.userfunctions.FunctionTests) ... ok CheckFuncReturnBlob (sqlite3.test.userfunctions.FunctionTests) ... ok CheckFuncReturnFloat (sqlite3.test.userfunctions.FunctionTests) ... ok CheckFuncReturnInt (sqlite3.test.userfunctions.FunctionTests) ... ok CheckFuncReturnNull (sqlite3.test.userfunctions.FunctionTests) ... ok CheckFuncReturnText (sqlite3.test.userfunctions.FunctionTests) ... ok CheckFuncReturnUnicode (sqlite3.test.userfunctions.FunctionTests) ... ok CheckParamBlob (sqlite3.test.userfunctions.FunctionTests) ... ok CheckParamFloat (sqlite3.test.userfunctions.FunctionTests) ... ok CheckParamInt (sqlite3.test.userfunctions.FunctionTests) ... ok CheckParamNone (sqlite3.test.userfunctions.FunctionTests) ... ok CheckParamString (sqlite3.test.userfunctions.FunctionTests) ... ok CheckAggrCheckAggrSum (sqlite3.test.userfunctions.AggregateTests) ... ok CheckAggrCheckParamBlob (sqlite3.test.userfunctions.AggregateTests) ... ok CheckAggrCheckParamFloat (sqlite3.test.userfunctions.AggregateTests) ... ok CheckAggrCheckParamInt (sqlite3.test.userfunctions.AggregateTests) ... ok CheckAggrCheckParamNone (sqlite3.test.userfunctions.AggregateTests) ... ok CheckAggrCheckParamStr (sqlite3.test.userfunctions.AggregateTests) ... ok CheckAggrErrorOnCreate (sqlite3.test.userfunctions.AggregateTests) ... ok CheckAggrExceptionInFinalize (sqlite3.test.userfunctions.AggregateTests) ... ok CheckAggrExceptionInInit (sqlite3.test.userfunctions.AggregateTests) ... ok CheckAggrExceptionInStep (sqlite3.test.userfunctions.AggregateTests) ... ok CheckAggrNoFinalize (sqlite3.test.userfunctions.AggregateTests) ... ok CheckAggrNoStep (sqlite3.test.userfunctions.AggregateTests) ... ok CheckColumnAccess (sqlite3.test.userfunctions.AuthorizerTests) ... ok CheckTableAccess (sqlite3.test.userfunctions.AuthorizerTests) ... ok CheckContextManager (sqlite3.test.py25tests.ContextTests) Can the connection be used as a context manager at all? ... ok CheckContextManagerCommit (sqlite3.test.py25tests.ContextTests) Is a commit called in the context manager? ... ok CheckContextManagerRollback (sqlite3.test.py25tests.ContextTests) Is a rollback called in the context manager? ... ok CheckIsInstance (sqlite3.test.factory.ConnectionFactoryTests) ... ok CheckIsInstance (sqlite3.test.factory.CursorFactoryTests) ... ok CheckIsProducedByFactory (sqlite3.test.factory.RowFactoryTestsBackwardsCompat) ... ok CheckCustomFactory (sqlite3.test.factory.RowFactoryTests) ... ok CheckSqliteRowAsDict (sqlite3.test.factory.RowFactoryTests) Checks if the row object can be correctly converted to a dictionary ... ok CheckSqliteRowAsTuple (sqlite3.test.factory.RowFactoryTests) Checks if the row object can be converted to a tuple ... ok CheckSqliteRowHashCmp (sqlite3.test.factory.RowFactoryTests) Checks if the row object compares and hashes correctly ... ok CheckSqliteRowIndex (sqlite3.test.factory.RowFactoryTests) ... ok CheckSqliteRowIter (sqlite3.test.factory.RowFactoryTests) Checks if the row object is iterable ... ok CheckCustom (sqlite3.test.factory.TextFactoryTests) ... ok CheckOptimizedUnicode (sqlite3.test.factory.TextFactoryTests) ... ok CheckString (sqlite3.test.factory.TextFactoryTests) ... ok CheckUnicode (sqlite3.test.factory.TextFactoryTests) ... ok CheckDMLdoesAutoCommitBefore (sqlite3.test.transactions.TransactionTests) ... ok CheckDeleteStartsTransaction (sqlite3.test.transactions.TransactionTests) ... ok CheckInsertStartsTransaction (sqlite3.test.transactions.TransactionTests) ... ok CheckLocking (sqlite3.test.transactions.TransactionTests) ... ok CheckRaiseTimeout (sqlite3.test.transactions.TransactionTests) ... ok CheckReplaceStartsTransaction (sqlite3.test.transactions.TransactionTests) ... ok CheckRollbackCursorConsistency (sqlite3.test.transactions.TransactionTests) ... ok CheckToggleAutoCommit (sqlite3.test.transactions.TransactionTests) ... ok CheckUpdateStartsTransaction (sqlite3.test.transactions.TransactionTests) ... ok CheckDropTable (sqlite3.test.transactions.SpecialCommandTests) ... ok CheckPragma (sqlite3.test.transactions.SpecialCommandTests) ... ok CheckVacuum (sqlite3.test.transactions.SpecialCommandTests) ... ok CheckCollationIsUsed (sqlite3.test.hooks.CollationTests) ... ok CheckCollationRegisterTwice (sqlite3.test.hooks.CollationTests) ... ok CheckCreateCollationNotAscii (sqlite3.test.hooks.CollationTests) ... ok CheckCreateCollationNotCallable (sqlite3.test.hooks.CollationTests) ... ok CheckDeregisterCollation (sqlite3.test.hooks.CollationTests) ... ok CheckCancelOperation (sqlite3.test.hooks.ProgressTests) ... ok CheckClearHandler (sqlite3.test.hooks.ProgressTests) ... ok CheckOpcodeCount (sqlite3.test.hooks.ProgressTests) ... ok CheckProgressHandlerUsed (sqlite3.test.hooks.ProgressTests) ... ok CheckAutoCommit (sqlite3.test.regression.RegressionTests) ... ok CheckColumnNameWithSpaces (sqlite3.test.regression.RegressionTests) ... ok CheckConnectionCall (sqlite3.test.regression.RegressionTests) ... ok CheckConnectionConstructorCallCheck (sqlite3.test.regression.RegressionTests) ... ok CheckCursorConstructorCallCheck (sqlite3.test.regression.RegressionTests) ... ok CheckCursorRegistration (sqlite3.test.regression.RegressionTests) ... ok CheckEmptyStatement (sqlite3.test.regression.RegressionTests) ... ok CheckOnConflictRollback (sqlite3.test.regression.RegressionTests) ... ok CheckPragmaAutocommit (sqlite3.test.regression.RegressionTests) ... ok CheckPragmaSchemaVersion (sqlite3.test.regression.RegressionTests) ... ok CheckPragmaUserVersion (sqlite3.test.regression.RegressionTests) ... ok CheckRegisterAdapter (sqlite3.test.regression.RegressionTests) ... ok CheckSetDict (sqlite3.test.regression.RegressionTests) ... ok CheckSetIsolationLevel (sqlite3.test.regression.RegressionTests) ... ok CheckStatementFinalizationOnCloseDb (sqlite3.test.regression.RegressionTests) ... ok CheckStatementReset (sqlite3.test.regression.RegressionTests) ... ok CheckTypeMapUsage (sqlite3.test.regression.RegressionTests) ... ok CheckUnicodeConnect (sqlite3.test.regression.RegressionTests) ... ok CheckWorkaroundForBuggySqliteTransferBindings (sqlite3.test.regression.RegressionTests) ... ok CheckTableDump (sqlite3.test.dump.DumpTests) ... ok ====================================================================== FAIL: CheckSqlTimestamp (sqlite3.test.types.DateTimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/sqlite3/test/types.py", line 388, in CheckSqlTimestamp self.assertEqual(ts.year, now.year) AssertionError: 2011 != 2010 ---------------------------------------------------------------------- Ran 214 tests in 0.317s FAILED (failures=1) test test_sqlite failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/sqlite3/test/types.py", line 388, in CheckSqlTimestamp self.assertEqual(ts.year, now.year) AssertionError: 2011 != 2010 test_ssl test_startfile test_startfile skipped -- module os has no attribute startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_strtod test_struct test_structmembers test_structseq test_subprocess [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15863 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] . [15648 refs] [15648 refs] this bit of output is from a test of stdout in a different process ... [15648 refs] [15648 refs] [15863 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15863 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] [15648 refs] . [15648 refs] [15648 refs] this bit of output is from a test of stdout in a different process ... [15648 refs] [15648 refs] [15863 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry test_symtable test_syntax test_sys [15648 refs] [15648 refs] [15648 refs] [15877 refs] [15671 refs] test_sysconfig [15648 refs] [15648 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [15648 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [18948 refs] [20223 refs] [20035 refs] [20035 refs] [20035 refs] [20035 refs] test_threading_local test_threadsignals test_time test_timeout test_tk test_tk skipped -- No module named _tkinter test_tokenize test_trace test_traceback test_transformer test_ttk_guionly test_ttk_guionly skipped -- No module named _tkinter test_ttk_textonly test_ttk_textonly skipped -- No module named _tkinter test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_univnewlines2k test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllibnet test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid test_wait3 test_wait4 test_warnings [15679 refs] [15679 refs] [15672 refs] [15679 refs] [15679 refs] [15672 refs] test_wave test_weakref test_weakset test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib test_xmlrpc test_xpickle sh: line 1: python2.4: command not found sh: line 1: python2.6: command not found test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zipimport_support test_zlib 352 tests OK. 1 test failed: test_sqlite 28 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_epoll test_gdb test_gl test_imgfile test_ioctl test_kqueue test_macos test_macostools test_multiprocessing test_pep277 test_py3kwarn test_scriptpackages test_startfile test_sunaudiodev test_tcl test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_winreg test_winsound test_zipfile64 7 skips unexpected on linux2: test_epoll test_gdb test_ioctl test_multiprocessing test_tk test_ttk_guionly test_ttk_textonly [985087 refs] From python-checkins at python.org Sat Jan 1 03:25:36 2011 From: python-checkins at python.org (terry.reedy) Date: Sat, 1 Jan 2011 03:25:36 +0100 (CET) Subject: [Python-checkins] r87598 - python/branches/py3k/Lib/idlelib/EditorWindow.py Message-ID: <20110101022536.637D8EE9A0@mail.python.org> Author: terry.reedy Date: Sat Jan 1 03:25:36 2011 New Revision: 87598 Log: Issue 6285: catch missing IDLE help file. Modified: python/branches/py3k/Lib/idlelib/EditorWindow.py Modified: python/branches/py3k/Lib/idlelib/EditorWindow.py ============================================================================== --- python/branches/py3k/Lib/idlelib/EditorWindow.py (original) +++ python/branches/py3k/Lib/idlelib/EditorWindow.py Sat Jan 1 03:25:36 2011 @@ -450,7 +450,11 @@ def python_docs(self, event=None): if sys.platform[:3] == 'win': - os.startfile(self.help_url) + try: + os.startfile(self.help_url) + except WindowsError as why: + tkMessageBox.showerror(title='Document Start Failure', + message=str(why), parent=self.text) else: webbrowser.open(self.help_url) return "break" @@ -753,9 +757,13 @@ "Create a callback with the helpfile value frozen at definition time" def display_extra_help(helpfile=helpfile): if not helpfile.startswith(('www', 'http')): - url = os.path.normpath(helpfile) + helpfile = os.path.normpath(helpfile) if sys.platform[:3] == 'win': - os.startfile(helpfile) + try: + os.startfile(helpfile) + except WindowsError as why: + tkMessageBox.showerror(title='Document Start Failure', + message=str(why), parent=self.text) else: webbrowser.open(helpfile) return display_extra_help From python-checkins at python.org Sat Jan 1 03:28:54 2011 From: python-checkins at python.org (terry.reedy) Date: Sat, 1 Jan 2011 03:28:54 +0100 (CET) Subject: [Python-checkins] r87599 - python/branches/release31-maint/Lib/idlelib/EditorWindow.py Message-ID: <20110101022854.C2CD0EE9A0@mail.python.org> Author: terry.reedy Date: Sat Jan 1 03:28:54 2011 New Revision: 87599 Log: Issue 6285: catch missing IDLE help file. Modified: python/branches/release31-maint/Lib/idlelib/EditorWindow.py Modified: python/branches/release31-maint/Lib/idlelib/EditorWindow.py ============================================================================== --- python/branches/release31-maint/Lib/idlelib/EditorWindow.py (original) +++ python/branches/release31-maint/Lib/idlelib/EditorWindow.py Sat Jan 1 03:28:54 2011 @@ -451,7 +451,11 @@ def python_docs(self, event=None): if sys.platform[:3] == 'win': - os.startfile(self.help_url) + try: + os.startfile(self.help_url) + except WindowsError as why: + tkMessageBox.showerror(title='Document Start Failure', + message=str(why), parent=self.text) else: webbrowser.open(self.help_url) return "break" @@ -754,9 +758,13 @@ "Create a callback with the helpfile value frozen at definition time" def display_extra_help(helpfile=helpfile): if not helpfile.startswith(('www', 'http')): - url = os.path.normpath(helpfile) + helpfile = os.path.normpath(helpfile) if sys.platform[:3] == 'win': - os.startfile(helpfile) + try: + os.startfile(helpfile) + except WindowsError as why: + tkMessageBox.showerror(title='Document Start Failure', + message=str(why), parent=self.text) else: webbrowser.open(helpfile) return display_extra_help From python-checkins at python.org Sat Jan 1 03:32:46 2011 From: python-checkins at python.org (terry.reedy) Date: Sat, 1 Jan 2011 03:32:46 +0100 (CET) Subject: [Python-checkins] r87600 - python/branches/release27-maint/Lib/idlelib/EditorWindow.py Message-ID: <20110101023246.64363EE987@mail.python.org> Author: terry.reedy Date: Sat Jan 1 03:32:46 2011 New Revision: 87600 Log: Issue 6285: catch missing IDLE help file. Backport from 3.2. Modified: python/branches/release27-maint/Lib/idlelib/EditorWindow.py Modified: python/branches/release27-maint/Lib/idlelib/EditorWindow.py ============================================================================== --- python/branches/release27-maint/Lib/idlelib/EditorWindow.py (original) +++ python/branches/release27-maint/Lib/idlelib/EditorWindow.py Sat Jan 1 03:32:46 2011 @@ -452,7 +452,11 @@ def python_docs(self, event=None): if sys.platform[:3] == 'win': - os.startfile(self.help_url) + try: + os.startfile(self.help_url) + except WindowsError as why: + tkMessageBox.showerror(title='Document Start Failure', + message=str(why), parent=self.text) else: webbrowser.open(self.help_url) return "break" @@ -747,9 +751,13 @@ "Create a callback with the helpfile value frozen at definition time" def display_extra_help(helpfile=helpfile): if not helpfile.startswith(('www', 'http')): - url = os.path.normpath(helpfile) + helpfile = os.path.normpath(helpfile) if sys.platform[:3] == 'win': - os.startfile(helpfile) + try: + os.startfile(helpfile) + except WindowsError as why: + tkMessageBox.showerror(title='Document Start Failure', + message=str(why), parent=self.text) else: webbrowser.open(helpfile) return display_extra_help From python-checkins at python.org Sat Jan 1 03:54:11 2011 From: python-checkins at python.org (terry.reedy) Date: Sat, 1 Jan 2011 03:54:11 +0100 (CET) Subject: [Python-checkins] r87601 - python/branches/py3k/Misc/NEWS Message-ID: <20110101025411.4710EEEA8B@mail.python.org> Author: terry.reedy Date: Sat Jan 1 03:54:11 2011 New Revision: 87601 Log: Modified: python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 1 03:54:11 2011 @@ -20,6 +20,9 @@ Library ------- +- Issue 6285: IDLE no longer crashes on missing help file; patch by Scott David + Daniels. + - Fix collections.OrderedDict.setdefault() so that it works in subclasses that define __missing__(). From python-checkins at python.org Sat Jan 1 03:59:12 2011 From: python-checkins at python.org (terry.reedy) Date: Sat, 1 Jan 2011 03:59:12 +0100 (CET) Subject: [Python-checkins] r87601 - svn:log Message-ID: <20110101025912.25ADEEE99B@mail.python.org> Author: terry.reedy Revision: 87601 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -0,0 +1 @@ +Issue 6285: add NEWS entry for 3.2 \ No newline at end of file From python-checkins at python.org Sat Jan 1 04:47:24 2011 From: python-checkins at python.org (terry.reedy) Date: Sat, 1 Jan 2011 04:47:24 +0100 (CET) Subject: [Python-checkins] r87601 - svn:log Message-ID: <20110101034724.7E147EE9D8@mail.python.org> Author: terry.reedy Revision: 87601 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -1 +1 @@ -Issue 6285: add NEWS entry for 3.2 \ No newline at end of file +Issue 6285: add NEWS entry for 3.2. From solipsis at pitrou.net Sat Jan 1 04:55:21 2011 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sat, 01 Jan 2011 04:55:21 +0100 Subject: [Python-checkins] Daily py3k reference leaks (r87598): sum=0 Message-ID: py3k results for svn r87598 (hg cset d166e319d298) -------------------------------------------------- Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/antoine/py3k/refleaks/reflogD-6Thw', '-x'] From python-checkins at python.org Sat Jan 1 05:32:14 2011 From: python-checkins at python.org (richard.tew) Date: Sat, 1 Jan 2011 05:32:14 +0100 (CET) Subject: [Python-checkins] r87602 - svn:log Message-ID: <20110101043214.F178CEEB0B@mail.python.org> Author: richard.tew Revision: 87602 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -8717,8 +8717,3 @@ 2.7.1 final version bump ................ - -Remaining work before release: -- 'test__all__' modifies the environment and raises a flag in Python unit test execution. -- 'configure' needs to be rebuilt. -- Kristjan wants to check in some changes to get them included. \ No newline at end of file From python-checkins at python.org Sat Jan 1 10:06:37 2011 From: python-checkins at python.org (tarek.ziade) Date: Sat, 01 Jan 2011 10:06:37 +0100 Subject: [Python-checkins] distutils2: allowing predicates without parenthesis -- that's how the install script will Message-ID: tarek.ziade pushed edb34bfee375 to distutils2: http://hg.python.org/distutils2/rev/edb34bfee375 changeset: 853:edb34bfee375 tag: tip user: Tarek Ziade date: Sat Jan 01 10:05:56 2011 +0100 summary: allowing predicates without parenthesis -- that's how the install script will work files: distutils2/tests/test_version.py distutils2/version.py diff --git a/distutils2/tests/test_version.py b/distutils2/tests/test_version.py --- a/distutils2/tests/test_version.py +++ b/distutils2/tests/test_version.py @@ -196,6 +196,8 @@ self.assertRaises(ValueError, VersionPredicate, '') + self.assertTrue(VersionPredicate('Hey 2.5').match('2.5.1')) + # XXX need to silent the micro version in this case #assert not VersionPredicate('Ho (<3.0,!=2.6)').match('2.6.3') @@ -220,6 +222,7 @@ for version in other_versions: self.assertFalse(V(version).is_final) + class VersionWhiteBoxTestCase(unittest.TestCase): def test_parse_numdots(self): diff --git a/distutils2/version.py b/distutils2/version.py --- a/distutils2/version.py +++ b/distutils2/version.py @@ -323,7 +323,7 @@ _PREDICATE = re.compile(r"(?i)^\s*([a-z_][\sa-zA-Z_-]*(?:\.[a-z_]\w*)*)(.*)") -_VERSIONS = re.compile(r"^\s*\((.*)\)\s*$") +_VERSIONS = re.compile(r"^\s*\((?P.*)\)\s*$|^\s*(?P.*)\s*$") _PLAIN_VERSIONS = re.compile(r"^\s*(.*)\s*$") _SPLIT_CMP = re.compile(r"^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$") @@ -358,14 +358,20 @@ name, predicates = match.groups() self.name = name.strip() - predicates = predicates.strip() - predicates = _VERSIONS.match(predicates) + self.predicates = [] + predicates = _VERSIONS.match(predicates.strip()) if predicates is not None: - predicates = predicates.groups()[0] - self.predicates = [_split_predicate(pred.strip()) - for pred in predicates.split(',')] - else: - self.predicates = [] + predicates = predicates.groupdict() + if predicates['versions'] is not None: + versions = predicates['versions'] + else: + versions = predicates.get('versions2') + + if versions is not None: + for version in versions.split(','): + if version.strip() == '': + continue + self.predicates.append(_split_predicate(version)) def match(self, version): """Check if the provided version matches the predicates.""" -- Repository URL: http://hg.python.org/distutils2 From python-checkins at python.org Sat Jan 1 10:48:12 2011 From: python-checkins at python.org (tarek.ziade) Date: Sat, 01 Jan 2011 10:48:12 +0100 Subject: [Python-checkins] distutils2: added a log Message-ID: tarek.ziade pushed 9ddc3c5388e6 to distutils2: http://hg.python.org/distutils2/rev/9ddc3c5388e6 changeset: 855:9ddc3c5388e6 user: Tarek Ziade date: Sat Jan 01 10:14:04 2011 +0100 summary: added a log files: distutils2/index/simple.py diff --git a/distutils2/index/simple.py b/distutils2/index/simple.py --- a/distutils2/index/simple.py +++ b/distutils2/index/simple.py @@ -14,6 +14,7 @@ import logging import os +from distutils2 import logger from distutils2.index.base import BaseClient from distutils2.index.dist import (ReleasesList, EXTENSIONS, get_infos_from_url, MD5_HASH) @@ -167,6 +168,7 @@ if predicate.name.lower() in self._projects and not force_update: return self._projects.get(predicate.name.lower()) prefer_final = self._get_prefer_final(prefer_final) + logger.info('Reading info on PyPI about %s' % predicate.name) self._process_index_page(predicate.name) if predicate.name.lower() not in self._projects: -- Repository URL: http://hg.python.org/distutils2 From python-checkins at python.org Sat Jan 1 10:48:12 2011 From: python-checkins at python.org (tarek.ziade) Date: Sat, 01 Jan 2011 10:48:12 +0100 Subject: [Python-checkins] distutils2: make sure get_last() returns None in case no release matches Message-ID: tarek.ziade pushed 4ee28ba88ed4 to distutils2: http://hg.python.org/distutils2/rev/4ee28ba88ed4 changeset: 854:4ee28ba88ed4 user: Tarek Ziade date: Sat Jan 01 10:13:28 2011 +0100 summary: make sure get_last() returns None in case no release matches files: distutils2/index/dist.py distutils2/tests/test_index_dist.py diff --git a/distutils2/index/dist.py b/distutils2/index/dist.py --- a/distutils2/index/dist.py +++ b/distutils2/index/dist.py @@ -376,6 +376,8 @@ """ predicate = get_version_predicate(requirements) releases = self.filter(predicate) + if len(releases) == 0: + return None releases.sort_releases(prefer_final, reverse=True) return releases[0] diff --git a/distutils2/tests/test_index_dist.py b/distutils2/tests/test_index_dist.py --- a/distutils2/tests/test_index_dist.py +++ b/distutils2/tests/test_index_dist.py @@ -237,6 +237,10 @@ # dists.sort_distributions(prefer_source=True) # self.assertEqual(fb2_binary, dists[0]) + def test_get_last(self): + dists = ReleasesList('Foo') + self.assertEqual(dists.get_last('Foo 1.0'), None) + def test_suite(): suite = unittest.TestSuite() -- Repository URL: http://hg.python.org/distutils2 From python-checkins at python.org Sat Jan 1 10:48:12 2011 From: python-checkins at python.org (tarek.ziade) Date: Sat, 01 Jan 2011 10:48:12 +0100 Subject: [Python-checkins] distutils2: make sure project that have numbers in their names can be parsed Message-ID: tarek.ziade pushed 0de7d5f4dae5 to distutils2: http://hg.python.org/distutils2/rev/0de7d5f4dae5 changeset: 856:0de7d5f4dae5 tag: tip user: Tarek Ziade date: Sat Jan 01 10:47:44 2011 +0100 summary: make sure project that have numbers in their names can be parsed files: distutils2/tests/test_version.py distutils2/version.py diff --git a/distutils2/tests/test_version.py b/distutils2/tests/test_version.py --- a/distutils2/tests/test_version.py +++ b/distutils2/tests/test_version.py @@ -201,6 +201,15 @@ # XXX need to silent the micro version in this case #assert not VersionPredicate('Ho (<3.0,!=2.6)').match('2.6.3') + + # Make sure a predicate that ends with a number works + self.assertTrue(VersionPredicate('virtualenv5 (1.0)').match('1.0')) + self.assertTrue(VersionPredicate('virtualenv5').match('1.0')) + self.assertTrue(VersionPredicate('vi5two').match('1.0')) + self.assertTrue(VersionPredicate('5two').match('1.0')) + self.assertTrue(VersionPredicate('vi5two 1.0').match('1.0')) + self.assertTrue(VersionPredicate('5two 1.0').match('1.0')) + # test repr for predicate in predicates: self.assertEqual(str(VersionPredicate(predicate)), predicate) diff --git a/distutils2/version.py b/distutils2/version.py --- a/distutils2/version.py +++ b/distutils2/version.py @@ -322,7 +322,8 @@ return None -_PREDICATE = re.compile(r"(?i)^\s*([a-z_][\sa-zA-Z_-]*(?:\.[a-z_]\w*)*)(.*)") +# A predicate is: "ProjectName (VERSION1, VERSION2, ..) +_PREDICATE = re.compile(r"(?i)^\s*(\w[\s\w-]*(?:\.\w*)*)(.*)") _VERSIONS = re.compile(r"^\s*\((?P.*)\)\s*$|^\s*(?P.*)\s*$") _PLAIN_VERSIONS = re.compile(r"^\s*(.*)\s*$") _SPLIT_CMP = re.compile(r"^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$") @@ -359,19 +360,24 @@ name, predicates = match.groups() self.name = name.strip() self.predicates = [] + if predicates is None: + return + predicates = _VERSIONS.match(predicates.strip()) - if predicates is not None: - predicates = predicates.groupdict() - if predicates['versions'] is not None: - versions = predicates['versions'] - else: - versions = predicates.get('versions2') + if predicates is None: + return - if versions is not None: - for version in versions.split(','): - if version.strip() == '': - continue - self.predicates.append(_split_predicate(version)) + predicates = predicates.groupdict() + if predicates['versions'] is not None: + versions = predicates['versions'] + else: + versions = predicates.get('versions2') + + if versions is not None: + for version in versions.split(','): + if version.strip() == '': + continue + self.predicates.append(_split_predicate(version)) def match(self, version): """Check if the provided version matches the predicates.""" -- Repository URL: http://hg.python.org/distutils2 From python-checkins at python.org Sat Jan 1 11:07:30 2011 From: python-checkins at python.org (georg.brandl) Date: Sat, 1 Jan 2011 11:07:30 +0100 (CET) Subject: [Python-checkins] r87603 - python/branches/py3k/Misc/NEWS Message-ID: <20110101100730.BE5B9EE987@mail.python.org> Author: georg.brandl Date: Sat Jan 1 11:07:30 2011 New Revision: 87603 Log: Fix issue references. Modified: python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 1 11:07:30 2011 @@ -20,27 +20,27 @@ Library ------- -- Issue 6285: IDLE no longer crashes on missing help file; patch by Scott David - Daniels. +- Issue #6285: IDLE no longer crashes on missing help file; patch by Scott + David Daniels. - Fix collections.OrderedDict.setdefault() so that it works in subclasses that define __missing__(). -- Issue 10786: unittest.TextTestRunner default stream no longer bound at - import time. `sys.stderr` now looked up at instantiation time. Fix contributed - by Mark Roddy. +- Issue #10786: unittest.TextTestRunner default stream no longer bound at + import time. `sys.stderr` now looked up at instantiation time. Fix + contributed by Mark Roddy. -- Issue 10753 - Characters ';','=' and ',' in the PATH_INFO environment +- Issue #10753: Characters ';','=' and ',' in the PATH_INFO environment variable won't be quoted when the URI is constructed by the wsgiref.util 's request_uri method. According to RFC 3986, these characters can be a part of params in PATH component of URI and need not be quoted. -- Issue 10738: Fix webbrowser.Opera.raise_opts +- Issue #10738: Fix webbrowser.Opera.raise_opts. -- Issue 9824: SimpleCookie now encodes , and ; in values to cater to how +- Issue #9824: SimpleCookie now encodes , and ; in values to cater to how browsers actually parse cookies. -- Issue 9333: os.symlink now available regardless of user privileges. +- Issue #9333: os.symlink now available regardless of user privileges. The function now raises OSError on Windows >=6.0 when the user is unable to create symbolic links. XP and 2003 still raise NotImplementedError. From python-checkins at python.org Sat Jan 1 11:09:32 2011 From: python-checkins at python.org (georg.brandl) Date: Sat, 1 Jan 2011 11:09:32 +0100 (CET) Subject: [Python-checkins] r87604 - in python/branches/py3k: Lib/test/test_zipfile.py Lib/test/zip_cp437_header.zip Lib/zipfile.py Misc/NEWS Message-ID: <20110101100932.C595DEE9E1@mail.python.org> Author: georg.brandl Date: Sat Jan 1 11:09:32 2011 New Revision: 87604 Log: #10801: In zipfile, support different encodings for the header and the filenames. Patch by MvL, test by Eli Bendersky. Added: python/branches/py3k/Lib/test/zip_cp437_header.zip (contents, props changed) Modified: python/branches/py3k/Lib/test/test_zipfile.py python/branches/py3k/Lib/zipfile.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/test/test_zipfile.py ============================================================================== --- python/branches/py3k/Lib/test/test_zipfile.py (original) +++ python/branches/py3k/Lib/test/test_zipfile.py Sat Jan 1 11:09:32 2011 @@ -6,6 +6,7 @@ import io import os +import sys import imp import time import shutil @@ -23,6 +24,7 @@ TESTFN2 = TESTFN + "2" TESTFNDIR = TESTFN + "d" FIXEDTEST_SIZE = 1000 +DATAFILES_DIR = 'zipfile_datafiles' SMALL_TEST_DATA = [('_ziptest1', '1q2w3e4r5t'), ('ziptest2dir/_ziptest2', 'qawsedrftg'), @@ -487,6 +489,18 @@ except zipfile.BadZipFile: self.assertTrue(zipfp2.fp is None, 'zipfp is not closed') + def test_unicode_filenames(self): + if __name__ == '__main__': + myfile = sys.argv[0] + else: + myfile = __file__ + + mydir = os.path.dirname(myfile) or os.curdir + fname = os.path.join(mydir, 'zip_cp437_header.zip') + + with zipfile.ZipFile(fname) as zipfp: + zipfp.extractall() + def tearDown(self): unlink(TESTFN) unlink(TESTFN2) Added: python/branches/py3k/Lib/test/zip_cp437_header.zip ============================================================================== Binary file. No diff available. Modified: python/branches/py3k/Lib/zipfile.py ============================================================================== --- python/branches/py3k/Lib/zipfile.py (original) +++ python/branches/py3k/Lib/zipfile.py Sat Jan 1 11:09:32 2011 @@ -930,7 +930,13 @@ if fheader[_FH_EXTRA_FIELD_LENGTH]: zef_file.read(fheader[_FH_EXTRA_FIELD_LENGTH]) - if fname != zinfo.orig_filename.encode("utf-8"): + if zinfo.flag_bits & 0x800: + # UTF-8 filename + fname_str = fname.decode("utf-8") + else: + fname_str = fname.decode("cp437") + + if fname_str != zinfo.orig_filename: if not self._filePassed: zef_file.close() raise BadZipFile( Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat Jan 1 11:09:32 2011 @@ -20,6 +20,9 @@ Library ------- +- Issue #10801: In zipfile, support different encodings for the header and + the filenames. + - Issue #6285: IDLE no longer crashes on missing help file; patch by Scott David Daniels. From python-checkins at python.org Sat Jan 1 11:42:32 2011 From: python-checkins at python.org (georg.brandl) Date: Sat, 1 Jan 2011 11:42:32 +0100 (CET) Subject: [Python-checkins] r87606 - python/branches/py3k/Lib/test/test_zipfile.py Message-ID: <20110101104232.09AFAEE9A3@mail.python.org> Author: georg.brandl Date: Sat Jan 1 11:42:31 2011 New Revision: 87606 Log: #10801: do not actually extract, just open() the files in the test zipfile. Modified: python/branches/py3k/Lib/test/test_zipfile.py Modified: python/branches/py3k/Lib/test/test_zipfile.py ============================================================================== --- python/branches/py3k/Lib/test/test_zipfile.py (original) +++ python/branches/py3k/Lib/test/test_zipfile.py Sat Jan 1 11:42:31 2011 @@ -490,16 +490,11 @@ self.assertTrue(zipfp2.fp is None, 'zipfp is not closed') def test_unicode_filenames(self): - if __name__ == '__main__': - myfile = sys.argv[0] - else: - myfile = __file__ - - mydir = os.path.dirname(myfile) or os.curdir - fname = os.path.join(mydir, 'zip_cp437_header.zip') - + # bug #10801 + fname = findfile('zip_cp437_header.zip') with zipfile.ZipFile(fname) as zipfp: - zipfp.extractall() + for name in zipfp.namelist(): + zipfp.open(name).close() def tearDown(self): unlink(TESTFN) From python-checkins at python.org Sat Jan 1 15:28:32 2011 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 1 Jan 2011 15:28:32 +0100 (CET) Subject: [Python-checkins] r87607 - python/branches/py3k/Python/getcopyright.c Message-ID: <20110101142832.3515BEE98A@mail.python.org> Author: benjamin.peterson Date: Sat Jan 1 15:28:31 2011 New Revision: 87607 Log: update copyright to 2011 Modified: python/branches/py3k/Python/getcopyright.c Modified: python/branches/py3k/Python/getcopyright.c ============================================================================== --- python/branches/py3k/Python/getcopyright.c (original) +++ python/branches/py3k/Python/getcopyright.c Sat Jan 1 15:28:31 2011 @@ -4,7 +4,7 @@ static char cprt[] = "\ -Copyright (c) 2001-2010 Python Software Foundation.\n\ +Copyright (c) 2001-2011 Python Software Foundation.\n\ All Rights Reserved.\n\ \n\ Copyright (c) 2000 BeOpen.com.\n\ From python-checkins at python.org Sat Jan 1 15:30:24 2011 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 1 Jan 2011 15:30:24 +0100 (CET) Subject: [Python-checkins] r87608 - in python/branches/release27-maint: Python/getcopyright.c Message-ID: <20110101143024.7E149EE98A@mail.python.org> Author: benjamin.peterson Date: Sat Jan 1 15:30:24 2011 New Revision: 87608 Log: Merged revisions 87607 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r87607 | benjamin.peterson | 2011-01-01 08:28:31 -0600 (Sat, 01 Jan 2011) | 1 line update copyright to 2011 ........ Modified: python/branches/release27-maint/ (props changed) python/branches/release27-maint/Python/getcopyright.c Modified: python/branches/release27-maint/Python/getcopyright.c ============================================================================== --- python/branches/release27-maint/Python/getcopyright.c (original) +++ python/branches/release27-maint/Python/getcopyright.c Sat Jan 1 15:30:24 2011 @@ -4,7 +4,7 @@ static char cprt[] = "\ -Copyright (c) 2001-2010 Python Software Foundation.\n\ +Copyright (c) 2001-2011 Python Software Foundation.\n\ All Rights Reserved.\n\ \n\ Copyright (c) 2000 BeOpen.com.\n\ From python-checkins at python.org Sat Jan 1 16:32:26 2011 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 1 Jan 2011 16:32:26 +0100 (CET) Subject: [Python-checkins] r87609 - in python/branches/release31-maint: Python/getcopyright.c Message-ID: <20110101153226.74922EE983@mail.python.org> Author: benjamin.peterson Date: Sat Jan 1 16:32:26 2011 New Revision: 87609 Log: Merged revisions 87607 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r87607 | benjamin.peterson | 2011-01-01 08:28:31 -0600 (Sat, 01 Jan 2011) | 1 line update copyright to 2011 ........ Modified: python/branches/release31-maint/ (props changed) python/branches/release31-maint/Python/getcopyright.c Modified: python/branches/release31-maint/Python/getcopyright.c ============================================================================== --- python/branches/release31-maint/Python/getcopyright.c (original) +++ python/branches/release31-maint/Python/getcopyright.c Sat Jan 1 16:32:26 2011 @@ -4,7 +4,7 @@ static char cprt[] = "\ -Copyright (c) 2001-2010 Python Software Foundation.\n\ +Copyright (c) 2001-2011 Python Software Foundation.\n\ All Rights Reserved.\n\ \n\ Copyright (c) 2000 BeOpen.com.\n\ From python-checkins at python.org Sat Jan 1 22:18:46 2011 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 1 Jan 2011 22:18:46 +0100 (CET) Subject: [Python-checkins] r87610 - python/branches/py3k/Include/patchlevel.h Message-ID: <20110101211846.63121EE981@mail.python.org> Author: gregory.p.smith Date: Sat Jan 1 22:18:46 2011 New Revision: 87610 Log: post release bump Modified: python/branches/py3k/Include/patchlevel.h Modified: python/branches/py3k/Include/patchlevel.h ============================================================================== --- python/branches/py3k/Include/patchlevel.h (original) +++ python/branches/py3k/Include/patchlevel.h Sat Jan 1 22:18:46 2011 @@ -23,7 +23,7 @@ #define PY_RELEASE_SERIAL 2 /* Version as a string */ -#define PY_VERSION "3.2b2" +#define PY_VERSION "3.2b2+" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ From python-checkins at python.org Sat Jan 1 23:38:00 2011 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 1 Jan 2011 23:38:00 +0100 (CET) Subject: [Python-checkins] r87611 - in python/branches/py3k/Lib: collections.py test/test_collections.py Message-ID: <20110101223800.55157EE9B4@mail.python.org> Author: raymond.hettinger Date: Sat Jan 1 23:38:00 2011 New Revision: 87611 Log: Make it easier to extend OrderedDict without breaking it. Modified: python/branches/py3k/Lib/collections.py python/branches/py3k/Lib/test/test_collections.py Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Sat Jan 1 23:38:00 2011 @@ -52,7 +52,7 @@ self.__root = root = _proxy(self.__hardroot) root.prev = root.next = root self.__map = {} - self.update(*args, **kwds) + self.__update(*args, **kwds) def __setitem__(self, key, value, dict_setitem=dict.__setitem__, proxy=_proxy, Link=_Link): @@ -171,7 +171,7 @@ size += sizeof(self.__root) * n # proxy objects return size - update = MutableMapping.update + update = __update = MutableMapping.update pop = MutableMapping.pop keys = MutableMapping.keys values = MutableMapping.values Modified: python/branches/py3k/Lib/test/test_collections.py ============================================================================== --- python/branches/py3k/Lib/test/test_collections.py (original) +++ python/branches/py3k/Lib/test/test_collections.py Sat Jan 1 23:38:00 2011 @@ -1012,6 +1012,14 @@ od = OrderedDict(**d) self.assertGreater(sys.getsizeof(od), sys.getsizeof(d)) + def test_override_update(self): + # Verify that subclasses can override update() without breaking __init__() + class MyOD(OrderedDict): + def update(self, *args, **kwds): + raise Exception() + items = [('a', 1), ('c', 3), ('b', 2)] + self.assertEqual(list(MyOD(items).items()), items) + class GeneralMappingTests(mapping_tests.BasicTestMappingProtocol): type2test = OrderedDict From python-checkins at python.org Sun Jan 2 00:51:55 2011 From: python-checkins at python.org (raymond.hettinger) Date: Sun, 2 Jan 2011 00:51:55 +0100 (CET) Subject: [Python-checkins] r87612 - in python/branches/py3k/Lib: collections.py test/test_collections.py Message-ID: <20110101235155.59973EE981@mail.python.org> Author: raymond.hettinger Date: Sun Jan 2 00:51:55 2011 New Revision: 87612 Log: Fix OrderedDic.pop() to work for subclasses that define __missing__(). Modified: python/branches/py3k/Lib/collections.py python/branches/py3k/Lib/test/test_collections.py Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Sun Jan 2 00:51:55 2011 @@ -22,7 +22,7 @@ class _Link(object): __slots__ = 'prev', 'next', 'key', '__weakref__' -class OrderedDict(dict, MutableMapping): +class OrderedDict(dict): 'Dictionary that remembers insertion order' # An inherited dict maps keys to values. # The inherited dict provides __getitem__, __len__, __contains__, and get. @@ -172,12 +172,22 @@ return size update = __update = MutableMapping.update - pop = MutableMapping.pop keys = MutableMapping.keys values = MutableMapping.values items = MutableMapping.items __ne__ = MutableMapping.__ne__ + __marker = object() + + def pop(self, key, default=__marker): + if key in self: + result = self[key] + del self[key] + return result + if default is self.__marker: + raise KeyError(key) + return default + def setdefault(self, key, default=None): 'OD.setdefault(k[,d]) -> OD.get(k,d), also set OD[k]=d if k not in OD' if key in self: Modified: python/branches/py3k/Lib/test/test_collections.py ============================================================================== --- python/branches/py3k/Lib/test/test_collections.py (original) +++ python/branches/py3k/Lib/test/test_collections.py Sun Jan 2 00:51:55 2011 @@ -834,6 +834,10 @@ self.assertEqual(list(d.items()), [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5), ('f', 6), ('g', 7)]) + def test_abc(self): + self.assertIsInstance(OrderedDict(), MutableMapping) + self.assertTrue(issubclass(OrderedDict, MutableMapping)) + def test_clear(self): pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)] shuffle(pairs) @@ -892,6 +896,17 @@ self.assertEqual(len(od), 0) self.assertEqual(od.pop(k, 12345), 12345) + # make sure pop still works when __missing__ is defined + class Missing(OrderedDict): + def __missing__(self, key): + return 0 + m = Missing(a=1) + self.assertEqual(m.pop('b', 5), 5) + self.assertEqual(m.pop('a', 6), 1) + self.assertEqual(m.pop('a', 6), 6) + with self.assertRaises(KeyError): + m.pop('a') + def test_equality(self): pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)] shuffle(pairs) From python-checkins at python.org Sun Jan 2 02:03:27 2011 From: python-checkins at python.org (raymond.hettinger) Date: Sun, 2 Jan 2011 02:03:27 +0100 (CET) Subject: [Python-checkins] r87613 - in python/branches/release27-maint: Lib/collections.py Lib/test/test_collections.py Misc/NEWS Message-ID: <20110102010327.5A6ABEE9C1@mail.python.org> Author: raymond.hettinger Date: Sun Jan 2 02:03:26 2011 New Revision: 87613 Log: Raymond-Hettingers-MacBook-Pro:py27 raymondhettinger$ cat svn-commit.tmp Backport r87594 r87611 and r87612 so that OrderedDict subclassing behavior better matches dict subclassing (i.e. adding __missing__ works and extending/overriding the update() methods doesn't break __init__()). Modified: python/branches/release27-maint/Lib/collections.py python/branches/release27-maint/Lib/test/test_collections.py python/branches/release27-maint/Misc/NEWS Modified: python/branches/release27-maint/Lib/collections.py ============================================================================== --- python/branches/release27-maint/Lib/collections.py (original) +++ python/branches/release27-maint/Lib/collections.py Sun Jan 2 02:03:26 2011 @@ -43,7 +43,7 @@ ### OrderedDict ################################################################################ -class OrderedDict(dict, MutableMapping): +class OrderedDict(dict): 'Dictionary that remembers insertion order' # An inherited dict maps keys to values. # The inherited dict provides __getitem__, __len__, __contains__, and get. @@ -71,7 +71,7 @@ NEXT = 1 root[PREV] = root[NEXT] = root self.__map = {} - self.update(*args, **kwds) + self.__update(*args, **kwds) def __setitem__(self, key, value, PREV=0, NEXT=1, dict_setitem=dict.__setitem__): 'od.__setitem__(i, y) <==> od[i]=y' @@ -134,9 +134,7 @@ pass dict.clear(self) - setdefault = MutableMapping.setdefault - update = MutableMapping.update - pop = MutableMapping.pop + update = __update = MutableMapping.update keys = MutableMapping.keys values = MutableMapping.values items = MutableMapping.items @@ -157,6 +155,24 @@ "od.viewitems() -> a set-like object providing a view on od's items" return ItemsView(self) + __marker = object() + + def pop(self, key, default=__marker): + if key in self: + result = self[key] + del self[key] + return result + if default is self.__marker: + raise KeyError(key) + return default + + def setdefault(self, key, default=None): + 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od' + if key in self: + return self[key] + self[key] = default + return default + def popitem(self, last=True): '''od.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. Modified: python/branches/release27-maint/Lib/test/test_collections.py ============================================================================== --- python/branches/release27-maint/Lib/test/test_collections.py (original) +++ python/branches/release27-maint/Lib/test/test_collections.py Sun Jan 2 02:03:26 2011 @@ -812,6 +812,10 @@ self.assertEqual(list(d.items()), [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5), ('f', 6), ('g', 7)]) + def test_abc(self): + self.assertIsInstance(OrderedDict(), MutableMapping) + self.assertTrue(issubclass(OrderedDict, MutableMapping)) + def test_clear(self): pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)] shuffle(pairs) @@ -873,6 +877,17 @@ self.assertEqual(len(od), 0) self.assertEqual(od.pop(k, 12345), 12345) + # make sure pop still works when __missing__ is defined + class Missing(OrderedDict): + def __missing__(self, key): + return 0 + m = Missing(a=1) + self.assertEqual(m.pop('b', 5), 5) + self.assertEqual(m.pop('a', 6), 1) + self.assertEqual(m.pop('a', 6), 6) + with self.assertRaises(KeyError): + m.pop('a') + def test_equality(self): pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)] shuffle(pairs) @@ -956,6 +971,12 @@ # make sure 'x' is added to the end self.assertEqual(list(od.items())[-1], ('x', 10)) + # make sure setdefault still works when __missing__ is defined + class Missing(OrderedDict): + def __missing__(self, key): + return 0 + self.assertEqual(Missing().setdefault(5, 9), 9) + def test_reinsert(self): # Given insert a, insert b, delete a, re-insert a, # verify that a is now later than b. @@ -973,6 +994,13 @@ self.assertEqual(list(od.viewvalues()), [None for k in s]) self.assertEqual(list(od.viewitems()), [(k, None) for k in s]) + def test_override_update(self): + # Verify that subclasses can override update() without breaking __init__() + class MyOD(OrderedDict): + def update(self, *args, **kwds): + raise Exception() + items = [('a', 1), ('c', 3), ('b', 2)] + self.assertEqual(list(MyOD(items).items()), items) class GeneralMappingTests(mapping_tests.BasicTestMappingProtocol): type2test = OrderedDict Modified: python/branches/release27-maint/Misc/NEWS ============================================================================== --- python/branches/release27-maint/Misc/NEWS (original) +++ python/branches/release27-maint/Misc/NEWS Sun Jan 2 02:03:26 2011 @@ -22,6 +22,8 @@ Library ------- +- Subclasses of collections.OrderedDict now work correctly with __missing__. + - Issue 10753 - Characters ';','=' and ',' in the PATH_INFO environment variable won't be quoted when the URI is constructed by the wsgiref.util 's request_uri method. According to RFC 3986, these characters can be a part of From solipsis at pitrou.net Sun Jan 2 04:55:30 2011 From: solipsis at pitrou.net (solipsis at pitrou.net) Date: Sun, 02 Jan 2011 04:55:30 +0100 Subject: [Python-checkins] Daily py3k reference leaks (r87612): sum=0 Message-ID: py3k results for svn r87612 (hg cset 936cee5928d7) -------------------------------------------------- Command line was: ['./python', '-m', 'test.regrtest', '-uall', '-R', '3:3:/home/antoine/py3k/refleaks/reflogIKcdtq', '-x'] From python-checkins at python.org Sun Jan 2 09:03:33 2011 From: python-checkins at python.org (raymond.hettinger) Date: Sun, 2 Jan 2011 09:03:33 +0100 (CET) Subject: [Python-checkins] r87615 - python/branches/py3k/Lib/collections.py Message-ID: <20110102080333.624BFEE993@mail.python.org> Author: raymond.hettinger Date: Sun Jan 2 09:03:33 2011 New Revision: 87615 Log: Fix doctest to not rely on order of dictionary entries. Use super() instead of direct references to the dict superclass. Modified: python/branches/py3k/Lib/collections.py Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Sun Jan 2 09:03:33 2011 @@ -366,16 +366,16 @@ or multiset. Elements are stored as dictionary keys and their counts are stored as dictionary values. - >>> c = Counter('abracadabra') # count elements from a string + >>> c = Counter('abcdeabcdabcaba') # count elements from a string >>> c.most_common(3) # three most common elements - [('a', 5), ('r', 2), ('b', 2)] + [('a', 5), ('b', 4), ('c', 3)] >>> sorted(c) # list all unique elements - ['a', 'b', 'c', 'd', 'r'] + ['a', 'b', 'c', 'd', 'e'] >>> ''.join(sorted(c.elements())) # list elements with repetitions - 'aaaaabbcdrr' + 'aaaaabbbbcccdde' >>> sum(c.values()) # total of all counts - 11 + 15 >>> c['a'] # count of letter 'a' 5 @@ -383,8 +383,8 @@ ... c[elem] += 1 # by adding 1 to each element's count >>> c['a'] # now there are seven 'a' 7 - >>> del c['r'] # remove all 'r' - >>> c['r'] # now there are zero 'r' + >>> del c['b'] # remove all 'b' + >>> c['b'] # now there are zero 'b' 0 >>> d = Counter('simsalabim') # make another counter @@ -423,6 +423,7 @@ >>> c = Counter(a=4, b=2) # a new counter from keyword args ''' + super().__init__() self.update(iterable, **kwds) def __missing__(self, key): @@ -434,8 +435,8 @@ '''List the n most common elements and their counts from the most common to the least. If n is None, then list all element counts. - >>> Counter('abracadabra').most_common(3) - [('a', 5), ('r', 2), ('b', 2)] + >>> Counter('abcdeabcdabcaba').most_common(3) + [('a', 5), ('b', 4), ('c', 3)] ''' # Emulate Bag.sortedByCount from Smalltalk @@ -501,7 +502,7 @@ for elem, count in iterable.items(): self[elem] = count + self_get(elem, 0) else: - dict.update(self, iterable) # fast path when counter is empty + super().update(iterable) # fast path when counter is empty else: _count_elements(self, iterable) if kwds: @@ -541,7 +542,7 @@ def __delitem__(self, elem): 'Like dict.__delitem__() but does not raise KeyError for missing values.' if elem in self: - dict.__delitem__(self, elem) + super().__delitem__(elem) def __repr__(self): if not self: From python-checkins at python.org Sun Jan 2 13:18:44 2011 From: python-checkins at python.org (stefan.krah) Date: Sun, 2 Jan 2011 13:18:44 +0100 (CET) Subject: [Python-checkins] r87616 - in python/branches/py3k-cdecimal: .gitignore Demo Doc/ACKS.txt Doc/README.txt Doc/c-api/buffer.rst Doc/c-api/codec.rst Doc/c-api/exceptions.rst Doc/c-api/import.rst Doc/c-api/init.rst Doc/c-api/intro.rst Doc/c-api/list.rst Doc/c-api/slice.rst Doc/c-api/typeobj.rst Doc/c-api/unicode.rst Doc/c-api/veryhigh.rst Doc/copyright.rst Doc/distutils/apiref.rst Doc/documenting/markup.rst Doc/extending/embedding.rst Doc/extending/extending.rst Doc/extending/windows.rst Doc/faq/extending.rst Doc/glossary.rst Doc/howto/index.rst Doc/howto/logging-cookbook.rst Doc/howto/logging.rst Doc/includes/tzinfo-examples.py Doc/install/index.rst Doc/library/_thread.rst Doc/library/allos.rst Doc/library/argparse.rst Doc/library/array.rst Doc/library/bdb.rst Doc/library/builtins.rst Doc/library/codecs.rst Doc/library/collections.rst Doc/library/compileall.rst Doc/library/concurrent.futures.rst Doc/library/configparser.rst Doc/library/ctypes.rst Doc/library/curses.rst Doc/library/dbm.rst Doc/library/difflib.rst Doc/library/dis.rst Doc/library/doctest.rst Doc/library/email.header.rst Doc/library/email.message.rst Doc/library/email.util.rst Doc/library/exceptions.rst Doc/library/fileformats.rst Doc/library/functions.rst Doc/library/functools.rst Doc/library/grp.rst Doc/library/hashlib.rst Doc/library/heapq.rst Doc/library/html.parser.rst Doc/library/http.client.rst Doc/library/imp.rst Doc/library/inspect.rst Doc/library/io.rst Doc/library/itertools.rst Doc/library/logging.config.rst Doc/library/logging.handlers.rst Doc/library/logging.rst Doc/library/msilib.rst Doc/library/multiprocessing.rst Doc/library/os.path.rst Doc/library/os.rst Doc/library/parser.rst Doc/library/pdb.rst Doc/library/pickle.rst Doc/library/pkgutil.rst Doc/library/platform.rst Doc/library/pty.rst Doc/library/py_compile.rst Doc/library/pydoc.rst Doc/library/random.rst Doc/library/re.rst Doc/library/runpy.rst Doc/library/shelve.rst Doc/library/socket.rst Doc/library/someos.rst Doc/library/sqlite3.rst Doc/library/stdtypes.rst Doc/library/string.rst Doc/library/struct.rst Doc/library/subprocess.rst Doc/library/sys.rst Doc/library/test.rst Doc/library/textwrap.rst Doc/library/threading.rst Doc/library/tkinter.rst Doc/library/tkinter.tix.rst Doc/library/trace.rst Doc/library/turtle.rst Doc/library/unicodedata.rst Doc/library/unittest.rst Doc/library/urllib.parse.rst Doc/library/urllib.request.rst Doc/library/warnings.rst Doc/library/xml.dom.minidom.rst Doc/library/zipfile.rst Doc/license.rst Doc/reference/datamodel.rst Doc/reference/expressions.rst Doc/reference/lexical_analysis.rst Doc/tools/sphinxext/static/basic.css Doc/tools/sphinxext/susp-ignored.csv Doc/tutorial/interpreter.rst Doc/tutorial/stdlib.rst Doc/using/cmdline.rst Doc/whatsnew/2.7.rst Doc/whatsnew/3.2.rst Include/Python.h Include/abstract.h Include/ast.h Include/bytearrayobject.h Include/bytes_methods.h Include/bytesobject.h Include/cellobject.h Include/ceval.h Include/classobject.h Include/code.h Include/codecs.h Include/compile.h Include/complexobject.h Include/datetime.h Include/descrobject.h Include/dictobject.h Include/dtoa.h Include/eval.h Include/fileobject.h Include/floatobject.h Include/frameobject.h Include/funcobject.h Include/genobject.h Include/import.h Include/listobject.h Include/longintrepr.h Include/longobject.h Include/marshal.h Include/memoryobject.h Include/methodobject.h Include/modsupport.h Include/moduleobject.h Include/object.h Include/objimpl.h Include/parsetok.h Include/patchlevel.h Include/pyarena.h Include/pyatomic.h Include/pyctype.h Include/pydebug.h Include/pyerrors.h Include/pygetopt.h Include/pymath.h Include/pystate.h Include/pystrtod.h Include/pythonrun.h Include/pythread.h Include/pytime.h Include/setobject.h Include/sliceobject.h Include/structseq.h Include/symtable.h Include/sysmodule.h Include/timefuncs.h Include/token.h Include/traceback.h Include/tupleobject.h Include/typeslots.h Include/ucnhash.h Include/unicodeobject.h Include/warnings.h Include/weakrefobject.h LICENSE Lib/_abcoll.py Lib/_pyio.py Lib/_weakrefset.py Lib/argparse.py Lib/bdb.py Lib/codecs.py Lib/collections.py Lib/compileall.py Lib/concurrent/futures/_base.py Lib/concurrent/futures/process.py Lib/configparser.py Lib/dbm/dumb.py Lib/decimal.py Lib/difflib.py Lib/distutils/__init__.py Lib/distutils/archive_util.py Lib/distutils/command/build_ext.py Lib/distutils/command/install.py Lib/distutils/sysconfig.py Lib/doctest.py Lib/email/_parseaddr.py Lib/email/generator.py Lib/email/header.py Lib/email/message.py Lib/email/test/test_email.py Lib/email/utils.py Lib/encodings/aliases.py Lib/encodings/base64_codec.py Lib/encodings/bz2_codec.py Lib/encodings/hex_codec.py Lib/encodings/quopri_codec.py Lib/encodings/rot_13.py Lib/encodings/uu_codec.py Lib/encodings/zlib_codec.py Lib/functools.py Lib/getpass.py Lib/gettext.py Lib/html/parser.py Lib/http/client.py Lib/http/cookies.py Lib/http/server.py Lib/idlelib/Bindings.py Lib/idlelib/EditorWindow.py Lib/idlelib/FileList.py Lib/idlelib/IOBinding.py Lib/idlelib/idlever.py Lib/idlelib/macosxSupport.py Lib/inspect.py Lib/json/tests Lib/lib2to3 Lib/lib2to3/fixes/fix_urllib.py Lib/lib2to3/main.py Lib/lib2to3/refactor.py Lib/lib2to3/tests/test_refactor.py Lib/lib2to3/tests/test_util.py Lib/logging/__init__.py Lib/mimetypes.py Lib/multiprocessing/__init__.py Lib/multiprocessing/connection.py Lib/multiprocessing/dummy/__init__.py Lib/multiprocessing/dummy/connection.py Lib/multiprocessing/forking.py Lib/multiprocessing/heap.py Lib/multiprocessing/managers.py Lib/multiprocessing/pool.py Lib/multiprocessing/process.py Lib/multiprocessing/queues.py Lib/multiprocessing/reduction.py Lib/multiprocessing/sharedctypes.py Lib/multiprocessing/synchronize.py Lib/multiprocessing/util.py Lib/netrc.py Lib/numbers.py Lib/os.py Lib/pdb.py Lib/py_compile.py Lib/pydoc.py Lib/pydoc_data/_pydoc.css Lib/pydoc_data/topics.py Lib/random.py Lib/shelve.py Lib/shutil.py Lib/site.py Lib/smtpd.py Lib/subprocess.py Lib/sysconfig.py Lib/tabnanny.py Lib/telnetlib.py Lib/tempfile.py Lib/test/__main__.py Lib/test/crashers/README Lib/test/datetimetester.py Lib/test/json_tests Lib/test/pystone.py Lib/test/regrtest.py Lib/test/script_helper.py Lib/test/subprocessdata Lib/test/support.py Lib/test/symlink_support.py Lib/test/test_abc.py Lib/test/test_argparse.py Lib/test/test_array.py Lib/test/test_asyncore.py Lib/test/test_bool.py Lib/test/test_builtin.py Lib/test/test_calendar.py Lib/test/test_cfgparser.py Lib/test/test_cgi.py Lib/test/test_cmath.py Lib/test/test_cmd_line.py Lib/test/test_codecs.py Lib/test/test_collections.py Lib/test/test_compileall.py Lib/test/test_complex.py Lib/test/test_concurrent_futures.py Lib/test/test_contextlib.py Lib/test/test_csv.py Lib/test/test_dbm_gnu.py Lib/test/test_decimal.py Lib/test/test_descr.py Lib/test/test_difflib.py Lib/test/test_dis.py Lib/test/test_float.py Lib/test/test_fork1.py Lib/test/test_fractions.py Lib/test/test_functools.py Lib/test/test_grp.py Lib/test/test_htmlparser.py Lib/test/test_http_cookies.py Lib/test/test_httplib.py Lib/test/test_httpservers.py Lib/test/test_import.py Lib/test/test_inspect.py Lib/test/test_int.py Lib/test/test_io.py Lib/test/test_itertools.py Lib/test/test_json.py Lib/test/test_listcomps.py Lib/test/test_logging.py Lib/test/test_long.py Lib/test/test_math.py Lib/test/test_memoryview.py Lib/test/test_multiprocessing.py Lib/test/test_netrc.py Lib/test/test_normalization.py Lib/test/test_ntpath.py Lib/test/test_os.py Lib/test/test_pdb.py Lib/test/test_posixpath.py Lib/test/test_pydoc.py Lib/test/test_pyexpat.py Lib/test/test_random.py Lib/test/test_range.py Lib/test/test_runpy.py Lib/test/test_shelve.py Lib/test/test_shutil.py Lib/test/test_site.py Lib/test/test_smtpd.py Lib/test/test_smtplib.py Lib/test/test_socket.py Lib/test/test_ssl.py Lib/test/test_struct.py Lib/test/test_subprocess.py Lib/test/test_sys.py Lib/test/test_syslog.py Lib/test/test_telnetlib.py Lib/test/test_tempfile.py Lib/test/test_threadsignals.py Lib/test/test_time.py Lib/test/test_trace.py Lib/test/test_tuple.py Lib/test/test_types.py Lib/test/test_unicode.py Lib/test/test_unicodedata.py Lib/test/test_unittest.py Lib/test/test_urllib.py Lib/test/test_urllib2.py Lib/test/test_urllibnet.py Lib/test/test_urlparse.py Lib/test/test_weakset.py Lib/test/test_winsound.py Lib/test/test_wsgiref.py Lib/test/test_xml_etree.py Lib/test/test_xml_etree_c.py Lib/test/test_xmlrpc.py Lib/test/test_zipfile.py Lib/test/test_zipimport_support.py Lib/test/test_zlib.py Lib/test/win_console_handler.py Lib/test/zip_cp437_header.zip Lib/threading.py Lib/tkinter/__init__.py Lib/tkinter/scrolledtext.py Lib/tkinter/test/test_ttk/test_widgets.py Lib/tkinter/tix.py Lib/turtle.py Lib/turtledemo/__main__.py Lib/turtledemo/about_turtledemo.txt Lib/turtledemo/demohelp.txt Lib/unittest/case.py Lib/unittest/main.py Lib/unittest/runner.py Lib/unittest/suite.py Lib/unittest/test/_test_warnings.py Lib/unittest/test/test_assertions.py Lib/unittest/test/test_break.py Lib/unittest/test/test_case.py Lib/unittest/test/test_discovery.py Lib/unittest/test/test_functiontestcase.py Lib/unittest/test/test_loader.py Lib/unittest/test/test_program.py Lib/unittest/test/test_runner.py Lib/unittest/test/test_setups.py Lib/unittest/test/test_suite.py Lib/unittest/util.py Lib/urllib/parse.py Lib/urllib/request.py Lib/wave.py Lib/weakref.py Lib/webbrowser.py Lib/wsgiref/util.py Lib/xml/etree/ElementTree.py Lib/xmlrpc/client.py Lib/zipfile.py Mac/BuildScript/build-installer.py Mac/Makefile.in Mac/README Makefile.pre.in Misc/ACKS Misc/NEWS Misc/README Misc/RFD Misc/RPM/python-3.2.spec Misc/SpecialBuilds.txt Misc/pymemcompat.h Misc/python-wing4.wpr Misc/python.man Misc/python.pc.in Misc/setuid-prog.c Modules/_collectionsmodule.c Modules/_ctypes/_ctypes.c Modules/_ctypes/cfield.c Modules/_datetimemodule.c Modules/_elementtree.c Modules/_functoolsmodule.c Modules/_gdbmmodule.c Modules/_io/bufferedio.c Modules/_lsprof.c Modules/_posixsubprocess.c Modules/_ssl.c Modules/_struct.c Modules/_testcapimodule.c Modules/_threadmodule.c Modules/arraymodule.c Modules/getpath.c Modules/grpmodule.c Modules/itertoolsmodule.c Modules/main.c Modules/mmapmodule.c Modules/parsermodule.c Modules/posixmodule.c Modules/pwdmodule.c Modules/pyexpat.c Modules/readline.c Modules/resource.c Modules/signalmodule.c Modules/socketmodule.c Modules/socketmodule.h Modules/spwdmodule.c Modules/symtablemodule.c Modules/syslogmodule.c Modules/timemodule.c Modules/unicodedata.c Modules/xxlimited.c Objects/bytearrayobject.c Objects/bytesobject.c Objects/complexobject.c Objects/descrobject.c Objects/floatobject.c Objects/funcobject.c Objects/genobject.c Objects/listobject.c Objects/longobject.c Objects/memoryobject.c Objects/moduleobject.c Objects/object.c Objects/obmalloc.c Objects/rangeobject.c Objects/setobject.c Objects/sliceobject.c Objects/stringlib/formatter.h Objects/structseq.c Objects/tupleobject.c Objects/typeobject.c Objects/typeslots.inc Objects/typeslots.py Objects/unicodectype.c Objects/unicodeobject.c PC/VC6/readme.txt PC/getpathp.c PC/pyconfig.h PC/python3.def PC/python3.mak PC/python32gen.py PC/python32stub.def PC/python3dll.c PC/python_nt.rc PCbuild/build_tkinter.py PCbuild/make_buildinfo.c PCbuild/pcbuild.sln PCbuild/pyproject.vsprops PCbuild/python3dll.vcproj PCbuild/pythoncore.vcproj PCbuild/readme.txt PCbuild/xxlimited.vcproj Parser/pgenmain.c Parser/printgrammar.c Parser/tokenizer.c Python/_warnings.c Python/ast.c Python/bltinmodule.c Python/ceval.c Python/compile.c Python/dynload_shlib.c Python/dynload_win.c Python/errors.c Python/future.c Python/getcopyright.c Python/import.c Python/peephole.c Python/pyarena.c Python/pythonrun.c Python/sysmodule.c Python/thread_nt.h Python/thread_pthread.h Python/traceback.c README Tools/README Tools/buildbot/external-amd64.bat Tools/buildbot/external-common.bat Tools/buildbot/external.bat Tools/buildbot/test.bat Tools/demo Tools/framer Tools/msi/msi.py Tools/parser Tools/scripts/README Tools/scripts/abitype.py Tools/scripts/find-uname.py Tools/scripts/get-remote-certificate.py Tools/scripts/redemo.py Tools/scripts/untabify.py Tools/ssl Tools/test2to3 Tools/unicode/gencodec.py Tools/world configure configure.in pyconfig.h.in runtests.sh setup.py Message-ID: <20110102121844.23065EE986@mail.python.org> Author: stefan.krah Date: Sun Jan 2 13:18:37 2011 New Revision: 87616 Log: Merged revisions 86689-86690,86693-86694,86697,86699-86702,86705,86708,86713,86717,86720,86725,86727,86729-86734,86737,86743-86747,86750-86751,86758-86759,86791,86794-86795,86797-86801,86804,86808,86819,86823-86825,86828-86829,86837-86839,86842-86845,86854-86857,86861,86864,86867-86870,86874-86875,86878-86884,86887-86893,86895-86896,86901-86903,86905-86925,86928-86937,86940,86943-86971,86974-86977,86979-86981,86983-86986,86993,86996-87004,87007-87014,87017-87032,87036,87038-87045,87047-87048,87050-87052,87054,87056-87060,87062-87084,87086,87088,87093-87094,87101-87110,87112-87119,87124-87137,87140-87141,87145-87161,87171-87177,87179-87186,87188-87194,87197-87198,87201-87210,87212-87217,87221-87222,87225,87228-87230,87233,87236,87238,87241,87245-87248,87251,87256,87258,87260-87277,87280,87283-87284,87288-87289,87292-87304,87306,87312,87315-87317,87323-87324,87327-87329,87337-87341,87344-87346,87348,87350-87356,87359-87368,87371-87374,87377-87378,87381,87384,87389-87400,87402-87403,87408,87411,87415,87418,87421,87424-87427,87430,87433,87435-87443,87445-87448,87451,87454-87455,87458-87463,87466-87479,87482-87483,87485-87486,87489,87492-87493,87496-87498,87501,87504-87508,87512-87514,87516-87539,87542,87547-87550,87553,87556-87564,87567,87569,87571,87573,87575,87577,87579-87590,87593-87595,87598,87601,87603-87604,87606-87607,87610-87612,87615 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r86689 | kristjan.jonsson | 2010-11-22 12:37:06 +0100 (Mon, 22 Nov 2010) | 3 lines issue 10501 make_buildinfo regression with unquoted path Make_buildinfo.exe should be called with a quoted path, and should quote the full paths to its temp files, to support spaces in filenames. ................ r86690 | ezio.melotti | 2010-11-22 13:56:58 +0100 (Mon, 22 Nov 2010) | 1 line #9424: add a DeprecationWarning for assertEquals, assertNotEquals, assertAlmostEquals, assertNotAlmostEquals, and assert_ ................ r86693 | antoine.pitrou | 2010-11-22 17:19:04 +0100 (Mon, 22 Nov 2010) | 3 lines Fix tests when ctypes isn't available ................ r86694 | antoine.pitrou | 2010-11-22 17:26:21 +0100 (Mon, 22 Nov 2010) | 3 lines Fix test_multiprocessing when ctypes isn't available ................ r86697 | alexander.belopolsky | 2010-11-22 20:40:51 +0100 (Mon, 22 Nov 2010) | 1 line Issue #6878: Fixed return type of tkinter methods documented to return lists. ................ r86699 | lukasz.langa | 2010-11-23 00:31:26 +0100 (Tue, 23 Nov 2010) | 3 lines Issue #9846: ZipExtFile provides no mechanism for closing the underlying file object ................ r86700 | lukasz.langa | 2010-11-23 01:15:02 +0100 (Tue, 23 Nov 2010) | 3 lines zipfile: remove remaining ResourceWarnings ................ r86701 | lukasz.langa | 2010-11-23 01:19:53 +0100 (Tue, 23 Nov 2010) | 3 lines information on Issue #9846 ................ r86702 | terry.reedy | 2010-11-23 07:01:31 +0100 (Tue, 23 Nov 2010) | 2 lines Issue 9222 Fix filetypes for open dialog ................ r86705 | georg.brandl | 2010-11-23 08:54:19 +0100 (Tue, 23 Nov 2010) | 1 line #10468: document Unicode exception creation and access functions. ................ r86708 | georg.brandl | 2010-11-23 09:37:54 +0100 (Tue, 23 Nov 2010) | 2 lines #10511: clarification of what heaps are; suggested by Johannes Hoff. ................ r86713 | georg.brandl | 2010-11-23 19:14:57 +0100 (Tue, 23 Nov 2010) | 1 line assert.h is also included. Thanks to Savio Sena. ................ r86717 | terry.reedy | 2010-11-23 21:17:24 +0100 (Tue, 23 Nov 2010) | 2 lines Issue 1859: Doc that textwrap does not break on \n (pending possible behavior patch). Patch by Jeremy Thurgood. ................ r86720 | terry.reedy | 2010-11-23 21:32:47 +0100 (Tue, 23 Nov 2010) | 2 lines IssIssue 1859: Add Jeremy Thurgood to Misc/ACKS ................ r86725 | georg.brandl | 2010-11-24 10:09:29 +0100 (Wed, 24 Nov 2010) | 1 line Remove UTF-8 BOM. ................ r86727 | brian.curtin | 2010-11-24 14:14:05 +0100 (Wed, 24 Nov 2010) | 7 lines Fix #10027. st_nlink not set on Windows calls to os.stat/lstat. Note: This patch has no tests because as of now there is no way to create links. #8879 adds that and the tests will go in there. I've manually observed that existing links on my system function properly with this. ................ r86729 | brian.curtin | 2010-11-24 14:23:18 +0100 (Wed, 24 Nov 2010) | 2 lines ifdef a Windows specific section. ................ r86730 | barry.warsaw | 2010-11-24 19:18:21 +0100 (Wed, 24 Nov 2010) | 2 lines Remove unnecessary import. ................ r86731 | barry.warsaw | 2010-11-24 20:43:47 +0100 (Wed, 24 Nov 2010) | 2 lines Final patch for issue 9807. ................ r86732 | ezio.melotti | 2010-11-24 21:18:02 +0100 (Wed, 24 Nov 2010) | 1 line #10299: Add a table that lists all the built-in functions in functions.rst ................ r86733 | brian.curtin | 2010-11-24 21:24:31 +0100 (Wed, 24 Nov 2010) | 8 lines Fix #8879. Add os.link support to Windows. Additionally, the st_ino attribute of stat structures was not being filled in. This was left out of the fix to #10027 and was noticed due to test_tarfile failing when applying the patch for this issue. An earlier version of the fix to #10027 included st_ino, but that attribute got lost in the shuffle of a few review/fix cycles. All tests pass. ................ r86734 | barry.warsaw | 2010-11-24 21:30:00 +0100 (Wed, 24 Nov 2010) | 5 lines Put /usr/local paths after the relative paths in library_dirs and include_dirs, so installed non-matching shared libraries don't break extension module linking. Fixes issue 10520. ................ r86737 | ezio.melotti | 2010-11-24 23:02:18 +0100 (Wed, 24 Nov 2010) | 1 line Add NEWS entry for r86732 and fix double function in the table. ................ r86743 | barry.warsaw | 2010-11-25 02:34:47 +0100 (Thu, 25 Nov 2010) | 2 lines sys.abiflags may not be defined on all platforms. ................ r86744 | barry.warsaw | 2010-11-25 04:46:44 +0100 (Thu, 25 Nov 2010) | 2 lines sys.abiflags is not defined on all platforms. ................ r86745 | terry.reedy | 2010-11-25 07:12:34 +0100 (Thu, 25 Nov 2010) | 2 lines Issue 2986: Add autojunk paramater to SequenceMatcher to turn off heuristic. Patch by Terry Reedy, Eli Bendersky, and Simon Cross ................ r86746 | raymond.hettinger | 2010-11-25 09:11:57 +0100 (Thu, 25 Nov 2010) | 1 line Clean-up docstring, comments, and whitespace. ................ r86747 | amaury.forgeotdarc | 2010-11-25 09:13:35 +0100 (Thu, 25 Nov 2010) | 3 lines Fix compilation warnings seen on Windows. 'typecode' is always an ascii letter, there was no data lost. ................ r86750 | senthil.kumaran | 2010-11-25 15:56:44 +0100 (Thu, 25 Nov 2010) | 3 lines Mouse support and colour to Demo/curses/life.py by Dafydd Crosby ................ r86751 | eric.smith | 2010-11-25 17:08:06 +0100 (Thu, 25 Nov 2010) | 1 line Issue #7094: Add alternate ('#') flag to __format__ methods for float, complex and Decimal. Allows greater control over when decimal points appear. Added to make transitioning from %-formatting easier. '#g' still has a problem with Decimal which I'll fix soon. ................ r86758 | eric.araujo | 2010-11-26 01:39:59 +0100 (Fri, 26 Nov 2010) | 2 lines #10453 follow-up: Fix test_quiet on Windows, thanks to Stephan Krah. ................ r86759 | senthil.kumaran | 2010-11-26 03:20:04 +0100 (Fri, 26 Nov 2010) | 3 lines s/colour/color/g ................ r86791 | stefan.krah | 2010-11-26 11:54:09 +0100 (Fri, 26 Nov 2010) | 1 line Indentation cleanup. ................ r86794 | georg.brandl | 2010-11-26 12:50:13 +0100 (Fri, 26 Nov 2010) | 1 line #10526: fix typo. ................ r86795 | georg.brandl | 2010-11-26 12:55:48 +0100 (Fri, 26 Nov 2010) | 1 line Use PyLong_FromLong where appropriate. ................ r86797 | georg.brandl | 2010-11-26 13:05:27 +0100 (Fri, 26 Nov 2010) | 1 line Modernize code in effective(). ................ r86798 | georg.brandl | 2010-11-26 13:05:48 +0100 (Fri, 26 Nov 2010) | 1 line #10420: fix docs of bdb.effective(). ................ r86799 | georg.brandl | 2010-11-26 13:08:19 +0100 (Fri, 26 Nov 2010) | 1 line Remove parenthetical remark that is confusing now that the module is not named "__builtin__" anymore. ................ r86800 | georg.brandl | 2010-11-26 13:10:06 +0100 (Fri, 26 Nov 2010) | 1 line Typo fix. ................ r86801 | georg.brandl | 2010-11-26 13:12:14 +0100 (Fri, 26 Nov 2010) | 1 line Better example for os.system(): do not change the system time. ................ r86804 | stefan.krah | 2010-11-26 13:58:05 +0100 (Fri, 26 Nov 2010) | 1 line Issue #10383: Fix two leaks. ................ r86808 | stefan.krah | 2010-11-26 17:16:47 +0100 (Fri, 26 Nov 2010) | 1 line Further indentation cleanup. ................ r86819 | alexander.belopolsky | 2010-11-26 19:51:39 +0100 (Fri, 26 Nov 2010) | 1 line Fixed deprecation warnings. ................ r86823 | eric.araujo | 2010-11-27 00:31:07 +0100 (Sat, 27 Nov 2010) | 2 lines Use link-generating markup (see #9312) ................ r86824 | eric.araujo | 2010-11-27 00:46:18 +0100 (Sat, 27 Nov 2010) | 2 lines Rewrap long lines + minor edits ................ r86825 | raymond.hettinger | 2010-11-27 09:09:40 +0100 (Sat, 27 Nov 2010) | 1 line Replace _nbits() with int.bit_length(). ................ r86828 | raymond.hettinger | 2010-11-27 10:31:37 +0100 (Sat, 27 Nov 2010) | 1 line Issue 10242: unittest.assertItemsEqual makes too many assumptions. ................ r86829 | stefan.krah | 2010-11-27 12:44:18 +0100 (Sat, 27 Nov 2010) | 1 line Fix additional leaks. ................ r86837 | barry.warsaw | 2010-11-27 21:03:03 +0100 (Sat, 27 Nov 2010) | 2 lines Roumen Petrov's fix for when all paths are absolute. (Issue 10520) ................ r86838 | antoine.pitrou | 2010-11-27 21:40:43 +0100 (Sat, 27 Nov 2010) | 3 lines Make doc for PyErr_Format() up to date. ................ r86839 | terry.reedy | 2010-11-27 21:52:14 +0100 (Sat, 27 Nov 2010) | 2 lines Add version-added note twice for new difflib SequenceMatcher autojunk parameter. ................ r86842 | antoine.pitrou | 2010-11-27 23:00:11 +0100 (Sat, 27 Nov 2010) | 4 lines Issue #10518: Bring back the callable() builtin. Approved by Guido (BDFL) and Georg (RM). ................ r86843 | stefan.krah | 2010-11-27 23:06:49 +0100 (Sat, 27 Nov 2010) | 1 line Windows: fix leak in posix_listdir. ................ r86844 | benjamin.peterson | 2010-11-28 03:51:28 +0100 (Sun, 28 Nov 2010) | 1 line there's now a setup.py switch for this ................ r86845 | ezio.melotti | 2010-11-28 05:18:54 +0100 (Sun, 28 Nov 2010) | 1 line Add callable() to the built-in functions table. ................ r86854 | brian.curtin | 2010-11-29 00:59:46 +0100 (Mon, 29 Nov 2010) | 6 lines Fix for #8879. Amaury noticed that this was originally written in a way that would fail on names that can't be encoded with the mbcs codec. Restructured the function to work with wide names first then narrow names second, to fall in line with the way other functions are written in posixmodule.c. ................ r86855 | raymond.hettinger | 2010-11-29 02:38:25 +0100 (Mon, 29 Nov 2010) | 1 line Do not add an obsolete unittest name to Py3.2. ................ r86856 | ezio.melotti | 2010-11-29 03:02:10 +0100 (Mon, 29 Nov 2010) | 1 line Use assertCountEqual instead of assertItemsEqual ................ r86857 | raymond.hettinger | 2010-11-29 04:56:12 +0100 (Mon, 29 Nov 2010) | 1 line Issue #10565: Iterator ABC should require both __next__ and __iter__. ................ r86861 | senthil.kumaran | 2010-11-29 12:54:17 +0100 (Mon, 29 Nov 2010) | 5 lines Fix #10561 - Fix pdb behavior. Delete the breakpoints by breakpoint number. Handle multiple breakpoints at same line. Update docs/test. Patch by Xavier de Gaye. ................ r86864 | senthil.kumaran | 2010-11-29 13:42:29 +0100 (Mon, 29 Nov 2010) | 3 lines Remove the comment used while testing. ................ r86867 | georg.brandl | 2010-11-29 15:50:54 +0100 (Mon, 29 Nov 2010) | 1 line Fix indentation bug. ................ r86868 | georg.brandl | 2010-11-29 15:53:15 +0100 (Mon, 29 Nov 2010) | 1 line Fix heading style inconsistencies. ................ r86869 | georg.brandl | 2010-11-29 21:12:24 +0100 (Mon, 29 Nov 2010) | 1 line Code style cleanup in bdb. ................ r86870 | georg.brandl | 2010-11-29 21:19:15 +0100 (Mon, 29 Nov 2010) | 1 line Use booleans where applicable. ................ r86874 | raymond.hettinger | 2010-11-30 03:49:29 +0100 (Tue, 30 Nov 2010) | 1 line Issue #10323: Predictable final state for slice(). ................ r86875 | alexander.belopolsky | 2010-11-30 04:03:30 +0100 (Tue, 30 Nov 2010) | 3 lines Issue #10572: Moved json tests to Lib/test/json_tests. Approved by Raymond Hettinger. ................ r86878 | nick.coghlan | 2010-11-30 07:19:46 +0100 (Tue, 30 Nov 2010) | 1 line Issue 10586: change the new functools.lru_cache implementation to expose the maximum and current cache sizes through the public statistics API. This API is now a single function that returns a named tuple. ................ r86879 | nick.coghlan | 2010-11-30 07:36:04 +0100 (Tue, 30 Nov 2010) | 1 line Issue 10220: switch to using string constants rather than integers for inspect.getgeneratorstate() return values and make debugging friendly str() and repr() for generator states a requirement in the test suite ................ r86880 | raymond.hettinger | 2010-11-30 08:13:04 +0100 (Tue, 30 Nov 2010) | 1 line Neaten-up a bit. ................ r86881 | georg.brandl | 2010-11-30 08:43:28 +0100 (Tue, 30 Nov 2010) | 1 line #10584: fix bad links. ................ r86882 | georg.brandl | 2010-11-30 09:20:16 +0100 (Tue, 30 Nov 2010) | 1 line Fix input type for zlib. ................ r86883 | georg.brandl | 2010-11-30 10:30:54 +0100 (Tue, 30 Nov 2010) | 1 line Include structseq.h in Python.h, and remove now-redundant includes in individual sources. ................ r86884 | georg.brandl | 2010-11-30 10:41:01 +0100 (Tue, 30 Nov 2010) | 1 line Remove redundant includes of headers that are already included by Python.h. ................ r86887 | georg.brandl | 2010-11-30 15:57:54 +0100 (Tue, 30 Nov 2010) | 1 line Fix typo. ................ r86888 | brian.curtin | 2010-11-30 16:40:04 +0100 (Tue, 30 Nov 2010) | 3 lines Try to fix failures on platforms that can't encode the test characters. Skip the test if encoding fails. ................ r86889 | nick.coghlan | 2010-11-30 16:48:08 +0100 (Tue, 30 Nov 2010) | 1 line Issue 9873: the URL parsing functions now accept ASCII encoded byte sequences in addition to character strings ................ r86890 | brian.curtin | 2010-11-30 16:54:04 +0100 (Tue, 30 Nov 2010) | 2 lines Actually fix what I attempted to fix in r86888... ................ r86891 | alexander.belopolsky | 2010-11-30 17:56:15 +0100 (Tue, 30 Nov 2010) | 1 line Issue #10552: Partially fixed a sort error in Tools/unicode/gencodec.py ................ r86892 | eric.araujo | 2010-11-30 18:20:31 +0100 (Tue, 30 Nov 2010) | 2 lines Let???s keep ???throw??? for the generator method and use ???raise??? elsewhere. ................ r86893 | alexander.belopolsky | 2010-11-30 18:30:43 +0100 (Tue, 30 Nov 2010) | 1 line Issue #9598: untabify.py will now respect encoding cookie in the files it processes ................ r86895 | raymond.hettinger | 2010-11-30 18:45:41 +0100 (Tue, 30 Nov 2010) | 1 line Add some internal links. ................ r86896 | daniel.stutzbach | 2010-11-30 18:49:53 +0100 (Tue, 30 Nov 2010) | 1 line Fix typo: "ofbytes" should be "of bytes" ................ r86901 | raymond.hettinger | 2010-11-30 20:15:45 +0100 (Tue, 30 Nov 2010) | 1 line Add example, tighten text, and minor clean-ups. ................ r86902 | raymond.hettinger | 2010-11-30 21:02:57 +0100 (Tue, 30 Nov 2010) | 1 line Documentation nits. ................ r86903 | raymond.hettinger | 2010-11-30 21:32:59 +0100 (Tue, 30 Nov 2010) | 1 line Add link to specification. ................ r86905 | antoine.pitrou | 2010-11-30 23:23:20 +0100 (Tue, 30 Nov 2010) | 4 lines Issue #8685: Speed up set difference `a - b` when source set `a` is much larger than operand `b`. Patch by Andrew Bennetts. ................ r86906 | brian.curtin | 2010-12-01 00:46:54 +0100 (Wed, 01 Dec 2010) | 3 lines Fix #10591. Fix test_os for refleak runs. Split a common setUp/tearDown into the appropriate parts. ................ r86907 | raymond.hettinger | 2010-12-01 01:47:56 +0100 (Wed, 01 Dec 2010) | 1 line Doc and docstring nits. ................ r86908 | ezio.melotti | 2010-12-01 01:56:10 +0100 (Wed, 01 Dec 2010) | 1 line #10535: Enable silenced warnings in unittest by default ................ r86909 | ezio.melotti | 2010-12-01 02:45:53 +0100 (Wed, 01 Dec 2010) | 1 line Fix test failure in debug builds and add NEWS entry for r86908 ................ r86910 | ezio.melotti | 2010-12-01 03:32:32 +0100 (Wed, 01 Dec 2010) | 1 line #10273: Rename assertRegexpMatches and assertRaisesRegexp to assertRegex and assertRaisesRegex. ................ r86911 | raymond.hettinger | 2010-12-01 04:45:41 +0100 (Wed, 01 Dec 2010) | 1 line Issue 10593: Adopt Nick's suggestion for an lru_cache with maxsize=None. ................ r86912 | raymond.hettinger | 2010-12-01 11:49:19 +0100 (Wed, 01 Dec 2010) | 1 line Add recipe to itertools doc. ................ r86913 | georg.brandl | 2010-12-01 16:32:43 +0100 (Wed, 01 Dec 2010) | 1 line Add missing word, and add a better reference to the actual function. ................ r86914 | georg.brandl | 2010-12-01 16:36:33 +0100 (Wed, 01 Dec 2010) | 1 line #10594: fix parameter names in PyList API docs. ................ r86915 | georg.brandl | 2010-12-01 16:44:25 +0100 (Wed, 01 Dec 2010) | 1 line Fix some markup and style in the unittest docs. ................ r86916 | alexander.belopolsky | 2010-12-01 21:05:49 +0100 (Wed, 01 Dec 2010) | 1 line Issue #4113: Added custom __repr__ method to functools.partial. ................ r86917 | alexander.belopolsky | 2010-12-01 22:55:40 +0100 (Wed, 01 Dec 2010) | 1 line Reverted unintended change from r86916 ................ r86918 | raymond.hettinger | 2010-12-01 23:48:00 +0100 (Wed, 01 Dec 2010) | 1 line Add itertools.accumulate(). ................ r86919 | raymond.hettinger | 2010-12-01 23:50:36 +0100 (Wed, 01 Dec 2010) | 1 line Add itertools.accumulate(). ................ r86920 | raymond.hettinger | 2010-12-02 00:45:20 +0100 (Thu, 02 Dec 2010) | 1 line Clean-up last update (missing comma, unnecessary spacing change, spurious backtick). ................ r86921 | alexander.belopolsky | 2010-12-02 01:05:57 +0100 (Thu, 02 Dec 2010) | 1 line With Raymond's approval added a paragraph describing Unicode 6.0.0 changes. Not reST formatted. ................ r86922 | alexander.belopolsky | 2010-12-02 01:10:11 +0100 (Thu, 02 Dec 2010) | 1 line Issue4335: Added a test for inspect.getsourcelines with a module without EOL at EOF. ................ r86923 | raymond.hettinger | 2010-12-02 02:38:25 +0100 (Thu, 02 Dec 2010) | 1 line Fix markup ................ r86924 | raymond.hettinger | 2010-12-02 03:41:33 +0100 (Thu, 02 Dec 2010) | 1 line Add an example to the random docs. ................ r86925 | r.david.murray | 2010-12-02 03:58:07 +0100 (Thu, 02 Dec 2010) | 4 lines #10464: fix netrc handling of lines with embedded '#" characters. Patch by Xuanji Li. ................ r86928 | nick.coghlan | 2010-12-02 05:11:46 +0100 (Thu, 02 Dec 2010) | 1 line Issue #9573: os.fork now works when triggered as a side effect of import (the wisdom of actually relying on this remains questionable!) ................ r86929 | raymond.hettinger | 2010-12-02 06:35:35 +0100 (Thu, 02 Dec 2010) | 1 line Neaten-up random module docs. ................ r86930 | terry.reedy | 2010-12-02 08:05:56 +0100 (Thu, 02 Dec 2010) | 2 lines Issue 9299 Add exist_ok parameter to os.makedirs to suppress 'File exists' exception. Patch by Ray Allen. ................ r86931 | georg.brandl | 2010-12-02 10:06:12 +0100 (Thu, 02 Dec 2010) | 1 line Fix-up documentation of makedirs(). ................ r86932 | david.malcolm | 2010-12-02 17:41:00 +0100 (Thu, 02 Dec 2010) | 2 lines Fix spelling of Jamie Zawinski's surname in urllib.parse docstring (issue 10606) ................ r86933 | georg.brandl | 2010-12-02 19:02:01 +0100 (Thu, 02 Dec 2010) | 1 line #10597: fix Py_SetPythonHome docs by pointing to where the meaning of PYTHONHOME is already documented. ................ r86934 | georg.brandl | 2010-12-02 19:06:51 +0100 (Thu, 02 Dec 2010) | 1 line #7475: add (un)transform method to bytes/bytearray and str, add back codecs that can be used with them from Python 2. ................ r86935 | brian.curtin | 2010-12-02 19:29:18 +0100 (Thu, 02 Dec 2010) | 17 lines Fix #9333. Expose os.symlink on Windows only when usable. In order to create symlinks on Windows, SeCreateSymbolicLinkPrivilege is an account privilege that is required to be held by the user. Not only must the privilege be enabled for the account, the activated privileges for the currently running application must be adjusted to enable the requested privilege. Rather than exposing an additional function to be called prior to the user's first os.symlink call, we handle the AdjustTokenPrivileges Windows API call internally and only expose os.symlink when the privilege escalation was successful. Due to the change of only exposing os.symlink when it's available, we can go back to the original test skipping methods of checking via `hasattr`. ................ r86936 | r.david.murray | 2010-12-02 22:47:19 +0100 (Thu, 02 Dec 2010) | 4 lines #8989: add 'domain' keyword to make_msgid. Patch by Adrian von Bidder. ................ r86937 | daniel.stutzbach | 2010-12-02 22:55:33 +0100 (Thu, 02 Dec 2010) | 1 line Issue9915: speeding up sorting with a key ................ r86940 | eric.araujo | 2010-12-02 23:16:19 +0100 (Thu, 02 Dec 2010) | 2 lines Fix wrong test code in test_csv (#10602) ................ r86943 | georg.brandl | 2010-12-02 23:35:25 +0100 (Thu, 02 Dec 2010) | 1 line Re-add accidentally removed line. ................ r86944 | michael.foord | 2010-12-03 01:53:09 +0100 (Fri, 03 Dec 2010) | 1 line Issue 7911: unittest.TestCase.longMessage defaults to True for improved failure messages by default ................ r86945 | michael.foord | 2010-12-03 02:34:01 +0100 (Fri, 03 Dec 2010) | 1 line Initial implementation of Lib/test/__main__.py so we can run tests with 'python -m test' ................ r86946 | benjamin.peterson | 2010-12-03 02:44:10 +0100 (Fri, 03 Dec 2010) | 1 line code style ................ r86947 | michael.foord | 2010-12-03 03:03:30 +0100 (Fri, 03 Dec 2010) | 1 line Set test.regrtest.TEMPDIR correctly when run with 'python -m test' ................ r86948 | raymond.hettinger | 2010-12-03 03:09:34 +0100 (Fri, 03 Dec 2010) | 1 line Simplify the signature for itertools.accumulate() to match numpy. Handle one item iterable the same way as min()/max(). ................ r86949 | michael.foord | 2010-12-03 03:27:44 +0100 (Fri, 03 Dec 2010) | 1 line Remove test/__main__.py until runpy tests can be fixed ................ r86950 | raymond.hettinger | 2010-12-03 03:33:53 +0100 (Fri, 03 Dec 2010) | 1 line Update the itertools.accumulate() docs. ................ r86951 | brian.curtin | 2010-12-03 03:46:02 +0100 (Fri, 03 Dec 2010) | 6 lines Fix #10554. Added context manager support to Popen objects. Added a few common Popen uses to the tests like we've done for a few other instances of adding context managers. Eventually the entire test suite could be converted to use the context manager format. ................ r86952 | r.david.murray | 2010-12-03 05:06:39 +0100 (Fri, 03 Dec 2010) | 12 lines #1486713: Add a tolerant mode to HTMLParser. The motivation for adding this option is that the the functionality it provides used to be provided by sgmllib in Python2, and was used by, for example, BeautifulSoup. Without this option, the Python3 version of BeautifulSoup and the many programs that use it are crippled. The original patch was by 'kxroberto'. I modified it heavily but kept his heuristics and test. I also added additional heuristics to fix #975556, #1046092, and part of #6191. This patch should be completely backward compatible: the behavior with the default strict=True is unchanged. ................ r86953 | r.david.murray | 2010-12-03 05:26:18 +0100 (Fri, 03 Dec 2010) | 2 lines Add missing versionchanged, correct 'throw' wording to 'raise'. ................ r86954 | georg.brandl | 2010-12-03 08:37:16 +0100 (Fri, 03 Dec 2010) | 1 line Move entries from "core" section to where they belong. ................ r86955 | georg.brandl | 2010-12-03 08:38:22 +0100 (Fri, 03 Dec 2010) | 1 line #1745035: add limits for command and data size to smtpd; patch by Savio Sena. ................ r86956 | nick.coghlan | 2010-12-03 08:44:33 +0100 (Fri, 03 Dec 2010) | 1 line Partially revert r78719 - it removed a check that is still needed in some cases (i.e. this will allow Michael to add the test.__main__ support that broke the buildbots previously) ................ r86957 | georg.brandl | 2010-12-03 08:47:22 +0100 (Fri, 03 Dec 2010) | 1 line #940286: pydoc.Helper.help() ignores input/output init parameters. ................ r86958 | georg.brandl | 2010-12-03 08:49:09 +0100 (Fri, 03 Dec 2010) | 1 line Use booleans. ................ r86959 | georg.brandl | 2010-12-03 08:54:09 +0100 (Fri, 03 Dec 2010) | 1 line Remove redundant check for PyBytes in unicode_encode. ................ r86960 | georg.brandl | 2010-12-03 08:55:44 +0100 (Fri, 03 Dec 2010) | 1 line #10360: catch TypeError in WeakSet.__contains__, just like WeakKeyDictionary does. ................ r86961 | georg.brandl | 2010-12-03 10:18:37 +0100 (Fri, 03 Dec 2010) | 1 line Rewrap NEWS (Builbot test commit.) ................ r86962 | nick.coghlan | 2010-12-03 10:29:11 +0100 (Fri, 03 Dec 2010) | 14 lines Improve Pydoc interactive browsing (#2001). Patch by Ron Adam. * A -b option to start an enhanced browsing session. * Allow -b and -p options to be used together. * Specifying port 0 will pick an arbitrary unused socket port. * A new browse() function to start the new server and browser. * Show Python version information in the header. * A *Get* field which takes the same input as the help() function. * A *Search* field which replaces the Tkinter search box. * Links to *Module Index*, *Topics*, and *Keywords*. * Improved source file viewing. * An HTMLDoc.filelink() method. * The -g option and the gui() and serve() functions are deprecated. ................ r86963 | georg.brandl | 2010-12-03 10:45:33 +0100 (Fri, 03 Dec 2010) | 1 line Add a line with the actual changes. ................ r86964 | georg.brandl | 2010-12-03 10:58:38 +0100 (Fri, 03 Dec 2010) | 1 line #10549: fix interface of docclass() for text documenter. ................ r86965 | michael.foord | 2010-12-03 11:42:03 +0100 (Fri, 03 Dec 2010) | 1 line Adding lib/test/__main__.py for running tests with 'python -m test' ................ r86966 | michael.foord | 2010-12-03 11:59:15 +0100 (Fri, 03 Dec 2010) | 1 line Fix lib/test/__main__.py to work even outside a Python build. ................ r86967 | vinay.sajip | 2010-12-03 12:50:38 +0100 (Fri, 03 Dec 2010) | 1 line logging: Added getLogRecordFactory/setLogRecordFactory with docs and tests. ................ r86968 | michael.foord | 2010-12-03 13:27:40 +0100 (Fri, 03 Dec 2010) | 1 line Factor out common code from lib/test/__main__.py and lib/test/regrtest.py into a function. ................ r86969 | vinay.sajip | 2010-12-03 14:01:11 +0100 (Fri, 03 Dec 2010) | 1 line logging: tidied up some docstrings. ................ r86970 | nick.coghlan | 2010-12-03 15:26:13 +0100 (Fri, 03 Dec 2010) | 3 lines Issue 2690: Add support for slicing and negative indices to range objects (includes precalculation and storage of the range length). Refer to the tracker issue for the language moratorium implications of this change ................ r86971 | nick.coghlan | 2010-12-03 15:30:41 +0100 (Fri, 03 Dec 2010) | 1 line Add missing CSS file from r86962 ................ r86974 | georg.brandl | 2010-12-03 16:30:09 +0100 (Fri, 03 Dec 2010) | 1 line Markup consistency fixes. ................ r86975 | nick.coghlan | 2010-12-03 17:08:46 +0100 (Fri, 03 Dec 2010) | 1 line Handle Windows paths and don't double up on HTML header sections in new pydoc URL handler ................ r86976 | lukasz.langa | 2010-12-03 17:28:00 +0100 (Fri, 03 Dec 2010) | 2 lines Issue 10499: Modular interpolation in configparser ................ r86977 | victor.stinner | 2010-12-03 17:51:33 +0100 (Fri, 03 Dec 2010) | 1 line #6780: fix complex() constructor TypeError message ................ r86979 | victor.stinner | 2010-12-03 18:06:43 +0100 (Fri, 03 Dec 2010) | 4 lines import: use PyUnicode_FSConverter to support bytes path and PEP 383 (instead of PyArg_Parse*() with "es" format and Py_FileSystemDefaultEncoding) ................ r86980 | georg.brandl | 2010-12-03 18:19:27 +0100 (Fri, 03 Dec 2010) | 1 line Fix punctuation. ................ r86981 | antoine.pitrou | 2010-12-03 19:41:39 +0100 (Fri, 03 Dec 2010) | 5 lines Issue #10478: Reentrant calls inside buffered IO objects (for example by way of a signal handler) now raise a RuntimeError instead of freezing the current process. ................ r86983 | terry.reedy | 2010-12-03 19:57:42 +0100 (Fri, 03 Dec 2010) | 1 line ................ r86984 | antoine.pitrou | 2010-12-03 20:14:17 +0100 (Fri, 03 Dec 2010) | 3 lines Add an "advanced topics" section to the io doc. ................ r86985 | eric.araujo | 2010-12-03 20:19:17 +0100 (Fri, 03 Dec 2010) | 5 lines Fix incorrect use of gettext in argparse (#10497). Steven, the maintainer of argparse, agreed to have this committed without tests for now, since the fix is obvious. See the bug log. ................ r86986 | michael.foord | 2010-12-03 20:20:44 +0100 (Fri, 03 Dec 2010) | 1 line Fix so that test.test_unittest can be executed by unittest and not just regrtest ................ r86993 | eric.araujo | 2010-12-03 20:41:00 +0100 (Fri, 03 Dec 2010) | 7 lines Allow translators to reorder placeholders in localizable messages from argparse (#10528). There is no unit test; I checked with xgettext that no more warnings were emitted. Steven approved the change. ................ r86996 | georg.brandl | 2010-12-03 20:56:42 +0100 (Fri, 03 Dec 2010) | 1 line Fix indentation. ................ r86997 | antoine.pitrou | 2010-12-03 20:59:41 +0100 (Fri, 03 Dec 2010) | 4 lines Issue #10272: The ssl module now raises socket.timeout instead of a generic SSLError on socket timeouts. ................ r86998 | martin.v.loewis | 2010-12-03 21:14:31 +0100 (Fri, 03 Dec 2010) | 2 lines Merge branches/pep-0384. ................ r86999 | lukasz.langa | 2010-12-03 23:15:19 +0100 (Fri, 03 Dec 2010) | 3 lines %s -> %r correction after review by ??ric Araujo ................ r87000 | terry.reedy | 2010-12-03 23:29:40 +0100 (Fri, 03 Dec 2010) | 3 lines Issue 10534 deprecate isbjunk and isbpopular methods. Will add gone in 3.3 test later. ................ r87001 | terry.reedy | 2010-12-03 23:50:06 +0100 (Fri, 03 Dec 2010) | 2 lines Issue #10534: add NEWS entry for r86983 and r87000. ................ r87002 | martin.v.loewis | 2010-12-04 00:11:07 +0100 (Sat, 04 Dec 2010) | 21 lines Merged revisions 85551,86156-86157,86464 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r85551 | benjamin.peterson | 2010-10-15 23:57:29 +0200 (Fr, 15 Okt 2010) | 1 line escape() is now in the html module ........ r86156 | georg.brandl | 2010-11-04 09:34:57 +0100 (Do, 04 Nov 2010) | 1 line Consistency fixes in option parser help texts. ........ r86157 | georg.brandl | 2010-11-04 09:35:30 +0100 (Do, 04 Nov 2010) | 1 line #10286: fix urllib class names. ........ r86464 | benjamin.peterson | 2010-11-14 16:28:52 +0100 (So, 14 Nov 2010) | 1 line match only .py files #10416 ........ ................ r87003 | michael.foord | 2010-12-04 02:11:21 +0100 (Sat, 04 Dec 2010) | 1 line Issue 10620: Specifying test modules by path instead of module name to 'python -m unittest' ................ r87004 | michael.foord | 2010-12-04 02:43:59 +0100 (Sat, 04 Dec 2010) | 1 line Correct comment in unittest test ................ r87007 | alexander.belopolsky | 2010-12-04 04:38:46 +0100 (Sat, 04 Dec 2010) | 5 lines Issue #10557: Fixed error messages from float() and other numeric types. Added a new API function, PyUnicode_TransformDecimalToASCII(), which transforms non-ASCII decimal digits in a Unicode string to their ASCII equivalents. ................ r87008 | georg.brandl | 2010-12-04 10:04:04 +0100 (Sat, 04 Dec 2010) | 1 line Fix typo. ................ r87009 | martin.v.loewis | 2010-12-04 10:08:10 +0100 (Sat, 04 Dec 2010) | 2 lines Make script 2-vs-3-agnostic. ................ r87010 | gregory.p.smith | 2010-12-04 10:10:44 +0100 (Sat, 04 Dec 2010) | 11 lines issue7213 + issue2320: Cause a DeprecationWarning if the close_fds argument is not passed to subprocess.Popen as the default value will be changing in a future Python to the safer and more often desired value of True. DeprecationWarnings that show up in a lot of existing code are controversial and have caused pain in the past. I'd like to leave this on for 3.2 beta1 and see how things go. We can remove the warning if it is deemed too noisy during any betas. (case study: the md5 and sha module DeprecationWarnings are loathed around the world as those modules were never going to be removed in 2.x and 2to3 has a fixer for code that uses them) ................ r87011 | martin.v.loewis | 2010-12-04 10:11:41 +0100 (Sat, 04 Dec 2010) | 2 lines Add Revision keyword. ................ r87012 | martin.v.loewis | 2010-12-04 10:12:14 +0100 (Sat, 04 Dec 2010) | 2 lines Regenerate. ................ r87013 | georg.brandl | 2010-12-04 10:14:36 +0100 (Sat, 04 Dec 2010) | 1 line #6045: provide at least get() and setdefault() for all dbm modules. ................ r87014 | senthil.kumaran | 2010-12-04 10:44:30 +0100 (Sat, 04 Dec 2010) | 3 lines Add the NEWS entry for issue7904 ................ r87017 | gregory.p.smith | 2010-12-04 10:59:52 +0100 (Sat, 04 Dec 2010) | 2 lines refactor the warning test. ................ r87018 | hirokazu.yamamoto | 2010-12-04 11:16:05 +0100 (Sat, 04 Dec 2010) | 6 lines Fixed several corner case issues on os.stat/os.lstat related to reparse points. (Windows) - Set S_IEXEC via final path name not link name. - Set S_IFLNK also via FindFirstFile (when CreateFile fails) ................ r87019 | georg.brandl | 2010-12-04 11:26:46 +0100 (Sat, 04 Dec 2010) | 1 line Add an "optimize" parameter to compile() to control the optimization level, and provide an interface to it in py_compile, compileall and PyZipFile. ................ r87020 | georg.brandl | 2010-12-04 11:39:14 +0100 (Sat, 04 Dec 2010) | 1 line #1513299: cleanup some map() uses where a comprehension works better. ................ r87021 | georg.brandl | 2010-12-04 11:47:18 +0100 (Sat, 04 Dec 2010) | 1 line #1772833: add -q command line option. ................ r87022 | georg.brandl | 2010-12-04 12:02:04 +0100 (Sat, 04 Dec 2010) | 1 line #1569291: speed up array.repeat() by making only O(log n) memcpy() calls; the code follows unicode_repeat. ................ r87023 | mark.dickinson | 2010-12-04 12:06:25 +0100 (Sat, 04 Dec 2010) | 1 line Fix indentation in Objects/longobject.c ................ r87024 | georg.brandl | 2010-12-04 12:12:43 +0100 (Sat, 04 Dec 2010) | 1 line #7905: Actually respect the keyencoding parameter to shelve.Shelf. ................ r87025 | georg.brandl | 2010-12-04 12:20:26 +0100 (Sat, 04 Dec 2010) | 1 line Add the "interact" pdb command from pdb++. ................ r87026 | gregory.p.smith | 2010-12-04 12:22:11 +0100 (Sat, 04 Dec 2010) | 3 lines issue6559: Adds a pass_fds parameter to subprocess.Popen that allows the caller to list exactly which file descriptors should be kept open. ................ r87027 | gregory.p.smith | 2010-12-04 12:36:58 +0100 (Sat, 04 Dec 2010) | 3 lines issue10622: fix superflous scrollbar on the right side of
 boxes in the
  generated html docs.  visible in chrome, possibly other webkit browsers.
................
  r87028 | lukasz.langa | 2010-12-04 12:48:11 +0100 (Sat, 04 Dec 2010) | 3 lines
  
  configparser: minute refactoring of RawConfigParser.items()
................
  r87029 | mark.dickinson | 2010-12-04 12:52:58 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Remove some unecessary '#ifdef Py_NAN's from floatobject.c
................
  r87030 | martin.v.loewis | 2010-12-04 13:00:49 +0100 (Sat, 04 Dec 2010) | 3 lines
  
  Expose CompileString, not CompileStringFlags under the
  limited API.
................
  r87031 | hirokazu.yamamoto | 2010-12-04 13:20:57 +0100 (Sat, 04 Dec 2010) | 2 lines
  
  I hope this will fix Win2008(x64) buildbot error.
................
  r87032 | mark.dickinson | 2010-12-04 13:25:30 +0100 (Sat, 04 Dec 2010) | 3 lines
  
  Issue #10596: Fix float.__mod__ to have the same behaviour as
  float.__divmod__ with respect to signed zeros.
................
  r87036 | lukasz.langa | 2010-12-04 13:46:01 +0100 (Sat, 04 Dec 2010) | 5 lines
  
  configparser: fixed inconsistency where in SafeConfigParser option values
   were ensured to be strings but section names and option keys were not.
   Behaviour unchanged for RawConfigParser and ConfigParser.
................
  r87038 | mark.dickinson | 2010-12-04 14:14:29 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Use copysign to produce appropriately signed zeros instead of trying to worm around possible compiler optimizations.
................
  r87039 | eric.smith | 2010-12-04 14:27:34 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Removed static function complex_format, moved it into complex_repr. Modified tests to check both str and repr, which are the same for complex.
................
  r87040 | eric.smith | 2010-12-04 14:32:18 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Issue #10624: Move requires_IEEE_754 into test.support. I'll fix up other uses of it shortly.
................
  r87041 | lukasz.langa | 2010-12-04 14:48:13 +0100 (Sat, 04 Dec 2010) | 4 lines
  
  support for checking test coverage added.
  70% coverage at the moment (not tragic but needs work).
................
  r87042 | martin.v.loewis | 2010-12-04 14:49:32 +0100 (Sat, 04 Dec 2010) | 2 lines
  
  Fix PEP number.
................
  r87043 | eric.smith | 2010-12-04 16:17:38 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Issue #10624: Use support.requires_IEEE_754 in all appropriate tests.
................
  r87044 | eric.smith | 2010-12-04 16:26:13 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Issue 10625: Add tests for negative zeros in complex str and repr.
................
  r87045 | georg.brandl | 2010-12-04 17:00:47 +0100 (Sat, 04 Dec 2010) | 1 line
  
  #7245: Add a SIGINT handler on continue in pdb that allows to break a program again by pressing Ctrl-C.
................
  r87047 | georg.brandl | 2010-12-04 17:21:42 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Add display/undisplay pdb commands.
................
  r87048 | georg.brandl | 2010-12-04 17:22:44 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Fix accidental checkin.
................
  r87050 | georg.brandl | 2010-12-04 18:09:30 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Fix typo.
................
  r87051 | georg.brandl | 2010-12-04 18:11:36 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Fix test suite to not activate new sigint behavior in pdb.
................
  r87052 | eric.smith | 2010-12-04 18:12:41 +0100 (Sat, 04 Dec 2010) | 1 line
  
  More issue #10624: Add requires_IEEE_754 to __all__.
................
  r87054 | victor.stinner | 2010-12-04 18:24:33 +0100 (Sat, 04 Dec 2010) | 3 lines
  
  Issue #10601: sys.displayhook uses 'backslashreplace' error handler on
  UnicodeEncodeError.
................
  r87056 | eric.araujo | 2010-12-04 18:31:49 +0100 (Sat, 04 Dec 2010) | 2 lines
  
  Use proper plural forms in argparse (#4391)
................
  r87057 | lukasz.langa | 2010-12-04 18:48:18 +0100 (Sat, 04 Dec 2010) | 2 lines
  
  configparser: mapping protocol access get() handles configparser-specific arguments as well
................
  r87058 | gregory.p.smith | 2010-12-04 19:11:44 +0100 (Sat, 04 Dec 2010) | 2 lines
  
  clarify the docs and new warning message.
................
  r87059 | antoine.pitrou | 2010-12-04 19:36:03 +0100 (Sat, 04 Dec 2010) | 3 lines
  
  Silence compile error
................
  r87060 | georg.brandl | 2010-12-04 20:01:29 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Update pydoc topics.
................
  r87062 | georg.brandl | 2010-12-04 20:06:14 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Update suspicious exceptions.
................
  r87063 | georg.brandl | 2010-12-04 20:06:18 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Fix markup errors.
................
  r87064 | georg.brandl | 2010-12-04 20:09:24 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Bump to 3.2b1.
................
  r87065 | raymond.hettinger | 2010-12-04 21:51:36 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Doc nit.
................
  r87066 | raymond.hettinger | 2010-12-04 23:56:25 +0100 (Sat, 04 Dec 2010) | 1 line
  
  Fill-in stub for concurrent.futures
................
  r87067 | raymond.hettinger | 2010-12-05 00:42:12 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Mention itertools.accumulate().
................
  r87068 | raymond.hettinger | 2010-12-05 01:39:18 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Start the argparse entry.
................
  r87069 | raymond.hettinger | 2010-12-05 02:01:52 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Optimization of Timsort.
................
  r87070 | hirokazu.yamamoto | 2010-12-05 03:04:16 +0100 (Sun, 05 Dec 2010) | 3 lines
  
  Now can reproduce the error on AMD64 Windows Server 2008
  even where os.symlink is not supported.
................
  r87071 | hirokazu.yamamoto | 2010-12-05 03:41:46 +0100 (Sun, 05 Dec 2010) | 2 lines
  
  Avoid possible zombi process.
................
  r87072 | hirokazu.yamamoto | 2010-12-05 03:48:08 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Sorry, I had introduced tab in source code.
................
  r87073 | raymond.hettinger | 2010-12-05 03:56:21 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Note the updates to range objects.
................
  r87074 | raymond.hettinger | 2010-12-05 05:04:21 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Describe the transform/untranform methods
................
  r87075 | hirokazu.yamamoto | 2010-12-05 05:16:47 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Should use posix_error here.
................
  r87076 | raymond.hettinger | 2010-12-05 06:39:54 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Optimization notes.
................
  r87077 | raymond.hettinger | 2010-12-05 07:35:16 +0100 (Sun, 05 Dec 2010) | 1 line
  
  New string format character.
................
  r87078 | nick.coghlan | 2010-12-05 07:45:03 +0100 (Sun, 05 Dec 2010) | 2 lines
  
  Issue 10626 investigation: regrtest now checks for alterations to the logging state in the current process (and yes, test_pydoc alters it)
................
  r87079 | raymond.hettinger | 2010-12-05 08:02:45 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Update the unittest section.
................
  r87080 | raymond.hettinger | 2010-12-05 08:06:47 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Spelling
................
  r87081 | nick.coghlan | 2010-12-05 08:17:25 +0100 (Sun, 05 Dec 2010) | 1 line
  
  More fine-grained monitoring of alterations to logging state
................
  r87082 | georg.brandl | 2010-12-05 08:51:39 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Temporarily disable newly failing test for the release.
................
  r87083 | georg.brandl | 2010-12-05 08:59:29 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Apply rest of #10628, and add a few todo comments.
................
  r87084 | raymond.hettinger | 2010-12-05 09:35:21 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Nits and todos
................
  r87086 | georg.brandl | 2010-12-05 12:40:48 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Take PyUnicode_TransformDecimalToASCII out of the limited API.
................
  r87088 | georg.brandl | 2010-12-05 12:42:38 +0100 (Sun, 05 Dec 2010) | 1 line
  
  Fix title.
................
  r87093 | martin.v.loewis | 2010-12-06 00:07:58 +0100 (Mon, 06 Dec 2010) | 2 lines
  
  Automate build for python3.dll.
  Package missing files.
................
  r87094 | raymond.hettinger | 2010-12-06 05:31:40 +0100 (Mon, 06 Dec 2010) | 2 lines
  
  Typo fixups.
................
  r87101 | georg.brandl | 2010-12-06 23:02:48 +0100 (Mon, 06 Dec 2010) | 1 line
  
  Remove visible XXX comments.
................
  r87102 | georg.brandl | 2010-12-06 23:25:25 +0100 (Mon, 06 Dec 2010) | 1 line
  
  Don't use deprecated aliases.
................
  r87103 | raymond.hettinger | 2010-12-07 00:31:36 +0100 (Tue, 07 Dec 2010) | 1 line
  
  Note improvements to the docs.
................
  r87104 | david.malcolm | 2010-12-07 01:32:04 +0100 (Tue, 07 Dec 2010) | 2 lines
  
  Fix typo
................
  r87105 | raymond.hettinger | 2010-12-07 02:47:52 +0100 (Tue, 07 Dec 2010) | 1 line
  
  Add entry for the new sysconfig module.
................
  r87106 | raymond.hettinger | 2010-12-07 03:04:56 +0100 (Tue, 07 Dec 2010) | 1 line
  
  Add entry for new pdb features
................
  r87107 | benjamin.peterson | 2010-12-07 04:46:27 +0100 (Tue, 07 Dec 2010) | 1 line
  
  return views from dict proxy items/values/keys #10630
................
  r87108 | benjamin.peterson | 2010-12-07 04:47:37 +0100 (Tue, 07 Dec 2010) | 1 line
  
  add news note
................
  r87109 | benjamin.peterson | 2010-12-07 05:04:02 +0100 (Tue, 07 Dec 2010) | 1 line
  
  use the more direct API
................
  r87110 | raymond.hettinger | 2010-12-07 07:45:30 +0100 (Tue, 07 Dec 2010) | 1 line
  
  Add example for the entry for argparse
................
  r87112 | raymond.hettinger | 2010-12-07 09:52:41 +0100 (Tue, 07 Dec 2010) | 1 line
  
  More cleanups and examples.
................
  r87113 | raymond.hettinger | 2010-12-07 10:24:30 +0100 (Tue, 07 Dec 2010) | 2 lines
  
  Spelling.
................
  r87114 | raymond.hettinger | 2010-12-07 10:37:11 +0100 (Tue, 07 Dec 2010) | 1 line
  
  Clean-ups and examples.
................
  r87115 | raymond.hettinger | 2010-12-07 10:44:21 +0100 (Tue, 07 Dec 2010) | 1 line
  
  Make the example a little more interesting and useful.
................
  r87116 | raymond.hettinger | 2010-12-07 10:55:02 +0100 (Tue, 07 Dec 2010) | 2 lines
  
  Martin's name with Unicode.
................
  r87117 | hirokazu.yamamoto | 2010-12-07 11:24:37 +0100 (Tue, 07 Dec 2010) | 2 lines
  
  Issue #10637: Called CloseHandle twice in os.stat/os.lstat (Windows)
................
  r87118 | ronald.oussoren | 2010-12-07 15:41:05 +0100 (Tue, 07 Dec 2010) | 14 lines
  
  Two small changes to adjust framework builds to the new stable ABI
  
  Both the Makefile and the script that is used on OSX to create the binary
  installer refer to the directory containing the Makefile using the name
  'config'. This name was changed with the new ABI (with default build flags
  it is now named config-3.2m).  This patch ensures that both files use the
  correct name.
  
  The build-installer.py script contains one other change: it now tests for the
  Tcl/Tk framework version by looking at the 'Current' symlink in the framework
  instead of runnning a script. This makes it possible to verify the version
  that is in the SDK that's used during the build instead of the version that
  is installed on the system.
................
  r87119 | ronald.oussoren | 2010-12-07 16:28:10 +0100 (Tue, 07 Dec 2010) | 2 lines
  
  Fix for issue #10107: Without this patch IDLE on OSX doesn't warn about unsaved files when quitting.
................
  r87124 | raymond.hettinger | 2010-12-08 02:13:53 +0100 (Wed, 08 Dec 2010) | 1 line
  
  Update whatsnew.  Salt the random number seed.
................
  r87125 | raymond.hettinger | 2010-12-08 07:42:41 +0100 (Wed, 08 Dec 2010) | 2 lines
  
  Add example for concurrent.futures.
................
  r87126 | raymond.hettinger | 2010-12-08 07:48:33 +0100 (Wed, 08 Dec 2010) | 1 line
  
  Clean-ups.
................
  r87127 | raymond.hettinger | 2010-12-08 07:50:02 +0100 (Wed, 08 Dec 2010) | 1 line
  
  Nits.
................
  r87128 | senthil.kumaran | 2010-12-08 09:04:49 +0100 (Wed, 08 Dec 2010) | 3 lines
  
  Fix Issue8194  - Fix incompatible API change in the parse_respones for xmlrpclib.
................
  r87129 | raymond.hettinger | 2010-12-08 11:18:21 +0100 (Wed, 08 Dec 2010) | 1 line
  
  range() example
................
  r87130 | raymond.hettinger | 2010-12-08 12:19:45 +0100 (Wed, 08 Dec 2010) | 1 line
  
  Example of argparge with subparsers.
................
  r87131 | raymond.hettinger | 2010-12-08 12:33:19 +0100 (Wed, 08 Dec 2010) | 2 lines
  
  Entry for inspect.getattr_static().
................
  r87132 | hirokazu.yamamoto | 2010-12-08 15:47:07 +0100 (Wed, 08 Dec 2010) | 3 lines
  
  Mention NASM which is needed to build openssl-1.0.0a original source.
  (PC/VC6/readme.txt)
................
  r87133 | alexander.belopolsky | 2010-12-08 22:21:56 +0100 (Wed, 08 Dec 2010) | 1 line
  
  Added a datetime new features entry
................
  r87134 | alexander.belopolsky | 2010-12-08 22:38:46 +0100 (Wed, 08 Dec 2010) | 1 line
  
  Edited the Unicode 6.0.0 entry to add unicode.org links and trim the summary.
................
  r87135 | victor.stinner | 2010-12-08 23:25:45 +0100 (Wed, 08 Dec 2010) | 4 lines
  
  Issue #10546: UTF-16-LE and UTF-16-BE *do* support non-BMP characters
  
  Fix the doc and add tests.
................
  r87136 | r.david.murray | 2010-12-08 23:53:00 +0100 (Wed, 08 Dec 2010) | 6 lines
  
  Have script_helper._assert_python strip refcount strings from stderr.
  
  This makes the output of the function and those that depend on it
  independent of whether or not they are being run under a debug
  build.
................
  r87137 | alexander.belopolsky | 2010-12-09 00:31:48 +0100 (Thu, 09 Dec 2010) | 1 line
  
  Issue #6697: Fixed instances of _PyUnicode_AsString() result not checked for NULL
................
  r87140 | hirokazu.yamamoto | 2010-12-09 11:49:00 +0100 (Thu, 09 Dec 2010) | 2 lines
  
  Should call Py_INCREF for Py_None (Modules/_ssl.c: PySSL_cipher)
................
  r87141 | hirokazu.yamamoto | 2010-12-09 12:13:30 +0100 (Thu, 09 Dec 2010) | 2 lines
  
  Fixed typo in comment.
................
  r87145 | raymond.hettinger | 2010-12-09 17:41:54 +0100 (Thu, 09 Dec 2010) | 2 lines
  
  Entries for datetime, callable, and collections.Counter.
................
  r87146 | georg.brandl | 2010-12-09 19:08:43 +0100 (Thu, 09 Dec 2010) | 1 line
  
  Fix "seperate".
................
  r87147 | georg.brandl | 2010-12-09 19:10:27 +0100 (Thu, 09 Dec 2010) | 1 line
  
  #10661: give QName a nicer repr.
................
  r87148 | georg.brandl | 2010-12-09 19:26:02 +0100 (Thu, 09 Dec 2010) | 1 line
  
  Guard against rogue tuples.
................
  r87149 | raymond.hettinger | 2010-12-10 00:43:34 +0100 (Fri, 10 Dec 2010) | 1 line
  
  Doh! Example pasted twice, but only once in the right place.
................
  r87150 | raymond.hettinger | 2010-12-10 02:09:01 +0100 (Fri, 10 Dec 2010) | 1 line
  
  Overview of email module and recategorize various entries.
................
  r87151 | raymond.hettinger | 2010-12-10 02:19:15 +0100 (Fri, 10 Dec 2010) | 1 line
  
  Reclassify some entries and remove a couple of minor ones.
................
  r87152 | ezio.melotti | 2010-12-10 03:32:05 +0100 (Fri, 10 Dec 2010) | 1 line
  
  #10273: Remove a "Matches" that I missed in r86910. Thanks to RDM for noticing it.
................
  r87153 | vinay.sajip | 2010-12-10 09:17:05 +0100 (Fri, 10 Dec 2010) | 1 line
  
  Minor documentation tweak.
................
  r87154 | vinay.sajip | 2010-12-10 09:19:38 +0100 (Fri, 10 Dec 2010) | 1 line
  
  test.support: Added TestHandler and Matcher classes for better support of assertions about logging.
................
  r87155 | vinay.sajip | 2010-12-10 10:11:23 +0100 (Fri, 10 Dec 2010) | 1 line
  
  Fied typo
................
  r87156 | georg.brandl | 2010-12-10 11:01:44 +0100 (Fri, 10 Dec 2010) | 1 line
  
  #10668: fix wrong call of __init__.
................
  r87157 | vinay.sajip | 2010-12-10 12:42:57 +0100 (Fri, 10 Dec 2010) | 1 line
  
  logging: added handler of last resort.
................
  r87158 | raymond.hettinger | 2010-12-10 18:45:13 +0100 (Fri, 10 Dec 2010) | 1 line
  
  Move nntp entry back to changed modules section and add entry for non-ascii import directories.
................
  r87159 | alexander.belopolsky | 2010-12-10 19:11:24 +0100 (Fri, 10 Dec 2010) | 1 line
  
  Updated UCD version and unicode.org links to Unicode 6.0.0
................
  r87160 | alexander.belopolsky | 2010-12-10 19:14:16 +0100 (Fri, 10 Dec 2010) | 1 line
  
  Reverted accidental commit (from r87159)
................
  r87161 | georg.brandl | 2010-12-10 20:22:11 +0100 (Fri, 10 Dec 2010) | 1 line
  
  Fix typo.
................
  r87171 | martin.v.loewis | 2010-12-11 19:17:22 +0100 (Sat, 11 Dec 2010) | 2 lines
  
  Adjust PySlice_GetIndices documentation to signature change.
................
  r87172 | georg.brandl | 2010-12-11 20:10:30 +0100 (Sat, 11 Dec 2010) | 1 line
  
  Avoid AttributeError(_closed) when a TemporaryDirectory is deallocated whose mkdtemp call failed.
................
  r87173 | martin.v.loewis | 2010-12-11 20:22:04 +0100 (Sat, 11 Dec 2010) | 2 lines
  
  Add versionchanged for parameter type changes.
................
  r87174 | barry.warsaw | 2010-12-11 22:32:01 +0100 (Sat, 11 Dec 2010) | 4 lines
  
  Create the hardlink between python-3.2m and python-3.2 in altbininstall target
  instead of bininstall target so it shows up when you do 'make altinstall'.
  Closes issue 10677.
................
  r87175 | georg.brandl | 2010-12-11 23:19:34 +0100 (Sat, 11 Dec 2010) | 1 line
  
  Fix markup.
................
  r87176 | benjamin.peterson | 2010-12-12 02:33:04 +0100 (Sun, 12 Dec 2010) | 1 line
  
  remove (un)transform methods
................
  r87177 | benjamin.peterson | 2010-12-12 02:46:43 +0100 (Sun, 12 Dec 2010) | 1 line
  
  having three copies of the same test is surely a bit excessive
................
  r87179 | vinay.sajip | 2010-12-12 14:20:55 +0100 (Sun, 12 Dec 2010) | 1 line
  
  Logging documentation update.
................
  r87180 | vinay.sajip | 2010-12-12 14:25:29 +0100 (Sun, 12 Dec 2010) | 1 line
  
  Logging documentation - further update.
................
  r87181 | vinay.sajip | 2010-12-12 14:49:39 +0100 (Sun, 12 Dec 2010) | 1 line
  
  Logging documentation - further update.
................
  r87182 | nick.coghlan | 2010-12-12 16:24:21 +0100 (Sun, 12 Dec 2010) | 2 lines
  
  Issue #10188 (partial resolution): tidy up some behaviour in the new tempfile.TemporaryDirectory context manager
................
  r87183 | vinay.sajip | 2010-12-12 18:37:27 +0100 (Sun, 12 Dec 2010) | 1 line
  
  Logging documentation - further update.
................
  r87184 | antoine.pitrou | 2010-12-12 19:09:53 +0100 (Sun, 12 Dec 2010) | 3 lines
  
  SET_LINENO was removed in 2.3
................
  r87185 | antoine.pitrou | 2010-12-12 19:12:40 +0100 (Sun, 12 Dec 2010) | 3 lines
  
  Remove reference to stuff which is already obsolete in 2.x.
................
  r87186 | antoine.pitrou | 2010-12-12 19:14:34 +0100 (Sun, 12 Dec 2010) | 3 lines
  
  Obsolete aliases needn't be documented
................
  r87188 | antoine.pitrou | 2010-12-12 19:25:25 +0100 (Sun, 12 Dec 2010) | 3 lines
  
  Make this a warning and fix indentation
................
  r87189 | antoine.pitrou | 2010-12-12 20:59:47 +0100 (Sun, 12 Dec 2010) | 3 lines
  
  Better explain the buffer interface (hopefully)
................
  r87190 | antoine.pitrou | 2010-12-12 21:01:43 +0100 (Sun, 12 Dec 2010) | 3 lines
  
  Add link to the buffer protocol description from the memory description.
................
  r87191 | r.david.murray | 2010-12-12 21:06:19 +0100 (Sun, 12 Dec 2010) | 6 lines
  
  #243654: only create a new MIME boundary if we don't already have one.
  
  The rearranged code should do exactly what the old code did, but
  the new code avoids a potentially costly re computation in the case
  where a boundary already exists.
................
  r87192 | antoine.pitrou | 2010-12-12 21:09:18 +0100 (Sun, 12 Dec 2010) | 3 lines
  
  Remove redundant sentence, and fix markup
................
  r87193 | antoine.pitrou | 2010-12-12 21:13:31 +0100 (Sun, 12 Dec 2010) | 3 lines
  
  Fix heading level
................
  r87194 | antoine.pitrou | 2010-12-12 21:17:29 +0100 (Sun, 12 Dec 2010) | 3 lines
  
  Consistent ordering of availability statements
................
  r87197 | antoine.pitrou | 2010-12-12 21:34:49 +0100 (Sun, 12 Dec 2010) | 3 lines
  
  Homogenize the "optional OS services" menu
................
  r87198 | antoine.pitrou | 2010-12-12 21:57:12 +0100 (Sun, 12 Dec 2010) | 3 lines
  
  Improve readability of the socket docs
................
  r87201 | vinay.sajip | 2010-12-12 23:30:17 +0100 (Sun, 12 Dec 2010) | 1 line
  
  Logging documentation - further update.
................
  r87202 | vinay.sajip | 2010-12-12 23:45:35 +0100 (Sun, 12 Dec 2010) | 1 line
  
  Logging documentation - further update.
................
  r87203 | vinay.sajip | 2010-12-12 23:47:13 +0100 (Sun, 12 Dec 2010) | 1 line
  
  Logging documentation - further update.
................
  r87204 | nick.coghlan | 2010-12-13 04:02:43 +0100 (Mon, 13 Dec 2010) | 1 line
  
  Actually finish the tests for r87182
................
  r87205 | kristjan.jonsson | 2010-12-13 04:32:10 +0100 (Mon, 13 Dec 2010) | 8 lines
  
  issue 10683
  When the solution is converted to Visual Studio 2010, the command line to invoke make_buildinfo changes from:
  $(SolutionDir)make_buildinfo.exe" Debug "$(IntDir)\"
  to
  $(SolutionDir)make_buildinfo.exe" Debug "$(IntDir)"
  If the final backslash is omitted, the backslash in IntDir will escape the quote, thus passing the quote in as part of the path name.
  
  This solution is a hack-fix to that problem by skipping any trailing quote from the path name.  It works as long as we don't need any additional arguments to make_buildinfo.exe.  This will help all those sould that are going to run this project through the visual studio autoconverter and get the same error.
................
  r87206 | gregory.p.smith | 2010-12-13 07:45:02 +0100 (Mon, 13 Dec 2010) | 5 lines
  
  Get rid of the close_fds DeprecationWarning.  Changes the default on a per
  platform basis.  It remains False on Windows and changes to True on all
  other platforms (POSIX).  Based on python-dev discussion and
  http://bugs.python.org/issue7213.
................
  r87207 | gregory.p.smith | 2010-12-13 08:59:39 +0100 (Mon, 13 Dec 2010) | 4 lines
  
  issue7213: Open the pipes used by subprocesses with the FD_CLOEXEC flag from
  the C code, using pipe2() when available.  Adds unittests for close_fds and
  cloexec behaviors.
................
  r87208 | gregory.p.smith | 2010-12-13 09:00:52 +0100 (Mon, 13 Dec 2010) | 2 lines
  
  regenerate configure based on r87207.
................
  r87209 | gregory.p.smith | 2010-12-13 09:07:14 +0100 (Mon, 13 Dec 2010) | 2 lines
  
  Mention the subprocess.Popen close_fds default change.  Fixup *s to -s.
................
  r87210 | vinay.sajip | 2010-12-13 09:54:02 +0100 (Mon, 13 Dec 2010) | 1 line
  
  Logging documentatio update.
................
  r87212 | nick.coghlan | 2010-12-13 17:32:51 +0100 (Mon, 13 Dec 2010) | 1 line
  
  Captured IO streams with embedded backslashes are always such a fun combination...
................
  r87213 | barry.warsaw | 2010-12-13 19:04:23 +0100 (Mon, 13 Dec 2010) | 6 lines
  
  Issue 10687.  When --without-pymalloc is given, $VERSION is the same as
  $LDVERSION, which screws up the sym/hard-links.  This avoids those games when
  $VERSION == $LDVERSION.
  
  Also, include a drive-by fix for an obvious syntax error.
................
  r87214 | vinay.sajip | 2010-12-13 19:43:57 +0100 (Mon, 13 Dec 2010) | 1 line
  
  Logging documentation update.
................
  r87215 | vinay.sajip | 2010-12-13 19:49:08 +0100 (Mon, 13 Dec 2010) | 1 line
  
  Logging documentation update.
................
  r87216 | r.david.murray | 2010-12-13 23:50:30 +0100 (Mon, 13 Dec 2010) | 2 lines
  
  #10698: fix typo in example.
................
  r87217 | r.david.murray | 2010-12-14 00:51:19 +0100 (Tue, 14 Dec 2010) | 5 lines
  
  #1078919: make add_header automatically do RFC2231 encoding when needed.
  
  Also document the use of three-tuples if control of the charset
  and language is desired.
................
  r87221 | r.david.murray | 2010-12-14 01:55:46 +0100 (Tue, 14 Dec 2010) | 4 lines
  
  #10699: fix docstring for tzset: it does not take a parameter
  
  Thanks to Garrett Cooper for the fix.
................
  r87222 | r.david.murray | 2010-12-14 02:22:50 +0100 (Tue, 14 Dec 2010) | 2 lines
  
  Use skipIf instead of a return when attribute doesn't exist.
................
  r87225 | r.david.murray | 2010-12-14 02:38:16 +0100 (Tue, 14 Dec 2010) | 2 lines
  
  9162: fix license in multiprocessing files
................
  r87228 | r.david.murray | 2010-12-14 03:25:43 +0100 (Tue, 14 Dec 2010) | 2 lines
  
  Turn on regrtest -W (rerun immediately) option for Windows, too.
................
  r87229 | gregory.p.smith | 2010-12-14 14:43:30 +0100 (Tue, 14 Dec 2010) | 7 lines
  
  Issue #6559: fix the subprocess.Popen pass_fds implementation. Add a unittest.
  Issue #7213: Change the close_fds default on Windows to better match the new
  default on POSIX.  True when possible (False if stdin/stdout/stderr are
  supplied).
  
  Update the documentation to reflect all of the above.
................
  r87230 | r.david.murray | 2010-12-14 15:16:20 +0100 (Tue, 14 Dec 2010) | 7 lines
  
  #10695: use %s not %d so that a string 'port' does not cause a debug traceback
  
  Passing the port as a string value works fine in regular mode, but
  if you turned debug on it would throw an error trying to print the
  port number, which is surprising and confusing.
................
  r87233 | gregory.p.smith | 2010-12-14 15:38:00 +0100 (Tue, 14 Dec 2010) | 4 lines
  
  Issue #1731717: Fixed the problem where subprocess.wait() could cause an
  OSError exception when The OS had been told to ignore SIGCLD in our process
  or otherwise not wait for exiting child processes.
................
  r87236 | gregory.p.smith | 2010-12-14 16:23:02 +0100 (Tue, 14 Dec 2010) | 2 lines
  
  Fix "BytesWarning: str() on a bytes instance"
................
  r87238 | r.david.murray | 2010-12-14 17:20:53 +0100 (Tue, 14 Dec 2010) | 7 lines
  
  #775964: skip YP/NIS entries instead of failing the test
  
  Also includes doc updates mentioning that these entries may not
  be retrievable via getgrnam and getgrgid.
  
  Patch by Bobby Impollonia.
................
  r87241 | gregory.p.smith | 2010-12-14 19:18:49 +0100 (Tue, 14 Dec 2010) | 2 lines
  
  SIGCHLD is a more portable name than SIGCLD.  (OSX has no SIGCLD)
................
  r87245 | vinay.sajip | 2010-12-14 20:40:21 +0100 (Tue, 14 Dec 2010) | 1 line
  
  Logging documentation update.
................
  r87246 | raymond.hettinger | 2010-12-14 22:12:03 +0100 (Tue, 14 Dec 2010) | 1 line
  
  Nits
................
  r87247 | antoine.pitrou | 2010-12-14 23:06:10 +0100 (Tue, 14 Dec 2010) | 3 lines
  
  Freshen README contents
................
  r87248 | r.david.murray | 2010-12-14 23:32:50 +0100 (Tue, 14 Dec 2010) | 2 lines
  
  More comprehensive compileall cli tests, and fixes.
................
  r87251 | r.david.murray | 2010-12-15 00:06:25 +0100 (Wed, 15 Dec 2010) | 4 lines
  
  #4236: avoid possible Fatal Error when import is called from __del__
  
  Patch by Simon Cross, crasher test code by Martin von L??wis.
................
  r87256 | r.david.murray | 2010-12-15 03:19:14 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  #10705: document what the values of debuglevel are and mean.
................
  r87258 | andrew.kuchling | 2010-12-15 03:37:01 +0100 (Wed, 15 Dec 2010) | 1 line
  
  Typo fix
................
  r87260 | senthil.kumaran | 2010-12-15 05:02:45 +0100 (Wed, 15 Dec 2010) | 6 lines
  
  TIMEOUT value change in URLTimeout Test. test.support.transient_internet has a
  socket timeout of 30 when it checks for resource.  Explicit overrding (like
  setting the 10) wont exhibit consistent behavior when tests are outside context
  manager. So, settting it 30.
................
  r87261 | antoine.pitrou | 2010-12-15 16:33:18 +0100 (Wed, 15 Dec 2010) | 4 lines
  
  Issue #10706: Remove outdated script runtests.sh.  Either `make test`
  or `python -m test` should be used instead.
................
  r87262 | antoine.pitrou | 2010-12-15 16:42:59 +0100 (Wed, 15 Dec 2010) | 3 lines
  
  Remove outdated compatibility file.
................
  r87263 | antoine.pitrou | 2010-12-15 16:47:34 +0100 (Wed, 15 Dec 2010) | 3 lines
  
  Encourage --with-pydebug rather than individual setting of debug options.
................
  r87264 | antoine.pitrou | 2010-12-15 16:48:20 +0100 (Wed, 15 Dec 2010) | 3 lines
  
  I don't think we need to ship the comp.lang.python RFD these days.
................
  r87265 | raymond.hettinger | 2010-12-15 17:30:37 +0100 (Wed, 15 Dec 2010) | 1 line
  
  Issue 10667: Fast path for collections.Counter
................
  r87266 | raymond.hettinger | 2010-12-15 18:54:13 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Add entries for the random module and the collections module.
................
  r87267 | raymond.hettinger | 2010-12-15 19:20:19 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Adopt Antoine's suggestion to improve readability with module subsections.
................
  r87268 | raymond.hettinger | 2010-12-15 19:31:57 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Minor regroupings.
................
  r87269 | raymond.hettinger | 2010-12-15 20:00:38 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Move email section in with other modules.  Fix markup.
................
  r87270 | antoine.pitrou | 2010-12-15 20:07:26 +0100 (Wed, 15 Dec 2010) | 3 lines
  
  Move the urllib-inherited API to a distinguished section
................
  r87271 | eric.araujo | 2010-12-15 20:09:58 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Improve trace documentation (#9264).  Patch by Eli Bendersky.
................
  r87272 | raymond.hettinger | 2010-12-15 20:20:01 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Add intro to the changed modules section.
................
  r87273 | eric.araujo | 2010-12-15 20:30:15 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Use nested method directives, rewrap long lines, fix whitespace.
................
  r87274 | raymond.hettinger | 2010-12-15 20:33:49 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Elaborate on the calculation used in the random module.
................
  r87275 | alexander.belopolsky | 2010-12-15 20:47:37 +0100 (Wed, 15 Dec 2010) | 1 line
  
  Use sentence case in section titles consistently
................
  r87276 | terry.reedy | 2010-12-15 21:18:10 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Issue 10534, difflib: tweak doc; test new SequenceMatcher instance attributes; avoid unneeded lists of SM.b2j keys and items in .__chain_b. Do not backport.
................
  r87277 | eric.araujo | 2010-12-15 21:26:30 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Fix wrong name in docstring and doc (#10693).  Original patch by Eli Bendersky.
................
  r87280 | eric.araujo | 2010-12-15 22:07:22 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Fix build_ext with VS 8.0.  Patch by Hirokazu Yamamoto (#9558).
................
  r87283 | eric.araujo | 2010-12-15 23:06:35 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Add disclaimer about MinGW compat in distutils docs (#6007).  Patch by Chris Lambacher.
................
  r87284 | raymond.hettinger | 2010-12-15 23:07:15 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Add entries for structseq, ContextDecorator, and various C-API changes.
................
  r87288 | raymond.hettinger | 2010-12-15 23:35:03 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Entry for decimal and fractions.
................
  r87289 | eric.araujo | 2010-12-15 23:37:27 +0100 (Wed, 15 Dec 2010) | 2 lines
  
  Mark up one missed None in pkgutil.rst (#8851)
................
  r87292 | antoine.pitrou | 2010-12-15 23:59:16 +0100 (Wed, 15 Dec 2010) | 4 lines
  
  Issue #8844: Regular and recursive lock acquisitions can now be interrupted
  by signals on platforms using pthreads.  Patch by Reid Kleckner.
................
  r87293 | antoine.pitrou | 2010-12-16 00:38:50 +0100 (Thu, 16 Dec 2010) | 3 lines
  
  Make test_threadsignals more lax, and add notes
................
  r87294 | eric.araujo | 2010-12-16 01:07:01 +0100 (Thu, 16 Dec 2010) | 2 lines
  
  No need to generate a link for something that???s just above.
................
  r87295 | raymond.hettinger | 2010-12-16 01:21:08 +0100 (Thu, 16 Dec 2010) | 2 lines
  
  Entries for ElementTree, collectionsm, functools and ZipFile.
................
  r87296 | eric.araujo | 2010-12-16 01:23:30 +0100 (Thu, 16 Dec 2010) | 2 lines
  
  Advertise ???python -m??? instead of direct filename.
................
  r87297 | raymond.hettinger | 2010-12-16 01:30:53 +0100 (Thu, 16 Dec 2010) | 1 line
  
  Nits
................
  r87298 | raymond.hettinger | 2010-12-16 01:53:05 +0100 (Thu, 16 Dec 2010) | 2 lines
  
  Thank you ispell.
................
  r87299 | lukasz.langa | 2010-12-16 02:16:22 +0100 (Thu, 16 Dec 2010) | 4 lines
  
  Broken ConfigParser removed, SafeConfigParser renamed to ConfigParser.
  Life is beatiful once again.
................
  r87300 | eric.araujo | 2010-12-16 02:40:26 +0100 (Thu, 16 Dec 2010) | 2 lines
  
  Advertise ???python -m test??? over test.regrtest (r87296 followup)
................
  r87301 | lukasz.langa | 2010-12-16 02:42:36 +0100 (Thu, 16 Dec 2010) | 3 lines
  
  Acknowledged renaming of SafeConfigParser to ConfigParser.
................
  r87302 | eric.araujo | 2010-12-16 03:10:11 +0100 (Thu, 16 Dec 2010) | 2 lines
  
  Add versionadded directive missing from r78983.
................
  r87303 | raymond.hettinger | 2010-12-16 03:24:12 +0100 (Thu, 16 Dec 2010) | 2 lines
  
  Improve the ContextDecorator example.
................
  r87304 | eric.araujo | 2010-12-16 04:13:05 +0100 (Thu, 16 Dec 2010) | 2 lines
  
  Fix one versionchanged
................
  r87306 | brian.curtin | 2010-12-16 04:24:49 +0100 (Thu, 16 Dec 2010) | 2 lines
  
  EasyDialogs was removed in 3.x. fallback_getpass will always be the answer here.
................
  r87312 | eric.araujo | 2010-12-16 07:28:48 +0100 (Thu, 16 Dec 2010) | 2 lines
  
  Add missing docs and directives related to PEP 3147 and byte-compilation
................
  r87315 | raymond.hettinger | 2010-12-16 11:06:11 +0100 (Thu, 16 Dec 2010) | 1 line
  
  Add todo for WSGI
................
  r87316 | antoine.pitrou | 2010-12-16 14:33:56 +0100 (Thu, 16 Dec 2010) | 3 lines
  
  Credit Florent for porting
................
  r87317 | antoine.pitrou | 2010-12-16 17:48:36 +0100 (Thu, 16 Dec 2010) | 4 lines
  
  Issue #10714: Limit length of incoming request in http.server to 65536 bytes
  for security reasons.  Initial patch by Ross Lagerwall.
................
  r87323 | antoine.pitrou | 2010-12-16 19:25:24 +0100 (Thu, 16 Dec 2010) | 3 lines
  
  Issue #10710: `Misc/setuid-prog.c` is removed from the source tree.
................
  r87324 | r.david.murray | 2010-12-16 20:08:51 +0100 (Thu, 16 Dec 2010) | 9 lines
  
  #10719: restore messages generated on invalid compileall args
  
  Before the introduction of filename arguments to compileall it gave semi useful
  messages about not being able to 'list' names that weren't valid directories.
  This fix restores that behavior.  In addition to the test for this case, the
  patch also adds a test for the default behavior of compileall when no arguments
  are provided, and fixes a bug in one of the previously added tests.
................
  r87327 | gregory.p.smith | 2010-12-16 20:23:05 +0100 (Thu, 16 Dec 2010) | 2 lines
  
  assert that the regex given to assertRegex is non-empty.
................
  r87328 | lukasz.langa | 2010-12-17 02:32:29 +0100 (Fri, 17 Dec 2010) | 5 lines
  
  configparser API cleanup: default values now sensible, slightly incompatible.
  Backwards compatible alternative values possible as documented.
  Done by ??ukasz Langa, approved by Raymond and Fred.
................
  r87329 | senthil.kumaran | 2010-12-17 05:48:45 +0100 (Fri, 17 Dec 2010) | 3 lines
  
  Fix Issue9721 - urljoin behavior when the relative url starts with ';'
................
  r87337 | r.david.murray | 2010-12-17 17:11:40 +0100 (Fri, 17 Dec 2010) | 2 lines
  
  #10559: provide instructions for accessing sys.argv when first mentioned.
................
  r87338 | r.david.murray | 2010-12-17 17:29:07 +0100 (Fri, 17 Dec 2010) | 2 lines
  
  #10454: clarify the compileall docs and help messages.
................
  r87339 | daniel.stutzbach | 2010-12-17 17:31:32 +0100 (Fri, 17 Dec 2010) | 1 line
  
  Issue 8753: Added documentation for Py_ReprEntr and Py_ReprLeave.
................
  r87340 | antoine.pitrou | 2010-12-17 18:35:56 +0100 (Fri, 17 Dec 2010) | 4 lines
  
  Issue #10711: Remove HTTP 0.9 support from http.client.  The `strict`
  parameter to HTTPConnection and friends is deprecated.
................
  r87341 | antoine.pitrou | 2010-12-17 18:42:16 +0100 (Fri, 17 Dec 2010) | 4 lines
  
  Issue #4188: Avoid creating dummy thread objects when logging operations
  from the threading module (with the internal verbose flag activated).
................
  r87344 | raymond.hettinger | 2010-12-17 21:19:50 +0100 (Fri, 17 Dec 2010) | 1 line
  
  Expand the LBYL glossary entry.
................
  r87345 | martin.v.loewis | 2010-12-17 21:43:27 +0100 (Fri, 17 Dec 2010) | 1 line
  
  Upgrade Tcl/Tk to 8.5.9.
................
  r87346 | daniel.stutzbach | 2010-12-17 21:53:03 +0100 (Fri, 17 Dec 2010) | 1 line
  
  Issue2690: Update docs to reflect the change made by issue2690.
................
  r87348 | martin.v.loewis | 2010-12-17 22:04:09 +0100 (Fri, 17 Dec 2010) | 1 line
  
  Upgrade to sqlite3 3.7.4.
................
  r87350 | lukasz.langa | 2010-12-17 22:56:32 +0100 (Fri, 17 Dec 2010) | 3 lines
  
  100% test coverage, better mapping protocol compatibility, some minor bugfixes
................
  r87351 | lukasz.langa | 2010-12-17 22:57:32 +0100 (Fri, 17 Dec 2010) | 3 lines
  
  configparser hype coming up!
................
  r87352 | lukasz.langa | 2010-12-17 23:05:46 +0100 (Fri, 17 Dec 2010) | 3 lines
  
  fix for an embarrassing autoformatting SNAFU. Thanks for your alertness, Antoine.
................
  r87353 | victor.stinner | 2010-12-17 23:24:30 +0100 (Fri, 17 Dec 2010) | 1 line
  
  update .gitignore using .hgignore
................
  r87354 | daniel.stutzbach | 2010-12-17 23:28:07 +0100 (Fri, 17 Dec 2010) | 1 line
  
  Fix typo
................
  r87355 | raymond.hettinger | 2010-12-18 00:31:30 +0100 (Sat, 18 Dec 2010) | 1 line
  
  Add link to a sample solution to a common problem.
................
  r87356 | r.david.murray | 2010-12-18 04:48:32 +0100 (Sat, 18 Dec 2010) | 11 lines
  
  #9907: call rl_initialize early when using editline on OSX
  
  editline rl_initialize apparently discards any mappings done before it
  is called, which makes tab revert to file completion instead of inserting
  a tab.  So now on OSX we call rl_initialize first if we are using
  readline, and then re-read the users .editrc (if any) afterward so they
  can still override our defaults.
  
  Patch by Ned Deily, modified by Ronald Oussoren.
................
  r87359 | raymond.hettinger | 2010-12-18 10:41:32 +0100 (Sat, 18 Dec 2010) | 1 line
  
  Enhance argparse example to show aliases.
................
  r87360 | raymond.hettinger | 2010-12-18 11:48:26 +0100 (Sat, 18 Dec 2010) | 2 lines
  
  Minor wordsmithing and markup fix-ups.
................
  r87361 | raymond.hettinger | 2010-12-18 11:57:50 +0100 (Sat, 18 Dec 2010) | 2 lines
  
  Minor markup and wording fixups.
................
  r87362 | steven.bethard | 2010-12-18 12:19:23 +0100 (Sat, 18 Dec 2010) | 1 line
  
  Add subparser aliases for argparse. Resolves issue 9324. Approved by Georg for beta2 on the tracker.
................
  r87363 | raymond.hettinger | 2010-12-18 12:20:52 +0100 (Sat, 18 Dec 2010) | 2 lines
  
  Nits.
................
  r87364 | georg.brandl | 2010-12-18 12:53:25 +0100 (Sat, 18 Dec 2010) | 1 line
  
  Add attribution.
................
  r87365 | georg.brandl | 2010-12-18 12:58:12 +0100 (Sat, 18 Dec 2010) | 1 line
  
  Typo fix.
................
  r87366 | georg.brandl | 2010-12-18 13:01:15 +0100 (Sat, 18 Dec 2010) | 1 line
  
  Use kbd role.
................
  r87367 | antoine.pitrou | 2010-12-18 13:33:06 +0100 (Sat, 18 Dec 2010) | 3 lines
  
  Make this a note again.
................
  r87368 | ezio.melotti | 2010-12-18 15:59:43 +0100 (Sat, 18 Dec 2010) | 1 line
  
  #5587: add a repr to dict_proxy objects.  Patch by David Stanek and Daniel Urban.
................
  r87371 | georg.brandl | 2010-12-18 17:21:58 +0100 (Sat, 18 Dec 2010) | 1 line
  
  Fix typo.
................
  r87372 | r.david.murray | 2010-12-18 17:39:06 +0100 (Sat, 18 Dec 2010) | 2 lines
  
  #10728: the default for printing help is sys.stdout, not stderr.
................
  r87373 | senthil.kumaran | 2010-12-18 17:55:23 +0100 (Sat, 18 Dec 2010) | 3 lines
  
  Fix Issue6791 - Limit the HTTP header readline with _MAXLENGTH. Patch by Antoine Pitrou
................
  r87374 | r.david.murray | 2010-12-18 18:19:10 +0100 (Sat, 18 Dec 2010) | 8 lines
  
  #10404: Use ctl-button-1 for context menus on OSX Idle.
  
  This provides access to the context menus where they previously could
  not be accessed due to the way OSX Tk binds buttons.  It also
  improves platform consistency.
  
  Patch by Ned Deily.
................
  r87377 | ezio.melotti | 2010-12-18 18:31:58 +0100 (Sat, 18 Dec 2010) | 1 line
  
  Use lowercase true/false in assertTrue/assertFalse messages.
................
  r87378 | georg.brandl | 2010-12-18 18:51:28 +0100 (Sat, 18 Dec 2010) | 1 line
  
  #10723: add missing builtin exceptions.
................
  r87381 | antoine.pitrou | 2010-12-18 18:59:18 +0100 (Sat, 18 Dec 2010) | 3 lines
  
  NEWS entry for r87373	
................
  r87384 | r.david.murray | 2010-12-18 19:25:38 +0100 (Sat, 18 Dec 2010) | 12 lines
  
  #9286: Fix the rfc822 parser to preserve whitespace in address local part.
  
  Such addresses are not RFC compliant except under the 'obsolete syntax'
  rules, but before this fix the whitespace was dropped from the input,
  concatenating the pieces.  That breaks one of the principles of the
  email package, that of preserving the input as much as possible.
  It also denies the application program the opportunity to apply its
  own heuristics to interpretation of such non-compliant addresses.
  
  It is possible users of the email package were depending on the local
  part always being a single token, so this fix will not be backported.
................
  r87389 | ezio.melotti | 2010-12-18 21:00:04 +0100 (Sat, 18 Dec 2010) | 1 line
  
  #10573: use actual/expected consistently in unittest methods. The order of the args of assertCountEqual is also changed.
................
  r87390 | michael.foord | 2010-12-19 04:19:47 +0100 (Sun, 19 Dec 2010) | 1 line
  
  Issue 10611. Issue 9857. Improve the way exception handling, including test skipping, is done inside TestCase.run
................
  r87391 | michael.foord | 2010-12-19 04:59:10 +0100 (Sun, 19 Dec 2010) | 1 line
  
  Fix minor issue in implementation of issue 10470.
................
  r87392 | michael.foord | 2010-12-19 05:07:28 +0100 (Sun, 19 Dec 2010) | 1 line
  
  Improvement to fix for issue 9926 to allow TestResult to be reused.
................
  r87393 | vinay.sajip | 2010-12-19 07:02:31 +0100 (Sun, 19 Dec 2010) | 1 line
  
  Logging documentation update.
................
  r87394 | georg.brandl | 2010-12-19 11:10:32 +0100 (Sun, 19 Dec 2010) | 1 line
  
  #6075: make idle work with both Carbon AquaTk and Cocoa AquaTk. Patch by Kevin Walzer and Ned Deily.
................
  r87395 | georg.brandl | 2010-12-19 11:17:46 +0100 (Sun, 19 Dec 2010) | 1 line
  
  Temporarily skip test failing with newer ttk.
................
  r87396 | georg.brandl | 2010-12-19 11:25:28 +0100 (Sun, 19 Dec 2010) | 1 line
  
  Update pydoc topics.
................
  r87397 | georg.brandl | 2010-12-19 11:28:46 +0100 (Sun, 19 Dec 2010) | 1 line
  
  Fix markup error and update suspicious file.
................
  r87398 | georg.brandl | 2010-12-19 11:30:28 +0100 (Sun, 19 Dec 2010) | 1 line
  
  Bump to 3.2b2.
................
  r87399 | senthil.kumaran | 2010-12-19 11:49:52 +0100 (Sun, 19 Dec 2010) | 3 lines
  
  Issue3243 - Support iterable bodies in httplib. Patch contributions by Xuanji Li and Chris AtLee.
................
  r87400 | georg.brandl | 2010-12-19 13:33:52 +0100 (Sun, 19 Dec 2010) | 1 line
  
  #3243 follow-up: remove debugging print and fix docs; data is a bytes object.
................
  r87402 | vinay.sajip | 2010-12-19 13:56:57 +0100 (Sun, 19 Dec 2010) | 1 line
  
  Logging documentation reorganised.
................
  r87403 | vinay.sajip | 2010-12-19 14:41:26 +0100 (Sun, 19 Dec 2010) | 1 line
  
  Logging documentation updates.
................
  r87408 | r.david.murray | 2010-12-20 19:08:59 +0100 (Mon, 20 Dec 2010) | 8 lines
  
  Make test_compileall more robust by using -S to keep sys.path minimized.
  
  Arfrever Taifersar Arahesis reported that test_compileall failed during Gentoo
  install because it was tyring to write .pyc files to a read-only system
  directory during test_no_args_compiles_path.  Having subprocess call python
  with -S should eliminate the system directories from the path.
................
  r87411 | r.david.murray | 2010-12-20 20:04:51 +0100 (Mon, 20 Dec 2010) | 2 lines
  
  Revert incorrect patch made at the wrong time.
................
  r87415 | r.david.murray | 2010-12-21 19:07:59 +0100 (Tue, 21 Dec 2010) | 4 lines
  
  Fix the change made for issue 1243654.
  
  Surprisingly, it turns out there was no test that exercised this code path.
................
  r87418 | r.david.murray | 2010-12-21 19:24:33 +0100 (Tue, 21 Dec 2010) | 10 lines
  
  Make test_compileall more robust by using -S to keep sys.path minimized.
  
  Try this again, hopefully the right way this time.
  
  Arfrever Taifersar Arahesis reported that test_compileall failed during Gentoo
  install because it was tyring to write .pyc files to a read-only system
  directory during test_no_args_compiles_path.  Having the tests call python
  with -S should eliminate the system directories from the path.
................
  r87421 | antoine.pitrou | 2010-12-21 19:49:01 +0100 (Tue, 21 Dec 2010) | 4 lines
  
  Suggest sys.maxsize as a reliable way to know whether the interpreter is 64-bit.
  (part of #10735)
................
  r87424 | raymond.hettinger | 2010-12-21 20:24:26 +0100 (Tue, 21 Dec 2010) | 1 line
  
  Deprecate assertDictContainsSubset()
................
  r87425 | raymond.hettinger | 2010-12-21 21:09:55 +0100 (Tue, 21 Dec 2010) | 2 lines
  
  Reference the release schedule
................
  r87426 | raymond.hettinger | 2010-12-21 21:52:12 +0100 (Tue, 21 Dec 2010) | 2 lines
  
  Document the alternate format for :ref:.
................
  r87427 | antoine.pitrou | 2010-12-21 22:20:59 +0100 (Tue, 21 Dec 2010) | 3 lines
  
  Issue #10750: The `raw` attribute of buffered IO objects is now read-only.
................
  r87430 | r.david.murray | 2010-12-21 22:53:37 +0100 (Tue, 21 Dec 2010) | 9 lines
  
  #4871: check that zipfile password is bytes, and give useful error message.
  
  Previously passing a string in as the password would fail either with
  an assertion error or a TypeError with a confusing error message.
  Note that a string can't be accepted since zipfile has no way to
  guess what encoding should be used to turn it into bytes.
  
  Patch by Victor Stinner.
................
  r87433 | alexander.belopolsky | 2010-12-22 02:37:36 +0100 (Wed, 22 Dec 2010) | 3 lines
  
  Both PEP 3131 and the current implementation use NFKC normalization
  for identifiers.  Fixed the documentation to agree.
................
  r87435 | alexander.belopolsky | 2010-12-22 03:35:20 +0100 (Wed, 22 Dec 2010) | 1 line
  
  Removed unneeded #include
................
  r87436 | gregory.p.smith | 2010-12-22 06:22:17 +0100 (Wed, 22 Dec 2010) | 2 lines
  
  fix a compiler warning about err_msg potentially being used uninitialized.
................
  r87437 | raymond.hettinger | 2010-12-22 10:11:54 +0100 (Wed, 22 Dec 2010) | 2 lines
  
  Add todo
................
  r87438 | michael.foord | 2010-12-22 11:39:04 +0100 (Wed, 22 Dec 2010) | 1 line
  
  Minor typo corrections in whatsnew
................
  r87439 | vinay.sajip | 2010-12-22 16:04:15 +0100 (Wed, 22 Dec 2010) | 1 line
  
  Logging documentation updates.
................
  r87440 | michael.foord | 2010-12-22 19:28:51 +0100 (Wed, 22 Dec 2010) | 1 line
  
  Another trivial typo correction in whatsnew
................
  r87441 | antoine.pitrou | 2010-12-22 23:19:15 +0100 (Wed, 22 Dec 2010) | 3 lines
  
  Fix ResourceWarning in test_normalization
................
  r87442 | alexander.belopolsky | 2010-12-23 03:27:37 +0100 (Thu, 23 Dec 2010) | 1 line
  
  Issue #10254: Fixed a crash and a regression introduced by the implementation of PRI 29.
................
  r87443 | alexander.belopolsky | 2010-12-23 03:58:25 +0100 (Thu, 23 Dec 2010) | 1 line
  
  Issue #10587: Document the meaning of str methods.
................
  r87445 | eric.araujo | 2010-12-23 19:41:33 +0100 (Thu, 23 Dec 2010) | 2 lines
  
  Fix small inaccuracy: there is no index function
................
  r87446 | eric.araujo | 2010-12-23 19:44:31 +0100 (Thu, 23 Dec 2010) | 2 lines
  
  Nits: use a real boolean, make one docstring more similar to the other ones
................
  r87447 | eric.araujo | 2010-12-23 20:13:05 +0100 (Thu, 23 Dec 2010) | 2 lines
  
  Fix typo in superclass method name
................
  r87448 | r.david.murray | 2010-12-23 20:44:49 +0100 (Thu, 23 Dec 2010) | 4 lines
  
  #4496: remove misleading comment and note that self.handlers is obsolete.
  
  self.handlers is still used in one urllib2 test, but not by the code iteslf.
................
  r87451 | r.david.murray | 2010-12-23 21:35:46 +0100 (Thu, 23 Dec 2010) | 4 lines
  
  #1155362: allow hh:mm:ss-uuuu like we allow hh:mm:ss+uuuu in parsedate_tz
  
  Original patch by Thomas Herve.
................
  r87454 | raymond.hettinger | 2010-12-23 22:54:02 +0100 (Thu, 23 Dec 2010) | 4 lines
  
  Fix buglet.  If the input was an iterator, the fallback would occur after
  part of the iterator had been consumed.   Also, fix argument names which
  did not match the docs and were a bit misleading.
................
  r87455 | benjamin.peterson | 2010-12-23 23:17:42 +0100 (Thu, 23 Dec 2010) | 1 line
  
  fix docstring
................
  r87458 | benjamin.peterson | 2010-12-23 23:49:38 +0100 (Thu, 23 Dec 2010) | 1 line
  
  use native tenary condition
................
  r87459 | benjamin.peterson | 2010-12-23 23:53:42 +0100 (Thu, 23 Dec 2010) | 1 line
  
  kill some function imports
................
  r87460 | terry.reedy | 2010-12-24 00:10:28 +0100 (Fri, 24 Dec 2010) | 3 lines
  
  Issue 10730: mimetypes module - add .svgz to mimetypes.suffix_map and .svg to types_map.
  Addition OKed by GB on IRC (R. David Murray). No backport.
................
  r87461 | eric.araujo | 2010-12-24 00:18:41 +0100 (Fri, 24 Dec 2010) | 2 lines
  
  Fix syntax typo
................
  r87462 | benjamin.peterson | 2010-12-24 00:45:39 +0100 (Fri, 24 Dec 2010) | 1 line
  
  update comment
................
  r87463 | alexander.belopolsky | 2010-12-24 01:24:11 +0100 (Fri, 24 Dec 2010) | 1 line
  
  Issue #9063: Corrected the tzinfo example.
................
  r87466 | raymond.hettinger | 2010-12-24 01:48:47 +0100 (Fri, 24 Dec 2010) | 1 line
  
  Add test for r87454.
................
  r87467 | raymond.hettinger | 2010-12-24 01:52:54 +0100 (Fri, 24 Dec 2010) | 1 line
  
  Fix docs and comment for r87454.
................
  r87468 | raymond.hettinger | 2010-12-24 01:58:34 +0100 (Fri, 24 Dec 2010) | 2 lines
  
  Fix docstring.
................
  r87469 | senthil.kumaran | 2010-12-24 05:03:59 +0100 (Fri, 24 Dec 2010) | 4 lines
  
  Fix some mistakes- Issue3243 (r87399)  Correcting the operator precendence
  problem with Content-Length header and uncommenting the test.
................
  r87470 | alexander.belopolsky | 2010-12-24 05:22:40 +0100 (Fri, 24 Dec 2010) | 1 line
  
  Added an XXX note to describe timedelta/timedelta feature.
................
  r87471 | raymond.hettinger | 2010-12-24 11:02:22 +0100 (Fri, 24 Dec 2010) | 20 lines
  
  Improve diff for assertCountEqual() to actually show the differing counts.
  
  New output looks like this: 
  
  Traceback (most recent call last):
    File "test.py", line 5, in test_ce
      self.assertCountEqual('abracadabra xx', 'simsalabim xx')
  AssertionError: Element counts were not equal:
  Expected 5, got 2:  'a'
  Expected 2, got 1:  'b'
  Expected 0, got 2:  'i'
  Expected 0, got 2:  'm'
  Expected 0, got 1:  'l'
  Expected 0, got 2:  's'
  Expected 1, got 0:  'c'
  Expected 1, got 0:  'd'
  Expected 2, got 0:  'r'
................
  r87472 | raymond.hettinger | 2010-12-24 11:04:00 +0100 (Fri, 24 Dec 2010) | 1 line
  
  Add news entry for 87471.
................
  r87473 | raymond.hettinger | 2010-12-24 11:30:06 +0100 (Fri, 24 Dec 2010) | 1 line
  
  Add direct tests for the util functions.
................
  r87474 | raymond.hettinger | 2010-12-24 12:20:30 +0100 (Fri, 24 Dec 2010) | 1 line
  
  Put diff output in useful order (when the elements were first seen).
................
  r87475 | raymond.hettinger | 2010-12-24 12:24:00 +0100 (Fri, 24 Dec 2010) | 1 line
  
  Keep helper functions private.
................
  r87476 | vinay.sajip | 2010-12-24 13:03:48 +0100 (Fri, 24 Dec 2010) | 1 line
  
  Logging documentation updates.
................
  r87477 | raymond.hettinger | 2010-12-24 22:51:48 +0100 (Fri, 24 Dec 2010) | 1 line
  
  Adopt symmetric names for arguments (actual/expected --> first/second).
................
  r87478 | terry.reedy | 2010-12-24 22:59:03 +0100 (Fri, 24 Dec 2010) | 2 lines
  
  Match current tracker name, though I do not know if still active.
................
  r87479 | r.david.murray | 2010-12-24 23:36:49 +0100 (Fri, 24 Dec 2010) | 8 lines
  
  #1693546: don't add quotes around RFC 2231 encoded values.
  
  The RFC is bit hard to understand on this point, but the examples
  clearly show that parameter values that are encoded according
  to its charset/language rules don't have surrounding quotes, and
  the ABNF does not allow for quotes.  So when we produce such
  encoded values, we no longer add quotes.
................
  r87482 | brian.quinlan | 2010-12-25 00:10:41 +0100 (Sat, 25 Dec 2010) | 1 line
  
  Better reporting of test failures on Windows.
................
  r87483 | brian.quinlan | 2010-12-25 01:18:27 +0100 (Sat, 25 Dec 2010) | 1 line
  
  Assign closed handles to None to make errors more obvious if they are used.
................
  r87485 | victor.stinner | 2010-12-25 23:40:32 +0100 (Sat, 25 Dec 2010) | 5 lines
  
  Issue #10763: subprocess.communicate() closes stdout and stderr if both are
  pipes (bug specific to Windows).
  
  Improve also the unit test: write a portable unit test.
................
  r87486 | eric.araujo | 2010-12-26 03:18:49 +0100 (Sun, 26 Dec 2010) | 2 lines
  
  Fix typo spotted by Rodrigo Bernardo Pimentel (#9891)
................
  r87489 | eric.araujo | 2010-12-26 03:38:05 +0100 (Sun, 26 Dec 2010) | 2 lines
  
  Remove unexistent parameter (#3216)
................
  r87492 | terry.reedy | 2010-12-26 04:48:35 +0100 (Sun, 26 Dec 2010) | 1 line
  
  revert 87478
................
  r87493 | eric.araujo | 2010-12-26 18:53:27 +0100 (Sun, 26 Dec 2010) | 2 lines
  
  Fix typo (#10770)
................
  r87496 | vinay.sajip | 2010-12-26 19:47:51 +0100 (Sun, 26 Dec 2010) | 1 line
  
  Improved logging cookbook for logging with multiprocessing.
................
  r87497 | r.david.murray | 2010-12-26 20:54:29 +0100 (Sun, 26 Dec 2010) | 10 lines
  
  #5258/#10642: print fn, line, traceback and continue when .pth file is broken
  
  If a .pth file contained an error, it could cause a traceback in site.py,
  terminating its processing.  In 2.7 and 3.2, the interpreter will then not
  start.  Previously, a message would print saying to use -v to get the
  traceback.  In either case, the traceback generated for a failed .pth file did
  not include the .pth filename, making it difficult to debug the problem.  Now
  site.py reports not only the .pth filename but also the line number causing the
  error, and just skips the remainder of the file.
................
  r87498 | vinay.sajip | 2010-12-26 22:22:33 +0100 (Sun, 26 Dec 2010) | 1 line
  
  Added logging documentation cross-references.
................
  r87501 | r.david.murray | 2010-12-27 01:03:13 +0100 (Mon, 27 Dec 2010) | 2 lines
  
  Escape file path before searching for it in output via regex
................
  r87504 | victor.stinner | 2010-12-27 02:49:26 +0100 (Mon, 27 Dec 2010) | 1 line
  
  Issue #9738: Document encodings of error and warning functions
................
  r87505 | victor.stinner | 2010-12-27 02:49:29 +0100 (Mon, 27 Dec 2010) | 1 line
  
  Issue #9738: document encodings of unicode functions
................
  r87506 | victor.stinner | 2010-12-27 02:49:31 +0100 (Mon, 27 Dec 2010) | 1 line
  
  Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
................
  r87507 | victor.stinner | 2010-12-27 03:39:20 +0100 (Mon, 27 Dec 2010) | 1 line
  
  Issue #9738: Ooops, fix typos in my previous commit (r87506)
................
  r87508 | r.david.murray | 2010-12-27 05:31:48 +0100 (Mon, 27 Dec 2010) | 5 lines
  
  Skip test that does not raise an error on Windows.
  
  I'm assuming that the putative path from the malformed
  pth file is simply not found and therefore ignored.
................
  r87512 | vinay.sajip | 2010-12-27 12:18:52 +0100 (Mon, 27 Dec 2010) | 1 line
  
  Issue #10774: test_logging now removes temp files created during tests.
................
  r87513 | vinay.sajip | 2010-12-27 15:31:52 +0100 (Mon, 27 Dec 2010) | 1 line
  
  Issue #10626: test_logging now preserves logger disabled states.
................
  r87514 | vinay.sajip | 2010-12-27 19:34:25 +0100 (Mon, 27 Dec 2010) | 1 line
  
  Issue #10626: test_logging now preserves logger disabled states.
................
  r87516 | r.david.murray | 2010-12-27 21:09:32 +0100 (Mon, 27 Dec 2010) | 5 lines
  
  #7056: runtest and runtest_inner don't use testdir, so drop it from their sigs
  
  I've only tested regular runs and -j runs.  If I've broken anything
  else I'm sure I'll hear about it sooner or later.
................
  r87517 | victor.stinner | 2010-12-27 21:10:36 +0100 (Mon, 27 Dec 2010) | 3 lines
  
  Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystem
  encoding instead of UTF-8.
................
  r87518 | victor.stinner | 2010-12-27 21:12:13 +0100 (Mon, 27 Dec 2010) | 3 lines
  
  Issue #10778: decoding_fgets() decodes the filename from the filesystem
  encoding instead of UTF-8.
................
  r87519 | victor.stinner | 2010-12-28 01:28:21 +0100 (Tue, 28 Dec 2010) | 3 lines
  
  Issue #10780: PyErr_SetFromWindowsErrWithFilename() and
  PyErr_SetExcFromWindowsErrWithFilename() decode the filename from the
  filesystem encoding instead of UTF-8.
................
  r87520 | victor.stinner | 2010-12-28 01:59:02 +0100 (Tue, 28 Dec 2010) | 3 lines
  
  Issue #8966: Remove the documentation of ctypes.set_conversion_mode()
  
  Function removed by r83195.
................
  r87521 | victor.stinner | 2010-12-28 01:59:03 +0100 (Tue, 28 Dec 2010) | 3 lines
  
  Issue #10780: Remove commas at the end of the argument list
  
  Forbidden in C, stupid language!
................
  r87522 | georg.brandl | 2010-12-28 10:16:12 +0100 (Tue, 28 Dec 2010) | 1 line
  
  Replace sys.maxint mention by sys.maxsize.
................
  r87523 | georg.brandl | 2010-12-28 10:18:24 +0100 (Tue, 28 Dec 2010) | 1 line
  
  Remove confusing paragraph -- this is relevant only to advanced users anyway and does not belong into the tutorial.
................
  r87524 | georg.brandl | 2010-12-28 10:29:19 +0100 (Tue, 28 Dec 2010) | 1 line
  
  Fix advice: call PyType_Ready to fill in ob_type of custom types.
................
  r87525 | georg.brandl | 2010-12-28 10:51:43 +0100 (Tue, 28 Dec 2010) | 1 line
  
  #10679: install idle, pydoc, 2to3 scripts with X.Y suffix for make altinstall; create symlinks for make install.
................
  r87526 | georg.brandl | 2010-12-28 11:38:33 +0100 (Tue, 28 Dec 2010) | 1 line
  
  #10777: fix iteration over dict keys while mutating the dict.
................
  r87527 | georg.brandl | 2010-12-28 11:56:20 +0100 (Tue, 28 Dec 2010) | 1 line
  
  #10768: fix ScrolledText widget construction, and make the example work from the interactive shell.
................
  r87528 | georg.brandl | 2010-12-28 12:02:12 +0100 (Tue, 28 Dec 2010) | 1 line
  
  Add news entry and clarify another.
................
  r87529 | victor.stinner | 2010-12-28 12:02:46 +0100 (Tue, 28 Dec 2010) | 2 lines
  
  Issue #9738: Fix typo, ASCII-encoding string => ASCII-encoded string
................
  r87530 | georg.brandl | 2010-12-28 12:06:07 +0100 (Tue, 28 Dec 2010) | 1 line
  
  #10767: update README in crashers; not all may have a bug entry and/or be fixed.
................
  r87531 | georg.brandl | 2010-12-28 12:08:17 +0100 (Tue, 28 Dec 2010) | 1 line
  
  #10742: document readonly attribute of memoryviews.
................
  r87532 | georg.brandl | 2010-12-28 12:15:49 +0100 (Tue, 28 Dec 2010) | 1 line
  
  #10781: clarify that *encoding* is not a parameter for Node objects in general.
................
  r87533 | georg.brandl | 2010-12-28 12:38:12 +0100 (Tue, 28 Dec 2010) | 1 line
  
  Remove history; adapt a bit more to reST, since this will once be part of the dev guide.
................
  r87534 | georg.brandl | 2010-12-28 12:48:53 +0100 (Tue, 28 Dec 2010) | 1 line
  
  Rewrap.
................
  r87535 | georg.brandl | 2010-12-28 12:49:41 +0100 (Tue, 28 Dec 2010) | 1 line
  
  #10739: document that on Windows, socket.makefile() does not make a file that has a true file descriptor usable where such a thing is expected.
................
  r87536 | georg.brandl | 2010-12-28 12:53:25 +0100 (Tue, 28 Dec 2010) | 1 line
  
  #10609: fix non-working dbm example.
................
  r87537 | victor.stinner | 2010-12-28 14:26:42 +0100 (Tue, 28 Dec 2010) | 6 lines
  
  Issue #10783: struct.pack() doesn't encode implicitly unicode to UTF-8
  
   * Replace "bytes" by "bytes object" in struct error messages
   * Document the API change in What's new in Python 3.2
   * Fix test_wave
   * Remove also ugly implicit conversions in test_struct
................
  r87538 | victor.stinner | 2010-12-28 14:33:43 +0100 (Tue, 28 Dec 2010) | 1 line
  
  Issue #10783: Fix test_sys, pack('c', ' ') => pack('c', b' ')
................
  r87539 | brian.curtin | 2010-12-28 15:31:47 +0100 (Tue, 28 Dec 2010) | 3 lines
  
  Fix #9333. The symlink function is always available now, raising OSError
  when the user doesn't hold the symbolic link privilege rather than hiding it.
................
  r87542 | senthil.kumaran | 2010-12-28 16:55:16 +0100 (Tue, 28 Dec 2010) | 3 lines
  
  Fix Issue10759 - html.parser.unescape() fails on HTML entities with incorrect syntax
................
  r87547 | brian.curtin | 2010-12-28 18:08:22 +0100 (Tue, 28 Dec 2010) | 3 lines
  
  Minor doc update for #9333. Took out the phrasing about os.symlink not
  existing and mentioned the OSError possibility.
................
  r87548 | brian.curtin | 2010-12-28 18:12:43 +0100 (Tue, 28 Dec 2010) | 3 lines
  
  This file was obsolted by a number of adjustments to the os.symlink tests
  on Windows, and is no longer needed by any tests or Lib/test/support.py
................
  r87549 | georg.brandl | 2010-12-28 19:30:18 +0100 (Tue, 28 Dec 2010) | 1 line
  
  Add sys.flags.quiet attribute for the new -q option, as noted missing by Eric in #1772833.
................
  r87550 | r.david.murray | 2010-12-28 19:54:13 +0100 (Tue, 28 Dec 2010) | 8 lines
  
  #9824: encode , and ; in cookie values so that browsers don't split on them
  
  There is a small chance of backward incompatibility here, but only for
  non-SimpleCookie applications reading SimpleCookie generated cookies.  Even
  then, any such ap is likely to be handling escaped values already, and it would
  take a fairly perverse implementation of unescaping to fail to unescape these
  newly escaped chars, so the risk seems minimal.
................
  r87553 | terry.reedy | 2010-12-28 20:30:19 +0100 (Tue, 28 Dec 2010) | 2 lines
  
  Issue 10738: Fix webbrowser.Opera.raise_opts value.
................
  r87556 | brian.quinlan | 2010-12-28 22:14:34 +0100 (Tue, 28 Dec 2010) | 1 line
  
  Does not install a logging handler. Fixes issue 10626.
................
  r87557 | victor.stinner | 2010-12-29 00:05:20 +0100 (Wed, 29 Dec 2010) | 1 line
  
  Compile pgenmain.c and printgrammar.c with PGEN defined
................
  r87558 | victor.stinner | 2010-12-29 00:14:17 +0100 (Wed, 29 Dec 2010) | 1 line
  
  Don't ignore pgen error (on "make Parser/pgen.stamp")
................
  r87559 | victor.stinner | 2010-12-29 00:35:10 +0100 (Wed, 29 Dec 2010) | 1 line
  
  Issue #10783: rephrase the changelog (NEWS, What's new)
................
  r87560 | victor.stinner | 2010-12-29 00:39:51 +0100 (Wed, 29 Dec 2010) | 1 line
  
  Rephrase PyUnicode_CompareWithASCIIString() documentation
................
  r87561 | brian.curtin | 2010-12-29 03:04:28 +0100 (Wed, 29 Dec 2010) | 2 lines
  
  Fix #9333 on Windows XP, where os.symlink is not a possibility.
................
  r87562 | brian.curtin | 2010-12-29 03:41:07 +0100 (Wed, 29 Dec 2010) | 2 lines
  
  Close stdout, clear ResourceWarning
................
  r87563 | victor.stinner | 2010-12-29 03:44:42 +0100 (Wed, 29 Dec 2010) | 1 line
  
  Issue #10783: rephrase the changelog (new try)
................
  r87564 | senthil.kumaran | 2010-12-29 07:25:42 +0100 (Wed, 29 Dec 2010) | 3 lines
  
  Fix Issue 10753 - Don't quote ;=, in the PATH_INFO envvar.
................
  r87567 | r.david.murray | 2010-12-29 17:57:24 +0100 (Wed, 29 Dec 2010) | 2 lines
  
  Fix a comment typo and update another comment to match Python3 reality                                                                                                                                                                                                                 
................
  r87569 | terry.reedy | 2010-12-29 20:02:07 +0100 (Wed, 29 Dec 2010) | 2 lines
  
  Minor clarification
................
  r87571 | r.david.murray | 2010-12-29 20:06:48 +0100 (Wed, 29 Dec 2010) | 2 lines
  
  Fix same typo in docs.
................
  r87573 | senthil.kumaran | 2010-12-30 08:07:58 +0100 (Thu, 30 Dec 2010) | 3 lines
  
  Fix Issue10793 - hashlib documentation issue on return type of digest
................
  r87575 | martin.v.loewis | 2010-12-30 09:36:37 +0100 (Thu, 30 Dec 2010) | 2 lines
  
  Issue #10542: Document that identifiers use XID_Start XID_Continue*.
................
  r87577 | martin.v.loewis | 2010-12-30 15:55:47 +0100 (Thu, 30 Dec 2010) | 2 lines
  
  Build and install libpython3.so.
................
  r87579 | georg.brandl | 2010-12-30 18:22:33 +0100 (Thu, 30 Dec 2010) | 1 line
  
  Remove some of the old demos.  (Put a few somewhere else.)
................
  r87580 | georg.brandl | 2010-12-30 18:32:22 +0100 (Thu, 30 Dec 2010) | 1 line
  
  Clean up tools: remove "world" and "framer", move single SSL script to scripts/.
................
  r87581 | georg.brandl | 2010-12-30 18:36:17 +0100 (Thu, 30 Dec 2010) | 1 line
  
  Fix NameErrors.
................
  r87582 | michael.foord | 2010-12-30 20:36:29 +0100 (Thu, 30 Dec 2010) | 1 line
  
  Issue 10786: unittest.TextTestRunner default stream no longer bound at import time
................
  r87583 | georg.brandl | 2010-12-30 22:33:07 +0100 (Thu, 30 Dec 2010) | 1 line
  
  More cleanup: Move some demos into a dedicated Tools/demo dir, move 2to3 demo to Tools, and remove all the other Demo content.
................
  r87584 | georg.brandl | 2010-12-30 22:33:49 +0100 (Thu, 30 Dec 2010) | 1 line
  
  Remove the actual Demo dir.
................
  r87585 | georg.brandl | 2010-12-30 23:11:50 +0100 (Thu, 30 Dec 2010) | 1 line
  
  Harmonize docstrings.  Move redemo from Tools/scripts to Tools/demo.  Add a README file to Tools/demo.
................
  r87586 | georg.brandl | 2010-12-30 23:12:40 +0100 (Thu, 30 Dec 2010) | 1 line
  
  Remove mentions of the Demo directory.
................
  r87587 | georg.brandl | 2010-12-30 23:31:10 +0100 (Thu, 30 Dec 2010) | 1 line
  
  Add the missing __main__.py in the turtledemo package.  It seems to have been lost during some mass rename action (r86095).
................
  r87588 | georg.brandl | 2010-12-30 23:32:49 +0100 (Thu, 30 Dec 2010) | 1 line
  
  Update README, remove empty directory.
................
  r87589 | vinay.sajip | 2010-12-31 00:26:50 +0100 (Fri, 31 Dec 2010) | 1 line
  
  Issue #10788: Changed test_logging setUp logic to provide more information.
................
  r87590 | r.david.murray | 2010-12-31 20:21:14 +0100 (Fri, 31 Dec 2010) | 4 lines
  
  #9361: add some tests for calendar.leapdays
  
  Patch by John Chandler.
................
  r87593 | georg.brandl | 2011-01-01 00:00:03 +0100 (Sat, 01 Jan 2011) | 1 line
  
  Happy New Year!  (CET edition)
................
  r87594 | raymond.hettinger | 2011-01-01 00:16:17 +0100 (Sat, 01 Jan 2011) | 1 line
  
  Fix OrderedDict.setdefault() to work for subclasses that define __missing__().
................
  r87595 | raymond.hettinger | 2011-01-01 00:23:06 +0100 (Sat, 01 Jan 2011) | 2 lines
  
  Typo.
................
  r87598 | terry.reedy | 2011-01-01 03:25:36 +0100 (Sat, 01 Jan 2011) | 2 lines
  
  Issue 6285: catch missing IDLE help file.
................
  r87601 | terry.reedy | 2011-01-01 03:54:11 +0100 (Sat, 01 Jan 2011) | 2 lines
  
  Issue 6285: add NEWS entry for 3.2.
................
  r87603 | georg.brandl | 2011-01-01 11:07:30 +0100 (Sat, 01 Jan 2011) | 1 line
  
  Fix issue references.
................
  r87604 | georg.brandl | 2011-01-01 11:09:32 +0100 (Sat, 01 Jan 2011) | 1 line
  
  #10801: In zipfile, support different encodings for the header and the filenames.  Patch by MvL, test by Eli Bendersky.
................
  r87606 | georg.brandl | 2011-01-01 11:42:31 +0100 (Sat, 01 Jan 2011) | 1 line
  
  #10801: do not actually extract, just open() the files in the test zipfile.
................
  r87607 | benjamin.peterson | 2011-01-01 15:28:31 +0100 (Sat, 01 Jan 2011) | 1 line
  
  update copyright to 2011
................
  r87610 | gregory.p.smith | 2011-01-01 22:18:46 +0100 (Sat, 01 Jan 2011) | 2 lines
  
  post release bump
................
  r87611 | raymond.hettinger | 2011-01-01 23:38:00 +0100 (Sat, 01 Jan 2011) | 1 line
  
  Make it easier to extend OrderedDict without breaking it.
................
  r87612 | raymond.hettinger | 2011-01-02 00:51:55 +0100 (Sun, 02 Jan 2011) | 1 line
  
  Fix OrderedDic.pop() to work for subclasses that define  __missing__().
................
  r87615 | raymond.hettinger | 2011-01-02 09:03:33 +0100 (Sun, 02 Jan 2011) | 4 lines
  
  Fix doctest to not rely on order of dictionary entries.
  Use super() instead of direct references to the dict superclass.
................


Added:
   python/branches/py3k-cdecimal/Doc/howto/logging-cookbook.rst
      - copied unchanged from r87615, /python/branches/py3k/Doc/howto/logging-cookbook.rst
   python/branches/py3k-cdecimal/Doc/howto/logging.rst
      - copied unchanged from r87615, /python/branches/py3k/Doc/howto/logging.rst
   python/branches/py3k-cdecimal/Doc/library/logging.config.rst
      - copied unchanged from r87615, /python/branches/py3k/Doc/library/logging.config.rst
   python/branches/py3k-cdecimal/Doc/library/logging.handlers.rst
      - copied unchanged from r87615, /python/branches/py3k/Doc/library/logging.handlers.rst
   python/branches/py3k-cdecimal/Include/typeslots.h
      - copied unchanged from r87615, /python/branches/py3k/Include/typeslots.h
   python/branches/py3k-cdecimal/Lib/encodings/base64_codec.py
      - copied unchanged from r87615, /python/branches/py3k/Lib/encodings/base64_codec.py
   python/branches/py3k-cdecimal/Lib/encodings/bz2_codec.py
      - copied unchanged from r87615, /python/branches/py3k/Lib/encodings/bz2_codec.py
   python/branches/py3k-cdecimal/Lib/encodings/hex_codec.py
      - copied unchanged from r87615, /python/branches/py3k/Lib/encodings/hex_codec.py
   python/branches/py3k-cdecimal/Lib/encodings/quopri_codec.py
      - copied unchanged from r87615, /python/branches/py3k/Lib/encodings/quopri_codec.py
   python/branches/py3k-cdecimal/Lib/encodings/rot_13.py
      - copied unchanged from r87615, /python/branches/py3k/Lib/encodings/rot_13.py
   python/branches/py3k-cdecimal/Lib/encodings/uu_codec.py
      - copied unchanged from r87615, /python/branches/py3k/Lib/encodings/uu_codec.py
   python/branches/py3k-cdecimal/Lib/encodings/zlib_codec.py
      - copied unchanged from r87615, /python/branches/py3k/Lib/encodings/zlib_codec.py
   python/branches/py3k-cdecimal/Lib/pydoc_data/_pydoc.css
      - copied unchanged from r87615, /python/branches/py3k/Lib/pydoc_data/_pydoc.css
   python/branches/py3k-cdecimal/Lib/test/__main__.py
      - copied unchanged from r87615, /python/branches/py3k/Lib/test/__main__.py
   python/branches/py3k-cdecimal/Lib/test/json_tests/   (props changed)
      - copied from r87615, /python/branches/py3k/Lib/test/json_tests/
   python/branches/py3k-cdecimal/Lib/test/subprocessdata/
      - copied from r87615, /python/branches/py3k/Lib/test/subprocessdata/
   python/branches/py3k-cdecimal/Lib/test/zip_cp437_header.zip
      - copied unchanged from r87615, /python/branches/py3k/Lib/test/zip_cp437_header.zip
   python/branches/py3k-cdecimal/Lib/turtledemo/__main__.py
      - copied unchanged from r87615, /python/branches/py3k/Lib/turtledemo/__main__.py
   python/branches/py3k-cdecimal/Lib/unittest/test/_test_warnings.py
      - copied unchanged from r87615, /python/branches/py3k/Lib/unittest/test/_test_warnings.py
   python/branches/py3k-cdecimal/Modules/xxlimited.c
      - copied unchanged from r87615, /python/branches/py3k/Modules/xxlimited.c
   python/branches/py3k-cdecimal/Objects/typeslots.inc
      - copied unchanged from r87615, /python/branches/py3k/Objects/typeslots.inc
   python/branches/py3k-cdecimal/Objects/typeslots.py
      - copied unchanged from r87615, /python/branches/py3k/Objects/typeslots.py
   python/branches/py3k-cdecimal/PC/python3.def
      - copied unchanged from r87615, /python/branches/py3k/PC/python3.def
   python/branches/py3k-cdecimal/PC/python3.mak
      - copied unchanged from r87615, /python/branches/py3k/PC/python3.mak
   python/branches/py3k-cdecimal/PC/python32gen.py
      - copied unchanged from r87615, /python/branches/py3k/PC/python32gen.py
   python/branches/py3k-cdecimal/PC/python32stub.def
      - copied unchanged from r87615, /python/branches/py3k/PC/python32stub.def
   python/branches/py3k-cdecimal/PC/python3dll.c
      - copied unchanged from r87615, /python/branches/py3k/PC/python3dll.c
   python/branches/py3k-cdecimal/PCbuild/python3dll.vcproj
      - copied unchanged from r87615, /python/branches/py3k/PCbuild/python3dll.vcproj
   python/branches/py3k-cdecimal/PCbuild/xxlimited.vcproj
      - copied unchanged from r87615, /python/branches/py3k/PCbuild/xxlimited.vcproj
   python/branches/py3k-cdecimal/Tools/demo/
      - copied from r87615, /python/branches/py3k/Tools/demo/
   python/branches/py3k-cdecimal/Tools/parser/
      - copied from r87615, /python/branches/py3k/Tools/parser/
   python/branches/py3k-cdecimal/Tools/scripts/abitype.py
      - copied unchanged from r87615, /python/branches/py3k/Tools/scripts/abitype.py
   python/branches/py3k-cdecimal/Tools/scripts/find-uname.py
      - copied unchanged from r87615, /python/branches/py3k/Tools/scripts/find-uname.py
   python/branches/py3k-cdecimal/Tools/scripts/get-remote-certificate.py
      - copied unchanged from r87615, /python/branches/py3k/Tools/scripts/get-remote-certificate.py
   python/branches/py3k-cdecimal/Tools/test2to3/   (props changed)
      - copied from r87615, /python/branches/py3k/Tools/test2to3/
Removed:
   python/branches/py3k-cdecimal/Demo/
   python/branches/py3k-cdecimal/Lib/json/tests/
   python/branches/py3k-cdecimal/Lib/test/symlink_support.py
   python/branches/py3k-cdecimal/Misc/RFD
   python/branches/py3k-cdecimal/Misc/pymemcompat.h
   python/branches/py3k-cdecimal/Misc/setuid-prog.c
   python/branches/py3k-cdecimal/Tools/framer/
   python/branches/py3k-cdecimal/Tools/scripts/redemo.py
   python/branches/py3k-cdecimal/Tools/ssl/
   python/branches/py3k-cdecimal/Tools/world/
   python/branches/py3k-cdecimal/runtests.sh
Modified:
   python/branches/py3k-cdecimal/   (props changed)
   python/branches/py3k-cdecimal/.gitignore
   python/branches/py3k-cdecimal/Doc/ACKS.txt
   python/branches/py3k-cdecimal/Doc/README.txt
   python/branches/py3k-cdecimal/Doc/c-api/buffer.rst
   python/branches/py3k-cdecimal/Doc/c-api/codec.rst
   python/branches/py3k-cdecimal/Doc/c-api/exceptions.rst
   python/branches/py3k-cdecimal/Doc/c-api/import.rst
   python/branches/py3k-cdecimal/Doc/c-api/init.rst
   python/branches/py3k-cdecimal/Doc/c-api/intro.rst
   python/branches/py3k-cdecimal/Doc/c-api/list.rst
   python/branches/py3k-cdecimal/Doc/c-api/slice.rst
   python/branches/py3k-cdecimal/Doc/c-api/typeobj.rst
   python/branches/py3k-cdecimal/Doc/c-api/unicode.rst
   python/branches/py3k-cdecimal/Doc/c-api/veryhigh.rst
   python/branches/py3k-cdecimal/Doc/copyright.rst
   python/branches/py3k-cdecimal/Doc/distutils/apiref.rst
   python/branches/py3k-cdecimal/Doc/documenting/markup.rst
   python/branches/py3k-cdecimal/Doc/extending/embedding.rst
   python/branches/py3k-cdecimal/Doc/extending/extending.rst
   python/branches/py3k-cdecimal/Doc/extending/windows.rst
   python/branches/py3k-cdecimal/Doc/faq/extending.rst
   python/branches/py3k-cdecimal/Doc/glossary.rst
   python/branches/py3k-cdecimal/Doc/howto/index.rst
   python/branches/py3k-cdecimal/Doc/includes/tzinfo-examples.py
   python/branches/py3k-cdecimal/Doc/install/index.rst
   python/branches/py3k-cdecimal/Doc/library/_thread.rst
   python/branches/py3k-cdecimal/Doc/library/allos.rst
   python/branches/py3k-cdecimal/Doc/library/argparse.rst
   python/branches/py3k-cdecimal/Doc/library/array.rst
   python/branches/py3k-cdecimal/Doc/library/bdb.rst
   python/branches/py3k-cdecimal/Doc/library/builtins.rst
   python/branches/py3k-cdecimal/Doc/library/codecs.rst
   python/branches/py3k-cdecimal/Doc/library/collections.rst
   python/branches/py3k-cdecimal/Doc/library/compileall.rst
   python/branches/py3k-cdecimal/Doc/library/concurrent.futures.rst
   python/branches/py3k-cdecimal/Doc/library/configparser.rst
   python/branches/py3k-cdecimal/Doc/library/ctypes.rst
   python/branches/py3k-cdecimal/Doc/library/curses.rst
   python/branches/py3k-cdecimal/Doc/library/dbm.rst
   python/branches/py3k-cdecimal/Doc/library/difflib.rst
   python/branches/py3k-cdecimal/Doc/library/dis.rst
   python/branches/py3k-cdecimal/Doc/library/doctest.rst
   python/branches/py3k-cdecimal/Doc/library/email.header.rst
   python/branches/py3k-cdecimal/Doc/library/email.message.rst
   python/branches/py3k-cdecimal/Doc/library/email.util.rst
   python/branches/py3k-cdecimal/Doc/library/exceptions.rst
   python/branches/py3k-cdecimal/Doc/library/fileformats.rst
   python/branches/py3k-cdecimal/Doc/library/functions.rst
   python/branches/py3k-cdecimal/Doc/library/functools.rst
   python/branches/py3k-cdecimal/Doc/library/grp.rst
   python/branches/py3k-cdecimal/Doc/library/hashlib.rst
   python/branches/py3k-cdecimal/Doc/library/heapq.rst
   python/branches/py3k-cdecimal/Doc/library/html.parser.rst
   python/branches/py3k-cdecimal/Doc/library/http.client.rst
   python/branches/py3k-cdecimal/Doc/library/imp.rst
   python/branches/py3k-cdecimal/Doc/library/inspect.rst
   python/branches/py3k-cdecimal/Doc/library/io.rst
   python/branches/py3k-cdecimal/Doc/library/itertools.rst
   python/branches/py3k-cdecimal/Doc/library/logging.rst
   python/branches/py3k-cdecimal/Doc/library/msilib.rst
   python/branches/py3k-cdecimal/Doc/library/multiprocessing.rst
   python/branches/py3k-cdecimal/Doc/library/os.path.rst
   python/branches/py3k-cdecimal/Doc/library/os.rst
   python/branches/py3k-cdecimal/Doc/library/parser.rst
   python/branches/py3k-cdecimal/Doc/library/pdb.rst
   python/branches/py3k-cdecimal/Doc/library/pickle.rst
   python/branches/py3k-cdecimal/Doc/library/pkgutil.rst
   python/branches/py3k-cdecimal/Doc/library/platform.rst
   python/branches/py3k-cdecimal/Doc/library/pty.rst
   python/branches/py3k-cdecimal/Doc/library/py_compile.rst
   python/branches/py3k-cdecimal/Doc/library/pydoc.rst
   python/branches/py3k-cdecimal/Doc/library/random.rst
   python/branches/py3k-cdecimal/Doc/library/re.rst
   python/branches/py3k-cdecimal/Doc/library/runpy.rst
   python/branches/py3k-cdecimal/Doc/library/shelve.rst
   python/branches/py3k-cdecimal/Doc/library/socket.rst
   python/branches/py3k-cdecimal/Doc/library/someos.rst
   python/branches/py3k-cdecimal/Doc/library/sqlite3.rst
   python/branches/py3k-cdecimal/Doc/library/stdtypes.rst
   python/branches/py3k-cdecimal/Doc/library/string.rst
   python/branches/py3k-cdecimal/Doc/library/struct.rst
   python/branches/py3k-cdecimal/Doc/library/subprocess.rst
   python/branches/py3k-cdecimal/Doc/library/sys.rst
   python/branches/py3k-cdecimal/Doc/library/test.rst
   python/branches/py3k-cdecimal/Doc/library/textwrap.rst
   python/branches/py3k-cdecimal/Doc/library/threading.rst
   python/branches/py3k-cdecimal/Doc/library/tkinter.rst
   python/branches/py3k-cdecimal/Doc/library/tkinter.tix.rst
   python/branches/py3k-cdecimal/Doc/library/trace.rst
   python/branches/py3k-cdecimal/Doc/library/turtle.rst
   python/branches/py3k-cdecimal/Doc/library/unicodedata.rst
   python/branches/py3k-cdecimal/Doc/library/unittest.rst
   python/branches/py3k-cdecimal/Doc/library/urllib.parse.rst
   python/branches/py3k-cdecimal/Doc/library/urllib.request.rst
   python/branches/py3k-cdecimal/Doc/library/warnings.rst
   python/branches/py3k-cdecimal/Doc/library/xml.dom.minidom.rst
   python/branches/py3k-cdecimal/Doc/library/zipfile.rst
   python/branches/py3k-cdecimal/Doc/license.rst
   python/branches/py3k-cdecimal/Doc/reference/datamodel.rst
   python/branches/py3k-cdecimal/Doc/reference/expressions.rst
   python/branches/py3k-cdecimal/Doc/reference/lexical_analysis.rst
   python/branches/py3k-cdecimal/Doc/tools/sphinxext/static/basic.css
   python/branches/py3k-cdecimal/Doc/tools/sphinxext/susp-ignored.csv
   python/branches/py3k-cdecimal/Doc/tutorial/interpreter.rst
   python/branches/py3k-cdecimal/Doc/tutorial/stdlib.rst
   python/branches/py3k-cdecimal/Doc/using/cmdline.rst
   python/branches/py3k-cdecimal/Doc/whatsnew/2.7.rst
   python/branches/py3k-cdecimal/Doc/whatsnew/3.2.rst
   python/branches/py3k-cdecimal/Include/Python.h
   python/branches/py3k-cdecimal/Include/abstract.h
   python/branches/py3k-cdecimal/Include/ast.h
   python/branches/py3k-cdecimal/Include/bytearrayobject.h
   python/branches/py3k-cdecimal/Include/bytes_methods.h
   python/branches/py3k-cdecimal/Include/bytesobject.h
   python/branches/py3k-cdecimal/Include/cellobject.h
   python/branches/py3k-cdecimal/Include/ceval.h
   python/branches/py3k-cdecimal/Include/classobject.h
   python/branches/py3k-cdecimal/Include/code.h
   python/branches/py3k-cdecimal/Include/codecs.h
   python/branches/py3k-cdecimal/Include/compile.h
   python/branches/py3k-cdecimal/Include/complexobject.h
   python/branches/py3k-cdecimal/Include/datetime.h
   python/branches/py3k-cdecimal/Include/descrobject.h
   python/branches/py3k-cdecimal/Include/dictobject.h
   python/branches/py3k-cdecimal/Include/dtoa.h
   python/branches/py3k-cdecimal/Include/eval.h
   python/branches/py3k-cdecimal/Include/fileobject.h
   python/branches/py3k-cdecimal/Include/floatobject.h
   python/branches/py3k-cdecimal/Include/frameobject.h
   python/branches/py3k-cdecimal/Include/funcobject.h
   python/branches/py3k-cdecimal/Include/genobject.h
   python/branches/py3k-cdecimal/Include/import.h
   python/branches/py3k-cdecimal/Include/listobject.h
   python/branches/py3k-cdecimal/Include/longintrepr.h
   python/branches/py3k-cdecimal/Include/longobject.h
   python/branches/py3k-cdecimal/Include/marshal.h
   python/branches/py3k-cdecimal/Include/memoryobject.h
   python/branches/py3k-cdecimal/Include/methodobject.h
   python/branches/py3k-cdecimal/Include/modsupport.h
   python/branches/py3k-cdecimal/Include/moduleobject.h
   python/branches/py3k-cdecimal/Include/object.h
   python/branches/py3k-cdecimal/Include/objimpl.h
   python/branches/py3k-cdecimal/Include/parsetok.h
   python/branches/py3k-cdecimal/Include/patchlevel.h
   python/branches/py3k-cdecimal/Include/pyarena.h
   python/branches/py3k-cdecimal/Include/pyatomic.h
   python/branches/py3k-cdecimal/Include/pyctype.h
   python/branches/py3k-cdecimal/Include/pydebug.h
   python/branches/py3k-cdecimal/Include/pyerrors.h
   python/branches/py3k-cdecimal/Include/pygetopt.h
   python/branches/py3k-cdecimal/Include/pymath.h
   python/branches/py3k-cdecimal/Include/pystate.h
   python/branches/py3k-cdecimal/Include/pystrtod.h
   python/branches/py3k-cdecimal/Include/pythonrun.h
   python/branches/py3k-cdecimal/Include/pythread.h
   python/branches/py3k-cdecimal/Include/pytime.h
   python/branches/py3k-cdecimal/Include/setobject.h
   python/branches/py3k-cdecimal/Include/sliceobject.h
   python/branches/py3k-cdecimal/Include/structseq.h
   python/branches/py3k-cdecimal/Include/symtable.h
   python/branches/py3k-cdecimal/Include/sysmodule.h
   python/branches/py3k-cdecimal/Include/timefuncs.h
   python/branches/py3k-cdecimal/Include/token.h
   python/branches/py3k-cdecimal/Include/traceback.h
   python/branches/py3k-cdecimal/Include/tupleobject.h
   python/branches/py3k-cdecimal/Include/ucnhash.h
   python/branches/py3k-cdecimal/Include/unicodeobject.h
   python/branches/py3k-cdecimal/Include/warnings.h
   python/branches/py3k-cdecimal/Include/weakrefobject.h
   python/branches/py3k-cdecimal/LICENSE
   python/branches/py3k-cdecimal/Lib/_abcoll.py
   python/branches/py3k-cdecimal/Lib/_pyio.py
   python/branches/py3k-cdecimal/Lib/_weakrefset.py
   python/branches/py3k-cdecimal/Lib/argparse.py
   python/branches/py3k-cdecimal/Lib/bdb.py
   python/branches/py3k-cdecimal/Lib/codecs.py
   python/branches/py3k-cdecimal/Lib/collections.py
   python/branches/py3k-cdecimal/Lib/compileall.py
   python/branches/py3k-cdecimal/Lib/concurrent/futures/_base.py
   python/branches/py3k-cdecimal/Lib/concurrent/futures/process.py
   python/branches/py3k-cdecimal/Lib/configparser.py
   python/branches/py3k-cdecimal/Lib/dbm/dumb.py
   python/branches/py3k-cdecimal/Lib/decimal.py
   python/branches/py3k-cdecimal/Lib/difflib.py
   python/branches/py3k-cdecimal/Lib/distutils/__init__.py
   python/branches/py3k-cdecimal/Lib/distutils/archive_util.py
   python/branches/py3k-cdecimal/Lib/distutils/command/build_ext.py
   python/branches/py3k-cdecimal/Lib/distutils/command/install.py
   python/branches/py3k-cdecimal/Lib/distutils/sysconfig.py
   python/branches/py3k-cdecimal/Lib/doctest.py
   python/branches/py3k-cdecimal/Lib/email/_parseaddr.py
   python/branches/py3k-cdecimal/Lib/email/generator.py
   python/branches/py3k-cdecimal/Lib/email/header.py
   python/branches/py3k-cdecimal/Lib/email/message.py
   python/branches/py3k-cdecimal/Lib/email/test/test_email.py
   python/branches/py3k-cdecimal/Lib/email/utils.py
   python/branches/py3k-cdecimal/Lib/encodings/aliases.py
   python/branches/py3k-cdecimal/Lib/functools.py
   python/branches/py3k-cdecimal/Lib/getpass.py
   python/branches/py3k-cdecimal/Lib/gettext.py
   python/branches/py3k-cdecimal/Lib/html/parser.py
   python/branches/py3k-cdecimal/Lib/http/client.py
   python/branches/py3k-cdecimal/Lib/http/cookies.py
   python/branches/py3k-cdecimal/Lib/http/server.py
   python/branches/py3k-cdecimal/Lib/idlelib/Bindings.py
   python/branches/py3k-cdecimal/Lib/idlelib/EditorWindow.py
   python/branches/py3k-cdecimal/Lib/idlelib/FileList.py
   python/branches/py3k-cdecimal/Lib/idlelib/IOBinding.py
   python/branches/py3k-cdecimal/Lib/idlelib/idlever.py
   python/branches/py3k-cdecimal/Lib/idlelib/macosxSupport.py
   python/branches/py3k-cdecimal/Lib/inspect.py
   python/branches/py3k-cdecimal/Lib/lib2to3/   (props changed)
   python/branches/py3k-cdecimal/Lib/lib2to3/fixes/fix_urllib.py
   python/branches/py3k-cdecimal/Lib/lib2to3/main.py
   python/branches/py3k-cdecimal/Lib/lib2to3/refactor.py
   python/branches/py3k-cdecimal/Lib/lib2to3/tests/test_refactor.py
   python/branches/py3k-cdecimal/Lib/lib2to3/tests/test_util.py
   python/branches/py3k-cdecimal/Lib/logging/__init__.py
   python/branches/py3k-cdecimal/Lib/mimetypes.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/__init__.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/connection.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/dummy/__init__.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/dummy/connection.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/forking.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/heap.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/managers.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/pool.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/process.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/queues.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/reduction.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/sharedctypes.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/synchronize.py
   python/branches/py3k-cdecimal/Lib/multiprocessing/util.py
   python/branches/py3k-cdecimal/Lib/netrc.py
   python/branches/py3k-cdecimal/Lib/numbers.py
   python/branches/py3k-cdecimal/Lib/os.py
   python/branches/py3k-cdecimal/Lib/pdb.py
   python/branches/py3k-cdecimal/Lib/py_compile.py
   python/branches/py3k-cdecimal/Lib/pydoc.py
   python/branches/py3k-cdecimal/Lib/pydoc_data/topics.py
   python/branches/py3k-cdecimal/Lib/random.py
   python/branches/py3k-cdecimal/Lib/shelve.py
   python/branches/py3k-cdecimal/Lib/shutil.py
   python/branches/py3k-cdecimal/Lib/site.py
   python/branches/py3k-cdecimal/Lib/smtpd.py
   python/branches/py3k-cdecimal/Lib/subprocess.py
   python/branches/py3k-cdecimal/Lib/sysconfig.py
   python/branches/py3k-cdecimal/Lib/tabnanny.py
   python/branches/py3k-cdecimal/Lib/telnetlib.py
   python/branches/py3k-cdecimal/Lib/tempfile.py
   python/branches/py3k-cdecimal/Lib/test/crashers/README
   python/branches/py3k-cdecimal/Lib/test/datetimetester.py
   python/branches/py3k-cdecimal/Lib/test/pystone.py
   python/branches/py3k-cdecimal/Lib/test/regrtest.py
   python/branches/py3k-cdecimal/Lib/test/script_helper.py
   python/branches/py3k-cdecimal/Lib/test/support.py
   python/branches/py3k-cdecimal/Lib/test/test_abc.py
   python/branches/py3k-cdecimal/Lib/test/test_argparse.py
   python/branches/py3k-cdecimal/Lib/test/test_array.py
   python/branches/py3k-cdecimal/Lib/test/test_asyncore.py
   python/branches/py3k-cdecimal/Lib/test/test_bool.py
   python/branches/py3k-cdecimal/Lib/test/test_builtin.py
   python/branches/py3k-cdecimal/Lib/test/test_calendar.py
   python/branches/py3k-cdecimal/Lib/test/test_cfgparser.py
   python/branches/py3k-cdecimal/Lib/test/test_cgi.py
   python/branches/py3k-cdecimal/Lib/test/test_cmath.py
   python/branches/py3k-cdecimal/Lib/test/test_cmd_line.py
   python/branches/py3k-cdecimal/Lib/test/test_codecs.py
   python/branches/py3k-cdecimal/Lib/test/test_collections.py
   python/branches/py3k-cdecimal/Lib/test/test_compileall.py
   python/branches/py3k-cdecimal/Lib/test/test_complex.py
   python/branches/py3k-cdecimal/Lib/test/test_concurrent_futures.py
   python/branches/py3k-cdecimal/Lib/test/test_contextlib.py
   python/branches/py3k-cdecimal/Lib/test/test_csv.py
   python/branches/py3k-cdecimal/Lib/test/test_dbm_gnu.py
   python/branches/py3k-cdecimal/Lib/test/test_decimal.py
   python/branches/py3k-cdecimal/Lib/test/test_descr.py
   python/branches/py3k-cdecimal/Lib/test/test_difflib.py
   python/branches/py3k-cdecimal/Lib/test/test_dis.py
   python/branches/py3k-cdecimal/Lib/test/test_float.py
   python/branches/py3k-cdecimal/Lib/test/test_fork1.py
   python/branches/py3k-cdecimal/Lib/test/test_fractions.py
   python/branches/py3k-cdecimal/Lib/test/test_functools.py
   python/branches/py3k-cdecimal/Lib/test/test_grp.py
   python/branches/py3k-cdecimal/Lib/test/test_htmlparser.py
   python/branches/py3k-cdecimal/Lib/test/test_http_cookies.py
   python/branches/py3k-cdecimal/Lib/test/test_httplib.py
   python/branches/py3k-cdecimal/Lib/test/test_httpservers.py
   python/branches/py3k-cdecimal/Lib/test/test_import.py
   python/branches/py3k-cdecimal/Lib/test/test_inspect.py
   python/branches/py3k-cdecimal/Lib/test/test_int.py
   python/branches/py3k-cdecimal/Lib/test/test_io.py
   python/branches/py3k-cdecimal/Lib/test/test_itertools.py
   python/branches/py3k-cdecimal/Lib/test/test_json.py
   python/branches/py3k-cdecimal/Lib/test/test_listcomps.py
   python/branches/py3k-cdecimal/Lib/test/test_logging.py
   python/branches/py3k-cdecimal/Lib/test/test_long.py
   python/branches/py3k-cdecimal/Lib/test/test_math.py
   python/branches/py3k-cdecimal/Lib/test/test_memoryview.py
   python/branches/py3k-cdecimal/Lib/test/test_multiprocessing.py
   python/branches/py3k-cdecimal/Lib/test/test_netrc.py
   python/branches/py3k-cdecimal/Lib/test/test_normalization.py
   python/branches/py3k-cdecimal/Lib/test/test_ntpath.py
   python/branches/py3k-cdecimal/Lib/test/test_os.py
   python/branches/py3k-cdecimal/Lib/test/test_pdb.py
   python/branches/py3k-cdecimal/Lib/test/test_posixpath.py
   python/branches/py3k-cdecimal/Lib/test/test_pydoc.py
   python/branches/py3k-cdecimal/Lib/test/test_pyexpat.py
   python/branches/py3k-cdecimal/Lib/test/test_random.py
   python/branches/py3k-cdecimal/Lib/test/test_range.py
   python/branches/py3k-cdecimal/Lib/test/test_runpy.py
   python/branches/py3k-cdecimal/Lib/test/test_shelve.py
   python/branches/py3k-cdecimal/Lib/test/test_shutil.py
   python/branches/py3k-cdecimal/Lib/test/test_site.py
   python/branches/py3k-cdecimal/Lib/test/test_smtpd.py
   python/branches/py3k-cdecimal/Lib/test/test_smtplib.py
   python/branches/py3k-cdecimal/Lib/test/test_socket.py
   python/branches/py3k-cdecimal/Lib/test/test_ssl.py
   python/branches/py3k-cdecimal/Lib/test/test_struct.py
   python/branches/py3k-cdecimal/Lib/test/test_subprocess.py
   python/branches/py3k-cdecimal/Lib/test/test_sys.py
   python/branches/py3k-cdecimal/Lib/test/test_syslog.py
   python/branches/py3k-cdecimal/Lib/test/test_telnetlib.py
   python/branches/py3k-cdecimal/Lib/test/test_tempfile.py
   python/branches/py3k-cdecimal/Lib/test/test_threadsignals.py
   python/branches/py3k-cdecimal/Lib/test/test_time.py
   python/branches/py3k-cdecimal/Lib/test/test_trace.py
   python/branches/py3k-cdecimal/Lib/test/test_tuple.py
   python/branches/py3k-cdecimal/Lib/test/test_types.py
   python/branches/py3k-cdecimal/Lib/test/test_unicode.py
   python/branches/py3k-cdecimal/Lib/test/test_unicodedata.py
   python/branches/py3k-cdecimal/Lib/test/test_unittest.py
   python/branches/py3k-cdecimal/Lib/test/test_urllib.py
   python/branches/py3k-cdecimal/Lib/test/test_urllib2.py
   python/branches/py3k-cdecimal/Lib/test/test_urllibnet.py
   python/branches/py3k-cdecimal/Lib/test/test_urlparse.py
   python/branches/py3k-cdecimal/Lib/test/test_weakset.py
   python/branches/py3k-cdecimal/Lib/test/test_winsound.py
   python/branches/py3k-cdecimal/Lib/test/test_wsgiref.py
   python/branches/py3k-cdecimal/Lib/test/test_xml_etree.py
   python/branches/py3k-cdecimal/Lib/test/test_xml_etree_c.py
   python/branches/py3k-cdecimal/Lib/test/test_xmlrpc.py
   python/branches/py3k-cdecimal/Lib/test/test_zipfile.py
   python/branches/py3k-cdecimal/Lib/test/test_zipimport_support.py
   python/branches/py3k-cdecimal/Lib/test/test_zlib.py
   python/branches/py3k-cdecimal/Lib/test/win_console_handler.py
   python/branches/py3k-cdecimal/Lib/threading.py
   python/branches/py3k-cdecimal/Lib/tkinter/__init__.py
   python/branches/py3k-cdecimal/Lib/tkinter/scrolledtext.py
   python/branches/py3k-cdecimal/Lib/tkinter/test/test_ttk/test_widgets.py
   python/branches/py3k-cdecimal/Lib/tkinter/tix.py
   python/branches/py3k-cdecimal/Lib/turtle.py
   python/branches/py3k-cdecimal/Lib/turtledemo/about_turtledemo.txt
   python/branches/py3k-cdecimal/Lib/turtledemo/demohelp.txt
   python/branches/py3k-cdecimal/Lib/unittest/case.py
   python/branches/py3k-cdecimal/Lib/unittest/main.py
   python/branches/py3k-cdecimal/Lib/unittest/runner.py
   python/branches/py3k-cdecimal/Lib/unittest/suite.py
   python/branches/py3k-cdecimal/Lib/unittest/test/test_assertions.py
   python/branches/py3k-cdecimal/Lib/unittest/test/test_break.py
   python/branches/py3k-cdecimal/Lib/unittest/test/test_case.py
   python/branches/py3k-cdecimal/Lib/unittest/test/test_discovery.py
   python/branches/py3k-cdecimal/Lib/unittest/test/test_functiontestcase.py
   python/branches/py3k-cdecimal/Lib/unittest/test/test_loader.py
   python/branches/py3k-cdecimal/Lib/unittest/test/test_program.py
   python/branches/py3k-cdecimal/Lib/unittest/test/test_runner.py
   python/branches/py3k-cdecimal/Lib/unittest/test/test_setups.py
   python/branches/py3k-cdecimal/Lib/unittest/test/test_suite.py
   python/branches/py3k-cdecimal/Lib/unittest/util.py
   python/branches/py3k-cdecimal/Lib/urllib/parse.py
   python/branches/py3k-cdecimal/Lib/urllib/request.py
   python/branches/py3k-cdecimal/Lib/wave.py
   python/branches/py3k-cdecimal/Lib/weakref.py
   python/branches/py3k-cdecimal/Lib/webbrowser.py
   python/branches/py3k-cdecimal/Lib/wsgiref/util.py
   python/branches/py3k-cdecimal/Lib/xml/etree/ElementTree.py
   python/branches/py3k-cdecimal/Lib/xmlrpc/client.py
   python/branches/py3k-cdecimal/Lib/zipfile.py
   python/branches/py3k-cdecimal/Mac/BuildScript/build-installer.py
   python/branches/py3k-cdecimal/Mac/Makefile.in
   python/branches/py3k-cdecimal/Mac/README
   python/branches/py3k-cdecimal/Makefile.pre.in
   python/branches/py3k-cdecimal/Misc/ACKS
   python/branches/py3k-cdecimal/Misc/NEWS
   python/branches/py3k-cdecimal/Misc/README
   python/branches/py3k-cdecimal/Misc/RPM/python-3.2.spec
   python/branches/py3k-cdecimal/Misc/SpecialBuilds.txt
   python/branches/py3k-cdecimal/Misc/python-wing4.wpr
   python/branches/py3k-cdecimal/Misc/python.man
   python/branches/py3k-cdecimal/Misc/python.pc.in
   python/branches/py3k-cdecimal/Modules/_collectionsmodule.c
   python/branches/py3k-cdecimal/Modules/_ctypes/_ctypes.c
   python/branches/py3k-cdecimal/Modules/_ctypes/cfield.c
   python/branches/py3k-cdecimal/Modules/_datetimemodule.c
   python/branches/py3k-cdecimal/Modules/_elementtree.c
   python/branches/py3k-cdecimal/Modules/_functoolsmodule.c
   python/branches/py3k-cdecimal/Modules/_gdbmmodule.c
   python/branches/py3k-cdecimal/Modules/_io/bufferedio.c
   python/branches/py3k-cdecimal/Modules/_lsprof.c
   python/branches/py3k-cdecimal/Modules/_posixsubprocess.c
   python/branches/py3k-cdecimal/Modules/_ssl.c
   python/branches/py3k-cdecimal/Modules/_struct.c
   python/branches/py3k-cdecimal/Modules/_testcapimodule.c
   python/branches/py3k-cdecimal/Modules/_threadmodule.c
   python/branches/py3k-cdecimal/Modules/arraymodule.c
   python/branches/py3k-cdecimal/Modules/getpath.c
   python/branches/py3k-cdecimal/Modules/grpmodule.c
   python/branches/py3k-cdecimal/Modules/itertoolsmodule.c
   python/branches/py3k-cdecimal/Modules/main.c
   python/branches/py3k-cdecimal/Modules/mmapmodule.c
   python/branches/py3k-cdecimal/Modules/parsermodule.c
   python/branches/py3k-cdecimal/Modules/posixmodule.c
   python/branches/py3k-cdecimal/Modules/pwdmodule.c
   python/branches/py3k-cdecimal/Modules/pyexpat.c
   python/branches/py3k-cdecimal/Modules/readline.c
   python/branches/py3k-cdecimal/Modules/resource.c
   python/branches/py3k-cdecimal/Modules/signalmodule.c
   python/branches/py3k-cdecimal/Modules/socketmodule.c
   python/branches/py3k-cdecimal/Modules/socketmodule.h
   python/branches/py3k-cdecimal/Modules/spwdmodule.c
   python/branches/py3k-cdecimal/Modules/symtablemodule.c
   python/branches/py3k-cdecimal/Modules/syslogmodule.c
   python/branches/py3k-cdecimal/Modules/timemodule.c
   python/branches/py3k-cdecimal/Modules/unicodedata.c
   python/branches/py3k-cdecimal/Objects/bytearrayobject.c
   python/branches/py3k-cdecimal/Objects/bytesobject.c
   python/branches/py3k-cdecimal/Objects/complexobject.c
   python/branches/py3k-cdecimal/Objects/descrobject.c
   python/branches/py3k-cdecimal/Objects/floatobject.c
   python/branches/py3k-cdecimal/Objects/funcobject.c
   python/branches/py3k-cdecimal/Objects/genobject.c
   python/branches/py3k-cdecimal/Objects/listobject.c
   python/branches/py3k-cdecimal/Objects/longobject.c
   python/branches/py3k-cdecimal/Objects/memoryobject.c
   python/branches/py3k-cdecimal/Objects/moduleobject.c
   python/branches/py3k-cdecimal/Objects/object.c
   python/branches/py3k-cdecimal/Objects/obmalloc.c
   python/branches/py3k-cdecimal/Objects/rangeobject.c
   python/branches/py3k-cdecimal/Objects/setobject.c
   python/branches/py3k-cdecimal/Objects/sliceobject.c
   python/branches/py3k-cdecimal/Objects/stringlib/formatter.h
   python/branches/py3k-cdecimal/Objects/structseq.c
   python/branches/py3k-cdecimal/Objects/tupleobject.c
   python/branches/py3k-cdecimal/Objects/typeobject.c
   python/branches/py3k-cdecimal/Objects/unicodectype.c
   python/branches/py3k-cdecimal/Objects/unicodeobject.c
   python/branches/py3k-cdecimal/PC/VC6/readme.txt
   python/branches/py3k-cdecimal/PC/getpathp.c
   python/branches/py3k-cdecimal/PC/pyconfig.h
   python/branches/py3k-cdecimal/PC/python_nt.rc
   python/branches/py3k-cdecimal/PCbuild/build_tkinter.py
   python/branches/py3k-cdecimal/PCbuild/make_buildinfo.c
   python/branches/py3k-cdecimal/PCbuild/pcbuild.sln
   python/branches/py3k-cdecimal/PCbuild/pyproject.vsprops
   python/branches/py3k-cdecimal/PCbuild/pythoncore.vcproj
   python/branches/py3k-cdecimal/PCbuild/readme.txt
   python/branches/py3k-cdecimal/Parser/pgenmain.c
   python/branches/py3k-cdecimal/Parser/printgrammar.c
   python/branches/py3k-cdecimal/Parser/tokenizer.c
   python/branches/py3k-cdecimal/Python/_warnings.c
   python/branches/py3k-cdecimal/Python/ast.c
   python/branches/py3k-cdecimal/Python/bltinmodule.c
   python/branches/py3k-cdecimal/Python/ceval.c
   python/branches/py3k-cdecimal/Python/compile.c
   python/branches/py3k-cdecimal/Python/dynload_shlib.c
   python/branches/py3k-cdecimal/Python/dynload_win.c
   python/branches/py3k-cdecimal/Python/errors.c
   python/branches/py3k-cdecimal/Python/future.c
   python/branches/py3k-cdecimal/Python/getcopyright.c
   python/branches/py3k-cdecimal/Python/import.c
   python/branches/py3k-cdecimal/Python/peephole.c
   python/branches/py3k-cdecimal/Python/pyarena.c
   python/branches/py3k-cdecimal/Python/pythonrun.c
   python/branches/py3k-cdecimal/Python/sysmodule.c
   python/branches/py3k-cdecimal/Python/thread_nt.h
   python/branches/py3k-cdecimal/Python/thread_pthread.h
   python/branches/py3k-cdecimal/Python/traceback.c
   python/branches/py3k-cdecimal/README
   python/branches/py3k-cdecimal/Tools/README
   python/branches/py3k-cdecimal/Tools/buildbot/external-amd64.bat
   python/branches/py3k-cdecimal/Tools/buildbot/external-common.bat
   python/branches/py3k-cdecimal/Tools/buildbot/external.bat
   python/branches/py3k-cdecimal/Tools/buildbot/test.bat
   python/branches/py3k-cdecimal/Tools/msi/msi.py
   python/branches/py3k-cdecimal/Tools/scripts/README
   python/branches/py3k-cdecimal/Tools/scripts/untabify.py
   python/branches/py3k-cdecimal/Tools/unicode/gencodec.py
   python/branches/py3k-cdecimal/configure
   python/branches/py3k-cdecimal/configure.in
   python/branches/py3k-cdecimal/pyconfig.h.in
   python/branches/py3k-cdecimal/setup.py

Modified: python/branches/py3k-cdecimal/.gitignore
==============================================================================
--- python/branches/py3k-cdecimal/.gitignore	(original)
+++ python/branches/py3k-cdecimal/.gitignore	Sun Jan  2 13:18:37 2011
@@ -1,8 +1,17 @@
+*.cover
+*.o
+*.orig
+*.pyc
+*.pyd
+*.pyo
+*.rej
+*~
 Doc/build/
 Doc/tools/docutils/
 Doc/tools/jinja2/
 Doc/tools/pygments/
 Doc/tools/sphinx/
+Lib/lib2to3/*.pickle
 Makefile
 Makefile.pre
 Misc/python.pc
@@ -10,17 +19,26 @@
 Modules/Setup.config
 Modules/Setup.local
 Modules/config.c
+Modules/ld_so_aix
+PCbuild/*.bsc
+PCbuild/*.dll
+PCbuild/*.exe
+PCbuild/*.exp
+PCbuild/*.lib
+PCbuild/*.ncb
+PCbuild/*.o
+PCbuild/*.pdb
+PCbuild/Win32-temp-*
 Parser/pgen
 Parser/pgen.stamp
+__pycache__
+autom4te.cache
 build/
 config.log
 config.status
-libpython3.2.a
+libpython*.a
 pybuilddir.txt
 pyconfig.h
 python
 python-gdb.py
 tags
-Lib/lib2to3/Grammar3.2.0.alpha.2.pickle
-Lib/lib2to3/PatternGrammar3.2.0.alpha.2.pickle
-autom4te.cache

Modified: python/branches/py3k-cdecimal/Doc/ACKS.txt
==============================================================================
--- python/branches/py3k-cdecimal/Doc/ACKS.txt	(original)
+++ python/branches/py3k-cdecimal/Doc/ACKS.txt	Sun Jan  2 13:18:37 2011
@@ -111,6 +111,7 @@
    * Andrew M. Kuchling
    * Dave Kuhlman
    * Erno Kuusela
+   * Ross Lagerwall
    * Thomas Lamb
    * Detlef Lannert
    * Piers Lauder

Modified: python/branches/py3k-cdecimal/Doc/README.txt
==============================================================================
--- python/branches/py3k-cdecimal/Doc/README.txt	(original)
+++ python/branches/py3k-cdecimal/Doc/README.txt	Sun Jan  2 13:18:37 2011
@@ -132,7 +132,7 @@
 as long as you don't change or remove the copyright notice:
 
 ----------------------------------------------------------------------
-Copyright (c) 2000-2010 Python Software Foundation.
+Copyright (c) 2000-2011 Python Software Foundation.
 All rights reserved.
 
 Copyright (c) 2000 BeOpen.com.

Modified: python/branches/py3k-cdecimal/Doc/c-api/buffer.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/c-api/buffer.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/c-api/buffer.rst	Sun Jan  2 13:18:37 2011
@@ -12,16 +12,32 @@
 .. index::
    single: buffer interface
 
-Python objects implemented in C can export a "buffer interface."  These
-functions can be used by an object to expose its data in a raw, byte-oriented
-format. Clients of the object can use the buffer interface to access the
-object data directly, without needing to copy it first.
-
-Examples of objects that support the buffer interface are :class:`bytes`,
-:class:`bytearray` and :class:`array.array`. The bytes and bytearray objects
-exposes their bytes contents in the buffer interface's byte-oriented form.
-An :class:`array.array` can also expose its contents, but it should be noted
-that array elements may be multi-byte values.
+Certain objects available in Python wrap access to an underlying memory
+array or *buffer*.  Such objects include the built-in :class:`bytes` and
+:class:`bytearray`, and some extension types like :class:`array.array`.
+Third-party libraries may define their own types for special purposes, such
+as image processing or numeric analysis.
+
+While each of these types have their own semantics, they share the common
+characteristic of being backed by a possibly large memory buffer.  It is
+then desireable, in some situations, to access that buffer directly and
+without intermediate copying.
+
+Python provides such a facility at the C level in the form of the *buffer
+protocol*.  This protocol has two sides:
+
+.. index:: single: PyBufferProcs
+
+- on the producer side, a type can export a "buffer interface" which allows
+  objects of that type to expose information about their underlying buffer.
+  This interface is described in the section :ref:`buffer-structs`;
+
+- on the consumer side, several means are available to obtain a pointer to
+  the raw underlying data of an object (for example a method parameter).
+
+Simple objects such as :class:`bytes` and :class:`bytearray` expose their
+underlying buffer in byte-oriented form.  Other forms are possible; for example,
+the elements exposed by a :class:`array.array` can be multi-byte values.
 
 An example consumer of the buffer interface is the :meth:`~io.BufferedIOBase.write`
 method of file objects: any object that can export a series of bytes through
@@ -44,12 +60,6 @@
 resource leaks.
 
 
-.. index:: single: PyBufferProcs
-
-How the buffer interface is exposed by a type object is described in the
-section :ref:`buffer-structs`, under the description for :c:type:`PyBufferProcs`.
-
-
 The buffer structure
 ====================
 

Modified: python/branches/py3k-cdecimal/Doc/c-api/codec.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/c-api/codec.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/c-api/codec.rst	Sun Jan  2 13:18:37 2011
@@ -80,15 +80,13 @@
    The callback gets a single argument, an instance of
    :exc:`UnicodeEncodeError`, :exc:`UnicodeDecodeError` or
    :exc:`UnicodeTranslateError` that holds information about the problematic
-   sequence of characters or bytes and their offset in the original string.  The
+   sequence of characters or bytes and their offset in the original string (see
+   :ref:`unicodeexceptions` for functions to extract this information).  The
    callback must either raise the given exception, or return a two-item tuple
    containing the replacement for the problematic sequence, and an integer
    giving the offset in the original string at which encoding/decoding should be
    resumed.
 
-   .. XXX once they are documented, link to PyUnicode*Error access functions
-      to show how to get at the exception properties
-
    Return ``0`` on success, ``-1`` on error.
 
 .. c:function:: PyObject* PyCodec_LookupError(const char *name)

Modified: python/branches/py3k-cdecimal/Doc/c-api/exceptions.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/c-api/exceptions.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/c-api/exceptions.rst	Sun Jan  2 13:18:37 2011
@@ -145,79 +145,11 @@
 
 .. c:function:: PyObject* PyErr_Format(PyObject *exception, const char *format, ...)
 
-   This function sets the error indicator and returns *NULL*. *exception* should be
-   a Python exception (class, not an instance). *format* should be an ASCII-encoded string,
-   containing format codes, similar to :c:func:`printf`. The ``width.precision``
-   before a format code is parsed, but the width part is ignored.
-
-   .. % This should be exactly the same as the table in PyString_FromFormat.
-   .. % One should just refer to the other.
-   .. % The descriptions for %zd and %zu are wrong, but the truth is complicated
-   .. % because not all compilers support the %z width modifier -- we fake it
-   .. % when necessary via interpolating PY_FORMAT_SIZE_T.
-   .. % Similar comments apply to the %ll width modifier and
-   .. % PY_FORMAT_LONG_LONG.
-
-   +-------------------+---------------+--------------------------------+
-   | Format Characters | Type          | Comment                        |
-   +===================+===============+================================+
-   | :attr:`%%`        | *n/a*         | The literal % character.       |
-   +-------------------+---------------+--------------------------------+
-   | :attr:`%c`        | int           | A single character,            |
-   |                   |               | represented as an C int.       |
-   +-------------------+---------------+--------------------------------+
-   | :attr:`%d`        | int           | Exactly equivalent to          |
-   |                   |               | ``printf("%d")``.              |
-   +-------------------+---------------+--------------------------------+
-   | :attr:`%u`        | unsigned int  | Exactly equivalent to          |
-   |                   |               | ``printf("%u")``.              |
-   +-------------------+---------------+--------------------------------+
-   | :attr:`%ld`       | long          | Exactly equivalent to          |
-   |                   |               | ``printf("%ld")``.             |
-   +-------------------+---------------+--------------------------------+
-   | :attr:`%lu`       | unsigned long | Exactly equivalent to          |
-   |                   |               | ``printf("%lu")``.             |
-   +-------------------+---------------+--------------------------------+
-   | :attr:`%lld`      | long long     | Exactly equivalent to          |
-   |                   |               | ``printf("%lld")``.            |
-   +-------------------+---------------+--------------------------------+
-   | :attr:`%llu`      | unsigned      | Exactly equivalent to          |
-   |                   | long long     | ``printf("%llu")``.            |
-   +-------------------+---------------+--------------------------------+
-   | :attr:`%zd`       | Py_ssize_t    | Exactly equivalent to          |
-   |                   |               | ``printf("%zd")``.             |
-   +-------------------+---------------+--------------------------------+
-   | :attr:`%zu`       | size_t        | Exactly equivalent to          |
-   |                   |               | ``printf("%zu")``.             |
-   +-------------------+---------------+--------------------------------+
-   | :attr:`%i`        | int           | Exactly equivalent to          |
-   |                   |               | ``printf("%i")``.              |
-   +-------------------+---------------+--------------------------------+
-   | :attr:`%x`        | int           | Exactly equivalent to          |
-   |                   |               | ``printf("%x")``.              |
-   +-------------------+---------------+--------------------------------+
-   | :attr:`%s`        | char\*        | A null-terminated C character  |
-   |                   |               | array.                         |
-   +-------------------+---------------+--------------------------------+
-   | :attr:`%p`        | void\*        | The hex representation of a C  |
-   |                   |               | pointer. Mostly equivalent to  |
-   |                   |               | ``printf("%p")`` except that   |
-   |                   |               | it is guaranteed to start with |
-   |                   |               | the literal ``0x`` regardless  |
-   |                   |               | of what the platform's         |
-   |                   |               | ``printf`` yields.             |
-   +-------------------+---------------+--------------------------------+
-
-   An unrecognized format character causes all the rest of the format string to be
-   copied as-is to the result string, and any extra arguments discarded.
-
-   .. note::
-
-      The `"%lld"` and `"%llu"` format specifiers are only available
-      when :const:`HAVE_LONG_LONG` is defined.
-
-   .. versionchanged:: 3.2
-      Support for `"%lld"` and `"%llu"` added.
+   This function sets the error indicator and returns *NULL*.  *exception*
+   should be a Python exception class.  The *format* and subsequent
+   parameters help format the error message; they have the same meaning and
+   values as in :c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded
+   string.
 
 
 .. c:function:: void PyErr_SetNone(PyObject *type)
@@ -287,7 +219,9 @@
 
    Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior that
    if *filename* is not *NULL*, it is passed to the constructor of
-   :exc:`WindowsError` as a third parameter. Availability: Windows.
+   :exc:`WindowsError` as a third parameter.  *filename* is decoded from the
+   filesystem encoding (:func:`sys.getfilesystemencoding`).  Availability:
+   Windows.
 
 
 .. c:function:: PyObject* PyErr_SetExcFromWindowsErrWithFilename(PyObject *type, int ierr, char *filename)
@@ -301,7 +235,8 @@
    Set file, line, and offset information for the current exception.  If the
    current exception is not a :exc:`SyntaxError`, then it sets additional
    attributes, which make the exception printing subsystem think the exception
-   is a :exc:`SyntaxError`.
+   is a :exc:`SyntaxError`. *filename* is decoded from the filesystem encoding
+   (:func:`sys.getfilesystemencoding`).
 
 .. versionadded:: 3.2
 
@@ -323,7 +258,7 @@
 .. c:function:: int PyErr_WarnEx(PyObject *category, char *message, int stack_level)
 
    Issue a warning message.  The *category* argument is a warning category (see
-   below) or *NULL*; the *message* argument is a message string.  *stack_level* is a
+   below) or *NULL*; the *message* argument is an UTF-8 encoded string.  *stack_level* is a
    positive number giving a number of stack frames; the warning will be issued from
    the  currently executing line of code in that stack frame.  A *stack_level* of 1
    is the function calling :c:func:`PyErr_WarnEx`, 2 is  the function above that,
@@ -363,13 +298,16 @@
    is a straightforward wrapper around the Python function
    :func:`warnings.warn_explicit`, see there for more information.  The *module*
    and *registry* arguments may be set to *NULL* to get the default effect
-   described there.
+   described there. *message* and *module* are UTF-8 encoded strings,
+   *filename* is decoded from the filesystem encoding
+   (:func:`sys.getfilesystemencoding`).
 
 
 .. c:function:: int PyErr_WarnFormat(PyObject *category, Py_ssize_t stack_level, const char *format, ...)
 
    Function similar to :c:func:`PyErr_WarnEx`, but use
-   :c:func:`PyUnicode_FromFormatV` to format the warning message.
+   :c:func:`PyUnicode_FromFormat` to format the warning message.  *format* is
+   an ASCII-encoded string.
 
    .. versionadded:: 3.2
 
@@ -496,6 +434,85 @@
    This steals a reference to *ctx*.
 
 
+.. _unicodeexceptions:
+
+Unicode Exception Objects
+=========================
+
+The following functions are used to create and modify Unicode exceptions from C.
+
+.. c:function:: PyObject* PyUnicodeDecodeError_Create(const char *encoding, const char *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason)
+
+   Create a :class:`UnicodeDecodeError` object with the attributes *encoding*,
+   *object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are
+   UTF-8 encoded strings.
+
+.. c:function:: PyObject* PyUnicodeEncodeError_Create(const char *encoding, const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason)
+
+   Create a :class:`UnicodeEncodeError` object with the attributes *encoding*,
+   *object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are
+   UTF-8 encoded strings.
+
+.. c:function:: PyObject* PyUnicodeTranslateError_Create(const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason)
+
+   Create a :class:`UnicodeTranslateError` object with the attributes *object*,
+   *length*, *start*, *end* and *reason*. *reason* is an UTF-8 encoded string.
+
+.. c:function:: PyObject* PyUnicodeDecodeError_GetEncoding(PyObject *exc)
+                PyObject* PyUnicodeEncodeError_GetEncoding(PyObject *exc)
+
+   Return the *encoding* attribute of the given exception object.
+
+.. c:function:: PyObject* PyUnicodeDecodeError_GetObject(PyObject *exc)
+                PyObject* PyUnicodeEncodeError_GetObject(PyObject *exc)
+                PyObject* PyUnicodeTranslateError_GetObject(PyObject *exc)
+
+   Return the *object* attribute of the given exception object.
+
+.. c:function:: int PyUnicodeDecodeError_GetStart(PyObject *exc, Py_ssize_t *start)
+                int PyUnicodeEncodeError_GetStart(PyObject *exc, Py_ssize_t *start)
+                int PyUnicodeTranslateError_GetStart(PyObject *exc, Py_ssize_t *start)
+
+   Get the *start* attribute of the given exception object and place it into
+   *\*start*.  *start* must not be *NULL*.  Return ``0`` on success, ``-1`` on
+   failure.
+
+.. c:function:: int PyUnicodeDecodeError_SetStart(PyObject *exc, Py_ssize_t start)
+                int PyUnicodeEncodeError_SetStart(PyObject *exc, Py_ssize_t start)
+                int PyUnicodeTranslateError_SetStart(PyObject *exc, Py_ssize_t start)
+
+   Set the *start* attribute of the given exception object to *start*.  Return
+   ``0`` on success, ``-1`` on failure.
+
+.. c:function:: int PyUnicodeDecodeError_GetEnd(PyObject *exc, Py_ssize_t *end)
+                int PyUnicodeEncodeError_GetEnd(PyObject *exc, Py_ssize_t *end)
+                int PyUnicodeTranslateError_GetEnd(PyObject *exc, Py_ssize_t *end)
+
+   Get the *end* attribute of the given exception object and place it into
+   *\*end*.  *end* must not be *NULL*.  Return ``0`` on success, ``-1`` on
+   failure.
+
+.. c:function:: int PyUnicodeDecodeError_SetEnd(PyObject *exc, Py_ssize_t end)
+                int PyUnicodeEncodeError_SetEnd(PyObject *exc, Py_ssize_t end)
+                int PyUnicodeTranslateError_SetEnd(PyObject *exc, Py_ssize_t end)
+
+   Set the *end* attribute of the given exception object to *end*.  Return ``0``
+   on success, ``-1`` on failure.
+
+.. c:function:: PyObject* PyUnicodeDecodeError_GetReason(PyObject *exc)
+                PyObject* PyUnicodeEncodeError_GetReason(PyObject *exc)
+                PyObject* PyUnicodeTranslateError_GetReason(PyObject *exc)
+
+   Return the *reason* attribute of the given exception object.
+
+.. c:function:: int PyUnicodeDecodeError_SetReason(PyObject *exc, const char *reason)
+                int PyUnicodeEncodeError_SetReason(PyObject *exc, const char *reason)
+                int PyUnicodeTranslateError_SetReason(PyObject *exc, const char *reason)
+
+   Set the *reason* attribute of the given exception object to *reason*.  Return
+   ``0`` on success, ``-1`` on failure.
+
+
 Recursion Control
 =================
 
@@ -525,6 +542,35 @@
    Ends a :c:func:`Py_EnterRecursiveCall`.  Must be called once for each
    *successful* invocation of :c:func:`Py_EnterRecursiveCall`.
 
+Properly implementing :attr:`tp_repr` for container types requires
+special recursion handling.  In addition to protecting the stack,
+:attr:`tp_repr` also needs to track objects to prevent cycles.  The
+following two functions facilitate this functionality.  Effectively,
+these are the C equivalent to :func:`reprlib.recursive_repr`.
+
+.. c:function:: int Py_ReprEnter(PyObject *object)
+
+   Called at the beginning of the :attr:`tp_repr` implementation to
+   detect cycles.
+
+   If the object has already been processed, the function returns a
+   positive integer.  In that case the :attr:`tp_repr` implementation
+   should return a string object indicating a cycle.  As examples,
+   :class:`dict` objects return ``{...}`` and :class:`list` objects
+   return ``[...]``.
+
+   The function will return a negative integer if the recursion limit
+   is reached.  In that case the :attr:`tp_repr` implementation should
+   typically return ``NULL``.
+
+   Otherwise, the function returns zero and the :attr:`tp_repr`
+   implementation can continue normally.
+
+.. c:function:: void Py_ReprLeave(PyObject *object)
+
+   Ends a :c:func:`Py_ReprEnter`.  Must be called once for each
+   invocation of :c:func:`Py_ReprEnter` that returns zero.
+
 
 .. _standardexceptions:
 

Modified: python/branches/py3k-cdecimal/Doc/c-api/import.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/c-api/import.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/c-api/import.rst	Sun Jan  2 13:18:37 2011
@@ -142,6 +142,7 @@
    attribute of the module object is set to *cpathname* if it is
    non-``NULL``.  Of the three functions, this is the preferred one to use.
 
+   .. versionadded:: 3.2
 
 .. c:function:: long PyImport_GetMagicNumber()
 
@@ -155,6 +156,8 @@
    Return the magic tag string for :pep:`3147` format Python bytecode file
    names.
 
+   .. versionadded:: 3.2
+
 .. c:function:: PyObject* PyImport_GetModuleDict()
 
    Return the dictionary used for the module administration (a.k.a.

Modified: python/branches/py3k-cdecimal/Doc/c-api/init.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/c-api/init.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/c-api/init.rst	Sun Jan  2 13:18:37 2011
@@ -412,8 +412,9 @@
 .. c:function:: void Py_SetPythonHome(wchar_t *home)
 
    Set the default "home" directory, that is, the location of the standard
-   Python libraries.  The libraries are searched in
-   :file:`{home}/lib/python{version}` and :file:`{home}/lib/python{version}`.
+   Python libraries.  See :envvar:`PYTHONHOME` for the meaning of the
+   argument string.
+
    The argument should point to a zero-terminated character string in static
    storage whose contents will not change for the duration of the program's
    execution.  No code in the Python interpreter will change the contents of

Modified: python/branches/py3k-cdecimal/Doc/c-api/intro.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/c-api/intro.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/c-api/intro.rst	Sun Jan  2 13:18:37 2011
@@ -41,8 +41,8 @@
    #include "Python.h"
 
 This implies inclusion of the following standard headers: ````,
-````, ````, ````, and ```` (if
-available).
+````, ````, ````, ```` and ````
+(if available).
 
 .. note::
 

Modified: python/branches/py3k-cdecimal/Doc/c-api/list.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/c-api/list.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/c-api/list.rst	Sun Jan  2 13:18:37 2011
@@ -37,7 +37,7 @@
 
    .. note::
 
-      If *length* is greater than zero, the returned list object's items are
+      If *len* is greater than zero, the returned list object's items are
       set to ``NULL``.  Thus you cannot use abstract API functions such as
       :c:func:`PySequence_SetItem`  or expose the object to Python code before
       setting all items to a real object with :c:func:`PyList_SetItem`.
@@ -58,9 +58,9 @@
 
 .. c:function:: PyObject* PyList_GetItem(PyObject *list, Py_ssize_t index)
 
-   Return the object at position *pos* in the list pointed to by *p*.  The
+   Return the object at position *index* in the list pointed to by *list*.  The
    position must be positive, indexing from the end of the list is not
-   supported.  If *pos* is out of bounds, return *NULL* and set an
+   supported.  If *index* is out of bounds, return *NULL* and set an
    :exc:`IndexError` exception.
 
 

Modified: python/branches/py3k-cdecimal/Doc/c-api/slice.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/c-api/slice.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/c-api/slice.rst	Sun Jan  2 13:18:37 2011
@@ -26,7 +26,7 @@
    the new object could not be allocated.
 
 
-.. c:function:: int PySlice_GetIndices(PySliceObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step)
+.. c:function:: int PySlice_GetIndices(PyObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step)
 
    Retrieve the start, stop and step indices from the slice object *slice*,
    assuming a sequence of length *length*. Treats indices greater than
@@ -38,8 +38,12 @@
 
    You probably do not want to use this function.
 
+   .. versionchanged:: 3.2
+      The parameter type for the *slice* parameter was ``PySliceObject*``
+      before.
 
-.. c:function:: int PySlice_GetIndicesEx(PySliceObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength)
+
+.. c:function:: int PySlice_GetIndicesEx(PyObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength)
 
    Usable replacement for :c:func:`PySlice_GetIndices`.  Retrieve the start,
    stop, and step indices from the slice object *slice* assuming a sequence of
@@ -49,3 +53,6 @@
 
    Returns 0 on success and -1 on error with exception set.
 
+   .. versionchanged:: 3.2
+      The parameter type for the *slice* parameter was ``PySliceObject*``
+      before.

Modified: python/branches/py3k-cdecimal/Doc/c-api/typeobj.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/c-api/typeobj.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/c-api/typeobj.rst	Sun Jan  2 13:18:37 2011
@@ -705,7 +705,9 @@
    This field is not inherited by subtypes (computed attributes are inherited
    through a different mechanism).
 
-   Docs for PyGetSetDef (XXX belong elsewhere)::
+   .. XXX belongs elsewhere
+
+   Docs for PyGetSetDef::
 
       typedef PyObject *(*getter)(PyObject *, void *);
       typedef int (*setter)(PyObject *, PyObject *, void *);
@@ -752,7 +754,7 @@
 
       PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);
 
-   XXX explain.
+   .. XXX explain.
 
    This field is inherited by subtypes.
 
@@ -767,7 +769,7 @@
 
    This field is inherited by subtypes.
 
-   XXX explain.
+   .. XXX explain.
 
 
 .. c:member:: long PyTypeObject.tp_dictoffset
@@ -1193,7 +1195,7 @@
 .. sectionauthor:: Benjamin Peterson
 
 
-The buffer interface exports a model where an object can expose its internal
+The :ref:`buffer interface ` exports a model where an object can expose its internal
 data.
 
 If an object does not export the buffer interface, then its :attr:`tp_as_buffer`

Modified: python/branches/py3k-cdecimal/Doc/c-api/unicode.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/c-api/unicode.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/c-api/unicode.rst	Sun Jan  2 13:18:37 2011
@@ -328,6 +328,13 @@
    Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two
    arguments.
 
+.. c:function:: PyObject* PyUnicode_TransformDecimalToASCII(Py_UNICODE *s, Py_ssize_t size)
+
+   Create a Unicode object by replacing all decimal digits in
+   :c:type:`Py_UNICODE` buffer of the given size by ASCII digits 0--9
+   according to their decimal value.  Return *NULL* if an exception
+   occurs.
+
 
 .. c:function:: Py_UNICODE* PyUnicode_AsUnicode(PyObject *unicode)
 
@@ -1056,7 +1063,9 @@
 .. c:function:: int PyUnicode_CompareWithASCIIString(PyObject *uni, char *string)
 
    Compare a unicode object, *uni*, with *string* and return -1, 0, 1 for less
-   than, equal, and greater than, respectively.
+   than, equal, and greater than, respectively. It is best to pass only
+   ASCII-encoded strings, but the function interprets the input string as
+   ISO-8859-1 if it contains non-ASCII characters".
 
 
 .. c:function:: int PyUnicode_RichCompare(PyObject *left,  PyObject *right,  int op)

Modified: python/branches/py3k-cdecimal/Doc/c-api/veryhigh.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/c-api/veryhigh.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/c-api/veryhigh.rst	Sun Jan  2 13:18:37 2011
@@ -66,8 +66,9 @@
    If *fp* refers to a file associated with an interactive device (console or
    terminal input or Unix pseudo-terminal), return the value of
    :c:func:`PyRun_InteractiveLoop`, otherwise return the result of
-   :c:func:`PyRun_SimpleFile`.  If *filename* is *NULL*, this function uses
-   ``"???"`` as the filename.
+   :c:func:`PyRun_SimpleFile`.  *filename* is decoded from the filesystem
+   encoding (:func:`sys.getfilesystemencoding`).  If *filename* is *NULL*, this
+   function uses ``"???"`` as the filename.
 
 
 .. c:function:: int PyRun_SimpleString(const char *command)
@@ -110,9 +111,10 @@
 .. c:function:: int PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit, PyCompilerFlags *flags)
 
    Similar to :c:func:`PyRun_SimpleStringFlags`, but the Python source code is read
-   from *fp* instead of an in-memory string. *filename* should be the name of the
-   file.  If *closeit* is true, the file is closed before PyRun_SimpleFileExFlags
-   returns.
+   from *fp* instead of an in-memory string. *filename* should be the name of
+   the file, it is decoded from the filesystem encoding
+   (:func:`sys.getfilesystemencoding`).  If *closeit* is true, the file is
+   closed before PyRun_SimpleFileExFlags returns.
 
 
 .. c:function:: int PyRun_InteractiveOne(FILE *fp, const char *filename)
@@ -125,7 +127,10 @@
 
    Read and execute a single statement from a file associated with an
    interactive device according to the *flags* argument.  The user will be
-   prompted using ``sys.ps1`` and ``sys.ps2``.  Returns ``0`` when the input was
+   prompted using ``sys.ps1`` and ``sys.ps2``.  *filename* is decoded from the
+   filesystem encoding (:func:`sys.getfilesystemencoding`).
+
+   Returns ``0`` when the input was
    executed successfully, ``-1`` if there was an exception, or an error code
    from the :file:`errcode.h` include file distributed as part of Python if
    there was a parse error.  (Note that :file:`errcode.h` is not included by
@@ -142,7 +147,8 @@
 
    Read and execute statements from a file associated with an interactive device
    until EOF is reached.  The user will be prompted using ``sys.ps1`` and
-   ``sys.ps2``.  Returns ``0`` at EOF.
+   ``sys.ps2``.  *filename* is decoded from the filesystem encoding
+   (:func:`sys.getfilesystemencoding`).  Returns ``0`` at EOF.
 
 
 .. c:function:: struct _node* PyParser_SimpleParseString(const char *str, int start)
@@ -164,7 +170,8 @@
    Parse Python source code from *str* using the start token *start* according to
    the *flags* argument.  The result can be used to create a code object which can
    be evaluated efficiently. This is useful if a code fragment must be evaluated
-   many times.
+   many times. *filename* is decoded from the filesystem encoding
+   (:func:`sys.getfilesystemencoding`).
 
 
 .. c:function:: struct _node* PyParser_SimpleParseFile(FILE *fp, const char *filename, int start)
@@ -217,7 +224,8 @@
 .. c:function:: PyObject* PyRun_FileExFlags(FILE *fp, const char *filename, int start, PyObject *globals, PyObject *locals, int closeit, PyCompilerFlags *flags)
 
    Similar to :c:func:`PyRun_StringFlags`, but the Python source code is read from
-   *fp* instead of an in-memory string. *filename* should be the name of the file.
+   *fp* instead of an in-memory string. *filename* should be the name of the file,
+   it is decoded from the filesystem encoding (:func:`sys.getfilesystemencoding`).
    If *closeit* is true, the file is closed before :c:func:`PyRun_FileExFlags`
    returns.
 
@@ -230,23 +238,38 @@
 
 .. c:function:: PyObject* Py_CompileStringFlags(const char *str, const char *filename, int start, PyCompilerFlags *flags)
 
+   This is a simplified interface to :c:func:`Py_CompileStringExFlags` below, with
+   *optimize* set to ``-1``.
+
+
+.. c:function:: PyObject* Py_CompileStringExFlags(const char *str, const char *filename, int start, PyCompilerFlags *flags, int optimize)
+
    Parse and compile the Python source code in *str*, returning the resulting code
    object.  The start token is given by *start*; this can be used to constrain the
    code which can be compiled and should be :const:`Py_eval_input`,
    :const:`Py_file_input`, or :const:`Py_single_input`.  The filename specified by
    *filename* is used to construct the code object and may appear in tracebacks or
-   :exc:`SyntaxError` exception messages.  This returns *NULL* if the code cannot
-   be parsed or compiled.
+   :exc:`SyntaxError` exception messages, it is decoded from the filesystem
+   encoding (:func:`sys.getfilesystemencoding`).  This returns *NULL* if the
+   code cannot be parsed or compiled.
+
+   The integer *optimize* specifies the optimization level of the compiler; a
+   value of ``-1`` selects the optimization level of the interpreter as given by
+   :option:`-O` options.  Explicit levels are ``0`` (no optimization;
+   ``__debug__`` is true), ``1`` (asserts are removed, ``__debug__`` is false)
+   or ``2`` (docstrings are removed too).
+
+   .. versionadded:: 3.2
 
 
-.. c:function:: PyObject* PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals)
+.. c:function:: PyObject* PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals)
 
    This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just
    the code object, and the dictionaries of global and local variables.
    The other arguments are set to *NULL*.
 
 
-.. c:function:: PyObject* PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals, PyObject **args, int argcount, PyObject **kws, int kwcount, PyObject **defs, int defcount, PyObject *closure)
+.. c:function:: PyObject* PyEval_EvalCodeEx(PyObject *co, PyObject *globals, PyObject *locals, PyObject **args, int argcount, PyObject **kws, int kwcount, PyObject **defs, int defcount, PyObject *closure)
 
    Evaluate a precompiled code object, given a particular environment for its
    evaluation.  This environment consists of dictionaries of global and local

Modified: python/branches/py3k-cdecimal/Doc/copyright.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/copyright.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/copyright.rst	Sun Jan  2 13:18:37 2011
@@ -4,7 +4,7 @@
 
 Python and this documentation is:
 
-Copyright ?? 2001-2010 Python Software Foundation. All rights reserved.
+Copyright ?? 2001-2011 Python Software Foundation. All rights reserved.
 
 Copyright ?? 2000 BeOpen.com. All rights reserved.
 

Modified: python/branches/py3k-cdecimal/Doc/distutils/apiref.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/distutils/apiref.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/distutils/apiref.rst	Sun Jan  2 13:18:37 2011
@@ -888,7 +888,7 @@
 .. function:: make_zipfile(base_name, base_dir[, verbose=0, dry_run=0])
 
    Create a zip file from all files in and under *base_dir*.  The output zip file
-   will be named *base_dir* + :file:`.zip`.  Uses either the  :mod:`zipfile` Python
+   will be named *base_name* + :file:`.zip`.  Uses either the  :mod:`zipfile` Python
    module (if available) or the InfoZIP :file:`zip`  utility (if installed and
    found on the default search path).  If neither  tool is available, raises
    :exc:`DistutilsExecError`.   Returns the name of the output zip file.

Modified: python/branches/py3k-cdecimal/Doc/documenting/markup.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/documenting/markup.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/documenting/markup.rst	Sun Jan  2 13:18:37 2011
@@ -610,6 +610,8 @@
 
 The ``:ref:`` invocation is replaced with the section title.
 
+Alternatively, you can reference any label (not just section titles)
+if you provide the link text ``:ref:`link text````.
 
 Paragraph-level markup
 ----------------------

Modified: python/branches/py3k-cdecimal/Doc/extending/embedding.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/extending/embedding.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/extending/embedding.rst	Sun Jan  2 13:18:37 2011
@@ -35,9 +35,6 @@
 to :c:func:`PyRun_SimpleFile`.  You can also call the lower-level operations
 described in the previous chapters to construct and use Python objects.
 
-A simple demo of embedding Python can be found in the directory
-:file:`Demo/embed/` of the source distribution.
-
 
 .. seealso::
 
@@ -209,7 +206,7 @@
    {
        if(!PyArg_ParseTuple(args, ":numargs"))
            return NULL;
-       return Py_BuildValue("i", numargs);
+       return PyLong_FromLong(numargs);
    }
 
    static PyMethodDef EmbMethods[] = {

Modified: python/branches/py3k-cdecimal/Doc/extending/extending.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/extending/extending.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/extending/extending.rst	Sun Jan  2 13:18:37 2011
@@ -81,7 +81,7 @@
        if (!PyArg_ParseTuple(args, "s", &command))
            return NULL;
        sts = system(command);
-       return Py_BuildValue("i", sts);
+       return PyLong_FromLong(sts);
    }
 
 There is a straightforward translation from the argument list in Python (for
@@ -274,12 +274,9 @@
    sts = system(command);
 
 Our :func:`spam.system` function must return the value of :c:data:`sts` as a
-Python object.  This is done using the function :c:func:`Py_BuildValue`, which is
-something like the inverse of :c:func:`PyArg_ParseTuple`: it takes a format
-string and an arbitrary number of C values, and returns a new Python object.
-More info on :c:func:`Py_BuildValue` is given later. ::
+Python object.  This is done using the function :c:func:`PyLong_FromLong`. ::
 
-   return Py_BuildValue("i", sts);
+   return PyLong_FromLong(sts);
 
 In this case, it will return an integer object.  (Yes, even integers are objects
 on the heap in Python!)
@@ -1195,7 +1192,7 @@
        if (!PyArg_ParseTuple(args, "s", &command))
            return NULL;
        sts = PySpam_System(command);
-       return Py_BuildValue("i", sts);
+       return PyLong_FromLong(sts);
    }
 
 In the beginning of the module, right after the line ::

Modified: python/branches/py3k-cdecimal/Doc/extending/windows.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/extending/windows.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/extending/windows.rst	Sun Jan  2 13:18:37 2011
@@ -110,7 +110,7 @@
    Now your options are:
 
 #. Copy :file:`example.sln` and :file:`example.vcproj`, rename them to
-      :file:`spam.\*`, and edit them by hand, or
+   :file:`spam.\*`, and edit them by hand, or
 
 #. Create a brand new project; instructions are below.
 
@@ -179,8 +179,8 @@
 
 and add the following to the module initialization function::
 
-   MyObject_Type.ob_type = &PyType_Type;
-
+   if (PyType_Ready(&MyObject_Type) < 0)
+        return NULL;
 
 
 .. _dynamic-linking:

Modified: python/branches/py3k-cdecimal/Doc/faq/extending.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/faq/extending.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/faq/extending.rst	Sun Jan  2 13:18:37 2011
@@ -379,7 +379,7 @@
            if (ps1  == prompt ||                  /* ">>> " or */
                '\n' == code[i + j - 1])           /* "... " and double '\n' */
            {                                               /* so execute it */
-             dum = PyEval_EvalCode ((PyCodeObject *)src, glb, loc);
+             dum = PyEval_EvalCode (src, glb, loc);
              Py_XDECREF (dum);
              Py_XDECREF (src);
              free (code);

Modified: python/branches/py3k-cdecimal/Doc/glossary.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/glossary.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/glossary.rst	Sun Jan  2 13:18:37 2011
@@ -27,7 +27,7 @@
       :ref:`2to3-reference`.
 
    abstract base class
-      Abstract Base Classes (abbreviated ABCs) complement :term:`duck-typing` by
+      :ref:`abstract-base-classes` complement :term:`duck-typing` by
       providing a way to define interfaces when other techniques like
       :func:`hasattr` would be clumsy. Python comes with many built-in ABCs for
       data structures (in the :mod:`collections` module), numbers (in the
@@ -181,22 +181,22 @@
       not expressions.
 
    extension module
-      A module written in C or C++, using Python's C API to interact with the core and
-      with user code.
+      A module written in C or C++, using Python's C API to interact with the
+      core and with user code.
 
    file object
       An object exposing a file-oriented API (with methods such as
-      :meth:`read()` or :meth:`write()`) to an underlying resource.
-      Depending on the way it was created, a file object can mediate access
-      to a real on-disk file or to another other type of storage or
-      communication device (for example standard input/output, in-memory
-      buffers, sockets, pipes, etc.).  File objects are also called
-      :dfn:`file-like objects` or :dfn:`streams`.
-
-      There are actually three categories of file objects: raw binary
-      files, buffered binary files and text files.  Their interfaces are
-      defined in the :mod:`io` module.  The canonical way to create a
-      file object is by using the :func:`open` function.
+      :meth:`read()` or :meth:`write()`) to an underlying resource.  Depending
+      on the way it was created, a file object can mediate access to a real
+      on-disk file or to another other type of storage or communication device
+      (for example standard input/output, in-memory buffers, sockets, pipes,
+      etc.).  File objects are also called :dfn:`file-like objects` or
+      :dfn:`streams`.
+
+      There are actually three categories of file objects: raw binary files,
+      buffered binary files and text files.  Their interfaces are defined in the
+      :mod:`io` module.  The canonical way to create a file object is by using
+      the :func:`open` function.
 
    file-like object
       A synonym for :term:`file object`.
@@ -392,6 +392,12 @@
       the :term:`EAFP` approach and is characterized by the presence of many
       :keyword:`if` statements.
 
+      In a multi-threaded environment, the LBYL approach can risk introducing a
+      race condition between "the looking" and "the leaping".  For example, the
+      code, ``if key in mapping: return mapping[key]`` can fail if another
+      thread removes *key* from *mapping* after the test, but before the lookup.
+      This issue can be solved with locks or by using the EAFP approach.
+
    list
       A built-in Python :term:`sequence`.  Despite its name it is more akin
       to an array in other languages than to a linked list since access to

Modified: python/branches/py3k-cdecimal/Doc/howto/index.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/howto/index.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/howto/index.rst	Sun Jan  2 13:18:37 2011
@@ -19,6 +19,8 @@
    descriptor.rst
    doanddont.rst
    functional.rst
+   logging.rst
+   logging-cookbook.rst
    regex.rst
    sockets.rst
    sorting.rst

Modified: python/branches/py3k-cdecimal/Doc/includes/tzinfo-examples.py
==============================================================================
--- python/branches/py3k-cdecimal/Doc/includes/tzinfo-examples.py	(original)
+++ python/branches/py3k-cdecimal/Doc/includes/tzinfo-examples.py	Sun Jan  2 13:18:37 2011
@@ -71,7 +71,7 @@
     def _isdst(self, dt):
         tt = (dt.year, dt.month, dt.day,
               dt.hour, dt.minute, dt.second,
-              dt.weekday(), 0, -1)
+              dt.weekday(), 0, 0)
         stamp = _time.mktime(tt)
         tt = _time.localtime(stamp)
         return tt.tm_isdst > 0

Modified: python/branches/py3k-cdecimal/Doc/install/index.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/install/index.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/install/index.rst	Sun Jan  2 13:18:37 2011
@@ -929,15 +929,34 @@
 GNU C / Cygwin / MinGW
 ^^^^^^^^^^^^^^^^^^^^^^
 
-These instructions only apply if you're using a version of Python prior  to
-2.4.1 with a MinGW prior to 3.0.0 (with binutils-2.13.90-20030111-1).
-
 This section describes the necessary steps to use Distutils with the GNU C/C++
 compilers in their Cygwin and MinGW distributions. [#]_ For a Python interpreter
 that was built with Cygwin, everything should work without any of these
 following steps.
 
-These compilers require some special libraries. This task is more complex than
+Not all extensions can be built with MinGW or Cygwin, but many can.  Extensions
+most likely to not work are those that use C++ or depend on Microsoft Visual C
+extensions.
+
+To let Distutils compile your extension with Cygwin you have to type::
+
+   python setup.py build --compiler=cygwin
+
+and for Cygwin in no-cygwin mode [#]_ or for MinGW type::
+
+   python setup.py build --compiler=mingw32
+
+If you want to use any of these options/compilers as default, you should
+consider writing it in your personal or system-wide configuration file for
+Distutils (see section :ref:`inst-config-files`.)
+
+Older Versions of Python and MinGW
+""""""""""""""""""""""""""""""""""
+The following instructions only apply if you're using a version of Python
+inferior to 2.4.1 with a MinGW inferior to 3.0.0 (with
+binutils-2.13.90-20030111-1).
+
+These compilers require some special libraries.  This task is more complex than
 for Borland's C++, because there is no program to convert the library.  First
 you have to create a list of symbols which the Python DLL exports. (You can find
 a good program for this task at
@@ -967,18 +986,6 @@
 them too. The converted files have to reside in the same directories as the
 normal libraries do.
 
-To let Distutils compile your extension with Cygwin you now have to type ::
-
-   python setup.py build --compiler=cygwin
-
-and for Cygwin in no-cygwin mode [#]_ or for MinGW type::
-
-   python setup.py build --compiler=mingw32
-
-If you want to use any of these options/compilers as default, you should
-consider to write it in your personal or system-wide configuration file for
-Distutils (see section :ref:`inst-config-files`.)
-
 
 .. seealso::
 

Modified: python/branches/py3k-cdecimal/Doc/library/_thread.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/_thread.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/_thread.rst	Sun Jan  2 13:18:37 2011
@@ -137,6 +137,10 @@
    .. versionchanged:: 3.2
       The *timeout* parameter is new.
 
+   .. versionchanged:: 3.2
+      Lock acquires can now be interrupted by signals on POSIX.
+
+
 .. method:: lock.release()
 
    Releases the lock.  The lock must have been acquired earlier, but not

Modified: python/branches/py3k-cdecimal/Doc/library/allos.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/allos.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/allos.rst	Sun Jan  2 13:18:37 2011
@@ -19,6 +19,8 @@
    optparse.rst
    getopt.rst
    logging.rst
+   logging.config.rst
+   logging.handlers.rst
    getpass.rst
    curses.rst
    curses.ascii.rst

Modified: python/branches/py3k-cdecimal/Doc/library/argparse.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/argparse.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/argparse.rst	Sun Jan  2 13:18:37 2011
@@ -1428,6 +1428,16 @@
 
        {foo,bar}   additional help
 
+   Furthermore, ``add_parser`` supports an additional ``aliases`` argument,
+   which allows multiple strings to refer to the same subparser. This example,
+   like ``svn``, aliases ``co`` as a shorthand for ``checkout``::
+
+     >>> parser = argparse.ArgumentParser()
+     >>> subparsers = parser.add_subparsers()
+     >>> checkout = subparsers.add_parser('checkout', aliases=['co'])
+     >>> checkout.add_argument('foo')
+     >>> parser.parse_args(['co', 'bar'])
+     Namespace(foo='bar')
 
    One particularly effective way of handling sub-commands is to combine the use
    of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so
@@ -1466,7 +1476,7 @@
      >>> args.func(args)
      ((XYZYX))
 
-   This way, you can let :meth:`parse_args` does the job of calling the
+   This way, you can let :meth:`parse_args` do the job of calling the
    appropriate function after argument parsing is complete.  Associating
    functions with actions like this is typically the easiest way to handle the
    different actions for each of your subparsers.  However, if it is necessary
@@ -1648,14 +1658,14 @@
 .. method:: ArgumentParser.print_usage(file=None)
 
    Print a brief description of how the :class:`ArgumentParser` should be
-   invoked on the command line.  If *file* is ``None``, :data:`sys.stderr` is
+   invoked on the command line.  If *file* is ``None``, :data:`sys.stdout` is
    assumed.
 
 .. method:: ArgumentParser.print_help(file=None)
 
    Print a help message, including the program usage and information about the
    arguments registered with the :class:`ArgumentParser`.  If *file* is
-   ``None``, :data:`sys.stderr` is assumed.
+   ``None``, :data:`sys.stdout` is assumed.
 
 There are also variants of these methods that simply return a string instead of
 printing it:
@@ -1729,6 +1739,7 @@
    This method prints a usage message including the *message* to the
    standard output and terminates the program with a status code of 2.
 
+.. _upgrading-optparse-code:
 
 Upgrading optparse code
 -----------------------

Modified: python/branches/py3k-cdecimal/Doc/library/array.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/array.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/array.rst	Sun Jan  2 13:18:37 2011
@@ -65,10 +65,6 @@
    passed to the :meth:`extend` method.
 
 
-.. data:: ArrayType
-
-   Obsolete alias for :class:`array`.
-
 .. data:: typecodes
 
    A string with all available type codes.

Modified: python/branches/py3k-cdecimal/Doc/library/bdb.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/bdb.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/bdb.rst	Sun Jan  2 13:18:37 2011
@@ -359,12 +359,10 @@
 .. function:: effective(file, line, frame)
 
    Determine if there is an effective (active) breakpoint at this line of code.
-   Return breakpoint number or 0 if none.
-
-   Called only if we know there is a breakpoint at this location.  Returns the
-   breakpoint that was triggered and a flag that indicates if it is ok to delete
-   a temporary breakpoint.
+   Return a tuple of the breakpoint and a boolean that indicates if it is ok
+   to delete a temporary breakpoint.  Return ``(None, None)`` if there is no
+   matching breakpoint.
 
 .. function:: set_trace()
 
-   Starts debugging with a :class:`Bdb` instance from caller's frame.
+   Start debugging with a :class:`Bdb` instance from caller's frame.

Modified: python/branches/py3k-cdecimal/Doc/library/builtins.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/builtins.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/builtins.rst	Sun Jan  2 13:18:37 2011
@@ -32,9 +32,8 @@
 
        # ...
 
-As an implementation detail, most modules have the name ``__builtins__`` (note
-the ``'s'``) made available as part of their globals.  The value of
-``__builtins__`` is normally either this module or the value of this modules's
-:attr:`__dict__` attribute.  Since this is an implementation detail, it may not
-be used by alternate implementations of Python.
-
+As an implementation detail, most modules have the name ``__builtins__`` made
+available as part of their globals.  The value of ``__builtins__`` is normally
+either this module or the value of this modules's :attr:`__dict__` attribute.
+Since this is an implementation detail, it may not be used by alternate
+implementations of Python.

Modified: python/branches/py3k-cdecimal/Doc/library/codecs.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/codecs.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/codecs.rst	Sun Jan  2 13:18:37 2011
@@ -1114,9 +1114,9 @@
 +-----------------+--------------------------------+--------------------------------+
 | utf_16          | U16, utf16                     | all languages                  |
 +-----------------+--------------------------------+--------------------------------+
-| utf_16_be       | UTF-16BE                       | all languages (BMP only)       |
+| utf_16_be       | UTF-16BE                       | all languages                  |
 +-----------------+--------------------------------+--------------------------------+
-| utf_16_le       | UTF-16LE                       | all languages (BMP only)       |
+| utf_16_le       | UTF-16LE                       | all languages                  |
 +-----------------+--------------------------------+--------------------------------+
 | utf_7           | U7, unicode-1-1-utf-7          | all languages                  |
 +-----------------+--------------------------------+--------------------------------+
@@ -1165,6 +1165,44 @@
 |                    |         | operand                   |
 +--------------------+---------+---------------------------+
 
+The following codecs provide bytes-to-bytes mappings.
+
++--------------------+---------------------------+---------------------------+
+| Codec              | Aliases                   | Purpose                   |
++====================+===========================+===========================+
+| base64_codec       | base64, base-64           | Convert operand to MIME   |
+|                    |                           | base64                    |
++--------------------+---------------------------+---------------------------+
+| bz2_codec          | bz2                       | Compress the operand      |
+|                    |                           | using bz2                 |
++--------------------+---------------------------+---------------------------+
+| hex_codec          | hex                       | Convert operand to        |
+|                    |                           | hexadecimal               |
+|                    |                           | representation, with two  |
+|                    |                           | digits per byte           |
++--------------------+---------------------------+---------------------------+
+| quopri_codec       | quopri, quoted-printable, | Convert operand to MIME   |
+|                    | quotedprintable           | quoted printable          |
++--------------------+---------------------------+---------------------------+
+| uu_codec           | uu                        | Convert the operand using |
+|                    |                           | uuencode                  |
++--------------------+---------------------------+---------------------------+
+| zlib_codec         | zip, zlib                 | Compress the operand      |
+|                    |                           | using gzip                |
++--------------------+---------------------------+---------------------------+
+
+The following codecs provide string-to-string mappings.
+
++--------------------+---------------------------+---------------------------+
+| Codec              | Aliases                   | Purpose                   |
++====================+===========================+===========================+
+| rot_13             | rot13                     | Returns the Caesar-cypher |
+|                    |                           | encryption of the operand |
++--------------------+---------------------------+---------------------------+
+
+.. versionadded:: 3.2
+   bytes-to-bytes and string-to-string codecs.
+
 
 :mod:`encodings.idna` --- Internationalized Domain Names in Applications
 ------------------------------------------------------------------------

Modified: python/branches/py3k-cdecimal/Doc/library/collections.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/collections.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/collections.rst	Sun Jan  2 13:18:37 2011
@@ -28,7 +28,7 @@
 =====================   ====================================================================
 
 In addition to the concrete container classes, the collections module provides
-ABCs (abstract base classes) that can be used to test whether a class provides a
+:ref:`abstract-base-classes` that can be used to test whether a class provides a
 particular interface, for example, whether it is hashable or a mapping.
 
 .. seealso::
@@ -866,7 +866,7 @@
 original insertion position is changed and moved to the end::
 
     class LastUpdatedOrderedDict(OrderedDict):
-        'Store items is the order the keys were last added'
+        'Store items in the order the keys were last added'
         def __setitem__(self, key, value):
             if key in self:
                 del self[key]
@@ -959,6 +959,7 @@
    subclass) or an arbitrary sequence which can be converted into a string using
    the built-in :func:`str` function.
 
+.. _abstract-base-classes:
 
 ABCs - abstract base classes
 ----------------------------

Modified: python/branches/py3k-cdecimal/Doc/library/compileall.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/compileall.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/compileall.rst	Sun Jan  2 13:18:37 2011
@@ -6,9 +6,10 @@
 
 
 This module provides some utility functions to support installing Python
-libraries.  These functions compile Python source files in a directory tree,
-allowing users without permission to write to the libraries to take advantage of
-cached byte-code files.
+libraries.  These functions compile Python source files in a directory tree.
+This module can be used to create the cached byte-code files at library
+installation time, which makes them available for use even by users who don't
+have write permission to the library directories.
 
 
 Command-line use
@@ -27,7 +28,8 @@
 
 .. cmdoption:: -l
 
-   Do not recurse.
+   Do not recurse into subdirectories, only compile source code files directly
+   contained in the named or implied directories.
 
 .. cmdoption:: -f
 
@@ -35,55 +37,118 @@
 
 .. cmdoption:: -q
 
-   Do not print the list of files compiled.
+   Do not print the list of files compiled, print only error messages.
 
 .. cmdoption:: -d destdir
 
-   Purported directory name for error messages.
+   Directory prepended to the path to each file being compiled.  This will
+   appear in compilation time tracebacks, and is also compiled in to the
+   byte-code file, where it will be used in tracebacks and other messages in
+   cases where the source file does not exist at the time the byte-code file is
+   executed.
 
 .. cmdoption:: -x regex
 
-   Skip files with a full path that matches given regular expression.
+   regex is used to search the full path to each file considered for
+   compilation, and if the regex produces a match, the file is skipped.
 
 .. cmdoption:: -i list
 
-   Expand list with its content (file and directory names).
+   Read the file ``list`` and add each line that it contains to the list of
+   files and directories to compile.  If ``list`` is ``-``, read lines from
+   ``stdin``.
 
 .. cmdoption:: -b
 
-   Write legacy ``.pyc`` file path names.  Default is to write :pep:`3147`-style
-   byte-compiled path names.
+   Write the byte-code files to their legacy locations and names, which may
+   overwrite byte-code files created by another version of Python.  The default
+   is to write files to their :pep:`3147` locations and names, which allows
+   byte-code files from multiple versions of Python to coexist.
+
+.. versionchanged:: 3.2
+   Added the ``-i``, ``-b`` and ``-h`` options.
 
 
 Public functions
 ----------------
 
-.. function:: compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, quiet=False, legacy=False)
+.. function:: compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, quiet=False, legacy=False, optimize=-1)
 
    Recursively descend the directory tree named by *dir*, compiling all :file:`.py`
-   files along the way.  The *maxlevels* parameter is used to limit the depth of
-   the recursion; it defaults to ``10``.  If *ddir* is given, it is used as the
-   base path from  which the filenames used in error messages will be generated.
+   files along the way.
+
+   The *maxlevels* parameter is used to limit the depth of the recursion; it
+   defaults to ``10``.
+
+   If *ddir* is given, it is prepended to the path to each file being compiled
+   for use in compilation time tracebacks, and is also compiled in to the
+   byte-code file, where it will be used in tracebacks and other messages in
+   cases where the source file does not exist at the time the byte-code file is
+   executed.
+
    If *force* is true, modules are re-compiled even if the timestamps are up to
    date.
 
-   If *rx* is given, it specifies a regular expression of file names to exclude
-   from the search; that expression is searched for in the full path.
+   If *rx* is given, its search method is called on the complete path to each
+   file considered for compilation, and if it returns a true value, the file
+   is skipped.
+
+   If *quiet* is true, nothing is printed to the standard output unless errors
+   occur.
+
+   If *legacy* is true, byte-code files are written to their legacy locations
+   and names, which may overwrite byte-code files created by another version of
+   Python.  The default is to write files to their :pep:`3147` locations and
+   names, which allows byte-code files from multiple versions of Python to
+   coexist.
+
+   *optimize* specifies the optimization level for the compiler.  It is passed to
+   the built-in :func:`compile` function.
+
+   .. versionchanged:: 3.2
+      Added the *legacy* and *optimize* parameter.
+
 
-   If *quiet* is true, nothing is printed to the standard output in normal
-   operation.
+.. function:: compile_file(fullname, ddir=None, force=False, rx=None, quiet=False, legacy=False, optimize=-1)
 
-   If *legacy* is true, old-style ``.pyc`` file path names are written,
-   otherwise (the default), :pep:`3147`-style path names are written.
+   Compile the file with path *fullname*.
 
+   If *ddir* is given, it is prepended to the path to the file being compiled
+   for use in compilation time tracebacks, and is also compiled in to the
+   byte-code file, where it will be used in tracebacks and other messages in
+   cases where the source file does not exist at the time the byte-code file is
+   executed.
 
-.. function:: compile_path(skip_curdir=True, maxlevels=0, force=False, legacy=False)
+   If *ra* is given, its search method is passed the full path name to the
+   file being compiled, and if it returns a true value, the file is not
+   compiled and ``True`` is returned.
+
+   If *quiet* is true, nothing is printed to the standard output unless errors
+   occur.
+
+   If *legacy* is true, byte-code files are written to their legacy locations
+   and names, which may overwrite byte-code files created by another version of
+   Python.  The default is to write files to their :pep:`3147` locations and
+   names, which allows byte-code files from multiple versions of Python to
+   coexist.
+
+   *optimize* specifies the optimization level for the compiler.  It is passed to
+   the built-in :func:`compile` function.
+
+   .. versionadded:: 3.2
+
+
+.. function:: compile_path(skip_curdir=True, maxlevels=0, force=False, legacy=False, optimize=-1)
 
    Byte-compile all the :file:`.py` files found along ``sys.path``. If
-   *skip_curdir* is true (the default), the current directory is not included in
-   the search.  The *maxlevels* parameter defaults to ``0``, and the *force*
-   and *legacy* parameters default to ``False``. All are
-   passed to the :func:`compile_dir` function.
+   *skip_curdir* is true (the default), the current directory is not included
+   in the search.  All other parameters are passed to the :func:`compile_dir`
+   function.  Note that unlike the other compile functions, ``maxlevels``
+   defaults to ``0``.
+
+   .. versionchanged:: 3.2
+      Added the *legacy* and *optimize* parameter.
+
 
 To force a recompile of all the :file:`.py` files in the :file:`Lib/`
 subdirectory and all its subdirectories::

Modified: python/branches/py3k-cdecimal/Doc/library/concurrent.futures.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/concurrent.futures.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/concurrent.futures.rst	Sun Jan  2 13:18:37 2011
@@ -1,5 +1,5 @@
-:mod:`concurrent.futures` --- Concurrent computation
-====================================================
+:mod:`concurrent.futures` --- Launching parallel tasks
+======================================================
 
 .. module:: concurrent.futures
    :synopsis: Execute computations concurrently using threads or processes.
@@ -10,7 +10,7 @@
 asynchronously executing callables.
 
 The asynchronous execution can be be performed with threads, using
-:class:`ThreadPoolExecutor`, or seperate processes, using
+:class:`ThreadPoolExecutor`, or separate processes, using
 :class:`ProcessPoolExecutor`.  Both implement the same interface, which is
 defined by the abstract :class:`Executor` class.
 

Modified: python/branches/py3k-cdecimal/Doc/library/configparser.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/configparser.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/configparser.rst	Sun Jan  2 13:18:37 2011
@@ -17,11 +17,10 @@
    single: ini file
    single: Windows ini file
 
-This module provides the classes :class:`RawConfigParser` and
-:class:`SafeConfigParser`.  They implement a basic configuration
-language which provides a structure similar to what's found in Microsoft
-Windows INI files.  You can use this to write Python programs which can be
-customized by end users easily.
+This module provides the :class:`ConfigParser` class which implements a basic
+configuration language which provides a structure similar to what's found in
+Microsoft Windows INI files.  You can use this to write Python programs which
+can be customized by end users easily.
 
 .. note::
 
@@ -34,6 +33,10 @@
       Support for a creating Unix shell-like mini-languages which can be used
       as an alternate format for application configuration files.
 
+   Module :mod:`json`
+      The json module implements a subset of JavaScript syntax which can also
+      be used for this purpose.
+
 
 Quick Start
 -----------
@@ -43,17 +46,17 @@
 .. code-block:: ini
 
    [DEFAULT]
-     ServerAliveInterval = 45
-     Compression = yes
-     CompressionLevel = 9
-     ForwardX11 = yes
+   ServerAliveInterval = 45
+   Compression = yes
+   CompressionLevel = 9
+   ForwardX11 = yes
 
    [bitbucket.org]
-     User = hg
+   User = hg
 
    [topsecret.server.com]
-     Port = 50022
-     ForwardX11 = no
+   Port = 50022
+   ForwardX11 = no
 
 The structure of INI files is described `in the following section
 <#supported-ini-file-structure>`_.  Essentially, the file
@@ -64,7 +67,7 @@
 .. doctest::
 
    >>> import configparser
-   >>> config = configparser.RawConfigParser()
+   >>> config = configparser.ConfigParser()
    >>> config['DEFAULT'] = {'ServerAliveInterval': '45',
    ...                      'Compression': 'yes',
    ...                      'CompressionLevel': '9'}
@@ -89,7 +92,7 @@
 .. doctest::
 
    >>> import configparser
-   >>> config = configparser.RawConfigParser()
+   >>> config = configparser.ConfigParser()
    >>> config.sections()
    []
    >>> config.read('example.ini')
@@ -227,63 +230,129 @@
 
 Configuration files may include comments, prefixed by specific
 characters (``#`` and ``;`` by default [1]_).  Comments may appear on
-their own on an otherwise empty line, or may be entered on lines holding
-values or section names.  In the latter case, they need to be preceded
-by a whitespace character to be recognized as a comment.  For backwards
-compatibility, by default only ``;`` starts an inline comment, while
-``#`` does not [1]_.
-
-On top of the core functionality, :class:`SafeConfigParser` supports
-interpolation.  This means values can contain format strings which refer to
-other values in the same section, or values in a special ``DEFAULT`` section
-[1]_.  Additional defaults can be provided on initialization.
+their own on an otherwise empty line, possibly indented. [1]_
 
 For example:
 
 .. code-block:: ini
 
-   [Paths]
-   home_dir: /Users
-   my_dir: %(home_dir)s/lumberjack
-   my_pictures: %(my_dir)s/Pictures
+   [Simple Values]
+   key=value
+   spaces in keys=allowed
+   spaces in values=allowed as well
+   spaces around the delimiter = obviously
+   you can also use : to delimit keys from values
+
+   [All Values Are Strings]
+   values like this: 1000000
+   or this: 3.14159265359
+   are they treated as numbers? : no
+   integers, floats and booleans are held as: strings
+   can use the API to get converted values directly: true
 
    [Multiline Values]
    chorus: I'm a lumberjack, and I'm okay
-      I sleep all night and I work all day
+       I sleep all night and I work all day
 
    [No Values]
    key_without_value
    empty string value here =
 
-   [You can use comments] ; after a useful line
-   ; in an empty line
-   after: a_value ; here's another comment
-   inside: a         ;comment
-           multiline ;comment
-           value!    ;comment
-
-      [Sections Can Be Indented]
-         can_values_be_as_well = True
-         does_that_mean_anything_special = False
-         purpose = formatting for readability
-         multiline_values = are
-            handled just fine as
-            long as they are indented
-            deeper than the first line
-            of a value
-         # Did I mention we can indent comments, too?
-
-In the example above, :class:`SafeConfigParser` would resolve ``%(home_dir)s``
-to the value of ``home_dir`` (``/Users`` in this case).  ``%(my_dir)s`` in
-effect would resolve to ``/Users/lumberjack``.  All interpolations are done on
-demand so keys used in the chain of references do not have to be specified in
-any specific order in the configuration file.
-
-:class:`RawConfigParser` would simply return ``%(my_dir)s/Pictures`` as the
-value of ``my_pictures`` and ``%(home_dir)s/lumberjack`` as the value of
-``my_dir``.  Other features presented in the example are handled in the same
-manner by both parsers.
+   [You can use comments]
+   # like this
+   ; or this
+
+   # By default only in an empty line.
+   # Inline comments can be harmful because they prevent users
+   # from using the delimiting characters as parts of values.
+   # That being said, this can be customized.
+
+       [Sections Can Be Indented]
+           can_values_be_as_well = True
+           does_that_mean_anything_special = False
+           purpose = formatting for readability
+           multiline_values = are
+               handled just fine as
+               long as they are indented
+               deeper than the first line
+               of a value
+           # Did I mention we can indent comments, too?
+
+
+Interpolation of values
+-----------------------
+
+On top of the core functionality, :class:`ConfigParser` supports
+interpolation.  This means values can be preprocessed before returning them
+from ``get()`` calls.
+
+.. class:: BasicInterpolation()
+
+   The default implementation used by :class:`ConfigParser`.  It enables
+   values to contain format strings which refer to other values in the same
+   section, or values in the special default section [1]_.  Additional default
+   values can be provided on initialization.
+
+   For example:
+
+   .. code-block:: ini
+
+      [Paths]
+      home_dir: /Users
+      my_dir: %(home_dir)s/lumberjack
+      my_pictures: %(my_dir)s/Pictures
+
+
+   In the example above, :class:`ConfigParser` with *interpolation* set to
+   ``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of
+   ``home_dir`` (``/Users`` in this case).  ``%(my_dir)s`` in effect would
+   resolve to ``/Users/lumberjack``.  All interpolations are done on demand so
+   keys used in the chain of references do not have to be specified in any
+   specific order in the configuration file.
+
+   With ``interpolation`` set to ``None``, the parser would simply return
+   ``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and
+   ``%(home_dir)s/lumberjack`` as the value of ``my_dir``.
+
+.. class:: ExtendedInterpolation()
+
+   An alternative handler for interpolation which implements a more advanced
+   syntax, used for instance in ``zc.buildout``. Extended interpolation is
+   using ``${section:option}`` to denote a value from a foreign section.
+   Interpolation can span multiple levels. For convenience, if the ``section:``
+   part is omitted, interpolation defaults to the current section (and possibly
+   the default values from the special section).
+
+   For example, the configuration specified above with basic interpolation,
+   would look like this with extended interpolation:
+
+   .. code-block:: ini
+
+      [Paths]
+      home_dir: /Users
+      my_dir: ${home_dir}/lumberjack
+      my_pictures: ${my_dir}/Pictures
+
+   Values from other sections can be fetched as well:
+
+   .. code-block:: ini
+
+      [Common]
+      home_dir: /Users
+      library_dir: /Library
+      system_dir: /System
+      macports_dir: /opt/local
 
+      [Frameworks]
+      Python: 3.2
+      path: ${Common:system_dir}/Library/Frameworks/
+
+      [Arthur]
+      nickname: Two Sheds
+      last_name: Jackson
+      my_dir: ${Common:home_dir}/twosheds
+      my_pictures: ${my_dir}/Pictures
+      python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}
 
 Mapping Protocol Access
 -----------------------
@@ -320,19 +389,22 @@
   the default value to be visible again.  Trying to delete a default value
   causes a ``KeyError``.
 
-* Trying to delete the ``DEFAULTSECT`` throws ``ValueError``.
-
-* There are two parser-level methods in the legacy API that hide the dictionary
-  interface and are incompatible:
-
-  * ``parser.get(section, option, **kwargs)`` - the second argument is **not** a
-    fallback value
+* Trying to delete the ``DEFAULTSECT`` raises ``ValueError``.
 
-  * ``parser.items(section)`` - this returns a list of *option*, *value* pairs
-    for a specified ``section``
+* ``parser.get(section, option, **kwargs)`` - the second argument is **not**
+  a fallback value. Note however that the section-level ``get()`` methods are
+  compatible both with the mapping protocol and the classic configparser API.
+
+* ``parser.items()`` is compatible with the mapping protocol (returns a list of
+  *section_name*, *section_proxy* pairs including the DEFAULTSECT).  However,
+  this method can also be invoked with arguments: ``parser.items(section, raw,
+  vars)``. The latter call returns a list of *option*, *value* pairs for
+  a specified ``section``, with all interpolations expanded (unless
+  ``raw=True`` is provided).
 
 The mapping protocol is implemented on top of the existing legacy API so that
-subclassing the original interface makes the mappings work as expected as well.
+subclasses overriding the original interface still should have mappings working
+as expected.
 
 
 Customizing Parser Behaviour
@@ -350,9 +422,9 @@
 * *defaults*, default value: ``None``
 
   This option accepts a dictionary of key-value pairs which will be initially
-  put in the ``DEFAULTSECT``.  This makes for an elegant way to support concise
-  configuration files that don't specify values which are the same as the
-  documented default.
+  put in the ``DEFAULT`` section.  This makes for an elegant way to support
+  concise configuration files that don't specify values which are the same as
+  the documented default.
 
   Hint: if you want to specify default values for a specific section, use
   :meth:`read_dict` before you read the actual file.
@@ -374,7 +446,7 @@
 
   .. doctest::
 
-     >>> parser = configparser.RawConfigParser()
+     >>> parser = configparser.ConfigParser()
      >>> parser.read_dict({'section1': {'key1': 'value1',
      ...                                'key2': 'value2',
      ...                                'key3': 'value3'},
@@ -395,7 +467,7 @@
   .. doctest::
 
      >>> from collections import OrderedDict
-     >>> parser = configparser.RawConfigParser()
+     >>> parser = configparser.ConfigParser()
      >>> parser.read_dict(
      ...   OrderedDict((
      ...     ('s1',
@@ -439,9 +511,10 @@
      ...   skip-external-locking
      ...   old_passwords = 1
      ...   skip-bdb
-     ...   skip-innodb # we don't need ACID today
+     ...   # we don't need ACID today
+     ...   skip-innodb
      ... """
-     >>> config = configparser.RawConfigParser(allow_no_value=True)
+     >>> config = configparser.ConfigParser(allow_no_value=True)
      >>> config.read_string(sample_config)
 
      >>> # Settings with values are treated as before:
@@ -464,30 +537,80 @@
   This means values (but not keys) can contain the delimiters.
 
   See also the *space_around_delimiters* argument to
-  :meth:`RawConfigParser.write`.
+  :meth:`ConfigParser.write`.
 
-* *comment_prefixes*, default value: ``_COMPATIBLE`` (``'#'`` valid on empty
-  lines, ``';'`` valid also on non-empty lines)
+* *comment_prefixes*, default value: ``('#', ';')``
 
-  Comment prefixes are strings that indicate the start of a valid comment
-  within a config file.  The peculiar default value allows for comments starting
-  with ``'#'`` or ``';'`` but only the latter can be used in a non-empty line.
-  This is obviously dictated by backwards compatibiliy.  A more predictable
-  approach would be to specify prefixes as ``('#', ';')`` which will allow for
-  both prefixes to be used in non-empty lines.
+* *inline_comment_prefixes*, default value: ``None``
+
+  Comment prefixes are strings that indicate the start of a valid comment within
+  a config file. *comment_prefixes* are used only on otherwise empty lines
+  (optionally indented) whereas *inline_comment_prefixes* can be used after
+  every valid value (e.g.  section names, options and empty lines as well). By
+  default inline comments are disabled and ``'#'`` and ``';'`` are used as
+  prefixes for whole line comments.
+
+  .. versionchanged:: 3.2
+     In previous versions of :mod:`configparser` behaviour matched
+     ``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``.
 
   Please note that config parsers don't support escaping of comment prefixes so
-  leaving characters out of *comment_prefixes* is a way of ensuring they can be
-  used as parts of keys or values.
+  using *inline_comment_prefixes* may prevent users from specifying option
+  values with characters used as comment prefixes. When in doubt, avoid setting
+  *inline_comment_prefixes*. In any circumstances, the only way of storing
+  comment prefix characters at the beginning of a line in multiline values is to
+  interpolate the prefix, for example::
+
+    >>> from configparser import ConfigParser, ExtendedInterpolation
+    >>> parser = ConfigParser(interpolation=ExtendedInterpolation())
+    >>> # the default BasicInterpolation could be used as well
+    >>> parser.read_string("""
+    ... [DEFAULT]
+    ... hash = #
+    ...
+    ... [hashes]
+    ... shebang =
+    ...   ${hash}!/usr/bin/env python
+    ...   ${hash} -*- coding: utf-8 -*-
+    ...
+    ... extensions =
+    ...   enabled_extension
+    ...   another_extension
+    ...   #disabled_by_comment
+    ...   yet_another_extension
+    ...
+    ... interpolation not necessary = if # is not at line start
+    ... even in multiline values = line #1
+    ...   line #2
+    ...   line #3
+    ... """)
+    >>> print(parser['hashes']['shebang'])
+
+    #!/usr/bin/env python
+    # -*- coding: utf-8 -*-
+    >>> print(parser['hashes']['extensions'])
+
+    enabled_extension
+    another_extension
+    yet_another_extension
+    >>> print(parser['hashes']['interpolation not necessary'])
+    if # is not at line start
+    >>> print(parser['hashes']['even in multiline values'])
+    line #1
+    line #2
+    line #3
 
-* *strict*, default value: ``False``
+* *strict*, default value: ``True``
 
-  If set to ``True``, the parser will not allow for any section or option
+  When set to ``True``, the parser will not allow for any section or option
   duplicates while reading from a single source (using :meth:`read_file`,
-  :meth:`read_string` or :meth:`read_dict`).  The default is ``False`` only
-  because of backwards compatibility reasons.  It is recommended to use strict
+  :meth:`read_string` or :meth:`read_dict`). It is recommended to use strict
   parsers in new applications.
 
+  .. versionchanged:: 3.2
+     In previous versions of :mod:`configparser` behaviour matched
+     ``strict=False``.
+
 * *empty_lines_in_values*, default value: ``True``
 
   In config parsers, values can span multiple lines as long as they are
@@ -505,13 +628,35 @@
 
       this = is still a part of the multiline value of 'key'
 
-
   This can be especially problematic for the user to see if she's using a
   proportional font to edit the file.  That is why when your application does
   not need values with empty lines, you should consider disallowing them.  This
   will make empty lines split keys every time.  In the example above, it would
   produce two keys, ``key`` and ``this``.
 
+* *default_section*, default value: ``configparser.DEFAULTSECT`` (that is:
+  ``"DEFAULT"``)
+
+  The convention of allowing a special section of default values for other
+  sections or interpolation purposes is a powerful concept of this library,
+  letting users create complex declarative configurations. This section is
+  normally called ``"DEFAULT"`` but this can be customized to point to any
+  other valid section name. Some typical values include: ``"general"`` or
+  ``"common"``. The name provided is used for recognizing default sections when
+  reading from any source and is used when writing configuration back to
+  a file. Its current value can be retrieved using the
+  ``parser_instance.default_section`` attribute and may be modified at runtime
+  (i.e. to convert files from one format to another).
+
+* *interpolation*, default value: ``configparser.BasicInterpolation``
+
+  Interpolation behaviour may be customized by providing a custom handler
+  through the *interpolation* argument. ``None`` can be used to turn off
+  interpolation completely, ``ExtendedInterpolation()`` provides a more
+  advanced variant inspired by ``zc.buildout``. More on the subject in the
+  `dedicated documentation section <#interpolation-of-values>`_.
+  :class:`RawConfigParser` has a default value of ``None``.
+
 
 More advanced customization may be achieved by overriding default values of
 these parser attributes.  The defaults are defined on the classes, so they
@@ -527,7 +672,7 @@
 
   .. doctest::
 
-     >>> custom = configparser.RawConfigParser()
+     >>> custom = configparser.ConfigParser()
      >>> custom['section1'] = {'funky': 'nope'}
      >>> custom['section1'].getboolean('funky')
      Traceback (most recent call last):
@@ -557,7 +702,7 @@
      ... [Section2]
      ... AnotherKey = Value
      ... """
-     >>> typical = configparser.RawConfigParser()
+     >>> typical = configparser.ConfigParser()
      >>> typical.read_string(config)
      >>> list(typical['Section1'].keys())
      ['key']
@@ -575,11 +720,11 @@
 Legacy API Examples
 -------------------
 
-Mainly because of backwards compatibility concerns, :mod:`configparser` provides
-also a legacy API with explicit ``get``/``set`` methods.  While there are valid
-use cases for the methods outlined below, mapping protocol access is preferred
-for new projects.  The legacy API is at times more advanced, low-level and
-downright counterintuitive.
+Mainly because of backwards compatibility concerns, :mod:`configparser`
+provides also a legacy API with explicit ``get``/``set`` methods.  While there
+are valid use cases for the methods outlined below, mapping protocol access is
+preferred for new projects.  The legacy API is at times more advanced,
+low-level and downright counterintuitive.
 
 An example of writing to a configuration file::
 
@@ -587,12 +732,11 @@
 
    config = configparser.RawConfigParser()
 
-   # Please note that using RawConfigParser's and the raw mode of
-   # ConfigParser's respective set functions, you can assign non-string values
-   # to keys internally, but will receive an error when attempting to write to
-   # a file or when you get it in non-raw mode. Setting values using the
-   # mapping protocol or SafeConfigParser's set() does not allow such
-   # assignments to take place.
+   # Please note that using RawConfigParser's set functions, you can assign
+   # non-string values to keys internally, but will receive an error when
+   # attempting to write to a file or when you get it in non-raw mode. Setting
+   # values using the mapping protocol or ConfigParser's set() does not allow
+   # such assignments to take place.
    config.add_section('Section1')
    config.set('Section1', 'int', '15')
    config.set('Section1', 'bool', 'true')
@@ -623,12 +767,11 @@
    if config.getboolean('Section1', 'bool'):
        print(config.get('Section1', 'foo'))
 
-To get interpolation, use :class:`SafeConfigParser` or, if
-you absolutely have to, a :class:`ConfigParser`::
+To get interpolation, use :class:`ConfigParser`::
 
    import configparser
 
-   cfg = configparser.SafeConfigParser()
+   cfg = configparser.ConfigParser()
    cfg.read('example.cfg')
 
    # Set the optional `raw` argument of get() to True if you wish to disable
@@ -657,13 +800,13 @@
    print(cfg.get('Section1', 'monster', fallback=None))
          # -> None
 
-Default values are available in all three types of ConfigParsers.  They are
-used in interpolation if an option used is not defined elsewhere. ::
+Default values are available in both types of ConfigParsers.  They are used in
+interpolation if an option used is not defined elsewhere. ::
 
    import configparser
 
    # New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each
-   config = configparser.SafeConfigParser({'bar': 'Life', 'baz': 'hard'})
+   config = configparser.ConfigParser({'bar': 'Life', 'baz': 'hard'})
    config.read('example.cfg')
 
    print(config.get('Section1', 'foo')) # -> "Python is fun!"
@@ -672,42 +815,62 @@
    print(config.get('Section1', 'foo')) # -> "Life is hard!"
 
 
-.. _rawconfigparser-objects:
+.. _configparser-objects:
 
-RawConfigParser Objects
------------------------
+ConfigParser Objects
+--------------------
 
-.. class:: RawConfigParser(defaults=None, dict_type=collections.OrderedDict, allow_no_value=False, delimiters=('=', ':'), comment_prefixes=_COMPATIBLE, strict=False, empty_lines_in_values=True)
+.. class:: ConfigParser(defaults=None, dict_type=collections.OrderedDict, allow_no_value=False, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section=configparser.DEFAULTSECT, interpolation=BasicInterpolation())
 
-   The basic configuration parser.  When *defaults* is given, it is initialized
+   The main configuration parser.  When *defaults* is given, it is initialized
    into the dictionary of intrinsic defaults.  When *dict_type* is given, it
    will be used to create the dictionary objects for the list of sections, for
    the options within a section, and for the default values.
 
    When *delimiters* is given, it is used as the set of substrings that
    divide keys from values.  When *comment_prefixes* is given, it will be used
-   as the set of substrings that prefix comments in a line, both for the whole
+   as the set of substrings that prefix comments in otherwise empty lines.
+   Comments can be indented. When *inline_comment_prefixes* is given, it will be
+   used as the set of substrings that prefix comments in non-empty lines.
+
    line and inline comments.  For backwards compatibility, the default value for
    *comment_prefixes* is a special value that indicates that ``;`` and ``#`` can
    start whole line comments while only ``;`` can start inline comments.
 
-   When *strict* is ``True`` (default: ``False``), the parser won't allow for
+   When *strict* is ``True`` (the default), the parser won't allow for
    any section or option duplicates while reading from a single source (file,
    string or dictionary), raising :exc:`DuplicateSectionError` or
    :exc:`DuplicateOptionError`.  When *empty_lines_in_values* is ``False``
    (default: ``True``), each empty line marks the end of an option.  Otherwise,
    internal empty lines of a multiline option are kept as part of the value.
    When *allow_no_value* is ``True`` (default: ``False``), options without
-   values are accepted; the value presented for these is ``None``.
+   values are accepted; the value held for these is ``None`` and they are
+   serialized without the trailing delimiter.
 
-   This class does not support the magical interpolation behavior.
+   When *default_section* is given, it specifies the name for the special
+   section holding default values for other sections and interpolation purposes
+   (normally named ``"DEFAULT"``). This value can be retrieved and changed on
+   runtime using the ``default_section`` instance attribute.
+
+   Interpolation behaviour may be customized by providing a custom handler
+   through the *interpolation* argument. ``None`` can be used to turn off
+   interpolation completely, ``ExtendedInterpolation()`` provides a more
+   advanced variant inspired by ``zc.buildout``. More on the subject in the
+   `dedicated documentation section <#interpolation-of-values>`_.
+
+   All option names used in interpolation will be passed through the
+   :meth:`optionxform` method just like any other option name reference.  For
+   example, using the default implementation of :meth:`optionxform` (which
+   converts option names to lower case), the values ``foo %(bar)s`` and ``foo
+   %(BAR)s`` are equivalent.
 
    .. versionchanged:: 3.1
       The default *dict_type* is :class:`collections.OrderedDict`.
 
    .. versionchanged:: 3.2
-      *allow_no_value*, *delimiters*, *comment_prefixes*, *strict* and
-      *empty_lines_in_values* were added.
+      *allow_no_value*, *delimiters*, *comment_prefixes*, *strict*,
+      *empty_lines_in_values*, *default_section* and *interpolation* were
+      added.
 
 
    .. method:: defaults()
@@ -717,22 +880,25 @@
 
    .. method:: sections()
 
-      Return a list of the sections available; ``DEFAULT`` is not included in
-      the list.
+      Return a list of the sections available; the *default section* is not
+      included in the list.
 
 
    .. method:: add_section(section)
 
       Add a section named *section* to the instance.  If a section by the given
-      name already exists, :exc:`DuplicateSectionError` is raised.  If the name
-      ``DEFAULT`` (or any of it's case-insensitive variants) is passed,
-      :exc:`ValueError` is raised.
+      name already exists, :exc:`DuplicateSectionError` is raised.  If the
+      *default section* name is passed, :exc:`ValueError` is raised.  The name
+      of the section must be a string; if not, :exc:`TypeError` is raised.
+
+      .. versionchanged:: 3.2
+         Non-string section names raise :exc:`TypeError`.
 
 
    .. method:: has_section(section)
 
-      Indicates whether the named section is present in the configuration.  The
-      ``DEFAULT`` section is not acknowledged.
+      Indicates whether the named *section* is present in the configuration.
+      The *default section* is not acknowledged.
 
 
    .. method:: options(section)
@@ -742,23 +908,25 @@
 
    .. method:: has_option(section, option)
 
-      If the given section exists, and contains the given option, return
-      :const:`True`; otherwise return :const:`False`.
+      If the given *section* exists, and contains the given *option*, return
+      :const:`True`; otherwise return :const:`False`. If the specified
+      *section* is :const:`None` or an empty string, DEFAULT is assumed.
 
 
    .. method:: read(filenames, encoding=None)
 
       Attempt to read and parse a list of filenames, returning a list of
       filenames which were successfully parsed.  If *filenames* is a string, it
-      is treated as a single filename.  If a file named in *filenames* cannot be
-      opened, that file will be ignored.  This is designed so that you can
-      specify a list of potential configuration file locations (for example, the
-      current directory, the user's home directory, and some system-wide
-      directory), and all existing configuration files in the list will be read.
-      If none of the named files exist, the :class:`ConfigParser` instance will
-      contain an empty dataset.  An application which requires initial values to
-      be loaded from a file should load the required file or files using
-      :meth:`read_file` before calling :meth:`read` for any optional files::
+      is treated as a single filename.  If a file named in *filenames* cannot
+      be opened, that file will be ignored.  This is designed so that you can
+      specify a list of potential configuration file locations (for example,
+      the current directory, the user's home directory, and some system-wide
+      directory), and all existing configuration files in the list will be
+      read.  If none of the named files exist, the :class:`ConfigParser`
+      instance will contain an empty dataset.  An application which requires
+      initial values to be loaded from a file should load the required file or
+      files using :meth:`read_file` before calling :meth:`read` for any
+      optional files::
 
          import configparser, os
 
@@ -800,17 +968,21 @@
 
    .. method:: read_dict(dictionary, source='')
 
-      Load configuration from a dictionary.  Keys are section names, values are
-      dictionaries with keys and values that should be present in the section.
-      If the used dictionary type preserves order, sections and their keys will
-      be added in order.  Values are automatically converted to strings.
+      Load configuration from any object that provides a dict-like ``items()``
+      method.  Keys are section names, values are dictionaries with keys and
+      values that should be present in the section.  If the used dictionary
+      type preserves order, sections and their keys will be added in order.
+      Values are automatically converted to strings.
 
       Optional argument *source* specifies a context-specific name of the
       dictionary passed.  If not given, ```` is used.
 
+      This method can be used to copy state between parsers.
+
       .. versionadded:: 3.2
 
-   .. method:: get(section, option, [vars, fallback])
+
+   .. method:: get(section, option, raw=False, [vars, fallback])
 
       Get an *option* value for the named *section*.  If *vars* is provided, it
       must be a dictionary.  The *option* is looked up in *vars* (if provided),
@@ -818,58 +990,57 @@
       and *fallback* is provided, it is used as a fallback value.  ``None`` can
       be provided as a *fallback* value.
 
+      All the ``'%'`` interpolations are expanded in the return values, unless
+      the *raw* argument is true.  Values for interpolation keys are looked up
+      in the same manner as the option.
+
       .. versionchanged:: 3.2
-         Arguments *vars* and *fallback* are keyword only to protect users from
-         trying to use the third argument as the *fallback* fallback (especially
-         when using the mapping protocol).
+         Arguments *raw*, *vars* and *fallback* are keyword only to protect
+         users from trying to use the third argument as the *fallback* fallback
+         (especially when using the mapping protocol).
 
 
-   .. method:: getint(section, option, [vars, fallback])
+   .. method:: getint(section, option, raw=False, [vars, fallback])
 
       A convenience method which coerces the *option* in the specified *section*
-      to an integer.  See :meth:`get` for explanation of *vars* and *fallback*.
+      to an integer.  See :meth:`get` for explanation of *raw*, *vars* and
+      *fallback*.
 
 
-   .. method:: getfloat(section, option, [vars, fallback])
+   .. method:: getfloat(section, option, raw=False, [vars, fallback])
 
       A convenience method which coerces the *option* in the specified *section*
-      to a floating point number.  See :meth:`get` for explanation of *vars* and
-      *fallback*.
+      to a floating point number.  See :meth:`get` for explanation of *raw*,
+      *vars* and *fallback*.
 
 
-   .. method:: getboolean(section, option, [vars, fallback])
+   .. method:: getboolean(section, option, raw=False, [vars, fallback])
 
       A convenience method which coerces the *option* in the specified *section*
       to a Boolean value.  Note that the accepted values for the option are
-      ``"1"``, ``"yes"``, ``"true"``, and ``"on"``, which cause this method to
-      return ``True``, and ``"0"``, ``"no"``, ``"false"``, and ``"off"``, which
+      ``'1'``, ``'yes'``, ``'true'``, and ``'on'``, which cause this method to
+      return ``True``, and ``'0'``, ``'no'``, ``'false'``, and ``'off'``, which
       cause it to return ``False``.  These string values are checked in a
       case-insensitive manner.  Any other value will cause it to raise
-      :exc:`ValueError`. See :meth:`get` for explanation of *vars* and
+      :exc:`ValueError`.  See :meth:`get` for explanation of *raw*, *vars* and
       *fallback*.
 
 
-   .. method:: items(section)
+   .. method:: items([section], raw=False, vars=None)
 
-      Return a list of *name*, *value* pairs for each option in the given
-      *section*.
+      When *section* is not given, return a list of *section_name*,
+      *section_proxy* pairs, including DEFAULTSECT.
+
+      Otherwise, return a list of *name*, *value* pairs for the options in the
+      given *section*.  Optional arguments have the same meaning as for the
+      :meth:`get` method.
 
 
    .. method:: set(section, option, value)
 
       If the given section exists, set the given option to the specified value;
-      otherwise raise :exc:`NoSectionError`.  While it is possible to use
-      :class:`RawConfigParser` (or :class:`ConfigParser` with *raw* parameters
-      set to true) for *internal* storage of non-string values, full
-      functionality (including interpolation and output to files) can only be
-      achieved using string values.
-
-      .. note::
-
-         This method lets users assign non-string values to keys internally.
-         This behaviour is unsupported and will cause errors when attempting to
-         write to a file or get it in non-raw mode.  **Use the mapping protocol
-         API** which does not allow such assignments to take place.
+      otherwise raise :exc:`NoSectionError`.  *option* and *value* must be
+      strings; if not, :exc:`TypeError` is raised.
 
 
    .. method:: write(fileobject, space_around_delimiters=True)
@@ -921,134 +1092,52 @@
          Use :meth:`read_file` instead.
 
 
-.. _configparser-objects:
-
-ConfigParser Objects
---------------------
-
-.. warning::
-   Whenever you can, consider using :class:`SafeConfigParser` which adds
-   validation and escaping for the interpolation.
-
-The :class:`ConfigParser` class extends some methods of the
-:class:`RawConfigParser` interface, adding some optional arguments.
-
-.. class:: ConfigParser(defaults=None, dict_type=collections.OrderedDict, allow_no_value=False, delimiters=('=', ':'), comment_prefixes=_COMPATIBLE, strict=False, empty_lines_in_values=True)
-
-   Derived class of :class:`RawConfigParser` that implements the magical
-   interpolation feature and adds optional arguments to the :meth:`get` and
-   :meth:`items` methods.
-
-   :class:`SafeConfigParser` is generally recommended over this class if you
-   need interpolation.
-
-   The values in *defaults* must be appropriate for the ``%()s`` string
-   interpolation.
-
-   All option names used in interpolation will be passed through the
-   :meth:`optionxform` method just like any other option name reference.  For
-   example, using the default implementation of :meth:`optionxform` (which
-   converts option names to lower case), the values ``foo %(bar)s`` and ``foo
-   %(BAR)s`` are equivalent.
-
-   .. versionchanged:: 3.1
-      The default *dict_type* is :class:`collections.OrderedDict`.
-
-   .. versionchanged:: 3.2
-      *allow_no_value*, *delimiters*, *comment_prefixes*,
-      *strict* and *empty_lines_in_values* were added.
-
-
-   .. method:: get(section, option, raw=False, [vars, fallback])
-
-      Get an *option* value for the named *section*.  If *vars* is provided, it
-      must be a dictionary.  The *option* is looked up in *vars* (if provided),
-      *section*, and in *DEFAULTSECT* in that order.  If the key is not found
-      and *fallback* is provided, it is used as a fallback value.  ``None`` can
-      be provided as a *fallback* value.
-
-      All the ``'%'`` interpolations are expanded in the return values, unless
-      the *raw* argument is true.  Values for interpolation keys are looked up
-      in the same manner as the option.
-
-      .. versionchanged:: 3.2
-         Arguments *raw*, *vars* and *fallback* are keyword only to protect
-         users from trying to use the third argument as the *fallback* fallback
-         (especially when using the mapping protocol).
-
-
-   .. method:: getint(section, option, raw=False, [vars, fallback])
-
-      A convenience method which coerces the *option* in the specified *section*
-      to an integer.  See :meth:`get` for explanation of *raw*, *vars* and
-      *fallback*.
-
-
-   .. method:: getfloat(section, option, raw=False, [vars, fallback])
-
-      A convenience method which coerces the *option* in the specified *section*
-      to a floating point number.  See :meth:`get` for explanation of *raw*,
-      *vars* and *fallback*.
-
-
-   .. method:: getboolean(section, option, raw=False, [vars, fallback])
-
-      A convenience method which coerces the *option* in the specified *section*
-      to a Boolean value.  Note that the accepted values for the option are
-      ``'1'``, ``'yes'``, ``'true'``, and ``'on'``, which cause this method to
-      return ``True``, and ``'0'``, ``'no'``, ``'false'``, and ``'off'``, which
-      cause it to return ``False``.  These string values are checked in a
-      case-insensitive manner.  Any other value will cause it to raise
-      :exc:`ValueError`.  See :meth:`get` for explanation of *raw*, *vars* and
-      *fallback*.
-
-
-   .. method:: items(section, raw=False, vars=None)
-
-      Return a list of *name*, *value* pairs for the options in the given
-      *section*.  Optional arguments have the same meaning as for the
-      :meth:`get` method.
-
-
 .. data:: MAX_INTERPOLATION_DEPTH
 
    The maximum depth for recursive interpolation for :meth:`get` when the *raw*
-   parameter is false.  This is relevant only for the :class:`ConfigParser` class.
+   parameter is false.  This is relevant only when the default *interpolation*
+   is used.
 
 
-.. _safeconfigparser-objects:
+.. _rawconfigparser-objects:
 
-SafeConfigParser Objects
-------------------------
+RawConfigParser Objects
+-----------------------
 
-.. class:: SafeConfigParser(defaults=None, dict_type=collections.OrderedDict, allow_no_value=False, delimiters=('=', ':'), comment_prefixes=_COMPATIBLE, strict=False, empty_lines_in_values=True)
+.. class:: RawConfigParser(defaults=None, dict_type=collections.OrderedDict, allow_no_value=False, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section=configaparser.DEFAULTSECT, interpolation=None)
 
-   Derived class of :class:`ConfigParser` that implements a variant of the
-   magical interpolation feature.  This implementation is more predictable as
-   it validates the interpolation syntax used within a configuration file.
-   This class also enables escaping the interpolation character (a key can have
-   ``%`` as part of the value by specifying ``%%`` in the file).
+   Legacy variant of the :class:`ConfigParser` with interpolation disabled
+   by default and unsafe ``add_section`` and ``set`` methods.
 
-   Applications that don't require interpolation should use
-   :class:`RawConfigParser`, otherwise :class:`SafeConfigParser` is the best
-   option.
+   .. note::
+      Consider using :class:`ConfigParser` instead which checks types of
+      the values to be stored internally. If you don't want interpolation, you
+      can use ``ConfigParser(interpolation=None)``.
 
-   .. versionchanged:: 3.1
-      The default *dict_type* is :class:`collections.OrderedDict`.
 
-   .. versionchanged:: 3.2
-      *allow_no_value*, *delimiters*, *comment_prefixes*, *strict* and
-      *empty_lines_in_values* were added.
+   .. method:: add_section(section)
 
+      Add a section named *section* to the instance.  If a section by the given
+      name already exists, :exc:`DuplicateSectionError` is raised.  If the
+      *default section* name is passed, :exc:`ValueError` is raised.
+
+      Type of *section* is not checked which lets users create non-string named
+      sections. This behaviour is unsupported and may cause internal errors.
 
-   The :class:`SafeConfigParser` class implements the same extended interface
-   as :class:`ConfigParser`, with the following addition:
 
    .. method:: set(section, option, value)
 
       If the given section exists, set the given option to the specified value;
-      otherwise raise :exc:`NoSectionError`.  *value* must be a string; if not,
-      :exc:`TypeError` is raised.
+      otherwise raise :exc:`NoSectionError`.  While it is possible to use
+      :class:`RawConfigParser` (or :class:`ConfigParser` with *raw* parameters
+      set to true) for *internal* storage of non-string values, full
+      functionality (including interpolation and output to files) can only be
+      achieved using string values.
+
+      This method lets users assign non-string values to keys internally.  This
+      behaviour is unsupported and will cause errors when attempting to write
+      to a file or get it in non-raw mode.  **Use the mapping protocol API**
+      which does not allow such assignments to take place.
 
 
 Exceptions

Modified: python/branches/py3k-cdecimal/Doc/library/ctypes.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/ctypes.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/ctypes.rst	Sun Jan  2 13:18:37 2011
@@ -1930,22 +1930,6 @@
    but it is possible to enlarge the buffer.
 
 
-.. function:: set_conversion_mode(encoding, errors)
-
-   This function sets the rules that ctypes objects use when converting between
-   bytes objects and (unicode) strings. *encoding* must be a string specifying an
-   encoding, like ``'utf-8'`` or ``'mbcs'``, *errors* must be a string specifying
-   the error handling on encoding/decoding errors. Examples of possible values are
-   ``'strict'``, ``'replace'``, or ``'ignore'``.
-
-   :func:`set_conversion_mode` returns a 2-tuple containing the previous
-   conversion rules. On windows, the initial conversion rules are ``('mbcs',
-   'ignore')``, on other systems ``('ascii', 'strict')``.
-
-   You can set the *encoding* to ``'undefined'`` to completely disable automatic
-   conversions.
-
-
 .. function:: set_errno(value)
 
    Set the current value of the ctypes-private copy of the system :data:`errno`

Modified: python/branches/py3k-cdecimal/Doc/library/curses.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/curses.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/curses.rst	Sun Jan  2 13:18:37 2011
@@ -49,7 +49,7 @@
       Tutorial material on using curses with Python, by Andrew Kuchling and Eric
       Raymond.
 
-   The :file:`Demo/curses/` directory in the Python source distribution contains
+   The :file:`Tools/demo/` directory in the Python source distribution contains
    some example programs using the curses bindings provided by this module.
 
 

Modified: python/branches/py3k-cdecimal/Doc/library/dbm.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/dbm.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/dbm.rst	Sun Jan  2 13:18:37 2011
@@ -20,7 +20,7 @@
 
 .. function:: whichdb(filename)
 
-   This functionattempts to guess which of the several simple database modules
+   This function attempts to guess which of the several simple database modules
    available --- :mod:`dbm.gnu`, :mod:`dbm.ndbm` or :mod:`dbm.dumb` --- should
    be used to open a given file.
 
@@ -61,10 +61,15 @@
    modified by the prevailing umask).
 
 
-The object returned by :func:`.open` supports most of the same functionality as
+The object returned by :func:`.open` supports the same basic functionality as
 dictionaries; keys and their corresponding values can be stored, retrieved, and
 deleted, and the :keyword:`in` operator and the :meth:`keys` method are
-available. Key and values are always stored as bytes. This means that when
+available, as well as :meth:`get` and :meth:`setdefault`.
+
+.. versionchanged:: 3.2
+   :meth:`get` and :meth:`setdefault` are now available in all database modules.
+
+Key and values are always stored as bytes. This means that when
 strings are used they are implicitly converted to the default encoding before
 being stored.
 
@@ -86,10 +91,8 @@
    # Notice how the value is now in bytes.
    assert db['www.cnn.com'] == b'Cable News Network'
 
-   # Loop through contents.  Other dictionary methods
-   # such as .keys(), .values() also work.
-   for k, v in db.iteritems():
-       print(k, '\t', v)
+   # Often-used methods of the dict interface work too.
+   print(db.get('python.org', b'not present'))
 
    # Storing a non-string key or value will raise an exception (most
    # likely a TypeError).

Modified: python/branches/py3k-cdecimal/Doc/library/difflib.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/difflib.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/difflib.rst	Sun Jan  2 13:18:37 2011
@@ -17,6 +17,7 @@
 information in various formats, including HTML and context and unified
 diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
 
+
 .. class:: SequenceMatcher
 
    This is a flexible class for comparing pairs of sequences of any type, so long
@@ -35,6 +36,17 @@
    complicated way on how many elements the sequences have in common; best case
    time is linear.
 
+   **Automatic junk heuristic:** :class:`SequenceMatcher` supports a heuristic that
+   automatically treats certain sequence items as junk. The heuristic counts how many
+   times each individual item appears in the sequence. If an item's duplicates (after
+   the first one) account for more than 1% of the sequence and the sequence is at least
+   200 items long, this item is marked as "popular" and is treated as junk for
+   the purpose of sequence matching. This heuristic can be turned off by setting
+   the ``autojunk`` argument to ``False`` when creating the :class:`SequenceMatcher`.
+
+   .. versionadded:: 3.2
+      The *autojunk* parameter.
+
 
 .. class:: Differ
 
@@ -324,7 +336,7 @@
 The :class:`SequenceMatcher` class has this constructor:
 
 
-.. class:: SequenceMatcher(isjunk=None, a='', b='')
+.. class:: SequenceMatcher(isjunk=None, a='', b='', autojunk=True)
 
    Optional argument *isjunk* must be ``None`` (the default) or a one-argument
    function that takes a sequence element and returns true if and only if the
@@ -340,8 +352,23 @@
    The optional arguments *a* and *b* are sequences to be compared; both default to
    empty strings.  The elements of both sequences must be :term:`hashable`.
 
-   :class:`SequenceMatcher` objects have the following methods:
+   The optional argument *autojunk* can be used to disable the automatic junk
+   heuristic.
 
+   .. versionadded:: 3.2
+      The *autojunk* parameter.
+
+   SequenceMatcher objects get three data attributes: *bjunk* is the
+   set of elements of *b* for which *isjunk* is True; *bpopular* is the set of
+   non-junk elements considered popular by the heuristic (if it is not
+   disabled); *b2j* is a dict mapping the remaining elements of *b* to a list
+   of positions where they occur. All three are reset whenever *b* is reset
+   with :meth:`set_seqs` or :meth:`set_seq2`.
+
+   .. versionadded:: 3.2
+      The *bjunk* and *bpopular* attributes.
+
+   :class:`SequenceMatcher` objects have the following methods:
 
    .. method:: set_seqs(a, b)
 
@@ -520,7 +547,7 @@
 SequenceMatcher Examples
 ------------------------
 
-This example compares two strings, considering blanks to be "junk:"
+This example compares two strings, considering blanks to be "junk":
 
    >>> s = SequenceMatcher(lambda x: x == " ",
    ...                     "private Thread currentThread;",

Modified: python/branches/py3k-cdecimal/Doc/library/dis.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/dis.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/dis.rst	Sun Jan  2 13:18:37 2011
@@ -733,11 +733,6 @@
    Used by the :keyword:`del` statement.
 
 
-.. opcode:: SET_LINENO (lineno)
-
-   This opcode is obsolete.
-
-
 .. opcode:: RAISE_VARARGS (argc)
 
    Raises an exception. *argc* indicates the number of parameters to the raise

Modified: python/branches/py3k-cdecimal/Doc/library/doctest.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/doctest.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/doctest.rst	Sun Jan  2 13:18:37 2011
@@ -922,7 +922,7 @@
 
    def load_tests(loader, tests, ignore):
        tests.addTests(doctest.DocTestSuite(my_module_with_doctests))
-       return test
+       return tests
 
 There are two main functions for creating :class:`unittest.TestSuite` instances
 from text files and modules with doctests:

Modified: python/branches/py3k-cdecimal/Doc/library/email.header.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/email.header.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/email.header.rst	Sun Jan  2 13:18:37 2011
@@ -63,7 +63,7 @@
    character set is used both as *s*'s initial charset and as the default for
    subsequent :meth:`append` calls.
 
-   The maximum line length can be specified explicit via *maxlinelen*.  For
+   The maximum line length can be specified explicitly via *maxlinelen*.  For
    splitting the first line to a shorter value (to account for the field header
    which isn't included in *s*, e.g. :mailheader:`Subject`) pass in the name of the
    field in *header_name*.  The default *maxlinelen* is 76, and the default value

Modified: python/branches/py3k-cdecimal/Doc/library/email.message.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/email.message.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/email.message.rst	Sun Jan  2 13:18:37 2011
@@ -270,7 +270,15 @@
       taken as the parameter name, with underscores converted to dashes (since
       dashes are illegal in Python identifiers).  Normally, the parameter will
       be added as ``key="value"`` unless the value is ``None``, in which case
-      only the key will be added.
+      only the key will be added.  If the value contains non-ASCII characters,
+      it can be specified as a three tuple in the format
+      ``(CHARSET, LANGUAGE, VALUE)``, where ``CHARSET`` is a string naming the
+      charset to be used to encode the value, ``LANGUAGE`` can usually be set
+      to ``None`` or the empty string (see :rfc:`2231` for other possibilities),
+      and ``VALUE`` is the string value containing non-ASCII code points.  If
+      a three tuple is not passed and the value contains non-ASCII characters,
+      it is automatically encoded in :rfc:`2231` format using a ``CHARSET``
+      of ``utf-8`` and a ``LANGUAGE`` of ``None``.
 
       Here's an example::
 
@@ -280,6 +288,15 @@
 
          Content-Disposition: attachment; filename="bud.gif"
 
+      An example with with non-ASCII characters::
+
+         msg.add_header('Content-Disposition', 'attachment',
+                        filename=('iso-8859-1', '', 'Fu??baller.ppt'))
+
+      Which produces ::
+
+         Content-Disposition: attachment; filename*="iso-8859-1''Fu%DFballer.ppt"
+
 
    .. method:: replace_header(_name, _value)
 
@@ -369,7 +386,7 @@
       :rfc:`2231`, you can collapse the parameter value by calling
       :func:`email.utils.collapse_rfc2231_value`, passing in the return value
       from :meth:`get_param`.  This will return a suitably decoded Unicode
-      string whn the value is a tuple, or the original string unquoted if it
+      string when the value is a tuple, or the original string unquoted if it
       isn't.  For example::
 
          rawparam = msg.get_param('foo')

Modified: python/branches/py3k-cdecimal/Doc/library/email.util.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/email.util.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/email.util.rst	Sun Jan  2 13:18:37 2011
@@ -105,11 +105,17 @@
    ``False``.  The default is ``False``.
 
 
-.. function:: make_msgid(idstring=None)
+.. function:: make_msgid(idstring=None, domain=None)
 
    Returns a string suitable for an :rfc:`2822`\ -compliant
    :mailheader:`Message-ID` header.  Optional *idstring* if given, is a string
-   used to strengthen the uniqueness of the message id.
+   used to strengthen the uniqueness of the message id.  Optional *domain* if
+   given provides the portion of the msgid after the '@'.  The default is the
+   local hostname.  It is not normally necessary to override this default, but
+   may be useful certain cases, such as a constructing distributed system that
+   uses a consistent domain name across multiple hosts.
+
+   .. versionchanged:: 3.2 domain keyword added
 
 
 .. function:: decode_rfc2231(s)

Modified: python/branches/py3k-cdecimal/Doc/library/exceptions.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/exceptions.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/exceptions.rst	Sun Jan  2 13:18:37 2011
@@ -63,6 +63,12 @@
    :exc:`FloatingPointError`.
 
 
+.. exception:: BufferError
+
+   Raised when a :ref:`buffer ` related operation cannot be
+   performed.
+
+
 .. exception:: LookupError
 
    The base class for the exceptions that are raised when a key or index used on
@@ -257,6 +263,18 @@
    of the exception instance returns only the message.
 
 
+.. exception:: IndentationError
+
+   Base class for syntax errors related to incorrect indentation.  This is a
+   subclass of :exc:`SyntaxError`.
+
+
+.. exception:: TabError
+
+   Raised when indentation contains an inconsistent use of tabs and spaces.
+   This is a subclass of :exc:`IndentationError`.
+
+
 .. exception:: SystemError
 
    Raised when the interpreter finds an internal error, but the situation does not

Modified: python/branches/py3k-cdecimal/Doc/library/fileformats.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/fileformats.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/fileformats.rst	Sun Jan  2 13:18:37 2011
@@ -5,7 +5,7 @@
 ************
 
 The modules described in this chapter parse various miscellaneous file formats
-that aren't markup languages or are related to e-mail.
+that aren't markup languages and are not related to e-mail.
 
 
 .. toctree::

Modified: python/branches/py3k-cdecimal/Doc/library/functions.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/functions.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/functions.rst	Sun Jan  2 13:18:37 2011
@@ -7,6 +7,24 @@
 The Python interpreter has a number of functions and types built into it that
 are always available.  They are listed here in alphabetical order.
 
+===================  =================  ==================  ================  ====================
+..                   ..                 Built-in Functions  ..                ..
+===================  =================  ==================  ================  ====================
+:func:`abs`          :func:`dict`       :func:`help`        :func:`min`       :func:`setattr`
+:func:`all`          :func:`dir`        :func:`hex`         :func:`next`      :func:`slice`
+:func:`any`          :func:`divmod`     :func:`id`          :func:`object`    :func:`sorted`
+:func:`ascii`        :func:`enumerate`  :func:`input`       :func:`oct`       :func:`staticmethod`
+:func:`bin`          :func:`eval`       :func:`int`         :func:`open`      :func:`str`
+:func:`bool`         :func:`exec`       :func:`isinstance`  :func:`ord`       :func:`sum`
+:func:`bytearray`    :func:`filter`     :func:`issubclass`  :func:`pow`       :func:`super`
+:func:`bytes`        :func:`float`      :func:`iter`        :func:`print`     :func:`tuple`
+:func:`callable`     :func:`format`     :func:`len`         :func:`property`  :func:`type`
+:func:`chr`          :func:`frozenset`  :func:`list`        :func:`range`     :func:`vars`
+:func:`classmethod`  :func:`getattr`    :func:`locals`      :func:`repr`      :func:`zip`
+:func:`compile`      :func:`globals`    :func:`map`         :func:`reversed`  :func:`__import__`
+:func:`complex`      :func:`hasattr`    :func:`max`         :func:`round`
+:func:`delattr`      :func:`hash`       :func:`memoryview`  :func:`set`
+===================  =================  ==================  ================  ====================
 
 .. function:: abs(x)
 
@@ -103,6 +121,19 @@
    Bytes objects can also be created with literals, see :ref:`strings`.
 
 
+.. function:: callable(object)
+
+   Return :const:`True` if the *object* argument appears callable,
+   :const:`False` if not.  If this returns true, it is still possible that a
+   call fails, but if it is false, calling *object* will never succeed.
+   Note that classes are callable (calling a class returns a new instance);
+   instances are callable if their class has a :meth:`__call__` method.
+
+   .. versionadded:: 3.2
+      This function was first removed in Python 3.0 and then brought back
+      in Python 3.2.
+
+
 .. function:: chr(i)
 
    Return the string representing a character whose Unicode codepoint is the integer
@@ -143,7 +174,7 @@
    type hierarchy in :ref:`types`.
 
 
-.. function:: compile(source, filename, mode, flags=0, dont_inherit=False)
+.. function:: compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1)
 
    Compile the *source* into a code or AST object.  Code objects can be executed
    by :func:`exec` or :func:`eval`.  *source* can either be a string or an AST
@@ -175,6 +206,12 @@
    can be found as the :attr:`compiler_flag` attribute on the :class:`_Feature`
    instance in the :mod:`__future__` module.
 
+   The argument *optimize* specifies the optimization level of the compiler; the
+   default value of ``-1`` selects the optimization level of the interpreter as
+   given by :option:`-O` options.  Explicit levels are ``0`` (no optimization;
+   ``__debug__`` is true), ``1`` (asserts are removed, ``__debug__`` is false)
+   or ``2`` (docstrings are removed too).
+
    This function raises :exc:`SyntaxError` if the compiled source is invalid,
    and :exc:`TypeError` if the source contains null bytes.
 
@@ -187,7 +224,7 @@
 
    .. versionchanged:: 3.2
       Allowed use of Windows and Mac newlines.  Also input in ``'exec'`` mode
-      does not have to end in a newline anymore.
+      does not have to end in a newline anymore.  Added the *optimize* parameter.
 
 
 .. function:: complex([real[, imag]])
@@ -417,8 +454,8 @@
       sign: "+" | "-"
       infinity: "Infinity" | "inf"
       nan: "nan"
-      numeric-value: `floatnumber` | `infinity` | `nan`
-      numeric-string: [`sign`] `numeric-value`
+      numeric_value: `floatnumber` | `infinity` | `nan`
+      numeric_string: [`sign`] `numeric_value`
 
    Here ``floatnumber`` is the form of a Python floating-point literal,
    described in :ref:`floating`.  Case is not significant, so, for example,
@@ -992,8 +1029,33 @@
       >>> list(range(1, 0))
       []
 
+   Range objects implement the :class:`collections.Sequence` ABC, and provide
+   features such as containment tests, element index lookup, slicing and
+   support for negative indices:
+
+      >>> r = range(0, 20, 2)
+      >>> r
+      range(0, 20, 2)
+      >>> 11 in r
+      False
+      >>> 10 in r
+      True
+      >>> r.index(10)
+      5
+      >>> r[5]
+      10
+      >>> r[:5]
+      range(0, 10, 2)
+      >>> r[-1]
+      18
+
+   Ranges containing absolute values larger than :data:`sys.maxsize` are permitted
+   but some features (such as :func:`len`) will raise :exc:`OverflowError`.
+
    .. versionchanged:: 3.2
-      Testing integers for membership takes constant time instead of iterating
+      Implement the Sequence ABC.
+      Support slicing and negative indices.
+      Test integers for membership in constant time instead of iterating
       through all items.
 
 

Modified: python/branches/py3k-cdecimal/Doc/library/functools.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/functools.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/functools.rst	Sun Jan  2 13:18:37 2011
@@ -32,7 +32,7 @@
    A compare function is any callable that accept two arguments, compares them,
    and returns a negative number for less-than, zero for equality, or a positive
    number for greater-than.  A key function is a callable that accepts one
-   argument and returns another value that indicates the position in the desired
+   argument and returns another value indicating the position in the desired
    collation sequence.
 
    Example::
@@ -42,37 +42,76 @@
    .. versionadded:: 3.2
 
 
-.. decorator:: lru_cache(maxsize)
+.. decorator:: lru_cache(maxsize=100)
 
    Decorator to wrap a function with a memoizing callable that saves up to the
    *maxsize* most recent calls.  It can save time when an expensive or I/O bound
    function is periodically called with the same arguments.
 
-   The *maxsize* parameter defaults to 100.  Since a dictionary is used to cache
-   results, the positional and keyword arguments to the function must be
-   hashable.
-
-   The wrapped function is instrumented with two attributes, :attr:`cache_hits`
-   and :attr:`cache_misses` which count the number of successful or unsuccessful
-   cache lookups.  These statistics are helpful for tuning the *maxsize*
-   parameter and for measuring the cache's effectiveness.
+   Since a dictionary is used to cache results, the positional and keyword
+   arguments to the function must be hashable.
 
-   The wrapped function also has a :attr:`cache_clear` attribute which can be
-   called (with no arguments) to clear the cache.
+   If *maxsize* is set to None, the LRU feature is disabled and the cache
+   can grow without bound.
+
+   To help measure the effectiveness of the cache and tune the *maxsize*
+   parameter, the wrapped function is instrumented with a :func:`cache_info`
+   function that returns a :term:`named tuple` showing *hits*, *misses*,
+   *maxsize* and *currsize*.  In a multi-threaded environment, the hits
+   and misses are approximate.
+
+   The decorator also provides a :func:`cache_clear` function for clearing or
+   invalidating the cache.
 
    The original underlying function is accessible through the
-   :attr:`__wrapped__` attribute.  This allows introspection, bypassing
-   the cache, or rewrapping the function with a different caching tool.
+   :attr:`__wrapped__` attribute.  This is useful for introspection, for
+   bypassing the cache, or for rewrapping the function with a different cache.
 
-   A `LRU (least recently used) cache
-   `_
-   is indicated when the pattern of calls changes over time, such as
-   when more recent calls are the best predictors of upcoming calls
-   (for example, the most popular articles on a news server tend to
-   change every day).
+   An `LRU (least recently used) cache
+   `_ works
+   best when more recent calls are the best predictors of upcoming calls (for
+   example, the most popular articles on a news server tend to change daily).
+   The cache's size limit assures that the cache does not grow without bound on
+   long-running processes such as web servers.
+
+   Example of an LRU cache for static web content::
+
+        @lru_cache(maxsize=20)
+        def get_pep(num):
+            'Retrieve text of a Python Enhancement Proposal'
+            resource = 'http://www.python.org/dev/peps/pep-%04d/' % num
+            try:
+                with urllib.request.urlopen(resource) as s:
+                    return s.read()
+            except urllib.error.HTTPError:
+                return 'Not Found'
+
+        >>> for n in 8, 290, 308, 320, 8, 218, 320, 279, 289, 320, 9991:
+        ...     pep = get_pep(n)
+        ...     print(n, len(pep))
+
+        >>> print(get_pep.cache_info())
+        CacheInfo(hits=3, misses=8, maxsize=20, currsize=8)
+
+   Example of efficiently computing
+   `Fibonacci numbers `_
+   using a cache to implement a
+   `dynamic programming `_
+   technique::
+
+        @lru_cache(maxsize=None)
+        def fib(n):
+            if n < 2:
+                return n
+            return fib(n-1) + fib(n-2)
 
-   .. versionadded:: 3.2
+        >>> print([fib(n) for n in range(16)])
+        [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610]
 
+        >>> print(fib.cache_info())
+        CacheInfo(hits=28, misses=16, maxsize=None, currsize=16)
+
+   .. versionadded:: 3.2
 
 .. decorator:: total_ordering
 

Modified: python/branches/py3k-cdecimal/Doc/library/grp.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/grp.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/grp.rst	Sun Jan  2 13:18:37 2011
@@ -30,7 +30,9 @@
 The gid is an integer, name and password are strings, and the member list is a
 list of strings. (Note that most users are not explicitly listed as members of
 the group they are in according to the password database.  Check both databases
-to get complete membership information.)
+to get complete membership information.  Also note that a ``gr_name`` that
+starts with a ``+`` or ``-`` is likely to be a YP/NIS reference and may not be
+accessible via :func:`getgrnam` or :func:`getgrgid`.)
 
 It defines the following items:
 

Modified: python/branches/py3k-cdecimal/Doc/library/hashlib.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/hashlib.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/hashlib.rst	Sun Jan  2 13:18:37 2011
@@ -135,7 +135,7 @@
 .. method:: hash.digest()
 
    Return the digest of the data passed to the :meth:`update` method so far.
-   This is a bytes array of size :attr:`digest_size` which may contain bytes in
+   This is a bytes object of size :attr:`digest_size` which may contain bytes in
    the whole range from 0 to 255.
 
 

Modified: python/branches/py3k-cdecimal/Doc/library/heapq.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/heapq.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/heapq.rst	Sun Jan  2 13:18:37 2011
@@ -16,11 +16,12 @@
    Latest version of the :source:`heapq Python source code
    `
 
-Heaps are arrays for which ``heap[k] <= heap[2*k+1]`` and ``heap[k] <=
-heap[2*k+2]`` for all *k*, counting elements from zero.  For the sake of
-comparison, non-existing elements are considered to be infinite.  The
-interesting property of a heap is that ``heap[0]`` is always its smallest
-element.
+Heaps are binary trees for which every parent node has a value less than or
+equal to any of its children.  This implementation uses arrays for which
+``heap[k] <= heap[2*k+1]`` and ``heap[k] <= heap[2*k+2]`` for all *k*, counting
+elements from zero.  For the sake of comparison, non-existing elements are
+considered to be infinite.  The interesting property of a heap is that its
+smallest element is always the root, ``heap[0]``.
 
 The API below differs from textbook heap algorithms in two aspects: (a) We use
 zero-based indexing.  This makes the relationship between the index for a node

Modified: python/branches/py3k-cdecimal/Doc/library/html.parser.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/html.parser.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/html.parser.rst	Sun Jan  2 13:18:37 2011
@@ -12,9 +12,13 @@
 This module defines a class :class:`HTMLParser` which serves as the basis for
 parsing text files formatted in HTML (HyperText Mark-up Language) and XHTML.
 
-.. class:: HTMLParser()
+.. class:: HTMLParser(strict=True)
 
-   The :class:`HTMLParser` class is instantiated without arguments.
+   Create a parser instance.  If *strict* is ``True`` (the default), invalid
+   html results in :exc:`~html.parser.HTMLParseError` exceptions [#]_.  If
+   *strict* is ``False``, the parser uses heuristics to make a best guess at
+   the intention of any invalid html it encounters, similar to the way most
+   browsers do.
 
    An :class:`HTMLParser` instance is fed HTML data and calls handler functions when tags
    begin and end.  The :class:`HTMLParser` class is meant to be overridden by the
@@ -23,6 +27,8 @@
    This parser does not check that end tags match start tags or call the end-tag
    handler for elements which are closed implicitly by closing an outer element.
 
+   .. versionchanged:: 3.2 *strict* keyword added
+
 An exception is defined as well:
 
 
@@ -191,3 +197,8 @@
    Encountered a html end tag
 
 
+.. rubric:: Footnotes
+
+.. [#] For backward compatibility reasons *strict* mode does not raise
+       exceptions for all non-compliant HTML.  That is, some invalid HTML
+       is tolerated even in *strict* mode.

Modified: python/branches/py3k-cdecimal/Doc/library/http.client.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/http.client.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/http.client.rst	Sun Jan  2 13:18:37 2011
@@ -23,16 +23,13 @@
 The module provides the following classes:
 
 
-.. class:: HTTPConnection(host, port=None, strict=None[, timeout[, source_address]])
+.. class:: HTTPConnection(host, port=None[, strict[, timeout[, source_address]]])
 
    An :class:`HTTPConnection` instance represents one transaction with an HTTP
    server.  It should be instantiated passing it a host and optional port
    number.  If no port number is passed, the port is extracted from the host
    string if it has the form ``host:port``, else the default HTTP port (80) is
-   used.  When True, the optional parameter *strict* (which defaults to a false
-   value) causes ``BadStatusLine`` to
-   be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1
-   status line.  If the optional *timeout* parameter is given, blocking
+   used.  If the optional *timeout* parameter is given, blocking
    operations (like connection attempts) will timeout after that many seconds
    (if it is not given, the global default timeout setting is used).
    The optional *source_address* parameter may be a typle of a (host, port)
@@ -49,8 +46,12 @@
    .. versionchanged:: 3.2
       *source_address* was added.
 
+   .. versionchanged:: 3.2
+      The *strict* parameter is deprecated.  HTTP 0.9-style "Simple Responses"
+      are not supported anymore.
+
 
-.. class:: HTTPSConnection(host, port=None, key_file=None, cert_file=None, strict=None[, timeout[, source_address]], *, context=None, check_hostname=None)
+.. class:: HTTPSConnection(host, port=None, key_file=None, cert_file=None[, strict[, timeout[, source_address]]], *, context=None, check_hostname=None)
 
    A subclass of :class:`HTTPConnection` that uses SSL for communication with
    secure servers.  Default port is ``443``.  If *context* is specified, it
@@ -80,12 +81,20 @@
       This class now supports HTTPS virtual hosts if possible (that is,
       if :data:`ssl.HAS_SNI` is true).
 
+   .. versionchanged:: 3.2
+      The *strict* parameter is deprecated.  HTTP 0.9-style "Simple Responses"
+      are not supported anymore.
+
 
-.. class:: HTTPResponse(sock, debuglevel=0, strict=0, method=None, url=None)
+.. class:: HTTPResponse(sock, debuglevel=0[, strict], method=None, url=None)
 
    Class whose instances are returned upon successful connection.  Not
    instantiated directly by user.
 
+   .. versionchanged:: 3.2
+      The *strict* parameter is deprecated.  HTTP 0.9-style "Simple Responses"
+      are not supported anymore.
+
 
 The following exceptions are raised as appropriate:
 
@@ -384,14 +393,18 @@
    string.
 
    The *body* may also be an open :term:`file object`, in which case the
-   contents of the file is sent; this file object should support
-   ``fileno()`` and ``read()`` methods. The header Content-Length is
-   automatically set to the length of the file as reported by
-   stat.
+   contents of the file is sent; this file object should support ``fileno()``
+   and ``read()`` methods. The header Content-Length is automatically set to
+   the length of the file as reported by stat. The *body* argument may also be
+   an iterable and Contet-Length header should be explicitly provided when the
+   body is an iterable.
 
    The *headers* argument should be a mapping of extra HTTP
    headers to send with the request.
 
+   .. versionadded:: 3.2
+      *body* can now be an iterable.
+
 .. method:: HTTPConnection.getresponse()
 
    Should be called after a request is sent to get the response from the server.
@@ -405,8 +418,10 @@
 
 .. method:: HTTPConnection.set_debuglevel(level)
 
-   Set the debugging level (the amount of debugging output printed). The default
-   debug level is ``0``, meaning no debugging output is printed.
+   Set the debugging level.  The default debug level is ``0``, meaning no
+   debugging output is printed.  Any value greater than ``0`` will cause all
+   currently defined debug output to be printed to stdout.  The ``debuglevel``
+   is passed to any new :class:`HTTPResponse` objects that are created.
 
    .. versionadded:: 3.1
 

Modified: python/branches/py3k-cdecimal/Doc/library/imp.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/imp.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/imp.rst	Sun Jan  2 13:18:37 2011
@@ -190,8 +190,8 @@
    continue to use the old class definition.  The same is true for derived classes.
 
 
-The following functions and data provide conveniences for handling :pep:`3147`
-byte-compiled file paths.
+The following functions are conveniences for handling :pep:`3147` byte-compiled
+file paths.
 
 .. versionadded:: 3.2
 
@@ -258,88 +258,6 @@
 
    The module was found as a frozen module (see :func:`init_frozen`).
 
-The following constant and functions are obsolete; their functionality is
-available through :func:`find_module` or :func:`load_module`. They are kept
-around for backward compatibility:
-
-
-.. data:: SEARCH_ERROR
-
-   Unused.
-
-
-.. function:: init_builtin(name)
-
-   Initialize the built-in module called *name* and return its module object along
-   with storing it in ``sys.modules``.  If the module was already initialized, it
-   will be initialized *again*.  Re-initialization involves the copying of the
-   built-in module's ``__dict__`` from the cached module over the module's entry in
-   ``sys.modules``.  If there is no built-in module called *name*, ``None`` is
-   returned.
-
-
-.. function:: init_frozen(name)
-
-   Initialize the frozen module called *name* and return its module object.  If
-   the module was already initialized, it will be initialized *again*.  If there
-   is no frozen module called *name*, ``None`` is returned.  (Frozen modules are
-   modules written in Python whose compiled byte-code object is incorporated
-   into a custom-built Python interpreter by Python's :program:`freeze`
-   utility. See :file:`Tools/freeze/` for now.)
-
-
-.. function:: is_builtin(name)
-
-   Return ``1`` if there is a built-in module called *name* which can be
-   initialized again.  Return ``-1`` if there is a built-in module called *name*
-   which cannot be initialized again (see :func:`init_builtin`).  Return ``0`` if
-   there is no built-in module called *name*.
-
-
-.. function:: is_frozen(name)
-
-   Return ``True`` if there is a frozen module (see :func:`init_frozen`) called
-   *name*, or ``False`` if there is no such module.
-
-
-.. function:: load_compiled(name, pathname, [file])
-
-   .. index:: pair: file; byte-code
-
-   Load and initialize a module implemented as a byte-compiled code file and return
-   its module object.  If the module was already initialized, it will be
-   initialized *again*.  The *name* argument is used to create or access a module
-   object.  The *pathname* argument points to the byte-compiled code file.  The
-   *file* argument is the byte-compiled code file, open for reading in binary mode,
-   from the beginning. It must currently be a real file object, not a user-defined
-   class emulating a file.
-
-
-.. function:: load_dynamic(name, pathname[, file])
-
-   Load and initialize a module implemented as a dynamically loadable shared
-   library and return its module object.  If the module was already initialized, it
-   will be initialized *again*. Re-initialization involves copying the ``__dict__``
-   attribute of the cached instance of the module over the value used in the module
-   cached in ``sys.modules``.  The *pathname* argument must point to the shared
-   library.  The *name* argument is used to construct the name of the
-   initialization function: an external C function called ``initname()`` in the
-   shared library is called.  The optional *file* argument is ignored.  (Note:
-   using shared libraries is highly system dependent, and not all systems support
-   it.)
-
-
-.. function:: load_source(name, pathname[, file])
-
-   Load and initialize a module implemented as a Python source file and return its
-   module object.  If the module was already initialized, it will be initialized
-   *again*.  The *name* argument is used to create or access a module object.  The
-   *pathname* argument points to the source file.  The *file* argument is the
-   source file, open for reading as text, from the beginning. It must currently be
-   a real file object, not a user-defined class emulating a file.  Note that if a
-   properly matching byte-compiled file (with suffix :file:`.pyc` or :file:`.pyo`)
-   exists, it will be used instead of parsing the given source file.
-
 
 .. class:: NullImporter(path_string)
 
@@ -390,10 +308,3 @@
            # Since we may exit via an exception, close fp explicitly.
            if fp:
                fp.close()
-
-.. index:: module: knee
-
-A more complete example that implements hierarchical module names and includes a
-:func:`reload` function can be found in the module :mod:`knee`.  The :mod:`knee`
-module can be found in :file:`Demo/imputil/` in the Python source distribution.
-

Modified: python/branches/py3k-cdecimal/Doc/library/inspect.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/inspect.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/inspect.rst	Sun Jan  2 13:18:37 2011
@@ -630,17 +630,17 @@
 When implementing coroutine schedulers and for other advanced uses of
 generators, it is useful to determine whether a generator is currently
 executing, is waiting to start or resume or execution, or has already
-terminated. func:`getgeneratorstate` allows the current state of a
+terminated. :func:`getgeneratorstate` allows the current state of a
 generator to be determined easily.
 
 .. function:: getgeneratorstate(generator)
 
-    Get current state of a generator-iterator.
+   Get current state of a generator-iterator.
 
-    Possible states are:
-      GEN_CREATED: Waiting to start execution.
-      GEN_RUNNING: Currently being executed by the interpreter.
-      GEN_SUSPENDED: Currently suspended at a yield expression.
-      GEN_CLOSED: Execution has completed.
+   Possible states are:
+   -  GEN_CREATED: Waiting to start execution.
+   -  GEN_RUNNING: Currently being executed by the interpreter.
+   -  GEN_SUSPENDED: Currently suspended at a yield expression.
+   -  GEN_CLOSED: Execution has completed.
 
    .. versionadded:: 3.2

Modified: python/branches/py3k-cdecimal/Doc/library/io.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/io.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/io.rst	Sun Jan  2 13:18:37 2011
@@ -54,12 +54,6 @@
 The text stream API is described in detail in the documentation for the
 :class:`TextIOBase`.
 
-.. note::
-
-   Text I/O over a binary storage (such as a file) is significantly slower than
-   binary I/O over the same storage.  This can become noticeable if you handle
-   huge amounts of text data (for example very large log files).
-
 
 Binary I/O
 ^^^^^^^^^^
@@ -361,9 +355,9 @@
 
    .. method:: readinto(b)
 
-      Read up to len(b) bytes into bytearray *b* and return the number ofbytes
-      read.  If the object is in non-blocking mode and no bytes are available,
-      ``None`` is returned.
+      Read up to len(b) bytes into bytearray *b* and return the number
+      of bytes read.  If the object is in non-blocking mode and no
+      bytes are available, ``None`` is returned.
 
    .. method:: write(b)
 
@@ -506,8 +500,8 @@
 Buffered Streams
 ^^^^^^^^^^^^^^^^
 
-In many situations, buffered I/O streams will provide higher performance
-(bandwidth and latency) than raw I/O streams.  Their API is also more usable.
+Buffered I/O streams provide a higher-level interface to an I/O device
+than raw I/O does.
 
 .. class:: BytesIO([initial_bytes])
 
@@ -784,14 +778,72 @@
       # .getvalue() will now raise an exception.
       output.close()
 
-   .. note::
-
-      :class:`StringIO` uses a native text storage and doesn't suffer from the
-      performance issues of other text streams, such as those based on
-      :class:`TextIOWrapper`.
 
 .. class:: IncrementalNewlineDecoder
 
    A helper codec that decodes newlines for universal newlines mode.  It
    inherits :class:`codecs.IncrementalDecoder`.
 
+
+Advanced topics
+---------------
+
+Here we will discuss several advanced topics pertaining to the concrete
+I/O implementations described above.
+
+Performance
+^^^^^^^^^^^
+
+Binary I/O
+""""""""""
+
+By reading and writing only large chunks of data even when the user asks
+for a single byte, buffered I/O is designed to hide any inefficiency in
+calling and executing the operating system's unbuffered I/O routines.  The
+gain will vary very much depending on the OS and the kind of I/O which is
+performed (for example, on some contemporary OSes such as Linux, unbuffered
+disk I/O can be as fast as buffered I/O).  The bottom line, however, is
+that buffered I/O will offer you predictable performance regardless of the
+platform and the backing device.  Therefore, it is most always preferable to
+use buffered I/O rather than unbuffered I/O.
+
+Text I/O
+""""""""
+
+Text I/O over a binary storage (such as a file) is significantly slower than
+binary I/O over the same storage, because it implies conversions from
+unicode to binary data using a character codec.  This can become noticeable
+if you handle huge amounts of text data (for example very large log files).
+
+:class:`StringIO`, however, is a native in-memory unicode container and will
+exhibit similar speed to :class:`BytesIO`.
+
+Multi-threading
+^^^^^^^^^^^^^^^
+
+:class:`FileIO` objects are thread-safe to the extent that the operating
+system calls (such as ``read(2)`` under Unix) they are wrapping are thread-safe
+too.
+
+Binary buffered objects (instances of :class:`BufferedReader`,
+:class:`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`)
+protect their internal structures using a lock; it is therefore safe to call
+them from multiple threads at once.
+
+:class:`TextIOWrapper` objects are not thread-safe.
+
+Reentrancy
+^^^^^^^^^^
+
+Binary buffered objects (instances of :class:`BufferedReader`,
+:class:`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`)
+are not reentrant.  While reentrant calls will not happen in normal situations,
+they can arise if you are doing I/O in a :mod:`signal` handler.  If it is
+attempted to enter a buffered object again while already being accessed
+*from the same thread*, then a :exc:`RuntimeError` is raised.
+
+The above implicitly extends to text files, since the :func:`open()`
+function will wrap a buffered object inside a :class:`TextIOWrapper`.  This
+includes standard streams and therefore affects the built-in function
+:func:`print()` as well.
+

Modified: python/branches/py3k-cdecimal/Doc/library/itertools.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/itertools.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/itertools.rst	Sun Jan  2 13:18:37 2011
@@ -46,6 +46,7 @@
 ====================    ============================    =================================================   =============================================================
 Iterator                Arguments                       Results                                             Example
 ====================    ============================    =================================================   =============================================================
+:func:`accumulate`      p                               p0, p0+p1, p0+p1+p2, ...                            ``accumulate([1,2,3,4,5]) --> 1 3 6 10 15``
 :func:`chain`           p, q, ...                       p0, p1, ... plast, q0, q1, ...                      ``chain('ABC', 'DEF') --> A B C D E F``
 :func:`compress`        data, selectors                 (d[0] if s[0]), (d[1] if s[1]), ...                 ``compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F``
 :func:`dropwhile`       pred, seq                       seq[n], seq[n+1], starting when pred fails          ``dropwhile(lambda x: x<5, [1,4,6,4,1]) --> 6 4 1``
@@ -83,6 +84,22 @@
 streams of infinite length, so they should only be accessed by functions or
 loops that truncate the stream.
 
+.. function:: accumulate(iterable)
+
+    Make an iterator that returns accumulated sums. Elements may be any addable
+    type including :class:`Decimal` or :class:`Fraction`.  Equivalent to::
+
+        def accumulate(iterable):
+            'Return running totals'
+            # accumulate([1,2,3,4,5]) --> 1 3 6 10 15
+            it = iter(iterable)
+            total = next(it)
+            yield total
+            for element in it:
+                total = total + element
+                yield total
+
+    .. versionadded:: 3.2
 
 .. function:: chain(*iterables)
 
@@ -560,8 +577,8 @@
 
 .. _itertools-recipes:
 
-Recipes
--------
+Itertools Recipes
+-----------------
 
 This section shows recipes for creating an extended toolset using the existing
 itertools as building blocks.

Modified: python/branches/py3k-cdecimal/Doc/library/logging.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/logging.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/logging.rst	Sun Jan  2 13:18:37 2011
@@ -2,7 +2,7 @@
 ==============================================
 
 .. module:: logging
-   :synopsis: Flexible error logging system for applications.
+   :synopsis: Flexible event logging system for applications.
 
 
 .. moduleauthor:: Vinay Sajip 
@@ -11,748 +11,107 @@
 
 .. index:: pair: Errors; logging
 
-This module defines functions and classes which implement a flexible error
-logging system for applications.
+.. sidebar:: Important
 
-Logging is performed by calling methods on instances of the :class:`Logger`
-class (hereafter called :dfn:`loggers`). Each instance has a name, and they are
-conceptually arranged in a namespace hierarchy using dots (periods) as
-separators. For example, a logger named "scan" is the parent of loggers
-"scan.text", "scan.html" and "scan.pdf". Logger names can be anything you want,
-and indicate the area of an application in which a logged message originates.
-
-Logged messages also have levels of importance associated with them. The default
-levels provided are :const:`DEBUG`, :const:`INFO`, :const:`WARNING`,
-:const:`ERROR` and :const:`CRITICAL`. As a convenience, you indicate the
-importance of a logged message by calling an appropriate method of
-:class:`Logger`. The methods are :meth:`debug`, :meth:`info`, :meth:`warning`,
-:meth:`error` and :meth:`critical`, which mirror the default levels. You are not
-constrained to use these levels: you can specify your own and use a more general
-:class:`Logger` method, :meth:`log`, which takes an explicit level argument.
+   This page contains the API reference information. For tutorial
+   information and discussion of more advanced topics, see
 
+   * :ref:`Basic Tutorial `
+   * :ref:`Advanced Tutorial `
+   * :ref:`Logging Cookbook `
 
-Logging tutorial
-----------------
+
+This module defines functions and classes which implement a flexible event
+logging system for applications and libraries.
 
 The key benefit of having the logging API provided by a standard library module
 is that all Python modules can participate in logging, so your application log
-can include messages from third-party modules.
-
-It is, of course, possible to log messages with different verbosity levels or to
-different destinations.  Support for writing log messages to files, HTTP
-GET/POST locations, email via SMTP, generic sockets, or OS-specific logging
-mechanisms are all supported by the standard module.  You can also create your
-own log destination class if you have special requirements not met by any of the
-built-in classes.
-
-Simple examples
-^^^^^^^^^^^^^^^
-
-.. sectionauthor:: Doug Hellmann
-.. (see )
-
-Most applications are probably going to want to log to a file, so let's start
-with that case. Using the :func:`basicConfig` function, we can set up the
-default handler so that debug messages are written to a file (in the example,
-we assume that you have the appropriate permissions to create a file called
-*example.log* in the current directory)::
-
-   import logging
-   LOG_FILENAME = 'example.log'
-   logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)
-
-   logging.debug('This message should go to the log file')
-
-And now if we open the file and look at what we have, we should find the log
-message::
-
-   DEBUG:root:This message should go to the log file
-
-If you run the script repeatedly, the additional log messages are appended to
-the file.  To create a new file each time, you can pass a *filemode* argument to
-:func:`basicConfig` with a value of ``'w'``.  Rather than managing the file size
-yourself, though, it is simpler to use a :class:`RotatingFileHandler`::
-
-   import glob
-   import logging
-   import logging.handlers
-
-   LOG_FILENAME = 'logging_rotatingfile_example.out'
-
-   # Set up a specific logger with our desired output level
-   my_logger = logging.getLogger('MyLogger')
-   my_logger.setLevel(logging.DEBUG)
-
-   # Add the log message handler to the logger
-   handler = logging.handlers.RotatingFileHandler(
-                 LOG_FILENAME, maxBytes=20, backupCount=5)
-
-   my_logger.addHandler(handler)
-
-   # Log some messages
-   for i in range(20):
-       my_logger.debug('i = %d' % i)
-
-   # See what files are created
-   logfiles = glob.glob('%s*' % LOG_FILENAME)
-
-   for filename in logfiles:
-       print(filename)
-
-The result should be 6 separate files, each with part of the log history for the
-application::
-
-   logging_rotatingfile_example.out
-   logging_rotatingfile_example.out.1
-   logging_rotatingfile_example.out.2
-   logging_rotatingfile_example.out.3
-   logging_rotatingfile_example.out.4
-   logging_rotatingfile_example.out.5
-
-The most current file is always :file:`logging_rotatingfile_example.out`,
-and each time it reaches the size limit it is renamed with the suffix
-``.1``. Each of the existing backup files is renamed to increment the suffix
-(``.1`` becomes ``.2``, etc.)  and the ``.6`` file is erased.
-
-Obviously this example sets the log length much much too small as an extreme
-example.  You would want to set *maxBytes* to an appropriate value.
-
-Another useful feature of the logging API is the ability to produce different
-messages at different log levels.  This allows you to instrument your code with
-debug messages, for example, but turning the log level down so that those debug
-messages are not written for your production system.  The default levels are
-``NOTSET``, ``DEBUG``, ``INFO``, ``WARNING``, ``ERROR`` and ``CRITICAL``.
-
-The logger, handler, and log message call each specify a level.  The log message
-is only emitted if the handler and logger are configured to emit messages of
-that level or lower.  For example, if a message is ``CRITICAL``, and the logger
-is set to ``ERROR``, the message is emitted.  If a message is a ``WARNING``, and
-the logger is set to produce only ``ERROR``\s, the message is not emitted::
-
-   import logging
-   import sys
-
-   LEVELS = {'debug': logging.DEBUG,
-             'info': logging.INFO,
-             'warning': logging.WARNING,
-             'error': logging.ERROR,
-             'critical': logging.CRITICAL}
-
-   if len(sys.argv) > 1:
-       level_name = sys.argv[1]
-       level = LEVELS.get(level_name, logging.NOTSET)
-       logging.basicConfig(level=level)
-
-   logging.debug('This is a debug message')
-   logging.info('This is an info message')
-   logging.warning('This is a warning message')
-   logging.error('This is an error message')
-   logging.critical('This is a critical error message')
-
-Run the script with an argument like 'debug' or 'warning' to see which messages
-show up at different levels::
-
-   $ python logging_level_example.py debug
-   DEBUG:root:This is a debug message
-   INFO:root:This is an info message
-   WARNING:root:This is a warning message
-   ERROR:root:This is an error message
-   CRITICAL:root:This is a critical error message
-
-   $ python logging_level_example.py info
-   INFO:root:This is an info message
-   WARNING:root:This is a warning message
-   ERROR:root:This is an error message
-   CRITICAL:root:This is a critical error message
-
-You will notice that these log messages all have ``root`` embedded in them.  The
-logging module supports a hierarchy of loggers with different names.  An easy
-way to tell where a specific log message comes from is to use a separate logger
-object for each of your modules.  Each new logger "inherits" the configuration
-of its parent, and log messages sent to a logger include the name of that
-logger.  Optionally, each logger can be configured differently, so that messages
-from different modules are handled in different ways.  Let's look at a simple
-example of how to log from different modules so it is easy to trace the source
-of the message::
-
-   import logging
-
-   logging.basicConfig(level=logging.WARNING)
-
-   logger1 = logging.getLogger('package1.module1')
-   logger2 = logging.getLogger('package2.module2')
-
-   logger1.warning('This message comes from one module')
-   logger2.warning('And this message comes from another module')
-
-And the output::
-
-   $ python logging_modules_example.py
-   WARNING:package1.module1:This message comes from one module
-   WARNING:package2.module2:And this message comes from another module
-
-There are many more options for configuring logging, including different log
-message formatting options, having messages delivered to multiple destinations,
-and changing the configuration of a long-running application on the fly using a
-socket interface.  All of these options are covered in depth in the library
-module documentation.
-
-Loggers
-^^^^^^^
-
-The logging library takes a modular approach and offers the several categories
-of components: loggers, handlers, filters, and formatters.  Loggers expose the
-interface that application code directly uses.  Handlers send the log records to
-the appropriate destination. Filters provide a finer grained facility for
-determining which log records to send on to a handler.  Formatters specify the
-layout of the resultant log record.
-
-:class:`Logger` objects have a threefold job.  First, they expose several
-methods to application code so that applications can log messages at runtime.
-Second, logger objects determine which log messages to act upon based upon
-severity (the default filtering facility) or filter objects.  Third, logger
-objects pass along relevant log messages to all interested log handlers.
-
-The most widely used methods on logger objects fall into two categories:
-configuration and message sending.
-
-* :meth:`Logger.setLevel` specifies the lowest-severity log message a logger
-  will handle, where debug is the lowest built-in severity level and critical is
-  the highest built-in severity.  For example, if the severity level is info,
-  the logger will handle only info, warning, error, and critical messages and
-  will ignore debug messages.
-
-* :meth:`Logger.addFilter` and :meth:`Logger.removeFilter` add and remove filter
-  objects from the logger object.  This tutorial does not address filters.
-
-With the logger object configured, the following methods create log messages:
-
-* :meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`,
-  :meth:`Logger.error`, and :meth:`Logger.critical` all create log records with
-  a message and a level that corresponds to their respective method names. The
-  message is actually a format string, which may contain the standard string
-  substitution syntax of :const:`%s`, :const:`%d`, :const:`%f`, and so on.  The
-  rest of their arguments is a list of objects that correspond with the
-  substitution fields in the message.  With regard to :const:`**kwargs`, the
-  logging methods care only about a keyword of :const:`exc_info` and use it to
-  determine whether to log exception information.
-
-* :meth:`Logger.exception` creates a log message similar to
-  :meth:`Logger.error`.  The difference is that :meth:`Logger.exception` dumps a
-  stack trace along with it.  Call this method only from an exception handler.
-
-* :meth:`Logger.log` takes a log level as an explicit argument.  This is a
-  little more verbose for logging messages than using the log level convenience
-  methods listed above, but this is how to log at custom log levels.
-
-:func:`getLogger` returns a reference to a logger instance with the specified
-name if it is provided, or ``root`` if not.  The names are period-separated
-hierarchical structures.  Multiple calls to :func:`getLogger` with the same name
-will return a reference to the same logger object.  Loggers that are further
-down in the hierarchical list are children of loggers higher up in the list.
-For example, given a logger with a name of ``foo``, loggers with names of
-``foo.bar``, ``foo.bar.baz``, and ``foo.bam`` are all descendants of ``foo``.
-Child loggers propagate messages up to the handlers associated with their
-ancestor loggers.  Because of this, it is unnecessary to define and configure
-handlers for all the loggers an application uses. It is sufficient to
-configure handlers for a top-level logger and create child loggers as needed.
-
-
-Handlers
-^^^^^^^^
-
-:class:`Handler` objects are responsible for dispatching the appropriate log
-messages (based on the log messages' severity) to the handler's specified
-destination.  Logger objects can add zero or more handler objects to themselves
-with an :func:`addHandler` method.  As an example scenario, an application may
-want to send all log messages to a log file, all log messages of error or higher
-to stdout, and all messages of critical to an email address.  This scenario
-requires three individual handlers where each handler is responsible for sending
-messages of a specific severity to a specific location.
-
-The standard library includes quite a few handler types; this tutorial uses only
-:class:`StreamHandler` and :class:`FileHandler` in its examples.
-
-There are very few methods in a handler for application developers to concern
-themselves with.  The only handler methods that seem relevant for application
-developers who are using the built-in handler objects (that is, not creating
-custom handlers) are the following configuration methods:
-
-* The :meth:`Handler.setLevel` method, just as in logger objects, specifies the
-  lowest severity that will be dispatched to the appropriate destination.  Why
-  are there two :func:`setLevel` methods?  The level set in the logger
-  determines which severity of messages it will pass to its handlers.  The level
-  set in each handler determines which messages that handler will send on.
-
-* :func:`setFormatter` selects a Formatter object for this handler to use.
-
-* :func:`addFilter` and :func:`removeFilter` respectively configure and
-  deconfigure filter objects on handlers.
-
-Application code should not directly instantiate and use instances of
-:class:`Handler`.  Instead, the :class:`Handler` class is a base class that
-defines the interface that all handlers should have and establishes some
-default behavior that child classes can use (or override).
-
-
-Formatters
-^^^^^^^^^^
-
-Formatter objects configure the final order, structure, and contents of the log
-message.  Unlike the base :class:`logging.Handler` class, application code may
-instantiate formatter classes, although you could likely subclass the formatter
-if your application needs special behavior.  The constructor takes three
-optional arguments -- a message format string, a date format string and a style
-indicator.
-
-.. method:: logging.Formatter.__init__(fmt=None, datefmt=None, style='%')
-
-If there is no message format string, the default is to use the
-raw message.  If there is no date format string, the default date format is::
-
-    %Y-%m-%d %H:%M:%S
-
-with the milliseconds tacked on at the end. The ``style`` is one of `%`, '{'
-or '$'. If one of these is not specified, then '%' will be used.
-
-If the ``style`` is '%', the message format string uses
-``%()s`` styled string substitution; the possible keys are
-documented in :ref:`formatter-objects`. If the style is '{', the message format
-string is assumed to be compatible with :meth:`str.format` (using keyword
-arguments), while if the style is '$' then the message format string should
-conform to what is expected by :meth:`string.Template.substitute`.
-
-.. versionchanged:: 3.2
-   Added the ``style`` parameter.
+can include your own messages integrated with messages from third-party
+modules.
 
-The following message format string will log the time in a human-readable
-format, the severity of the message, and the contents of the message, in that
-order::
-
-    "%(asctime)s - %(levelname)s - %(message)s"
-
-Formatters use a user-configurable function to convert the creation time of a
-record to a tuple. By default, :func:`time.localtime` is used; to change this
-for a particular formatter instance, set the ``converter`` attribute of the
-instance to a function with the same signature as :func:`time.localtime` or
-:func:`time.gmtime`. To change it for all formatters, for example if you want
-all logging times to be shown in GMT, set the ``converter`` attribute in the
-Formatter class (to ``time.gmtime`` for GMT display).
-
-
-Configuring Logging
-^^^^^^^^^^^^^^^^^^^
-
-Programmers can configure logging in three ways:
-
-1. Creating loggers, handlers, and formatters explicitly using Python
-   code that calls the configuration methods listed above.
-2. Creating a logging config file and reading it using the :func:`fileConfig`
-   function.
-3. Creating a dictionary of configuration information and passing it
-   to the :func:`dictConfig` function.
-
-The following example configures a very simple logger, a console
-handler, and a simple formatter using Python code::
-
-    import logging
-
-    # create logger
-    logger = logging.getLogger("simple_example")
-    logger.setLevel(logging.DEBUG)
-
-    # create console handler and set level to debug
-    ch = logging.StreamHandler()
-    ch.setLevel(logging.DEBUG)
-
-    # create formatter
-    formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
-
-    # add formatter to ch
-    ch.setFormatter(formatter)
-
-    # add ch to logger
-    logger.addHandler(ch)
-
-    # "application" code
-    logger.debug("debug message")
-    logger.info("info message")
-    logger.warn("warn message")
-    logger.error("error message")
-    logger.critical("critical message")
-
-Running this module from the command line produces the following output::
-
-    $ python simple_logging_module.py
-    2005-03-19 15:10:26,618 - simple_example - DEBUG - debug message
-    2005-03-19 15:10:26,620 - simple_example - INFO - info message
-    2005-03-19 15:10:26,695 - simple_example - WARNING - warn message
-    2005-03-19 15:10:26,697 - simple_example - ERROR - error message
-    2005-03-19 15:10:26,773 - simple_example - CRITICAL - critical message
-
-The following Python module creates a logger, handler, and formatter nearly
-identical to those in the example listed above, with the only difference being
-the names of the objects::
-
-    import logging
-    import logging.config
-
-    logging.config.fileConfig("logging.conf")
-
-    # create logger
-    logger = logging.getLogger("simpleExample")
-
-    # "application" code
-    logger.debug("debug message")
-    logger.info("info message")
-    logger.warn("warn message")
-    logger.error("error message")
-    logger.critical("critical message")
-
-Here is the logging.conf file::
-
-    [loggers]
-    keys=root,simpleExample
-
-    [handlers]
-    keys=consoleHandler
-
-    [formatters]
-    keys=simpleFormatter
-
-    [logger_root]
-    level=DEBUG
-    handlers=consoleHandler
-
-    [logger_simpleExample]
-    level=DEBUG
-    handlers=consoleHandler
-    qualname=simpleExample
-    propagate=0
-
-    [handler_consoleHandler]
-    class=StreamHandler
-    level=DEBUG
-    formatter=simpleFormatter
-    args=(sys.stdout,)
-
-    [formatter_simpleFormatter]
-    format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
-    datefmt=
-
-The output is nearly identical to that of the non-config-file-based example::
-
-    $ python simple_logging_config.py
-    2005-03-19 15:38:55,977 - simpleExample - DEBUG - debug message
-    2005-03-19 15:38:55,979 - simpleExample - INFO - info message
-    2005-03-19 15:38:56,054 - simpleExample - WARNING - warn message
-    2005-03-19 15:38:56,055 - simpleExample - ERROR - error message
-    2005-03-19 15:38:56,130 - simpleExample - CRITICAL - critical message
-
-You can see that the config file approach has a few advantages over the Python
-code approach, mainly separation of configuration and code and the ability of
-noncoders to easily modify the logging properties.
-
-Note that the class names referenced in config files need to be either relative
-to the logging module, or absolute values which can be resolved using normal
-import mechanisms. Thus, you could use either
-:class:`handlers.WatchedFileHandler` (relative to the logging module) or
-``mypackage.mymodule.MyHandler`` (for a class defined in package ``mypackage``
-and module ``mymodule``, where ``mypackage`` is available on the Python import
-path).
-
-In Python 3.2, a new means of configuring logging has been introduced, using
-dictionaries to hold configuration information. This provides a superset of the
-functionality of the config-file-based approach outlined above, and is the
-recommended configuration method for new applications and deployments. Because
-a Python dictionary is used to hold configuration information, and since you
-can populate that dictionary using different means, you have more options for
-configuration. For example, you can use a configuration file in JSON format,
-or, if you have access to YAML processing functionality, a file in YAML
-format, to populate the configuration dictionary. Or, of course, you can
-construct the dictionary in Python code, receive it in pickled form over a
-socket, or use whatever approach makes sense for your application.
-
-Here's an example of the same configuration as above, in YAML format for
-the new dictionary-based approach::
-
-    version: 1
-    formatters:
-      simple:
-        format: format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
-    handlers:
-      console:
-        class: logging.StreamHandler
-        level: DEBUG
-        formatter: simple
-        stream: ext://sys.stdout
-    loggers:
-      simpleExample:
-        level: DEBUG
-        handlers: [console]
-        propagate: no
-    root:
-        level: DEBUG
-        handlers: [console]
-
-For more information about logging using a dictionary, see
-:ref:`logging-config-api`.
-
-.. _library-config:
-
-Configuring Logging for a Library
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-When developing a library which uses logging, some consideration needs to be
-given to its configuration. If the using application does not use logging, and
-library code makes logging calls, then a one-off message "No handlers could be
-found for logger X.Y.Z" is printed to the console. This message is intended
-to catch mistakes in logging configuration, but will confuse an application
-developer who is not aware of logging by the library.
-
-In addition to documenting how a library uses logging, a good way to configure
-library logging so that it does not cause a spurious message is to add a
-handler which does nothing. This avoids the message being printed, since a
-handler will be found: it just doesn't produce any output. If the library user
-configures logging for application use, presumably that configuration will add
-some handlers, and if levels are suitably configured then logging calls made
-in library code will send output to those handlers, as normal.
-
-A do-nothing handler can be simply defined as follows::
-
-    import logging
-
-    class NullHandler(logging.Handler):
-        def emit(self, record):
-            pass
-
-An instance of this handler should be added to the top-level logger of the
-logging namespace used by the library. If all logging by a library *foo* is
-done using loggers with names matching "foo.x.y", then the code::
-
-    import logging
-
-    h = NullHandler()
-    logging.getLogger("foo").addHandler(h)
-
-should have the desired effect. If an organisation produces a number of
-libraries, then the logger name specified can be "orgname.foo" rather than
-just "foo".
-
-**PLEASE NOTE:** It is strongly advised that you *do not add any handlers other
-than* :class:`NullHandler` *to your library's loggers*. This is because the
-configuration of handlers is the prerogative of the application developer who
-uses your library. The application developer knows their target audience and
-what handlers are most appropriate for their application: if you add handlers
-"under the hood", you might well interfere with their ability to carry out
-unit tests and deliver logs which suit their requirements.
-
-.. versionadded:: 3.1
-
-The :class:`NullHandler` class was not present in previous versions, but is
-now included, so that it need not be defined in library code.
+The module provides a lot of functionality and flexibility.  If you are
+unfamiliar with logging, the best way to get to grips with it is to see the
+tutorials (see the links on the right).
+
+The basic classes defined by the module, together with their functions, are
+listed below.
+
+* Loggers expose the interface that application code directly uses.
+* Handlers send the log records (created by loggers) to the appropriate
+  destination.
+* Filters provide a finer grained facility for determining which log records
+  to output.
+* Formatters specify the layout of log records in the final output.
 
 
+.. _logger:
 
-Logging Levels
+Logger Objects
 --------------
 
-The numeric values of logging levels are given in the following table. These are
-primarily of interest if you want to define your own levels, and need them to
-have specific values relative to the predefined levels. If you define a level
-with the same numeric value, it overwrites the predefined value; the predefined
-name is lost.
-
-+--------------+---------------+
-| Level        | Numeric value |
-+==============+===============+
-| ``CRITICAL`` | 50            |
-+--------------+---------------+
-| ``ERROR``    | 40            |
-+--------------+---------------+
-| ``WARNING``  | 30            |
-+--------------+---------------+
-| ``INFO``     | 20            |
-+--------------+---------------+
-| ``DEBUG``    | 10            |
-+--------------+---------------+
-| ``NOTSET``   | 0             |
-+--------------+---------------+
-
-Levels can also be associated with loggers, being set either by the developer or
-through loading a saved logging configuration. When a logging method is called
-on a logger, the logger compares its own level with the level associated with
-the method call. If the logger's level is higher than the method call's, no
-logging message is actually generated. This is the basic mechanism controlling
-the verbosity of logging output.
-
-Logging messages are encoded as instances of the :class:`LogRecord` class. When
-a logger decides to actually log an event, a :class:`LogRecord` instance is
-created from the logging message.
-
-Logging messages are subjected to a dispatch mechanism through the use of
-:dfn:`handlers`, which are instances of subclasses of the :class:`Handler`
-class. Handlers are responsible for ensuring that a logged message (in the form
-of a :class:`LogRecord`) ends up in a particular location (or set of locations)
-which is useful for the target audience for that message (such as end users,
-support desk staff, system administrators, developers). Handlers are passed
-:class:`LogRecord` instances intended for particular destinations. Each logger
-can have zero, one or more handlers associated with it (via the
-:meth:`addHandler` method of :class:`Logger`). In addition to any handlers
-directly associated with a logger, *all handlers associated with all ancestors
-of the logger* are called to dispatch the message (unless the *propagate* flag
-for a logger is set to a false value, at which point the passing to ancestor
-handlers stops).
-
-Just as for loggers, handlers can have levels associated with them. A handler's
-level acts as a filter in the same way as a logger's level does. If a handler
-decides to actually dispatch an event, the :meth:`emit` method is used to send
-the message to its destination. Most user-defined subclasses of :class:`Handler`
-will need to override this :meth:`emit`.
-
-.. _custom-levels:
-
-Custom Levels
-^^^^^^^^^^^^^
-
-Defining your own levels is possible, but should not be necessary, as the
-existing levels have been chosen on the basis of practical experience.
-However, if you are convinced that you need custom levels, great care should
-be exercised when doing this, and it is possibly *a very bad idea to define
-custom levels if you are developing a library*. That's because if multiple
-library authors all define their own custom levels, there is a chance that
-the logging output from such multiple libraries used together will be
-difficult for the using developer to control and/or interpret, because a
-given numeric value might mean different things for different libraries.
-
-
-Useful Handlers
----------------
-
-In addition to the base :class:`Handler` class, many useful subclasses are
-provided:
-
-#. :class:`StreamHandler` instances send messages to streams (file-like
-   objects).
-
-#. :class:`FileHandler` instances send messages to disk files.
-
-.. module:: logging.handlers
-
-#. :class:`BaseRotatingHandler` is the base class for handlers that
-   rotate log files at a certain point. It is not meant to be  instantiated
-   directly. Instead, use :class:`RotatingFileHandler` or
-   :class:`TimedRotatingFileHandler`.
-
-#. :class:`RotatingFileHandler` instances send messages to disk
-   files, with support for maximum log file sizes and log file rotation.
-
-#. :class:`TimedRotatingFileHandler` instances send messages to
-   disk files, rotating the log file at certain timed intervals.
-
-#. :class:`SocketHandler` instances send messages to TCP/IP
-   sockets.
-
-#. :class:`DatagramHandler` instances send messages to UDP
-   sockets.
+Loggers have the following attributes and methods. Note that Loggers are never
+instantiated directly, but always through the module-level function
+``logging.getLogger(name)``.
 
-#. :class:`SMTPHandler` instances send messages to a designated
-   email address.
+.. class:: Logger
 
-#. :class:`SysLogHandler` instances send messages to a Unix
-   syslog daemon, possibly on a remote machine.
+.. attribute:: Logger.propagate
 
-#. :class:`NTEventLogHandler` instances send messages to a
-   Windows NT/2000/XP event log.
+   If this evaluates to false, logging messages are not passed by this logger or by
+   its child loggers to the handlers of higher level (ancestor) loggers. The
+   constructor sets this attribute to 1.
 
-#. :class:`MemoryHandler` instances send messages to a buffer
-   in memory, which is flushed whenever specific criteria are met.
 
-#. :class:`HTTPHandler` instances send messages to an HTTP
-   server using either ``GET`` or ``POST`` semantics.
+.. method:: Logger.setLevel(lvl)
 
-#. :class:`WatchedFileHandler` instances watch the file they are
-   logging to. If the file changes, it is closed and reopened using the file
-   name. This handler is only useful on Unix-like systems; Windows does not
-   support the underlying mechanism used.
+   Sets the threshold for this logger to *lvl*. Logging messages which are less
+   severe than *lvl* will be ignored. When a logger is created, the level is set to
+   :const:`NOTSET` (which causes all messages to be processed when the logger is
+   the root logger, or delegation to the parent when the logger is a non-root
+   logger). Note that the root logger is created with level :const:`WARNING`.
 
-#. :class:`QueueHandler` instances send messages to a queue, such as
-   those implemented in the :mod:`queue` or :mod:`multiprocessing` modules.
+   The term 'delegation to the parent' means that if a logger has a level of
+   NOTSET, its chain of ancestor loggers is traversed until either an ancestor with
+   a level other than NOTSET is found, or the root is reached.
 
-.. currentmodule:: logging
+   If an ancestor is found with a level other than NOTSET, then that ancestor's
+   level is treated as the effective level of the logger where the ancestor search
+   began, and is used to determine how a logging event is handled.
 
-#. :class:`NullHandler` instances do nothing with error messages. They are used
-   by library developers who want to use logging, but want to avoid the "No
-   handlers could be found for logger XXX" message which can be displayed if
-   the library user has not configured logging. See :ref:`library-config` for
-   more information.
-
-.. versionadded:: 3.1
-
-The :class:`NullHandler` class was not present in previous versions.
-
-.. versionadded:: 3.2
-
-The :class:`QueueHandler` class was not present in previous versions.
-
-The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler`
-classes are defined in the core logging package. The other handlers are
-defined in a sub- module, :mod:`logging.handlers`. (There is also another
-sub-module, :mod:`logging.config`, for configuration functionality.)
-
-Logged messages are formatted for presentation through instances of the
-:class:`Formatter` class. They are initialized with a format string suitable for
-use with the % operator and a dictionary.
-
-For formatting multiple messages in a batch, instances of
-:class:`BufferingFormatter` can be used. In addition to the format string (which
-is applied to each message in the batch), there is provision for header and
-trailer format strings.
-
-When filtering based on logger level and/or handler level is not enough,
-instances of :class:`Filter` can be added to both :class:`Logger` and
-:class:`Handler` instances (through their :meth:`addFilter` method). Before
-deciding to process a message further, both loggers and handlers consult all
-their filters for permission. If any filter returns a false value, the message
-is not processed further.
-
-The basic :class:`Filter` functionality allows filtering by specific logger
-name. If this feature is used, messages sent to the named logger and its
-children are allowed through the filter, and all others dropped.
+   If the root is reached, and it has a level of NOTSET, then all messages will be
+   processed. Otherwise, the root's level will be used as the effective level.
 
-Module-Level Functions
-----------------------
 
-In addition to the classes described above, there are a number of module- level
-functions.
+.. method:: Logger.isEnabledFor(lvl)
 
+   Indicates if a message of severity *lvl* would be processed by this logger.
+   This method checks first the module-level level set by
+   ``logging.disable(lvl)`` and then the logger's effective level as determined
+   by :meth:`getEffectiveLevel`.
 
-.. function:: getLogger(name=None)
 
-   Return a logger with the specified name or, if name is ``None``, return a
-   logger which is the root logger of the hierarchy. If specified, the name is
-   typically a dot-separated hierarchical name like *"a"*, *"a.b"* or *"a.b.c.d"*.
-   Choice of these names is entirely up to the developer who is using logging.
+.. method:: Logger.getEffectiveLevel()
 
-   All calls to this function with a given name return the same logger instance.
-   This means that logger instances never need to be passed between different parts
-   of an application.
+   Indicates the effective level for this logger. If a value other than
+   :const:`NOTSET` has been set using :meth:`setLevel`, it is returned. Otherwise,
+   the hierarchy is traversed towards the root until a value other than
+   :const:`NOTSET` is found, and that value is returned.
 
 
-.. function:: getLoggerClass()
+.. method:: Logger.getChild(suffix)
 
-   Return either the standard :class:`Logger` class, or the last class passed to
-   :func:`setLoggerClass`. This function may be called from within a new class
-   definition, to ensure that installing a customised :class:`Logger` class will
-   not undo customisations already applied by other code. For example::
+   Returns a logger which is a descendant to this logger, as determined by the suffix.
+   Thus, ``logging.getLogger('abc').getChild('def.ghi')`` would return the same
+   logger as would be returned by ``logging.getLogger('abc.def.ghi')``. This is a
+   convenience method, useful when the parent logger is named using e.g. ``__name__``
+   rather than a literal string.
 
-      class MyLogger(logging.getLoggerClass()):
-          # ... override behaviour here
+   .. versionadded:: 3.2
 
 
-.. function:: debug(msg, *args, **kwargs)
+.. method:: Logger.debug(msg, *args, **kwargs)
 
-   Logs a message with level :const:`DEBUG` on the root logger. The *msg* is the
+   Logs a message with level :const:`DEBUG` on this logger. The *msg* is the
    message format string, and the *args* are the arguments which are merged into
    *msg* using the string formatting operator. (Note that this means that you can
    use keywords in the format string, together with a single dictionary argument.)
@@ -781,18 +140,19 @@
    This mimics the `Traceback (most recent call last):` which is used when
    displaying exception frames.
 
-   The third optional keyword argument is *extra* which can be used to pass a
+   The third keyword argument is *extra* which can be used to pass a
    dictionary which is used to populate the __dict__ of the LogRecord created for
    the logging event with user-defined attributes. These custom attributes can then
    be used as you like. For example, they could be incorporated into logged
    messages. For example::
 
-      FORMAT = "%(asctime)-15s %(clientip)s %(user)-8s %(message)s"
+      FORMAT = '%(asctime)-15s %(clientip)s %(user)-8s %(message)s'
       logging.basicConfig(format=FORMAT)
-      d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}
-      logging.warning("Protocol problem: %s", "connection reset", extra=d)
+      d = { 'clientip' : '192.168.0.1', 'user' : 'fbloggs' }
+      logger = logging.getLogger('tcpserver')
+      logger.warning('Protocol problem: %s', 'connection reset', extra=d)
 
-   would print something like::
+   would print something like  ::
 
       2006-02-08 22:20:02,165 192.168.0.1 fbloggs  Protocol problem: connection reset
 
@@ -817,1211 +177,101 @@
    .. versionadded:: 3.2
       The *stack_info* parameter was added.
 
-.. function:: info(msg, *args, **kwargs)
 
-   Logs a message with level :const:`INFO` on the root logger. The arguments are
-   interpreted as for :func:`debug`.
+.. method:: Logger.info(msg, *args, **kwargs)
 
+   Logs a message with level :const:`INFO` on this logger. The arguments are
+   interpreted as for :meth:`debug`.
 
-.. function:: warning(msg, *args, **kwargs)
 
-   Logs a message with level :const:`WARNING` on the root logger. The arguments are
-   interpreted as for :func:`debug`.
+.. method:: Logger.warning(msg, *args, **kwargs)
 
+   Logs a message with level :const:`WARNING` on this logger. The arguments are
+   interpreted as for :meth:`debug`.
 
-.. function:: error(msg, *args, **kwargs)
 
-   Logs a message with level :const:`ERROR` on the root logger. The arguments are
-   interpreted as for :func:`debug`.
+.. method:: Logger.error(msg, *args, **kwargs)
 
+   Logs a message with level :const:`ERROR` on this logger. The arguments are
+   interpreted as for :meth:`debug`.
 
-.. function:: critical(msg, *args, **kwargs)
 
-   Logs a message with level :const:`CRITICAL` on the root logger. The arguments
-   are interpreted as for :func:`debug`.
+.. method:: Logger.critical(msg, *args, **kwargs)
 
+   Logs a message with level :const:`CRITICAL` on this logger. The arguments are
+   interpreted as for :meth:`debug`.
 
-.. function:: exception(msg, *args)
 
-   Logs a message with level :const:`ERROR` on the root logger. The arguments are
-   interpreted as for :func:`debug`. Exception info is added to the logging
-   message. This function should only be called from an exception handler.
+.. method:: Logger.log(lvl, msg, *args, **kwargs)
 
-.. function:: log(level, msg, *args, **kwargs)
+   Logs a message with integer level *lvl* on this logger. The other arguments are
+   interpreted as for :meth:`debug`.
 
-   Logs a message with level *level* on the root logger. The other arguments are
-   interpreted as for :func:`debug`.
 
-   PLEASE NOTE: The above module-level functions which delegate to the root
-   logger should *not* be used in threads, in versions of Python earlier than
-   2.7.1 and 3.2, unless at least one handler has been added to the root
-   logger *before* the threads are started. These convenience functions call
-   :func:`basicConfig` to ensure that at least one handler is available; in
-   earlier versions of Python, this can (under rare circumstances) lead to
-   handlers being added multiple times to the root logger, which can in turn
-   lead to multiple messages for the same event.
+.. method:: Logger.exception(msg, *args)
 
-.. function:: disable(lvl)
+   Logs a message with level :const:`ERROR` on this logger. The arguments are
+   interpreted as for :meth:`debug`. Exception info is added to the logging
+   message. This method should only be called from an exception handler.
 
-   Provides an overriding level *lvl* for all loggers which takes precedence over
-   the logger's own level. When the need arises to temporarily throttle logging
-   output down across the whole application, this function can be useful. Its
-   effect is to disable all logging calls of severity *lvl* and below, so that
-   if you call it with a value of INFO, then all INFO and DEBUG events would be
-   discarded, whereas those of severity WARNING and above would be processed
-   according to the logger's effective level.
 
+.. method:: Logger.addFilter(filt)
 
-.. function:: addLevelName(lvl, levelName)
+   Adds the specified filter *filt* to this logger.
 
-   Associates level *lvl* with text *levelName* in an internal dictionary, which is
-   used to map numeric levels to a textual representation, for example when a
-   :class:`Formatter` formats a message. This function can also be used to define
-   your own levels. The only constraints are that all levels used must be
-   registered using this function, levels should be positive integers and they
-   should increase in increasing order of severity.
 
-   NOTE: If you are thinking of defining your own levels, please see the section
-   on :ref:`custom-levels`.
+.. method:: Logger.removeFilter(filt)
 
-.. function:: getLevelName(lvl)
+   Removes the specified filter *filt* from this logger.
 
-   Returns the textual representation of logging level *lvl*. If the level is one
-   of the predefined levels :const:`CRITICAL`, :const:`ERROR`, :const:`WARNING`,
-   :const:`INFO` or :const:`DEBUG` then you get the corresponding string. If you
-   have associated levels with names using :func:`addLevelName` then the name you
-   have associated with *lvl* is returned. If a numeric value corresponding to one
-   of the defined levels is passed in, the corresponding string representation is
-   returned. Otherwise, the string "Level %s" % lvl is returned.
 
+.. method:: Logger.filter(record)
 
-.. function:: makeLogRecord(attrdict)
+   Applies this logger's filters to the record and returns a true value if the
+   record is to be processed.
 
-   Creates and returns a new :class:`LogRecord` instance whose attributes are
-   defined by *attrdict*. This function is useful for taking a pickled
-   :class:`LogRecord` attribute dictionary, sent over a socket, and reconstituting
-   it as a :class:`LogRecord` instance at the receiving end.
 
+.. method:: Logger.addHandler(hdlr)
 
-.. function:: basicConfig(**kwargs)
+   Adds the specified handler *hdlr* to this logger.
 
-   Does basic configuration for the logging system by creating a
-   :class:`StreamHandler` with a default :class:`Formatter` and adding it to the
-   root logger. The functions :func:`debug`, :func:`info`, :func:`warning`,
-   :func:`error` and :func:`critical` will call :func:`basicConfig` automatically
-   if no handlers are defined for the root logger.
 
-   This function does nothing if the root logger already has handlers
-   configured for it.
+.. method:: Logger.removeHandler(hdlr)
 
-   PLEASE NOTE: This function should be called from the main thread
-   before other threads are started. In versions of Python prior to
-   2.7.1 and 3.2, if this function is called from multiple threads,
-   it is possible (in rare circumstances) that a handler will be added
-   to the root logger more than once, leading to unexpected results
-   such as messages being duplicated in the log.
+   Removes the specified handler *hdlr* from this logger.
 
-   The following keyword arguments are supported.
 
-   +--------------+---------------------------------------------+
-   | Format       | Description                                 |
-   +==============+=============================================+
-   | ``filename`` | Specifies that a FileHandler be created,    |
-   |              | using the specified filename, rather than a |
-   |              | StreamHandler.                              |
-   +--------------+---------------------------------------------+
-   | ``filemode`` | Specifies the mode to open the file, if     |
-   |              | filename is specified (if filemode is       |
-   |              | unspecified, it defaults to 'a').           |
-   +--------------+---------------------------------------------+
-   | ``format``   | Use the specified format string for the     |
-   |              | handler.                                    |
-   +--------------+---------------------------------------------+
-   | ``datefmt``  | Use the specified date/time format.         |
-   +--------------+---------------------------------------------+
-   | ``style``    | If ``format`` is specified, use this style  |
-   |              | for the format string. One of '%', '{' or   |
-   |              | '$' for %-formatting, :meth:`str.format` or |
-   |              | :class:`string.Template` respectively, and  |
-   |              | defaulting to '%' if not specified.         |
-   +--------------+---------------------------------------------+
-   | ``level``    | Set the root logger level to the specified  |
-   |              | level.                                      |
-   +--------------+---------------------------------------------+
-   | ``stream``   | Use the specified stream to initialize the  |
-   |              | StreamHandler. Note that this argument is   |
-   |              | incompatible with 'filename' - if both are  |
-   |              | present, 'stream' is ignored.               |
-   +--------------+---------------------------------------------+
+.. method:: Logger.findCaller(stack_info=False)
 
-   .. versionchanged:: 3.2
-      The ``style`` argument was added.
+   Finds the caller's source filename and line number. Returns the filename, line
+   number, function name and stack information as a 4-element tuple. The stack
+   information is returned as *None* unless *stack_info* is *True*.
 
 
-.. function:: shutdown()
+.. method:: Logger.handle(record)
 
-   Informs the logging system to perform an orderly shutdown by flushing and
-   closing all handlers. This should be called at application exit and no
-   further use of the logging system should be made after this call.
+   Handles a record by passing it to all handlers associated with this logger and
+   its ancestors (until a false value of *propagate* is found). This method is used
+   for unpickled records received from a socket, as well as those created locally.
+   Logger-level filtering is applied using :meth:`~Logger.filter`.
 
 
-.. function:: setLoggerClass(klass)
+.. method:: Logger.makeRecord(name, lvl, fn, lno, msg, args, exc_info, func=None, extra=None, sinfo=None)
 
-   Tells the logging system to use the class *klass* when instantiating a logger.
-   The class should define :meth:`__init__` such that only a name argument is
-   required, and the :meth:`__init__` should call :meth:`Logger.__init__`. This
-   function is typically called before any loggers are instantiated by applications
-   which need to use custom logger behavior.
+   This is a factory method which can be overridden in subclasses to create
+   specialized :class:`LogRecord` instances.
 
+.. method:: Logger.hasHandlers()
 
-.. seealso::
+   Checks to see if this logger has any handlers configured. This is done by
+   looking for handlers in this logger and its parents in the logger hierarchy.
+   Returns True if a handler was found, else False. The method stops searching
+   up the hierarchy whenever a logger with the 'propagate' attribute set to
+   False is found - that will be the last logger which is checked for the
+   existence of handlers.
 
-   :pep:`282` - A Logging System
-      The proposal which described this feature for inclusion in the Python standard
-      library.
+   .. versionadded:: 3.2
 
-   `Original Python logging package `_
-      This is the original source for the :mod:`logging` package.  The version of the
-      package available from this site is suitable for use with Python 1.5.2, 2.1.x
-      and 2.2.x, which do not include the :mod:`logging` package in the standard
-      library.
-
-.. _logger:
-
-Logger Objects
---------------
-
-Loggers have the following attributes and methods. Note that Loggers are never
-instantiated directly, but always through the module-level function
-``logging.getLogger(name)``.
-
-.. class:: Logger
-
-.. attribute:: Logger.propagate
-
-   If this evaluates to false, logging messages are not passed by this logger or by
-   its child loggers to the handlers of higher level (ancestor) loggers. The
-   constructor sets this attribute to 1.
-
-
-.. method:: Logger.setLevel(lvl)
-
-   Sets the threshold for this logger to *lvl*. Logging messages which are less
-   severe than *lvl* will be ignored. When a logger is created, the level is set to
-   :const:`NOTSET` (which causes all messages to be processed when the logger is
-   the root logger, or delegation to the parent when the logger is a non-root
-   logger). Note that the root logger is created with level :const:`WARNING`.
-
-   The term "delegation to the parent" means that if a logger has a level of
-   NOTSET, its chain of ancestor loggers is traversed until either an ancestor with
-   a level other than NOTSET is found, or the root is reached.
-
-   If an ancestor is found with a level other than NOTSET, then that ancestor's
-   level is treated as the effective level of the logger where the ancestor search
-   began, and is used to determine how a logging event is handled.
-
-   If the root is reached, and it has a level of NOTSET, then all messages will be
-   processed. Otherwise, the root's level will be used as the effective level.
-
-
-.. method:: Logger.isEnabledFor(lvl)
-
-   Indicates if a message of severity *lvl* would be processed by this logger.
-   This method checks first the module-level level set by
-   ``logging.disable(lvl)`` and then the logger's effective level as determined
-   by :meth:`getEffectiveLevel`.
-
-
-.. method:: Logger.getEffectiveLevel()
-
-   Indicates the effective level for this logger. If a value other than
-   :const:`NOTSET` has been set using :meth:`setLevel`, it is returned. Otherwise,
-   the hierarchy is traversed towards the root until a value other than
-   :const:`NOTSET` is found, and that value is returned.
-
-
-.. method:: Logger.getChild(suffix)
-
-   Returns a logger which is a descendant to this logger, as determined by the suffix.
-   Thus, ``logging.getLogger('abc').getChild('def.ghi')`` would return the same
-   logger as would be returned by ``logging.getLogger('abc.def.ghi')``. This is a
-   convenience method, useful when the parent logger is named using e.g. ``__name__``
-   rather than a literal string.
-
-   .. versionadded:: 3.2
-
-
-.. method:: Logger.debug(msg, *args, **kwargs)
-
-   Logs a message with level :const:`DEBUG` on this logger. The *msg* is the
-   message format string, and the *args* are the arguments which are merged into
-   *msg* using the string formatting operator. (Note that this means that you can
-   use keywords in the format string, together with a single dictionary argument.)
-
-   There are three keyword arguments in *kwargs* which are inspected: *exc_info*
-   which, if it does not evaluate as false, causes exception information to be
-   added to the logging message. If an exception tuple (in the format returned by
-   :func:`sys.exc_info`) is provided, it is used; otherwise, :func:`sys.exc_info`
-   is called to get the exception information.
-
-   The second optional keyword argument is *stack_info*, which defaults to
-   False. If specified as True, stack information is added to the logging
-   message, including the actual logging call. Note that this is not the same
-   stack information as that displayed through specifying *exc_info*: The
-   former is stack frames from the bottom of the stack up to the logging call
-   in the current thread, whereas the latter is information about stack frames
-   which have been unwound, following an exception, while searching for
-   exception handlers.
-
-   You can specify *stack_info* independently of *exc_info*, e.g. to just show
-   how you got to a certain point in your code, even when no exceptions were
-   raised. The stack frames are printed following a header line which says::
-
-       Stack (most recent call last):
-
-   This mimics the `Traceback (most recent call last):` which is used when
-   displaying exception frames.
-
-   The third keyword argument is *extra* which can be used to pass a
-   dictionary which is used to populate the __dict__ of the LogRecord created for
-   the logging event with user-defined attributes. These custom attributes can then
-   be used as you like. For example, they could be incorporated into logged
-   messages. For example::
-
-      FORMAT = "%(asctime)-15s %(clientip)s %(user)-8s %(message)s"
-      logging.basicConfig(format=FORMAT)
-      d = { 'clientip' : '192.168.0.1', 'user' : 'fbloggs' }
-      logger = logging.getLogger("tcpserver")
-      logger.warning("Protocol problem: %s", "connection reset", extra=d)
-
-   would print something like  ::
-
-      2006-02-08 22:20:02,165 192.168.0.1 fbloggs  Protocol problem: connection reset
-
-   The keys in the dictionary passed in *extra* should not clash with the keys used
-   by the logging system. (See the :class:`Formatter` documentation for more
-   information on which keys are used by the logging system.)
-
-   If you choose to use these attributes in logged messages, you need to exercise
-   some care. In the above example, for instance, the :class:`Formatter` has been
-   set up with a format string which expects 'clientip' and 'user' in the attribute
-   dictionary of the LogRecord. If these are missing, the message will not be
-   logged because a string formatting exception will occur. So in this case, you
-   always need to pass the *extra* dictionary with these keys.
-
-   While this might be annoying, this feature is intended for use in specialized
-   circumstances, such as multi-threaded servers where the same code executes in
-   many contexts, and interesting conditions which arise are dependent on this
-   context (such as remote client IP address and authenticated user name, in the
-   above example). In such circumstances, it is likely that specialized
-   :class:`Formatter`\ s would be used with particular :class:`Handler`\ s.
-
-   .. versionadded:: 3.2
-      The *stack_info* parameter was added.
-
-
-.. method:: Logger.info(msg, *args, **kwargs)
-
-   Logs a message with level :const:`INFO` on this logger. The arguments are
-   interpreted as for :meth:`debug`.
-
-
-.. method:: Logger.warning(msg, *args, **kwargs)
-
-   Logs a message with level :const:`WARNING` on this logger. The arguments are
-   interpreted as for :meth:`debug`.
-
-
-.. method:: Logger.error(msg, *args, **kwargs)
-
-   Logs a message with level :const:`ERROR` on this logger. The arguments are
-   interpreted as for :meth:`debug`.
-
-
-.. method:: Logger.critical(msg, *args, **kwargs)
-
-   Logs a message with level :const:`CRITICAL` on this logger. The arguments are
-   interpreted as for :meth:`debug`.
-
-
-.. method:: Logger.log(lvl, msg, *args, **kwargs)
-
-   Logs a message with integer level *lvl* on this logger. The other arguments are
-   interpreted as for :meth:`debug`.
-
-
-.. method:: Logger.exception(msg, *args)
-
-   Logs a message with level :const:`ERROR` on this logger. The arguments are
-   interpreted as for :meth:`debug`. Exception info is added to the logging
-   message. This method should only be called from an exception handler.
-
-
-.. method:: Logger.addFilter(filt)
-
-   Adds the specified filter *filt* to this logger.
-
-
-.. method:: Logger.removeFilter(filt)
-
-   Removes the specified filter *filt* from this logger.
-
-
-.. method:: Logger.filter(record)
-
-   Applies this logger's filters to the record and returns a true value if the
-   record is to be processed.
-
-
-.. method:: Logger.addHandler(hdlr)
-
-   Adds the specified handler *hdlr* to this logger.
-
-
-.. method:: Logger.removeHandler(hdlr)
-
-   Removes the specified handler *hdlr* from this logger.
-
-
-.. method:: Logger.findCaller(stack_info=False)
-
-   Finds the caller's source filename and line number. Returns the filename, line
-   number, function name and stack information as a 4-element tuple. The stack
-   information is returned as *None* unless *stack_info* is *True*.
-
-
-.. method:: Logger.handle(record)
-
-   Handles a record by passing it to all handlers associated with this logger and
-   its ancestors (until a false value of *propagate* is found). This method is used
-   for unpickled records received from a socket, as well as those created locally.
-   Logger-level filtering is applied using :meth:`~Logger.filter`.
-
-
-.. method:: Logger.makeRecord(name, lvl, fn, lno, msg, args, exc_info, func=None, extra=None, sinfo=None)
-
-   This is a factory method which can be overridden in subclasses to create
-   specialized :class:`LogRecord` instances.
-
-.. method:: Logger.hasHandlers()
-
-   Checks to see if this logger has any handlers configured. This is done by
-   looking for handlers in this logger and its parents in the logger hierarchy.
-   Returns True if a handler was found, else False. The method stops searching
-   up the hierarchy whenever a logger with the "propagate" attribute set to
-   False is found - that will be the last logger which is checked for the
-   existence of handlers.
-
-.. versionadded:: 3.2
-
-The :meth:`hasHandlers` method was not present in previous versions.
-
-.. _minimal-example:
-
-Basic example
--------------
-
-The :mod:`logging` package provides a lot of flexibility, and its configuration
-can appear daunting.  This section demonstrates that simple use of the logging
-package is possible.
-
-The simplest example shows logging to the console::
-
-   import logging
-
-   logging.debug('A debug message')
-   logging.info('Some information')
-   logging.warning('A shot across the bows')
-
-If you run the above script, you'll see this::
-
-   WARNING:root:A shot across the bows
-
-Because no particular logger was specified, the system used the root logger. The
-debug and info messages didn't appear because by default, the root logger is
-configured to only handle messages with a severity of WARNING or above. The
-message format is also a configuration default, as is the output destination of
-the messages - ``sys.stderr``. The severity level, the message format and
-destination can be easily changed, as shown in the example below::
-
-   import logging
-
-   logging.basicConfig(level=logging.DEBUG,
-                       format='%(asctime)s %(levelname)s %(message)s',
-                       filename='myapp.log',
-                       filemode='w')
-   logging.debug('A debug message')
-   logging.info('Some information')
-   logging.warning('A shot across the bows')
-
-The :meth:`basicConfig` method is used to change the configuration defaults,
-which results in output (written to ``myapp.log``) which should look
-something like the following::
-
-   2004-07-02 13:00:08,743 DEBUG A debug message
-   2004-07-02 13:00:08,743 INFO Some information
-   2004-07-02 13:00:08,743 WARNING A shot across the bows
-
-This time, all messages with a severity of DEBUG or above were handled, and the
-format of the messages was also changed, and output went to the specified file
-rather than the console.
-
-.. XXX logging should probably be updated for new string formatting!
-
-Formatting uses the old Python string formatting - see section
-:ref:`old-string-formatting`. The format string takes the following common
-specifiers. For a complete list of specifiers, consult the :class:`Formatter`
-documentation.
-
-+-------------------+-----------------------------------------------+
-| Format            | Description                                   |
-+===================+===============================================+
-| ``%(name)s``      | Name of the logger (logging channel).         |
-+-------------------+-----------------------------------------------+
-| ``%(levelname)s`` | Text logging level for the message            |
-|                   | (``'DEBUG'``, ``'INFO'``, ``'WARNING'``,      |
-|                   | ``'ERROR'``, ``'CRITICAL'``).                 |
-+-------------------+-----------------------------------------------+
-| ``%(asctime)s``   | Human-readable time when the                  |
-|                   | :class:`LogRecord` was created.  By default   |
-|                   | this is of the form "2003-07-08 16:49:45,896" |
-|                   | (the numbers after the comma are millisecond  |
-|                   | portion of the time).                         |
-+-------------------+-----------------------------------------------+
-| ``%(message)s``   | The logged message.                           |
-+-------------------+-----------------------------------------------+
-
-To change the date/time format, you can pass an additional keyword parameter,
-*datefmt*, as in the following::
-
-   import logging
-
-   logging.basicConfig(level=logging.DEBUG,
-                       format='%(asctime)s %(levelname)-8s %(message)s',
-                       datefmt='%a, %d %b %Y %H:%M:%S',
-                       filename='/temp/myapp.log',
-                       filemode='w')
-   logging.debug('A debug message')
-   logging.info('Some information')
-   logging.warning('A shot across the bows')
-
-which would result in output like ::
-
-   Fri, 02 Jul 2004 13:06:18 DEBUG    A debug message
-   Fri, 02 Jul 2004 13:06:18 INFO     Some information
-   Fri, 02 Jul 2004 13:06:18 WARNING  A shot across the bows
-
-The date format string follows the requirements of :func:`strftime` - see the
-documentation for the :mod:`time` module.
-
-If, instead of sending logging output to the console or a file, you'd rather use
-a file-like object which you have created separately, you can pass it to
-:func:`basicConfig` using the *stream* keyword argument. Note that if both
-*stream* and *filename* keyword arguments are passed, the *stream* argument is
-ignored.
-
-Of course, you can put variable information in your output. To do this, simply
-have the message be a format string and pass in additional arguments containing
-the variable information, as in the following example::
-
-   import logging
-
-   logging.basicConfig(level=logging.DEBUG,
-                       format='%(asctime)s %(levelname)-8s %(message)s',
-                       datefmt='%a, %d %b %Y %H:%M:%S',
-                       filename='/temp/myapp.log',
-                       filemode='w')
-   logging.error('Pack my box with %d dozen %s', 5, 'liquor jugs')
-
-which would result in ::
-
-   Wed, 21 Jul 2004 15:35:16 ERROR    Pack my box with 5 dozen liquor jugs
-
-
-.. _multiple-destinations:
-
-Logging to multiple destinations
---------------------------------
-
-Let's say you want to log to console and file with different message formats and
-in differing circumstances. Say you want to log messages with levels of DEBUG
-and higher to file, and those messages at level INFO and higher to the console.
-Let's also assume that the file should contain timestamps, but the console
-messages should not. Here's how you can achieve this::
-
-   import logging
-
-   # set up logging to file - see previous section for more details
-   logging.basicConfig(level=logging.DEBUG,
-                       format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
-                       datefmt='%m-%d %H:%M',
-                       filename='/temp/myapp.log',
-                       filemode='w')
-   # define a Handler which writes INFO messages or higher to the sys.stderr
-   console = logging.StreamHandler()
-   console.setLevel(logging.INFO)
-   # set a format which is simpler for console use
-   formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
-   # tell the handler to use this format
-   console.setFormatter(formatter)
-   # add the handler to the root logger
-   logging.getLogger('').addHandler(console)
-
-   # Now, we can log to the root logger, or any other logger. First the root...
-   logging.info('Jackdaws love my big sphinx of quartz.')
-
-   # Now, define a couple of other loggers which might represent areas in your
-   # application:
-
-   logger1 = logging.getLogger('myapp.area1')
-   logger2 = logging.getLogger('myapp.area2')
-
-   logger1.debug('Quick zephyrs blow, vexing daft Jim.')
-   logger1.info('How quickly daft jumping zebras vex.')
-   logger2.warning('Jail zesty vixen who grabbed pay from quack.')
-   logger2.error('The five boxing wizards jump quickly.')
-
-When you run this, on the console you will see ::
-
-   root        : INFO     Jackdaws love my big sphinx of quartz.
-   myapp.area1 : INFO     How quickly daft jumping zebras vex.
-   myapp.area2 : WARNING  Jail zesty vixen who grabbed pay from quack.
-   myapp.area2 : ERROR    The five boxing wizards jump quickly.
-
-and in the file you will see something like ::
-
-   10-22 22:19 root         INFO     Jackdaws love my big sphinx of quartz.
-   10-22 22:19 myapp.area1  DEBUG    Quick zephyrs blow, vexing daft Jim.
-   10-22 22:19 myapp.area1  INFO     How quickly daft jumping zebras vex.
-   10-22 22:19 myapp.area2  WARNING  Jail zesty vixen who grabbed pay from quack.
-   10-22 22:19 myapp.area2  ERROR    The five boxing wizards jump quickly.
-
-As you can see, the DEBUG message only shows up in the file. The other messages
-are sent to both destinations.
-
-This example uses console and file handlers, but you can use any number and
-combination of handlers you choose.
-
-.. _logging-exceptions:
-
-Exceptions raised during logging
---------------------------------
-
-The logging package is designed to swallow exceptions which occur while logging
-in production. This is so that errors which occur while handling logging events
-- such as logging misconfiguration, network or other similar errors - do not
-cause the application using logging to terminate prematurely.
-
-:class:`SystemExit` and :class:`KeyboardInterrupt` exceptions are never
-swallowed. Other exceptions which occur during the :meth:`emit` method of a
-:class:`Handler` subclass are passed to its :meth:`handleError` method.
-
-The default implementation of :meth:`handleError` in :class:`Handler` checks
-to see if a module-level variable, :data:`raiseExceptions`, is set. If set, a
-traceback is printed to :data:`sys.stderr`. If not set, the exception is swallowed.
-
-**Note:** The default value of :data:`raiseExceptions` is ``True``. This is because
-during development, you typically want to be notified of any exceptions that
-occur. It's advised that you set :data:`raiseExceptions` to ``False`` for production
-usage.
-
-.. _context-info:
-
-Adding contextual information to your logging output
-----------------------------------------------------
-
-Sometimes you want logging output to contain contextual information in
-addition to the parameters passed to the logging call. For example, in a
-networked application, it may be desirable to log client-specific information
-in the log (e.g. remote client's username, or IP address). Although you could
-use the *extra* parameter to achieve this, it's not always convenient to pass
-the information in this way. While it might be tempting to create
-:class:`Logger` instances on a per-connection basis, this is not a good idea
-because these instances are not garbage collected. While this is not a problem
-in practice, when the number of :class:`Logger` instances is dependent on the
-level of granularity you want to use in logging an application, it could
-be hard to manage if the number of :class:`Logger` instances becomes
-effectively unbounded.
-
-
-Using LoggerAdapters to impart contextual information
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-An easy way in which you can pass contextual information to be output along
-with logging event information is to use the :class:`LoggerAdapter` class.
-This class is designed to look like a :class:`Logger`, so that you can call
-:meth:`debug`, :meth:`info`, :meth:`warning`, :meth:`error`,
-:meth:`exception`, :meth:`critical` and :meth:`log`. These methods have the
-same signatures as their counterparts in :class:`Logger`, so you can use the
-two types of instances interchangeably.
-
-When you create an instance of :class:`LoggerAdapter`, you pass it a
-:class:`Logger` instance and a dict-like object which contains your contextual
-information. When you call one of the logging methods on an instance of
-:class:`LoggerAdapter`, it delegates the call to the underlying instance of
-:class:`Logger` passed to its constructor, and arranges to pass the contextual
-information in the delegated call. Here's a snippet from the code of
-:class:`LoggerAdapter`::
-
-    def debug(self, msg, *args, **kwargs):
-        """
-        Delegate a debug call to the underlying logger, after adding
-        contextual information from this adapter instance.
-        """
-        msg, kwargs = self.process(msg, kwargs)
-        self.logger.debug(msg, *args, **kwargs)
-
-The :meth:`process` method of :class:`LoggerAdapter` is where the contextual
-information is added to the logging output. It's passed the message and
-keyword arguments of the logging call, and it passes back (potentially)
-modified versions of these to use in the call to the underlying logger. The
-default implementation of this method leaves the message alone, but inserts
-an "extra" key in the keyword argument whose value is the dict-like object
-passed to the constructor. Of course, if you had passed an "extra" keyword
-argument in the call to the adapter, it will be silently overwritten.
-
-The advantage of using "extra" is that the values in the dict-like object are
-merged into the :class:`LogRecord` instance's __dict__, allowing you to use
-customized strings with your :class:`Formatter` instances which know about
-the keys of the dict-like object. If you need a different method, e.g. if you
-want to prepend or append the contextual information to the message string,
-you just need to subclass :class:`LoggerAdapter` and override :meth:`process`
-to do what you need. Here's an example script which uses this class, which
-also illustrates what dict-like behaviour is needed from an arbitrary
-"dict-like" object for use in the constructor::
-
-   import logging
-
-   class ConnInfo:
-       """
-       An example class which shows how an arbitrary class can be used as
-       the 'extra' context information repository passed to a LoggerAdapter.
-       """
-
-       def __getitem__(self, name):
-           """
-           To allow this instance to look like a dict.
-           """
-           from random import choice
-           if name == "ip":
-               result = choice(["127.0.0.1", "192.168.0.1"])
-           elif name == "user":
-               result = choice(["jim", "fred", "sheila"])
-           else:
-               result = self.__dict__.get(name, "?")
-           return result
-
-       def __iter__(self):
-           """
-           To allow iteration over keys, which will be merged into
-           the LogRecord dict before formatting and output.
-           """
-           keys = ["ip", "user"]
-           keys.extend(self.__dict__.keys())
-           return keys.__iter__()
-
-   if __name__ == "__main__":
-       from random import choice
-       levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL)
-       a1 = logging.LoggerAdapter(logging.getLogger("a.b.c"),
-                                  { "ip" : "123.231.231.123", "user" : "sheila" })
-       logging.basicConfig(level=logging.DEBUG,
-                           format="%(asctime)-15s %(name)-5s %(levelname)-8s IP: %(ip)-15s User: %(user)-8s %(message)s")
-       a1.debug("A debug message")
-       a1.info("An info message with %s", "some parameters")
-       a2 = logging.LoggerAdapter(logging.getLogger("d.e.f"), ConnInfo())
-       for x in range(10):
-           lvl = choice(levels)
-           lvlname = logging.getLevelName(lvl)
-           a2.log(lvl, "A message at %s level with %d %s", lvlname, 2, "parameters")
-
-When this script is run, the output should look something like this::
-
-   2008-01-18 14:49:54,023 a.b.c DEBUG    IP: 123.231.231.123 User: sheila   A debug message
-   2008-01-18 14:49:54,023 a.b.c INFO     IP: 123.231.231.123 User: sheila   An info message with some parameters
-   2008-01-18 14:49:54,023 d.e.f CRITICAL IP: 192.168.0.1     User: jim      A message at CRITICAL level with 2 parameters
-   2008-01-18 14:49:54,033 d.e.f INFO     IP: 192.168.0.1     User: jim      A message at INFO level with 2 parameters
-   2008-01-18 14:49:54,033 d.e.f WARNING  IP: 192.168.0.1     User: sheila   A message at WARNING level with 2 parameters
-   2008-01-18 14:49:54,033 d.e.f ERROR    IP: 127.0.0.1       User: fred     A message at ERROR level with 2 parameters
-   2008-01-18 14:49:54,033 d.e.f ERROR    IP: 127.0.0.1       User: sheila   A message at ERROR level with 2 parameters
-   2008-01-18 14:49:54,033 d.e.f WARNING  IP: 192.168.0.1     User: sheila   A message at WARNING level with 2 parameters
-   2008-01-18 14:49:54,033 d.e.f WARNING  IP: 192.168.0.1     User: jim      A message at WARNING level with 2 parameters
-   2008-01-18 14:49:54,033 d.e.f INFO     IP: 192.168.0.1     User: fred     A message at INFO level with 2 parameters
-   2008-01-18 14:49:54,033 d.e.f WARNING  IP: 192.168.0.1     User: sheila   A message at WARNING level with 2 parameters
-   2008-01-18 14:49:54,033 d.e.f WARNING  IP: 127.0.0.1       User: jim      A message at WARNING level with 2 parameters
-
-
-.. _filters-contextual:
-
-Using Filters to impart contextual information
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-You can also add contextual information to log output using a user-defined
-:class:`Filter`. ``Filter`` instances are allowed to modify the ``LogRecords``
-passed to them, including adding additional attributes which can then be output
-using a suitable format string, or if needed a custom :class:`Formatter`.
-
-For example in a web application, the request being processed (or at least,
-the interesting parts of it) can be stored in a threadlocal
-(:class:`threading.local`) variable, and then accessed from a ``Filter`` to
-add, say, information from the request - say, the remote IP address and remote
-user's username - to the ``LogRecord``, using the attribute names 'ip' and
-'user' as in the ``LoggerAdapter`` example above. In that case, the same format
-string can be used to get similar output to that shown above. Here's an example
-script::
-
-    import logging
-    from random import choice
-
-    class ContextFilter(logging.Filter):
-        """
-        This is a filter which injects contextual information into the log.
-
-        Rather than use actual contextual information, we just use random
-        data in this demo.
-        """
-
-        USERS = ['jim', 'fred', 'sheila']
-        IPS = ['123.231.231.123', '127.0.0.1', '192.168.0.1']
-
-        def filter(self, record):
-
-            record.ip = choice(ContextFilter.IPS)
-            record.user = choice(ContextFilter.USERS)
-            return True
-
-    if __name__ == "__main__":
-       levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL)
-       a1 = logging.LoggerAdapter(logging.getLogger("a.b.c"),
-                                  { "ip" : "123.231.231.123", "user" : "sheila" })
-       logging.basicConfig(level=logging.DEBUG,
-                           format="%(asctime)-15s %(name)-5s %(levelname)-8s IP: %(ip)-15s User: %(user)-8s %(message)s")
-       a1 = logging.getLogger("a.b.c")
-       a2 = logging.getLogger("d.e.f")
-
-       f = ContextFilter()
-       a1.addFilter(f)
-       a2.addFilter(f)
-       a1.debug("A debug message")
-       a1.info("An info message with %s", "some parameters")
-       for x in range(10):
-           lvl = choice(levels)
-           lvlname = logging.getLevelName(lvl)
-           a2.log(lvl, "A message at %s level with %d %s", lvlname, 2, "parameters")
-
-which, when run, produces something like::
-
-    2010-09-06 22:38:15,292 a.b.c DEBUG    IP: 123.231.231.123 User: fred     A debug message
-    2010-09-06 22:38:15,300 a.b.c INFO     IP: 192.168.0.1     User: sheila   An info message with some parameters
-    2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1       User: sheila   A message at CRITICAL level with 2 parameters
-    2010-09-06 22:38:15,300 d.e.f ERROR    IP: 127.0.0.1       User: jim      A message at ERROR level with 2 parameters
-    2010-09-06 22:38:15,300 d.e.f DEBUG    IP: 127.0.0.1       User: sheila   A message at DEBUG level with 2 parameters
-    2010-09-06 22:38:15,300 d.e.f ERROR    IP: 123.231.231.123 User: fred     A message at ERROR level with 2 parameters
-    2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 192.168.0.1     User: jim      A message at CRITICAL level with 2 parameters
-    2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1       User: sheila   A message at CRITICAL level with 2 parameters
-    2010-09-06 22:38:15,300 d.e.f DEBUG    IP: 192.168.0.1     User: jim      A message at DEBUG level with 2 parameters
-    2010-09-06 22:38:15,301 d.e.f ERROR    IP: 127.0.0.1       User: sheila   A message at ERROR level with 2 parameters
-    2010-09-06 22:38:15,301 d.e.f DEBUG    IP: 123.231.231.123 User: fred     A message at DEBUG level with 2 parameters
-    2010-09-06 22:38:15,301 d.e.f INFO     IP: 123.231.231.123 User: fred     A message at INFO level with 2 parameters
-
-
-.. _multiple-processes:
-
-Logging to a single file from multiple processes
-------------------------------------------------
-
-Although logging is thread-safe, and logging to a single file from multiple
-threads in a single process *is* supported, logging to a single file from
-*multiple processes* is *not* supported, because there is no standard way to
-serialize access to a single file across multiple processes in Python. If you
-need to log to a single file from multiple processes, one way of doing this is
-to have all the processes log to a :class:`SocketHandler`, and have a separate
-process which implements a socket server which reads from the socket and logs
-to file. (If you prefer, you can dedicate one thread in one of the existing
-processes to perform this function.) The following section documents this
-approach in more detail and includes a working socket receiver which can be
-used as a starting point for you to adapt in your own applications.
-
-If you are using a recent version of Python which includes the
-:mod:`multiprocessing` module, you could write your own handler which uses the
-:class:`Lock` class from this module to serialize access to the file from
-your processes. The existing :class:`FileHandler` and subclasses do not make
-use of :mod:`multiprocessing` at present, though they may do so in the future.
-Note that at present, the :mod:`multiprocessing` module does not provide
-working lock functionality on all platforms (see
-http://bugs.python.org/issue3770).
-
-.. currentmodule:: logging.handlers
-
-Alternatively, you can use a ``Queue`` and a :class:`QueueHandler` to send
-all logging events to one of the processes in your multi-process application.
-The following example script demonstrates how you can do this; in the example
-a separate listener process listens for events sent by other processes and logs
-them according to its own logging configuration. Although the example only
-demonstrates one way of doing it (for example, you may want to use a listener
-thread rather than a separate listener process - the implementation would be
-analogous) it does allow for completely different logging configurations for
-the listener and the other processes in your application, and can be used as
-the basis for code meeting your own specific requirements::
-
-    # You'll need these imports in your own code
-    import logging
-    import logging.handlers
-    import multiprocessing
-
-    # Next two import lines for this demo only
-    from random import choice, random
-    import time
-
-    #
-    # Because you'll want to define the logging configurations for listener and workers, the
-    # listener and worker process functions take a configurer parameter which is a callable
-    # for configuring logging for that process. These functions are also passed the queue,
-    # which they use for communication.
-    #
-    # In practice, you can configure the listener however you want, but note that in this
-    # simple example, the listener does not apply level or filter logic to received records.
-    # In practice, you would probably want to do ths logic in the worker processes, to avoid
-    # sending events which would be filtered out between processes.
-    #
-    # The size of the rotated files is made small so you can see the results easily.
-    def listener_configurer():
-        root = logging.getLogger()
-        h = logging.handlers.RotatingFileHandler('/tmp/mptest.log', 'a', 300, 10)
-        f = logging.Formatter('%(asctime)s %(processName)-10s %(name)s %(levelname)-8s %(message)s')
-        h.setFormatter(f)
-        root.addHandler(h)
-
-    # This is the listener process top-level loop: wait for logging events
-    # (LogRecords)on the queue and handle them, quit when you get a None for a
-    # LogRecord.
-    def listener_process(queue, configurer):
-        configurer()
-        while True:
-            try:
-                record = queue.get()
-                if record is None: # We send this as a sentinel to tell the listener to quit.
-                    break
-                logger = logging.getLogger(record.name)
-                logger.handle(record) # No level or filter logic applied - just do it!
-            except (KeyboardInterrupt, SystemExit):
-                raise
-            except:
-                import sys, traceback
-                print >> sys.stderr, 'Whoops! Problem:'
-                traceback.print_exc(file=sys.stderr)
-
-    # Arrays used for random selections in this demo
-
-    LEVELS = [logging.DEBUG, logging.INFO, logging.WARNING,
-              logging.ERROR, logging.CRITICAL]
-
-    LOGGERS = ['a.b.c', 'd.e.f']
-
-    MESSAGES = [
-        'Random message #1',
-        'Random message #2',
-        'Random message #3',
-    ]
-
-    # The worker configuration is done at the start of the worker process run.
-    # Note that on Windows you can't rely on fork semantics, so each process
-    # will run the logging configuration code when it starts.
-    def worker_configurer(queue):
-        h = logging.handlers.QueueHandler(queue) # Just the one handler needed
-        root = logging.getLogger()
-        root.addHandler(h)
-        root.setLevel(logging.DEBUG) # send all messages, for demo; no other level or filter logic applied.
-
-    # This is the worker process top-level loop, which just logs ten events with
-    # random intervening delays before terminating.
-    # The print messages are just so you know it's doing something!
-    def worker_process(queue, configurer):
-        configurer(queue)
-        name = multiprocessing.current_process().name
-        print('Worker started: %s' % name)
-        for i in range(10):
-            time.sleep(random())
-            logger = logging.getLogger(choice(LOGGERS))
-            level = choice(LEVELS)
-            message = choice(MESSAGES)
-            logger.log(level, message)
-        print('Worker finished: %s' % name)
-
-    # Here's where the demo gets orchestrated. Create the queue, create and start
-    # the listener, create ten workers and start them, wait for them to finish,
-    # then send a None to the queue to tell the listener to finish.
-    def main():
-        queue = multiprocessing.Queue(-1)
-        listener = multiprocessing.Process(target=listener_process,
-                                           args=(queue, listener_configurer))
-        listener.start()
-        workers = []
-        for i in range(10):
-            worker = multiprocessing.Process(target=worker_process,
-                                           args=(queue, worker_configurer))
-            workers.append(worker)
-            worker.start()
-        for w in workers:
-            w.join()
-        queue.put_nowait(None)
-        listener.join()
-
-    if __name__ == '__main__':
-        main()
-
-
-.. currentmodule:: logging
-
-
-.. _network-logging:
-
-Sending and receiving logging events across a network
------------------------------------------------------
-
-Let's say you want to send logging events across a network, and handle them at
-the receiving end. A simple way of doing this is attaching a
-:class:`SocketHandler` instance to the root logger at the sending end::
-
-   import logging, logging.handlers
-
-   rootLogger = logging.getLogger('')
-   rootLogger.setLevel(logging.DEBUG)
-   socketHandler = logging.handlers.SocketHandler('localhost',
-                       logging.handlers.DEFAULT_TCP_LOGGING_PORT)
-   # don't bother with a formatter, since a socket handler sends the event as
-   # an unformatted pickle
-   rootLogger.addHandler(socketHandler)
-
-   # Now, we can log to the root logger, or any other logger. First the root...
-   logging.info('Jackdaws love my big sphinx of quartz.')
-
-   # Now, define a couple of other loggers which might represent areas in your
-   # application:
-
-   logger1 = logging.getLogger('myapp.area1')
-   logger2 = logging.getLogger('myapp.area2')
-
-   logger1.debug('Quick zephyrs blow, vexing daft Jim.')
-   logger1.info('How quickly daft jumping zebras vex.')
-   logger2.warning('Jail zesty vixen who grabbed pay from quack.')
-   logger2.error('The five boxing wizards jump quickly.')
-
-At the receiving end, you can set up a receiver using the :mod:`socketserver`
-module. Here is a basic working example::
-
-   import pickle
-   import logging
-   import logging.handlers
-   import socketserver
-   import struct
-
-
-   class LogRecordStreamHandler(socketserver.StreamRequestHandler):
-       """Handler for a streaming logging request.
-
-       This basically logs the record using whatever logging policy is
-       configured locally.
-       """
-
-       def handle(self):
-           """
-           Handle multiple requests - each expected to be a 4-byte length,
-           followed by the LogRecord in pickle format. Logs the record
-           according to whatever policy is configured locally.
-           """
-           while True:
-               chunk = self.connection.recv(4)
-               if len(chunk) < 4:
-                   break
-               slen = struct.unpack(">L", chunk)[0]
-               chunk = self.connection.recv(slen)
-               while len(chunk) < slen:
-                   chunk = chunk + self.connection.recv(slen - len(chunk))
-               obj = self.unPickle(chunk)
-               record = logging.makeLogRecord(obj)
-               self.handleLogRecord(record)
-
-       def unPickle(self, data):
-           return pickle.loads(data)
-
-       def handleLogRecord(self, record):
-           # if a name is specified, we use the named logger rather than the one
-           # implied by the record.
-           if self.server.logname is not None:
-               name = self.server.logname
-           else:
-               name = record.name
-           logger = logging.getLogger(name)
-           # N.B. EVERY record gets logged. This is because Logger.handle
-           # is normally called AFTER logger-level filtering. If you want
-           # to do filtering, do it at the client end to save wasting
-           # cycles and network bandwidth!
-           logger.handle(record)
-
-   class LogRecordSocketReceiver(socketserver.ThreadingTCPServer):
-       """simple TCP socket-based logging receiver suitable for testing.
-       """
-
-       allow_reuse_address = 1
-
-       def __init__(self, host='localhost',
-                    port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,
-                    handler=LogRecordStreamHandler):
-           socketserver.ThreadingTCPServer.__init__(self, (host, port), handler)
-           self.abort = 0
-           self.timeout = 1
-           self.logname = None
-
-       def serve_until_stopped(self):
-           import select
-           abort = 0
-           while not abort:
-               rd, wr, ex = select.select([self.socket.fileno()],
-                                          [], [],
-                                          self.timeout)
-               if rd:
-                   self.handle_request()
-               abort = self.abort
-
-   def main():
-       logging.basicConfig(
-           format="%(relativeCreated)5d %(name)-15s %(levelname)-8s %(message)s")
-       tcpserver = LogRecordSocketReceiver()
-       print("About to start TCP server...")
-       tcpserver.serve_until_stopped()
-
-   if __name__ == "__main__":
-       main()
-
-First run the server, and then the client. On the client side, nothing is
-printed on the console; on the server side, you should see something like::
-
-   About to start TCP server...
-      59 root            INFO     Jackdaws love my big sphinx of quartz.
-      59 myapp.area1     DEBUG    Quick zephyrs blow, vexing daft Jim.
-      69 myapp.area1     INFO     How quickly daft jumping zebras vex.
-      69 myapp.area2     WARNING  Jail zesty vixen who grabbed pay from quack.
-      69 myapp.area2     ERROR    The five boxing wizards jump quickly.
-
-Note that there are some security issues with pickle in some scenarios. If
-these affect you, you can use an alternative serialization scheme by overriding
-the :meth:`makePickle` method and implementing your alternative there, as
-well as adapting the above script to use your alternative serialization.
-
-.. _arbitrary-object-messages:
-
-Using arbitrary objects as messages
------------------------------------
-
-In the preceding sections and examples, it has been assumed that the message
-passed when logging the event is a string. However, this is not the only
-possibility. You can pass an arbitrary object as a message, and its
-:meth:`__str__` method will be called when the logging system needs to convert
-it to a string representation. In fact, if you want to, you can avoid
-computing a string representation altogether - for example, the
-:class:`SocketHandler` emits an event by pickling it and sending it over the
-wire.
-
-Dealing with handlers that block
---------------------------------
-
-.. currentmodule:: logging.handlers
-
-Sometimes you have to get your logging handlers to do their work without
-blocking the thread you???re logging from. This is common in Web applications,
-though of course it also occurs in other scenarios.
-
-A common culprit which demonstrates sluggish behaviour is the
-:class:`SMTPHandler`: sending emails can take a long time, for a
-number of reasons outside the developer???s control (for example, a poorly
-performing mail or network infrastructure). But almost any network-based
-handler can block: Even a :class:`SocketHandler` operation may do a
-DNS query under the hood which is too slow (and this query can be deep in the
-socket library code, below the Python layer, and outside your control).
-
-One solution is to use a two-part approach. For the first part, attach only a
-:class:`QueueHandler` to those loggers which are accessed from
-performance-critical threads. They simply write to their queue, which can be
-sized to a large enough capacity or initialized with no upper bound to their
-size. The write to the queue will typically be accepted quickly, though you
-will probably need to catch the :ref:`queue.Full` exception as a precaution
-in your code. If you are a library developer who has performance-critical
-threads in their code, be sure to document this (together with a suggestion to
-attach only ``QueueHandlers`` to your loggers) for the benefit of other
-developers who will use your code.
-
-The second part of the solution is :class:`QueueListener`, which has been
-designed as the counterpart to :class:`QueueHandler`.  A
-:class:`QueueListener` is very simple: it???s passed a queue and some handlers,
-and it fires up an internal thread which listens to its queue for LogRecords
-sent from ``QueueHandlers`` (or any other source of ``LogRecords``, for that
-matter). The ``LogRecords`` are removed from the queue and passed to the
-handlers for processing.
-
-The advantage of having a separate :class:`QueueListener` class is that you
-can use the same instance to service multiple ``QueueHandlers``. This is more
-resource-friendly than, say, having threaded versions of the existing handler
-classes, which would eat up one thread per handler for no particular benefit.
-
-An example of using these two classes follows (imports omitted)::
-
-    que = queue.Queue(-1) # no limit on size
-    queue_handler = QueueHandler(que)
-    handler = logging.StreamHandler()
-    listener = QueueListener(que, handler)
-    root = logging.getLogger()
-    root.addHandler(queue_handler)
-    formatter = logging.Formatter('%(threadName)s: %(message)s')
-    handler.setFormatter(formatter)
-    listener.start()
-    # The log output will display the thread which generated
-    # the event (the main thread) rather than the internal
-    # thread which monitors the internal queue. This is what
-    # you want to happen.
-    root.warning('Look out!')
-    listener.stop()
-
-which, when run, will produce::
-
-    MainThread: Look out!
-
-
-Optimization
-------------
-
-Formatting of message arguments is deferred until it cannot be avoided.
-However, computing the arguments passed to the logging method can also be
-expensive, and you may want to avoid doing it if the logger will just throw
-away your event. To decide what to do, you can call the :meth:`isEnabledFor`
-method which takes a level argument and returns true if the event would be
-created by the Logger for that level of call. You can write code like this::
-
-    if logger.isEnabledFor(logging.DEBUG):
-        logger.debug("Message with %s, %s", expensive_func1(),
-                                            expensive_func2())
-
-so that if the logger's threshold is set above ``DEBUG``, the calls to
-:func:`expensive_func1` and :func:`expensive_func2` are never made.
-
-There are other optimizations which can be made for specific applications which
-need more precise control over what logging information is collected. Here's a
-list of things you can do to avoid processing during logging which you don't
-need:
-
-+-----------------------------------------------+----------------------------------------+
-| What you don't want to collect                | How to avoid collecting it             |
-+===============================================+========================================+
-| Information about where calls were made from. | Set ``logging._srcfile`` to ``None``.  |
-+-----------------------------------------------+----------------------------------------+
-| Threading information.                        | Set ``logging.logThreads`` to ``0``.   |
-+-----------------------------------------------+----------------------------------------+
-| Process information.                          | Set ``logging.logProcesses`` to ``0``. |
-+-----------------------------------------------+----------------------------------------+
-
-Also note that the core logging module only includes the basic handlers. If
-you don't import :mod:`logging.handlers` and :mod:`logging.config`, they won't
-take up any memory.
 
 .. _handler:
 
@@ -2129,1171 +379,653 @@
    is intended to be implemented by subclasses and so raises a
    :exc:`NotImplementedError`.
 
+For a list of handlers included as standard, see :mod:`logging.handlers`.
 
-.. _stream-handler:
-
-StreamHandler
-^^^^^^^^^^^^^
-
-The :class:`StreamHandler` class, located in the core :mod:`logging` package,
-sends logging output to streams such as *sys.stdout*, *sys.stderr* or any
-file-like object (or, more precisely, any object which supports :meth:`write`
-and :meth:`flush` methods).
+.. _formatter-objects:
 
+Formatter Objects
+-----------------
 
 .. currentmodule:: logging
 
-.. class:: StreamHandler(stream=None)
-
-   Returns a new instance of the :class:`StreamHandler` class. If *stream* is
-   specified, the instance will use it for logging output; otherwise, *sys.stderr*
-   will be used.
-
-
-   .. method:: emit(record)
+:class:`Formatter` objects have the following attributes and methods. They are
+responsible for converting a :class:`LogRecord` to (usually) a string which can
+be interpreted by either a human or an external system. The base
+:class:`Formatter` allows a formatting string to be specified. If none is
+supplied, the default value of ``'%(message)s'`` is used.
 
-      If a formatter is specified, it is used to format the record. The record
-      is then written to the stream with a trailing newline. If exception
-      information is present, it is formatted using
-      :func:`traceback.print_exception` and appended to the stream.
+A Formatter can be initialized with a format string which makes use of knowledge
+of the :class:`LogRecord` attributes - such as the default value mentioned above
+making use of the fact that the user's message and arguments are pre-formatted
+into a :class:`LogRecord`'s *message* attribute.  This format string contains
+standard Python %-style mapping keys. See section :ref:`old-string-formatting`
+for more information on string formatting.
 
+The useful mapping keys in a :class:`LogRecord` are given in the section on
+:ref:`logrecord-attributes`.
 
-   .. method:: flush()
 
-      Flushes the stream by calling its :meth:`flush` method. Note that the
-      :meth:`close` method is inherited from :class:`Handler` and so does
-      no output, so an explicit :meth:`flush` call may be needed at times.
+.. class:: Formatter(fmt=None, datefmt=None)
 
-.. versionchanged:: 3.2
-   The ``StreamHandler`` class now has a ``terminator`` attribute, default
-   value ``"\n"``, which is used as the terminator when writing a formatted
-   record to a stream. If you don't want this newline termination, you can
-   set the handler instance's ``terminator`` attribute to the empty string.
-
-.. _file-handler:
-
-FileHandler
-^^^^^^^^^^^
-
-The :class:`FileHandler` class, located in the core :mod:`logging` package,
-sends logging output to a disk file.  It inherits the output functionality from
-:class:`StreamHandler`.
+   Returns a new instance of the :class:`Formatter` class.  The instance is
+   initialized with a format string for the message as a whole, as well as a
+   format string for the date/time portion of a message.  If no *fmt* is
+   specified, ``'%(message)s'`` is used.  If no *datefmt* is specified, the
+   ISO8601 date format is used.
 
+   .. method:: format(record)
 
-.. class:: FileHandler(filename, mode='a', encoding=None, delay=False)
+      The record's attribute dictionary is used as the operand to a string
+      formatting operation. Returns the resulting string. Before formatting the
+      dictionary, a couple of preparatory steps are carried out. The *message*
+      attribute of the record is computed using *msg* % *args*. If the
+      formatting string contains ``'(asctime)'``, :meth:`formatTime` is called
+      to format the event time. If there is exception information, it is
+      formatted using :meth:`formatException` and appended to the message. Note
+      that the formatted exception information is cached in attribute
+      *exc_text*. This is useful because the exception information can be
+      pickled and sent across the wire, but you should be careful if you have
+      more than one :class:`Formatter` subclass which customizes the formatting
+      of exception information. In this case, you will have to clear the cached
+      value after a formatter has done its formatting, so that the next
+      formatter to handle the event doesn't use the cached value but
+      recalculates it afresh.
 
-   Returns a new instance of the :class:`FileHandler` class. The specified file is
-   opened and used as the stream for logging. If *mode* is not specified,
-   :const:`'a'` is used.  If *encoding* is not *None*, it is used to open the file
-   with that encoding.  If *delay* is true, then file opening is deferred until the
-   first call to :meth:`emit`. By default, the file grows indefinitely.
+      If stack information is available, it's appended after the exception
+      information, using :meth:`formatStack` to transform it if necessary.
 
 
-   .. method:: close()
+   .. method:: formatTime(record, datefmt=None)
 
-      Closes the file.
+      This method should be called from :meth:`format` by a formatter which
+      wants to make use of a formatted time. This method can be overridden in
+      formatters to provide for any specific requirement, but the basic behavior
+      is as follows: if *datefmt* (a string) is specified, it is used with
+      :func:`time.strftime` to format the creation time of the
+      record. Otherwise, the ISO8601 format is used.  The resulting string is
+      returned.
 
 
-   .. method:: emit(record)
+   .. method:: formatException(exc_info)
 
-      Outputs the record to the file.
+      Formats the specified exception information (a standard exception tuple as
+      returned by :func:`sys.exc_info`) as a string. This default implementation
+      just uses :func:`traceback.print_exception`. The resulting string is
+      returned.
 
-.. _null-handler:
+   .. method:: formatStack(stack_info)
 
-NullHandler
-^^^^^^^^^^^
+      Formats the specified stack information (a string as returned by
+      :func:`traceback.print_stack`, but with the last newline removed) as a
+      string. This default implementation just returns the input value.
 
-.. versionadded:: 3.1
+.. _filter:
 
-The :class:`NullHandler` class, located in the core :mod:`logging` package,
-does not do any formatting or output. It is essentially a "no-op" handler
-for use by library developers.
+Filter Objects
+--------------
 
+``Filters`` can be used by ``Handlers`` and ``Loggers`` for more sophisticated
+filtering than is provided by levels. The base filter class only allows events
+which are below a certain point in the logger hierarchy. For example, a filter
+initialized with 'A.B' will allow events logged by loggers 'A.B', 'A.B.C',
+'A.B.C.D', 'A.B.D' etc. but not 'A.BB', 'B.A.B' etc. If initialized with the
+empty string, all events are passed.
 
-.. class:: NullHandler()
 
-   Returns a new instance of the :class:`NullHandler` class.
+.. class:: Filter(name='')
 
+   Returns an instance of the :class:`Filter` class. If *name* is specified, it
+   names a logger which, together with its children, will have its events allowed
+   through the filter. If *name* is the empty string, allows every event.
 
-   .. method:: emit(record)
 
-      This method does nothing.
+   .. method:: filter(record)
 
-   .. method:: handle(record)
+      Is the specified record to be logged? Returns zero for no, nonzero for
+      yes. If deemed appropriate, the record may be modified in-place by this
+      method.
 
-      This method does nothing.
+Note that filters attached to handlers are consulted whenever an event is
+emitted by the handler, whereas filters attached to loggers are consulted
+whenever an event is logged to the handler (using :meth:`debug`, :meth:`info`,
+etc.) This means that events which have been generated by descendant loggers
+will not be filtered by a logger's filter setting, unless the filter has also
+been applied to those descendant loggers.
 
-   .. method:: createLock()
+You don't actually need to subclass ``Filter``: you can pass any instance
+which has a ``filter`` method with the same semantics.
 
-      This method returns ``None`` for the lock, since there is no
-      underlying I/O to which access needs to be serialized.
+.. versionchanged:: 3.2
+   You don't need to create specialized ``Filter`` classes, or use other
+   classes with a ``filter`` method: you can use a function (or other
+   callable) as a filter. The filtering logic will check to see if the filter
+   object has a ``filter`` attribute: if it does, it's assumed to be a
+   ``Filter`` and its :meth:`~Filter.filter` method is called. Otherwise, it's
+   assumed to be a callable and called with the record as the single
+   parameter. The returned value should conform to that returned by
+   :meth:`~Filter.filter`.
 
+Although filters are used primarily to filter records based on more
+sophisticated criteria than levels, they get to see every record which is
+processed by the handler or logger they're attached to: this can be useful if
+you want to do things like counting how many records were processed by a
+particular logger or handler, or adding, changing or removing attributes in
+the LogRecord being processed. Obviously changing the LogRecord needs to be
+done with some care, but it does allow the injection of contextual information
+into logs (see :ref:`filters-contextual`).
 
-See :ref:`library-config` for more information on how to use
-:class:`NullHandler`.
+.. _log-record:
 
-.. _watched-file-handler:
+LogRecord Objects
+-----------------
 
-WatchedFileHandler
-^^^^^^^^^^^^^^^^^^
+:class:`LogRecord` instances are created automatically by the :class:`Logger`
+every time something is logged, and can be created manually via
+:func:`makeLogRecord` (for example, from a pickled event received over the
+wire).
 
-.. currentmodule:: logging.handlers
 
-The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers`
-module, is a :class:`FileHandler` which watches the file it is logging to. If
-the file changes, it is closed and reopened using the file name.
+.. class:: LogRecord(name, level, pathname, lineno, msg, args, exc_info, func=None, sinfo=None)
 
-A file change can happen because of usage of programs such as *newsyslog* and
-*logrotate* which perform log file rotation. This handler, intended for use
-under Unix/Linux, watches the file to see if it has changed since the last emit.
-(A file is deemed to have changed if its device or inode have changed.) If the
-file has changed, the old file stream is closed, and the file opened to get a
-new stream.
+   Contains all the information pertinent to the event being logged.
 
-This handler is not appropriate for use under Windows, because under Windows
-open log files cannot be moved or renamed - logging opens the files with
-exclusive locks - and so there is no need for such a handler. Furthermore,
-*ST_INO* is not supported under Windows; :func:`stat` always returns zero for
-this value.
+   The primary information is passed in :attr:`msg` and :attr:`args`, which
+   are combined using ``msg % args`` to create the :attr:`message` field of the
+   record.
 
+   :param name:  The name of the logger used to log the event represented by
+                 this LogRecord.
+   :param level: The numeric level of the logging event (one of DEBUG, INFO etc.)
+   :param pathname: The full pathname of the source file where the logging call
+                    was made.
+   :param lineno: The line number in the source file where the logging call was
+                  made.
+   :param msg: The event description message, possibly a format string with
+               placeholders for variable data.
+   :param args: Variable data to merge into the *msg* argument to obtain the
+                event description.
+   :param exc_info: An exception tuple with the current exception information,
+                    or *None* if no exception information is available.
+   :param func: The name of the function or method from which the logging call
+                was invoked.
+   :param sinfo: A text string representing stack information from the base of
+                 the stack in the current thread, up to the logging call.
 
-.. class:: WatchedFileHandler(filename[,mode[, encoding[, delay]]])
+   .. method:: getMessage()
 
-   Returns a new instance of the :class:`WatchedFileHandler` class. The specified
-   file is opened and used as the stream for logging. If *mode* is not specified,
-   :const:`'a'` is used.  If *encoding* is not *None*, it is used to open the file
-   with that encoding.  If *delay* is true, then file opening is deferred until the
-   first call to :meth:`emit`.  By default, the file grows indefinitely.
+      Returns the message for this :class:`LogRecord` instance after merging any
+      user-supplied arguments with the message. If the user-supplied message
+      argument to the logging call is not a string, :func:`str` is called on it to
+      convert it to a string. This allows use of user-defined classes as
+      messages, whose ``__str__`` method can return the actual format string to
+      be used.
 
+   .. versionchanged:: 3.2
+      The creation of a ``LogRecord`` has been made more configurable by
+      providing a factory which is used to create the record. The factory can be
+      set using :func:`getLogRecordFactory` and :func:`setLogRecordFactory`
+      (see this for the factory's signature).
+
+   This functionality can be used to inject your own values into a
+   LogRecord at creation time. You can use the following pattern::
+
+      old_factory = logging.getLogRecordFactory()
+
+      def record_factory(*args, **kwargs):
+          record = old_factory(*args, **kwargs)
+          record.custom_attribute = 0xdecafbad
+          return record
+
+      logging.setLogRecordFactory(record_factory)
+
+   With this pattern, multiple factories could be chained, and as long
+   as they don't overwrite each other's attributes or unintentionally
+   overwrite the standard attributes listed above, there should be no
+   surprises.
+
+
+.. _logrecord-attributes:
+
+LogRecord attributes
+--------------------
+
+The LogRecord has a number of attributes, most of which are derived from the
+parameters to the constructor. (Note that the names do not always correspond
+exactly between the LogRecord constructor parameters and the LogRecord
+attributes.) These attributes can be used to merge data from the record into
+the format string. The following table lists (in alphabetical order) the
+attribute names, their meanings and the corresponding placeholder in a %-style
+format string.
+
+If you are using {}-formatting (:func:`str.format`), you can use
+``{attrname}`` as the placeholder in the format string. If you are using
+$-formatting (:class:`string.Template`), use the form ``${attrname}``. In
+both cases, of course, replace ``attrname`` with the actual attribute name
+you want to use.
+
+In the case of {}-formatting, you can specify formatting flags by placing them
+after the attribute name, separated from it with a colon. For example: a
+placeholder of ``{msecs:03d}`` would format a millisecond value of ``4`` as
+``004``. Refer to the :meth:`str.format` documentation for full details on
+the options available to you.
+
++----------------+-------------------------+-----------------------------------------------+
+| Attribute name | Format                  | Description                                   |
++================+=========================+===============================================+
+| args           | You shouldn't need to   | The tuple of arguments merged into ``msg`` to |
+|                | format this yourself.   | produce ``message``.                          |
++----------------+-------------------------+-----------------------------------------------+
+| asctime        | ``%(asctime)s``         | Human-readable time when the                  |
+|                |                         | :class:`LogRecord` was created.  By default   |
+|                |                         | this is of the form '2003-07-08 16:49:45,896' |
+|                |                         | (the numbers after the comma are millisecond  |
+|                |                         | portion of the time).                         |
++----------------+-------------------------+-----------------------------------------------+
+| created        | ``%(created)f``         | Time when the :class:`LogRecord` was created  |
+|                |                         | (as returned by :func:`time.time`).           |
++----------------+-------------------------+-----------------------------------------------+
+| exc_info       | You shouldn't need to   | Exception tuple (?? la ``sys.exc_info``) or,   |
+|                | format this yourself.   | if no exception has occurred, *None*.         |
++----------------+-------------------------+-----------------------------------------------+
+| filename       | ``%(filename)s``        | Filename portion of ``pathname``.             |
++----------------+-------------------------+-----------------------------------------------+
+| funcName       | ``%(funcName)s``        | Name of function containing the logging call. |
++----------------+-------------------------+-----------------------------------------------+
+| levelname      | ``%(levelname)s``       | Text logging level for the message            |
+|                |                         | (``'DEBUG'``, ``'INFO'``, ``'WARNING'``,      |
+|                |                         | ``'ERROR'``, ``'CRITICAL'``).                 |
++----------------+-------------------------+-----------------------------------------------+
+| levelno        | ``%(levelno)s``         | Numeric logging level for the message         |
+|                |                         | (:const:`DEBUG`, :const:`INFO`,               |
+|                |                         | :const:`WARNING`, :const:`ERROR`,             |
+|                |                         | :const:`CRITICAL`).                           |
++----------------+-------------------------+-----------------------------------------------+
+| lineno         | ``%(lineno)d``          | Source line number where the logging call was |
+|                |                         | issued (if available).                        |
++----------------+-------------------------+-----------------------------------------------+
+| module         | ``%(module)s``          | Module (name portion of ``filename``).        |
++----------------+-------------------------+-----------------------------------------------+
+| msecs          | ``%(msecs)d``           | Millisecond portion of the time when the      |
+|                |                         | :class:`LogRecord` was created.               |
++----------------+-------------------------+-----------------------------------------------+
+| message        | ``%(message)s``         | The logged message, computed as ``msg %       |
+|                |                         | args``. This is set when                      |
+|                |                         | :meth:`Formatter.format` is invoked.          |
++----------------+-------------------------+-----------------------------------------------+
+| msg            | You shouldn't need to   | The format string passed in the original      |
+|                | format this yourself.   | logging call. Merged with ``args`` to         |
+|                |                         | produce ``message``, or an arbitrary object   |
+|                |                         | (see :ref:`arbitrary-object-messages`).       |
++----------------+-------------------------+-----------------------------------------------+
+| name           | ``%(name)s``            | Name of the logger used to log the call.      |
++----------------+-------------------------+-----------------------------------------------+
+| pathname       | ``%(pathname)s``        | Full pathname of the source file where the    |
+|                |                         | logging call was issued (if available).       |
++----------------+-------------------------+-----------------------------------------------+
+| process        | ``%(process)d``         | Process ID (if available).                    |
++----------------+-------------------------+-----------------------------------------------+
+| processName    | ``%(processName)s``     | Process name (if available).                  |
++----------------+-------------------------+-----------------------------------------------+
+| relativeCreated| ``%(relativeCreated)d`` | Time in milliseconds when the LogRecord was   |
+|                |                         | created, relative to the time the logging     |
+|                |                         | module was loaded.                            |
++----------------+-------------------------+-----------------------------------------------+
+| stack_info     | You shouldn't need to   | Stack frame information (where available)     |
+|                | format this yourself.   | from the bottom of the stack in the current   |
+|                |                         | thread, up to and including the stack frame   |
+|                |                         | of the logging call which resulted in the     |
+|                |                         | creation of this record.                      |
++----------------+-------------------------+-----------------------------------------------+
+| thread         | ``%(thread)d``          | Thread ID (if available).                     |
++----------------+-------------------------+-----------------------------------------------+
+| threadName     | ``%(threadName)s``      | Thread name (if available).                   |
++----------------+-------------------------+-----------------------------------------------+
 
-   .. method:: emit(record)
 
-      Outputs the record to the file, but first checks to see if the file has
-      changed.  If it has, the existing stream is flushed and closed and the
-      file opened again, before outputting the record to the file.
+.. _logger-adapter:
 
-.. _rotating-file-handler:
+LoggerAdapter Objects
+---------------------
 
-RotatingFileHandler
-^^^^^^^^^^^^^^^^^^^
+:class:`LoggerAdapter` instances are used to conveniently pass contextual
+information into logging calls. For a usage example , see the section on
+:ref:`adding contextual information to your logging output `.
 
-The :class:`RotatingFileHandler` class, located in the :mod:`logging.handlers`
-module, supports rotation of disk log files.
 
+.. class:: LoggerAdapter(logger, extra)
 
-.. class:: RotatingFileHandler(filename, mode='a', maxBytes=0, backupCount=0, encoding=None, delay=0)
+   Returns an instance of :class:`LoggerAdapter` initialized with an
+   underlying :class:`Logger` instance and a dict-like object.
 
-   Returns a new instance of the :class:`RotatingFileHandler` class. The specified
-   file is opened and used as the stream for logging. If *mode* is not specified,
-   ``'a'`` is used.  If *encoding* is not *None*, it is used to open the file
-   with that encoding.  If *delay* is true, then file opening is deferred until the
-   first call to :meth:`emit`.  By default, the file grows indefinitely.
+   .. method:: process(msg, kwargs)
 
-   You can use the *maxBytes* and *backupCount* values to allow the file to
-   :dfn:`rollover` at a predetermined size. When the size is about to be exceeded,
-   the file is closed and a new file is silently opened for output. Rollover occurs
-   whenever the current log file is nearly *maxBytes* in length; if *maxBytes* is
-   zero, rollover never occurs.  If *backupCount* is non-zero, the system will save
-   old log files by appending the extensions ".1", ".2" etc., to the filename. For
-   example, with a *backupCount* of 5 and a base file name of :file:`app.log`, you
-   would get :file:`app.log`, :file:`app.log.1`, :file:`app.log.2`, up to
-   :file:`app.log.5`. The file being written to is always :file:`app.log`.  When
-   this file is filled, it is closed and renamed to :file:`app.log.1`, and if files
-   :file:`app.log.1`, :file:`app.log.2`, etc.  exist, then they are renamed to
-   :file:`app.log.2`, :file:`app.log.3` etc.  respectively.
+      Modifies the message and/or keyword arguments passed to a logging call in
+      order to insert contextual information. This implementation takes the object
+      passed as *extra* to the constructor and adds it to *kwargs* using key
+      'extra'. The return value is a (*msg*, *kwargs*) tuple which has the
+      (possibly modified) versions of the arguments passed in.
 
+In addition to the above, :class:`LoggerAdapter` supports the following
+methods of :class:`Logger`, i.e. :meth:`debug`, :meth:`info`, :meth:`warning`,
+:meth:`error`, :meth:`exception`, :meth:`critical`, :meth:`log`,
+:meth:`isEnabledFor`, :meth:`getEffectiveLevel`, :meth:`setLevel`,
+:meth:`hasHandlers`. These methods have the same signatures as their
+counterparts in :class:`Logger`, so you can use the two types of instances
+interchangeably.
 
-   .. method:: doRollover()
+.. versionchanged:: 3.2
+   The :meth:`isEnabledFor`, :meth:`getEffectiveLevel`, :meth:`setLevel` and
+   :meth:`hasHandlers` methods were added to :class:`LoggerAdapter`.  These
+   methods delegate to the underlying logger.
 
-      Does a rollover, as described above.
 
+Thread Safety
+-------------
 
-   .. method:: emit(record)
+The logging module is intended to be thread-safe without any special work
+needing to be done by its clients. It achieves this though using threading
+locks; there is one lock to serialize access to the module's shared data, and
+each handler also creates a lock to serialize access to its underlying I/O.
 
-      Outputs the record to the file, catering for rollover as described
-      previously.
+If you are implementing asynchronous signal handlers using the :mod:`signal`
+module, you may not be able to use logging from within such handlers. This is
+because lock implementations in the :mod:`threading` module are not always
+re-entrant, and so cannot be invoked from such signal handlers.
 
-.. _timed-rotating-file-handler:
 
-TimedRotatingFileHandler
-^^^^^^^^^^^^^^^^^^^^^^^^
+Module-Level Functions
+----------------------
 
-The :class:`TimedRotatingFileHandler` class, located in the
-:mod:`logging.handlers` module, supports rotation of disk log files at certain
-timed intervals.
+In addition to the classes described above, there are a number of module- level
+functions.
 
 
-.. class:: TimedRotatingFileHandler(filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False)
+.. function:: getLogger(name=None)
 
-   Returns a new instance of the :class:`TimedRotatingFileHandler` class. The
-   specified file is opened and used as the stream for logging. On rotating it also
-   sets the filename suffix. Rotating happens based on the product of *when* and
-   *interval*.
+   Return a logger with the specified name or, if name is ``None``, return a
+   logger which is the root logger of the hierarchy. If specified, the name is
+   typically a dot-separated hierarchical name like *'a'*, *'a.b'* or *'a.b.c.d'*.
+   Choice of these names is entirely up to the developer who is using logging.
 
-   You can use the *when* to specify the type of *interval*. The list of possible
-   values is below.  Note that they are not case sensitive.
+   All calls to this function with a given name return the same logger instance.
+   This means that logger instances never need to be passed between different parts
+   of an application.
 
-   +----------------+-----------------------+
-   | Value          | Type of interval      |
-   +================+=======================+
-   | ``'S'``        | Seconds               |
-   +----------------+-----------------------+
-   | ``'M'``        | Minutes               |
-   +----------------+-----------------------+
-   | ``'H'``        | Hours                 |
-   +----------------+-----------------------+
-   | ``'D'``        | Days                  |
-   +----------------+-----------------------+
-   | ``'W'``        | Week day (0=Monday)   |
-   +----------------+-----------------------+
-   | ``'midnight'`` | Roll over at midnight |
-   +----------------+-----------------------+
 
-   The system will save old log files by appending extensions to the filename.
-   The extensions are date-and-time based, using the strftime format
-   ``%Y-%m-%d_%H-%M-%S`` or a leading portion thereof, depending on the
-   rollover interval.
+.. function:: getLoggerClass()
 
-   When computing the next rollover time for the first time (when the handler
-   is created), the last modification time of an existing log file, or else
-   the current time, is used to compute when the next rotation will occur.
+   Return either the standard :class:`Logger` class, or the last class passed to
+   :func:`setLoggerClass`. This function may be called from within a new class
+   definition, to ensure that installing a customised :class:`Logger` class will
+   not undo customisations already applied by other code. For example::
 
-   If the *utc* argument is true, times in UTC will be used; otherwise
-   local time is used.
+      class MyLogger(logging.getLoggerClass()):
+          # ... override behaviour here
 
-   If *backupCount* is nonzero, at most *backupCount* files
-   will be kept, and if more would be created when rollover occurs, the oldest
-   one is deleted. The deletion logic uses the interval to determine which
-   files to delete, so changing the interval may leave old files lying around.
 
-   If *delay* is true, then file opening is deferred until the first call to
-   :meth:`emit`.
+.. function:: getLogRecordFactory()
 
+   Return a callable which is used to create a :class:`LogRecord`.
 
-   .. method:: doRollover()
+   .. versionadded:: 3.2
+      This function has been provided, along with :func:`setLogRecordFactory`,
+      to allow developers more control over how the :class:`LogRecord`
+      representing a logging event is constructed.
 
-      Does a rollover, as described above.
+   See :func:`setLogRecordFactory` for more information about the how the
+   factory is called.
 
+.. function:: debug(msg, *args, **kwargs)
 
-   .. method:: emit(record)
+   Logs a message with level :const:`DEBUG` on the root logger. The *msg* is the
+   message format string, and the *args* are the arguments which are merged into
+   *msg* using the string formatting operator. (Note that this means that you can
+   use keywords in the format string, together with a single dictionary argument.)
 
-      Outputs the record to the file, catering for rollover as described above.
+   There are three keyword arguments in *kwargs* which are inspected: *exc_info*
+   which, if it does not evaluate as false, causes exception information to be
+   added to the logging message. If an exception tuple (in the format returned by
+   :func:`sys.exc_info`) is provided, it is used; otherwise, :func:`sys.exc_info`
+   is called to get the exception information.
 
+   The second optional keyword argument is *stack_info*, which defaults to
+   False. If specified as True, stack information is added to the logging
+   message, including the actual logging call. Note that this is not the same
+   stack information as that displayed through specifying *exc_info*: The
+   former is stack frames from the bottom of the stack up to the logging call
+   in the current thread, whereas the latter is information about stack frames
+   which have been unwound, following an exception, while searching for
+   exception handlers.
 
-.. _socket-handler:
+   You can specify *stack_info* independently of *exc_info*, e.g. to just show
+   how you got to a certain point in your code, even when no exceptions were
+   raised. The stack frames are printed following a header line which says::
 
-SocketHandler
-^^^^^^^^^^^^^
+       Stack (most recent call last):
 
-The :class:`SocketHandler` class, located in the :mod:`logging.handlers` module,
-sends logging output to a network socket. The base class uses a TCP socket.
+   This mimics the `Traceback (most recent call last):` which is used when
+   displaying exception frames.
 
+   The third optional keyword argument is *extra* which can be used to pass a
+   dictionary which is used to populate the __dict__ of the LogRecord created for
+   the logging event with user-defined attributes. These custom attributes can then
+   be used as you like. For example, they could be incorporated into logged
+   messages. For example::
 
-.. class:: SocketHandler(host, port)
+      FORMAT = '%(asctime)-15s %(clientip)s %(user)-8s %(message)s'
+      logging.basicConfig(format=FORMAT)
+      d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}
+      logging.warning('Protocol problem: %s', 'connection reset', extra=d)
 
-   Returns a new instance of the :class:`SocketHandler` class intended to
-   communicate with a remote machine whose address is given by *host* and *port*.
+   would print something like::
 
+      2006-02-08 22:20:02,165 192.168.0.1 fbloggs  Protocol problem: connection reset
 
-   .. method:: close()
+   The keys in the dictionary passed in *extra* should not clash with the keys used
+   by the logging system. (See the :class:`Formatter` documentation for more
+   information on which keys are used by the logging system.)
 
-      Closes the socket.
+   If you choose to use these attributes in logged messages, you need to exercise
+   some care. In the above example, for instance, the :class:`Formatter` has been
+   set up with a format string which expects 'clientip' and 'user' in the attribute
+   dictionary of the LogRecord. If these are missing, the message will not be
+   logged because a string formatting exception will occur. So in this case, you
+   always need to pass the *extra* dictionary with these keys.
 
+   While this might be annoying, this feature is intended for use in specialized
+   circumstances, such as multi-threaded servers where the same code executes in
+   many contexts, and interesting conditions which arise are dependent on this
+   context (such as remote client IP address and authenticated user name, in the
+   above example). In such circumstances, it is likely that specialized
+   :class:`Formatter`\ s would be used with particular :class:`Handler`\ s.
 
-   .. method:: emit()
+   .. versionadded:: 3.2
+      The *stack_info* parameter was added.
 
-      Pickles the record's attribute dictionary and writes it to the socket in
-      binary format. If there is an error with the socket, silently drops the
-      packet. If the connection was previously lost, re-establishes the
-      connection. To unpickle the record at the receiving end into a
-      :class:`LogRecord`, use the :func:`makeLogRecord` function.
+.. function:: info(msg, *args, **kwargs)
 
+   Logs a message with level :const:`INFO` on the root logger. The arguments are
+   interpreted as for :func:`debug`.
 
-   .. method:: handleError()
 
-      Handles an error which has occurred during :meth:`emit`. The most likely
-      cause is a lost connection. Closes the socket so that we can retry on the
-      next event.
+.. function:: warning(msg, *args, **kwargs)
 
+   Logs a message with level :const:`WARNING` on the root logger. The arguments are
+   interpreted as for :func:`debug`.
 
-   .. method:: makeSocket()
 
-      This is a factory method which allows subclasses to define the precise
-      type of socket they want. The default implementation creates a TCP socket
-      (:const:`socket.SOCK_STREAM`).
+.. function:: error(msg, *args, **kwargs)
 
+   Logs a message with level :const:`ERROR` on the root logger. The arguments are
+   interpreted as for :func:`debug`.
 
-   .. method:: makePickle(record)
 
-      Pickles the record's attribute dictionary in binary format with a length
-      prefix, and returns it ready for transmission across the socket.
+.. function:: critical(msg, *args, **kwargs)
 
-      Note that pickles aren't completely secure. If you are concerned about
-      security, you may want to override this method to implement a more secure
-      mechanism. For example, you can sign pickles using HMAC and then verify
-      them on the receiving end, or alternatively you can disable unpickling of
-      global objects on the receiving end.
+   Logs a message with level :const:`CRITICAL` on the root logger. The arguments
+   are interpreted as for :func:`debug`.
 
-   .. method:: send(packet)
 
-      Send a pickled string *packet* to the socket. This function allows for
-      partial sends which can happen when the network is busy.
+.. function:: exception(msg, *args)
 
+   Logs a message with level :const:`ERROR` on the root logger. The arguments are
+   interpreted as for :func:`debug`. Exception info is added to the logging
+   message. This function should only be called from an exception handler.
 
-.. _datagram-handler:
+.. function:: log(level, msg, *args, **kwargs)
 
-DatagramHandler
-^^^^^^^^^^^^^^^
+   Logs a message with level *level* on the root logger. The other arguments are
+   interpreted as for :func:`debug`.
 
-The :class:`DatagramHandler` class, located in the :mod:`logging.handlers`
-module, inherits from :class:`SocketHandler` to support sending logging messages
-over UDP sockets.
+   PLEASE NOTE: The above module-level functions which delegate to the root
+   logger should *not* be used in threads, in versions of Python earlier than
+   2.7.1 and 3.2, unless at least one handler has been added to the root
+   logger *before* the threads are started. These convenience functions call
+   :func:`basicConfig` to ensure that at least one handler is available; in
+   earlier versions of Python, this can (under rare circumstances) lead to
+   handlers being added multiple times to the root logger, which can in turn
+   lead to multiple messages for the same event.
 
+.. function:: disable(lvl)
 
-.. class:: DatagramHandler(host, port)
+   Provides an overriding level *lvl* for all loggers which takes precedence over
+   the logger's own level. When the need arises to temporarily throttle logging
+   output down across the whole application, this function can be useful. Its
+   effect is to disable all logging calls of severity *lvl* and below, so that
+   if you call it with a value of INFO, then all INFO and DEBUG events would be
+   discarded, whereas those of severity WARNING and above would be processed
+   according to the logger's effective level.
 
-   Returns a new instance of the :class:`DatagramHandler` class intended to
-   communicate with a remote machine whose address is given by *host* and *port*.
 
+.. function:: addLevelName(lvl, levelName)
 
-   .. method:: emit()
+   Associates level *lvl* with text *levelName* in an internal dictionary, which is
+   used to map numeric levels to a textual representation, for example when a
+   :class:`Formatter` formats a message. This function can also be used to define
+   your own levels. The only constraints are that all levels used must be
+   registered using this function, levels should be positive integers and they
+   should increase in increasing order of severity.
 
-      Pickles the record's attribute dictionary and writes it to the socket in
-      binary format. If there is an error with the socket, silently drops the
-      packet. To unpickle the record at the receiving end into a
-      :class:`LogRecord`, use the :func:`makeLogRecord` function.
+   NOTE: If you are thinking of defining your own levels, please see the section
+   on :ref:`custom-levels`.
 
+.. function:: getLevelName(lvl)
 
-   .. method:: makeSocket()
+   Returns the textual representation of logging level *lvl*. If the level is one
+   of the predefined levels :const:`CRITICAL`, :const:`ERROR`, :const:`WARNING`,
+   :const:`INFO` or :const:`DEBUG` then you get the corresponding string. If you
+   have associated levels with names using :func:`addLevelName` then the name you
+   have associated with *lvl* is returned. If a numeric value corresponding to one
+   of the defined levels is passed in, the corresponding string representation is
+   returned. Otherwise, the string 'Level %s' % lvl is returned.
 
-      The factory method of :class:`SocketHandler` is here overridden to create
-      a UDP socket (:const:`socket.SOCK_DGRAM`).
 
+.. function:: makeLogRecord(attrdict)
 
-   .. method:: send(s)
+   Creates and returns a new :class:`LogRecord` instance whose attributes are
+   defined by *attrdict*. This function is useful for taking a pickled
+   :class:`LogRecord` attribute dictionary, sent over a socket, and reconstituting
+   it as a :class:`LogRecord` instance at the receiving end.
 
-      Send a pickled string to a socket.
 
+.. function:: basicConfig(**kwargs)
 
-.. _syslog-handler:
-
-SysLogHandler
-^^^^^^^^^^^^^
-
-The :class:`SysLogHandler` class, located in the :mod:`logging.handlers` module,
-supports sending logging messages to a remote or local Unix syslog.
+   Does basic configuration for the logging system by creating a
+   :class:`StreamHandler` with a default :class:`Formatter` and adding it to the
+   root logger. The functions :func:`debug`, :func:`info`, :func:`warning`,
+   :func:`error` and :func:`critical` will call :func:`basicConfig` automatically
+   if no handlers are defined for the root logger.
 
+   This function does nothing if the root logger already has handlers
+   configured for it.
 
-.. class:: SysLogHandler(address=('localhost', SYSLOG_UDP_PORT), facility=LOG_USER, socktype=socket.SOCK_DGRAM)
+   PLEASE NOTE: This function should be called from the main thread
+   before other threads are started. In versions of Python prior to
+   2.7.1 and 3.2, if this function is called from multiple threads,
+   it is possible (in rare circumstances) that a handler will be added
+   to the root logger more than once, leading to unexpected results
+   such as messages being duplicated in the log.
 
-   Returns a new instance of the :class:`SysLogHandler` class intended to
-   communicate with a remote Unix machine whose address is given by *address* in
-   the form of a ``(host, port)`` tuple.  If *address* is not specified,
-   ``('localhost', 514)`` is used.  The address is used to open a socket.  An
-   alternative to providing a ``(host, port)`` tuple is providing an address as a
-   string, for example "/dev/log". In this case, a Unix domain socket is used to
-   send the message to the syslog. If *facility* is not specified,
-   :const:`LOG_USER` is used. The type of socket opened depends on the
-   *socktype* argument, which defaults to :const:`socket.SOCK_DGRAM` and thus
-   opens a UDP socket. To open a TCP socket (for use with the newer syslog
-   daemons such as rsyslog), specify a value of :const:`socket.SOCK_STREAM`.
+   The following keyword arguments are supported.
 
-   Note that if your server is not listening on UDP port 514,
-   :class:`SysLogHandler` may appear not to work. In that case, check what
-   address you should be using for a domain socket - it's system dependent.
-   For example, on Linux it's usually "/dev/log" but on OS/X it's
-   "/var/run/syslog". You'll need to check your platform and use the
-   appropriate address (you may need to do this check at runtime if your
-   application needs to run on several platforms). On Windows, you pretty
-   much have to use the UDP option.
+   +--------------+---------------------------------------------+
+   | Format       | Description                                 |
+   +==============+=============================================+
+   | ``filename`` | Specifies that a FileHandler be created,    |
+   |              | using the specified filename, rather than a |
+   |              | StreamHandler.                              |
+   +--------------+---------------------------------------------+
+   | ``filemode`` | Specifies the mode to open the file, if     |
+   |              | filename is specified (if filemode is       |
+   |              | unspecified, it defaults to 'a').           |
+   +--------------+---------------------------------------------+
+   | ``format``   | Use the specified format string for the     |
+   |              | handler.                                    |
+   +--------------+---------------------------------------------+
+   | ``datefmt``  | Use the specified date/time format.         |
+   +--------------+---------------------------------------------+
+   | ``style``    | If ``format`` is specified, use this style  |
+   |              | for the format string. One of '%', '{' or   |
+   |              | '$' for %-formatting, :meth:`str.format` or |
+   |              | :class:`string.Template` respectively, and  |
+   |              | defaulting to '%' if not specified.         |
+   +--------------+---------------------------------------------+
+   | ``level``    | Set the root logger level to the specified  |
+   |              | level.                                      |
+   +--------------+---------------------------------------------+
+   | ``stream``   | Use the specified stream to initialize the  |
+   |              | StreamHandler. Note that this argument is   |
+   |              | incompatible with 'filename' - if both are  |
+   |              | present, 'stream' is ignored.               |
+   +--------------+---------------------------------------------+
 
    .. versionchanged:: 3.2
-      *socktype* was added.
-
-
-   .. method:: close()
-
-      Closes the socket to the remote host.
-
-
-   .. method:: emit(record)
-
-      The record is formatted, and then sent to the syslog server. If exception
-      information is present, it is *not* sent to the server.
-
-
-   .. method:: encodePriority(facility, priority)
-
-      Encodes the facility and priority into an integer. You can pass in strings
-      or integers - if strings are passed, internal mapping dictionaries are
-      used to convert them to integers.
-
-      The symbolic ``LOG_`` values are defined in :class:`SysLogHandler` and
-      mirror the values defined in the ``sys/syslog.h`` header file.
-
-      **Priorities**
-
-      +--------------------------+---------------+
-      | Name (string)            | Symbolic value|
-      +==========================+===============+
-      | ``alert``                | LOG_ALERT     |
-      +--------------------------+---------------+
-      | ``crit`` or ``critical`` | LOG_CRIT      |
-      +--------------------------+---------------+
-      | ``debug``                | LOG_DEBUG     |
-      +--------------------------+---------------+
-      | ``emerg`` or ``panic``   | LOG_EMERG     |
-      +--------------------------+---------------+
-      | ``err`` or ``error``     | LOG_ERR       |
-      +--------------------------+---------------+
-      | ``info``                 | LOG_INFO      |
-      +--------------------------+---------------+
-      | ``notice``               | LOG_NOTICE    |
-      +--------------------------+---------------+
-      | ``warn`` or ``warning``  | LOG_WARNING   |
-      +--------------------------+---------------+
-
-      **Facilities**
-
-      +---------------+---------------+
-      | Name (string) | Symbolic value|
-      +===============+===============+
-      | ``auth``      | LOG_AUTH      |
-      +---------------+---------------+
-      | ``authpriv``  | LOG_AUTHPRIV  |
-      +---------------+---------------+
-      | ``cron``      | LOG_CRON      |
-      +---------------+---------------+
-      | ``daemon``    | LOG_DAEMON    |
-      +---------------+---------------+
-      | ``ftp``       | LOG_FTP       |
-      +---------------+---------------+
-      | ``kern``      | LOG_KERN      |
-      +---------------+---------------+
-      | ``lpr``       | LOG_LPR       |
-      +---------------+---------------+
-      | ``mail``      | LOG_MAIL      |
-      +---------------+---------------+
-      | ``news``      | LOG_NEWS      |
-      +---------------+---------------+
-      | ``syslog``    | LOG_SYSLOG    |
-      +---------------+---------------+
-      | ``user``      | LOG_USER      |
-      +---------------+---------------+
-      | ``uucp``      | LOG_UUCP      |
-      +---------------+---------------+
-      | ``local0``    | LOG_LOCAL0    |
-      +---------------+---------------+
-      | ``local1``    | LOG_LOCAL1    |
-      +---------------+---------------+
-      | ``local2``    | LOG_LOCAL2    |
-      +---------------+---------------+
-      | ``local3``    | LOG_LOCAL3    |
-      +---------------+---------------+
-      | ``local4``    | LOG_LOCAL4    |
-      +---------------+---------------+
-      | ``local5``    | LOG_LOCAL5    |
-      +---------------+---------------+
-      | ``local6``    | LOG_LOCAL6    |
-      +---------------+---------------+
-      | ``local7``    | LOG_LOCAL7    |
-      +---------------+---------------+
-
-   .. method:: mapPriority(levelname)
-
-      Maps a logging level name to a syslog priority name.
-      You may need to override this if you are using custom levels, or
-      if the default algorithm is not suitable for your needs. The
-      default algorithm maps ``DEBUG``, ``INFO``, ``WARNING``, ``ERROR`` and
-      ``CRITICAL`` to the equivalent syslog names, and all other level
-      names to "warning".
-
-.. _nt-eventlog-handler:
-
-NTEventLogHandler
-^^^^^^^^^^^^^^^^^
-
-The :class:`NTEventLogHandler` class, located in the :mod:`logging.handlers`
-module, supports sending logging messages to a local Windows NT, Windows 2000 or
-Windows XP event log. Before you can use it, you need Mark Hammond's Win32
-extensions for Python installed.
-
-
-.. class:: NTEventLogHandler(appname, dllname=None, logtype='Application')
-
-   Returns a new instance of the :class:`NTEventLogHandler` class. The *appname* is
-   used to define the application name as it appears in the event log. An
-   appropriate registry entry is created using this name. The *dllname* should give
-   the fully qualified pathname of a .dll or .exe which contains message
-   definitions to hold in the log (if not specified, ``'win32service.pyd'`` is used
-   - this is installed with the Win32 extensions and contains some basic
-   placeholder message definitions. Note that use of these placeholders will make
-   your event logs big, as the entire message source is held in the log. If you
-   want slimmer logs, you have to pass in the name of your own .dll or .exe which
-   contains the message definitions you want to use in the event log). The
-   *logtype* is one of ``'Application'``, ``'System'`` or ``'Security'``, and
-   defaults to ``'Application'``.
-
-
-   .. method:: close()
-
-      At this point, you can remove the application name from the registry as a
-      source of event log entries. However, if you do this, you will not be able
-      to see the events as you intended in the Event Log Viewer - it needs to be
-      able to access the registry to get the .dll name. The current version does
-      not do this.
-
-
-   .. method:: emit(record)
-
-      Determines the message ID, event category and event type, and then logs
-      the message in the NT event log.
-
-
-   .. method:: getEventCategory(record)
-
-      Returns the event category for the record. Override this if you want to
-      specify your own categories. This version returns 0.
-
-
-   .. method:: getEventType(record)
-
-      Returns the event type for the record. Override this if you want to
-      specify your own types. This version does a mapping using the handler's
-      typemap attribute, which is set up in :meth:`__init__` to a dictionary
-      which contains mappings for :const:`DEBUG`, :const:`INFO`,
-      :const:`WARNING`, :const:`ERROR` and :const:`CRITICAL`. If you are using
-      your own levels, you will either need to override this method or place a
-      suitable dictionary in the handler's *typemap* attribute.
-
-
-   .. method:: getMessageID(record)
-
-      Returns the message ID for the record. If you are using your own messages,
-      you could do this by having the *msg* passed to the logger being an ID
-      rather than a format string. Then, in here, you could use a dictionary
-      lookup to get the message ID. This version returns 1, which is the base
-      message ID in :file:`win32service.pyd`.
-
-.. _smtp-handler:
-
-SMTPHandler
-^^^^^^^^^^^
-
-The :class:`SMTPHandler` class, located in the :mod:`logging.handlers` module,
-supports sending logging messages to an email address via SMTP.
-
-
-.. class:: SMTPHandler(mailhost, fromaddr, toaddrs, subject, credentials=None)
-
-   Returns a new instance of the :class:`SMTPHandler` class. The instance is
-   initialized with the from and to addresses and subject line of the email. The
-   *toaddrs* should be a list of strings. To specify a non-standard SMTP port, use
-   the (host, port) tuple format for the *mailhost* argument. If you use a string,
-   the standard SMTP port is used. If your SMTP server requires authentication, you
-   can specify a (username, password) tuple for the *credentials* argument.
-
-
-   .. method:: emit(record)
-
-      Formats the record and sends it to the specified addressees.
-
-
-   .. method:: getSubject(record)
-
-      If you want to specify a subject line which is record-dependent, override
-      this method.
-
-.. _memory-handler:
-
-MemoryHandler
-^^^^^^^^^^^^^
-
-The :class:`MemoryHandler` class, located in the :mod:`logging.handlers` module,
-supports buffering of logging records in memory, periodically flushing them to a
-:dfn:`target` handler. Flushing occurs whenever the buffer is full, or when an
-event of a certain severity or greater is seen.
-
-:class:`MemoryHandler` is a subclass of the more general
-:class:`BufferingHandler`, which is an abstract class. This buffers logging
-records in memory. Whenever each record is added to the buffer, a check is made
-by calling :meth:`shouldFlush` to see if the buffer should be flushed.  If it
-should, then :meth:`flush` is expected to do the needful.
-
-
-.. class:: BufferingHandler(capacity)
-
-   Initializes the handler with a buffer of the specified capacity.
-
-
-   .. method:: emit(record)
-
-      Appends the record to the buffer. If :meth:`shouldFlush` returns true,
-      calls :meth:`flush` to process the buffer.
-
-
-   .. method:: flush()
-
-      You can override this to implement custom flushing behavior. This version
-      just zaps the buffer to empty.
-
-
-   .. method:: shouldFlush(record)
-
-      Returns true if the buffer is up to capacity. This method can be
-      overridden to implement custom flushing strategies.
-
-
-.. class:: MemoryHandler(capacity, flushLevel=ERROR, target=None)
-
-   Returns a new instance of the :class:`MemoryHandler` class. The instance is
-   initialized with a buffer size of *capacity*. If *flushLevel* is not specified,
-   :const:`ERROR` is used. If no *target* is specified, the target will need to be
-   set using :meth:`setTarget` before this handler does anything useful.
-
-
-   .. method:: close()
-
-      Calls :meth:`flush`, sets the target to :const:`None` and clears the
-      buffer.
-
-
-   .. method:: flush()
-
-      For a :class:`MemoryHandler`, flushing means just sending the buffered
-      records to the target, if there is one. The buffer is also cleared when
-      this happens. Override if you want different behavior.
-
-
-   .. method:: setTarget(target)
-
-      Sets the target handler for this handler.
-
-
-   .. method:: shouldFlush(record)
-
-      Checks for buffer full or a record at the *flushLevel* or higher.
-
-
-.. _http-handler:
-
-HTTPHandler
-^^^^^^^^^^^
-
-The :class:`HTTPHandler` class, located in the :mod:`logging.handlers` module,
-supports sending logging messages to a Web server, using either ``GET`` or
-``POST`` semantics.
-
-
-.. class:: HTTPHandler(host, url, method='GET', secure=False, credentials=None)
-
-   Returns a new instance of the :class:`HTTPHandler` class. The *host* can be
-   of the form ``host:port``, should you need to use a specific port number.
-   If no *method* is specified, ``GET`` is used. If *secure* is True, an HTTPS
-   connection will be used. If *credentials* is specified, it should be a
-   2-tuple consisting of userid and password, which will be placed in an HTTP
-   'Authorization' header using Basic authentication. If you specify
-   credentials, you should also specify secure=True so that your userid and
-   password are not passed in cleartext across the wire.
-
-
-   .. method:: emit(record)
-
-      Sends the record to the Web server as a percent-encoded dictionary.
-
-
-.. _queue-handler:
-
-
-QueueHandler
-^^^^^^^^^^^^
-
-The :class:`QueueHandler` class, located in the :mod:`logging.handlers` module,
-supports sending logging messages to a queue, such as those implemented in the
-:mod:`queue` or :mod:`multiprocessing` modules.
-
-Along with the :class:`QueueListener` class, :class:`QueueHandler` can be used
-to let handlers do their work on a separate thread from the one which does the
-logging. This is important in Web applications and also other service
-applications where threads servicing clients need to respond as quickly as
-possible, while any potentially slow operations (such as sending an email via
-:class:`SMTPHandler`) are done on a separate thread.
-
-.. class:: QueueHandler(queue)
-
-   Returns a new instance of the :class:`QueueHandler` class. The instance is
-   initialized with the queue to send messages to. The queue can be any queue-
-   like object; it's used as-is by the :meth:`enqueue` method, which needs
-   to know how to send messages to it.
-
-
-   .. method:: emit(record)
-
-      Enqueues the result of preparing the LogRecord.
-
-   .. method:: prepare(record)
-
-      Prepares a record for queuing. The object returned by this
-      method is enqueued.
-
-      The base implementation formats the record to merge the message
-      and arguments, and removes unpickleable items from the record
-      in-place.
-
-      You might want to override this method if you want to convert
-      the record to a dict or JSON string, or send a modified copy
-      of the record while leaving the original intact.
-
-   .. method:: enqueue(record)
-
-      Enqueues the record on the queue using ``put_nowait()``; you may
-      want to override this if you want to use blocking behaviour, or a
-      timeout, or a customised queue implementation.
-
-
-.. versionadded:: 3.2
-
-The :class:`QueueHandler` class was not present in previous versions.
-
-.. queue-listener:
-
-QueueListener
-^^^^^^^^^^^^^
-
-The :class:`QueueListener` class, located in the :mod:`logging.handlers`
-module, supports receiving logging messages from a queue, such as those
-implemented in the :mod:`queue` or :mod:`multiprocessing` modules. The
-messages are received from a queue in an internal thread and passed, on
-the same thread, to one or more handlers for processing.
-
-Along with the :class:`QueueHandler` class, :class:`QueueListener` can be used
-to let handlers do their work on a separate thread from the one which does the
-logging. This is important in Web applications and also other service
-applications where threads servicing clients need to respond as quickly as
-possible, while any potentially slow operations (such as sending an email via
-:class:`SMTPHandler`) are done on a separate thread.
-
-.. class:: QueueListener(queue, *handlers)
-
-   Returns a new instance of the :class:`QueueListener` class. The instance is
-   initialized with the queue to send messages to and a list of handlers which
-   will handle entries placed on the queue. The queue can be any queue-
-   like object; it's passed as-is to the :meth:`dequeue` method, which needs
-   to know how to get messages from it.
-
-   .. method:: dequeue(block)
-
-      Dequeues a record and return it, optionally blocking.
-
-      The base implementation uses ``get()``. You may want to override this
-      method if you want to use timeouts or work with custom queue
-      implementations.
-
-   .. method:: prepare(record)
-
-      Prepare a record for handling.
-
-      This implementation just returns the passed-in record. You may want to
-      override this method if you need to do any custom marshalling or
-      manipulation of the record before passing it to the handlers.
-
-   .. method:: handle(record)
-
-      Handle a record.
-
-      This just loops through the handlers offering them the record
-      to handle. The actual object passed to the handlers is that which
-      is returned from :meth:`prepare`.
-
-   .. method:: start()
-
-      Starts the listener.
-
-      This starts up a background thread to monitor the queue for
-      LogRecords to process.
-
-   .. method:: stop()
-
-      Stops the listener.
-
-      This asks the thread to terminate, and then waits for it to do so.
-      Note that if you don't call this before your application exits, there
-      may be some records still left on the queue, which won't be processed.
-
-.. versionadded:: 3.2
-
-The :class:`QueueListener` class was not present in previous versions.
-
-.. _zeromq-handlers:
-
-Subclassing QueueHandler
-^^^^^^^^^^^^^^^^^^^^^^^^
-
-You can use a :class:`QueueHandler` subclass to send messages to other kinds
-of queues, for example a ZeroMQ "publish" socket. In the example below,the
-socket is created separately and passed to the handler (as its 'queue')::
-
-    import zmq # using pyzmq, the Python binding for ZeroMQ
-    import json # for serializing records portably
-
-    ctx = zmq.Context()
-    sock = zmq.Socket(ctx, zmq.PUB) # or zmq.PUSH, or other suitable value
-    sock.bind('tcp://*:5556') # or wherever
-
-    class ZeroMQSocketHandler(QueueHandler):
-        def enqueue(self, record):
-            data = json.dumps(record.__dict__)
-            self.queue.send(data)
-
-    handler = ZeroMQSocketHandler(sock)
-
-
-Of course there are other ways of organizing this, for example passing in the
-data needed by the handler to create the socket::
-
-    class ZeroMQSocketHandler(QueueHandler):
-        def __init__(self, uri, socktype=zmq.PUB, ctx=None):
-            self.ctx = ctx or zmq.Context()
-            socket = zmq.Socket(self.ctx, socktype)
-            socket.bind(uri)
-            QueueHandler.__init__(self, socket)
-
-        def enqueue(self, record):
-            data = json.dumps(record.__dict__)
-            self.queue.send(data)
-
-        def close(self):
-            self.queue.close()
-
-Subclassing QueueListener
-^^^^^^^^^^^^^^^^^^^^^^^^^
-
-You can also subclass :class:`QueueListener` to get messages from other kinds
-of queues, for example a ZeroMQ "subscribe" socket. Here's an example::
-
-    class ZeroMQSocketListener(QueueListener):
-        def __init__(self, uri, *handlers, **kwargs):
-            self.ctx = kwargs.get('ctx') or zmq.Context()
-            socket = zmq.Socket(self.ctx, zmq.SUB)
-            socket.setsockopt(zmq.SUBSCRIBE, '') # subscribe to everything
-            socket.connect(uri)
-
-        def dequeue(self):
-            msg = self.queue.recv()
-            return logging.makeLogRecord(json.loads(msg))
-
-.. _formatter-objects:
-
-Formatter Objects
------------------
-
-.. currentmodule:: logging
-
-:class:`Formatter`\ s have the following attributes and methods. They are
-responsible for converting a :class:`LogRecord` to (usually) a string which can
-be interpreted by either a human or an external system. The base
-:class:`Formatter` allows a formatting string to be specified. If none is
-supplied, the default value of ``'%(message)s'`` is used.
-
-A Formatter can be initialized with a format string which makes use of knowledge
-of the :class:`LogRecord` attributes - such as the default value mentioned above
-making use of the fact that the user's message and arguments are pre-formatted
-into a :class:`LogRecord`'s *message* attribute.  This format string contains
-standard Python %-style mapping keys. See section :ref:`old-string-formatting`
-for more information on string formatting.
-
-Currently, the useful mapping keys in a :class:`LogRecord` are:
-
-+-------------------------+-----------------------------------------------+
-| Format                  | Description                                   |
-+=========================+===============================================+
-| ``%(name)s``            | Name of the logger (logging channel).         |
-+-------------------------+-----------------------------------------------+
-| ``%(levelno)s``         | Numeric logging level for the message         |
-|                         | (:const:`DEBUG`, :const:`INFO`,               |
-|                         | :const:`WARNING`, :const:`ERROR`,             |
-|                         | :const:`CRITICAL`).                           |
-+-------------------------+-----------------------------------------------+
-| ``%(levelname)s``       | Text logging level for the message            |
-|                         | (``'DEBUG'``, ``'INFO'``, ``'WARNING'``,      |
-|                         | ``'ERROR'``, ``'CRITICAL'``).                 |
-+-------------------------+-----------------------------------------------+
-| ``%(pathname)s``        | Full pathname of the source file where the    |
-|                         | logging call was issued (if available).       |
-+-------------------------+-----------------------------------------------+
-| ``%(filename)s``        | Filename portion of pathname.                 |
-+-------------------------+-----------------------------------------------+
-| ``%(module)s``          | Module (name portion of filename).            |
-+-------------------------+-----------------------------------------------+
-| ``%(funcName)s``        | Name of function containing the logging call. |
-+-------------------------+-----------------------------------------------+
-| ``%(lineno)d``          | Source line number where the logging call was |
-|                         | issued (if available).                        |
-+-------------------------+-----------------------------------------------+
-| ``%(created)f``         | Time when the :class:`LogRecord` was created  |
-|                         | (as returned by :func:`time.time`).           |
-+-------------------------+-----------------------------------------------+
-| ``%(relativeCreated)d`` | Time in milliseconds when the LogRecord was   |
-|                         | created, relative to the time the logging     |
-|                         | module was loaded.                            |
-+-------------------------+-----------------------------------------------+
-| ``%(asctime)s``         | Human-readable time when the                  |
-|                         | :class:`LogRecord` was created.  By default   |
-|                         | this is of the form "2003-07-08 16:49:45,896" |
-|                         | (the numbers after the comma are millisecond  |
-|                         | portion of the time).                         |
-+-------------------------+-----------------------------------------------+
-| ``%(msecs)d``           | Millisecond portion of the time when the      |
-|                         | :class:`LogRecord` was created.               |
-+-------------------------+-----------------------------------------------+
-| ``%(thread)d``          | Thread ID (if available).                     |
-+-------------------------+-----------------------------------------------+
-| ``%(threadName)s``      | Thread name (if available).                   |
-+-------------------------+-----------------------------------------------+
-| ``%(process)d``         | Process ID (if available).                    |
-+-------------------------+-----------------------------------------------+
-| ``%(processName)s``     | Process name (if available).                  |
-+-------------------------+-----------------------------------------------+
-| ``%(message)s``         | The logged message, computed as ``msg %       |
-|                         | args``.                                       |
-+-------------------------+-----------------------------------------------+
-
-
-.. class:: Formatter(fmt=None, datefmt=None)
-
-   Returns a new instance of the :class:`Formatter` class.  The instance is
-   initialized with a format string for the message as a whole, as well as a
-   format string for the date/time portion of a message.  If no *fmt* is
-   specified, ``'%(message)s'`` is used.  If no *datefmt* is specified, the
-   ISO8601 date format is used.
-
-   .. method:: format(record)
-
-      The record's attribute dictionary is used as the operand to a string
-      formatting operation. Returns the resulting string. Before formatting the
-      dictionary, a couple of preparatory steps are carried out. The *message*
-      attribute of the record is computed using *msg* % *args*. If the
-      formatting string contains ``'(asctime)'``, :meth:`formatTime` is called
-      to format the event time. If there is exception information, it is
-      formatted using :meth:`formatException` and appended to the message. Note
-      that the formatted exception information is cached in attribute
-      *exc_text*. This is useful because the exception information can be
-      pickled and sent across the wire, but you should be careful if you have
-      more than one :class:`Formatter` subclass which customizes the formatting
-      of exception information. In this case, you will have to clear the cached
-      value after a formatter has done its formatting, so that the next
-      formatter to handle the event doesn't use the cached value but
-      recalculates it afresh.
-
-      If stack information is available, it's appended after the exception
-      information, using :meth:`formatStack` to transform it if necessary.
-
-
-   .. method:: formatTime(record, datefmt=None)
-
-      This method should be called from :meth:`format` by a formatter which
-      wants to make use of a formatted time. This method can be overridden in
-      formatters to provide for any specific requirement, but the basic behavior
-      is as follows: if *datefmt* (a string) is specified, it is used with
-      :func:`time.strftime` to format the creation time of the
-      record. Otherwise, the ISO8601 format is used.  The resulting string is
-      returned.
-
-
-   .. method:: formatException(exc_info)
-
-      Formats the specified exception information (a standard exception tuple as
-      returned by :func:`sys.exc_info`) as a string. This default implementation
-      just uses :func:`traceback.print_exception`. The resulting string is
-      returned.
-
-   .. method:: formatStack(stack_info)
-
-      Formats the specified stack information (a string as returned by
-      :func:`traceback.print_stack`, but with the last newline removed) as a
-      string. This default implementation just returns the input value.
-
-.. _filter:
-
-Filter Objects
---------------
-
-``Filters`` can be used by ``Handlers`` and ``Loggers`` for more sophisticated
-filtering than is provided by levels. The base filter class only allows events
-which are below a certain point in the logger hierarchy. For example, a filter
-initialized with "A.B" will allow events logged by loggers "A.B", "A.B.C",
-"A.B.C.D", "A.B.D" etc. but not "A.BB", "B.A.B" etc. If initialized with the
-empty string, all events are passed.
-
-
-.. class:: Filter(name='')
-
-   Returns an instance of the :class:`Filter` class. If *name* is specified, it
-   names a logger which, together with its children, will have its events allowed
-   through the filter. If *name* is the empty string, allows every event.
-
-
-   .. method:: filter(record)
-
-      Is the specified record to be logged? Returns zero for no, nonzero for
-      yes. If deemed appropriate, the record may be modified in-place by this
-      method.
-
-Note that filters attached to handlers are consulted whenever an event is
-emitted by the handler, whereas filters attached to loggers are consulted
-whenever an event is logged to the handler (using :meth:`debug`, :meth:`info`,
-etc.) This means that events which have been generated by descendant loggers
-will not be filtered by a logger's filter setting, unless the filter has also
-been applied to those descendant loggers.
-
-You don't actually need to subclass ``Filter``: you can pass any instance
-which has a ``filter`` method with the same semantics.
-
-.. versionchanged:: 3.2
-   You don't need to create specialized ``Filter`` classes, or use other
-   classes with a ``filter`` method: you can use a function (or other
-   callable) as a filter. The filtering logic will check to see if the filter
-   object has a ``filter`` attribute: if it does, it's assumed to be a
-   ``Filter`` and its :meth:`~Filter.filter` method is called. Otherwise, it's
-   assumed to be a callable and called with the record as the single
-   parameter. The returned value should conform to that returned by
-   :meth:`~Filter.filter`.
-
-Other uses for filters
-^^^^^^^^^^^^^^^^^^^^^^
-
-Although filters are used primarily to filter records based on more
-sophisticated criteria than levels, they get to see every record which is
-processed by the handler or logger they're attached to: this can be useful if
-you want to do things like counting how many records were processed by a
-particular logger or handler, or adding, changing or removing attributes in
-the LogRecord being processed. Obviously changing the LogRecord needs to be
-done with some care, but it does allow the injection of contextual information
-into logs (see :ref:`filters-contextual`).
-
-.. _log-record:
-
-LogRecord Objects
------------------
-
-:class:`LogRecord` instances are created automatically by the :class:`Logger`
-every time something is logged, and can be created manually via
-:func:`makeLogRecord` (for example, from a pickled event received over the
-wire).
-
-
-.. class:: LogRecord(name, lvl, pathname, lineno, msg, args, exc_info, func=None, sinfo=None)
-
-   Contains all the information pertinent to the event being logged.
-
-   The primary information is passed in :attr:`msg` and :attr:`args`, which
-   are combined using ``msg % args`` to create the :attr:`message` field of the
-   record.
-
-   .. attribute:: args
-
-      Tuple of arguments to be used in formatting :attr:`msg`.
-
-   .. attribute:: exc_info
-
-      Exception tuple (?? la :func:`sys.exc_info`) or ``None`` if no exception
-      information is available.
-
-   .. attribute:: func
-
-      Name of the function of origin (i.e. in which the logging call was made).
-
-   .. attribute:: lineno
-
-      Line number in the source file of origin.
-
-   .. attribute:: lvl
-
-      Numeric logging level.
-
-   .. attribute:: message
-
-      Bound to the result of :meth:`getMessage` when
-      :meth:`Formatter.format(record)` is invoked.
-
-   .. attribute:: msg
-
-      User-supplied :ref:`format string` or arbitrary object
-      (see :ref:`arbitrary-object-messages`) used in :meth:`getMessage`.
-
-   .. attribute:: name
-
-      Name of the logger that emitted the record.
-
-   .. attribute:: pathname
-
-      Absolute pathname of the source file of origin.
-
-   .. attribute:: stack_info
-
-      Stack frame information (where available) from the bottom of the stack
-      in the current thread, up to and including the stack frame of the
-      logging call which resulted in the creation of this record.
-
-   .. method:: getMessage()
-
-      Returns the message for this :class:`LogRecord` instance after merging any
-      user-supplied arguments with the message. If the user-supplied message
-      argument to the logging call is not a string, :func:`str` is called on it to
-      convert it to a string. This allows use of user-defined classes as
-      messages, whose ``__str__`` method can return the actual format string to
-      be used.
-
-.. _logger-adapter:
-
-LoggerAdapter Objects
----------------------
+      The ``style`` argument was added.
 
-:class:`LoggerAdapter` instances are used to conveniently pass contextual
-information into logging calls. For a usage example , see the section on
-`adding contextual information to your logging output`__.
 
-__ context-info_
+.. function:: shutdown()
 
-.. class:: LoggerAdapter(logger, extra)
+   Informs the logging system to perform an orderly shutdown by flushing and
+   closing all handlers. This should be called at application exit and no
+   further use of the logging system should be made after this call.
 
-  Returns an instance of :class:`LoggerAdapter` initialized with an
-  underlying :class:`Logger` instance and a dict-like object.
 
-  .. method:: process(msg, kwargs)
+.. function:: setLoggerClass(klass)
 
-    Modifies the message and/or keyword arguments passed to a logging call in
-    order to insert contextual information. This implementation takes the object
-    passed as *extra* to the constructor and adds it to *kwargs* using key
-    'extra'. The return value is a (*msg*, *kwargs*) tuple which has the
-    (possibly modified) versions of the arguments passed in.
+   Tells the logging system to use the class *klass* when instantiating a logger.
+   The class should define :meth:`__init__` such that only a name argument is
+   required, and the :meth:`__init__` should call :meth:`Logger.__init__`. This
+   function is typically called before any loggers are instantiated by applications
+   which need to use custom logger behavior.
 
-In addition to the above, :class:`LoggerAdapter` supports the following
-methods of :class:`Logger`, i.e. :meth:`debug`, :meth:`info`, :meth:`warning`,
-:meth:`error`, :meth:`exception`, :meth:`critical`, :meth:`log`,
-:meth:`isEnabledFor`, :meth:`getEffectiveLevel`, :meth:`setLevel`,
-:meth:`hasHandlers`. These methods have the same signatures as their
-counterparts in :class:`Logger`, so you can use the two types of instances
-interchangeably.
 
-.. versionchanged:: 3.2
-   The :meth:`isEnabledFor`, :meth:`getEffectiveLevel`, :meth:`setLevel` and
-   :meth:`hasHandlers` methods were added to :class:`LoggerAdapter`.  These
-   methods delegate to the underlying logger.
+.. function:: setLogRecordFactory(factory)
 
+   Set a callable which is used to create a :class:`LogRecord`.
 
-Thread Safety
--------------
+   :param factory: The factory callable to be used to instantiate a log record.
 
-The logging module is intended to be thread-safe without any special work
-needing to be done by its clients. It achieves this though using threading
-locks; there is one lock to serialize access to the module's shared data, and
-each handler also creates a lock to serialize access to its underlying I/O.
-
-If you are implementing asynchronous signal handlers using the :mod:`signal`
-module, you may not be able to use logging from within such handlers. This is
-because lock implementations in the :mod:`threading` module are not always
-re-entrant, and so cannot be invoked from such signal handlers.
+   .. versionadded:: 3.2
+      This function has been provided, along with :func:`getLogRecordFactory`, to
+      allow developers more control over how the :class:`LogRecord` representing
+      a logging event is constructed.
+
+   The factory has the following signature:
+
+   ``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, **kwargs)``
+
+      :name: The logger name.
+      :level: The logging level (numeric).
+      :fn: The full pathname of the file where the logging call was made.
+      :lno: The line number in the file where the logging call was made.
+      :msg: The logging message.
+      :args: The arguments for the logging message.
+      :exc_info: An exception tuple, or None.
+      :func: The name of the function or method which invoked the logging
+             call.
+      :sinfo: A stack traceback such as is provided by
+              :func:`traceback.print_stack`, showing the call hierarchy.
+      :kwargs: Additional keyword arguments.
 
 
 Integration with the warnings module
@@ -3310,842 +1042,28 @@
    If *capture* is ``True``, warnings issued by the :mod:`warnings` module will
    be redirected to the logging system. Specifically, a warning will be
    formatted using :func:`warnings.formatwarning` and the resulting string
-   logged to a logger named "py.warnings" with a severity of `WARNING`.
+   logged to a logger named 'py.warnings' with a severity of `WARNING`.
 
    If *capture* is ``False``, the redirection of warnings to the logging system
    will stop, and warnings will be redirected to their original destinations
    (i.e. those in effect before `captureWarnings(True)` was called).
 
 
-Configuration
--------------
-
-
-.. _logging-config-api:
-
-Configuration functions
-^^^^^^^^^^^^^^^^^^^^^^^
+.. seealso::
 
-The following functions configure the logging module. They are located in the
-:mod:`logging.config` module.  Their use is optional --- you can configure the
-logging module using these functions or by making calls to the main API (defined
-in :mod:`logging` itself) and defining handlers which are declared either in
-:mod:`logging` or :mod:`logging.handlers`.
-
-.. function:: dictConfig(config)
-
-    Takes the logging configuration from a dictionary.  The contents of
-    this dictionary are described in :ref:`logging-config-dictschema`
-    below.
-
-    If an error is encountered during configuration, this function will
-    raise a :exc:`ValueError`, :exc:`TypeError`, :exc:`AttributeError`
-    or :exc:`ImportError` with a suitably descriptive message.  The
-    following is a (possibly incomplete) list of conditions which will
-    raise an error:
-
-    * A ``level`` which is not a string or which is a string not
-      corresponding to an actual logging level.
-    * A ``propagate`` value which is not a boolean.
-    * An id which does not have a corresponding destination.
-    * A non-existent handler id found during an incremental call.
-    * An invalid logger name.
-    * Inability to resolve to an internal or external object.
-
-    Parsing is performed by the :class:`DictConfigurator` class, whose
-    constructor is passed the dictionary used for configuration, and
-    has a :meth:`configure` method.  The :mod:`logging.config` module
-    has a callable attribute :attr:`dictConfigClass`
-    which is initially set to :class:`DictConfigurator`.
-    You can replace the value of :attr:`dictConfigClass` with a
-    suitable implementation of your own.
-
-    :func:`dictConfig` calls :attr:`dictConfigClass` passing
-    the specified dictionary, and then calls the :meth:`configure` method on
-    the returned object to put the configuration into effect::
-
-          def dictConfig(config):
-              dictConfigClass(config).configure()
-
-    For example, a subclass of :class:`DictConfigurator` could call
-    ``DictConfigurator.__init__()`` in its own :meth:`__init__()`, then
-    set up custom prefixes which would be usable in the subsequent
-    :meth:`configure` call. :attr:`dictConfigClass` would be bound to
-    this new subclass, and then :func:`dictConfig` could be called exactly as
-    in the default, uncustomized state.
-
-.. function:: fileConfig(fname[, defaults])
-
-   Reads the logging configuration from a :mod:`configparser`\-format file named
-   *fname*. This function can be called several times from an application,
-   allowing an end user to select from various pre-canned
-   configurations (if the developer provides a mechanism to present the choices
-   and load the chosen configuration). Defaults to be passed to the ConfigParser
-   can be specified in the *defaults* argument.
-
-
-.. function:: listen(port=DEFAULT_LOGGING_CONFIG_PORT)
-
-   Starts up a socket server on the specified port, and listens for new
-   configurations. If no port is specified, the module's default
-   :const:`DEFAULT_LOGGING_CONFIG_PORT` is used. Logging configurations will be
-   sent as a file suitable for processing by :func:`fileConfig`. Returns a
-   :class:`Thread` instance on which you can call :meth:`start` to start the
-   server, and which you can :meth:`join` when appropriate. To stop the server,
-   call :func:`stopListening`.
-
-   To send a configuration to the socket, read in the configuration file and
-   send it to the socket as a string of bytes preceded by a four-byte length
-   string packed in binary using ``struct.pack('>L', n)``.
-
-
-.. function:: stopListening()
-
-   Stops the listening server which was created with a call to :func:`listen`.
-   This is typically called before calling :meth:`join` on the return value from
-   :func:`listen`.
-
-
-.. _logging-config-dictschema:
-
-Configuration dictionary schema
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Describing a logging configuration requires listing the various
-objects to create and the connections between them; for example, you
-may create a handler named "console" and then say that the logger
-named "startup" will send its messages to the "console" handler.
-These objects aren't limited to those provided by the :mod:`logging`
-module because you might write your own formatter or handler class.
-The parameters to these classes may also need to include external
-objects such as ``sys.stderr``.  The syntax for describing these
-objects and connections is defined in :ref:`logging-config-dict-connections`
-below.
-
-Dictionary Schema Details
-"""""""""""""""""""""""""
-
-The dictionary passed to :func:`dictConfig` must contain the following
-keys:
-
-* *version* - to be set to an integer value representing the schema
-  version.  The only valid value at present is 1, but having this key
-  allows the schema to evolve while still preserving backwards
-  compatibility.
-
-All other keys are optional, but if present they will be interpreted
-as described below.  In all cases below where a 'configuring dict' is
-mentioned, it will be checked for the special ``'()'`` key to see if a
-custom instantiation is required.  If so, the mechanism described in
-:ref:`logging-config-dict-userdef` below is used to create an instance;
-otherwise, the context is used to determine what to instantiate.
-
-* *formatters* - the corresponding value will be a dict in which each
-  key is a formatter id and each value is a dict describing how to
-  configure the corresponding Formatter instance.
-
-  The configuring dict is searched for keys ``format`` and ``datefmt``
-  (with defaults of ``None``) and these are used to construct a
-  :class:`logging.Formatter` instance.
-
-* *filters* - the corresponding value will be a dict in which each key
-  is a filter id and each value is a dict describing how to configure
-  the corresponding Filter instance.
-
-  The configuring dict is searched for the key ``name`` (defaulting to the
-  empty string) and this is used to construct a :class:`logging.Filter`
-  instance.
-
-* *handlers* - the corresponding value will be a dict in which each
-  key is a handler id and each value is a dict describing how to
-  configure the corresponding Handler instance.
-
-  The configuring dict is searched for the following keys:
-
-  * ``class`` (mandatory).  This is the fully qualified name of the
-    handler class.
-
-  * ``level`` (optional).  The level of the handler.
-
-  * ``formatter`` (optional).  The id of the formatter for this
-    handler.
-
-  * ``filters`` (optional).  A list of ids of the filters for this
-    handler.
-
-  All *other* keys are passed through as keyword arguments to the
-  handler's constructor.  For example, given the snippet::
-
-      handlers:
-        console:
-          class : logging.StreamHandler
-          formatter: brief
-          level   : INFO
-          filters: [allow_foo]
-          stream  : ext://sys.stdout
-        file:
-          class : logging.handlers.RotatingFileHandler
-          formatter: precise
-          filename: logconfig.log
-          maxBytes: 1024
-          backupCount: 3
-
-  the handler with id ``console`` is instantiated as a
-  :class:`logging.StreamHandler`, using ``sys.stdout`` as the underlying
-  stream.  The handler with id ``file`` is instantiated as a
-  :class:`logging.handlers.RotatingFileHandler` with the keyword arguments
-  ``filename='logconfig.log', maxBytes=1024, backupCount=3``.
-
-* *loggers* - the corresponding value will be a dict in which each key
-  is a logger name and each value is a dict describing how to
-  configure the corresponding Logger instance.
-
-  The configuring dict is searched for the following keys:
-
-  * ``level`` (optional).  The level of the logger.
-
-  * ``propagate`` (optional).  The propagation setting of the logger.
-
-  * ``filters`` (optional).  A list of ids of the filters for this
-    logger.
-
-  * ``handlers`` (optional).  A list of ids of the handlers for this
-    logger.
-
-  The specified loggers will be configured according to the level,
-  propagation, filters and handlers specified.
-
-* *root* - this will be the configuration for the root logger.
-  Processing of the configuration will be as for any logger, except
-  that the ``propagate`` setting will not be applicable.
-
-* *incremental* - whether the configuration is to be interpreted as
-  incremental to the existing configuration.  This value defaults to
-  ``False``, which means that the specified configuration replaces the
-  existing configuration with the same semantics as used by the
-  existing :func:`fileConfig` API.
-
-  If the specified value is ``True``, the configuration is processed
-  as described in the section on :ref:`logging-config-dict-incremental`.
-
-* *disable_existing_loggers* - whether any existing loggers are to be
-  disabled. This setting mirrors the parameter of the same name in
-  :func:`fileConfig`. If absent, this parameter defaults to ``True``.
-  This value is ignored if *incremental* is ``True``.
-
-.. _logging-config-dict-incremental:
-
-Incremental Configuration
-"""""""""""""""""""""""""
-
-It is difficult to provide complete flexibility for incremental
-configuration.  For example, because objects such as filters
-and formatters are anonymous, once a configuration is set up, it is
-not possible to refer to such anonymous objects when augmenting a
-configuration.
-
-Furthermore, there is not a compelling case for arbitrarily altering
-the object graph of loggers, handlers, filters, formatters at
-run-time, once a configuration is set up; the verbosity of loggers and
-handlers can be controlled just by setting levels (and, in the case of
-loggers, propagation flags).  Changing the object graph arbitrarily in
-a safe way is problematic in a multi-threaded environment; while not
-impossible, the benefits are not worth the complexity it adds to the
-implementation.
-
-Thus, when the ``incremental`` key of a configuration dict is present
-and is ``True``, the system will completely ignore any ``formatters`` and
-``filters`` entries, and process only the ``level``
-settings in the ``handlers`` entries, and the ``level`` and
-``propagate`` settings in the ``loggers`` and ``root`` entries.
-
-Using a value in the configuration dict lets configurations to be sent
-over the wire as pickled dicts to a socket listener. Thus, the logging
-verbosity of a long-running application can be altered over time with
-no need to stop and restart the application.
-
-.. _logging-config-dict-connections:
-
-Object connections
-""""""""""""""""""
-
-The schema describes a set of logging objects - loggers,
-handlers, formatters, filters - which are connected to each other in
-an object graph.  Thus, the schema needs to represent connections
-between the objects.  For example, say that, once configured, a
-particular logger has attached to it a particular handler.  For the
-purposes of this discussion, we can say that the logger represents the
-source, and the handler the destination, of a connection between the
-two.  Of course in the configured objects this is represented by the
-logger holding a reference to the handler.  In the configuration dict,
-this is done by giving each destination object an id which identifies
-it unambiguously, and then using the id in the source object's
-configuration to indicate that a connection exists between the source
-and the destination object with that id.
-
-So, for example, consider the following YAML snippet::
-
-    formatters:
-      brief:
-        # configuration for formatter with id 'brief' goes here
-      precise:
-        # configuration for formatter with id 'precise' goes here
-    handlers:
-      h1: #This is an id
-       # configuration of handler with id 'h1' goes here
-       formatter: brief
-      h2: #This is another id
-       # configuration of handler with id 'h2' goes here
-       formatter: precise
-    loggers:
-      foo.bar.baz:
-        # other configuration for logger 'foo.bar.baz'
-        handlers: [h1, h2]
-
-(Note: YAML used here because it's a little more readable than the
-equivalent Python source form for the dictionary.)
-
-The ids for loggers are the logger names which would be used
-programmatically to obtain a reference to those loggers, e.g.
-``foo.bar.baz``.  The ids for Formatters and Filters can be any string
-value (such as ``brief``, ``precise`` above) and they are transient,
-in that they are only meaningful for processing the configuration
-dictionary and used to determine connections between objects, and are
-not persisted anywhere when the configuration call is complete.
-
-The above snippet indicates that logger named ``foo.bar.baz`` should
-have two handlers attached to it, which are described by the handler
-ids ``h1`` and ``h2``. The formatter for ``h1`` is that described by id
-``brief``, and the formatter for ``h2`` is that described by id
-``precise``.
-
-
-.. _logging-config-dict-userdef:
-
-User-defined objects
-""""""""""""""""""""
-
-The schema supports user-defined objects for handlers, filters and
-formatters.  (Loggers do not need to have different types for
-different instances, so there is no support in this configuration
-schema for user-defined logger classes.)
-
-Objects to be configured are described by dictionaries
-which detail their configuration.  In some places, the logging system
-will be able to infer from the context how an object is to be
-instantiated, but when a user-defined object is to be instantiated,
-the system will not know how to do this.  In order to provide complete
-flexibility for user-defined object instantiation, the user needs
-to provide a 'factory' - a callable which is called with a
-configuration dictionary and which returns the instantiated object.
-This is signalled by an absolute import path to the factory being
-made available under the special key ``'()'``.  Here's a concrete
-example::
-
-    formatters:
-      brief:
-        format: '%(message)s'
-      default:
-        format: '%(asctime)s %(levelname)-8s %(name)-15s %(message)s'
-        datefmt: '%Y-%m-%d %H:%M:%S'
-      custom:
-          (): my.package.customFormatterFactory
-          bar: baz
-          spam: 99.9
-          answer: 42
-
-The above YAML snippet defines three formatters.  The first, with id
-``brief``, is a standard :class:`logging.Formatter` instance with the
-specified format string.  The second, with id ``default``, has a
-longer format and also defines the time format explicitly, and will
-result in a :class:`logging.Formatter` initialized with those two format
-strings.  Shown in Python source form, the ``brief`` and ``default``
-formatters have configuration sub-dictionaries::
-
-    {
-      'format' : '%(message)s'
-    }
-
-and::
-
-    {
-      'format' : '%(asctime)s %(levelname)-8s %(name)-15s %(message)s',
-      'datefmt' : '%Y-%m-%d %H:%M:%S'
-    }
-
-respectively, and as these dictionaries do not contain the special key
-``'()'``, the instantiation is inferred from the context: as a result,
-standard :class:`logging.Formatter` instances are created.  The
-configuration sub-dictionary for the third formatter, with id
-``custom``, is::
-
-  {
-    '()' : 'my.package.customFormatterFactory',
-    'bar' : 'baz',
-    'spam' : 99.9,
-    'answer' : 42
-  }
-
-and this contains the special key ``'()'``, which means that
-user-defined instantiation is wanted.  In this case, the specified
-factory callable will be used. If it is an actual callable it will be
-used directly - otherwise, if you specify a string (as in the example)
-the actual callable will be located using normal import mechanisms.
-The callable will be called with the **remaining** items in the
-configuration sub-dictionary as keyword arguments.  In the above
-example, the formatter with id ``custom`` will be assumed to be
-returned by the call::
-
-    my.package.customFormatterFactory(bar='baz', spam=99.9, answer=42)
-
-The key ``'()'`` has been used as the special key because it is not a
-valid keyword parameter name, and so will not clash with the names of
-the keyword arguments used in the call.  The ``'()'`` also serves as a
-mnemonic that the corresponding value is a callable.
-
-
-.. _logging-config-dict-externalobj:
-
-Access to external objects
-""""""""""""""""""""""""""
-
-There are times where a configuration needs to refer to objects
-external to the configuration, for example ``sys.stderr``.  If the
-configuration dict is constructed using Python code, this is
-straightforward, but a problem arises when the configuration is
-provided via a text file (e.g. JSON, YAML).  In a text file, there is
-no standard way to distinguish ``sys.stderr`` from the literal string
-``'sys.stderr'``.  To facilitate this distinction, the configuration
-system looks for certain special prefixes in string values and
-treat them specially.  For example, if the literal string
-``'ext://sys.stderr'`` is provided as a value in the configuration,
-then the ``ext://`` will be stripped off and the remainder of the
-value processed using normal import mechanisms.
-
-The handling of such prefixes is done in a way analogous to protocol
-handling: there is a generic mechanism to look for prefixes which
-match the regular expression ``^(?P[a-z]+)://(?P.*)$``
-whereby, if the ``prefix`` is recognised, the ``suffix`` is processed
-in a prefix-dependent manner and the result of the processing replaces
-the string value.  If the prefix is not recognised, then the string
-value will be left as-is.
-
-
-.. _logging-config-dict-internalobj:
-
-Access to internal objects
-""""""""""""""""""""""""""
-
-As well as external objects, there is sometimes also a need to refer
-to objects in the configuration.  This will be done implicitly by the
-configuration system for things that it knows about.  For example, the
-string value ``'DEBUG'`` for a ``level`` in a logger or handler will
-automatically be converted to the value ``logging.DEBUG``, and the
-``handlers``, ``filters`` and ``formatter`` entries will take an
-object id and resolve to the appropriate destination object.
-
-However, a more generic mechanism is needed for user-defined
-objects which are not known to the :mod:`logging` module.  For
-example, consider :class:`logging.handlers.MemoryHandler`, which takes
-a ``target`` argument which is another handler to delegate to. Since
-the system already knows about this class, then in the configuration,
-the given ``target`` just needs to be the object id of the relevant
-target handler, and the system will resolve to the handler from the
-id.  If, however, a user defines a ``my.package.MyHandler`` which has
-an ``alternate`` handler, the configuration system would not know that
-the ``alternate`` referred to a handler.  To cater for this, a generic
-resolution system allows the user to specify::
-
-    handlers:
-      file:
-        # configuration of file handler goes here
-
-      custom:
-        (): my.package.MyHandler
-        alternate: cfg://handlers.file
-
-The literal string ``'cfg://handlers.file'`` will be resolved in an
-analogous way to strings with the ``ext://`` prefix, but looking
-in the configuration itself rather than the import namespace.  The
-mechanism allows access by dot or by index, in a similar way to
-that provided by ``str.format``.  Thus, given the following snippet::
-
-    handlers:
-      email:
-        class: logging.handlers.SMTPHandler
-        mailhost: localhost
-        fromaddr: my_app at domain.tld
-        toaddrs:
-          - support_team at domain.tld
-          - dev_team at domain.tld
-        subject: Houston, we have a problem.
-
-in the configuration, the string ``'cfg://handlers'`` would resolve to
-the dict with key ``handlers``, the string ``'cfg://handlers.email``
-would resolve to the dict with key ``email`` in the ``handlers`` dict,
-and so on.  The string ``'cfg://handlers.email.toaddrs[1]`` would
-resolve to ``'dev_team.domain.tld'`` and the string
-``'cfg://handlers.email.toaddrs[0]'`` would resolve to the value
-``'support_team at domain.tld'``. The ``subject`` value could be accessed
-using either ``'cfg://handlers.email.subject'`` or, equivalently,
-``'cfg://handlers.email[subject]'``.  The latter form only needs to be
-used if the key contains spaces or non-alphanumeric characters.  If an
-index value consists only of decimal digits, access will be attempted
-using the corresponding integer value, falling back to the string
-value if needed.
-
-Given a string ``cfg://handlers.myhandler.mykey.123``, this will
-resolve to ``config_dict['handlers']['myhandler']['mykey']['123']``.
-If the string is specified as ``cfg://handlers.myhandler.mykey[123]``,
-the system will attempt to retrieve the value from
-``config_dict['handlers']['myhandler']['mykey'][123]``, and fall back
-to ``config_dict['handlers']['myhandler']['mykey']['123']`` if that
-fails.
-
-.. _logging-config-fileformat:
-
-Configuration file format
-^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The configuration file format understood by :func:`fileConfig` is based on
-:mod:`configparser` functionality. The file must contain sections called
-``[loggers]``, ``[handlers]`` and ``[formatters]`` which identify by name the
-entities of each type which are defined in the file. For each such entity, there
-is a separate section which identifies how that entity is configured.  Thus, for
-a logger named ``log01`` in the ``[loggers]`` section, the relevant
-configuration details are held in a section ``[logger_log01]``. Similarly, a
-handler called ``hand01`` in the ``[handlers]`` section will have its
-configuration held in a section called ``[handler_hand01]``, while a formatter
-called ``form01`` in the ``[formatters]`` section will have its configuration
-specified in a section called ``[formatter_form01]``. The root logger
-configuration must be specified in a section called ``[logger_root]``.
-
-Examples of these sections in the file are given below. ::
-
-   [loggers]
-   keys=root,log02,log03,log04,log05,log06,log07
-
-   [handlers]
-   keys=hand01,hand02,hand03,hand04,hand05,hand06,hand07,hand08,hand09
-
-   [formatters]
-   keys=form01,form02,form03,form04,form05,form06,form07,form08,form09
-
-The root logger must specify a level and a list of handlers. An example of a
-root logger section is given below. ::
-
-   [logger_root]
-   level=NOTSET
-   handlers=hand01
-
-The ``level`` entry can be one of ``DEBUG, INFO, WARNING, ERROR, CRITICAL`` or
-``NOTSET``. For the root logger only, ``NOTSET`` means that all messages will be
-logged. Level values are :func:`eval`\ uated in the context of the ``logging``
-package's namespace.
-
-The ``handlers`` entry is a comma-separated list of handler names, which must
-appear in the ``[handlers]`` section. These names must appear in the
-``[handlers]`` section and have corresponding sections in the configuration
-file.
-
-For loggers other than the root logger, some additional information is required.
-This is illustrated by the following example. ::
-
-   [logger_parser]
-   level=DEBUG
-   handlers=hand01
-   propagate=1
-   qualname=compiler.parser
-
-The ``level`` and ``handlers`` entries are interpreted as for the root logger,
-except that if a non-root logger's level is specified as ``NOTSET``, the system
-consults loggers higher up the hierarchy to determine the effective level of the
-logger. The ``propagate`` entry is set to 1 to indicate that messages must
-propagate to handlers higher up the logger hierarchy from this logger, or 0 to
-indicate that messages are **not** propagated to handlers up the hierarchy. The
-``qualname`` entry is the hierarchical channel name of the logger, that is to
-say the name used by the application to get the logger.
-
-Sections which specify handler configuration are exemplified by the following.
-::
-
-   [handler_hand01]
-   class=StreamHandler
-   level=NOTSET
-   formatter=form01
-   args=(sys.stdout,)
-
-The ``class`` entry indicates the handler's class (as determined by :func:`eval`
-in the ``logging`` package's namespace). The ``level`` is interpreted as for
-loggers, and ``NOTSET`` is taken to mean "log everything".
-
-The ``formatter`` entry indicates the key name of the formatter for this
-handler. If blank, a default formatter (``logging._defaultFormatter``) is used.
-If a name is specified, it must appear in the ``[formatters]`` section and have
-a corresponding section in the configuration file.
-
-The ``args`` entry, when :func:`eval`\ uated in the context of the ``logging``
-package's namespace, is the list of arguments to the constructor for the handler
-class. Refer to the constructors for the relevant handlers, or to the examples
-below, to see how typical entries are constructed. ::
-
-   [handler_hand02]
-   class=FileHandler
-   level=DEBUG
-   formatter=form02
-   args=('python.log', 'w')
-
-   [handler_hand03]
-   class=handlers.SocketHandler
-   level=INFO
-   formatter=form03
-   args=('localhost', handlers.DEFAULT_TCP_LOGGING_PORT)
-
-   [handler_hand04]
-   class=handlers.DatagramHandler
-   level=WARN
-   formatter=form04
-   args=('localhost', handlers.DEFAULT_UDP_LOGGING_PORT)
-
-   [handler_hand05]
-   class=handlers.SysLogHandler
-   level=ERROR
-   formatter=form05
-   args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER)
-
-   [handler_hand06]
-   class=handlers.NTEventLogHandler
-   level=CRITICAL
-   formatter=form06
-   args=('Python Application', '', 'Application')
-
-   [handler_hand07]
-   class=handlers.SMTPHandler
-   level=WARN
-   formatter=form07
-   args=('localhost', 'from at abc', ['user1 at abc', 'user2 at xyz'], 'Logger Subject')
-
-   [handler_hand08]
-   class=handlers.MemoryHandler
-   level=NOTSET
-   formatter=form08
-   target=
-   args=(10, ERROR)
-
-   [handler_hand09]
-   class=handlers.HTTPHandler
-   level=NOTSET
-   formatter=form09
-   args=('localhost:9022', '/log', 'GET')
-
-Sections which specify formatter configuration are typified by the following. ::
-
-   [formatter_form01]
-   format=F1 %(asctime)s %(levelname)s %(message)s
-   datefmt=
-   class=logging.Formatter
-
-The ``format`` entry is the overall format string, and the ``datefmt`` entry is
-the :func:`strftime`\ -compatible date/time format string.  If empty, the
-package substitutes ISO8601 format date/times, which is almost equivalent to
-specifying the date format string ``"%Y-%m-%d %H:%M:%S"``.  The ISO8601 format
-also specifies milliseconds, which are appended to the result of using the above
-format string, with a comma separator.  An example time in ISO8601 format is
-``2003-01-23 00:29:50,411``.
-
-The ``class`` entry is optional.  It indicates the name of the formatter's class
-(as a dotted module and class name.)  This option is useful for instantiating a
-:class:`Formatter` subclass.  Subclasses of :class:`Formatter` can present
-exception tracebacks in an expanded or condensed format.
-
-
-Configuration server example
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Here is an example of a module using the logging configuration server::
-
-    import logging
-    import logging.config
-    import time
-    import os
-
-    # read initial config file
-    logging.config.fileConfig("logging.conf")
-
-    # create and start listener on port 9999
-    t = logging.config.listen(9999)
-    t.start()
-
-    logger = logging.getLogger("simpleExample")
-
-    try:
-        # loop through logging calls to see the difference
-        # new configurations make, until Ctrl+C is pressed
-        while True:
-            logger.debug("debug message")
-            logger.info("info message")
-            logger.warn("warn message")
-            logger.error("error message")
-            logger.critical("critical message")
-            time.sleep(5)
-    except KeyboardInterrupt:
-        # cleanup
-        logging.config.stopListening()
-        t.join()
-
-And here is a script that takes a filename and sends that file to the server,
-properly preceded with the binary-encoded length, as the new logging
-configuration::
-
-    #!/usr/bin/env python
-    import socket, sys, struct
-
-    data_to_send = open(sys.argv[1], "r").read()
-
-    HOST = 'localhost'
-    PORT = 9999
-    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-    print("connecting...")
-    s.connect((HOST, PORT))
-    print("sending config...")
-    s.send(struct.pack(">L", len(data_to_send)))
-    s.send(data_to_send)
-    s.close()
-    print("complete")
+   Module :mod:`logging.config`
+      Configuration API for the logging module.
 
+   Module :mod:`logging.handlers`
+      Useful handlers included with the logging module.
 
-More examples
--------------
-
-Multiple handlers and formatters
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   :pep:`282` - A Logging System
+      The proposal which described this feature for inclusion in the Python standard
+      library.
 
-Loggers are plain Python objects.  The :func:`addHandler` method has no minimum
-or maximum quota for the number of handlers you may add.  Sometimes it will be
-beneficial for an application to log all messages of all severities to a text
-file while simultaneously logging errors or above to the console.  To set this
-up, simply configure the appropriate handlers.  The logging calls in the
-application code will remain unchanged.  Here is a slight modification to the
-previous simple module-based configuration example::
-
-    import logging
-
-    logger = logging.getLogger("simple_example")
-    logger.setLevel(logging.DEBUG)
-    # create file handler which logs even debug messages
-    fh = logging.FileHandler("spam.log")
-    fh.setLevel(logging.DEBUG)
-    # create console handler with a higher log level
-    ch = logging.StreamHandler()
-    ch.setLevel(logging.ERROR)
-    # create formatter and add it to the handlers
-    formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
-    ch.setFormatter(formatter)
-    fh.setFormatter(formatter)
-    # add the handlers to logger
-    logger.addHandler(ch)
-    logger.addHandler(fh)
-
-    # "application" code
-    logger.debug("debug message")
-    logger.info("info message")
-    logger.warn("warn message")
-    logger.error("error message")
-    logger.critical("critical message")
-
-Notice that the "application" code does not care about multiple handlers.  All
-that changed was the addition and configuration of a new handler named *fh*.
-
-The ability to create new handlers with higher- or lower-severity filters can be
-very helpful when writing and testing an application.  Instead of using many
-``print`` statements for debugging, use ``logger.debug``: Unlike the print
-statements, which you will have to delete or comment out later, the logger.debug
-statements can remain intact in the source code and remain dormant until you
-need them again.  At that time, the only change that needs to happen is to
-modify the severity level of the logger and/or handler to debug.
-
-
-Using logging in multiple modules
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-It was mentioned above that multiple calls to
-``logging.getLogger('someLogger')`` return a reference to the same logger
-object.  This is true not only within the same module, but also across modules
-as long as it is in the same Python interpreter process.  It is true for
-references to the same object; additionally, application code can define and
-configure a parent logger in one module and create (but not configure) a child
-logger in a separate module, and all logger calls to the child will pass up to
-the parent.  Here is a main module::
-
-    import logging
-    import auxiliary_module
-
-    # create logger with "spam_application"
-    logger = logging.getLogger("spam_application")
-    logger.setLevel(logging.DEBUG)
-    # create file handler which logs even debug messages
-    fh = logging.FileHandler("spam.log")
-    fh.setLevel(logging.DEBUG)
-    # create console handler with a higher log level
-    ch = logging.StreamHandler()
-    ch.setLevel(logging.ERROR)
-    # create formatter and add it to the handlers
-    formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
-    fh.setFormatter(formatter)
-    ch.setFormatter(formatter)
-    # add the handlers to the logger
-    logger.addHandler(fh)
-    logger.addHandler(ch)
-
-    logger.info("creating an instance of auxiliary_module.Auxiliary")
-    a = auxiliary_module.Auxiliary()
-    logger.info("created an instance of auxiliary_module.Auxiliary")
-    logger.info("calling auxiliary_module.Auxiliary.do_something")
-    a.do_something()
-    logger.info("finished auxiliary_module.Auxiliary.do_something")
-    logger.info("calling auxiliary_module.some_function()")
-    auxiliary_module.some_function()
-    logger.info("done with auxiliary_module.some_function()")
-
-Here is the auxiliary module::
-
-    import logging
-
-    # create logger
-    module_logger = logging.getLogger("spam_application.auxiliary")
-
-    class Auxiliary:
-        def __init__(self):
-            self.logger = logging.getLogger("spam_application.auxiliary.Auxiliary")
-            self.logger.info("creating an instance of Auxiliary")
-        def do_something(self):
-            self.logger.info("doing something")
-            a = 1 + 1
-            self.logger.info("done doing something")
-
-    def some_function():
-        module_logger.info("received a call to \"some_function\"")
-
-The output looks like this::
-
-    2005-03-23 23:47:11,663 - spam_application - INFO -
-       creating an instance of auxiliary_module.Auxiliary
-    2005-03-23 23:47:11,665 - spam_application.auxiliary.Auxiliary - INFO -
-       creating an instance of Auxiliary
-    2005-03-23 23:47:11,665 - spam_application - INFO -
-       created an instance of auxiliary_module.Auxiliary
-    2005-03-23 23:47:11,668 - spam_application - INFO -
-       calling auxiliary_module.Auxiliary.do_something
-    2005-03-23 23:47:11,668 - spam_application.auxiliary.Auxiliary - INFO -
-       doing something
-    2005-03-23 23:47:11,669 - spam_application.auxiliary.Auxiliary - INFO -
-       done doing something
-    2005-03-23 23:47:11,670 - spam_application - INFO -
-       finished auxiliary_module.Auxiliary.do_something
-    2005-03-23 23:47:11,671 - spam_application - INFO -
-       calling auxiliary_module.some_function()
-    2005-03-23 23:47:11,672 - spam_application.auxiliary - INFO -
-       received a call to "some_function"
-    2005-03-23 23:47:11,673 - spam_application - INFO -
-       done with auxiliary_module.some_function()
+   `Original Python logging package `_
+      This is the original source for the :mod:`logging` package.  The version of the
+      package available from this site is suitable for use with Python 1.5.2, 2.1.x
+      and 2.2.x, which do not include the :mod:`logging` package in the standard
+      library.
 

Modified: python/branches/py3k-cdecimal/Doc/library/msilib.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/msilib.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/msilib.rst	Sun Jan  2 13:18:37 2011
@@ -351,7 +351,7 @@
 -----------------
 
 
-.. class:: Directory(database, cab, basedir, physical,  logical, default, component, [componentflags])
+.. class:: Directory(database, cab, basedir, physical,  logical, default, [componentflags])
 
    Create a new directory in the Directory table. There is a current component at
    each point in time for the directory, which is either explicitly created through

Modified: python/branches/py3k-cdecimal/Doc/library/multiprocessing.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/multiprocessing.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/multiprocessing.rst	Sun Jan  2 13:18:37 2011
@@ -1,8 +1,8 @@
-:mod:`multiprocessing` --- Process-based "threading" interface
-==============================================================
+:mod:`multiprocessing` --- Process-based parallelism
+====================================================
 
 .. module:: multiprocessing
-   :synopsis: Process-based "threading" interface.
+   :synopsis: Process-based parallelism.
 
 
 Introduction

Modified: python/branches/py3k-cdecimal/Doc/library/os.path.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/os.path.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/os.path.rst	Sun Jan  2 13:18:37 2011
@@ -228,7 +228,7 @@
 
    *start* defaults to :attr:`os.curdir`.
 
-   Availability:  Windows, Unix.
+   Availability: Unix, Windows.
 
 
 .. function:: samefile(path1, path2)
@@ -241,7 +241,7 @@
    name using the Windows API call GetFinalPathNameByHandle. This function
    raises an exception if handles cannot be obtained to either file.
 
-   Availability: Windows, Unix.
+   Availability: Unix, Windows.
 
    .. versionchanged:: 3.2
       Added Windows support.

Modified: python/branches/py3k-cdecimal/Doc/library/os.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/os.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/os.rst	Sun Jan  2 13:18:37 2011
@@ -1058,7 +1058,10 @@
 
    Create a hard link pointing to *source* named *link_name*.
 
-   Availability: Unix.
+   Availability: Unix, Windows.
+
+   .. versionchanged:: 3.2
+      Added Windows support.
 
 
 .. function:: listdir(path='.')
@@ -1140,25 +1143,31 @@
    Availability: Unix, Windows.
 
 
-.. function:: makedirs(path[, mode])
+.. function:: makedirs(path, mode=0o777, exist_ok=False)
 
    .. index::
       single: directory; creating
       single: UNC paths; and os.makedirs()
 
    Recursive directory creation function.  Like :func:`mkdir`, but makes all
-   intermediate-level directories needed to contain the leaf directory.  Throws
-   an :exc:`error` exception if the leaf directory already exists or cannot be
-   created.  The default *mode* is ``0o777`` (octal).  On some systems, *mode*
-   is ignored. Where it is used, the current umask value is first masked out.
+   intermediate-level directories needed to contain the leaf directory.  If
+   the target directory with the same mode as specified already exists,
+   raises an :exc:`OSError` exception if *exist_ok* is False, otherwise no
+   exception is raised.  If the directory cannot be created in other cases,
+   raises an :exc:`OSError` exception.  The default *mode* is ``0o777`` (octal).
+   On some systems, *mode* is ignored.  Where it is used, the current umask
+   value is first masked out.
 
    .. note::
 
-      :func:`makedirs` will become confused if the path elements to create include
-      :data:`os.pardir`.
+      :func:`makedirs` will become confused if the path elements to create
+      include :data:`pardir`.
 
    This function handles UNC paths correctly.
 
+   .. versionadded:: 3.2
+      The *exist_ok* parameter.
+
 
 .. function:: pathconf(path, name)
 
@@ -1383,7 +1392,18 @@
 
    Symbolic link support was introduced in Windows 6.0 (Vista).  :func:`symlink`
    will raise a :exc:`NotImplementedError` on Windows versions earlier than 6.0.
-   The *SeCreateSymbolicLinkPrivilege* is required in order to create symlinks.
+
+   .. note::
+
+      The *SeCreateSymbolicLinkPrivilege* is required in order to successfully
+      create symlinks. This privilege is not typically granted to regular
+      users but is available to accounts which can escalate privileges to the
+      administrator level. Either obtaining the privilege or running your
+      application as an administrator are ways to successfully create symlinks.
+
+
+      :exc:`OSError` is raised when the function is called by an unprivileged
+      user.
 
    Availability: Unix, Windows.
 

Modified: python/branches/py3k-cdecimal/Doc/library/parser.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/parser.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/parser.rst	Sun Jan  2 13:18:37 2011
@@ -268,7 +268,7 @@
    will only need to be aware of the simple string values.
 
 Note that the functions :func:`compilest`, :func:`expr`, and :func:`suite` may
-raise exceptions which are normally thrown by the parsing and compilation
+raise exceptions which are normally raised by the parsing and compilation
 process.  These include the built in exceptions :exc:`MemoryError`,
 :exc:`OverflowError`, :exc:`SyntaxError`, and :exc:`SystemError`.  In these
 cases, these exceptions carry all the meaning normally associated with them.

Modified: python/branches/py3k-cdecimal/Doc/library/pdb.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/pdb.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/pdb.rst	Sun Jan  2 13:18:37 2011
@@ -135,7 +135,8 @@
 :class:`Pdb` class and calling the method of the same name.  If you want to
 access further features, you have to do this yourself:
 
-.. class:: Pdb(completekey='tab', stdin=None, stdout=None, skip=None)
+.. class:: Pdb(completekey='tab', stdin=None, stdout=None, skip=None, \
+               nosigint=False)
 
    :class:`Pdb` is the debugger class.
 
@@ -146,6 +147,11 @@
    patterns.  The debugger will not step into frames that originate in a module
    that matches one of these patterns. [1]_
 
+   By default, Pdb sets a handler for the SIGINT signal (which is sent when the
+   user presses Ctrl-C on the console) when you give a ``continue`` command.
+   This allows you to break into the debugger again by pressing Ctrl-C.  If you
+   want Pdb not to touch the SIGINT handler, set *nosigint* tot true.
+
    Example call to enable tracing with *skip*::
 
       import pdb; pdb.Pdb(skip=['django.*']).set_trace()
@@ -153,6 +159,10 @@
    .. versionadded:: 3.1
       The *skip* argument.
 
+   .. versionadded:: 3.2
+      The *nosigint* argument.  Previously, a SIGINT handler was never set by
+      Pdb.
+
    .. method:: run(statement, globals=None, locals=None)
                runeval(expression, globals=None, locals=None)
                runcall(function, *args, **kwds)
@@ -256,8 +266,9 @@
    Temporary breakpoint, which is removed automatically when it is first hit.
    The arguments are the same as for :pdbcmd:`break`.
 
-.. pdbcommand:: cl(ear) [bpnumber [bpnumber ...]]
+.. pdbcommand:: cl(ear) [filename:lineno | bpnumber [bpnumber ...]]
 
+   With a *filename:lineno* argument, clear all the breakpoints at this line.
    With a space separated list of breakpoint numbers, clear those breakpoints.
    Without argument, clear all breaks (but first ask confirmation).
 
@@ -406,6 +417,30 @@
 
    .. versionadded:: 3.2
 
+.. pdbcommand:: display [expression]
+
+   Display the value of the expression if it changed, each time execution stops
+   in the current frame.
+
+   Without expression, list all display expressions for the current frame.
+
+   .. versionadded:: 3.2
+
+.. pdbcommand:: undisplay [expression]
+
+   Do not display the expression any more in the current frame.  Without
+   expression, clear all display expressions for the current frame.
+
+   .. versionadded:: 3.2
+
+.. pdbcommand:: interact
+
+   Start an interative interpreter (using the :mod:`code` module) whose global
+   namespace contains all the (global and local) names found in the current
+   scope.
+
+   .. versionadded:: 3.2
+
 .. _debugger-aliases:
 
 .. pdbcommand:: alias [name [command]]

Modified: python/branches/py3k-cdecimal/Doc/library/pickle.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/pickle.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/pickle.rst	Sun Jan  2 13:18:37 2011
@@ -42,7 +42,7 @@
 objects.  :mod:`marshal` exists primarily to support Python's :file:`.pyc`
 files.
 
-The :mod:`pickle` module differs from :mod:`marshal` several significant ways:
+The :mod:`pickle` module differs from :mod:`marshal` in several significant ways:
 
 * The :mod:`pickle` module keeps track of the objects it has already serialized,
   so that later references to the same object won't be serialized again.

Modified: python/branches/py3k-cdecimal/Doc/library/pkgutil.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/pkgutil.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/pkgutil.rst	Sun Jan  2 13:18:37 2011
@@ -77,8 +77,8 @@
    newly created by a path hook.
 
    If there is no importer, a wrapper around the basic import machinery is
-   returned.  This wrapper is never inserted into the importer cache (None is
-   inserted instead).
+   returned.  This wrapper is never inserted into the importer cache (``None``
+   is inserted instead).
 
    The cache (or part of it) can be cleared manually if a rescan of
    :data:`sys.path_hooks` is necessary.

Modified: python/branches/py3k-cdecimal/Doc/library/platform.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/platform.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/platform.rst	Sun Jan  2 13:18:37 2011
@@ -36,6 +36,16 @@
    and then only if the executable points to the Python interpreter.  Reasonable
    defaults are used when the above needs are not met.
 
+   .. note::
+
+      On Mac OS X (and perhaps other platforms), executable files may be
+      universal files containing multiple architectures.
+
+      To get at the "64-bitness" of the current interpreter, it is more
+      reliable to query the :attr:`sys.maxsize` attribute::
+
+         is_64bits = sys.maxsize > 2**32
+
 
 .. function:: machine()
 
@@ -186,7 +196,7 @@
 
    .. note::
 
-      Note: this function works best with Mark Hammond's
+      This function works best with Mark Hammond's
       :mod:`win32all` package installed, but also on Python 2.3 and
       later (support for this was added in Python 2.6). It obviously
       only runs on Win32 compatible platforms.

Modified: python/branches/py3k-cdecimal/Doc/library/pty.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/pty.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/pty.rst	Sun Jan  2 13:18:37 2011
@@ -45,3 +45,50 @@
    a file descriptor. The defaults try to read 1024 bytes each time they are
    called.
 
+
+Example
+-------
+
+.. sectionauthor:: Steen Lumholt
+
+The following program acts like the Unix command :manpage:`script(1)`, using a
+pseudo-terminal to record all input and output of a terminal session in a
+"typescript". ::
+
+   import sys, os, time, getopt
+   import pty
+
+   mode = 'wb'
+   shell = 'sh'
+   filename = 'typescript'
+   if 'SHELL' in os.environ:
+       shell = os.environ['SHELL']
+
+   try:
+       opts, args = getopt.getopt(sys.argv[1:], 'ap')
+   except getopt.error as msg:
+       print('%s: %s' % (sys.argv[0], msg))
+       sys.exit(2)
+
+   for opt, arg in opts:
+       # option -a: append to typescript file
+       if opt == '-a':
+           mode = 'ab'
+       # option -p: use a Python shell as the terminal command
+       elif opt == '-p':
+           shell = sys.executable
+   if args:
+       filename = args[0]
+
+   script = open(filename, mode)
+
+   def read(fd):
+       data = os.read(fd, 1024)
+       script.write(data)
+       return data
+
+   sys.stdout.write('Script started, file is %s\n' % filename)
+   script.write(('Script started on %s\n' % time.asctime()).encode())
+   pty.spawn(shell, read)
+   script.write(('Script done on %s\n' % time.asctime()).encode())
+   sys.stdout.write('Script done, file is %s\n' % filename)

Modified: python/branches/py3k-cdecimal/Doc/library/py_compile.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/py_compile.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/py_compile.rst	Sun Jan  2 13:18:37 2011
@@ -22,20 +22,29 @@
    Exception raised when an error occurs while attempting to compile the file.
 
 
-.. function:: compile(file, cfile=None, dfile=None, doraise=False)
+.. function:: compile(file, cfile=None, dfile=None, doraise=False, optimize=-1)
 
-   Compile a source file to byte-code and write out the byte-code cache  file.  The
-   source code is loaded from the file name *file*.  The  byte-code is written to
-   *cfile*, which defaults to the :PEP:`3147` path, ending in ``.pyc``
-   (``'.pyo`` if optimization is enabled in the current interpreter).  For
-   example, if *file* is ``/foo/bar/baz.py`` *cfile* will default to
-   ``/foo/bar/__pycache__/baz.cpython-32.pyc`` for Python 3.2.  If *dfile* is specified, it is used as the
-   name of the source file in error messages instead of *file*.  If *doraise* is
-   true, a :exc:`PyCompileError` is raised when an error is encountered while
-   compiling *file*. If *doraise* is false (the default), an error string is
-   written to ``sys.stderr``, but no exception is raised.  This function
-   returns the path to byte-compiled file, i.e. whatever *cfile* value was
-   used.
+   Compile a source file to byte-code and write out the byte-code cache  file.
+   The source code is loaded from the file name *file*.  The  byte-code is
+   written to *cfile*, which defaults to the :PEP:`3147` path, ending in
+   ``.pyc`` (``.pyo`` if optimization is enabled in the current interpreter).
+   For example, if *file* is ``/foo/bar/baz.py`` *cfile* will default to
+   ``/foo/bar/__pycache__/baz.cpython-32.pyc`` for Python 3.2.  If *dfile* is
+   specified, it is used as the name of the source file in error messages when
+   instead of *file*.  If *doraise* is true, a :exc:`PyCompileError` is raised
+   when an error is encountered while compiling *file*. If *doraise* is false
+   (the default), an error string is written to ``sys.stderr``, but no exception
+   is raised.  This function returns the path to byte-compiled file, i.e.
+   whatever *cfile* value was used.
+
+   *optimize* controls the optimization level and is passed to the built-in
+   :func:`compile` function.  The default of ``-1`` selects the optimization
+   level of the current interpreter.
+
+   .. versionchanged:: 3.2
+      Changed default value of *cfile* to be :PEP:`3147`-compliant.  Previous
+      default was *file* + ``'c'`` (``'o'`` if optimization was enabled).
+      Also added the *optimize* parameter.
 
 
 .. function:: main(args=None)
@@ -44,6 +53,11 @@
    line, if *args* is ``None``) are compiled and the resulting bytecode is
    cached in the normal manner.  This function does not search a directory
    structure to locate source files; it only compiles files named explicitly.
+   If ``'-'`` is the only parameter in args, the list of files is taken from
+   standard input.
+
+   .. versionchanged:: 3.2
+      Added support for ``'-'``.
 
 When this module is run as a script, the :func:`main` is used to compile all the
 files named on the command line.  The exit status is nonzero if one of the files

Modified: python/branches/py3k-cdecimal/Doc/library/pydoc.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/pydoc.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/pydoc.rst	Sun Jan  2 13:18:37 2011
@@ -50,12 +50,21 @@
 module is the first line of its documentation string.
 
 You can also use :program:`pydoc` to start an HTTP server on the local machine
-that will serve documentation to visiting Web browsers. :program:`pydoc -p 1234`
-will start a HTTP server on port 1234, allowing you to browse
-the documentation at ``http://localhost:1234/`` in your preferred Web browser.
+that will serve documentation to visiting Web browsers.  :program:`pydoc -p 1234`
+will start a HTTP server on port 1234, allowing you to browse the
+documentation at ``http://localhost:1234/`` in your preferred Web browser.
+Specifying ``0`` as the port number will select an arbitrary unused port.
+
 :program:`pydoc -g` will start the server and additionally bring up a
 small :mod:`tkinter`\ -based graphical interface to help you search for
-documentation pages.
+documentation pages.  The ``-g`` option is deprecated, since the server can
+now be controlled directly from HTTP clients.
+
+:program:`pydoc -b` will start the server and additionally open a web
+browser to a module index page.  Each served page has a navigation bar at the
+top where you can *Get* help on an individual item, *Search* all modules with a
+keyword in their synopsis line, and go to the *Module index*, *Topics* and
+*Keywords* pages.
 
 When :program:`pydoc` generates documentation, it uses the current environment
 and path to locate modules.  Thus, invoking :program:`pydoc spam`
@@ -69,3 +78,5 @@
 to a different URL or to a local directory containing the Library
 Reference Manual pages.
 
+.. versionchanged:: 3.2
+   Added the ``-b`` option, deprecated the ``-g`` option.

Modified: python/branches/py3k-cdecimal/Doc/library/random.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/random.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/random.rst	Sun Jan  2 13:18:37 2011
@@ -233,41 +233,18 @@
    parameter.
 
 
-Alternative Generators:
+Alternative Generator:
 
 .. class:: SystemRandom([seed])
 
    Class that uses the :func:`os.urandom` function for generating random numbers
    from sources provided by the operating system. Not available on all systems.
-   Does not rely on software state and sequences are not reproducible. Accordingly,
+   Does not rely on software state, and sequences are not reproducible. Accordingly,
    the :meth:`seed` method has no effect and is ignored.
    The :meth:`getstate` and :meth:`setstate` methods raise
    :exc:`NotImplementedError` if called.
 
 
-Examples of basic usage::
-
-   >>> random.random()        # Random float x, 0.0 <= x < 1.0
-   0.37444887175646646
-   >>> random.uniform(1, 10)  # Random float x, 1.0 <= x < 10.0
-   1.1800146073117523
-   >>> random.randint(1, 10)  # Integer from 1 to 10, endpoints included
-   7
-   >>> random.randrange(0, 101, 2)  # Even integer from 0 to 100
-   26
-   >>> random.choice('abcdefghij')  # Choose a random element
-   'c'
-
-   >>> items = [1, 2, 3, 4, 5, 6, 7]
-   >>> random.shuffle(items)
-   >>> items
-   [7, 3, 2, 5, 6, 4, 1]
-
-   >>> random.sample([1, 2, 3, 4, 5],  3)  # Choose 3 elements
-   [4, 1, 5]
-
-
-
 .. seealso::
 
    M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-dimensionally
@@ -280,8 +257,9 @@
    random number generator with a long period and comparatively simple update
    operations.
 
+
 Notes on Reproducibility
-========================
+------------------------
 
 Sometimes it is useful to be able to reproduce the sequences given by a pseudo
 random number generator.  By re-using a seed value, the same sequence should be
@@ -295,3 +273,53 @@
 
 * The generator's :meth:`random` method will continue to produce the same
   sequence when the compatible seeder is given the same seed.
+
+.. _random-examples:
+
+Examples and Recipes
+--------------------
+
+Basic usage::
+
+   >>> random.random()                      # Random float x, 0.0 <= x < 1.0
+   0.37444887175646646
+
+   >>> random.uniform(1, 10)                # Random float x, 1.0 <= x < 10.0
+   1.1800146073117523
+
+   >>> random.randrange(10)                 # Integer from 0 to 9
+   7
+
+   >>> random.randrange(0, 101, 2)          # Even integer from 0 to 100
+   26
+
+   >>> random.choice('abcdefghij')          # Single random element
+   'c'
+
+   >>> items = [1, 2, 3, 4, 5, 6, 7]
+   >>> random.shuffle(items)
+   >>> items
+   [7, 3, 2, 5, 6, 4, 1]
+
+   >>> random.sample([1, 2, 3, 4, 5],  3)   # Three samples without replacement
+   [4, 1, 5]
+
+A common task is to make a :func:`random.choice` with weighted probababilites.
+
+If the weights are small integer ratios, a simple technique is to build a sample
+population with repeats::
+
+    >>> weighted_choices = [('Red', 3), ('Blue', 2), ('Yellow', 1), ('Green', 4)]
+    >>> population = [val for val, cnt in weighted_choices for i in range(cnt)]
+    >>> random.choice(population)
+    'Green'
+
+A more general approach is to arrange the weights in a cumulative distribution
+with :func:`itertools.accumulate`, and then locate the random value with
+:func:`bisect.bisect`::
+
+    >>> choices, weights = zip(*weighted_choices)
+    >>> cumdist = list(itertools.accumulate(weights))
+    >>> x = random.random() * cumdist[-1]
+    >>> choices[bisect.bisect(cumdist, x)]
+    'Blue'

Modified: python/branches/py3k-cdecimal/Doc/library/re.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/re.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/re.rst	Sun Jan  2 13:18:37 2011
@@ -991,8 +991,10 @@
    The string passed to :meth:`~regex.match` or :meth:`~regex.search`.
 
 
-Examples
---------
+.. _re-examples:
+
+Regular Expression Examples
+---------------------------
 
 
 Checking For a Pair
@@ -1298,6 +1300,7 @@
     Token = collections.namedtuple('Token', 'typ value line column')
 
     def tokenize(s):
+        keywords = {'IF', 'THEN', 'FOR', 'NEXT', 'GOSUB', 'RETURN'}
         tok_spec = [
             ('NUMBER', r'\d+(\.\d*)?'), # Integer or decimal number
             ('ASSIGN', r':='),          # Assignment operator
@@ -1318,6 +1321,8 @@
                 line_start = pos
                 line += 1
             elif typ != 'SKIP':
+                if typ == 'ID' and val in keywords:
+                    typ = val
                 yield Token(typ, mo.group(typ), line, mo.start()-line_start)
             pos = mo.end()
             mo = gettok(s, pos)

Modified: python/branches/py3k-cdecimal/Doc/library/runpy.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/runpy.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/runpy.rst	Sun Jan  2 13:18:37 2011
@@ -70,6 +70,9 @@
    .. versionchanged:: 3.1
       Added ability to execute packages by looking for a ``__main__`` submodule.
 
+   .. versionchanged:: 3.2
+      Added ``__cached__`` global variable (see :PEP:`3147`).
+
 
 .. function:: run_path(file_path, init_globals=None, run_name=None)
 

Modified: python/branches/py3k-cdecimal/Doc/library/shelve.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/shelve.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/shelve.rst	Sun Jan  2 13:18:37 2011
@@ -101,7 +101,7 @@
   implementation used.
 
 
-.. class:: Shelf(dict, protocol=None, writeback=False)
+.. class:: Shelf(dict, protocol=None, writeback=False, keyencoding='utf-8')
 
    A subclass of :class:`collections.MutableMapping` which stores pickled values
    in the *dict* object.
@@ -115,8 +115,15 @@
    This allows natural operations on mutable entries, but can consume much more
    memory and make sync and close take a long time.
 
+   The *keyencoding* parameter is the encoding used to encode keys before they
+   are used with the underlying dict.
 
-.. class:: BsdDbShelf(dict, protocol=None, writeback=False)
+   .. versionadded:: 3.2
+      The *keyencoding* parameter; previously, keys were always encoded in
+      UTF-8.
+
+
+.. class:: BsdDbShelf(dict, protocol=None, writeback=False, keyencoding='utf-8')
 
    A subclass of :class:`Shelf` which exposes :meth:`first`, :meth:`!next`,
    :meth:`previous`, :meth:`last` and :meth:`set_location` which are available
@@ -125,8 +132,8 @@
    modules.  The *dict* object passed to the constructor must support those
    methods.  This is generally accomplished by calling one of
    :func:`bsddb.hashopen`, :func:`bsddb.btopen` or :func:`bsddb.rnopen`.  The
-   optional *protocol* and *writeback* parameters have the same interpretation
-   as for the :class:`Shelf` class.
+   optional *protocol*, *writeback*, and *keyencoding* parameters have the same
+   interpretation as for the :class:`Shelf` class.
 
 
 .. class:: DbfilenameShelf(filename, flag='c', protocol=None, writeback=False)

Modified: python/branches/py3k-cdecimal/Doc/library/socket.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/socket.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/socket.rst	Sun Jan  2 13:18:37 2011
@@ -14,16 +14,6 @@
    Some behavior may be platform dependent, since calls are made to the operating
    system socket APIs.
 
-For an introduction to socket programming (in C), see the following papers: An
-Introductory 4.3BSD Interprocess Communication Tutorial, by Stuart Sechrest and
-An Advanced 4.3BSD Interprocess Communication Tutorial, by Samuel J.  Leffler et
-al, both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections
-PS1:7 and PS1:8).  The platform-specific reference material for the various
-socket-related system calls are also a valuable source of information on the
-details of socket semantics.  For Unix, refer to the manual pages; for Windows,
-see the WinSock (or Winsock 2) specification. For IPv6-ready APIs, readers may
-want to refer to :rfc:`3493` titled Basic Socket Interface Extensions for IPv6.
-
 .. index:: object: socket
 
 The Python interface is a straightforward transliteration of the Unix system
@@ -34,26 +24,63 @@
 files, buffer allocation on receive operations is automatic, and buffer length
 is implicit on send operations.
 
-Socket addresses are represented as follows: A single string is used for the
-:const:`AF_UNIX` address family. A pair ``(host, port)`` is used for the
-:const:`AF_INET` address family, where *host* is a string representing either a
-hostname in Internet domain notation like ``'daring.cwi.nl'`` or an IPv4 address
-like ``'100.50.200.5'``, and *port* is an integral port number. For
-:const:`AF_INET6` address family, a four-tuple ``(host, port, flowinfo,
-scopeid)`` is used, where *flowinfo* and *scopeid* represents ``sin6_flowinfo``
-and ``sin6_scope_id`` member in :const:`struct sockaddr_in6` in C. For
-:mod:`socket` module methods, *flowinfo* and *scopeid* can be omitted just for
-backward compatibility. Note, however, omission of *scopeid* can cause problems
-in manipulating scoped IPv6 addresses. Other address families are currently not
-supported. The address format required by a particular socket object is
-automatically selected based on the address family specified when the socket
-object was created.
+
+Socket families
+---------------
+
+Depending on the system and the build options, various socket families
+are supported by this module.
+
+Socket addresses are represented as follows:
+
+- A single string is used for the :const:`AF_UNIX` address family.
+
+- A pair ``(host, port)`` is used for the :const:`AF_INET` address family,
+  where *host* is a string representing either a hostname in Internet domain
+  notation like ``'daring.cwi.nl'`` or an IPv4 address like ``'100.50.200.5'``,
+  and *port* is an integral port number.
+
+- For :const:`AF_INET6` address family, a four-tuple ``(host, port, flowinfo,
+  scopeid)`` is used, where *flowinfo* and *scopeid* represent the ``sin6_flowinfo``
+  and ``sin6_scope_id`` members in :const:`struct sockaddr_in6` in C.  For
+  :mod:`socket` module methods, *flowinfo* and *scopeid* can be omitted just for
+  backward compatibility.  Note, however, omission of *scopeid* can cause problems
+  in manipulating scoped IPv6 addresses.
+
+- :const:`AF_NETLINK` sockets are represented as pairs ``(pid, groups)``.
+
+- Linux-only support for TIPC is available using the :const:`AF_TIPC`
+  address family.  TIPC is an open, non-IP based networked protocol designed
+  for use in clustered computer environments.  Addresses are represented by a
+  tuple, and the fields depend on the address type. The general tuple form is
+  ``(addr_type, v1, v2, v3 [, scope])``, where:
+
+  - *addr_type* is one of TIPC_ADDR_NAMESEQ, TIPC_ADDR_NAME, or
+    TIPC_ADDR_ID.
+  - *scope* is one of TIPC_ZONE_SCOPE, TIPC_CLUSTER_SCOPE, and
+    TIPC_NODE_SCOPE.
+  - If *addr_type* is TIPC_ADDR_NAME, then *v1* is the server type, *v2* is
+    the port identifier, and *v3* should be 0.
+
+    If *addr_type* is TIPC_ADDR_NAMESEQ, then *v1* is the server type, *v2*
+    is the lower port number, and *v3* is the upper port number.
+
+    If *addr_type* is TIPC_ADDR_ID, then *v1* is the node, *v2* is the
+    reference, and *v3* should be set to 0.
+
+    If *addr_type* is TIPC_ADDR_ID, then *v1* is the node, *v2* is the
+    reference, and *v3* should be set to 0.
+
+- Certain other address families (:const:`AF_BLUETOOTH`, :const:`AF_PACKET`)
+  support specific representations.
+
+  .. XXX document them!
 
 For IPv4 addresses, two special forms are accepted instead of a host address:
 the empty string represents :const:`INADDR_ANY`, and the string
-``''`` represents :const:`INADDR_BROADCAST`. The behavior is not
-available for IPv6 for backward compatibility, therefore, you may want to avoid
-these if you intend to support IPv6 with your Python programs.
+``''`` represents :const:`INADDR_BROADCAST`.  This behavior is not
+compatible with IPv6, therefore, you may want to avoid these if you intend
+to support IPv6 with your Python programs.
 
 If you use a hostname in the *host* portion of IPv4/v6 socket address, the
 program may show a nondeterministic behavior, as Python uses the first address
@@ -62,40 +89,18 @@
 resolution and/or the host configuration.  For deterministic behavior use a
 numeric address in *host* portion.
 
-AF_NETLINK sockets are represented as  pairs ``pid, groups``.
-
-
-Linux-only support for TIPC is also available using the :const:`AF_TIPC`
-address family. TIPC is an open, non-IP based networked protocol designed
-for use in clustered computer environments.  Addresses are represented by a
-tuple, and the fields depend on the address type. The general tuple form is
-``(addr_type, v1, v2, v3 [, scope])``, where:
-
-- *addr_type* is one of TIPC_ADDR_NAMESEQ, TIPC_ADDR_NAME, or
-  TIPC_ADDR_ID.
-- *scope* is one of TIPC_ZONE_SCOPE, TIPC_CLUSTER_SCOPE, and
-  TIPC_NODE_SCOPE.
-- If *addr_type* is TIPC_ADDR_NAME, then *v1* is the server type, *v2* is
-  the port identifier, and *v3* should be 0.
-
-  If *addr_type* is TIPC_ADDR_NAMESEQ, then *v1* is the server type, *v2*
-  is the lower port number, and *v3* is the upper port number.
-
-  If *addr_type* is TIPC_ADDR_ID, then *v1* is the node, *v2* is the
-  reference, and *v3* should be set to 0.
-
-  If *addr_type* is TIPC_ADDR_ID, then *v1* is the node, *v2* is the
-  reference, and *v3* should be set to 0.
-
-
 All errors raise exceptions.  The normal exceptions for invalid argument types
 and out-of-memory conditions can be raised; errors related to socket or address
-semantics raise the error :exc:`socket.error`.
+semantics raise :exc:`socket.error` or one of its subclasses.
 
 Non-blocking mode is supported through :meth:`~socket.setblocking`.  A
 generalization of this based on timeouts is supported through
 :meth:`~socket.settimeout`.
 
+
+Module contents
+---------------
+
 The module :mod:`socket` exports the following constants and functions:
 
 
@@ -144,7 +149,8 @@
 
    These constants represent the address (and protocol) families, used for the
    first argument to :func:`socket`.  If the :const:`AF_UNIX` constant is not
-   defined then this protocol is unsupported.
+   defined then this protocol is unsupported.  More constants may be available
+   depending on the system.
 
 
 .. data:: SOCK_STREAM
@@ -154,8 +160,9 @@
           SOCK_SEQPACKET
 
    These constants represent the socket types, used for the second argument to
-   :func:`socket`. (Only :const:`SOCK_STREAM` and :const:`SOCK_DGRAM` appear to be
-   generally useful.)
+   :func:`socket`.  More constants may be available depending on the system.
+   (Only :const:`SOCK_STREAM` and :const:`SOCK_DGRAM` appear to be generally
+   useful.)
 
 .. data:: SOCK_CLOEXEC
           SOCK_NONBLOCK
@@ -627,18 +634,24 @@
    is system-dependent (usually 5).
 
 
-.. method:: socket.makefile(mode='r', buffering=None, *, encoding=None, errors=None, newline=None)
+.. method:: socket.makefile(mode='r', buffering=None, *, encoding=None, \
+                            errors=None, newline=None)
 
    .. index:: single: I/O control; buffering
 
-   Return a :term:`file object` associated with the socket.  The exact
-   returned type depends on the arguments given to :meth:`makefile`.  These
-   arguments are interpreted the same way as by the built-in :func:`open`
-   function.
-
-   Closing the file object won't close the socket unless there are no
-   remaining references to the socket.  The socket must be in blocking mode
-   (it can not have a timeout).
+   Return a :term:`file object` associated with the socket.  The exact returned
+   type depends on the arguments given to :meth:`makefile`.  These arguments are
+   interpreted the same way as by the built-in :func:`open` function.
+
+   Closing the file object won't close the socket unless there are no remaining
+   references to the socket.  The socket must be in blocking mode (it can not
+   have a timeout).
+
+   .. note::
+
+      On Windows, the file-like object created by :meth:`makefile` cannot be
+      used where a file object with a file descriptor is expected, such as the
+      stream arguments of :meth:`subprocess.Popen`.
 
 
 .. method:: socket.recv(bufsize[, flags])
@@ -950,3 +963,21 @@
 
    # disabled promiscuous mode
    s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)
+
+
+.. seealso::
+
+   For an introduction to socket programming (in C), see the following papers:
+
+   - *An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart Sechrest
+
+   - *An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J.  Leffler et
+     al,
+
+   both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections
+   PS1:7 and PS1:8).  The platform-specific reference material for the various
+   socket-related system calls are also a valuable source of information on the
+   details of socket semantics.  For Unix, refer to the manual pages; for Windows,
+   see the WinSock (or Winsock 2) specification.  For IPv6-ready APIs, readers may
+   want to refer to :rfc:`3493` titled Basic Socket Interface Extensions for IPv6.
+

Modified: python/branches/py3k-cdecimal/Doc/library/someos.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/someos.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/someos.rst	Sun Jan  2 13:18:37 2011
@@ -14,11 +14,11 @@
 
    select.rst
    threading.rst
-   dummy_threading.rst
-   _thread.rst
-   _dummy_thread.rst
-   concurrent.futures.rst
    multiprocessing.rst
+   concurrent.futures.rst
    mmap.rst
    readline.rst
    rlcompleter.rst
+   dummy_threading.rst
+   _thread.rst
+   _dummy_thread.rst

Modified: python/branches/py3k-cdecimal/Doc/library/sqlite3.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/sqlite3.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/sqlite3.rst	Sun Jan  2 13:18:37 2011
@@ -888,4 +888,4 @@
 .. [#f1] The sqlite3 module is not built with loadable extension support by
   default, because some platforms (notably Mac OS X) have SQLite libraries which
   are compiled without this feature. To get loadable extension support, you must
-  modify setup.py and and remove the line that sets SQLITE_OMIT_LOAD_EXTENSION.
+  pass --enable-loadable-sqlite-extensions to configure.

Modified: python/branches/py3k-cdecimal/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/stdtypes.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/stdtypes.rst	Sun Jan  2 13:18:37 2011
@@ -836,8 +836,8 @@
 must have a trailing comma, such as ``(d,)``.
 
 Objects of type range are created using the :func:`range` function.  They don't
-support slicing, concatenation or repetition, and using ``in``, ``not in``,
-:func:`min` or :func:`max` on them is inefficient.
+support concatenation or repetition, and using :func:`min` or :func:`max` on
+them is inefficient.
 
 Most sequence types support the following operations.  The ``in`` and ``not in``
 operations have the same priorities as the comparison operations.  The ``+`` and
@@ -1078,20 +1078,26 @@
 .. method:: str.isalnum()
 
    Return true if all characters in the string are alphanumeric and there is at
-   least one character, false otherwise.
+   least one character, false otherwise.  A character ``c`` is alphanumeric if one
+   of the following returns ``True``: ``c.isalpha()``, ``c.isdecimal()``,
+   ``c.isdigit()``, or ``c.isnumeric()``.
 
 
 .. method:: str.isalpha()
 
    Return true if all characters in the string are alphabetic and there is at least
-   one character, false otherwise.
+   one character, false otherwise.  Alphabetic characters are those characters defined
+   in the Unicode character database as "Letter", i.e., those with general category
+   property being one of "Lm", "Lt", "Lu", "Ll", or "Lo".  Note that this is different
+   from the "Alphabetic" property defined in the Unicode Standard.
 
 
 .. method:: str.isdecimal()
 
    Return true if all characters in the string are decimal
    characters and there is at least one character, false
-   otherwise. Decimal characters include digit characters, and all characters
+   otherwise. Decimal characters are those from general category "Nd". This category
+   includes digit characters, and all characters
    that that can be used to form decimal-radix numbers, e.g. U+0660,
    ARABIC-INDIC DIGIT ZERO.
 
@@ -1099,7 +1105,9 @@
 .. method:: str.isdigit()
 
    Return true if all characters in the string are digits and there is at least one
-   character, false otherwise.
+   character, false otherwise.  Digits include decimal characters and digits that need
+   special handling, such as the compatibility superscript digits.  Formally, a digit
+   is a character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal.
 
 
 .. method:: str.isidentifier()
@@ -1111,7 +1119,9 @@
 .. method:: str.islower()
 
    Return true if all cased characters in the string are lowercase and there is at
-   least one cased character, false otherwise.
+   least one cased character, false otherwise.  Cased characters are those with
+   general category property being one of "Lu", "Ll", or "Lt" and lowercase characters
+   are those with general category property "Ll".
 
 
 .. method:: str.isnumeric()
@@ -1120,7 +1130,8 @@
    characters, and there is at least one character, false
    otherwise. Numeric characters include digit characters, and all characters
    that have the Unicode numeric value property, e.g. U+2155,
-   VULGAR FRACTION ONE FIFTH.
+   VULGAR FRACTION ONE FIFTH.  Formally, numeric characters are those with the property
+   value Numeric_Type=Digit, Numeric_Type=Decimal or Numeric_Type=Numeric.
 
 
 .. method:: str.isprintable()
@@ -1137,8 +1148,9 @@
 .. method:: str.isspace()
 
    Return true if there are only whitespace characters in the string and there is
-   at least one character, false otherwise.
-
+   at least one character, false otherwise.  Whitespace characters  are those
+   characters defined in the Unicode character database as "Other" or "Separator"
+   and those with bidirectional property being one of "WS", "B", or "S".
 
 .. method:: str.istitle()
 
@@ -1150,7 +1162,9 @@
 .. method:: str.isupper()
 
    Return true if all cased characters in the string are uppercase and there is at
-   least one cased character, false otherwise.
+   least one cased character, false otherwise. Cased characters are those with
+   general category property being one of "Lu", "Ll", or "Lt" and uppercase characters
+   are those with general category property "Lu".
 
 
 .. method:: str.join(iterable)
@@ -2279,8 +2293,8 @@
 ===============
 
 :class:`memoryview` objects allow Python code to access the internal data
-of an object that supports the buffer protocol without copying.  Memory
-is generally interpreted as simple bytes.
+of an object that supports the :ref:`buffer protocol ` without
+copying.  Memory is generally interpreted as simple bytes.
 
 .. class:: memoryview(obj)
 
@@ -2419,6 +2433,10 @@
       A tuple of integers the length of :attr:`ndim` giving the size in bytes to
       access each element for each dimension of the array.
 
+   .. attribute:: readonly
+
+      A bool indicating whether the memory is read only.
+
    .. memoryview.suboffsets isn't documented because it only seems useful for C
 
 
@@ -2433,12 +2451,9 @@
    single: protocol; context management
 
 Python's :keyword:`with` statement supports the concept of a runtime context
-defined by a context manager.  This is implemented using two separate methods
+defined by a context manager.  This is implemented using a pair of methods
 that allow user-defined classes to define a runtime context that is entered
-before the statement body is executed and exited when the statement ends.
-
-The :dfn:`context management protocol` consists of a pair of methods that need
-to be provided for a context manager object to define a runtime context:
+before the statement body is executed and exited when the statement ends:
 
 
 .. method:: contextmanager.__enter__()
@@ -2486,9 +2501,9 @@
 their implementation of the context management protocol. See the
 :mod:`contextlib` module for some examples.
 
-Python's :term:`generator`\s and the ``contextlib.contextmanager`` :term:`decorator`
+Python's :term:`generator`\s and the :class:`contextlib.contextmanager` decorator
 provide a convenient way to implement these protocols.  If a generator function is
-decorated with the ``contextlib.contextmanager`` decorator, it will return a
+decorated with the :class:`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/py3k-cdecimal/Doc/library/string.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/string.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/string.rst	Sun Jan  2 13:18:37 2011
@@ -350,9 +350,18 @@
    |         | positive numbers, and a minus sign on negative numbers.  |
    +---------+----------------------------------------------------------+
 
-The ``'#'`` option is only valid for integers, and only for binary, octal, or
-hexadecimal output.  If present, it specifies that the output will be prefixed
-by ``'0b'``, ``'0o'``, or ``'0x'``, respectively.
+
+The ``'#'`` option causes the "alternate form" to be used for the
+conversion.  The alternate form is defined differently for different
+types.  This option is only valid for integer, float, complex and
+Decimal types. For integers, when binary, octal, or hexadecimal output
+is used, this option adds the prefix respective ``'0b'``, ``'0o'``, or
+``'0x'`` to the output value. For floats, complex and Decimal the
+alternate form causes the result of the conversion to always contain a
+decimal-point character, even if no digits follow it. Normally, a
+decimal-point character appears in the result of these conversions
+only if a digit follows it. In addition, for ``'g'`` and ``'G'``
+conversions, trailing zeros are not removed from the result.
 
 The ``','`` option signals the use of a comma for a thousands separator.
 For a locale aware separator, use the ``'n'`` integer presentation type

Modified: python/branches/py3k-cdecimal/Doc/library/struct.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/struct.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/struct.rst	Sun Jan  2 13:18:37 2011
@@ -164,58 +164,53 @@
 +--------+--------------------------+--------------------+----------------+------------+
 | ``c``  | :c:type:`char`           | bytes of length 1  | 1              |            |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``b``  | :c:type:`signed char`    | integer            | 1              | \(1),\(4)  |
+| ``b``  | :c:type:`signed char`    | integer            | 1              | \(1),\(3)  |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``B``  | :c:type:`unsigned char`  | integer            | 1              | \(4)       |
+| ``B``  | :c:type:`unsigned char`  | integer            | 1              | \(3)       |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``?``  | :c:type:`_Bool`          | bool               | 1              | \(2)       |
+| ``?``  | :c:type:`_Bool`          | bool               | 1              | \(1)       |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``h``  | :c:type:`short`          | integer            | 2              | \(4)       |
+| ``h``  | :c:type:`short`          | integer            | 2              | \(3)       |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``H``  | :c:type:`unsigned short` | integer            | 2              | \(4)       |
+| ``H``  | :c:type:`unsigned short` | integer            | 2              | \(3)       |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``i``  | :c:type:`int`            | integer            | 4              | \(4)       |
+| ``i``  | :c:type:`int`            | integer            | 4              | \(3)       |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``I``  | :c:type:`unsigned int`   | integer            | 4              | \(4)       |
+| ``I``  | :c:type:`unsigned int`   | integer            | 4              | \(3)       |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``l``  | :c:type:`long`           | integer            | 4              | \(4)       |
+| ``l``  | :c:type:`long`           | integer            | 4              | \(3)       |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``L``  | :c:type:`unsigned long`  | integer            | 4              | \(4)       |
+| ``L``  | :c:type:`unsigned long`  | integer            | 4              | \(3)       |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``q``  | :c:type:`long long`      | integer            | 8              | \(3), \(4) |
+| ``q``  | :c:type:`long long`      | integer            | 8              | \(2), \(3) |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``Q``  | :c:type:`unsigned long   | integer            | 8              | \(3), \(4) |
+| ``Q``  | :c:type:`unsigned long   | integer            | 8              | \(2), \(3) |
 |        | long`                    |                    |                |            |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``f``  | :c:type:`float`          | float              | 4              | \(5)       |
+| ``f``  | :c:type:`float`          | float              | 4              | \(4)       |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``d``  | :c:type:`double`         | float              | 8              | \(5)       |
+| ``d``  | :c:type:`double`         | float              | 8              | \(4)       |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``s``  | :c:type:`char[]`         | bytes              |                | \(1)       |
+| ``s``  | :c:type:`char[]`         | bytes              |                |            |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``p``  | :c:type:`char[]`         | bytes              |                | \(1)       |
+| ``p``  | :c:type:`char[]`         | bytes              |                |            |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``P``  | :c:type:`void \*`        | integer            |                | \(6)       |
+| ``P``  | :c:type:`void \*`        | integer            |                | \(5)       |
 +--------+--------------------------+--------------------+----------------+------------+
 
 Notes:
 
 (1)
-   The ``c``, ``s`` and ``p`` conversion codes operate on :class:`bytes`
-   objects, but packing with such codes also supports :class:`str` objects,
-   which are encoded using UTF-8.
-
-(2)
    The ``'?'`` conversion code corresponds to the :c:type:`_Bool` type defined by
    C99. If this type is not available, it is simulated using a :c:type:`char`. In
    standard mode, it is always represented by one byte.
 
-(3)
+(2)
    The ``'q'`` and ``'Q'`` conversion codes are available in native mode only if
    the platform C compiler supports C :c:type:`long long`, or, on Windows,
    :c:type:`__int64`.  They are always available in standard modes.
 
-(4)
+(3)
    When attempting to pack a non-integer using any of the integer conversion
    codes, if the non-integer has a :meth:`__index__` method then that method is
    called to convert the argument to an integer before packing.
@@ -223,12 +218,12 @@
    .. versionchanged:: 3.2
       Use of the :meth:`__index__` method for non-integers is new in 3.2.
 
-(5)
+(4)
    For the ``'f'`` and ``'d'`` conversion codes, the packed representation uses
    the IEEE 754 binary32 (for ``'f'``) or binary64 (for ``'d'``) format,
    regardless of the floating-point format used by the platform.
 
-(6)
+(5)
    The ``'P'`` format character is only available for the native byte ordering
    (selected as the default or with the ``'@'`` byte order character). The byte
    order character ``'='`` chooses to use little- or big-endian ordering based
@@ -310,9 +305,9 @@
 The ordering of format characters may have an impact on size since the padding
 needed to satisfy alignment requirements is different::
 
-    >>> pack('ci', '*', 0x12131415)
+    >>> pack('ci', b'*', 0x12131415)
     b'*\x00\x00\x00\x12\x13\x14\x15'
-    >>> pack('ic', 0x12131415, '*')
+    >>> pack('ic', 0x12131415, b'*')
     b'\x12\x13\x14\x15*'
     >>> calcsize('ci')
     8

Modified: python/branches/py3k-cdecimal/Doc/library/subprocess.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/subprocess.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/subprocess.rst	Sun Jan  2 13:18:37 2011
@@ -28,7 +28,7 @@
 This module defines one class called :class:`Popen`:
 
 
-.. class:: Popen(args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0, restore_signals=True, start_new_session=False)
+.. class:: Popen(args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=True, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0, restore_signals=True, start_new_session=False, pass_fds=())
 
    Arguments are:
 
@@ -153,12 +153,22 @@
 
    If *close_fds* is true, all file descriptors except :const:`0`, :const:`1` and
    :const:`2` will be closed before the child process is executed. (Unix only).
-   Or, on Windows, if *close_fds* is true then no handles will be inherited by the
+   The default varies by platform:  Always true on Unix.  On Windows it is
+   true when *stdin*/*stdout*/*stderr* are :const:`None`, false otherwise.
+   On Windows, if *close_fds* is true then no handles will be inherited by the
    child process.  Note that on Windows, you cannot set *close_fds* to true and
    also redirect the standard handles by setting *stdin*, *stdout* or *stderr*.
 
-   If *shell* is :const:`True`, the specified command will be executed through the
-   shell.
+   .. versionchanged:: 3.2
+      The default for *close_fds* was changed from :const:`False` to
+      what is described above.
+
+   *pass_fds* is an optional sequence of file descriptors to keep open
+   between the parent and child.  Providing any *pass_fds* forces
+   *close_fds* to be :const:`True`.  (Unix only)
+
+   .. versionadded:: 3.2
+      The *pass_fds* parameter was added.
 
    If *cwd* is not ``None``, the child's current directory will be changed to *cwd*
    before it is executed.  Note that this directory is not considered when
@@ -208,6 +218,16 @@
    underlying CreateProcess() function.  They can specify things such as appearance
    of the main window and priority for the new process.  (Windows only)
 
+   Popen objects are supported as context managers via the :keyword:`with` statement,
+   closing any open file descriptors on exit.
+   ::
+
+      with Popen(["ifconfig"], stdout=PIPE) as proc:
+          log.write(proc.stdout.read())
+
+   .. versionchanged:: 3.2
+      Added context manager support.
+
 
 .. data:: PIPE
 
@@ -639,4 +659,5 @@
 * ``stdin=PIPE`` and ``stdout=PIPE`` must be specified.
 
 * popen2 closes all file descriptors by default, but you have to specify
-  ``close_fds=True`` with :class:`Popen`.
+  ``close_fds=True`` with :class:`Popen` to guarantee this behavior on
+  all platforms or past Python versions.

Modified: python/branches/py3k-cdecimal/Doc/library/sys.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/sys.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/sys.rst	Sun Jan  2 13:18:37 2011
@@ -99,13 +99,39 @@
 
 .. function:: displayhook(value)
 
-   If *value* is not ``None``, this function prints it to ``sys.stdout``, and saves
-   it in ``builtins._``.
+   If *value* is not ``None``, this function prints ``repr(value)`` to
+   ``sys.stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is
+   not encodable to ``sys.stdout.encoding`` with ``sys.stdout.errors`` error
+   handler (which is probably ``'strict'``), encode it to
+   ``sys.stdout.encoding`` with ``'backslashreplace'`` error handler.
 
    ``sys.displayhook`` is called on the result of evaluating an :term:`expression`
    entered in an interactive Python session.  The display of these values can be
    customized by assigning another one-argument function to ``sys.displayhook``.
 
+   Pseudo-code::
+
+       def displayhook(value):
+           if value is None:
+               return
+           # Set '_' to None to avoid recursion
+           builtins._ = None
+           text = repr(value)
+           try:
+               sys.stdout.write(text)
+           except UnicodeEncodeError:
+               bytes = text.encode(sys.stdout.encoding, 'backslashreplace')
+               if hasattr(sys.stdout, 'buffer'):
+                   sys.stdout.buffer.write(bytes)
+               else:
+                   text = bytes.decode(sys.stdout.encoding, 'strict')
+                   sys.stdout.write(text)
+           sys.stdout.write("\n")
+           builtins._ = value
+
+   .. versionchanged:: 3.2
+      Use ``'backslashreplace'`` error handler on :exc:`UnicodeEncodeError`.
+
 
 .. function:: excepthook(type, value, traceback)
 
@@ -238,6 +264,11 @@
    +------------------------------+------------------------------------------+
    | :const:`bytes_warning`       | -b                                       |
    +------------------------------+------------------------------------------+
+   | :const:`quiet`               | -q                                       |
+   +------------------------------+------------------------------------------+
+
+   .. versionchanged:: 3.2
+      Added ``quiet`` attribute for the new :option:`-q` flag.
 
 
 .. data:: float_info
@@ -389,6 +420,9 @@
    additional garbage collector overhead if the object is managed by the garbage
    collector.
 
+   See `recursive sizeof recipe `_
+   for an example of using :func:`getsizeof` recursively to find the size of
+   containers and all their contents.
 
 .. function:: getswitchinterval()
 

Modified: python/branches/py3k-cdecimal/Doc/library/test.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/test.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/test.rst	Sun Jan  2 13:18:37 2011
@@ -6,11 +6,11 @@
 .. sectionauthor:: Brett Cannon 
 
 .. note::
-    The :mod:`test` package is meant for internal use by Python only. It is
-    documented for the benefit of the core developers of Python. Any use of
-    this package outside of Python's standard library is discouraged as code
-    mentioned here can change or be removed without notice between releases of
-    Python.
+   The :mod:`test` package is meant for internal use by Python only. It is
+   documented for the benefit of the core developers of Python. Any use of
+   this package outside of Python's standard library is discouraged as code
+   mentioned here can change or be removed without notice between releases of
+   Python.
 
 
 The :mod:`test` package contains all regression tests for Python as well as the
@@ -154,28 +154,31 @@
 
 .. _regrtest:
 
-Running tests using :mod:`test.regrtest`
-----------------------------------------
+Running tests using the command-line interface
+----------------------------------------------
 
-:mod:`test.regrtest` can be used as a script to drive Python's regression test
-suite. Running the script by itself automatically starts running all regression
+The :mod:`test` package can be run as a script to drive Python's regression
+test suite, thanks to the :option:`-m` option: :program:`python -m test`. Under
+the hood, it uses :mod:`test.regrtest`; the call :program:`python -m
+test.regrtest` used in previous Python versions still works).
+Running the script by itself automatically starts running all regression
 tests in the :mod:`test` package. It does this by finding all modules in the
 package whose name starts with ``test_``, importing them, and executing the
 function :func:`test_main` if present. The names of tests to execute may also
 be passed to the script. Specifying a single regression test (:program:`python
-regrtest.py test_spam.py`) will minimize output and only print
+-m test test_spam`) will minimize output and only print
 whether the test passed or failed and thus minimize output.
 
-Running :mod:`test.regrtest` directly allows what resources are available for
+Running :mod:`test` directly allows what resources are available for
 tests to use to be set. You do this by using the ``-u`` command-line
-option. Run :program:`python regrtest.py -uall` to turn on all
+option. Run :program:`python -m test -uall` to turn on all
 resources; specifying ``all`` as an option for ``-u`` enables all
 possible resources. If all but one resource is desired (a more common case), a
 comma-separated list of resources that are not desired may be listed after
-``all``. The command :program:`python regrtest.py -uall,-audio,-largefile`
-will run :mod:`test.regrtest` with all resources except the ``audio`` and
+``all``. The command :program:`python -m test -uall,-audio,-largefile`
+will run :mod:`test` with all resources except the ``audio`` and
 ``largefile`` resources. For a list of all resources and more command-line
-options, run :program:`python regrtest.py -h`.
+options, run :program:`python -m test -h`.
 
 Some other ways to execute the regression tests depend on what platform the
 tests are being executed on. On Unix, you can run :program:`make test` at the

Modified: python/branches/py3k-cdecimal/Doc/library/textwrap.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/textwrap.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/textwrap.rst	Sun Jan  2 13:18:37 2011
@@ -121,6 +121,13 @@
          each tab character will be replaced by a single space, which is *not*
          the same as tab expansion.
 
+      .. note::
+
+         If :attr:`replace_whitespace` is false, newlines may appear in the
+         middle of a line and cause strange output. For this reason, text should
+         be split into paragraphs (using :meth:`str.splitlines` or similar)
+         which are wrapped separately.
+
 
    .. attribute:: drop_whitespace
 

Modified: python/branches/py3k-cdecimal/Doc/library/threading.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/threading.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/threading.rst	Sun Jan  2 13:18:37 2011
@@ -1,8 +1,8 @@
-:mod:`threading` --- Higher-level threading interface
-=====================================================
+:mod:`threading` --- Thread-based parallelism
+=============================================
 
 .. module:: threading
-   :synopsis: Higher-level threading interface.
+   :synopsis: Thread-based parallelism.
 
 
 This module constructs higher-level threading interfaces on top of the lower
@@ -408,6 +408,9 @@
    .. versionchanged:: 3.2
       The *timeout* parameter is new.
 
+   .. versionchanged:: 3.2
+      Lock acquires can now be interrupted by signals on POSIX.
+
 
 .. method:: Lock.release()
 

Modified: python/branches/py3k-cdecimal/Doc/library/tkinter.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/tkinter.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/tkinter.rst	Sun Jan  2 13:18:37 2011
@@ -659,9 +659,7 @@
 
 scrollcommand
    This is almost always the :meth:`!set` method of some scrollbar widget, but can
-   be any widget method that takes a single argument.   Refer to the file
-   :file:`Demo/tkinter/matt/canvas-with-scrollbars.py` in the Python source
-   distribution for an example.
+   be any widget method that takes a single argument.
 
 wrap:
    Must be one of: ``"none"``, ``"char"``, or ``"word"``.

Modified: python/branches/py3k-cdecimal/Doc/library/tkinter.tix.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/tkinter.tix.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/tkinter.tix.rst	Sun Jan  2 13:18:37 2011
@@ -84,11 +84,7 @@
 -----------
 
 `Tix `_
-introduces over 40 widget classes to the :mod:`tkinter` repertoire.  There is a
-demo of all the :mod:`tkinter.tix` widgets in the :file:`Demo/tix` directory of
-the standard distribution.
-
-.. The Python sample code is still being added to Python, hence commented out
+introduces over 40 widget classes to the :mod:`tkinter` repertoire.
 
 
 Basic Widgets

Modified: python/branches/py3k-cdecimal/Doc/library/trace.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/trace.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/trace.rst	Sun Jan  2 13:18:37 2011
@@ -17,103 +17,178 @@
 
 .. _trace-cli:
 
-Command Line Usage
+Command-Line Usage
 ------------------
 
 The :mod:`trace` module can be invoked from the command line.  It can be as
 simple as ::
 
-   python -m trace --count somefile.py ...
+   python -m trace --count -C . somefile.py ...
 
-The above will generate annotated listings of all Python modules imported during
-the execution of :file:`somefile.py`.
+The above will execute :file:`somefile.py` and generate annotated listings of
+all Python modules imported during the execution into the current directory.
 
-The following command-line arguments are supported:
+.. program:: trace
+
+.. cmdoption:: --help
+
+   Display usage and exit.
+
+.. cmdoption:: --version
+
+   Display the version of the module and exit.
+
+Main options
+^^^^^^^^^^^^
+
+At least one of the following options must be specified when invoking
+:mod:`trace`.  The :option:`--listfuncs <-l>` option is mutually exclusive with
+the :option:`--trace <-t>` and :option:`--counts <-c>` options . When
+:option:`--listfuncs <-l>` is provided, neither :option:`--counts <-c>` nor
+:option:`--trace <-t>` are accepted, and vice versa.
+
+.. program:: trace
+
+.. cmdoption:: -c, --count
+
+   Produce a set of annotated listing files upon program completion that shows
+   how many times each statement was executed.  See also
+   :option:`--coverdir <-C>`, :option:`--file <-f>` and
+   :option:`--no-report <-R>` below.
+
+.. cmdoption:: -t, --trace
 
-:option:`--trace`, :option:`-t`
    Display lines as they are executed.
 
-:option:`--count`, :option:`-c`
-   Produce a set of  annotated listing files upon program completion that shows how
-   many times each statement was executed.
+.. cmdoption:: -l, --listfuncs
+
+   Display the functions executed by running the program.
+
+.. cmdoption:: -r, --report
 
-:option:`--report`, :option:`-r`
    Produce an annotated list from an earlier program run that used the
-   :option:`--count` and :option:`--file` arguments.
+   :option:`--count <-c>` and :option:`--file <-f>` option.  This does not
+   execute any code.
 
-:option:`--no-report`, :option:`-R`
-   Do not generate annotated listings.  This is useful if you intend to make
-   several runs with :option:`--count` then produce a single set of annotated
-   listings at the end.
+.. cmdoption:: -T, --trackcalls
+
+   Display the calling relationships exposed by running the program.
+
+Modifiers
+^^^^^^^^^
+
+.. program:: trace
+
+.. cmdoption:: -f, --file=
 
-:option:`--listfuncs`, :option:`-l`
-   List the functions executed by running the program.
+   Name of a file to accumulate counts over several tracing runs.  Should be
+   used with the :option:`--count <-c>` option.
 
-:option:`--trackcalls`, :option:`-T`
-   Generate calling relationships exposed by running the program.
+.. cmdoption:: -C, --coverdir=
 
-:option:`--file`, :option:`-f`
-   Name a file containing (or to contain) counts.
+   Directory where the report files go.  The coverage report for
+   ``package.module`` is written to file :file:`{dir}/{package}/{module}.cover`.
 
-:option:`--coverdir`, :option:`-C`
-   Name a directory in which to save annotated listing files.
+.. cmdoption:: -m, --missing
 
-:option:`--missing`, :option:`-m`
    When generating annotated listings, mark lines which were not executed with
-   '``>>>>>>``'.
+   ``>>>>>>``.
 
-:option:`--summary`, :option:`-s`
-   When using :option:`--count` or :option:`--report`, write a brief summary to
-   stdout for each file processed.
-
-:option:`--ignore-module`
-   Accepts comma separated list of module names. Ignore each of the named
-   module and its submodules (if it is a package).  May be given
-   multiple times.
-
-:option:`--ignore-dir`
-   Ignore all modules and packages in the named directory and subdirectories
-   (multiple directories can be joined by os.pathsep).  May be given multiple
-   times.
+.. cmdoption:: -s, --summary
 
+   When using :option:`--count <-c>` or :option:`--report <-r>`, write a brief
+   summary to stdout for each file processed.
+
+.. cmdoption:: -R, --no-report
+
+   Do not generate annotated listings.  This is useful if you intend to make
+   several runs with :option:`--count <-c>`, and then produce a single set of
+   annotated listings at the end.
+
+.. cmdoption:: -g, --timing
+
+   Prefix each line with the time since the program started.  Only used while
+   tracing.
+
+Filters
+^^^^^^^
+
+These options may be repeated multiple times.
+
+.. program:: trace
+
+.. cmdoption:: --ignore-module=
+
+   Ignore each of the given module names and its submodules (if it is a
+   package).  The argument can be a list of names separated by a comma.
+
+.. cmdoption:: --ignore-dir=
+
+   Ignore all modules and packages in the named directory and subdirectories.
+   The argument can be a list of directories separated by :data:`os.pathsep`.
 
 .. _trace-api:
 
-Programming Interface
----------------------
+Programmatic Interface
+----------------------
+
+.. class:: Trace(count=1, trace=1, countfuncs=0, countcallers=0, ignoremods=(),\
+                 ignoredirs=(), infile=None, outfile=None, timing=False)
+
+   Create an object to trace execution of a single statement or expression.  All
+   parameters are optional.  *count* enables counting of line numbers.  *trace*
+   enables line execution tracing.  *countfuncs* enables listing of the
+   functions called during the run.  *countcallers* enables call relationship
+   tracking.  *ignoremods* is a list of modules or packages to ignore.
+   *ignoredirs* is a list of directories whose modules or packages should be
+   ignored.  *infile* is the name of the file from which to read stored count
+   information.  *outfile* is the name of the file in which to write updated
+   count information.  *timing* enables a timestamp relative to when tracing was
+   started to be displayed.
+
+    .. method:: run(cmd)
+
+       Execute the command and gather statistics from the execution with
+       the current tracing parameters.  *cmd* must be a string or code object,
+       suitable for passing into :func:`exec`.
 
+    .. method:: runctx(cmd, globals=None, locals=None)
 
-.. class:: Trace(count=1, trace=1, countfuncs=0, countcallers=0, ignoremods=(), ignoredirs=(), infile=None, outfile=None, timing=False)
+       Execute the command and gather statistics from the execution with the
+       current tracing parameters, in the defined global and local
+       environments.  If not defined, *globals* and *locals* default to empty
+       dictionaries.
 
-   Create an object to trace execution of a single statement or expression. All
-   parameters are optional.  *count* enables counting of line numbers. *trace*
-   enables line execution tracing.  *countfuncs* enables listing of the functions
-   called during the run.  *countcallers* enables call relationship tracking.
-   *ignoremods* is a list of modules or packages to ignore.  *ignoredirs* is a list
-   of directories whose modules or packages should be ignored.  *infile* is the
-   file from which to read stored count information.  *outfile* is a file in which
-   to write updated count information. *timing* enables a timestamp relative
-   to when tracing was started to be displayed.
+    .. method:: runfunc(func, *args, **kwds)
 
+       Call *func* with the given arguments under control of the :class:`Trace`
+       object with the current tracing parameters.
 
-.. method:: Trace.run(cmd)
+    .. method:: results()
 
-   Run *cmd* under control of the Trace object with the current tracing parameters.
+       Return a :class:`CoverageResults` object that contains the cumulative
+       results of all previous calls to ``run``, ``runctx`` and ``runfunc``
+       for the given :class:`Trace` instance.  Does not reset the accumulated
+       trace results.
 
+.. class:: CoverageResults
 
-.. method:: Trace.runctx(cmd, globals=None, locals=None)
+   A container for coverage results, created by :meth:`Trace.results`.  Should
+   not be created directly by the user.
 
-   Run *cmd* under control of the Trace object with the current tracing parameters
-   in the defined global and local environments.  If not defined, *globals* and
-   *locals* default to empty dictionaries.
+    .. method:: update(other)
 
+       Merge in data from another :class:`CoverageResults` object.
 
-.. method:: Trace.runfunc(func, *args, **kwds)
+    .. method:: write_results(show_missing=True, summary=False, coverdir=None)
 
-   Call *func* with the given arguments under control of the :class:`Trace` object
-   with the current tracing parameters.
+       Write coverage results.  Set *show_missing* to show lines that had no
+       hits.  Set *summary* to include in the output the coverage summary per
+       module.  *coverdir* specifies the directory into which the coverage
+       result files will be output.  If ``None``, the results for each source
+       file are placed in its directory.
 
-This is a simple example showing the use of this module::
+A simple example demonstrating the use of the programmatic interface::
 
    import sys
    import trace

Modified: python/branches/py3k-cdecimal/Doc/library/turtle.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/turtle.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/turtle.rst	Sun Jan  2 13:18:37 2011
@@ -2268,7 +2268,7 @@
 stored and an additional one in the current working directory.  The latter will
 override the settings of the first one.
 
-The :file:`Demo/turtle` directory contains a :file:`turtle.cfg` file.  You can
+The :file:`Lib/turtledemo` directory contains a :file:`turtle.cfg` file.  You can
 study it as an example and see its effects when running the demos (preferably
 not from within the demo-viewer).
 
@@ -2400,8 +2400,7 @@
   strings and numbers respectively.
 
 - Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py`
-  have been added to the Demo directory (source distribution only). As usual
-  they can be viewed and executed within the demo viewer :file:`turtleDemo.py`.
+  have been added to the :file:`Lib/turtledemo` directory.
 
 
 .. doctest::

Modified: python/branches/py3k-cdecimal/Doc/library/unicodedata.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/unicodedata.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/unicodedata.rst	Sun Jan  2 13:18:37 2011
@@ -13,14 +13,15 @@
    single: character
    pair: Unicode; database
 
-This module provides access to the Unicode Character Database which defines
-character properties for all Unicode characters. The data in this database is
-based on the :file:`UnicodeData.txt` file version 5.2.0 which is publicly
-available from ftp://ftp.unicode.org/.
-
-The module uses the same names and symbols as defined by the UnicodeData File
-Format 5.2.0 (see http://www.unicode.org/reports/tr44/tr44-4.html).
-It defines the following functions:
+This module provides access to the Unicode Character Database (UCD) which
+defines character properties for all Unicode characters. The data contained in
+this database is compiled from the `UCD version 6.0.0
+`_.
+
+The module uses the same names and symbols as defined by Unicode
+Standard Annex #44, `"Unicode Character Database"
+`_.  It defines the
+following functions:
 
 
 .. function:: lookup(name)

Modified: python/branches/py3k-cdecimal/Doc/library/unittest.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/unittest.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/unittest.rst	Sun Jan  2 13:18:37 2011
@@ -191,7 +191,7 @@
 
 .. _unittest-command-line-interface:
 
-Command Line Interface
+Command-Line Interface
 ----------------------
 
 The unittest module can be used from the command line to run tests from
@@ -204,6 +204,16 @@
 You can pass in a list with any combination of module names, and fully
 qualified class or method names.
 
+Test modules can be specified by file path as well::
+
+   python -m unittest tests/test_something.py
+
+This allows you to use the shell filename completion to specify the test module.
+The file specified must still be importable as a module. The path is converted
+to a module name by removing the '.py' and converting path separators into '.'.
+If you want to execute a test file that isn't importable as a module you should
+execute the file directly instead.
+
 You can run tests with more detail (higher verbosity) by passing in the -v flag::
 
    python -m unittest -v test_module
@@ -221,8 +231,8 @@
    not modules or classes.
 
 
-failfast, catch and buffer command-line options
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Command-line options
+~~~~~~~~~~~~~~~~~~~~
 
 :program:`unittest` supports these command-line options:
 
@@ -247,7 +257,7 @@
    Stop the test run on the first error or failure.
 
 .. versionadded:: 3.2
-   The command-line options :option:`-c`, :option:`-b` and :option:`-f` were added.
+   The command-line options ``-b``, ``-c`` and ``-f`` were added.
 
 The command line can also be used for test discovery, for running all of the
 tests in a project or just a subset.
@@ -834,16 +844,16 @@
    +-----------------------------------------+-----------------------------+---------------+
 
    All the assert methods (except :meth:`assertRaises`,
-   :meth:`assertRaisesRegexp`, :meth:`assertWarns`, :meth:`assertWarnsRegexp`)
+   :meth:`assertRaisesRegex`, :meth:`assertWarns`, :meth:`assertWarnsRegex`)
    accept a *msg* argument that, if specified, is used as the error message on
    failure (see also :data:`longMessage`).
 
-   .. method:: assertEqual(first, second, msg=None)
+   .. method:: assertEqual(actual, expected, msg=None)
 
-      Test that *first* and *second* are equal.  If the values do not compare
-      equal, the test will fail.
+      Test that *actual* and *expected* are equal.  If the values do not
+      compare equal, the test will fail.
 
-      In addition, if *first* and *second* are the exact same type and one of
+      In addition, if *actual* and *expected* are the exact same type and one of
       list, tuple, dict, set, frozenset or str or any type that a subclass
       registers with :meth:`addTypeEqualityFunc` the type specific equality
       function will be called in order to generate a more useful default
@@ -858,10 +868,10 @@
          function for comparing strings.
 
 
-   .. method:: assertNotEqual(first, second, msg=None)
+   .. method:: assertNotEqual(actual, expected, msg=None)
 
-      Test that *first* and *second* are not equal.  If the values do compare
-      equal, the test will fail.
+      Test that *actual* and *expected* are not equal.  If the values do
+      compare equal, the test will fail.
 
    .. method:: assertTrue(expr, msg=None)
                assertFalse(expr, msg=None)
@@ -875,10 +885,11 @@
       provide a better error message in case of failure.
 
 
-   .. method:: assertIs(first, second, msg=None)
-               assertIsNot(first, second, msg=None)
+   .. method:: assertIs(actual, expected, msg=None)
+               assertIsNot(actual, expected, msg=None)
 
-      Test that *first* and *second* evaluate (or don't evaluate) to the same object.
+      Test that *actual* and *expected* evaluate (or don't evaluate) to the
+      same object.
 
       .. versionadded:: 3.1
 
@@ -918,14 +929,14 @@
    | :meth:`assertRaises(exc, fun, *args, **kwds)            | ``fun(*args, **kwds)`` raises `exc`  |            |
    | `                                |                                      |            |
    +---------------------------------------------------------+--------------------------------------+------------+
-   | :meth:`assertRaisesRegexp(exc, re, fun, *args, **kwds)  | ``fun(*args, **kwds)`` raises `exc`  | 3.1        |
-   | `                          | and the message matches `re`         |            |
+   | :meth:`assertRaisesRegex(exc, re, fun, *args, **kwds)   | ``fun(*args, **kwds)`` raises `exc`  | 3.1        |
+   | `                           | and the message matches `re`         |            |
    +---------------------------------------------------------+--------------------------------------+------------+
    | :meth:`assertWarns(warn, fun, *args, **kwds)            | ``fun(*args, **kwds)`` raises `warn` | 3.2        |
    | `                                 |                                      |            |
    +---------------------------------------------------------+--------------------------------------+------------+
-   | :meth:`assertWarnsRegexp(warn, re, fun, *args, **kwds)  | ``fun(*args, **kwds)`` raises `warn` | 3.2        |
-   | `                           | and the message matches `re`         |            |
+   | :meth:`assertWarnsRegex(warn, re, fun, *args, **kwds)   | ``fun(*args, **kwds)`` raises `warn` | 3.2        |
+   | `                            | and the message matches `re`         |            |
    +---------------------------------------------------------+--------------------------------------+------------+
 
    .. method:: assertRaises(exception, callable, *args, **kwds)
@@ -961,23 +972,26 @@
          Added the :attr:`exception` attribute.
 
 
-   .. method:: assertRaisesRegexp(exception, regexp, callable, *args, **kwds)
-               assertRaisesRegexp(exception, regexp)
+   .. method:: assertRaisesRegex(exception, regex, callable, *args, **kwds)
+               assertRaisesRegex(exception, regex)
 
-      Like :meth:`assertRaises` but also tests that *regexp* matches
-      on the string representation of the raised exception.  *regexp* may be
+      Like :meth:`assertRaises` but also tests that *regex* matches
+      on the string representation of the raised exception.  *regex* may be
       a regular expression object or a string containing a regular expression
       suitable for use by :func:`re.search`.  Examples::
 
-         self.assertRaisesRegexp(ValueError, 'invalid literal for.*XYZ$',
-                                 int, 'XYZ')
+         self.assertRaisesRegex(ValueError, 'invalid literal for.*XYZ$',
+                                int, 'XYZ')
 
       or::
 
-         with self.assertRaisesRegexp(ValueError, 'literal'):
+         with self.assertRaisesRegex(ValueError, 'literal'):
             int('XYZ')
 
       .. versionadded:: 3.1
+         under the name ``assertRaisesRegexp``.
+      .. versionchanged:: 3.2
+         Renamed to :meth:`assertRaisesRegex`.
 
 
    .. method:: assertWarns(warning, callable, *args, **kwds)
@@ -1014,21 +1028,21 @@
       .. versionadded:: 3.2
 
 
-   .. method:: assertWarnsRegexp(warning, regexp, callable, *args, **kwds)
-               assertWarnsRegexp(warning, regexp)
+   .. method:: assertWarnsRegex(warning, regex, callable, *args, **kwds)
+               assertWarnsRegex(warning, regex)
 
-      Like :meth:`assertWarns` but also tests that *regexp* matches on the
-      message of the triggered warning.  *regexp* may be a regular expression
+      Like :meth:`assertWarns` but also tests that *regex* matches on the
+      message of the triggered warning.  *regex* may be a regular expression
       object or a string containing a regular expression suitable for use
       by :func:`re.search`.  Example::
 
-         self.assertWarnsRegexp(DeprecationWarning,
-                                r'legacy_function\(\) is deprecated',
-                                legacy_function, 'XYZ')
+         self.assertWarnsRegex(DeprecationWarning,
+                               r'legacy_function\(\) is deprecated',
+                               legacy_function, 'XYZ')
 
       or::
 
-         with self.assertWarnsRegexp(RuntimeWarning, 'unsafe frobnicating'):
+         with self.assertWarnsRegex(RuntimeWarning, 'unsafe frobnicating'):
              frobnicate('/etc/passwd')
 
       .. versionadded:: 3.2
@@ -1058,47 +1072,44 @@
    | :meth:`assertLessEqual(a, b)          | ``a <= b``                     | 3.1          |
    | `           |                                |              |
    +---------------------------------------+--------------------------------+--------------+
-   | :meth:`assertRegexpMatches(s, re)     | ``regex.search(s)``            | 3.1          |
-   | `       |                                |              |
+   | :meth:`assertRegex(s, re)             | ``regex.search(s)``            | 3.1          |
+   | `               |                                |              |
    +---------------------------------------+--------------------------------+--------------+
-   | :meth:`assertNotRegexpMatches(s, re)  | ``not regex.search(s)``        | 3.2          |
-   | `    |                                |              |
+   | :meth:`assertNotRegex(s, re)          | ``not regex.search(s)``        | 3.2          |
+   | `            |                                |              |
    +---------------------------------------+--------------------------------+--------------+
-   | :meth:`assertDictContainsSubset(a, b) | all the key/value pairs        | 3.1          |
-   | `  | in `a` exist in `b`            |              |
-   +---------------------------------------+--------------------------------+--------------+
-   | :meth:`assertItemsEqual(a, b)         | `a` and `b` have the same      | 3.2          |
-   | `          | elements in the same number,   |              |
+   | :meth:`assertCountEqual(a, b)         | `a` and `b` have the same      | 3.2          |
+   | `          | elements in the same number,   |              |
    |                                       | regardless of their order      |              |
    +---------------------------------------+--------------------------------+--------------+
 
 
-   .. method:: assertAlmostEqual(first, second, places=7, msg=None, delta=None)
-               assertNotAlmostEqual(first, second, places=7, msg=None, delta=None)
+   .. method:: assertAlmostEqual(actual, expected, places=7, msg=None, delta=None)
+               assertNotAlmostEqual(actual, expected, places=7, msg=None, delta=None)
 
-      Test that *first* and *second* are approximately (or not approximately)
+      Test that *actual* and *expected* are approximately (or not approximately)
       equal by computing the difference, rounding to the given number of
       decimal *places* (default 7), and comparing to zero.  Note that these
       methods round the values to the given number of *decimal places* (i.e.
       like the :func:`round` function) and not *significant digits*.
 
       If *delta* is supplied instead of *places* then the difference
-      between *first* and *second* must be less (or more) than *delta*.
+      between *actual* and *expected* must be less (or more) than *delta*.
 
       Supplying both *delta* and *places* raises a ``TypeError``.
 
       .. versionchanged:: 3.2
-         assertAlmostEqual automatically considers almost equal objects that compare equal.
-         assertNotAlmostEqual automatically fails if the objects compare equal.
-         Added the ``delta`` keyword argument.
+         :meth:`assertAlmostEqual` automatically considers almost equal objects
+         that compare equal.  :meth:`assertNotAlmostEqual` automatically fails
+         if the objects compare equal.  Added the *delta* keyword argument.
 
 
-   .. method:: assertGreater(first, second, msg=None)
-               assertGreaterEqual(first, second, msg=None)
-               assertLess(first, second, msg=None)
-               assertLessEqual(first, second, msg=None)
+   .. method:: assertGreater(actual, expected, msg=None)
+               assertGreaterEqual(actual, expected, msg=None)
+               assertLess(actual, expected, msg=None)
+               assertLessEqual(actual, expected, msg=None)
 
-      Test that *first* is respectively >, >=, < or <= than *second* depending
+      Test that *actual* is respectively >, >=, < or <= than *expected* depending
       on the method name.  If not, the test will fail::
 
          >>> self.assertGreaterEqual(3, 4)
@@ -1107,54 +1118,64 @@
       .. versionadded:: 3.1
 
 
-   .. method:: assertRegexpMatches(text, regexp, msg=None)
-               assertNotRegexpMatches(text, regexp, msg=None)
+   .. method:: assertRegex(text, regex, msg=None)
+               assertNotRegex(text, regex, msg=None)
 
-      Test that a *regexp* search matches (or does not match) *text*.  In case
+      Test that a *regex* search matches (or does not match) *text*.  In case
       of failure, the error message will include the pattern and the *text* (or
-      the pattern and the part of *text* that unexpectedly matched).  *regexp*
+      the pattern and the part of *text* that unexpectedly matched).  *regex*
       may be a regular expression object or a string containing a regular
       expression suitable for use by :func:`re.search`.
 
-      .. versionadded:: 3.1 :meth:`~TestCase.assertRegexpMatches`
-      .. versionadded:: 3.2 :meth:`~TestCase.assertNotRegexpMatches`
+      .. versionadded:: 3.1
+         under the name ``assertRegexpMatches``.
+      .. versionchanged:: 3.2
+         The method ``assertRegexpMatches()`` has been renamed to
+         :meth:`.assertRegex`.
+      .. versionadded:: 3.2
+         :meth:`.assertNotRegex`.
 
 
-   .. method:: assertDictContainsSubset(expected, actual, msg=None)
+   .. method:: assertDictContainsSubset(subset, dictionary, msg=None)
 
-      Tests whether the key/value pairs in dictionary *actual* are a
-      superset of those in *expected*.  If not, an error message listing
-      the missing keys and mismatched values is generated.
+      Tests whether the key/value pairs in *dictionary* are a superset of
+      those in *subset*.  If not, an error message listing the missing keys
+      and mismatched values is generated.
+
+      Note, the arguments are in the opposite order of what the method name
+      dictates.  Instead, consider using the set-methods on :ref:`dictionary
+      views `, for example: ``d.keys() <= e.keys()`` or
+      ``d.items() <= d.items()``.
 
       .. versionadded:: 3.1
+      .. deprecated:: 3.2
 
 
-   .. method:: assertItemsEqual(actual, expected, msg=None)
+   .. method:: assertCountEqual(first, second, msg=None)
 
-      Test that sequence *expected* contains the same elements as *actual*,
+      Test that sequence *first* contains the same elements as *second*,
       regardless of their order. When they don't, an error message listing the
       differences between the sequences will be generated.
 
-      Duplicate elements are *not* ignored when comparing *actual* and
-      *expected*. It verifies if each element has the same count in both
-      sequences. It is the equivalent of ``assertEqual(sorted(expected),
-      sorted(actual))`` but it works with sequences of unhashable objects as
-      well.
+      Duplicate elements are *not* ignored when comparing *first* and
+      *second*. It verifies whether each element has the same count in both
+      sequences. Equivalent to:
+      ``assertEqual(Counter(list(first)), Counter(list(second)))``
+      but works with sequences of unhashable objects as well.
 
       .. versionadded:: 3.2
 
-
    .. method:: assertSameElements(actual, expected, msg=None)
 
-      Test that sequence *expected* contains the same elements as *actual*,
+      Test that sequence *actual* contains the same elements as *expected*,
       regardless of their order. When they don't, an error message listing
       the differences between the sequences will be generated.
 
       Duplicate elements are ignored when comparing *actual* and *expected*.
-      It is the equivalent of ``assertEqual(set(expected), set(actual))``
+      It is the equivalent of ``assertEqual(set(actual), set(expected))``
       but it works with sequences of unhashable objects as well. Because
       duplicates are ignored, this method has been deprecated in favour of
-      :meth:`assertItemsEqual`.
+      :meth:`assertCountEqual`.
 
       .. versionadded:: 3.1
       .. deprecated:: 3.2
@@ -1208,9 +1229,9 @@
 
 
 
-   .. method:: assertMultiLineEqual(first, second, msg=None)
+   .. method:: assertMultiLineEqual(actual, expected, msg=None)
 
-      Test that the multiline string *first* is equal to the string *second*.
+      Test that the multiline string *actual* is equal to the string *expected*.
       When not equal a diff of the two strings highlighting the differences
       will be included in the error message. This method is used by default
       when comparing strings with :meth:`assertEqual`.
@@ -1218,10 +1239,10 @@
       .. versionadded:: 3.1
 
 
-   .. method:: assertSequenceEqual(seq1, seq2, msg=None, seq_type=None)
+   .. method:: assertSequenceEqual(actual, expected, msg=None, seq_type=None)
 
       Tests that two sequences are equal.  If a *seq_type* is supplied, both
-      *seq1* and *seq2* must be instances of *seq_type* or a failure will
+      *actual* and *expected* must be instances of *seq_type* or a failure will
       be raised.  If the sequences are different an error message is
       constructed that shows the difference between the two.
 
@@ -1232,8 +1253,8 @@
       .. versionadded:: 3.1
 
 
-   .. method:: assertListEqual(list1, list2, msg=None)
-               assertTupleEqual(tuple1, tuple2, msg=None)
+   .. method:: assertListEqual(actual, expected, msg=None)
+               assertTupleEqual(actual, expected, msg=None)
 
       Tests that two lists or tuples are equal.  If not an error message is
       constructed that shows only the differences between the two.  An error
@@ -1244,19 +1265,19 @@
       .. versionadded:: 3.1
 
 
-   .. method:: assertSetEqual(set1, set2, msg=None)
+   .. method:: assertSetEqual(actual, expected, msg=None)
 
       Tests that two sets are equal.  If not, an error message is constructed
       that lists the differences between the sets.  This method is used by
       default when comparing sets or frozensets with :meth:`assertEqual`.
 
-      Fails if either of *set1* or *set2* does not have a :meth:`set.difference`
+      Fails if either of *actual* or *expected* does not have a :meth:`set.difference`
       method.
 
       .. versionadded:: 3.1
 
 
-   .. method:: assertDictEqual(expected, actual, msg=None)
+   .. method:: assertDictEqual(actual, expected, msg=None)
 
       Test that two dictionaries are equal.  If not, an error message is
       constructed that shows the differences in the dictionaries. This
@@ -1297,8 +1318,8 @@
       to ``True`` allows you to have a custom error message in addition to the
       normal one.
 
-      This attribute defaults to ``False``, meaning that a custom message passed
-      to an assert method will silence the normal message.
+      This attribute defaults to ``True``. If set to False then a custom message
+      passed to an assert method will silence the normal message.
 
       The class setting can be overridden in individual tests by assigning an
       instance attribute to ``True`` or ``False`` before calling the assert methods.
@@ -1355,11 +1376,11 @@
       returns the first line of the test method's docstring, if available,
       or ``None``.
 
-      .. versionchanged:: 3.1,3.2
+      .. versionchanged:: 3.1
          In 3.1 this was changed to add the test name to the short description
-         even in the presence of a docstring. This caused compatibility issues
+         even in the presence of a docstring.  This caused compatibility issues
          with unittest extensions and adding the test name was moved to the
-         :class:`TextTestResult`.
+         :class:`TextTestResult` in Python 3.2.
 
 
    .. method:: addCleanup(function, *args, **kwargs)
@@ -1401,6 +1422,8 @@
    :mod:`unittest`-based test framework.
 
 
+.. _deprecated-aliases:
+
 Deprecated aliases
 ##################
 
@@ -1408,21 +1431,27 @@
 aliases that are now deprecated.  The following table lists the correct names
 along with their deprecated aliases:
 
-   ==============================  ===============================
-    Method Name                     Deprecated alias(es)
-   ==============================  ===============================
-    :meth:`.assertEqual`            failUnlessEqual, assertEquals
-    :meth:`.assertNotEqual`         failIfEqual
-    :meth:`.assertTrue`             failUnless, assert\_
+   ==============================  ====================== ======================
+    Method Name                     Deprecated alias       Deprecated alias
+   ==============================  ====================== ======================
+    :meth:`.assertEqual`            failUnlessEqual        assertEquals
+    :meth:`.assertNotEqual`         failIfEqual            assertNotEquals
+    :meth:`.assertTrue`             failUnless             assert\_
     :meth:`.assertFalse`            failIf
     :meth:`.assertRaises`           failUnlessRaises
-    :meth:`.assertAlmostEqual`      failUnlessAlmostEqual
-    :meth:`.assertNotAlmostEqual`   failIfAlmostEqual
-   ==============================  ===============================
-
-   .. deprecated:: 3.1
-         the aliases listed in the second column
-
+    :meth:`.assertAlmostEqual`      failUnlessAlmostEqual  assertAlmostEquals
+    :meth:`.assertNotAlmostEqual`   failIfAlmostEqual      assertNotAlmostEquals
+    :meth:`.assertRegex`                                   assertRegexpMatches
+    :meth:`.assertRaisesRegex`                             assertRaisesRegexp
+   ==============================  ====================== ======================
+
+   .. deprecated-removed:: 3.1 3.3
+         the fail* aliases listed in the second column.
+   .. deprecated:: 3.2
+         the assert* aliases listed in the third column.
+   .. deprecated:: 3.2
+         ``assertRegexpMatches`` and ``assertRaisesRegexp`` have been renamed to
+         :meth:`.assertRegex` and :meth:`.assertRaisesRegex`
 
 
 .. _testsuite-objects:
@@ -1841,12 +1870,21 @@
    instead of repeatedly creating new instances.
 
 
-.. class:: TextTestRunner(stream=sys.stderr, descriptions=True, verbosity=1, runnerclass=None)
+.. class:: TextTestRunner(stream=sys.stderr, descriptions=True, verbosity=1, runnerclass=None, warnings=None)
 
    A basic test runner implementation which prints results on standard error.  It
    has a few configurable parameters, but is essentially very simple.  Graphical
    applications which run test suites should provide alternate implementations.
 
+   By default this runner shows :exc:`DeprecationWarning`,
+   :exc:`PendingDeprecationWarning`, and :exc:`ImportWarning` even if they are
+   :ref:`ignored by default `. Deprecation warnings caused by
+   :ref:`deprecated unittest methods ` are also
+   special-cased and, when the warning filters are ``'default'`` or ``'always'``,
+   they will appear only once per-module, in order to avoid too many warning
+   messages.  This behavior can be overridden using the :option:`-Wd` or
+   :option:`-Wa` options and leaving *warnings* to ``None``.
+
    .. method:: _makeResult()
 
       This method returns the instance of ``TestResult`` used by :meth:`run`.
@@ -1860,7 +1898,12 @@
 
         stream, descriptions, verbosity
 
-.. function:: main(module='__main__', defaultTest=None, argv=None, testRunner=None, testLoader=unittest.loader.defaultTestLoader, exit=True, verbosity=1, failfast=None, catchbreak=None, buffer=None)
+   .. versionchanged:: 3.2
+      Added the ``warnings`` argument.
+
+.. function:: main(module='__main__', defaultTest=None, argv=None, testRunner=None, \
+                   testLoader=unittest.loader.defaultTestLoader, exit=True, verbosity=1, \
+                   failfast=None, catchbreak=None, buffer=None, warnings=None)
 
    A command-line program that runs a set of tests; this is primarily for making
    test modules conveniently executable.  The simplest use for this function is to
@@ -1887,23 +1930,29 @@
       >>> main(module='test_module', exit=False)
 
    The ``failfast``, ``catchbreak`` and ``buffer`` parameters have the same
-   effect as the `failfast, catch and buffer command-line options`_.
+   effect as the same-name `command-line options`_.
+
+   The *warning* argument specifies the :ref:`warning filter `
+   that should be used while running the tests.  If it's not specified, it will
+   remain ``None`` if a :option:`-W` option is passed to :program:`python`,
+   otherwise it will be set to ``'default'``.
 
    Calling ``main`` actually returns an instance of the ``TestProgram`` class.
    This stores the result of the tests run as the ``result`` attribute.
 
+   .. versionchanged:: 3.1
+      The ``exit`` parameter was added.
+
    .. versionchanged:: 3.2
-      The ``exit``, ``verbosity``, ``failfast``, ``catchbreak`` and ``buffer``
-      parameters were added.
+      The ``verbosity``, ``failfast``, ``catchbreak``, ``buffer``
+      and ``warnings`` parameters were added.
 
 
 load_tests Protocol
 ###################
 
-
 .. versionadded:: 3.2
 
-
 Modules or packages can customize how tests are loaded from them during normal
 test runs or test discovery by implementing a function called ``load_tests``.
 
@@ -2050,12 +2099,14 @@
 Signal Handling
 ---------------
 
-The ``-c``/``--catch`` command-line option to unittest, along with the ``catchbreak``
-parameter to :func:`unittest.main()`, provide more friendly handling of
-control-C during a test run. With catch break behavior enabled control-C will
-allow the currently running test to complete, and the test run will then end
-and report all the results so far. A second control-c will raise a
-:exc:`KeyboardInterrupt` in the usual way.
+.. versionadded:: 3.2
+
+The :option:`-c/--catch ` command-line option to unittest,
+along with the ``catchbreak`` parameter to :func:`unittest.main()`, provide
+more friendly handling of control-C during a test run. With catch break
+behavior enabled control-C will allow the currently running test to complete,
+and the test run will then end and report all the results so far. A second
+control-c will raise a :exc:`KeyboardInterrupt` in the usual way.
 
 The control-c handling signal handler attempts to remain compatible with code or
 tests that install their own :const:`signal.SIGINT` handler. If the ``unittest``
@@ -2075,7 +2126,6 @@
    (usually in response to the user pressing control-c) all registered results
    have :meth:`~TestResult.stop` called.
 
-   .. versionadded:: 3.2
 
 .. function:: registerResult(result)
 
@@ -2087,7 +2137,6 @@
    handling is not enabled, so test frameworks can unconditionally register
    all results they create independently of whether or not handling is enabled.
 
-   .. versionadded:: 3.2
 
 .. function:: removeResult(result)
 
@@ -2095,7 +2144,6 @@
    :meth:`~TestResult.stop` will no longer be called on that result object in
    response to a control-c.
 
-   .. versionadded:: 3.2
 
 .. function:: removeHandler(function=None)
 
@@ -2106,6 +2154,3 @@
       @unittest.removeHandler
       def test_signal_handling(self):
           ...
-
-   .. versionadded:: 3.2
-

Modified: python/branches/py3k-cdecimal/Doc/library/urllib.parse.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/urllib.parse.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/urllib.parse.rst	Sun Jan  2 13:18:37 2011
@@ -24,7 +24,15 @@
 ``rsync``, ``rtsp``, ``rtspu``, ``sftp``, ``shttp``, ``sip``, ``sips``,
 ``snews``, ``svn``, ``svn+ssh``, ``telnet``, ``wais``.
 
-The :mod:`urllib.parse` module defines the following functions:
+The :mod:`urllib.parse` module defines functions that fall into two broad
+categories: URL parsing and URL quoting. These are covered in detail in
+the following sections.
+
+URL Parsing
+-----------
+
+The URL parsing functions focus on splitting a URL string into its components,
+or on combining URL components into a URL string.
 
 .. function:: urlparse(urlstring, scheme='', allow_fragments=True)
 
@@ -242,6 +250,161 @@
    string.  If there is no fragment identifier in *url*, return *url* unmodified
    and an empty string.
 
+   The return value is actually an instance of a subclass of :class:`tuple`.  This
+   class has the following additional read-only convenience attributes:
+
+   +------------------+-------+-------------------------+----------------------+
+   | Attribute        | Index | Value                   | Value if not present |
+   +==================+=======+=========================+======================+
+   | :attr:`url`      | 0     | URL with no fragment    | empty string         |
+   +------------------+-------+-------------------------+----------------------+
+   | :attr:`fragment` | 1     | Fragment identifier     | empty string         |
+   +------------------+-------+-------------------------+----------------------+
+
+   See section :ref:`urlparse-result-object` for more information on the result
+   object.
+
+   .. versionchanged:: 3.2
+      Result is a structured object rather than a simple 2-tuple
+
+
+Parsing ASCII Encoded Bytes
+---------------------------
+
+The URL parsing functions were originally designed to operate on character
+strings only. In practice, it is useful to be able to manipulate properly
+quoted and encoded URLs as sequences of ASCII bytes. Accordingly, the
+URL parsing functions in this module all operate on :class:`bytes` and
+:class:`bytearray` objects in addition to :class:`str` objects.
+
+If :class:`str` data is passed in, the result will also contain only
+:class:`str` data. If :class:`bytes` or :class:`bytearray` data is
+passed in, the result will contain only :class:`bytes` data.
+
+Attempting to mix :class:`str` data with :class:`bytes` or
+:class:`bytearray` in a single function call will result in a
+:exc:`TypeError` being raised, while attempting to pass in non-ASCII
+byte values will trigger :exc:`UnicodeDecodeError`.
+
+To support easier conversion of result objects between :class:`str` and
+:class:`bytes`, all return values from URL parsing functions provide
+either an :meth:`encode` method (when the result contains :class:`str`
+data) or a :meth:`decode` method (when the result contains :class:`bytes`
+data). The signatures of these methods match those of the corresponding
+:class:`str` and :class:`bytes` methods (except that the default encoding
+is ``'ascii'`` rather than ``'utf-8'``). Each produces a value of a
+corresponding type that contains either :class:`bytes` data (for
+:meth:`encode` methods) or :class:`str` data (for
+:meth:`decode` methods).
+
+Applications that need to operate on potentially improperly quoted URLs
+that may contain non-ASCII data will need to do their own decoding from
+bytes to characters before invoking the URL parsing methods.
+
+The behaviour described in this section applies only to the URL parsing
+functions. The URL quoting functions use their own rules when producing
+or consuming byte sequences as detailed in the documentation of the
+individual URL quoting functions.
+
+.. versionchanged:: 3.2
+   URL parsing functions now accept ASCII encoded byte sequences
+
+
+.. _urlparse-result-object:
+
+Structured Parse Results
+------------------------
+
+The result objects from the :func:`urlparse`, :func:`urlsplit`  and
+:func:`urldefrag` functions are subclasses of the :class:`tuple` type.
+These subclasses add the attributes listed in the documentation for
+those functions, the encoding and decoding support described in the
+previous section, as well as an additional method:
+
+.. method:: urllib.parse.SplitResult.geturl()
+
+   Return the re-combined version of the original URL as a string. This may
+   differ from the original URL in that the scheme may be normalized to lower
+   case and empty components may be dropped. Specifically, empty parameters,
+   queries, and fragment identifiers will be removed.
+
+   For :func:`urldefrag` results, only empty fragment identifiers will be removed.
+   For :func:`urlsplit` and :func:`urlparse` results, all noted changes will be
+   made to the URL returned by this method.
+
+   The result of this method remains unchanged if passed back through the original
+   parsing function:
+
+      >>> from urllib.parse import urlsplit
+      >>> url = 'HTTP://www.Python.org/doc/#'
+      >>> r1 = urlsplit(url)
+      >>> r1.geturl()
+      'http://www.Python.org/doc/'
+      >>> r2 = urlsplit(r1.geturl())
+      >>> r2.geturl()
+      'http://www.Python.org/doc/'
+
+
+The following classes provide the implementations of the structured parse
+results when operating on :class:`str` objects:
+
+.. class:: DefragResult(url, fragment)
+
+   Concrete class for :func:`urldefrag` results containing :class:`str`
+   data. The :meth:`encode` method returns a :class:`DefragResultBytes`
+   instance.
+
+   .. versionadded:: 3.2
+
+.. class:: ParseResult(scheme, netloc, path, params, query, fragment)
+
+   Concrete class for :func:`urlparse` results containing :class:`str`
+   data. The :meth:`encode` method returns a :class:`ParseResultBytes`
+   instance.
+
+.. class:: SplitResult(scheme, netloc, path, query, fragment)
+
+   Concrete class for :func:`urlsplit` results containing :class:`str`
+   data. The :meth:`encode` method returns a :class:`SplitResultBytes`
+   instance.
+
+
+The following classes provide the implementations of the parse results when
+operating on :class:`bytes` or :class:`bytearray` objects:
+
+.. class:: DefragResultBytes(url, fragment)
+
+   Concrete class for :func:`urldefrag` results containing :class:`bytes`
+   data. The :meth:`decode` method returns a :class:`DefragResult`
+   instance.
+
+   .. versionadded:: 3.2
+
+.. class:: ParseResultBytes(scheme, netloc, path, params, query, fragment)
+
+   Concrete class for :func:`urlparse` results containing :class:`bytes`
+   data. The :meth:`decode` method returns a :class:`ParseResult`
+   instance.
+
+   .. versionadded:: 3.2
+
+.. class:: SplitResultBytes(scheme, netloc, path, query, fragment)
+
+   Concrete class for :func:`urlsplit` results containing :class:`bytes`
+   data. The :meth:`decode` method returns a :class:`SplitResult`
+   instance.
+
+   .. versionadded:: 3.2
+
+
+URL Quoting
+-----------
+
+The URL quoting functions focus on taking program data and making it safe
+for use as URL components by quoting special characters and appropriately
+encoding non-ASCII text. They also support reversing these operations to
+recreate the original data from the contents of a URL component if that
+task isn't already covered by the URL parsing functions above.
 
 .. function:: quote(string, safe='/', encoding=None, errors=None)
 
@@ -322,8 +485,7 @@
    If it is a :class:`str`, unescaped non-ASCII characters in *string*
    are encoded into UTF-8 bytes.
 
-   Example: ``unquote_to_bytes('a%26%EF')`` yields
-   ``b'a&\xef'``.
+   Example: ``unquote_to_bytes('a%26%EF')`` yields ``b'a&\xef'``.
 
 
 .. function:: urlencode(query, doseq=False, safe='', encoding=None, errors=None)
@@ -340,12 +502,13 @@
    the optional parameter *doseq* is evaluates to *True*, individual
    ``key=value`` pairs separated by ``'&'`` are generated for each element of
    the value sequence for the key.  The order of parameters in the encoded
-   string will match the order of parameter tuples in the sequence. This module
-   provides the functions :func:`parse_qs` and :func:`parse_qsl` which are used
-   to parse query strings into Python data structures.
+   string will match the order of parameter tuples in the sequence.
 
    When *query* parameter is a :class:`str`, the *safe*, *encoding* and *error*
-   parameters are sent the :func:`quote_plus` for encoding.
+   parameters are passed down to :func:`quote_plus` for encoding.
+
+   To reverse this encoding process, :func:`parse_qs` and :func:`parse_qsl` are
+   provided in this module to parse query strings into Python data structures.
 
    .. versionchanged:: 3.2
       Query parameter supports bytes and string objects.
@@ -376,57 +539,3 @@
 
    :rfc:`1738` - Uniform Resource Locators (URL)
       This specifies the formal syntax and semantics of absolute URLs.
-
-
-.. _urlparse-result-object:
-
-Results of :func:`urlparse` and :func:`urlsplit`
-------------------------------------------------
-
-The result objects from the :func:`urlparse` and :func:`urlsplit` functions are
-subclasses of the :class:`tuple` type.  These subclasses add the attributes
-described in those functions, as well as provide an additional method:
-
-.. method:: ParseResult.geturl()
-
-   Return the re-combined version of the original URL as a string. This may differ
-   from the original URL in that the scheme will always be normalized to lower case
-   and empty components may be dropped. Specifically, empty parameters, queries,
-   and fragment identifiers will be removed.
-
-   The result of this method is a fixpoint if passed back through the original
-   parsing function:
-
-      >>> import urllib.parse
-      >>> url = 'HTTP://www.Python.org/doc/#'
-
-      >>> r1 = urllib.parse.urlsplit(url)
-      >>> r1.geturl()
-      'http://www.Python.org/doc/'
-
-      >>> r2 = urllib.parse.urlsplit(r1.geturl())
-      >>> r2.geturl()
-      'http://www.Python.org/doc/'
-
-
-The following classes provide the implementations of the parse results:
-
-.. class:: BaseResult
-
-   Base class for the concrete result classes.  This provides most of the
-   attribute definitions.  It does not provide a :meth:`geturl` method.  It is
-   derived from :class:`tuple`, but does not override the :meth:`__init__` or
-   :meth:`__new__` methods.
-
-
-.. class:: ParseResult(scheme, netloc, path, params, query, fragment)
-
-   Concrete class for :func:`urlparse` results.  The :meth:`__new__` method is
-   overridden to support checking that the right number of arguments are passed.
-
-
-.. class:: SplitResult(scheme, netloc, path, query, fragment)
-
-   Concrete class for :func:`urlsplit` results.  The :meth:`__new__` method is
-   overridden to support checking that the right number of arguments are passed.
-

Modified: python/branches/py3k-cdecimal/Doc/library/urllib.request.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/urllib.request.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/urllib.request.rst	Sun Jan  2 13:18:37 2011
@@ -1,4 +1,4 @@
-:mod:`urllib.request` --- extensible library for opening URLs
+:mod:`urllib.request` --- Extensible library for opening URLs
 =============================================================
 
 .. module:: urllib.request
@@ -20,14 +20,15 @@
    Open the URL *url*, which can be either a string or a
    :class:`Request` object.
 
-   *data* may be a string specifying additional data to send to the
-   server, or ``None`` if no such data is needed.  Currently HTTP
-   requests are the only ones that use *data*; the HTTP request will
-   be a POST instead of a GET when the *data* parameter is provided.
-   *data* should be a buffer in the standard
+   *data* may be a bytes object specifying additional data to send to the
+   server, or ``None`` if no such data is needed. *data* may also be an
+   iterable object and in that case Content-Length value must be specified in
+   the headers. Currently HTTP requests are the only ones that use *data*; the
+   HTTP request will be a POST instead of a GET when the *data* parameter is
+   provided.  *data* should be a buffer in the standard
    :mimetype:`application/x-www-form-urlencoded` format.  The
-   :func:`urllib.parse.urlencode` function takes a mapping or sequence
-   of 2-tuples and returns a string in this format. urllib.request module uses
+   :func:`urllib.parse.urlencode` function takes a mapping or sequence of
+   2-tuples and returns a string in this format. urllib.request module uses
    HTTP/1.1 and includes ``Connection:close`` header in its HTTP requests.
 
    The optional *timeout* parameter specifies a timeout in seconds for
@@ -76,6 +77,9 @@
       HTTPS virtual hosts are now supported if possible (that is, if
       :data:`ssl.HAS_SNI` is true).
 
+   .. versionadded:: 3.2
+      *data* can be an iterable object.
+
 .. function:: install_opener(opener)
 
    Install an :class:`OpenerDirector` instance as the default global opener.
@@ -104,52 +108,6 @@
    member variable to modify its position in the handlers list.
 
 
-.. function:: urlretrieve(url, filename=None, reporthook=None, data=None)
-
-   Copy a network object denoted by a URL to a local file, if necessary. If the URL
-   points to a local file, or a valid cached copy of the object exists, the object
-   is not copied.  Return a tuple ``(filename, headers)`` where *filename* is the
-   local file name under which the object can be found, and *headers* is whatever
-   the :meth:`info` method of the object returned by :func:`urlopen` returned (for
-   a remote object, possibly cached). Exceptions are the same as for
-   :func:`urlopen`.
-
-   The second argument, if present, specifies the file location to copy to (if
-   absent, the location will be a tempfile with a generated name). The third
-   argument, if present, is a hook function that will be called once on
-   establishment of the network connection and once after each block read
-   thereafter.  The hook will be passed three arguments; a count of blocks
-   transferred so far, a block size in bytes, and the total size of the file.  The
-   third argument may be ``-1`` on older FTP servers which do not return a file
-   size in response to a retrieval request.
-
-   If the *url* uses the :file:`http:` scheme identifier, the optional *data*
-   argument may be given to specify a ``POST`` request (normally the request type
-   is ``GET``).  The *data* argument must in standard
-   :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urlencode`
-   function below.
-
-   :func:`urlretrieve` will raise :exc:`ContentTooShortError` when it detects that
-   the amount of data available  was less than the expected amount (which is the
-   size reported by a  *Content-Length* header). This can occur, for example, when
-   the  download is interrupted.
-
-   The *Content-Length* is treated as a lower bound: if there's more data  to read,
-   urlretrieve reads more data, but if less data is available,  it raises the
-   exception.
-
-   You can still retrieve the downloaded data in this case, it is stored  in the
-   :attr:`content` attribute of the exception instance.
-
-   If no *Content-Length* header was supplied, urlretrieve can not check the size
-   of the data it has downloaded, and just returns it.  In this case you just have
-   to assume that the download was successful.
-
-.. function:: urlcleanup()
-
-   Clear the cache that may have been built up by previous calls to
-   :func:`urlretrieve`.
-
 .. function:: pathname2url(path)
 
    Convert the pathname *path* from the local syntax for a path to the form used in
@@ -218,115 +176,6 @@
    fetching of the image, this should be true.
 
 
-.. class:: URLopener(proxies=None, **x509)
-
-   Base class for opening and reading URLs.  Unless you need to support opening
-   objects using schemes other than :file:`http:`, :file:`ftp:`, or :file:`file:`,
-   you probably want to use :class:`FancyURLopener`.
-
-   By default, the :class:`URLopener` class sends a :mailheader:`User-Agent` header
-   of ``urllib/VVV``, where *VVV* is the :mod:`urllib` version number.
-   Applications can define their own :mailheader:`User-Agent` header by subclassing
-   :class:`URLopener` or :class:`FancyURLopener` and setting the class attribute
-   :attr:`version` to an appropriate string value in the subclass definition.
-
-   The optional *proxies* parameter should be a dictionary mapping scheme names to
-   proxy URLs, where an empty dictionary turns proxies off completely.  Its default
-   value is ``None``, in which case environmental proxy settings will be used if
-   present, as discussed in the definition of :func:`urlopen`, above.
-
-   Additional keyword parameters, collected in *x509*, may be used for
-   authentication of the client when using the :file:`https:` scheme.  The keywords
-   *key_file* and *cert_file* are supported to provide an  SSL key and certificate;
-   both are needed to support client authentication.
-
-   :class:`URLopener` objects will raise an :exc:`IOError` exception if the server
-   returns an error code.
-
-    .. method:: open(fullurl, data=None)
-
-       Open *fullurl* using the appropriate protocol.  This method sets up cache and
-       proxy information, then calls the appropriate open method with its input
-       arguments.  If the scheme is not recognized, :meth:`open_unknown` is called.
-       The *data* argument has the same meaning as the *data* argument of
-       :func:`urlopen`.
-
-
-    .. method:: open_unknown(fullurl, data=None)
-
-       Overridable interface to open unknown URL types.
-
-
-    .. method:: retrieve(url, filename=None, reporthook=None, data=None)
-
-       Retrieves the contents of *url* and places it in *filename*.  The return value
-       is a tuple consisting of a local filename and either a
-       :class:`email.message.Message` object containing the response headers (for remote
-       URLs) or ``None`` (for local URLs).  The caller must then open and read the
-       contents of *filename*.  If *filename* is not given and the URL refers to a
-       local file, the input filename is returned.  If the URL is non-local and
-       *filename* is not given, the filename is the output of :func:`tempfile.mktemp`
-       with a suffix that matches the suffix of the last path component of the input
-       URL.  If *reporthook* is given, it must be a function accepting three numeric
-       parameters.  It will be called after each chunk of data is read from the
-       network.  *reporthook* is ignored for local URLs.
-
-       If the *url* uses the :file:`http:` scheme identifier, the optional *data*
-       argument may be given to specify a ``POST`` request (normally the request type
-       is ``GET``).  The *data* argument must in standard
-       :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urlencode`
-       function below.
-
-
-    .. attribute:: version
-
-       Variable that specifies the user agent of the opener object.  To get
-       :mod:`urllib` to tell servers that it is a particular user agent, set this in a
-       subclass as a class variable or in the constructor before calling the base
-       constructor.
-
-
-.. class:: FancyURLopener(...)
-
-   :class:`FancyURLopener` subclasses :class:`URLopener` providing default handling
-   for the following HTTP response codes: 301, 302, 303, 307 and 401.  For the 30x
-   response codes listed above, the :mailheader:`Location` header is used to fetch
-   the actual URL.  For 401 response codes (authentication required), basic HTTP
-   authentication is performed.  For the 30x response codes, recursion is bounded
-   by the value of the *maxtries* attribute, which defaults to 10.
-
-   For all other response codes, the method :meth:`http_error_default` is called
-   which you can override in subclasses to handle the error appropriately.
-
-   .. note::
-
-      According to the letter of :rfc:`2616`, 301 and 302 responses to POST requests
-      must not be automatically redirected without confirmation by the user.  In
-      reality, browsers do allow automatic redirection of these responses, changing
-      the POST to a GET, and :mod:`urllib` reproduces this behaviour.
-
-   The parameters to the constructor are the same as those for :class:`URLopener`.
-
-   .. note::
-
-      When performing basic authentication, a :class:`FancyURLopener` instance calls
-      its :meth:`prompt_user_passwd` method.  The default implementation asks the
-      users for the required information on the controlling terminal.  A subclass may
-      override this method to support more appropriate behavior if needed.
-
-    The :class:`FancyURLopener` class offers one additional method that should be
-    overloaded to provide the appropriate behavior:
-
-    .. method:: prompt_user_passwd(host, realm)
-
-       Return information needed to authenticate the user at the given host in the
-       specified security realm.  The return value should be a tuple, ``(user,
-       password)``, which can be used for basic authentication.
-
-       The implementation prompts for this information on the terminal; an application
-       should override this method to use an appropriate interaction model in the local
-       environment.
-
 .. class:: OpenerDirector()
 
    The :class:`OpenerDirector` class opens URLs via :class:`BaseHandler`\ s chained
@@ -1219,6 +1068,170 @@
    >>> f.read().decode('utf-8')
 
 
+Legacy interface
+----------------
+
+The following functions and classes are ported from the Python 2 module
+``urllib`` (as opposed to ``urllib2``).  They might become deprecated at
+some point in the future.
+
+
+.. function:: urlretrieve(url, filename=None, reporthook=None, data=None)
+
+   Copy a network object denoted by a URL to a local file, if necessary. If the URL
+   points to a local file, or a valid cached copy of the object exists, the object
+   is not copied.  Return a tuple ``(filename, headers)`` where *filename* is the
+   local file name under which the object can be found, and *headers* is whatever
+   the :meth:`info` method of the object returned by :func:`urlopen` returned (for
+   a remote object, possibly cached). Exceptions are the same as for
+   :func:`urlopen`.
+
+   The second argument, if present, specifies the file location to copy to (if
+   absent, the location will be a tempfile with a generated name). The third
+   argument, if present, is a hook function that will be called once on
+   establishment of the network connection and once after each block read
+   thereafter.  The hook will be passed three arguments; a count of blocks
+   transferred so far, a block size in bytes, and the total size of the file.  The
+   third argument may be ``-1`` on older FTP servers which do not return a file
+   size in response to a retrieval request.
+
+   If the *url* uses the :file:`http:` scheme identifier, the optional *data*
+   argument may be given to specify a ``POST`` request (normally the request type
+   is ``GET``).  The *data* argument must in standard
+   :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urlencode`
+   function below.
+
+   :func:`urlretrieve` will raise :exc:`ContentTooShortError` when it detects that
+   the amount of data available  was less than the expected amount (which is the
+   size reported by a  *Content-Length* header). This can occur, for example, when
+   the  download is interrupted.
+
+   The *Content-Length* is treated as a lower bound: if there's more data  to read,
+   urlretrieve reads more data, but if less data is available,  it raises the
+   exception.
+
+   You can still retrieve the downloaded data in this case, it is stored  in the
+   :attr:`content` attribute of the exception instance.
+
+   If no *Content-Length* header was supplied, urlretrieve can not check the size
+   of the data it has downloaded, and just returns it.  In this case you just have
+   to assume that the download was successful.
+
+.. function:: urlcleanup()
+
+   Clear the cache that may have been built up by previous calls to
+   :func:`urlretrieve`.
+
+.. class:: URLopener(proxies=None, **x509)
+
+   Base class for opening and reading URLs.  Unless you need to support opening
+   objects using schemes other than :file:`http:`, :file:`ftp:`, or :file:`file:`,
+   you probably want to use :class:`FancyURLopener`.
+
+   By default, the :class:`URLopener` class sends a :mailheader:`User-Agent` header
+   of ``urllib/VVV``, where *VVV* is the :mod:`urllib` version number.
+   Applications can define their own :mailheader:`User-Agent` header by subclassing
+   :class:`URLopener` or :class:`FancyURLopener` and setting the class attribute
+   :attr:`version` to an appropriate string value in the subclass definition.
+
+   The optional *proxies* parameter should be a dictionary mapping scheme names to
+   proxy URLs, where an empty dictionary turns proxies off completely.  Its default
+   value is ``None``, in which case environmental proxy settings will be used if
+   present, as discussed in the definition of :func:`urlopen`, above.
+
+   Additional keyword parameters, collected in *x509*, may be used for
+   authentication of the client when using the :file:`https:` scheme.  The keywords
+   *key_file* and *cert_file* are supported to provide an  SSL key and certificate;
+   both are needed to support client authentication.
+
+   :class:`URLopener` objects will raise an :exc:`IOError` exception if the server
+   returns an error code.
+
+    .. method:: open(fullurl, data=None)
+
+       Open *fullurl* using the appropriate protocol.  This method sets up cache and
+       proxy information, then calls the appropriate open method with its input
+       arguments.  If the scheme is not recognized, :meth:`open_unknown` is called.
+       The *data* argument has the same meaning as the *data* argument of
+       :func:`urlopen`.
+
+
+    .. method:: open_unknown(fullurl, data=None)
+
+       Overridable interface to open unknown URL types.
+
+
+    .. method:: retrieve(url, filename=None, reporthook=None, data=None)
+
+       Retrieves the contents of *url* and places it in *filename*.  The return value
+       is a tuple consisting of a local filename and either a
+       :class:`email.message.Message` object containing the response headers (for remote
+       URLs) or ``None`` (for local URLs).  The caller must then open and read the
+       contents of *filename*.  If *filename* is not given and the URL refers to a
+       local file, the input filename is returned.  If the URL is non-local and
+       *filename* is not given, the filename is the output of :func:`tempfile.mktemp`
+       with a suffix that matches the suffix of the last path component of the input
+       URL.  If *reporthook* is given, it must be a function accepting three numeric
+       parameters.  It will be called after each chunk of data is read from the
+       network.  *reporthook* is ignored for local URLs.
+
+       If the *url* uses the :file:`http:` scheme identifier, the optional *data*
+       argument may be given to specify a ``POST`` request (normally the request type
+       is ``GET``).  The *data* argument must in standard
+       :mimetype:`application/x-www-form-urlencoded` format; see the :func:`urlencode`
+       function below.
+
+
+    .. attribute:: version
+
+       Variable that specifies the user agent of the opener object.  To get
+       :mod:`urllib` to tell servers that it is a particular user agent, set this in a
+       subclass as a class variable or in the constructor before calling the base
+       constructor.
+
+
+.. class:: FancyURLopener(...)
+
+   :class:`FancyURLopener` subclasses :class:`URLopener` providing default handling
+   for the following HTTP response codes: 301, 302, 303, 307 and 401.  For the 30x
+   response codes listed above, the :mailheader:`Location` header is used to fetch
+   the actual URL.  For 401 response codes (authentication required), basic HTTP
+   authentication is performed.  For the 30x response codes, recursion is bounded
+   by the value of the *maxtries* attribute, which defaults to 10.
+
+   For all other response codes, the method :meth:`http_error_default` is called
+   which you can override in subclasses to handle the error appropriately.
+
+   .. note::
+
+      According to the letter of :rfc:`2616`, 301 and 302 responses to POST requests
+      must not be automatically redirected without confirmation by the user.  In
+      reality, browsers do allow automatic redirection of these responses, changing
+      the POST to a GET, and :mod:`urllib` reproduces this behaviour.
+
+   The parameters to the constructor are the same as those for :class:`URLopener`.
+
+   .. note::
+
+      When performing basic authentication, a :class:`FancyURLopener` instance calls
+      its :meth:`prompt_user_passwd` method.  The default implementation asks the
+      users for the required information on the controlling terminal.  A subclass may
+      override this method to support more appropriate behavior if needed.
+
+   The :class:`FancyURLopener` class offers one additional method that should be
+   overloaded to provide the appropriate behavior:
+
+   .. method:: prompt_user_passwd(host, realm)
+
+      Return information needed to authenticate the user at the given host in the
+      specified security realm.  The return value should be a tuple, ``(user,
+      password)``, which can be used for basic authentication.
+
+      The implementation prompts for this information on the terminal; an application
+      should override this method to use an appropriate interaction model in the local
+      environment.
+
+
 :mod:`urllib.request` Restrictions
 ----------------------------------
 
@@ -1272,8 +1285,8 @@
 
 
 
-:mod:`urllib.response` --- Response classes used by urllib.
-===========================================================
+:mod:`urllib.response` --- Response classes used by urllib
+==========================================================
 
 .. module:: urllib.response
    :synopsis: Response classes used by urllib.

Modified: python/branches/py3k-cdecimal/Doc/library/warnings.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/warnings.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/warnings.rst	Sun Jan  2 13:18:37 2011
@@ -249,6 +249,8 @@
 entries from the warnings list before each new operation).
 
 
+.. _warning-ignored:
+
 Updating Code For New Versions of Python
 ----------------------------------------
 
@@ -279,6 +281,9 @@
 developer want to be notified that your code is using a deprecated module, to a
 user this information is essentially noise and provides no benefit to them.
 
+The :mod:`unittest` module has been also updated to use the ``'default'``
+filter while running tests.
+
 
 .. _warning-functions:
 

Modified: python/branches/py3k-cdecimal/Doc/library/xml.dom.minidom.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/xml.dom.minidom.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/xml.dom.minidom.rst	Sun Jan  2 13:18:37 2011
@@ -122,7 +122,7 @@
           ... # Work with dom.
 
 
-.. method:: Node.writexml(writer, indent="", addindent="", newl="", encoding="")
+.. method:: Node.writexml(writer, indent="", addindent="", newl="")
 
    Write XML to the writer object.  The writer should have a :meth:`write` method
    which matches that of the file object interface.  The *indent* parameter is the
@@ -130,8 +130,8 @@
    indentation to use for subnodes of the current one.  The *newl* parameter
    specifies the string to use to terminate newlines.
 
-   For the :class:`Document` node, an additional keyword argument *encoding* can be
-   used to specify the encoding field of the XML header.
+   For the :class:`Document` node, an additional keyword argument *encoding* can
+   be used to specify the encoding field of the XML header.
 
 
 .. method:: Node.toxml(encoding=None)

Modified: python/branches/py3k-cdecimal/Doc/library/zipfile.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/zipfile.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/zipfile.rst	Sun Jan  2 13:18:37 2011
@@ -51,6 +51,7 @@
 
 
 .. class:: PyZipFile
+   :noindex:
 
    Class for creating ZIP archives containing Python libraries.
 
@@ -178,8 +179,8 @@
    .. note::
 
       The file-like object is read-only and provides the following methods:
-      :meth:`read`, :meth:`readline`, :meth:`readlines`, :meth:`__iter__`,
-      :meth:`__next__`.
+      :meth:`!read`, :meth:`!readline`, :meth:`!readlines`, :meth:`!__iter__`,
+      :meth:`!__next__`.
 
    .. note::
 
@@ -294,7 +295,7 @@
 
    .. note::
 
-      When passing a :class:`ZipInfo` instance as the *zinfo_or_acrname* parameter,
+      When passing a :class:`ZipInfo` instance as the *zinfo_or_arcname* parameter,
       the compression method used will be that specified in the *compress_type*
       member of the given :class:`ZipInfo` instance.  By default, the
       :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`.
@@ -318,37 +319,53 @@
    string no longer than 65535 bytes.  Comments longer than this will be
    truncated in the written archive when :meth:`ZipFile.close` is called.
 
+
 .. _pyzipfile-objects:
 
 PyZipFile Objects
 -----------------
 
 The :class:`PyZipFile` constructor takes the same parameters as the
-:class:`ZipFile` constructor.  Instances have one method in addition to those of
-:class:`ZipFile` objects.
+:class:`ZipFile` constructor, and one additional parameter, *optimize*.
+
+.. class:: PyZipFile(file, mode='r', compression=ZIP_STORED, allowZip64=False, \
+                     optimize=-1)
+
+   .. versionadded:: 3.2
+      The *optimize* parameter.
+
+   Instances have one method in addition to those of :class:`ZipFile` objects:
 
+   .. method:: PyZipFile.writepy(pathname, basename='')
 
-.. method:: PyZipFile.writepy(pathname, basename='')
+      Search for files :file:`\*.py` and add the corresponding file to the
+      archive.
 
-   Search for files :file:`\*.py` and add the corresponding file to the archive.
-   The corresponding file is a :file:`\*.pyo` file if available, else a
-   :file:`\*.pyc` file, compiling if necessary.  If the pathname is a file, the
-   filename must end with :file:`.py`, and just the (corresponding
-   :file:`\*.py[co]`) file is added at the top level (no path information).  If the
-   pathname is a file that does not end with :file:`.py`, a :exc:`RuntimeError`
-   will be raised.  If it is a directory, and the directory is not a package
-   directory, then all the files :file:`\*.py[co]` are added at the top level.  If
-   the directory is a package directory, then all :file:`\*.py[co]` are added under
-   the package name as a file path, and if any subdirectories are package
-   directories, all of these are added recursively.  *basename* is intended for
-   internal use only.  The :meth:`writepy` method makes archives with file names
-   like this::
-
-      string.pyc                                # Top level name
-      test/__init__.pyc                         # Package directory
-      test/testall.pyc                          # Module test.testall
-      test/bogus/__init__.pyc                   # Subpackage directory
-      test/bogus/myfile.pyc                     # Submodule test.bogus.myfile
+      If the *optimize* parameter to :class:`PyZipFile` was not given or ``-1``,
+      the corresponding file is a :file:`\*.pyo` file if available, else a
+      :file:`\*.pyc` file, compiling if necessary.
+
+      If the *optimize* parameter to :class:`PyZipFile` was ``0``, ``1`` or
+      ``2``, only files with that optimization level (see :func:`compile`) are
+      added to the archive, compiling if necessary.
+
+      If the pathname is a file, the filename must end with :file:`.py`, and
+      just the (corresponding :file:`\*.py[co]`) file is added at the top level
+      (no path information).  If the pathname is a file that does not end with
+      :file:`.py`, a :exc:`RuntimeError` will be raised.  If it is a directory,
+      and the directory is not a package directory, then all the files
+      :file:`\*.py[co]` are added at the top level.  If the directory is a
+      package directory, then all :file:`\*.py[co]` are added under the package
+      name as a file path, and if any subdirectories are package directories,
+      all of these are added recursively.  *basename* is intended for internal
+      use only.  The :meth:`writepy` method makes archives with file names like
+      this::
+
+         string.pyc                   # Top level name
+         test/__init__.pyc            # Package directory
+         test/testall.pyc             # Module test.testall
+         test/bogus/__init__.pyc      # Subpackage directory
+         test/bogus/myfile.pyc        # Submodule test.bogus.myfile
 
 
 .. _zipinfo-objects:

Modified: python/branches/py3k-cdecimal/Doc/license.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/license.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/license.rst	Sun Jan  2 13:18:37 2011
@@ -108,7 +108,7 @@
 +----------------+--------------+------------+------------+-----------------+
 | 3.1.2          | 3.1          | 2010       | PSF        | yes             |
 +----------------+--------------+------------+------------+-----------------+
-| 3.2            | 3.1          | 2010       | PSF        | yes             |
+| 3.2            | 3.1          | 2011       | PSF        | yes             |
 +----------------+--------------+------------+------------+-----------------+
 
 .. note::
@@ -138,7 +138,7 @@
    analyze, test, perform and/or display publicly, prepare derivative works,
    distribute, and otherwise use Python |release| alone or in any derivative
    version, provided, however, that PSF's License Agreement and PSF's notice of
-   copyright, i.e., "Copyright ?? 2001-2010 Python Software Foundation; All Rights
+   copyright, i.e., "Copyright ?? 2001-2011 Python Software Foundation; All Rights
    Reserved" are retained in Python |release| alone or in any derivative version
    prepared by Licensee.
 
@@ -906,7 +906,7 @@
 sources unless the zlib version found on the system is too old to be
 used for the build::
 
-  Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
+  Copyright (C) 1995-2011 Jean-loup Gailly and Mark Adler
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

Modified: python/branches/py3k-cdecimal/Doc/reference/datamodel.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/reference/datamodel.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/reference/datamodel.rst	Sun Jan  2 13:18:37 2011
@@ -618,7 +618,7 @@
       an object passed to the C function as an implicit extra argument.  An example of
       a built-in method is ``alist.append()``, assuming *alist* is a list object. In
       this case, the special read-only attribute :attr:`__self__` is set to the object
-      denoted by *list*.
+      denoted by *alist*.
 
    Classes
       Classes are callable.  These objects normally act as factories for new

Modified: python/branches/py3k-cdecimal/Doc/reference/expressions.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/reference/expressions.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/reference/expressions.rst	Sun Jan  2 13:18:37 2011
@@ -1161,7 +1161,7 @@
 'foo'`` yields ``False``, not ``''``.)
 
 
-Conditional Expressions
+Conditional expressions
 =======================
 
 .. index::
@@ -1322,8 +1322,8 @@
    true numerically due to roundoff.  For example, and assuming a platform on which
    a Python float is an IEEE 754 double-precision number, in order that ``-1e-100 %
    1e100`` have the same sign as ``1e100``, the computed result is ``-1e-100 +
-   1e100``, which is numerically exactly equal to ``1e100``.  Function :func:`fmod`
-   in the :mod:`math` module returns a result whose sign matches the sign of the
+   1e100``, which is numerically exactly equal to ``1e100``.  The function
+   :func:`math.fmod` returns a result whose sign matches the sign of the
    first argument instead, and so returns ``-1e-100`` in this case. Which approach
    is more appropriate depends on the application.
 
@@ -1344,7 +1344,8 @@
    the :keyword:`is` operator, like those involving comparisons between instance
    methods, or constants.  Check their documentation for more info.
 
-.. [#] The ``%`` is also used for string formatting; the same precedence applies.
+.. [#] The ``%`` operator is also used for string formatting; the same
+   precedence applies.
 
 .. [#] The power operator ``**`` binds less tightly than an arithmetic or
    bitwise unary operator on its right, that is, ``2**-1`` is ``0.5``.

Modified: python/branches/py3k-cdecimal/Doc/reference/lexical_analysis.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/reference/lexical_analysis.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/reference/lexical_analysis.rst	Sun Jan  2 13:18:37 2011
@@ -292,9 +292,11 @@
 Identifiers are unlimited in length.  Case is significant.
 
 .. productionlist::
-   identifier: `id_start` `id_continue`*
+   identifier: `xid_start` `xid_continue`*
    id_start: 
    id_continue: 
+   xid_start: 
+   xid_continue: 
 
 The Unicode category codes mentioned above stand for:
 
@@ -308,9 +310,11 @@
 * *Mc* - spacing combining marks
 * *Nd* - decimal numbers
 * *Pc* - connector punctuations
+* *Other_ID_Start* - explicit list of characters in `PropList.txt `_ to support backwards compatibility
+* *Other_ID_Continue* - likewise
 
-All identifiers are converted into the normal form NFC while parsing; comparison
-of identifiers is based on NFC.
+All identifiers are converted into the normal form NFKC while parsing; comparison
+of identifiers is based on NFKC.
 
 A non-normative HTML file listing all valid identifier characters for Unicode
 4.1 can be found at

Modified: python/branches/py3k-cdecimal/Doc/tools/sphinxext/static/basic.css
==============================================================================
--- python/branches/py3k-cdecimal/Doc/tools/sphinxext/static/basic.css	(original)
+++ python/branches/py3k-cdecimal/Doc/tools/sphinxext/static/basic.css	Sun Jan  2 13:18:37 2011
@@ -364,6 +364,7 @@
 
 pre {
     overflow: auto;
+    overflow-y: hidden;
 }
 
 td.linenos pre {

Modified: python/branches/py3k-cdecimal/Doc/tools/sphinxext/susp-ignored.csv
==============================================================================
--- python/branches/py3k-cdecimal/Doc/tools/sphinxext/susp-ignored.csv	(original)
+++ python/branches/py3k-cdecimal/Doc/tools/sphinxext/susp-ignored.csv	Sun Jan  2 13:18:37 2011
@@ -324,3 +324,22 @@
 library/configparser,,`,# Set the optional `raw` argument of get() to True if you wish to disable
 library/configparser,,`,# The optional `vars` argument is a dict with members that will take
 library/configparser,,`,# The optional `fallback` argument can be used to provide a fallback value
+library/configparser,,:option,${section:option}
+library/configparser,,:system,path: ${Common:system_dir}/Library/Frameworks/
+library/configparser,,:home,my_dir: ${Common:home_dir}/twosheds
+library/configparser,,:path,python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}
+library/configparser,,:Python,python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}
+library/pdb,,:lineno,[filename:lineno | bpnumber [bpnumber ...]]
+library/pdb,,:lineno,filename:lineno
+library/logging,,:Watch,WARNING:root:Watch out!
+library/logging,,:So,INFO:root:So should this
+library/logging,,:Started,INFO:root:Started
+library/logging,,:Doing,INFO:root:Doing something
+library/logging,,:Finished,INFO:root:Finished
+library/logging,,:Look,WARNING:root:Look before you leap!
+library/logging,,:So,INFO:So should this
+library/logging,,:logger,severity:logger name:message
+library/logging,,:message,severity:logger name:message
+whatsnew/3.2,,:directory,...   ${buildout:directory}/downloads/dist
+whatsnew/3.2,,:location,... zope9-location = ${zope9:location}
+whatsnew/3.2,,:prefix,... zope-conf = ${custom:prefix}/etc/zope.conf

Modified: python/branches/py3k-cdecimal/Doc/tutorial/interpreter.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/tutorial/interpreter.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/tutorial/interpreter.rst	Sun Jan  2 13:18:37 2011
@@ -58,14 +58,6 @@
 ``python -m module [arg] ...``, which executes the source file for *module* as
 if you had spelled out its full name on the command line.
 
-Note that there is a difference between ``python file`` and ``python
->> import os
-   >>> os.system('time 0:02')
-   0
    >>> os.getcwd()      # Return the current working directory
    'C:\\Python31'
-   >>> os.chdir('/server/accesslogs')
+   >>> os.chdir('/server/accesslogs')   # Change current working directory
+   >>> os.system('mkdir today')   # Run the command mkdir in the system shell
+   0
 
 Be sure to use the ``import os`` style instead of ``from os import *``.  This
 will keep :func:`os.open` from shadowing the built-in :func:`open` function which
@@ -207,14 +207,14 @@
 :mod:`tarfile`. ::
 
    >>> import zlib
-   >>> s = 'witch which has which witches wrist watch'
+   >>> s = b'witch which has which witches wrist watch'
    >>> len(s)
    41
    >>> t = zlib.compress(s)
    >>> len(t)
    37
    >>> zlib.decompress(t)
-   'witch which has which witches wrist watch'
+   b'witch which has which witches wrist watch'
    >>> zlib.crc32(s)
    226805979
 

Modified: python/branches/py3k-cdecimal/Doc/using/cmdline.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/using/cmdline.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/using/cmdline.rst	Sun Jan  2 13:18:37 2011
@@ -220,6 +220,13 @@
    Discard docstrings in addition to the :option:`-O` optimizations.
 
 
+.. cmdoption:: -q
+
+   Don't display the copyright and version messages even in interactive mode.
+
+   .. versionadded:: 3.2
+
+
 .. cmdoption:: -s
 
    Don't add user site directory to sys.path

Modified: python/branches/py3k-cdecimal/Doc/whatsnew/2.7.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/whatsnew/2.7.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/whatsnew/2.7.rst	Sun Jan  2 13:18:37 2011
@@ -246,7 +246,7 @@
 modules.
 
 * The :mod:`ConfigParser` module uses them by default, meaning that
-  configuration files can now read, modified, and then written back
+  configuration files can now be read, modified, and then written back
   in their original order.
 
 * The :meth:`~collections.somenamedtuple._asdict()` method for

Modified: python/branches/py3k-cdecimal/Doc/whatsnew/3.2.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/whatsnew/3.2.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/whatsnew/3.2.rst	Sun Jan  2 13:18:37 2011
@@ -11,7 +11,7 @@
 
    * Anyone can add text to this document.  Do not spend very much time
    on the wording of your changes, because your text will probably
-   get rewritten to some degree.
+   get rewritten.
 
    * The maintainer will go through Misc/NEWS periodically and add
    changes; it's therefore more important to add your changes to
@@ -47,7 +47,128 @@
    This saves the maintainer the effort of going through the SVN log
    when researching a change.
 
-This article explains the new features in Python 3.2, compared to 3.1.
+This article explains the new features in Python 3.2 as compared to 3.1.  It
+focuses on a few highlights and gives a few examples.  For full details, see the
+:source:`Misc/NEWS ` file.
+
+.. seealso::
+
+   :pep:`392` - Python 3.2 Release Schedule
+
+PEP 384: Defining a Stable ABI
+==============================
+
+In the past, extension modules built for one Python version were often
+not usable with other Python versions. Particularly on Windows, every
+feature release of Python required rebuilding all extension modules that
+one wanted to use. This requirement was the result of the free access to
+Python interpreter internals that extension modules could use.
+
+With Python 3.2, an alternative approach becomes available: extension
+modules which restrict themselves to a limited API (by defining
+Py_LIMITED_API) cannot use many of the internals, but are constrained
+to a set of API functions that are promised to be stable for several
+releases. As a consequence, extension modules built for 3.2 in that
+mode will also work with 3.3, 3.4, and so on. Extension modules that
+make use of details of memory structures can still be built, but will
+need to be recompiled for every feature release.
+
+.. seealso::
+
+   :pep:`384` - Defining a Stable ABI
+      PEP written by Martin von L??wis.
+
+PEP 389: Argparse Command Line Parsing Module
+=============================================
+
+A new module for command line parsing, :mod:`argparse`, was introduced to
+overcome the limitations of :mod:`optparse` which did not provide support for
+positional arguments (not just options), subcommands, required options and other
+common patterns of specifying and validating options.
+
+This module has already has wide-spread success in the community as a
+third-party module.  Being more fully featured than its predecessor, the
+:mod:`argparse` module is now the preferred module for command-line processing.
+The older module is still being kept available because of the substantial amount
+of legacy code that depends on it.
+
+Here's an annotated example parser showing features like limiting results to a
+set of choices, specifying a *metavar* in the help screen, validating that one
+or more positional arguments is present, and making a required option::
+
+    import argparse
+    parser = argparse.ArgumentParser(
+                description = 'Manage servers',         # main description for help
+                epilog = 'Tested on Solaris and Linux') # displayed after help
+    parser.add_argument('action',                       # argument name
+                choices = ['deploy', 'start', 'stop'],  # one of four allowed values
+                help = 'action on each target')         # help msg
+    parser.add_argument('targets',
+                metavar = 'HOSTNAME',                   # var name used in help msg
+                nargs = '+',                            # require 1 or more targets
+                help = 'url for target machines')       # help msg explanation
+    parser.add_argument('-u', '--user',                 # -u or --user option
+                required = True,                        # make this a required argument
+                help = 'login as user')
+
+Example of calling the parser on a command string::
+
+    >>> cmd  = 'deploy sneezy.example.com sleepy.example.com -u skycaptain'
+    >>> result = parser.parse_args(cmd.split())
+    >>> result.action
+    'deploy'
+    >>> result.targets
+    ['sneezy.example.com', 'sleepy.example.com']
+    >>> result.user
+    'skycaptain'
+
+Example of the parser's automatically generated help::
+
+    >>> parser.parse_args('-h'.split())
+
+    usage: manage_cloud.py [-h] -u USER
+                           {deploy,start,stop} HOSTNAME [HOSTNAME ...]
+
+    Manage servers
+
+    positional arguments:
+      {deploy,start,stop}   action on each target
+      HOSTNAME              url for target machines
+
+    optional arguments:
+      -h, --help            show this help message and exit
+      -u USER, --user USER  login as user
+
+    Tested on Solaris and Linux
+
+An especially nice :mod:`argparse` feature is the ability to define subparsers,
+each with their own argument patterns and help displays::
+
+    import argparse
+    parser = argparse.ArgumentParser(prog='HELM')
+    subparsers = parser.add_subparsers()
+
+    parser_l = subparsers.add_parser('launch', help='Launch Control')   # first subgroup
+    parser_l.add_argument('-m', '--missiles', action='store_true')
+    parser_l.add_argument('-t', '--torpedos', action='store_true')
+
+    parser_m = subparsers.add_parser('move', help='Move Vessel',        # second subgroup
+                                     aliases=('steer', 'turn'))         # equivalent names
+    parser_m.add_argument('-c', '--course', type=int, required=True)
+    parser_m.add_argument('-s', '--speed', type=int, default=0)
+
+    $ ./helm.py --help                         # top level help (launch and move)
+    $ ./helm.py launch --help                  # help for launch options
+    $ ./helm.py launch --missiles              # set missiles=True and torpedos=False
+    $ ./helm.py steer --course 180 --speed 5   # set movement parameters
+
+.. seealso::
+
+   :pep:`389` - New Command Line Parsing Module
+      PEP written by Steven Bethard.
+
+   :ref:`upgrading-optparse-code` for details on the differences from
+      :mod:`optparse`.
 
 
 PEP 391:  Dictionary Based Configuration for Logging
@@ -84,7 +205,7 @@
     "root": {"level": "DEBUG", "handlers": ["console", "console_priority"]}}
 
 
-If that dictionary is stored in a file called "conf.json", it can loaded
+If that dictionary is stored in a file called :file:`conf.json`, it can loaded
 and called with code like this::
 
    >>> import logging.config
@@ -100,7 +221,60 @@
 PEP 3148:  The ``concurrent.futures`` module
 ============================================
 
-.. (Stub section)
+Code for creating and managing concurrency is being collected in a new toplevel
+namespace, *concurrent*.  Its first member is a *futures* package which provides
+a uniform high level interface for managing threads and processes.
+
+The design for :mod:`concurrent.futures` was inspired by
+*java.util.concurrent.package*.  In that model, a running call and its result
+are represented by a :class:`~concurrent.futures.Future` object which abstracts
+features common to threads, processes, and remote procedure calls.  That object
+supports status checks (running or done), timeouts, cancellations, adding
+callbacks, and access to results or exceptions.
+
+The primary offering of the new module is a pair of executor classes for
+launching and managing calls.  The goal of the executors is to make it easier to
+use existing tools for making parallel calls. They save the effort needed to
+setup a pool of resources, launch the calls, create a results queue, add
+time-out handling, and limit the total number of threads, processes, or remote
+procedure calls.
+
+Ideally, each application should share a single executor across multiple
+components so that process and thread limits can be centrally managed.  This
+solves the design challenge that arises when each component has its own
+competing strategy for resource management.
+
+Both classes share a common interface with three methods:
+:meth:`~concurrent.futures.Executor.submit` for scheduling a callable and
+returning a :class:`~concurrent.futures.Future` object;
+:meth:`~concurrent.futures.Executor.map` for scheduling many asynchronous calls
+at a time, and :meth:`~concurrent.futures.Executor.shutdown` for freeing
+resources.  The class is a :term:`context manager` and can be used within a
+:keyword:`with` statement to assure that resources are automatically released
+when currently pending futures are done executing.
+
+A simple of example of :class:`~concurrent.futures.ThreadPoolExecutor` is a
+launch of four parallel threads for copying files::
+
+  import shutil
+  with ThreadPoolExecutor(max_workers=4) as e:
+      e.submit(shutil.copy, 'src1.txt', 'dest1.txt')
+      e.submit(shutil.copy, 'src2.txt', 'dest2.txt')
+      e.submit(shutil.copy, 'src3.txt', 'dest3.txt')
+      e.submit(shutil.copy, 'src3.txt', 'dest4.txt')
+
+.. seealso::
+
+   :pep:`3148` - Futures -- Execute Computations Asynchronously
+      PEP written by Brian Quinlan.
+
+   :ref:`Code for Threaded Parallel URL reads`, an
+   example using threads to fetch multiple web pages in parallel.
+
+   :ref:`Code for computing prime numbers in
+   parallel`, an example demonstrating
+   :class:`~concurrent.futures.ProcessPoolExecutor`.
+
 
 
 PEP 3147:  PYC Repository Directories
@@ -158,8 +332,8 @@
       PEP written by Barry Warsaw.
 
 
-PEP 3149 ABI Version Tagged .so Files
-=====================================
+PEP 3149: ABI Version Tagged .so Files
+======================================
 
 The PYC repository directory allows multiple bytecode cache files to be
 co-located.  This PEP implements a similar mechanism for shared object files by
@@ -189,38 +363,29 @@
       PEP written by Barry Warsaw.
 
 
-Email 5.1
-=========
-
-The email package is extended to be able to parse and generate email messages
-in bytes format.
-
-* New functions :func:`~email.message_from_bytes` and
-  :func:`~email.message_from_binary_file`, and new classes
-  :class:`~email.parser.BytesFeedParser` and :class:`~email.parser.BytesParser`
-  allow binary message data to be parsed into model objects.
-
-* Given bytes input to the model, :meth:`~email.message.Message.get_payload`
-  will by default decode a message body that has a
-  :mailheader:`Content-Transfer-Encoding` of ``8bit`` using the charset
-  specified in the MIME headers and return the resulting string.
-
-* Given bytes input to the model, :class:`~email.generator.Generator` will
-  convert message bodies that have a :mailheader:`Content-Transfer-Encoding` of
-  8bit to instead have a 7bit Content-Transfer-Encoding.
+Other Language Changes
+======================
 
-* New class :class:`~email.generator.BytesGenerator` produces bytes
-  as output, preserving any unchanged non-ASCII data that was
-  present in the input used to build the model, including message bodies
-  with a :mailheader:`Content-Transfer-Encoding` of 8bit.
+Some smaller changes made to the core Python language are:
 
-  (Proposed and implemented by R. David Murray, :issue:`4661`.)
+* String formatting for :func:`format` and :meth:`str.format` gained new
+  capabilities for the format character **#**.  Previously, for integers in
+  binary, octal, or hexadecimal, it caused the output to be prefixed with '0b',
+  '0o', or '0x' respectively.  Now it can also handle floats, complex, and
+  Decimal, causing the output to always have a decimal point even when no digits
+  follow it.
+
+  >>> format(20, '#o')
+  '0o24'
+  >>> format(12.34, '#5.0f')
+  '  12.'
 
+  (Suggested by Mark Dickinson and implemented by Eric Smith in :issue:`7094`.)
 
-Other Language Changes
-======================
+* The interpreter can now be started with a quiet option, ``-q``, to suppress
+  the copyright and version information in an interactive mode.
 
-Some smaller changes made to the core Python language are:
+  (Contributed by Marcin Wojdyr in issue:`1772833`).
 
 * The :func:`hasattr` function used to catch and suppress any Exception.  Now,
   it only catches :exc:`AttributeError`.  Under the hood, :func:`hasattr` works
@@ -244,20 +409,18 @@
 
   (Proposed and implemented by Mark Dickinson; :issue:`9337`.)
 
-* :class:`memoryview` objects now have a :meth:`release()` method and support
-  the context manager protocol.  This allows timely release of any resources
-  that were acquired when requesting a buffer from the original object.
+* :class:`memoryview` objects now have a :meth:`~memoryview.release()` method
+  and they also now support the context manager protocol.  This allows timely
+  release of any resources that were acquired when requesting a buffer from the
+  original object.
+
+  >>> with memoryview(b'abcdefgh') as v:
+  ...     print(v.tolist())
+  ...
+  [97, 98, 99, 100, 101, 102, 103, 104]
 
   (Added by Antoine Pitrou; :issue:`9757`.)
 
-* Mark Dickinson crafted an elegant and efficient scheme for assuring that
-  different numeric datatypes will have the same hash value whenever their
-  actual values are equal::
-
-   >>> assert hash(Fraction(3, 2)) == hash(1.5) == \
-              hash(Decimal("1.5")) == hash(complex(1.5, 0))
-
-  (See :issue:`8188`.)
 
 * Previously it was illegal to delete a name from the local namespace if it
   occurs as a free variable in a nested block::
@@ -283,41 +446,179 @@
 
   (See :issue:`4617`.)
 
+* The internal :c:type:`structsequence` tool now creates subclasses of tuple.
+  This means that C generated structures like those returned by :func:`os.stat`,
+  :func:`time.gmtime`, and :func:`sys.version_info` now work like a
+  :term:`named tuple` and are more interoperable with functions and methods that
+  expect a tuple as an argument.  The is a big step forward in making the C
+  structures as flexible as their pure Python counterparts.
+
+  (Suggested by Arfrever Frehtes Taifersar Arahesis and implemented
+  by Benjamin Peterson in :issue:`8413`.)
+
+* Warnings are now easier to control.  A :envvar:`PYTHONWARNINGS` environment
+  variable is now available as an alternative to using ``-W`` at the command
+  line.
+
+  (Suggested by Barry Warsaw and implemented by Philip Jenvey in :issue:`7301`.)
+
 * A new warning category, :exc:`ResourceWarning`, has been added.  It is
-  emitted when certain potential issues with resource consumption or cleanup
+  emitted when potential issues with resource consumption or cleanup
   are detected.  It is silenced by default in normal release builds, but
-  can be easily enabled through the means provided by the :mod:`warnings`
+  can be enabled through the means provided by the :mod:`warnings`
   module, or on the command line.
 
-  :exc:`ResourceWarning` is issued at interpreter shutdown if the
+  A :exc:`ResourceWarning` is issued at interpreter shutdown if the
   :data:`gc.garbage` list isn't empty.  This is meant to make the programmer
   aware that their code contains object finalization issues.
 
-  (Added by Antoine Pitrou and Georg Brandl; :issue:`477863`.)
-
-  :exc:`ResourceWarning` is also issued when a :term:`file object` is destroyed
+  A :exc:`ResourceWarning` is also issued when a :term:`file object` is destroyed
   without having been explicitly closed.  While the deallocator for such
   object ensures it closes the underlying operating system resource
   (usually, a file descriptor), the delay in deallocating the object could
   produce various issues, especially under Windows.  Here is an example
   of enabling the warning from the command line::
 
-      $ ./python -Wdefault
-      Python 3.2a3+ (py3k, Nov  5 2010, 22:58:04)
-      [GCC 4.4.3] on linux2
-      Type "help", "copyright", "credits" or "license" for more information.
+      $ ./python -q -Wdefault
       >>> f = open("foo", "wb")
       >>> del f
       __main__:1: ResourceWarning: unclosed file <_io.BufferedWriter name='foo'>
-      >>>
 
-  (Added by Antoine Pitrou, :issue:`10093`.)
+  (Added by Antoine Pitrou and Georg Brandl in :issue:`10093` and :issue:`477863`.)
+
+* :class:`range` objects now support *index* and *count* methods. This is part
+  of an effort to make more objects fully implement the
+  :class:`collections.Sequence` :term:`abstract base class`.  As a result, the
+  language will have a more uniform API.  In addition, :class:`range` objects
+  now support slicing and negative indices.  This makes *range* more
+  interoperable with lists::
+
+      >>> range(0, 100, 2).count(10)
+      1
+      >>> range(0, 100, 2).index(10)
+      5
+      >>> range(0, 100, 2)[5]
+      10
+      >>> range(0, 100, 2)[0:5]
+      range(0, 10, 2)
+
+  (Contributed by Daniel Stuzback in :issue:`9213` and by Alexander Belopolsky
+  in :issue:`2690`.)
+
+* The :func:`callable` builtin function from Py2.x was resurrected.  It provides
+  a concise, readable alternative to using an :term:`abstract base class` in an
+  expression like ``isinstance(x, collections.Callable)``:
+
+  >>> callable(max)
+  True
+  >>> callable(20)
+  False
+
+  (See :issue:`10518`.)
+
+* Python's import mechanism can now load module installed in directories with
+  non-ASCII characters in the path name.
+
+  (Required extensive work by Victor Stinner in :issue:`9425`.)
 
 
 New, Improved, and Deprecated Modules
 =====================================
 
-* XXX mention :mod:`argparse`.
+Python's standard library has undergone significant maintenance efforts and
+quality improvements.
+
+The biggest news for Python 3.2 is that the :mod:`email` package and
+:mod:`nntplib` modules now work correctly with the bytes/text model in Python 3.
+For the first time, there is correct handling of inputs with mixed encodings.
+
+Throughout the standard library, there has been more careful attention to
+encodings and text versus bytes issues.  In particular, interactions with the
+operating system are now better able to pass non-ASCII data using the Windows
+mcbs encoding, locale aware encodings, or UTF-8.
+
+Another significant win is the addition of substantially better support for
+*SSL* connections and security certificates.
+
+In addition, more functions and classes now have a :term:`context manager` to
+support convenient and reliable resource clean-up using the
+:keyword:`with`-statement.
+
+email
+-----
+
+The usability of the :mod:`email` package in Python 3 has been mostly fixed by
+the extensive efforts of R. David Murray.  The problem was that emails are
+typically read and stored in the form of :class:`bytes` rather than :class:`str`
+text, and they may contain multiple encodings within a single email.  So, the
+email package had to be extended to parse and generate email messages in bytes
+format.
+
+* New functions :func:`~email.message_from_bytes` and
+  :func:`~email.message_from_binary_file`, and new classes
+  :class:`~email.parser.BytesFeedParser` and :class:`~email.parser.BytesParser`
+  allow binary message data to be parsed into model objects.
+
+* Given bytes input to the model, :meth:`~email.message.Message.get_payload`
+  will by default decode a message body that has a
+  :mailheader:`Content-Transfer-Encoding` of *8bit* using the charset
+  specified in the MIME headers and return the resulting string.
+
+* Given bytes input to the model, :class:`~email.generator.Generator` will
+  convert message bodies that have a :mailheader:`Content-Transfer-Encoding` of
+  *8bit* to instead have a *7bit* :mailheader:`Content-Transfer-Encoding`.
+
+* A new class :class:`~email.generator.BytesGenerator` produces bytes as output,
+  preserving any unchanged non-ASCII data that was present in the input used to
+  build the model, including message bodies with a
+  :mailheader:`Content-Transfer-Encoding` of *8bit*.
+
+* The :mod:`smtplib` :class:`~smtplib.SMTP` class now accepts a byte string
+  for the *msg* argument to the :meth:`~smtplib.SMTP.sendmail` method,
+  and a new method, :meth:`~smtplib.SMTP.send_message` accepts a
+  :class:`~email.message.Message` object and can optionally obtain the
+  *from_addr* and *to_addrs* addresses directly from the object.
+
+.. XXX Update before 3.2rc1 to reflect all of the latest work and add examples.
+
+(Proposed and implemented by R. David Murray, :issue:`4661` and :issue:`10321`.)
+
+elementtree
+-----------
+
+The :mod:`xml.etree.ElementTree` package and its :mod:`xml.etree.cElementTree`
+counterpart have been updated to version 1.3.
+
+Several new and useful functions and methods have been added:
+
+* :func:`xml.etree.ElementTree.fromstringlist` which builds an XML document
+  from a sequence of fragments
+* :func:`xml.etree.ElementTree.register_namespace` for registering a global
+  namespace prefix
+* :func:`xml.etree.ElementTree.tostringlist` for string representation
+  including all sublists
+* :meth:`xml.etree.ElementTree.Element.extend` for appending a sequence of zero
+  or more elements
+* :meth:`xml.etree.ElementTree.Element.iterfind` searches an element and
+  subelements
+* :meth:`xml.etree.ElementTree.Element.itertext` creates a text iterator over
+  an element and its sub-elements
+* :meth:`xml.etree.ElementTree.TreeBuilder.end` closes the current element
+* :meth:`xml.etree.ElementTree.TreeBuilder.doctype` handles a doctype
+  declaration
+
+Two methods have been deprecated:
+
+* :meth:`xml.etree.ElementTree.getchildren` use ``list(elem)`` instead.
+* :meth:`xml.etree.ElementTree.getiterator` use ``Element.iter`` instead.
+
+For details of the update, see `Introducing ElementTree
+`_ on Fredrik Lundh's website.
+
+(Contributed by Florent Xicluna and Fredrik Lundh, :issue:`6472`.)
+
+functools
+---------
 
 * The :mod:`functools` module includes a new decorator for caching function
   calls.  :func:`functools.lru_cache` can save repeated queries to an external
@@ -332,20 +633,22 @@
          c.execute('SELECT phonenumber FROM phonelist WHERE name=?', (name,))
          return c.fetchone()[0]
 
+  >>> for name in user_requests:
+  ...     get_phone_number(name)        # cached lookup
+
   To help with choosing an effective cache size, the wrapped function is
-  instrumented with two attributes *cache_hits* and *cache_misses*:
+  instrumented for tracking cache statistics:
 
-  >>> for name in user_requests:
-  ...     get_phone_number(name)
-  >>> print(get_phone_number.cache_hits, get_phone_number.cache_misses)
-  4805 980
+  >>> get_phone_number.cache_info()
+  CacheInfo(hits=4805, misses=980, maxsize=300, currsize=300)
 
   If the phonelist table gets updated, the outdated contents of the cache can be
   cleared with:
 
   >>> get_phone_number.cache_clear()
 
-  (Contributed by Raymond Hettinger.)
+  (Contributed by Raymond Hettinger and incorporating design ideas from
+  Jim Baker, Miki Tebeka, and Nick Coghlan.)
 
 * The :func:`functools.wraps` decorator now adds a :attr:`__wrapped__` attribute
   pointing to the original callable function.  This allows wrapped functions to
@@ -356,76 +659,312 @@
   (By Nick Coghlan and Terrence Cole; :issue:`9567`, :issue:`3445`, and
   :issue:`8814`.)
 
-* The :mod:`nntplib` module gets a revamped implementation with better
-  bytes / unicode semantics as well as more practical APIs.  These improvements
-  break compatibility with the nntplib version in Python 3.1, which was
-  partly dysfunctional in itself.
+* To help write classes with rich comparison methods, a new decorator
+  :func:`functools.total_ordering` will use a existing equality and inequality
+  methods to fill-in the remaining methods.
+
+  For example, supplying *__eq__* and *__lt__* will enable
+  :func:`~functools.total_ordering` to fill-in *__le__*, *__gt__* and *__ge__*::
+
+    @total_ordering
+    class Student:
+        def __eq__(self, other):
+            return ((self.lastname.lower(), self.firstname.lower()) ==
+                    (other.lastname.lower(), other.firstname.lower()))
+        def __lt__(self, other):
+            return ((self.lastname.lower(), self.firstname.lower()) <
+                    (other.lastname.lower(), other.firstname.lower()))
 
-  (Contributed by Antoine Pitrou in :issue:`9360`)
+  (Contributed by Raymond Hettinger.)
 
-* The :mod:`abc` module now supports :func:`~abc.abstractclassmethod` and
-  :func:`~abc.abstractstaticmethod`.
+.. XXX clarify what the example does
 
-  (Patch submitted by Daniel Urban; :issue:`5867`.)
+* To aid in porting programs from Python 2, the :func:`~functools.cmp_to_key`
+  function converts an old-style comparison function to
+  modern :term:`key function`:
 
-* The previously deprecated :func:`contextlib.nested` function has been removed
-  in favor of a plain :keyword:`with` statement which can accept multiple
-  context managers.  The latter technique is faster (because it is built-in),
-  and it does a better job finalizing multiple context managers when one of them
-  raises an exception.
+  >>> # locale-aware sort order
+  >>> sorted(iterable, key=cmp_to_key(locale.strcoll))
 
-  (Contributed by Georg Brandl and Mattias Br??ndstr??m;
-  `appspot issue 53094 `_.)
+  For sorting examples and a brief sorting tutorial, see the `Sorting HowTo
+  `_ tutorial.
+
+  (Contributed by Raymond Hettinger.)
+
+itertools
+---------
+
+* The :mod:`itertools` module has a new :func:`~itertools.accumulate` function
+  modeled on APL's *scan* operator and on Numpy's *accumulate* function:
+
+  >>> list(accumulate(8, 2, 50))
+  [8, 10, 60]
+
+  >>> prob_dist = [0.1, 0.4, 0.2, 0.3]
+  >>> list(accumulate(prob_dist))      # cumulative probability distribution
+  [0.1, 0.5, 0.7, 1.0]
+
+  For an example using :func:`~itertools.accumulate`, see the :ref:`examples for
+  the random module `.
+
+  (Contributed by Raymond Hettinger and incorporating design suggestions
+  from Mark Dickinson.)
+
+collections
+-----------
+
+* The :class:`collections.Counter` class now has two forms of in-place
+  subtraction, the existing *-=* operator for `saturating subtraction
+  `_ and the new
+  :meth:`~collections.Counter.subtract` method for regular subtraction.  The
+  former is suitable for `multisets `_
+  which only have positive counts, and the latter is more suitable for use cases
+  that allow negative counts:
+
+  >>> tally = Counter(dogs=5, cat=3)
+  >>> tally -= Counter(dogs=2, cats=8)    # saturating subtraction
+  >>> tally
+  Counter({'dogs': 3})
+
+  >>> tally = Counter(dogs=5, cats=3)
+  >>> tally.subtract(dogs=2, cats=8)      # regular subtraction
+  >>> tally
+  Counter({'dogs': 3, 'cats': -5})
+
+  (Contributed by Raymond Hettinger.)
+
+* The :class:`collections.OrderedDict` class has a new method
+  :meth:`~collections.OrderedDict.move_to_end` which takes an existing key and
+  moves it to either the beginning or end of an ordered sequence.  When the
+  dictionary sequence is being used as a queue, these operations correspond to
+  "move to the front of the line" or "move to the back of the line":
+
+  >>> d = OrderedDict.fromkeys(['a', 'b', 'X', 'd', 'e'])
+  >>> list(d)
+  ['a', 'b', 'X', 'd', 'e']
+  >>> d.move_to_end('X', last=True)
+  >>> list(d)
+  ['a', 'b', 'd', 'e', 'X']
+  >>> d.move_to_end('X', last=False)
+  >>> list(d)
+  ['X', 'a', 'b', 'd', 'e']
+
+  (Contributed by Raymond Hettinger.)
+
+* The :class:`collections.deque` grew two new methods :meth:`~collections.deque.count`
+  and :meth:`collections.deque.reverse` that make them more substitutable for
+  :class:`list` when needed:
+
+  >>> d = deque('simsalabim')
+  >>> d.count('s')
+  2
+  >>> d.reverse()
+  >>> d
+  deque(['m', 'i', 'b', 'a', 'l', 'a', 's', 'm', 'i', 's'])
+
+  (Contributed by Raymond Hettinger.)
+
+datetime
+--------
+
+* The :mod:`datetime` module has a new type :class:`~datetime.timezone` that
+  implements the :class:`~datetime.tzinfo` interface by returning a fixed UTC
+  offset and timezone name. This makes it easier to create timezone aware
+  datetime objects:
+
+  >>> datetime.now(timezone.utc)
+  datetime.datetime(2010, 12, 8, 21, 4, 2, 923754, tzinfo=datetime.timezone.utc)
+
+  >>> datetime.strptime("01/01/2000 12:00 +0000", "%m/%d/%Y %H:%M %z")
+  datetime.datetime(2000, 1, 1, 12, 0, tzinfo=datetime.timezone.utc)
+
+* Also, :class:`~datetime.timedelta` objects can now be multiplied by
+  :class:`float` and divided by :class:`float` and :class:`int` objects.
+
+.. XXX Describe added support for dividing a timedelta by another timedelta.
+       See revision 80290 and issue #2706.
+
+  (Contributed by Alexander Belopolsky in :issue:`1289118`, :issue:`5094` and
+  :issue:`6641`.)
+
+abc
+---
+
+The :mod:`abc` module now supports :func:`~abc.abstractclassmethod` and
+:func:`~abc.abstractstaticmethod`.
+
+These tools make it possible to define an :term:`Abstract Base Class` that
+requires a particular :func:`classmethod` or :func:`staticmethod` to be
+implemented.
+
+(Patch submitted by Daniel Urban; :issue:`5867`.)
+
+contextlib
+----------
 
-* The :class:`ftplib.FTP` class now supports the context manager protocol to
-  unconditionally consume :exc:`socket.error` exceptions and to close the FTP
-  connection when done::
+There is a new and slightly mind-blowing tool
+:class:`~contextlib.ContextDecorator` that is helpful for creating a
+:term:`context manager` that does double-duty as a function decorator.
 
-   >>> from ftplib import FTP
-   >>> with FTP("ftp1.at.proftpd.org") as ftp:
-   ...     ftp.login()
-   ...     ftp.dir()
-   ...
-   '230 Anonymous login ok, restrictions apply.'
-   dr-xr-xr-x   9 ftp      ftp           154 May  6 10:43 .
-   dr-xr-xr-x   9 ftp      ftp           154 May  6 10:43 ..
-   dr-xr-xr-x   5 ftp      ftp          4096 May  6 10:43 CentOS
-   dr-xr-xr-x   3 ftp      ftp            18 Jul 10  2008 Fedora
+As a convenience, this new functionality is used by
+:func:`~contextlib.contextmanager` so that no extra effort is needed to support
+both roles.
 
-  Other file-like objects such as :class:`mmap.mmap` and :func:`fileinput.input`
-  also grew auto-closing context managers::
+The basic idea is that both context managers and function decorators can be used
+for pre-action and post-action wrappers.  Context managers wrap a group of
+statements using the :keyword:`with`-statement, and function decorators wrap a
+group of statements enclosed in a function.  So, occasionally there is a need to
+write a pre/post action wrapper that can be used in either role.
 
-      with fileinput.input(files=('log1.txt', 'log2.txt')) as f:
-          for line in f:
-              process(line)
+For example, it is sometimes useful to wrap functions or groups of statements
+with a logger that can track the time of entry and time of exit.  Rather than
+writing both a function decorator and a context manager for the task, the
+:func:`~contextlib.contextmanager` provides both capabilities in a single
+definition:
 
-  (Contributed by Tarek Ziad?? and Giampaolo Rodol?? in :issue:`4972`, and
-  by Georg Brandl in :issue:`8046` and :issue:`1286`.)
+>>> import logging
+>>> logging.basicConfig(level=logging.INFO)
+>>> @contextmanager
+... def track_entry_and_exit(name):
+...     logging.info('Entering: {}'.format(name))
+...     yield
+...     logging.info('Exiting: {}'.format(name))
 
-* :class:`gzip.GzipFile` now implements the :class:`io.BufferedIOBase` ABC
-  (except for ``truncate()``), has a :meth:`~gzip.GzipFile.peek` method,
-  and supports unseekable as well as zero-padded file objects.
+Formerly, this would have only been usable as a context manager:
 
-  (Contributed by Antoine Pitrou, Nir Aides and Brian Curtin in :issue:`9962`,
-  :issue:`1675951`, :issue:`7471` and :issue:`2846`.)
+>>> with track_entry_and_exit('widget loader'):
+...     print('Some time consuming activity goes here')
+...     load_widget()
 
-  The :mod:`gzip` module also gains the :func:`~gzip.compress` and
-  :func:`~gzip.decompress` functions for easier in-memory compression and
-  decompression.
+Now, it can be used as a decorator as well:
 
-  (Contributed by Anand B. Pillai in :issue:`3488`.)
+>>> @track_entry_and_exit('widget loader')
+... def activity():
+...     print('Some time consuming activity goes here')
+...     load_widget()
 
-* The :mod:`os` module now has the :const:`ST_RDONLY` and :const:`ST_NOSUID`
-  constants, for use with the :func:`~os.statvfs` function.
+Trying to fulfill two roles at once places some limitations on the technique.
+Context managers normally have the flexibility to return an argument usable by
+the :keyword:`with`-statement, but there is no parallel for function decorators.
 
-  (Patch by Adam Jackson; :issue:`7647`.)
+In the above example, there is not a clean way for the *track_entry_and_exit*
+context manager does not have a way to return a logging instance for use in the
+body of enclosed statements.
 
-* :func:`os.getppid` is now supported on Windows.  Note that it will continue to
-  return the same pid even after the parent process has exited.
+(Contributed by Michael Foord in :issue:`9110`.)
 
-  (Patch by Jon Anglin; :issue:`6394`.)
+decimal and fractions
+---------------------
 
-* The :func:`shutil.copytree` function has two new options:
+Mark Dickinson crafted an elegant and efficient scheme for assuring that
+different numeric datatypes will have the same hash value whenever their actual
+values are equal (:issue:`8188`)::
+
+   >>> assert hash(Fraction(3, 2)) == hash(1.5) == \
+              hash(Decimal("1.5")) == hash(complex(1.5, 0))
+
+An early decision to limit the inter-operability of various numeric types has
+been relaxed.  It is still unsupported (and ill-advised) to to have implicit
+mixing in arithmetic expressions such as ``Decimal('1.1') + float('1.1')``
+because the latter loses information in the process of constructing the binary
+float.  However, since existing floating point value can be converted losslessly
+to either a decimal or rational representation, it makes sense to add them to
+the constructor and to support mixed-type comparisons.
+
+* The :class:`decimal.Decimal` constructor now accepts :class:`float` objects
+  directly so there in no longer a need to use the :meth:`~decimal.Decimal.from_float`
+  method (:issue:`8257`).
+
+* Mixed type comparisons are now fully supported so that
+  :class:`~decimal.Decimal` objects can be directly compared with :class:`float`
+  and :class:`fractions.Fraction` (:issue:`2531` and :issue:`8188`).
+
+Similar changes were made to :class:`fractions.Fraction` so that the
+:meth:`~fractions.Fraction.from_float()` and :meth:`~fractions.Fraction.from_decimal`
+methods are no longer needed (:issue:`8294`):
+
+>>> Decimal(1.1)
+Decimal('1.100000000000000088817841970012523233890533447265625')
+>>> Fraction(1.1)
+Fraction(2476979795053773, 2251799813685248)
+
+Another useful change for the :mod:`decimal` module is that the
+:attr:`Context.clamp` attribute is now public.  This is useful in creating
+contexts that correspond to the decimal interchange formats specified in IEEE
+754 (see :issue:`8540`).
+
+(Contributed by Mark Dickinson and Raymond Hettinger.)
+
+ftp
+---
+
+The :class:`ftplib.FTP` class now supports the context manager protocol to
+unconditionally consume :exc:`socket.error` exceptions and to close the FTP
+connection when done::
+
+ >>> from ftplib import FTP
+ >>> with FTP("ftp1.at.proftpd.org") as ftp:
+ ...     ftp.login()
+ ...     ftp.dir()
+ ...
+ '230 Anonymous login ok, restrictions apply.'
+ dr-xr-xr-x   9 ftp      ftp           154 May  6 10:43 .
+ dr-xr-xr-x   9 ftp      ftp           154 May  6 10:43 ..
+ dr-xr-xr-x   5 ftp      ftp          4096 May  6 10:43 CentOS
+ dr-xr-xr-x   3 ftp      ftp            18 Jul 10  2008 Fedora
+
+Other file-like objects such as :class:`mmap.mmap` and :func:`fileinput.input`
+also grew auto-closing context managers::
+
+    with fileinput.input(files=('log1.txt', 'log2.txt')) as f:
+        for line in f:
+            process(line)
+
+(Contributed by Tarek Ziad?? and Giampaolo Rodol?? in :issue:`4972`, and
+by Georg Brandl in :issue:`8046` and :issue:`1286`.)
+
+.. XXX mention os.popen and subprocess.Popen auto-closing of fds
+
+gzip and zipfile
+----------------
+
+:class:`gzip.GzipFile` now implements the :class:`io.BufferedIOBase`
+:term:`abstract base class` (except for ``truncate()``).  It also has a
+:meth:`~gzip.GzipFile.peek` method and supports unseekable as well as
+zero-padded file objects.
+
+The :mod:`gzip` module also gains the :func:`~gzip.compress` and
+:func:`~gzip.decompress` functions for easier in-memory compression and
+decompression.  Keep in mind that text needs to be encoded in to :class:`bytes`
+before compressing and decompressing:
+
+>>> s = 'Three shall be the number thou shalt count, '
+>>> s += 'and the number of the counting shall be three'
+>>> b = s.encode()                        # convert to utf-8
+>>> len(b)
+89
+>>> c = gzip.compress(b)
+>>> len(c)
+77
+>>> gzip.decompress(c).decode()[:42]      # decompress and convert to text
+'Three shall be the number thou shalt count,'
+
+(Contributed by Anand B. Pillai in :issue:`3488`; and by Antoine Pitrou, Nir
+Aides and Brian Curtin in :issue:`9962`, :issue:`1675951`, :issue:`7471` and
+:issue:`2846`.)
+
+Also, the :class:`zipfile.ZipExtFile` class was reworked internally to represent
+files stored inside an archive.  The new implementation is significantly faster
+and can be wrapped in a :class:`io.BufferedReader` object for more speedups.  It
+also solves an issue where interleaved calls to *read* and *readline* gave the
+wrong results.
+
+(Patch submitted by by Nir Aides in :issue:`7610`.)
+
+shutil
+------
+
+The :func:`shutil.copytree` function has two new options:
 
   * *ignore_dangling_symlinks*: when ``symlinks=False`` so that the function
     copies the file pointed to by the symlink, not the symlink itself. This
@@ -434,25 +973,40 @@
   * *copy_function*: is a callable that will be used to copy files.
     :func:`shutil.copy2` is used by default.
 
-  (Contributed by Tarek Ziad??.)
+(Contributed by Tarek Ziad??.)
+
+sqlite3
+-------
+
+The :mod:`sqlite3` module was updated to version 2.6.0.  It has two new capabilities.
+
+* The :attr:`sqlite3.Connection.in_transit` attribute is true if there is an
+  active transaction for uncommitted changes.
+
+* The :meth:`sqlite3.Connection.enable_load_extension` and
+  :meth:`sqlite3.Connection.load_extension` methods allows you to load SQLite
+  extensions from ".so" files.  One well-known extension is the fulltext-search
+  extension distributed with SQLite.
+
+(Contributed by R. David Murray and Shashwat Anand; :issue:`8845`.)
+
+socket
+------
+
+The :mod:`socket` module has two new improvements.
 
 * Socket objects now have a :meth:`~socket.socket.detach()` method which puts
   the socket into closed state without actually closing the underlying file
   descriptor.  The latter can then be reused for other purposes.
-
   (Added by Antoine Pitrou; :issue:`8524`.)
 
-* The :mod:`sqlite3` module has two new capabilities.
-
-  The :attr:`Connection.in_transit` attribute is true if there is an active
-  transaction for uncommitted changes.
-
-  The :meth:`Connection.enable_load_extension` and
-  :meth:`Connection.load_extension` methods allows you to load SQLite extensions
-  from ".so" files.  One well-known extension is the fulltext-search extension
-  distributed with SQLite.
+* :func:`socket.create_connection` now supports the context manager protocol
+  to unconditionally consume :exc:`socket.error` exceptions and to close the
+  socket when done.
+  (Contributed by Giampaolo Rodol??; :issue:`9794`.)
 
-  (Contributed by R. David Murray and Shashwat Anand; :issue:`8845`.)
+ssl
+---
 
 * The :mod:`ssl` module has a new class, :class:`~ssl.SSLContext` which serves
   as a container for various persistent SSL data, such as protocol settings,
@@ -460,18 +1014,18 @@
   :meth:`~ssl.SSLContext.wrap_socket` method allows to create an SSL socket from
   such an SSL context.  (Added by Antoine Pitrou; :issue:`8550`.)
 
-  A new function, :func:`ssl.match_hostname`, helps implement server identity
+* A new function, :func:`ssl.match_hostname`, helps implement server identity
   verification for higher-level protocols by implementing the rules of
   HTTPS (from :rfc:`2818`), which are also suitable for other protocols.
   (Added by Antoine Pitrou, :issue:`1589`).
 
-  The :func:`ssl.wrap_socket` constructor function now takes a *ciphers*
+* The :func:`ssl.wrap_socket` constructor function now takes a *ciphers*
   argument that's a string listing the encryption algorithms to be allowed; the
   format of the string is described `in the OpenSSL documentation
   `__.  (Added
   by Antoine Pitrou; :issue:`8322`.)
 
-  When linked against a recent enough version of OpenSSL, the :mod:`ssl`
+* When linked against a recent enough version of OpenSSL, the :mod:`ssl`
   module now supports the Server Name Indication extension to the TLS
   protocol, allowing for several "virtual hosts" using different certificates
   on a single IP/port.  This extension is only supported in client mode,
@@ -479,43 +1033,117 @@
   :meth:`SSLContext.wrap_socket`.
   (Added by Antoine Pitrou, :issue:`5639`.)
 
-  Various options have been added to the :mod:`ssl` module, such as
+* Various options have been added to the :mod:`ssl` module, such as
   :data:`~ssl.OP_NO_SSLv2` which allows to force disabling of the insecure and
   obsolete SSLv2 protocol.  (Added by Antoine Pitrou; :issue:`4870`.)
 
-  Another change makes the extension load all of OpenSSL's ciphers and digest
+* Another change makes the extension load all of OpenSSL's ciphers and digest
   algorithms so that they're all available.  Some SSL certificates couldn't be
   verified, reporting an "unknown algorithm" error.  (Reported by Beda Kosata,
   and fixed by Antoine Pitrou; :issue:`8484`.)
 
-  The version of OpenSSL being used is now available as the module attributes
+* The version of OpenSSL being used is now available as the module attributes
   :data:`ssl.OPENSSL_VERSION` (a string), :data:`ssl.OPENSSL_VERSION_INFO` (a
   5-tuple), and :data:`ssl.OPENSSL_VERSION_NUMBER` (an integer).  (Added by
   Antoine Pitrou; :issue:`8321`.)
 
-* :class:`http.client.HTTPSConnection`, :class:`urllib.request.HTTPSHandler`
-  and :func:`urllib.request.urlopen` now take optional arguments to allow for
-  server certificate checking against a set of Certificate Authorities,
-  as recommended in public uses of HTTPS.
-  (Added by Antoine Pitrou, :issue:`9003`.)
-
-* Instances of :class:`unittest.TestCase` have two new methods
-  :meth:`~unittest.TestCase.assertWarns` and :meth:`~unittest.TestCase.assertWarnsRegexp`
-  to check that a given warning type was triggered by the code under test::
-
-      with self.assertWarns(DeprecationWarning):
-          legacy_function('XYZ')
+nntp
+----
 
+The :mod:`nntplib` module has a revamped implementation with better bytes and
+unicode semantics as well as more practical APIs.  These improvements break
+compatibility with the nntplib version in Python 3.1, which was partly
+dysfunctional in itself.
+
+(Contributed by Antoine Pitrou in :issue:`9360`)
+
+certificates
+------------
+
+:class:`http.client.HTTPSConnection`, :class:`urllib.request.HTTPSHandler`
+and :func:`urllib.request.urlopen` now take optional arguments to allow for
+server certificate checking against a set of Certificate Authorities,
+as recommended in public uses of HTTPS.
+
+(Added by Antoine Pitrou, :issue:`9003`.)
+
+unittest
+--------
+
+* The command-line call, ``python -m unittest`` can now accept file paths
+  instead of module names for running specific tests (:issue:`10620`).  The new
+  test discovery can find tests within packages, locating any test importable
+  from the top level directory.  The top level directory can be specified with
+  the `-t` option, a pattern for matching files with ``-p``, and a directory to
+  start discovery with ``-s``::
+
+    $ python -m unittest discover -s my_proj_dir -p '_test.py'
+
+  (Contributed by Michael Foord.)
+
+* The :mod:`unittest` module has two new methods,
+  :meth:`~unittest.TestCase.assertWarns` and
+  :meth:`~unittest.TestCase.assertWarnsRegex` to check that a given warning type
+  is triggered by the code under test:
+
+  >>> with self.assertWarns(DeprecationWarning):
+  ...     legacy_function('XYZ')
+
+  Another new method, :meth:`~unittest.TestCase.assertCountEqual` is used to
+  compare two iterables to determine if their element counts are equal (whether
+  the same elements are present with the same number of occurrences regardless
+  of order)::
+
+     def test_anagram(self):
+         self.assertCountEqual('algorithm', 'logarithm')
+
+  A principal feature of the unittest module is an effort to produce meaningful
+  diagnostics when a test fails.  When possible the failure is recorded along
+  with a diff of the output.  This is especially helpful for analyzing log files
+  of failed test runs. However, since diffs can sometime be voluminous, there is
+  a new :attr:`~unittest.TestCase.maxDiff` attribute which sets maximum length of
+  diffs.
+
+  In addition the naming in the module has undergone a number of clean-ups.  For
+  example, :meth:`~unittest.TestCase.assertRegex` is the new name for
+  :meth:`~unittest.TestCase.assertRegexpMatches` which was misnamed because the
+  test uses :func:`re.search`, not :func:`re.match`.  Other methods using
+  regular expressions are now named using short form "Regex" in preference
+  to "Regexp" -- this matches the names used in other unittest implementations,
+  matches Python's old name for the :mod:`re` module, and it has unambiguous
+  camel-casing.
+
+  To improve consistency, some of long-standing method aliases are being
+  deprecated in favor of the preferred names:
+
+   - replace :meth:`assert_` with :meth:`.assertTrue`
+   - replace :meth:`assertEquals` with :meth:`.assertEqual`
+   - replace :meth:`assertNotEquals` with :meth:`.assertNotEqual`
+   - replace :meth:`assertAlmostEquals` with :meth:`.assertAlmostEqual`
+   - replace :meth:`assertNotAlmostEquals` with :meth:`.assertNotAlmostEqual`
+
+  Likewise, the ``TestCase.fail*`` methods deprecated in Python 3.1 are expected
+  to be removed in Python 3.3. See also the :ref:`deprecated-aliases` section in
+  the :mod:`unittest` documentation.
+
+  (Contributed by Ezio Melotti; :issue:`9424`.)
+
+random
+------
+
+The integer methods in the :mod:`random` module now do a better job of producing
+uniform distributions.  Previously, they computed selections with
+``int(n*random())`` which had a slight bias whenever *n* was not a power of two.
+Now, multiple selections are made from a range upto the next power of two and a
+selection is kept only when it falls within the range ``0 <= x < n``.  The
+functions and methods affected are :func:`~random.randrange`,
+:func:`~random.randint`, :func:`~random.choice`, :func:`~random.shuffle` and
+:func:`~random.sample`.
 
-* The previously deprecated :func:`string.maketrans` function has been removed
-  in favor of the static methods, :meth:`bytes.maketrans` and
-  :meth:`bytearray.maketrans`.  This change solves the confusion around which
-  types were supported by the :mod:`string` module.  Now, :class:`str`,
-  :class:`bytes`, and :class:`bytearray` each have their own **maketrans** and
-  **translate** methods with intermediate translation tables of the appropriate
-  type.
+(Contributed by Raymond Hettinger; :issue:`9025`.)
 
-  (Contributed by Georg Brandl; :issue:`5675`.)
+poplib
+------
 
 * :class:`~poplib.POP3_SSL` class now accepts a *context* parameter, which is a
   :class:`ssl.SSLContext` object allowing bundling SSL configuration options,
@@ -524,12 +1152,6 @@
 
   (Contributed by Giampaolo Rodol??; :issue:`8807`.)
 
-* :func:`socket.create_connection` now supports the context manager protocol
-  to unconditionally consume :exc:`socket.error` exceptions and to close the
-  socket when done.
-
-  (Contributed by Giampaolo Rodol??; :issue:`9794`.)
-
 * :class:`asyncore.dispatcher` now provides a
   :meth:`~asyncore.dispatcher.handle_accepted()` method
   returning a `(sock, addr)` pair which is called when a connection has actually
@@ -539,28 +1161,208 @@
 
   (Contributed by Giampaolo Rodol??; :issue:`6706`.)
 
-* The :mod:`tempfile` module has a new context manager,
-  :class:`~tempfile.TemporaryDirectory` which provides easy deterministic
-  cleanup of temporary directories.
-
-  (Contributed by Neil Schemenauer and Nick Coghlan; :issue:`5178`.)
-
-* The :mod:`smtplib` :class:`~smtplib.SMTP` class now accepts a byte string
-  for the *msg* argument to the :meth:`~smtplib.SMTP.sendmail` method,
-  and a new method, :meth:`~smtplib.SMTP.send_message` accepts a
-  :class:`~email.message.Message` object and can optionally obtain the
-  *from_addr* and *to_addrs* addresses directly from the object.
-
-  (Contributed by R. David Murray, :issue:`10321`.)
+tempfile
+--------
 
-
-* The :mod:`inspect` module has a new function :func:`getgenatorstate`
-  to easily identify the current state of a generator as one of
-  ``GEN_CREATED``, ``GEN_RUNNING``, ``GEN_SUSPENDED`` or ``GEN_CLOSED``.
-
-  (Contributed by Rodolpho Eckhardt and Nick Coghlan, :issue:`10220`.)
-
-.. XXX: Mention inspect.getattr_static (Michael Foord)
+The :mod:`tempfile` module has a new context manager,
+:class:`~tempfile.TemporaryDirectory` which provides easy deterministic
+cleanup of temporary directories:
+
+>>> with tempfile.TemporaryDirectory() as tmpdirname:
+...     print 'created temporary directory', tmpdirname
+
+(Contributed by Neil Schemenauer and Nick Coghlan; :issue:`5178`.)
+
+inspect
+-------
+
+* The :mod:`inspect` module has a new function
+  :func:`~inspect.getgeneratorstate` to easily identify the current state of a
+  generator as one of ``GEN_CREATED``, ``GEN_RUNNING``, ``GEN_SUSPENDED`` or
+  ``GEN_CLOSED``. (Contributed by Rodolpho Eckhardt and Nick Coghlan,
+  :issue:`10220`.)
+
+* To support lookups without the possibility of activating a dynamic attribute,
+  the :mod:`inspect` module has a new function, :func:`~inspect.getattr_static`.
+  Unlike, :func:`hasattr`, this is a true read-only search, guaranteed not to
+  change state while it is searching.  (Contributed by Michael Foord.)
+
+pydoc
+-----
+
+The :mod:`pydoc` module now provides a much improved Web server interface,
+as well as a new command-line option to automatically open a browser
+window to display that server.
+
+(Contributed by Ron Adam; :issue:`2001`.)
+
+sysconfig
+---------
+
+The new :mod:`sysconfig` module makes it straight-forward to discover
+installation paths and configuration variables which vary across platforms and
+installations.
+
+The module offers access simple access functions for platform and version
+information:
+
+* :func:`~sysconfig.get_platform` returning values like *linux-i586* or
+  *macosx-10.6-ppc*.
+* :func:`~sysconfig.get_python_version` returns a Python version string in
+  the form, "3.2".
+
+It also provides access to the paths and variables corresponding to one of
+seven named schemes used by :mod:`distutils`.  Those include *posix_prefix*,
+*posix_home*, *posix_user*, *nt*, *nt_user*, *os2*, *os2_home*:
+
+* :func:`~sysconfig.get_paths` makes a dictionary containing installation paths
+  for the current installation scheme.
+* :func:`~sysconfig.get_config_vars` returns a dictionary of platform specific
+  variables.
+
+There is also a convenient command-line interface::
+
+  C:\Python32>python -m sysconfig
+  Platform: "win32"
+  Python version: "3.2"
+  Current installation scheme: "nt"
+
+  Paths:
+          data = "C:\Python32"
+          include = "C:\Python32\Include"
+          platinclude = "C:\Python32\Include"
+          platlib = "C:\Python32\Lib\site-packages"
+          platstdlib = "C:\Python32\Lib"
+          purelib = "C:\Python32\Lib\site-packages"
+          scripts = "C:\Python32\Scripts"
+          stdlib = "C:\Python32\Lib"
+
+  Variables:
+          BINDIR = "C:\Python32"
+          BINLIBDEST = "C:\Python32\Lib"
+          EXE = ".exe"
+          INCLUDEPY = "C:\Python32\Include"
+          LIBDEST = "C:\Python32\Lib"
+          SO = ".pyd"
+          VERSION = "32"
+          abiflags = ""
+          base = "C:\Python32"
+          exec_prefix = "C:\Python32"
+          platbase = "C:\Python32"
+          prefix = "C:\Python32"
+          projectbase = "C:\Python32"
+          py_version = "3.2"
+          py_version_nodot = "32"
+          py_version_short = "3.2"
+          srcdir = "C:\Python32"
+          userbase = "C:\Documents and Settings\Raymond\Application Data\Python"
+
+pdb
+---
+
+The :mod:`pdb` debugger module gained a number of usability improvements:
+
+* :file:`pdb.py` now has a ``-c`` option that executes commands as given in a
+  :file:`.pdbrc` script file.
+* A :file:`.pdbrc` script file can contain ``continue`` and ``next`` commands
+  that continue debugging.
+* The :class:`Pdb` class constructor now accepts a *nosigint* argument.
+* new commands: ``l(list)``, ``ll(long list`` and ``source`` for
+  listing source code.
+* new commands: ``display`` and ``undisplay`` for showing or hiding
+  the value of an expression if it has changed.
+* new command: ``interact`` for starting an interactive interpreter containing
+  the global and local  names found in the current scope.
+* breakpoints can be cleared by breakpoint number
+
+(Contributed by Georg Brandl, Antonio Cuni and Ilya Sandler.)
+
+configparser
+------------
+
+The :mod:`configparser` module was modified to improve usability and
+predictability of the default parser and its supported INI syntax.  The old
+:class:`ConfigParser` class was removed in favor of :class:`SafeConfigParser`
+which has in turn been renamed to :class:`~configparser.ConfigParser`. Support
+for inline comments is now turned off by default and section or option
+duplicates are not allowed in a single configuration source.
+
+Config parsers gained a new API based on the mapping protocol::
+
+  >>> parser = ConfigParser()
+  >>> parser.read_string("""
+  ... [DEFAULT]
+  ... monty = python
+  ...
+  ... [phrases]
+  ... the = who
+  ... full = metal jacket
+  ... """)
+  >>> parser['phrases']['full']
+  'metal jacket'
+  >>> section = parser['phrases']
+  >>> section['the']
+  'who'
+  >>> section['british'] = '%(the)s %(full)s %(monty)s!'
+  >>> parser['phrases']['british']
+  'who metal jacket python!'
+  >>> 'british' in section
+  True
+
+The new API is implemented on top of the classical API so custom parser
+subclasses should be able to use it without modifications.
+
+The INI file structure accepted by config parsers can now be customized. Users
+can specify alternative option/value delimiters and comment prefixes, change the
+name of the *DEFAULT* section or switch the interpolation syntax.  Along with
+support for pluggable interpolation, an additional interpolation handler
+:class:`~configparser.ExtendedInterpolation` was introduced::
+
+  >>> parser = ConfigParser(interpolation=ExtendedInterpolation())
+  >>> parser.read_dict({'buildout': {'directory': '/home/ambv/zope9'},
+  ...                   'custom': {'prefix': '/usr/local'}})
+  >>> parser.read_string("""
+  ... [buildout]
+  ... parts =
+  ...   zope9
+  ...   instance
+  ... find-links =
+  ...   ${buildout:directory}/downloads/dist
+  ...
+  ... [zope9]
+  ... recipe = plone.recipe.zope9install
+  ... location = /opt/zope
+  ...
+  ... [instance]
+  ... recipe = plone.recipe.zope9instance
+  ... zope9-location = ${zope9:location}
+  ... zope-conf = ${custom:prefix}/etc/zope.conf
+  ... """)
+  >>> parser['buildout']['find-links']
+  '\n/home/ambv/zope9/downloads/dist'
+  >>> parser['instance']['zope-conf']
+  '/usr/local/etc/zope.conf'
+  >>> instance = parser['instance']
+  >>> instance['zope-conf']
+  '/usr/local/etc/zope.conf'
+  >>> instance['zope9-location']
+  '/opt/zope'
+
+A number of smaller features were also introduced, like support for specifying
+encoding in read operations, specifying fallback values for get-functions, or
+reading directly from dictionaries and strings.
+
+(All changes contributed by ??ukasz Langa.)
+
+.. XXX: Mention urllib.parse changes
+          Issue 9873 (Nick Coghlan):
+            - ASCII byte sequence support in URL parsing
+            - named tuple for urldefrag return value
+          Issue 5468 (Dan Mahn) for urlencode:
+            - bytes input support
+            - non-UTF8 percent encoding of non-ASCII characters
+          Issue 2987 for IPv6 (RFC2732) support in urlparse
+.. XXX: Any updates to the WSGI bytes versus text problem?
 
 Multi-threading
 ===============
@@ -582,34 +1384,24 @@
 
   (Contributed by Antoine Pitrou.)
 
-* Recursive locks (created with the :func:`threading.RLock` API) now benefit
-  from a C implementation which makes them as fast as regular locks, and between
-  10x and 15x faster than their previous pure Python implementation.
-
-  (Contributed by Antoine Pitrou; :issue:`3001`.)
-
 * Regular and recursive locks now accept an optional *timeout* argument to their
   :meth:`acquire` method.  (Contributed by Antoine Pitrou; :issue:`7316`.)
 
-  Similarly, :meth:`threading.Semaphore.acquire` also gains a *timeout*
+* Similarly, :meth:`threading.Semaphore.acquire` also gained a *timeout*
   argument.  (Contributed by Torsten Landschoff; :issue:`850728`.)
 
+* Regular and recursive lock acquisitions can now be interrupted by signals on
+  platforms using pthreads.  This means that Python programs that deadlock while
+  acquiring locks can be successfully killed by repeatedly sending SIGINT to the
+  process (by pressing :kbd:`Ctrl+C` in most shells).
+  (Contributed by Reid Kleckner; :issue:`8844`.)
+
 
 Optimizations
 =============
 
 A number of small performance enhancements have been added:
 
-* JSON decoding performance is improved and memory consumption is reduced
-  whenever the same string is repeated for multiple keys.
-
-  (Contributed by Antoine Pitrou; :issue:`7451`.)
-
-* JSON encoding now uses the C speedups also when the ``sort_keys`` argument
-  is true.
-
-  (Contributed by Raymond Hettinger and Antoine Pitrou, :issue:`10314`.)
-
 * Python's peephole optimizer now recognizes patterns such ``x in {1, 2, 3}`` as
   being a test for membership in a set of constants.  The optimizer recasts the
   :class:`set` as a :class:`frozenset` and stores the pre-built constant.
@@ -624,6 +1416,36 @@
 
   (Patch and additional tests by Dave Malcolm; :issue:`6690`).
 
+* Serializing and unserializing data using the :mod:`pickle` module is now
+  several times faster.
+
+  (Contributed by Alexandre Vassalotti, Antoine Pitrou
+  and the Unladen Swallow team in :issue:`9410` and :issue:`3873`.)
+
+* The `Timsort algorithm `_ used in
+  :meth:`list.sort` and :func:`sorted` now runs faster and uses less memory
+  when called with a :term:`key function`.  Previously, every element of
+  a list was wrapped with a temporary object that remembered the key value
+  associated with each element.  Now, an array of keys and values are
+  sorted in parallel.  This save the memory consumed by the sort wrappers,
+  and it saves time lost during comparisons which were delegated by the
+  sort wrappers.
+
+  (Patch by Daniel Stuzback in :issue:`9915`.)
+
+* JSON decoding performance is improved and memory consumption is reduced
+  whenever the same string is repeated for multiple keys.  Also, JSON encoding
+  now uses the C speedups when the ``sort_keys`` argument is true.
+
+  (Contributed by Antoine Pitrou in :issue:`7451` and by Raymond Hettinger and
+  Antoine Pitrou in :issue:`10314`.)
+
+* Recursive locks (created with the :func:`threading.RLock` API) now benefit
+  from a C implementation which makes them as fast as regular locks, and between
+  10x and 15x faster than their previous pure Python implementation.
+
+  (Contributed by Antoine Pitrou; :issue:`3001`.)
+
 * The fast-search algorithm in stringlib is now used by the :meth:`split`,
   :meth:`rsplit`, :meth:`splitlines` and :meth:`replace` methods on
   :class:`bytes`, :class:`bytearray` and :class:`str` objects. Likewise, the
@@ -632,20 +1454,52 @@
 
   (Patch by Florent Xicluna in :issue:`7622` and :issue:`7462`.)
 
-* Serializing and unserializing data using the :mod:`pickle` module is now
-  several times faster. (Contributed by Alexandre Vassalotti, Antoine Pitrou
-  and the Unladen Swallow team in :issue:`9410` and :issue:`3873`.)
+
+* String to integer conversions now work two "digits" at a time, reducing the
+  number of division and modulo operations.
+
+  (:issue:`6713` by Gawain Bolton, Mark Dickinson, and Victor Stinner.)
+
+There were several other minor optimizations. Set differencing now runs faster
+when one operand is much larger than the other (Patch by Andress Bennetts in
+:issue:`8685`).  The :meth:`array.repeat` method has a faster implementation
+(:issue:`1569291` by Alexander Belopolsky). The :class:`BaseHTTPRequestHandler`
+has more efficient buffering (:issue:`3709` by Andrew Schaaf).  The
+multi-argument form of :func:`operator.attrgetter` now function runs slightly
+faster (:issue:`10160` by Christos Georgiou).  And :class:`ConfigParser` loads
+multi-line arguments a bit faster (:issue:`7113` by ??ukasz Langa).
 
 
 Unicode
 =======
 
+Python has been updated to Unicode 6.0.0.  The new features of the
+Unicode Standard that will affect Python users include:
+
+* addition of 2,088 characters, including over 1,000 additional
+  symbols???chief among them the additional emoji symbols, which are
+  especially important for mobile phones;
+
+* changes to character properties for existing characters including
+
+  - a general category change to two Kannada characters (U+0CF1,
+    U+0CF2), which has the effect of making them newly eligible for
+    inclusion in identifiers;
+
+  - a general category change to one New Tai Lue numeric character
+    (U+19DA), which has the effect of disqualifying it from
+    inclusion in identifiers.
+
+  For more information, see `Unicode Character Database Changes
+  `_
+  at the `Unicode Consortium `_ web site.
+
 The :mod:`os` module has two new functions: :func:`~os.fsencode` and
 :func:`~os.fsdecode`. Add :data:`os.environb`: bytes version of
 :data:`os.environ`, :func:`os.getenvb` function and
 :data:`os.supports_bytes_environ` constant.
 
-``'mbcs'`` encoding doesn't ignore the error handler argument anymore. By
+``'mbcs'`` encoding doesn't ignore the error handler argument any more. By
 default (strict mode), it raises an UnicodeDecodeError on undecodable byte
 sequence and UnicodeEncodeError on unencodable character. To get the ``'mbcs'``
 encoding of Python 3.1, use ``'ignore'`` error handler to decode and
@@ -661,11 +1515,38 @@
 ``'mbcs'``), and the ``'surrogateescape'`` error handler on all operating
 systems.
 
+* Added the *cp720* Arabic DOS encoding (:issue:`1616979`).
+
+
+Documentation
+=============
+
+The documentation continues to be improved.
+
+A table of quick links has been added to the top of lengthy sections such as
+:ref:`built-in-funcs`.  In the case of :mod:`itertools`, the links are
+accompanied by tables of cheatsheet-style summaries to provide an overview and
+memory jog without having to read all of the docs.
+
+In some cases, the pure python source code can be helpful adjunct to the docs,
+so now some modules feature quick links to the latest version of the source
+code.  For example, the :mod:`functools` module documentation has a quick link
+at the top labeled :source:`functools Python source code `.
 
-.. IDLE
-   ====
+The docs now contain more examples and recipes.  In particular, :mod:`re` module
+has an extensive section, :ref:`re-examples`.  Likewise, the :mod:`itertools`
+module continues to be updated with new :ref:`itertools-recipes`.
 
-   * Stub
+The :mod:`datetime` module now has an auxiliary implementation in pure Python.
+No functionality was changed.  This just provides an easier-to-read
+alternate implementation.  (Contributed by Alexander Belopolsky.)
+
+
+IDLE
+====
+
+* The format menu now has an option to clean-up source files by stripping
+  trailing whitespace (:issue:`5150`).
 
 
 Build and C API Changes
@@ -693,11 +1574,51 @@
 
   (Contributed by Amaury Forgeot D'Arc; :issue:`9210`.)
 
-* Hash values are now values of a new type, Py_hash_t, which is defined to
-  be the same size as a pointer.  Previously they were of type long, which
-  on some 64-bit operating systems is still only 32 bits long.
+* Hash values are now values of a new type, :c:type:`Py_hash_t`, which is
+  defined to be the same size as a pointer.  Previously they were of type long,
+  which on some 64-bit operating systems is still only 32 bits long.  As a
+  result of this fix, :class:`set` and :class:`dict` can now hold more than
+  ``2**32`` entries on builds with 64-bit pointers (previously, they could grow
+  to that size but their performance degraded catastrophically).
+
+  (Suggested by Raymond Hettinger and implemented by Benjamin Peterson;
+  :issue:`9778`.)
+
+* A new macro :c:macro:`Py_VA_COPY` copies the state of the variable argument
+  list.  It is equivalent to C99 *va_copy* but available on all python platforms
+  (:issue:`2443`).
+
+* A new C API function :c:func:`PySys_SetArgvEx` allows an embedded
+  interpreter to set sys.argv without also modifying :attr:`sys.path`
+  (:issue:`5753`).
+
+* :c:macro:`PyEval_CallObject` is now only available in macro form.  The
+  function declaration, which was kept for backwards compatibility reasons, is
+  now removed -- the macro was introduced in 1997  (:issue:`8276`).
+
+* The is a new function :c:func:`PyLong_AsLongLongAndOverflow` which
+  is analogous to :c:func:`PyLong_AsLongAndOverflow`.  The both serve to
+  convert Python :class:`int` into a native fixed-width type while providing
+  detection of cases where the conversion won't fit (:issue:`7767`).
+
+* The :c:func:`PyUnicode_CompareWithASCIIString` now returns *not equal*
+  if the Python string in *NUL* terminated.
+
+* There is a new function :c:func:`PyErr_NewExceptionWithDoc` that is
+  like :c:func:`PyErr_NewException` but allows a docstring to be specified.
+  This lets C exceptions have the same self-documenting capabilities as
+  their pure Python counterparts (:issue:`7033`).
+
+* When compiled with the ``--with-valgrind`` option, the pymalloc
+  allocator will be automatically disabled when running under Valgrind.  This
+  gives improved memory leak detection when running under Valgrind, while taking
+  advantage of pymalloc at other times (:issue:`2422`).
+
+* Removed the "O?" format from the *PyArg_Parse* functions.  The format is no
+  longer used and it had never been documented (:issue:`8837`).
 
-  (Contributed by Benjamin Peterson; :issue:`9778`.)
+There were a number of other small changes to the C-API.  See the
+:file:`Misc/NEWS` file for a complete list.
 
 
 Porting to Python 3.2
@@ -706,11 +1627,42 @@
 This section lists previously described changes and other bugfixes that may
 require changes to your code:
 
+* The :mod:`configparser` module has a number of clean-ups.  The major change is
+  to replace the old :class:`ConfigParser` class with long-standing preferred
+  alternative :class:`SafeConfigParser`.  In addition there are a number of
+  smaller incompatibilites:
+
+  * The interpolation syntax is now validated on
+    :meth:`~configparser.ConfigParser.get` and
+    :meth:`~configparser.ConfigParser.set` operations. In the default
+    interpolation scheme, only two tokens with percent signs are valid: ``%(name)s``
+    and ``%%``, the latter being an escaped percent sign.
+
+  * The :meth:`~configparser.ConfigParser.set` and
+    :meth:`~configparser.ConfigParser.add_section` methods now verify that
+    values are actual strings.  Formerly, unsupported types could be introduced
+    unintentionally.
+
+  * Duplicate sections or options from a single source now raise either
+    :exc:`~configparser.DuplicateSectionError` or
+    :exc:`~configparser.DuplicateOptionError`.  Formerly, duplicates would
+    silently overwrite a previous entry.
+
+  * Inline comments are now disabled by default so now the **;** character
+    can be safely used in values.
+
+  * Comments now can be indented.  Consequently, for **;** or **#** to appear at
+    the start of a line in multiline values, it has to be interpolated.  This
+    keeps comment prefix characters in values from being mistaken as comments.
+
+  * ``""`` is now a valid value and is no longer automatically converted to an
+    empty string. For empty strings, use ``"option ="`` in a line.
+
 * The :mod:`nntplib` module was reworked extensively, meaning that its APIs
   are often incompatible with the 3.1 APIs.
 
-* :class:`bytearray` objects cannot be used anymore as filenames: convert them
-  to :class:`bytes`.
+* :class:`bytearray` objects can no longer be used as filenames; instead,
+  they should be converted to :class:`bytes`.
 
 * PyArg_Parse*() functions:
 
@@ -722,4 +1674,38 @@
   instead; the new type has a well-defined interface for passing typing safety
   information and a less complicated signature for calling a destructor.
 
- * Remove sys.setfilesystemencoding() function: it was broken by design.
+* The :func:`sys.setfilesystemencoding` function was removed because
+  it had a flawed design.
+
+* The :func:`random.seed` function and method now salt string seeds with an
+  sha512 hash function.  To access the previous version of *seed* in order to
+  reproduce Python 3.1 sequences, set the *version* argument to *1*,
+  ``random.seed(s, version=1)``.
+
+* The previously deprecated :func:`string.maketrans` function has been removed
+  in favor of the static methods, :meth:`bytes.maketrans` and
+  :meth:`bytearray.maketrans`.  This change solves the confusion around which
+  types were supported by the :mod:`string` module.  Now, :class:`str`,
+  :class:`bytes`, and :class:`bytearray` each have their own **maketrans** and
+  **translate** methods with intermediate translation tables of the appropriate
+  type.
+
+  (Contributed by Georg Brandl; :issue:`5675`.)
+
+* The previously deprecated :func:`contextlib.nested` function has been removed
+  in favor of a plain :keyword:`with` statement which can accept multiple
+  context managers.  The latter technique is faster (because it is built-in),
+  and it does a better job finalizing multiple context managers when one of them
+  raises an exception::
+
+    >>> with open('mylog.txt') as infile, open('a.out', 'w') as outfile:
+    ...     for line in infile:
+    ...         if '' in line:
+    ...             outfile.write(line)
+
+  (Contributed by Georg Brandl and Mattias Br??ndstr??m;
+  `appspot issue 53094 `_.)
+
+* :func:`struct.pack` no longer implicitly encodes unicode to UTF-8: use
+  explicit conversion instead and replace unicode literals by bytes literals.
+

Modified: python/branches/py3k-cdecimal/Include/Python.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/Python.h	(original)
+++ python/branches/py3k-cdecimal/Include/Python.h	Sun Jan  2 13:18:37 2011
@@ -66,6 +66,7 @@
 
 #include "object.h"
 #include "objimpl.h"
+#include "typeslots.h"
 
 #include "pydebug.h"
 
@@ -98,6 +99,8 @@
 #include "descrobject.h"
 #include "warnings.h"
 #include "weakrefobject.h"
+#include "structseq.h"
+
 
 #include "codecs.h"
 #include "pyerrors.h"
@@ -129,7 +132,9 @@
 #endif
 
 /* _Py_Mangle is defined in compile.c */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
+#endif
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/abstract.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/abstract.h	(original)
+++ python/branches/py3k-cdecimal/Include/abstract.h	Sun Jan  2 13:18:37 2011
@@ -387,7 +387,9 @@
      PyAPI_FUNC(Py_ssize_t) PyObject_Length(PyObject *o);
 #define PyObject_Length PyObject_Size
 
+#ifndef Py_LIMITED_API
      PyAPI_FUNC(Py_ssize_t) _PyObject_LengthHint(PyObject *o, Py_ssize_t);
+#endif
 
        /*
      Guess the size of object o using len(o) or o.__length_hint__().
@@ -765,9 +767,11 @@
      that can accept a char* naming integral's type.
        */
 
+#ifndef Py_LIMITED_API
      PyAPI_FUNC(PyObject *) _PyNumber_ConvertIntegralToInt(
          PyObject *integral,
          const char* error_format);
+#endif
 
        /*
     Returns the object converted to Py_ssize_t by going through
@@ -1057,11 +1061,13 @@
      Use __contains__ if possible, else _PySequence_IterSearch().
        */
 
+#ifndef Py_LIMITED_API
 #define PY_ITERSEARCH_COUNT    1
 #define PY_ITERSEARCH_INDEX    2
 #define PY_ITERSEARCH_CONTAINS 3
      PyAPI_FUNC(Py_ssize_t) _PySequence_IterSearch(PyObject *seq,
                                         PyObject *obj, int operation);
+#endif
     /*
       Iterate over seq.  Result depends on the operation:
       PY_ITERSEARCH_COUNT:  return # of times obj appears in seq; -1 if
@@ -1228,6 +1234,7 @@
       /* issubclass(object, typeorclass) */
 
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
 
 PyAPI_FUNC(int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
@@ -1235,6 +1242,7 @@
 PyAPI_FUNC(char *const *) _PySequence_BytesToCharpArray(PyObject* self);
 
 PyAPI_FUNC(void) _Py_FreeCharPArray(char *const array[]);
+#endif
 
 /* For internal use by buffer API functions */
 PyAPI_FUNC(void) _Py_add_one_to_index_F(int nd, Py_ssize_t *index,

Modified: python/branches/py3k-cdecimal/Include/ast.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/ast.h	(original)
+++ python/branches/py3k-cdecimal/Include/ast.h	Sun Jan  2 13:18:37 2011
@@ -4,8 +4,11 @@
 extern "C" {
 #endif
 
-PyAPI_FUNC(mod_ty) PyAST_FromNode(const node *, PyCompilerFlags *flags,
-				  const char *, PyArena *);
+PyAPI_FUNC(mod_ty) PyAST_FromNode(
+    const node *n,
+    PyCompilerFlags *flags,
+    const char *filename,       /* decoded from the filesystem encoding */
+    PyArena *arena);
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/bytearrayobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/bytearrayobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/bytearrayobject.h	Sun Jan  2 13:18:37 2011
@@ -19,6 +19,7 @@
  */
 
 /* Object layout */
+#ifndef Py_LIMITED_API
 typedef struct {
     PyObject_VAR_HEAD
     /* XXX(nnorwitz): should ob_exports be Py_ssize_t? */
@@ -26,6 +27,7 @@
     Py_ssize_t ob_alloc; /* How many bytes allocated */
     char *ob_bytes;
 } PyByteArrayObject;
+#endif
 
 /* Type object */
 PyAPI_DATA(PyTypeObject) PyByteArray_Type;
@@ -44,12 +46,14 @@
 PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t);
 
 /* Macros, trading safety for speed */
+#ifndef Py_LIMITED_API
 #define PyByteArray_AS_STRING(self) \
     (assert(PyByteArray_Check(self)), \
      Py_SIZE(self) ? ((PyByteArrayObject *)(self))->ob_bytes : _PyByteArray_empty_string)
 #define PyByteArray_GET_SIZE(self)  (assert(PyByteArray_Check(self)),Py_SIZE(self))
 
 PyAPI_DATA(char) _PyByteArray_empty_string[];
+#endif
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/bytes_methods.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/bytes_methods.h	(original)
+++ python/branches/py3k-cdecimal/Include/bytes_methods.h	Sun Jan  2 13:18:37 2011
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
 #ifndef Py_BYTES_CTYPE_H
 #define Py_BYTES_CTYPE_H
 
@@ -42,3 +43,4 @@
 #define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str)
 
 #endif /* !Py_BYTES_CTYPE_H */
+#endif /* !Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/bytesobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/bytesobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/bytesobject.h	Sun Jan  2 13:18:37 2011
@@ -27,6 +27,7 @@
 /* Caching the hash (ob_shash) saves recalculation of a string's hash value.
    This significantly speeds up dict lookups. */
 
+#ifndef Py_LIMITED_API
 typedef struct {
     PyObject_VAR_HEAD
     Py_hash_t ob_shash;
@@ -38,6 +39,7 @@
      *     ob_shash is the hash of the string or -1 if not computed yet.
      */
 } PyBytesObject;
+#endif
 
 PyAPI_DATA(PyTypeObject) PyBytes_Type;
 PyAPI_DATA(PyTypeObject) PyBytesIter_Type;
@@ -58,21 +60,27 @@
 PyAPI_FUNC(PyObject *) PyBytes_Repr(PyObject *, int);
 PyAPI_FUNC(void) PyBytes_Concat(PyObject **, PyObject *);
 PyAPI_FUNC(void) PyBytes_ConcatAndDel(PyObject **, PyObject *);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) _PyBytes_Resize(PyObject **, Py_ssize_t);
 PyAPI_FUNC(PyObject *) _PyBytes_FormatLong(PyObject*, int, int,
 						  int, char**, int*);
+#endif
 PyAPI_FUNC(PyObject *) PyBytes_DecodeEscape(const char *, Py_ssize_t,
 						   const char *, Py_ssize_t,
 						   const char *);
 
 /* Macro, trading safety for speed */
+#ifndef Py_LIMITED_API
 #define PyBytes_AS_STRING(op) (assert(PyBytes_Check(op)), \
                                 (((PyBytesObject *)(op))->ob_sval))
 #define PyBytes_GET_SIZE(op)  (assert(PyBytes_Check(op)),Py_SIZE(op))
+#endif
 
 /* _PyBytes_Join(sep, x) is like sep.join(x).  sep must be PyBytesObject*,
    x must be an iterable object. */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) _PyBytes_Join(PyObject *sep, PyObject *x);
+#endif
 
 /* Provides access to the internal data buffer and size of a string
    object or the default encoded version of an Unicode object. Passing
@@ -90,7 +98,7 @@
 /* Using the current locale, insert the thousands grouping
    into the string pointed to by buffer.  For the argument descriptions,
    see Objects/stringlib/localeutil.h */
-
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(Py_ssize_t) _PyBytes_InsertThousandsGroupingLocale(char *buffer,
                                                    Py_ssize_t n_buffer,
                                                    char *digits,
@@ -107,6 +115,7 @@
                                                    Py_ssize_t min_width,
                                                    const char *grouping,
                                                    const char *thousands_sep);
+#endif
 
 /* Flags used by string formatting */
 #define F_LJUST (1<<0)

Modified: python/branches/py3k-cdecimal/Include/cellobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/cellobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/cellobject.h	Sun Jan  2 13:18:37 2011
@@ -1,5 +1,5 @@
 /* Cell object interface */
-
+#ifndef Py_LIMITED_API
 #ifndef Py_CELLOBJECT_H
 #define Py_CELLOBJECT_H
 #ifdef __cplusplus
@@ -26,3 +26,4 @@
 }
 #endif
 #endif /* !Py_TUPLEOBJECT_H */
+#endif /* Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/ceval.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/ceval.h	(original)
+++ python/branches/py3k-cdecimal/Include/ceval.h	Sun Jan  2 13:18:37 2011
@@ -20,8 +20,10 @@
                                          const char *methodname,
                                          const char *format, ...);
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
 PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
+#endif
 
 struct _frame; /* Avoid including frameobject.h */
 
@@ -33,7 +35,9 @@
 /* Look at the current frame's (if any) code's co_flags, and turn on
    the corresponding compiler flags in cf->cf_flags.  Return 1 if any
    flag was set, else return 0. */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
+#endif
 
 PyAPI_FUNC(int) Py_AddPendingCall(int (*func)(void *), void *arg);
 PyAPI_FUNC(int) Py_MakePendingCalls(void);
@@ -167,8 +171,10 @@
 PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate);
 PyAPI_FUNC(void) PyEval_ReInitThreads(void);
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(void) _PyEval_SetSwitchInterval(unsigned long microseconds);
 PyAPI_FUNC(unsigned long) _PyEval_GetSwitchInterval(void);
+#endif
 
 #define Py_BEGIN_ALLOW_THREADS { \
                         PyThreadState *_save; \
@@ -187,8 +193,10 @@
 
 #endif /* !WITH_THREAD */
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
 PyAPI_FUNC(void) _PyEval_SignalAsyncExc(void);
+#endif
 
 
 #ifdef __cplusplus

Modified: python/branches/py3k-cdecimal/Include/classobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/classobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/classobject.h	Sun Jan  2 13:18:37 2011
@@ -2,6 +2,7 @@
 
 /* Revealing some structures (not for general use) */
 
+#ifndef Py_LIMITED_API
 #ifndef Py_CLASSOBJECT_H
 #define Py_CLASSOBJECT_H
 #ifdef __cplusplus
@@ -54,3 +55,4 @@
 }
 #endif
 #endif /* !Py_CLASSOBJECT_H */
+#endif /* Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/code.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/code.h	(original)
+++ python/branches/py3k-cdecimal/Include/code.h	Sun Jan  2 13:18:37 2011
@@ -1,5 +1,6 @@
 /* Definitions for bytecode */
 
+#ifndef Py_LIMITED_API
 #ifndef Py_CODE_H
 #define Py_CODE_H
 #ifdef __cplusplus
@@ -93,8 +94,10 @@
 /* Update *bounds to describe the first and one-past-the-last instructions in the
    same line as lasti.  Return the number of that line.
 */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co,
                                         int lasti, PyAddrPair *bounds);
+#endif
 
 PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts,
                                       PyObject *names, PyObject *lineno_obj);
@@ -103,3 +106,4 @@
 }
 #endif
 #endif /* !Py_CODE_H */
+#endif /* Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/codecs.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/codecs.h	(original)
+++ python/branches/py3k-cdecimal/Include/codecs.h	Sun Jan  2 13:18:37 2011
@@ -45,9 +45,11 @@
 
  */
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) _PyCodec_Lookup(
        const char *encoding
        );
+#endif
 
 /* Codec registry encoding check API.
 

Modified: python/branches/py3k-cdecimal/Include/compile.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/compile.h	(original)
+++ python/branches/py3k-cdecimal/Include/compile.h	Sun Jan  2 13:18:37 2011
@@ -1,4 +1,4 @@
-
+#ifndef Py_LIMITED_API
 #ifndef Py_COMPILE_H
 #define Py_COMPILE_H
 
@@ -29,8 +29,13 @@
 #define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL"
 
 struct _mod; /* Declare the existence of this type */
-PyAPI_FUNC(PyCodeObject *) PyAST_Compile(struct _mod *, const char *,
-					PyCompilerFlags *, PyArena *);
+#define PyAST_Compile(mod, s, f, ar) PyAST_CompileEx(mod, s, f, -1, ar)
+PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx(
+    struct _mod *mod,
+    const char *filename,       /* decoded from the filesystem encoding */
+    PyCompilerFlags *flags,
+    int optimize,
+    PyArena *arena);
 PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *);
 
 
@@ -38,3 +43,4 @@
 }
 #endif
 #endif /* !Py_COMPILE_H */
+#endif /* !Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/complexobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/complexobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/complexobject.h	Sun Jan  2 13:18:37 2011
@@ -6,6 +6,7 @@
 extern "C" {
 #endif
 
+#ifndef Py_LIMITED_API
 typedef struct {
     double real;
     double imag;
@@ -28,7 +29,7 @@
 PyAPI_FUNC(Py_complex) c_quot(Py_complex, Py_complex);
 PyAPI_FUNC(Py_complex) c_pow(Py_complex, Py_complex);
 PyAPI_FUNC(double) c_abs(Py_complex);
-
+#endif
 
 /* Complex object interface */
 
@@ -36,29 +37,36 @@
 PyComplexObject represents a complex number with double-precision
 real and imaginary parts.
 */
-
+#ifndef Py_LIMITED_API
 typedef struct {
     PyObject_HEAD
     Py_complex cval;
-} PyComplexObject;     
+} PyComplexObject;
+#endif
 
 PyAPI_DATA(PyTypeObject) PyComplex_Type;
 
 #define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
 #define PyComplex_CheckExact(op) (Py_TYPE(op) == &PyComplex_Type)
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
+#endif
 PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);
 
 PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op);
 PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
+#endif
 
 /* Format the object based on the format_spec, as defined in PEP 3101
    (Advanced String Formatting). */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) _PyComplex_FormatAdvanced(PyObject *obj,
                                                  Py_UNICODE *format_spec,
                                                  Py_ssize_t format_spec_len);
+#endif
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/datetime.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/datetime.h	(original)
+++ python/branches/py3k-cdecimal/Include/datetime.h	Sun Jan  2 13:18:37 2011
@@ -1,6 +1,6 @@
 /*  datetime.h
  */
-
+#ifndef Py_LIMITED_API
 #ifndef DATETIME_H
 #define DATETIME_H
 #ifdef __cplusplus
@@ -234,3 +234,4 @@
 }
 #endif
 #endif
+#endif /* !Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/descrobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/descrobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/descrobject.h	Sun Jan  2 13:18:37 2011
@@ -16,6 +16,7 @@
     void *closure;
 } PyGetSetDef;
 
+#ifndef Py_LIMITED_API
 typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args,
                                  void *wrapped);
 
@@ -68,6 +69,7 @@
     struct wrapperbase *d_base;
     void *d_wrapped; /* This can be any function pointer */
 } PyWrapperDescrObject;
+#endif /* Py_LIMITED_API */
 
 PyAPI_DATA(PyTypeObject) PyClassMethodDescr_Type;
 PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type;
@@ -78,13 +80,16 @@
 
 PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
 PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);
+struct PyMemberDef; /* forward declaration for following prototype */
 PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *,
                                                struct PyMemberDef *);
 PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *,
                                                struct PyGetSetDef *);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
                                                 struct wrapperbase *, void *);
 #define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL)
+#endif
 
 PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *);
 PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *);

Modified: python/branches/py3k-cdecimal/Include/dictobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/dictobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/dictobject.h	Sun Jan  2 13:18:37 2011
@@ -45,6 +45,7 @@
  * majority of dicts (consisting mostly of usually-small instance dicts and
  * usually-small dicts created to pass keyword arguments).
  */
+#ifndef Py_LIMITED_API
 #define PyDict_MINSIZE 8
 
 typedef struct {
@@ -84,6 +85,7 @@
     PyDictEntry *(*ma_lookup)(PyDictObject *mp, PyObject *key, Py_hash_t hash);
     PyDictEntry ma_smalltable[PyDict_MINSIZE];
 };
+#endif /* Py_LIMITED_API */
 
 PyAPI_DATA(PyTypeObject) PyDict_Type;
 PyAPI_DATA(PyTypeObject) PyDictIterKey_Type;
@@ -112,18 +114,22 @@
 PyAPI_FUNC(void) PyDict_Clear(PyObject *mp);
 PyAPI_FUNC(int) PyDict_Next(
     PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) _PyDict_Next(
     PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, Py_hash_t *hash);
+#endif
 PyAPI_FUNC(PyObject *) PyDict_Keys(PyObject *mp);
 PyAPI_FUNC(PyObject *) PyDict_Values(PyObject *mp);
 PyAPI_FUNC(PyObject *) PyDict_Items(PyObject *mp);
 PyAPI_FUNC(Py_ssize_t) PyDict_Size(PyObject *mp);
 PyAPI_FUNC(PyObject *) PyDict_Copy(PyObject *mp);
 PyAPI_FUNC(int) PyDict_Contains(PyObject *mp, PyObject *key);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) _PyDict_Contains(PyObject *mp, PyObject *key, Py_hash_t hash);
 PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused);
 PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp);
 PyAPI_FUNC(int) _PyDict_HasOnlyStringKeys(PyObject *mp);
+#endif
 
 /* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */
 PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other);

Modified: python/branches/py3k-cdecimal/Include/dtoa.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/dtoa.h	(original)
+++ python/branches/py3k-cdecimal/Include/dtoa.h	Sun Jan  2 13:18:37 2011
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
 #ifndef PY_NO_SHORT_FLOAT_REPR
 #ifdef __cplusplus
 extern "C" {
@@ -13,3 +14,4 @@
 }
 #endif
 #endif
+#endif

Modified: python/branches/py3k-cdecimal/Include/eval.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/eval.h	(original)
+++ python/branches/py3k-cdecimal/Include/eval.h	Sun Jan  2 13:18:37 2011
@@ -7,9 +7,9 @@
 extern "C" {
 #endif
 
-PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyCodeObject *, PyObject *, PyObject *);
+PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyObject *, PyObject *, PyObject *);
 
-PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyCodeObject *co,
+PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyObject *co,
 					PyObject *globals,
 					PyObject *locals,
 					PyObject **args, int argc,
@@ -17,7 +17,9 @@
 					PyObject **defs, int defc,
 					PyObject *kwdefs, PyObject *closure);
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args);
+#endif
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/fileobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/fileobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/fileobject.h	Sun Jan  2 13:18:37 2011
@@ -14,7 +14,9 @@
 PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int);
 PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *);
 PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
+#endif
 
 /* The default encoding used by the platform file system APIs
    If non-NULL, this is different than the default encoding for strings
@@ -26,6 +28,7 @@
 
    The std printer acts as a preliminary sys.stderr until the new io
    infrastructure is in place. */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);
 PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
 
@@ -39,6 +42,7 @@
 #else
 #define _PyVerify_fd(A) (1) /* dummy */
 #endif
+#endif /* Py_LIMITED_API */
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/floatobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/floatobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/floatobject.h	Sun Jan  2 13:18:37 2011
@@ -11,10 +11,12 @@
 extern "C" {
 #endif
 
+#ifndef Py_LIMITED_API
 typedef struct {
     PyObject_HEAD
     double ob_fval;
 } PyFloatObject;
+#endif
 
 PyAPI_DATA(PyTypeObject) PyFloat_Type;
 
@@ -45,8 +47,11 @@
 /* Extract C double from Python float.  The macro version trades safety for
    speed. */
 PyAPI_FUNC(double) PyFloat_AsDouble(PyObject *);
+#ifndef Py_LIMITED_API
 #define PyFloat_AS_DOUBLE(op) (((PyFloatObject *)(op))->ob_fval)
+#endif
 
+#ifndef Py_LIMITED_API
 /* _PyFloat_{Pack,Unpack}{4,8}
  *
  * The struct and pickle (at least) modules need an efficient platform-
@@ -110,6 +115,7 @@
 PyAPI_FUNC(PyObject *) _PyFloat_FormatAdvanced(PyObject *obj,
 					       Py_UNICODE *format_spec,
 					       Py_ssize_t format_spec_len);
+#endif /* Py_LIMITED_API */
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/frameobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/frameobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/frameobject.h	Sun Jan  2 13:18:37 2011
@@ -1,6 +1,7 @@
 
 /* Frame object interface */
 
+#ifndef Py_LIMITED_API
 #ifndef Py_FRAMEOBJECT_H
 #define Py_FRAMEOBJECT_H
 #ifdef __cplusplus
@@ -85,3 +86,4 @@
 }
 #endif
 #endif /* !Py_FRAMEOBJECT_H */
+#endif /* Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/funcobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/funcobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/funcobject.h	Sun Jan  2 13:18:37 2011
@@ -1,6 +1,6 @@
 
 /* Function object interface */
-
+#ifndef Py_LIMITED_API
 #ifndef Py_FUNCOBJECT_H
 #define Py_FUNCOBJECT_H
 #ifdef __cplusplus
@@ -84,3 +84,4 @@
 }
 #endif
 #endif /* !Py_FUNCOBJECT_H */
+#endif /* Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/genobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/genobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/genobject.h	Sun Jan  2 13:18:37 2011
@@ -1,6 +1,7 @@
 
 /* Generator object interface */
 
+#ifndef Py_LIMITED_API
 #ifndef Py_GENOBJECT_H
 #define Py_GENOBJECT_H
 #ifdef __cplusplus
@@ -38,3 +39,4 @@
 }
 #endif
 #endif /* !Py_GENOBJECT_H */
+#endif /* Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/import.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/import.h	(original)
+++ python/branches/py3k-cdecimal/Include/import.h	Sun Jan  2 13:18:37 2011
@@ -30,6 +30,7 @@
 PyAPI_FUNC(void) PyImport_Cleanup(void);
 PyAPI_FUNC(int) PyImport_ImportFrozenModule(char *);
 
+#ifndef Py_LIMITED_API
 #ifdef WITH_THREAD
 PyAPI_FUNC(void) _PyImport_AcquireLock(void);
 PyAPI_FUNC(int) _PyImport_ReleaseLock(void);
@@ -49,13 +50,15 @@
     char *name;
     PyObject* (*initfunc)(void);
 };
+PyAPI_DATA(struct _inittab *) PyImport_Inittab;
+PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
+#endif /* Py_LIMITED_API */
 
 PyAPI_DATA(PyTypeObject) PyNullImporter_Type;
-PyAPI_DATA(struct _inittab *) PyImport_Inittab;
 
 PyAPI_FUNC(int) PyImport_AppendInittab(const char *name, PyObject* (*initfunc)(void));
-PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
 
+#ifndef Py_LIMITED_API
 struct _frozen {
     char *name;
     unsigned char *code;
@@ -66,6 +69,7 @@
    collection of frozen modules: */
 
 PyAPI_DATA(struct _frozen *) PyImport_FrozenModules;
+#endif
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/listobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/listobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/listobject.h	Sun Jan  2 13:18:37 2011
@@ -19,6 +19,7 @@
 extern "C" {
 #endif
 
+#ifndef Py_LIMITED_API
 typedef struct {
     PyObject_VAR_HEAD
     /* Vector of pointers to list elements.  list[0] is ob_item[0], etc. */
@@ -37,6 +38,7 @@
      */
     Py_ssize_t allocated;
 } PyListObject;
+#endif
 
 PyAPI_DATA(PyTypeObject) PyList_Type;
 PyAPI_DATA(PyTypeObject) PyListIter_Type;
@@ -58,12 +60,16 @@
 PyAPI_FUNC(int) PyList_Sort(PyObject *);
 PyAPI_FUNC(int) PyList_Reverse(PyObject *);
 PyAPI_FUNC(PyObject *) PyList_AsTuple(PyObject *);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) _PyList_Extend(PyListObject *, PyObject *);
+#endif
 
 /* Macro, trading safety for speed */
+#ifndef Py_LIMITED_API
 #define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i])
 #define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v))
 #define PyList_GET_SIZE(op)    Py_SIZE(op)
+#endif
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/longintrepr.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/longintrepr.h	(original)
+++ python/branches/py3k-cdecimal/Include/longintrepr.h	Sun Jan  2 13:18:37 2011
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
 #ifndef Py_LONGINTREPR_H
 #define Py_LONGINTREPR_H
 #ifdef __cplusplus
@@ -99,3 +100,4 @@
 }
 #endif
 #endif /* !Py_LONGINTREPR_H */
+#endif /* Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/longobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/longobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/longobject.h	Sun Jan  2 13:18:37 2011
@@ -50,7 +50,9 @@
 #endif /* SIZEOF_PID_T */
 
 /* Used by Python/mystrtoul.c. */
+#ifndef Py_LIMITED_API
 PyAPI_DATA(unsigned char) _PyLong_DigitValue[256];
+#endif
 
 /* _PyLong_Frexp returns a double x and an exponent e such that the
    true value is approximately equal to x * 2**e.  e is >= 0.  x is
@@ -58,7 +60,9 @@
    zeroes); otherwise, 0.5 <= abs(x) < 1.0.  On overflow, which is
    possible if the number of bits doesn't fit into a Py_ssize_t, sets
    OverflowError and returns -1.0 for x, 0 for e. */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(double) _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e);
+#endif
 
 PyAPI_FUNC(double) PyLong_AsDouble(PyObject *);
 PyAPI_FUNC(PyObject *) PyLong_FromVoidPtr(void *);
@@ -74,8 +78,11 @@
 #endif /* HAVE_LONG_LONG */
 
 PyAPI_FUNC(PyObject *) PyLong_FromString(char *, char **, int);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int);
+#endif
 
+#ifndef Py_LIMITED_API
 /* _PyLong_Sign.  Return 0 if v is 0, -1 if v < 0, +1 if v > 0.
    v must not be NULL, and must be a normalized long.
    There are no error cases.
@@ -150,6 +157,7 @@
 PyAPI_FUNC(PyObject *) _PyLong_FormatAdvanced(PyObject *obj,
 					      Py_UNICODE *format_spec,
 					      Py_ssize_t format_spec_len);
+#endif /* Py_LIMITED_API */
 
 /* These aren't really part of the long object, but they're handy. The
    functions are in Python/mystrtoul.c.

Modified: python/branches/py3k-cdecimal/Include/marshal.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/marshal.h	(original)
+++ python/branches/py3k-cdecimal/Include/marshal.h	Sun Jan  2 13:18:37 2011
@@ -13,10 +13,12 @@
 PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int);
 PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int);
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *);
 PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *);
 PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *);
 PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *);
+#endif
 PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, Py_ssize_t);
 
 #ifdef __cplusplus

Modified: python/branches/py3k-cdecimal/Include/memoryobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/memoryobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/memoryobject.h	Sun Jan  2 13:18:37 2011
@@ -10,10 +10,12 @@
 
 #define PyMemoryView_Check(op) (Py_TYPE(op) == &PyMemoryView_Type)
 
+#ifndef Py_LIMITED_API
 /* Get a pointer to the underlying Py_buffer of a memoryview object. */
 #define PyMemoryView_GET_BUFFER(op) (&((PyMemoryViewObject *)(op))->view)
 /* Get a pointer to the PyObject from which originates a memoryview object. */
 #define PyMemoryView_GET_BASE(op) (((PyMemoryViewObject *)(op))->view.obj)
+#endif
 
 
 PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base, 
@@ -61,11 +63,12 @@
 /* The struct is declared here so that macros can work, but it shouldn't
    be considered public. Don't access those fields directly, use the macros
    and functions instead! */
+#ifndef Py_LIMITED_API
 typedef struct {
     PyObject_HEAD
     Py_buffer view;
 } PyMemoryViewObject;
-
+#endif
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/methodobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/methodobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/methodobject.h	Sun Jan  2 13:18:37 2011
@@ -26,12 +26,14 @@
 
 /* Macros for direct access to these values. Type checks are *not*
    done, so use with care. */
+#ifndef Py_LIMITED_API
 #define PyCFunction_GET_FUNCTION(func) \
         (((PyCFunctionObject *)func) -> m_ml -> ml_meth)
 #define PyCFunction_GET_SELF(func) \
 	(((PyCFunctionObject *)func) -> m_self)
 #define PyCFunction_GET_FLAGS(func) \
 	(((PyCFunctionObject *)func) -> m_ml -> ml_flags)
+#endif
 PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
 
 struct PyMethodDef {
@@ -68,12 +70,14 @@
 
 #define METH_COEXIST   0x0040
 
+#ifndef Py_LIMITED_API
 typedef struct {
     PyObject_HEAD
     PyMethodDef *m_ml; /* Description of the C function to call */
     PyObject    *m_self; /* Passed as 'self' arg to the C func, can be NULL */
     PyObject    *m_module; /* The __module__ attribute, can be anything */
 } PyCFunctionObject;
+#endif
 
 PyAPI_FUNC(int) PyCFunction_ClearFreeList(void);
 

Modified: python/branches/py3k-cdecimal/Include/modsupport.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/modsupport.h	(original)
+++ python/branches/py3k-cdecimal/Include/modsupport.h	Sun Jan  2 13:18:37 2011
@@ -31,7 +31,9 @@
 PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...);
 PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);
 PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw);
+#endif
 
 PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list);
 PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *,
@@ -92,6 +94,12 @@
    9-Jan-1995	GvR	Initial version (incompatible with older API)
 */
 
+/* The PYTHON_ABI_VERSION is introduced in PEP 384. For the lifetime of
+   Python 3, it will stay at the value of 3; changes to the limited API
+   must be performed in a strictly backwards-compatible manner. */
+#define PYTHON_ABI_VERSION 3
+#define PYTHON_ABI_STRING "3"
+
 #ifdef Py_TRACE_REFS
  /* When we are tracing reference counts, rename PyModule_Create2 so
     modules compiled with incompatible settings will generate a
@@ -102,10 +110,17 @@
 PyAPI_FUNC(PyObject *) PyModule_Create2(struct PyModuleDef*,
                                      int apiver);
 
+#ifdef Py_LIMITED_API
+#define PyModule_Create(module) \
+	PyModule_Create2(module, PYTHON_ABI_VERSION)
+#else
 #define PyModule_Create(module) \
 	PyModule_Create2(module, PYTHON_API_VERSION)
+#endif
 
+#ifndef Py_LIMITED_API
 PyAPI_DATA(char *) _Py_PackageContext;
+#endif
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/moduleobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/moduleobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/moduleobject.h	Sun Jan  2 13:18:37 2011
@@ -17,7 +17,9 @@
 PyAPI_FUNC(const char *) PyModule_GetName(PyObject *);
 PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *);
 PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
+#endif
 PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*);
 PyAPI_FUNC(void*) PyModule_GetState(PyObject*);
 

Modified: python/branches/py3k-cdecimal/Include/object.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/object.h	(original)
+++ python/branches/py3k-cdecimal/Include/object.h	Sun Jan  2 13:18:37 2011
@@ -61,6 +61,10 @@
 #define Py_REF_DEBUG
 #endif
 
+#if defined(Py_LIMITED_API) && defined(Py_REF_DEBUG)
+#error Py_LIMITED_API is incompatible with Py_DEBUG, Py_TRACE_REFS, and Py_REF_DEBUG
+#endif
+
 #ifdef Py_TRACE_REFS
 /* Define pointers to support a doubly-linked list of all live heap objects. */
 #define _PyObject_HEAD_EXTRA            \
@@ -196,6 +200,7 @@
 typedef int (*visitproc)(PyObject *, void *);
 typedef int (*traverseproc)(PyObject *, visitproc, void *);
 
+#ifndef Py_LIMITED_API
 typedef struct {
     /* Number implementations must check *both*
        arguments for proper type and implement the necessary conversions
@@ -265,10 +270,17 @@
      getbufferproc bf_getbuffer;
      releasebufferproc bf_releasebuffer;
 } PyBufferProcs;
+#endif /* Py_LIMITED_API */
 
 typedef void (*freefunc)(void *);
 typedef void (*destructor)(PyObject *);
+#ifndef Py_LIMITED_API
+/* We can't provide a full compile-time check that limited-API
+   users won't implement tp_print. However, not defining printfunc
+   and making tp_print of a different function pointer type
+   should at least cause a warning in most cases. */
 typedef int (*printfunc)(PyObject *, FILE *, int);
+#endif
 typedef PyObject *(*getattrfunc)(PyObject *, char *);
 typedef PyObject *(*getattrofunc)(PyObject *, PyObject *);
 typedef int (*setattrfunc)(PyObject *, char *, PyObject *);
@@ -284,6 +296,9 @@
 typedef PyObject *(*newfunc)(struct _typeobject *, PyObject *, PyObject *);
 typedef PyObject *(*allocfunc)(struct _typeobject *, Py_ssize_t);
 
+#ifdef Py_LIMITED_API
+typedef struct _typeobject PyTypeObject; /* opaque */
+#else
 typedef struct _typeobject {
     PyObject_VAR_HEAD
     const char *tp_name; /* For printing, in format "." */
@@ -371,8 +386,25 @@
     struct _typeobject *tp_next;
 #endif
 } PyTypeObject;
+#endif
+
+typedef struct{
+    int slot;    /* slot id, see below */
+    void *pfunc; /* function pointer */
+} PyType_Slot;
+
+typedef struct{
+    const char* name;
+    const char* doc;
+    int basicsize;
+    int itemsize;
+    int flags;
+    PyType_Slot *slots; /* terminated by slot==0. */
+} PyType_Spec;
 
+PyAPI_FUNC(PyObject*) PyType_FromSpec(PyType_Spec*);
 
+#ifndef Py_LIMITED_API
 /* The *real* layout of a type object when allocated on the heap */
 typedef struct _heaptypeobject {
     /* Note: there's a dependency on the order of these members
@@ -393,7 +425,7 @@
 /* access macro to the members which are floating "behind" the object */
 #define PyHeapType_GET_MEMBERS(etype) \
     ((PyMemberDef *)(((char *)etype) + Py_TYPE(etype)->tp_basicsize))
-
+#endif
 
 /* Generic type check */
 PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *);
@@ -412,15 +444,19 @@
 PyAPI_FUNC(PyObject *) PyType_GenericAlloc(PyTypeObject *, Py_ssize_t);
 PyAPI_FUNC(PyObject *) PyType_GenericNew(PyTypeObject *,
                                                PyObject *, PyObject *);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *);
 PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, char *, PyObject **);
+#endif
 PyAPI_FUNC(unsigned int) PyType_ClearCache(void);
 PyAPI_FUNC(void) PyType_Modified(PyTypeObject *);
 
 /* Generic operations on objects */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);
 PyAPI_FUNC(void) _Py_BreakPoint(void);
 PyAPI_FUNC(void) _PyObject_Dump(PyObject *);
+#endif
 PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *);
 PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *);
 PyAPI_FUNC(PyObject *) PyObject_ASCII(PyObject *);
@@ -433,9 +469,13 @@
 PyAPI_FUNC(PyObject *) PyObject_GetAttr(PyObject *, PyObject *);
 PyAPI_FUNC(int) PyObject_SetAttr(PyObject *, PyObject *, PyObject *);
 PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *);
+#endif
 PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *);
+#endif
 PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *);
 PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *,
                                               PyObject *, PyObject *);
@@ -469,8 +509,10 @@
 PyAPI_FUNC(void) Py_ReprLeave(PyObject *);
 
 /* Helpers for hash functions */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(Py_hash_t) _Py_HashDouble(double);
 PyAPI_FUNC(Py_hash_t) _Py_HashPointer(void*);
+#endif
 
 /* Helper for passing objects to printf and the like */
 #define PyObject_REPR(obj) _PyUnicode_AsString(PyObject_Repr(obj))
@@ -649,9 +691,13 @@
 
 #define _Py_ForgetReference(op) _Py_INC_TPFREES(op)
 
+#ifdef Py_LIMITED_API
+PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
+#else
 #define _Py_Dealloc(op) (                               \
     _Py_INC_TPFREES(op) _Py_COUNT_ALLOCS_COMMA          \
     (*Py_TYPE(op)->tp_dealloc)((PyObject *)(op)))
+#endif
 #endif /* !Py_TRACE_REFS */
 
 #define Py_INCREF(op) (                         \

Modified: python/branches/py3k-cdecimal/Include/objimpl.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/objimpl.h	(original)
+++ python/branches/py3k-cdecimal/Include/objimpl.h	Sun Jan  2 13:18:37 2011
@@ -246,6 +246,7 @@
 #define _PyObject_GC_Del PyObject_GC_Del
 
 /* GC information is stored BEFORE the object structure. */
+#ifndef Py_LIMITED_API
 typedef union _gc_head {
     struct {
         union _gc_head *gc_next;
@@ -298,7 +299,7 @@
 #define _PyObject_GC_MAY_BE_TRACKED(obj) \
     (PyObject_IS_GC(obj) && \
         (!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj)))
-
+#endif /* Py_LIMITED_API */
 
 PyAPI_FUNC(PyObject *) _PyObject_GC_Malloc(size_t);
 PyAPI_FUNC(PyObject *) _PyObject_GC_New(PyTypeObject *);

Modified: python/branches/py3k-cdecimal/Include/parsetok.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/parsetok.h	(original)
+++ python/branches/py3k-cdecimal/Include/parsetok.h	Sun Jan  2 13:18:37 2011
@@ -1,6 +1,6 @@
 
 /* Parser-tokenizer link interface */
-
+#ifndef Py_LIMITED_API
 #ifndef Py_PARSETOK_H
 #define Py_PARSETOK_H
 #ifdef __cplusplus
@@ -9,10 +9,10 @@
 
 typedef struct {
     int error;
-    const char *filename;
+    const char *filename;       /* decoded from the filesystem encoding */
     int lineno;
     int offset;
-    char *text;
+    char *text;                 /* UTF-8-encoded string */
     int token;
     int expected;
 } perrdetail;
@@ -39,23 +39,32 @@
 
 PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int,
                                               perrdetail *, int);
-PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *, 
+PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *,
 					   const char*, grammar *,
 						 int, char *, char *,
 						 perrdetail *, int);
-PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(FILE *, const char *,
-					   const char*, grammar *,
-						 int, char *, char *,
-						 perrdetail *, int *);
+PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(
+    FILE *fp,
+    const char *filename,       /* decoded from the filesystem encoding */
+    const char *enc,
+    grammar *g,
+    int start,
+    char *ps1,
+    char *ps2,
+    perrdetail *err_ret,
+    int *flags);
 
 PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *,
 					      const char *,
 					      grammar *, int,
                                               perrdetail *, int);
-PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(const char *,
-					      const char *,
-					      grammar *, int,
-                                              perrdetail *, int *);
+PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(
+    const char *s,
+    const char *filename,       /* decoded from the filesystem encoding */
+    grammar *g,
+    int start,
+    perrdetail *err_ret,
+    int *flags);
 
 /* Note that he following function is defined in pythonrun.c not parsetok.c. */
 PyAPI_FUNC(void) PyParser_SetError(perrdetail *);
@@ -64,3 +73,4 @@
 }
 #endif
 #endif /* !Py_PARSETOK_H */
+#endif /* !Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/patchlevel.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/patchlevel.h	(original)
+++ python/branches/py3k-cdecimal/Include/patchlevel.h	Sun Jan  2 13:18:37 2011
@@ -19,11 +19,11 @@
 #define PY_MAJOR_VERSION	3
 #define PY_MINOR_VERSION	2
 #define PY_MICRO_VERSION	0
-#define PY_RELEASE_LEVEL	PY_RELEASE_LEVEL_ALPHA
-#define PY_RELEASE_SERIAL	4
+#define PY_RELEASE_LEVEL	PY_RELEASE_LEVEL_BETA
+#define PY_RELEASE_SERIAL	2
 
 /* Version as a string */
-#define PY_VERSION      	"3.2a4+"
+#define PY_VERSION      	"3.2b2+"
 /*--end constants--*/
 
 /* Subversion Revision number of this file (not of the repository) */

Modified: python/branches/py3k-cdecimal/Include/pyarena.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/pyarena.h	(original)
+++ python/branches/py3k-cdecimal/Include/pyarena.h	Sun Jan  2 13:18:37 2011
@@ -1,6 +1,7 @@
 /* An arena-like memory interface for the compiler.
  */
 
+#ifndef Py_LIMITED_API
 #ifndef Py_PYARENA_H
 #define Py_PYARENA_H
 
@@ -60,3 +61,4 @@
 #endif
 
 #endif /* !Py_PYARENA_H */
+#endif /* Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/pyatomic.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/pyatomic.h	(original)
+++ python/branches/py3k-cdecimal/Include/pyatomic.h	Sun Jan  2 13:18:37 2011
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
 #ifndef Py_ATOMIC_H
 #define Py_ATOMIC_H
 /* XXX: When compilers start offering a stdatomic.h with lock-free
@@ -177,3 +178,4 @@
 #endif
 
 #endif  /* Py_ATOMIC_H */
+#endif  /* Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/pyctype.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/pyctype.h	(original)
+++ python/branches/py3k-cdecimal/Include/pyctype.h	Sun Jan  2 13:18:37 2011
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
 #ifndef PYCTYPE_H
 #define PYCTYPE_H
 
@@ -29,3 +30,4 @@
 #define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)])
 
 #endif /* !PYCTYPE_H */
+#endif /* !Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/pydebug.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/pydebug.h	(original)
+++ python/branches/py3k-cdecimal/Include/pydebug.h	Sun Jan  2 13:18:37 2011
@@ -1,4 +1,4 @@
-
+#ifndef Py_LIMITED_API
 #ifndef Py_PYDEBUG_H
 #define Py_PYDEBUG_H
 #ifdef __cplusplus
@@ -7,6 +7,7 @@
 
 PyAPI_DATA(int) Py_DebugFlag;
 PyAPI_DATA(int) Py_VerboseFlag;
+PyAPI_DATA(int) Py_QuietFlag;
 PyAPI_DATA(int) Py_InteractiveFlag;
 PyAPI_DATA(int) Py_InspectFlag;
 PyAPI_DATA(int) Py_OptimizeFlag;
@@ -31,3 +32,4 @@
 }
 #endif
 #endif /* !Py_PYDEBUG_H */
+#endif /* Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/pyerrors.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/pyerrors.h	(original)
+++ python/branches/py3k-cdecimal/Include/pyerrors.h	Sun Jan  2 13:18:37 2011
@@ -6,6 +6,7 @@
 
 /* Error objects */
 
+#ifndef Py_LIMITED_API
 /* PyException_HEAD defines the initial segment of every exception class. */
 #define PyException_HEAD PyObject_HEAD PyObject *dict;\
              PyObject *args; PyObject *traceback;\
@@ -55,6 +56,7 @@
     PyObject *winerror;
 } PyWindowsErrorObject;
 #endif
+#endif
 
 /* Error handling definitions */
 
@@ -68,8 +70,9 @@
 PyAPI_FUNC(void) PyErr_Clear(void);
 PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
 PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *);
+PyAPI_FUNC(void) Py_FatalError(const char *message);
 
-#ifdef Py_DEBUG
+#if defined(Py_DEBUG) || defined(Py_LIMITED_API)
 #define _PyErr_OCCURRED() PyErr_Occurred()
 #else
 #define _PyErr_OCCURRED() (_PyThreadState_Current->curexc_type)
@@ -183,7 +186,7 @@
     PyObject *exc,
     const char *filename   /* decoded from the filesystem encoding */
     );
-#ifdef MS_WINDOWS
+#if defined(MS_WINDOWS) && !defined(Py_LIMITED_API)
 PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
     PyObject *, const Py_UNICODE *);
 #endif /* MS_WINDOWS */
@@ -198,16 +201,26 @@
 PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject(
     int, const char *);
 PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
-    int, const char *);
+    int ierr,
+    const char *filename        /* decoded from the filesystem encoding */
+    );
+#ifndef Py_LIMITED_API
+/* XXX redeclare to use WSTRING */
 PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
     int, const Py_UNICODE *);
+#endif
 PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
     PyObject *,int, PyObject *);
 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
-    PyObject *,int, const char *);
+    PyObject *exc,
+    int ierr,
+    const char *filename        /* decoded from the filesystem encoding */
+    );
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
     PyObject *,int, const Py_UNICODE *);
+#endif
 PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
 #endif /* MS_WINDOWS */
 
@@ -230,27 +243,57 @@
 PyAPI_FUNC(void) PyErr_SetInterrupt(void);
 
 /* In signalmodule.c */
+#ifndef Py_LIMITED_API
 int PySignal_SetWakeupFd(int fd);
+#endif
 
 /* Support for adding program text to SyntaxErrors */
-PyAPI_FUNC(void) PyErr_SyntaxLocation(const char *, int);
-PyAPI_FUNC(void) PyErr_SyntaxLocationEx(const char *, int, int);
-PyAPI_FUNC(PyObject *) PyErr_ProgramText(const char *, int);
+PyAPI_FUNC(void) PyErr_SyntaxLocation(
+    const char *filename,       /* decoded from the filesystem encoding */
+    int lineno);
+PyAPI_FUNC(void) PyErr_SyntaxLocationEx(
+    const char *filename,       /* decoded from the filesystem encoding */
+    int lineno,
+    int col_offset);
+PyAPI_FUNC(PyObject *) PyErr_ProgramText(
+    const char *filename,       /* decoded from the filesystem encoding */
+    int lineno);
 
 /* The following functions are used to create and modify unicode
    exceptions from C */
 
 /* create a UnicodeDecodeError object */
 PyAPI_FUNC(PyObject *) PyUnicodeDecodeError_Create(
-    const char *, const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
+    const char *encoding,       /* UTF-8 encoded string */
+    const char *object,
+    Py_ssize_t length,
+    Py_ssize_t start,
+    Py_ssize_t end,
+    const char *reason          /* UTF-8 encoded string */
+    );
 
 /* create a UnicodeEncodeError object */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create(
-    const char *, const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
+    const char *encoding,       /* UTF-8 encoded string */
+    const Py_UNICODE *object,
+    Py_ssize_t length,
+    Py_ssize_t start,
+    Py_ssize_t end,
+    const char *reason          /* UTF-8 encoded string */
+    );
+#endif
 
 /* create a UnicodeTranslateError object */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create(
-    const Py_UNICODE *, Py_ssize_t, Py_ssize_t, Py_ssize_t, const char *);
+    const Py_UNICODE *object,
+    Py_ssize_t length,
+    Py_ssize_t start,
+    Py_ssize_t end,
+    const char *reason          /* UTF-8 encoded string */
+    );
+#endif
 
 /* get the encoding attribute */
 PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_GetEncoding(PyObject *);
@@ -293,11 +336,17 @@
 /* assign a new value to the reason attribute
    return 0 on success, -1 on failure */
 PyAPI_FUNC(int) PyUnicodeEncodeError_SetReason(
-    PyObject *, const char *);
+    PyObject *exc,
+    const char *reason          /* UTF-8 encoded string */
+    );
 PyAPI_FUNC(int) PyUnicodeDecodeError_SetReason(
-    PyObject *, const char *);
+    PyObject *exc,
+    const char *reason          /* UTF-8 encoded string */
+    );
 PyAPI_FUNC(int) PyUnicodeTranslateError_SetReason(
-    PyObject *, const char *);
+    PyObject *exc,
+    const char *reason          /* UTF-8 encoded string */
+    );
 
 
 /* These APIs aren't really part of the error implementation, but

Modified: python/branches/py3k-cdecimal/Include/pygetopt.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/pygetopt.h	(original)
+++ python/branches/py3k-cdecimal/Include/pygetopt.h	Sun Jan  2 13:18:37 2011
@@ -5,9 +5,11 @@
 extern "C" {
 #endif
 
+#ifndef Py_LIMITED_API
 PyAPI_DATA(int) _PyOS_opterr;
 PyAPI_DATA(int) _PyOS_optind;
 PyAPI_DATA(wchar_t *) _PyOS_optarg;
+#endif
 
 PyAPI_FUNC(int) _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring);
 

Modified: python/branches/py3k-cdecimal/Include/pymath.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/pymath.h	(original)
+++ python/branches/py3k-cdecimal/Include/pymath.h	Sun Jan  2 13:18:37 2011
@@ -67,6 +67,7 @@
    nothing. */
 
 /* we take double rounding as evidence of x87 usage */
+#ifndef Py_LIMITED_API
 #ifndef Py_FORCE_DOUBLE
 #  ifdef X87_DOUBLE_ROUNDING
 PyAPI_FUNC(double) _Py_force_double(double);
@@ -75,11 +76,14 @@
 #    define Py_FORCE_DOUBLE(X) (X)
 #  endif
 #endif
+#endif
 
+#ifndef Py_LIMITED_API
 #ifdef HAVE_GCC_ASM_FOR_X87
 PyAPI_FUNC(unsigned short) _Py_get_387controlword(void);
 PyAPI_FUNC(void) _Py_set_387controlword(unsigned short);
 #endif
+#endif
 
 /* Py_IS_NAN(X)
  * Return 1 if float or double arg is a NaN, else 0.

Modified: python/branches/py3k-cdecimal/Include/pystate.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/pystate.h	(original)
+++ python/branches/py3k-cdecimal/Include/pystate.h	Sun Jan  2 13:18:37 2011
@@ -13,6 +13,9 @@
 struct _ts; /* Forward */
 struct _is; /* Forward */
 
+#ifdef Py_LIMITED_API
+typedef struct _is PyInterpreterState;
+#else
 typedef struct _is {
 
     struct _is *next;
@@ -37,12 +40,14 @@
 #endif
 
 } PyInterpreterState;
+#endif
 
 
 /* State unique per thread */
 
 struct _frame; /* Avoid including frameobject.h */
 
+#ifndef Py_LIMITED_API
 /* Py_tracefunc return -1 when raising an exception, or 0 for success. */
 typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *);
 
@@ -54,7 +59,11 @@
 #define PyTrace_C_CALL 4
 #define PyTrace_C_EXCEPTION 5
 #define PyTrace_C_RETURN 6
+#endif
 
+#ifdef Py_LIMITED_API
+typedef struct _ts PyThreadState;
+#else
 typedef struct _ts {
     /* See Python/ceval.c for comments explaining most fields */
 
@@ -106,6 +115,7 @@
     /* XXX signal handlers should also be here */
 
 } PyThreadState;
+#endif
 
 
 PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void);
@@ -133,9 +143,11 @@
 
 /* Assuming the current thread holds the GIL, this is the
    PyThreadState for the current thread. */
+#ifndef Py_LIMITED_API
 PyAPI_DATA(_Py_atomic_address) _PyThreadState_Current;
+#endif
 
-#ifdef Py_DEBUG
+#if defined(Py_DEBUG) || defined(Py_LIMITED_API)
 #define PyThreadState_GET() PyThreadState_Get()
 #else
 #define PyThreadState_GET() \
@@ -190,19 +202,25 @@
 /* The implementation of sys._current_frames()  Returns a dict mapping
    thread id to that thread's current frame.
 */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void);
+#endif
 
 /* Routines for advanced debuggers, requested by David Beazley.
    Don't use unless you know what you are doing! */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void);
 PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *);
 PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *);
 PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *);
 
 typedef struct _frame *(*PyThreadFrameGetter)(PyThreadState *self_);
+#endif
 
 /* hook for PyEval_GetFrame(), requested for Psyco */
+#ifndef Py_LIMITED_API
 PyAPI_DATA(PyThreadFrameGetter) _PyThreadState_GetFrame;
+#endif
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/pystrtod.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/pystrtod.h	(original)
+++ python/branches/py3k-cdecimal/Include/pystrtod.h	Sun Jan  2 13:18:37 2011
@@ -18,7 +18,9 @@
                                          int flags,
                                          int *type);
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr);
+#endif
 
 
 /* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */

Modified: python/branches/py3k-cdecimal/Include/pythonrun.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/pythonrun.h	(original)
+++ python/branches/py3k-cdecimal/Include/pythonrun.h	Sun Jan  2 13:18:37 2011
@@ -16,9 +16,11 @@
 #define PyCF_ONLY_AST 0x0400
 #define PyCF_IGNORE_COOKIE 0x0800
 
+#ifndef Py_LIMITED_API
 typedef struct {
     int cf_flags;  /* bitmask of CO_xxx flags relevant to future */
 } PyCompilerFlags;
+#endif
 
 PyAPI_FUNC(void) Py_SetProgramName(wchar_t *);
 PyAPI_FUNC(wchar_t *) Py_GetProgramName(void);
@@ -33,41 +35,87 @@
 PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
 PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);
 
-PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
-PyAPI_FUNC(int) PyRun_AnyFileExFlags(FILE *, const char *, int, PyCompilerFlags *);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
-PyAPI_FUNC(int) PyRun_SimpleFileExFlags(FILE *, const char *, int, PyCompilerFlags *);
-PyAPI_FUNC(int) PyRun_InteractiveOneFlags(FILE *, const char *, PyCompilerFlags *);
-PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(FILE *, const char *, PyCompilerFlags *);
-
-PyAPI_FUNC(struct _mod *) PyParser_ASTFromString(const char *, const char *,
-                                                 int, PyCompilerFlags *flags,
-                                                 PyArena *);
-PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(FILE *, const char *,
-                                               const char*, int,
-                                               char *, char *,
-                                               PyCompilerFlags *, int *,
-                                               PyArena *);
+PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
+PyAPI_FUNC(int) PyRun_AnyFileExFlags(
+    FILE *fp,
+    const char *filename,       /* decoded from the filesystem encoding */
+    int closeit,
+    PyCompilerFlags *flags);
+PyAPI_FUNC(int) PyRun_SimpleFileExFlags(
+    FILE *fp,
+    const char *filename,       /* decoded from the filesystem encoding */
+    int closeit,
+    PyCompilerFlags *flags);
+PyAPI_FUNC(int) PyRun_InteractiveOneFlags(
+    FILE *fp,
+    const char *filename,       /* decoded from the filesystem encoding */
+    PyCompilerFlags *flags);
+PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(
+    FILE *fp,
+    const char *filename,       /* decoded from the filesystem encoding */
+    PyCompilerFlags *flags);
+
+PyAPI_FUNC(struct _mod *) PyParser_ASTFromString(
+    const char *s,
+    const char *filename,       /* decoded from the filesystem encoding */
+    int start,
+    PyCompilerFlags *flags,
+    PyArena *arena);
+PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(
+    FILE *fp,
+    const char *filename,       /* decoded from the filesystem encoding */
+    const char* enc,
+    int start,
+    char *ps1,
+    char *ps2,
+    PyCompilerFlags *flags,
+    int *errcode,
+    PyArena *arena);
+#endif
+
+#ifndef PyParser_SimpleParseString
 #define PyParser_SimpleParseString(S, B) \
     PyParser_SimpleParseStringFlags(S, B, 0)
 #define PyParser_SimpleParseFile(FP, S, B) \
     PyParser_SimpleParseFileFlags(FP, S, B, 0)
+#endif
 PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int,
                                                           int);
 PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *,
                                                         int, int);
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *,
                                          PyObject *, PyCompilerFlags *);
 
-PyAPI_FUNC(PyObject *) PyRun_FileExFlags(FILE *, const char *, int,
-                                         PyObject *, PyObject *, int,
-                                         PyCompilerFlags *);
-
-#define Py_CompileString(str, p, s) Py_CompileStringFlags(str, p, s, NULL)
-PyAPI_FUNC(PyObject *) Py_CompileStringFlags(const char *, const char *, int,
-                                             PyCompilerFlags *);
-PyAPI_FUNC(struct symtable *) Py_SymtableString(const char *, const char *, int);
+PyAPI_FUNC(PyObject *) PyRun_FileExFlags(
+    FILE *fp,
+    const char *filename,       /* decoded from the filesystem encoding */
+    int start,
+    PyObject *globals,
+    PyObject *locals,
+    int closeit,
+    PyCompilerFlags *flags);
+#endif
+
+#ifdef Py_LIMITED_API
+PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int);
+#else
+#define Py_CompileString(str, p, s) Py_CompileStringExFlags(str, p, s, NULL, -1)
+#define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags(str, p, s, f, -1)
+PyAPI_FUNC(PyObject *) Py_CompileStringExFlags(
+    const char *str,
+    const char *filename,       /* decoded from the filesystem encoding */
+    int start,
+    PyCompilerFlags *flags,
+    int optimize);
+#endif
+PyAPI_FUNC(struct symtable *) Py_SymtableString(
+    const char *str,
+    const char *filename,       /* decoded from the filesystem encoding */
+    int start);
 
 PyAPI_FUNC(void) PyErr_Print(void);
 PyAPI_FUNC(void) PyErr_PrintEx(int);
@@ -76,19 +124,24 @@
 /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
  * exit functions.
  */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(void));
+#endif
 PyAPI_FUNC(int) Py_AtExit(void (*func)(void));
 
 PyAPI_FUNC(void) Py_Exit(int);
 
 /* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(void) _Py_RestoreSignals(void);
 
 PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *);
+#endif
 
 /* Bootstrap */
 PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv);
 
+#ifndef Py_LIMITED_API
 /* Use macros for a bunch of old variants */
 #define PyRun_String(str, s, g, l) PyRun_StringFlags(str, s, g, l, NULL)
 #define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags(fp, name, 0, NULL)
@@ -107,6 +160,7 @@
     PyRun_FileExFlags(fp, p, s, g, l, c, NULL)
 #define PyRun_FileFlags(fp, p, s, g, l, flags) \
     PyRun_FileExFlags(fp, p, s, g, l, 0, flags)
+#endif
 
 /* In getpath.c */
 PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
@@ -114,6 +168,9 @@
 PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void);
 PyAPI_FUNC(wchar_t *) Py_GetPath(void);
 PyAPI_FUNC(void)      Py_SetPath(const wchar_t *);
+#ifdef MS_WINDOWS
+int _Py_CheckPython3();
+#endif
 
 /* In their own files */
 PyAPI_FUNC(const char *) Py_GetVersion(void);
@@ -121,11 +178,14 @@
 PyAPI_FUNC(const char *) Py_GetCopyright(void);
 PyAPI_FUNC(const char *) Py_GetCompiler(void);
 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(const char *) _Py_svnversion(void);
 PyAPI_FUNC(const char *) Py_SubversionRevision(void);
 PyAPI_FUNC(const char *) Py_SubversionShortBranch(void);
+#endif
 
 /* Internal -- various one-time initializations */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void);
 PyAPI_FUNC(PyObject *) _PySys_Init(void);
 PyAPI_FUNC(void) _PyImport_Init(void);
@@ -134,8 +194,10 @@
 PyAPI_FUNC(int) _PyFrame_Init(void);
 PyAPI_FUNC(void) _PyFloat_Init(void);
 PyAPI_FUNC(int) PyByteArray_Init(void);
+#endif
 
 /* Various internal finalizers */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(void) _PyExc_Fini(void);
 PyAPI_FUNC(void) _PyImport_Fini(void);
 PyAPI_FUNC(void) PyMethod_Fini(void);
@@ -150,12 +212,17 @@
 PyAPI_FUNC(void) PyFloat_Fini(void);
 PyAPI_FUNC(void) PyOS_FiniInterrupts(void);
 PyAPI_FUNC(void) _PyGC_Fini(void);
+#endif
 
 /* Stuff with no proper home (yet) */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, char *);
+#endif
 PyAPI_DATA(int) (*PyOS_InputHook)(void);
 PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *);
+#ifndef Py_LIMITED_API
 PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;
+#endif
 
 /* Stack size, in "pointers" (so we get extra safety margins
    on 64-bit platforms).  On a 32-bit platform, this translates

Modified: python/branches/py3k-cdecimal/Include/pythread.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/pythread.h	(original)
+++ python/branches/py3k-cdecimal/Include/pythread.h	Sun Jan  2 13:18:37 2011
@@ -9,6 +9,14 @@
 extern "C" {
 #endif
 
+/* Return status codes for Python lock acquisition.  Chosen for maximum
+ * backwards compatibility, ie failure -> 0, success -> 1.  */
+typedef enum PyLockStatus {
+    PY_LOCK_FAILURE = 0,
+    PY_LOCK_ACQUIRED = 1,
+    PY_LOCK_INTR
+} PyLockStatus;
+
 PyAPI_FUNC(void) PyThread_init_thread(void);
 PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *);
 PyAPI_FUNC(void) PyThread_exit_thread(void);
@@ -49,11 +57,18 @@
    even when the lock can't be acquired.
    If microseconds > 0, the call waits up to the specified duration.
    If microseconds < 0, the call waits until success (or abnormal failure)
-   
+
    microseconds must be less than PY_TIMEOUT_MAX. Behaviour otherwise is
-   undefined. */
-PyAPI_FUNC(int) PyThread_acquire_lock_timed(PyThread_type_lock,
-					    PY_TIMEOUT_T microseconds);
+   undefined.
+
+   If intr_flag is true and the acquire is interrupted by a signal, then the
+   call will return PY_LOCK_INTR.  The caller may reattempt to acquire the
+   lock.
+*/
+PyAPI_FUNC(PyLockStatus) PyThread_acquire_lock_timed(PyThread_type_lock,
+                                                     PY_TIMEOUT_T microseconds,
+                                                     int intr_flag);
+
 PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock);
 
 PyAPI_FUNC(size_t) PyThread_get_stacksize(void);

Modified: python/branches/py3k-cdecimal/Include/pytime.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/pytime.h	(original)
+++ python/branches/py3k-cdecimal/Include/pytime.h	Sun Jan  2 13:18:37 2011
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
 #ifndef Py_PYTIME_H
 #define Py_PYTIME_H
 
@@ -44,3 +45,4 @@
 #endif
 
 #endif /* Py_PYTIME_H */
+#endif /* Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/setobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/setobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/setobject.h	Sun Jan  2 13:18:37 2011
@@ -18,7 +18,7 @@
 hold a search finger.  The hash field of Unused or Dummy slots has
 no meaning otherwise.
 */
-
+#ifndef Py_LIMITED_API
 #define PySet_MINSIZE 8
 
 typedef struct {
@@ -56,6 +56,7 @@
     Py_hash_t hash;                  /* only used by frozenset objects */
     PyObject *weakreflist;      /* List of weak references */
 };
+#endif /* Py_LIMITED_API */
 
 PyAPI_DATA(PyTypeObject) PySet_Type;
 PyAPI_DATA(PyTypeObject) PyFrozenSet_Type;
@@ -85,14 +86,20 @@
 PyAPI_FUNC(PyObject *) PySet_New(PyObject *);
 PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *);
 PyAPI_FUNC(Py_ssize_t) PySet_Size(PyObject *anyset);
+#ifndef Py_LIMITED_API
 #define PySet_GET_SIZE(so) (((PySetObject *)(so))->used)
+#endif
 PyAPI_FUNC(int) PySet_Clear(PyObject *set);
 PyAPI_FUNC(int) PySet_Contains(PyObject *anyset, PyObject *key);
 PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key);
 PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash);
+#endif
 PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable);
+#endif
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/sliceobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/sliceobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/sliceobject.h	Sun Jan  2 13:18:37 2011
@@ -18,11 +18,12 @@
 names are from range).  After much talk with Guido, it was decided to
 let these be any arbitrary python type.  Py_None stands for omitted values.
 */
-
+#ifndef Py_LIMITED_API
 typedef struct {
     PyObject_HEAD
     PyObject *start, *stop, *step;	/* not NULL */
 } PySliceObject;
+#endif
 
 PyAPI_DATA(PyTypeObject) PySlice_Type;
 PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
@@ -31,10 +32,12 @@
 
 PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
                                   PyObject* step);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
-PyAPI_FUNC(int) PySlice_GetIndices(PySliceObject *r, Py_ssize_t length,
+#endif
+PyAPI_FUNC(int) PySlice_GetIndices(PyObject *r, Py_ssize_t length,
                                   Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
-PyAPI_FUNC(int) PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length,
+PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
 				    Py_ssize_t *start, Py_ssize_t *stop, 
 				    Py_ssize_t *step, Py_ssize_t *slicelength);
 

Modified: python/branches/py3k-cdecimal/Include/structseq.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/structseq.h	(original)
+++ python/branches/py3k-cdecimal/Include/structseq.h	Sun Jan  2 13:18:37 2011
@@ -21,18 +21,25 @@
 
 extern char* PyStructSequence_UnnamedField;
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
                                            PyStructSequence_Desc *desc);
+#endif
+PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
 
 PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
 
+#ifndef Py_LIMITED_API
 typedef PyTupleObject PyStructSequence;
 
 /* Macro, *only* to be used to fill in brand new objects */
 #define PyStructSequence_SET_ITEM(op, i, v) PyTuple_SET_ITEM(op, i, v)
 
 #define PyStructSequence_GET_ITEM(op, i) PyTuple_GET_ITEM(op, i)
+#endif
 
+PyAPI_FUNC(void) PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*);
+PyAPI_FUNC(PyObject*) PyStructSequence_GetItem(PyObject*, Py_ssize_t);
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/symtable.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/symtable.h	(original)
+++ python/branches/py3k-cdecimal/Include/symtable.h	Sun Jan  2 13:18:37 2011
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
 #ifndef Py_SYMTABLE_H
 #define Py_SYMTABLE_H
 
@@ -15,7 +16,8 @@
 struct _symtable_entry;
 
 struct symtable {
-    const char *st_filename;        /* name of file being compiled */
+    const char *st_filename;        /* name of file being compiled,
+                                       decoded from the filesystem encoding */
     struct _symtable_entry *st_cur; /* current symbol table entry */
     struct _symtable_entry *st_top; /* symbol table entry for module */
     PyObject *st_blocks;            /* dict: map AST node addresses
@@ -59,8 +61,10 @@
 
 PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *);
 
-PyAPI_FUNC(struct symtable *) PySymtable_Build(mod_ty, const char *,
-                                              PyFutureFeatures *);
+PyAPI_FUNC(struct symtable *) PySymtable_Build(
+    mod_ty mod,
+    const char *filename,       /* decoded from the filesystem encoding */
+    PyFutureFeatures *future);
 PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *);
 
 PyAPI_FUNC(void) PySymtable_Free(struct symtable *);
@@ -102,3 +106,4 @@
 }
 #endif
 #endif /* !Py_SYMTABLE_H */
+#endif /* Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/sysmodule.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/sysmodule.h	(original)
+++ python/branches/py3k-cdecimal/Include/sysmodule.h	Sun Jan  2 13:18:37 2011
@@ -20,7 +20,9 @@
 PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...);
 PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...);
 
+#ifndef Py_LIMITED_API
 PyAPI_DATA(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc;
+#endif
 
 PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
 PyAPI_FUNC(void) PySys_AddWarnOption(const wchar_t *);

Modified: python/branches/py3k-cdecimal/Include/timefuncs.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/timefuncs.h	(original)
+++ python/branches/py3k-cdecimal/Include/timefuncs.h	Sun Jan  2 13:18:37 2011
@@ -14,7 +14,9 @@
  * to fit in a time_t.  ValueError is set on return iff the return
  * value is (time_t)-1 and PyErr_Occurred().
  */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(time_t) _PyTime_DoubleToTimet(double x);
+#endif
 
 
 #ifdef __cplusplus

Modified: python/branches/py3k-cdecimal/Include/token.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/token.h	(original)
+++ python/branches/py3k-cdecimal/Include/token.h	Sun Jan  2 13:18:37 2011
@@ -1,6 +1,6 @@
 
 /* Token types */
-
+#ifndef Py_LIMITED_API
 #ifndef Py_TOKEN_H
 #define Py_TOKEN_H
 #ifdef __cplusplus
@@ -85,3 +85,4 @@
 }
 #endif
 #endif /* !Py_TOKEN_H */
+#endif /* Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/traceback.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/traceback.h	(original)
+++ python/branches/py3k-cdecimal/Include/traceback.h	Sun Jan  2 13:18:37 2011
@@ -8,7 +8,7 @@
 struct _frame;
 
 /* Traceback interface */
-
+#ifndef Py_LIMITED_API
 typedef struct _traceback {
     PyObject_HEAD
     struct _traceback *tb_next;
@@ -16,10 +16,13 @@
     int tb_lasti;
     int tb_lineno;
 } PyTracebackObject;
+#endif
 
 PyAPI_FUNC(int) PyTraceBack_Here(struct _frame *);
 PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int);
+#endif
 
 /* Reveal traceback type so we can typecheck traceback objects */
 PyAPI_DATA(PyTypeObject) PyTraceBack_Type;

Modified: python/branches/py3k-cdecimal/Include/tupleobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/tupleobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/tupleobject.h	Sun Jan  2 13:18:37 2011
@@ -21,6 +21,7 @@
 returned item's reference count.
 */
 
+#ifndef Py_LIMITED_API
 typedef struct {
     PyObject_VAR_HEAD
     PyObject *ob_item[1];
@@ -30,6 +31,7 @@
      * the tuple is not yet visible outside the function that builds it.
      */
 } PyTupleObject;
+#endif
 
 PyAPI_DATA(PyTypeObject) PyTuple_Type;
 PyAPI_DATA(PyTypeObject) PyTupleIter_Type;
@@ -43,16 +45,22 @@
 PyAPI_FUNC(PyObject *) PyTuple_GetItem(PyObject *, Py_ssize_t);
 PyAPI_FUNC(int) PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *);
 PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t);
+#endif
 PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...);
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *);
+#endif
 
 /* Macro, trading safety for speed */
+#ifndef Py_LIMITED_API
 #define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])
 #define PyTuple_GET_SIZE(op)    Py_SIZE(op)
 
 /* Macro, *only* to be used to fill in brand new tuples */
 #define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
+#endif
 
 PyAPI_FUNC(int) PyTuple_ClearFreeList(void);
 

Modified: python/branches/py3k-cdecimal/Include/ucnhash.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/ucnhash.h	(original)
+++ python/branches/py3k-cdecimal/Include/ucnhash.h	Sun Jan  2 13:18:37 2011
@@ -1,5 +1,5 @@
 /* Unicode name database interface */
-
+#ifndef Py_LIMITED_API
 #ifndef Py_UCNHASH_H
 #define Py_UCNHASH_H
 #ifdef __cplusplus
@@ -31,3 +31,4 @@
 }
 #endif
 #endif /* !Py_UCNHASH_H */
+#endif /* !Py_LIMITED_API */

Modified: python/branches/py3k-cdecimal/Include/unicodeobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/unicodeobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/unicodeobject.h	Sun Jan  2 13:18:37 2011
@@ -131,7 +131,9 @@
    Python and represents a single Unicode element in the Unicode
    type. */
 
+#ifndef Py_LIMITED_API
 typedef PY_UNICODE_TYPE Py_UNICODE;
+#endif
 
 /* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */
 
@@ -318,6 +320,7 @@
    _Py_ascii_whitespace (see below) with an inlined check.
 
  */
+#ifndef Py_LIMITED_API
 #define Py_UNICODE_ISSPACE(ch) \
     ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch))
 
@@ -362,6 +365,7 @@
     ((*((string)->str + (offset)) == *((substring)->str)) && \
     ((*((string)->str + (offset) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && \
      !memcmp((string)->str + (offset), (substring)->str, (substring)->length*sizeof(Py_UNICODE)))
+#endif /* Py_LIMITED_API */
 
 #ifdef __cplusplus
 extern "C" {
@@ -369,6 +373,7 @@
 
 /* --- Unicode Type ------------------------------------------------------- */
 
+#ifndef Py_LIMITED_API
 typedef struct {
     PyObject_HEAD
     Py_ssize_t length;          /* Length of raw Unicode data in buffer */
@@ -381,6 +386,7 @@
                                    string, or NULL; this is used for
                                    implementing the buffer protocol */
 } PyUnicodeObject;
+#endif
 
 PyAPI_DATA(PyTypeObject) PyUnicode_Type;
 PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
@@ -394,6 +400,7 @@
 #define PyUnicode_CheckExact(op) (Py_TYPE(op) == &PyUnicode_Type)
 
 /* Fast access macros */
+#ifndef Py_LIMITED_API
 #define PyUnicode_GET_SIZE(op) \
     (assert(PyUnicode_Check(op)),(((PyUnicodeObject *)(op))->length))
 #define PyUnicode_GET_DATA_SIZE(op) \
@@ -402,6 +409,7 @@
     (assert(PyUnicode_Check(op)),(((PyUnicodeObject *)(op))->str))
 #define PyUnicode_AS_DATA(op) \
     (assert(PyUnicode_Check(op)),((const char *)((PyUnicodeObject *)(op))->str))
+#endif
 
 /* --- Constants ---------------------------------------------------------- */
 
@@ -426,29 +434,33 @@
 
    The buffer is copied into the new object. */
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
     const Py_UNICODE *u,        /* Unicode buffer */
     Py_ssize_t size             /* size of buffer */
     );
+#endif
 
 /* Similar to PyUnicode_FromUnicode(), but u points to UTF-8 encoded bytes */
 PyAPI_FUNC(PyObject*) PyUnicode_FromStringAndSize(
-    const char *u,        /* char buffer */
-    Py_ssize_t size       /* size of buffer */
+    const char *u,             /* UTF-8 encoded string */
+    Py_ssize_t size            /* size of buffer */
     );
 
 /* Similar to PyUnicode_FromUnicode(), but u points to null-terminated
    UTF-8 encoded bytes */
 PyAPI_FUNC(PyObject*) PyUnicode_FromString(
-    const char *u        /* string */
+    const char *u              /* UTF-8 encoded string */
     );
 
 /* Return a read-only pointer to the Unicode object's internal
    Py_UNICODE buffer. */
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
     PyObject *unicode           /* Unicode object */
     );
+#endif
 
 /* Get the length of the Unicode object. */
 
@@ -456,8 +468,10 @@
     PyObject *unicode           /* Unicode object */
     );
 
+#ifndef Py_LIMITED_API
 /* Get the maximum ordinal for a Unicode character. */
 PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void);
+#endif
 
 /* Resize an already allocated Unicode object to the new size length.
 
@@ -527,16 +541,22 @@
     ...
     );
 
+#ifndef Py_LIMITED_API
 /* Format the object based on the format_spec, as defined in PEP 3101
    (Advanced String Formatting). */
 PyAPI_FUNC(PyObject *) _PyUnicode_FormatAdvanced(PyObject *obj,
                                                  Py_UNICODE *format_spec,
                                                  Py_ssize_t format_spec_len);
+#endif
 
 PyAPI_FUNC(void) PyUnicode_InternInPlace(PyObject **);
 PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
-PyAPI_FUNC(PyObject *) PyUnicode_InternFromString(const char *);
+PyAPI_FUNC(PyObject *) PyUnicode_InternFromString(
+    const char *u              /* UTF-8 encoded string */
+    );
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(void) _Py_ReleaseInternedUnicodeStrings(void);
+#endif
 
 /* Use only if you know it's a string */
 #define PyUnicode_CHECK_INTERNED(op) (((PyUnicodeObject *)(op))->state)
@@ -568,7 +588,7 @@
    error. */
 
 PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
-    PyUnicodeObject *unicode,   /* Unicode object */
+    PyObject *unicode,          /* Unicode object */
     register wchar_t *w,        /* wchar_t buffer */
     Py_ssize_t size             /* size of buffer */
     );
@@ -646,9 +666,11 @@
 
 */
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) _PyUnicode_AsDefaultEncodedString(
     PyObject *unicode,
     const char *errors);
+#endif
 
 /* Returns a pointer to the default encoding (UTF-8) of the
    Unicode object unicode and the size of the encoded representation
@@ -664,9 +686,11 @@
 
 */
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(char *) _PyUnicode_AsStringAndSize(
     PyObject *unicode,
     Py_ssize_t *size);
+#endif
 
 /* Returns a pointer to the default encoding (UTF-8) of the
    Unicode object unicode.
@@ -682,7 +706,9 @@
 
 */
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(char *) _PyUnicode_AsString(PyObject *unicode);
+#endif
 
 /* Returns "utf-8".  */
 
@@ -721,12 +747,14 @@
 /* Encodes a Py_UNICODE buffer of the given size and returns a
    Python string object. */
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) PyUnicode_Encode(
     const Py_UNICODE *s,        /* Unicode char buffer */
     Py_ssize_t size,            /* number of Py_UNICODE chars to encode */
     const char *encoding,       /* encoding */
     const char *errors          /* error handling */
     );
+#endif
 
 /* Encodes a Unicode object and returns the result as Python
    object. */
@@ -776,6 +804,7 @@
     Py_ssize_t *consumed        /* bytes consumed */
     );
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF7(
     const Py_UNICODE *data,     /* Unicode char buffer */
     Py_ssize_t length,          /* number of Py_UNICODE chars to encode */
@@ -783,6 +812,7 @@
     int base64WhiteSpace,       /* Encode whitespace (sp, ht, nl, cr) in base64 */
     const char *errors          /* error handling */
     );
+#endif
 
 /* --- UTF-8 Codecs ------------------------------------------------------- */
 
@@ -803,11 +833,13 @@
     PyObject *unicode           /* Unicode object */
     );
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8(
     const Py_UNICODE *data,     /* Unicode char buffer */
     Py_ssize_t length,          /* number of Py_UNICODE chars to encode */
     const char *errors          /* error handling */
     );
+#endif
 
 /* --- UTF-32 Codecs ------------------------------------------------------ */
 
@@ -876,12 +908,14 @@
 
 */
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF32(
     const Py_UNICODE *data,     /* Unicode char buffer */
     Py_ssize_t length,          /* number of Py_UNICODE chars to encode */
     const char *errors,         /* error handling */
     int byteorder               /* byteorder to use 0=BOM+native;-1=LE,1=BE */
     );
+#endif
 
 /* --- UTF-16 Codecs ------------------------------------------------------ */
 
@@ -954,12 +988,14 @@
 
 */
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF16(
     const Py_UNICODE *data,     /* Unicode char buffer */
     Py_ssize_t length,          /* number of Py_UNICODE chars to encode */
     const char *errors,         /* error handling */
     int byteorder               /* byteorder to use 0=BOM+native;-1=LE,1=BE */
     );
+#endif
 
 /* --- Unicode-Escape Codecs ---------------------------------------------- */
 
@@ -973,10 +1009,12 @@
     PyObject *unicode           /* Unicode object */
     );
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) PyUnicode_EncodeUnicodeEscape(
     const Py_UNICODE *data,     /* Unicode char buffer */
     Py_ssize_t length           /* Number of Py_UNICODE chars to encode */
     );
+#endif
 
 /* --- Raw-Unicode-Escape Codecs ------------------------------------------ */
 
@@ -990,20 +1028,24 @@
     PyObject *unicode           /* Unicode object */
     );
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) PyUnicode_EncodeRawUnicodeEscape(
     const Py_UNICODE *data,     /* Unicode char buffer */
     Py_ssize_t length           /* Number of Py_UNICODE chars to encode */
     );
+#endif
 
 /* --- Unicode Internal Codec ---------------------------------------------
 
     Only for internal use in _codecsmodule.c */
 
+#ifndef Py_LIMITED_API
 PyObject *_PyUnicode_DecodeUnicodeInternal(
     const char *string,
     Py_ssize_t length,
     const char *errors
     );
+#endif
 
 /* --- Latin-1 Codecs -----------------------------------------------------
 
@@ -1021,11 +1063,13 @@
     PyObject *unicode           /* Unicode object */
     );
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) PyUnicode_EncodeLatin1(
     const Py_UNICODE *data,     /* Unicode char buffer */
     Py_ssize_t length,          /* Number of Py_UNICODE chars to encode */
     const char *errors          /* error handling */
     );
+#endif
 
 /* --- ASCII Codecs -------------------------------------------------------
 
@@ -1043,11 +1087,13 @@
     PyObject *unicode           /* Unicode object */
     );
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) PyUnicode_EncodeASCII(
     const Py_UNICODE *data,     /* Unicode char buffer */
     Py_ssize_t length,          /* Number of Py_UNICODE chars to encode */
     const char *errors          /* error handling */
     );
+#endif
 
 /* --- Character Map Codecs -----------------------------------------------
 
@@ -1085,6 +1131,7 @@
                                    (unicode ordinal -> char ordinal) */
     );
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) PyUnicode_EncodeCharmap(
     const Py_UNICODE *data,     /* Unicode char buffer */
     Py_ssize_t length,          /* Number of Py_UNICODE chars to encode */
@@ -1092,6 +1139,7 @@
                                    (unicode ordinal -> char ordinal) */
     const char *errors          /* error handling */
     );
+#endif
 
 /* Translate a Py_UNICODE buffer of the given length by applying a
    character mapping table to it and return the resulting Unicode
@@ -1106,12 +1154,14 @@
 
 */
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) PyUnicode_TranslateCharmap(
     const Py_UNICODE *data,     /* Unicode char buffer */
     Py_ssize_t length,          /* Number of Py_UNICODE chars to encode */
     PyObject *table,            /* Translate table */
     const char *errors          /* error handling */
     );
+#endif
 
 #ifdef MS_WIN32
 
@@ -1134,11 +1184,13 @@
     PyObject *unicode           /* Unicode object */
     );
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS(
     const Py_UNICODE *data,     /* Unicode char buffer */
     Py_ssize_t length,          /* Number of Py_UNICODE chars to encode */
     const char *errors          /* error handling */
     );
+#endif
 
 #endif /* MS_WIN32 */
 
@@ -1166,12 +1218,27 @@
 
 */
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(int) PyUnicode_EncodeDecimal(
     Py_UNICODE *s,              /* Unicode buffer */
     Py_ssize_t length,          /* Number of Py_UNICODE chars to encode */
     char *output,               /* Output buffer; must have size >= length */
     const char *errors          /* error handling */
     );
+#endif
+
+/* Transforms code points that have decimal digit property to the
+   corresponding ASCII digit code points.
+
+   Returns a new Unicode string on success, NULL on failure.
+*/
+
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(PyObject*) PyUnicode_TransformDecimalToASCII(
+    Py_UNICODE *s,              /* Unicode buffer */
+    Py_ssize_t length           /* Number of Py_UNICODE chars to transform */
+    );
+#endif
 
 /* --- File system encoding ---------------------------------------------- */
 
@@ -1390,7 +1457,7 @@
 
 PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString(
     PyObject *left,
-    const char *right
+    const char *right           /* ASCII-encoded string */
     );
 
 /* Rich compare two strings and return one of the following:
@@ -1438,26 +1505,31 @@
 
 PyAPI_FUNC(int) PyUnicode_IsIdentifier(PyObject *s);
 
+#ifndef Py_LIMITED_API
 /* Externally visible for str.strip(unicode) */
 PyAPI_FUNC(PyObject *) _PyUnicode_XStrip(
     PyUnicodeObject *self,
     int striptype,
     PyObject *sepobj
     );
+#endif
 
 /* Using the current locale, insert the thousands grouping
    into the string pointed to by buffer.  For the argument descriptions,
    see Objects/stringlib/localeutil.h */
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGroupingLocale(Py_UNICODE *buffer,
                                                    Py_ssize_t n_buffer,
                                                    Py_UNICODE *digits,
                                                    Py_ssize_t n_digits,
                                                    Py_ssize_t min_width);
+#endif
 
 /* Using explicit passed-in values, insert the thousands grouping
    into the string pointed to by buffer.  For the argument descriptions,
    see Objects/stringlib/localeutil.h */
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping(Py_UNICODE *buffer,
                                                    Py_ssize_t n_buffer,
                                                    Py_UNICODE *digits,
@@ -1465,10 +1537,12 @@
                                                    Py_ssize_t min_width,
                                                    const char *grouping,
                                                    const char *thousands_sep);
+#endif
 /* === Characters Type APIs =============================================== */
 
 /* Helper array used by Py_UNICODE_ISSPACE(). */
 
+#ifndef Py_LIMITED_API
 PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[];
 
 /* These should not be used directly. Use the Py_UNICODE_IS* and
@@ -1594,6 +1668,7 @@
 PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnicodeCopy(
     PyObject *unicode
     );
+#endif /* Py_LIMITED_API */
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/warnings.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/warnings.h	(original)
+++ python/branches/py3k-cdecimal/Include/warnings.h	Sun Jan  2 13:18:37 2011
@@ -4,15 +4,31 @@
 extern "C" {
 #endif
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject*) _PyWarnings_Init(void);
+#endif
 
-PyAPI_FUNC(int) PyErr_WarnEx(PyObject *, const char *, Py_ssize_t);
-PyAPI_FUNC(int) PyErr_WarnFormat(PyObject *, Py_ssize_t, const char *, ...);
-PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, const char *, int,
-                                    const char *, PyObject *);
+PyAPI_FUNC(int) PyErr_WarnEx(
+    PyObject *category,
+    const char *message,        /* UTF-8 encoded string */
+    Py_ssize_t stack_level);
+PyAPI_FUNC(int) PyErr_WarnFormat(
+    PyObject *category,
+    Py_ssize_t stack_level,
+    const char *format,         /* ASCII-encoded string  */
+    ...);
+PyAPI_FUNC(int) PyErr_WarnExplicit(
+    PyObject *category,
+    const char *message,        /* UTF-8 encoded string */
+    const char *filename,       /* decoded from the filesystem encoding */
+    int lineno,
+    const char *module,         /* UTF-8 encoded string */
+    PyObject *registry);
 
 /* DEPRECATED: Use PyErr_WarnEx() instead. */
+#ifndef Py_LIMITED_API
 #define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)
+#endif
 
 #ifdef __cplusplus
 }

Modified: python/branches/py3k-cdecimal/Include/weakrefobject.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/weakrefobject.h	(original)
+++ python/branches/py3k-cdecimal/Include/weakrefobject.h	Sun Jan  2 13:18:37 2011
@@ -12,6 +12,7 @@
 /* PyWeakReference is the base struct for the Python ReferenceType, ProxyType,
  * and CallableProxyType.
  */
+#ifndef Py_LIMITED_API
 struct _PyWeakReference {
     PyObject_HEAD
 
@@ -37,6 +38,7 @@
     PyWeakReference *wr_prev;
     PyWeakReference *wr_next;
 };
+#endif
 
 PyAPI_DATA(PyTypeObject) _PyWeakref_RefType;
 PyAPI_DATA(PyTypeObject) _PyWeakref_ProxyType;
@@ -62,9 +64,11 @@
                                                 PyObject *callback);
 PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
 
+#ifndef Py_LIMITED_API
 PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head);
 
 PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self);
+#endif
 
 #define PyWeakref_GET_OBJECT(ref) (((PyWeakReference *)(ref))->wr_object)
 

Modified: python/branches/py3k-cdecimal/LICENSE
==============================================================================
--- python/branches/py3k-cdecimal/LICENSE	(original)
+++ python/branches/py3k-cdecimal/LICENSE	Sun Jan  2 13:18:37 2011
@@ -68,7 +68,7 @@
     3.1             3.0.1       2009        PSF         yes
     3.1.1           3.1         2009        PSF         yes
     3.1.2           3.1         2010        PSF         yes
-    3.2             3.1         2010        PSF         yes
+    3.2             3.1         2011        PSF         yes
 
 Footnotes:
 
@@ -103,9 +103,9 @@
 analyze, test, perform and/or display publicly, prepare derivative works,
 distribute, and otherwise use Python alone or in any derivative version,
 provided, however, that PSF's License Agreement and PSF's notice of copyright,
-i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-Python Software Foundation; All Rights Reserved" are retained in Python alone or
-in any derivative version prepared by Licensee.
+i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+2011 Python Software Foundation; All Rights Reserved" are retained in Python
+alone or in any derivative version prepared by Licensee.
 
 3. In the event Licensee prepares a derivative work that is based on
 or incorporates Python or any part thereof, and wants to make

Modified: python/branches/py3k-cdecimal/Lib/_abcoll.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/_abcoll.py	(original)
+++ python/branches/py3k-cdecimal/Lib/_abcoll.py	Sun Jan  2 13:18:37 2011
@@ -90,7 +90,8 @@
     @classmethod
     def __subclasshook__(cls, C):
         if cls is Iterator:
-            if any("__next__" in B.__dict__ for B in C.__mro__):
+            if (any("__next__" in B.__dict__ for B in C.__mro__) and
+                any("__iter__" in B.__dict__ for B in C.__mro__)):
                 return True
         return NotImplemented
 

Modified: python/branches/py3k-cdecimal/Lib/_pyio.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/_pyio.py	(original)
+++ python/branches/py3k-cdecimal/Lib/_pyio.py	Sun Jan  2 13:18:37 2011
@@ -676,7 +676,7 @@
     """
 
     def __init__(self, raw):
-        self.raw = raw
+        self._raw = raw
 
     ### Positioning ###
 
@@ -720,8 +720,8 @@
         if self.raw is None:
             raise ValueError("raw stream already detached")
         self.flush()
-        raw = self.raw
-        self.raw = None
+        raw = self._raw
+        self._raw = None
         return raw
 
     ### Inquiries ###
@@ -736,6 +736,10 @@
         return self.raw.writable()
 
     @property
+    def raw(self):
+        return self._raw
+
+    @property
     def closed(self):
         return self.raw.closed
 
@@ -1465,7 +1469,7 @@
             if not isinstance(errors, str):
                 raise ValueError("invalid errors: %r" % errors)
 
-        self.buffer = buffer
+        self._buffer = buffer
         self._line_buffering = line_buffering
         self._encoding = encoding
         self._errors = errors
@@ -1520,6 +1524,10 @@
     def line_buffering(self):
         return self._line_buffering
 
+    @property
+    def buffer(self):
+        return self._buffer
+
     def seekable(self):
         return self._seekable
 
@@ -1734,8 +1742,8 @@
         if self.buffer is None:
             raise ValueError("buffer is already detached")
         self.flush()
-        buffer = self.buffer
-        self.buffer = None
+        buffer = self._buffer
+        self._buffer = None
         return buffer
 
     def seek(self, cookie, whence=0):

Modified: python/branches/py3k-cdecimal/Lib/_weakrefset.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/_weakrefset.py	(original)
+++ python/branches/py3k-cdecimal/Lib/_weakrefset.py	Sun Jan  2 13:18:37 2011
@@ -66,7 +66,11 @@
         return sum(x() is not None for x in self.data)
 
     def __contains__(self, item):
-        return ref(item) in self.data
+        try:
+            wr = ref(item)
+        except TypeError:
+            return False
+        return wr in self.data
 
     def __reduce__(self):
         return (self.__class__, (list(self),),

Modified: python/branches/py3k-cdecimal/Lib/argparse.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/argparse.py	(original)
+++ python/branches/py3k-cdecimal/Lib/argparse.py	Sun Jan  2 13:18:37 2011
@@ -88,7 +88,7 @@
 import sys as _sys
 import textwrap as _textwrap
 
-from gettext import gettext as _
+from gettext import gettext as _, ngettext
 
 
 def _callable(obj):
@@ -1023,9 +1023,13 @@
 
     class _ChoicesPseudoAction(Action):
 
-        def __init__(self, name, help):
+        def __init__(self, name, aliases, help):
+            metavar = dest = name
+            if aliases:
+                metavar += ' (%s)' % ', '.join(aliases)
             sup = super(_SubParsersAction._ChoicesPseudoAction, self)
-            sup.__init__(option_strings=[], dest=name, help=help)
+            sup.__init__(option_strings=[], dest=dest, help=help,
+                         metavar=metavar)
 
     def __init__(self,
                  option_strings,
@@ -1053,15 +1057,22 @@
         if kwargs.get('prog') is None:
             kwargs['prog'] = '%s %s' % (self._prog_prefix, name)
 
+        aliases = kwargs.pop('aliases', ())
+
         # create a pseudo-action to hold the choice help
         if 'help' in kwargs:
             help = kwargs.pop('help')
-            choice_action = self._ChoicesPseudoAction(name, help)
+            choice_action = self._ChoicesPseudoAction(name, aliases, help)
             self._choices_actions.append(choice_action)
 
         # create the parser and add it to the map
         parser = self._parser_class(**kwargs)
         self._name_parser_map[name] = parser
+
+        # make parser available under aliases also
+        for alias in aliases:
+            self._name_parser_map[alias] = parser
+
         return parser
 
     def _get_subactions(self):
@@ -1079,8 +1090,9 @@
         try:
             parser = self._name_parser_map[parser_name]
         except KeyError:
-            tup = parser_name, ', '.join(self._name_parser_map)
-            msg = _('unknown parser %r (choices: %s)' % tup)
+            args = {'parser_name': parser_name,
+                    'choices': ', '.join(self._name_parser_map)}
+            msg = _('unknown parser %(parser_name)r (choices: %(choices)s)') % args
             raise ArgumentError(self, msg)
 
         # parse all the remaining options into the namespace
@@ -1121,7 +1133,7 @@
             elif 'w' in self._mode:
                 return _sys.stdout
             else:
-                msg = _('argument "-" with mode %r' % self._mode)
+                msg = _('argument "-" with mode %r') % self._mode
                 raise ValueError(msg)
 
         # all other arguments are used as file names
@@ -1380,10 +1392,11 @@
         for option_string in args:
             # error on strings that don't start with an appropriate prefix
             if not option_string[0] in self.prefix_chars:
-                msg = _('invalid option string %r: '
-                        'must start with a character %r')
-                tup = option_string, self.prefix_chars
-                raise ValueError(msg % tup)
+                args = {'option': option_string,
+                        'prefix_chars': self.prefix_chars}
+                msg = _('invalid option string %(option)r: '
+                        'must start with a character %(prefix_chars)r')
+                raise ValueError(msg % args)
 
             # strings starting with two prefix characters are long options
             option_strings.append(option_string)
@@ -1436,7 +1449,9 @@
             conflict_handler(action, confl_optionals)
 
     def _handle_conflict_error(self, action, conflicting_actions):
-        message = _('conflicting option string(s): %s')
+        message = ngettext('conflicting option string: %s',
+                           'conflicting option strings: %s',
+                           len(conflicting_actions))
         conflict_string = ', '.join([option_string
                                      for option_string, action
                                      in conflicting_actions])
@@ -1993,7 +2008,9 @@
                 OPTIONAL: _('expected at most one argument'),
                 ONE_OR_MORE: _('expected at least one argument'),
             }
-            default = _('expected %s argument(s)') % action.nargs
+            default = ngettext('expected %s argument',
+                               'expected %s arguments',
+                               action.nargs) % action.nargs
             msg = nargs_errors.get(action.nargs, default)
             raise ArgumentError(action, msg)
 
@@ -2049,8 +2066,9 @@
         if len(option_tuples) > 1:
             options = ', '.join([option_string
                 for action, option_string, explicit_arg in option_tuples])
-            tup = arg_string, options
-            self.error(_('ambiguous option: %s could match %s') % tup)
+            args = {'option': arg_string, 'matches': options}
+            msg = _('ambiguous option: %(option)s could match %(matches)s')
+            self.error(msg % args)
 
         # if exactly one action matched, this segmentation is good,
         # so return the parsed action
@@ -2229,8 +2247,9 @@
         # TypeErrors or ValueErrors also indicate errors
         except (TypeError, ValueError):
             name = getattr(action.type, '__name__', repr(action.type))
-            msg = _('invalid %s value: %r')
-            raise ArgumentError(action, msg % (name, arg_string))
+            args = {'type': name, 'value': arg_string}
+            msg = _('invalid %(type)s value: %(value)r')
+            raise ArgumentError(action, msg % args)
 
         # return the converted value
         return result
@@ -2238,9 +2257,10 @@
     def _check_value(self, action, value):
         # converted value must be one of the choices (if specified)
         if action.choices is not None and value not in action.choices:
-            tup = value, ', '.join(map(repr, action.choices))
-            msg = _('invalid choice: %r (choose from %s)') % tup
-            raise ArgumentError(action, msg)
+            args = {'value': value,
+                    'choices': ', '.join(map(repr, action.choices))}
+            msg = _('invalid choice: %(value)r (choose from %(choices)s)')
+            raise ArgumentError(action, msg % args)
 
     # =======================
     # Help-formatting methods
@@ -2332,4 +2352,5 @@
         should either exit or raise an exception.
         """
         self.print_usage(_sys.stderr)
-        self.exit(2, _('%s: error: %s\n') % (self.prog, message))
+        args = {'prog': self.prog, 'message': message}
+        self.exit(2, _('%(prog)s: error: %(message)s\n') % args)

Modified: python/branches/py3k-cdecimal/Lib/bdb.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/bdb.py	(original)
+++ python/branches/py3k-cdecimal/Lib/bdb.py	Sun Jan  2 13:18:37 2011
@@ -3,16 +3,14 @@
 import fnmatch
 import sys
 import os
-import types
 
-__all__ = ["BdbQuit","Bdb","Breakpoint"]
+__all__ = ["BdbQuit", "Bdb", "Breakpoint"]
 
 class BdbQuit(Exception):
-    """Exception to give up completely"""
+    """Exception to give up completely."""
 
 
 class Bdb:
-
     """Generic Python debugger base class.
 
     This class takes care of details of the trace facility;
@@ -120,14 +118,14 @@
 
     def break_here(self, frame):
         filename = self.canonic(frame.f_code.co_filename)
-        if not filename in self.breaks:
+        if filename not in self.breaks:
             return False
         lineno = frame.f_lineno
-        if not lineno in self.breaks[filename]:
+        if lineno not in self.breaks[filename]:
             # The line itself has no breakpoint, but maybe the line is the
             # first line of a function with breakpoint set by function name.
             lineno = frame.f_code.co_firstlineno
-            if not lineno in self.breaks[filename]:
+            if lineno not in self.breaks[filename]:
                 return False
 
         # flag says ok to delete temp. bp
@@ -170,7 +168,7 @@
     def _set_stopinfo(self, stopframe, returnframe, stoplineno=0):
         self.stopframe = stopframe
         self.returnframe = returnframe
-        self.quitting = 0
+        self.quitting = False
         # stoplineno >= 0 means: stop at line >= the stoplineno
         # stoplineno -1 means: don't stop at all
         self.stoplineno = stoplineno
@@ -227,7 +225,7 @@
     def set_quit(self):
         self.stopframe = self.botframe
         self.returnframe = None
-        self.quitting = 1
+        self.quitting = True
         sys.settrace(None)
 
     # Derived classes and clients can call the following methods
@@ -237,47 +235,47 @@
     # Call self.get_*break*() to see the breakpoints or better
     # for bp in Breakpoint.bpbynumber: if bp: bp.bpprint().
 
-    def set_break(self, filename, lineno, temporary=0, cond = None,
+    def set_break(self, filename, lineno, temporary=False, cond=None,
                   funcname=None):
         filename = self.canonic(filename)
         import linecache # Import as late as possible
         line = linecache.getline(filename, lineno)
         if not line:
-            return 'Line %s:%d does not exist' % (filename,
-                                   lineno)
-        if not filename in self.breaks:
-            self.breaks[filename] = []
-        list = self.breaks[filename]
-        if not lineno in list:
+            return 'Line %s:%d does not exist' % (filename, lineno)
+        list = self.breaks.setdefault(filename, [])
+        if lineno not in list:
             list.append(lineno)
         bp = Breakpoint(filename, lineno, temporary, cond, funcname)
 
+    def _prune_breaks(self, filename, lineno):
+        if (filename, lineno) not in Breakpoint.bplist:
+            self.breaks[filename].remove(lineno)
+        if not self.breaks[filename]:
+            del self.breaks[filename]
+
     def clear_break(self, filename, lineno):
         filename = self.canonic(filename)
-        if not filename in self.breaks:
+        if filename not in self.breaks:
             return 'There are no breakpoints in %s' % filename
         if lineno not in self.breaks[filename]:
-            return 'There is no breakpoint at %s:%d' % (filename,
-                                    lineno)
+            return 'There is no breakpoint at %s:%d' % (filename, lineno)
         # If there's only one bp in the list for that file,line
         # pair, then remove the breaks entry
         for bp in Breakpoint.bplist[filename, lineno][:]:
             bp.deleteMe()
-        if (filename, lineno) not in Breakpoint.bplist:
-            self.breaks[filename].remove(lineno)
-        if not self.breaks[filename]:
-            del self.breaks[filename]
+        self._prune_breaks(filename, lineno)
 
     def clear_bpbynumber(self, arg):
         try:
             bp = self.get_bpbynumber(arg)
         except ValueError as err:
             return str(err)
-        self.clear_break(bp.file, bp.line)
+        bp.deleteMe()
+        self._prune_breaks(bp.file, bp.line)
 
     def clear_all_file_breaks(self, filename):
         filename = self.canonic(filename)
-        if not filename in self.breaks:
+        if filename not in self.breaks:
             return 'There are no breakpoints in %s' % filename
         for line in self.breaks[filename]:
             blist = Breakpoint.bplist[filename, line]
@@ -350,31 +348,30 @@
             i = max(0, len(stack) - 1)
         return stack, i
 
-    #
-
     def format_stack_entry(self, frame_lineno, lprefix=': '):
         import linecache, reprlib
         frame, lineno = frame_lineno
         filename = self.canonic(frame.f_code.co_filename)
         s = '%s(%r)' % (filename, lineno)
         if frame.f_code.co_name:
-            s = s + frame.f_code.co_name
+            s += frame.f_code.co_name
         else:
-            s = s + ""
+            s += ""
         if '__args__' in frame.f_locals:
             args = frame.f_locals['__args__']
         else:
             args = None
         if args:
-            s = s + reprlib.repr(args)
+            s += reprlib.repr(args)
         else:
-            s = s + '()'
+            s += '()'
         if '__return__' in frame.f_locals:
             rv = frame.f_locals['__return__']
-            s = s + '->'
-            s = s + reprlib.repr(rv)
+            s += '->'
+            s += reprlib.repr(rv)
         line = linecache.getline(filename, lineno, frame.f_globals)
-        if line: s = s + lprefix + line.strip()
+        if line:
+            s += lprefix + line.strip()
         return s
 
     # The following methods can be called by clients to use
@@ -394,7 +391,7 @@
         except BdbQuit:
             pass
         finally:
-            self.quitting = 1
+            self.quitting = True
             sys.settrace(None)
 
     def runeval(self, expr, globals=None, locals=None):
@@ -410,7 +407,7 @@
         except BdbQuit:
             pass
         finally:
-            self.quitting = 1
+            self.quitting = True
             sys.settrace(None)
 
     def runctx(self, cmd, globals, locals):
@@ -428,7 +425,7 @@
         except BdbQuit:
             pass
         finally:
-            self.quitting = 1
+            self.quitting = True
             sys.settrace(None)
         return res
 
@@ -438,8 +435,7 @@
 
 
 class Breakpoint:
-
-    """Breakpoint class
+    """Breakpoint class.
 
     Implements temporary breakpoints, ignore counts, disabling and
     (re)-enabling, and conditionals.
@@ -461,7 +457,7 @@
                 # index 0 is unused, except for marking an
                 # effective break .... see effective()
 
-    def __init__(self, file, line, temporary=0, cond=None, funcname=None):
+    def __init__(self, file, line, temporary=False, cond=None, funcname=None):
         self.funcname = funcname
         # Needed if funcname is not None.
         self.func_first_executable_line = None
@@ -469,11 +465,11 @@
         self.line = line
         self.temporary = temporary
         self.cond = cond
-        self.enabled = 1
+        self.enabled = True
         self.ignore = 0
         self.hits = 0
         self.number = Breakpoint.next
-        Breakpoint.next = Breakpoint.next + 1
+        Breakpoint.next += 1
         # Build the two lists
         self.bpbynumber.append(self)
         if (file, line) in self.bplist:
@@ -481,7 +477,6 @@
         else:
             self.bplist[file, line] = [self]
 
-
     def deleteMe(self):
         index = (self.file, self.line)
         self.bpbynumber[self.number] = None   # No longer in list
@@ -491,10 +486,10 @@
             del self.bplist[index]
 
     def enable(self):
-        self.enabled = 1
+        self.enabled = True
 
     def disable(self):
-        self.enabled = 0
+        self.enabled = False
 
     def bpprint(self, out=None):
         if out is None:
@@ -565,49 +560,44 @@
     that indicates if it is ok to delete a temporary bp.
 
     """
-    possibles = Breakpoint.bplist[file,line]
-    for i in range(0, len(possibles)):
-        b = possibles[i]
-        if b.enabled == 0:
+    possibles = Breakpoint.bplist[file, line]
+    for b in possibles:
+        if not b.enabled:
             continue
         if not checkfuncname(b, frame):
             continue
         # Count every hit when bp is enabled
-        b.hits = b.hits + 1
+        b.hits += 1
         if not b.cond:
-            # If unconditional, and ignoring,
-            # go on to next, else break
+            # If unconditional, and ignoring go on to next, else break
             if b.ignore > 0:
-                b.ignore = b.ignore -1
+                b.ignore -= 1
                 continue
             else:
-                # breakpoint and marker that's ok
-                # to delete if temporary
-                return (b,1)
+                # breakpoint and marker that it's ok to delete if temporary
+                return (b, True)
         else:
             # Conditional bp.
             # Ignore count applies only to those bpt hits where the
             # condition evaluates to true.
             try:
-                val = eval(b.cond, frame.f_globals,
-                       frame.f_locals)
+                val = eval(b.cond, frame.f_globals, frame.f_locals)
                 if val:
                     if b.ignore > 0:
-                        b.ignore = b.ignore -1
+                        b.ignore -= 1
                         # continue
                     else:
-                        return (b,1)
+                        return (b, True)
                 # else:
                 #   continue
             except:
-                # if eval fails, most conservative
-                # thing is to stop on breakpoint
-                # regardless of ignore count.
-                # Don't delete temporary,
-                # as another hint to user.
-                return (b,0)
+                # if eval fails, most conservative thing is to stop on
+                # breakpoint regardless of ignore count.  Don't delete
+                # temporary, as another hint to user.
+                return (b, False)
     return (None, None)
 
+
 # -------------------- testing --------------------
 
 class Tdb(Bdb):
@@ -640,5 +630,3 @@
 def test():
     t = Tdb()
     t.run('import bdb; bdb.foo(10)')
-
-# end

Modified: python/branches/py3k-cdecimal/Lib/codecs.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/codecs.py	(original)
+++ python/branches/py3k-cdecimal/Lib/codecs.py	Sun Jan  2 13:18:37 2011
@@ -396,6 +396,8 @@
 
 class StreamReader(Codec):
 
+    charbuffertype = str
+
     def __init__(self, stream, errors='strict'):
 
         """ Creates a StreamReader instance.
@@ -417,9 +419,8 @@
         self.stream = stream
         self.errors = errors
         self.bytebuffer = b""
-        # For str->str decoding this will stay a str
-        # For str->unicode decoding the first read will promote it to unicode
-        self.charbuffer = ""
+        self._empty_charbuffer = self.charbuffertype()
+        self.charbuffer = self._empty_charbuffer
         self.linebuffer = None
 
     def decode(self, input, errors='strict'):
@@ -455,7 +456,7 @@
         """
         # If we have lines cached, first merge them back into characters
         if self.linebuffer:
-            self.charbuffer = "".join(self.linebuffer)
+            self.charbuffer = self._empty_charbuffer.join(self.linebuffer)
             self.linebuffer = None
 
         # read until we get the required number of characters (if available)
@@ -498,7 +499,7 @@
         if chars < 0:
             # Return everything we've got
             result = self.charbuffer
-            self.charbuffer = ""
+            self.charbuffer = self._empty_charbuffer
         else:
             # Return the first chars characters
             result = self.charbuffer[:chars]
@@ -529,7 +530,7 @@
             return line
 
         readsize = size or 72
-        line = ""
+        line = self._empty_charbuffer
         # If size is given, we call read() only once
         while True:
             data = self.read(readsize, firstline=True)
@@ -537,7 +538,8 @@
                 # If we're at a "\r" read one extra character (which might
                 # be a "\n") to get a proper line ending. If the stream is
                 # temporarily exhausted we return the wrong line ending.
-                if data.endswith("\r"):
+                if (isinstance(data, str) and data.endswith("\r")) or \
+                   (isinstance(data, bytes) and data.endswith(b"\r")):
                     data += self.read(size=1, chars=1)
 
             line += data
@@ -563,7 +565,8 @@
                 line0withoutend = lines[0].splitlines(False)[0]
                 if line0withend != line0withoutend: # We really have a line end
                     # Put the rest back together and keep it until the next call
-                    self.charbuffer = "".join(lines[1:]) + self.charbuffer
+                    self.charbuffer = self._empty_charbuffer.join(lines[1:]) + \
+                                      self.charbuffer
                     if keepends:
                         line = line0withend
                     else:
@@ -574,7 +577,7 @@
                 if line and not keepends:
                     line = line.splitlines(False)[0]
                 break
-            if readsize<8000:
+            if readsize < 8000:
                 readsize *= 2
         return line
 
@@ -603,7 +606,7 @@
 
         """
         self.bytebuffer = b""
-        self.charbuffer = ""
+        self.charbuffer = self._empty_charbuffer
         self.linebuffer = None
 
     def seek(self, offset, whence=0):

Modified: python/branches/py3k-cdecimal/Lib/collections.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/collections.py	(original)
+++ python/branches/py3k-cdecimal/Lib/collections.py	Sun Jan  2 13:18:37 2011
@@ -22,7 +22,7 @@
 class _Link(object):
     __slots__ = 'prev', 'next', 'key', '__weakref__'
 
-class OrderedDict(dict, MutableMapping):
+class OrderedDict(dict):
     'Dictionary that remembers insertion order'
     # An inherited dict maps keys to values.
     # The inherited dict provides __getitem__, __len__, __contains__, and get.
@@ -52,7 +52,7 @@
             self.__root = root = _proxy(self.__hardroot)
             root.prev = root.next = root
             self.__map = {}
-        self.update(*args, **kwds)
+        self.__update(*args, **kwds)
 
     def __setitem__(self, key, value,
                     dict_setitem=dict.__setitem__, proxy=_proxy, Link=_Link):
@@ -171,14 +171,30 @@
         size += sizeof(self.__root) * n         # proxy objects
         return size
 
-    setdefault = MutableMapping.setdefault
-    update = MutableMapping.update
-    pop = MutableMapping.pop
+    update = __update = MutableMapping.update
     keys = MutableMapping.keys
     values = MutableMapping.values
     items = MutableMapping.items
     __ne__ = MutableMapping.__ne__
 
+    __marker = object()
+
+    def pop(self, key, default=__marker):
+        if key in self:
+            result = self[key]
+            del self[key]
+            return result
+        if default is self.__marker:
+            raise KeyError(key)
+        return default
+
+    def setdefault(self, key, default=None):
+        'OD.setdefault(k[,d]) -> OD.get(k,d), also set OD[k]=d if k not in OD'
+        if key in self:
+            return self[key]
+        self[key] = default
+        return default
+
     @_recursive_repr()
     def __repr__(self):
         'od.__repr__() <==> repr(od)'
@@ -334,21 +350,32 @@
 ###  Counter
 ########################################################################
 
+def _count_elements(mapping, iterable):
+    'Tally elements from the iterable.'
+    mapping_get = mapping.get
+    for elem in iterable:
+        mapping[elem] = mapping_get(elem, 0) + 1
+
+try:                                    # Load C helper function if available
+    from _collections import _count_elements
+except ImportError:
+    pass
+
 class Counter(dict):
     '''Dict subclass for counting hashable items.  Sometimes called a bag
     or multiset.  Elements are stored as dictionary keys and their counts
     are stored as dictionary values.
 
-    >>> c = Counter('abracadabra')      # count elements from a string
+    >>> c = Counter('abcdeabcdabcaba')  # count elements from a string
 
     >>> c.most_common(3)                # three most common elements
-    [('a', 5), ('r', 2), ('b', 2)]
+    [('a', 5), ('b', 4), ('c', 3)]
     >>> sorted(c)                       # list all unique elements
-    ['a', 'b', 'c', 'd', 'r']
+    ['a', 'b', 'c', 'd', 'e']
     >>> ''.join(sorted(c.elements()))   # list elements with repetitions
-    'aaaaabbcdrr'
+    'aaaaabbbbcccdde'
     >>> sum(c.values())                 # total of all counts
-    11
+    15
 
     >>> c['a']                          # count of letter 'a'
     5
@@ -356,8 +383,8 @@
     ...     c[elem] += 1                # by adding 1 to each element's count
     >>> c['a']                          # now there are seven 'a'
     7
-    >>> del c['r']                      # remove all 'r'
-    >>> c['r']                          # now there are zero 'r'
+    >>> del c['b']                      # remove all 'b'
+    >>> c['b']                          # now there are zero 'b'
     0
 
     >>> d = Counter('simsalabim')       # make another counter
@@ -396,6 +423,7 @@
         >>> c = Counter(a=4, b=2)                   # a new counter from keyword args
 
         '''
+        super().__init__()
         self.update(iterable, **kwds)
 
     def __missing__(self, key):
@@ -407,8 +435,8 @@
         '''List the n most common elements and their counts from the most
         common to the least.  If n is None, then list all element counts.
 
-        >>> Counter('abracadabra').most_common(3)
-        [('a', 5), ('r', 2), ('b', 2)]
+        >>> Counter('abcdeabcdabcaba').most_common(3)
+        [('a', 5), ('b', 4), ('c', 3)]
 
         '''
         # Emulate Bag.sortedByCount from Smalltalk
@@ -474,11 +502,9 @@
                     for elem, count in iterable.items():
                         self[elem] = count + self_get(elem, 0)
                 else:
-                    dict.update(self, iterable) # fast path when counter is empty
+                    super().update(iterable) # fast path when counter is empty
             else:
-                self_get = self.get
-                for elem in iterable:
-                    self[elem] = 1 + self_get(elem, 0)
+                _count_elements(self, iterable)
         if kwds:
             self.update(kwds)
 
@@ -516,7 +542,7 @@
     def __delitem__(self, elem):
         'Like dict.__delitem__() but does not raise KeyError for missing values.'
         if elem in self:
-            dict.__delitem__(self, elem)
+            super().__delitem__(elem)
 
     def __repr__(self):
         if not self:

Modified: python/branches/py3k-cdecimal/Lib/compileall.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/compileall.py	(original)
+++ python/branches/py3k-cdecimal/Lib/compileall.py	Sun Jan  2 13:18:37 2011
@@ -19,19 +19,20 @@
 
 __all__ = ["compile_dir","compile_file","compile_path"]
 
-def compile_dir(dir, maxlevels=10, ddir=None,
-                force=False, rx=None, quiet=False, legacy=False):
+def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,
+                quiet=False, legacy=False, optimize=-1):
     """Byte-compile all modules in the given directory tree.
 
     Arguments (only dir is required):
 
     dir:       the directory to byte-compile
     maxlevels: maximum recursion level (default 10)
-    ddir:      if given, purported directory name (this is the
-               directory name that will show up in error messages)
+    ddir:      the directory that will be prepended to the path to the
+               file as it is compiled into each byte-code file.
     force:     if True, force compilation, even if timestamps are up-to-date
     quiet:     if True, be quiet during compilation
     legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
+    optimize:  optimization level or -1 for level of the interpreter
     """
     if not quiet:
         print('Listing', dir, '...')
@@ -51,7 +52,8 @@
         else:
             dfile = None
         if not os.path.isdir(fullname):
-            if not compile_file(fullname, ddir, force, rx, quiet, legacy):
+            if not compile_file(fullname, ddir, force, rx, quiet,
+                                legacy, optimize):
                 success = 0
         elif (maxlevels > 0 and name != os.curdir and name != os.pardir and
               os.path.isdir(fullname) and not os.path.islink(fullname)):
@@ -60,15 +62,19 @@
                 success = 0
     return success
 
-def compile_file(fullname, ddir=None, force=0, rx=None, quiet=False,
-                 legacy=False):
-    """Byte-compile file.
+def compile_file(fullname, ddir=None, force=False, rx=None, quiet=False,
+                 legacy=False, optimize=-1):
+    """Byte-compile one file.
+
+    Arguments (only fullname is required):
+
     fullname:  the file to byte-compile
-    ddir:      if given, purported directory name (this is the
-               directory name that will show up in error messages)
+    ddir:      if given, the directory name compiled in to the
+               byte-code file.
     force:     if True, force compilation, even if timestamps are up-to-date
     quiet:     if True, be quiet during compilation
     legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
+    optimize:  optimization level or -1 for level of the interpreter
     """
     success = 1
     name = os.path.basename(fullname)
@@ -84,7 +90,11 @@
         if legacy:
             cfile = fullname + ('c' if __debug__ else 'o')
         else:
-            cfile = imp.cache_from_source(fullname)
+            if optimize >= 0:
+                cfile = imp.cache_from_source(fullname,
+                                              debug_override=not optimize)
+            else:
+                cfile = imp.cache_from_source(fullname)
             cache_dir = os.path.dirname(cfile)
         head, tail = name[:-3], name[-3:]
         if tail == '.py':
@@ -101,7 +111,8 @@
             if not quiet:
                 print('Compiling', fullname, '...')
             try:
-                ok = py_compile.compile(fullname, cfile, dfile, True)
+                ok = py_compile.compile(fullname, cfile, dfile, True,
+                                        optimize=optimize)
             except py_compile.PyCompileError as err:
                 if quiet:
                     print('*** Error compiling', fullname, '...')
@@ -126,7 +137,7 @@
     return success
 
 def compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=False,
-                 legacy=False):
+                 legacy=False, optimize=-1):
     """Byte-compile all module on sys.path.
 
     Arguments (all optional):
@@ -136,6 +147,7 @@
     force: as for compile_dir() (default False)
     quiet: as for compile_dir() (default False)
     legacy: as for compile_dir() (default False)
+    optimize: as for compile_dir() (default -1)
     """
     success = 1
     for dir in sys.path:
@@ -144,7 +156,7 @@
         else:
             success = success and compile_dir(dir, maxlevels, None,
                                               force, quiet=quiet,
-                                              legacy=legacy)
+                                              legacy=legacy, optimize=optimize)
     return success
 
 
@@ -154,60 +166,73 @@
 
     parser = argparse.ArgumentParser(
         description='Utilities to support installing Python libraries.')
-    parser.add_argument('-l', action='store_const', default=10, const=0,
-                        dest='maxlevels', help="don't recurse down")
+    parser.add_argument('-l', action='store_const', const=0,
+                        default=10, dest='maxlevels',
+                        help="don't recurse into subdirectories")
     parser.add_argument('-f', action='store_true', dest='force',
                         help='force rebuild even if timestamps are up to date')
     parser.add_argument('-q', action='store_true', dest='quiet',
-                        help='reduce output')
+                        help='output only error messages')
     parser.add_argument('-b', action='store_true', dest='legacy',
-                        help='produce legacy byte-compiled file paths')
+                        help='use legacy (pre-PEP3147) compiled file locations')
     parser.add_argument('-d', metavar='DESTDIR',  dest='ddir', default=None,
-                        help=('purported directory name for error messages; '
-                              'if no directory arguments, -l sys.path '
-                              'is assumed.'))
+                        help=('directory to prepend to file paths for use in '
+                              'compile time tracebacks and in runtime '
+                              'tracebacks in cases where the source file is '
+                              'unavailable'))
     parser.add_argument('-x', metavar='REGEXP', dest='rx', default=None,
-                        help=('skip files matching the regular expression.\n\t'
+                        help=('skip files matching the regular expression. '
                               'The regexp is searched for in the full path '
-                              'of the file'))
+                              'to each file considered for compilation.'))
     parser.add_argument('-i', metavar='FILE', dest='flist',
-                        help='expand the list with the content of FILE.')
-    parser.add_argument('compile_dest', metavar='FILE|DIR', nargs='?')
+                        help=('add all the files and directories listed in '
+                              'FILE to the list considered for compilation. '
+                              'If "-", names are read from stdin.'))
+    parser.add_argument('compile_dest', metavar='FILE|DIR', nargs='*',
+                        help=('zero or more file and directory names '
+                              'to compile; if no arguments given, defaults '
+                              'to the equivalent of -l sys.path'))
     args = parser.parse_args()
 
-    if (args.ddir and args.compile_dest != 1 and
-        not os.path.isdir(args.compile_dest)):
-        raise argparse.ArgumentError(
-            "-d destdir requires exactly one directory argument")
+    compile_dests = args.compile_dest
+
+    if (args.ddir and (len(compile_dests) != 1
+            or not os.path.isdir(compile_dests[0]))):
+        parser.exit('-d destdir requires exactly one directory argument')
     if args.rx:
         import re
         args.rx = re.compile(args.rx)
 
     # if flist is provided then load it
-    compile_dests = [args.compile_dest]
     if args.flist:
-        with open(args.flist) as f:
-            files = f.read().split()
-            compile_dests.extend(files)
+        try:
+            with (sys.stdin if args.flist=='-' else open(args.flist)) as f:
+                for line in f:
+                    compile_dests.append(line.strip())
+        except EnvironmentError:
+            print("Error reading file list {}".format(args.flist))
+            return False
 
+    success = True
     try:
         if compile_dests:
             for dest in compile_dests:
-                if os.path.isdir(dest):
+                if os.path.isfile(dest):
+                    if not compile_file(dest, args.ddir, args.force, args.rx,
+                                        args.quiet, args.legacy):
+                        success = False
+                else:
                     if not compile_dir(dest, args.maxlevels, args.ddir,
                                        args.force, args.rx, args.quiet,
                                        args.legacy):
-                        return 0
-                else:
-                    if not compile_file(dest, args.ddir, args.force, args.rx,
-                                        args.quiet, args.legacy):
-                        return 0
+                        success = False
+            return success
         else:
             return compile_path(legacy=args.legacy)
     except KeyboardInterrupt:
         print("\n[interrupted]")
-        return 0
-    return 1
+        return False
+    return True
 
 
 if __name__ == '__main__':

Modified: python/branches/py3k-cdecimal/Lib/concurrent/futures/_base.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/concurrent/futures/_base.py	(original)
+++ python/branches/py3k-cdecimal/Lib/concurrent/futures/_base.py	Sun Jan  2 13:18:37 2011
@@ -41,8 +41,6 @@
 
 # Logger for internal use by the futures package.
 LOGGER = logging.getLogger("concurrent.futures")
-STDERR_HANDLER = logging.StreamHandler()
-LOGGER.addHandler(STDERR_HANDLER)
 
 class Error(Exception):
     """Base class for all future-related exceptions."""

Modified: python/branches/py3k-cdecimal/Lib/concurrent/futures/process.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/concurrent/futures/process.py	(original)
+++ python/branches/py3k-cdecimal/Lib/concurrent/futures/process.py	Sun Jan  2 13:18:37 2011
@@ -118,7 +118,7 @@
 def _process_worker(call_queue, result_queue, shutdown):
     """Evaluates calls from call_queue and places the results in result_queue.
 
-    This worker is run in a seperate process.
+    This worker is run in a separate process.
 
     Args:
         call_queue: A multiprocessing.Queue of _CallItems that will be read and

Modified: python/branches/py3k-cdecimal/Lib/configparser.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/configparser.py	(original)
+++ python/branches/py3k-cdecimal/Lib/configparser.py	Sun Jan  2 13:18:37 2011
@@ -4,29 +4,20 @@
 and followed by "name: value" entries, with continuations and such in
 the style of RFC 822.
 
-The option values can contain format strings which refer to other values in
-the same section, or values in a special [DEFAULT] section.
-
-For example:
-
-    something: %(dir)s/whatever
-
-would resolve the "%(dir)s" to the value of dir.  All reference
-expansions are done late, on demand.
-
 Intrinsic defaults can be specified by passing them into the
 ConfigParser constructor as a dictionary.
 
 class:
 
 ConfigParser -- responsible for parsing a list of
-                configuration files, and managing the parsed database.
+                    configuration files, and managing the parsed database.
 
     methods:
 
     __init__(defaults=None, dict_type=_default_dict, allow_no_value=False,
-             delimiters=('=', ':'), comment_prefixes=_COMPATIBLE,
-             strict=False, empty_lines_in_values=True):
+             delimiters=('=', ':'), comment_prefixes=('#', ';'),
+             inline_comment_prefixes=None, strict=True,
+             empty_lines_in_values=True):
         Create the parser. When `defaults' is given, it is initialized into the
         dictionary or intrinsic defaults. The keys must be strings, the values
         must be appropriate for %()s string interpolation.
@@ -39,11 +30,15 @@
         that divide keys from values.
 
         When `comment_prefixes' is given, it will be used as the set of
-        substrings that prefix comments in a line.
+        substrings that prefix comments in empty lines. Comments can be
+        indented.
+
+        When `inline_comment_prefixes' is given, it will be used as the set of
+        substrings that prefix comments in non-empty lines.
 
         When `strict` is True, the parser won't allow for any section or option
         duplicates while reading from a single source (file, string or
-        dictionary). Default is False.
+        dictionary). Default is True.
 
         When `empty_lines_in_values' is False (default: True), each empty line
         marks the end of an option. Otherwise, internal empty lines of
@@ -103,8 +98,10 @@
         insensitively defined as 0, false, no, off for False, and 1, true,
         yes, on for True).  Returns False or True.
 
-    items(section, raw=False, vars=None)
-        Return a list of tuples with (name, value) for each option
+    items(section=_UNSET, raw=False, vars=None)
+        If section is given, return a list of tuples with (section_name,
+        section_proxy) for each section, including DEFAULTSECT. Otherwise,
+        return a list of tuples with (name, value) for each option
         in the section.
 
     remove_section(section)
@@ -275,9 +272,8 @@
 class InterpolationSyntaxError(InterpolationError):
     """Raised when the source text contains invalid syntax.
 
-    Current implementation raises this exception only for SafeConfigParser
-    instances when the source text into which substitutions are made
-    does not conform to the required syntax.
+    Current implementation raises this exception when the source text into
+    which substitutions are made does not conform to the required syntax.
     """
 
 
@@ -316,7 +312,7 @@
     def filename(self):
         """Deprecated, use `source'."""
         warnings.warn(
-            "This 'filename' attribute will be removed in future versions.  "
+            "The 'filename' attribute will be removed in future versions.  "
             "Use 'source' instead.",
             DeprecationWarning, stacklevel=2
         )
@@ -351,17 +347,210 @@
         self.args = (filename, lineno, line)
 
 
-# Used in parsers to denote selecting a backwards-compatible inline comment
-# character behavior (; and # are comments at the start of a line, but ; only
-# inline)
-_COMPATIBLE = object()
-
 # Used in parser getters to indicate the default behaviour when a specific
 # option is not found it to raise an exception. Created to enable `None' as
 # a valid fallback value.
 _UNSET = object()
 
 
+class Interpolation:
+    """Dummy interpolation that passes the value through with no changes."""
+
+    def before_get(self, parser, section, option, value, defaults):
+        return value
+
+    def before_set(self, parser, section, option, value):
+        return value
+
+    def before_read(self, parser, section, option, value):
+        return value
+
+    def before_write(self, parser, section, option, value):
+        return value
+
+
+class BasicInterpolation(Interpolation):
+    """Interpolation as implemented in the classic ConfigParser.
+
+    The option values can contain format strings which refer to other values in
+    the same section, or values in the special default section.
+
+    For example:
+
+        something: %(dir)s/whatever
+
+    would resolve the "%(dir)s" to the value of dir.  All reference
+    expansions are done late, on demand. If a user needs to use a bare % in
+    a configuration file, she can escape it by writing %%. Other other % usage
+    is considered a user error and raises `InterpolationSyntaxError'."""
+
+    _KEYCRE = re.compile(r"%\(([^)]+)\)s")
+
+    def before_get(self, parser, section, option, value, defaults):
+        L = []
+        self._interpolate_some(parser, option, L, value, section, defaults, 1)
+        return ''.join(L)
+
+    def before_set(self, parser, section, option, value):
+        tmp_value = value.replace('%%', '') # escaped percent signs
+        tmp_value = self._KEYCRE.sub('', tmp_value) # valid syntax
+        if '%' in tmp_value:
+            raise ValueError("invalid interpolation syntax in %r at "
+                             "position %d" % (value, tmp_value.find('%')))
+        return value
+
+    def _interpolate_some(self, parser, option, accum, rest, section, map,
+                          depth):
+        if depth > MAX_INTERPOLATION_DEPTH:
+            raise InterpolationDepthError(option, section, rest)
+        while rest:
+            p = rest.find("%")
+            if p < 0:
+                accum.append(rest)
+                return
+            if p > 0:
+                accum.append(rest[:p])
+                rest = rest[p:]
+            # p is no longer used
+            c = rest[1:2]
+            if c == "%":
+                accum.append("%")
+                rest = rest[2:]
+            elif c == "(":
+                m = self._KEYCRE.match(rest)
+                if m is None:
+                    raise InterpolationSyntaxError(option, section,
+                        "bad interpolation variable reference %r" % rest)
+                var = parser.optionxform(m.group(1))
+                rest = rest[m.end():]
+                try:
+                    v = map[var]
+                except KeyError:
+                    raise InterpolationMissingOptionError(
+                        option, section, rest, var)
+                if "%" in v:
+                    self._interpolate_some(parser, option, accum, v,
+                                           section, map, depth + 1)
+                else:
+                    accum.append(v)
+            else:
+                raise InterpolationSyntaxError(
+                    option, section,
+                    "'%%' must be followed by '%%' or '(', "
+                    "found: %r" % (rest,))
+
+
+class ExtendedInterpolation(Interpolation):
+    """Advanced variant of interpolation, supports the syntax used by
+    `zc.buildout'. Enables interpolation between sections."""
+
+    _KEYCRE = re.compile(r"\$\{([^}]+)\}")
+
+    def before_get(self, parser, section, option, value, defaults):
+        L = []
+        self._interpolate_some(parser, option, L, value, section, defaults, 1)
+        return ''.join(L)
+
+    def before_set(self, parser, section, option, value):
+        tmp_value = value.replace('$$', '') # escaped dollar signs
+        tmp_value = self._KEYCRE.sub('', tmp_value) # valid syntax
+        if '$' in tmp_value:
+            raise ValueError("invalid interpolation syntax in %r at "
+                             "position %d" % (value, tmp_value.find('%')))
+        return value
+
+    def _interpolate_some(self, parser, option, accum, rest, section, map,
+                          depth):
+        if depth > MAX_INTERPOLATION_DEPTH:
+            raise InterpolationDepthError(option, section, rest)
+        while rest:
+            p = rest.find("$")
+            if p < 0:
+                accum.append(rest)
+                return
+            if p > 0:
+                accum.append(rest[:p])
+                rest = rest[p:]
+            # p is no longer used
+            c = rest[1:2]
+            if c == "$":
+                accum.append("$")
+                rest = rest[2:]
+            elif c == "{":
+                m = self._KEYCRE.match(rest)
+                if m is None:
+                    raise InterpolationSyntaxError(option, section,
+                        "bad interpolation variable reference %r" % rest)
+                path = parser.optionxform(m.group(1)).split(':')
+                rest = rest[m.end():]
+                sect = section
+                opt = option
+                try:
+                    if len(path) == 1:
+                        opt = path[0]
+                        v = map[opt]
+                    elif len(path) == 2:
+                        sect = path[0]
+                        opt = path[1]
+                        v = parser.get(sect, opt, raw=True)
+                    else:
+                        raise InterpolationSyntaxError(
+                            option, section,
+                            "More than one ':' found: %r" % (rest,))
+                except (KeyError, NoSectionError, NoOptionError):
+                    raise InterpolationMissingOptionError(
+                        option, section, rest, ":".join(path))
+                if "$" in v:
+                    self._interpolate_some(parser, opt, accum, v, sect,
+                                           dict(parser.items(sect, raw=True)),
+                                           depth + 1)
+                else:
+                    accum.append(v)
+            else:
+                raise InterpolationSyntaxError(
+                    option, section,
+                    "'$' must be followed by '$' or '{', "
+                    "found: %r" % (rest,))
+
+
+class LegacyInterpolation(Interpolation):
+    """Deprecated interpolation used in old versions of ConfigParser.
+    Use BasicInterpolation or ExtendedInterpolation instead."""
+
+    _KEYCRE = re.compile(r"%\(([^)]*)\)s|.")
+
+    def before_get(self, parser, section, option, value, vars):
+        rawval = value
+        depth = MAX_INTERPOLATION_DEPTH
+        while depth:                    # Loop through this until it's done
+            depth -= 1
+            if value and "%(" in value:
+                replace = functools.partial(self._interpolation_replace,
+                                            parser=parser)
+                value = self._KEYCRE.sub(replace, value)
+                try:
+                    value = value % vars
+                except KeyError as e:
+                    raise InterpolationMissingOptionError(
+                        option, section, rawval, e.args[0])
+            else:
+                break
+        if value and "%(" in value:
+            raise InterpolationDepthError(option, section, rawval)
+        return value
+
+    def before_set(self, parser, section, option, value):
+        return value
+
+    @staticmethod
+    def _interpolation_replace(match, parser):
+        s = match.group(1)
+        if s is None:
+            return match.group()
+        else:
+            return "%%(%s)s" % parser.optionxform(s)
+
+
 class RawConfigParser(MutableMapping):
     """ConfigParser that does not do interpolation."""
 
@@ -388,7 +577,8 @@
                                            # space/tab
         (?P.*))?$                   # everything up to eol
         """
-
+    # Interpolation algorithm to be used if the user does not specify another
+    _DEFAULT_INTERPOLATION = Interpolation()
     # Compiled regular expression for matching sections
     SECTCRE = re.compile(_SECT_TMPL, re.VERBOSE)
     # Compiled regular expression for matching options with typical separators
@@ -404,9 +594,11 @@
 
     def __init__(self, defaults=None, dict_type=_default_dict,
                  allow_no_value=False, *, delimiters=('=', ':'),
-                 comment_prefixes=_COMPATIBLE, strict=False,
-                 empty_lines_in_values=True,
-                 default_section=DEFAULTSECT):
+                 comment_prefixes=('#', ';'), inline_comment_prefixes=None,
+                 strict=True, empty_lines_in_values=True,
+                 default_section=DEFAULTSECT,
+                 interpolation=_UNSET):
+
         self._dict = dict_type
         self._sections = self._dict()
         self._defaults = self._dict()
@@ -426,16 +618,16 @@
             else:
                 self._optcre = re.compile(self._OPT_TMPL.format(delim=d),
                                           re.VERBOSE)
-        if comment_prefixes is _COMPATIBLE:
-            self._startonly_comment_prefixes = ('#',)
-            self._comment_prefixes = (';',)
-        else:
-            self._startonly_comment_prefixes = ()
-            self._comment_prefixes = tuple(comment_prefixes or ())
+        self._comment_prefixes = tuple(comment_prefixes or ())
+        self._inline_comment_prefixes = tuple(inline_comment_prefixes or ())
         self._strict = strict
         self._allow_no_value = allow_no_value
         self._empty_lines_in_values = empty_lines_in_values
-        self._default_section=default_section
+        if interpolation is _UNSET:
+            self._interpolation = self._DEFAULT_INTERPOLATION
+        else:
+            self._interpolation = interpolation
+        self.default_section=default_section
 
     def defaults(self):
         return self._defaults
@@ -451,8 +643,8 @@
         Raise DuplicateSectionError if a section by the specified name
         already exists. Raise ValueError if name is DEFAULT.
         """
-        if section == self._default_section:
-            raise ValueError('Invalid section name: %s' % section)
+        if section == self.default_section:
+            raise ValueError('Invalid section name: %r' % section)
 
         if section in self._sections:
             raise DuplicateSectionError(section)
@@ -526,19 +718,23 @@
         that should be present in the section. If the used dictionary type
         preserves order, sections and their keys will be added in order.
 
+        All types held in the dictionary are converted to strings during
+        reading, including section names, option names and keys.
+
         Optional second argument is the `source' specifying the name of the
         dictionary being read.
         """
         elements_added = set()
         for section, keys in dictionary.items():
+            section = str(section)
             try:
                 self.add_section(section)
             except (DuplicateSectionError, ValueError):
                 if self._strict and section in elements_added:
                     raise
-                elements_added.add(section)
+            elements_added.add(section)
             for key, value in keys.items():
-                key = self.optionxform(key)
+                key = self.optionxform(str(key))
                 if value is not None:
                     value = str(value)
                 if self._strict and (section, key) in elements_added:
@@ -555,7 +751,7 @@
         )
         self.read_file(fp, source=filename)
 
-    def get(self, section, option, *, vars=None, fallback=_UNSET):
+    def get(self, section, option, *, raw=False, vars=None, fallback=_UNSET):
         """Get an option value for a given section.
 
         If `vars' is provided, it must be a dictionary. The option is looked up
@@ -563,7 +759,12 @@
         If the key is not found and `fallback' is provided, it is used as
         a fallback value. `None' can be provided as a `fallback' value.
 
-        Arguments `vars' and `fallback' are keyword only.
+        If interpolation is enabled and the optional argument `raw' is False,
+        all interpolations are expanded in the return values.
+
+        Arguments `raw', `vars', and `fallback' are keyword only.
+
+        The section DEFAULT is special.
         """
         try:
             d = self._unify_values(section, vars)
@@ -574,61 +775,90 @@
                 return fallback
         option = self.optionxform(option)
         try:
-            return d[option]
+            value = d[option]
         except KeyError:
             if fallback is _UNSET:
                 raise NoOptionError(option, section)
             else:
                 return fallback
 
-    def items(self, section):
-        try:
-            d2 = self._sections[section]
-        except KeyError:
-            if section != self._default_section:
-                raise NoSectionError(section)
-            d2 = self._dict()
-        d = self._defaults.copy()
-        d.update(d2)
-        return d.items()
+        if raw or value is None:
+            return value
+        else:
+            return self._interpolation.before_get(self, section, option, value,
+                                                  d)
 
     def _get(self, section, conv, option, **kwargs):
         return conv(self.get(section, option, **kwargs))
 
-    def getint(self, section, option, *, vars=None, fallback=_UNSET):
+    def getint(self, section, option, *, raw=False, vars=None,
+               fallback=_UNSET):
         try:
-            return self._get(section, int, option, vars=vars)
+            return self._get(section, int, option, raw=raw, vars=vars)
         except (NoSectionError, NoOptionError):
             if fallback is _UNSET:
                 raise
             else:
                 return fallback
 
-    def getfloat(self, section, option, *, vars=None, fallback=_UNSET):
+    def getfloat(self, section, option, *, raw=False, vars=None,
+                 fallback=_UNSET):
         try:
-            return self._get(section, float, option, vars=vars)
+            return self._get(section, float, option, raw=raw, vars=vars)
         except (NoSectionError, NoOptionError):
             if fallback is _UNSET:
                 raise
             else:
                 return fallback
 
-    def getboolean(self, section, option, *, vars=None, fallback=_UNSET):
+    def getboolean(self, section, option, *, raw=False, vars=None,
+                   fallback=_UNSET):
         try:
             return self._get(section, self._convert_to_boolean, option,
-                             vars=vars)
+                             raw=raw, vars=vars)
         except (NoSectionError, NoOptionError):
             if fallback is _UNSET:
                 raise
             else:
                 return fallback
 
+    def items(self, section=_UNSET, raw=False, vars=None):
+        """Return a list of (name, value) tuples for each option in a section.
+
+        All % interpolations are expanded in the return values, based on the
+        defaults passed into the constructor, unless the optional argument
+        `raw' is true.  Additional substitutions may be provided using the
+        `vars' argument, which must be a dictionary whose contents overrides
+        any pre-existing defaults.
+
+        The section DEFAULT is special.
+        """
+        if section is _UNSET:
+            return super().items()
+        d = self._defaults.copy()
+        try:
+            d.update(self._sections[section])
+        except KeyError:
+            if section != self.default_section:
+                raise NoSectionError(section)
+        # Update with the entry specific variables
+        if vars:
+            for key, value in vars.items():
+                d[self.optionxform(key)] = value
+        value_getter = lambda option: self._interpolation.before_get(self,
+            section, option, d[option], d)
+        if raw:
+            value_getter = lambda option: d[option]
+        return [(option, value_getter(option)) for option in d.keys()]
+
     def optionxform(self, optionstr):
         return optionstr.lower()
 
     def has_option(self, section, option):
-        """Check for the existence of a given option in a given section."""
-        if not section or section == self._default_section:
+        """Check for the existence of a given option in a given section.
+        If the specified `section' is None or an empty string, DEFAULT is
+        assumed. If the specified `section' does not exist, returns False."""
+        if not section or section == self.default_section:
             option = self.optionxform(option)
             return option in self._defaults
         elif section not in self._sections:
@@ -640,7 +870,10 @@
 
     def set(self, section, option, value=None):
         """Set an option."""
-        if not section or section == self._default_section:
+        if value:
+            value = self._interpolation.before_set(self, section, option,
+                                                   value)
+        if not section or section == self.default_section:
             sectdict = self._defaults
         else:
             try:
@@ -660,7 +893,7 @@
         else:
             d = self._delimiters[0]
         if self._defaults:
-            self._write_section(fp, self._default_section,
+            self._write_section(fp, self.default_section,
                                     self._defaults.items(), d)
         for section in self._sections:
             self._write_section(fp, section,
@@ -670,6 +903,8 @@
         """Write a single section to the specified `fp'."""
         fp.write("[{}]\n".format(section_name))
         for key, value in section_items:
+            value = self._interpolation.before_write(self, section_name, key,
+                                                     value)
             if value is not None or not self._allow_no_value:
                 value = delimiter + str(value).replace('\n', '\n\t')
             else:
@@ -679,7 +914,7 @@
 
     def remove_option(self, section, option):
         """Remove an option."""
-        if not section or section == self._default_section:
+        if not section or section == self.default_section:
             sectdict = self._defaults
         else:
             try:
@@ -701,7 +936,7 @@
         return existed
 
     def __getitem__(self, key):
-        if key != self._default_section and not self.has_section(key):
+        if key != self.default_section and not self.has_section(key):
             raise KeyError(key)
         return self._proxies[key]
 
@@ -715,21 +950,21 @@
         self.read_dict({key: value})
 
     def __delitem__(self, key):
-        if key == self._default_section:
+        if key == self.default_section:
             raise ValueError("Cannot remove the default section.")
         if not self.has_section(key):
             raise KeyError(key)
         self.remove_section(key)
 
     def __contains__(self, key):
-        return key == self._default_section or self.has_section(key)
+        return key == self.default_section or self.has_section(key)
 
     def __len__(self):
         return len(self._sections) + 1 # the default section
 
     def __iter__(self):
         # XXX does it break when underlying container state changed?
-        return itertools.chain((self._default_section,), self._sections.keys())
+        return itertools.chain((self.default_section,), self._sections.keys())
 
     def _read(self, fp, fpname):
         """Parse a sectioned configuration file.
@@ -756,18 +991,18 @@
         indent_level = 0
         e = None                              # None, or an exception
         for lineno, line in enumerate(fp, start=1):
-            # strip full line comments
             comment_start = None
-            for prefix in self._startonly_comment_prefixes:
-                if line.strip().startswith(prefix):
-                    comment_start = 0
-                    break
             # strip inline comments
-            for prefix in self._comment_prefixes:
+            for prefix in self._inline_comment_prefixes:
                 index = line.find(prefix)
                 if index == 0 or (index > 0 and line[index-1].isspace()):
                     comment_start = index
                     break
+            # strip full line comments
+            for prefix in self._comment_prefixes:
+                if line.strip().startswith(prefix):
+                    comment_start = 0
+                    break
             value = line[:comment_start].strip()
             if not value:
                 if self._empty_lines_in_values:
@@ -801,7 +1036,7 @@
                                                         lineno)
                         cursect = self._sections[sectname]
                         elements_added.add(sectname)
-                    elif sectname == self._default_section:
+                    elif sectname == self.default_section:
                         cursect = self._defaults
                     else:
                         cursect = self._dict()
@@ -830,13 +1065,10 @@
                         # match if it would set optval to None
                         if optval is not None:
                             optval = optval.strip()
-                            # allow empty values
-                            if optval == '""':
-                                optval = ''
                             cursect[optname] = [optval]
                         else:
                             # valueless option handling
-                            cursect[optname] = optval
+                            cursect[optname] = None
                     else:
                         # a non-fatal parsing error occurred. set up the
                         # exception but keep going. the exception will be
@@ -849,12 +1081,16 @@
         self._join_multiline_values()
 
     def _join_multiline_values(self):
-        all_sections = itertools.chain((self._defaults,),
-                                       self._sections.values())
-        for options in all_sections:
+        defaults = self.default_section, self._defaults
+        all_sections = itertools.chain((defaults,),
+                                       self._sections.items())
+        for section, options in all_sections:
             for name, val in options.items():
                 if isinstance(val, list):
-                    options[name] = '\n'.join(val).rstrip()
+                    val = '\n'.join(val).rstrip()
+                options[name] = self._interpolation.before_read(self,
+                                                                section,
+                                                                name, val)
 
     def _handle_error(self, exc, fpname, lineno, line):
         if not exc:
@@ -871,7 +1107,7 @@
         try:
             d.update(self._sections[section])
         except KeyError:
-            if section != self._default_section:
+            if section != self.default_section:
                 raise NoSectionError(section)
         # Update with the entry specific variables
         if vars:
@@ -888,7 +1124,7 @@
             raise ValueError('Not a boolean: %s' % value)
         return self.BOOLEAN_STATES[value.lower()]
 
-    def _validate_value_type(self, value):
+    def _validate_value_types(self, *, section="", option="", value=""):
         """Raises a TypeError for non-string values.
 
         The only legal non-string value if we allow valueless
@@ -898,205 +1134,48 @@
         - we allow valueless options but the value is not None
 
         For compatibility reasons this method is not used in classic set()
-        for RawConfigParsers and ConfigParsers. It is invoked in every
-        case for mapping protocol access and in SafeConfigParser.set().
+        for RawConfigParsers. It is invoked in every case for mapping protocol
+        access and in ConfigParser.set().
         """
+        if not isinstance(section, str):
+            raise TypeError("section names must be strings")
+        if not isinstance(option, str):
+            raise TypeError("option keys must be strings")
         if not self._allow_no_value or value:
             if not isinstance(value, str):
                 raise TypeError("option values must be strings")
 
 
-
 class ConfigParser(RawConfigParser):
     """ConfigParser implementing interpolation."""
 
-    def get(self, section, option, *, raw=False, vars=None, fallback=_UNSET):
-        """Get an option value for a given section.
-
-        If `vars' is provided, it must be a dictionary. The option is looked up
-        in `vars' (if provided), `section', and in `DEFAULTSECT' in that order.
-        If the key is not found and `fallback' is provided, it is used as
-        a fallback value. `None' can be provided as a `fallback' value.
-
-        All % interpolations are expanded in the return values, unless the
-        optional argument `raw' is true.  Values for interpolation keys are
-        looked up in the same manner as the option.
-
-        Arguments `raw', `vars', and `fallback' are keyword only.
-
-        The section DEFAULT is special.
-        """
-        try:
-            d = self._unify_values(section, vars)
-        except NoSectionError:
-            if fallback is _UNSET:
-                raise
-            else:
-                return fallback
-        option = self.optionxform(option)
-        try:
-            value = d[option]
-        except KeyError:
-            if fallback is _UNSET:
-                raise NoOptionError(option, section)
-            else:
-                return fallback
-
-        if raw or value is None:
-            return value
-        else:
-            return self._interpolate(section, option, value, d)
-
-    def getint(self, section, option, *, raw=False, vars=None,
-               fallback=_UNSET):
-        try:
-            return self._get(section, int, option, raw=raw, vars=vars)
-        except (NoSectionError, NoOptionError):
-            if fallback is _UNSET:
-                raise
-            else:
-                return fallback
-
-    def getfloat(self, section, option, *, raw=False, vars=None,
-                 fallback=_UNSET):
-        try:
-            return self._get(section, float, option, raw=raw, vars=vars)
-        except (NoSectionError, NoOptionError):
-            if fallback is _UNSET:
-                raise
-            else:
-                return fallback
-
-    def getboolean(self, section, option, *, raw=False, vars=None,
-                   fallback=_UNSET):
-        try:
-            return self._get(section, self._convert_to_boolean, option,
-                             raw=raw, vars=vars)
-        except (NoSectionError, NoOptionError):
-            if fallback is _UNSET:
-                raise
-            else:
-                return fallback
-
-    def items(self, section, raw=False, vars=None):
-        """Return a list of (name, value) tuples for each option in a section.
-
-        All % interpolations are expanded in the return values, based on the
-        defaults passed into the constructor, unless the optional argument
-        `raw' is true.  Additional substitutions may be provided using the
-        `vars' argument, which must be a dictionary whose contents overrides
-        any pre-existing defaults.
+    _DEFAULT_INTERPOLATION = BasicInterpolation()
 
-        The section DEFAULT is special.
-        """
-        d = self._defaults.copy()
-        try:
-            d.update(self._sections[section])
-        except KeyError:
-            if section != self._default_section:
-                raise NoSectionError(section)
-        # Update with the entry specific variables
-        if vars:
-            for key, value in vars.items():
-                d[self.optionxform(key)] = value
-        options = list(d.keys())
-        if raw:
-            return [(option, d[option])
-                    for option in options]
-        else:
-            return [(option, self._interpolate(section, option, d[option], d))
-                    for option in options]
-
-    def _interpolate(self, section, option, rawval, vars):
-        # do the string interpolation
-        value = rawval
-        depth = MAX_INTERPOLATION_DEPTH
-        while depth:                    # Loop through this until it's done
-            depth -= 1
-            if value and "%(" in value:
-                value = self._KEYCRE.sub(self._interpolation_replace, value)
-                try:
-                    value = value % vars
-                except KeyError as e:
-                    raise InterpolationMissingOptionError(
-                        option, section, rawval, e.args[0])
-            else:
-                break
-        if value and "%(" in value:
-            raise InterpolationDepthError(option, section, rawval)
-        return value
-
-    _KEYCRE = re.compile(r"%\(([^)]*)\)s|.")
+    def set(self, section, option, value=None):
+        """Set an option.  Extends RawConfigParser.set by validating type and
+        interpolation syntax on the value."""
+        self._validate_value_types(option=option, value=value)
+        super().set(section, option, value)
 
-    def _interpolation_replace(self, match):
-        s = match.group(1)
-        if s is None:
-            return match.group()
-        else:
-            return "%%(%s)s" % self.optionxform(s)
+    def add_section(self, section):
+        """Create a new section in the configuration.  Extends
+        RawConfigParser.add_section by validating if the section name is
+        a string."""
+        self._validate_value_types(section=section)
+        super().add_section(section)
 
 
 class SafeConfigParser(ConfigParser):
-    """ConfigParser implementing sane interpolation."""
-
-    def _interpolate(self, section, option, rawval, vars):
-        # do the string interpolation
-        L = []
-        self._interpolate_some(option, L, rawval, section, vars, 1)
-        return ''.join(L)
-
-    _interpvar_re = re.compile(r"%\(([^)]+)\)s")
-
-    def _interpolate_some(self, option, accum, rest, section, map, depth):
-        if depth > MAX_INTERPOLATION_DEPTH:
-            raise InterpolationDepthError(option, section, rest)
-        while rest:
-            p = rest.find("%")
-            if p < 0:
-                accum.append(rest)
-                return
-            if p > 0:
-                accum.append(rest[:p])
-                rest = rest[p:]
-            # p is no longer used
-            c = rest[1:2]
-            if c == "%":
-                accum.append("%")
-                rest = rest[2:]
-            elif c == "(":
-                m = self._interpvar_re.match(rest)
-                if m is None:
-                    raise InterpolationSyntaxError(option, section,
-                        "bad interpolation variable reference %r" % rest)
-                var = self.optionxform(m.group(1))
-                rest = rest[m.end():]
-                try:
-                    v = map[var]
-                except KeyError:
-                    raise InterpolationMissingOptionError(
-                        option, section, rest, var)
-                if "%" in v:
-                    self._interpolate_some(option, accum, v,
-                                           section, map, depth + 1)
-                else:
-                    accum.append(v)
-            else:
-                raise InterpolationSyntaxError(
-                    option, section,
-                    "'%%' must be followed by '%%' or '(', "
-                    "found: %r" % (rest,))
+    """ConfigParser alias for backwards compatibility purposes."""
 
-    def set(self, section, option, value=None):
-        """Set an option.  Extend ConfigParser.set: check for string values."""
-        self._validate_value_type(value)
-        # check for bad percent signs
-        if value:
-            tmp_value = value.replace('%%', '') # escaped percent signs
-            tmp_value = self._interpvar_re.sub('', tmp_value) # valid syntax
-            if '%' in tmp_value:
-                raise ValueError("invalid interpolation syntax in %r at "
-                                "position %d" % (value, tmp_value.find('%')))
-        ConfigParser.set(self, section, option, value)
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+        warnings.warn(
+            "The SafeConfigParser class has been renamed to ConfigParser "
+            "in Python 3.2. This alias will be removed in future versions."
+            " Use ConfigParser directly instead.",
+            DeprecationWarning, stacklevel=2
+        )
 
 
 class SectionProxy(MutableMapping):
@@ -1106,12 +1185,6 @@
         """Creates a view on a section of the specified `name` in `parser`."""
         self._parser = parser
         self._name = name
-        self.getint = functools.partial(self._parser.getint,
-                                        self._name)
-        self.getfloat = functools.partial(self._parser.getfloat,
-                                          self._name)
-        self.getboolean = functools.partial(self._parser.getboolean,
-                                            self._name)
 
     def __repr__(self):
         return ''.format(self._name)
@@ -1122,25 +1195,44 @@
         return self._parser.get(self._name, key)
 
     def __setitem__(self, key, value):
-        self._parser._validate_value_type(value)
+        self._parser._validate_value_types(option=key, value=value)
         return self._parser.set(self._name, key, value)
 
     def __delitem__(self, key):
-        if not self._parser.has_option(self._name, key):
+        if not (self._parser.has_option(self._name, key) and
+                self._parser.remove_option(self._name, key)):
             raise KeyError(key)
-        return self._parser.remove_option(self._name, key)
 
     def __contains__(self, key):
         return self._parser.has_option(self._name, key)
 
     def __len__(self):
-        # XXX weak performance
-        return len(self._parser.options(self._name))
+        return len(self._options())
 
     def __iter__(self):
-        # XXX weak performance
-        # XXX does not break when underlying container state changed
-        return self._parser.options(self._name).__iter__()
+        return self._options().__iter__()
+
+    def _options(self):
+        if self._name != self._parser.default_section:
+            return self._parser.options(self._name)
+        else:
+            return self._parser.defaults()
+
+    def get(self, option, fallback=None, *, raw=False, vars=None):
+        return self._parser.get(self._name, option, raw=raw, vars=vars,
+                                fallback=fallback)
+
+    def getint(self, option, fallback=None, *, raw=False, vars=None):
+        return self._parser.getint(self._name, option, raw=raw, vars=vars,
+                                   fallback=fallback)
+
+    def getfloat(self, option, fallback=None, *, raw=False, vars=None):
+        return self._parser.getfloat(self._name, option, raw=raw, vars=vars,
+                                     fallback=fallback)
+
+    def getboolean(self, option, fallback=None, *, raw=False, vars=None):
+        return self._parser.getboolean(self._name, option, raw=raw, vars=vars,
+                                       fallback=fallback)
 
     @property
     def parser(self):

Modified: python/branches/py3k-cdecimal/Lib/dbm/dumb.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/dbm/dumb.py	(original)
+++ python/branches/py3k-cdecimal/Lib/dbm/dumb.py	Sun Jan  2 13:18:37 2011
@@ -203,7 +203,7 @@
         # The blocks used by the associated value are lost.
         del self._index[key]
         # XXX It's unclear why we do a _commit() here (the code always
-        # XXX has, so I'm not changing it).  _setitem__ doesn't try to
+        # XXX has, so I'm not changing it).  __setitem__ doesn't try to
         # XXX keep the directory file in synch.  Why should we?  Or
         # XXX why shouldn't __setitem__?
         self._commit()
@@ -232,7 +232,7 @@
 
     __del__ = close
 
-    def _chmod (self, file):
+    def _chmod(self, file):
         if hasattr(self._os, 'chmod'):
             self._os.chmod(file, self._mode)
 

Modified: python/branches/py3k-cdecimal/Lib/decimal.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/decimal.py	(original)
+++ python/branches/py3k-cdecimal/Lib/decimal.py	Sun Jan  2 13:18:37 2011
@@ -132,6 +132,7 @@
 ]
 
 __version__ = '1.70'    # Highest version of the spec this complies with
+                        # See http://speleotrove.com/decimal/
 
 import copy as _copy
 import math as _math
@@ -5526,23 +5527,7 @@
 
 ##### Integer arithmetic functions used by ln, log10, exp and __pow__ #####
 
-# This function from Tim Peters was taken from here:
-# http://mail.python.org/pipermail/python-list/1999-July/007758.html
-# The correction being in the function definition is for speed, and
-# the whole function is not resolved with math.log because of avoiding
-# the use of floats.
-def _nbits(n, correction = {
-        '0': 4, '1': 3, '2': 2, '3': 2,
-        '4': 1, '5': 1, '6': 1, '7': 1,
-        '8': 0, '9': 0, 'a': 0, 'b': 0,
-        'c': 0, 'd': 0, 'e': 0, 'f': 0}):
-    """Number of bits in binary representation of the positive integer n,
-    or 0 if n == 0.
-    """
-    if n < 0:
-        raise ValueError("The argument to _nbits should be nonnegative.")
-    hex_n = "%x" % n
-    return 4*len(hex_n) - correction[hex_n[0]]
+_nbits = int.bit_length
 
 def _sqrt_nearest(n, a):
     """Closest integer to the square root of the positive integer n.  a is
@@ -5991,7 +5976,7 @@
 #
 # A format specifier for Decimal looks like:
 #
-#   [[fill]align][sign][0][minimumwidth][,][.precision][type]
+#   [[fill]align][sign][#][0][minimumwidth][,][.precision][type]
 
 _parse_format_specifier_regex = re.compile(r"""\A
 (?:
@@ -5999,6 +5984,7 @@
    (?P[<>=^])
 )?
 (?P[-+ ])?
+(?P\#)?
 (?P0)?
 (?P(?!0)\d+)?
 (?P,)?
@@ -6214,7 +6200,7 @@
 
     sign = _format_sign(is_negative, spec)
 
-    if fracpart:
+    if fracpart or spec['alt']:
         fracpart = spec['decimal_point'] + fracpart
 
     if exp != 0 or spec['type'] in 'eE':

Modified: python/branches/py3k-cdecimal/Lib/difflib.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/difflib.py	(original)
+++ python/branches/py3k-cdecimal/Lib/difflib.py	Sun Jan  2 13:18:37 2011
@@ -32,6 +32,7 @@
            'Differ','IS_CHARACTER_JUNK', 'IS_LINE_JUNK', 'context_diff',
            'unified_diff', 'HtmlDiff', 'Match']
 
+import warnings
 import heapq
 from collections import namedtuple as _namedtuple
 
@@ -150,7 +151,7 @@
         Return an upper bound on ratio() very quickly.
     """
 
-    def __init__(self, isjunk=None, a='', b=''):
+    def __init__(self, isjunk=None, a='', b='', autojunk=True):
         """Construct a SequenceMatcher.
 
         Optional arg isjunk is None (the default), or a one-argument
@@ -168,6 +169,10 @@
         Optional arg b is the second of two sequences to be compared.  By
         default, an empty string.  The elements of b must be hashable. See
         also .set_seqs() and .set_seq2().
+
+        Optional arg autojunk should be set to False to disable the
+        "automatic junk heuristic" that treats popular elements as junk
+        (see module documentation for more information).
         """
 
         # Members:
@@ -178,7 +183,7 @@
         #      we need to do to 'a' to change it into 'b'?"
         # b2j
         #      for x in b, b2j[x] is a list of the indices (into b)
-        #      at which x appears; junk elements do not appear
+        #      at which x appears; junk and popular elements do not appear
         # fullbcount
         #      for x in b, fullbcount[x] == the number of times x
         #      appears in b; only materialized if really needed (used
@@ -200,17 +205,14 @@
         #      subtle but helpful effects on the algorithm, which I'll
         #      get around to writing up someday <0.9 wink>.
         #      DON'T USE!  Only __chain_b uses this.  Use isbjunk.
-        # isbjunk
-        #      for x in b, isbjunk(x) == isjunk(x) but much faster;
-        #      it's really the __contains__ method of a hidden dict.
-        #      DOES NOT WORK for x in a!
-        # isbpopular
-        #      for x in b, isbpopular(x) is true iff b is reasonably long
-        #      (at least 200 elements) and x accounts for more than 1% of
-        #      its elements.  DOES NOT WORK for x in a!
+        # bjunk
+        #      the items in b for which isjunk is True.
+        # bpopular
+        #      nonjunk items in b treated as junk by the heuristic (if used).
 
         self.isjunk = isjunk
         self.a = self.b = None
+        self.autojunk = autojunk
         self.set_seqs(a, b)
 
     def set_seqs(self, a, b):
@@ -287,7 +289,7 @@
     # from starting any matching block at a junk element ...
     # also creates the fast isbjunk function ...
     # b2j also does not contain entries for "popular" elements, meaning
-    # elements that account for more than 1% of the total elements, and
+    # elements that account for more than 1 + 1% of the total elements, and
     # when the sequence is reasonably large (>= 200 elements); this can
     # be viewed as an adaptive notion of semi-junk, and yields an enormous
     # speedup when, e.g., comparing program files with hundreds of
@@ -308,44 +310,46 @@
         # out the junk later is much cheaper than building b2j "right"
         # from the start.
         b = self.b
-        n = len(b)
         self.b2j = b2j = {}
-        populardict = {}
+
         for i, elt in enumerate(b):
-            if elt in b2j:
-                indices = b2j[elt]
-                if n >= 200 and len(indices) * 100 > n:
-                    populardict[elt] = 1
-                    del indices[:]
-                else:
-                    indices.append(i)
-            else:
-                b2j[elt] = [i]
+            indices = b2j.setdefault(elt, [])
+            indices.append(i)
 
-        # Purge leftover indices for popular elements.
-        for elt in populardict:
-            del b2j[elt]
-
-        # Now b2j.keys() contains elements uniquely, and especially when
-        # the sequence is a string, that's usually a good deal smaller
-        # than len(string).  The difference is the number of isjunk calls
-        # saved.
+        # Purge junk elements
+        self.bjunk = junk = set()
         isjunk = self.isjunk
-        junkdict = {}
         if isjunk:
-            for d in populardict, b2j:
-                for elt in list(d.keys()):
-                    if isjunk(elt):
-                        junkdict[elt] = 1
-                        del d[elt]
-
-        # Now for x in b, isjunk(x) == x in junkdict, but the
-        # latter is much faster.  Note too that while there may be a
-        # lot of junk in the sequence, the number of *unique* junk
-        # elements is probably small.  So the memory burden of keeping
-        # this dict alive is likely trivial compared to the size of b2j.
-        self.isbjunk = junkdict.__contains__
-        self.isbpopular = populardict.__contains__
+            for elt in b2j.keys():
+                if isjunk(elt):
+                    junk.add(elt)
+            for elt in junk: # separate loop avoids separate list of keys
+                del b2j[elt]
+
+        # Purge popular elements that are not junk
+        self.bpopular = popular = set()
+        n = len(b)
+        if self.autojunk and n >= 200:
+            ntest = n // 100 + 1
+            for elt, idxs in b2j.items():
+                if len(idxs) > ntest:
+                    popular.add(elt)
+            for elt in popular: # ditto; as fast for 1% deletion
+                del b2j[elt]
+
+    def isbjunk(self, item):
+        "Deprecated; use 'item in SequenceMatcher().bjunk'."
+        warnings.warn("'SequenceMatcher().isbjunk(item)' is deprecated;\n"
+                      "use 'item in SMinstance.bjunk' instead.",
+                      DeprecationWarning, 2)
+        return item in self.bjunk
+
+    def isbpopular(self, item):
+        "Deprecated; use 'item in SequenceMatcher().bpopular'."
+        warnings.warn("'SequenceMatcher().isbpopular(item)' is deprecated;\n"
+                      "use 'item in SMinstance.bpopular' instead.",
+                      DeprecationWarning, 2)
+        return item in self.bpopular
 
     def find_longest_match(self, alo, ahi, blo, bhi):
         """Find longest matching block in a[alo:ahi] and b[blo:bhi].
@@ -403,7 +407,7 @@
         # Windiff ends up at the same place as diff, but by pairing up
         # the unique 'b's and then matching the first two 'a's.
 
-        a, b, b2j, isbjunk = self.a, self.b, self.b2j, self.isbjunk
+        a, b, b2j, isbjunk = self.a, self.b, self.b2j, self.bjunk.__contains__
         besti, bestj, bestsize = alo, blo, 0
         # find longest junk-free match
         # during an iteration of the loop, j2len[j] = length of longest

Modified: python/branches/py3k-cdecimal/Lib/distutils/__init__.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/__init__.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/__init__.py	Sun Jan  2 13:18:37 2011
@@ -15,5 +15,5 @@
 # Updated automatically by the Python release process.
 #
 #--start constants--
-__version__ = "3.2a4"
+__version__ = "3.2b2"
 #--end constants--

Modified: python/branches/py3k-cdecimal/Lib/distutils/archive_util.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/archive_util.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/archive_util.py	Sun Jan  2 13:18:37 2011
@@ -68,7 +68,7 @@
 def make_zipfile(base_name, base_dir, verbose=0, dry_run=0):
     """Create a zip file from all the files under 'base_dir'.
 
-    The output zip file will be named 'base_dir' + ".zip".  Uses either the
+    The output zip file will be named 'base_name' + ".zip".  Uses either the
     "zipfile" Python module (if available) or the InfoZIP "zip" utility
     (if installed and found on the default search path).  If neither tool is
     available, raises DistutilsExecError.  Returns the name of the output zip

Modified: python/branches/py3k-cdecimal/Lib/distutils/command/build_ext.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/command/build_ext.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/command/build_ext.py	Sun Jan  2 13:18:37 2011
@@ -214,7 +214,7 @@
 
             elif MSVC_VERSION == 8:
                 self.library_dirs.append(os.path.join(sys.exec_prefix,
-                                         'PC', 'VS8.0', 'win32release'))
+                                         'PC', 'VS8.0'))
             elif MSVC_VERSION == 7:
                 self.library_dirs.append(os.path.join(sys.exec_prefix,
                                          'PC', 'VS7.1'))

Modified: python/branches/py3k-cdecimal/Lib/distutils/command/install.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/command/install.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/command/install.py	Sun Jan  2 13:18:37 2011
@@ -48,7 +48,7 @@
     'unix_prefix': {
         'purelib': '$base/lib/python$py_version_short/site-packages',
         'platlib': '$platbase/lib/python$py_version_short/site-packages',
-        'headers': '$base/include/python$py_version_short/$dist_name',
+        'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
         'scripts': '$base/bin',
         'data'   : '$base',
         },
@@ -82,7 +82,8 @@
     INSTALL_SCHEMES['unix_user'] = {
         'purelib': '$usersite',
         'platlib': '$usersite',
-        'headers': '$userbase/include/python$py_version_short/$dist_name',
+        'headers':
+            '$userbase/include/python$py_version_short$abiflags/$dist_name',
         'scripts': '$userbase/bin',
         'data'   : '$userbase',
         }
@@ -312,6 +313,11 @@
 
         py_version = sys.version.split()[0]
         (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
+        try:
+            abiflags = sys.abiflags
+        except AttributeError:
+            # sys.abiflags may not be defined on all platforms.
+            abiflags = ''
         self.config_vars = {'dist_name': self.distribution.get_name(),
                             'dist_version': self.distribution.get_version(),
                             'dist_fullname': self.distribution.get_fullname(),
@@ -322,6 +328,7 @@
                             'prefix': prefix,
                             'sys_exec_prefix': exec_prefix,
                             'exec_prefix': exec_prefix,
+                            'abiflags': abiflags,
                            }
 
         if HAS_USER_SITE:

Modified: python/branches/py3k-cdecimal/Lib/distutils/sysconfig.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/sysconfig.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/sysconfig.py	Sun Jan  2 13:18:37 2011
@@ -11,7 +11,6 @@
 
 __revision__ = "$Id$"
 
-import io
 import os
 import re
 import sys
@@ -49,6 +48,18 @@
     return False
 python_build = _python_build()
 
+# Calculate the build qualifier flags if they are defined.  Adding the flags
+# to the include and lib directories only makes sense for an installation, not
+# an in-source build.
+build_flags = ''
+try:
+    if not python_build:
+        build_flags = sys.abiflags
+except AttributeError:
+    # It's not a configure-based build, so the sys module doesn't have
+    # this attribute, which is fine.
+    pass
+
 def get_python_version():
     """Return a string containing the major and minor Python version,
     leaving off the patchlevel.  Sample return values could be '1.5'
@@ -83,7 +94,8 @@
             else:
                 incdir = os.path.join(get_config_var('srcdir'), 'Include')
                 return os.path.normpath(incdir)
-        return os.path.join(prefix, "include", "python" + get_python_version())
+        python_dir = 'python' + get_python_version() + build_flags
+        return os.path.join(prefix, "include", python_dir)
     elif os.name == "nt":
         return os.path.join(prefix, "include")
     elif os.name == "os2":
@@ -209,7 +221,8 @@
     if python_build:
         return os.path.join(os.path.dirname(sys.executable), "Makefile")
     lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
-    return os.path.join(lib_dir, "config", "Makefile")
+    config_file = 'config-{}{}'.format(get_python_version(), build_flags)
+    return os.path.join(lib_dir, config_file, 'Makefile')
 
 
 def parse_config_h(fp, g=None):

Modified: python/branches/py3k-cdecimal/Lib/doctest.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/doctest.py	(original)
+++ python/branches/py3k-cdecimal/Lib/doctest.py	Sun Jan  2 13:18:37 2011
@@ -318,7 +318,8 @@
     def __init__(self, out):
         self.__out = out
         self.__debugger_used = False
-        pdb.Pdb.__init__(self, stdout=out)
+        # do not play signal games in the pdb
+        pdb.Pdb.__init__(self, stdout=out, nosigint=True)
         # still use input() to get user input
         self.use_rawinput = 1
 
@@ -2528,14 +2529,16 @@
                     exec(f.read(), globs, globs)
             except:
                 print(sys.exc_info()[1])
-                pdb.post_mortem(sys.exc_info()[2])
+                p = pdb.Pdb(nosigint=True)
+                p.reset()
+                p.interaction(None, sys.exc_info()[2])
         else:
             fp = open(srcfilename)
             try:
                 script = fp.read()
             finally:
                 fp.close()
-            pdb.run("exec(%r)" % script, globs, globs)
+            pdb.Pdb(nosigint=True).run("exec(%r)" % script, globs, globs)
 
     finally:
         os.remove(srcfilename)

Modified: python/branches/py3k-cdecimal/Lib/email/_parseaddr.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/email/_parseaddr.py	(original)
+++ python/branches/py3k-cdecimal/Lib/email/_parseaddr.py	Sun Jan  2 13:18:37 2011
@@ -64,8 +64,10 @@
     if len(data) == 4:
         s = data[3]
         i = s.find('+')
+        if i == -1:
+            i = s.find('-')
         if i > 0:
-            data[3:] = [s[:i], s[i+1:]]
+            data[3:] = [s[:i], s[i:]]
         else:
             data.append('') # Dummy tz
     if len(data) < 5:
@@ -199,14 +201,18 @@
         self.commentlist = []
 
     def gotonext(self):
-        """Parse up to the start of the next address."""
+        """Skip white space and extract comments."""
+        wslist = []
         while self.pos < len(self.field):
             if self.field[self.pos] in self.LWS + '\n\r':
+                if self.field[self.pos] not in '\n\r':
+                    wslist.append(self.field[self.pos])
                 self.pos += 1
             elif self.field[self.pos] == '(':
                 self.commentlist.append(self.getcomment())
             else:
                 break
+        return EMPTYSTRING.join(wslist)
 
     def getaddrlist(self):
         """Parse all addresses.
@@ -319,16 +325,24 @@
 
         self.gotonext()
         while self.pos < len(self.field):
+            preserve_ws = True
             if self.field[self.pos] == '.':
+                if aslist and not aslist[-1].strip():
+                    aslist.pop()
                 aslist.append('.')
                 self.pos += 1
+                preserve_ws = False
             elif self.field[self.pos] == '"':
                 aslist.append('"%s"' % quote(self.getquote()))
             elif self.field[self.pos] in self.atomends:
+                if aslist and not aslist[-1].strip():
+                    aslist.pop()
                 break
             else:
                 aslist.append(self.getatom())
-            self.gotonext()
+            ws = self.gotonext()
+            if preserve_ws and ws:
+                aslist.append(ws)
 
         if self.pos >= len(self.field) or self.field[self.pos] != '@':
             return EMPTYSTRING.join(aslist)

Modified: python/branches/py3k-cdecimal/Lib/email/generator.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/email/generator.py	(original)
+++ python/branches/py3k-cdecimal/Lib/email/generator.py	Sun Jan  2 13:18:37 2011
@@ -220,18 +220,13 @@
             g = self.clone(s)
             g.flatten(part, unixfrom=False, linesep=self._NL)
             msgtexts.append(s.getvalue())
-        # Now make sure the boundary we've selected doesn't appear in any of
-        # the message texts.
-        alltext = self._encoded_NL.join(msgtexts)
         # BAW: What about boundaries that are wrapped in double-quotes?
-        boundary = msg.get_boundary(failobj=self._make_boundary(alltext))
-        # If we had to calculate a new boundary because the body text
-        # contained that string, set the new boundary.  We don't do it
-        # unconditionally because, while set_boundary() preserves order, it
-        # doesn't preserve newlines/continuations in headers.  This is no big
-        # deal in practice, but turns out to be inconvenient for the unittest
-        # suite.
-        if msg.get_boundary() != boundary:
+        boundary = msg.get_boundary()
+        if not boundary:
+            # Create a boundary that doesn't appear in any of the
+            # message texts.
+            alltext = self._encoded_NL.join(msgtexts)
+            boundary = self._make_boundary(alltext)
             msg.set_boundary(boundary)
         # If there's a preamble, write it out, with a trailing CRLF
         if msg.preamble is not None:

Modified: python/branches/py3k-cdecimal/Lib/email/header.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/email/header.py	(original)
+++ python/branches/py3k-cdecimal/Lib/email/header.py	Sun Jan  2 13:18:37 2011
@@ -169,7 +169,7 @@
         charset is used both as s's initial charset and as the default for
         subsequent .append() calls.
 
-        The maximum line length can be specified explicit via maxlinelen.  For
+        The maximum line length can be specified explicitly via maxlinelen. For
         splitting the first line to a shorter value (to account for the field
         header which isn't included in s, e.g. `Subject') pass in the name of
         the field in header_name.  The default maxlinelen is 78 as recommended
@@ -241,7 +241,7 @@
         constructor is used.
 
         s may be a byte string or a Unicode string.  If it is a byte string
-        (i.e. isinstance(s, str) is true), then charset is the encoding of
+        (i.e. isinstance(s, str) is false), then charset is the encoding of
         that byte string, and a UnicodeError will be raised if the string
         cannot be decoded with that charset.  If s is a Unicode string, then
         charset is a hint specifying the character set of the characters in

Modified: python/branches/py3k-cdecimal/Lib/email/message.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/email/message.py	(original)
+++ python/branches/py3k-cdecimal/Lib/email/message.py	Sun Jan  2 13:18:37 2011
@@ -57,16 +57,28 @@
 def _formatparam(param, value=None, quote=True):
     """Convenience function to format and return a key=value pair.
 
-    This will quote the value if needed or if quote is true.
+    This will quote the value if needed or if quote is true.  If value is a
+    three tuple (charset, language, value), it will be encoded according
+    to RFC2231 rules.  If it contains non-ascii characters it will likewise
+    be encoded according to RFC2231 rules, using the utf-8 charset and
+    a null language.
     """
     if value is not None and len(value) > 0:
         # A tuple is used for RFC 2231 encoded parameter values where items
         # are (charset, language, value).  charset is a string, not a Charset
-        # instance.
+        # instance.  RFC 2231 encoded values are never quoted, per RFC.
         if isinstance(value, tuple):
             # Encode as per RFC 2231
             param += '*'
             value = utils.encode_rfc2231(value[2], value[0], value[1])
+            return '%s=%s' % (param, value)
+        else:
+            try:
+                value.encode('ascii')
+            except UnicodeEncodeError:
+                param += '*'
+                value = utils.encode_rfc2231(value, 'utf-8', '')
+                return '%s=%s' % (param, value)
         # BAW: Please check this.  I think that if quote is set it should
         # force quoting even if not necessary.
         if quote or tspecials.search(value):
@@ -438,11 +450,19 @@
         name is the header field to add.  keyword arguments can be used to set
         additional parameters for the header field, with underscores converted
         to dashes.  Normally the parameter will be added as key="value" unless
-        value is None, in which case only the key will be added.
+        value is None, in which case only the key will be added.  If a
+        parameter value contains non-ASCII characters it can be specified as a
+        three-tuple of (charset, language, value), in which case it will be
+        encoded according to RFC2231 rules.  Otherwise it will be encoded using
+        the utf-8 charset and a language of ''.
 
-        Example:
+        Examples:
 
         msg.add_header('content-disposition', 'attachment', filename='bud.gif')
+        msg.add_header('content-disposition', 'attachment',
+                       filename=('utf-8', '', Fu??baller.ppt'))
+        msg.add_header('content-disposition', 'attachment',
+                       filename='Fu??baller.ppt'))
         """
         parts = []
         for k, v in _params.items():

Modified: python/branches/py3k-cdecimal/Lib/email/test/test_email.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/email/test/test_email.py	(original)
+++ python/branches/py3k-cdecimal/Lib/email/test/test_email.py	Sun Jan  2 13:18:37 2011
@@ -180,6 +180,17 @@
         self.assertRaises(errors.HeaderParseError,
                           msg.set_boundary, 'BOUNDARY')
 
+    def test_make_boundary(self):
+        msg = MIMEMultipart('form-data')
+        # Note that when the boundary gets created is an implementation
+        # detail and might change.
+        self.assertEqual(msg.items()[0][1], 'multipart/form-data')
+        # Trigger creation of boundary
+        msg.as_string()
+        self.assertEqual(msg.items()[0][1][:33],
+                        'multipart/form-data; boundary="==')
+        # XXX: there ought to be tests of the uniqueness of the boundary, too.
+
     def test_message_rfc822_only(self):
         # Issue 7970: message/rfc822 not in multipart parsed by
         # HeaderParser caused an exception when flattened.
@@ -510,6 +521,45 @@
         self.assertEqual(msg.get_payload(decode=True),
                          bytes(x, 'raw-unicode-escape'))
 
+    # Issue 1078919
+    def test_ascii_add_header(self):
+        msg = Message()
+        msg.add_header('Content-Disposition', 'attachment',
+                       filename='bud.gif')
+        self.assertEqual('attachment; filename="bud.gif"',
+            msg['Content-Disposition'])
+
+    def test_noascii_add_header(self):
+        msg = Message()
+        msg.add_header('Content-Disposition', 'attachment',
+            filename="Fu??baller.ppt")
+        self.assertEqual(
+            'attachment; filename*=utf-8\'\'Fu%C3%9Fballer.ppt',
+            msg['Content-Disposition'])
+
+    def test_nonascii_add_header_via_triple(self):
+        msg = Message()
+        msg.add_header('Content-Disposition', 'attachment',
+            filename=('iso-8859-1', '', 'Fu??baller.ppt'))
+        self.assertEqual(
+            'attachment; filename*=iso-8859-1\'\'Fu%DFballer.ppt',
+            msg['Content-Disposition'])
+
+    def test_ascii_add_header_with_tspecial(self):
+        msg = Message()
+        msg.add_header('Content-Disposition', 'attachment',
+            filename="windows [filename].ppt")
+        self.assertEqual(
+            'attachment; filename="windows [filename].ppt"',
+            msg['Content-Disposition'])
+
+    def test_nonascii_add_header_with_tspecial(self):
+        msg = Message()
+        msg.add_header('Content-Disposition', 'attachment',
+            filename="Fu??baller [filename].ppt")
+        self.assertEqual(
+            "attachment; filename*=utf-8''Fu%C3%9Fballer%20%5Bfilename%5D.ppt",
+            msg['Content-Disposition'])
 
 
 # Test the email.encoders module
@@ -2243,6 +2293,16 @@
         eq(utils.parsedate_tz('5 Feb 2003 13:47:26 -0800'),
            (2003, 2, 5, 13, 47, 26, 0, 1, -1, -28800))
 
+    def test_parsedate_no_space_before_positive_offset(self):
+        self.assertEqual(utils.parsedate_tz('Wed, 3 Apr 2002 14:58:26+0800'),
+           (2002, 4, 3, 14, 58, 26, 0, 1, -1, 28800))
+
+    def test_parsedate_no_space_before_negative_offset(self):
+        # Issue 1155362: we already handled '+' for this case.
+        self.assertEqual(utils.parsedate_tz('Wed, 3 Apr 2002 14:58:26-0800'),
+           (2002, 4, 3, 14, 58, 26, 0, 1, -1, -28800))
+
+
     def test_parsedate_acceptable_to_time_functions(self):
         eq = self.assertEqual
         timetup = utils.parsedate('5 Feb 2003 13:47:26 -0800')
@@ -2319,6 +2379,24 @@
         eq(utils.parseaddr('"\\\\"example\\\\" example"@example.com'),
           ('', '"\\\\"example\\\\" example"@example.com'))
 
+    def test_parseaddr_preserves_spaces_in_local_part(self):
+        # issue 9286.  A normal RFC5322 local part should not contain any
+        # folding white space, but legacy local parts can (they are a sequence
+        # of atoms, not dotatoms).  On the other hand we strip whitespace from
+        # before the @ and around dots, on the assumption that the whitespace
+        # around the punctuation is a mistake in what would otherwise be
+        # an RFC5322 local part.  Leading whitespace is, usual, stripped as well.
+        self.assertEqual(('', "merwok wok at xample.com"),
+            utils.parseaddr("merwok wok at xample.com"))
+        self.assertEqual(('', "merwok  wok at xample.com"),
+            utils.parseaddr("merwok  wok at xample.com"))
+        self.assertEqual(('', "merwok  wok at xample.com"),
+            utils.parseaddr(" merwok  wok  @xample.com"))
+        self.assertEqual(('', 'merwok"wok"  wok at xample.com'),
+            utils.parseaddr('merwok"wok"  wok at xample.com'))
+        self.assertEqual(('', 'merwok.wok.wok at xample.com'),
+            utils.parseaddr('merwok. wok .  wok at xample.com'))
+
     def test_multiline_from_comment(self):
         x = """\
 Foo
@@ -2457,6 +2535,10 @@
     text/rfc822-headers
 """)
 
+    def test_make_msgid_domain(self):
+        self.assertEqual(
+            email.utils.make_msgid(domain='testdomain-string')[-19:],
+            '@testdomain-string>')
 
 
 # Test the iterator/generators
@@ -3577,7 +3659,7 @@
 Subject: This is a test message
 Date: Fri, 4 May 2001 14:05:44 -0400
 Content-Type: text/plain; charset=us-ascii;
- title*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21"
+ title*=us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21
 
 
 Hi,
@@ -3607,7 +3689,7 @@
 Subject: This is a test message
 Date: Fri, 4 May 2001 14:05:44 -0400
 Content-Type: text/plain; charset="us-ascii";
- title*="us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21"
+ title*=us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it%21
 
 
 Hi,
@@ -3622,6 +3704,32 @@
         msg = self._msgobj('msg_32.txt')
         eq(msg.get_content_charset(), 'us-ascii')
 
+    def test_rfc2231_parse_rfc_quoting(self):
+        m = textwrap.dedent('''\
+            Content-Disposition: inline;
+            \tfilename*0*=''This%20is%20even%20more%20;
+            \tfilename*1*=%2A%2A%2Afun%2A%2A%2A%20;
+            \tfilename*2="is it not.pdf"
+
+            ''')
+        msg = email.message_from_string(m)
+        self.assertEqual(msg.get_filename(),
+                         'This is even more ***fun*** is it not.pdf')
+        self.assertEqual(m, msg.as_string())
+
+    def test_rfc2231_parse_extra_quoting(self):
+        m = textwrap.dedent('''\
+            Content-Disposition: inline;
+            \tfilename*0*="''This%20is%20even%20more%20";
+            \tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20";
+            \tfilename*2="is it not.pdf"
+
+            ''')
+        msg = email.message_from_string(m)
+        self.assertEqual(msg.get_filename(),
+                         'This is even more ***fun*** is it not.pdf')
+        self.assertEqual(m, msg.as_string())
+
     def test_rfc2231_no_language_or_charset(self):
         m = '''\
 Content-Transfer-Encoding: 8bit

Modified: python/branches/py3k-cdecimal/Lib/email/utils.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/email/utils.py	(original)
+++ python/branches/py3k-cdecimal/Lib/email/utils.py	Sun Jan  2 13:18:37 2011
@@ -148,13 +148,15 @@
 
 
 
-def make_msgid(idstring=None):
+def make_msgid(idstring=None, domain=None):
     """Returns a string suitable for RFC 2822 compliant Message-ID, e.g:
 
     <20020201195627.33539.96671 at nightshade.la.mastaler.com>
 
     Optional idstring if given is a string used to strengthen the
-    uniqueness of the message id.
+    uniqueness of the message id.  Optional domain if given provides the
+    portion of the message id after the '@'.  It defaults to the locally
+    defined hostname.
     """
     timeval = time.time()
     utcdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(timeval))
@@ -164,8 +166,9 @@
         idstring = ''
     else:
         idstring = '.' + idstring
-    idhost = socket.getfqdn()
-    msgid = '<%s.%s.%s%s@%s>' % (utcdate, pid, randint, idstring, idhost)
+    if domain is None:
+        domain = socket.getfqdn()
+    msgid = '<%s.%s.%s%s@%s>' % (utcdate, pid, randint, idstring, domain)
     return msgid
 
 

Modified: python/branches/py3k-cdecimal/Lib/encodings/aliases.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/encodings/aliases.py	(original)
+++ python/branches/py3k-cdecimal/Lib/encodings/aliases.py	Sun Jan  2 13:18:37 2011
@@ -33,9 +33,9 @@
     'us'                 : 'ascii',
     'us_ascii'           : 'ascii',
 
-    ## base64_codec codec
-    #'base64'             : 'base64_codec',
-    #'base_64'            : 'base64_codec',
+    # base64_codec codec
+    'base64'             : 'base64_codec',
+    'base_64'            : 'base64_codec',
 
     # big5 codec
     'big5_tw'            : 'big5',
@@ -45,8 +45,8 @@
     'big5_hkscs'         : 'big5hkscs',
     'hkscs'              : 'big5hkscs',
 
-    ## bz2_codec codec
-    #'bz2'                : 'bz2_codec',
+    # bz2_codec codec
+    'bz2'                : 'bz2_codec',
 
     # cp037 codec
     '037'                : 'cp037',
@@ -248,8 +248,8 @@
     'cp936'              : 'gbk',
     'ms936'              : 'gbk',
 
-    ## hex_codec codec
-    #'hex'                : 'hex_codec',
+    # hex_codec codec
+    'hex'                : 'hex_codec',
 
     # hp_roman8 codec
     'roman8'             : 'hp_roman8',
@@ -450,13 +450,13 @@
     'cp154'              : 'ptcp154',
     'cyrillic_asian'     : 'ptcp154',
 
-    ## quopri_codec codec
-    #'quopri'             : 'quopri_codec',
-    #'quoted_printable'   : 'quopri_codec',
-    #'quotedprintable'    : 'quopri_codec',
+    # quopri_codec codec
+    'quopri'             : 'quopri_codec',
+    'quoted_printable'   : 'quopri_codec',
+    'quotedprintable'    : 'quopri_codec',
 
-    ## rot_13 codec
-    #'rot13'              : 'rot_13',
+    # rot_13 codec
+    'rot13'              : 'rot_13',
 
     # shift_jis codec
     'csshiftjis'         : 'shift_jis',
@@ -518,12 +518,12 @@
     'utf8_ucs2'          : 'utf_8',
     'utf8_ucs4'          : 'utf_8',
 
-    ## uu_codec codec
-    #'uu'                 : 'uu_codec',
+    # uu_codec codec
+    'uu'                 : 'uu_codec',
 
-    ## zlib_codec codec
-    #'zip'                : 'zlib_codec',
-    #'zlib'               : 'zlib_codec',
+    # zlib_codec codec
+    'zip'                : 'zlib_codec',
+    'zlib'               : 'zlib_codec',
 
     # temporary mac CJK aliases, will be replaced by proper codecs in 3.1
     'x_mac_japanese'      : 'shift_jis',

Modified: python/branches/py3k-cdecimal/Lib/functools.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/functools.py	(original)
+++ python/branches/py3k-cdecimal/Lib/functools.py	Sun Jan  2 13:18:37 2011
@@ -12,7 +12,7 @@
            'total_ordering', 'cmp_to_key', 'lru_cache', 'reduce', 'partial']
 
 from _functools import partial, reduce
-from collections import OrderedDict
+from collections import OrderedDict, namedtuple
 try:
     from _thread import allocate_lock as Lock
 except:
@@ -114,49 +114,91 @@
             raise TypeError('hash not implemented')
     return K
 
+_CacheInfo = namedtuple("CacheInfo", "hits misses maxsize currsize")
+
 def lru_cache(maxsize=100):
     """Least-recently-used cache decorator.
 
+    If *maxsize* is set to None, the LRU features are disabled and the cache
+    can grow without bound.
+
     Arguments to the cached function must be hashable.
-    Cache performance statistics stored in f.hits and f.misses.
-    Clear the cache using f.clear().
-    http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used
+
+    View the cache statistics named tuple (hits, misses, maxsize, currsize) with
+    f.cache_info().  Clear the cache and statistics with f.cache_clear().
+    Access the underlying function with f.__wrapped__.
+
+    See:  http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used
 
     """
-    def decorating_function(user_function, tuple=tuple, sorted=sorted,
-                            len=len, KeyError=KeyError):
-        cache = OrderedDict()           # ordered least recent to most recent
-        cache_popitem = cache.popitem
-        cache_renew = cache.move_to_end
-        kwd_mark = object()             # separate positional and keyword args
+    # Users should only access the lru_cache through its public API:
+    #       cache_info, cache_clear, and f.__wrapped__
+    # The internals of the lru_cache are encapsulated for thread safety and
+    # to allow the implementation to change (including a possible C version).
+
+    def decorating_function(user_function,
+                tuple=tuple, sorted=sorted, len=len, KeyError=KeyError):
+
+        hits = misses = 0
+        kwd_mark = object()             # separates positional and keyword args
         lock = Lock()
 
-        @wraps(user_function)
-        def wrapper(*args, **kwds):
-            key = args
-            if kwds:
-                key += (kwd_mark,) + tuple(sorted(kwds.items()))
-            try:
-                with lock:
+        if maxsize is None:
+            cache = dict()              # simple cache without ordering or size limit
+
+            @wraps(user_function)
+            def wrapper(*args, **kwds):
+                nonlocal hits, misses
+                key = args
+                if kwds:
+                    key += (kwd_mark,) + tuple(sorted(kwds.items()))
+                try:
                     result = cache[key]
-                    cache_renew(key)            # record recent use of this key
-                    wrapper.cache_hits += 1
-            except KeyError:
-                result = user_function(*args, **kwds)
-                with lock:
-                    cache[key] = result         # record recent use of this key
-                    wrapper.cache_misses += 1
-                    if len(cache) > maxsize:
-                        cache_popitem(0)        # purge least recently used cache entry
-            return result
+                    hits += 1
+                except KeyError:
+                    result = user_function(*args, **kwds)
+                    cache[key] = result
+                    misses += 1
+                return result
+        else:
+            cache = OrderedDict()       # ordered least recent to most recent
+            cache_popitem = cache.popitem
+            cache_renew = cache.move_to_end
+
+            @wraps(user_function)
+            def wrapper(*args, **kwds):
+                nonlocal hits, misses
+                key = args
+                if kwds:
+                    key += (kwd_mark,) + tuple(sorted(kwds.items()))
+                try:
+                    with lock:
+                        result = cache[key]
+                        cache_renew(key)        # record recent use of this key
+                        hits += 1
+                except KeyErr