[Python-checkins] r86687 - in python/branches/py3k-cdecimal: Doc/c-api/codec.rst Doc/c-api/utilities.rst Doc/documenting/markup.rst Doc/glossary.rst Doc/howto/unicode.rst Doc/includes/email-mime.py Doc/includes/mp_newtype.py Doc/includes/sqlite3/adapter_point_1.py Doc/includes/sqlite3/adapter_point_2.py Doc/includes/sqlite3/converter_point.py Doc/library/argparse.rst Doc/library/calendar.rst Doc/library/codecs.rst Doc/library/collections.rst Doc/library/compileall.rst Doc/library/configparser.rst Doc/library/ctypes.rst Doc/library/decimal.rst Doc/library/doctest.rst Doc/library/exceptions.rst Doc/library/functions.rst Doc/library/getopt.rst Doc/library/http.server.rst Doc/library/idle.rst Doc/library/inspect.rst Doc/library/itertools.rst Doc/library/multiprocessing.rst Doc/library/optparse.rst Doc/library/pydoc.rst Doc/library/sqlite3.rst Doc/library/stdtypes.rst Doc/library/sys.rst Doc/library/test.rst Doc/library/timeit.rst Doc/library/unittest.rst Doc/library/urllib.request.rst Doc/library/webbrowser.rst Doc/reference/compound_stmts.rst Doc/reference/datamodel.rst Doc/reference/expressions.rst Doc/tools/sphinxext/static/basic.css Doc/whatsnew/3.2.rst Include/codecs.h Include/pyport.h Lib/compileall.py Lib/configparser.py Lib/ctypes/test/test_keeprefs.py Lib/decimal.py Lib/distutils/dir_util.py Lib/distutils/tests/test_archive_util.py Lib/distutils/tests/test_bdist.py Lib/distutils/tests/test_bdist_dumb.py Lib/distutils/tests/test_build.py Lib/distutils/tests/test_build_clib.py Lib/distutils/tests/test_build_ext.py Lib/distutils/tests/test_check.py Lib/distutils/tests/test_cmd.py Lib/distutils/tests/test_config.py Lib/distutils/tests/test_config_cmd.py Lib/distutils/tests/test_core.py Lib/distutils/tests/test_cygwinccompiler.py Lib/distutils/tests/test_dep_util.py Lib/distutils/tests/test_dir_util.py Lib/distutils/tests/test_dist.py Lib/distutils/tests/test_extension.py Lib/distutils/tests/test_file_util.py Lib/distutils/tests/test_filelist.py Lib/distutils/tests/test_install.py Lib/distutils/tests/test_install_data.py Lib/distutils/tests/test_install_headers.py Lib/distutils/tests/test_install_lib.py Lib/distutils/tests/test_log.py Lib/distutils/tests/test_msvc9compiler.py Lib/distutils/tests/test_register.py Lib/distutils/tests/test_sdist.py Lib/distutils/tests/test_spawn.py Lib/distutils/tests/test_sysconfig.py Lib/distutils/tests/test_text_file.py Lib/distutils/tests/test_upload.py Lib/distutils/tests/test_util.py Lib/distutils/tests/test_version.py Lib/email/generator.py Lib/email/test/test_email.py Lib/gzip.py Lib/http/server.py Lib/idlelib/idle.bat Lib/importlib/test/import_/test___package__.py Lib/importlib/test/import_/test_caching.py Lib/importlib/test/import_/test_fromlist.py Lib/importlib/test/import_/test_meta_path.py Lib/inspect.py Lib/json/tests/test_decode.py Lib/json/tests/test_default.py Lib/json/tests/test_dump.py Lib/json/tests/test_encode_basestring_ascii.py Lib/json/tests/test_float.py Lib/json/tests/test_indent.py Lib/json/tests/test_pass1.py Lib/json/tests/test_pass2.py Lib/json/tests/test_pass3.py Lib/json/tests/test_recursion.py Lib/json/tests/test_scanstring.py Lib/json/tests/test_separators.py Lib/json/tests/test_speedups.py Lib/json/tests/test_unicode.py Lib/pstats.py Lib/pydoc.py Lib/sqlite3/test/dbapi.py Lib/sqlite3/test/types.py Lib/subprocess.py Lib/sysconfig.py Lib/test/buffer_tests.py Lib/test/cmath_testcases.txt Lib/test/fork_wait.py Lib/test/list_tests.py Lib/test/outstanding_bugs.py Lib/test/pickletester.py Lib/test/seq_tests.py Lib/test/string_tests.py Lib/test/test__locale.py Lib/test/test_argparse.py Lib/test/test_array.py Lib/test/test_ast.py Lib/test/test_augassign.py Lib/test/test_base64.py Lib/test/test_bigmem.py Lib/test/test_builtin.py Lib/test/test_bytes.py Lib/test/test_calendar.py Lib/test/test_cfgparser.py Lib/test/test_cgi.py Lib/test/test_charmapcodec.py Lib/test/test_class.py Lib/test/test_cmath.py Lib/test/test_code.py Lib/test/test_codeccallbacks.py Lib/test/test_codecs.py Lib/test/test_codeop.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_copyreg.py Lib/test/test_decimal.py Lib/test/test_deque.py Lib/test/test_descr.py Lib/test/test_epoll.py Lib/test/test_exceptions.py Lib/test/test_file.py Lib/test/test_fileio.py Lib/test/test_float.py Lib/test/test_fractions.py Lib/test/test_frozen.py Lib/test/test_functools.py Lib/test/test_gdb.py Lib/test/test_getargs2.py Lib/test/test_getopt.py Lib/test/test_glob.py Lib/test/test_gzip.py Lib/test/test_hashlib.py Lib/test/test_http_cookiejar.py Lib/test/test_httplib.py Lib/test/test_httpservers.py Lib/test/test_imaplib.py Lib/test/test_imp.py Lib/test/test_inspect.py Lib/test/test_int.py Lib/test/test_io.py Lib/test/test_ioctl.py Lib/test/test_isinstance.py Lib/test/test_itertools.py Lib/test/test_keywordonlyarg.py Lib/test/test_kqueue.py Lib/test/test_linecache.py Lib/test/test_logging.py Lib/test/test_marshal.py Lib/test/test_math.py Lib/test/test_memoryio.py Lib/test/test_memoryview.py Lib/test/test_minidom.py Lib/test/test_mmap.py Lib/test/test_multiprocessing.py Lib/test/test_nntplib.py Lib/test/test_opcodes.py Lib/test/test_operator.py Lib/test/test_optparse.py Lib/test/test_os.py Lib/test/test_parser.py Lib/test/test_pep247.py Lib/test/test_pep263.py Lib/test/test_pep3131.py Lib/test/test_platform.py Lib/test/test_posix.py Lib/test/test_pow.py Lib/test/test_pty.py Lib/test/test_pyclbr.py Lib/test/test_pyexpat.py Lib/test/test_queue.py Lib/test/test_range.py Lib/test/test_reprlib.py Lib/test/test_sax.py Lib/test/test_scope.py Lib/test/test_shutil.py Lib/test/test_signal.py Lib/test/test_site.py Lib/test/test_slice.py Lib/test/test_socket.py Lib/test/test_socketserver.py Lib/test/test_structmembers.py Lib/test/test_subprocess.py Lib/test/test_sys.py Lib/test/test_sysconfig.py Lib/test/test_tarfile.py Lib/test/test_tempfile.py Lib/test/test_textwrap.py Lib/test/test_threadedtempfile.py Lib/test/test_threading.py Lib/test/test_time.py Lib/test/test_tokenize.py Lib/test/test_trace.py Lib/test/test_traceback.py Lib/test/test_ucn.py Lib/test/test_unicode.py Lib/test/test_unicodedata.py Lib/test/test_urllib2.py Lib/test/test_warnings.py Lib/test/test_winreg.py Lib/test/test_with.py Lib/test/test_xmlrpc.py Lib/test/test_zipimport.py Lib/trace.py Lib/unittest/case.py Lib/unittest/loader.py Lib/unittest/main.py Lib/unittest/test/test_assertions.py Lib/unittest/test/test_case.py Lib/unittest/test/test_discovery.py Lib/unittest/test/test_loader.py Lib/urllib/parse.py Lib/urllib/request.py Lib/xmlrpc/client.py Misc/ACKS Misc/NEWS Misc/indent.pro Misc/maintainers.rst Misc/python-wing4.wpr Modules/_io/bytesio.c Modules/termios.c Modules/unicodedata.c Objects/abstract.c Objects/rangeobject.c Parser/asdl_c.py Python/Python-ast.c Python/pythonrun.c Tools/scripts/patchcheck.py Tools/unicode/makeunicodedata.py configure configure.in pyconfig.h.in

stefan.krah python-checkins at python.org
Mon Nov 22 12:00:45 CET 2010


Author: stefan.krah
Date: Mon Nov 22 12:00:42 2010
New Revision: 86687

Log:
Merged revisions 86520-86521,86523,86525-86526,86528,86530,86533,86535,86537-86538,86540,86542,86544-86545,86547-86553,86555,86561-86562,86564-86567,86570-86580,86583-86585,86587,86592-86596,86598,86601,86603,86605,86607-86608,86610-86611,86614,86617-86626,86630-86636,86638-86642,86645-86651,86654-86655,86660-86662,86665,86668-86671,86676,86679,86681,86684 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86520 | senthil.kumaran | 2010-11-18 16:36:41 +0100 (Thu, 18 Nov 2010) | 3 lines
  
  Fix Issue2244 - urllib unquotes user and password info multiple times - Patch by Theodore Turocy
........
  r86521 | eric.araujo | 2010-11-18 17:38:46 +0100 (Thu, 18 Nov 2010) | 17 lines
  
  Fix usage of :option: in the docs (#9312).
  
  :option: is used to create a link to an option of python, not to mark
  up any instance of any arbitrary command-line option.  These were
  changed to ````.
  
  For modules which do have a command-line interface, lists of options
  have been properly marked up with the program/cmdoption directives
  combo.  Options defined in such blocks can be linked to with :option:
  later in the same file, they won’t link to an option of python.
  
  Finally, the markup of command-line fragments in optparse.rst has
  been cleaned to use ``x`` instead of ``"x"``, keeping that latter
  form for actual Python strings.
  
  Patch by Eli Benderski and Éric Araujo.
........
  r86523 | senthil.kumaran | 2010-11-18 18:08:48 +0100 (Thu, 18 Nov 2010) | 3 lines
  
  Code Changes as per review comments by Antoine Pitrou.
........
  r86525 | antoine.pitrou | 2010-11-18 18:29:23 +0100 (Thu, 18 Nov 2010) | 5 lines
  
  Wrap all test_nntplib methods accessing a remote server in a transient_internet()
  exception catcher.  Wrapping the initial connection routine is not sufficient
  as network timeouts can then occur as part of NNTP commands.
........
  r86526 | alexander.belopolsky | 2010-11-18 19:50:13 +0100 (Thu, 18 Nov 2010) | 1 line
  
  Issue 7828: Fixed chr() and ord() documentation for wide characters
........
  r86528 | ezio.melotti | 2010-11-18 20:48:27 +0100 (Thu, 18 Nov 2010) | 1 line
  
  #10455: fix typo
........
  r86530 | alexander.belopolsky | 2010-11-19 17:09:58 +0100 (Fri, 19 Nov 2010) | 1 line
  
  Issue #4153: Updated Unicode HOWTO.
........
  r86533 | antoine.pitrou | 2010-11-19 21:07:52 +0100 (Fri, 19 Nov 2010) | 3 lines
  
  Fix test_ssl_presence when ssl is not present
........
  r86535 | fred.drake | 2010-11-19 22:24:25 +0100 (Fri, 19 Nov 2010) | 2 lines
  
  remove documentation for something that's gone
........
  r86537 | georg.brandl | 2010-11-19 23:09:04 +0100 (Fri, 19 Nov 2010) | 1 line
  
  Do not put a raw REPLACEMENT CHARACTER in the document.
........
  r86538 | benjamin.peterson | 2010-11-20 02:38:49 +0100 (Sat, 20 Nov 2010) | 1 line
  
  use %R format code; fixes invalid dereferencing #10391
........
  r86540 | benjamin.peterson | 2010-11-20 03:01:45 +0100 (Sat, 20 Nov 2010) | 1 line
  
  c89 declarations
........
  r86542 | r.david.murray | 2010-11-20 04:48:58 +0100 (Sat, 20 Nov 2010) | 2 lines
  
  Make test class name unique so that both test classes run.
........
  r86544 | brian.quinlan | 2010-11-20 05:09:35 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Fixes a timing-related failure on Windows (issue 10183)
........
  r86545 | benjamin.peterson | 2010-11-20 05:31:07 +0100 (Sat, 20 Nov 2010) | 1 line
  
  new plan: functions that want 'tmp' can declare it
........
  r86547 | ezio.melotti | 2010-11-20 10:57:27 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Add a few labels and links to unittest doc
........
  r86548 | mark.dickinson | 2010-11-20 11:09:56 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Add configure-time test for log1p disrespecting zero sign.
........
  r86549 | ezio.melotti | 2010-11-20 11:13:45 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Use correct markup for True/False/None
........
  r86550 | georg.brandl | 2010-11-20 11:24:34 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Fix rst markup errors.
........
  r86551 | mark.dickinson | 2010-11-20 11:29:12 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Regenerated configure and pyconfig.h.in.
........
  r86552 | mark.dickinson | 2010-11-20 11:43:10 +0100 (Sat, 20 Nov 2010) | 3 lines
  
  Issue #10325: Fix two issues in the fallback definitions of PY_LLONG_MAX and
  PY_ULLONG_MAX in pyport.h.  Thanks Hallvard B Furuseth for the patch.
........
  r86553 | mark.dickinson | 2010-11-20 12:08:27 +0100 (Sat, 20 Nov 2010) | 4 lines
  
  Issue #9920: Skip tests for cmath.atan and cmath.atanh applied to
  complex zeros on systems where the log1p function fails to respect
  the sign of zero.  This fixes a test failure on AIX.
........
  r86555 | georg.brandl | 2010-11-20 12:25:01 +0100 (Sat, 20 Nov 2010) | 1 line
  
  #10465: fix broken delegation in __getattr__ of _PaddedFile.
........
  r86561 | georg.brandl | 2010-11-20 12:47:10 +0100 (Sat, 20 Nov 2010) | 1 line
  
  #10460: Update indent.pro to match PEP 7 better.
........
  r86562 | georg.brandl | 2010-11-20 14:44:41 +0100 (Sat, 20 Nov 2010) | 1 line
  
  #10439: document PyCodec C APIs.
........
  r86564 | georg.brandl | 2010-11-20 15:08:53 +0100 (Sat, 20 Nov 2010) | 1 line
  
  #10460: an even better indent.pro.
........
  r86565 | georg.brandl | 2010-11-20 15:16:17 +0100 (Sat, 20 Nov 2010) | 1 line
  
  socket.gethostbyname(socket.gethostname()) can fail when host name resolution is not set up correctly; do not fail test_socket if this is the case.
........
  r86566 | michael.foord | 2010-11-20 16:07:30 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Issue 9732: addition of getattr_static to the inspect module
........
  r86567 | r.david.murray | 2010-11-20 16:10:13 +0100 (Sat, 20 Nov 2010) | 5 lines
  
  Improve TestBytesGeneratorIdempotent using by using linesep.
  
  Also corrects a typo from a previous commit.  Unfortunately
  this does *not* fix issue #10134.
........
  r86570 | michael.foord | 2010-11-20 16:34:26 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Issue 10326: TestCase instances can now be pickled (they store names of instance methods instead of references to the instance methods themselves).
........
  r86571 | michael.foord | 2010-11-20 16:43:02 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Issue 10326: extend test for pickling of TestCase instances to ensure they can be unpickled too
........
  r86572 | michael.foord | 2010-11-20 16:47:56 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Issue 10326: further extend test for unpickling to ensure type lookup mechanism works after unpickling
........
  r86573 | lukasz.langa | 2010-11-20 17:15:37 +0100 (Sat, 20 Nov 2010) | 3 lines
  
  configparser: the name of the DEFAULT section is now customizable
........
  r86574 | lukasz.langa | 2010-11-20 17:16:24 +0100 (Sat, 20 Nov 2010) | 3 lines
  
  acknowledge configparser evolution
........
  r86575 | michael.foord | 2010-11-20 17:20:16 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Issue 9732: remove use of __class__ in inspect.getattr_static and note the mro exception to code execution
........
  r86576 | lukasz.langa | 2010-11-20 17:24:30 +0100 (Sat, 20 Nov 2010) | 3 lines
  
  removed a NEWS entry that cloned itself in mysterious circumstances
........
  r86577 | r.david.murray | 2010-11-20 17:33:30 +0100 (Sat, 20 Nov 2010) | 4 lines
  
  #1574217: only swallow AttributeErrors in isinstance, not everything.
  
  Patch and tests by Brian Harring, with improvements by Ralf Schmitt.
........
  r86578 | michael.foord | 2010-11-20 17:40:44 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Issue 9732: fetch the method resolution order from the type metaclass directly in getattr_static
........
  r86579 | michael.foord | 2010-11-20 17:58:30 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Issue 9732: __class__ no longer checked on objects by getattr_static
........
  r86580 | senthil.kumaran | 2010-11-20 18:02:50 +0100 (Sat, 20 Nov 2010) | 3 lines
  
  Fix issue10377 - Output from pstats - it is just secs (i.e, wallclock time) and not CPU time.
........
  r86583 | benjamin.peterson | 2010-11-20 18:21:08 +0100 (Sat, 20 Nov 2010) | 1 line
  
  code style
........
  r86584 | benjamin.peterson | 2010-11-20 18:22:13 +0100 (Sat, 20 Nov 2010) | 1 line
  
  add space
........
  r86585 | michael.foord | 2010-11-20 18:22:21 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Improve unittest.TestLoader.discover docstring
........
  r86587 | benjamin.peterson | 2010-11-20 18:24:04 +0100 (Sat, 20 Nov 2010) | 1 line
  
  correct logic when pos is after the string #10467
........
  r86592 | michael.foord | 2010-11-20 18:50:34 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Addition of issue 9926 to NEWS
........
  r86593 | benjamin.peterson | 2010-11-20 19:07:52 +0100 (Sat, 20 Nov 2010) | 1 line
  
  add filename to ENOENT message #4925
........
  r86594 | alexander.belopolsky | 2010-11-20 19:21:07 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Issue #10371: Deprecated undocumented functions in the trace module.
........
  r86595 | benjamin.peterson | 2010-11-20 19:24:54 +0100 (Sat, 20 Nov 2010) | 1 line
  
  don't shadow globals
........
  r86596 | ezio.melotti | 2010-11-20 20:04:17 +0100 (Sat, 20 Nov 2010) | 1 line
  
  #9424: Replace deprecated assert* methods in the Python test suite.
........
  r86598 | benjamin.peterson | 2010-11-20 20:09:08 +0100 (Sat, 20 Nov 2010) | 1 line
  
  revert changes in inappropiate branch
........
  r86601 | eric.araujo | 2010-11-20 20:35:27 +0100 (Sat, 20 Nov 2010) | 2 lines
  
  Fix two NameErrors in distutils (#10407)
........
  r86603 | antoine.pitrou | 2010-11-20 20:36:05 +0100 (Sat, 20 Nov 2010) | 3 lines
  
  In 3.x, bytearray is akin to bytes, not str.
........
  r86605 | eric.araujo | 2010-11-20 20:37:28 +0100 (Sat, 20 Nov 2010) | 2 lines
  
  Add entry for r86601
........
  r86607 | antoine.pitrou | 2010-11-20 20:50:57 +0100 (Sat, 20 Nov 2010) | 4 lines
  
  Issue #10255: Fix reference leak in Py_InitializeEx().  Patch by Neil
  Schemenauer.
........
  r86608 | georg.brandl | 2010-11-20 20:54:36 +0100 (Sat, 20 Nov 2010) | 1 line
  
  #9724: add nonlocal to pydoc topics.
........
  r86610 | antoine.pitrou | 2010-11-20 21:03:08 +0100 (Sat, 20 Nov 2010) | 4 lines
  
  Issue #8078: Add constants for higher baud rates in the termios module.
  Patch by Rodolpho Eckhardt.
........
  r86611 | r.david.murray | 2010-11-20 22:18:51 +0100 (Sat, 20 Nov 2010) | 4 lines
  
  #10453: compileall now uses argparse instead of getopt, so -h works.
  
  Patch by Michele Orrù.
........
  r86614 | r.david.murray | 2010-11-20 22:28:24 +0100 (Sat, 20 Nov 2010) | 2 lines
  
  Fix email doc update I overlooked (thanks, Éric)
........
  r86617 | eric.araujo | 2010-11-20 22:53:02 +0100 (Sat, 20 Nov 2010) | 2 lines
  
  Fix typos and style in compileall.
........
  r86618 | benjamin.peterson | 2010-11-20 23:35:41 +0100 (Sat, 20 Nov 2010) | 1 line
  
  count() should return integers #10474
........
  r86619 | georg.brandl | 2010-11-20 23:40:10 +0100 (Sat, 20 Nov 2010) | 1 line
  
  Add error handling in range_count.
........
  r86620 | benjamin.peterson | 2010-11-20 23:44:32 +0100 (Sat, 20 Nov 2010) | 1 line
  
  code style and simplification
........
  r86621 | benjamin.peterson | 2010-11-20 23:50:04 +0100 (Sat, 20 Nov 2010) | 1 line
  
  enable test that was commented out for whatever reason
........
  r86622 | benjamin.peterson | 2010-11-21 00:01:55 +0100 (Sun, 21 Nov 2010) | 1 line
  
  merge all range tests into test_range
........
  r86623 | benjamin.peterson | 2010-11-21 00:03:34 +0100 (Sun, 21 Nov 2010) | 1 line
  
  fix two broken tests
........
  r86624 | benjamin.peterson | 2010-11-21 00:05:39 +0100 (Sun, 21 Nov 2010) | 1 line
  
  pep 7 actually wants the brace on a new line
........
  r86625 | eric.araujo | 2010-11-21 00:56:22 +0100 (Sun, 21 Nov 2010) | 2 lines
  
  Document index and count as part of the Sequence ABC (#9746)
........
  r86626 | raymond.hettinger | 2010-11-21 01:07:55 +0100 (Sun, 21 Nov 2010) | 1 line
  
  Clean-up the description of the range object.
........
  r86630 | eric.araujo | 2010-11-21 03:19:09 +0100 (Sun, 21 Nov 2010) | 2 lines
  
  Try to get more useful output from failing buildbot
........
  r86631 | raymond.hettinger | 2010-11-21 03:47:22 +0100 (Sun, 21 Nov 2010) | 1 line
  
  Issue #7770: Note the useful range of sin/cos in the decimal module examples.
........
  r86632 | eric.araujo | 2010-11-21 04:09:17 +0100 (Sun, 21 Nov 2010) | 2 lines
  
  Style edits in followup to r86521 (#9312)
........
  r86633 | nick.coghlan | 2010-11-21 04:44:04 +0100 (Sun, 21 Nov 2010) | 1 line
  
  Issue #10220: Add inspect.getgeneratorstate(). Initial patch by Rodolpho Eckhardt
........
  r86634 | nick.coghlan | 2010-11-21 04:55:53 +0100 (Sun, 21 Nov 2010) | 1 line
  
  Add a couple of missing versionadded tags in the inspect module docs
........
  r86635 | raymond.hettinger | 2010-11-21 05:08:28 +0100 (Sun, 21 Nov 2010) | 1 line
  
  Revert  r86517
........
  r86636 | mark.dickinson | 2010-11-21 08:37:49 +0100 (Sun, 21 Nov 2010) | 1 line
  
  Fix capitalization.
........
  r86638 | lukasz.langa | 2010-11-21 14:41:35 +0100 (Sun, 21 Nov 2010) | 3 lines
  
  Issue #10489: removed broken `__name__` support from configparser
........
  r86639 | lukasz.langa | 2010-11-21 14:56:42 +0100 (Sun, 21 Nov 2010) | 3 lines
  
  configparser: read-only attributes to get the section name and parser from a SectionProxy instance
........
  r86640 | senthil.kumaran | 2010-11-21 15:36:14 +0100 (Sun, 21 Nov 2010) | 3 lines
  
  Fix issue3709 - BaseHTTPRequestHandler will buffer the headers and write only on end_headers call.
........
  r86641 | benjamin.peterson | 2010-11-21 16:12:34 +0100 (Sun, 21 Nov 2010) | 1 line
  
  fix refleak
........
  r86642 | r.david.murray | 2010-11-21 17:53:48 +0100 (Sun, 21 Nov 2010) | 10 lines
  
  Fix TestBytesGeneratorIdempotent tests and a couple bugs they revealed.
  
  The tests that were failing on (some) windows machines, where the
  msg_XX.txt files used native \r\n lineseps are now also run on machines
  that use \n natively, and conversely the \n tests are run on Windows.
  The failing tests revealed one place where linesep needed to be added
  to a flatten call in generator.  There was also another that the tests
  didn't catch, so I added a test for that case as well.
........
  r86645 | antoine.pitrou | 2010-11-21 18:14:19 +0100 (Sun, 21 Nov 2010) | 3 lines
  
  Make test_nntplib more robust
........
  r86646 | brett.cannon | 2010-11-21 20:58:24 +0100 (Sun, 21 Nov 2010) | 1 line
  
  Add sets to the precedence table.
........
  r86647 | ezio.melotti | 2010-11-21 21:27:39 +0100 (Sun, 21 Nov 2010) | 1 line
  
  Add CSS rule for the deprecated-removed directive
........
  r86648 | mark.dickinson | 2010-11-21 22:09:58 +0100 (Sun, 21 Nov 2010) | 2 lines
  
  Issue #10488: Bring documentation for 'float' builtin up to date.
........
  r86649 | michael.foord | 2010-11-21 22:28:01 +0100 (Sun, 21 Nov 2010) | 1 line
  
  Issue 10470:  'python -m unittest' launches test discovery by default.(If you need to pass options to test discovery the discover subcommand must still be specified explicitly.)
........
  r86650 | raymond.hettinger | 2010-11-22 00:23:29 +0100 (Mon, 22 Nov 2010) | 1 line
  
  Issue 6722: Improve the namedtuple examples.
........
  r86651 | brian.curtin | 2010-11-22 00:45:10 +0100 (Mon, 22 Nov 2010) | 5 lines
  
  Fix #6378. Start IDLE using the proper version of Python based on the directory
  tree that idle.bat resides in.
  
  Works with any/all versions of Python installed concurrently.
........
  r86654 | raymond.hettinger | 2010-11-22 00:51:45 +0100 (Mon, 22 Nov 2010) | 1 line
  
  Issue 3292: Fixup to the Sequence docs.
........
  r86655 | brian.curtin | 2010-11-22 01:01:01 +0100 (Mon, 22 Nov 2010) | 2 lines
  
  Quote the paths in the event that they contain spaces.
........
  r86660 | raymond.hettinger | 2010-11-22 02:08:14 +0100 (Mon, 22 Nov 2010) | 1 line
  
  Update maintainers
........
  r86661 | eric.araujo | 2010-11-22 02:11:49 +0100 (Mon, 22 Nov 2010) | 2 lines
  
  Fix typo
........
  r86662 | eric.araujo | 2010-11-22 02:19:20 +0100 (Mon, 22 Nov 2010) | 2 lines
  
  r84925 followup: add docstring for get_makefile_filename (+PEP 257 fixes)
........
  r86665 | ezio.melotti | 2010-11-22 02:22:43 +0100 (Mon, 22 Nov 2010) | 1 line
  
  Add myself for unittest and fix Alexander username
........
  r86668 | eric.araujo | 2010-11-22 03:42:43 +0100 (Mon, 22 Nov 2010) | 2 lines
  
  Fix one compileall test (#10453).  Patch by Michele Orrù.
........
  r86669 | alexander.belopolsky | 2010-11-22 04:06:56 +0100 (Mon, 22 Nov 2010) | 1 line
  
  Issue #10138: Removed 'indefinitely' from the proleptic calendar description.
........
  r86670 | eric.araujo | 2010-11-22 04:09:19 +0100 (Mon, 22 Nov 2010) | 5 lines
  
  
  Remove unnecessary `object` base class in docs (#9095).
  
  Also add a note about inheritance from `object` being default.
........
  r86671 | eric.araujo | 2010-11-22 04:13:47 +0100 (Mon, 22 Nov 2010) | 2 lines
  
  Fix resource warning from patchcheck.py
........
  r86676 | senthil.kumaran | 2010-11-22 05:48:26 +0100 (Mon, 22 Nov 2010) | 4 lines
  
  Fix Issue4493 - urllib2 adds '/' to the path component of url, when it does not
  starts with one. This behavior is exhibited by browser and other clients.
........
  r86679 | senthil.kumaran | 2010-11-22 06:08:13 +0100 (Mon, 22 Nov 2010) | 3 lines
  
  Fix - s/urllib2/urllib.request/
........
  r86681 | martin.v.loewis | 2010-11-22 10:00:02 +0100 (Mon, 22 Nov 2010) | 2 lines
  
  Issue #10459: Update CJK character names to Unicode 6.0.
........
  r86684 | michael.foord | 2010-11-22 11:41:27 +0100 (Mon, 22 Nov 2010) | 1 line
  
  Improve test for 'python -m unittest' launching test discovery
........


Added:
   python/branches/py3k-cdecimal/Doc/c-api/codec.rst
      - copied unchanged from r86684, /python/branches/py3k/Doc/c-api/codec.rst
Modified:
   python/branches/py3k-cdecimal/   (props changed)
   python/branches/py3k-cdecimal/Doc/c-api/utilities.rst
   python/branches/py3k-cdecimal/Doc/documenting/markup.rst
   python/branches/py3k-cdecimal/Doc/glossary.rst
   python/branches/py3k-cdecimal/Doc/howto/unicode.rst
   python/branches/py3k-cdecimal/Doc/includes/email-mime.py
   python/branches/py3k-cdecimal/Doc/includes/mp_newtype.py
   python/branches/py3k-cdecimal/Doc/includes/sqlite3/adapter_point_1.py
   python/branches/py3k-cdecimal/Doc/includes/sqlite3/adapter_point_2.py
   python/branches/py3k-cdecimal/Doc/includes/sqlite3/converter_point.py
   python/branches/py3k-cdecimal/Doc/library/argparse.rst
   python/branches/py3k-cdecimal/Doc/library/calendar.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/configparser.rst
   python/branches/py3k-cdecimal/Doc/library/ctypes.rst
   python/branches/py3k-cdecimal/Doc/library/decimal.rst
   python/branches/py3k-cdecimal/Doc/library/doctest.rst
   python/branches/py3k-cdecimal/Doc/library/exceptions.rst
   python/branches/py3k-cdecimal/Doc/library/functions.rst
   python/branches/py3k-cdecimal/Doc/library/getopt.rst
   python/branches/py3k-cdecimal/Doc/library/http.server.rst
   python/branches/py3k-cdecimal/Doc/library/idle.rst
   python/branches/py3k-cdecimal/Doc/library/inspect.rst
   python/branches/py3k-cdecimal/Doc/library/itertools.rst
   python/branches/py3k-cdecimal/Doc/library/multiprocessing.rst
   python/branches/py3k-cdecimal/Doc/library/optparse.rst
   python/branches/py3k-cdecimal/Doc/library/pydoc.rst
   python/branches/py3k-cdecimal/Doc/library/sqlite3.rst
   python/branches/py3k-cdecimal/Doc/library/stdtypes.rst
   python/branches/py3k-cdecimal/Doc/library/sys.rst
   python/branches/py3k-cdecimal/Doc/library/test.rst
   python/branches/py3k-cdecimal/Doc/library/timeit.rst
   python/branches/py3k-cdecimal/Doc/library/unittest.rst
   python/branches/py3k-cdecimal/Doc/library/urllib.request.rst
   python/branches/py3k-cdecimal/Doc/library/webbrowser.rst
   python/branches/py3k-cdecimal/Doc/reference/compound_stmts.rst
   python/branches/py3k-cdecimal/Doc/reference/datamodel.rst
   python/branches/py3k-cdecimal/Doc/reference/expressions.rst
   python/branches/py3k-cdecimal/Doc/tools/sphinxext/static/basic.css
   python/branches/py3k-cdecimal/Doc/whatsnew/3.2.rst
   python/branches/py3k-cdecimal/Include/codecs.h
   python/branches/py3k-cdecimal/Include/pyport.h
   python/branches/py3k-cdecimal/Lib/compileall.py
   python/branches/py3k-cdecimal/Lib/configparser.py
   python/branches/py3k-cdecimal/Lib/ctypes/test/test_keeprefs.py
   python/branches/py3k-cdecimal/Lib/decimal.py
   python/branches/py3k-cdecimal/Lib/distutils/dir_util.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_archive_util.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_bdist.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_bdist_dumb.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_build.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_build_clib.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_build_ext.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_check.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_cmd.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_config.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_config_cmd.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_core.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_cygwinccompiler.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_dep_util.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_dir_util.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_dist.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_extension.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_file_util.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_filelist.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_install.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_install_data.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_install_headers.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_install_lib.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_log.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_msvc9compiler.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_register.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_sdist.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_spawn.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_sysconfig.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_text_file.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_upload.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_util.py
   python/branches/py3k-cdecimal/Lib/distutils/tests/test_version.py
   python/branches/py3k-cdecimal/Lib/email/generator.py
   python/branches/py3k-cdecimal/Lib/email/test/test_email.py
   python/branches/py3k-cdecimal/Lib/gzip.py
   python/branches/py3k-cdecimal/Lib/http/server.py
   python/branches/py3k-cdecimal/Lib/idlelib/idle.bat
   python/branches/py3k-cdecimal/Lib/importlib/test/import_/test___package__.py
   python/branches/py3k-cdecimal/Lib/importlib/test/import_/test_caching.py
   python/branches/py3k-cdecimal/Lib/importlib/test/import_/test_fromlist.py
   python/branches/py3k-cdecimal/Lib/importlib/test/import_/test_meta_path.py
   python/branches/py3k-cdecimal/Lib/inspect.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_decode.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_default.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_dump.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_encode_basestring_ascii.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_float.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_indent.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_pass1.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_pass2.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_pass3.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_recursion.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_scanstring.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_separators.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_speedups.py
   python/branches/py3k-cdecimal/Lib/json/tests/test_unicode.py
   python/branches/py3k-cdecimal/Lib/pstats.py
   python/branches/py3k-cdecimal/Lib/pydoc.py
   python/branches/py3k-cdecimal/Lib/sqlite3/test/dbapi.py
   python/branches/py3k-cdecimal/Lib/sqlite3/test/types.py
   python/branches/py3k-cdecimal/Lib/subprocess.py
   python/branches/py3k-cdecimal/Lib/sysconfig.py
   python/branches/py3k-cdecimal/Lib/test/buffer_tests.py
   python/branches/py3k-cdecimal/Lib/test/cmath_testcases.txt
   python/branches/py3k-cdecimal/Lib/test/fork_wait.py
   python/branches/py3k-cdecimal/Lib/test/list_tests.py
   python/branches/py3k-cdecimal/Lib/test/outstanding_bugs.py
   python/branches/py3k-cdecimal/Lib/test/pickletester.py
   python/branches/py3k-cdecimal/Lib/test/seq_tests.py
   python/branches/py3k-cdecimal/Lib/test/string_tests.py
   python/branches/py3k-cdecimal/Lib/test/test__locale.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_ast.py
   python/branches/py3k-cdecimal/Lib/test/test_augassign.py
   python/branches/py3k-cdecimal/Lib/test/test_base64.py
   python/branches/py3k-cdecimal/Lib/test/test_bigmem.py
   python/branches/py3k-cdecimal/Lib/test/test_builtin.py
   python/branches/py3k-cdecimal/Lib/test/test_bytes.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_charmapcodec.py
   python/branches/py3k-cdecimal/Lib/test/test_class.py
   python/branches/py3k-cdecimal/Lib/test/test_cmath.py
   python/branches/py3k-cdecimal/Lib/test/test_code.py
   python/branches/py3k-cdecimal/Lib/test/test_codeccallbacks.py
   python/branches/py3k-cdecimal/Lib/test/test_codecs.py
   python/branches/py3k-cdecimal/Lib/test/test_codeop.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_copyreg.py
   python/branches/py3k-cdecimal/Lib/test/test_decimal.py
   python/branches/py3k-cdecimal/Lib/test/test_deque.py
   python/branches/py3k-cdecimal/Lib/test/test_descr.py
   python/branches/py3k-cdecimal/Lib/test/test_epoll.py
   python/branches/py3k-cdecimal/Lib/test/test_exceptions.py
   python/branches/py3k-cdecimal/Lib/test/test_file.py
   python/branches/py3k-cdecimal/Lib/test/test_fileio.py
   python/branches/py3k-cdecimal/Lib/test/test_float.py
   python/branches/py3k-cdecimal/Lib/test/test_fractions.py
   python/branches/py3k-cdecimal/Lib/test/test_frozen.py
   python/branches/py3k-cdecimal/Lib/test/test_functools.py
   python/branches/py3k-cdecimal/Lib/test/test_gdb.py
   python/branches/py3k-cdecimal/Lib/test/test_getargs2.py
   python/branches/py3k-cdecimal/Lib/test/test_getopt.py
   python/branches/py3k-cdecimal/Lib/test/test_glob.py
   python/branches/py3k-cdecimal/Lib/test/test_gzip.py
   python/branches/py3k-cdecimal/Lib/test/test_hashlib.py
   python/branches/py3k-cdecimal/Lib/test/test_http_cookiejar.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_imaplib.py
   python/branches/py3k-cdecimal/Lib/test/test_imp.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_ioctl.py
   python/branches/py3k-cdecimal/Lib/test/test_isinstance.py
   python/branches/py3k-cdecimal/Lib/test/test_itertools.py
   python/branches/py3k-cdecimal/Lib/test/test_keywordonlyarg.py
   python/branches/py3k-cdecimal/Lib/test/test_kqueue.py
   python/branches/py3k-cdecimal/Lib/test/test_linecache.py
   python/branches/py3k-cdecimal/Lib/test/test_logging.py
   python/branches/py3k-cdecimal/Lib/test/test_marshal.py
   python/branches/py3k-cdecimal/Lib/test/test_math.py
   python/branches/py3k-cdecimal/Lib/test/test_memoryio.py
   python/branches/py3k-cdecimal/Lib/test/test_memoryview.py
   python/branches/py3k-cdecimal/Lib/test/test_minidom.py
   python/branches/py3k-cdecimal/Lib/test/test_mmap.py
   python/branches/py3k-cdecimal/Lib/test/test_multiprocessing.py
   python/branches/py3k-cdecimal/Lib/test/test_nntplib.py
   python/branches/py3k-cdecimal/Lib/test/test_opcodes.py
   python/branches/py3k-cdecimal/Lib/test/test_operator.py
   python/branches/py3k-cdecimal/Lib/test/test_optparse.py
   python/branches/py3k-cdecimal/Lib/test/test_os.py
   python/branches/py3k-cdecimal/Lib/test/test_parser.py
   python/branches/py3k-cdecimal/Lib/test/test_pep247.py
   python/branches/py3k-cdecimal/Lib/test/test_pep263.py
   python/branches/py3k-cdecimal/Lib/test/test_pep3131.py
   python/branches/py3k-cdecimal/Lib/test/test_platform.py
   python/branches/py3k-cdecimal/Lib/test/test_posix.py
   python/branches/py3k-cdecimal/Lib/test/test_pow.py
   python/branches/py3k-cdecimal/Lib/test/test_pty.py
   python/branches/py3k-cdecimal/Lib/test/test_pyclbr.py
   python/branches/py3k-cdecimal/Lib/test/test_pyexpat.py
   python/branches/py3k-cdecimal/Lib/test/test_queue.py
   python/branches/py3k-cdecimal/Lib/test/test_range.py
   python/branches/py3k-cdecimal/Lib/test/test_reprlib.py
   python/branches/py3k-cdecimal/Lib/test/test_sax.py
   python/branches/py3k-cdecimal/Lib/test/test_scope.py
   python/branches/py3k-cdecimal/Lib/test/test_shutil.py
   python/branches/py3k-cdecimal/Lib/test/test_signal.py
   python/branches/py3k-cdecimal/Lib/test/test_site.py
   python/branches/py3k-cdecimal/Lib/test/test_slice.py
   python/branches/py3k-cdecimal/Lib/test/test_socket.py
   python/branches/py3k-cdecimal/Lib/test/test_socketserver.py
   python/branches/py3k-cdecimal/Lib/test/test_structmembers.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_sysconfig.py
   python/branches/py3k-cdecimal/Lib/test/test_tarfile.py
   python/branches/py3k-cdecimal/Lib/test/test_tempfile.py
   python/branches/py3k-cdecimal/Lib/test/test_textwrap.py
   python/branches/py3k-cdecimal/Lib/test/test_threadedtempfile.py
   python/branches/py3k-cdecimal/Lib/test/test_threading.py
   python/branches/py3k-cdecimal/Lib/test/test_time.py
   python/branches/py3k-cdecimal/Lib/test/test_tokenize.py
   python/branches/py3k-cdecimal/Lib/test/test_trace.py
   python/branches/py3k-cdecimal/Lib/test/test_traceback.py
   python/branches/py3k-cdecimal/Lib/test/test_ucn.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_urllib2.py
   python/branches/py3k-cdecimal/Lib/test/test_warnings.py
   python/branches/py3k-cdecimal/Lib/test/test_winreg.py
   python/branches/py3k-cdecimal/Lib/test/test_with.py
   python/branches/py3k-cdecimal/Lib/test/test_xmlrpc.py
   python/branches/py3k-cdecimal/Lib/test/test_zipimport.py
   python/branches/py3k-cdecimal/Lib/trace.py
   python/branches/py3k-cdecimal/Lib/unittest/case.py
   python/branches/py3k-cdecimal/Lib/unittest/loader.py
   python/branches/py3k-cdecimal/Lib/unittest/main.py
   python/branches/py3k-cdecimal/Lib/unittest/test/test_assertions.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_loader.py
   python/branches/py3k-cdecimal/Lib/urllib/parse.py
   python/branches/py3k-cdecimal/Lib/urllib/request.py
   python/branches/py3k-cdecimal/Lib/xmlrpc/client.py
   python/branches/py3k-cdecimal/Misc/ACKS
   python/branches/py3k-cdecimal/Misc/NEWS
   python/branches/py3k-cdecimal/Misc/indent.pro
   python/branches/py3k-cdecimal/Misc/maintainers.rst
   python/branches/py3k-cdecimal/Misc/python-wing4.wpr
   python/branches/py3k-cdecimal/Modules/_io/bytesio.c
   python/branches/py3k-cdecimal/Modules/termios.c
   python/branches/py3k-cdecimal/Modules/unicodedata.c
   python/branches/py3k-cdecimal/Objects/abstract.c
   python/branches/py3k-cdecimal/Objects/rangeobject.c
   python/branches/py3k-cdecimal/Parser/asdl_c.py
   python/branches/py3k-cdecimal/Python/Python-ast.c
   python/branches/py3k-cdecimal/Python/pythonrun.c
   python/branches/py3k-cdecimal/Tools/scripts/patchcheck.py
   python/branches/py3k-cdecimal/Tools/unicode/makeunicodedata.py
   python/branches/py3k-cdecimal/configure
   python/branches/py3k-cdecimal/configure.in
   python/branches/py3k-cdecimal/pyconfig.h.in

Modified: python/branches/py3k-cdecimal/Doc/c-api/utilities.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/c-api/utilities.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/c-api/utilities.rst	Mon Nov 22 12:00:42 2010
@@ -18,3 +18,4 @@
    arg.rst
    conversion.rst
    reflection.rst
+   codec.rst

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	Mon Nov 22 12:00:42 2010
@@ -565,10 +565,6 @@
    If you don't need the "variable part" indication, use the standard
    ````code```` instead.
 
-.. describe:: var
-
-   A Python or C variable or parameter name.
-
 
 The following roles generate external links:
 

Modified: python/branches/py3k-cdecimal/Doc/glossary.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/glossary.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/glossary.rst	Mon Nov 22 12:00:42 2010
@@ -435,6 +435,14 @@
       its first :term:`argument` (which is usually called ``self``).
       See :term:`function` and :term:`nested scope`.
 
+   method resolution order
+      Method Resolution Order is the order in which base classes are searched
+      for a member during lookup. See `The Python 2.3 Method Resolution Order
+      <http://www.python.org/download/releases/2.3/mro/>`_.
+
+   MRO
+      See :term:`method resolution order`.
+
    mutable
       Mutable objects can change their value but keep their :func:`id`.  See
       also :term:`immutable`.

Modified: python/branches/py3k-cdecimal/Doc/howto/unicode.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/howto/unicode.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/howto/unicode.rst	Mon Nov 22 12:00:42 2010
@@ -4,13 +4,11 @@
   Unicode HOWTO
 *****************
 
-:Release: 1.11
+:Release: 1.12
 
-This HOWTO discusses Python 2.x's support for Unicode, and explains
+This HOWTO discusses Python support for Unicode, and explains
 various problems that people commonly encounter when trying to work
-with Unicode.  (This HOWTO has not yet been updated to cover the 3.x
-versions of Python.)
-
+with Unicode.
 
 Introduction to Unicode
 =======================
@@ -44,14 +42,14 @@
 hold values ranging from 0 to 255.  ASCII codes only went up to 127, so some
 machines assigned values between 128 and 255 to accented characters.  Different
 machines had different codes, however, which led to problems exchanging files.
-Eventually various commonly used sets of values for the 128-255 range emerged.
+Eventually various commonly used sets of values for the 128--255 range emerged.
 Some were true standards, defined by the International Standards Organization,
 and some were **de facto** conventions that were invented by one company or
 another and managed to catch on.
 
 255 characters aren't very many.  For example, you can't fit both the accented
 characters used in Western Europe and the Cyrillic alphabet used for Russian
-into the 128-255 range because there are more than 127 such characters.
+into the 128--255 range because there are more than 127 such characters.
 
 You could write files using different codes (all your Russian files in a coding
 system called KOI8, all your French files in a different coding system called
@@ -64,8 +62,8 @@
 to represent many different characters from many different alphabets; an initial
 goal was to have Unicode contain the alphabets for every single human language.
 It turns out that even 16 bits isn't enough to meet that goal, and the modern
-Unicode specification uses a wider range of codes, 0-1,114,111 (0x10ffff in
-base-16).
+Unicode specification uses a wider range of codes, 0 through 1,114,111 (0x10ffff
+in base 16).
 
 There's a related ISO standard, ISO 10646.  Unicode and ISO 10646 were
 originally separate efforts, but the specifications were merged with the 1.1
@@ -90,7 +88,7 @@
 The Unicode standard describes how characters are represented by **code
 points**.  A code point is an integer value, usually denoted in base 16.  In the
 standard, a code point is written using the notation U+12ca to mean the
-character with value 0x12ca (4810 decimal).  The Unicode standard contains a lot
+character with value 0x12ca (4,810 decimal).  The Unicode standard contains a lot
 of tables listing characters and their corresponding code points::
 
    0061    'a'; LATIN SMALL LETTER A
@@ -117,10 +115,10 @@
 ---------
 
 To summarize the previous section: a Unicode string is a sequence of code
-points, which are numbers from 0 to 0x10ffff.  This sequence needs to be
-represented as a set of bytes (meaning, values from 0-255) in memory.  The rules
-for translating a Unicode string into a sequence of bytes are called an
-**encoding**.
+points, which are numbers from 0 through 0x10ffff (1,114,111 decimal).  This
+sequence needs to be represented as a set of bytes (meaning, values
+from 0 through 255) in memory.  The rules for translating a Unicode string
+into a sequence of bytes are called an **encoding**.
 
 The first encoding you might think of is an array of 32-bit integers.  In this
 representation, the string "Python" would look like this::
@@ -164,7 +162,7 @@
    case.)
 
 Latin-1, also known as ISO-8859-1, is a similar encoding.  Unicode code points
-0-255 are identical to the Latin-1 values, so converting to this encoding simply
+0--255 are identical to the Latin-1 values, so converting to this encoding simply
 requires converting code points to byte values; if a code point larger than 255
 is encountered, the string can't be encoded into Latin-1.
 
@@ -226,8 +224,8 @@
 <http://en.wikipedia.org/wiki/UTF-8>, for example.
 
 
-Python 2.x's Unicode Support
-============================
+Python's Unicode Support
+========================
 
 Now that you've learned the rudiments of Unicode, we can look at Python's
 Unicode features.
@@ -265,10 +263,13 @@
     UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 0:
                         unexpected code byte
     >>> b'\x80abc'.decode("utf-8", "replace")
-    '\ufffdabc'
+    '?abc'
     >>> b'\x80abc'.decode("utf-8", "ignore")
     'abc'
 
+(In this code example, the Unicode replacement character has been replaced by
+a question mark because it may not be displayed on some systems.)
+
 Encodings are specified as strings containing the encoding's name.  Python 3.2
 comes with roughly 100 different encodings; see the Python Library Reference at
 :ref:`standard-encodings` for a list.  Some encodings have multiple names; for
@@ -281,10 +282,10 @@
 built-in :func:`ord` function that takes a one-character Unicode string and
 returns the code point value::
 
-    >>> chr(40960)
-    '\ua000'
-    >>> ord('\ua000')
-    40960
+    >>> chr(57344)
+    '\ue000'
+    >>> ord('\ue000')
+    57344
 
 Converting to Bytes
 -------------------
@@ -326,7 +327,8 @@
 
 In Python source code, specific Unicode code points can be written using the
 ``\u`` escape sequence, which is followed by four hex digits giving the code
-point.  The ``\U`` escape sequence is similar, but expects 8 hex digits, not 4::
+point.  The ``\U`` escape sequence is similar, but expects eight hex digits,
+not four::
 
     >>> s = "a\xac\u1234\u20ac\U00008000"
               ^^^^ two-digit hex escape
@@ -465,18 +467,17 @@
 
 Reading Unicode from a file is therefore simple::
 
-    f = open('unicode.rst', encoding='utf-8')
-    for line in f:
-        print(repr(line))
+    with open('unicode.rst', encoding='utf-8') as f:
+        for line in f:
+            print(repr(line))
 
 It's also possible to open files in update mode, allowing both reading and
 writing::
 
-    f = open('test', encoding='utf-8', mode='w+')
-    f.write('\u4500 blah blah blah\n')
-    f.seek(0)
-    print(repr(f.readline()[:1]))
-    f.close()
+    with open('test', encoding='utf-8', mode='w+') as f:
+        f.write('\u4500 blah blah blah\n')
+        f.seek(0)
+        print(repr(f.readline()[:1]))
 
 The Unicode character U+FEFF is used as a byte-order mark (BOM), and is often
 written as the first character of a file in order to assist with autodetection
@@ -513,14 +514,13 @@
 automatically converted to the right encoding for you::
 
     filename = 'filename\u4500abc'
-    f = open(filename, 'w')
-    f.write('blah\n')
-    f.close()
+    with open(filename, 'w') as f:
+        f.write('blah\n')
 
 Functions in the :mod:`os` module such as :func:`os.stat` will also accept Unicode
 filenames.
 
-:func:`os.listdir`, which returns filenames, raises an issue: should it return
+Function :func:`os.listdir`, which returns filenames, raises an issue: should it return
 the Unicode version of filenames, or should it return byte strings containing
 the encoded versions?  :func:`os.listdir` will do both, depending on whether you
 provided the directory path as a byte string or a Unicode string.  If you pass a
@@ -569,14 +569,6 @@
 two different kinds of strings.  There is no automatic encoding or decoding if
 you do e.g. ``str + bytes``, a :exc:`TypeError` is raised for this expression.
 
-It's easy to miss such problems if you only test your software with data that
-doesn't contain any accents; everything will seem to work, but there's actually
-a bug in your program waiting for the first user who attempts to use characters
-> 127.  A second tip, therefore, is:
-
-    Include characters > 127 and, even better, characters > 255 in your test
-    data.
-
 When using data coming from a web browser or some other untrusted source, a
 common technique is to check for illegal characters in a string before using the
 string in a generated command line or storing it in a database.  If you're doing
@@ -594,8 +586,8 @@
         if '/' in filename:
             raise ValueError("'/' not allowed in filenames")
         unicode_name = filename.decode(encoding)
-        f = open(unicode_name, 'r')
-        # ... return contents of file ...
+        with open(unicode_name, 'r') as f:
+            # ... return contents of file ...
 
 However, if an attacker could specify the ``'base64'`` encoding, they could pass
 ``'L2V0Yy9wYXNzd2Q='``, which is the base-64 encoded form of the string
@@ -610,27 +602,30 @@
 Applications in Python" are available at
 <http://downloads.egenix.com/python/LSM2005-Developing-Unicode-aware-applications-in-Python.pdf>
 and discuss questions of character encodings as well as how to internationalize
-and localize an application.
+and localize an application.  These slides cover Python 2.x only.
 
 
-Revision History and Acknowledgements
-=====================================
+Acknowledgements
+================
 
 Thanks to the following people who have noted errors or offered suggestions on
 this article: Nicholas Bastin, Marius Gedminas, Kent Johnson, Ken Krugler,
 Marc-André Lemburg, Martin von Löwis, Chad Whitacre.
 
-Version 1.0: posted August 5 2005.
+.. comment
+   Revision History
+
+   Version 1.0: posted August 5 2005.
 
-Version 1.01: posted August 7 2005.  Corrects factual and markup errors; adds
-several links.
+   Version 1.01: posted August 7 2005.  Corrects factual and markup errors; adds
+   several links.
 
-Version 1.02: posted August 16 2005.  Corrects factual errors.
+   Version 1.02: posted August 16 2005.  Corrects factual errors.
 
-Version 1.1: Feb-Nov 2008.  Updates the document with respect to Python 3 changes.
+   Version 1.1: Feb-Nov 2008.  Updates the document with respect to Python 3 changes.
 
-Version 1.11: posted June 20 2010.  Notes that Python 3.x is not covered,
-and that the HOWTO only covers 2.x.
+   Version 1.11: posted June 20 2010.  Notes that Python 3.x is not covered,
+   and that the HOWTO only covers 2.x.
 
 .. comment Describe Python 3.x support (new section? new document?)
 .. comment Additional topic: building Python w/ UCS2 or UCS4 support

Modified: python/branches/py3k-cdecimal/Doc/includes/email-mime.py
==============================================================================
--- python/branches/py3k-cdecimal/Doc/includes/email-mime.py	(original)
+++ python/branches/py3k-cdecimal/Doc/includes/email-mime.py	Mon Nov 22 12:00:42 2010
@@ -27,5 +27,5 @@
 
 # Send the email via our own SMTP server.
 s = smtplib.SMTP()
-s.sendmail(msg)
+s.send_message(msg)
 s.quit()

Modified: python/branches/py3k-cdecimal/Doc/includes/mp_newtype.py
==============================================================================
--- python/branches/py3k-cdecimal/Doc/includes/mp_newtype.py	(original)
+++ python/branches/py3k-cdecimal/Doc/includes/mp_newtype.py	Mon Nov 22 12:00:42 2010
@@ -12,7 +12,7 @@
 
 ##
 
-class Foo(object):
+class Foo:
     def f(self):
         print('you called Foo.f()')
     def g(self):

Modified: python/branches/py3k-cdecimal/Doc/includes/sqlite3/adapter_point_1.py
==============================================================================
--- python/branches/py3k-cdecimal/Doc/includes/sqlite3/adapter_point_1.py	(original)
+++ python/branches/py3k-cdecimal/Doc/includes/sqlite3/adapter_point_1.py	Mon Nov 22 12:00:42 2010
@@ -1,6 +1,6 @@
 import sqlite3
 
-class Point(object):
+class Point:
     def __init__(self, x, y):
         self.x, self.y = x, y
 

Modified: python/branches/py3k-cdecimal/Doc/includes/sqlite3/adapter_point_2.py
==============================================================================
--- python/branches/py3k-cdecimal/Doc/includes/sqlite3/adapter_point_2.py	(original)
+++ python/branches/py3k-cdecimal/Doc/includes/sqlite3/adapter_point_2.py	Mon Nov 22 12:00:42 2010
@@ -1,6 +1,6 @@
 import sqlite3
 
-class Point(object):
+class Point:
     def __init__(self, x, y):
         self.x, self.y = x, y
 

Modified: python/branches/py3k-cdecimal/Doc/includes/sqlite3/converter_point.py
==============================================================================
--- python/branches/py3k-cdecimal/Doc/includes/sqlite3/converter_point.py	(original)
+++ python/branches/py3k-cdecimal/Doc/includes/sqlite3/converter_point.py	Mon Nov 22 12:00:42 2010
@@ -1,6 +1,6 @@
 import sqlite3
 
-class Point(object):
+class Point:
     def __init__(self, x, y):
         self.x, self.y = x, y
 

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	Mon Nov 22 12:00:42 2010
@@ -1312,7 +1312,7 @@
 that is normally used.  This can be achieved by specifying the ``namespace=``
 keyword argument::
 
-   >>> class C(object):
+   >>> class C:
    ...     pass
    ...
    >>> c = C()

Modified: python/branches/py3k-cdecimal/Doc/library/calendar.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/calendar.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/calendar.rst	Mon Nov 22 12:00:42 2010
@@ -16,7 +16,7 @@
 functionality, see also the :mod:`datetime` and :mod:`time` modules.
 
 Most of these functions and classes rely on the :mod:`datetime` module which
-uses an idealized calendar, the current Gregorian calendar indefinitely extended
+uses an idealized calendar, the current Gregorian calendar extended
 in both directions.  This matches the definition of the "proleptic Gregorian"
 calendar in Dershowitz and Reingold's book "Calendrical Calculations", where
 it's the base calendar for all computations.

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	Mon Nov 22 12:00:42 2010
@@ -788,7 +788,7 @@
 
 Strings are stored internally as sequences of codepoints (to be precise
 as :c:type:`Py_UNICODE` arrays). Depending on the way Python is compiled (either
-via :option:`--without-wide-unicode` or :option:`--with-wide-unicode`, with the
+via ``--without-wide-unicode`` or ``--with-wide-unicode``, with the
 former being the default) :c:type:`Py_UNICODE` is either a 16-bit or 32-bit data
 type. Once a string object is used outside of CPU and memory, CPU endianness
 and how these arrays are stored as bytes become an issue.  Transforming a

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	Mon Nov 22 12:00:42 2010
@@ -586,11 +586,15 @@
    .. versionchanged:: 3.1
       Added support for *rename*.
 
-Example:
 
 .. doctest::
    :options: +NORMALIZE_WHITESPACE
 
+   >>> # Basic example
+   >>> Point = namedtuple('Point', 'x y')
+   >>> p = Point(x=10, y=11)
+
+   >>> # Example using the verbose option to print the class definition
    >>> Point = namedtuple('Point', 'x y', verbose=True)
    class Point(tuple):
            'Point(x, y)'

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	Mon Nov 22 12:00:42 2010
@@ -10,16 +10,53 @@
 allowing users without permission to write to the libraries to take advantage of
 cached byte-code files.
 
-This module may also be used as a script (using the :option:`-m` Python flag) to
-compile Python sources.  Directories to recursively traverse (passing
-:option:`-l` stops the recursive behavior) for sources are listed on the command
-line.  If no arguments are given, the invocation is equivalent to ``-l
-sys.path``.  Printing lists of the files compiled can be disabled with the
-:option:`-q` flag.  In addition, the :option:`-x` option takes a regular
-expression argument.  All files that match the expression will be skipped.
-The :option:`-b` flag may be given to write legacy ``.pyc`` file path names,
-otherwise :pep:`3147` style byte-compiled path names are written.
 
+Command-line use
+----------------
+
+This module can work as a script (using :program:`python -m compileall`) to
+compile Python sources.
+
+.. program:: compileall
+
+.. cmdoption:: [directory|file]...
+
+   Positional arguments are files to compile or directories that contain
+   source files, traversed recursively.  If no argument is given, behave as if
+   the command line was ``-l <directories from sys.path>``.
+
+.. cmdoption:: -l
+
+   Do not recurse.
+
+.. cmdoption:: -f
+
+   Force rebuild even if timestamps are up-to-date.
+
+.. cmdoption:: -q
+
+   Do not print the list of files compiled.
+
+.. cmdoption:: -d destdir
+
+   Purported directory name for error messages.
+
+.. cmdoption:: -x regex
+
+   Skip files with a full path that matches given regular expression.
+
+.. cmdoption:: -i list
+
+   Expand list with its content (file and directory names).
+
+.. cmdoption:: -b
+
+   Write legacy ``.pyc`` file path names.  Default is to write :pep:`3147`-style
+   byte-compiled path names.
+
+
+Public functions
+----------------
 
 .. function:: compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, quiet=False, legacy=False)
 
@@ -37,7 +74,7 @@
    operation.
 
    If *legacy* is true, old-style ``.pyc`` file path names are written,
-   otherwise (the default), :pep:`3147` style path names are written.
+   otherwise (the default), :pep:`3147`-style path names are written.
 
 
 .. function:: compile_path(skip_curdir=True, maxlevels=0, force=False, legacy=False)
@@ -64,4 +101,3 @@
 
    Module :mod:`py_compile`
       Byte-compile a single source file.
-

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	Mon Nov 22 12:00:42 2010
@@ -333,10 +333,6 @@
 
 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.
-One difference is the explicit lack of support for the ``'__name__'`` special
-key.  This is because the existing behavior of ``'__name__'`` is very
-inconsistent and supporting it would only lead to problems.  Details `here
-<http://mail.python.org/pipermail/python-dev/2010-July/102556.html>`_.
 
 
 Customizing Parser Behaviour
@@ -947,8 +943,7 @@
    need interpolation.
 
    The values in *defaults* must be appropriate for the ``%()s`` string
-   interpolation.  Note that ``'__name__'`` is an intrinsic default; its value
-   is the section name, and will override any value provided in *defaults*.
+   interpolation.
 
    All option names used in interpolation will be passed through the
    :meth:`optionxform` method just like any other option name reference.  For

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	Mon Nov 22 12:00:42 2010
@@ -369,7 +369,7 @@
 :attr:`_as_parameter_` attribute and uses this as the function argument.  Of
 course, it must be one of integer, string, or bytes::
 
-   >>> class Bottles(object):
+   >>> class Bottles:
    ...     def __init__(self, number):
    ...         self._as_parameter_ = number
    ...

Modified: python/branches/py3k-cdecimal/Doc/library/decimal.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/decimal.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/decimal.rst	Mon Nov 22 12:00:42 2010
@@ -1717,6 +1717,9 @@
    def cos(x):
        """Return the cosine of x as measured in radians.
 
+       The Taylor series approximation works best for a small value of x.
+       For larger values, first compute x = x % (2 * pi).
+
        >>> print(cos(Decimal('0.5')))
        0.8775825618903727161162815826
        >>> print(cos(0.5))
@@ -1740,6 +1743,9 @@
    def sin(x):
        """Return the sine of x as measured in radians.
 
+       The Taylor series approximation works best for a small value of x.
+       For larger values, first compute x = x % (2 * pi).
+
        >>> print(sin(Decimal('0.5')))
        0.4794255386042030002732879352
        >>> print(sin(0.5))

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	Mon Nov 22 12:00:42 2010
@@ -88,7 +88,7 @@
    $
 
 There's no output!  That's normal, and it means all the examples worked.  Pass
-:option:`-v` to the script, and :mod:`doctest` prints a detailed log of what
+``-v`` to the script, and :mod:`doctest` prints a detailed log of what
 it's trying, and prints a summary at the end::
 
    $ python example.py -v
@@ -151,7 +151,7 @@
 final line of output is ``***Test Failed*** N failures.``, where *N* is the
 number of examples that failed.
 
-Run it with the :option:`-v` switch instead::
+Run it with the ``-v`` switch instead::
 
    python M.py -v
 
@@ -160,7 +160,7 @@
 
 You can force verbose mode by passing ``verbose=True`` to :func:`testmod`, or
 prohibit it by passing ``verbose=False``.  In either of those cases,
-``sys.argv`` is not examined by :func:`testmod` (so passing :option:`-v` or not
+``sys.argv`` is not examined by :func:`testmod` (so passing ``-v`` or not
 has no effect).
 
 There is also a command line shortcut for running :func:`testmod`.  You can
@@ -229,7 +229,7 @@
 that can be used to tell it to look for files in other locations.
 
 Like :func:`testmod`, :func:`testfile`'s verbosity can be set with the
-:option:`-v` command-line switch or with the optional keyword argument
+``-v`` command-line switch or with the optional keyword argument
 *verbose*.
 
 There is also a command line shortcut for running :func:`testfile`.  You can
@@ -1377,7 +1377,7 @@
    verbosity.  If *verbose* is ``True``, then information is printed about each
    example, as it is run.  If *verbose* is ``False``, then only failures are
    printed.  If *verbose* is unspecified, or ``None``, then verbose output is used
-   iff the command-line switch :option:`-v` is used.
+   iff the command-line switch ``-v`` is used.
 
    The optional keyword argument *optionflags* can be used to control how the test
    runner compares expected output to actual output, and how it displays failures.

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	Mon Nov 22 12:00:42 2010
@@ -120,7 +120,7 @@
 
    Raised when a floating point operation fails.  This exception is always defined,
    but can only be raised when Python is configured with the
-   :option:`--with-fpectl` option, or the :const:`WANT_SIGFPE_HANDLER` symbol is
+   ``--with-fpectl`` option, or the :const:`WANT_SIGFPE_HANDLER` symbol is
    defined in the :file:`pyconfig.h` file.
 
 

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	Mon Nov 22 12:00:42 2010
@@ -70,7 +70,7 @@
    Return a new array of bytes.  The :class:`bytearray` type is a mutable
    sequence of integers in the range 0 <= x < 256.  It has most of the usual
    methods of mutable sequences, described in :ref:`typesseq-mutable`, as well
-   as most methods that the :class:`str` type has, see :ref:`bytes-methods`.
+   as most methods that the :class:`bytes` type has, see :ref:`bytes-methods`.
 
    The optional *source* parameter can be used to initialize the array in a few
    different ways:
@@ -105,11 +105,15 @@
 
 .. function:: chr(i)
 
-   Return the string of one character whose Unicode codepoint is the integer
+   Return the string representing a character whose Unicode codepoint is the integer
    *i*.  For example, ``chr(97)`` returns the string ``'a'``. This is the
-   inverse of :func:`ord`.  The valid range for the argument depends how Python
-   was configured -- it may be either UCS2 [0..0xFFFF] or UCS4 [0..0x10FFFF].
-   :exc:`ValueError` will be raised if *i* is outside that range.
+   inverse of :func:`ord`.  The valid range for the argument is from 0 through
+   1,114,111 (0x10FFFF in base 16).  :exc:`ValueError` will be raised if *i* is
+   outside that range.
+
+   Note that on narrow Unicode builds, the result is a string of
+   length two for *i* greater than 65,535 (0xFFFF in hexadecimal).
+
 
 
 .. function:: classmethod(function)
@@ -255,7 +259,7 @@
       ['Struct', '__builtins__', '__doc__', '__file__', '__name__',
        '__package__', '_clearcache', 'calcsize', 'error', 'pack', 'pack_into',
        'unpack', 'unpack_from']
-      >>> class Foo(object):
+      >>> class Foo:
       ...     def __dir__(self):
       ...         return ["kan", "ga", "roo"]
       ...
@@ -395,26 +399,54 @@
 
 .. function:: float([x])
 
-   Convert a string or a number to floating point.  If the argument is a string,
-   it must contain a possibly signed decimal or floating point number, possibly
-   embedded in whitespace. The argument may also be ``'[+|-]nan'`` or
-   ``'[+|-]inf'``.  Otherwise, the argument may be an integer or a floating
-   point number, and a floating point number with the same value (within
-   Python's floating point precision) is returned.  If no argument is given,
-   ``0.0`` is returned.
+   .. index::
+      single: NaN
+      single: Infinity
 
-   .. note::
+   Convert a string or a number to floating point.
 
-      .. index::
-         single: NaN
-         single: Infinity
-
-      When passing in a string, values for NaN and Infinity may be returned,
-      depending on the underlying C library.  Float accepts the strings
-      ``'nan'``, ``'inf'`` and ``'-inf'`` for NaN and positive or negative
-      infinity.  The case and a leading + are ignored as well as a leading - is
-      ignored for NaN.  Float always represents NaN and infinity as ``nan``,
-      ``inf`` or ``-inf``.
+   If the argument is a string, it should contain a decimal number, optionally
+   preceded by a sign, and optionally embedded in whitespace.  The optional
+   sign may be ``'+'`` or ``'-'``; a ``'+'`` sign has no effect on the value
+   produced.  The argument may also be a string representing a NaN
+   (not-a-number), or a positive or negative infinity.  More precisely, the
+   input must conform to the following grammar after leading and trailing
+   whitespace characters are removed:
+
+   .. productionlist::
+      sign: "+" | "-"
+      infinity: "Infinity" | "inf"
+      nan: "nan"
+      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,
+   "inf", "Inf", "INFINITY" and "iNfINity" are all acceptable spellings for
+   positive infinity.
+
+   Otherwise, if the argument is an integer or a floating point number, a
+   floating point number with the same value (within Python's floating point
+   precision) is returned.  If the argument is outside the range of a Python
+   float, an :exc:`OverflowError` will be raised.
+
+   For a general Python object ``x``, ``float(x)`` delegates to
+   ``x.__float__()``.
+
+   If no argument is given, ``0.0`` is returned.
+
+   Examples::
+
+      >>> float('+1.23')
+      1.23
+      >>> float('   -12345\n')
+      -12345.0
+      >>> float('1e-003')
+      0.001
+      >>> float('+1E6')
+      1000000.0
+      >>> float('-Infinity')
+      -inf
 
    The float type is described in :ref:`typesnumeric`.
 
@@ -822,14 +854,14 @@
 .. XXX works for bytes too, but should it?
 .. function:: ord(c)
 
-   Given a string of length one, return an integer representing the Unicode code
-   point of the character.  For example, ``ord('a')`` returns the integer ``97``
+   Given a string representing one Uncicode character, return an integer
+   representing the Unicode code
+   point of that character.  For example, ``ord('a')`` returns the integer ``97``
    and ``ord('\u2020')`` returns ``8224``.  This is the inverse of :func:`chr`.
 
-   If the argument length is not one, a :exc:`TypeError` will be raised.  (If
-   Python was built with UCS2 Unicode, then the character's code point must be
-   in the range [0..65535] inclusive; otherwise the string length is two!)
-
+   On wide Unicode builds, if the argument length is not one, a
+   :exc:`TypeError` will be raised.  On narrow Unicode builds, strings
+   of length two are accepted when they form a UTF-16 surrogate pair.
 
 .. function:: pow(x, y[, z])
 
@@ -871,7 +903,7 @@
    function for setting, and *fdel* a function for del'ing, an attribute.  Typical
    use is to define a managed attribute ``x``::
 
-      class C(object):
+      class C:
           def __init__(self):
               self._x = None
 
@@ -890,7 +922,7 @@
    property will copy *fget*'s docstring (if it exists).  This makes it possible to
    create read-only properties easily using :func:`property` as a :term:`decorator`::
 
-      class Parrot(object):
+      class Parrot:
           def __init__(self):
               self._voltage = 100000
 
@@ -907,7 +939,7 @@
    corresponding accessor function set to the decorated function.  This is
    best explained with an example::
 
-      class C(object):
+      class C:
           def __init__(self):
               self._x = None
 
@@ -1211,7 +1243,7 @@
    attribute.  For example, the following two statements create identical
    :class:`type` objects:
 
-      >>> class X(object):
+      >>> class X:
       ...     a = 1
       ...
       >>> X = type('X', (object,), dict(a=1))

Modified: python/branches/py3k-cdecimal/Doc/library/getopt.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/getopt.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/getopt.rst	Mon Nov 22 12:00:42 2010
@@ -47,7 +47,7 @@
    empty string.  Long options on the command line can be recognized so long as
    they provide a prefix of the option name that matches exactly one of the
    accepted options.  For example, if *longopts* is ``['foo', 'frob']``, the
-   option :option:`--fo` will match as :option:`--foo`, but :option:`--f` will
+   option ``--fo`` will match as ``--foo``, but ``--f`` will
    not match uniquely, so :exc:`GetoptError` will be raised.
 
    The return value consists of two elements: the first is a list of ``(option,
@@ -68,7 +68,7 @@
    intermixed. The :func:`getopt` function stops processing options as soon as a
    non-option argument is encountered.
 
-   If the first character of the option string is '+', or if the environment
+   If the first character of the option string is ``'+'``, or if the environment
    variable :envvar:`POSIXLY_CORRECT` is set, then option processing stops as
    soon as a non-option argument is encountered.
 

Modified: python/branches/py3k-cdecimal/Doc/library/http.server.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/http.server.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/http.server.rst	Mon Nov 22 12:00:42 2010
@@ -182,22 +182,29 @@
 
    .. method:: send_header(keyword, value)
 
-      Writes a specific HTTP header to the output stream. *keyword* should
-      specify the header keyword, with *value* specifying its value.
+      Stores the HTTP header to an internal buffer which will be written to the
+      output stream when :meth:`end_headers` method is invoked.
+      *keyword* should specify the header keyword, with *value*
+      specifying its value.
+
+      .. versionchanged:: 3.2 Storing the headers in an internal buffer
+
 
    .. method:: send_response_only(code, message=None)
 
       Sends the reponse header only, used for the purposes when ``100
-      Continue`` response is sent by the server to the client. If the *message*
-      is not specified, the HTTP message corresponding the response *code*  is
-      sent.
+      Continue`` response is sent by the server to the client. The headers not
+      buffered and sent directly the output stream.If the *message* is not
+      specified, the HTTP message corresponding the response *code*  is sent.
 
       .. versionadded:: 3.2
 
    .. method:: end_headers()
 
-      Sends a blank line, indicating the end of the HTTP headers in the
-      response.
+      Write the buffered HTTP headers to the output stream and send a blank
+      line, indicating the end of the HTTP headers in the response.
+
+      .. versionchanged:: 3.2 Writing the buffered headers to the output stream.
 
    .. method:: log_request(code='-', size='-')
 

Modified: python/branches/py3k-cdecimal/Doc/library/idle.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/idle.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/idle.rst	Mon Nov 22 12:00:42 2010
@@ -286,13 +286,13 @@
 
 If there are arguments:
 
-#. If :option:`-e` is used, arguments are files opened for editing and
+#. If ``-e`` is used, arguments are files opened for editing and
    ``sys.argv`` reflects the arguments passed to IDLE itself.
 
-#. Otherwise, if :option:`-c` is used, all arguments are placed in
+#. Otherwise, if ``-c`` is used, all arguments are placed in
    ``sys.argv[1:...]``, with ``sys.argv[0]`` set to ``'-c'``.
 
-#. Otherwise, if neither :option:`-e` nor :option:`-c` is used, the first
+#. Otherwise, if neither ``-e`` nor ``-c`` is used, the first
    argument is a script which is executed with the remaining arguments in
    ``sys.argv[1:...]``  and ``sys.argv[0]`` set to the script name.  If the script
    name is '-', no script is executed but an interactive Python session is started;

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	Mon Nov 22 12:00:42 2010
@@ -563,3 +563,84 @@
    entry in the list represents the caller; the last entry represents where the
    exception was raised.
 
+
+Fetching attributes statically
+------------------------------
+
+Both :func:`getattr` and :func:`hasattr` can trigger code execution when
+fetching or checking for the existence of attributes. Descriptors, like
+properties, will be invoked and :meth:`__getattr__` and :meth:`__getattribute__`
+may be called.
+
+For cases where you want passive introspection, like documentation tools, this
+can be inconvenient. `getattr_static` has the same signature as :func:`getattr`
+but avoids executing code when it fetches attributes.
+
+.. function:: getattr_static(obj, attr, default=None)
+
+   Retrieve attributes without triggering dynamic lookup via the
+   descriptor protocol, `__getattr__` or `__getattribute__`.
+
+   Note: this function may not be able to retrieve all attributes
+   that getattr can fetch (like dynamically created attributes)
+   and may find attributes that getattr can't (like descriptors
+   that raise AttributeError). It can also return descriptors objects
+   instead of instance members.
+
+   .. versionadded:: 3.2
+
+The only known case that can cause `getattr_static` to trigger code execution,
+and cause it to return incorrect results (or even break), is where a class uses
+:data:`~object.__slots__` and provides a `__dict__` member using a property or
+descriptor. If you find other cases please report them so they can be fixed
+or documented.
+
+`getattr_static` does not resolve descriptors, for example slot descriptors or
+getset descriptors on objects implemented in C. The descriptor object
+is returned instead of the underlying attribute.
+
+You can handle these with code like the following. Note that
+for arbitrary getset descriptors invoking these may trigger
+code execution::
+
+   # example code for resolving the builtin descriptor types
+   class _foo:
+       __slots__ = ['foo']
+
+   slot_descriptor = type(_foo.foo)
+   getset_descriptor = type(type(open(__file__)).name)
+   wrapper_descriptor = type(str.__dict__['__add__'])
+   descriptor_types = (slot_descriptor, getset_descriptor, wrapper_descriptor)
+
+   result = getattr_static(some_object, 'foo')
+   if type(result) in descriptor_types:
+       try:
+           result = result.__get__()
+       except AttributeError:
+           # descriptors can raise AttributeError to
+           # indicate there is no underlying value
+           # in which case the descriptor itself will
+           # have to do
+           pass
+
+
+Current State of a Generator
+----------------------------
+
+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
+generator to be determined easily.
+
+.. function:: getgeneratorstate(generator)
+
+    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.
+
+   .. versionadded:: 3.2

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	Mon Nov 22 12:00:42 2010
@@ -322,7 +322,7 @@
 
    :func:`groupby` is equivalent to::
 
-      class groupby(object):
+      class groupby:
           # [k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B
           # [list(g) for k, g in groupby('AAAABBBCCD')] --> AAAA BBB CC D
           def __init__(self, iterable, key=None):

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	Mon Nov 22 12:00:42 2010
@@ -1334,7 +1334,7 @@
 
    from multiprocessing.managers import BaseManager
 
-   class MathsClass(object):
+   class MathsClass:
        def add(self, x, y):
            return x + y
        def mul(self, x, y):

Modified: python/branches/py3k-cdecimal/Doc/library/optparse.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/optparse.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/optparse.rst	Mon Nov 22 12:00:42 2010
@@ -104,26 +104,26 @@
    an argument used to supply extra information to guide or customize the
    execution of a program.  There are many different syntaxes for options; the
    traditional Unix syntax is a hyphen ("-") followed by a single letter,
-   e.g. ``"-x"`` or ``"-F"``.  Also, traditional Unix syntax allows multiple
-   options to be merged into a single argument, e.g.  ``"-x -F"`` is equivalent
-   to ``"-xF"``.  The GNU project introduced ``"--"`` followed by a series of
-   hyphen-separated words, e.g.  ``"--file"`` or ``"--dry-run"``.  These are the
+   e.g. ``-x`` or ``-F``.  Also, traditional Unix syntax allows multiple
+   options to be merged into a single argument, e.g. ``-x -F`` is equivalent
+   to ``-xF``.  The GNU project introduced ``--`` followed by a series of
+   hyphen-separated words, e.g. ``--file`` or ``--dry-run``.  These are the
    only two option syntaxes provided by :mod:`optparse`.
 
    Some other option syntaxes that the world has seen include:
 
-   * a hyphen followed by a few letters, e.g. ``"-pf"`` (this is *not* the same
+   * a hyphen followed by a few letters, e.g. ``-pf`` (this is *not* the same
      as multiple options merged into a single argument)
 
-   * a hyphen followed by a whole word, e.g. ``"-file"`` (this is technically
+   * a hyphen followed by a whole word, e.g. ``-file`` (this is technically
      equivalent to the previous syntax, but they aren't usually seen in the same
      program)
 
    * a plus sign followed by a single letter, or a few letters, or a word, e.g.
-     ``"+f"``, ``"+rgb"``
+     ``+f``, ``+rgb``
 
-   * a slash followed by a letter, or a few letters, or a word, e.g. ``"/f"``,
-     ``"/file"``
+   * a slash followed by a letter, or a few letters, or a word, e.g. ``/f``,
+     ``/file``
 
    These option syntaxes are not supported by :mod:`optparse`, and they never
    will be.  This is deliberate: the first three are non-standard on any
@@ -151,9 +151,9 @@
    Typically, a given option either takes an argument or it doesn't. Lots of
    people want an "optional option arguments" feature, meaning that some options
    will take an argument if they see it, and won't if they don't.  This is
-   somewhat controversial, because it makes parsing ambiguous: if ``"-a"`` takes
-   an optional argument and ``"-b"`` is another option entirely, how do we
-   interpret ``"-ab"``?  Because of this ambiguity, :mod:`optparse` does not
+   somewhat controversial, because it makes parsing ambiguous: if ``-a`` takes
+   an optional argument and ``-b`` is another option entirely, how do we
+   interpret ``-ab``?  Because of this ambiguity, :mod:`optparse` does not
    support this feature.
 
 positional argument
@@ -171,9 +171,9 @@
 
    prog -v --report /tmp/report.txt foo bar
 
-``"-v"`` and ``"--report"`` are both options.  Assuming that :option:`--report`
-takes one argument, ``"/tmp/report.txt"`` is an option argument.  ``"foo"`` and
-``"bar"`` are positional arguments.
+``-v`` and ``--report`` are both options.  Assuming that ``--report``
+takes one argument, ``/tmp/report.txt`` is an option argument.  ``foo`` and
+``bar`` are positional arguments.
 
 
 .. _optparse-what-options-for:
@@ -258,7 +258,7 @@
    parser.add_option(opt_str, ...,
                      attr=value, ...)
 
-Each option has one or more option strings, such as ``"-f"`` or ``"--file"``,
+Each option has one or more option strings, such as ``-f`` or ``--file``,
 and several option attributes that tell :mod:`optparse` what to expect and what
 to do when it encounters that option on the command line.
 
@@ -287,7 +287,7 @@
 :meth:`parse_args` returns two values:
 
 * ``options``, an object containing values for all of your options---e.g. if
-  ``"--file"`` takes a single string argument, then ``options.file`` will be the
+  ``--file`` takes a single string argument, then ``options.file`` will be the
   filename supplied by the user, or ``None`` if the user did not supply that
   option
 
@@ -333,8 +333,8 @@
    args = ["-f", "foo.txt"]
    (options, args) = parser.parse_args(args)
 
-When :mod:`optparse` sees the option string ``"-f"``, it consumes the next
-argument, ``"foo.txt"``, and stores it in ``options.filename``.  So, after this
+When :mod:`optparse` sees the option string ``-f``, it consumes the next
+argument, ``foo.txt``, and stores it in ``options.filename``.  So, after this
 call to :meth:`parse_args`, ``options.filename`` is ``"foo.txt"``.
 
 Some other option types supported by :mod:`optparse` are ``int`` and ``float``.
@@ -346,13 +346,13 @@
 Also, there's no explicit action, since the default is ``store``.
 
 Let's parse another fake command-line.  This time, we'll jam the option argument
-right up against the option: since ``"-n42"`` (one argument) is equivalent to
-``"-n 42"`` (two arguments), the code ::
+right up against the option: since ``-n42`` (one argument) is equivalent to
+``-n 42`` (two arguments), the code ::
 
    (options, args) = parser.parse_args(["-n42"])
    print(options.num)
 
-will print ``"42"``.
+will print ``42``.
 
 If you don't specify a type, :mod:`optparse` assumes ``string``.  Combined with
 the fact that the default action is ``store``, that means our first example can
@@ -362,9 +362,9 @@
 
 If you don't supply a destination, :mod:`optparse` figures out a sensible
 default from the option strings: if the first long option string is
-``"--foo-bar"``, then the default destination is ``foo_bar``.  If there are no
+``--foo-bar``, then the default destination is ``foo_bar``.  If there are no
 long option strings, :mod:`optparse` looks at the first short option string: the
-default destination for ``"-f"`` is ``f``.
+default destination for ``-f`` is ``f``.
 
 :mod:`optparse` also includes the built-in ``complex`` type.  Adding
 types is covered in section :ref:`optparse-extending-optparse`.
@@ -378,7 +378,7 @@
 Flag options---set a variable to true or false when a particular option is seen
 ---are quite common.  :mod:`optparse` supports them with two separate actions,
 ``store_true`` and ``store_false``.  For example, you might have a ``verbose``
-flag that is turned on with ``"-v"`` and off with ``"-q"``::
+flag that is turned on with ``-v`` and off with ``-q``::
 
    parser.add_option("-v", action="store_true", dest="verbose")
    parser.add_option("-q", action="store_false", dest="verbose")
@@ -387,8 +387,8 @@
 OK.  (It just means you have to be a bit careful when setting default values---
 see below.)
 
-When :mod:`optparse` encounters ``"-v"`` on the command line, it sets
-``options.verbose`` to ``True``; when it encounters ``"-q"``,
+When :mod:`optparse` encounters ``-v`` on the command line, it sets
+``options.verbose`` to ``True``; when it encounters ``-q``,
 ``options.verbose`` is set to ``False``.
 
 
@@ -428,7 +428,7 @@
 command line is parsed.
 
 First, consider the verbose/quiet example.  If we want :mod:`optparse` to set
-``verbose`` to ``True`` unless ``"-q"`` is seen, then we can do this::
+``verbose`` to ``True`` unless ``-q`` is seen, then we can do this::
 
    parser.add_option("-v", action="store_true", dest="verbose", default=True)
    parser.add_option("-q", action="store_false", dest="verbose")
@@ -486,7 +486,7 @@
                      help="interaction mode: novice, intermediate, "
                           "or expert [default: %default]")
 
-If :mod:`optparse` encounters either ``"-h"`` or ``"--help"`` on the
+If :mod:`optparse` encounters either ``-h`` or ``--help`` on the
 command-line, or if you just call :meth:`parser.print_help`, it prints the
 following to standard output:
 
@@ -513,7 +513,7 @@
 
      usage = "usage: %prog [options] arg1 arg2"
 
-  :mod:`optparse` expands ``"%prog"`` in the usage string to the name of the
+  :mod:`optparse` expands ``%prog`` in the usage string to the name of the
   current program, i.e. ``os.path.basename(sys.argv[0])``.  The expanded string
   is then printed before the detailed option help.
 
@@ -531,17 +531,17 @@
      -m MODE, --mode=MODE
 
   Here, "MODE" is called the meta-variable: it stands for the argument that the
-  user is expected to supply to :option:`-m`/:option:`--mode`.  By default,
+  user is expected to supply to ``-m``/``--mode``.  By default,
   :mod:`optparse` converts the destination variable name to uppercase and uses
   that for the meta-variable.  Sometimes, that's not what you want---for
-  example, the :option:`--filename` option explicitly sets ``metavar="FILE"``,
+  example, the ``--filename`` option explicitly sets ``metavar="FILE"``,
   resulting in this automatically-generated option description::
 
      -f FILE, --filename=FILE
 
   This is important for more than just saving space, though: the manually
-  written help text uses the meta-variable "FILE" to clue the user in that
-  there's a connection between the semi-formal syntax "-f FILE" and the informal
+  written help text uses the meta-variable ``FILE`` to clue the user in that
+  there's a connection between the semi-formal syntax ``-f FILE`` and the informal
   semantic description "write output to FILE". This is a simple but effective
   way to make your help text a lot clearer and more useful for end users.
 
@@ -593,11 +593,11 @@
 
    parser = OptionParser(usage="%prog [-f] [-q]", version="%prog 1.0")
 
-``"%prog"`` is expanded just like it is in ``usage``.  Apart from that,
+``%prog`` is expanded just like it is in ``usage``.  Apart from that,
 ``version`` can contain anything you like.  When you supply it, :mod:`optparse`
-automatically adds a ``"--version"`` option to your parser. If it encounters
+automatically adds a ``--version`` option to your parser. If it encounters
 this option on the command line, it expands your ``version`` string (by
-replacing ``"%prog"``), prints it to stdout, and exits.
+replacing ``%prog``), prints it to stdout, and exits.
 
 For example, if your script is called ``/usr/bin/foo``::
 
@@ -610,7 +610,7 @@
 
    Print the version message for the current program (``self.version``) to
    *file* (default stdout).  As with :meth:`print_usage`, any occurrence
-   of ``"%prog"`` in ``self.version`` is replaced with the name of the current
+   of ``%prog`` in ``self.version`` is replaced with the name of the current
    program.  Does nothing if ``self.version`` is empty or undefined.
 
 .. method:: OptionParser.get_version()
@@ -633,9 +633,9 @@
 
 Handling user errors is much more important, since they are guaranteed to happen
 no matter how stable your code is.  :mod:`optparse` can automatically detect
-some user errors, such as bad option arguments (passing ``"-n 4x"`` where
-:option:`-n` takes an integer argument), missing arguments (``"-n"`` at the end
-of the command line, where :option:`-n` takes an argument of any type).  Also,
+some user errors, such as bad option arguments (passing ``-n 4x`` where
+``-n`` takes an integer argument), missing arguments (``-n`` at the end
+of the command line, where ``-n`` takes an argument of any type).  Also,
 you can call :func:`OptionParser.error` to signal an application-defined error
 condition::
 
@@ -648,7 +648,7 @@
 program's usage message and an error message to standard error and exits with
 error status 2.
 
-Consider the first example above, where the user passes ``"4x"`` to an option
+Consider the first example above, where the user passes ``4x`` to an option
 that takes an integer::
 
    $ /usr/bin/foo -n 4x
@@ -741,8 +741,8 @@
    ``version`` (default: ``None``)
       A version string to print when the user supplies a version option. If you
       supply a true value for ``version``, :mod:`optparse` automatically adds a
-      version option with the single option string ``"--version"``.  The
-      substring ``"%prog"`` is expanded the same as for ``usage``.
+      version option with the single option string ``--version``.  The
+      substring ``%prog`` is expanded the same as for ``usage``.
 
    ``conflict_handler`` (default: ``"error"``)
       Specifies what to do when options with conflicting option strings are
@@ -761,11 +761,11 @@
       IndentedHelpFormatter and TitledHelpFormatter.
 
    ``add_help_option`` (default: ``True``)
-      If true, :mod:`optparse` will add a help option (with option strings ``"-h"``
-      and ``"--help"``) to the parser.
+      If true, :mod:`optparse` will add a help option (with option strings ``-h``
+      and ``--help``) to the parser.
 
    ``prog``
-      The string to use when expanding ``"%prog"`` in ``usage`` and ``version``
+      The string to use when expanding ``%prog`` in ``usage`` and ``version``
       instead of ``os.path.basename(sys.argv[0])``.
 
    ``epilog`` (default: ``None``)
@@ -809,7 +809,7 @@
 ^^^^^^^^^^^^^^^^
 
 Each Option instance represents a set of synonymous command-line option strings,
-e.g. :option:`-f` and :option:`--file`.  You can specify any number of short or
+e.g. ``-f`` and ``--file``.  You can specify any number of short or
 long option strings, but you must specify at least one overall option string.
 
 The canonical way to create an :class:`Option` instance is with the
@@ -972,7 +972,7 @@
 .. attribute:: Option.help
 
    Help text to print for this option when listing all available options after
-   the user supplies a :attr:`~Option.help` option (such as ``"--help"``).  If
+   the user supplies a :attr:`~Option.help` option (such as ``--help``).  If
    no help text is supplied, the option will be listed without help text.  To
    hide this option, use the special value :data:`optparse.SUPPRESS_HELP`.
 
@@ -1010,9 +1010,9 @@
   If :attr:`~Option.type` is not supplied, it defaults to ``"string"``.
 
   If :attr:`~Option.dest` is not supplied, :mod:`optparse` derives a destination
-  from the first long option string (e.g., ``"--foo-bar"`` implies
+  from the first long option string (e.g., ``--foo-bar`` implies
   ``foo_bar``). If there are no long option strings, :mod:`optparse` derives a
-  destination from the first short option string (e.g., ``"-f"`` implies ``f``).
+  destination from the first short option string (e.g., ``-f`` implies ``f``).
 
   Example::
 
@@ -1043,7 +1043,7 @@
      parser.add_option("--noisy",
                        action="store_const", const=2, dest="verbose")
 
-  If ``"--noisy"`` is seen, :mod:`optparse` will set  ::
+  If ``--noisy`` is seen, :mod:`optparse` will set  ::
 
      options.verbose = 2
 
@@ -1078,13 +1078,13 @@
 
      parser.add_option("-t", "--tracks", action="append", type="int")
 
-  If ``"-t3"`` is seen on the command-line, :mod:`optparse` does the equivalent
+  If ``-t3`` is seen on the command-line, :mod:`optparse` does the equivalent
   of::
 
      options.tracks = []
      options.tracks.append(int("3"))
 
-  If, a little later on, ``"--tracks=4"`` is seen, it does::
+  If, a little later on, ``--tracks=4`` is seen, it does::
 
      options.tracks.append(int("4"))
 
@@ -1106,13 +1106,13 @@
 
      parser.add_option("-v", action="count", dest="verbosity")
 
-  The first time ``"-v"`` is seen on the command line, :mod:`optparse` does the
+  The first time ``-v`` is seen on the command line, :mod:`optparse` does the
   equivalent of::
 
      options.verbosity = 0
      options.verbosity += 1
 
-  Every subsequent occurrence of ``"-v"`` results in  ::
+  Every subsequent occurrence of ``-v`` results in  ::
 
      options.verbosity += 1
 
@@ -1155,7 +1155,7 @@
                        help="Input file to read data from")
      parser.add_option("--secret", help=SUPPRESS_HELP)
 
-  If :mod:`optparse` sees either ``"-h"`` or ``"--help"`` on the command line,
+  If :mod:`optparse` sees either ``-h`` or ``--help`` on the command line,
   it will print something like the following help message to stdout (assuming
   ``sys.argv[0]`` is ``"foo.py"``):
 
@@ -1269,8 +1269,8 @@
 
 .. method:: OptionParser.disable_interspersed_args()
 
-   Set parsing to stop on the first non-option.  For example, if ``"-a"`` and
-   ``"-b"`` are both simple options that take no arguments, :mod:`optparse`
+   Set parsing to stop on the first non-option.  For example, if ``-a`` and
+   ``-b`` are both simple options that take no arguments, :mod:`optparse`
    normally accepts this syntax::
 
       prog -a arg1 -b arg2
@@ -1300,7 +1300,7 @@
 .. method:: OptionParser.has_option(opt_str)
 
    Return true if the OptionParser has an option with option string *opt_str*
-   (e.g., ``"-q"`` or ``"--verbose"``).
+   (e.g., ``-q`` or ``--verbose``).
 
 .. method:: OptionParser.remove_option(opt_str)
 
@@ -1353,9 +1353,9 @@
    parser.add_option("-n", "--noisy", ..., help="be noisy")
 
 At this point, :mod:`optparse` detects that a previously-added option is already
-using the ``"-n"`` option string.  Since ``conflict_handler`` is ``"resolve"``,
-it resolves the situation by removing ``"-n"`` from the earlier option's list of
-option strings.  Now ``"--dry-run"`` is the only way for the user to activate
+using the ``-n`` option string.  Since ``conflict_handler`` is ``"resolve"``,
+it resolves the situation by removing ``-n`` from the earlier option's list of
+option strings.  Now ``--dry-run`` is the only way for the user to activate
 that option.  If the user asks for help, the help message will reflect that::
 
    options:
@@ -1371,7 +1371,7 @@
 
    parser.add_option("--dry-run", ..., help="new dry-run option")
 
-At this point, the original :option:`-n/--dry-run` option is no longer
+At this point, the original ``-n``/``--dry-run`` option is no longer
 accessible, so :mod:`optparse` removes it, leaving this help text::
 
    options:
@@ -1409,7 +1409,7 @@
 .. method:: OptionParser.print_usage(file=None)
 
    Print the usage message for the current program (``self.usage``) to *file*
-   (default stdout).  Any occurrence of the string ``"%prog"`` in ``self.usage``
+   (default stdout).  Any occurrence of the string ``%prog`` in ``self.usage``
    is replaced with the name of the current program.  Does nothing if
    ``self.usage`` is empty or not defined.
 
@@ -1473,9 +1473,9 @@
 
 ``callback`` is a function (or other callable object), so you must have already
 defined ``my_callback()`` when you create this callback option. In this simple
-case, :mod:`optparse` doesn't even know if :option:`-c` takes any arguments,
+case, :mod:`optparse` doesn't even know if ``-c`` takes any arguments,
 which usually means that the option takes no arguments---the mere presence of
-:option:`-c` on the command-line is all it needs to know.  In some
+``-c`` on the command-line is all it needs to know.  In some
 circumstances, though, you might want your callback to consume an arbitrary
 number of command-line arguments.  This is where writing callbacks gets tricky;
 it's covered later in this section.
@@ -1528,8 +1528,8 @@
 ``opt_str``
    is the option string seen on the command-line that's triggering the callback.
    (If an abbreviated long option was used, ``opt_str`` will be the full,
-   canonical option string---e.g. if the user puts ``"--foo"`` on the
-   command-line as an abbreviation for ``"--foobar"``, then ``opt_str`` will be
+   canonical option string---e.g. if the user puts ``--foo`` on the
+   command-line as an abbreviation for ``--foobar``, then ``opt_str`` will be
    ``"--foobar"``.)
 
 ``value``
@@ -1604,8 +1604,8 @@
 Callback example 2: check option order
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-Here's a slightly more interesting example: record the fact that ``"-a"`` is
-seen, but blow up if it comes after ``"-b"`` in the command-line.  ::
+Here's a slightly more interesting example: record the fact that ``-a`` is
+seen, but blow up if it comes after ``-b`` in the command-line.  ::
 
    def check_order(option, opt_str, value, parser):
        if parser.values.b:
@@ -1622,7 +1622,7 @@
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 If you want to re-use this callback for several similar options (set a flag, but
-blow up if ``"-b"`` has already been seen), it needs a bit of work: the error
+blow up if ``-b`` has already been seen), it needs a bit of work: the error
 message and the flag that it sets must be generalized.  ::
 
    def check_order(option, opt_str, value, parser):
@@ -1692,15 +1692,15 @@
 built-in capabilities for it.  And you have to deal with certain intricacies of
 conventional Unix command-line parsing that :mod:`optparse` normally handles for
 you.  In particular, callbacks should implement the conventional rules for bare
-``"--"`` and ``"-"`` arguments:
+``--`` and ``-`` arguments:
 
-* either ``"--"`` or ``"-"`` can be option arguments
+* either ``--`` or ``-`` can be option arguments
 
-* bare ``"--"`` (if not the argument to some option): halt command-line
-  processing and discard the ``"--"``
+* bare ``--`` (if not the argument to some option): halt command-line
+  processing and discard the ``--``
 
-* bare ``"-"`` (if not the argument to some option): halt command-line
-  processing but keep the ``"-"`` (append it to ``parser.largs``)
+* bare ``-`` (if not the argument to some option): halt command-line
+  processing but keep the ``-`` (append it to ``parser.largs``)
 
 If you want an option that takes a variable number of arguments, there are
 several subtle, tricky issues to worry about.  The exact implementation you
@@ -1771,7 +1771,7 @@
       def check_mytype(option, opt, value)
 
    where ``option`` is an :class:`Option` instance, ``opt`` is an option string
-   (e.g., ``"-f"``), and ``value`` is the string from the command line that must
+   (e.g., ``-f``), and ``value`` is the string from the command line that must
    be checked and converted to your desired type.  ``check_mytype()`` should
    return an object of the hypothetical type ``mytype``.  The value returned by
    a type-checking function will wind up in the OptionValues instance returned
@@ -1883,7 +1883,7 @@
 ``"append"`` action, but instead of taking a single value from the command-line
 and appending it to an existing list, ``"extend"`` will take multiple values in
 a single comma-delimited string, and extend an existing list with them.  That
-is, if ``"--names"`` is an ``"extend"`` option of type ``"string"``, the command
+is, if ``--names`` is an ``"extend"`` option of type ``"string"``, the command
 line ::
 
    --names=foo,bar --names blah --names ding,dong

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	Mon Nov 22 12:00:42 2010
@@ -40,25 +40,25 @@
    executed on that occasion.  Use an ``if __name__ == '__main__':`` guard to
    only execute code when a file is invoked as a script and not just imported.
 
-Specifying a :option:`-w` flag before the argument will cause HTML documentation
+Specifying a ``-w`` flag before the argument will cause HTML documentation
 to be written out to a file in the current directory, instead of displaying text
 on the console.
 
-Specifying a :option:`-k` flag before the argument will search the synopsis
+Specifying a ``-k`` flag before the argument will search the synopsis
 lines of all available modules for the keyword given as the argument, again in a
 manner similar to the Unix :program:`man` command.  The synopsis line of a
 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`
-:option:`-p 1234` will start a HTTP server on port 1234, allowing you to browse
+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.
-:program:`pydoc` :option:`-g` will start the server and additionally bring up a
+: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.
 
 When :program:`pydoc` generates documentation, it uses the current environment
-and path to locate modules.  Thus, invoking :program:`pydoc` :option:`spam`
+and path to locate modules.  Thus, invoking :program:`pydoc spam`
 documents precisely the version of the module you would get if you started the
 Python interpreter and typed ``import spam``.
 

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	Mon Nov 22 12:00:42 2010
@@ -710,7 +710,7 @@
 This is a good approach if you write the class yourself. Let's suppose you have
 a class like this::
 
-   class Point(object):
+   class Point:
        def __init__(self, x, y):
            self.x, self.y = x, y
 

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	Mon Nov 22 12:00:42 2010
@@ -846,7 +846,7 @@
 
 This table lists the sequence operations sorted in ascending priority
 (operations in the same box have the same priority).  In the table, *s* and *t*
-are sequences of the same type; *n*, *i* and *j* are integers:
+are sequences of the same type; *n*, *i*, *j* and *k* are integers.
 
 +------------------+--------------------------------+----------+
 | Operation        | Result                         | Notes    |
@@ -876,6 +876,12 @@
 +------------------+--------------------------------+----------+
 | ``max(s)``       | largest item of *s*            |          |
 +------------------+--------------------------------+----------+
+| ``s.index(i)``   | index of the first occurence   |          |
+|                  | of *i* in *s*                  |          |
++------------------+--------------------------------+----------+
+| ``s.count(i)``   | total number of occurences of  |          |
+|                  | *i* in *s*                     |          |
++------------------+--------------------------------+----------+
 
 Sequence types also support comparisons.  In particular, tuples and lists are
 compared lexicographically by comparing corresponding elements.  This means that
@@ -1575,16 +1581,14 @@
 The :class:`range` type is an immutable sequence which is commonly used for
 looping.  The advantage of the :class:`range` type is that an :class:`range`
 object will always take the same amount of memory, no matter the size of the
-range it represents.  There are no consistent performance advantages.
+range it represents.
 
-Range objects have relatively little behavior: they support indexing,
-iteration, the :func:`len` function, and the following methods.
+Range objects have relatively little behavior: they support indexing, contains,
+iteration, the :func:`len` function, and the following methods:
 
 .. method:: range.count(x)
 
-   Return the number of *i*'s for which ``s[i] == x``.  Normally the
-   result will be 0 or 1, but it could be greater if *x* defines an
-   unusual equality function.
+   Return the number of *i*'s for which ``s[i] == x``.
 
     .. versionadded:: 3.2
 

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	Mon Nov 22 12:00:42 2010
@@ -169,7 +169,7 @@
 
    A string giving the site-specific directory prefix where the platform-dependent
    Python files are installed; by default, this is also ``'/usr/local'``.  This can
-   be set at build time with the :option:`--exec-prefix` argument to the
+   be set at build time with the ``--exec-prefix`` argument to the
    :program:`configure` script.  Specifically, all configuration files (e.g. the
    :file:`pyconfig.h` header file) are installed in the directory ``exec_prefix +
    '/lib/pythonversion/config'``, and shared library modules are installed in
@@ -685,7 +685,7 @@
 
    A string giving the site-specific directory prefix where the platform
    independent Python files are installed; by default, this is the string
-   ``'/usr/local'``.  This can be set at build time with the :option:`--prefix`
+   ``'/usr/local'``.  This can be set at build time with the ``--prefix``
    argument to the :program:`configure` script.  The main collection of Python
    library modules is installed in the directory ``prefix + '/lib/pythonversion'``
    while the platform independent header files (all except :file:`pyconfig.h`) are
@@ -862,7 +862,7 @@
 
    Activate dumping of VM measurements using the Pentium timestamp counter, if
    *on_flag* is true. Deactivate these dumps if *on_flag* is off. The function is
-   available only if Python was compiled with :option:`--with-tsc`. To understand
+   available only if Python was compiled with ``--with-tsc``. To understand
    the output of this dump, read :file:`Python/ceval.c` in the Python sources.
 
    .. impl-detail::

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	Mon Nov 22 12:00:42 2010
@@ -163,24 +163,23 @@
 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` :option:`test_spam.py`) will minimize output and only print
+regrtest.py test_spam.py`) 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
-tests to use to be set. You do this by using the :option:`-u` command-line
-option. Run :program:`python regrtest.py` :option:`-uall` to turn on all
-resources; specifying :option:`all` as an option for :option:`-u` enables all
+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
+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
-:option:`all`. The command :program:`python regrtest.py`
-:option:`-uall,-audio,-largefile` will run :mod:`test.regrtest` with all
-resources except the :option:`audio` and :option:`largefile` resources. For a
-list of all resources and more command-line options, run :program:`python
-regrtest.py` :option:`-h`.
+``all``. The command :program:`python regrtest.py -uall,-audio,-largefile`
+will run :mod:`test.regrtest` 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`.
 
 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`
-:option:`test` at the top-level directory where Python was built. On Windows,
+tests are being executed on. On Unix, you can run :program:`make test` at the
+top-level directory where Python was built. On Windows,
 executing :program:`rt.bat` from your :file:`PCBuild` directory will run all
 regression tests.
 

Modified: python/branches/py3k-cdecimal/Doc/library/timeit.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/timeit.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/timeit.rst	Mon Nov 22 12:00:42 2010
@@ -117,27 +117,36 @@
 
    python -m timeit [-n N] [-r N] [-s S] [-t] [-c] [-h] [statement ...]
 
-where the following options are understood:
+Where the following options are understood:
+
+.. program:: timeit
+
+.. cmdoption:: -n N, --number=N
 
--n N/:option:`--number=N`
    how many times to execute 'statement'
 
--r N/:option:`--repeat=N`
+.. cmdoption:: -r N, --repeat=N
+
    how many times to repeat the timer (default 3)
 
--s S/:option:`--setup=S`
-   statement to be executed once initially (default ``'pass'``)
+.. cmdoption:: -s S, --setup=S
+
+   statement to be executed once initially (default ``pass``)
+
+.. cmdoption:: -t, --time
 
--t/:option:`--time`
    use :func:`time.time` (default on all platforms but Windows)
 
--c/:option:`--clock`
+.. cmdoption:: -c, --clock
+
    use :func:`time.clock` (default on Windows)
 
--v/:option:`--verbose`
+.. cmdoption:: -v, --verbose
+
    print raw timing results; repeat for more digits precision
 
--h/:option:`--help`
+.. cmdoption:: -h, --help
+
    print a short usage message and exit
 
 A multi-line statement may be given by specifying each line as a separate

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	Mon Nov 22 12:00:42 2010
@@ -8,6 +8,8 @@
 .. sectionauthor:: Fred L. Drake, Jr. <fdrake at acm.org>
 .. sectionauthor:: Raymond Hettinger <python at rcn.com>
 
+(If you are already familiar with the basic concepts of testing, you might want
+to skip to :ref:`the list of assert methods <assert-methods>`.)
 
 The Python unit testing framework, sometimes referred to as "PyUnit," is a
 Python language version of JUnit, by Kent Beck and Erich Gamma. JUnit is, in
@@ -154,7 +156,7 @@
 test.
 
 The final block shows a simple way to run the tests. :func:`unittest.main`
-provides a command line interface to the test script.  When run from the command
+provides a command-line interface to the test script.  When run from the command
 line, the above script produces an output that looks like this::
 
    ...
@@ -206,7 +208,11 @@
 
    python -m unittest -v test_module
 
-For a list of all the command line options::
+When executed without arguments :ref:`unittest-test-discovery` is started::
+
+   python -m unittest
+
+For a list of all the command-line options::
 
    python -m unittest -h
 
@@ -215,31 +221,33 @@
    not modules or classes.
 
 
-failfast, catch and buffer command line options
+failfast, catch and buffer command-line options
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-unittest supports three command options.
+:program:`unittest` supports these command-line options:
 
-* :option:`-b` / :option:`--buffer`
+.. program:: unittest
 
-  The standard output and standard error streams are buffered during the test
-  run. Output during a passing test is discarded. Output is echoed normally
-  on test fail or error and is added to the failure messages.
+.. cmdoption:: -b, --buffer
 
-* :option:`-c` / :option:`--catch`
+   The standard output and standard error streams are buffered during the test
+   run. Output during a passing test is discarded. Output is echoed normally
+   on test fail or error and is added to the failure messages.
 
-  Control-C during the test run waits for the current test to end and then
-  reports all the results so far. A second control-C raises the normal
-  :exc:`KeyboardInterrupt` exception.
+.. cmdoption:: -c, --catch
 
-  See `Signal Handling`_ for the functions that provide this functionality.
+   Control-C during the test run waits for the current test to end and then
+   reports all the results so far. A second control-C raises the normal
+   :exc:`KeyboardInterrupt` exception.
 
-* :option:`-f` / :option:`--failfast`
+   See `Signal Handling`_ for the functions that provide this functionality.
 
-  Stop the test run on the first error or failure.
+.. cmdoption:: -f, --failfast
+
+   Stop the test run on the first error or failure.
 
 .. versionadded:: 3.2
-   The command line options ``-c``, ``-b`` and ``-f`` were added.
+   The command-line options :option:`-c`, :option:`-b` and :option:`-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.
@@ -257,18 +265,36 @@
 directory of the project (in other words, they must all be in Python packages).
 
 Test discovery is implemented in :meth:`TestLoader.discover`, but can also be
-used from the command line. The basic command line usage is::
+used from the command line. The basic command-line usage is::
 
    cd project_directory
    python -m unittest discover
 
+.. note::
+
+   As a shortcut, ``python -m unittest`` is the equivalent of
+   ``python -m unittest discover``. If you want to pass arguments to test
+   discovery the `discover` sub-command must be used explicitly.
+
 The ``discover`` sub-command has the following options:
 
-   -v, --verbose    Verbose output
-   -s directory     Directory to start discovery ('.' default)
-   -p pattern       Pattern to match test files ('test*.py' default)
-   -t directory     Top level directory of project (default to
-                    start directory)
+.. program:: unittest discover
+
+.. cmdoption:: -v, --verbose
+
+   Verbose output
+
+.. cmdoption:: -s directory
+
+   Directory to start discovery ('.' default)
+
+.. cmdoption:: -p pattern
+
+   Pattern to match test files ('test*.py' default)
+
+.. cmdoption:: -t directory
+
+   Top level directory of project (defaults to start directory)
 
 The :option:`-s`, :option:`-p`, and :option:`-t` options can be passed in
 as positional arguments in that order. The following two command lines
@@ -740,7 +766,7 @@
    .. method:: run(result=None)
 
       Run the test, collecting the result into the test result object passed as
-      *result*.  If *result* is omitted or :const:`None`, a temporary result
+      *result*.  If *result* is omitted or ``None``, a temporary result
       object is created (by calling the :meth:`defaultTestResult` method) and
       used. The result object is not returned to :meth:`run`'s caller.
 
@@ -762,7 +788,7 @@
       by the test to be propagated to the caller, and can be used to support
       running tests under a debugger.
 
-
+   .. _assert-methods:
 
    The :class:`TestCase` class provides a number of methods to check for and
    report failures, such as:
@@ -807,6 +833,10 @@
    | <TestCase.assertNotIsInstance>`         |                             |               |
    +-----------------------------------------+-----------------------------+---------------+
 
+   All the assert methods (except :meth:`assertRaises`,
+   :meth:`assertRaisesRegexp`, :meth:`assertWarns`, :meth:`assertWarnsRegexp`)
+   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)
 
@@ -817,9 +847,8 @@
       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
-      error message.
-
-      If specified, *msg* will be used as the error message on failure.
+      error message (see also the :ref:`list of type-specific methods
+      <type-specific-methods>`).
 
       .. versionchanged:: 3.1
          Added the automatic calling of type specific equality function.
@@ -1131,9 +1160,29 @@
       .. deprecated:: 3.2
 
 
+   .. _type-specific-methods:
 
-   The following methods are used automatically by :meth:`~TestCase.assertEqual`
-   and usually is not necessary to invoke them directly:
+   The :meth:`assertEqual` method dispatches the equality check for objects of
+   the same type to different type-specific methods.  These methods are already
+   implemented for most of the built-in types, but it's also possible to
+   register new methods using :meth:`addTypeEqualityFunc`:
+
+   .. method:: addTypeEqualityFunc(typeobj, function)
+
+      Registers a type-specific method called by :meth:`assertEqual` to check
+      if two objects of exactly the same *typeobj* (not subclasses) compare
+      equal.  *function* must take two positional arguments and a third msg=None
+      keyword argument just as :meth:`assertEqual` does.  It must raise
+      :data:`self.failureException(msg) <failureException>` when inequality
+      between the first two parameters is detected -- possibly providing useful
+      information and explaining the inequalities in details in the error
+      message.
+
+      .. versionadded:: 3.1
+
+   The list of type-specific methods automatically used by
+   :meth:`~TestCase.assertEqual` are summarized in the following table.  Note
+   that it's usually not necessary to invoke these methods directly.
 
    +-----------------------------------------+-----------------------------+--------------+
    | Method                                  | Used to compare             | New in       |
@@ -1176,7 +1225,8 @@
       be raised.  If the sequences are different an error message is
       constructed that shows the difference between the two.
 
-      This method is used to implement :meth:`assertListEqual` and
+      This method is not called directly by :meth:`assertEqual`, but
+      it's used to implement :meth:`assertListEqual` and
       :meth:`assertTupleEqual`.
 
       .. versionadded:: 3.1
@@ -1217,12 +1267,14 @@
 
 
 
+   .. _other-methods-and-attrs:
+
    Finally the :class:`TestCase` provides the following methods and attributes:
 
 
    .. method:: fail(msg=None)
 
-      Signals a test failure unconditionally, with *msg* or :const:`None` for
+      Signals a test failure unconditionally, with *msg* or ``None`` for
       the error message.
 
 
@@ -1237,18 +1289,19 @@
 
    .. attribute:: longMessage
 
-      If set to True then any explicit failure message you pass in to the
-      assert methods will be appended to the end of the normal failure message.
-      The normal messages contain useful information about the objects involved,
-      for example the message from assertEqual shows you the repr of the two
-      unequal objects. Setting this attribute to True allows you to have a
-      custom error message in addition to the normal one.
+      If set to ``True`` then any explicit failure message you pass in to the
+      :ref:`assert methods <assert-methods>` will be appended to the end of the
+      normal failure message.  The normal messages contain useful information
+      about the objects involved, for example the message from assertEqual
+      shows you the repr of the two unequal objects. Setting this attribute
+      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
+      This attribute defaults to ``False``, meaning that 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.
+      instance attribute to ``True`` or ``False`` before calling the assert methods.
 
       .. versionadded:: 3.1
 
@@ -1297,10 +1350,10 @@
 
    .. method:: shortDescription()
 
-      Returns a description of the test, or :const:`None` if no description
+      Returns a description of the test, or ``None`` if no description
       has been provided.  The default implementation of this method
       returns the first line of the test method's docstring, if available,
-      or :const:`None`.
+      or ``None``.
 
       .. versionchanged:: 3.1,3.2
          In 3.1 this was changed to add the test name to the short description
@@ -1308,22 +1361,6 @@
          with unittest extensions and adding the test name was moved to the
          :class:`TextTestResult`.
 
-   .. method:: addTypeEqualityFunc(typeobj, function)
-
-      Registers a type specific :meth:`assertEqual` equality checking
-      function to be called by :meth:`assertEqual` when both objects it has
-      been asked to compare are exactly *typeobj* (not subclasses).
-      *function* must take two positional arguments and a third msg=None
-      keyword argument just as :meth:`assertEqual` does.  It must raise
-      ``self.failureException`` when inequality between the first two
-      parameters is detected.
-
-      One good use of custom equality checking functions for a type
-      is to raise ``self.failureException`` with an error message useful
-      for debugging the problem by explaining the inequalities in detail.
-
-      .. versionadded:: 3.1
-
 
    .. method:: addCleanup(function, *args, **kwargs)
 
@@ -1686,14 +1723,14 @@
 
    .. method:: wasSuccessful()
 
-      Return :const:`True` if all tests run so far have passed, otherwise returns
-      :const:`False`.
+      Return ``True`` if all tests run so far have passed, otherwise returns
+      ``False``.
 
 
    .. method:: stop()
 
       This method can be called to signal that the set of tests being run should
-      be aborted by setting the :attr:`shouldStop` attribute to :const:`True`.
+      be aborted by setting the :attr:`shouldStop` attribute to ``True``.
       :class:`TestRunner` objects should respect this flag and return without
       running any additional tests.
 
@@ -1850,7 +1887,7 @@
       >>> 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 `failfast, catch and buffer command-line options`_.
 
    Calling ``main`` actually returns an instance of the ``TestProgram`` class.
    This stores the result of the tests run as the ``result`` attribute.
@@ -2013,7 +2050,7 @@
 Signal Handling
 ---------------
 
-The :option:`-c`/:option:`--catch` command line option to unittest, along with the ``catchbreak``
+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

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	Mon Nov 22 12:00:42 2010
@@ -1280,7 +1280,7 @@
 
 The :mod:`urllib.response` module defines functions and classes which define a
 minimal file like interface, including ``read()`` and ``readline()``. The
-typical response object is an addinfourl instance, which defines and ``info()``
+typical response object is an addinfourl instance, which defines an ``info()``
 method and that returns headers and a ``geturl()`` method that returns the url.
 Functions defined by this module are used internally by the
 :mod:`urllib.request` module.

Modified: python/branches/py3k-cdecimal/Doc/library/webbrowser.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/library/webbrowser.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/library/webbrowser.rst	Mon Nov 22 12:00:42 2010
@@ -31,8 +31,8 @@
 
 The script :program:`webbrowser` can be used as a command-line interface for the
 module. It accepts an URL as the argument. It accepts the following optional
-parameters: :option:`-n` opens the URL in a new browser window, if possible;
-:option:`-t` opens the URL in a new browser page ("tab"). The options are,
+parameters: ``-n`` opens the URL in a new browser window, if possible;
+``-t`` opens the URL in a new browser page ("tab"). The options are,
 naturally, mutually exclusive.
 
 The following exception is defined:
@@ -64,7 +64,6 @@
    Open *url* in a new window of the default browser, if possible, otherwise, open
    *url* in the only browser window.
 
-
 .. function:: open_new_tab(url)
 
    Open *url* in a new page ("tab") of the default browser, if possible, otherwise

Modified: python/branches/py3k-cdecimal/Doc/reference/compound_stmts.rst
==============================================================================
--- python/branches/py3k-cdecimal/Doc/reference/compound_stmts.rst	(original)
+++ python/branches/py3k-cdecimal/Doc/reference/compound_stmts.rst	Mon Nov 22 12:00:42 2010
@@ -561,7 +561,16 @@
 A class definition is an executable statement.  The inheritance list usually
 gives a list of base classes (see :ref:`metaclasses` for more advanced uses), so
 each item in the list should evaluate to a class object which allows
-subclassing.
+subclassing.  Classes without an inheritance list inherit, by default, from the
+base class :class:`object`; hence, ::
+
+   class Foo:
+       pass
+
+is equivalent to ::
+
+   class Foo(object):
+       pass
 
 The class's suite is then executed in a new execution frame (see :ref:`naming`),
 using a newly created local namespace and the original global namespace.

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	Mon Nov 22 12:00:42 2010
@@ -1987,7 +1987,7 @@
 dictionary.  That behaviour is the reason why the following code raises an
 exception::
 
-   >>> class C(object):
+   >>> class C:
    ...     pass
    ...
    >>> c = C()

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	Mon Nov 22 12:00:42 2010
@@ -1312,6 +1312,7 @@
 | ``(expressions...)``,                         | Binding or tuple display,           |
 | ``[expressions...]``,                         | list display,                       |
 | ``{key:datum...}``,                           | dictionary display,                 |
+| ``{expressions...}``                          | set display                         |
 +-----------------------------------------------+-------------------------------------+
 
 

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	Mon Nov 22 12:00:42 2010
@@ -253,8 +253,8 @@
 
 table.docutils td, table.docutils th {
     padding: 2px 5px 2px 5px;
-    border-left: 0;    
-    background-color: #eef;    
+    border-left: 0;
+    background-color: #eef;
 }
 
 table.field-list td, table.field-list th {
@@ -266,7 +266,7 @@
 }
 
 table.docutils th {
-    border-top: 1px solid #cac;    
+    border-top: 1px solid #cac;
     background-color: #ede;
 }
 
@@ -276,7 +276,7 @@
 }
 
 th.head {
-    text-align: center;    
+    text-align: center;
 }
 
 /* -- other body styles ----------------------------------------------------- */
@@ -329,7 +329,7 @@
     font-style: italic;
 }
 
-p.deprecated {
+p.deprecated, p.deprecated-removed {
     background-color: #ffe4e4;
     border: 1px solid #f66;
     padding: 7px

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	Mon Nov 22 12:00:42 2010
@@ -554,6 +554,14 @@
   (Contributed by R. David Murray, :issue:`10321`.)
 
 
+* 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)
+
 Multi-threading
 ===============
 

Modified: python/branches/py3k-cdecimal/Include/codecs.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/codecs.h	(original)
+++ python/branches/py3k-cdecimal/Include/codecs.h	Mon Nov 22 12:00:42 2010
@@ -144,7 +144,7 @@
 
 /* Unicode encoding error handling callback registry API */
 
-/* Register the error handling callback function error under the name
+/* Register the error handling callback function error under the given
    name. This function will be called by the codec when it encounters
    unencodable characters/undecodable bytes and doesn't know the
    callback name, when name is specified as the error parameter
@@ -152,8 +152,8 @@
    Return 0 on success, -1 on error */
 PyAPI_FUNC(int) PyCodec_RegisterError(const char *name, PyObject *error);
 
-/* Lookup the error handling callback function registered under the
-   name error. As a special case NULL can be passed, in which case
+/* Lookup the error handling callback function registered under the given
+   name. As a special case NULL can be passed, in which case
    the error handling callback for "strict" will be returned. */
 PyAPI_FUNC(PyObject *) PyCodec_LookupError(const char *name);
 
@@ -163,7 +163,7 @@
 /* ignore the unicode error, skipping the faulty input */
 PyAPI_FUNC(PyObject *) PyCodec_IgnoreErrors(PyObject *exc);
 
-/* replace the unicode error with ? or U+FFFD */
+/* replace the unicode encode error with ? or U+FFFD */
 PyAPI_FUNC(PyObject *) PyCodec_ReplaceErrors(PyObject *exc);
 
 /* replace the unicode encode error with XML character references */

Modified: python/branches/py3k-cdecimal/Include/pyport.h
==============================================================================
--- python/branches/py3k-cdecimal/Include/pyport.h	(original)
+++ python/branches/py3k-cdecimal/Include/pyport.h	Mon Nov 22 12:00:42 2010
@@ -62,15 +62,20 @@
 #define PY_LLONG_MAX LLONG_MAX
 #define PY_ULLONG_MAX ULLONG_MAX
 #elif defined(__LONG_LONG_MAX__)
-/* Otherwise, if GCC has a builtin define, use that. */
+/* Otherwise, if GCC has a builtin define, use that.  (Definition of
+ * PY_LLONG_MIN assumes two's complement with no trap representation.) */
 #define PY_LLONG_MAX __LONG_LONG_MAX__
-#define PY_LLONG_MIN (-PY_LLONG_MAX-1)
-#define PY_ULLONG_MAX (__LONG_LONG_MAX__*2ULL + 1ULL)
-#else
-/* Otherwise, rely on two's complement. */
-#define PY_ULLONG_MAX (~0ULL)
-#define PY_LLONG_MAX  ((long long)(PY_ULLONG_MAX>>1))
-#define PY_LLONG_MIN (-PY_LLONG_MAX-1)
+#define PY_LLONG_MIN (-PY_LLONG_MAX - 1)
+#define PY_ULLONG_MAX (PY_LLONG_MAX * Py_ULL(2) + 1)
+#elif defined(SIZEOF_LONG_LONG)
+/* Otherwise compute from SIZEOF_LONG_LONG, assuming two's complement, no
+   padding bits, and no trap representation.  Note: PY_ULLONG_MAX was
+   previously #defined as (~0ULL) here; but that'll give the wrong value in a
+   preprocessor expression on systems where long long != intmax_t. */
+#define PY_LLONG_MAX                                                    \
+    (1 + 2 * ((Py_LL(1) << (CHAR_BIT * SIZEOF_LONG_LONG - 2)) - 1))
+#define PY_LLONG_MIN (-PY_LLONG_MAX - 1)
+#define PY_ULLONG_MAX (PY_LLONG_MAX * Py_ULL(2) + 1)
 #endif /* LLONG_MAX */
 #endif
 #endif /* HAVE_LONG_LONG */

Modified: python/branches/py3k-cdecimal/Lib/compileall.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/compileall.py	(original)
+++ python/branches/py3k-cdecimal/Lib/compileall.py	Mon Nov 22 12:00:42 2010
@@ -1,4 +1,4 @@
-"""Module/script to "compile" all .py files to .pyc (or .pyo) file.
+"""Module/script to byte-compile all .py files to .pyc (or .pyo) files.
 
 When called as a script with arguments, this compiles the directories
 given as arguments recursively; the -l option prevents it from
@@ -9,14 +9,13 @@
 packages -- for now, you'll have to deal with packages separately.)
 
 See module py_compile for details of the actual byte-compilation.
-
 """
 import os
-import errno
 import sys
+import errno
+import imp
 import py_compile
 import struct
-import imp
 
 __all__ = ["compile_dir","compile_file","compile_path"]
 
@@ -33,7 +32,6 @@
     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
-
     """
     if not quiet:
         print('Listing', dir, '...')
@@ -55,10 +53,8 @@
         if not os.path.isdir(fullname):
             if not compile_file(fullname, ddir, force, rx, quiet, legacy):
                 success = 0
-        elif maxlevels > 0 and \
-             name != os.curdir and name != os.pardir and \
-             os.path.isdir(fullname) and \
-             not os.path.islink(fullname):
+        elif (maxlevels > 0 and name != os.curdir and name != os.pardir and
+              os.path.isdir(fullname) and not os.path.islink(fullname)):
             if not compile_dir(fullname, maxlevels - 1, dfile, force, rx,
                                quiet, legacy):
                 success = 0
@@ -73,7 +69,6 @@
     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
-
     """
     success = 1
     name = os.path.basename(fullname)
@@ -141,7 +136,6 @@
     force: as for compile_dir() (default False)
     quiet: as for compile_dir() (default False)
     legacy: as for compile_dir() (default False)
-
     """
     success = 1
     for dir in sys.path:
@@ -153,90 +147,68 @@
                                               legacy=legacy)
     return success
 
-def expand_args(args, flist):
-    """read names in flist and append to args"""
-    expanded = args[:]
-    if flist:
-        try:
-            if flist == '-':
-                fd = sys.stdin
-            else:
-                fd = open(flist)
-            while 1:
-                line = fd.readline()
-                if not line:
-                    break
-                expanded.append(line[:-1])
-        except IOError:
-            print("Error reading file list %s" % flist)
-            raise
-    return expanded
 
 def main():
     """Script main program."""
-    import getopt
-    try:
-        opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:i:b')
-    except getopt.error as msg:
-        print(msg)
-        print("usage: python compileall.py [-l] [-f] [-q] [-d destdir] "
-              "[-x regexp] [-i list] [directory|file ...]")
-        print("-l: don't recurse down")
-        print("-f: force rebuild even if timestamps are up-to-date")
-        print("-q: quiet operation")
-        print("-d destdir: purported directory name for error messages")
-        print("   if no directory arguments, -l sys.path is assumed")
-        print("-x regexp: skip files matching the regular expression regexp")
-        print("   the regexp is searched for in the full path of the file")
-        print("-i list: expand list with its content "
-              "(file and directory names)")
-        print("-b: Produce legacy byte-compile file paths")
-        sys.exit(2)
-    maxlevels = 10
-    ddir = None
-    force = False
-    quiet = False
-    rx = None
-    flist = None
-    legacy = False
-    for o, a in opts:
-        if o == '-l': maxlevels = 0
-        if o == '-d': ddir = a
-        if o == '-f': force = True
-        if o == '-q': quiet = True
-        if o == '-x':
-            import re
-            rx = re.compile(a)
-        if o == '-i': flist = a
-        if o == '-b': legacy = True
-    if ddir:
-        if len(args) != 1 and not os.path.isdir(args[0]):
-            print("-d destdir require exactly one directory argument")
-            sys.exit(2)
-    success = 1
+    import argparse
+
+    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('-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')
+    parser.add_argument('-b', action='store_true', dest='legacy',
+                        help='produce legacy byte-compiled file paths')
+    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.'))
+    parser.add_argument('-x', metavar='REGEXP', dest='rx', default=None,
+                        help=('skip files matching the regular expression.\n\t'
+                              'The regexp is searched for in the full path '
+                              'of the file'))
+    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='?')
+    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")
+    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:
-        if args or flist:
-            try:
-                if flist:
-                    args = expand_args(args, flist)
-            except IOError:
-                success = 0
-            if success:
-                for arg in args:
-                    if os.path.isdir(arg):
-                        if not compile_dir(arg, maxlevels, ddir,
-                                           force, rx, quiet, legacy):
-                            success = 0
-                    else:
-                        if not compile_file(arg, ddir, force, rx,
-                                            quiet, legacy):
-                            success = 0
+        if compile_dests:
+            for dest in compile_dests:
+                if os.path.isdir(dest):
+                    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
         else:
-            success = compile_path(legacy=legacy)
+            return compile_path(legacy=args.legacy)
     except KeyboardInterrupt:
-        print("\n[interrupt]")
-        success = 0
-    return success
+        print("\n[interrupted]")
+        return 0
+    return 1
+
 
 if __name__ == '__main__':
     exit_status = int(not main())

Modified: python/branches/py3k-cdecimal/Lib/configparser.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/configparser.py	(original)
+++ python/branches/py3k-cdecimal/Lib/configparser.py	Mon Nov 22 12:00:42 2010
@@ -29,8 +29,7 @@
              strict=False, 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. Note that `__name__'
-        is always an intrinsic default; its value is the section's name.
+        must be appropriate for %()s string interpolation.
 
         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
@@ -406,12 +405,13 @@
     def __init__(self, defaults=None, dict_type=_default_dict,
                  allow_no_value=False, *, delimiters=('=', ':'),
                  comment_prefixes=_COMPATIBLE, strict=False,
-                 empty_lines_in_values=True):
+                 empty_lines_in_values=True,
+                 default_section=DEFAULTSECT):
         self._dict = dict_type
         self._sections = self._dict()
         self._defaults = self._dict()
         self._proxies = self._dict()
-        self._proxies[DEFAULTSECT] = SectionProxy(self, DEFAULTSECT)
+        self._proxies[default_section] = SectionProxy(self, default_section)
         if defaults:
             for key, value in defaults.items():
                 self._defaults[self.optionxform(key)] = value
@@ -435,6 +435,7 @@
         self._strict = strict
         self._allow_no_value = allow_no_value
         self._empty_lines_in_values = empty_lines_in_values
+        self._default_section=default_section
 
     def defaults(self):
         return self._defaults
@@ -448,10 +449,9 @@
         """Create a new section in the configuration.
 
         Raise DuplicateSectionError if a section by the specified name
-        already exists. Raise ValueError if name is DEFAULT or any of it's
-        case-insensitive variants.
+        already exists. Raise ValueError if name is DEFAULT.
         """
-        if section.upper() == DEFAULTSECT:
+        if section == self._default_section:
             raise ValueError('Invalid section name: %s' % section)
 
         if section in self._sections:
@@ -473,8 +473,6 @@
         except KeyError:
             raise NoSectionError(section)
         opts.update(self._defaults)
-        if '__name__' in opts:
-            del opts['__name__']
         return list(opts.keys())
 
     def read(self, filenames, encoding=None):
@@ -587,13 +585,11 @@
         try:
             d2 = self._sections[section]
         except KeyError:
-            if section != DEFAULTSECT:
+            if section != self._default_section:
                 raise NoSectionError(section)
             d2 = self._dict()
         d = self._defaults.copy()
         d.update(d2)
-        if "__name__" in d:
-            del d["__name__"]
         return d.items()
 
     def _get(self, section, conv, option, **kwargs):
@@ -632,7 +628,7 @@
 
     def has_option(self, section, option):
         """Check for the existence of a given option in a given section."""
-        if not section or section == DEFAULTSECT:
+        if not section or section == self._default_section:
             option = self.optionxform(option)
             return option in self._defaults
         elif section not in self._sections:
@@ -644,7 +640,7 @@
 
     def set(self, section, option, value=None):
         """Set an option."""
-        if not section or section == DEFAULTSECT:
+        if not section or section == self._default_section:
             sectdict = self._defaults
         else:
             try:
@@ -664,7 +660,8 @@
         else:
             d = self._delimiters[0]
         if self._defaults:
-            self._write_section(fp, DEFAULTSECT, self._defaults.items(), d)
+            self._write_section(fp, self._default_section,
+                                    self._defaults.items(), d)
         for section in self._sections:
             self._write_section(fp, section,
                                 self._sections[section].items(), d)
@@ -673,8 +670,6 @@
         """Write a single section to the specified `fp'."""
         fp.write("[{}]\n".format(section_name))
         for key, value in section_items:
-            if key == "__name__":
-                continue
             if value is not None or not self._allow_no_value:
                 value = delimiter + str(value).replace('\n', '\n\t')
             else:
@@ -684,7 +679,7 @@
 
     def remove_option(self, section, option):
         """Remove an option."""
-        if not section or section == DEFAULTSECT:
+        if not section or section == self._default_section:
             sectdict = self._defaults
         else:
             try:
@@ -706,7 +701,7 @@
         return existed
 
     def __getitem__(self, key):
-        if key != DEFAULTSECT and not self.has_section(key):
+        if key != self._default_section and not self.has_section(key):
             raise KeyError(key)
         return self._proxies[key]
 
@@ -720,21 +715,21 @@
         self.read_dict({key: value})
 
     def __delitem__(self, key):
-        if key == DEFAULTSECT:
+        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 == DEFAULTSECT 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((DEFAULTSECT,), self._sections.keys())
+        return itertools.chain((self._default_section,), self._sections.keys())
 
     def _read(self, fp, fpname):
         """Parse a sectioned configuration file.
@@ -806,11 +801,10 @@
                                                         lineno)
                         cursect = self._sections[sectname]
                         elements_added.add(sectname)
-                    elif sectname == DEFAULTSECT:
+                    elif sectname == self._default_section:
                         cursect = self._defaults
                     else:
                         cursect = self._dict()
-                        cursect['__name__'] = sectname
                         self._sections[sectname] = cursect
                         self._proxies[sectname] = SectionProxy(self, sectname)
                         elements_added.add(sectname)
@@ -877,7 +871,7 @@
         try:
             d.update(self._sections[section])
         except KeyError:
-            if section != DEFAULTSECT:
+            if section != self._default_section:
                 raise NoSectionError(section)
         # Update with the entry specific variables
         if vars:
@@ -999,15 +993,13 @@
         try:
             d.update(self._sections[section])
         except KeyError:
-            if section != DEFAULTSECT:
+            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 "__name__" in options:
-            options.remove("__name__")
         if raw:
             return [(option, d[option])
                     for option in options]
@@ -1110,55 +1102,52 @@
 class SectionProxy(MutableMapping):
     """A proxy for a single section from a parser."""
 
-    _noname = ("__name__ special key access and modification "
-               "not supported through the mapping interface.")
-
-    def __init__(self, parser, section_name):
-        """Creates a view on a section named `section_name` in `parser`."""
+    def __init__(self, parser, name):
+        """Creates a view on a section of the specified `name` in `parser`."""
         self._parser = parser
-        self._section = section_name
+        self._name = name
         self.getint = functools.partial(self._parser.getint,
-                                        self._section)
+                                        self._name)
         self.getfloat = functools.partial(self._parser.getfloat,
-                                          self._section)
+                                          self._name)
         self.getboolean = functools.partial(self._parser.getboolean,
-                                            self._section)
+                                            self._name)
 
     def __repr__(self):
-        return '<Section: {}>'.format(self._section)
+        return '<Section: {}>'.format(self._name)
 
     def __getitem__(self, key):
-        if key == '__name__':
-            raise ValueError(self._noname)
-        if not self._parser.has_option(self._section, key):
+        if not self._parser.has_option(self._name, key):
             raise KeyError(key)
-        return self._parser.get(self._section, key)
+        return self._parser.get(self._name, key)
 
     def __setitem__(self, key, value):
-        if key == '__name__':
-            raise ValueError(self._noname)
         self._parser._validate_value_type(value)
-        return self._parser.set(self._section, key, value)
+        return self._parser.set(self._name, key, value)
 
     def __delitem__(self, key):
-        if key == '__name__':
-            raise ValueError(self._noname)
-        if not self._parser.has_option(self._section, key):
+        if not self._parser.has_option(self._name, key):
             raise KeyError(key)
-        return self._parser.remove_option(self._section, key)
+        return self._parser.remove_option(self._name, key)
 
     def __contains__(self, key):
-        if key == '__name__':
-            return False
-        return self._parser.has_option(self._section, key)
+        return self._parser.has_option(self._name, key)
 
     def __len__(self):
-        # __name__ is properly hidden by .options()
         # XXX weak performance
-        return len(self._parser.options(self._section))
+        return len(self._parser.options(self._name))
 
     def __iter__(self):
-        # __name__ is properly hidden by .options()
         # XXX weak performance
         # XXX does not break when underlying container state changed
-        return self._parser.options(self._section).__iter__()
+        return self._parser.options(self._name).__iter__()
+
+    @property
+    def parser(self):
+        # The parser object of the proxy is read-only.
+        return self._parser
+
+    @property
+    def name(self):
+        # The name of the section on a proxy is read-only.
+        return self._name

Modified: python/branches/py3k-cdecimal/Lib/ctypes/test/test_keeprefs.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/ctypes/test/test_keeprefs.py	(original)
+++ python/branches/py3k-cdecimal/Lib/ctypes/test/test_keeprefs.py	Mon Nov 22 12:00:42 2010
@@ -4,19 +4,19 @@
 class SimpleTestCase(unittest.TestCase):
     def test_cint(self):
         x = c_int()
-        self.assertEquals(x._objects, None)
+        self.assertEqual(x._objects, None)
         x.value = 42
-        self.assertEquals(x._objects, None)
+        self.assertEqual(x._objects, None)
         x = c_int(99)
-        self.assertEquals(x._objects, None)
+        self.assertEqual(x._objects, None)
 
     def test_ccharp(self):
         x = c_char_p()
-        self.assertEquals(x._objects, None)
+        self.assertEqual(x._objects, None)
         x.value = b"abc"
-        self.assertEquals(x._objects, b"abc")
+        self.assertEqual(x._objects, b"abc")
         x = c_char_p(b"spam")
-        self.assertEquals(x._objects, b"spam")
+        self.assertEqual(x._objects, b"spam")
 
 class StructureTestCase(unittest.TestCase):
     def test_cint_struct(self):
@@ -25,21 +25,21 @@
                         ("b", c_int)]
 
         x = X()
-        self.assertEquals(x._objects, None)
+        self.assertEqual(x._objects, None)
         x.a = 42
         x.b = 99
-        self.assertEquals(x._objects, None)
+        self.assertEqual(x._objects, None)
 
     def test_ccharp_struct(self):
         class X(Structure):
             _fields_ = [("a", c_char_p),
                         ("b", c_char_p)]
         x = X()
-        self.assertEquals(x._objects, None)
+        self.assertEqual(x._objects, None)
 
         x.a = b"spam"
         x.b = b"foo"
-        self.assertEquals(x._objects, {"0": b"spam", "1": b"foo"})
+        self.assertEqual(x._objects, {"0": b"spam", "1": b"foo"})
 
     def test_struct_struct(self):
         class POINT(Structure):
@@ -52,28 +52,28 @@
         r.ul.y = 1
         r.lr.x = 2
         r.lr.y = 3
-        self.assertEquals(r._objects, None)
+        self.assertEqual(r._objects, None)
 
         r = RECT()
         pt = POINT(1, 2)
         r.ul = pt
-        self.assertEquals(r._objects, {'0': {}})
+        self.assertEqual(r._objects, {'0': {}})
         r.ul.x = 22
         r.ul.y = 44
-        self.assertEquals(r._objects, {'0': {}})
+        self.assertEqual(r._objects, {'0': {}})
         r.lr = POINT()
-        self.assertEquals(r._objects, {'0': {}, '1': {}})
+        self.assertEqual(r._objects, {'0': {}, '1': {}})
 
 class ArrayTestCase(unittest.TestCase):
     def test_cint_array(self):
         INTARR = c_int * 3
 
         ia = INTARR()
-        self.assertEquals(ia._objects, None)
+        self.assertEqual(ia._objects, None)
         ia[0] = 1
         ia[1] = 2
         ia[2] = 3
-        self.assertEquals(ia._objects, None)
+        self.assertEqual(ia._objects, None)
 
         class X(Structure):
             _fields_ = [("x", c_int),
@@ -83,9 +83,9 @@
         x.x = 1000
         x.a[0] = 42
         x.a[1] = 96
-        self.assertEquals(x._objects, None)
+        self.assertEqual(x._objects, None)
         x.a = ia
-        self.assertEquals(x._objects, {'1': {}})
+        self.assertEqual(x._objects, {'1': {}})
 
 class PointerTestCase(unittest.TestCase):
     def test_p_cint(self):

Modified: python/branches/py3k-cdecimal/Lib/decimal.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/decimal.py	(original)
+++ python/branches/py3k-cdecimal/Lib/decimal.py	Mon Nov 22 12:00:42 2010
@@ -943,7 +943,7 @@
         # in the documentation.  (See library docs, 'Built-in Types').
         if self._is_special:
             if self.is_snan():
-                raise ValueError('Cannot hash a signaling NaN value.')
+                raise TypeError('Cannot hash a signaling NaN value.')
             elif self.is_nan():
                 return _PyHASH_NAN
             else:

Modified: python/branches/py3k-cdecimal/Lib/distutils/dir_util.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/dir_util.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/dir_util.py	Mon Nov 22 12:00:42 2010
@@ -5,6 +5,7 @@
 __revision__ = "$Id$"
 
 import os, sys
+import errno
 from distutils.errors import DistutilsFileError, DistutilsInternalError
 from distutils import log
 

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_archive_util.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_archive_util.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_archive_util.py	Mon Nov 22 12:00:42 2010
@@ -113,7 +113,7 @@
 
         self.assertTrue(os.path.exists(tarball2))
         # let's compare both tarballs
-        self.assertEquals(self._tarinfo(tarball), self._tarinfo(tarball2))
+        self.assertEqual(self._tarinfo(tarball), self._tarinfo(tarball2))
 
         # trying an uncompressed one
         base_name = os.path.join(tmpdir2, 'archive')
@@ -153,7 +153,7 @@
             os.chdir(old_dir)
         tarball = base_name + '.tar.Z'
         self.assertTrue(os.path.exists(tarball))
-        self.assertEquals(len(w.warnings), 1)
+        self.assertEqual(len(w.warnings), 1)
 
         # same test with dry_run
         os.remove(tarball)
@@ -167,7 +167,7 @@
         finally:
             os.chdir(old_dir)
         self.assertTrue(not os.path.exists(tarball))
-        self.assertEquals(len(w.warnings), 1)
+        self.assertEqual(len(w.warnings), 1)
 
     @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run')
     def test_make_zipfile(self):
@@ -184,9 +184,9 @@
         tarball = base_name + '.zip'
 
     def test_check_archive_formats(self):
-        self.assertEquals(check_archive_formats(['gztar', 'xxx', 'zip']),
-                          'xxx')
-        self.assertEquals(check_archive_formats(['gztar', 'zip']), None)
+        self.assertEqual(check_archive_formats(['gztar', 'xxx', 'zip']),
+                         'xxx')
+        self.assertEqual(check_archive_formats(['gztar', 'zip']), None)
 
     def test_make_archive(self):
         tmpdir = self.mkdtemp()
@@ -203,7 +203,7 @@
                 make_archive('xxx', 'xxx', root_dir=self.mkdtemp())
             except:
                 pass
-            self.assertEquals(os.getcwd(), current_dir)
+            self.assertEqual(os.getcwd(), current_dir)
         finally:
             del ARCHIVE_FORMATS['xxx']
 

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_bdist.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_bdist.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_bdist.py	Mon Nov 22 12:00:42 2010
@@ -24,7 +24,7 @@
         cmd = bdist(dist)
         cmd.formats = ['msi']
         cmd.ensure_finalized()
-        self.assertEquals(cmd.formats, ['msi'])
+        self.assertEqual(cmd.formats, ['msi'])
 
         # what format bdist offers ?
         # XXX an explicit list in bdist is
@@ -35,7 +35,7 @@
         formats.sort()
         founded = list(cmd.format_command.keys())
         founded.sort()
-        self.assertEquals(founded, formats)
+        self.assertEqual(founded, formats)
 
 def test_suite():
     return unittest.makeSuite(BuildTestCase)

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_bdist_dumb.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_bdist_dumb.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_bdist_dumb.py	Mon Nov 22 12:00:42 2010
@@ -69,7 +69,7 @@
             base = base.replace(':', '-')
 
         wanted = ['%s.zip' % base]
-        self.assertEquals(dist_created, wanted)
+        self.assertEqual(dist_created, wanted)
 
         # now let's check what we have in the zip file
         # XXX to be done

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_build.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_build.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_build.py	Mon Nov 22 12:00:42 2010
@@ -18,11 +18,11 @@
         cmd.finalize_options()
 
         # if not specified, plat_name gets the current platform
-        self.assertEquals(cmd.plat_name, get_platform())
+        self.assertEqual(cmd.plat_name, get_platform())
 
         # build_purelib is build + lib
         wanted = os.path.join(cmd.build_base, 'lib')
-        self.assertEquals(cmd.build_purelib, wanted)
+        self.assertEqual(cmd.build_purelib, wanted)
 
         # build_platlib is 'build/lib.platform-x.x[-pydebug]'
         # examples:
@@ -32,21 +32,21 @@
             self.assertTrue(cmd.build_platlib.endswith('-pydebug'))
             plat_spec += '-pydebug'
         wanted = os.path.join(cmd.build_base, 'lib' + plat_spec)
-        self.assertEquals(cmd.build_platlib, wanted)
+        self.assertEqual(cmd.build_platlib, wanted)
 
         # by default, build_lib = build_purelib
-        self.assertEquals(cmd.build_lib, cmd.build_purelib)
+        self.assertEqual(cmd.build_lib, cmd.build_purelib)
 
         # build_temp is build/temp.<plat>
         wanted = os.path.join(cmd.build_base, 'temp' + plat_spec)
-        self.assertEquals(cmd.build_temp, wanted)
+        self.assertEqual(cmd.build_temp, wanted)
 
         # build_scripts is build/scripts-x.x
         wanted = os.path.join(cmd.build_base, 'scripts-' +  sys.version[0:3])
-        self.assertEquals(cmd.build_scripts, wanted)
+        self.assertEqual(cmd.build_scripts, wanted)
 
         # executable is os.path.normpath(sys.executable)
-        self.assertEquals(cmd.executable, os.path.normpath(sys.executable))
+        self.assertEqual(cmd.executable, os.path.normpath(sys.executable))
 
 def test_suite():
     return unittest.makeSuite(BuildTestCase)

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_build_clib.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_build_clib.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_build_clib.py	Mon Nov 22 12:00:42 2010
@@ -57,14 +57,14 @@
         self.assertRaises(DistutilsSetupError, cmd.get_source_files)
 
         cmd.libraries = [('name', {'sources': ['a', 'b']})]
-        self.assertEquals(cmd.get_source_files(), ['a', 'b'])
+        self.assertEqual(cmd.get_source_files(), ['a', 'b'])
 
         cmd.libraries = [('name', {'sources': ('a', 'b')})]
-        self.assertEquals(cmd.get_source_files(), ['a', 'b'])
+        self.assertEqual(cmd.get_source_files(), ['a', 'b'])
 
         cmd.libraries = [('name', {'sources': ('a', 'b')}),
                          ('name2', {'sources': ['c', 'd']})]
-        self.assertEquals(cmd.get_source_files(), ['a', 'b', 'c', 'd'])
+        self.assertEqual(cmd.get_source_files(), ['a', 'b', 'c', 'd'])
 
     def test_build_libraries(self):
 
@@ -93,11 +93,11 @@
 
         cmd.include_dirs = 'one-dir'
         cmd.finalize_options()
-        self.assertEquals(cmd.include_dirs, ['one-dir'])
+        self.assertEqual(cmd.include_dirs, ['one-dir'])
 
         cmd.include_dirs = None
         cmd.finalize_options()
-        self.assertEquals(cmd.include_dirs, [])
+        self.assertEqual(cmd.include_dirs, [])
 
         cmd.distribution.libraries = 'WONTWORK'
         self.assertRaises(DistutilsSetupError, cmd.finalize_options)

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_build_ext.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_build_ext.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_build_ext.py	Mon Nov 22 12:00:42 2010
@@ -96,11 +96,11 @@
         for attr in ('error', 'foo', 'new', 'roj'):
             self.assertTrue(hasattr(xx, attr))
 
-        self.assertEquals(xx.foo(2, 5), 7)
-        self.assertEquals(xx.foo(13,15), 28)
-        self.assertEquals(xx.new().demo(), None)
+        self.assertEqual(xx.foo(2, 5), 7)
+        self.assertEqual(xx.foo(13,15), 28)
+        self.assertEqual(xx.new().demo(), None)
         doc = 'This is a template module just for instruction.'
-        self.assertEquals(xx.__doc__, doc)
+        self.assertEqual(xx.__doc__, doc)
         self.assertTrue(isinstance(xx.Null(), xx.Null))
         self.assertTrue(isinstance(xx.Str(), xx.Str))
 
@@ -206,7 +206,7 @@
         cmd = build_ext(dist)
         cmd.libraries = 'my_lib'
         cmd.finalize_options()
-        self.assertEquals(cmd.libraries, ['my_lib'])
+        self.assertEqual(cmd.libraries, ['my_lib'])
 
         # make sure cmd.library_dirs is turned into a list
         # if it's a string
@@ -220,7 +220,7 @@
         cmd = build_ext(dist)
         cmd.rpath = os.pathsep.join(['one', 'two'])
         cmd.finalize_options()
-        self.assertEquals(cmd.rpath, ['one', 'two'])
+        self.assertEqual(cmd.rpath, ['one', 'two'])
 
         # XXX more tests to perform for win32
 
@@ -229,25 +229,25 @@
         cmd = build_ext(dist)
         cmd.define = 'one,two'
         cmd.finalize_options()
-        self.assertEquals(cmd.define, [('one', '1'), ('two', '1')])
+        self.assertEqual(cmd.define, [('one', '1'), ('two', '1')])
 
         # make sure undef is turned into a list of
         # strings if they are ','-separated strings
         cmd = build_ext(dist)
         cmd.undef = 'one,two'
         cmd.finalize_options()
-        self.assertEquals(cmd.undef, ['one', 'two'])
+        self.assertEqual(cmd.undef, ['one', 'two'])
 
         # make sure swig_opts is turned into a list
         cmd = build_ext(dist)
         cmd.swig_opts = None
         cmd.finalize_options()
-        self.assertEquals(cmd.swig_opts, [])
+        self.assertEqual(cmd.swig_opts, [])
 
         cmd = build_ext(dist)
         cmd.swig_opts = '1 2'
         cmd.finalize_options()
-        self.assertEquals(cmd.swig_opts, ['1', '2'])
+        self.assertEqual(cmd.swig_opts, ['1', '2'])
 
     def test_check_extensions_list(self):
         dist = Distribution()
@@ -284,7 +284,7 @@
         # check_extensions_list adds in ext the values passed
         # when they are in ('include_dirs', 'library_dirs', 'libraries'
         # 'extra_objects', 'extra_compile_args', 'extra_link_args')
-        self.assertEquals(ext.libraries, 'foo')
+        self.assertEqual(ext.libraries, 'foo')
         self.assertTrue(not hasattr(ext, 'some'))
 
         # 'macros' element of build info dict must be 1- or 2-tuple
@@ -294,15 +294,15 @@
 
         exts[0][1]['macros'] = [('1', '2'), ('3',)]
         cmd.check_extensions_list(exts)
-        self.assertEquals(exts[0].undef_macros, ['3'])
-        self.assertEquals(exts[0].define_macros, [('1', '2')])
+        self.assertEqual(exts[0].undef_macros, ['3'])
+        self.assertEqual(exts[0].define_macros, [('1', '2')])
 
     def test_get_source_files(self):
         modules = [Extension('foo', ['xxx'], optional=False)]
         dist = Distribution({'name': 'xx', 'ext_modules': modules})
         cmd = build_ext(dist)
         cmd.ensure_finalized()
-        self.assertEquals(cmd.get_source_files(), ['xxx'])
+        self.assertEqual(cmd.get_source_files(), ['xxx'])
 
     def test_compiler_option(self):
         # cmd.compiler is an option and
@@ -313,7 +313,7 @@
         cmd.compiler = 'unix'
         cmd.ensure_finalized()
         cmd.run()
-        self.assertEquals(cmd.compiler, 'unix')
+        self.assertEqual(cmd.compiler, 'unix')
 
     def test_get_outputs(self):
         tmp_dir = self.mkdtemp()
@@ -325,7 +325,7 @@
         cmd = build_ext(dist)
         self._fixup_command(cmd)
         cmd.ensure_finalized()
-        self.assertEquals(len(cmd.get_outputs()), 1)
+        self.assertEqual(len(cmd.get_outputs()), 1)
 
         if os.name == "nt":
             cmd.debug = sys.executable.endswith("_d.exe")
@@ -348,7 +348,7 @@
         so_ext = sysconfig.get_config_var('SO')
         self.assertTrue(so_file.endswith(so_ext))
         so_dir = os.path.dirname(so_file)
-        self.assertEquals(so_dir, other_tmp_dir)
+        self.assertEqual(so_dir, other_tmp_dir)
 
         cmd.inplace = 0
         cmd.compiler = None
@@ -357,7 +357,7 @@
         self.assertTrue(os.path.exists(so_file))
         self.assertTrue(so_file.endswith(so_ext))
         so_dir = os.path.dirname(so_file)
-        self.assertEquals(so_dir, cmd.build_lib)
+        self.assertEqual(so_dir, cmd.build_lib)
 
         # inplace = 0, cmd.package = 'bar'
         build_py = cmd.get_finalized_command('build_py')
@@ -365,7 +365,7 @@
         path = cmd.get_ext_fullpath('foo')
         # checking that the last directory is the build_dir
         path = os.path.split(path)[0]
-        self.assertEquals(path, cmd.build_lib)
+        self.assertEqual(path, cmd.build_lib)
 
         # inplace = 1, cmd.package = 'bar'
         cmd.inplace = 1
@@ -379,7 +379,7 @@
         # checking that the last directory is bar
         path = os.path.split(path)[0]
         lastdir = os.path.split(path)[-1]
-        self.assertEquals(lastdir, 'bar')
+        self.assertEqual(lastdir, 'bar')
 
     def test_ext_fullpath(self):
         ext = sysconfig.get_config_vars()['SO']
@@ -395,14 +395,14 @@
         curdir = os.getcwd()
         wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + ext)
         path = cmd.get_ext_fullpath('lxml.etree')
-        self.assertEquals(wanted, path)
+        self.assertEqual(wanted, path)
 
         # building lxml.etree not inplace
         cmd.inplace = 0
         cmd.build_lib = os.path.join(curdir, 'tmpdir')
         wanted = os.path.join(curdir, 'tmpdir', 'lxml', 'etree' + ext)
         path = cmd.get_ext_fullpath('lxml.etree')
-        self.assertEquals(wanted, path)
+        self.assertEqual(wanted, path)
 
         # building twisted.runner.portmap not inplace
         build_py = cmd.get_finalized_command('build_py')
@@ -411,13 +411,13 @@
         path = cmd.get_ext_fullpath('twisted.runner.portmap')
         wanted = os.path.join(curdir, 'tmpdir', 'twisted', 'runner',
                               'portmap' + ext)
-        self.assertEquals(wanted, path)
+        self.assertEqual(wanted, path)
 
         # building twisted.runner.portmap inplace
         cmd.inplace = 1
         path = cmd.get_ext_fullpath('twisted.runner.portmap')
         wanted = os.path.join(curdir, 'twisted', 'runner', 'portmap' + ext)
-        self.assertEquals(wanted, path)
+        self.assertEqual(wanted, path)
 
 def test_suite():
     src = _get_source_filename()

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_check.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_check.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_check.py	Mon Nov 22 12:00:42 2010
@@ -27,7 +27,7 @@
         # by default, check is checking the metadata
         # should have some warnings
         cmd = self._run()
-        self.assertEquals(cmd._warnings, 2)
+        self.assertEqual(cmd._warnings, 2)
 
         # now let's add the required fields
         # and run it again, to make sure we don't get
@@ -36,7 +36,7 @@
                     'author_email': 'xxx',
                     'name': 'xxx', 'version': 'xxx'}
         cmd = self._run(metadata)
-        self.assertEquals(cmd._warnings, 0)
+        self.assertEqual(cmd._warnings, 0)
 
         # now with the strict mode, we should
         # get an error if there are missing metadata
@@ -44,7 +44,7 @@
 
         # and of course, no error when all metadata are present
         cmd = self._run(metadata, strict=1)
-        self.assertEquals(cmd._warnings, 0)
+        self.assertEqual(cmd._warnings, 0)
 
     def test_check_document(self):
         if not HAS_DOCUTILS: # won't test without docutils
@@ -55,12 +55,12 @@
         # let's see if it detects broken rest
         broken_rest = 'title\n===\n\ntest'
         msgs = cmd._check_rst_data(broken_rest)
-        self.assertEquals(len(msgs), 1)
+        self.assertEqual(len(msgs), 1)
 
         # and non-broken rest
         rest = 'title\n=====\n\ntest'
         msgs = cmd._check_rst_data(rest)
-        self.assertEquals(len(msgs), 0)
+        self.assertEqual(len(msgs), 0)
 
     def test_check_restructuredtext(self):
         if not HAS_DOCUTILS: # won't test without docutils
@@ -70,7 +70,7 @@
         pkg_info, dist = self.create_dist(long_description=broken_rest)
         cmd = check(dist)
         cmd.check_restructuredtext()
-        self.assertEquals(cmd._warnings, 1)
+        self.assertEqual(cmd._warnings, 1)
 
         # let's see if we have an error with strict=1
         metadata = {'url': 'xxx', 'author': 'xxx',
@@ -83,7 +83,7 @@
         # and non-broken rest
         metadata['long_description'] = 'title\n=====\n\ntest'
         cmd = self._run(metadata, strict=1, restructuredtext=1)
-        self.assertEquals(cmd._warnings, 0)
+        self.assertEqual(cmd._warnings, 0)
 
     def test_check_all(self):
 

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_cmd.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_cmd.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_cmd.py	Mon Nov 22 12:00:42 2010
@@ -44,7 +44,7 @@
 
         # making sure execute gets called properly
         def _execute(func, args, exec_msg, level):
-            self.assertEquals(exec_msg, 'generating out from in')
+            self.assertEqual(exec_msg, 'generating out from in')
         cmd.force = True
         cmd.execute = _execute
         cmd.make_file(infiles='in', outfile='out', func='func', args=())
@@ -63,7 +63,7 @@
 
         wanted = ["command options for 'MyCmd':", '  option1 = 1',
                   '  option2 = 1']
-        self.assertEquals(msgs, wanted)
+        self.assertEqual(msgs, wanted)
 
     def test_ensure_string(self):
         cmd = self.cmd
@@ -81,7 +81,7 @@
         cmd = self.cmd
         cmd.option1 = 'ok,dok'
         cmd.ensure_string_list('option1')
-        self.assertEquals(cmd.option1, ['ok', 'dok'])
+        self.assertEqual(cmd.option1, ['ok', 'dok'])
 
         cmd.option2 = ['xxx', 'www']
         cmd.ensure_string_list('option2')
@@ -109,14 +109,14 @@
         with captured_stdout() as stdout:
             cmd.debug_print('xxx')
         stdout.seek(0)
-        self.assertEquals(stdout.read(), '')
+        self.assertEqual(stdout.read(), '')
 
         debug.DEBUG = True
         try:
             with captured_stdout() as stdout:
                 cmd.debug_print('xxx')
             stdout.seek(0)
-            self.assertEquals(stdout.read(), 'xxx\n')
+            self.assertEqual(stdout.read(), 'xxx\n')
         finally:
             debug.DEBUG = False
 

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_config.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_config.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_config.py	Mon Nov 22 12:00:42 2010
@@ -89,7 +89,7 @@
         waited = [('password', 'secret'), ('realm', 'pypi'),
                   ('repository', 'http://pypi.python.org/pypi'),
                   ('server', 'server1'), ('username', 'me')]
-        self.assertEquals(config, waited)
+        self.assertEqual(config, waited)
 
         # old format
         self.write_file(self.rc, PYPIRC_OLD)
@@ -98,7 +98,7 @@
         waited = [('password', 'secret'), ('realm', 'pypi'),
                   ('repository', 'http://pypi.python.org/pypi'),
                   ('server', 'server-login'), ('username', 'tarek')]
-        self.assertEquals(config, waited)
+        self.assertEqual(config, waited)
 
     def test_server_empty_registration(self):
         cmd = self._cmd(self.dist)
@@ -109,7 +109,7 @@
         f = open(rc)
         try:
             content = f.read()
-            self.assertEquals(content, WANTED)
+            self.assertEqual(content, WANTED)
         finally:
             f.close()
 

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_config_cmd.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_config_cmd.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_config_cmd.py	Mon Nov 22 12:00:42 2010
@@ -35,7 +35,7 @@
             f.close()
 
         dump_file(this_file, 'I am the header')
-        self.assertEquals(len(self._logs), numlines+1)
+        self.assertEqual(len(self._logs), numlines+1)
 
     def test_search_cpp(self):
         if sys.platform == 'win32':
@@ -45,10 +45,10 @@
 
         # simple pattern searches
         match = cmd.search_cpp(pattern='xxx', body='// xxx')
-        self.assertEquals(match, 0)
+        self.assertEqual(match, 0)
 
         match = cmd.search_cpp(pattern='_configtest', body='// xxx')
-        self.assertEquals(match, 1)
+        self.assertEqual(match, 1)
 
     def test_finalize_options(self):
         # finalize_options does a bit of transformation
@@ -60,9 +60,9 @@
         cmd.library_dirs = 'three%sfour' % os.pathsep
         cmd.ensure_finalized()
 
-        self.assertEquals(cmd.include_dirs, ['one', 'two'])
-        self.assertEquals(cmd.libraries, ['one'])
-        self.assertEquals(cmd.library_dirs, ['three', 'four'])
+        self.assertEqual(cmd.include_dirs, ['one', 'two'])
+        self.assertEqual(cmd.libraries, ['one'])
+        self.assertEqual(cmd.library_dirs, ['three', 'four'])
 
     def test_clean(self):
         # _clean removes files

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_core.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_core.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_core.py	Mon Nov 22 12:00:42 2010
@@ -89,7 +89,7 @@
         with captured_stdout() as stdout:
             distutils.core.setup(name='bar')
         stdout.seek(0)
-        self.assertEquals(stdout.read(), 'bar\n')
+        self.assertEqual(stdout.read(), 'bar\n')
 
         distutils.core.DEBUG = True
         try:
@@ -99,7 +99,7 @@
             distutils.core.DEBUG = False
         stdout.seek(0)
         wanted = "options (after parsing config files):\n"
-        self.assertEquals(stdout.readlines()[0], wanted)
+        self.assertEqual(stdout.readlines()[0], wanted)
 
 def test_suite():
     return unittest.makeSuite(CoreTestCase)

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_cygwinccompiler.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_cygwinccompiler.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_cygwinccompiler.py	Mon Nov 22 12:00:42 2010
@@ -66,82 +66,82 @@
         sys.version = ('2.6.1 (r261:67515, Dec  6 2008, 16:42:21) \n[GCC '
                        '4.0.1 (Apple Computer, Inc. build 5370)]')
 
-        self.assertEquals(check_config_h()[0], CONFIG_H_OK)
+        self.assertEqual(check_config_h()[0], CONFIG_H_OK)
 
         # then it tries to see if it can find "__GNUC__" in pyconfig.h
         sys.version = 'something without the *CC word'
 
         # if the file doesn't exist it returns  CONFIG_H_UNCERTAIN
-        self.assertEquals(check_config_h()[0], CONFIG_H_UNCERTAIN)
+        self.assertEqual(check_config_h()[0], CONFIG_H_UNCERTAIN)
 
         # if it exists but does not contain __GNUC__, it returns CONFIG_H_NOTOK
         self.write_file(self.python_h, 'xxx')
-        self.assertEquals(check_config_h()[0], CONFIG_H_NOTOK)
+        self.assertEqual(check_config_h()[0], CONFIG_H_NOTOK)
 
         # and CONFIG_H_OK if __GNUC__ is found
         self.write_file(self.python_h, 'xxx __GNUC__ xxx')
-        self.assertEquals(check_config_h()[0], CONFIG_H_OK)
+        self.assertEqual(check_config_h()[0], CONFIG_H_OK)
 
     def test_get_versions(self):
 
         # get_versions calls distutils.spawn.find_executable on
         # 'gcc', 'ld' and 'dllwrap'
-        self.assertEquals(get_versions(), (None, None, None))
+        self.assertEqual(get_versions(), (None, None, None))
 
         # Let's fake we have 'gcc' and it returns '3.4.5'
         self._exes['gcc'] = b'gcc (GCC) 3.4.5 (mingw special)\nFSF'
         res = get_versions()
-        self.assertEquals(str(res[0]), '3.4.5')
+        self.assertEqual(str(res[0]), '3.4.5')
 
         # and let's see what happens when the version
         # doesn't match the regular expression
         # (\d+\.\d+(\.\d+)*)
         self._exes['gcc'] = b'very strange output'
         res = get_versions()
-        self.assertEquals(res[0], None)
+        self.assertEqual(res[0], None)
 
         # same thing for ld
         self._exes['ld'] = b'GNU ld version 2.17.50 20060824'
         res = get_versions()
-        self.assertEquals(str(res[1]), '2.17.50')
+        self.assertEqual(str(res[1]), '2.17.50')
         self._exes['ld'] = b'@(#)PROGRAM:ld  PROJECT:ld64-77'
         res = get_versions()
-        self.assertEquals(res[1], None)
+        self.assertEqual(res[1], None)
 
         # and dllwrap
         self._exes['dllwrap'] = b'GNU dllwrap 2.17.50 20060824\nFSF'
         res = get_versions()
-        self.assertEquals(str(res[2]), '2.17.50')
+        self.assertEqual(str(res[2]), '2.17.50')
         self._exes['dllwrap'] = b'Cheese Wrap'
         res = get_versions()
-        self.assertEquals(res[2], None)
+        self.assertEqual(res[2], None)
 
     def test_get_msvcr(self):
 
         # none
         sys.version  = ('2.6.1 (r261:67515, Dec  6 2008, 16:42:21) '
                         '\n[GCC 4.0.1 (Apple Computer, Inc. build 5370)]')
-        self.assertEquals(get_msvcr(), None)
+        self.assertEqual(get_msvcr(), None)
 
         # MSVC 7.0
         sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
                        '[MSC v.1300 32 bits (Intel)]')
-        self.assertEquals(get_msvcr(), ['msvcr70'])
+        self.assertEqual(get_msvcr(), ['msvcr70'])
 
         # MSVC 7.1
         sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
                        '[MSC v.1310 32 bits (Intel)]')
-        self.assertEquals(get_msvcr(), ['msvcr71'])
+        self.assertEqual(get_msvcr(), ['msvcr71'])
 
         # VS2005 / MSVC 8.0
         sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
                        '[MSC v.1400 32 bits (Intel)]')
-        self.assertEquals(get_msvcr(), ['msvcr80'])
+        self.assertEqual(get_msvcr(), ['msvcr80'])
 
         # VS2008 / MSVC 9.0
         sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
                        '[MSC v.1500 32 bits (Intel)]')
-        self.assertEquals(get_msvcr(), ['msvcr90'])
+        self.assertEqual(get_msvcr(), ['msvcr90'])
 
         # unknown
         sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_dep_util.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_dep_util.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_dep_util.py	Mon Nov 22 12:00:42 2010
@@ -43,8 +43,8 @@
         self.write_file(two)
         self.write_file(four)
 
-        self.assertEquals(newer_pairwise([one, two], [three, four]),
-                          ([one],[three]))
+        self.assertEqual(newer_pairwise([one, two], [three, four]),
+                         ([one],[three]))
 
     def test_newer_group(self):
         tmpdir = self.mkdtemp()

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_dir_util.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_dir_util.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_dir_util.py	Mon Nov 22 12:00:42 2010
@@ -38,18 +38,18 @@
 
         mkpath(self.target, verbose=0)
         wanted = []
-        self.assertEquals(self._logs, wanted)
+        self.assertEqual(self._logs, wanted)
         remove_tree(self.root_target, verbose=0)
 
         mkpath(self.target, verbose=1)
         wanted = ['creating %s' % self.root_target,
                   'creating %s' % self.target]
-        self.assertEquals(self._logs, wanted)
+        self.assertEqual(self._logs, wanted)
         self._logs = []
 
         remove_tree(self.root_target, verbose=1)
         wanted = ["removing '%s' (and everything under it)" % self.root_target]
-        self.assertEquals(self._logs, wanted)
+        self.assertEqual(self._logs, wanted)
 
     @unittest.skipIf(sys.platform.startswith('win'),
                         "This test is only appropriate for POSIX-like systems.")
@@ -67,12 +67,12 @@
     def test_create_tree_verbosity(self):
 
         create_tree(self.root_target, ['one', 'two', 'three'], verbose=0)
-        self.assertEquals(self._logs, [])
+        self.assertEqual(self._logs, [])
         remove_tree(self.root_target, verbose=0)
 
         wanted = ['creating %s' % self.root_target]
         create_tree(self.root_target, ['one', 'two', 'three'], verbose=1)
-        self.assertEquals(self._logs, wanted)
+        self.assertEqual(self._logs, wanted)
 
         remove_tree(self.root_target, verbose=0)
 
@@ -82,7 +82,7 @@
         mkpath(self.target, verbose=0)
 
         copy_tree(self.target, self.target2, verbose=0)
-        self.assertEquals(self._logs, [])
+        self.assertEqual(self._logs, [])
 
         remove_tree(self.root_target, verbose=0)
 
@@ -96,18 +96,18 @@
 
         wanted = ['copying %s -> %s' % (a_file, self.target2)]
         copy_tree(self.target, self.target2, verbose=1)
-        self.assertEquals(self._logs, wanted)
+        self.assertEqual(self._logs, wanted)
 
         remove_tree(self.root_target, verbose=0)
         remove_tree(self.target2, verbose=0)
 
     def test_ensure_relative(self):
         if os.sep == '/':
-            self.assertEquals(ensure_relative('/home/foo'), 'home/foo')
-            self.assertEquals(ensure_relative('some/path'), 'some/path')
+            self.assertEqual(ensure_relative('/home/foo'), 'home/foo')
+            self.assertEqual(ensure_relative('some/path'), 'some/path')
         else:   # \\
-            self.assertEquals(ensure_relative('c:\\home\\foo'), 'c:home\\foo')
-            self.assertEquals(ensure_relative('home\\foo'), 'home\\foo')
+            self.assertEqual(ensure_relative('c:\\home\\foo'), 'c:home\\foo')
+            self.assertEqual(ensure_relative('home\\foo'), 'home\\foo')
 
 def test_suite():
     return unittest.makeSuite(DirUtilTestCase)

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_dist.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_dist.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_dist.py	Mon Nov 22 12:00:42 2010
@@ -124,7 +124,7 @@
         finally:
             warnings.warn = old_warn
 
-        self.assertEquals(len(warns), 0)
+        self.assertEqual(len(warns), 0)
 
     def test_finalize_options(self):
 
@@ -135,20 +135,20 @@
         dist.finalize_options()
 
         # finalize_option splits platforms and keywords
-        self.assertEquals(dist.metadata.platforms, ['one', 'two'])
-        self.assertEquals(dist.metadata.keywords, ['one', 'two'])
+        self.assertEqual(dist.metadata.platforms, ['one', 'two'])
+        self.assertEqual(dist.metadata.keywords, ['one', 'two'])
 
     def test_get_command_packages(self):
         dist = Distribution()
-        self.assertEquals(dist.command_packages, None)
+        self.assertEqual(dist.command_packages, None)
         cmds = dist.get_command_packages()
-        self.assertEquals(cmds, ['distutils.command'])
-        self.assertEquals(dist.command_packages,
-                          ['distutils.command'])
+        self.assertEqual(cmds, ['distutils.command'])
+        self.assertEqual(dist.command_packages,
+                         ['distutils.command'])
 
         dist.command_packages = 'one,two'
         cmds = dist.get_command_packages()
-        self.assertEquals(cmds, ['distutils.command', 'one', 'two'])
+        self.assertEqual(cmds, ['distutils.command', 'one', 'two'])
 
 
     def test_announce(self):
@@ -287,8 +287,8 @@
     def test_fix_help_options(self):
         help_tuples = [('a', 'b', 'c', 'd'), (1, 2, 3, 4)]
         fancy_options = fix_help_options(help_tuples)
-        self.assertEquals(fancy_options[0], ('a', 'b', 'c'))
-        self.assertEquals(fancy_options[1], (1, 2, 3))
+        self.assertEqual(fancy_options[0], ('a', 'b', 'c'))
+        self.assertEqual(fancy_options[1], (1, 2, 3))
 
     def test_show_help(self):
         # smoke test, just makes sure some help is displayed

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_extension.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_extension.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_extension.py	Mon Nov 22 12:00:42 2010
@@ -28,38 +28,38 @@
                   'rect', 'rwobject', 'scrap', 'surface', 'surflock',
                   'time', 'transform']
 
-        self.assertEquals(names, wanted)
+        self.assertEqual(names, wanted)
 
     def test_extension_init(self):
         # the first argument, which is the name, must be a string
         self.assertRaises(AssertionError, Extension, 1, [])
         ext = Extension('name', [])
-        self.assertEquals(ext.name, 'name')
+        self.assertEqual(ext.name, 'name')
 
         # the second argument, which is the list of files, must
         # be a list of strings
         self.assertRaises(AssertionError, Extension, 'name', 'file')
         self.assertRaises(AssertionError, Extension, 'name', ['file', 1])
         ext = Extension('name', ['file1', 'file2'])
-        self.assertEquals(ext.sources, ['file1', 'file2'])
+        self.assertEqual(ext.sources, ['file1', 'file2'])
 
         # others arguments have defaults
         for attr in ('include_dirs', 'define_macros', 'undef_macros',
                      'library_dirs', 'libraries', 'runtime_library_dirs',
                      'extra_objects', 'extra_compile_args', 'extra_link_args',
                      'export_symbols', 'swig_opts', 'depends'):
-            self.assertEquals(getattr(ext, attr), [])
+            self.assertEqual(getattr(ext, attr), [])
 
-        self.assertEquals(ext.language, None)
-        self.assertEquals(ext.optional, None)
+        self.assertEqual(ext.language, None)
+        self.assertEqual(ext.optional, None)
 
         # if there are unknown keyword options, warn about them
         with check_warnings() as w:
             warnings.simplefilter('always')
             ext = Extension('name', ['file1', 'file2'], chic=True)
 
-        self.assertEquals(len(w.warnings), 1)
-        self.assertEquals(str(w.warnings[0].message),
+        self.assertEqual(len(w.warnings), 1)
+        self.assertEqual(str(w.warnings[0].message),
                           "Unknown Extension options: 'chic'")
 
 def test_suite():

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_file_util.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_file_util.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_file_util.py	Mon Nov 22 12:00:42 2010
@@ -39,14 +39,14 @@
 
         move_file(self.source, self.target, verbose=0)
         wanted = []
-        self.assertEquals(self._logs, wanted)
+        self.assertEqual(self._logs, wanted)
 
         # back to original state
         move_file(self.target, self.source, verbose=0)
 
         move_file(self.source, self.target, verbose=1)
         wanted = ['moving %s -> %s' % (self.source, self.target)]
-        self.assertEquals(self._logs, wanted)
+        self.assertEqual(self._logs, wanted)
 
         # back to original state
         move_file(self.target, self.source, verbose=0)
@@ -56,7 +56,7 @@
         os.mkdir(self.target_dir)
         move_file(self.source, self.target_dir, verbose=1)
         wanted = ['moving %s -> %s' % (self.source, self.target_dir)]
-        self.assertEquals(self._logs, wanted)
+        self.assertEqual(self._logs, wanted)
 
 
 def test_suite():

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_filelist.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_filelist.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_filelist.py	Mon Nov 22 12:00:42 2010
@@ -9,29 +9,29 @@
 
     def test_glob_to_re(self):
         # simple cases
-        self.assertEquals(glob_to_re('foo*'), 'foo[^/]*\\Z(?ms)')
-        self.assertEquals(glob_to_re('foo?'), 'foo[^/]\\Z(?ms)')
-        self.assertEquals(glob_to_re('foo??'), 'foo[^/][^/]\\Z(?ms)')
+        self.assertEqual(glob_to_re('foo*'), 'foo[^/]*\\Z(?ms)')
+        self.assertEqual(glob_to_re('foo?'), 'foo[^/]\\Z(?ms)')
+        self.assertEqual(glob_to_re('foo??'), 'foo[^/][^/]\\Z(?ms)')
 
         # special cases
-        self.assertEquals(glob_to_re(r'foo\\*'), r'foo\\\\[^/]*\Z(?ms)')
-        self.assertEquals(glob_to_re(r'foo\\\*'), r'foo\\\\\\[^/]*\Z(?ms)')
-        self.assertEquals(glob_to_re('foo????'), r'foo[^/][^/][^/][^/]\Z(?ms)')
-        self.assertEquals(glob_to_re(r'foo\\??'), r'foo\\\\[^/][^/]\Z(?ms)')
+        self.assertEqual(glob_to_re(r'foo\\*'), r'foo\\\\[^/]*\Z(?ms)')
+        self.assertEqual(glob_to_re(r'foo\\\*'), r'foo\\\\\\[^/]*\Z(?ms)')
+        self.assertEqual(glob_to_re('foo????'), r'foo[^/][^/][^/][^/]\Z(?ms)')
+        self.assertEqual(glob_to_re(r'foo\\??'), r'foo\\\\[^/][^/]\Z(?ms)')
 
     def test_debug_print(self):
         file_list = FileList()
         with captured_stdout() as stdout:
             file_list.debug_print('xxx')
         stdout.seek(0)
-        self.assertEquals(stdout.read(), '')
+        self.assertEqual(stdout.read(), '')
 
         debug.DEBUG = True
         try:
             with captured_stdout() as stdout:
                 file_list.debug_print('xxx')
             stdout.seek(0)
-            self.assertEquals(stdout.read(), 'xxx\n')
+            self.assertEqual(stdout.read(), 'xxx\n')
         finally:
             debug.DEBUG = False
 

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_install.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_install.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_install.py	Mon Nov 22 12:00:42 2010
@@ -123,23 +123,23 @@
 
         # two elements
         cmd.handle_extra_path()
-        self.assertEquals(cmd.extra_path, ['path', 'dirs'])
-        self.assertEquals(cmd.extra_dirs, 'dirs')
-        self.assertEquals(cmd.path_file, 'path')
+        self.assertEqual(cmd.extra_path, ['path', 'dirs'])
+        self.assertEqual(cmd.extra_dirs, 'dirs')
+        self.assertEqual(cmd.path_file, 'path')
 
         # one element
         cmd.extra_path = ['path']
         cmd.handle_extra_path()
-        self.assertEquals(cmd.extra_path, ['path'])
-        self.assertEquals(cmd.extra_dirs, 'path')
-        self.assertEquals(cmd.path_file, 'path')
+        self.assertEqual(cmd.extra_path, ['path'])
+        self.assertEqual(cmd.extra_dirs, 'path')
+        self.assertEqual(cmd.path_file, 'path')
 
         # none
         dist.extra_path = cmd.extra_path = None
         cmd.handle_extra_path()
-        self.assertEquals(cmd.extra_path, None)
-        self.assertEquals(cmd.extra_dirs, '')
-        self.assertEquals(cmd.path_file, None)
+        self.assertEqual(cmd.extra_path, None)
+        self.assertEqual(cmd.extra_dirs, '')
+        self.assertEqual(cmd.path_file, None)
 
         # three elements (no way !)
         cmd.extra_path = 'path,dirs,again'
@@ -184,7 +184,7 @@
         # line (the egg info file)
         f = open(cmd.record)
         try:
-            self.assertEquals(len(f.readlines()), 1)
+            self.assertEqual(len(f.readlines()), 1)
         finally:
             f.close()
 

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_install_data.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_install_data.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_install_data.py	Mon Nov 22 12:00:42 2010
@@ -28,14 +28,14 @@
         self.write_file(two, 'xxx')
 
         cmd.data_files = [one, (inst2, [two])]
-        self.assertEquals(cmd.get_inputs(), [one, (inst2, [two])])
+        self.assertEqual(cmd.get_inputs(), [one, (inst2, [two])])
 
         # let's run the command
         cmd.ensure_finalized()
         cmd.run()
 
         # let's check the result
-        self.assertEquals(len(cmd.get_outputs()), 2)
+        self.assertEqual(len(cmd.get_outputs()), 2)
         rtwo = os.path.split(two)[-1]
         self.assertTrue(os.path.exists(os.path.join(inst2, rtwo)))
         rone = os.path.split(one)[-1]
@@ -48,7 +48,7 @@
         cmd.run()
 
         # let's check the result
-        self.assertEquals(len(cmd.get_outputs()), 2)
+        self.assertEqual(len(cmd.get_outputs()), 2)
         self.assertTrue(os.path.exists(os.path.join(inst2, rtwo)))
         self.assertTrue(os.path.exists(os.path.join(inst, rone)))
         cmd.outfiles = []
@@ -66,7 +66,7 @@
         cmd.run()
 
         # let's check the result
-        self.assertEquals(len(cmd.get_outputs()), 4)
+        self.assertEqual(len(cmd.get_outputs()), 4)
         self.assertTrue(os.path.exists(os.path.join(inst2, rtwo)))
         self.assertTrue(os.path.exists(os.path.join(inst, rone)))
 

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_install_headers.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_install_headers.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_install_headers.py	Mon Nov 22 12:00:42 2010
@@ -24,7 +24,7 @@
 
         pkg_dir, dist = self.create_dist(headers=headers)
         cmd = install_headers(dist)
-        self.assertEquals(cmd.get_inputs(), headers)
+        self.assertEqual(cmd.get_inputs(), headers)
 
         # let's run the command
         cmd.install_dir = os.path.join(pkg_dir, 'inst')
@@ -32,7 +32,7 @@
         cmd.run()
 
         # let's check the results
-        self.assertEquals(len(cmd.get_outputs()), 2)
+        self.assertEqual(len(cmd.get_outputs()), 2)
 
 def test_suite():
     return unittest.makeSuite(InstallHeadersTestCase)

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_install_lib.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_install_lib.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_install_lib.py	Mon Nov 22 12:00:42 2010
@@ -19,8 +19,8 @@
         cmd = install_lib(dist)
 
         cmd.finalize_options()
-        self.assertEquals(cmd.compile, 1)
-        self.assertEquals(cmd.optimize, 0)
+        self.assertEqual(cmd.compile, 1)
+        self.assertEqual(cmd.optimize, 0)
 
         # optimize must be 0, 1, or 2
         cmd.optimize = 'foo'
@@ -30,7 +30,7 @@
 
         cmd.optimize = '2'
         cmd.finalize_options()
-        self.assertEquals(cmd.optimize, 2)
+        self.assertEqual(cmd.optimize, 2)
 
     @unittest.skipUnless(not sys.dont_write_bytecode,
                          'byte-compile not supported')
@@ -77,7 +77,7 @@
         cmd.distribution.script_name = 'setup.py'
 
         # get_input should return 2 elements
-        self.assertEquals(len(cmd.get_inputs()), 2)
+        self.assertEqual(len(cmd.get_inputs()), 2)
 
     def test_dont_write_bytecode(self):
         # makes sure byte_compile is not used

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_log.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_log.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_log.py	Mon Nov 22 12:00:42 2010
@@ -23,9 +23,9 @@
                 log.debug("debug:\xe9")
                 log.fatal("fatal:\xe9")
                 stdout.seek(0)
-                self.assertEquals(stdout.read().rstrip(), "debug:\\xe9")
+                self.assertEqual(stdout.read().rstrip(), "debug:\\xe9")
                 stderr.seek(0)
-                self.assertEquals(stderr.read().rstrip(), "fatal:\\xe9")
+                self.assertEqual(stderr.read().rstrip(), "fatal:\\xe9")
         finally:
             sys.stdout = old_stdout
             sys.stderr = old_stderr

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_msvc9compiler.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_msvc9compiler.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_msvc9compiler.py	Mon Nov 22 12:00:42 2010
@@ -104,7 +104,7 @@
         import winreg
         HKCU = winreg.HKEY_CURRENT_USER
         keys = Reg.read_keys(HKCU, 'xxxx')
-        self.assertEquals(keys, None)
+        self.assertEqual(keys, None)
 
         keys = Reg.read_keys(HKCU, r'Control Panel')
         self.assertTrue('Desktop' in keys)
@@ -131,7 +131,7 @@
             f.close()
 
         # makes sure the manifest was properly cleaned
-        self.assertEquals(content, _CLEANED_MANIFEST)
+        self.assertEqual(content, _CLEANED_MANIFEST)
 
 
 def test_suite():

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_register.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_register.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_register.py	Mon Nov 22 12:00:42 2010
@@ -121,7 +121,7 @@
         f = open(self.rc)
         try:
             content = f.read()
-            self.assertEquals(content, WANTED_PYPIRC)
+            self.assertEqual(content, WANTED_PYPIRC)
         finally:
             f.close()
 
@@ -141,8 +141,8 @@
         req1 = dict(self.conn.reqs[0].headers)
         req2 = dict(self.conn.reqs[1].headers)
 
-        self.assertEquals(req1['Content-length'], '1374')
-        self.assertEquals(req2['Content-length'], '1374')
+        self.assertEqual(req1['Content-length'], '1374')
+        self.assertEqual(req2['Content-length'], '1374')
         self.assertTrue((b'xxx') in self.conn.reqs[1].data)
 
     def test_password_not_in_file(self):
@@ -155,7 +155,7 @@
 
         # dist.password should be set
         # therefore used afterwards by other commands
-        self.assertEquals(cmd.distribution.password, 'password')
+        self.assertEqual(cmd.distribution.password, 'password')
 
     def test_registering(self):
         # this test runs choice 2
@@ -172,7 +172,7 @@
         self.assertTrue(self.conn.reqs, 1)
         req = self.conn.reqs[0]
         headers = dict(req.headers)
-        self.assertEquals(headers['Content-length'], '608')
+        self.assertEqual(headers['Content-length'], '608')
         self.assertTrue((b'tarek') in req.data)
 
     def test_password_reset(self):
@@ -190,7 +190,7 @@
         self.assertTrue(self.conn.reqs, 1)
         req = self.conn.reqs[0]
         headers = dict(req.headers)
-        self.assertEquals(headers['Content-length'], '290')
+        self.assertEqual(headers['Content-length'], '290')
         self.assertTrue((b'tarek') in req.data)
 
     def test_strict(self):
@@ -253,7 +253,7 @@
         with check_warnings() as w:
             warnings.simplefilter("always")
             cmd.check_metadata()
-            self.assertEquals(len(w.warnings), 1)
+            self.assertEqual(len(w.warnings), 1)
 
 def test_suite():
     return unittest.makeSuite(RegisterTestCase)

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_sdist.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_sdist.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_sdist.py	Mon Nov 22 12:00:42 2010
@@ -108,7 +108,7 @@
         # now let's check what we have
         dist_folder = join(self.tmp_dir, 'dist')
         files = os.listdir(dist_folder)
-        self.assertEquals(files, ['fake-1.0.zip'])
+        self.assertEqual(files, ['fake-1.0.zip'])
 
         zip_file = zipfile.ZipFile(join(dist_folder, 'fake-1.0.zip'))
         try:
@@ -117,7 +117,7 @@
             zip_file.close()
 
         # making sure everything has been pruned correctly
-        self.assertEquals(len(content), 4)
+        self.assertEqual(len(content), 4)
 
     def test_make_distribution(self):
 
@@ -138,8 +138,7 @@
         dist_folder = join(self.tmp_dir, 'dist')
         result = os.listdir(dist_folder)
         result.sort()
-        self.assertEquals(result,
-                          ['fake-1.0.tar', 'fake-1.0.tar.gz'] )
+        self.assertEqual(result, ['fake-1.0.tar', 'fake-1.0.tar.gz'] )
 
         os.remove(join(dist_folder, 'fake-1.0.tar'))
         os.remove(join(dist_folder, 'fake-1.0.tar.gz'))
@@ -152,8 +151,7 @@
 
         result = os.listdir(dist_folder)
         result.sort()
-        self.assertEquals(result,
-                ['fake-1.0.tar', 'fake-1.0.tar.gz'])
+        self.assertEqual(result, ['fake-1.0.tar', 'fake-1.0.tar.gz'])
 
     def test_add_defaults(self):
 
@@ -201,7 +199,7 @@
         # now let's check what we have
         dist_folder = join(self.tmp_dir, 'dist')
         files = os.listdir(dist_folder)
-        self.assertEquals(files, ['fake-1.0.zip'])
+        self.assertEqual(files, ['fake-1.0.zip'])
 
         zip_file = zipfile.ZipFile(join(dist_folder, 'fake-1.0.zip'))
         try:
@@ -210,13 +208,13 @@
             zip_file.close()
 
         # making sure everything was added
-        self.assertEquals(len(content), 11)
+        self.assertEqual(len(content), 11)
 
         # checking the MANIFEST
         f = open(join(self.tmp_dir, 'MANIFEST'))
         try:
             manifest = f.read()
-            self.assertEquals(manifest, MANIFEST % {'sep': os.sep})
+            self.assertEqual(manifest, MANIFEST % {'sep': os.sep})
         finally:
             f.close()
 
@@ -229,7 +227,7 @@
         cmd.ensure_finalized()
         cmd.run()
         warnings = self.get_logs(WARN)
-        self.assertEquals(len(warnings), 2)
+        self.assertEqual(len(warnings), 2)
 
         # trying with a complete set of metadata
         self.clear_logs()
@@ -238,7 +236,7 @@
         cmd.metadata_check = 0
         cmd.run()
         warnings = self.get_logs(WARN)
-        self.assertEquals(len(warnings), 0)
+        self.assertEqual(len(warnings), 0)
 
     def test_check_metadata_deprecated(self):
         # makes sure make_metadata is deprecated
@@ -246,7 +244,7 @@
         with check_warnings() as w:
             warnings.simplefilter("always")
             cmd.check_metadata()
-            self.assertEquals(len(w.warnings), 1)
+            self.assertEqual(len(w.warnings), 1)
 
     def test_show_formats(self):
         with captured_stdout() as stdout:
@@ -256,7 +254,7 @@
         num_formats = len(ARCHIVE_FORMATS.keys())
         output = [line for line in stdout.getvalue().split('\n')
                   if line.strip().startswith('--formats=')]
-        self.assertEquals(len(output), num_formats)
+        self.assertEqual(len(output), num_formats)
 
     def test_finalize_options(self):
 
@@ -264,9 +262,9 @@
         cmd.finalize_options()
 
         # default options set by finalize
-        self.assertEquals(cmd.manifest, 'MANIFEST')
-        self.assertEquals(cmd.template, 'MANIFEST.in')
-        self.assertEquals(cmd.dist_dir, 'dist')
+        self.assertEqual(cmd.manifest, 'MANIFEST')
+        self.assertEqual(cmd.template, 'MANIFEST.in')
+        self.assertEqual(cmd.dist_dir, 'dist')
 
         # formats has to be a string splitable on (' ', ',') or
         # a stringlist
@@ -297,7 +295,7 @@
         finally:
             f.close()
 
-        self.assertEquals(len(manifest), 5)
+        self.assertEqual(len(manifest), 5)
 
         # adding a file
         self.write_file((self.tmp_dir, 'somecode', 'doc2.txt'), '#')
@@ -317,7 +315,7 @@
             f.close()
 
         # do we have the new file in MANIFEST ?
-        self.assertEquals(len(manifest2), 6)
+        self.assertEqual(len(manifest2), 6)
         self.assertIn('doc2.txt', manifest2[-1])
 
     def test_manifest_marker(self):

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_spawn.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_spawn.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_spawn.py	Mon Nov 22 12:00:42 2010
@@ -20,7 +20,7 @@
                                (['nochange', 'nospace'],
                                 ['nochange', 'nospace'])):
             res = _nt_quote_args(args)
-            self.assertEquals(res, wanted)
+            self.assertEqual(res, wanted)
 
 
     @unittest.skipUnless(os.name in ('nt', 'posix'),

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_sysconfig.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_sysconfig.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_sysconfig.py	Mon Nov 22 12:00:42 2010
@@ -1,5 +1,6 @@
 """Tests for distutils.sysconfig."""
 import os
+import shutil
 import test
 import unittest
 
@@ -70,7 +71,7 @@
 
         comp = compiler()
         sysconfig.customize_compiler(comp)
-        self.assertEquals(comp.exes['archiver'], 'my_ar -arflags')
+        self.assertEqual(comp.exes['archiver'], 'my_ar -arflags')
 
     def test_parse_makefile_base(self):
         self.makefile = TESTFN
@@ -81,8 +82,8 @@
         finally:
             fd.close()
         d = sysconfig.parse_makefile(self.makefile)
-        self.assertEquals(d, {'CONFIG_ARGS': "'--arg1=optarg1' 'ENV=LIB'",
-                              'OTHER': 'foo'})
+        self.assertEqual(d, {'CONFIG_ARGS': "'--arg1=optarg1' 'ENV=LIB'",
+                             'OTHER': 'foo'})
 
     def test_parse_makefile_literal_dollar(self):
         self.makefile = TESTFN
@@ -93,16 +94,16 @@
         finally:
             fd.close()
         d = sysconfig.parse_makefile(self.makefile)
-        self.assertEquals(d, {'CONFIG_ARGS': r"'--arg1=optarg1' 'ENV=\$LIB'",
-                              'OTHER': 'foo'})
+        self.assertEqual(d, {'CONFIG_ARGS': r"'--arg1=optarg1' 'ENV=\$LIB'",
+                             'OTHER': 'foo'})
 
 
     def test_sysconfig_module(self):
         import sysconfig as global_sysconfig
-        self.assertEquals(global_sysconfig.get_config_var('CFLAGS'), sysconfig.get_config_var('CFLAGS'))
-        self.assertEquals(global_sysconfig.get_config_var('LDFLAGS'), sysconfig.get_config_var('LDFLAGS'))
-        self.assertEquals(global_sysconfig.get_config_var('LDSHARED'),sysconfig.get_config_var('LDSHARED'))
-        self.assertEquals(global_sysconfig.get_config_var('CC'), sysconfig.get_config_var('CC'))
+        self.assertEqual(global_sysconfig.get_config_var('CFLAGS'), sysconfig.get_config_var('CFLAGS'))
+        self.assertEqual(global_sysconfig.get_config_var('LDFLAGS'), sysconfig.get_config_var('LDFLAGS'))
+        self.assertEqual(global_sysconfig.get_config_var('LDSHARED'),sysconfig.get_config_var('LDSHARED'))
+        self.assertEqual(global_sysconfig.get_config_var('CC'), sysconfig.get_config_var('CC'))
 
 
 

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_text_file.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_text_file.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_text_file.py	Mon Nov 22 12:00:42 2010
@@ -49,7 +49,7 @@
 
         def test_input(count, description, file, expected_result):
             result = file.readlines()
-            self.assertEquals(result, expected_result)
+            self.assertEqual(result, expected_result)
 
         tmpdir = self.mkdtemp()
         filename = os.path.join(tmpdir, "test.txt")

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_upload.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_upload.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_upload.py	Mon Nov 22 12:00:42 2010
@@ -89,7 +89,7 @@
         for attr, waited in (('username', 'me'), ('password', 'secret'),
                              ('realm', 'pypi'),
                              ('repository', 'http://pypi.python.org/pypi')):
-            self.assertEquals(getattr(cmd, attr), waited)
+            self.assertEqual(getattr(cmd, attr), waited)
 
     def test_saved_password(self):
         # file with no password
@@ -99,14 +99,14 @@
         dist = Distribution()
         cmd = upload(dist)
         cmd.finalize_options()
-        self.assertEquals(cmd.password, None)
+        self.assertEqual(cmd.password, None)
 
         # make sure we get it as well, if another command
         # initialized it at the dist level
         dist.password = 'xxx'
         cmd = upload(dist)
         cmd.finalize_options()
-        self.assertEquals(cmd.password, 'xxx')
+        self.assertEqual(cmd.password, 'xxx')
 
     def test_upload(self):
         tmp = self.mkdtemp()
@@ -124,12 +124,12 @@
 
         # what did we send ?
         headers = dict(self.conn.headers)
-        self.assertEquals(headers['Content-length'], '2087')
+        self.assertEqual(headers['Content-length'], '2087')
         self.assertTrue(headers['Content-type'].startswith('multipart/form-data'))
         self.assertFalse('\n' in headers['Authorization'])
 
-        self.assertEquals(self.conn.requests, [('POST', '/pypi')])
-        self.assert_((b'xxx') in self.conn.body)
+        self.assertEqual(self.conn.requests, [('POST', '/pypi')])
+        self.assertTrue((b'xxx') in self.conn.body)
 
 def test_suite():
     return unittest.makeSuite(uploadTestCase)

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_util.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_util.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_util.py	Mon Nov 22 12:00:42 2010
@@ -67,21 +67,21 @@
         sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
                        '[MSC v.1310 32 bit (Intel)]')
         sys.platform = 'win32'
-        self.assertEquals(get_platform(), 'win32')
+        self.assertEqual(get_platform(), 'win32')
 
         # windows XP, amd64
         os.name = 'nt'
         sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
                        '[MSC v.1310 32 bit (Amd64)]')
         sys.platform = 'win32'
-        self.assertEquals(get_platform(), 'win-amd64')
+        self.assertEqual(get_platform(), 'win-amd64')
 
         # windows XP, itanium
         os.name = 'nt'
         sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
                        '[MSC v.1310 32 bit (Itanium)]')
         sys.platform = 'win32'
-        self.assertEquals(get_platform(), 'win-ia64')
+        self.assertEqual(get_platform(), 'win-ia64')
 
         # macbook
         os.name = 'posix'
@@ -100,7 +100,7 @@
         cursize = sys.maxsize
         sys.maxsize = (2 ** 31)-1
         try:
-            self.assertEquals(get_platform(), 'macosx-10.3-i386')
+            self.assertEqual(get_platform(), 'macosx-10.3-i386')
         finally:
             sys.maxsize = cursize
 
@@ -111,33 +111,33 @@
                                        '-fno-strict-aliasing -fno-common '
                                        '-dynamic -DNDEBUG -g -O3')
 
-        self.assertEquals(get_platform(), 'macosx-10.4-fat')
+        self.assertEqual(get_platform(), 'macosx-10.4-fat')
 
         get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch i386 -isysroot '
                                        '/Developer/SDKs/MacOSX10.4u.sdk  '
                                        '-fno-strict-aliasing -fno-common '
                                        '-dynamic -DNDEBUG -g -O3')
 
-        self.assertEquals(get_platform(), 'macosx-10.4-intel')
+        self.assertEqual(get_platform(), 'macosx-10.4-intel')
 
         get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc -arch i386 -isysroot '
                                        '/Developer/SDKs/MacOSX10.4u.sdk  '
                                        '-fno-strict-aliasing -fno-common '
                                        '-dynamic -DNDEBUG -g -O3')
-        self.assertEquals(get_platform(), 'macosx-10.4-fat3')
+        self.assertEqual(get_platform(), 'macosx-10.4-fat3')
 
         get_config_vars()['CFLAGS'] = ('-arch ppc64 -arch x86_64 -arch ppc -arch i386 -isysroot '
                                        '/Developer/SDKs/MacOSX10.4u.sdk  '
                                        '-fno-strict-aliasing -fno-common '
                                        '-dynamic -DNDEBUG -g -O3')
-        self.assertEquals(get_platform(), 'macosx-10.4-universal')
+        self.assertEqual(get_platform(), 'macosx-10.4-universal')
 
         get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc64 -isysroot '
                                        '/Developer/SDKs/MacOSX10.4u.sdk  '
                                        '-fno-strict-aliasing -fno-common '
                                        '-dynamic -DNDEBUG -g -O3')
 
-        self.assertEquals(get_platform(), 'macosx-10.4-fat64')
+        self.assertEqual(get_platform(), 'macosx-10.4-fat64')
 
         for arch in ('ppc', 'i386', 'x86_64', 'ppc64'):
             get_config_vars()['CFLAGS'] = ('-arch %s -isysroot '
@@ -145,7 +145,7 @@
                                            '-fno-strict-aliasing -fno-common '
                                            '-dynamic -DNDEBUG -g -O3'%(arch,))
 
-            self.assertEquals(get_platform(), 'macosx-10.4-%s'%(arch,))
+            self.assertEqual(get_platform(), 'macosx-10.4-%s'%(arch,))
 
         # linux debian sarge
         os.name = 'posix'
@@ -155,7 +155,7 @@
         self._set_uname(('Linux', 'aglae', '2.6.21.1dedibox-r7',
                     '#1 Mon Apr 30 17:25:38 CEST 2007', 'i686'))
 
-        self.assertEquals(get_platform(), 'linux-i686')
+        self.assertEqual(get_platform(), 'linux-i686')
 
         # XXX more platforms to tests here
 
@@ -166,8 +166,8 @@
             return '/'.join(path)
         os.path.join = _join
 
-        self.assertEquals(convert_path('/home/to/my/stuff'),
-                          '/home/to/my/stuff')
+        self.assertEqual(convert_path('/home/to/my/stuff'),
+                         '/home/to/my/stuff')
 
         # win
         os.sep = '\\'
@@ -178,10 +178,10 @@
         self.assertRaises(ValueError, convert_path, '/home/to/my/stuff')
         self.assertRaises(ValueError, convert_path, 'home/to/my/stuff/')
 
-        self.assertEquals(convert_path('home/to/my/stuff'),
-                          'home\\to\\my\\stuff')
-        self.assertEquals(convert_path('.'),
-                          os.curdir)
+        self.assertEqual(convert_path('home/to/my/stuff'),
+                         'home\\to\\my\\stuff')
+        self.assertEqual(convert_path('.'),
+                         os.curdir)
 
     def test_change_root(self):
         # linux/mac
@@ -193,10 +193,10 @@
             return '/'.join(path)
         os.path.join = _join
 
-        self.assertEquals(change_root('/root', '/old/its/here'),
-                          '/root/old/its/here')
-        self.assertEquals(change_root('/root', 'its/here'),
-                          '/root/its/here')
+        self.assertEqual(change_root('/root', '/old/its/here'),
+                         '/root/old/its/here')
+        self.assertEqual(change_root('/root', 'its/here'),
+                         '/root/its/here')
 
         # windows
         os.name = 'nt'
@@ -212,10 +212,10 @@
             return '\\'.join(path)
         os.path.join = _join
 
-        self.assertEquals(change_root('c:\\root', 'c:\\old\\its\\here'),
-                          'c:\\root\\old\\its\\here')
-        self.assertEquals(change_root('c:\\root', 'its\\here'),
-                          'c:\\root\\its\\here')
+        self.assertEqual(change_root('c:\\root', 'c:\\old\\its\\here'),
+                         'c:\\root\\old\\its\\here')
+        self.assertEqual(change_root('c:\\root', 'its\\here'),
+                         'c:\\root\\its\\here')
 
         # BugsBunny os (it's a great os)
         os.name = 'BugsBunny'
@@ -233,16 +233,16 @@
         if os.name == 'posix':  # this test won't run on windows
             check_environ()
             import pwd
-            self.assertEquals(os.environ['HOME'], pwd.getpwuid(os.getuid())[5])
+            self.assertEqual(os.environ['HOME'], pwd.getpwuid(os.getuid())[5])
         else:
             check_environ()
 
-        self.assertEquals(os.environ['PLAT'], get_platform())
-        self.assertEquals(util._environ_checked, 1)
+        self.assertEqual(os.environ['PLAT'], get_platform())
+        self.assertEqual(util._environ_checked, 1)
 
     def test_split_quoted(self):
-        self.assertEquals(split_quoted('""one"" "two" \'three\' \\four'),
-                          ['one', 'two', 'three', 'four'])
+        self.assertEqual(split_quoted('""one"" "two" \'three\' \\four'),
+                         ['one', 'two', 'three', 'four'])
 
     def test_strtobool(self):
         yes = ('y', 'Y', 'yes', 'True', 't', 'true', 'True', 'On', 'on', '1')
@@ -259,7 +259,7 @@
         res = rfc822_escape(header)
         wanted = ('I am a%(8s)spoor%(8s)slonesome%(8s)s'
                   'header%(8s)s') % {'8s': '\n'+8*' '}
-        self.assertEquals(res, wanted)
+        self.assertEqual(res, wanted)
 
     def test_dont_write_bytecode(self):
         # makes sure byte_compile raise a DistutilsError

Modified: python/branches/py3k-cdecimal/Lib/distutils/tests/test_version.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/distutils/tests/test_version.py	(original)
+++ python/branches/py3k-cdecimal/Lib/distutils/tests/test_version.py	Mon Nov 22 12:00:42 2010
@@ -8,12 +8,12 @@
 
     def test_prerelease(self):
         version = StrictVersion('1.2.3a1')
-        self.assertEquals(version.version, (1, 2, 3))
-        self.assertEquals(version.prerelease, ('a', 1))
-        self.assertEquals(str(version), '1.2.3a1')
+        self.assertEqual(version.version, (1, 2, 3))
+        self.assertEqual(version.prerelease, ('a', 1))
+        self.assertEqual(str(version), '1.2.3a1')
 
         version = StrictVersion('1.2.0')
-        self.assertEquals(str(version), '1.2')
+        self.assertEqual(str(version), '1.2')
 
     def test_cmp_strict(self):
         versions = (('1.5.1', '1.5.2b2', -1),
@@ -42,9 +42,9 @@
                     raise AssertionError(("cmp(%s, %s) "
                                           "shouldn't raise ValueError")
                                             % (v1, v2))
-            self.assertEquals(res, wanted,
-                              'cmp(%s, %s) should be %s, got %s' %
-                              (v1, v2, wanted, res))
+            self.assertEqual(res, wanted,
+                             'cmp(%s, %s) should be %s, got %s' %
+                             (v1, v2, wanted, res))
 
 
     def test_cmp(self):
@@ -60,9 +60,9 @@
 
         for v1, v2, wanted in versions:
             res = LooseVersion(v1)._cmp(LooseVersion(v2))
-            self.assertEquals(res, wanted,
-                              'cmp(%s, %s) should be %s, got %s' %
-                              (v1, v2, wanted, res))
+            self.assertEqual(res, wanted,
+                             'cmp(%s, %s) should be %s, got %s' %
+                             (v1, v2, wanted, res))
 
 def test_suite():
     return unittest.makeSuite(VersionTestCase)

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	Mon Nov 22 12:00:42 2010
@@ -274,7 +274,7 @@
         for part in msg.get_payload():
             s = self._new_buffer()
             g = self.clone(s)
-            g.flatten(part, unixfrom=False)
+            g.flatten(part, unixfrom=False, linesep=self._NL)
             text = s.getvalue()
             lines = text.split(self._encoded_NL)
             # Strip off the unnecessary trailing empty line
@@ -301,7 +301,7 @@
         # in that case we just emit the string body.
         payload = msg.get_payload()
         if isinstance(payload, list):
-            g.flatten(msg.get_payload(0), unixfrom=False)
+            g.flatten(msg.get_payload(0), unixfrom=False, linesep=self._NL)
             payload = s.getvalue()
         self._fp.write(payload)
 

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	Mon Nov 22 12:00:42 2010
@@ -3,6 +3,7 @@
 # email package unit tests
 
 import os
+import re
 import sys
 import time
 import base64
@@ -44,13 +45,13 @@
 SPACE = ' '
 
 
-
+
 def openfile(filename, *args, **kws):
     path = os.path.join(os.path.dirname(landmark), 'data', filename)
     return open(path, *args, **kws)
 
 
-
+
 # Base test class
 class TestEmailBase(unittest.TestCase):
     def ndiffAssertEqual(self, first, second):
@@ -68,7 +69,7 @@
             return email.message_from_file(fp)
 
 
-
+
 # Test various aspects of the Message class's API
 class TestMessageAPI(TestEmailBase):
     def test_get_all(self):
@@ -77,7 +78,7 @@
         eq(msg.get_all('cc'), ['ccc at zzz.org', 'ddd at zzz.org', 'eee at zzz.org'])
         eq(msg.get_all('xx', 'n/a'), 'n/a')
 
-    def TEst_getset_charset(self):
+    def test_getset_charset(self):
         eq = self.assertEqual
         msg = Message()
         eq(msg.get_charset(), None)
@@ -510,7 +511,7 @@
                          bytes(x, 'raw-unicode-escape'))
 
 
-
+
 # Test the email.encoders module
 class TestEncoders(unittest.TestCase):
     def test_encode_empty_payload(self):
@@ -539,7 +540,7 @@
         msg = MIMEText('文', _charset='euc-jp')
         eq(msg['content-transfer-encoding'], '7bit')
 
-
+
 # Test long header wrapping
 class TestLongHeaders(TestEmailBase):
     def test_split_long_continuation(self):
@@ -918,7 +919,7 @@
 """)
 
 
-
+
 # Test mangling of "From " lines in the body of a message
 class TestFromMangling(unittest.TestCase):
     def setUp(self):
@@ -952,7 +953,7 @@
 """)
 
 
-
+
 # Test the basic MIMEAudio class
 class TestMIMEAudio(unittest.TestCase):
     def setUp(self):
@@ -999,7 +1000,7 @@
                                   header='foobar') is missing)
 
 
-
+
 # Test the basic MIMEImage class
 class TestMIMEImage(unittest.TestCase):
     def setUp(self):
@@ -1040,7 +1041,7 @@
                                   header='foobar') is missing)
 
 
-
+
 # Test the basic MIMEApplication class
 class TestMIMEApplication(unittest.TestCase):
     def test_headers(self):
@@ -1057,7 +1058,7 @@
         eq(msg.get_payload(decode=True), bytes)
 
 
-
+
 # Test the basic MIMEText class
 class TestMIMEText(unittest.TestCase):
     def setUp(self):
@@ -1111,7 +1112,7 @@
         self.assertRaises(UnicodeEncodeError, MIMEText, teststr)
 
 
-
+
 # Test complicated multipart/* messages
 class TestMultipart(TestEmailBase):
     def setUp(self):
@@ -1483,10 +1484,10 @@
 
 YXNkZg==
 --===============0012394164==--""")
-        self.assertEquals(m.get_payload(0).get_payload(), 'YXNkZg==')
+        self.assertEqual(m.get_payload(0).get_payload(), 'YXNkZg==')
+
 
 
-
 # Test some badly formatted messages
 class TestNonConformant(TestEmailBase):
     def test_parse_missing_minor_type(self):
@@ -1600,7 +1601,7 @@
         eq(msg.defects[0].line, ' Line 1\n')
 
 
-
+
 # Test RFC 2047 header encoding and decoding
 class TestRFC2047(TestEmailBase):
     def test_rfc2047_multiline(self):
@@ -1666,7 +1667,7 @@
         self.assertEqual(decode_header(s),
                         [(b'andr\xe9=zz', 'iso-8659-1')])
 
-
+
 # Test the MIMEMessage class
 class TestMIMEMessage(TestEmailBase):
     def setUp(self):
@@ -1967,28 +1968,31 @@
         msg = MIMEMultipart()
         self.assertTrue(msg.is_multipart())
 
-
+
 # A general test of parser->model->generator idempotency.  IOW, read a message
 # in, parse it into a message object tree, then without touching the tree,
 # regenerate the plain text.  The original text and the transformed text
 # should be identical.  Note: that we ignore the Unix-From since that may
 # contain a changed date.
 class TestIdempotent(TestEmailBase):
+
+    linesep = '\n'
+
     def _msgobj(self, filename):
         with openfile(filename) as fp:
             data = fp.read()
         msg = email.message_from_string(data)
         return msg, data
 
-    def _idempotent(self, msg, text):
+    def _idempotent(self, msg, text, unixfrom=False):
         eq = self.ndiffAssertEqual
         s = StringIO()
         g = Generator(s, maxheaderlen=0)
-        g.flatten(msg)
+        g.flatten(msg, unixfrom=unixfrom)
         eq(text, s.getvalue())
 
     def test_parse_text_message(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         msg, text = self._msgobj('msg_01.txt')
         eq(msg.get_content_type(), 'text/plain')
         eq(msg.get_content_maintype(), 'text')
@@ -2000,7 +2004,7 @@
         self._idempotent(msg, text)
 
     def test_parse_untyped_message(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         msg, text = self._msgobj('msg_03.txt')
         eq(msg.get_content_type(), 'text/plain')
         eq(msg.get_params(), None)
@@ -2071,12 +2075,16 @@
         msg, text = self._msgobj('msg_36.txt')
         self._idempotent(msg, text)
 
+    def test_message_delivery_status(self):
+        msg, text = self._msgobj('msg_43.txt')
+        self._idempotent(msg, text, unixfrom=True)
+
     def test_message_signed_idempotent(self):
         msg, text = self._msgobj('msg_45.txt')
         self._idempotent(msg, text)
 
     def test_content_type(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         unless = self.assertTrue
         # Get a message object and reset the seek pointer for other tests
         msg, text = self._msgobj('msg_05.txt')
@@ -2087,16 +2095,16 @@
             params[pk] = pv
         eq(params['report-type'], 'delivery-status')
         eq(params['boundary'], 'D1690A7AC1.996856090/mail.example.com')
-        eq(msg.preamble, 'This is a MIME-encapsulated message.\n')
-        eq(msg.epilogue, '\n')
+        eq(msg.preamble, 'This is a MIME-encapsulated message.' + self.linesep)
+        eq(msg.epilogue, self.linesep)
         eq(len(msg.get_payload()), 3)
         # Make sure the subparts are what we expect
         msg1 = msg.get_payload(0)
         eq(msg1.get_content_type(), 'text/plain')
-        eq(msg1.get_payload(), 'Yadda yadda yadda\n')
+        eq(msg1.get_payload(), 'Yadda yadda yadda' + self.linesep)
         msg2 = msg.get_payload(1)
         eq(msg2.get_content_type(), 'text/plain')
-        eq(msg2.get_payload(), 'Yadda yadda yadda\n')
+        eq(msg2.get_payload(), 'Yadda yadda yadda' + self.linesep)
         msg3 = msg.get_payload(2)
         eq(msg3.get_content_type(), 'message/rfc822')
         self.assertTrue(isinstance(msg3, Message))
@@ -2105,10 +2113,10 @@
         eq(len(payload), 1)
         msg4 = payload[0]
         unless(isinstance(msg4, Message))
-        eq(msg4.get_payload(), 'Yadda yadda yadda\n')
+        eq(msg4.get_payload(), 'Yadda yadda yadda' + self.linesep)
 
     def test_parser(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         unless = self.assertTrue
         msg, text = self._msgobj('msg_06.txt')
         # Check some of the outer headers
@@ -2122,10 +2130,10 @@
         self.assertTrue(isinstance(msg1, Message))
         eq(msg1.get_content_type(), 'text/plain')
         self.assertTrue(isinstance(msg1.get_payload(), str))
-        eq(msg1.get_payload(), '\n')
+        eq(msg1.get_payload(), self.linesep)
+
 
 
-
 # Test various other bits of the package's functionality
 class TestMiscellaneous(TestEmailBase):
     def test_message_from_string(self):
@@ -2450,7 +2458,7 @@
 """)
 
 
-
+
 # Test the iterator/generators
 class TestIterators(TestEmailBase):
     def test_body_line_iterator(self):
@@ -2540,7 +2548,7 @@
         self.assertTrue(''.join([il for il, n in imt]) == ''.join(om))
 
 
-
+
 class TestParsers(TestEmailBase):
     def test_header_parser(self):
         eq = self.assertEqual
@@ -2704,7 +2712,7 @@
         msg = email.message_from_string(m)
         self.assertTrue(msg.get_payload(0).get_payload().endswith('\r\n'))
 
-
+
 class Test8BitBytesHandling(unittest.TestCase):
     # In Python3 all input is string, but that doesn't work if the actual input
     # uses an 8bit transfer encoding.  To hack around that, in email 5.1 we
@@ -2954,28 +2962,44 @@
         self.assertEqual(s.getvalue(), text)
     maxDiff = None
 
-
-class TestBytesGeneratorIdempotent(TestIdempotent):
+
+class BaseTestBytesGeneratorIdempotent:
+
+    maxDiff = None
 
     def _msgobj(self, filename):
         with openfile(filename, 'rb') as fp:
             data = fp.read()
+        data = self.normalize_linesep_regex.sub(self.blinesep, data)
         msg = email.message_from_bytes(data)
         return msg, data
 
-    def _idempotent(self, msg, data):
+    def _idempotent(self, msg, data, unixfrom=False):
         b = BytesIO()
         g = email.generator.BytesGenerator(b, maxheaderlen=0)
-        g.flatten(msg)
-        self.assertEqual(data, b.getvalue())
-
-    maxDiff = None
+        g.flatten(msg, unixfrom=unixfrom, linesep=self.linesep)
+        self.assertByteStringsEqual(data, b.getvalue())
 
-    def assertEqual(self, str1, str2):
+    def assertByteStringsEqual(self, str1, str2):
+        # Not using self.blinesep here is intentional.  This way the output
+        # is more useful when the failure results in mixed line endings.
         self.assertListEqual(str1.split(b'\n'), str2.split(b'\n'))
 
 
-
+class TestBytesGeneratorIdempotentNL(BaseTestBytesGeneratorIdempotent,
+                                    TestIdempotent):
+    linesep = '\n'
+    blinesep = b'\n'
+    normalize_linesep_regex = re.compile(br'\r\n')
+
+
+class TestBytesGeneratorIdempotentCRLF(BaseTestBytesGeneratorIdempotent,
+                                       TestIdempotent):
+    linesep = '\r\n'
+    blinesep = b'\r\n'
+    normalize_linesep_regex = re.compile(br'(?<!\r)\n')
+
+
 class TestBase64(unittest.TestCase):
     def test_len(self):
         eq = self.assertEqual
@@ -3028,7 +3052,7 @@
         eq(he('hello\nworld'), '=?iso-8859-1?b?aGVsbG8Kd29ybGQ=?=')
 
 
-
+
 class TestQuopri(unittest.TestCase):
     def setUp(self):
         # Set of characters (as byte integers) that don't need to be encoded
@@ -3147,7 +3171,7 @@
 two line""")
 
 
-
+
 # Test the Charset class
 class TestCharset(unittest.TestCase):
     def tearDown(self):
@@ -3205,7 +3229,7 @@
         self.assertRaises(errors.CharsetError, Charset, 'asc\xffii')
 
 
-
+
 # Test multilingual MIME headers.
 class TestHeader(TestEmailBase):
     def test_simple(self):
@@ -3515,7 +3539,7 @@
         raises(errors.HeaderParseError, decode_header, s)
 
 
-
+
 # Test RFC 2231 header parameters (en/de)coding
 class TestRFC2231(TestEmailBase):
     def test_get_param(self):
@@ -3827,7 +3851,7 @@
         eq(s, 'My Document For You')
 
 
-
+
 # Tests to ensure that signed parts of an email are completely preserved, as
 # required by RFC1847 section 2.1.  Note that these are incomplete, because the
 # email package does not currently always preserve the body.  See issue 1670765.
@@ -3865,7 +3889,7 @@
         self._signed_parts_eq(original, result)
 
 
-
+
 def _testclasses():
     mod = sys.modules[__name__]
     return [getattr(mod, name) for name in dir(mod) if name.startswith('Test')]
@@ -3883,6 +3907,6 @@
         run_unittest(testclass)
 
 
-
+
 if __name__ == '__main__':
     unittest.main(defaultTest='suite')

Modified: python/branches/py3k-cdecimal/Lib/gzip.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/gzip.py	(original)
+++ python/branches/py3k-cdecimal/Lib/gzip.py	Mon Nov 22 12:00:42 2010
@@ -98,7 +98,7 @@
         return self.file.seek(offset, whence)
 
     def __getattr__(self, name):
-        return getattr(name, self.file)
+        return getattr(self.file, name)
 
 
 class GzipFile(io.BufferedIOBase):

Modified: python/branches/py3k-cdecimal/Lib/http/server.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/http/server.py	(original)
+++ python/branches/py3k-cdecimal/Lib/http/server.py	Mon Nov 22 12:00:42 2010
@@ -443,7 +443,10 @@
     def send_header(self, keyword, value):
         """Send a MIME header."""
         if self.request_version != 'HTTP/0.9':
-            self.wfile.write(("%s: %s\r\n" % (keyword, value)).encode('ASCII', 'strict'))
+            if not hasattr(self, '_headers_buffer'):
+                self._headers_buffer = []
+            self._headers_buffer.append(
+                ("%s: %s\r\n" % (keyword, value)).encode('ASCII', 'strict'))
 
         if keyword.lower() == 'connection':
             if value.lower() == 'close':
@@ -454,7 +457,9 @@
     def end_headers(self):
         """Send the blank line ending the MIME headers."""
         if self.request_version != 'HTTP/0.9':
-            self.wfile.write(b"\r\n")
+            self._headers_buffer.append(b"\r\n")
+            self.wfile.write(b"".join(self._headers_buffer))
+            self._headers_buffer = []
 
     def log_request(self, code='-', size='-'):
         """Log an accepted request.

Modified: python/branches/py3k-cdecimal/Lib/idlelib/idle.bat
==============================================================================
--- python/branches/py3k-cdecimal/Lib/idlelib/idle.bat	(original)
+++ python/branches/py3k-cdecimal/Lib/idlelib/idle.bat	Mon Nov 22 12:00:42 2010
@@ -1,3 +1,4 @@
 @echo off
-rem Working IDLE bat for Windows - uses start instead of absolute pathname
-start idle.pyw %1 %2 %3 %4 %5 %6 %7 %8 %9
+rem Start IDLE using the appropriate Python interpreter
+set CURRDIR=%~dp0
+start "%CURRDIR%..\..\pythonw.exe" "%CURRDIR%idle.pyw" %1 %2 %3 %4 %5 %6 %7 %8 %9

Modified: python/branches/py3k-cdecimal/Lib/importlib/test/import_/test___package__.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/importlib/test/import_/test___package__.py	(original)
+++ python/branches/py3k-cdecimal/Lib/importlib/test/import_/test___package__.py	Mon Nov 22 12:00:42 2010
@@ -42,7 +42,7 @@
                 module = import_util.import_('',
                                             globals={'__package__': 'pkg.fake'},
                                             fromlist=['attr'], level=2)
-        self.assertEquals(module.__name__, 'pkg')
+        self.assertEqual(module.__name__, 'pkg')
 
     def test_using___name__(self, package_as_None=False):
         # [__name__]
@@ -54,7 +54,7 @@
                 import_util.import_('pkg.fake')
                 module = import_util.import_('', globals= globals_,
                                                 fromlist=['attr'], level=2)
-            self.assertEquals(module.__name__, 'pkg')
+            self.assertEqual(module.__name__, 'pkg')
 
     def test_None_as___package__(self):
         # [None]

Modified: python/branches/py3k-cdecimal/Lib/importlib/test/import_/test_caching.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/importlib/test/import_/test_caching.py	(original)
+++ python/branches/py3k-cdecimal/Lib/importlib/test/import_/test_caching.py	Mon Nov 22 12:00:42 2010
@@ -54,7 +54,7 @@
         with self.create_mock('module') as mock:
             with util.import_state(meta_path=[mock]):
                 module = import_util.import_('module')
-                self.assertEquals(id(module), id(sys.modules['module']))
+                self.assertEqual(id(module), id(sys.modules['module']))
 
     # See test_using_cache_after_loader() for reasoning.
     @import_util.importlib_only
@@ -74,8 +74,8 @@
             with util.import_state(meta_path=[importer]):
                 module = import_util.import_('pkg', fromlist=['module'])
                 self.assertTrue(hasattr(module, 'module'))
-                self.assertEquals(id(module.module),
-                                  id(sys.modules['pkg.module']))
+                self.assertEqual(id(module.module),
+                                 id(sys.modules['pkg.module']))
 
 
 def test_main():

Modified: python/branches/py3k-cdecimal/Lib/importlib/test/import_/test_fromlist.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/importlib/test/import_/test_fromlist.py	(original)
+++ python/branches/py3k-cdecimal/Lib/importlib/test/import_/test_fromlist.py	Mon Nov 22 12:00:42 2010
@@ -19,14 +19,14 @@
         with util.mock_modules('pkg.__init__', 'pkg.module') as importer:
             with util.import_state(meta_path=[importer]):
                 module = import_util.import_('pkg.module')
-                self.assertEquals(module.__name__, 'pkg')
+                self.assertEqual(module.__name__, 'pkg')
 
     def test_return_from_from_import(self):
         # [from return]
         with util.mock_modules('pkg.__init__', 'pkg.module')as importer:
             with util.import_state(meta_path=[importer]):
                 module = import_util.import_('pkg.module', fromlist=['attr'])
-                self.assertEquals(module.__name__, 'pkg.module')
+                self.assertEqual(module.__name__, 'pkg.module')
 
 
 class HandlingFromlist(unittest.TestCase):
@@ -51,14 +51,14 @@
         with util.mock_modules('module') as importer:
             with util.import_state(meta_path=[importer]):
                 module = import_util.import_('module', fromlist=['attr'])
-                self.assertEquals(module.__name__, 'module')
+                self.assertEqual(module.__name__, 'module')
 
     def test_unexistent_object(self):
         # [bad object]
         with util.mock_modules('module') as importer:
             with util.import_state(meta_path=[importer]):
                 module = import_util.import_('module', fromlist=['non_existent'])
-                self.assertEquals(module.__name__, 'module')
+                self.assertEqual(module.__name__, 'module')
                 self.assertTrue(not hasattr(module, 'non_existent'))
 
     def test_module_from_package(self):
@@ -66,23 +66,23 @@
         with util.mock_modules('pkg.__init__', 'pkg.module') as importer:
             with util.import_state(meta_path=[importer]):
                 module = import_util.import_('pkg', fromlist=['module'])
-                self.assertEquals(module.__name__, 'pkg')
+                self.assertEqual(module.__name__, 'pkg')
                 self.assertTrue(hasattr(module, 'module'))
-                self.assertEquals(module.module.__name__, 'pkg.module')
+                self.assertEqual(module.module.__name__, 'pkg.module')
 
     def test_no_module_from_package(self):
         # [no module]
         with util.mock_modules('pkg.__init__') as importer:
             with util.import_state(meta_path=[importer]):
                 module = import_util.import_('pkg', fromlist='non_existent')
-                self.assertEquals(module.__name__, 'pkg')
+                self.assertEqual(module.__name__, 'pkg')
                 self.assertTrue(not hasattr(module, 'non_existent'))
 
     def test_empty_string(self):
         with util.mock_modules('pkg.__init__', 'pkg.mod') as importer:
             with util.import_state(meta_path=[importer]):
                 module = import_util.import_('pkg.mod', fromlist=[''])
-                self.assertEquals(module.__name__, 'pkg.mod')
+                self.assertEqual(module.__name__, 'pkg.mod')
 
     def basic_star_test(self, fromlist=['*']):
         # [using *]
@@ -90,7 +90,7 @@
             with util.import_state(meta_path=[mock]):
                 mock['pkg'].__all__ = ['module']
                 module = import_util.import_('pkg', fromlist=fromlist)
-                self.assertEquals(module.__name__, 'pkg')
+                self.assertEqual(module.__name__, 'pkg')
                 self.assertTrue(hasattr(module, 'module'))
                 self.assertEqual(module.module.__name__, 'pkg.module')
 
@@ -108,11 +108,11 @@
             with util.import_state(meta_path=[mock]):
                 mock['pkg'].__all__ = ['module1']
                 module = import_util.import_('pkg', fromlist=['module2', '*'])
-                self.assertEquals(module.__name__, 'pkg')
+                self.assertEqual(module.__name__, 'pkg')
                 self.assertTrue(hasattr(module, 'module1'))
                 self.assertTrue(hasattr(module, 'module2'))
-                self.assertEquals(module.module1.__name__, 'pkg.module1')
-                self.assertEquals(module.module2.__name__, 'pkg.module2')
+                self.assertEqual(module.module1.__name__, 'pkg.module1')
+                self.assertEqual(module.module2.__name__, 'pkg.module2')
 
 
 def test_main():

Modified: python/branches/py3k-cdecimal/Lib/importlib/test/import_/test_meta_path.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/importlib/test/import_/test_meta_path.py	(original)
+++ python/branches/py3k-cdecimal/Lib/importlib/test/import_/test_meta_path.py	Mon Nov 22 12:00:42 2010
@@ -21,7 +21,7 @@
             first.modules[mod] = 42
             second.modules[mod] = -13
             with util.import_state(meta_path=[first, second]):
-                self.assertEquals(import_util.import_(mod), 42)
+                self.assertEqual(import_util.import_(mod), 42)
 
     def test_continuing(self):
         # [continuing]
@@ -31,7 +31,7 @@
             first.find_module = lambda self, fullname, path=None: None
             second.modules[mod_name] = 42
             with util.import_state(meta_path=[first, second]):
-                self.assertEquals(import_util.import_(mod_name), 42)
+                self.assertEqual(import_util.import_(mod_name), 42)
 
 
 class CallSignature(unittest.TestCase):
@@ -61,9 +61,9 @@
                 args = log[0][0]
                 kwargs = log[0][1]
                 # Assuming all arguments are positional.
-                self.assertEquals(len(args), 2)
-                self.assertEquals(len(kwargs), 0)
-                self.assertEquals(args[0], mod_name)
+                self.assertEqual(len(args), 2)
+                self.assertEqual(len(kwargs), 0)
+                self.assertEqual(args[0], mod_name)
                 self.assertTrue(args[1] is None)
 
     def test_with_path(self):
@@ -83,7 +83,7 @@
                 kwargs = log[1][1]
                 # Assuming all arguments are positional.
                 self.assertTrue(not kwargs)
-                self.assertEquals(args[0], mod_name)
+                self.assertEqual(args[0], mod_name)
                 self.assertTrue(args[1] is path)
 
 

Modified: python/branches/py3k-cdecimal/Lib/inspect.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/inspect.py	(original)
+++ python/branches/py3k-cdecimal/Lib/inspect.py	Mon Nov 22 12:00:42 2010
@@ -1054,3 +1054,97 @@
 def trace(context=1):
     """Return a list of records for the stack below the current exception."""
     return getinnerframes(sys.exc_info()[2], context)
+
+
+# ------------------------------------------------ static version of getattr
+
+_sentinel = object()
+
+def _static_getmro(klass):
+    return type.__dict__['__mro__'].__get__(klass)
+
+def _check_instance(obj, attr):
+    instance_dict = {}
+    try:
+        instance_dict = object.__getattribute__(obj, "__dict__")
+    except AttributeError:
+        pass
+    return instance_dict.get(attr, _sentinel)
+
+
+def _check_class(klass, attr):
+    for entry in _static_getmro(klass):
+        try:
+            return entry.__dict__[attr]
+        except KeyError:
+            pass
+    return _sentinel
+
+def _is_type(obj):
+    try:
+        _static_getmro(obj)
+    except TypeError:
+        return False
+    return True
+
+
+def getattr_static(obj, attr, default=_sentinel):
+    """Retrieve attributes without triggering dynamic lookup via the
+       descriptor protocol,  __getattr__ or __getattribute__.
+
+       Note: this function may not be able to retrieve all attributes
+       that getattr can fetch (like dynamically created attributes)
+       and may find attributes that getattr can't (like descriptors
+       that raise AttributeError). It can also return descriptor objects
+       instead of instance members in some cases. See the
+       documentation for details.
+    """
+    instance_result = _sentinel
+    if not _is_type(obj):
+        instance_result = _check_instance(obj, attr)
+        klass = type(obj)
+    else:
+        klass = obj
+
+    klass_result = _check_class(klass, attr)
+
+    if instance_result is not _sentinel and klass_result is not _sentinel:
+        if (_check_class(type(klass_result), '__get__') is not _sentinel and
+            _check_class(type(klass_result), '__set__') is not _sentinel):
+            return klass_result
+
+    if instance_result is not _sentinel:
+        return instance_result
+    if klass_result is not _sentinel:
+        return klass_result
+
+    if obj is klass:
+        # for types we check the metaclass too
+        for entry in _static_getmro(type(klass)):
+            try:
+                return entry.__dict__[attr]
+            except KeyError:
+                pass
+    if default is not _sentinel:
+        return default
+    raise AttributeError(attr)
+
+
+GEN_CREATED, GEN_RUNNING, GEN_SUSPENDED, GEN_CLOSED = range(4)
+
+def getgeneratorstate(generator):
+    """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.
+    """
+    if generator.gi_running:
+        return GEN_RUNNING
+    if generator.gi_frame is None:
+        return GEN_CLOSED
+    if generator.gi_frame.f_lasti == -1:
+        return GEN_CREATED
+    return GEN_SUSPENDED

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_decode.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_decode.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_decode.py	Mon Nov 22 12:00:42 2010
@@ -24,12 +24,12 @@
     def test_decimal(self):
         rval = json.loads('1.1', parse_float=decimal.Decimal)
         self.assertTrue(isinstance(rval, decimal.Decimal))
-        self.assertEquals(rval, decimal.Decimal('1.1'))
+        self.assertEqual(rval, decimal.Decimal('1.1'))
 
     def test_float(self):
         rval = json.loads('1', parse_int=float)
         self.assertTrue(isinstance(rval, float))
-        self.assertEquals(rval, 1.0)
+        self.assertEqual(rval, 1.0)
 
     def test_object_pairs_hook(self):
         s = '{"xkd":1, "kcw":2, "art":3, "hxm":4, "qrt":5, "pad":6, "hoy":7}'
@@ -53,7 +53,7 @@
         # the whitespace regex, so this test is designed to try and
         # exercise the uncommon cases. The array cases are already covered.
         rval = json.loads('{   "key"    :    "value"    ,  "k":"v"    }')
-        self.assertEquals(rval, {"key":"value", "k":"v"})
+        self.assertEqual(rval, {"key":"value", "k":"v"})
 
     def check_keys_reuse(self, source, loads):
         rval = loads(source)

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_default.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_default.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_default.py	Mon Nov 22 12:00:42 2010
@@ -4,6 +4,6 @@
 
 class TestDefault(TestCase):
     def test_default(self):
-        self.assertEquals(
+        self.assertEqual(
             json.dumps(type, default=repr),
             json.dumps(repr(type)))

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_dump.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_dump.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_dump.py	Mon Nov 22 12:00:42 2010
@@ -7,15 +7,15 @@
     def test_dump(self):
         sio = StringIO()
         json.dump({}, sio)
-        self.assertEquals(sio.getvalue(), '{}')
+        self.assertEqual(sio.getvalue(), '{}')
 
     def test_dumps(self):
-        self.assertEquals(json.dumps({}), '{}')
+        self.assertEqual(json.dumps({}), '{}')
 
     def test_encode_truefalse(self):
-        self.assertEquals(json.dumps(
+        self.assertEqual(json.dumps(
                  {True: False, False: True}, sort_keys=True),
                  '{"false": true, "true": false}')
-        self.assertEquals(json.dumps(
+        self.assertEqual(json.dumps(
                 {2: 3.0, 4.0: 5, False: 1, 6: True}, sort_keys=True),
                 '{"false": 1, "2": 3.0, "4.0": 5, "6": true}')

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_encode_basestring_ascii.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_encode_basestring_ascii.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_encode_basestring_ascii.py	Mon Nov 22 12:00:42 2010
@@ -34,7 +34,7 @@
         fname = encode_basestring_ascii.__name__
         for input_string, expect in CASES:
             result = encode_basestring_ascii(input_string)
-            self.assertEquals(result, expect,
+            self.assertEqual(result, expect,
                 '{0!r} != {1!r} for {2}({3!r})'.format(
                     result, expect, fname, input_string))
 

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_float.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_float.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_float.py	Mon Nov 22 12:00:42 2010
@@ -6,10 +6,10 @@
 class TestFloat(TestCase):
     def test_floats(self):
         for num in [1617161771.7650001, math.pi, math.pi**100, math.pi**-100, 3.1]:
-            self.assertEquals(float(json.dumps(num)), num)
-            self.assertEquals(json.loads(json.dumps(num)), num)
+            self.assertEqual(float(json.dumps(num)), num)
+            self.assertEqual(json.loads(json.dumps(num)), num)
 
     def test_ints(self):
         for num in [1, 1<<32, 1<<64]:
-            self.assertEquals(json.dumps(num), str(num))
-            self.assertEquals(int(json.dumps(num)), num)
+            self.assertEqual(json.dumps(num), str(num))
+            self.assertEqual(int(json.dumps(num)), num)

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_indent.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_indent.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_indent.py	Mon Nov 22 12:00:42 2010
@@ -38,8 +38,8 @@
         h2 = json.loads(d2)
         h3 = json.loads(d3)
 
-        self.assertEquals(h1, h)
-        self.assertEquals(h2, h)
-        self.assertEquals(h3, h)
-        self.assertEquals(d2, expect.expandtabs(2))
-        self.assertEquals(d3, expect)
+        self.assertEqual(h1, h)
+        self.assertEqual(h2, h)
+        self.assertEqual(h3, h)
+        self.assertEqual(d2, expect.expandtabs(2))
+        self.assertEqual(d3, expect)

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_pass1.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_pass1.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_pass1.py	Mon Nov 22 12:00:42 2010
@@ -67,7 +67,7 @@
         # test in/out equivalence and parsing
         res = json.loads(JSON)
         out = json.dumps(res)
-        self.assertEquals(res, json.loads(out))
+        self.assertEqual(res, json.loads(out))
         try:
             json.dumps(res, allow_nan=False)
         except ValueError:

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_pass2.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_pass2.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_pass2.py	Mon Nov 22 12:00:42 2010
@@ -11,4 +11,4 @@
         # test in/out equivalence and parsing
         res = json.loads(JSON)
         out = json.dumps(res)
-        self.assertEquals(res, json.loads(out))
+        self.assertEqual(res, json.loads(out))

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_pass3.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_pass3.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_pass3.py	Mon Nov 22 12:00:42 2010
@@ -17,4 +17,4 @@
         # test in/out equivalence and parsing
         res = json.loads(JSON)
         out = json.dumps(res)
-        self.assertEquals(res, json.loads(out))
+        self.assertEqual(res, json.loads(out))

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_recursion.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_recursion.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_recursion.py	Mon Nov 22 12:00:42 2010
@@ -57,7 +57,7 @@
 
     def test_defaultrecursion(self):
         enc = RecursiveJSONEncoder()
-        self.assertEquals(enc.encode(JSONTestObject), '"JSONTestObject"')
+        self.assertEqual(enc.encode(JSONTestObject), '"JSONTestObject"')
         enc.recurse = True
         try:
             enc.encode(JSONTestObject)

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_scanstring.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_scanstring.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_scanstring.py	Mon Nov 22 12:00:42 2010
@@ -14,92 +14,92 @@
             self._test_scanstring(json.decoder.c_scanstring)
 
     def _test_scanstring(self, scanstring):
-        self.assertEquals(
+        self.assertEqual(
             scanstring('"z\\ud834\\udd20x"', 1, True),
             ('z\U0001d120x', 16))
 
         if sys.maxunicode == 65535:
-            self.assertEquals(
+            self.assertEqual(
                 scanstring('"z\U0001d120x"', 1, True),
                 ('z\U0001d120x', 6))
         else:
-            self.assertEquals(
+            self.assertEqual(
                 scanstring('"z\U0001d120x"', 1, True),
                 ('z\U0001d120x', 5))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('"\\u007b"', 1, True),
             ('{', 8))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('"A JSON payload should be an object or array, not a string."', 1, True),
             ('A JSON payload should be an object or array, not a string.', 60))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('["Unclosed array"', 2, True),
             ('Unclosed array', 17))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('["extra comma",]', 2, True),
             ('extra comma', 14))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('["double extra comma",,]', 2, True),
             ('double extra comma', 21))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('["Comma after the close"],', 2, True),
             ('Comma after the close', 24))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('["Extra close"]]', 2, True),
             ('Extra close', 14))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('{"Extra comma": true,}', 2, True),
             ('Extra comma', 14))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('{"Extra value after close": true} "misplaced quoted value"', 2, True),
             ('Extra value after close', 26))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('{"Illegal expression": 1 + 2}', 2, True),
             ('Illegal expression', 21))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('{"Illegal invocation": alert()}', 2, True),
             ('Illegal invocation', 21))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('{"Numbers cannot have leading zeroes": 013}', 2, True),
             ('Numbers cannot have leading zeroes', 37))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('{"Numbers cannot be hex": 0x14}', 2, True),
             ('Numbers cannot be hex', 24))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]', 21, True),
             ('Too deep', 30))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('{"Missing colon" null}', 2, True),
             ('Missing colon', 16))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('{"Double colon":: null}', 2, True),
             ('Double colon', 15))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('{"Comma instead of colon", null}', 2, True),
             ('Comma instead of colon', 25))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('["Colon instead of comma": false]', 2, True),
             ('Colon instead of comma', 25))
 
-        self.assertEquals(
+        self.assertEqual(
             scanstring('["Bad value", truth]', 2, True),
             ('Bad value', 12))
 

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_separators.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_separators.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_separators.py	Mon Nov 22 12:00:42 2010
@@ -37,6 +37,6 @@
         h1 = json.loads(d1)
         h2 = json.loads(d2)
 
-        self.assertEquals(h1, h)
-        self.assertEquals(h2, h)
-        self.assertEquals(d2, expect)
+        self.assertEqual(h1, h)
+        self.assertEqual(h2, h)
+        self.assertEqual(d2, expect)

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_speedups.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_speedups.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_speedups.py	Mon Nov 22 12:00:42 2010
@@ -5,11 +5,11 @@
 
 class TestSpeedups(TestCase):
     def test_scanstring(self):
-        self.assertEquals(decoder.scanstring.__module__, "_json")
+        self.assertEqual(decoder.scanstring.__module__, "_json")
         self.assertTrue(decoder.scanstring is decoder.c_scanstring)
 
     def test_encode_basestring_ascii(self):
-        self.assertEquals(encoder.encode_basestring_ascii.__module__, "_json")
+        self.assertEqual(encoder.encode_basestring_ascii.__module__, "_json")
         self.assertTrue(encoder.encode_basestring_ascii is
                           encoder.c_encode_basestring_ascii)
 

Modified: python/branches/py3k-cdecimal/Lib/json/tests/test_unicode.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/json/tests/test_unicode.py	(original)
+++ python/branches/py3k-cdecimal/Lib/json/tests/test_unicode.py	Mon Nov 22 12:00:42 2010
@@ -10,43 +10,43 @@
     def test_encoding3(self):
         u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
         j = json.dumps(u)
-        self.assertEquals(j, '"\\u03b1\\u03a9"')
+        self.assertEqual(j, '"\\u03b1\\u03a9"')
 
     def test_encoding4(self):
         u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
         j = json.dumps([u])
-        self.assertEquals(j, '["\\u03b1\\u03a9"]')
+        self.assertEqual(j, '["\\u03b1\\u03a9"]')
 
     def test_encoding5(self):
         u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
         j = json.dumps(u, ensure_ascii=False)
-        self.assertEquals(j, '"{0}"'.format(u))
+        self.assertEqual(j, '"{0}"'.format(u))
 
     def test_encoding6(self):
         u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
         j = json.dumps([u], ensure_ascii=False)
-        self.assertEquals(j, '["{0}"]'.format(u))
+        self.assertEqual(j, '["{0}"]'.format(u))
 
     def test_big_unicode_encode(self):
         u = '\U0001d120'
-        self.assertEquals(json.dumps(u), '"\\ud834\\udd20"')
-        self.assertEquals(json.dumps(u, ensure_ascii=False), '"\U0001d120"')
+        self.assertEqual(json.dumps(u), '"\\ud834\\udd20"')
+        self.assertEqual(json.dumps(u, ensure_ascii=False), '"\U0001d120"')
 
     def test_big_unicode_decode(self):
         u = 'z\U0001d120x'
-        self.assertEquals(json.loads('"' + u + '"'), u)
-        self.assertEquals(json.loads('"z\\ud834\\udd20x"'), u)
+        self.assertEqual(json.loads('"' + u + '"'), u)
+        self.assertEqual(json.loads('"z\\ud834\\udd20x"'), u)
 
     def test_unicode_decode(self):
         for i in range(0, 0xd7ff):
             u = chr(i)
             s = '"\\u{0:04x}"'.format(i)
-            self.assertEquals(json.loads(s), u)
+            self.assertEqual(json.loads(s), u)
 
     def test_unicode_preservation(self):
-        self.assertEquals(type(json.loads('""')), str)
-        self.assertEquals(type(json.loads('"a"')), str)
-        self.assertEquals(type(json.loads('["a"]')[0]), str)
+        self.assertEqual(type(json.loads('""')), str)
+        self.assertEqual(type(json.loads('"a"')), str)
+        self.assertEqual(type(json.loads('["a"]')[0]), str)
 
     def test_bytes_encode(self):
         self.assertRaises(TypeError, json.dumps, b"hi")

Modified: python/branches/py3k-cdecimal/Lib/pstats.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/pstats.py	(original)
+++ python/branches/py3k-cdecimal/Lib/pstats.py	Mon Nov 22 12:00:42 2010
@@ -348,7 +348,7 @@
         print(indent, self.total_calls, "function calls", end=' ', file=self.stream)
         if self.total_calls != self.prim_calls:
             print("(%d primitive calls)" % self.prim_calls, end=' ', file=self.stream)
-        print("in %.3f CPU seconds" % self.total_tt, file=self.stream)
+        print("in %.3f seconds" % self.total_tt, file=self.stream)
         print(file=self.stream)
         width, list = self.get_print_list(amount)
         if list:

Modified: python/branches/py3k-cdecimal/Lib/pydoc.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/pydoc.py	(original)
+++ python/branches/py3k-cdecimal/Lib/pydoc.py	Mon Nov 22 12:00:42 2010
@@ -1552,12 +1552,13 @@
         'finally': 'try',
         'for': ('for', 'break continue while'),
         'from': 'import',
-        'global': ('global', 'NAMESPACES'),
+        'global': ('global', 'nonlocal NAMESPACES'),
         'if': ('if', 'TRUTHVALUE'),
         'import': ('import', 'MODULES'),
         'in': ('in', 'SEQUENCEMETHODS'),
         'is': 'COMPARISON',
         'lambda': ('lambda', 'FUNCTIONS'),
+        'nonlocal': ('nonlocal', 'global NAMESPACES'),
         'not': 'BOOLEAN',
         'or': 'BOOLEAN',
         'pass': ('pass', ''),
@@ -1652,7 +1653,7 @@
         'NUMBERMETHODS': ('numeric-types', 'NUMBERS AUGMENTEDASSIGNMENT '
                           'SPECIALMETHODS'),
         'EXECUTION': ('execmodel', 'NAMESPACES DYNAMICFEATURES EXCEPTIONS'),
-        'NAMESPACES': ('naming', 'global ASSIGNMENT DELETION DYNAMICFEATURES'),
+        'NAMESPACES': ('naming', 'global nonlocal ASSIGNMENT DELETION DYNAMICFEATURES'),
         'DYNAMICFEATURES': ('dynamic-features', ''),
         'SCOPING': 'NAMESPACES',
         'FRAMES': 'NAMESPACES',

Modified: python/branches/py3k-cdecimal/Lib/sqlite3/test/dbapi.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/sqlite3/test/dbapi.py	(original)
+++ python/branches/py3k-cdecimal/Lib/sqlite3/test/dbapi.py	Mon Nov 22 12:00:42 2010
@@ -43,7 +43,7 @@
                          sqlite.paramstyle)
 
     def CheckWarning(self):
-        self.assert_(issubclass(sqlite.Warning, Exception),
+        self.assertTrue(issubclass(sqlite.Warning, Exception),
                      "Warning is not a subclass of Exception")
 
     def CheckError(self):

Modified: python/branches/py3k-cdecimal/Lib/sqlite3/test/types.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/sqlite3/test/types.py	(original)
+++ python/branches/py3k-cdecimal/Lib/sqlite3/test/types.py	Mon Nov 22 12:00:42 2010
@@ -291,7 +291,7 @@
         no row returned.
         """
         self.cur.execute("select * from test where 0 = 1")
-        self.assert_(self.cur.description[0][0] == "x")
+        self.assertEqual(self.cur.description[0][0], "x")
 
 class ObjectAdaptationTests(unittest.TestCase):
     def cast(obj):

Modified: python/branches/py3k-cdecimal/Lib/subprocess.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/subprocess.py	(original)
+++ python/branches/py3k-cdecimal/Lib/subprocess.py	Mon Nov 22 12:00:42 2010
@@ -1193,11 +1193,11 @@
                                 try:
                                     exc_type, exc_value = sys.exc_info()[:2]
                                     if isinstance(exc_value, OSError):
-                                        errno = exc_value.errno
+                                        errno_num = exc_value.errno
                                     else:
-                                        errno = 0
+                                        errno_num = 0
                                     message = '%s:%x:%s' % (exc_type.__name__,
-                                                            errno, exc_value)
+                                                            errno_num, exc_value)
                                     message = message.encode(errors="surrogatepass")
                                     os.write(errpipe_write, message)
                                 except Exception:
@@ -1252,10 +1252,12 @@
                         os.close(fd)
                 err_msg = err_msg.decode(errors="surrogatepass")
                 if issubclass(child_exception_type, OSError) and hex_errno:
-                    errno = int(hex_errno, 16)
-                    if errno != 0:
-                        err_msg = os.strerror(errno)
-                    raise child_exception_type(errno, err_msg)
+                    errno_num = int(hex_errno, 16)
+                    if errno_num != 0:
+                        err_msg = os.strerror(errno_num)
+                        if errno_num == errno.ENOENT:
+                            err_msg += ': ' + repr(args[0])
+                    raise child_exception_type(errno_num, err_msg)
                 raise child_exception_type(err_msg)
 
 

Modified: python/branches/py3k-cdecimal/Lib/sysconfig.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/sysconfig.py	(original)
+++ python/branches/py3k-cdecimal/Lib/sysconfig.py	Mon Nov 22 12:00:42 2010
@@ -314,6 +314,7 @@
 
 
 def get_makefile_filename():
+    """Return the path of the Makefile."""
     if _PYTHON_BUILD:
         return os.path.join(_PROJECT_BASE, "Makefile")
     return os.path.join(get_path('stdlib'), "config", "Makefile")
@@ -407,7 +408,7 @@
     return vars
 
 def get_config_h_filename():
-    """Returns the path of pyconfig.h."""
+    """Return the path of pyconfig.h."""
     if _PYTHON_BUILD:
         if os.name == "nt":
             inc_dir = os.path.join(_PROJECT_BASE, "PC")
@@ -418,17 +419,17 @@
     return os.path.join(inc_dir, 'pyconfig.h')
 
 def get_scheme_names():
-    """Returns a tuple containing the schemes names."""
+    """Return a tuple containing the schemes names."""
     schemes = list(_INSTALL_SCHEMES.keys())
     schemes.sort()
     return tuple(schemes)
 
 def get_path_names():
-    """Returns a tuple containing the paths names."""
+    """Return a tuple containing the paths names."""
     return _SCHEME_KEYS
 
 def get_paths(scheme=_get_default_scheme(), vars=None, expand=True):
-    """Returns a mapping containing an install scheme.
+    """Return a mapping containing an install scheme.
 
     ``scheme`` is the install scheme name. If not provided, it will
     return the default scheme for the current platform.
@@ -439,7 +440,7 @@
         return _INSTALL_SCHEMES[scheme]
 
 def get_path(name, scheme=_get_default_scheme(), vars=None, expand=True):
-    """Returns a path corresponding to the scheme.
+    """Return a path corresponding to the scheme.
 
     ``scheme`` is the install scheme name.
     """
@@ -756,7 +757,7 @@
         print('\t{0} = "{1}"'.format(key, value))
 
 def _main():
-    """Displays all information sysconfig detains."""
+    """Display all information sysconfig detains."""
     print('Platform: "{0}"'.format(get_platform()))
     print('Python version: "{0}"'.format(get_python_version()))
     print('Current installation scheme: "{0}"'.format(_get_default_scheme()))

Modified: python/branches/py3k-cdecimal/Lib/test/buffer_tests.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/buffer_tests.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/buffer_tests.py	Mon Nov 22 12:00:42 2010
@@ -15,32 +15,32 @@
 
     def test_islower(self):
         self.assertFalse(self.marshal(b'').islower())
-        self.assert_(self.marshal(b'a').islower())
+        self.assertTrue(self.marshal(b'a').islower())
         self.assertFalse(self.marshal(b'A').islower())
         self.assertFalse(self.marshal(b'\n').islower())
-        self.assert_(self.marshal(b'abc').islower())
+        self.assertTrue(self.marshal(b'abc').islower())
         self.assertFalse(self.marshal(b'aBc').islower())
-        self.assert_(self.marshal(b'abc\n').islower())
+        self.assertTrue(self.marshal(b'abc\n').islower())
         self.assertRaises(TypeError, self.marshal(b'abc').islower, 42)
 
     def test_isupper(self):
         self.assertFalse(self.marshal(b'').isupper())
         self.assertFalse(self.marshal(b'a').isupper())
-        self.assert_(self.marshal(b'A').isupper())
+        self.assertTrue(self.marshal(b'A').isupper())
         self.assertFalse(self.marshal(b'\n').isupper())
-        self.assert_(self.marshal(b'ABC').isupper())
+        self.assertTrue(self.marshal(b'ABC').isupper())
         self.assertFalse(self.marshal(b'AbC').isupper())
-        self.assert_(self.marshal(b'ABC\n').isupper())
+        self.assertTrue(self.marshal(b'ABC\n').isupper())
         self.assertRaises(TypeError, self.marshal(b'abc').isupper, 42)
 
     def test_istitle(self):
         self.assertFalse(self.marshal(b'').istitle())
         self.assertFalse(self.marshal(b'a').istitle())
-        self.assert_(self.marshal(b'A').istitle())
+        self.assertTrue(self.marshal(b'A').istitle())
         self.assertFalse(self.marshal(b'\n').istitle())
-        self.assert_(self.marshal(b'A Titlecased Line').istitle())
-        self.assert_(self.marshal(b'A\nTitlecased Line').istitle())
-        self.assert_(self.marshal(b'A Titlecased, Line').istitle())
+        self.assertTrue(self.marshal(b'A Titlecased Line').istitle())
+        self.assertTrue(self.marshal(b'A\nTitlecased Line').istitle())
+        self.assertTrue(self.marshal(b'A Titlecased, Line').istitle())
         self.assertFalse(self.marshal(b'Not a capitalized String').istitle())
         self.assertFalse(self.marshal(b'Not\ta Titlecase String').istitle())
         self.assertFalse(self.marshal(b'Not--a Titlecase String').istitle())
@@ -50,31 +50,31 @@
     def test_isspace(self):
         self.assertFalse(self.marshal(b'').isspace())
         self.assertFalse(self.marshal(b'a').isspace())
-        self.assert_(self.marshal(b' ').isspace())
-        self.assert_(self.marshal(b'\t').isspace())
-        self.assert_(self.marshal(b'\r').isspace())
-        self.assert_(self.marshal(b'\n').isspace())
-        self.assert_(self.marshal(b' \t\r\n').isspace())
+        self.assertTrue(self.marshal(b' ').isspace())
+        self.assertTrue(self.marshal(b'\t').isspace())
+        self.assertTrue(self.marshal(b'\r').isspace())
+        self.assertTrue(self.marshal(b'\n').isspace())
+        self.assertTrue(self.marshal(b' \t\r\n').isspace())
         self.assertFalse(self.marshal(b' \t\r\na').isspace())
         self.assertRaises(TypeError, self.marshal(b'abc').isspace, 42)
 
     def test_isalpha(self):
         self.assertFalse(self.marshal(b'').isalpha())
-        self.assert_(self.marshal(b'a').isalpha())
-        self.assert_(self.marshal(b'A').isalpha())
+        self.assertTrue(self.marshal(b'a').isalpha())
+        self.assertTrue(self.marshal(b'A').isalpha())
         self.assertFalse(self.marshal(b'\n').isalpha())
-        self.assert_(self.marshal(b'abc').isalpha())
+        self.assertTrue(self.marshal(b'abc').isalpha())
         self.assertFalse(self.marshal(b'aBc123').isalpha())
         self.assertFalse(self.marshal(b'abc\n').isalpha())
         self.assertRaises(TypeError, self.marshal(b'abc').isalpha, 42)
 
     def test_isalnum(self):
         self.assertFalse(self.marshal(b'').isalnum())
-        self.assert_(self.marshal(b'a').isalnum())
-        self.assert_(self.marshal(b'A').isalnum())
+        self.assertTrue(self.marshal(b'a').isalnum())
+        self.assertTrue(self.marshal(b'A').isalnum())
         self.assertFalse(self.marshal(b'\n').isalnum())
-        self.assert_(self.marshal(b'123abc456').isalnum())
-        self.assert_(self.marshal(b'a1b3c').isalnum())
+        self.assertTrue(self.marshal(b'123abc456').isalnum())
+        self.assertTrue(self.marshal(b'a1b3c').isalnum())
         self.assertFalse(self.marshal(b'aBc000 ').isalnum())
         self.assertFalse(self.marshal(b'abc\n').isalnum())
         self.assertRaises(TypeError, self.marshal(b'abc').isalnum, 42)
@@ -82,8 +82,8 @@
     def test_isdigit(self):
         self.assertFalse(self.marshal(b'').isdigit())
         self.assertFalse(self.marshal(b'a').isdigit())
-        self.assert_(self.marshal(b'0').isdigit())
-        self.assert_(self.marshal(b'0123456789').isdigit())
+        self.assertTrue(self.marshal(b'0').isdigit())
+        self.assertTrue(self.marshal(b'0123456789').isdigit())
         self.assertFalse(self.marshal(b'0123456789a').isdigit())
 
         self.assertRaises(TypeError, self.marshal(b'abc').isdigit, 42)

Modified: python/branches/py3k-cdecimal/Lib/test/cmath_testcases.txt
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/cmath_testcases.txt	(original)
+++ python/branches/py3k-cdecimal/Lib/test/cmath_testcases.txt	Mon Nov 22 12:00:42 2010
@@ -733,10 +733,11 @@
 ---------------------------
 
 -- zeros
-atan0000 atan 0.0 0.0 -> 0.0 0.0
-atan0001 atan 0.0 -0.0 -> 0.0 -0.0
-atan0002 atan -0.0 0.0 -> -0.0 0.0
-atan0003 atan -0.0 -0.0 -> -0.0 -0.0
+-- These are tested in testAtanSign in test_cmath.py
+-- atan0000 atan 0.0 0.0 -> 0.0 0.0
+-- atan0001 atan 0.0 -0.0 -> 0.0 -0.0
+-- atan0002 atan -0.0 0.0 -> -0.0 0.0
+-- atan0003 atan -0.0 -0.0 -> -0.0 -0.0
 
 -- values along both sides of imaginary axis
 atan0010 atan 0.0 -9.8813129168249309e-324 -> 0.0 -9.8813129168249309e-324
@@ -896,10 +897,11 @@
 ---------------------------------------
 
 -- zeros
-atanh0000 atanh 0.0 0.0 -> 0.0 0.0
-atanh0001 atanh 0.0 -0.0 -> 0.0 -0.0
-atanh0002 atanh -0.0 0.0 -> -0.0 0.0
-atanh0003 atanh -0.0 -0.0 -> -0.0 -0.0
+-- These are tested in testAtanhSign in test_cmath.py
+-- atanh0000 atanh 0.0 0.0 -> 0.0 0.0
+-- atanh0001 atanh 0.0 -0.0 -> 0.0 -0.0
+-- atanh0002 atanh -0.0 0.0 -> -0.0 0.0
+-- atanh0003 atanh -0.0 -0.0 -> -0.0 -0.0
 
 -- values along both sides of real axis
 atanh0010 atanh -9.8813129168249309e-324 0.0 -> -9.8813129168249309e-324 0.0

Modified: python/branches/py3k-cdecimal/Lib/test/fork_wait.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/fork_wait.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/fork_wait.py	Mon Nov 22 12:00:42 2010
@@ -40,8 +40,8 @@
                 break
             time.sleep(2 * SHORTSLEEP)
 
-        self.assertEquals(spid, cpid)
-        self.assertEquals(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8))
+        self.assertEqual(spid, cpid)
+        self.assertEqual(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8))
 
     def test_wait(self):
         for i in range(NUM_THREADS):
@@ -50,7 +50,7 @@
         time.sleep(LONGSLEEP)
 
         a = sorted(self.alive.keys())
-        self.assertEquals(a, list(range(NUM_THREADS)))
+        self.assertEqual(a, list(range(NUM_THREADS)))
 
         prefork_lives = self.alive.copy()
 

Modified: python/branches/py3k-cdecimal/Lib/test/list_tests.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/list_tests.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/list_tests.py	Mon Nov 22 12:00:42 2010
@@ -337,7 +337,7 @@
         self.assertRaises(BadExc, d.remove, 'c')
         for x, y in zip(d, e):
             # verify that original order and values are retained.
-            self.assert_(x is y)
+            self.assertIs(x, y)
 
     def test_count(self):
         a = self.type2test([0, 1, 2])*3
@@ -482,7 +482,7 @@
         u = self.type2test([0, 1])
         u2 = u
         u += [2, 3]
-        self.assert_(u is u2)
+        self.assertIs(u, u2)
 
         u = self.type2test("spam")
         u += "eggs"

Modified: python/branches/py3k-cdecimal/Lib/test/outstanding_bugs.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/outstanding_bugs.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/outstanding_bugs.py	Mon Nov 22 12:00:42 2010
@@ -35,7 +35,7 @@
             if not c:
                 break
             reads += c
-        self.assertEquals(reads, self.normalized)
+        self.assertEqual(reads, self.normalized)
 
     def test_issue1395_2(self):
         txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ASCII")
@@ -47,7 +47,7 @@
             if not c:
                 break
             reads += c
-        self.assertEquals(reads, self.normalized)
+        self.assertEqual(reads, self.normalized)
 
     def test_issue1395_3(self):
         txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ASCII")
@@ -58,7 +58,7 @@
         reads += txt.readline()
         reads += txt.readline()
         reads += txt.readline()
-        self.assertEquals(reads, self.normalized)
+        self.assertEqual(reads, self.normalized)
 
     def test_issue1395_4(self):
         txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ASCII")
@@ -66,7 +66,7 @@
 
         reads = txt.read(4)
         reads += txt.read()
-        self.assertEquals(reads, self.normalized)
+        self.assertEqual(reads, self.normalized)
 
     def test_issue1395_5(self):
         txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ASCII")
@@ -76,7 +76,7 @@
         pos = txt.tell()
         txt.seek(0)
         txt.seek(pos)
-        self.assertEquals(txt.read(4), "BBB\n")
+        self.assertEqual(txt.read(4), "BBB\n")
 
 
 

Modified: python/branches/py3k-cdecimal/Lib/test/pickletester.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/pickletester.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/pickletester.py	Mon Nov 22 12:00:42 2010
@@ -579,7 +579,7 @@
 
     def test_get(self):
         self.assertRaises(KeyError, self.loads, b'g0\np0')
-        self.assertEquals(self.loads(b'((Kdtp0\nh\x00l.))'), [(100,), (100,)])
+        self.assertEqual(self.loads(b'((Kdtp0\nh\x00l.))'), [(100,), (100,)])
 
     def test_insecure_strings(self):
         # XXX Some of these tests are temporarily disabled

Modified: python/branches/py3k-cdecimal/Lib/test/seq_tests.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/seq_tests.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/seq_tests.py	Mon Nov 22 12:00:42 2010
@@ -131,8 +131,8 @@
             self.assertRaises(ZeroDivisionError, self.type2test, IterGenExc(s))
 
     def test_truth(self):
-        self.assert_(not self.type2test())
-        self.assert_(self.type2test([42]))
+        self.assertFalse(self.type2test())
+        self.assertTrue(self.type2test([42]))
 
     def test_getitem(self):
         u = self.type2test([0, 1, 2, 3, 4])
@@ -268,7 +268,7 @@
             pass
         u3 = subclass([0, 1])
         self.assertEqual(u3, u3*1)
-        self.assert_(u3 is not u3*1)
+        self.assertIsNot(u3, u3*1)
 
     def test_iadd(self):
         u = self.type2test([0, 1])

Modified: python/branches/py3k-cdecimal/Lib/test/string_tests.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/string_tests.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/string_tests.py	Mon Nov 22 12:00:42 2010
@@ -67,7 +67,7 @@
             else:
                 obj = subtype(obj)
                 realresult = getattr(obj, methodname)(*args)
-                self.assert_(obj is not realresult)
+                self.assertIsNot(obj, realresult)
 
     # check that obj.method(*args) raises exc
     def checkraises(self, exc, obj, methodname, *args):
@@ -1197,34 +1197,34 @@
             pass
         s1 = subclass("abcd")
         s2 = t().join([s1])
-        self.assert_(s1 is not s2)
-        self.assert_(type(s2) is t)
+        self.assertIsNot(s1, s2)
+        self.assertIs(type(s2), t)
 
         s1 = t("abcd")
         s2 = t().join([s1])
-        self.assert_(s1 is s2)
+        self.assertIs(s1, s2)
 
         # Should also test mixed-type join.
         if t is str:
             s1 = subclass("abcd")
             s2 = "".join([s1])
-            self.assert_(s1 is not s2)
-            self.assert_(type(s2) is t)
+            self.assertIsNot(s1, s2)
+            self.assertIs(type(s2), t)
 
             s1 = t("abcd")
             s2 = "".join([s1])
-            self.assert_(s1 is s2)
+            self.assertIs(s1, s2)
 
 ##         elif t is str8:
 ##             s1 = subclass("abcd")
 ##             s2 = "".join([s1])
-##             self.assert_(s1 is not s2)
-##             self.assert_(type(s2) is str) # promotes!
+##             self.assertIsNot(s1, s2)
+##             self.assertIs(type(s2), str) # promotes!
 
 ##             s1 = t("abcd")
 ##             s2 = "".join([s1])
-##             self.assert_(s1 is not s2)
-##             self.assert_(type(s2) is str) # promotes!
+##             self.assertIsNot(s1, s2)
+##             self.assertIs(type(s2), str) # promotes!
 
         else:
             self.fail("unexpected type for MixinStrUnicodeTest %r" % t)

Modified: python/branches/py3k-cdecimal/Lib/test/test__locale.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test__locale.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test__locale.py	Mon Nov 22 12:00:42 2010
@@ -59,7 +59,7 @@
         known_value = known_numerics.get(used_locale,
                                     ('', ''))[data_type == 'thousands_sep']
         if known_value and calc_value:
-            self.assertEquals(calc_value, known_value,
+            self.assertEqual(calc_value, known_value,
                                 self.lc_numeric_err_msg % (
                                     calc_value, known_value,
                                     calc_type, data_type, set_locale,
@@ -107,7 +107,7 @@
                     set_locale = setlocale(LC_NUMERIC)
                 except Error:
                     set_locale = "<not able to determine>"
-                self.assertEquals(nl_radixchar, li_radixchar,
+                self.assertEqual(nl_radixchar, li_radixchar,
                                 "%s (nl_langinfo) != %s (localeconv) "
                                 "(set to %s, using %s)" % (
                                                 nl_radixchar, li_radixchar,
@@ -127,9 +127,9 @@
             if loc == 'eu_ES' and localeconv()['decimal_point'] == "' ":
                 continue
 
-            self.assertEquals(int(eval('3.14') * 100), 314,
+            self.assertEqual(int(eval('3.14') * 100), 314,
                                 "using eval('3.14') failed for %s" % loc)
-            self.assertEquals(int(float('3.14') * 100), 314,
+            self.assertEqual(int(float('3.14') * 100), 314,
                                 "using float('3.14') failed for %s" % loc)
             if localeconv()['decimal_point'] != '.':
                 self.assertRaises(ValueError, float,

Modified: python/branches/py3k-cdecimal/Lib/test/test_argparse.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_argparse.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_argparse.py	Mon Nov 22 12:00:42 2010
@@ -2698,18 +2698,18 @@
 
     def test_empty(self):
         ns = argparse.Namespace()
-        self.assertEquals('' in ns, False)
-        self.assertEquals('' not in ns, True)
-        self.assertEquals('x' in ns, False)
+        self.assertEqual('' in ns, False)
+        self.assertEqual('' not in ns, True)
+        self.assertEqual('x' in ns, False)
 
     def test_non_empty(self):
         ns = argparse.Namespace(x=1, y=2)
-        self.assertEquals('x' in ns, True)
-        self.assertEquals('x' not in ns, False)
-        self.assertEquals('y' in ns, True)
-        self.assertEquals('' in ns, False)
-        self.assertEquals('xx' in ns, False)
-        self.assertEquals('z' in ns, False)
+        self.assertEqual('x' in ns, True)
+        self.assertEqual('x' not in ns, False)
+        self.assertEqual('y' in ns, True)
+        self.assertEqual('' in ns, False)
+        self.assertEqual('xx' in ns, False)
+        self.assertEqual('z' in ns, False)
 
 # =====================
 # Help formatting tests
@@ -4259,7 +4259,7 @@
 # ArgumentTypeError tests
 # =======================
 
-class TestArgumentError(TestCase):
+class TestArgumentTypeError(TestCase):
 
     def test_argument_type_error(self):
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_array.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_array.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_array.py	Mon Nov 22 12:00:42 2010
@@ -238,9 +238,9 @@
     def test_reduce_ex(self):
         a = array.array(self.typecode, self.example)
         for protocol in range(3):
-            self.assert_(a.__reduce_ex__(protocol)[0] is array.array)
+            self.assertIs(a.__reduce_ex__(protocol)[0], array.array)
         for protocol in range(3, pickle.HIGHEST_PROTOCOL):
-            self.assert_(a.__reduce_ex__(protocol)[0] is array_reconstructor)
+            self.assertIs(a.__reduce_ex__(protocol)[0], array_reconstructor)
 
     def test_pickle(self):
         for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
@@ -785,11 +785,11 @@
                     data.reverse()
                     L[start:stop:step] = data
                     a[start:stop:step] = array.array(self.typecode, data)
-                    self.assertEquals(a, array.array(self.typecode, L))
+                    self.assertEqual(a, array.array(self.typecode, L))
 
                     del L[start:stop:step]
                     del a[start:stop:step]
-                    self.assertEquals(a, array.array(self.typecode, L))
+                    self.assertEqual(a, array.array(self.typecode, L))
 
     def test_index(self):
         example = 2*self.example

Modified: python/branches/py3k-cdecimal/Lib/test/test_ast.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_ast.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_ast.py	Mon Nov 22 12:00:42 2010
@@ -141,7 +141,7 @@
                                     (eval_tests, eval_results, "eval")):
             for i, o in zip(input, output):
                 ast_tree = compile(i, "?", kind, ast.PyCF_ONLY_AST)
-                self.assertEquals(to_tuple(ast_tree), o)
+                self.assertEqual(to_tuple(ast_tree), o)
                 self._assertTrueorder(ast_tree, (0, 0))
 
     def test_slice(self):
@@ -164,20 +164,20 @@
 
     def test_nodeclasses(self):
         x = ast.BinOp(1, 2, 3, lineno=0)
-        self.assertEquals(x.left, 1)
-        self.assertEquals(x.op, 2)
-        self.assertEquals(x.right, 3)
-        self.assertEquals(x.lineno, 0)
+        self.assertEqual(x.left, 1)
+        self.assertEqual(x.op, 2)
+        self.assertEqual(x.right, 3)
+        self.assertEqual(x.lineno, 0)
 
         # node raises exception when not given enough arguments
         self.assertRaises(TypeError, ast.BinOp, 1, 2)
 
         # can set attributes through kwargs too
         x = ast.BinOp(left=1, op=2, right=3, lineno=0)
-        self.assertEquals(x.left, 1)
-        self.assertEquals(x.op, 2)
-        self.assertEquals(x.right, 3)
-        self.assertEquals(x.lineno, 0)
+        self.assertEqual(x.left, 1)
+        self.assertEqual(x.op, 2)
+        self.assertEqual(x.right, 3)
+        self.assertEqual(x.lineno, 0)
 
         # this used to fail because Sub._fields was None
         x = ast.Sub()
@@ -195,7 +195,14 @@
             for protocol in protocols:
                 for ast in (compile(i, "?", "exec", 0x400) for i in exec_tests):
                     ast2 = mod.loads(mod.dumps(ast, protocol))
-                    self.assertEquals(to_tuple(ast2), to_tuple(ast))
+                    self.assertEqual(to_tuple(ast2), to_tuple(ast))
+
+    def test_invalid_sum(self):
+        pos = dict(lineno=2, col_offset=3)
+        m = ast.Module([ast.Expr(ast.expr(**pos), **pos)])
+        with self.assertRaises(TypeError) as cm:
+            compile(m, "<test>", "exec")
+        self.assertIn("but got <_ast.expr", str(cm.exception))
 
 
 class ASTHelpers_Test(unittest.TestCase):

Modified: python/branches/py3k-cdecimal/Lib/test/test_augassign.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_augassign.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_augassign.py	Mon Nov 22 12:00:42 2010
@@ -17,7 +17,7 @@
         x |= 5
         x ^= 1
         x /= 2
-        self.assertEquals(x, 3.0)
+        self.assertEqual(x, 3.0)
 
     def test_with_unpacking(self):
         self.assertRaises(SyntaxError, compile, "x, b += 3", "<test>", "exec")
@@ -34,7 +34,7 @@
         x[0] |= 5
         x[0] ^= 1
         x[0] /= 2
-        self.assertEquals(x[0], 3.0)
+        self.assertEqual(x[0], 3.0)
 
     def testInDict(self):
         x = {0: 2}
@@ -48,21 +48,21 @@
         x[0] |= 5
         x[0] ^= 1
         x[0] /= 2
-        self.assertEquals(x[0], 3.0)
+        self.assertEqual(x[0], 3.0)
 
     def testSequences(self):
         x = [1,2]
         x += [3,4]
         x *= 2
 
-        self.assertEquals(x, [1, 2, 3, 4, 1, 2, 3, 4])
+        self.assertEqual(x, [1, 2, 3, 4, 1, 2, 3, 4])
 
         x = [1, 2, 3]
         y = x
         x[1:2] *= 2
         y[1:2] += [1]
 
-        self.assertEquals(x, [1, 2, 1, 2, 3])
+        self.assertEqual(x, [1, 2, 1, 2, 3])
         self.assertTrue(x is y)
 
     def testCustomMethods1(self):
@@ -90,14 +90,14 @@
 
         self.assertIsInstance(x, aug_test)
         self.assertTrue(y is not x)
-        self.assertEquals(x.val, 11)
+        self.assertEqual(x.val, 11)
 
         x = aug_test2(2)
         y = x
         x += 10
 
         self.assertTrue(y is x)
-        self.assertEquals(x.val, 12)
+        self.assertEqual(x.val, 12)
 
         x = aug_test3(3)
         y = x
@@ -105,7 +105,7 @@
 
         self.assertIsInstance(x, aug_test3)
         self.assertTrue(y is not x)
-        self.assertEquals(x.val, 13)
+        self.assertEqual(x.val, 13)
 
 
     def testCustomMethods2(test_self):
@@ -269,7 +269,7 @@
         1 << x
         x <<= 1
 
-        test_self.assertEquals(output, '''\
+        test_self.assertEqual(output, '''\
 __add__ called
 __radd__ called
 __iadd__ called

Modified: python/branches/py3k-cdecimal/Lib/test/test_base64.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_base64.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_base64.py	Mon Nov 22 12:00:42 2010
@@ -6,7 +6,7 @@
 import subprocess
 
 
-
+
 class LegacyBase64TestCase(unittest.TestCase):
     def test_encodebytes(self):
         eq = self.assertEqual
@@ -58,7 +58,7 @@
         base64.decode(infp, outfp)
         self.assertEqual(outfp.getvalue(), b'www.python.org')
 
-
+
 class BaseXYTestCase(unittest.TestCase):
     def test_b64encode(self):
         eq = self.assertEqual
@@ -153,7 +153,7 @@
                  (b'!', b''),
                  (b'YWJj\nYWI=', b'abcab'))
         for bstr, res in tests:
-            self.assertEquals(base64.b64decode(bstr), res)
+            self.assertEqual(base64.b64decode(bstr), res)
             with self.assertRaises(binascii.Error):
                 base64.b64decode(bstr, validate=True)
 
@@ -225,7 +225,7 @@
         self.assertTrue(issubclass(binascii.Error, ValueError))
 
 
-
+
 class TestMain(unittest.TestCase):
     def get_output(self, *args, **options):
         args = (sys.executable, '-m', 'base64') + args
@@ -244,20 +244,20 @@
             fp.write(b'a\xffb\n')
 
         output = self.get_output('-e', support.TESTFN)
-        self.assertEquals(output.rstrip(), b'Yf9iCg==')
+        self.assertEqual(output.rstrip(), b'Yf9iCg==')
 
         with open(support.TESTFN, 'rb') as fp:
             output = self.get_output('-e', stdin=fp)
-        self.assertEquals(output.rstrip(), b'Yf9iCg==')
+        self.assertEqual(output.rstrip(), b'Yf9iCg==')
 
     def test_decode(self):
         with open(support.TESTFN, 'wb') as fp:
             fp.write(b'Yf9iCg==')
         output = self.get_output('-d', support.TESTFN)
-        self.assertEquals(output.rstrip(), b'a\xffb')
+        self.assertEqual(output.rstrip(), b'a\xffb')
+
 
 
-
 def test_main():
     support.run_unittest(__name__)
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_bigmem.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_bigmem.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_bigmem.py	Mon Nov 22 12:00:42 2010
@@ -13,7 +13,7 @@
 #    doesn't release the old 's' (if it exists) until well after its new
 #    value has been created. Use 'del s' before the create_largestring call.
 #
-#  - Do *not* compare large objects using assertEquals or similar. It's a
+#  - Do *not* compare large objects using assertEqual or similar. It's a
 #    lengthy operation and the errormessage will be utterly useless due to
 #    its size. To make sure whether a result has the right contents, better
 #    to use the strip or count methods, or compare meaningful slices.
@@ -48,32 +48,32 @@
         SUBSTR = self.from_latin1(' abc def ghi')
         s = _('-') * size + SUBSTR
         caps = s.capitalize()
-        self.assertEquals(caps[-len(SUBSTR):],
+        self.assertEqual(caps[-len(SUBSTR):],
                          SUBSTR.capitalize())
-        self.assertEquals(caps.lstrip(_('-')), SUBSTR)
+        self.assertEqual(caps.lstrip(_('-')), SUBSTR)
 
     @bigmemtest(minsize=_2G + 10, memuse=1)
     def test_center(self, size):
         SUBSTR = self.from_latin1(' abc def ghi')
         s = SUBSTR.center(size)
-        self.assertEquals(len(s), size)
+        self.assertEqual(len(s), size)
         lpadsize = rpadsize = (len(s) - len(SUBSTR)) // 2
         if len(s) % 2:
             lpadsize += 1
-        self.assertEquals(s[lpadsize:-rpadsize], SUBSTR)
-        self.assertEquals(s.strip(), SUBSTR.strip())
+        self.assertEqual(s[lpadsize:-rpadsize], SUBSTR)
+        self.assertEqual(s.strip(), SUBSTR.strip())
 
     @bigmemtest(minsize=_2G, memuse=2)
     def test_count(self, size):
         _ = self.from_latin1
         SUBSTR = _(' abc def ghi')
         s = _('.') * size + SUBSTR
-        self.assertEquals(s.count(_('.')), size)
+        self.assertEqual(s.count(_('.')), size)
         s += _('.')
-        self.assertEquals(s.count(_('.')), size + 1)
-        self.assertEquals(s.count(_(' ')), 3)
-        self.assertEquals(s.count(_('i')), 1)
-        self.assertEquals(s.count(_('j')), 0)
+        self.assertEqual(s.count(_('.')), size + 1)
+        self.assertEqual(s.count(_(' ')), 3)
+        self.assertEqual(s.count(_('i')), 1)
+        self.assertEqual(s.count(_('j')), 0)
 
     @bigmemtest(minsize=_2G, memuse=2)
     def test_endswith(self, size):
@@ -92,13 +92,13 @@
         _ = self.from_latin1
         s = _('-') * size
         tabsize = 8
-        self.assertEquals(s.expandtabs(), s)
+        self.assertEqual(s.expandtabs(), s)
         del s
         slen, remainder = divmod(size, tabsize)
         s = _('       \t') * slen
         s = s.expandtabs(tabsize)
-        self.assertEquals(len(s), size - remainder)
-        self.assertEquals(len(s.strip(_(' '))), 0)
+        self.assertEqual(len(s), size - remainder)
+        self.assertEqual(len(s.strip(_(' '))), 0)
 
     @bigmemtest(minsize=_2G, memuse=2)
     def test_find(self, size):
@@ -106,16 +106,16 @@
         SUBSTR = _(' abc def ghi')
         sublen = len(SUBSTR)
         s = _('').join([SUBSTR, _('-') * size, SUBSTR])
-        self.assertEquals(s.find(_(' ')), 0)
-        self.assertEquals(s.find(SUBSTR), 0)
-        self.assertEquals(s.find(_(' '), sublen), sublen + size)
-        self.assertEquals(s.find(SUBSTR, len(SUBSTR)), sublen + size)
-        self.assertEquals(s.find(_('i')), SUBSTR.find(_('i')))
-        self.assertEquals(s.find(_('i'), sublen),
+        self.assertEqual(s.find(_(' ')), 0)
+        self.assertEqual(s.find(SUBSTR), 0)
+        self.assertEqual(s.find(_(' '), sublen), sublen + size)
+        self.assertEqual(s.find(SUBSTR, len(SUBSTR)), sublen + size)
+        self.assertEqual(s.find(_('i')), SUBSTR.find(_('i')))
+        self.assertEqual(s.find(_('i'), sublen),
                          sublen + size + SUBSTR.find(_('i')))
-        self.assertEquals(s.find(_('i'), size),
+        self.assertEqual(s.find(_('i'), size),
                          sublen + size + SUBSTR.find(_('i')))
-        self.assertEquals(s.find(_('j')), -1)
+        self.assertEqual(s.find(_('j')), -1)
 
     @bigmemtest(minsize=_2G, memuse=2)
     def test_index(self, size):
@@ -123,14 +123,14 @@
         SUBSTR = _(' abc def ghi')
         sublen = len(SUBSTR)
         s = _('').join([SUBSTR, _('-') * size, SUBSTR])
-        self.assertEquals(s.index(_(' ')), 0)
-        self.assertEquals(s.index(SUBSTR), 0)
-        self.assertEquals(s.index(_(' '), sublen), sublen + size)
-        self.assertEquals(s.index(SUBSTR, sublen), sublen + size)
-        self.assertEquals(s.index(_('i')), SUBSTR.index(_('i')))
-        self.assertEquals(s.index(_('i'), sublen),
+        self.assertEqual(s.index(_(' ')), 0)
+        self.assertEqual(s.index(SUBSTR), 0)
+        self.assertEqual(s.index(_(' '), sublen), sublen + size)
+        self.assertEqual(s.index(SUBSTR, sublen), sublen + size)
+        self.assertEqual(s.index(_('i')), SUBSTR.index(_('i')))
+        self.assertEqual(s.index(_('i'), sublen),
                          sublen + size + SUBSTR.index(_('i')))
-        self.assertEquals(s.index(_('i'), size),
+        self.assertEqual(s.index(_('i'), size),
                          sublen + size + SUBSTR.index(_('i')))
         self.assertRaises(ValueError, s.index, _('j'))
 
@@ -209,8 +209,8 @@
         _ = self.from_latin1
         s = _('A') * size
         x = s.join([_('aaaaa'), _('bbbbb')])
-        self.assertEquals(x.count(_('a')), 5)
-        self.assertEquals(x.count(_('b')), 5)
+        self.assertEqual(x.count(_('a')), 5)
+        self.assertEqual(x.count(_('b')), 5)
         self.assertTrue(x.startswith(_('aaaaaA')))
         self.assertTrue(x.endswith(_('Abbbbb')))
 
@@ -220,27 +220,27 @@
         SUBSTR = _(' abc def ghi')
         s = SUBSTR.ljust(size)
         self.assertTrue(s.startswith(SUBSTR + _('  ')))
-        self.assertEquals(len(s), size)
-        self.assertEquals(s.strip(), SUBSTR.strip())
+        self.assertEqual(len(s), size)
+        self.assertEqual(s.strip(), SUBSTR.strip())
 
     @bigmemtest(minsize=_2G + 10, memuse=2)
     def test_lower(self, size):
         _ = self.from_latin1
         s = _('A') * size
         s = s.lower()
-        self.assertEquals(len(s), size)
-        self.assertEquals(s.count(_('a')), size)
+        self.assertEqual(len(s), size)
+        self.assertEqual(s.count(_('a')), size)
 
     @bigmemtest(minsize=_2G + 10, memuse=1)
     def test_lstrip(self, size):
         _ = self.from_latin1
         SUBSTR = _('abc def ghi')
         s = SUBSTR.rjust(size)
-        self.assertEquals(len(s), size)
-        self.assertEquals(s.lstrip(), SUBSTR.lstrip())
+        self.assertEqual(len(s), size)
+        self.assertEqual(s.lstrip(), SUBSTR.lstrip())
         del s
         s = SUBSTR.ljust(size)
-        self.assertEquals(len(s), size)
+        self.assertEqual(len(s), size)
         # Type-specific optimization
         if isinstance(s, (str, bytes)):
             stripped = s.lstrip()
@@ -252,12 +252,12 @@
         replacement = _('a')
         s = _(' ') * size
         s = s.replace(_(' '), replacement)
-        self.assertEquals(len(s), size)
-        self.assertEquals(s.count(replacement), size)
+        self.assertEqual(len(s), size)
+        self.assertEqual(s.count(replacement), size)
         s = s.replace(replacement, _(' '), size - 4)
-        self.assertEquals(len(s), size)
-        self.assertEquals(s.count(replacement), 4)
-        self.assertEquals(s[-10:], _('      aaaa'))
+        self.assertEqual(len(s), size)
+        self.assertEqual(s.count(replacement), 4)
+        self.assertEqual(s[-10:], _('      aaaa'))
 
     @bigmemtest(minsize=_2G, memuse=2)
     def test_rfind(self, size):
@@ -265,15 +265,15 @@
         SUBSTR = _(' abc def ghi')
         sublen = len(SUBSTR)
         s = _('').join([SUBSTR, _('-') * size, SUBSTR])
-        self.assertEquals(s.rfind(_(' ')), sublen + size + SUBSTR.rfind(_(' ')))
-        self.assertEquals(s.rfind(SUBSTR), sublen + size)
-        self.assertEquals(s.rfind(_(' '), 0, size), SUBSTR.rfind(_(' ')))
-        self.assertEquals(s.rfind(SUBSTR, 0, sublen + size), 0)
-        self.assertEquals(s.rfind(_('i')), sublen + size + SUBSTR.rfind(_('i')))
-        self.assertEquals(s.rfind(_('i'), 0, sublen), SUBSTR.rfind(_('i')))
-        self.assertEquals(s.rfind(_('i'), 0, sublen + size),
-                          SUBSTR.rfind(_('i')))
-        self.assertEquals(s.rfind(_('j')), -1)
+        self.assertEqual(s.rfind(_(' ')), sublen + size + SUBSTR.rfind(_(' ')))
+        self.assertEqual(s.rfind(SUBSTR), sublen + size)
+        self.assertEqual(s.rfind(_(' '), 0, size), SUBSTR.rfind(_(' ')))
+        self.assertEqual(s.rfind(SUBSTR, 0, sublen + size), 0)
+        self.assertEqual(s.rfind(_('i')), sublen + size + SUBSTR.rfind(_('i')))
+        self.assertEqual(s.rfind(_('i'), 0, sublen), SUBSTR.rfind(_('i')))
+        self.assertEqual(s.rfind(_('i'), 0, sublen + size),
+                         SUBSTR.rfind(_('i')))
+        self.assertEqual(s.rfind(_('j')), -1)
 
     @bigmemtest(minsize=_2G, memuse=2)
     def test_rindex(self, size):
@@ -281,17 +281,17 @@
         SUBSTR = _(' abc def ghi')
         sublen = len(SUBSTR)
         s = _('').join([SUBSTR, _('-') * size, SUBSTR])
-        self.assertEquals(s.rindex(_(' ')),
-                          sublen + size + SUBSTR.rindex(_(' ')))
-        self.assertEquals(s.rindex(SUBSTR), sublen + size)
-        self.assertEquals(s.rindex(_(' '), 0, sublen + size - 1),
-                          SUBSTR.rindex(_(' ')))
-        self.assertEquals(s.rindex(SUBSTR, 0, sublen + size), 0)
-        self.assertEquals(s.rindex(_('i')),
-                          sublen + size + SUBSTR.rindex(_('i')))
-        self.assertEquals(s.rindex(_('i'), 0, sublen), SUBSTR.rindex(_('i')))
-        self.assertEquals(s.rindex(_('i'), 0, sublen + size),
-                          SUBSTR.rindex(_('i')))
+        self.assertEqual(s.rindex(_(' ')),
+                         sublen + size + SUBSTR.rindex(_(' ')))
+        self.assertEqual(s.rindex(SUBSTR), sublen + size)
+        self.assertEqual(s.rindex(_(' '), 0, sublen + size - 1),
+                         SUBSTR.rindex(_(' ')))
+        self.assertEqual(s.rindex(SUBSTR, 0, sublen + size), 0)
+        self.assertEqual(s.rindex(_('i')),
+                         sublen + size + SUBSTR.rindex(_('i')))
+        self.assertEqual(s.rindex(_('i'), 0, sublen), SUBSTR.rindex(_('i')))
+        self.assertEqual(s.rindex(_('i'), 0, sublen + size),
+                         SUBSTR.rindex(_('i')))
         self.assertRaises(ValueError, s.rindex, _('j'))
 
     @bigmemtest(minsize=_2G + 10, memuse=1)
@@ -300,19 +300,19 @@
         SUBSTR = _(' abc def ghi')
         s = SUBSTR.ljust(size)
         self.assertTrue(s.startswith(SUBSTR + _('  ')))
-        self.assertEquals(len(s), size)
-        self.assertEquals(s.strip(), SUBSTR.strip())
+        self.assertEqual(len(s), size)
+        self.assertEqual(s.strip(), SUBSTR.strip())
 
     @bigmemtest(minsize=_2G + 10, memuse=1)
     def test_rstrip(self, size):
         _ = self.from_latin1
         SUBSTR = _(' abc def ghi')
         s = SUBSTR.ljust(size)
-        self.assertEquals(len(s), size)
-        self.assertEquals(s.rstrip(), SUBSTR.rstrip())
+        self.assertEqual(len(s), size)
+        self.assertEqual(s.rstrip(), SUBSTR.rstrip())
         del s
         s = SUBSTR.rjust(size)
-        self.assertEquals(len(s), size)
+        self.assertEqual(len(s), size)
         # Type-specific optimization
         if isinstance(s, (str, bytes)):
             stripped = s.rstrip()
@@ -330,16 +330,16 @@
         SUBSTR = _('a') + _(' ') * chunksize
         s = SUBSTR * chunksize
         l = s.split()
-        self.assertEquals(len(l), chunksize)
+        self.assertEqual(len(l), chunksize)
         expected = _('a')
         for item in l:
-            self.assertEquals(item, expected)
+            self.assertEqual(item, expected)
         del l
         l = s.split(_('a'))
-        self.assertEquals(len(l), chunksize + 1)
+        self.assertEqual(len(l), chunksize + 1)
         expected = _(' ') * chunksize
         for item in filter(None, l):
-            self.assertEquals(item, expected)
+            self.assertEqual(item, expected)
 
     # Allocates a string of twice size (and briefly two) and a list of
     # size.  Because of internal affairs, the s.split() call produces a
@@ -352,12 +352,12 @@
         _ = self.from_latin1
         s = _(' a') * size + _(' ')
         l = s.split()
-        self.assertEquals(len(l), size)
-        self.assertEquals(set(l), set([_('a')]))
+        self.assertEqual(len(l), size)
+        self.assertEqual(set(l), set([_('a')]))
         del l
         l = s.split(_('a'))
-        self.assertEquals(len(l), size + 1)
-        self.assertEquals(set(l), set([_(' ')]))
+        self.assertEqual(len(l), size + 1)
+        self.assertEqual(set(l), set([_(' ')]))
 
     @bigmemtest(minsize=_2G, memuse=2.1)
     def test_splitlines(self, size):
@@ -368,10 +368,10 @@
         SUBSTR = _(' ') * chunksize + _('\n') + _(' ') * chunksize + _('\r\n')
         s = SUBSTR * chunksize
         l = s.splitlines()
-        self.assertEquals(len(l), chunksize * 2)
+        self.assertEqual(len(l), chunksize * 2)
         expected = _(' ') * chunksize
         for item in l:
-            self.assertEquals(item, expected)
+            self.assertEqual(item, expected)
 
     @bigmemtest(minsize=_2G, memuse=2)
     def test_startswith(self, size):
@@ -387,12 +387,12 @@
         _ = self.from_latin1
         SUBSTR = _('   abc def ghi   ')
         s = SUBSTR.rjust(size)
-        self.assertEquals(len(s), size)
-        self.assertEquals(s.strip(), SUBSTR.strip())
+        self.assertEqual(len(s), size)
+        self.assertEqual(s.strip(), SUBSTR.strip())
         del s
         s = SUBSTR.ljust(size)
-        self.assertEquals(len(s), size)
-        self.assertEquals(s.strip(), SUBSTR.strip())
+        self.assertEqual(len(s), size)
+        self.assertEqual(s.strip(), SUBSTR.strip())
 
     @bigmemtest(minsize=_2G, memuse=2)
     def test_swapcase(self, size):
@@ -402,9 +402,9 @@
         repeats = size // sublen + 2
         s = SUBSTR * repeats
         s = s.swapcase()
-        self.assertEquals(len(s), sublen * repeats)
-        self.assertEquals(s[:sublen * 3], SUBSTR.swapcase() * 3)
-        self.assertEquals(s[-sublen * 3:], SUBSTR.swapcase() * 3)
+        self.assertEqual(len(s), sublen * repeats)
+        self.assertEqual(s[:sublen * 3], SUBSTR.swapcase() * 3)
+        self.assertEqual(s[-sublen * 3:], SUBSTR.swapcase() * 3)
 
     @bigmemtest(minsize=_2G, memuse=2)
     def test_title(self, size):
@@ -431,20 +431,20 @@
         repeats = size // sublen + 2
         s = SUBSTR * repeats
         s = s.translate(trans)
-        self.assertEquals(len(s), repeats * sublen)
-        self.assertEquals(s[:sublen], SUBSTR.translate(trans))
-        self.assertEquals(s[-sublen:], SUBSTR.translate(trans))
-        self.assertEquals(s.count(_('.')), 0)
-        self.assertEquals(s.count(_('!')), repeats * 2)
-        self.assertEquals(s.count(_('z')), repeats * 3)
+        self.assertEqual(len(s), repeats * sublen)
+        self.assertEqual(s[:sublen], SUBSTR.translate(trans))
+        self.assertEqual(s[-sublen:], SUBSTR.translate(trans))
+        self.assertEqual(s.count(_('.')), 0)
+        self.assertEqual(s.count(_('!')), repeats * 2)
+        self.assertEqual(s.count(_('z')), repeats * 3)
 
     @bigmemtest(minsize=_2G + 5, memuse=2)
     def test_upper(self, size):
         _ = self.from_latin1
         s = _('a') * size
         s = s.upper()
-        self.assertEquals(len(s), size)
-        self.assertEquals(s.count(_('A')), size)
+        self.assertEqual(len(s), size)
+        self.assertEqual(s.count(_('A')), size)
 
     @bigmemtest(minsize=_2G + 20, memuse=1)
     def test_zfill(self, size):
@@ -453,8 +453,8 @@
         s = SUBSTR.zfill(size)
         self.assertTrue(s.endswith(_('0') + SUBSTR[1:]))
         self.assertTrue(s.startswith(_('-0')))
-        self.assertEquals(len(s), size)
-        self.assertEquals(s.count(_('0')), size - len(SUBSTR))
+        self.assertEqual(len(s), size)
+        self.assertEqual(s.count(_('0')), size - len(SUBSTR))
 
     # This test is meaningful even with size < 2G, as long as the
     # doubled string is > 2G (but it tests more if both are > 2G :)
@@ -462,10 +462,10 @@
     def test_concat(self, size):
         _ = self.from_latin1
         s = _('.') * size
-        self.assertEquals(len(s), size)
+        self.assertEqual(len(s), size)
         s = s + s
-        self.assertEquals(len(s), size * 2)
-        self.assertEquals(s.count(_('.')), size * 2)
+        self.assertEqual(len(s), size * 2)
+        self.assertEqual(s.count(_('.')), size * 2)
 
     # This test is meaningful even with size < 2G, as long as the
     # repeated string is > 2G (but it tests more if both are > 2G :)
@@ -473,10 +473,10 @@
     def test_repeat(self, size):
         _ = self.from_latin1
         s = _('.') * size
-        self.assertEquals(len(s), size)
+        self.assertEqual(len(s), size)
         s = s * 2
-        self.assertEquals(len(s), size * 2)
-        self.assertEquals(s.count(_('.')), size * 2)
+        self.assertEqual(len(s), size * 2)
+        self.assertEqual(s.count(_('.')), size * 2)
 
     @bigmemtest(minsize=_2G + 20, memuse=2)
     def test_slice_and_getitem(self, size):
@@ -487,26 +487,26 @@
         stepsize = len(s) // 100
         stepsize = stepsize - (stepsize % sublen)
         for i in range(0, len(s) - stepsize, stepsize):
-            self.assertEquals(s[i], SUBSTR[0])
-            self.assertEquals(s[i:i + sublen], SUBSTR)
-            self.assertEquals(s[i:i + sublen:2], SUBSTR[::2])
+            self.assertEqual(s[i], SUBSTR[0])
+            self.assertEqual(s[i:i + sublen], SUBSTR)
+            self.assertEqual(s[i:i + sublen:2], SUBSTR[::2])
             if i > 0:
-                self.assertEquals(s[i + sublen - 1:i - 1:-3],
-                                  SUBSTR[sublen::-3])
+                self.assertEqual(s[i + sublen - 1:i - 1:-3],
+                                 SUBSTR[sublen::-3])
         # Make sure we do some slicing and indexing near the end of the
         # string, too.
-        self.assertEquals(s[len(s) - 1], SUBSTR[-1])
-        self.assertEquals(s[-1], SUBSTR[-1])
-        self.assertEquals(s[len(s) - 10], SUBSTR[0])
-        self.assertEquals(s[-sublen], SUBSTR[0])
-        self.assertEquals(s[len(s):], _(''))
-        self.assertEquals(s[len(s) - 1:], SUBSTR[-1:])
-        self.assertEquals(s[-1:], SUBSTR[-1:])
-        self.assertEquals(s[len(s) - sublen:], SUBSTR)
-        self.assertEquals(s[-sublen:], SUBSTR)
-        self.assertEquals(len(s[:]), len(s))
-        self.assertEquals(len(s[:len(s) - 5]), len(s) - 5)
-        self.assertEquals(len(s[5:-5]), len(s) - 10)
+        self.assertEqual(s[len(s) - 1], SUBSTR[-1])
+        self.assertEqual(s[-1], SUBSTR[-1])
+        self.assertEqual(s[len(s) - 10], SUBSTR[0])
+        self.assertEqual(s[-sublen], SUBSTR[0])
+        self.assertEqual(s[len(s):], _(''))
+        self.assertEqual(s[len(s) - 1:], SUBSTR[-1:])
+        self.assertEqual(s[-1:], SUBSTR[-1:])
+        self.assertEqual(s[len(s) - sublen:], SUBSTR)
+        self.assertEqual(s[-sublen:], SUBSTR)
+        self.assertEqual(len(s[:]), len(s))
+        self.assertEqual(len(s[:len(s) - 5]), len(s) - 5)
+        self.assertEqual(len(s[5:-5]), len(s) - 10)
 
         self.assertRaises(IndexError, operator.getitem, s, len(s))
         self.assertRaises(IndexError, operator.getitem, s, len(s) + 1)
@@ -565,7 +565,7 @@
             expectedsize = size
 
         s = c * size
-        self.assertEquals(len(s.encode(enc)), expectedsize)
+        self.assertEqual(len(s.encode(enc)), expectedsize)
 
     def setUp(self):
         # HACK: adjust memory use of tests inherited from BaseStrTest
@@ -632,7 +632,7 @@
         self.assertEqual(s, sf)
         del sf
         sf = '..%s..' % (s,)
-        self.assertEquals(len(sf), len(s) + 4)
+        self.assertEqual(len(sf), len(s) + 4)
         self.assertTrue(sf.startswith('..-'))
         self.assertTrue(sf.endswith('-..'))
         del s, sf
@@ -642,18 +642,18 @@
         s = ''.join([edge, '%s', edge])
         del edge
         s = s % '...'
-        self.assertEquals(len(s), size * 2 + 3)
-        self.assertEquals(s.count('.'), 3)
-        self.assertEquals(s.count('-'), size * 2)
+        self.assertEqual(len(s), size * 2 + 3)
+        self.assertEqual(s.count('.'), 3)
+        self.assertEqual(s.count('-'), size * 2)
 
     @bigmemtest(minsize=_2G + 10, memuse=character_size * 2)
     def test_repr_small(self, size):
         s = '-' * size
         s = repr(s)
-        self.assertEquals(len(s), size + 2)
-        self.assertEquals(s[0], "'")
-        self.assertEquals(s[-1], "'")
-        self.assertEquals(s.count('-'), size)
+        self.assertEqual(len(s), size + 2)
+        self.assertEqual(s[0], "'")
+        self.assertEqual(s[-1], "'")
+        self.assertEqual(s.count('-'), size)
         del s
         # repr() will create a string four times as large as this 'binary
         # string', but we don't want to allocate much more than twice
@@ -661,21 +661,21 @@
         size = size // 5 * 2
         s = '\x00' * size
         s = repr(s)
-        self.assertEquals(len(s), size * 4 + 2)
-        self.assertEquals(s[0], "'")
-        self.assertEquals(s[-1], "'")
-        self.assertEquals(s.count('\\'), size)
-        self.assertEquals(s.count('0'), size * 2)
+        self.assertEqual(len(s), size * 4 + 2)
+        self.assertEqual(s[0], "'")
+        self.assertEqual(s[-1], "'")
+        self.assertEqual(s.count('\\'), size)
+        self.assertEqual(s.count('0'), size * 2)
 
     @bigmemtest(minsize=_2G + 10, memuse=character_size * 5)
     def test_repr_large(self, size):
         s = '\x00' * size
         s = repr(s)
-        self.assertEquals(len(s), size * 4 + 2)
-        self.assertEquals(s[0], "'")
-        self.assertEquals(s[-1], "'")
-        self.assertEquals(s.count('\\'), size)
-        self.assertEquals(s.count('0'), size * 2)
+        self.assertEqual(len(s), size * 4 + 2)
+        self.assertEqual(s[0], "'")
+        self.assertEqual(s[-1], "'")
+        self.assertEqual(s.count('\\'), size)
+        self.assertEqual(s.count('0'), size * 2)
 
     @bigmemtest(minsize=2**32 / 5, memuse=character_size * 7)
     def test_unicode_repr(self, size):
@@ -708,7 +708,7 @@
     @bigmemtest(minsize=_2G + 2, memuse=1 + character_size)
     def test_decode(self, size):
         s = self.from_latin1('.') * size
-        self.assertEquals(len(s.decode('utf-8')), size)
+        self.assertEqual(len(s.decode('utf-8')), size)
 
 
 class BytearrayTest(unittest.TestCase, BaseStrTest):
@@ -719,7 +719,7 @@
     @bigmemtest(minsize=_2G + 2, memuse=1 + character_size)
     def test_decode(self, size):
         s = self.from_latin1('.') * size
-        self.assertEquals(len(s.decode('utf-8')), size)
+        self.assertEqual(len(s.decode('utf-8')), size)
 
     test_hash = None
     test_split_large = None
@@ -754,9 +754,9 @@
     # skipped, in verbose mode.)
     def basic_concat_test(self, size):
         t = ((),) * size
-        self.assertEquals(len(t), size)
+        self.assertEqual(len(t), size)
         t = t + t
-        self.assertEquals(len(t), size * 2)
+        self.assertEqual(len(t), size * 2)
 
     @bigmemtest(minsize=_2G // 2 + 2, memuse=24)
     def test_concat_small(self, size):
@@ -769,7 +769,7 @@
     @bigmemtest(minsize=_2G // 5 + 10, memuse=8 * 5)
     def test_contains(self, size):
         t = (1, 2, 3, 4, 5) * size
-        self.assertEquals(len(t), size * 5)
+        self.assertEqual(len(t), size * 5)
         self.assertIn(5, t)
         self.assertNotIn((1, 2, 3, 4, 5), t)
         self.assertNotIn(0, t)
@@ -785,27 +785,27 @@
     @bigmemtest(minsize=_2G + 10, memuse=8)
     def test_index_and_slice(self, size):
         t = (None,) * size
-        self.assertEquals(len(t), size)
-        self.assertEquals(t[-1], None)
-        self.assertEquals(t[5], None)
-        self.assertEquals(t[size - 1], None)
+        self.assertEqual(len(t), size)
+        self.assertEqual(t[-1], None)
+        self.assertEqual(t[5], None)
+        self.assertEqual(t[size - 1], None)
         self.assertRaises(IndexError, operator.getitem, t, size)
-        self.assertEquals(t[:5], (None,) * 5)
-        self.assertEquals(t[-5:], (None,) * 5)
-        self.assertEquals(t[20:25], (None,) * 5)
-        self.assertEquals(t[-25:-20], (None,) * 5)
-        self.assertEquals(t[size - 5:], (None,) * 5)
-        self.assertEquals(t[size - 5:size], (None,) * 5)
-        self.assertEquals(t[size - 6:size - 2], (None,) * 4)
-        self.assertEquals(t[size:size], ())
-        self.assertEquals(t[size:size+5], ())
+        self.assertEqual(t[:5], (None,) * 5)
+        self.assertEqual(t[-5:], (None,) * 5)
+        self.assertEqual(t[20:25], (None,) * 5)
+        self.assertEqual(t[-25:-20], (None,) * 5)
+        self.assertEqual(t[size - 5:], (None,) * 5)
+        self.assertEqual(t[size - 5:size], (None,) * 5)
+        self.assertEqual(t[size - 6:size - 2], (None,) * 4)
+        self.assertEqual(t[size:size], ())
+        self.assertEqual(t[size:size+5], ())
 
     # Like test_concat, split in two.
     def basic_test_repeat(self, size):
         t = ('',) * size
-        self.assertEquals(len(t), size)
+        self.assertEqual(len(t), size)
         t = t * 2
-        self.assertEquals(len(t), size * 2)
+        self.assertEqual(len(t), size * 2)
 
     @bigmemtest(minsize=_2G // 2 + 2, memuse=24)
     def test_repeat_small(self, size):
@@ -829,9 +829,9 @@
         else:
             count = 0
             for item in t:
-                self.assertEquals(item, count)
+                self.assertEqual(item, count)
                 count += 1
-            self.assertEquals(count, size)
+            self.assertEqual(count, size)
 
     @precisionbigmemtest(size=_1G - 25, memuse=9)
     def test_from_almost_2G_generator(self, size):
@@ -840,9 +840,9 @@
             t = tuple(range(size))
             count = 0
             for item in t:
-                self.assertEquals(item, count)
+                self.assertEqual(item, count)
                 count += 1
-            self.assertEquals(count, size)
+            self.assertEqual(count, size)
         except MemoryError:
             pass # acceptable, expected on 32-bit
 
@@ -851,10 +851,10 @@
         t = (0,) * size
         s = repr(t)
         # The repr of a tuple of 0's is exactly three times the tuple length.
-        self.assertEquals(len(s), size * 3)
-        self.assertEquals(s[:5], '(0, 0')
-        self.assertEquals(s[-5:], '0, 0)')
-        self.assertEquals(s.count('0'), size)
+        self.assertEqual(len(s), size * 3)
+        self.assertEqual(s[:5], '(0, 0')
+        self.assertEqual(s[-5:], '0, 0)')
+        self.assertEqual(s.count('0'), size)
 
     @bigmemtest(minsize=_2G // 3 + 2, memuse=8 + 3 * character_size)
     def test_repr_small(self, size):
@@ -890,9 +890,9 @@
     # skipped, in verbose mode.)
     def basic_test_concat(self, size):
         l = [[]] * size
-        self.assertEquals(len(l), size)
+        self.assertEqual(len(l), size)
         l = l + l
-        self.assertEquals(len(l), size * 2)
+        self.assertEqual(len(l), size * 2)
 
     @bigmemtest(minsize=_2G // 2 + 2, memuse=24)
     def test_concat_small(self, size):
@@ -905,7 +905,7 @@
     def basic_test_inplace_concat(self, size):
         l = [sys.stdout] * size
         l += l
-        self.assertEquals(len(l), size * 2)
+        self.assertEqual(len(l), size * 2)
         self.assertTrue(l[0] is l[-1])
         self.assertTrue(l[size - 1] is l[size + 1])
 
@@ -920,7 +920,7 @@
     @bigmemtest(minsize=_2G // 5 + 10, memuse=8 * 5)
     def test_contains(self, size):
         l = [1, 2, 3, 4, 5] * size
-        self.assertEquals(len(l), size * 5)
+        self.assertEqual(len(l), size * 5)
         self.assertIn(5, l)
         self.assertNotIn([1, 2, 3, 4, 5], l)
         self.assertNotIn(0, l)
@@ -933,66 +933,66 @@
     @bigmemtest(minsize=_2G + 10, memuse=8)
     def test_index_and_slice(self, size):
         l = [None] * size
-        self.assertEquals(len(l), size)
-        self.assertEquals(l[-1], None)
-        self.assertEquals(l[5], None)
-        self.assertEquals(l[size - 1], None)
+        self.assertEqual(len(l), size)
+        self.assertEqual(l[-1], None)
+        self.assertEqual(l[5], None)
+        self.assertEqual(l[size - 1], None)
         self.assertRaises(IndexError, operator.getitem, l, size)
-        self.assertEquals(l[:5], [None] * 5)
-        self.assertEquals(l[-5:], [None] * 5)
-        self.assertEquals(l[20:25], [None] * 5)
-        self.assertEquals(l[-25:-20], [None] * 5)
-        self.assertEquals(l[size - 5:], [None] * 5)
-        self.assertEquals(l[size - 5:size], [None] * 5)
-        self.assertEquals(l[size - 6:size - 2], [None] * 4)
-        self.assertEquals(l[size:size], [])
-        self.assertEquals(l[size:size+5], [])
+        self.assertEqual(l[:5], [None] * 5)
+        self.assertEqual(l[-5:], [None] * 5)
+        self.assertEqual(l[20:25], [None] * 5)
+        self.assertEqual(l[-25:-20], [None] * 5)
+        self.assertEqual(l[size - 5:], [None] * 5)
+        self.assertEqual(l[size - 5:size], [None] * 5)
+        self.assertEqual(l[size - 6:size - 2], [None] * 4)
+        self.assertEqual(l[size:size], [])
+        self.assertEqual(l[size:size+5], [])
 
         l[size - 2] = 5
-        self.assertEquals(len(l), size)
-        self.assertEquals(l[-3:], [None, 5, None])
-        self.assertEquals(l.count(5), 1)
+        self.assertEqual(len(l), size)
+        self.assertEqual(l[-3:], [None, 5, None])
+        self.assertEqual(l.count(5), 1)
         self.assertRaises(IndexError, operator.setitem, l, size, 6)
-        self.assertEquals(len(l), size)
+        self.assertEqual(len(l), size)
 
         l[size - 7:] = [1, 2, 3, 4, 5]
         size -= 2
-        self.assertEquals(len(l), size)
-        self.assertEquals(l[-7:], [None, None, 1, 2, 3, 4, 5])
+        self.assertEqual(len(l), size)
+        self.assertEqual(l[-7:], [None, None, 1, 2, 3, 4, 5])
 
         l[:7] = [1, 2, 3, 4, 5]
         size -= 2
-        self.assertEquals(len(l), size)
-        self.assertEquals(l[:7], [1, 2, 3, 4, 5, None, None])
+        self.assertEqual(len(l), size)
+        self.assertEqual(l[:7], [1, 2, 3, 4, 5, None, None])
 
         del l[size - 1]
         size -= 1
-        self.assertEquals(len(l), size)
-        self.assertEquals(l[-1], 4)
+        self.assertEqual(len(l), size)
+        self.assertEqual(l[-1], 4)
 
         del l[-2:]
         size -= 2
-        self.assertEquals(len(l), size)
-        self.assertEquals(l[-1], 2)
+        self.assertEqual(len(l), size)
+        self.assertEqual(l[-1], 2)
 
         del l[0]
         size -= 1
-        self.assertEquals(len(l), size)
-        self.assertEquals(l[0], 2)
+        self.assertEqual(len(l), size)
+        self.assertEqual(l[0], 2)
 
         del l[:2]
         size -= 2
-        self.assertEquals(len(l), size)
-        self.assertEquals(l[0], 4)
+        self.assertEqual(len(l), size)
+        self.assertEqual(l[0], 4)
 
     # Like test_concat, split in two.
     def basic_test_repeat(self, size):
         l = [] * size
         self.assertFalse(l)
         l = [''] * size
-        self.assertEquals(len(l), size)
+        self.assertEqual(len(l), size)
         l = l * 2
-        self.assertEquals(len(l), size * 2)
+        self.assertEqual(len(l), size * 2)
 
     @bigmemtest(minsize=_2G // 2 + 2, memuse=24)
     def test_repeat_small(self, size):
@@ -1005,13 +1005,13 @@
     def basic_test_inplace_repeat(self, size):
         l = ['']
         l *= size
-        self.assertEquals(len(l), size)
+        self.assertEqual(len(l), size)
         self.assertTrue(l[0] is l[-1])
         del l
 
         l = [''] * size
         l *= 2
-        self.assertEquals(len(l), size * 2)
+        self.assertEqual(len(l), size * 2)
         self.assertTrue(l[size - 1] is l[-1])
 
     @bigmemtest(minsize=_2G // 2 + 2, memuse=16)
@@ -1026,10 +1026,10 @@
         l = [0] * size
         s = repr(l)
         # The repr of a list of 0's is exactly three times the list length.
-        self.assertEquals(len(s), size * 3)
-        self.assertEquals(s[:5], '[0, 0')
-        self.assertEquals(s[-5:], '0, 0]')
-        self.assertEquals(s.count('0'), size)
+        self.assertEqual(len(s), size * 3)
+        self.assertEqual(s[:5], '[0, 0')
+        self.assertEqual(s[-5:], '0, 0]')
+        self.assertEqual(s.count('0'), size)
 
     @bigmemtest(minsize=_2G // 3 + 2, memuse=8 + 3 * character_size)
     def test_repr_small(self, size):
@@ -1045,20 +1045,20 @@
     def test_append(self, size):
         l = [object()] * size
         l.append(object())
-        self.assertEquals(len(l), size+1)
+        self.assertEqual(len(l), size+1)
         self.assertTrue(l[-3] is l[-2])
         self.assertFalse(l[-2] is l[-1])
 
     @bigmemtest(minsize=_2G // 5 + 2, memuse=8 * 5)
     def test_count(self, size):
         l = [1, 2, 3, 4, 5] * size
-        self.assertEquals(l.count(1), size)
-        self.assertEquals(l.count("1"), 0)
+        self.assertEqual(l.count(1), size)
+        self.assertEqual(l.count("1"), 0)
 
     def basic_test_extend(self, size):
         l = [object] * size
         l.extend(l)
-        self.assertEquals(len(l), size * 2)
+        self.assertEqual(len(l), size * 2)
         self.assertTrue(l[0] is l[-1])
         self.assertTrue(l[size - 1] is l[size + 1])
 
@@ -1074,9 +1074,9 @@
     def test_index(self, size):
         l = [1, 2, 3, 4, 5] * size
         size *= 5
-        self.assertEquals(l.index(1), 0)
-        self.assertEquals(l.index(5, size - 5), size - 1)
-        self.assertEquals(l.index(5, size - 5, size), size - 1)
+        self.assertEqual(l.index(1), 0)
+        self.assertEqual(l.index(5, size - 5), size - 1)
+        self.assertEqual(l.index(5, size - 5, size), size - 1)
         self.assertRaises(ValueError, l.index, 1, size - 4, size)
         self.assertRaises(ValueError, l.index, 6)
 
@@ -1086,80 +1086,80 @@
         l = [1.0] * size
         l.insert(size - 1, "A")
         size += 1
-        self.assertEquals(len(l), size)
-        self.assertEquals(l[-3:], [1.0, "A", 1.0])
+        self.assertEqual(len(l), size)
+        self.assertEqual(l[-3:], [1.0, "A", 1.0])
 
         l.insert(size + 1, "B")
         size += 1
-        self.assertEquals(len(l), size)
-        self.assertEquals(l[-3:], ["A", 1.0, "B"])
+        self.assertEqual(len(l), size)
+        self.assertEqual(l[-3:], ["A", 1.0, "B"])
 
         l.insert(1, "C")
         size += 1
-        self.assertEquals(len(l), size)
-        self.assertEquals(l[:3], [1.0, "C", 1.0])
-        self.assertEquals(l[size - 3:], ["A", 1.0, "B"])
+        self.assertEqual(len(l), size)
+        self.assertEqual(l[:3], [1.0, "C", 1.0])
+        self.assertEqual(l[size - 3:], ["A", 1.0, "B"])
 
     @bigmemtest(minsize=_2G // 5 + 4, memuse=8 * 5)
     def test_pop(self, size):
         l = ["a", "b", "c", "d", "e"] * size
         size *= 5
-        self.assertEquals(len(l), size)
+        self.assertEqual(len(l), size)
 
         item = l.pop()
         size -= 1
-        self.assertEquals(len(l), size)
-        self.assertEquals(item, "e")
-        self.assertEquals(l[-2:], ["c", "d"])
+        self.assertEqual(len(l), size)
+        self.assertEqual(item, "e")
+        self.assertEqual(l[-2:], ["c", "d"])
 
         item = l.pop(0)
         size -= 1
-        self.assertEquals(len(l), size)
-        self.assertEquals(item, "a")
-        self.assertEquals(l[:2], ["b", "c"])
+        self.assertEqual(len(l), size)
+        self.assertEqual(item, "a")
+        self.assertEqual(l[:2], ["b", "c"])
 
         item = l.pop(size - 2)
         size -= 1
-        self.assertEquals(len(l), size)
-        self.assertEquals(item, "c")
-        self.assertEquals(l[-2:], ["b", "d"])
+        self.assertEqual(len(l), size)
+        self.assertEqual(item, "c")
+        self.assertEqual(l[-2:], ["b", "d"])
 
     @bigmemtest(minsize=_2G + 10, memuse=8)
     def test_remove(self, size):
         l = [10] * size
-        self.assertEquals(len(l), size)
+        self.assertEqual(len(l), size)
 
         l.remove(10)
         size -= 1
-        self.assertEquals(len(l), size)
+        self.assertEqual(len(l), size)
 
         # Because of the earlier l.remove(), this append doesn't trigger
         # a resize.
         l.append(5)
         size += 1
-        self.assertEquals(len(l), size)
-        self.assertEquals(l[-2:], [10, 5])
+        self.assertEqual(len(l), size)
+        self.assertEqual(l[-2:], [10, 5])
         l.remove(5)
         size -= 1
-        self.assertEquals(len(l), size)
-        self.assertEquals(l[-2:], [10, 10])
+        self.assertEqual(len(l), size)
+        self.assertEqual(l[-2:], [10, 10])
 
     @bigmemtest(minsize=_2G // 5 + 2, memuse=8 * 5)
     def test_reverse(self, size):
         l = [1, 2, 3, 4, 5] * size
         l.reverse()
-        self.assertEquals(len(l), size * 5)
-        self.assertEquals(l[-5:], [5, 4, 3, 2, 1])
-        self.assertEquals(l[:5], [5, 4, 3, 2, 1])
+        self.assertEqual(len(l), size * 5)
+        self.assertEqual(l[-5:], [5, 4, 3, 2, 1])
+        self.assertEqual(l[:5], [5, 4, 3, 2, 1])
 
     @bigmemtest(minsize=_2G // 5 + 2, memuse=8 * 5)
     def test_sort(self, size):
         l = [1, 2, 3, 4, 5] * size
         l.sort()
-        self.assertEquals(len(l), size * 5)
-        self.assertEquals(l.count(1), size)
-        self.assertEquals(l[:10], [1] * 10)
-        self.assertEquals(l[-10:], [5] * 10)
+        self.assertEqual(len(l), size * 5)
+        self.assertEqual(l.count(1), size)
+        self.assertEqual(l[:10], [1] * 10)
+        self.assertEqual(l[-10:], [5] * 10)
 
 def test_main():
     support.run_unittest(StrTest, BytesTest, BytearrayTest,

Modified: python/branches/py3k-cdecimal/Lib/test/test_builtin.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_builtin.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_builtin.py	Mon Nov 22 12:00:42 2010
@@ -542,11 +542,11 @@
         class X:
             def __hash__(self):
                 return 2**100
-        self.assertEquals(type(hash(X())), int)
+        self.assertEqual(type(hash(X())), int)
         class Z(int):
             def __hash__(self):
                 return self
-        self.assertEquals(hash(Z(42)), hash(42))
+        self.assertEqual(hash(Z(42)), hash(42))
 
     def test_hex(self):
         self.assertEqual(hex(16), '0x10')
@@ -777,7 +777,7 @@
         self.assertEqual(next(it), 1)
         self.assertRaises(StopIteration, next, it)
         self.assertRaises(StopIteration, next, it)
-        self.assertEquals(next(it, 42), 42)
+        self.assertEqual(next(it, 42), 42)
 
         class Iter(object):
             def __iter__(self):
@@ -786,7 +786,7 @@
                 raise StopIteration
 
         it = iter(Iter())
-        self.assertEquals(next(it, 42), 42)
+        self.assertEqual(next(it, 42), 42)
         self.assertRaises(StopIteration, next, it)
 
         def gen():
@@ -794,9 +794,9 @@
             return
 
         it = gen()
-        self.assertEquals(next(it), 1)
+        self.assertEqual(next(it), 1)
         self.assertRaises(StopIteration, next, it)
-        self.assertEquals(next(it, 42), 42)
+        self.assertEqual(next(it, 42), 42)
 
     def test_oct(self):
         self.assertEqual(oct(100), '0o144')
@@ -906,182 +906,6 @@
 
         self.assertRaises(TypeError, pow)
 
-    def test_range(self):
-        self.assertEqual(list(range(3)), [0, 1, 2])
-        self.assertEqual(list(range(1, 5)), [1, 2, 3, 4])
-        self.assertEqual(list(range(0)), [])
-        self.assertEqual(list(range(-3)), [])
-        self.assertEqual(list(range(1, 10, 3)), [1, 4, 7])
-        #self.assertEqual(list(range(5, -5, -3)), [5, 2, -1, -4])
-
-        #issue 6334: the internal stored range length was being
-        #computed incorrectly in some cases involving large arguments.
-        x = range(10**20, 10**20+10, 3)
-        self.assertEqual(len(x), 4)
-        self.assertEqual(len(list(x)), 4)
-
-        x = range(10**20+10, 10**20, 3)
-        self.assertEqual(len(x), 0)
-        self.assertEqual(len(list(x)), 0)
-
-        x = range(10**20, 10**20+10, -3)
-        self.assertEqual(len(x), 0)
-        self.assertEqual(len(list(x)), 0)
-
-        x = range(10**20+10, 10**20, -3)
-        self.assertEqual(len(x), 4)
-        self.assertEqual(len(list(x)), 4)
-
-        # Now test range() with longs
-        self.assertEqual(list(range(-2**100)), [])
-        self.assertEqual(list(range(0, -2**100)), [])
-        self.assertEqual(list(range(0, 2**100, -1)), [])
-        self.assertEqual(list(range(0, 2**100, -1)), [])
-
-        a = int(10 * sys.maxsize)
-        b = int(100 * sys.maxsize)
-        c = int(50 * sys.maxsize)
-
-        self.assertEqual(list(range(a, a+2)), [a, a+1])
-        self.assertEqual(list(range(a+2, a, -1)), [a+2, a+1])
-        self.assertEqual(list(range(a+4, a, -2)), [a+4, a+2])
-
-        seq = list(range(a, b, c))
-        self.assertIn(a, seq)
-        self.assertNotIn(b, seq)
-        self.assertEqual(len(seq), 2)
-
-        seq = list(range(b, a, -c))
-        self.assertIn(b, seq)
-        self.assertNotIn(a, seq)
-        self.assertEqual(len(seq), 2)
-
-        seq = list(range(-a, -b, -c))
-        self.assertIn(-a, seq)
-        self.assertNotIn(-b, seq)
-        self.assertEqual(len(seq), 2)
-
-        self.assertRaises(TypeError, range)
-        self.assertRaises(TypeError, range, 1, 2, 3, 4)
-        self.assertRaises(ValueError, range, 1, 2, 0)
-        self.assertRaises(ValueError, range, a, a + 1, int(0))
-
-        """ XXX(nnorwitz):
-        class badzero(int):
-            def __eq__(self, other):
-                raise RuntimeError
-            __ne__ = __lt__ = __gt__ = __le__ = __ge__ = __eq__
-
-        # XXX This won't (but should!) raise RuntimeError if a is an int...
-        self.assertRaises(RuntimeError, range, a, a + 1, badzero(1))
-        """
-
-        # Reject floats.
-        self.assertRaises(TypeError, range, 1., 1., 1.)
-        self.assertRaises(TypeError, range, 1e100, 1e101, 1e101)
-
-        self.assertRaises(TypeError, range, 0, "spam")
-        self.assertRaises(TypeError, range, 0, 42, "spam")
-
-        #NEAL self.assertRaises(OverflowError, range, -sys.maxsize, sys.maxsize)
-        #NEAL self.assertRaises(OverflowError, range, 0, 2*sys.maxsize)
-
-        self.assertRaises(OverflowError, len, range(0, sys.maxsize**10))
-
-        bignum = 2*sys.maxsize
-        smallnum = 42
-
-        # User-defined class with an __index__ method
-        class I:
-            def __init__(self, n):
-                self.n = int(n)
-            def __index__(self):
-                return self.n
-        self.assertEqual(list(range(I(bignum), I(bignum + 1))), [bignum])
-        self.assertEqual(list(range(I(smallnum), I(smallnum + 1))), [smallnum])
-
-        # User-defined class with a failing __index__ method
-        class IX:
-            def __index__(self):
-                raise RuntimeError
-        self.assertRaises(RuntimeError, range, IX())
-
-        # User-defined class with an invalid __index__ method
-        class IN:
-            def __index__(self):
-                return "not a number"
-
-        self.assertRaises(TypeError, range, IN())
-        # Exercise various combinations of bad arguments, to check
-        # refcounting logic
-        self.assertRaises(TypeError, range, 0.0)
-
-        self.assertRaises(TypeError, range, 0, 0.0)
-        self.assertRaises(TypeError, range, 0.0, 0)
-        self.assertRaises(TypeError, range, 0.0, 0.0)
-
-        self.assertRaises(TypeError, range, 0, 0, 1.0)
-        self.assertRaises(TypeError, range, 0, 0.0, 1)
-        self.assertRaises(TypeError, range, 0, 0.0, 1.0)
-        self.assertRaises(TypeError, range, 0.0, 0, 1)
-        self.assertRaises(TypeError, range, 0.0, 0, 1.0)
-        self.assertRaises(TypeError, range, 0.0, 0.0, 1)
-        self.assertRaises(TypeError, range, 0.0, 0.0, 1.0)
-
-        self.assertEqual(range(3).count(-1), 0)
-        self.assertEqual(range(3).count(0), 1)
-        self.assertEqual(range(3).count(1), 1)
-        self.assertEqual(range(3).count(2), 1)
-        self.assertEqual(range(3).count(3), 0)
-
-        self.assertEqual(range(10**20).count(1), 1)
-        self.assertEqual(range(10**20).count(10**20), 0)
-        self.assertEqual(range(3).index(1), 1)
-        self.assertEqual(range(1, 2**100, 2).count(2**87), 0)
-        self.assertEqual(range(1, 2**100, 2).count(2**87+1), 1)
-
-        self.assertEqual(range(1, 10, 3).index(4), 1)
-        self.assertEqual(range(1, -10, -3).index(-5), 2)
-
-        self.assertEqual(range(10**20).index(1), 1)
-        self.assertEqual(range(10**20).index(10**20 - 1), 10**20 - 1)
-
-        self.assertRaises(ValueError, range(1, 2**100, 2).index, 2**87)
-        self.assertEqual(range(1, 2**100, 2).index(2**87+1), 2**86)
-
-        class AlwaysEqual(object):
-            def __eq__(self, other):
-                return True
-        always_equal = AlwaysEqual()
-        self.assertEqual(range(10).count(always_equal), 10)
-        self.assertEqual(range(10).index(always_equal), 0)
-
-    def test_range_index(self):
-        u = range(2)
-        self.assertEqual(u.index(0), 0)
-        self.assertEqual(u.index(1), 1)
-        self.assertRaises(ValueError, u.index, 2)
-
-        u = range(-2, 3)
-        self.assertEqual(u.count(0), 1)
-        self.assertEqual(u.index(0), 2)
-        self.assertRaises(TypeError, u.index)
-
-        class BadExc(Exception):
-            pass
-
-        class BadCmp:
-            def __eq__(self, other):
-                if other == 2:
-                    raise BadExc()
-                return False
-
-        a = range(4)
-        self.assertRaises(BadExc, a.index, BadCmp())
-
-        a = range(-2, 3)
-        self.assertEqual(a.index(0), 2)
-
     def test_input(self):
         self.write_testfile()
         fp = open(TESTFN, 'r')

Modified: python/branches/py3k-cdecimal/Lib/test/test_bytes.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_bytes.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_bytes.py	Mon Nov 22 12:00:42 2010
@@ -266,11 +266,11 @@
     def test_fromhex(self):
         self.assertRaises(TypeError, self.type2test.fromhex)
         self.assertRaises(TypeError, self.type2test.fromhex, 1)
-        self.assertEquals(self.type2test.fromhex(''), self.type2test())
+        self.assertEqual(self.type2test.fromhex(''), self.type2test())
         b = bytearray([0x1a, 0x2b, 0x30])
-        self.assertEquals(self.type2test.fromhex('1a2B30'), b)
-        self.assertEquals(self.type2test.fromhex('  1A 2B  30   '), b)
-        self.assertEquals(self.type2test.fromhex('0000'), b'\0\0')
+        self.assertEqual(self.type2test.fromhex('1a2B30'), b)
+        self.assertEqual(self.type2test.fromhex('  1A 2B  30   '), b)
+        self.assertEqual(self.type2test.fromhex('0000'), b'\0\0')
         self.assertRaises(TypeError, self.type2test.fromhex, b'1B')
         self.assertRaises(ValueError, self.type2test.fromhex, 'a')
         self.assertRaises(ValueError, self.type2test.fromhex, 'rt')
@@ -626,11 +626,11 @@
                     data.reverse()
                     L[start:stop:step] = data
                     b[start:stop:step] = data
-                    self.assertEquals(b, bytearray(L))
+                    self.assertEqual(b, bytearray(L))
 
                     del L[start:stop:step]
                     del b[start:stop:step]
-                    self.assertEquals(b, bytearray(L))
+                    self.assertEqual(b, bytearray(L))
 
     def test_setslice_trap(self):
         # This test verifies that we correctly handle assigning self
@@ -809,25 +809,25 @@
         resize(10)
         orig = b[:]
         self.assertRaises(BufferError, resize, 11)
-        self.assertEquals(b, orig)
+        self.assertEqual(b, orig)
         self.assertRaises(BufferError, resize, 9)
-        self.assertEquals(b, orig)
+        self.assertEqual(b, orig)
         self.assertRaises(BufferError, resize, 0)
-        self.assertEquals(b, orig)
+        self.assertEqual(b, orig)
         # Other operations implying resize
         self.assertRaises(BufferError, b.pop, 0)
-        self.assertEquals(b, orig)
+        self.assertEqual(b, orig)
         self.assertRaises(BufferError, b.remove, b[1])
-        self.assertEquals(b, orig)
+        self.assertEqual(b, orig)
         def delitem():
             del b[1]
         self.assertRaises(BufferError, delitem)
-        self.assertEquals(b, orig)
+        self.assertEqual(b, orig)
         # deleting a non-contiguous slice
         def delslice():
             b[1:-1:2] = b""
         self.assertRaises(BufferError, delslice)
-        self.assertEquals(b, orig)
+        self.assertEqual(b, orig)
 
 
 class AssortedBytesTest(unittest.TestCase):

Modified: python/branches/py3k-cdecimal/Lib/test/test_calendar.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_calendar.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_calendar.py	Mon Nov 22 12:00:42 2010
@@ -262,7 +262,7 @@
             return
         calendar.LocaleHTMLCalendar(locale='').formatmonthname(2010, 10)
         new_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
-        self.assertEquals(old_october, new_october)
+        self.assertEqual(old_october, new_october)
 
 
 class MonthCalendarTestCase(unittest.TestCase):

Modified: python/branches/py3k-cdecimal/Lib/test/test_cfgparser.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_cfgparser.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_cfgparser.py	Mon Nov 22 12:00:42 2010
@@ -31,6 +31,7 @@
     empty_lines_in_values = True
     dict_type = configparser._default_dict
     strict = False
+    default_section = configparser.DEFAULTSECT
 
     def newconfig(self, defaults=None):
         arguments = dict(
@@ -41,6 +42,7 @@
             empty_lines_in_values=self.empty_lines_in_values,
             dict_type=self.dict_type,
             strict=self.strict,
+            default_section=self.default_section,
         )
         return self.config_class(**arguments)
 
@@ -76,7 +78,7 @@
         # mapping access
         L = [section for section in cf]
         L.sort()
-        E.append(configparser.DEFAULTSECT)
+        E.append(self.default_section)
         E.sort()
         eq(L, E)
 
@@ -133,8 +135,15 @@
         # mapping access
         eq(cf['Foo Bar']['foo'], 'bar1')
         eq(cf['Spacey Bar']['foo'], 'bar2')
-        eq(cf['Spacey Bar From The Beginning']['foo'], 'bar3')
-        eq(cf['Spacey Bar From The Beginning']['baz'], 'qwe')
+        section = cf['Spacey Bar From The Beginning']
+        eq(section.name, 'Spacey Bar From The Beginning')
+        self.assertIs(section.parser, cf)
+        with self.assertRaises(AttributeError):
+            section.name = 'Name is read-only'
+        with self.assertRaises(AttributeError):
+            section.parser = 'Parser is read-only'
+        eq(section['foo'], 'bar3')
+        eq(section['baz'], 'qwe')
         eq(cf['Commented Bar']['foo'], 'bar4')
         eq(cf['Commented Bar']['baz'], 'qwe')
         eq(cf['Spaces']['key with spaces'], 'value')
@@ -144,22 +153,6 @@
         if self.allow_no_value:
             eq(cf['NoValue']['option-without-value'], None)
 
-        # API access
-        self.assertNotIn('__name__', cf.options("Foo Bar"),
-                         '__name__ "option" should not be exposed by the API!')
-
-        # mapping access
-        self.assertNotIn('__name__', cf['Foo Bar'],
-                         '__name__ "option" should not be exposed by '
-                         'mapping protocol access')
-        self.assertFalse('__name__' in cf['Foo Bar'])
-        with self.assertRaises(ValueError):
-            cf['Foo Bar']['__name__']
-        with self.assertRaises(ValueError):
-            del cf['Foo Bar']['__name__']
-        with self.assertRaises(ValueError):
-            cf['Foo Bar']['__name__'] = "can't write to this special name"
-
         # Make sure the right things happen for remove_option();
         # added to include check for SourceForge bug #123324:
 
@@ -365,7 +358,7 @@
         L.sort()
         eq = self.assertEqual
         elem_eq = self.assertItemsEqual
-        eq(L, ["A", "B", configparser.DEFAULTSECT, "a"])
+        eq(L, sorted(["A", "B", self.default_section, "a"]))
         eq(cf["a"].keys(), {"b"})
         eq(cf["a"]["b"], "value",
            "could not locate option, expecting case-insensitive option names")
@@ -399,11 +392,11 @@
     def test_default_case_sensitivity(self):
         cf = self.newconfig({"foo": "Bar"})
         self.assertEqual(
-            cf.get("DEFAULT", "Foo"), "Bar",
+            cf.get(self.default_section, "Foo"), "Bar",
             "could not locate option, expecting case-insensitive option names")
         cf = self.newconfig({"Foo": "Bar"})
         self.assertEqual(
-            cf.get("DEFAULT", "Foo"), "Bar",
+            cf.get(self.default_section, "Foo"), "Bar",
             "could not locate option, expecting case-insensitive defaults")
 
     def test_parse_errors(self):
@@ -530,7 +523,7 @@
             "[Long Line]\n"
             "foo{0[0]} this line is much, much longer than my editor\n"
             "   likes it.\n"
-            "[DEFAULT]\n"
+            "[{default_section}]\n"
             "foo{0[1]} another very\n"
             " long line\n"
             "[Long Line - With Comments!]\n"
@@ -538,7 +531,8 @@
             "            also      {comment} place\n"
             "            comments  {comment} in\n"
             "            multiline {comment} values"
-            "\n".format(self.delimiters, comment=self.comment_prefixes[0])
+            "\n".format(self.delimiters, comment=self.comment_prefixes[0],
+                        default_section=self.default_section)
             )
         if self.allow_no_value:
             config_string += (
@@ -550,7 +544,7 @@
         output = io.StringIO()
         cf.write(output)
         expect_string = (
-            "[DEFAULT]\n"
+            "[{default_section}]\n"
             "foo {equals} another very\n"
             "\tlong line\n"
             "\n"
@@ -563,7 +557,8 @@
             "\talso\n"
             "\tcomments\n"
             "\tmultiline\n"
-            "\n".format(equals=self.delimiters[0])
+            "\n".format(equals=self.delimiters[0],
+                        default_section=self.default_section)
             )
         if self.allow_no_value:
             expect_string += (
@@ -636,17 +631,15 @@
             "bar{equals}%(foo)s\n"
             "\n"
             "[Interpolation Error]\n"
-            "name{equals}%(reference)s\n".format(equals=self.delimiters[0]),
             # no definition for 'reference'
-            defaults={"getname": "%(__name__)s"})
+            "name{equals}%(reference)s\n".format(equals=self.delimiters[0]))
 
     def check_items_config(self, expected):
         cf = self.fromstring(
             "[section]\n"
             "name {0[0]} value\n"
             "key{0[1]} |%(name)s| \n"
-            "getdefault{0[1]} |%(default)s|\n"
-            "getname{0[1]} |%(__name__)s|".format(self.delimiters),
+            "getdefault{0[1]} |%(default)s|\n".format(self.delimiters),
             defaults={"default": "<default>"})
         L = list(cf.items("section"))
         L.sort()
@@ -669,7 +662,6 @@
         }
         cf = self.get_interpolation_config()
         eq = self.assertEqual
-        eq(cf.get("Foo", "getname"), "Foo")
         eq(cf.get("Foo", "bar"), "something with interpolation (1 step)")
         eq(cf.get("Foo", "bar9"),
            "something with lots of interpolation (9 steps)")
@@ -695,7 +687,6 @@
     def test_items(self):
         self.check_items_config([('default', '<default>'),
                                  ('getdefault', '|<default>|'),
-                                 ('getname', '|section|'),
                                  ('key', '|value|'),
                                  ('name', 'value')])
 
@@ -724,6 +715,9 @@
     delimiters = (':=', '$')
     comment_prefixes = ('//', '"')
 
+class ConfigParserTestCaseNonStandardDefaultSection(ConfigParserTestCase):
+    default_section = 'general'
+
 class MultilineValuesTestCase(BasicTestCase):
     config_class = configparser.ConfigParser
     wonderful_spam = ("I'm having spam spam spam spam "
@@ -758,7 +752,6 @@
     def test_interpolation(self):
         cf = self.get_interpolation_config()
         eq = self.assertEqual
-        eq(cf.get("Foo", "getname"), "%(__name__)s")
         eq(cf.get("Foo", "bar"),
            "something %(with1)s interpolation (1 step)")
         eq(cf.get("Foo", "bar9"),
@@ -771,7 +764,6 @@
     def test_items(self):
         self.check_items_config([('default', '<default>'),
                                  ('getdefault', '|%(default)s|'),
-                                 ('getname', '|%(__name__)s|'),
                                  ('key', '|%(name)s|'),
                                  ('name', 'value')])
 
@@ -851,13 +843,9 @@
         self.assertRaises(TypeError, cf.set, "sect", "option2", 1.0)
         self.assertRaises(TypeError, cf.set, "sect", "option2", object())
 
-    def test_add_section_default_1(self):
-        cf = self.newconfig()
-        self.assertRaises(ValueError, cf.add_section, "default")
-
-    def test_add_section_default_2(self):
+    def test_add_section_default(self):
         cf = self.newconfig()
-        self.assertRaises(ValueError, cf.add_section, "DEFAULT")
+        self.assertRaises(ValueError, cf.add_section, self.default_section)
 
 class SafeConfigParserTestCaseNonStandardDelimiters(SafeConfigParserTestCase):
     delimiters = (':=', '$')
@@ -884,17 +872,17 @@
                                          'no values here',
                                          'tricky interpolation',
                                          'more interpolation'])
-        self.assertEqual(cf.getint('DEFAULT', 'go',
+        self.assertEqual(cf.getint(self.default_section, 'go',
                                    vars={'interpolate': '-1'}), -1)
         with self.assertRaises(ValueError):
             # no interpolation will happen
-            cf.getint('DEFAULT', 'go', raw=True, vars={'interpolate': '-1'})
+            cf.getint(self.default_section, 'go', raw=True,
+                      vars={'interpolate': '-1'})
         self.assertEqual(len(cf.get('strange', 'other').split('\n')), 4)
         self.assertEqual(len(cf.get('corruption', 'value').split('\n')), 10)
         longname = 'yeah, sections can be indented as well'
         self.assertFalse(cf.getboolean(longname, 'are they subsections'))
-        self.assertEquals(cf.get(longname, 'lets use some Unicode'),
-                                           '片仮名')
+        self.assertEqual(cf.get(longname, 'lets use some Unicode'), '片仮名')
         self.assertEqual(len(cf.items('another one!')), 5) # 4 in section and
                                                            # `go` from DEFAULT
         with self.assertRaises(configparser.InterpolationMissingOptionError):
@@ -951,14 +939,14 @@
                              "k=v\n")
         output = io.StringIO()
         cf.write(output)
-        self.assertEquals(output.getvalue(),
-                          "[a]\n"
-                          "k = v\n\n"
-                          "[b]\n"
-                          "o1 = 4\n"
-                          "o2 = 3\n"
-                          "o3 = 2\n"
-                          "o4 = 1\n\n")
+        self.assertEqual(output.getvalue(),
+                         "[a]\n"
+                         "k = v\n\n"
+                         "[b]\n"
+                         "o1 = 4\n"
+                         "o2 = 3\n"
+                         "o3 = 2\n"
+                         "o4 = 1\n\n")
 
 
 class CompatibleTestCase(CfgParserTestCaseClass):
@@ -997,6 +985,7 @@
         Issue7005TestCase,
         StrictTestCase,
         CompatibleTestCase,
+        ConfigParserTestCaseNonStandardDefaultSection,
         )
 
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_cgi.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_cgi.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_cgi.py	Mon Nov 22 12:00:42 2010
@@ -217,7 +217,7 @@
 -----------------------------721837373350705526688164684--
 """
         fs = cgi.FieldStorage(fp=StringIO(postdata), environ=env)
-        self.assertEquals(len(fs.list), 4)
+        self.assertEqual(len(fs.list), 4)
         expect = [{'name':'id', 'filename':None, 'value':'1234'},
                   {'name':'title', 'filename':None, 'value':''},
                   {'name':'file', 'filename':'test.txt', 'value':'Testing 123.'},
@@ -225,7 +225,7 @@
         for x in range(len(fs.list)):
             for k, exp in expect[x].items():
                 got = getattr(fs.list[x], k)
-                self.assertEquals(got, exp)
+                self.assertEqual(got, exp)
 
     _qs_result = {
         'key1': 'value1',

Modified: python/branches/py3k-cdecimal/Lib/test/test_charmapcodec.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_charmapcodec.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_charmapcodec.py	Mon Nov 22 12:00:42 2010
@@ -27,24 +27,24 @@
 
 class CharmapCodecTest(unittest.TestCase):
     def test_constructorx(self):
-        self.assertEquals(str(b'abc', codecname), 'abc')
-        self.assertEquals(str(b'xdef', codecname), 'abcdef')
-        self.assertEquals(str(b'defx', codecname), 'defabc')
-        self.assertEquals(str(b'dxf', codecname), 'dabcf')
-        self.assertEquals(str(b'dxfx', codecname), 'dabcfabc')
+        self.assertEqual(str(b'abc', codecname), 'abc')
+        self.assertEqual(str(b'xdef', codecname), 'abcdef')
+        self.assertEqual(str(b'defx', codecname), 'defabc')
+        self.assertEqual(str(b'dxf', codecname), 'dabcf')
+        self.assertEqual(str(b'dxfx', codecname), 'dabcfabc')
 
     def test_encodex(self):
-        self.assertEquals('abc'.encode(codecname), b'abc')
-        self.assertEquals('xdef'.encode(codecname), b'abcdef')
-        self.assertEquals('defx'.encode(codecname), b'defabc')
-        self.assertEquals('dxf'.encode(codecname), b'dabcf')
-        self.assertEquals('dxfx'.encode(codecname), b'dabcfabc')
+        self.assertEqual('abc'.encode(codecname), b'abc')
+        self.assertEqual('xdef'.encode(codecname), b'abcdef')
+        self.assertEqual('defx'.encode(codecname), b'defabc')
+        self.assertEqual('dxf'.encode(codecname), b'dabcf')
+        self.assertEqual('dxfx'.encode(codecname), b'dabcfabc')
 
     def test_constructory(self):
-        self.assertEquals(str(b'ydef', codecname), 'def')
-        self.assertEquals(str(b'defy', codecname), 'def')
-        self.assertEquals(str(b'dyf', codecname), 'df')
-        self.assertEquals(str(b'dyfy', codecname), 'df')
+        self.assertEqual(str(b'ydef', codecname), 'def')
+        self.assertEqual(str(b'defy', codecname), 'def')
+        self.assertEqual(str(b'dyf', codecname), 'df')
+        self.assertEqual(str(b'dyfy', codecname), 'df')
 
     def test_maptoundefined(self):
         self.assertRaises(UnicodeError, str, b'abc\001', codecname)

Modified: python/branches/py3k-cdecimal/Lib/test/test_class.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_class.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_class.py	Mon Nov 22 12:00:42 2010
@@ -436,7 +436,7 @@
         del testme
         import gc
         gc.collect()
-        self.assertEquals(["crab people, crab people"], x)
+        self.assertEqual(["crab people, crab people"], x)
 
     def testBadTypeReturned(self):
         # return values of some method are type-checked
@@ -529,17 +529,17 @@
 
         a1 = A(1)
         a2 = A(2)
-        self.assertEquals(a1.f, a1.f)
-        self.assertNotEquals(a1.f, a2.f)
-        self.assertNotEquals(a1.f, a1.g)
-        self.assertEquals(a1.f, A(1).f)
-        self.assertEquals(hash(a1.f), hash(a1.f))
-        self.assertEquals(hash(a1.f), hash(A(1).f))
-
-        self.assertNotEquals(A.f, a1.f)
-        self.assertNotEquals(A.f, A.g)
-        self.assertEquals(B.f, A.f)
-        self.assertEquals(hash(B.f), hash(A.f))
+        self.assertEqual(a1.f, a1.f)
+        self.assertNotEqual(a1.f, a2.f)
+        self.assertNotEqual(a1.f, a1.g)
+        self.assertEqual(a1.f, A(1).f)
+        self.assertEqual(hash(a1.f), hash(a1.f))
+        self.assertEqual(hash(a1.f), hash(A(1).f))
+
+        self.assertNotEqual(A.f, a1.f)
+        self.assertNotEqual(A.f, A.g)
+        self.assertEqual(B.f, A.f)
+        self.assertEqual(hash(B.f), hash(A.f))
 
         # the following triggers a SystemError in 2.4
         a = A(hash(A.f)^(-1))

Modified: python/branches/py3k-cdecimal/Lib/test/test_cmath.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_cmath.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_cmath.py	Mon Nov 22 12:00:42 2010
@@ -514,6 +514,24 @@
         for z in complex_zeros:
             self.assertComplexIdentical(cmath.tanh(z), z)
 
+    # The algorithm used for atan and atanh makes use of the system
+    # log1p function; If that system function doesn't respect the sign
+    # of zero, then atan and atanh will also have difficulties with
+    # the sign of complex zeros.
+    @requires_IEEE_754
+    @unittest.skipIf(sysconfig.get_config_var('LOG1P_DROPS_ZERO_SIGN'),
+                     "system log1p() function doesn't preserve the sign")
+    def testAtanSign(self):
+        for z in complex_zeros:
+            self.assertComplexIdentical(cmath.atan(z), z)
+
+    @requires_IEEE_754
+    @unittest.skipIf(sysconfig.get_config_var('LOG1P_DROPS_ZERO_SIGN'),
+                     "system log1p() function doesn't preserve the sign")
+    def testAtanhSign(self):
+        for z in complex_zeros:
+            self.assertComplexIdentical(cmath.atanh(z), z)
+
 
 def test_main():
     run_unittest(CMathTests)

Modified: python/branches/py3k-cdecimal/Lib/test/test_code.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_code.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_code.py	Mon Nov 22 12:00:42 2010
@@ -128,9 +128,9 @@
 
     def test_newempty(self):
         co = _testcapi.code_newempty("filename", "funcname", 15)
-        self.assertEquals(co.co_filename, "filename")
-        self.assertEquals(co.co_name, "funcname")
-        self.assertEquals(co.co_firstlineno, 15)
+        self.assertEqual(co.co_filename, "filename")
+        self.assertEqual(co.co_name, "funcname")
+        self.assertEqual(co.co_firstlineno, 15)
 
 
 class CodeWeakRefTest(unittest.TestCase):

Modified: python/branches/py3k-cdecimal/Lib/test/test_codeccallbacks.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_codeccallbacks.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_codeccallbacks.py	Mon Nov 22 12:00:42 2010
@@ -186,7 +186,7 @@
         charmap = dict((ord(c), bytes(2*c.upper(), 'ascii')) for c in "abcdefgh")
         sin = "abc"
         sout = b"AABBCC"
-        self.assertEquals(codecs.charmap_encode(sin, "strict", charmap)[0], sout)
+        self.assertEqual(codecs.charmap_encode(sin, "strict", charmap)[0], sout)
 
         sin = "abcA"
         self.assertRaises(UnicodeError, codecs.charmap_encode, sin, "strict", charmap)
@@ -194,7 +194,7 @@
         charmap[ord("?")] = b"XYZ"
         sin = "abcDEF"
         sout = b"AABBCCXYZXYZXYZ"
-        self.assertEquals(codecs.charmap_encode(sin, "replace", charmap)[0], sout)
+        self.assertEqual(codecs.charmap_encode(sin, "replace", charmap)[0], sout)
 
         charmap[ord("?")] = "XYZ" # wrong type in mapping
         self.assertRaises(TypeError, codecs.charmap_encode, sin, "replace", charmap)
@@ -327,7 +327,7 @@
 
         # check with the correct number and type of arguments
         exc = exctype(*args)
-        self.assertEquals(str(exc), msg)
+        self.assertEqual(str(exc), msg)
 
     def test_unicodeencodeerror(self):
         self.check_exceptionobjectargs(
@@ -437,17 +437,17 @@
            UnicodeError("ouch")
         )
         # If the correct exception is passed in, "ignore" returns an empty replacement
-        self.assertEquals(
+        self.assertEqual(
             codecs.ignore_errors(
                 UnicodeEncodeError("ascii", "\u3042", 0, 1, "ouch")),
             ("", 1)
         )
-        self.assertEquals(
+        self.assertEqual(
             codecs.ignore_errors(
                 UnicodeDecodeError("ascii", bytearray(b"\xff"), 0, 1, "ouch")),
             ("", 1)
         )
-        self.assertEquals(
+        self.assertEqual(
             codecs.ignore_errors(
                 UnicodeTranslateError("\u3042", 0, 1, "ouch")),
             ("", 1)
@@ -477,17 +477,17 @@
             BadObjectUnicodeDecodeError()
         )
         # With the correct exception, "replace" returns an "?" or "\ufffd" replacement
-        self.assertEquals(
+        self.assertEqual(
             codecs.replace_errors(
                 UnicodeEncodeError("ascii", "\u3042", 0, 1, "ouch")),
             ("?", 1)
         )
-        self.assertEquals(
+        self.assertEqual(
             codecs.replace_errors(
                 UnicodeDecodeError("ascii", bytearray(b"\xff"), 0, 1, "ouch")),
             ("\ufffd", 1)
         )
-        self.assertEquals(
+        self.assertEqual(
             codecs.replace_errors(
                 UnicodeTranslateError("\u3042", 0, 1, "ouch")),
             ("\ufffd", 1)
@@ -520,7 +520,7 @@
         # Use the correct exception
         cs = (0, 1, 9, 10, 99, 100, 999, 1000, 9999, 10000, 0x3042)
         s = "".join(chr(c) for c in cs)
-        self.assertEquals(
+        self.assertEqual(
             codecs.xmlcharrefreplace_errors(
                 UnicodeEncodeError("ascii", s, 0, len(s), "ouch")
             ),
@@ -552,52 +552,52 @@
             UnicodeTranslateError("\u3042", 0, 1, "ouch")
         )
         # Use the correct exception
-        self.assertEquals(
+        self.assertEqual(
             codecs.backslashreplace_errors(
                 UnicodeEncodeError("ascii", "\u3042", 0, 1, "ouch")),
             ("\\u3042", 1)
         )
-        self.assertEquals(
+        self.assertEqual(
             codecs.backslashreplace_errors(
                 UnicodeEncodeError("ascii", "\x00", 0, 1, "ouch")),
             ("\\x00", 1)
         )
-        self.assertEquals(
+        self.assertEqual(
             codecs.backslashreplace_errors(
                 UnicodeEncodeError("ascii", "\xff", 0, 1, "ouch")),
             ("\\xff", 1)
         )
-        self.assertEquals(
+        self.assertEqual(
             codecs.backslashreplace_errors(
                 UnicodeEncodeError("ascii", "\u0100", 0, 1, "ouch")),
             ("\\u0100", 1)
         )
-        self.assertEquals(
+        self.assertEqual(
             codecs.backslashreplace_errors(
                 UnicodeEncodeError("ascii", "\uffff", 0, 1, "ouch")),
             ("\\uffff", 1)
         )
         # 1 on UCS-4 builds, 2 on UCS-2
         len_wide = len("\U00010000")
-        self.assertEquals(
+        self.assertEqual(
             codecs.backslashreplace_errors(
                 UnicodeEncodeError("ascii", "\U00010000",
                                    0, len_wide, "ouch")),
             ("\\U00010000", len_wide)
         )
-        self.assertEquals(
+        self.assertEqual(
             codecs.backslashreplace_errors(
                 UnicodeEncodeError("ascii", "\U0010ffff",
                                    0, len_wide, "ouch")),
             ("\\U0010ffff", len_wide)
         )
         # Lone surrogates (regardless of unicode width)
-        self.assertEquals(
+        self.assertEqual(
             codecs.backslashreplace_errors(
                 UnicodeEncodeError("ascii", "\ud800", 0, 1, "ouch")),
             ("\\ud800", 1)
         )
-        self.assertEquals(
+        self.assertEqual(
             codecs.backslashreplace_errors(
                 UnicodeEncodeError("ascii", "\udfff", 0, 1, "ouch")),
             ("\\udfff", 1)
@@ -630,14 +630,14 @@
                 )
 
     def test_lookup(self):
-        self.assertEquals(codecs.strict_errors, codecs.lookup_error("strict"))
-        self.assertEquals(codecs.ignore_errors, codecs.lookup_error("ignore"))
-        self.assertEquals(codecs.strict_errors, codecs.lookup_error("strict"))
-        self.assertEquals(
+        self.assertEqual(codecs.strict_errors, codecs.lookup_error("strict"))
+        self.assertEqual(codecs.ignore_errors, codecs.lookup_error("ignore"))
+        self.assertEqual(codecs.strict_errors, codecs.lookup_error("strict"))
+        self.assertEqual(
             codecs.xmlcharrefreplace_errors,
             codecs.lookup_error("xmlcharrefreplace")
         )
-        self.assertEquals(
+        self.assertEqual(
             codecs.backslashreplace_errors,
             codecs.lookup_error("backslashreplace")
         )
@@ -713,11 +713,11 @@
 
         # Valid negative position
         handler.pos = -1
-        self.assertEquals(b"\xff0".decode("ascii", "test.posreturn"), "<?>0")
+        self.assertEqual(b"\xff0".decode("ascii", "test.posreturn"), "<?>0")
 
         # Valid negative position
         handler.pos = -2
-        self.assertEquals(b"\xff0".decode("ascii", "test.posreturn"), "<?><?>")
+        self.assertEqual(b"\xff0".decode("ascii", "test.posreturn"), "<?><?>")
 
         # Negative position out of bounds
         handler.pos = -3
@@ -725,11 +725,11 @@
 
         # Valid positive position
         handler.pos = 1
-        self.assertEquals(b"\xff0".decode("ascii", "test.posreturn"), "<?>0")
+        self.assertEqual(b"\xff0".decode("ascii", "test.posreturn"), "<?>0")
 
         # Largest valid positive position (one beyond end of input)
         handler.pos = 2
-        self.assertEquals(b"\xff0".decode("ascii", "test.posreturn"), "<?>")
+        self.assertEqual(b"\xff0".decode("ascii", "test.posreturn"), "<?>")
 
         # Invalid positive position
         handler.pos = 3
@@ -737,7 +737,7 @@
 
         # Restart at the "0"
         handler.pos = 6
-        self.assertEquals(b"\\uyyyy0".decode("raw-unicode-escape", "test.posreturn"), "<?>0")
+        self.assertEqual(b"\\uyyyy0".decode("raw-unicode-escape", "test.posreturn"), "<?>0")
 
         class D(dict):
             def __getitem__(self, key):
@@ -767,11 +767,11 @@
 
         # Valid negative position
         handler.pos = -1
-        self.assertEquals("\xff0".encode("ascii", "test.posreturn"), b"<?>0")
+        self.assertEqual("\xff0".encode("ascii", "test.posreturn"), b"<?>0")
 
         # Valid negative position
         handler.pos = -2
-        self.assertEquals("\xff0".encode("ascii", "test.posreturn"), b"<?><?>")
+        self.assertEqual("\xff0".encode("ascii", "test.posreturn"), b"<?><?>")
 
         # Negative position out of bounds
         handler.pos = -3
@@ -779,11 +779,11 @@
 
         # Valid positive position
         handler.pos = 1
-        self.assertEquals("\xff0".encode("ascii", "test.posreturn"), b"<?>0")
+        self.assertEqual("\xff0".encode("ascii", "test.posreturn"), b"<?>0")
 
         # Largest valid positive position (one beyond end of input
         handler.pos = 2
-        self.assertEquals("\xff0".encode("ascii", "test.posreturn"), b"<?>")
+        self.assertEqual("\xff0".encode("ascii", "test.posreturn"), b"<?>")
 
         # Invalid positive position
         handler.pos = 3

Modified: python/branches/py3k-cdecimal/Lib/test/test_codecs.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_codecs.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_codecs.py	Mon Nov 22 12:00:42 2010
@@ -299,7 +299,7 @@
         # try to read it back
         s = io.BytesIO(d)
         f = reader(s)
-        self.assertEquals(f.read(), "spamspam")
+        self.assertEqual(f.read(), "spamspam")
 
     def test_badbom(self):
         s = io.BytesIO(4*b"\xff")
@@ -463,7 +463,7 @@
         # try to read it back
         s = io.BytesIO(d)
         f = reader(s)
-        self.assertEquals(f.read(), "spamspam")
+        self.assertEqual(f.read(), "spamspam")
 
     def test_badbom(self):
         s = io.BytesIO(b"\xff\xff")
@@ -607,10 +607,10 @@
                          b'[?]')
 
     def test_surrogatepass_handler(self):
-        self.assertEquals("abc\ud800def".encode("utf-8", "surrogatepass"),
-                          b"abc\xed\xa0\x80def")
-        self.assertEquals(b"abc\xed\xa0\x80def".decode("utf-8", "surrogatepass"),
-                          "abc\ud800def")
+        self.assertEqual("abc\ud800def".encode("utf-8", "surrogatepass"),
+                         b"abc\xed\xa0\x80def")
+        self.assertEqual(b"abc\xed\xa0\x80def".decode("utf-8", "surrogatepass"),
+                         "abc\ud800def")
         self.assertTrue(codecs.lookup_error("surrogatepass"))
 
 class UTF7Test(ReadTest):
@@ -681,7 +681,7 @@
 
     def test_bug1601501(self):
         # SF bug #1601501: check that the codec works with a buffer
-        self.assertEquals(str(b"\xef\xbb\xbf", "utf-8-sig"), "")
+        self.assertEqual(str(b"\xef\xbb\xbf", "utf-8-sig"), "")
 
     def test_bom(self):
         d = codecs.getincrementaldecoder("utf-8-sig")()
@@ -734,7 +734,7 @@
 
 class EscapeDecodeTest(unittest.TestCase):
     def test_empty(self):
-        self.assertEquals(codecs.escape_decode(""), ("", 0))
+        self.assertEqual(codecs.escape_decode(""), ("", 0))
 
 class RecodingTest(unittest.TestCase):
     def test_recoding(self):
@@ -861,16 +861,16 @@
             # code produces only lower case. Converting just puny to
             # lower is also insufficient, since some of the input characters
             # are upper case.
-            self.assertEquals(
+            self.assertEqual(
                 str(uni.encode("punycode"), "ascii").lower(),
                 str(puny, "ascii").lower()
             )
 
     def test_decode(self):
         for uni, puny in punycode_testcases:
-            self.assertEquals(uni, puny.decode("punycode"))
+            self.assertEqual(uni, puny.decode("punycode"))
             puny = puny.decode("ascii").encode("ascii")
-            self.assertEquals(uni, puny.decode("punycode"))
+            self.assertEqual(uni, puny.decode("punycode"))
 
 class UnicodeInternalTest(unittest.TestCase):
     def test_bug1251300(self):
@@ -892,7 +892,7 @@
             for internal, uni in ok:
                 if sys.byteorder == "little":
                     internal = bytes(reversed(internal))
-                self.assertEquals(uni, internal.decode("unicode_internal"))
+                self.assertEqual(uni, internal.decode("unicode_internal"))
             for internal in not_ok:
                 if sys.byteorder == "little":
                     internal = bytes(reversed(internal))
@@ -904,10 +904,10 @@
             try:
                 b"\x00\x00\x00\x00\x00\x11\x11\x00".decode("unicode_internal")
             except UnicodeDecodeError as ex:
-                self.assertEquals("unicode_internal", ex.encoding)
-                self.assertEquals(b"\x00\x00\x00\x00\x00\x11\x11\x00", ex.object)
-                self.assertEquals(4, ex.start)
-                self.assertEquals(8, ex.end)
+                self.assertEqual("unicode_internal", ex.encoding)
+                self.assertEqual(b"\x00\x00\x00\x00\x00\x11\x11\x00", ex.object)
+                self.assertEqual(4, ex.start)
+                self.assertEqual(8, ex.end)
             else:
                 self.fail()
 
@@ -919,15 +919,15 @@
             ignored = decoder(bytes("%s\x22\x22\x22\x22%s" % (ab[:4], ab[4:]),
                                     "ascii"),
                               "UnicodeInternalTest")
-            self.assertEquals(("ab", 12), ignored)
+            self.assertEqual(("ab", 12), ignored)
 
     def test_encode_length(self):
         # Issue 3739
         encoder = codecs.getencoder("unicode_internal")
-        self.assertEquals(encoder("a")[1], 1)
-        self.assertEquals(encoder("\xe9\u0142")[1], 2)
+        self.assertEqual(encoder("a")[1], 1)
+        self.assertEqual(encoder("\xe9\u0142")[1], 2)
 
-        self.assertEquals(codecs.escape_encode(br'\x00')[1], 4)
+        self.assertEqual(codecs.escape_encode(br'\x00')[1], 4)
 
 # From http://www.gnu.org/software/libidn/draft-josefsson-idn-test-vectors.html
 nameprep_tests = [
@@ -1098,101 +1098,101 @@
             else:
                 prepped = str(prepped, "utf-8", "surrogatepass")
                 try:
-                    self.assertEquals(nameprep(orig), prepped)
+                    self.assertEqual(nameprep(orig), prepped)
                 except Exception as e:
                     raise support.TestFailed("Test 3.%d: %s" % (pos+1, str(e)))
 
 class IDNACodecTest(unittest.TestCase):
     def test_builtin_decode(self):
-        self.assertEquals(str(b"python.org", "idna"), "python.org")
-        self.assertEquals(str(b"python.org.", "idna"), "python.org.")
-        self.assertEquals(str(b"xn--pythn-mua.org", "idna"), "pyth\xf6n.org")
-        self.assertEquals(str(b"xn--pythn-mua.org.", "idna"), "pyth\xf6n.org.")
+        self.assertEqual(str(b"python.org", "idna"), "python.org")
+        self.assertEqual(str(b"python.org.", "idna"), "python.org.")
+        self.assertEqual(str(b"xn--pythn-mua.org", "idna"), "pyth\xf6n.org")
+        self.assertEqual(str(b"xn--pythn-mua.org.", "idna"), "pyth\xf6n.org.")
 
     def test_builtin_encode(self):
-        self.assertEquals("python.org".encode("idna"), b"python.org")
-        self.assertEquals("python.org.".encode("idna"), b"python.org.")
-        self.assertEquals("pyth\xf6n.org".encode("idna"), b"xn--pythn-mua.org")
-        self.assertEquals("pyth\xf6n.org.".encode("idna"), b"xn--pythn-mua.org.")
+        self.assertEqual("python.org".encode("idna"), b"python.org")
+        self.assertEqual("python.org.".encode("idna"), b"python.org.")
+        self.assertEqual("pyth\xf6n.org".encode("idna"), b"xn--pythn-mua.org")
+        self.assertEqual("pyth\xf6n.org.".encode("idna"), b"xn--pythn-mua.org.")
 
     def test_stream(self):
         r = codecs.getreader("idna")(io.BytesIO(b"abc"))
         r.read(3)
-        self.assertEquals(r.read(), "")
+        self.assertEqual(r.read(), "")
 
     def test_incremental_decode(self):
-        self.assertEquals(
+        self.assertEqual(
             "".join(codecs.iterdecode((bytes([c]) for c in b"python.org"), "idna")),
             "python.org"
         )
-        self.assertEquals(
+        self.assertEqual(
             "".join(codecs.iterdecode((bytes([c]) for c in b"python.org."), "idna")),
             "python.org."
         )
-        self.assertEquals(
+        self.assertEqual(
             "".join(codecs.iterdecode((bytes([c]) for c in b"xn--pythn-mua.org."), "idna")),
             "pyth\xf6n.org."
         )
-        self.assertEquals(
+        self.assertEqual(
             "".join(codecs.iterdecode((bytes([c]) for c in b"xn--pythn-mua.org."), "idna")),
             "pyth\xf6n.org."
         )
 
         decoder = codecs.getincrementaldecoder("idna")()
-        self.assertEquals(decoder.decode(b"xn--xam", ), "")
-        self.assertEquals(decoder.decode(b"ple-9ta.o", ), "\xe4xample.")
-        self.assertEquals(decoder.decode(b"rg"), "")
-        self.assertEquals(decoder.decode(b"", True), "org")
+        self.assertEqual(decoder.decode(b"xn--xam", ), "")
+        self.assertEqual(decoder.decode(b"ple-9ta.o", ), "\xe4xample.")
+        self.assertEqual(decoder.decode(b"rg"), "")
+        self.assertEqual(decoder.decode(b"", True), "org")
 
         decoder.reset()
-        self.assertEquals(decoder.decode(b"xn--xam", ), "")
-        self.assertEquals(decoder.decode(b"ple-9ta.o", ), "\xe4xample.")
-        self.assertEquals(decoder.decode(b"rg."), "org.")
-        self.assertEquals(decoder.decode(b"", True), "")
+        self.assertEqual(decoder.decode(b"xn--xam", ), "")
+        self.assertEqual(decoder.decode(b"ple-9ta.o", ), "\xe4xample.")
+        self.assertEqual(decoder.decode(b"rg."), "org.")
+        self.assertEqual(decoder.decode(b"", True), "")
 
     def test_incremental_encode(self):
-        self.assertEquals(
+        self.assertEqual(
             b"".join(codecs.iterencode("python.org", "idna")),
             b"python.org"
         )
-        self.assertEquals(
+        self.assertEqual(
             b"".join(codecs.iterencode("python.org.", "idna")),
             b"python.org."
         )
-        self.assertEquals(
+        self.assertEqual(
             b"".join(codecs.iterencode("pyth\xf6n.org.", "idna")),
             b"xn--pythn-mua.org."
         )
-        self.assertEquals(
+        self.assertEqual(
             b"".join(codecs.iterencode("pyth\xf6n.org.", "idna")),
             b"xn--pythn-mua.org."
         )
 
         encoder = codecs.getincrementalencoder("idna")()
-        self.assertEquals(encoder.encode("\xe4x"), b"")
-        self.assertEquals(encoder.encode("ample.org"), b"xn--xample-9ta.")
-        self.assertEquals(encoder.encode("", True), b"org")
+        self.assertEqual(encoder.encode("\xe4x"), b"")
+        self.assertEqual(encoder.encode("ample.org"), b"xn--xample-9ta.")
+        self.assertEqual(encoder.encode("", True), b"org")
 
         encoder.reset()
-        self.assertEquals(encoder.encode("\xe4x"), b"")
-        self.assertEquals(encoder.encode("ample.org."), b"xn--xample-9ta.org.")
-        self.assertEquals(encoder.encode("", True), b"")
+        self.assertEqual(encoder.encode("\xe4x"), b"")
+        self.assertEqual(encoder.encode("ample.org."), b"xn--xample-9ta.org.")
+        self.assertEqual(encoder.encode("", True), b"")
 
 class CodecsModuleTest(unittest.TestCase):
 
     def test_decode(self):
-        self.assertEquals(codecs.decode(b'\xe4\xf6\xfc', 'latin-1'),
-                          '\xe4\xf6\xfc')
+        self.assertEqual(codecs.decode(b'\xe4\xf6\xfc', 'latin-1'),
+                         '\xe4\xf6\xfc')
         self.assertRaises(TypeError, codecs.decode)
-        self.assertEquals(codecs.decode(b'abc'), 'abc')
+        self.assertEqual(codecs.decode(b'abc'), 'abc')
         self.assertRaises(UnicodeDecodeError, codecs.decode, b'\xff', 'ascii')
 
     def test_encode(self):
-        self.assertEquals(codecs.encode('\xe4\xf6\xfc', 'latin-1'),
-                          b'\xe4\xf6\xfc')
+        self.assertEqual(codecs.encode('\xe4\xf6\xfc', 'latin-1'),
+                         b'\xe4\xf6\xfc')
         self.assertRaises(TypeError, codecs.encode)
         self.assertRaises(LookupError, codecs.encode, "foo", "__spam__")
-        self.assertEquals(codecs.encode('abc'), b'abc')
+        self.assertEqual(codecs.encode('abc'), b'abc')
         self.assertRaises(UnicodeEncodeError, codecs.encode, '\xffff', 'ascii')
 
     def test_register(self):
@@ -1228,19 +1228,19 @@
 
     def test_readlines(self):
         f = self.reader(self.stream)
-        self.assertEquals(f.readlines(), ['\ud55c\n', '\uae00'])
+        self.assertEqual(f.readlines(), ['\ud55c\n', '\uae00'])
 
 class EncodedFileTest(unittest.TestCase):
 
     def test_basic(self):
         f = io.BytesIO(b'\xed\x95\x9c\n\xea\xb8\x80')
         ef = codecs.EncodedFile(f, 'utf-16-le', 'utf-8')
-        self.assertEquals(ef.read(), b'\\\xd5\n\x00\x00\xae')
+        self.assertEqual(ef.read(), b'\\\xd5\n\x00\x00\xae')
 
         f = io.BytesIO()
         ef = codecs.EncodedFile(f, 'utf-8', 'latin1')
         ef.write(b'\xc3\xbc')
-        self.assertEquals(f.getvalue(), b'\xfc')
+        self.assertEqual(f.getvalue(), b'\xfc')
 
 all_unicode_encodings = [
     "ascii",
@@ -1495,33 +1495,33 @@
 
 class CharmapTest(unittest.TestCase):
     def test_decode_with_string_map(self):
-        self.assertEquals(
+        self.assertEqual(
             codecs.charmap_decode(b"\x00\x01\x02", "strict", "abc"),
             ("abc", 3)
         )
 
-        self.assertEquals(
+        self.assertEqual(
             codecs.charmap_decode(b"\x00\x01\x02", "replace", "ab"),
             ("ab\ufffd", 3)
         )
 
-        self.assertEquals(
+        self.assertEqual(
             codecs.charmap_decode(b"\x00\x01\x02", "replace", "ab\ufffe"),
             ("ab\ufffd", 3)
         )
 
-        self.assertEquals(
+        self.assertEqual(
             codecs.charmap_decode(b"\x00\x01\x02", "ignore", "ab"),
             ("ab", 3)
         )
 
-        self.assertEquals(
+        self.assertEqual(
             codecs.charmap_decode(b"\x00\x01\x02", "ignore", "ab\ufffe"),
             ("ab", 3)
         )
 
         allbytes = bytes(range(256))
-        self.assertEquals(
+        self.assertEqual(
             codecs.charmap_decode(allbytes, "ignore", ""),
             ("", len(allbytes))
         )
@@ -1530,14 +1530,14 @@
     def test_encodedfile(self):
         f = io.BytesIO(b"\xc3\xbc")
         with codecs.EncodedFile(f, "latin-1", "utf-8") as ef:
-            self.assertEquals(ef.read(), b"\xfc")
+            self.assertEqual(ef.read(), b"\xfc")
 
     def test_streamreaderwriter(self):
         f = io.BytesIO(b"\xc3\xbc")
         info = codecs.lookup("utf-8")
         with codecs.StreamReaderWriter(f, info.streamreader,
                                        info.streamwriter, 'strict') as srw:
-            self.assertEquals(srw.read(), "\xfc")
+            self.assertEqual(srw.read(), "\xfc")
 
 class TypesTest(unittest.TestCase):
     def test_decode_unicode(self):
@@ -1564,10 +1564,10 @@
     def test_unicode_escape(self):
         # Escape-decoding an unicode string is supported ang gives the same
         # result as decoding the equivalent ASCII bytes string.
-        self.assertEquals(codecs.unicode_escape_decode(r"\u1234"), ("\u1234", 6))
-        self.assertEquals(codecs.unicode_escape_decode(br"\u1234"), ("\u1234", 6))
-        self.assertEquals(codecs.raw_unicode_escape_decode(r"\u1234"), ("\u1234", 6))
-        self.assertEquals(codecs.raw_unicode_escape_decode(br"\u1234"), ("\u1234", 6))
+        self.assertEqual(codecs.unicode_escape_decode(r"\u1234"), ("\u1234", 6))
+        self.assertEqual(codecs.unicode_escape_decode(br"\u1234"), ("\u1234", 6))
+        self.assertEqual(codecs.raw_unicode_escape_decode(r"\u1234"), ("\u1234", 6))
+        self.assertEqual(codecs.raw_unicode_escape_decode(br"\u1234"), ("\u1234", 6))
 
 class SurrogateEscapeTest(unittest.TestCase):
 
@@ -1618,27 +1618,27 @@
                 f.write(data)
                 f.write(data)
                 f.seek(0)
-                self.assertEquals(f.read(), data * 2)
+                self.assertEqual(f.read(), data * 2)
                 f.seek(0)
-                self.assertEquals(f.read(), data * 2)
+                self.assertEqual(f.read(), data * 2)
 
             # Check that the BOM is written after a seek(0)
             with codecs.open(support.TESTFN, 'w+', encoding=encoding) as f:
                 f.write(data[0])
-                self.assertNotEquals(f.tell(), 0)
+                self.assertNotEqual(f.tell(), 0)
                 f.seek(0)
                 f.write(data)
                 f.seek(0)
-                self.assertEquals(f.read(), data)
+                self.assertEqual(f.read(), data)
 
             # (StreamWriter) Check that the BOM is written after a seek(0)
             with codecs.open(support.TESTFN, 'w+', encoding=encoding) as f:
                 f.writer.write(data[0])
-                self.assertNotEquals(f.writer.tell(), 0)
+                self.assertNotEqual(f.writer.tell(), 0)
                 f.writer.seek(0)
                 f.writer.write(data)
                 f.seek(0)
-                self.assertEquals(f.read(), data)
+                self.assertEqual(f.read(), data)
 
             # Check that the BOM is not written after a seek() at a position
             # different than the start
@@ -1647,7 +1647,7 @@
                 f.seek(f.tell())
                 f.write(data)
                 f.seek(0)
-                self.assertEquals(f.read(), data * 2)
+                self.assertEqual(f.read(), data * 2)
 
             # (StreamWriter) Check that the BOM is not written after a seek()
             # at a position different than the start
@@ -1656,7 +1656,7 @@
                 f.writer.seek(f.writer.tell())
                 f.writer.write(data)
                 f.seek(0)
-                self.assertEquals(f.read(), data * 2)
+                self.assertEqual(f.read(), data * 2)
 
 
 def test_main():

Modified: python/branches/py3k-cdecimal/Lib/test/test_codeop.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_codeop.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_codeop.py	Mon Nov 22 12:00:42 2010
@@ -37,14 +37,14 @@
                 ctx = {'a': 2}
                 d = { 'value': eval(code,ctx) }
                 r = { 'value': eval(str,ctx) }
-            self.assertEquals(unify_callables(r),unify_callables(d))
+            self.assertEqual(unify_callables(r),unify_callables(d))
         else:
             expected = compile(str, "<input>", symbol, PyCF_DONT_IMPLY_DEDENT)
-            self.assertEquals( compile_command(str, "<input>", symbol), expected)
+            self.assertEqual(compile_command(str, "<input>", symbol), expected)
 
     def assertIncomplete(self, str, symbol='single'):
         '''succeed iff str is the start of a valid piece of code'''
-        self.assertEquals( compile_command(str, symbol=symbol), None)
+        self.assertEqual(compile_command(str, symbol=symbol), None)
 
     def assertInvalid(self, str, symbol='single', is_syntax=1):
         '''succeed iff str is the start of an invalid piece of code'''
@@ -61,12 +61,12 @@
 
         # special case
         if not is_jython:
-            self.assertEquals(compile_command(""),
-                            compile("pass", "<input>", 'single',
-                                    PyCF_DONT_IMPLY_DEDENT))
-            self.assertEquals(compile_command("\n"),
-                            compile("pass", "<input>", 'single',
-                                    PyCF_DONT_IMPLY_DEDENT))
+            self.assertEqual(compile_command(""),
+                             compile("pass", "<input>", 'single',
+                                     PyCF_DONT_IMPLY_DEDENT))
+            self.assertEqual(compile_command("\n"),
+                             compile("pass", "<input>", 'single',
+                                     PyCF_DONT_IMPLY_DEDENT))
         else:
             av("")
             av("\n")
@@ -290,10 +290,10 @@
         ai("[i for i in range(10)] = (1, 2, 3)")
 
     def test_filename(self):
-        self.assertEquals(compile_command("a = 1\n", "abc").co_filename,
-                          compile("a = 1\n", "abc", 'single').co_filename)
-        self.assertNotEquals(compile_command("a = 1\n", "abc").co_filename,
-                             compile("a = 1\n", "def", 'single').co_filename)
+        self.assertEqual(compile_command("a = 1\n", "abc").co_filename,
+                         compile("a = 1\n", "abc", 'single').co_filename)
+        self.assertNotEqual(compile_command("a = 1\n", "abc").co_filename,
+                            compile("a = 1\n", "def", 'single').co_filename)
 
 
 def test_main():

Modified: python/branches/py3k-cdecimal/Lib/test/test_collections.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_collections.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_collections.py	Mon Nov 22 12:00:42 2010
@@ -701,9 +701,9 @@
                     ]):
             msg = (i, dup, words)
             self.assertTrue(dup is not words)
-            self.assertEquals(dup, words)
-            self.assertEquals(len(dup), len(words))
-            self.assertEquals(type(dup), type(words))
+            self.assertEqual(dup, words)
+            self.assertEqual(len(dup), len(words))
+            self.assertEqual(type(dup), type(words))
 
     def test_conversions(self):
         # Convert to: set, list, dict
@@ -922,10 +922,10 @@
                     OrderedDict(od),
                     ]):
             self.assertTrue(dup is not od)
-            self.assertEquals(dup, od)
-            self.assertEquals(list(dup.items()), list(od.items()))
-            self.assertEquals(len(dup), len(od))
-            self.assertEquals(type(dup), type(od))
+            self.assertEqual(dup, od)
+            self.assertEqual(list(dup.items()), list(od.items()))
+            self.assertEqual(len(dup), len(od))
+            self.assertEqual(type(dup), type(od))
 
     def test_yaml_linkage(self):
         # Verify that __reduce__ is setup in a way that supports PyYAML's dump() feature.

Modified: python/branches/py3k-cdecimal/Lib/test/test_compileall.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_compileall.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_compileall.py	Mon Nov 22 12:00:42 2010
@@ -7,6 +7,7 @@
 import struct
 import subprocess
 import tempfile
+import time
 import unittest
 import io
 
@@ -112,7 +113,7 @@
 
 
 class CommandLineTests(unittest.TestCase):
-    """Test some aspects of compileall's CLI."""
+    """Test compileall's CLI."""
 
     def setUp(self):
         self.addCleanup(self._cleanup)
@@ -184,6 +185,57 @@
         self.assertTrue(os.path.exists(cachedir))
         self.assertFalse(os.path.exists(cachecachedir))
 
+    def test_force(self):
+        retcode = subprocess.call(
+            (sys.executable, '-m', 'compileall', '-q', self.pkgdir))
+        self.assertEqual(retcode, 0)
+        pycpath = imp.cache_from_source(os.path.join(self.pkgdir, 'bar.py'))
+        # set atime/mtime backward to avoid file timestamp resolution issues
+        os.utime(pycpath, (time.time()-60,)*2)
+        access = os.stat(pycpath).st_mtime
+        retcode = subprocess.call(
+            (sys.executable, '-m', 'compileall', '-q', '-f', self.pkgdir))
+        self.assertEqual(retcode, 0)
+        access2 = os.stat(pycpath).st_mtime
+        self.assertNotEqual(access, access2)
+
+    def test_legacy(self):
+        # create a new module
+        newpackage = os.path.join(self.pkgdir, 'spam')
+        os.mkdir(newpackage)
+        with open(os.path.join(newpackage, '__init__.py'), 'w'):
+            pass
+        with open(os.path.join(newpackage, 'ham.py'), 'w'):
+            pass
+        sourcefile = os.path.join(newpackage, 'ham.py')
+
+        retcode = subprocess.call(
+                (sys.executable, '-m', 'compileall',  '-q', '-l', self.pkgdir))
+        self.assertEqual(retcode, 0)
+        self.assertFalse(os.path.exists(imp.cache_from_source(sourcefile)))
+
+        retcode = subprocess.call(
+                (sys.executable, '-m', 'compileall', '-q', self.pkgdir))
+        self.assertEqual(retcode, 0)
+        self.assertTrue(os.path.exists(imp.cache_from_source(sourcefile)))
+
+    def test_quiet(self):
+        noise = subprocess.getoutput('{} -m compileall {}'.format(
+                                     sys.executable, self.pkgdir))
+        quiet = subprocess.getoutput(('{} -m compileall -f -q {}'.format(
+                                     sys.executable, self.pkgdir)))
+        self.assertGreater(len(noise), len(quiet))
+
+    def test_regexp(self):
+        retcode = subprocess.call(
+            (sys.executable, '-m', 'compileall', '-q', '-x', 'bar.*', self.pkgdir))
+        self.assertEqual(retcode, 0)
+
+        sourcefile = os.path.join(self.pkgdir, 'bar.py')
+        self.assertFalse(os.path.exists(imp.cache_from_source(sourcefile)))
+        sourcefile = os.path.join(self.pkgdir, '__init__.py')
+        self.assertTrue(os.path.exists(imp.cache_from_source(sourcefile)))
+
 
 def test_main():
     support.run_unittest(

Modified: python/branches/py3k-cdecimal/Lib/test/test_complex.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_complex.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_complex.py	Mon Nov 22 12:00:42 2010
@@ -432,8 +432,8 @@
         def test_plus_minus_0j(self):
             # test that -0j and 0j literals are not identified
             z1, z2 = 0j, -0j
-            self.assertEquals(atan2(z1.imag, -1.), atan2(0., -1.))
-            self.assertEquals(atan2(z2.imag, -1.), atan2(-0., -1.))
+            self.assertEqual(atan2(z1.imag, -1.), atan2(0., -1.))
+            self.assertEqual(atan2(z2.imag, -1.), atan2(-0., -1.))
 
     @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
                          "test requires IEEE 754 doubles")

Modified: python/branches/py3k-cdecimal/Lib/test/test_concurrent_futures.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_concurrent_futures.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_concurrent_futures.py	Mon Nov 22 12:00:42 2010
@@ -75,7 +75,7 @@
 
     def _wait_on_event(self, handle):
         if sys.platform.startswith('win'):
-            r = ctypes.windll.kernel32.WaitForSingleObject(handle, 5 * 1000)
+            r = ctypes.windll.kernel32.WaitForSingleObject(handle, 60 * 1000)
             assert r == 0
         else:
             self.CALL_LOCKS[handle].wait()
@@ -249,8 +249,8 @@
                     [CANCELLED_FUTURE, future1, future2],
                      return_when=futures.FIRST_COMPLETED)
 
-            self.assertEquals(set([future1]), done)
-            self.assertEquals(set([CANCELLED_FUTURE, future2]), not_done)
+            self.assertEqual(set([future1]), done)
+            self.assertEqual(set([CANCELLED_FUTURE, future2]), not_done)
         finally:
             call1.close()
             call2.close()
@@ -264,8 +264,8 @@
                      [SUCCESSFUL_FUTURE, future1],
                      return_when=futures.FIRST_COMPLETED)
 
-            self.assertEquals(set([SUCCESSFUL_FUTURE]), finished)
-            self.assertEquals(set([future1]), pending)
+            self.assertEqual(set([SUCCESSFUL_FUTURE]), finished)
+            self.assertEqual(set([future1]), pending)
         finally:
             call1.close()
 
@@ -290,8 +290,8 @@
                     [future1, future2, future3],
                     return_when=futures.FIRST_EXCEPTION)
 
-            self.assertEquals(set([future1, future2]), finished)
-            self.assertEquals(set([future3]), pending)
+            self.assertEqual(set([future1, future2]), finished)
+            self.assertEqual(set([future3]), pending)
         finally:
             call1.close()
             call2.close()
@@ -318,10 +318,10 @@
                      future1, future2],
                     return_when=futures.FIRST_EXCEPTION)
 
-            self.assertEquals(set([SUCCESSFUL_FUTURE,
-                                   CANCELLED_AND_NOTIFIED_FUTURE,
-                                   future1]), finished)
-            self.assertEquals(set([CANCELLED_FUTURE, future2]), pending)
+            self.assertEqual(set([SUCCESSFUL_FUTURE,
+                                  CANCELLED_AND_NOTIFIED_FUTURE,
+                                  future1]), finished)
+            self.assertEqual(set([CANCELLED_FUTURE, future2]), pending)
 
 
         finally:
@@ -337,8 +337,8 @@
                      [EXCEPTION_FUTURE, future1],
                      return_when=futures.FIRST_EXCEPTION)
 
-            self.assertEquals(set([EXCEPTION_FUTURE]), finished)
-            self.assertEquals(set([future1]), pending)
+            self.assertEqual(set([EXCEPTION_FUTURE]), finished)
+            self.assertEqual(set([future1]), pending)
         finally:
             call1.close()
 
@@ -361,8 +361,8 @@
                     [future1, future2],
                     return_when=futures.ALL_COMPLETED)
 
-            self.assertEquals(set([future1, future2]), finished)
-            self.assertEquals(set(), pending)
+            self.assertEqual(set([future1, future2]), finished)
+            self.assertEqual(set(), pending)
 
 
         finally:
@@ -403,11 +403,11 @@
                      future1, future2, future3, future4],
                     return_when=futures.ALL_COMPLETED)
 
-            self.assertEquals(set([SUCCESSFUL_FUTURE,
-                                   CANCELLED_AND_NOTIFIED_FUTURE,
-                                   future1, future2, future3, future4]),
-                              finished)
-            self.assertEquals(set(), pending)
+            self.assertEqual(set([SUCCESSFUL_FUTURE,
+                                  CANCELLED_AND_NOTIFIED_FUTURE,
+                                  future1, future2, future3, future4]),
+                             finished)
+            self.assertEqual(set(), pending)
         finally:
             call1.close()
             call2.close()
@@ -433,14 +433,14 @@
                      EXCEPTION_FUTURE,
                      SUCCESSFUL_FUTURE,
                      future1, future2],
-                    timeout=1,
+                    timeout=5,
                     return_when=futures.ALL_COMPLETED)
 
-            self.assertEquals(set([CANCELLED_AND_NOTIFIED_FUTURE,
-                                   EXCEPTION_FUTURE,
-                                   SUCCESSFUL_FUTURE,
-                                   future1]), finished)
-            self.assertEquals(set([future2]), pending)
+            self.assertEqual(set([CANCELLED_AND_NOTIFIED_FUTURE,
+                                  EXCEPTION_FUTURE,
+                                  SUCCESSFUL_FUTURE,
+                                  future1]), finished)
+            self.assertEqual(set([future2]), pending)
 
 
         finally:
@@ -484,7 +484,7 @@
                      EXCEPTION_FUTURE,
                      SUCCESSFUL_FUTURE,
                      future1, future2]))
-            self.assertEquals(set(
+            self.assertEqual(set(
                     [CANCELLED_AND_NOTIFIED_FUTURE,
                      EXCEPTION_FUTURE,
                      SUCCESSFUL_FUTURE,
@@ -510,10 +510,10 @@
             except futures.TimeoutError:
                 pass
 
-            self.assertEquals(set([CANCELLED_AND_NOTIFIED_FUTURE,
-                                   EXCEPTION_FUTURE,
-                                   SUCCESSFUL_FUTURE]),
-                              completed_futures)
+            self.assertEqual(set([CANCELLED_AND_NOTIFIED_FUTURE,
+                                  EXCEPTION_FUTURE,
+                                  SUCCESSFUL_FUTURE]),
+                             completed_futures)
         finally:
             call1.close()
 
@@ -536,11 +536,11 @@
     # ExecutorShutdownTest.
     def test_submit(self):
         future = self.executor.submit(pow, 2, 8)
-        self.assertEquals(256, future.result())
+        self.assertEqual(256, future.result())
 
     def test_submit_keyword(self):
         future = self.executor.submit(mul, 2, y=8)
-        self.assertEquals(16, future.result())
+        self.assertEqual(16, future.result())
 
     def test_map(self):
         self.assertEqual(
@@ -560,7 +560,7 @@
             try:
                 for i in self.executor.map(timeout_call,
                                            [False, False, True],
-                                           timeout=1):
+                                           timeout=5):
                     results.append(i)
             except futures.TimeoutError:
                 pass
@@ -569,7 +569,7 @@
         finally:
             timeout_call.close()
 
-        self.assertEquals([42, 42], results)
+        self.assertEqual([42, 42], results)
 
 class ThreadPoolExecutorTest(ExecutorTest):
     def setUp(self):
@@ -595,7 +595,7 @@
         f = Future()
         f.add_done_callback(fn)
         f.set_result(5)
-        self.assertEquals(5, callback_result)
+        self.assertEqual(5, callback_result)
 
     def test_done_callback_with_exception(self):
         callback_exception = None
@@ -606,7 +606,7 @@
         f = Future()
         f.add_done_callback(fn)
         f.set_exception(Exception('test'))
-        self.assertEquals(('test',), callback_exception.args)
+        self.assertEqual(('test',), callback_exception.args)
 
     def test_done_callback_with_cancel(self):
         was_cancelled = None
@@ -657,7 +657,7 @@
         f = Future()
         f.set_result(5)
         f.add_done_callback(fn)
-        self.assertEquals(5, callback_result)
+        self.assertEqual(5, callback_result)
 
     def test_done_callback_already_failed(self):
         callback_exception = None
@@ -668,7 +668,7 @@
         f = Future()
         f.set_exception(Exception('test'))
         f.add_done_callback(fn)
-        self.assertEquals(('test',), callback_exception.args)
+        self.assertEqual(('test',), callback_exception.args)
 
     def test_done_callback_already_cancelled(self):
         was_cancelled = None
@@ -707,22 +707,22 @@
         f6 = create_future(state=FINISHED, result=5)
 
         self.assertTrue(f1.cancel())
-        self.assertEquals(f1._state, CANCELLED)
+        self.assertEqual(f1._state, CANCELLED)
 
         self.assertFalse(f2.cancel())
-        self.assertEquals(f2._state, RUNNING)
+        self.assertEqual(f2._state, RUNNING)
 
         self.assertTrue(f3.cancel())
-        self.assertEquals(f3._state, CANCELLED)
+        self.assertEqual(f3._state, CANCELLED)
 
         self.assertTrue(f4.cancel())
-        self.assertEquals(f4._state, CANCELLED_AND_NOTIFIED)
+        self.assertEqual(f4._state, CANCELLED_AND_NOTIFIED)
 
         self.assertFalse(f5.cancel())
-        self.assertEquals(f5._state, FINISHED)
+        self.assertEqual(f5._state, FINISHED)
 
         self.assertFalse(f6.cancel())
-        self.assertEquals(f6._state, FINISHED)
+        self.assertEqual(f6._state, FINISHED)
 
     def test_cancelled(self):
         self.assertFalse(PENDING_FUTURE.cancelled())
@@ -771,7 +771,7 @@
         t = threading.Thread(target=notification)
         t.start()
 
-        self.assertEquals(f1.result(timeout=5), 42)
+        self.assertEqual(f1.result(timeout=5), 42)
 
     def test_result_with_cancel(self):
         # TODO(brian at sweetapp.com): This test is timing dependant.

Modified: python/branches/py3k-cdecimal/Lib/test/test_copyreg.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_copyreg.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_copyreg.py	Mon Nov 22 12:00:42 2010
@@ -40,7 +40,7 @@
 
     def test_bool(self):
         import copy
-        self.assertEquals(True, copy.copy(True))
+        self.assertEqual(True, copy.copy(True))
 
     def test_extension_registry(self):
         mod, func, code = 'junk1 ', ' junk2', 0xabcd
@@ -101,16 +101,16 @@
                               mod, func, code)
 
     def test_slotnames(self):
-        self.assertEquals(copyreg._slotnames(WithoutSlots), [])
-        self.assertEquals(copyreg._slotnames(WithWeakref), [])
+        self.assertEqual(copyreg._slotnames(WithoutSlots), [])
+        self.assertEqual(copyreg._slotnames(WithWeakref), [])
         expected = ['_WithPrivate__spam']
-        self.assertEquals(copyreg._slotnames(WithPrivate), expected)
-        self.assertEquals(copyreg._slotnames(WithSingleString), ['spam'])
+        self.assertEqual(copyreg._slotnames(WithPrivate), expected)
+        self.assertEqual(copyreg._slotnames(WithSingleString), ['spam'])
         expected = ['eggs', 'spam']
         expected.sort()
         result = copyreg._slotnames(WithInherited)
         result.sort()
-        self.assertEquals(result, expected)
+        self.assertEqual(result, expected)
 
 
 def test_main():

Modified: python/branches/py3k-cdecimal/Lib/test/test_decimal.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_decimal.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_decimal.py	Mon Nov 22 12:00:42 2010
@@ -1346,7 +1346,7 @@
 
         #the same hash that to an int
         self.assertEqual(hashit(Decimal(23)), hashit(23))
-        self.assertRaises(ValueError, hash, Decimal('sNaN'))
+        self.assertRaises(TypeError, hash, Decimal('sNaN'))
         self.assertTrue(hashit(Decimal('Inf')))
         self.assertTrue(hashit(Decimal('-Inf')))
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_deque.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_deque.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_deque.py	Mon Nov 22 12:00:42 2010
@@ -234,7 +234,7 @@
             d = deque(data[:i])
             r = d.reverse()
             self.assertEqual(list(d), list(reversed(data[:i])))
-            self.assert_(r is None)
+            self.assertIs(r, None)
             d.reverse()
             self.assertEqual(list(d), data[:i])
         self.assertRaises(TypeError, d.reverse, 1)          # Arity is zero

Modified: python/branches/py3k-cdecimal/Lib/test/test_descr.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_descr.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_descr.py	Mon Nov 22 12:00:42 2010
@@ -4205,11 +4205,11 @@
             __getattr__ = descr
 
         self.assertRaises(AttributeError, getattr, A(), "attr")
-        self.assertEquals(descr.counter, 1)
+        self.assertEqual(descr.counter, 1)
         self.assertRaises(AttributeError, getattr, B(), "attr")
-        self.assertEquals(descr.counter, 2)
+        self.assertEqual(descr.counter, 2)
         self.assertRaises(AttributeError, getattr, C(), "attr")
-        self.assertEquals(descr.counter, 4)
+        self.assertEqual(descr.counter, 4)
 
         import gc
         class EvilGetattribute(object):
@@ -4236,7 +4236,7 @@
         # Testing dict-proxy iterkeys...
         keys = [ key for key in self.C.__dict__.keys() ]
         keys.sort()
-        self.assertEquals(keys, ['__dict__', '__doc__', '__module__',
+        self.assertEqual(keys, ['__dict__', '__doc__', '__module__',
             '__weakref__', 'meth'])
 
     def test_iter_values(self):

Modified: python/branches/py3k-cdecimal/Lib/test/test_epoll.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_epoll.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_epoll.py	Mon Nov 22 12:00:42 2010
@@ -56,7 +56,7 @@
         try:
             client.connect(('127.0.0.1', self.serverSocket.getsockname()[1]))
         except socket.error as e:
-            self.assertEquals(e.args[0], errno.EINPROGRESS)
+            self.assertEqual(e.args[0], errno.EINPROGRESS)
         else:
             raise AssertionError("Connect should have raised EINPROGRESS")
         server, addr = self.serverSocket.accept()
@@ -162,7 +162,7 @@
                     (server.fileno(), select.EPOLLOUT)]
         expected.sort()
 
-        self.assertEquals(events, expected)
+        self.assertEqual(events, expected)
         self.assertFalse(then - now > 0.01, then - now)
 
         now = time.time()
@@ -183,7 +183,7 @@
                     (server.fileno(), select.EPOLLIN | select.EPOLLOUT)]
         expected.sort()
 
-        self.assertEquals(events, expected)
+        self.assertEqual(events, expected)
 
         ep.unregister(client.fileno())
         ep.modify(server.fileno(), select.EPOLLOUT)
@@ -193,7 +193,7 @@
         self.assertFalse(then - now > 0.01)
 
         expected = [(server.fileno(), select.EPOLLOUT)]
-        self.assertEquals(events, expected)
+        self.assertEqual(events, expected)
 
     def test_errors(self):
         self.assertRaises(ValueError, select.epoll, -2)

Modified: python/branches/py3k-cdecimal/Lib/test/test_exceptions.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_exceptions.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_exceptions.py	Mon Nov 22 12:00:42 2010
@@ -22,8 +22,8 @@
             raise exc("spam")
         except exc as err:
             buf2 = str(err)
-        self.assertEquals(buf1, buf2)
-        self.assertEquals(exc.__name__, excname)
+        self.assertEqual(buf1, buf2)
+        self.assertEqual(exc.__name__, excname)
 
     def testRaising(self):
         self.raise_catch(AttributeError, "AttributeError")
@@ -156,7 +156,7 @@
             except TypeError as err:
                 exc, err, tb = sys.exc_info()
                 co = tb.tb_frame.f_code
-                self.assertEquals(co.co_name, "test_capi1")
+                self.assertEqual(co.co_name, "test_capi1")
                 self.assertTrue(co.co_filename.endswith('test_exceptions.py'))
             else:
                 self.fail("Expected exception")
@@ -168,10 +168,10 @@
             except RuntimeError as err:
                 exc, err, tb = sys.exc_info()
                 co = tb.tb_frame.f_code
-                self.assertEquals(co.co_name, "__init__")
+                self.assertEqual(co.co_name, "__init__")
                 self.assertTrue(co.co_filename.endswith('test_exceptions.py'))
                 co2 = tb.tb_frame.f_back.f_code
-                self.assertEquals(co2.co_name, "test_capi2")
+                self.assertEqual(co2.co_name, "test_capi2")
             else:
                 self.fail("Expected exception")
 
@@ -191,10 +191,9 @@
         except NameError:
             pass
         else:
-            self.assertEqual(str(WindowsError(1001)),
-                                 "1001")
+            self.assertEqual(str(WindowsError(1001)), "1001")
             self.assertEqual(str(WindowsError(1001, "message")),
-                                 "[Error 1001] message")
+                             "[Error 1001] message")
             self.assertEqual(WindowsError(1001, "message").errno, 22)
             self.assertEqual(WindowsError(1001, "message").winerror, 1001)
 
@@ -291,16 +290,16 @@
                 raise
             else:
                 # Verify module name
-                self.assertEquals(type(e).__module__, 'builtins')
+                self.assertEqual(type(e).__module__, 'builtins')
                 # Verify no ref leaks in Exc_str()
                 s = str(e)
                 for checkArgName in expected:
                     value = getattr(e, checkArgName)
-                    self.assertEquals(repr(value),
-                                      repr(expected[checkArgName]),
-                                      '%r.%s == %r, expected %r' % (
-                                      e, checkArgName,
-                                      value, expected[checkArgName]))
+                    self.assertEqual(repr(value),
+                                     repr(expected[checkArgName]),
+                                     '%r.%s == %r, expected %r' % (
+                                     e, checkArgName,
+                                     value, expected[checkArgName]))
 
                 # test for pickling support
                 for p in [pickle]:
@@ -310,9 +309,9 @@
                         for checkArgName in expected:
                             got = repr(getattr(new, checkArgName))
                             want = repr(expected[checkArgName])
-                            self.assertEquals(got, want,
-                                              'pickled "%r", attribute "%s' %
-                                              (e, checkArgName))
+                            self.assertEqual(got, want,
+                                             'pickled "%r", attribute "%s' %
+                                             (e, checkArgName))
 
     def testWithTraceback(self):
         try:
@@ -387,7 +386,7 @@
                 self.fancy_arg = fancy_arg
 
         x = DerivedException(fancy_arg=42)
-        self.assertEquals(x.fancy_arg, 42)
+        self.assertEqual(x.fancy_arg, 42)
 
     def testInfiniteRecursion(self):
         def f():
@@ -548,24 +547,24 @@
                 yield sys.exc_info()[0]
             yield sys.exc_info()[0]
         g = yield_raise()
-        self.assertEquals(next(g), KeyError)
-        self.assertEquals(sys.exc_info()[0], None)
-        self.assertEquals(next(g), KeyError)
-        self.assertEquals(sys.exc_info()[0], None)
-        self.assertEquals(next(g), None)
+        self.assertEqual(next(g), KeyError)
+        self.assertEqual(sys.exc_info()[0], None)
+        self.assertEqual(next(g), KeyError)
+        self.assertEqual(sys.exc_info()[0], None)
+        self.assertEqual(next(g), None)
 
         # Same test, but inside an exception handler
         try:
             raise TypeError("foo")
         except TypeError:
             g = yield_raise()
-            self.assertEquals(next(g), KeyError)
-            self.assertEquals(sys.exc_info()[0], TypeError)
-            self.assertEquals(next(g), KeyError)
-            self.assertEquals(sys.exc_info()[0], TypeError)
-            self.assertEquals(next(g), TypeError)
+            self.assertEqual(next(g), KeyError)
+            self.assertEqual(sys.exc_info()[0], TypeError)
+            self.assertEqual(next(g), KeyError)
+            self.assertEqual(sys.exc_info()[0], TypeError)
+            self.assertEqual(next(g), TypeError)
             del g
-            self.assertEquals(sys.exc_info()[0], TypeError)
+            self.assertEqual(sys.exc_info()[0], TypeError)
 
     def test_generator_finalizing_and_exc_info(self):
         # See #7173
@@ -593,7 +592,7 @@
             raise Exception(MyObject())
         except:
             pass
-        self.assertEquals(e, (None, None, None))
+        self.assertEqual(e, (None, None, None))
 
     def testUnicodeChangeAttributes(self):
         # See issue 7309. This was a crasher.

Modified: python/branches/py3k-cdecimal/Lib/test/test_file.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_file.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_file.py	Mon Nov 22 12:00:42 2010
@@ -25,7 +25,7 @@
         # verify weak references
         p = proxy(self.f)
         p.write(b'teststring')
-        self.assertEquals(self.f.tell(), p.tell())
+        self.assertEqual(self.f.tell(), p.tell())
         self.f.close()
         self.f = None
         self.assertRaises(ReferenceError, getattr, p, 'tell')
@@ -44,7 +44,7 @@
         a = array('b', b'x'*10)
         self.f = self.open(TESTFN, 'rb')
         n = self.f.readinto(a)
-        self.assertEquals(b'12', a.tobytes()[:n])
+        self.assertEqual(b'12', a.tobytes()[:n])
 
     def testReadinto_text(self):
         # verify readinto refuses text files
@@ -61,7 +61,7 @@
         self.f.close()
         self.f = self.open(TESTFN, 'rb')
         buf = self.f.read()
-        self.assertEquals(buf, b'12')
+        self.assertEqual(buf, b'12')
 
     def testWritelinesIntegers(self):
         # verify writelines with integers
@@ -82,7 +82,7 @@
 
     def testErrors(self):
         f = self.f
-        self.assertEquals(f.name, TESTFN)
+        self.assertEqual(f.name, TESTFN)
         self.assertTrue(not f.isatty())
         self.assertTrue(not f.closed)
 
@@ -118,12 +118,12 @@
             self.assertRaises(ValueError, method, *args)
 
         # file is closed, __exit__ shouldn't do anything
-        self.assertEquals(self.f.__exit__(None, None, None), None)
+        self.assertEqual(self.f.__exit__(None, None, None), None)
         # it must also return None if an exception was given
         try:
             1/0
         except:
-            self.assertEquals(self.f.__exit__(*sys.exc_info()), None)
+            self.assertEqual(self.f.__exit__(*sys.exc_info()), None)
 
     def testReadWhenWriting(self):
         self.assertRaises(IOError, self.f.read)
@@ -189,7 +189,7 @@
                 f.close()
             except IOError as msg:
                 self.fail('error setting buffer size %d: %s' % (s, str(msg)))
-            self.assertEquals(d, s)
+            self.assertEqual(d, s)
 
     def testTruncateOnWindows(self):
         # SF bug <http://www.python.org/sf/801631>

Modified: python/branches/py3k-cdecimal/Lib/test/test_fileio.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_fileio.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_fileio.py	Mon Nov 22 12:00:42 2010
@@ -27,31 +27,31 @@
         # verify weak references
         p = proxy(self.f)
         p.write(bytes(range(10)))
-        self.assertEquals(self.f.tell(), p.tell())
+        self.assertEqual(self.f.tell(), p.tell())
         self.f.close()
         self.f = None
         self.assertRaises(ReferenceError, getattr, p, 'tell')
 
     def testSeekTell(self):
         self.f.write(bytes(range(20)))
-        self.assertEquals(self.f.tell(), 20)
+        self.assertEqual(self.f.tell(), 20)
         self.f.seek(0)
-        self.assertEquals(self.f.tell(), 0)
+        self.assertEqual(self.f.tell(), 0)
         self.f.seek(10)
-        self.assertEquals(self.f.tell(), 10)
+        self.assertEqual(self.f.tell(), 10)
         self.f.seek(5, 1)
-        self.assertEquals(self.f.tell(), 15)
+        self.assertEqual(self.f.tell(), 15)
         self.f.seek(-5, 1)
-        self.assertEquals(self.f.tell(), 10)
+        self.assertEqual(self.f.tell(), 10)
         self.f.seek(-5, 2)
-        self.assertEquals(self.f.tell(), 15)
+        self.assertEqual(self.f.tell(), 15)
 
     def testAttributes(self):
         # verify expected attributes exist
         f = self.f
 
-        self.assertEquals(f.mode, "wb")
-        self.assertEquals(f.closed, False)
+        self.assertEqual(f.mode, "wb")
+        self.assertEqual(f.closed, False)
 
         # verify the attributes are readonly
         for attr in 'mode', 'closed':
@@ -65,7 +65,7 @@
         a = array('b', b'x'*10)
         self.f = _FileIO(TESTFN, 'r')
         n = self.f.readinto(a)
-        self.assertEquals(array('b', [1, 2]), a[:n])
+        self.assertEqual(array('b', [1, 2]), a[:n])
 
     def test_none_args(self):
         self.f.write(b"hi\nbye\nabc")
@@ -80,19 +80,19 @@
         self.assertRaises(TypeError, self.f.write, "Hello!")
 
     def testRepr(self):
-        self.assertEquals(repr(self.f), "<_io.FileIO name=%r mode=%r>"
+        self.assertEqual(repr(self.f), "<_io.FileIO name=%r mode=%r>"
                                         % (self.f.name, self.f.mode))
         del self.f.name
-        self.assertEquals(repr(self.f), "<_io.FileIO fd=%r mode=%r>"
+        self.assertEqual(repr(self.f), "<_io.FileIO fd=%r mode=%r>"
                                         % (self.f.fileno(), self.f.mode))
         self.f.close()
-        self.assertEquals(repr(self.f), "<_io.FileIO [closed]>")
+        self.assertEqual(repr(self.f), "<_io.FileIO [closed]>")
 
     def testErrors(self):
         f = self.f
         self.assertTrue(not f.isatty())
         self.assertTrue(not f.closed)
-        #self.assertEquals(f.name, TESTFN)
+        #self.assertEqual(f.name, TESTFN)
         self.assertRaises(ValueError, f.read, 10) # Open for reading
         f.close()
         self.assertTrue(f.closed)
@@ -233,22 +233,22 @@
     def testAbles(self):
         try:
             f = _FileIO(TESTFN, "w")
-            self.assertEquals(f.readable(), False)
-            self.assertEquals(f.writable(), True)
-            self.assertEquals(f.seekable(), True)
+            self.assertEqual(f.readable(), False)
+            self.assertEqual(f.writable(), True)
+            self.assertEqual(f.seekable(), True)
             f.close()
 
             f = _FileIO(TESTFN, "r")
-            self.assertEquals(f.readable(), True)
-            self.assertEquals(f.writable(), False)
-            self.assertEquals(f.seekable(), True)
+            self.assertEqual(f.readable(), True)
+            self.assertEqual(f.writable(), False)
+            self.assertEqual(f.seekable(), True)
             f.close()
 
             f = _FileIO(TESTFN, "a+")
-            self.assertEquals(f.readable(), True)
-            self.assertEquals(f.writable(), True)
-            self.assertEquals(f.seekable(), True)
-            self.assertEquals(f.isatty(), False)
+            self.assertEqual(f.readable(), True)
+            self.assertEqual(f.writable(), True)
+            self.assertEqual(f.seekable(), True)
+            self.assertEqual(f.isatty(), False)
             f.close()
 
             if sys.platform != "win32":
@@ -260,14 +260,14 @@
                     # OS'es that don't support /dev/tty.
                     pass
                 else:
-                    self.assertEquals(f.readable(), False)
-                    self.assertEquals(f.writable(), True)
+                    self.assertEqual(f.readable(), False)
+                    self.assertEqual(f.writable(), True)
                     if sys.platform != "darwin" and \
                        'bsd' not in sys.platform and \
                        not sys.platform.startswith('sunos'):
                         # Somehow /dev/tty appears seekable on some BSDs
-                        self.assertEquals(f.seekable(), False)
-                    self.assertEquals(f.isatty(), True)
+                        self.assertEqual(f.seekable(), False)
+                    self.assertEqual(f.isatty(), True)
                     f.close()
         finally:
             os.unlink(TESTFN)
@@ -301,7 +301,7 @@
             f.write(b"abc")
             f.close()
             with open(TESTFN, "rb") as f:
-                self.assertEquals(f.read(), b"abc")
+                self.assertEqual(f.read(), b"abc")
         finally:
             os.unlink(TESTFN)
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_float.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_float.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_float.py	Mon Nov 22 12:00:42 2010
@@ -554,9 +554,9 @@
                 self.assertEqual(fmt % -float(arg), '-' + rhs)
 
     def test_issue5864(self):
-        self.assertEquals(format(123.456, '.4'), '123.5')
-        self.assertEquals(format(1234.56, '.4'), '1.235e+03')
-        self.assertEquals(format(12345.6, '.4'), '1.235e+04')
+        self.assertEqual(format(123.456, '.4'), '123.5')
+        self.assertEqual(format(1234.56, '.4'), '1.235e+03')
+        self.assertEqual(format(12345.6, '.4'), '1.235e+04')
 
 class ReprTestCase(unittest.TestCase):
     def test_repr(self):

Modified: python/branches/py3k-cdecimal/Lib/test/test_fractions.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_fractions.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_fractions.py	Mon Nov 22 12:00:42 2010
@@ -84,16 +84,16 @@
 class GcdTest(unittest.TestCase):
 
     def testMisc(self):
-        self.assertEquals(0, gcd(0, 0))
-        self.assertEquals(1, gcd(1, 0))
-        self.assertEquals(-1, gcd(-1, 0))
-        self.assertEquals(1, gcd(0, 1))
-        self.assertEquals(-1, gcd(0, -1))
-        self.assertEquals(1, gcd(7, 1))
-        self.assertEquals(-1, gcd(7, -1))
-        self.assertEquals(1, gcd(-23, 15))
-        self.assertEquals(12, gcd(120, 84))
-        self.assertEquals(-12, gcd(84, -120))
+        self.assertEqual(0, gcd(0, 0))
+        self.assertEqual(1, gcd(1, 0))
+        self.assertEqual(-1, gcd(-1, 0))
+        self.assertEqual(1, gcd(0, 1))
+        self.assertEqual(-1, gcd(0, -1))
+        self.assertEqual(1, gcd(7, 1))
+        self.assertEqual(-1, gcd(7, -1))
+        self.assertEqual(1, gcd(-23, 15))
+        self.assertEqual(12, gcd(120, 84))
+        self.assertEqual(-12, gcd(84, -120))
 
 
 def _components(r):
@@ -104,8 +104,8 @@
 
     def assertTypedEquals(self, expected, actual):
         """Asserts that both the types and values are the same."""
-        self.assertEquals(type(expected), type(actual))
-        self.assertEquals(expected, actual)
+        self.assertEqual(type(expected), type(actual))
+        self.assertEqual(expected, actual)
 
     def assertRaisesMessage(self, exc_type, message,
                             callable, *args, **kwargs):
@@ -113,25 +113,25 @@
         try:
             callable(*args, **kwargs)
         except exc_type as e:
-            self.assertEquals(message, str(e))
+            self.assertEqual(message, str(e))
         else:
             self.fail("%s not raised" % exc_type.__name__)
 
     def testInit(self):
-        self.assertEquals((0, 1), _components(F()))
-        self.assertEquals((7, 1), _components(F(7)))
-        self.assertEquals((7, 3), _components(F(F(7, 3))))
-
-        self.assertEquals((-1, 1), _components(F(-1, 1)))
-        self.assertEquals((-1, 1), _components(F(1, -1)))
-        self.assertEquals((1, 1), _components(F(-2, -2)))
-        self.assertEquals((1, 2), _components(F(5, 10)))
-        self.assertEquals((7, 15), _components(F(7, 15)))
-        self.assertEquals((10**23, 1), _components(F(10**23)))
-
-        self.assertEquals((3, 77), _components(F(F(3, 7), 11)))
-        self.assertEquals((-9, 5), _components(F(2, F(-10, 9))))
-        self.assertEquals((2486, 2485), _components(F(F(22, 7), F(355, 113))))
+        self.assertEqual((0, 1), _components(F()))
+        self.assertEqual((7, 1), _components(F(7)))
+        self.assertEqual((7, 3), _components(F(F(7, 3))))
+
+        self.assertEqual((-1, 1), _components(F(-1, 1)))
+        self.assertEqual((-1, 1), _components(F(1, -1)))
+        self.assertEqual((1, 1), _components(F(-2, -2)))
+        self.assertEqual((1, 2), _components(F(5, 10)))
+        self.assertEqual((7, 15), _components(F(7, 15)))
+        self.assertEqual((10**23, 1), _components(F(10**23)))
+
+        self.assertEqual((3, 77), _components(F(F(3, 7), 11)))
+        self.assertEqual((-9, 5), _components(F(2, F(-10, 9))))
+        self.assertEqual((2486, 2485), _components(F(F(22, 7), F(355, 113))))
 
         self.assertRaisesMessage(ZeroDivisionError, "Fraction(12, 0)",
                                  F, 12, 0)
@@ -143,41 +143,41 @@
 
     @requires_IEEE_754
     def testInitFromFloat(self):
-        self.assertEquals((5, 2), _components(F(2.5)))
-        self.assertEquals((0, 1), _components(F(-0.0)))
-        self.assertEquals((3602879701896397, 36028797018963968),
-                          _components(F(0.1)))
+        self.assertEqual((5, 2), _components(F(2.5)))
+        self.assertEqual((0, 1), _components(F(-0.0)))
+        self.assertEqual((3602879701896397, 36028797018963968),
+                         _components(F(0.1)))
         self.assertRaises(TypeError, F, float('nan'))
         self.assertRaises(TypeError, F, float('inf'))
         self.assertRaises(TypeError, F, float('-inf'))
 
     def testInitFromDecimal(self):
-        self.assertEquals((11, 10),
-                          _components(F(Decimal('1.1'))))
-        self.assertEquals((7, 200),
-                          _components(F(Decimal('3.5e-2'))))
-        self.assertEquals((0, 1),
-                          _components(F(Decimal('.000e20'))))
+        self.assertEqual((11, 10),
+                         _components(F(Decimal('1.1'))))
+        self.assertEqual((7, 200),
+                         _components(F(Decimal('3.5e-2'))))
+        self.assertEqual((0, 1),
+                         _components(F(Decimal('.000e20'))))
         self.assertRaises(TypeError, F, Decimal('nan'))
         self.assertRaises(TypeError, F, Decimal('snan'))
         self.assertRaises(TypeError, F, Decimal('inf'))
         self.assertRaises(TypeError, F, Decimal('-inf'))
 
     def testFromString(self):
-        self.assertEquals((5, 1), _components(F("5")))
-        self.assertEquals((3, 2), _components(F("3/2")))
-        self.assertEquals((3, 2), _components(F(" \n  +3/2")))
-        self.assertEquals((-3, 2), _components(F("-3/2  ")))
-        self.assertEquals((13, 2), _components(F("    013/02 \n  ")))
-        self.assertEquals((16, 5), _components(F(" 3.2 ")))
-        self.assertEquals((-16, 5), _components(F(" -3.2 ")))
-        self.assertEquals((-3, 1), _components(F(" -3. ")))
-        self.assertEquals((3, 5), _components(F(" .6 ")))
-        self.assertEquals((1, 3125), _components(F("32.e-5")))
-        self.assertEquals((1000000, 1), _components(F("1E+06")))
-        self.assertEquals((-12300, 1), _components(F("-1.23e4")))
-        self.assertEquals((0, 1), _components(F(" .0e+0\t")))
-        self.assertEquals((0, 1), _components(F("-0.000e0")))
+        self.assertEqual((5, 1), _components(F("5")))
+        self.assertEqual((3, 2), _components(F("3/2")))
+        self.assertEqual((3, 2), _components(F(" \n  +3/2")))
+        self.assertEqual((-3, 2), _components(F("-3/2  ")))
+        self.assertEqual((13, 2), _components(F("    013/02 \n  ")))
+        self.assertEqual((16, 5), _components(F(" 3.2 ")))
+        self.assertEqual((-16, 5), _components(F(" -3.2 ")))
+        self.assertEqual((-3, 1), _components(F(" -3. ")))
+        self.assertEqual((3, 5), _components(F(" .6 ")))
+        self.assertEqual((1, 3125), _components(F("32.e-5")))
+        self.assertEqual((1000000, 1), _components(F("1E+06")))
+        self.assertEqual((-12300, 1), _components(F("-1.23e4")))
+        self.assertEqual((0, 1), _components(F(" .0e+0\t")))
+        self.assertEqual((0, 1), _components(F("-0.000e0")))
 
         self.assertRaisesMessage(
             ZeroDivisionError, "Fraction(3, 0)",
@@ -219,33 +219,33 @@
     def testImmutable(self):
         r = F(7, 3)
         r.__init__(2, 15)
-        self.assertEquals((7, 3), _components(r))
+        self.assertEqual((7, 3), _components(r))
 
         self.assertRaises(AttributeError, setattr, r, 'numerator', 12)
         self.assertRaises(AttributeError, setattr, r, 'denominator', 6)
-        self.assertEquals((7, 3), _components(r))
+        self.assertEqual((7, 3), _components(r))
 
         # But if you _really_ need to:
         r._numerator = 4
         r._denominator = 2
-        self.assertEquals((4, 2), _components(r))
+        self.assertEqual((4, 2), _components(r))
         # Which breaks some important operations:
-        self.assertNotEquals(F(4, 2), r)
+        self.assertNotEqual(F(4, 2), r)
 
     def testFromFloat(self):
         self.assertRaises(TypeError, F.from_float, 3+4j)
-        self.assertEquals((10, 1), _components(F.from_float(10)))
+        self.assertEqual((10, 1), _components(F.from_float(10)))
         bigint = 1234567890123456789
-        self.assertEquals((bigint, 1), _components(F.from_float(bigint)))
-        self.assertEquals((0, 1), _components(F.from_float(-0.0)))
-        self.assertEquals((10, 1), _components(F.from_float(10.0)))
-        self.assertEquals((-5, 2), _components(F.from_float(-2.5)))
-        self.assertEquals((99999999999999991611392, 1),
-                          _components(F.from_float(1e23)))
-        self.assertEquals(float(10**23), float(F.from_float(1e23)))
-        self.assertEquals((3602879701896397, 1125899906842624),
-                          _components(F.from_float(3.2)))
-        self.assertEquals(3.2, float(F.from_float(3.2)))
+        self.assertEqual((bigint, 1), _components(F.from_float(bigint)))
+        self.assertEqual((0, 1), _components(F.from_float(-0.0)))
+        self.assertEqual((10, 1), _components(F.from_float(10.0)))
+        self.assertEqual((-5, 2), _components(F.from_float(-2.5)))
+        self.assertEqual((99999999999999991611392, 1),
+                         _components(F.from_float(1e23)))
+        self.assertEqual(float(10**23), float(F.from_float(1e23)))
+        self.assertEqual((3602879701896397, 1125899906842624),
+                         _components(F.from_float(3.2)))
+        self.assertEqual(3.2, float(F.from_float(3.2)))
 
         inf = 1e1000
         nan = inf - inf
@@ -261,13 +261,13 @@
 
     def testFromDecimal(self):
         self.assertRaises(TypeError, F.from_decimal, 3+4j)
-        self.assertEquals(F(10, 1), F.from_decimal(10))
-        self.assertEquals(F(0), F.from_decimal(Decimal("-0")))
-        self.assertEquals(F(5, 10), F.from_decimal(Decimal("0.5")))
-        self.assertEquals(F(5, 1000), F.from_decimal(Decimal("5e-3")))
-        self.assertEquals(F(5000), F.from_decimal(Decimal("5e3")))
-        self.assertEquals(1 - F(1, 10**30),
-                          F.from_decimal(Decimal("0." + "9" * 30)))
+        self.assertEqual(F(10, 1), F.from_decimal(10))
+        self.assertEqual(F(0), F.from_decimal(Decimal("-0")))
+        self.assertEqual(F(5, 10), F.from_decimal(Decimal("0.5")))
+        self.assertEqual(F(5, 1000), F.from_decimal(Decimal("5e-3")))
+        self.assertEqual(F(5000), F.from_decimal(Decimal("5e3")))
+        self.assertEqual(1 - F(1, 10**30),
+                         F.from_decimal(Decimal("0." + "9" * 30)))
 
         self.assertRaisesMessage(
             TypeError, "Cannot convert Infinity to Fraction.",
@@ -303,15 +303,15 @@
         self.assertTypedEquals(-2, round(F(-15, 10)))
         self.assertTypedEquals(-1, round(F(-7, 10)))
 
-        self.assertEquals(False, bool(F(0, 1)))
-        self.assertEquals(True, bool(F(3, 2)))
+        self.assertEqual(False, bool(F(0, 1)))
+        self.assertEqual(True, bool(F(3, 2)))
         self.assertTypedEquals(0.1, float(F(1, 10)))
 
         # Check that __float__ isn't implemented by converting the
         # numerator and denominator to float before dividing.
         self.assertRaises(OverflowError, float, int('2'*400+'7'))
-        self.assertAlmostEquals(2.0/3,
-                                float(F(int('2'*400+'7'), int('3'*400+'1'))))
+        self.assertAlmostEqual(2.0/3,
+                               float(F(int('2'*400+'7'), int('3'*400+'1'))))
 
         self.assertTypedEquals(0.1+0j, complex(F(1,10)))
 
@@ -324,19 +324,19 @@
 
 
     def testArithmetic(self):
-        self.assertEquals(F(1, 2), F(1, 10) + F(2, 5))
-        self.assertEquals(F(-3, 10), F(1, 10) - F(2, 5))
-        self.assertEquals(F(1, 25), F(1, 10) * F(2, 5))
-        self.assertEquals(F(1, 4), F(1, 10) / F(2, 5))
+        self.assertEqual(F(1, 2), F(1, 10) + F(2, 5))
+        self.assertEqual(F(-3, 10), F(1, 10) - F(2, 5))
+        self.assertEqual(F(1, 25), F(1, 10) * F(2, 5))
+        self.assertEqual(F(1, 4), F(1, 10) / F(2, 5))
         self.assertTypedEquals(2, F(9, 10) // F(2, 5))
         self.assertTypedEquals(10**23, F(10**23, 1) // F(1))
-        self.assertEquals(F(2, 3), F(-7, 3) % F(3, 2))
-        self.assertEquals(F(8, 27), F(2, 3) ** F(3))
-        self.assertEquals(F(27, 8), F(2, 3) ** F(-3))
+        self.assertEqual(F(2, 3), F(-7, 3) % F(3, 2))
+        self.assertEqual(F(8, 27), F(2, 3) ** F(3))
+        self.assertEqual(F(27, 8), F(2, 3) ** F(-3))
         self.assertTypedEquals(2.0, F(4) ** F(1, 2))
         z = pow(F(-1), F(1, 2))
-        self.assertAlmostEquals(z.real, 0)
-        self.assertEquals(z.imag, 1)
+        self.assertAlmostEqual(z.real, 0)
+        self.assertEqual(z.imag, 1)
 
     def testMixedArithmetic(self):
         self.assertTypedEquals(F(11, 10), F(1, 10) + 1)
@@ -387,8 +387,8 @@
         self.assertTypedEquals(0.1 + 0j, F(1, 10) ** (1.0 + 0j))
         self.assertTypedEquals(4 , 2 ** F(2, 1))
         z = pow(-1, F(1, 2))
-        self.assertAlmostEquals(0, z.real)
-        self.assertEquals(1, z.imag)
+        self.assertAlmostEqual(0, z.real)
+        self.assertEqual(1, z.imag)
         self.assertTypedEquals(F(1, 4) , 2 ** F(-2, 1))
         self.assertTypedEquals(2.0 , 4 ** F(1, 2))
         self.assertTypedEquals(0.25, 2.0 ** F(-2, 1))
@@ -534,21 +534,21 @@
         self.assertFalse(float('-inf') == F(2, 5))
 
     def testStringification(self):
-        self.assertEquals("Fraction(7, 3)", repr(F(7, 3)))
-        self.assertEquals("Fraction(6283185307, 2000000000)",
-                          repr(F('3.1415926535')))
-        self.assertEquals("Fraction(-1, 100000000000000000000)",
-                          repr(F(1, -10**20)))
-        self.assertEquals("7/3", str(F(7, 3)))
-        self.assertEquals("7", str(F(7, 1)))
+        self.assertEqual("Fraction(7, 3)", repr(F(7, 3)))
+        self.assertEqual("Fraction(6283185307, 2000000000)",
+                         repr(F('3.1415926535')))
+        self.assertEqual("Fraction(-1, 100000000000000000000)",
+                         repr(F(1, -10**20)))
+        self.assertEqual("7/3", str(F(7, 3)))
+        self.assertEqual("7", str(F(7, 1)))
 
     def testHash(self):
-        self.assertEquals(hash(2.5), hash(F(5, 2)))
-        self.assertEquals(hash(10**50), hash(F(10**50)))
-        self.assertNotEquals(hash(float(10**23)), hash(F(10**23)))
+        self.assertEqual(hash(2.5), hash(F(5, 2)))
+        self.assertEqual(hash(10**50), hash(F(10**50)))
+        self.assertNotEqual(hash(float(10**23)), hash(F(10**23)))
         # Check that __hash__ produces the same value as hash(), for
         # consistency with int and Decimal.  (See issue #10356.)
-        self.assertEquals(hash(F(-1)), F(-1).__hash__())
+        self.assertEqual(hash(F(-1)), F(-1).__hash__())
 
     def testApproximatePi(self):
         # Algorithm borrowed from
@@ -561,7 +561,7 @@
             d, da = d+da, da+32
             t = (t * n) / d
             s += t
-        self.assertAlmostEquals(math.pi, s)
+        self.assertAlmostEqual(math.pi, s)
 
     def testApproximateCos1(self):
         # Algorithm borrowed from
@@ -575,7 +575,7 @@
             num *= x * x
             sign *= -1
             s += num / fact * sign
-        self.assertAlmostEquals(math.cos(1), s)
+        self.assertAlmostEqual(math.cos(1), s)
 
     def test_copy_deepcopy_pickle(self):
         r = F(13, 7)

Modified: python/branches/py3k-cdecimal/Lib/test/test_frozen.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_frozen.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_frozen.py	Mon Nov 22 12:00:42 2010
@@ -22,7 +22,7 @@
             self.assertEqual(len(dir(__phello__)), 8, dir(__phello__))
         else:
             self.assertEqual(len(dir(__phello__)), 9, dir(__phello__))
-        self.assertEquals(__phello__.__path__, [__phello__.__name__])
+        self.assertEqual(__phello__.__path__, [__phello__.__name__])
 
         try:
             import __phello__.spam

Modified: python/branches/py3k-cdecimal/Lib/test/test_functools.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_functools.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_functools.py	Mon Nov 22 12:00:42 2010
@@ -428,12 +428,12 @@
                 self.value = value
             def __lt__(self, other):
                 return self.value < other.value
-        self.assert_(A(1) < A(2))
-        self.assert_(A(2) > A(1))
-        self.assert_(A(1) <= A(2))
-        self.assert_(A(2) >= A(1))
-        self.assert_(A(2) <= A(2))
-        self.assert_(A(2) >= A(2))
+        self.assertTrue(A(1) < A(2))
+        self.assertTrue(A(2) > A(1))
+        self.assertTrue(A(1) <= A(2))
+        self.assertTrue(A(2) >= A(1))
+        self.assertTrue(A(2) <= A(2))
+        self.assertTrue(A(2) >= A(2))
 
     def test_total_ordering_le(self):
         @functools.total_ordering
@@ -442,12 +442,12 @@
                 self.value = value
             def __le__(self, other):
                 return self.value <= other.value
-        self.assert_(A(1) < A(2))
-        self.assert_(A(2) > A(1))
-        self.assert_(A(1) <= A(2))
-        self.assert_(A(2) >= A(1))
-        self.assert_(A(2) <= A(2))
-        self.assert_(A(2) >= A(2))
+        self.assertTrue(A(1) < A(2))
+        self.assertTrue(A(2) > A(1))
+        self.assertTrue(A(1) <= A(2))
+        self.assertTrue(A(2) >= A(1))
+        self.assertTrue(A(2) <= A(2))
+        self.assertTrue(A(2) >= A(2))
 
     def test_total_ordering_gt(self):
         @functools.total_ordering
@@ -456,12 +456,12 @@
                 self.value = value
             def __gt__(self, other):
                 return self.value > other.value
-        self.assert_(A(1) < A(2))
-        self.assert_(A(2) > A(1))
-        self.assert_(A(1) <= A(2))
-        self.assert_(A(2) >= A(1))
-        self.assert_(A(2) <= A(2))
-        self.assert_(A(2) >= A(2))
+        self.assertTrue(A(1) < A(2))
+        self.assertTrue(A(2) > A(1))
+        self.assertTrue(A(1) <= A(2))
+        self.assertTrue(A(2) >= A(1))
+        self.assertTrue(A(2) <= A(2))
+        self.assertTrue(A(2) >= A(2))
 
     def test_total_ordering_ge(self):
         @functools.total_ordering
@@ -470,24 +470,24 @@
                 self.value = value
             def __ge__(self, other):
                 return self.value >= other.value
-        self.assert_(A(1) < A(2))
-        self.assert_(A(2) > A(1))
-        self.assert_(A(1) <= A(2))
-        self.assert_(A(2) >= A(1))
-        self.assert_(A(2) <= A(2))
-        self.assert_(A(2) >= A(2))
+        self.assertTrue(A(1) < A(2))
+        self.assertTrue(A(2) > A(1))
+        self.assertTrue(A(1) <= A(2))
+        self.assertTrue(A(2) >= A(1))
+        self.assertTrue(A(2) <= A(2))
+        self.assertTrue(A(2) >= A(2))
 
     def test_total_ordering_no_overwrite(self):
         # new methods should not overwrite existing
         @functools.total_ordering
         class A(int):
             pass
-        self.assert_(A(1) < A(2))
-        self.assert_(A(2) > A(1))
-        self.assert_(A(1) <= A(2))
-        self.assert_(A(2) >= A(1))
-        self.assert_(A(2) <= A(2))
-        self.assert_(A(2) >= A(2))
+        self.assertTrue(A(1) < A(2))
+        self.assertTrue(A(2) > A(1))
+        self.assertTrue(A(1) <= A(2))
+        self.assertTrue(A(2) >= A(1))
+        self.assertTrue(A(2) <= A(2))
+        self.assertTrue(A(2) >= A(2))
 
     def test_no_operations_defined(self):
         with self.assertRaises(ValueError):
@@ -507,9 +507,9 @@
             x, y = choice(domain), choice(domain)
             actual = f(x, y)
             expected = orig(x, y)
-            self.assertEquals(actual, expected)
-        self.assert_(f.cache_hits > f.cache_misses)
-        self.assertEquals(f.cache_hits + f.cache_misses, 1000)
+            self.assertEqual(actual, expected)
+        self.assertTrue(f.cache_hits > f.cache_misses)
+        self.assertEqual(f.cache_hits + f.cache_misses, 1000)
 
         f.cache_clear()   # test clearing
         self.assertEqual(f.cache_hits, 0)

Modified: python/branches/py3k-cdecimal/Lib/test/test_gdb.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_gdb.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_gdb.py	Mon Nov 22 12:00:42 2010
@@ -129,7 +129,7 @@
                           '')
 
         # Ensure no unexpected error messages:
-        self.assertEquals(err, '')
+        self.assertEqual(err, '')
 
         return out
 
@@ -159,8 +159,8 @@
 
     def assertEndsWith(self, actual, exp_end):
         '''Ensure that the given "actual" string ends with "exp_end"'''
-        self.assert_(actual.endswith(exp_end),
-                     msg='%r did not end with %r' % (actual, exp_end))
+        self.assertTrue(actual.endswith(exp_end),
+                        msg='%r did not end with %r' % (actual, exp_end))
 
     def assertMultilineMatches(self, actual, pattern):
         m = re.match(pattern, actual, re.DOTALL)
@@ -182,9 +182,9 @@
                                                  cmds_after_breakpoint)
         if not exp_repr:
             exp_repr = repr(val)
-        self.assertEquals(gdb_repr, exp_repr,
-                          ('%r did not equal expected %r; full output was:\n%s'
-                           % (gdb_repr, exp_repr, gdb_output)))
+        self.assertEqual(gdb_repr, exp_repr,
+                         ('%r did not equal expected %r; full output was:\n%s'
+                          % (gdb_repr, exp_repr, gdb_output)))
 
     def test_int(self):
         'Verify the pretty-printing of various "int"/long values'
@@ -274,7 +274,7 @@
         gdb_repr, gdb_output = self.get_gdb_repr('''s = set(['a','b'])
 s.pop()
 id(s)''')
-        self.assertEquals(gdb_repr, "{'b'}")
+        self.assertEqual(gdb_repr, "{'b'}")
 
     def test_frozensets(self):
         'Verify the pretty-printing of frozensets'
@@ -290,8 +290,8 @@
 except RuntimeError as e:
     id(e)
 ''')
-        self.assertEquals(gdb_repr,
-                          "RuntimeError('I am an error',)")
+        self.assertEqual(gdb_repr,
+                         "RuntimeError('I am an error',)")
 
 
         # Test division by zero:
@@ -301,8 +301,8 @@
 except ZeroDivisionError as e:
     id(e)
 ''')
-        self.assertEquals(gdb_repr,
-                          "ZeroDivisionError('division by zero',)")
+        self.assertEqual(gdb_repr,
+                         "ZeroDivisionError('division by zero',)")
 
     def test_modern_class(self):
         'Verify the pretty-printing of new-style class instances'
@@ -382,7 +382,7 @@
                                                      'backtrace'])
             )
 
-        self.assertEquals(gdb_repr, '0x0')
+        self.assertEqual(gdb_repr, '0x0')
 
     def test_NULL_ob_type(self):
         'Ensure that a PyObject* with NULL ob_type is handled gracefully'
@@ -422,11 +422,11 @@
         into an infinite loop:'''
         gdb_repr, gdb_output = \
             self.get_gdb_repr("a = [3, 4, 5] ; a.append(a) ; id(a)")
-        self.assertEquals(gdb_repr, '[3, 4, 5, [...]]')
+        self.assertEqual(gdb_repr, '[3, 4, 5, [...]]')
 
         gdb_repr, gdb_output = \
             self.get_gdb_repr("a = [3, 4, 5] ; b = [a] ; a.append(b) ; id(a)")
-        self.assertEquals(gdb_repr, '[3, 4, 5, [[...]]]')
+        self.assertEqual(gdb_repr, '[3, 4, 5, [[...]]]')
 
     def test_selfreferential_dict(self):
         '''Ensure that a reference loop involving a dict doesn't lead proxyval
@@ -434,7 +434,7 @@
         gdb_repr, gdb_output = \
             self.get_gdb_repr("a = {} ; b = {'bar':a} ; a['foo'] = b ; id(a)")
 
-        self.assertEquals(gdb_repr, "{'foo': {'bar': {...}}}")
+        self.assertEqual(gdb_repr, "{'foo': {'bar': {...}}}")
 
     def test_selfreferential_old_style_instance(self):
         gdb_repr, gdb_output = \
@@ -479,30 +479,30 @@
     def test_truncation(self):
         'Verify that very long output is truncated'
         gdb_repr, gdb_output = self.get_gdb_repr('id(list(range(1000)))')
-        self.assertEquals(gdb_repr,
-                          "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, "
-                          "14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, "
-                          "27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, "
-                          "40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, "
-                          "53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, "
-                          "66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, "
-                          "79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, "
-                          "92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, "
-                          "104, 105, 106, 107, 108, 109, 110, 111, 112, 113, "
-                          "114, 115, 116, 117, 118, 119, 120, 121, 122, 123, "
-                          "124, 125, 126, 127, 128, 129, 130, 131, 132, 133, "
-                          "134, 135, 136, 137, 138, 139, 140, 141, 142, 143, "
-                          "144, 145, 146, 147, 148, 149, 150, 151, 152, 153, "
-                          "154, 155, 156, 157, 158, 159, 160, 161, 162, 163, "
-                          "164, 165, 166, 167, 168, 169, 170, 171, 172, 173, "
-                          "174, 175, 176, 177, 178, 179, 180, 181, 182, 183, "
-                          "184, 185, 186, 187, 188, 189, 190, 191, 192, 193, "
-                          "194, 195, 196, 197, 198, 199, 200, 201, 202, 203, "
-                          "204, 205, 206, 207, 208, 209, 210, 211, 212, 213, "
-                          "214, 215, 216, 217, 218, 219, 220, 221, 222, 223, "
-                          "224, 225, 226...(truncated)")
-        self.assertEquals(len(gdb_repr),
-                          1024 + len('...(truncated)'))
+        self.assertEqual(gdb_repr,
+                         "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, "
+                         "14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, "
+                         "27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, "
+                         "40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, "
+                         "53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, "
+                         "66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, "
+                         "79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, "
+                         "92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, "
+                         "104, 105, 106, 107, 108, 109, 110, 111, 112, 113, "
+                         "114, 115, 116, 117, 118, 119, 120, 121, 122, 123, "
+                         "124, 125, 126, 127, 128, 129, 130, 131, 132, 133, "
+                         "134, 135, 136, 137, 138, 139, 140, 141, 142, 143, "
+                         "144, 145, 146, 147, 148, 149, 150, 151, 152, 153, "
+                         "154, 155, 156, 157, 158, 159, 160, 161, 162, 163, "
+                         "164, 165, 166, 167, 168, 169, 170, 171, 172, 173, "
+                         "174, 175, 176, 177, 178, 179, 180, 181, 182, 183, "
+                         "184, 185, 186, 187, 188, 189, 190, 191, 192, 193, "
+                         "194, 195, 196, 197, 198, 199, 200, 201, 202, 203, "
+                         "204, 205, 206, 207, 208, 209, 210, 211, 212, 213, "
+                         "214, 215, 216, 217, 218, 219, 220, 221, 222, 223, "
+                         "224, 225, 226...(truncated)")
+        self.assertEqual(len(gdb_repr),
+                         1024 + len('...(truncated)'))
 
     def test_builtin_method(self):
         gdb_repr, gdb_output = self.get_gdb_repr('import sys; id(sys.stdout.readlines)')

Modified: python/branches/py3k-cdecimal/Lib/test/test_getargs2.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_getargs2.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_getargs2.py	Mon Nov 22 12:00:42 2010
@@ -220,7 +220,7 @@
         from _testcapi import getargs_tuple
 
         ret = getargs_tuple(1, (2, 3))
-        self.assertEquals(ret, (1,2,3))
+        self.assertEqual(ret, (1,2,3))
 
         # make sure invalid tuple arguments are handled correctly
         class seq:
@@ -233,28 +233,28 @@
 class Keywords_TestCase(unittest.TestCase):
     def test_positional_args(self):
         # using all positional args
-        self.assertEquals(
+        self.assertEqual(
             getargs_keywords((1,2), 3, (4,(5,6)), (7,8,9), 10),
             (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
             )
 
     def test_mixed_args(self):
         # positional and keyword args
-        self.assertEquals(
+        self.assertEqual(
             getargs_keywords((1,2), 3, (4,(5,6)), arg4=(7,8,9), arg5=10),
             (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
             )
 
     def test_keyword_args(self):
         # all keywords
-        self.assertEquals(
+        self.assertEqual(
             getargs_keywords(arg1=(1,2), arg2=3, arg3=(4,(5,6)), arg4=(7,8,9), arg5=10),
             (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
             )
 
     def test_optional_args(self):
         # missing optional keyword args, skipping tuples
-        self.assertEquals(
+        self.assertEqual(
             getargs_keywords(arg1=(1,2), arg2=3, arg5=10),
             (1, 2, 3, -1, -1, -1, -1, -1, -1, 10)
             )
@@ -264,7 +264,7 @@
         try:
             getargs_keywords(arg1=(1,2))
         except TypeError as err:
-            self.assertEquals(str(err), "Required argument 'arg2' (pos 2) not found")
+            self.assertEqual(str(err), "Required argument 'arg2' (pos 2) not found")
         else:
             self.fail('TypeError should have been raised')
 
@@ -272,7 +272,7 @@
         try:
             getargs_keywords((1,2),3,(4,(5,6)),(7,8,9),10,111)
         except TypeError as err:
-            self.assertEquals(str(err), "function takes at most 5 arguments (6 given)")
+            self.assertEqual(str(err), "function takes at most 5 arguments (6 given)")
         else:
             self.fail('TypeError should have been raised')
 
@@ -281,7 +281,7 @@
         try:
             getargs_keywords((1,2),3,arg5=10,arg666=666)
         except TypeError as err:
-            self.assertEquals(str(err), "'arg666' is an invalid keyword argument for this function")
+            self.assertEqual(str(err), "'arg666' is an invalid keyword argument for this function")
         else:
             self.fail('TypeError should have been raised')
 
@@ -289,7 +289,7 @@
         try:
             getargs_keywords((1,2), 3, (4,(5,6)), (7,8,9), **{'\uDC80': 10})
         except TypeError as err:
-            self.assertEquals(str(err), "'\udc80' is an invalid keyword argument for this function")
+            self.assertEqual(str(err), "'\udc80' is an invalid keyword argument for this function")
         else:
             self.fail('TypeError should have been raised')
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_getopt.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_getopt.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_getopt.py	Mon Nov 22 12:00:42 2010
@@ -175,9 +175,9 @@
 
     def test_issue4629(self):
         longopts, shortopts = getopt.getopt(['--help='], '', ['help='])
-        self.assertEquals(longopts, [('--help', '')])
+        self.assertEqual(longopts, [('--help', '')])
         longopts, shortopts = getopt.getopt(['--help=x'], '', ['help='])
-        self.assertEquals(longopts, [('--help', 'x')])
+        self.assertEqual(longopts, [('--help', 'x')])
         self.assertRaises(getopt.GetoptError, getopt.getopt, ['--help='], '', ['help'])
 
 def test_main():

Modified: python/branches/py3k-cdecimal/Lib/test/test_glob.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_glob.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_glob.py	Mon Nov 22 12:00:42 2010
@@ -59,8 +59,8 @@
         if set(type(x) for x in tmp) == uniset:
             u1 = glob.glob('*')
             u2 = glob.glob('./*')
-            self.assertEquals(set(type(r) for r in u1), uniset)
-            self.assertEquals(set(type(r) for r in u2), uniset)
+            self.assertEqual(set(type(r) for r in u1), uniset)
+            self.assertEqual(set(type(r) for r in u2), uniset)
 
     def test_glob_one_directory(self):
         eq = self.assertSequencesEqual_noorder

Modified: python/branches/py3k-cdecimal/Lib/test/test_gzip.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_gzip.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_gzip.py	Mon Nov 22 12:00:42 2010
@@ -113,7 +113,7 @@
                 ztxt = zgfile.read(8192)
                 contents += ztxt
                 if not ztxt: break
-        self.assertEquals(contents, b'a'*201)
+        self.assertEqual(contents, b'a'*201)
 
     def test_buffered_reader(self):
         # Issue #7471: a GzipFile can be wrapped in a BufferedReader for
@@ -177,7 +177,7 @@
             f.read(10)
             f.seek(10, whence=1)
             y = f.read(10)
-        self.assertEquals(y, data1[20:30])
+        self.assertEqual(y, data1[20:30])
 
     def test_seek_write(self):
         # Try seek, write test
@@ -197,6 +197,12 @@
                 self.assertTrue(hasattr(f, "name"))
                 self.assertEqual(f.name, self.filename)
 
+    def test_paddedfile_getattr(self):
+        self.test_write()
+        with gzip.GzipFile(self.filename, 'rb') as f:
+            self.assertTrue(hasattr(f.fileobj, "name"))
+            self.assertEqual(f.fileobj.name, self.filename)
+
     def test_mtime(self):
         mtime = 123456789
         with gzip.GzipFile(self.filename, 'w', mtime = mtime) as fWrite:

Modified: python/branches/py3k-cdecimal/Lib/test/test_hashlib.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_hashlib.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_hashlib.py	Mon Nov 22 12:00:42 2010
@@ -310,10 +310,10 @@
         m.update(b'1')
         m.update(b'#' * gil_minsize)
         m.update(b'1')
-        self.assertEquals(m.hexdigest(), 'cb1e1a2cbc80be75e19935d621fb9b21')
+        self.assertEqual(m.hexdigest(), 'cb1e1a2cbc80be75e19935d621fb9b21')
 
         m = hashlib.md5(b'x' * gil_minsize)
-        self.assertEquals(m.hexdigest(), 'cfb767f225d58469c5de3632a8803958')
+        self.assertEqual(m.hexdigest(), 'cfb767f225d58469c5de3632a8803958')
 
     @unittest.skipUnless(threading, 'Threading required for this test.')
     @support.reap_threads

Modified: python/branches/py3k-cdecimal/Lib/test/test_http_cookiejar.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_http_cookiejar.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_http_cookiejar.py	Mon Nov 22 12:00:42 2010
@@ -20,28 +20,28 @@
     def test_time2isoz(self):
         base = 1019227000
         day = 24*3600
-        self.assertEquals(time2isoz(base), "2002-04-19 14:36:40Z")
-        self.assertEquals(time2isoz(base+day), "2002-04-20 14:36:40Z")
-        self.assertEquals(time2isoz(base+2*day), "2002-04-21 14:36:40Z")
-        self.assertEquals(time2isoz(base+3*day), "2002-04-22 14:36:40Z")
+        self.assertEqual(time2isoz(base), "2002-04-19 14:36:40Z")
+        self.assertEqual(time2isoz(base+day), "2002-04-20 14:36:40Z")
+        self.assertEqual(time2isoz(base+2*day), "2002-04-21 14:36:40Z")
+        self.assertEqual(time2isoz(base+3*day), "2002-04-22 14:36:40Z")
 
         az = time2isoz()
         bz = time2isoz(500000)
         for text in (az, bz):
             self.assertTrue(re.search(r"^\d{4}-\d\d-\d\d \d\d:\d\d:\d\dZ$", text),
-                         "bad time2isoz format: %s %s" % (az, bz))
+                            "bad time2isoz format: %s %s" % (az, bz))
 
     def test_http2time(self):
         def parse_date(text):
             return time.gmtime(http2time(text))[:6]
 
-        self.assertEquals(parse_date("01 Jan 2001"), (2001, 1, 1, 0, 0, 0.0))
+        self.assertEqual(parse_date("01 Jan 2001"), (2001, 1, 1, 0, 0, 0.0))
 
         # this test will break around year 2070
-        self.assertEquals(parse_date("03-Feb-20"), (2020, 2, 3, 0, 0, 0.0))
+        self.assertEqual(parse_date("03-Feb-20"), (2020, 2, 3, 0, 0, 0.0))
 
         # this test will break around year 2048
-        self.assertEquals(parse_date("03-Feb-98"), (1998, 2, 3, 0, 0, 0.0))
+        self.assertEqual(parse_date("03-Feb-98"), (1998, 2, 3, 0, 0, 0.0))
 
     def test_http2time_formats(self):
         # test http2time for supported dates.  Test cases with 2 digit year
@@ -69,8 +69,8 @@
         test_t = 760233600  # assume broken POSIX counting of seconds
         result = time2isoz(test_t)
         expected = "1994-02-03 00:00:00Z"
-        self.assertEquals(result, expected,
-                          "%s  =>  '%s' (%s)" % (test_t, result, expected))
+        self.assertEqual(result, expected,
+                         "%s  =>  '%s' (%s)" % (test_t, result, expected))
 
         for s in tests:
             t = http2time(s)
@@ -108,7 +108,7 @@
             'foo=bar; expires=01 Jan 2040 22:23:32 GMT',
             'foo=bar; expires="01 Jan 2040 22:23:32 GMT"',
             ]:
-            self.assertEquals(parse_ns_headers([hdr]), expected)
+            self.assertEqual(parse_ns_headers([hdr]), expected)
 
     def test_parse_ns_headers_version(self):
 
@@ -118,7 +118,7 @@
             'foo=bar; version="1"',
             'foo=bar; Version="1"',
             ]:
-            self.assertEquals(parse_ns_headers([hdr]), expected)
+            self.assertEqual(parse_ns_headers([hdr]), expected)
 
     def test_parse_ns_headers_special_names(self):
         # names such as 'expires' are not special in first name=value pair
@@ -126,13 +126,13 @@
         # Cookie with name 'expires'
         hdr = 'expires=01 Jan 2040 22:23:32 GMT'
         expected = [[("expires", "01 Jan 2040 22:23:32 GMT"), ("version", "0")]]
-        self.assertEquals(parse_ns_headers([hdr]), expected)
+        self.assertEqual(parse_ns_headers([hdr]), expected)
 
     def test_join_header_words(self):
         joined = join_header_words([[("foo", None), ("bar", "baz")]])
-        self.assertEquals(joined, "foo; bar=baz")
+        self.assertEqual(joined, "foo; bar=baz")
 
-        self.assertEquals(join_header_words([[]]), "")
+        self.assertEqual(join_header_words([[]]), "")
 
     def test_split_header_words(self):
         tests = [
@@ -162,7 +162,7 @@
                 f = io.StringIO()
                 traceback.print_exc(None, f)
                 result = "(error -- traceback follows)\n\n%s" % f.getvalue()
-            self.assertEquals(result,  expect, """
+            self.assertEqual(result,  expect, """
 When parsing: '%s'
 Expected:     '%s'
 Got:          '%s'
@@ -194,7 +194,7 @@
         for arg, expect in tests:
             input = split_header_words([arg])
             res = join_header_words(input)
-            self.assertEquals(res, expect, """
+            self.assertEqual(res, expect, """
 When parsing: '%s'
 Expected:     '%s'
 Got:          '%s'
@@ -358,11 +358,11 @@
         interact_netscape(c, "http://www.acme.com/", '"spam"; path=/foo/')
         cookie = c._cookies["www.acme.com"]["/"]["eggs"]
         self.assertTrue(cookie.value is None)
-        self.assertEquals(cookie.name, "eggs")
+        self.assertEqual(cookie.name, "eggs")
         cookie = c._cookies["www.acme.com"]['/foo/']['"spam"']
         self.assertTrue(cookie.value is None)
-        self.assertEquals(cookie.name, '"spam"')
-        self.assertEquals(lwp_cookie_str(cookie), (
+        self.assertEqual(cookie.name, '"spam"')
+        self.assertEqual(lwp_cookie_str(cookie), (
             r'"spam"; path="/foo/"; domain="www.acme.com"; '
             'path_spec; discard; version=0'))
         old_str = repr(c)
@@ -373,13 +373,13 @@
         finally:
             os.unlink(c.filename)
         # cookies unchanged apart from lost info re. whether path was specified
-        self.assertEquals(
+        self.assertEqual(
             repr(c),
             re.sub("path_specified=%s" % True, "path_specified=%s" % False,
                    old_str)
             )
-        self.assertEquals(interact_netscape(c, "http://www.acme.com/foo/"),
-                          '"spam"; eggs')
+        self.assertEqual(interact_netscape(c, "http://www.acme.com/foo/"),
+                         '"spam"; eggs')
 
     def test_rfc2109_handling(self):
         # RFC 2109 cookies are handled as RFC 2965 or Netscape cookies,
@@ -423,18 +423,18 @@
                           'expires="Foo Bar 25 33:22:11 3022"')
 
         cookie = c._cookies[".acme.com"]["/"]["spam"]
-        self.assertEquals(cookie.domain, ".acme.com")
+        self.assertEqual(cookie.domain, ".acme.com")
         self.assertTrue(cookie.domain_specified)
-        self.assertEquals(cookie.port, DEFAULT_HTTP_PORT)
+        self.assertEqual(cookie.port, DEFAULT_HTTP_PORT)
         self.assertTrue(not cookie.port_specified)
         # case is preserved
         self.assertTrue(cookie.has_nonstandard_attr("blArgh") and
                      not cookie.has_nonstandard_attr("blargh"))
 
         cookie = c._cookies["www.acme.com"]["/"]["ni"]
-        self.assertEquals(cookie.domain, "www.acme.com")
+        self.assertEqual(cookie.domain, "www.acme.com")
         self.assertTrue(not cookie.domain_specified)
-        self.assertEquals(cookie.port, "80,8080")
+        self.assertEqual(cookie.port, "80,8080")
         self.assertTrue(cookie.port_specified)
 
         cookie = c._cookies["www.acme.com"]["/"]["nini"]
@@ -464,13 +464,13 @@
         future = time2netscape(time.time()+3600)
         interact_netscape(c, "http://www.acme.com/", 'spam="bar"; expires=%s' %
                           future)
-        self.assertEquals(len(c), 1)
+        self.assertEqual(len(c), 1)
         now = time2netscape(time.time()-1)
         # ... and if in past or present, discard it
         interact_netscape(c, "http://www.acme.com/", 'foo="eggs"; expires=%s' %
                           now)
         h = interact_netscape(c, "http://www.acme.com/")
-        self.assertEquals(len(c), 1)
+        self.assertEqual(len(c), 1)
         self.assertIn('spam="bar"', h)
         self.assertNotIn("foo", h)
 
@@ -480,19 +480,19 @@
                           future)
         interact_netscape(c, "http://www.acme.com/", 'bar="bar"; expires=%s' %
                           future)
-        self.assertEquals(len(c), 3)
+        self.assertEqual(len(c), 3)
         interact_netscape(c, "http://www.acme.com/", 'eggs="bar"; '
                           'expires=%s; max-age=0' % future)
         interact_netscape(c, "http://www.acme.com/", 'bar="bar"; '
                           'max-age=0; expires=%s' % future)
         h = interact_netscape(c, "http://www.acme.com/")
-        self.assertEquals(len(c), 1)
+        self.assertEqual(len(c), 1)
 
         # test expiry at end of session for cookies with no expires attribute
         interact_netscape(c, "http://www.rhubarb.net/", 'whum="fizz"')
-        self.assertEquals(len(c), 2)
+        self.assertEqual(len(c), 2)
         c.clear_session_cookies()
-        self.assertEquals(len(c), 1)
+        self.assertEqual(len(c), 1)
         self.assertIn('spam="bar"', h)
 
         # XXX RFC 2965 expiry rules (some apply to V0 too)
@@ -545,7 +545,7 @@
         # Default path does not include query, so is "/", not "/?spam".
         self.assertIn("/", cj._cookies["example.com"])
         # Cookie is sent back to the same URI.
-        self.assertEquals(interact_netscape(cj, uri), value)
+        self.assertEqual(interact_netscape(cj, uri), value)
 
     def test_escape_path(self):
         cases = [
@@ -570,31 +570,31 @@
             ("/foo/bar\uabcd", "/foo/bar%EA%AF%8D"),  # UTF-8 encoded
             ]
         for arg, result in cases:
-            self.assertEquals(escape_path(arg), result)
+            self.assertEqual(escape_path(arg), result)
 
     def test_request_path(self):
         # with parameters
         req = urllib.request.Request(
             "http://www.example.com/rheum/rhaponticum;"
             "foo=bar;sing=song?apples=pears&spam=eggs#ni")
-        self.assertEquals(request_path(req),
-                          "/rheum/rhaponticum;foo=bar;sing=song")
+        self.assertEqual(request_path(req),
+                         "/rheum/rhaponticum;foo=bar;sing=song")
         # without parameters
         req = urllib.request.Request(
             "http://www.example.com/rheum/rhaponticum?"
             "apples=pears&spam=eggs#ni")
-        self.assertEquals(request_path(req), "/rheum/rhaponticum")
+        self.assertEqual(request_path(req), "/rheum/rhaponticum")
         # missing final slash
         req = urllib.request.Request("http://www.example.com")
-        self.assertEquals(request_path(req), "/")
+        self.assertEqual(request_path(req), "/")
 
     def test_request_port(self):
         req = urllib.request.Request("http://www.acme.com:1234/",
                                      headers={"Host": "www.acme.com:4321"})
-        self.assertEquals(request_port(req), "1234")
+        self.assertEqual(request_port(req), "1234")
         req = urllib.request.Request("http://www.acme.com/",
                                      headers={"Host": "www.acme.com:4321"})
-        self.assertEquals(request_port(req), DEFAULT_HTTP_PORT)
+        self.assertEqual(request_port(req), DEFAULT_HTTP_PORT)
 
     def test_request_host(self):
         # this request is illegal (RFC2616, 14.2.3)
@@ -602,15 +602,15 @@
                                      headers={"Host": "www.acme.com:80"})
         # libwww-perl wants this response, but that seems wrong (RFC 2616,
         # section 5.2, point 1., and RFC 2965 section 1, paragraph 3)
-        #self.assertEquals(request_host(req), "www.acme.com")
-        self.assertEquals(request_host(req), "1.1.1.1")
+        #self.assertEqual(request_host(req), "www.acme.com")
+        self.assertEqual(request_host(req), "1.1.1.1")
         req = urllib.request.Request("http://www.acme.com/",
                                      headers={"Host": "irrelevant.com"})
-        self.assertEquals(request_host(req), "www.acme.com")
+        self.assertEqual(request_host(req), "www.acme.com")
         # port shouldn't be in request-host
         req = urllib.request.Request("http://www.acme.com:2345/resource.html",
                                      headers={"Host": "www.acme.com:5432"})
-        self.assertEquals(request_host(req), "www.acme.com")
+        self.assertEqual(request_host(req), "www.acme.com")
 
     def test_is_HDN(self):
         self.assertTrue(is_HDN("foo.bar.com"))
@@ -623,14 +623,14 @@
         self.assertTrue(not is_HDN("foo."))
 
     def test_reach(self):
-        self.assertEquals(reach("www.acme.com"), ".acme.com")
-        self.assertEquals(reach("acme.com"), "acme.com")
-        self.assertEquals(reach("acme.local"), ".local")
-        self.assertEquals(reach(".local"), ".local")
-        self.assertEquals(reach(".com"), ".com")
-        self.assertEquals(reach("."), ".")
-        self.assertEquals(reach(""), "")
-        self.assertEquals(reach("192.168.0.1"), "192.168.0.1")
+        self.assertEqual(reach("www.acme.com"), ".acme.com")
+        self.assertEqual(reach("acme.com"), "acme.com")
+        self.assertEqual(reach("acme.local"), ".local")
+        self.assertEqual(reach(".local"), ".local")
+        self.assertEqual(reach(".com"), ".com")
+        self.assertEqual(reach("."), ".")
+        self.assertEqual(reach(""), "")
+        self.assertEqual(reach("192.168.0.1"), "192.168.0.1")
 
     def test_domain_match(self):
         self.assertTrue(domain_match("192.168.1.1", "192.168.1.1"))
@@ -676,7 +676,7 @@
         c = CookieJar()
         interact_2965(c, "http://www.nasty.com/",
                       'foo=bar; domain=friendly.org; Version="1"')
-        self.assertEquals(len(c), 0)
+        self.assertEqual(len(c), 0)
 
     def test_strict_domain(self):
         # Cookies whose domain is a country-code tld like .co.uk should
@@ -686,11 +686,11 @@
         interact_netscape(cj, "http://example.co.uk/", 'no=problemo')
         interact_netscape(cj, "http://example.co.uk/",
                           'okey=dokey; Domain=.example.co.uk')
-        self.assertEquals(len(cj), 2)
+        self.assertEqual(len(cj), 2)
         for pseudo_tld in [".co.uk", ".org.za", ".tx.us", ".name.us"]:
             interact_netscape(cj, "http://example.%s/" % pseudo_tld,
                               'spam=eggs; Domain=.co.uk')
-            self.assertEquals(len(cj), 2)
+            self.assertEqual(len(cj), 2)
 
     def test_two_component_domain_ns(self):
         # Netscape: .www.bar.com, www.bar.com, .bar.com, bar.com, no domain
@@ -700,17 +700,17 @@
 
         # two-component V0 domain is OK
         interact_netscape(c, "http://foo.net/", 'ns=bar')
-        self.assertEquals(len(c), 1)
-        self.assertEquals(c._cookies["foo.net"]["/"]["ns"].value, "bar")
-        self.assertEquals(interact_netscape(c, "http://foo.net/"), "ns=bar")
+        self.assertEqual(len(c), 1)
+        self.assertEqual(c._cookies["foo.net"]["/"]["ns"].value, "bar")
+        self.assertEqual(interact_netscape(c, "http://foo.net/"), "ns=bar")
         # *will* be returned to any other domain (unlike RFC 2965)...
-        self.assertEquals(interact_netscape(c, "http://www.foo.net/"),
-                          "ns=bar")
+        self.assertEqual(interact_netscape(c, "http://www.foo.net/"),
+                         "ns=bar")
         # ...unless requested otherwise
         pol = DefaultCookiePolicy(
             strict_ns_domain=DefaultCookiePolicy.DomainStrictNonDomain)
         c.set_policy(pol)
-        self.assertEquals(interact_netscape(c, "http://www.foo.net/"), "")
+        self.assertEqual(interact_netscape(c, "http://www.foo.net/"), "")
 
         # unlike RFC 2965, even explicit two-component domain is OK,
         # because .foo.net matches foo.net
@@ -719,17 +719,17 @@
         # even if starts with a dot -- in NS rules, .foo.net matches foo.net!
         interact_netscape(c, "http://foo.net/foo/bar/",
                           'spam2=eggs; domain=.foo.net')
-        self.assertEquals(len(c), 3)
-        self.assertEquals(c._cookies[".foo.net"]["/foo"]["spam1"].value,
-                          "eggs")
-        self.assertEquals(c._cookies[".foo.net"]["/foo/bar"]["spam2"].value,
-                          "eggs")
-        self.assertEquals(interact_netscape(c, "http://foo.net/foo/bar/"),
-                          "spam2=eggs; spam1=eggs; ns=bar")
+        self.assertEqual(len(c), 3)
+        self.assertEqual(c._cookies[".foo.net"]["/foo"]["spam1"].value,
+                         "eggs")
+        self.assertEqual(c._cookies[".foo.net"]["/foo/bar"]["spam2"].value,
+                         "eggs")
+        self.assertEqual(interact_netscape(c, "http://foo.net/foo/bar/"),
+                         "spam2=eggs; spam1=eggs; ns=bar")
 
         # top-level domain is too general
         interact_netscape(c, "http://foo.net/", 'nini="ni"; domain=.net')
-        self.assertEquals(len(c), 3)
+        self.assertEqual(len(c), 3)
 
 ##         # Netscape protocol doesn't allow non-special top level domains (such
 ##         # as co.uk) in the domain attribute unless there are at least three
@@ -737,8 +737,8 @@
         # Oh yes it does!  Real implementations don't check this, and real
         # cookies (of course) rely on that behaviour.
         interact_netscape(c, "http://foo.co.uk", 'nasty=trick; domain=.co.uk')
-##         self.assertEquals(len(c), 2)
-        self.assertEquals(len(c), 4)
+##         self.assertEqual(len(c), 2)
+        self.assertEqual(len(c), 4)
 
     def test_two_component_domain_rfc2965(self):
         pol = DefaultCookiePolicy(rfc2965=True)
@@ -746,43 +746,43 @@
 
         # two-component V1 domain is OK
         interact_2965(c, "http://foo.net/", 'foo=bar; Version="1"')
-        self.assertEquals(len(c), 1)
-        self.assertEquals(c._cookies["foo.net"]["/"]["foo"].value, "bar")
-        self.assertEquals(interact_2965(c, "http://foo.net/"),
-                          "$Version=1; foo=bar")
+        self.assertEqual(len(c), 1)
+        self.assertEqual(c._cookies["foo.net"]["/"]["foo"].value, "bar")
+        self.assertEqual(interact_2965(c, "http://foo.net/"),
+                         "$Version=1; foo=bar")
         # won't be returned to any other domain (because domain was implied)
-        self.assertEquals(interact_2965(c, "http://www.foo.net/"), "")
+        self.assertEqual(interact_2965(c, "http://www.foo.net/"), "")
 
         # unless domain is given explicitly, because then it must be
         # rewritten to start with a dot: foo.net --> .foo.net, which does
         # not domain-match foo.net
         interact_2965(c, "http://foo.net/foo",
                       'spam=eggs; domain=foo.net; path=/foo; Version="1"')
-        self.assertEquals(len(c), 1)
-        self.assertEquals(interact_2965(c, "http://foo.net/foo"),
-                          "$Version=1; foo=bar")
+        self.assertEqual(len(c), 1)
+        self.assertEqual(interact_2965(c, "http://foo.net/foo"),
+                         "$Version=1; foo=bar")
 
         # explicit foo.net from three-component domain www.foo.net *does* get
         # set, because .foo.net domain-matches .foo.net
         interact_2965(c, "http://www.foo.net/foo/",
                       'spam=eggs; domain=foo.net; Version="1"')
-        self.assertEquals(c._cookies[".foo.net"]["/foo/"]["spam"].value,
-                          "eggs")
-        self.assertEquals(len(c), 2)
-        self.assertEquals(interact_2965(c, "http://foo.net/foo/"),
-                          "$Version=1; foo=bar")
-        self.assertEquals(interact_2965(c, "http://www.foo.net/foo/"),
-                          '$Version=1; spam=eggs; $Domain="foo.net"')
+        self.assertEqual(c._cookies[".foo.net"]["/foo/"]["spam"].value,
+                         "eggs")
+        self.assertEqual(len(c), 2)
+        self.assertEqual(interact_2965(c, "http://foo.net/foo/"),
+                         "$Version=1; foo=bar")
+        self.assertEqual(interact_2965(c, "http://www.foo.net/foo/"),
+                         '$Version=1; spam=eggs; $Domain="foo.net"')
 
         # top-level domain is too general
         interact_2965(c, "http://foo.net/",
                       'ni="ni"; domain=".net"; Version="1"')
-        self.assertEquals(len(c), 2)
+        self.assertEqual(len(c), 2)
 
         # RFC 2965 doesn't require blocking this
         interact_2965(c, "http://foo.co.uk/",
                       'nasty=trick; domain=.co.uk; Version="1"')
-        self.assertEquals(len(c), 3)
+        self.assertEqual(len(c), 3)
 
     def test_domain_allow(self):
         c = CookieJar(policy=DefaultCookiePolicy(
@@ -793,24 +793,24 @@
         headers = ["Set-Cookie: CUSTOMER=WILE_E_COYOTE; path=/"]
         res = FakeResponse(headers, "http://acme.com/")
         c.extract_cookies(res, req)
-        self.assertEquals(len(c), 0)
+        self.assertEqual(len(c), 0)
 
         req = urllib.request.Request("http://www.acme.com/")
         res = FakeResponse(headers, "http://www.acme.com/")
         c.extract_cookies(res, req)
-        self.assertEquals(len(c), 1)
+        self.assertEqual(len(c), 1)
 
         req = urllib.request.Request("http://www.coyote.com/")
         res = FakeResponse(headers, "http://www.coyote.com/")
         c.extract_cookies(res, req)
-        self.assertEquals(len(c), 1)
+        self.assertEqual(len(c), 1)
 
         # set a cookie with non-allowed domain...
         req = urllib.request.Request("http://www.coyote.com/")
         res = FakeResponse(headers, "http://www.coyote.com/")
         cookies = c.make_cookies(res, req)
         c.set_cookie(cookies[0])
-        self.assertEquals(len(c), 2)
+        self.assertEqual(len(c), 2)
         # ... and check is doesn't get returned
         c.add_cookie_header(req)
         self.assertTrue(not req.has_header("Cookie"))
@@ -824,17 +824,17 @@
         req = urllib.request.Request("http://www.acme.com/")
         res = FakeResponse(headers, "http://www.acme.com/")
         c.extract_cookies(res, req)
-        self.assertEquals(len(c), 0)
+        self.assertEqual(len(c), 0)
 
         p = pol.set_blocked_domains(["acme.com"])
         c.extract_cookies(res, req)
-        self.assertEquals(len(c), 1)
+        self.assertEqual(len(c), 1)
 
         c.clear()
         req = urllib.request.Request("http://www.roadrunner.net/")
         res = FakeResponse(headers, "http://www.roadrunner.net/")
         c.extract_cookies(res, req)
-        self.assertEquals(len(c), 1)
+        self.assertEqual(len(c), 1)
         req = urllib.request.Request("http://www.roadrunner.net/")
         c.add_cookie_header(req)
         self.assertTrue((req.has_header("Cookie") and
@@ -843,14 +843,14 @@
         c.clear()
         pol.set_blocked_domains([".acme.com"])
         c.extract_cookies(res, req)
-        self.assertEquals(len(c), 1)
+        self.assertEqual(len(c), 1)
 
         # set a cookie with blocked domain...
         req = urllib.request.Request("http://www.acme.com/")
         res = FakeResponse(headers, "http://www.acme.com/")
         cookies = c.make_cookies(res, req)
         c.set_cookie(cookies[0])
-        self.assertEquals(len(c), 2)
+        self.assertEqual(len(c), 2)
         # ... and check is doesn't get returned
         c.add_cookie_header(req)
         self.assertTrue(not req.has_header("Cookie"))
@@ -882,7 +882,7 @@
         c = CookieJar(policy=DefaultCookiePolicy(rfc2965=True))
         interact_2965(c, "http://www.acme.com/", r'foo=\b"a"r; Version=1')
         h = interact_2965(c, "http://www.acme.com/")
-        self.assertEquals(h, r'$Version=1; foo=\\b\"a\"r')
+        self.assertEqual(h, r'$Version=1; foo=\\b\"a\"r')
 
     def test_missing_final_slash(self):
         # Missing slash from request URL's abs_path should be assumed present.
@@ -890,7 +890,7 @@
         c = CookieJar(DefaultCookiePolicy(rfc2965=True))
         interact_2965(c, url, "foo=bar; Version=1")
         req = urllib.request.Request(url)
-        self.assertEquals(len(c), 1)
+        self.assertEqual(len(c), 1)
         c.add_cookie_header(req)
         self.assertTrue(req.has_header("Cookie"))
 
@@ -1000,31 +1000,31 @@
             i = 0
             for c in cs:
                 self.assertTrue(isinstance(c, Cookie))
-                self.assertEquals(c.version, versions[i])
-                self.assertEquals(c.name, names[i])
-                self.assertEquals(c.domain, domains[i])
-                self.assertEquals(c.path, paths[i])
+                self.assertEqual(c.version, versions[i])
+                self.assertEqual(c.name, names[i])
+                self.assertEqual(c.domain, domains[i])
+                self.assertEqual(c.path, paths[i])
                 i = i + 1
 
     def test_parse_ns_headers(self):
         # missing domain value (invalid cookie)
-        self.assertEquals(
+        self.assertEqual(
             parse_ns_headers(["foo=bar; path=/; domain"]),
             [[("foo", "bar"),
               ("path", "/"), ("domain", None), ("version", "0")]]
             )
         # invalid expires value
-        self.assertEquals(
+        self.assertEqual(
             parse_ns_headers(["foo=bar; expires=Foo Bar 12 33:22:11 2000"]),
             [[("foo", "bar"), ("expires", None), ("version", "0")]]
             )
         # missing cookie value (valid cookie)
-        self.assertEquals(
+        self.assertEqual(
             parse_ns_headers(["foo"]),
             [[("foo", None), ("version", "0")]]
             )
         # shouldn't add version if header is empty
-        self.assertEquals(parse_ns_headers([""]), [])
+        self.assertEqual(parse_ns_headers([""]), [])
 
     def test_bad_cookie_header(self):
 
@@ -1048,7 +1048,7 @@
             ]:
             c = cookiejar_from_cookie_headers(headers)
             # these bad cookies shouldn't be set
-            self.assertEquals(len(c), 0)
+            self.assertEqual(len(c), 0)
 
         # cookie with invalid expires is treated as session cookie
         headers = ["Set-Cookie: c=foo; expires=Foo Bar 12 33:22:11 2000"]
@@ -1187,8 +1187,8 @@
         req = urllib.request.Request("http://www.acme.com/")
         c.add_cookie_header(req)
 
-        self.assertEquals(req.get_header("Cookie"),
-                          "PART_NUMBER=ROCKET_LAUNCHER_0001")
+        self.assertEqual(req.get_header("Cookie"),
+                         "PART_NUMBER=ROCKET_LAUNCHER_0001")
 
         headers.append(
             "Set-Cookie: PART_NUMBER=RIDING_ROCKET_0023; path=/ammo")
@@ -1386,40 +1386,40 @@
         # legal domain
         cookie = interact_2965(c, "http://www.acme.com",
                                'ping=pong; domain="acme.com"; version=1')
-        self.assertEquals(len(c), 1)
+        self.assertEqual(len(c), 1)
 
         # illegal domain (host prefix "www.a" contains a dot)
         cookie = interact_2965(c, "http://www.a.acme.com",
                                'whiz=bang; domain="acme.com"; version=1')
-        self.assertEquals(len(c), 1)
+        self.assertEqual(len(c), 1)
 
         # legal domain
         cookie = interact_2965(c, "http://www.a.acme.com",
                                'wow=flutter; domain=".a.acme.com"; version=1')
-        self.assertEquals(len(c), 2)
+        self.assertEqual(len(c), 2)
 
         # can't partially match an IP-address
         cookie = interact_2965(c, "http://125.125.125.125",
                                'zzzz=ping; domain="125.125.125"; version=1')
-        self.assertEquals(len(c), 2)
+        self.assertEqual(len(c), 2)
 
         # illegal path (must be prefix of request path)
         cookie = interact_2965(c, "http://www.sol.no",
                                'blah=rhubarb; domain=".sol.no"; path="/foo"; '
                                'version=1')
-        self.assertEquals(len(c), 2)
+        self.assertEqual(len(c), 2)
 
         # legal path
         cookie = interact_2965(c, "http://www.sol.no/foo/bar",
                                'bing=bong; domain=".sol.no"; path="/foo"; '
                                'version=1')
-        self.assertEquals(len(c), 3)
+        self.assertEqual(len(c), 3)
 
         # illegal port (request-port not in list)
         cookie = interact_2965(c, "http://www.sol.no",
                                'whiz=ffft; domain=".sol.no"; port="90,100"; '
                                'version=1')
-        self.assertEquals(len(c), 3)
+        self.assertEqual(len(c), 3)
 
         # legal port
         cookie = interact_2965(
@@ -1427,13 +1427,13 @@
             r'bang=wallop; version=1; domain=".sol.no"; '
             r'port="90,100, 80,8080"; '
             r'max-age=100; Comment = "Just kidding! (\"|\\\\) "')
-        self.assertEquals(len(c), 4)
+        self.assertEqual(len(c), 4)
 
         # port attribute without any value (current port)
         cookie = interact_2965(c, "http://www.sol.no",
                                'foo9=bar; version=1; domain=".sol.no"; port; '
                                'max-age=100;')
-        self.assertEquals(len(c), 5)
+        self.assertEqual(len(c), 5)
 
         # encoded path
         # LWP has this test, but unescaping allowed path characters seems
@@ -1444,7 +1444,7 @@
         # character:
         cookie = interact_2965(c, "http://www.sol.no/<oo/",
                                r'foo8=bar; version=1; path="/%3coo"')
-        self.assertEquals(len(c), 6)
+        self.assertEqual(len(c), 6)
 
         # save and restore
         filename = test.support.TESTFN
@@ -1459,7 +1459,7 @@
             try: os.unlink(filename)
             except OSError: pass
 
-        self.assertEquals(old, repr(c))
+        self.assertEqual(old, repr(c))
 
     def test_url_encoding(self):
         # Try some URL encodings of the PATHs.
@@ -1517,11 +1517,11 @@
             return new_c
 
         new_c = save_and_restore(c, True)
-        self.assertEquals(len(new_c), 6)  # none discarded
+        self.assertEqual(len(new_c), 6)  # none discarded
         self.assertIn("name='foo1', value='bar'", repr(new_c))
 
         new_c = save_and_restore(c, False)
-        self.assertEquals(len(new_c), 4)  # 2 of them discarded on save
+        self.assertEqual(len(new_c), 4)  # 2 of them discarded on save
         self.assertIn("name='foo1', value='bar'", repr(new_c))
 
     def test_netscape_misc(self):
@@ -1559,19 +1559,19 @@
         interact_2965(c, "http://example/", 'foo3=bar; Version=1')
         cookie = interact_2965(c, "http://example/")
         self.assertIn("foo2=bar", cookie)
-        self.assertEquals(len(c), 3)
+        self.assertEqual(len(c), 3)
 
     def test_intranet_domains_ns(self):
         c = CookieJar(DefaultCookiePolicy(rfc2965 = False))
         interact_netscape(c, "http://example/", "foo1=bar")
         cookie = interact_netscape(c, "http://example/",
                                    'foo2=bar; domain=.local')
-        self.assertEquals(len(c), 2)
+        self.assertEqual(len(c), 2)
         self.assertIn("foo1=bar", cookie)
 
         cookie = interact_netscape(c, "http://example/")
         self.assertIn("foo2=bar", cookie)
-        self.assertEquals(len(c), 2)
+        self.assertEqual(len(c), 2)
 
     def test_empty_path(self):
         # Test for empty path
@@ -1592,17 +1592,17 @@
         req = urllib.request.Request("http://www.ants.com/")
         c.add_cookie_header(req)
 
-        self.assertEquals(req.get_header("Cookie"),
-                          "JSESSIONID=ABCDERANDOM123")
-        self.assertEquals(req.get_header("Cookie2"), '$Version="1"')
+        self.assertEqual(req.get_header("Cookie"),
+                         "JSESSIONID=ABCDERANDOM123")
+        self.assertEqual(req.get_header("Cookie2"), '$Version="1"')
 
         # missing path in the request URI
         req = urllib.request.Request("http://www.ants.com:8080")
         c.add_cookie_header(req)
 
-        self.assertEquals(req.get_header("Cookie"),
-                          "JSESSIONID=ABCDERANDOM123")
-        self.assertEquals(req.get_header("Cookie2"), '$Version="1"')
+        self.assertEqual(req.get_header("Cookie"),
+                         "JSESSIONID=ABCDERANDOM123")
+        self.assertEqual(req.get_header("Cookie2"), '$Version="1"')
 
     def test_session_cookies(self):
         year_plus_one = time.localtime()[0] + 1

Modified: python/branches/py3k-cdecimal/Lib/test/test_httplib.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_httplib.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_httplib.py	Mon Nov 22 12:00:42 2010
@@ -144,7 +144,7 @@
 
     def test_bad_status_repr(self):
         exc = client.BadStatusLine('')
-        self.assertEquals(repr(exc), '''BadStatusLine("\'\'",)''')
+        self.assertEqual(repr(exc), '''BadStatusLine("\'\'",)''')
 
     def test_partial_reads(self):
         # if we have a lenght, the system knows when to close itself
@@ -222,13 +222,13 @@
         sock = FakeSocket(None)
         conn.sock = sock
         conn.send(expected)
-        self.assertEquals(expected, sock.data)
+        self.assertEqual(expected, sock.data)
         sock.data = b''
         conn.send(array.array('b', expected))
-        self.assertEquals(expected, sock.data)
+        self.assertEqual(expected, sock.data)
         sock.data = b''
         conn.send(io.BytesIO(expected))
-        self.assertEquals(expected, sock.data)
+        self.assertEqual(expected, sock.data)
 
     def test_chunked(self):
         chunked_start = (
@@ -242,7 +242,7 @@
         sock = FakeSocket(chunked_start + '0\r\n')
         resp = client.HTTPResponse(sock, method="GET")
         resp.begin()
-        self.assertEquals(resp.read(), b'hello world')
+        self.assertEqual(resp.read(), b'hello world')
         resp.close()
 
         for x in ('', 'foo\r\n'):
@@ -252,7 +252,7 @@
             try:
                 resp.read()
             except client.IncompleteRead as i:
-                self.assertEquals(i.partial, b'hello world')
+                self.assertEqual(i.partial, b'hello world')
                 self.assertEqual(repr(i),'IncompleteRead(11 bytes read)')
                 self.assertEqual(str(i),'IncompleteRead(11 bytes read)')
             else:
@@ -272,9 +272,9 @@
         sock = FakeSocket(chunked_start + '0\r\n')
         resp = client.HTTPResponse(sock, method="HEAD")
         resp.begin()
-        self.assertEquals(resp.read(), b'')
-        self.assertEquals(resp.status, 200)
-        self.assertEquals(resp.reason, 'OK')
+        self.assertEqual(resp.read(), b'')
+        self.assertEqual(resp.status, 200)
+        self.assertEqual(resp.reason, 'OK')
         self.assertTrue(resp.isclosed())
 
     def test_negative_content_length(self):
@@ -282,7 +282,7 @@
             'HTTP/1.1 200 OK\r\nContent-Length: -1\r\n\r\nHello\r\n')
         resp = client.HTTPResponse(sock, method="GET")
         resp.begin()
-        self.assertEquals(resp.read(), b'Hello\r\n')
+        self.assertEqual(resp.read(), b'Hello\r\n')
         resp.close()
 
     def test_incomplete_read(self):
@@ -292,7 +292,7 @@
         try:
             resp.read()
         except client.IncompleteRead as i:
-            self.assertEquals(i.partial, b'Hello\r\n')
+            self.assertEqual(i.partial, b'Hello\r\n')
             self.assertEqual(repr(i),
                              "IncompleteRead(7 bytes read, 3 more expected)")
             self.assertEqual(str(i),
@@ -319,7 +319,7 @@
 
 class OfflineTest(TestCase):
     def test_responses(self):
-        self.assertEquals(client.responses[client.NOT_FOUND], "Not Found")
+        self.assertEqual(client.responses[client.NOT_FOUND], "Not Found")
 
 
 class SourceAddressTest(TestCase):

Modified: python/branches/py3k-cdecimal/Lib/test/test_httpservers.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_httpservers.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_httpservers.py	Mon Nov 22 12:00:42 2010
@@ -511,6 +511,49 @@
         self.verify_get_called()
         self.assertEqual(result[-1], b'<html><body>Data</body></html>\r\n')
 
+    def test_header_buffering(self):
+
+        def _readAndReseek(f):
+            pos = f.tell()
+            f.seek(0)
+            data = f.read()
+            f.seek(pos)
+            return data
+
+        input = BytesIO(b'GET / HTTP/1.1\r\n\r\n')
+        output = BytesIO()
+        self.handler.rfile = input
+        self.handler.wfile = output
+        self.handler.request_version = 'HTTP/1.1'
+
+        self.handler.send_header('Foo', 'foo')
+        self.handler.send_header('bar', 'bar')
+        self.assertEqual(_readAndReseek(output), b'')
+        self.handler.end_headers()
+        self.assertEqual(_readAndReseek(output),
+                         b'Foo: foo\r\nbar: bar\r\n\r\n')
+
+    def test_header_unbuffered_when_continue(self):
+
+        def _readAndReseek(f):
+            pos = f.tell()
+            f.seek(0)
+            data = f.read()
+            f.seek(pos)
+            return data
+
+        input = BytesIO(b'GET / HTTP/1.1\r\nExpect: 100-continue\r\n\r\n')
+        output = BytesIO()
+        self.handler.rfile = input
+        self.handler.wfile = output
+        self.handler.request_version = 'HTTP/1.1'
+
+        self.handler.handle_one_request()
+        self.assertNotEqual(_readAndReseek(output), b'')
+        result = _readAndReseek(output).split(b'\r\n')
+        self.assertEqual(result[0], b'HTTP/1.1 100 Continue')
+        self.assertEqual(result[1], b'HTTP/1.1 200 OK')
+
     def test_with_continue_rejected(self):
         usual_handler = self.handler        # Save to avoid breaking any subsequent tests.
         self.handler = RejectingSocketlessRequestHandler()

Modified: python/branches/py3k-cdecimal/Lib/test/test_imaplib.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_imaplib.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_imaplib.py	Mon Nov 22 12:00:42 2010
@@ -112,7 +112,7 @@
 
         if verbose: print("creating server")
         server = MyServer(addr, hdlr)
-        self.assertEquals(server.server_address, server.socket.getsockname())
+        self.assertEqual(server.server_address, server.socket.getsockname())
 
         if verbose:
             print("server created")

Modified: python/branches/py3k-cdecimal/Lib/test/test_imp.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_imp.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_imp.py	Mon Nov 22 12:00:42 2010
@@ -85,7 +85,7 @@
                 file.write("# coding: cp1252\nu = 'test.test_imp'\n")
             file, filename, info = imp.find_module(temp_mod_name)
             file.close()
-            self.assertEquals(file.encoding, 'cp1252')
+            self.assertEqual(file.encoding, 'cp1252')
         finally:
             del sys.path[0]
             support.unlink(temp_mod_name + '.py')

Modified: python/branches/py3k-cdecimal/Lib/test/test_inspect.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_inspect.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_inspect.py	Mon Nov 22 12:00:42 2010
@@ -385,8 +385,8 @@
         self.assertRaises(IOError, inspect.findsource, co)
         self.assertRaises(IOError, inspect.getsource, co)
         linecache.cache[co.co_filename] = (1, None, lines, co.co_filename)
-        self.assertEquals(inspect.findsource(co), (lines,0))
-        self.assertEquals(inspect.getsource(co), lines[0])
+        self.assertEqual(inspect.findsource(co), (lines,0))
+        self.assertEqual(inspect.getsource(co), lines[0])
 
 # Helper for testing classify_class_attrs.
 def attrs_wo_objs(cls):
@@ -706,12 +706,239 @@
         locs = dict(locs or {}, inst=self.inst)
         return (func, 'inst,' + call_params_string, locs)
 
+
+class TestGetattrStatic(unittest.TestCase):
+
+    def test_basic(self):
+        class Thing(object):
+            x = object()
+
+        thing = Thing()
+        self.assertEqual(inspect.getattr_static(thing, 'x'), Thing.x)
+        self.assertEqual(inspect.getattr_static(thing, 'x', None), Thing.x)
+        with self.assertRaises(AttributeError):
+            inspect.getattr_static(thing, 'y')
+
+        self.assertEqual(inspect.getattr_static(thing, 'y', 3), 3)
+
+    def test_inherited(self):
+        class Thing(object):
+            x = object()
+        class OtherThing(Thing):
+            pass
+
+        something = OtherThing()
+        self.assertEqual(inspect.getattr_static(something, 'x'), Thing.x)
+
+    def test_instance_attr(self):
+        class Thing(object):
+            x = 2
+            def __init__(self, x):
+                self.x = x
+        thing = Thing(3)
+        self.assertEqual(inspect.getattr_static(thing, 'x'), 3)
+        del thing.x
+        self.assertEqual(inspect.getattr_static(thing, 'x'), 2)
+
+    def test_property(self):
+        class Thing(object):
+            @property
+            def x(self):
+                raise AttributeError("I'm pretending not to exist")
+        thing = Thing()
+        self.assertEqual(inspect.getattr_static(thing, 'x'), Thing.x)
+
+    def test_descriptor(self):
+        class descriptor(object):
+            def __get__(*_):
+                raise AttributeError("I'm pretending not to exist")
+        desc = descriptor()
+        class Thing(object):
+            x = desc
+        thing = Thing()
+        self.assertEqual(inspect.getattr_static(thing, 'x'), desc)
+
+    def test_classAttribute(self):
+        class Thing(object):
+            x = object()
+
+        self.assertEqual(inspect.getattr_static(Thing, 'x'), Thing.x)
+
+    def test_inherited_classattribute(self):
+        class Thing(object):
+            x = object()
+        class OtherThing(Thing):
+            pass
+
+        self.assertEqual(inspect.getattr_static(OtherThing, 'x'), Thing.x)
+
+    def test_slots(self):
+        class Thing(object):
+            y = 'bar'
+            __slots__ = ['x']
+            def __init__(self):
+                self.x = 'foo'
+        thing = Thing()
+        self.assertEqual(inspect.getattr_static(thing, 'x'), Thing.x)
+        self.assertEqual(inspect.getattr_static(thing, 'y'), 'bar')
+
+        del thing.x
+        self.assertEqual(inspect.getattr_static(thing, 'x'), Thing.x)
+
+    def test_metaclass(self):
+        class meta(type):
+            attr = 'foo'
+        class Thing(object, metaclass=meta):
+            pass
+        self.assertEqual(inspect.getattr_static(Thing, 'attr'), 'foo')
+
+        class sub(meta):
+            pass
+        class OtherThing(object, metaclass=sub):
+            x = 3
+        self.assertEqual(inspect.getattr_static(OtherThing, 'attr'), 'foo')
+
+        class OtherOtherThing(OtherThing):
+            pass
+        # this test is odd, but it was added as it exposed a bug
+        self.assertEqual(inspect.getattr_static(OtherOtherThing, 'x'), 3)
+
+    def test_no_dict_no_slots(self):
+        self.assertEqual(inspect.getattr_static(1, 'foo', None), None)
+        self.assertNotEqual(inspect.getattr_static('foo', 'lower'), None)
+
+    def test_no_dict_no_slots_instance_member(self):
+        # returns descriptor
+        with open(__file__) as handle:
+            self.assertEqual(inspect.getattr_static(handle, 'name'), type(handle).name)
+
+    def test_inherited_slots(self):
+        # returns descriptor
+        class Thing(object):
+            __slots__ = ['x']
+            def __init__(self):
+                self.x = 'foo'
+
+        class OtherThing(Thing):
+            pass
+        # it would be nice if this worked...
+        # we get the descriptor instead of the instance attribute
+        self.assertEqual(inspect.getattr_static(OtherThing(), 'x'), Thing.x)
+
+    def test_descriptor(self):
+        class descriptor(object):
+            def __get__(self, instance, owner):
+                return 3
+        class Foo(object):
+            d = descriptor()
+
+        foo = Foo()
+
+        # for a non data descriptor we return the instance attribute
+        foo.__dict__['d'] = 1
+        self.assertEqual(inspect.getattr_static(foo, 'd'), 1)
+
+        # if the descriptor is a data-desciptor we should return the
+        # descriptor
+        descriptor.__set__ = lambda s, i, v: None
+        self.assertEqual(inspect.getattr_static(foo, 'd'), Foo.__dict__['d'])
+
+
+    def test_metaclass_with_descriptor(self):
+        class descriptor(object):
+            def __get__(self, instance, owner):
+                return 3
+        class meta(type):
+            d = descriptor()
+        class Thing(object, metaclass=meta):
+            pass
+        self.assertEqual(inspect.getattr_static(Thing, 'd'), meta.__dict__['d'])
+
+
+    def test_class_as_property(self):
+        class Base(object):
+            foo = 3
+
+        class Something(Base):
+            executed = False
+            @property
+            def __class__(self):
+                self.executed = True
+                return object
+
+        instance = Something()
+        self.assertEqual(inspect.getattr_static(instance, 'foo'), 3)
+        self.assertFalse(instance.executed)
+        self.assertEqual(inspect.getattr_static(Something, 'foo'), 3)
+
+    def test_mro_as_property(self):
+        class Meta(type):
+            @property
+            def __mro__(self):
+                return (object,)
+
+        class Base(object):
+            foo = 3
+
+        class Something(Base, metaclass=Meta):
+            pass
+
+        self.assertEqual(inspect.getattr_static(Something(), 'foo'), 3)
+        self.assertEqual(inspect.getattr_static(Something, 'foo'), 3)
+
+
+class TestGetGeneratorState(unittest.TestCase):
+
+    def setUp(self):
+        def number_generator():
+            for number in range(5):
+                yield number
+        self.generator = number_generator()
+
+    def _generatorstate(self):
+        return inspect.getgeneratorstate(self.generator)
+
+    def test_created(self):
+        self.assertEqual(self._generatorstate(), inspect.GEN_CREATED)
+
+    def test_suspended(self):
+        next(self.generator)
+        self.assertEqual(self._generatorstate(), inspect.GEN_SUSPENDED)
+
+    def test_closed_after_exhaustion(self):
+        for i in self.generator:
+            pass
+        self.assertEqual(self._generatorstate(), inspect.GEN_CLOSED)
+
+    def test_closed_after_immediate_exception(self):
+        with self.assertRaises(RuntimeError):
+            self.generator.throw(RuntimeError)
+        self.assertEqual(self._generatorstate(), inspect.GEN_CLOSED)
+
+    def test_running(self):
+        # As mentioned on issue #10220, checking for the RUNNING state only
+        # makes sense inside the generator itself.
+        # The following generator checks for this by using the closure's
+        # reference to self and the generator state checking helper method
+        def running_check_generator():
+            for number in range(5):
+                self.assertEqual(self._generatorstate(), inspect.GEN_RUNNING)
+                yield number
+                self.assertEqual(self._generatorstate(), inspect.GEN_RUNNING)
+        self.generator = running_check_generator()
+        # Running up to the first yield
+        next(self.generator)
+        # Running after the first yield
+        next(self.generator)
+
+
 def test_main():
     run_unittest(
         TestDecorators, TestRetrievingSourceCode, TestOneliners, TestBuggyCases,
         TestInterpreterStack, TestClassesAndFunctions, TestPredicates,
         TestGetcallargsFunctions, TestGetcallargsMethods,
-        TestGetcallargsUnboundMethods)
+        TestGetcallargsUnboundMethods, TestGetattrStatic, TestGetGeneratorState
+    )
 
 if __name__ == "__main__":
     test_main()

Modified: python/branches/py3k-cdecimal/Lib/test/test_int.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_int.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_int.py	Mon Nov 22 12:00:42 2010
@@ -295,7 +295,7 @@
                 try:
                     int(TruncReturnsNonIntegral())
                 except TypeError as e:
-                    self.assertEquals(str(e),
+                    self.assertEqual(str(e),
                                       "__trunc__ returned non-Integral"
                                       " (type NonIntegral)")
                 else:

Modified: python/branches/py3k-cdecimal/Lib/test/test_io.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_io.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_io.py	Mon Nov 22 12:00:42 2010
@@ -630,7 +630,7 @@
         rawio = self.MockRawIO()
         bufio = self.tp(rawio)
 
-        self.assertEquals(42, bufio.fileno())
+        self.assertEqual(42, bufio.fileno())
 
     def test_no_fileno(self):
         # XXX will we always have fileno() function? If so, kill
@@ -740,36 +740,36 @@
         bufio.__init__(rawio)
         bufio.__init__(rawio, buffer_size=1024)
         bufio.__init__(rawio, buffer_size=16)
-        self.assertEquals(b"abc", bufio.read())
+        self.assertEqual(b"abc", bufio.read())
         self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0)
         self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16)
         self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1)
         rawio = self.MockRawIO([b"abc"])
         bufio.__init__(rawio)
-        self.assertEquals(b"abc", bufio.read())
+        self.assertEqual(b"abc", bufio.read())
 
     def test_read(self):
         for arg in (None, 7):
             rawio = self.MockRawIO((b"abc", b"d", b"efg"))
             bufio = self.tp(rawio)
-            self.assertEquals(b"abcdefg", bufio.read(arg))
+            self.assertEqual(b"abcdefg", bufio.read(arg))
         # Invalid args
         self.assertRaises(ValueError, bufio.read, -2)
 
     def test_read1(self):
         rawio = self.MockRawIO((b"abc", b"d", b"efg"))
         bufio = self.tp(rawio)
-        self.assertEquals(b"a", bufio.read(1))
-        self.assertEquals(b"b", bufio.read1(1))
-        self.assertEquals(rawio._reads, 1)
-        self.assertEquals(b"c", bufio.read1(100))
-        self.assertEquals(rawio._reads, 1)
-        self.assertEquals(b"d", bufio.read1(100))
-        self.assertEquals(rawio._reads, 2)
-        self.assertEquals(b"efg", bufio.read1(100))
-        self.assertEquals(rawio._reads, 3)
-        self.assertEquals(b"", bufio.read1(100))
-        self.assertEquals(rawio._reads, 4)
+        self.assertEqual(b"a", bufio.read(1))
+        self.assertEqual(b"b", bufio.read1(1))
+        self.assertEqual(rawio._reads, 1)
+        self.assertEqual(b"c", bufio.read1(100))
+        self.assertEqual(rawio._reads, 1)
+        self.assertEqual(b"d", bufio.read1(100))
+        self.assertEqual(rawio._reads, 2)
+        self.assertEqual(b"efg", bufio.read1(100))
+        self.assertEqual(rawio._reads, 3)
+        self.assertEqual(b"", bufio.read1(100))
+        self.assertEqual(rawio._reads, 4)
         # Invalid args
         self.assertRaises(ValueError, bufio.read1, -1)
 
@@ -777,24 +777,24 @@
         rawio = self.MockRawIO((b"abc", b"d", b"efg"))
         bufio = self.tp(rawio)
         b = bytearray(2)
-        self.assertEquals(bufio.readinto(b), 2)
-        self.assertEquals(b, b"ab")
-        self.assertEquals(bufio.readinto(b), 2)
-        self.assertEquals(b, b"cd")
-        self.assertEquals(bufio.readinto(b), 2)
-        self.assertEquals(b, b"ef")
-        self.assertEquals(bufio.readinto(b), 1)
-        self.assertEquals(b, b"gf")
-        self.assertEquals(bufio.readinto(b), 0)
-        self.assertEquals(b, b"gf")
+        self.assertEqual(bufio.readinto(b), 2)
+        self.assertEqual(b, b"ab")
+        self.assertEqual(bufio.readinto(b), 2)
+        self.assertEqual(b, b"cd")
+        self.assertEqual(bufio.readinto(b), 2)
+        self.assertEqual(b, b"ef")
+        self.assertEqual(bufio.readinto(b), 1)
+        self.assertEqual(b, b"gf")
+        self.assertEqual(bufio.readinto(b), 0)
+        self.assertEqual(b, b"gf")
 
     def test_readlines(self):
         def bufio():
             rawio = self.MockRawIO((b"abc\n", b"d\n", b"ef"))
             return self.tp(rawio)
-        self.assertEquals(bufio().readlines(), [b"abc\n", b"d\n", b"ef"])
-        self.assertEquals(bufio().readlines(5), [b"abc\n", b"d\n"])
-        self.assertEquals(bufio().readlines(None), [b"abc\n", b"d\n", b"ef"])
+        self.assertEqual(bufio().readlines(), [b"abc\n", b"d\n", b"ef"])
+        self.assertEqual(bufio().readlines(5), [b"abc\n", b"d\n"])
+        self.assertEqual(bufio().readlines(None), [b"abc\n", b"d\n", b"ef"])
 
     def test_buffering(self):
         data = b"abcdefghi"
@@ -811,34 +811,34 @@
             bufio = self.tp(rawio, buffer_size=bufsize)
             pos = 0
             for nbytes in buf_read_sizes:
-                self.assertEquals(bufio.read(nbytes), data[pos:pos+nbytes])
+                self.assertEqual(bufio.read(nbytes), data[pos:pos+nbytes])
                 pos += nbytes
             # this is mildly implementation-dependent
-            self.assertEquals(rawio.read_history, raw_read_sizes)
+            self.assertEqual(rawio.read_history, raw_read_sizes)
 
     def test_read_non_blocking(self):
         # Inject some None's in there to simulate EWOULDBLOCK
         rawio = self.MockRawIO((b"abc", b"d", None, b"efg", None, None, None))
         bufio = self.tp(rawio)
 
-        self.assertEquals(b"abcd", bufio.read(6))
-        self.assertEquals(b"e", bufio.read(1))
-        self.assertEquals(b"fg", bufio.read())
-        self.assertEquals(b"", bufio.peek(1))
+        self.assertEqual(b"abcd", bufio.read(6))
+        self.assertEqual(b"e", bufio.read(1))
+        self.assertEqual(b"fg", bufio.read())
+        self.assertEqual(b"", bufio.peek(1))
         self.assertTrue(None is bufio.read())
-        self.assertEquals(b"", bufio.read())
+        self.assertEqual(b"", bufio.read())
 
     def test_read_past_eof(self):
         rawio = self.MockRawIO((b"abc", b"d", b"efg"))
         bufio = self.tp(rawio)
 
-        self.assertEquals(b"abcdefg", bufio.read(9000))
+        self.assertEqual(b"abcdefg", bufio.read(9000))
 
     def test_read_all(self):
         rawio = self.MockRawIO((b"abc", b"d", b"efg"))
         bufio = self.tp(rawio)
 
-        self.assertEquals(b"abcdefg", bufio.read())
+        self.assertEqual(b"abcdefg", bufio.read())
 
     @unittest.skipUnless(threading, 'Threading required for this test.')
     @support.requires_resource('cpu')
@@ -965,15 +965,15 @@
         bufio.__init__(rawio)
         bufio.__init__(rawio, buffer_size=1024)
         bufio.__init__(rawio, buffer_size=16)
-        self.assertEquals(3, bufio.write(b"abc"))
+        self.assertEqual(3, bufio.write(b"abc"))
         bufio.flush()
         self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0)
         self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16)
         self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1)
         bufio.__init__(rawio)
-        self.assertEquals(3, bufio.write(b"ghi"))
+        self.assertEqual(3, bufio.write(b"ghi"))
         bufio.flush()
-        self.assertEquals(b"".join(rawio._write_stack), b"abcghi")
+        self.assertEqual(b"".join(rawio._write_stack), b"abcghi")
 
     def test_detach_flush(self):
         raw = self.MockRawIO()
@@ -1015,11 +1015,11 @@
         sizes = gen_sizes()
         while n < len(contents):
             size = min(next(sizes), len(contents) - n)
-            self.assertEquals(bufio.write(contents[n:n+size]), size)
+            self.assertEqual(bufio.write(contents[n:n+size]), size)
             intermediate_func(bufio)
             n += size
         bufio.flush()
-        self.assertEquals(contents, b"".join(writer._write_stack))
+        self.assertEqual(contents, b"".join(writer._write_stack))
 
     def test_writes(self):
         self.check_writes(lambda bufio: None)
@@ -1048,11 +1048,11 @@
         raw = self.MockNonBlockWriterIO()
         bufio = self.tp(raw, 8)
 
-        self.assertEquals(bufio.write(b"abcd"), 4)
-        self.assertEquals(bufio.write(b"efghi"), 5)
+        self.assertEqual(bufio.write(b"abcd"), 4)
+        self.assertEqual(bufio.write(b"efghi"), 5)
         # 1 byte will be written, the rest will be buffered
         raw.block_on(b"k")
-        self.assertEquals(bufio.write(b"jklmn"), 5)
+        self.assertEqual(bufio.write(b"jklmn"), 5)
 
         # 8 bytes will be written, 8 will be buffered and the rest will be lost
         raw.block_on(b"0")
@@ -1062,11 +1062,11 @@
             written = e.characters_written
         else:
             self.fail("BlockingIOError should have been raised")
-        self.assertEquals(written, 16)
-        self.assertEquals(raw.pop_written(),
+        self.assertEqual(written, 16)
+        self.assertEqual(raw.pop_written(),
             b"abcdefghijklmnopqrwxyz")
 
-        self.assertEquals(bufio.write(b"ABCDEFGHI"), 9)
+        self.assertEqual(bufio.write(b"ABCDEFGHI"), 9)
         s = raw.pop_written()
         # Previously buffered bytes were flushed
         self.assertTrue(s.startswith(b"01234567A"), s)
@@ -1089,7 +1089,7 @@
         bufio = self.tp(writer, 8)
         bufio.write(b"abc")
         bufio.flush()
-        self.assertEquals(b"abc", writer._write_stack[0])
+        self.assertEqual(b"abc", writer._write_stack[0])
 
     def test_destructor(self):
         writer = self.MockRawIO()
@@ -1097,7 +1097,7 @@
         bufio.write(b"abc")
         del bufio
         support.gc_collect()
-        self.assertEquals(b"abc", writer._write_stack[0])
+        self.assertEqual(b"abc", writer._write_stack[0])
 
     def test_truncate(self):
         # Truncate implicitly flushes the buffer.
@@ -1156,7 +1156,7 @@
             with self.open(support.TESTFN, "rb") as f:
                 s = f.read()
             for i in range(256):
-                self.assertEquals(s.count(bytes([i])), N)
+                self.assertEqual(s.count(bytes([i])), N)
         finally:
             support.unlink(support.TESTFN)
 
@@ -1357,45 +1357,45 @@
         rw.write(b"eee")
         self.assertFalse(raw._write_stack) # Buffer writes
         self.assertEqual(b"ghjk", rw.read())
-        self.assertEquals(b"dddeee", raw._write_stack[0])
+        self.assertEqual(b"dddeee", raw._write_stack[0])
 
     def test_seek_and_tell(self):
         raw = self.BytesIO(b"asdfghjkl")
         rw = self.tp(raw)
 
-        self.assertEquals(b"as", rw.read(2))
-        self.assertEquals(2, rw.tell())
+        self.assertEqual(b"as", rw.read(2))
+        self.assertEqual(2, rw.tell())
         rw.seek(0, 0)
-        self.assertEquals(b"asdf", rw.read(4))
+        self.assertEqual(b"asdf", rw.read(4))
 
         rw.write(b"asdf")
         rw.seek(0, 0)
-        self.assertEquals(b"asdfasdfl", rw.read())
-        self.assertEquals(9, rw.tell())
+        self.assertEqual(b"asdfasdfl", rw.read())
+        self.assertEqual(9, rw.tell())
         rw.seek(-4, 2)
-        self.assertEquals(5, rw.tell())
+        self.assertEqual(5, rw.tell())
         rw.seek(2, 1)
-        self.assertEquals(7, rw.tell())
-        self.assertEquals(b"fl", rw.read(11))
+        self.assertEqual(7, rw.tell())
+        self.assertEqual(b"fl", rw.read(11))
         self.assertRaises(TypeError, rw.seek, 0.0)
 
     def check_flush_and_read(self, read_func):
         raw = self.BytesIO(b"abcdefghi")
         bufio = self.tp(raw)
 
-        self.assertEquals(b"ab", read_func(bufio, 2))
+        self.assertEqual(b"ab", read_func(bufio, 2))
         bufio.write(b"12")
-        self.assertEquals(b"ef", read_func(bufio, 2))
-        self.assertEquals(6, bufio.tell())
+        self.assertEqual(b"ef", read_func(bufio, 2))
+        self.assertEqual(6, bufio.tell())
         bufio.flush()
-        self.assertEquals(6, bufio.tell())
-        self.assertEquals(b"ghi", read_func(bufio))
+        self.assertEqual(6, bufio.tell())
+        self.assertEqual(b"ghi", read_func(bufio))
         raw.seek(0, 0)
         raw.write(b"XYZ")
         # flush() resets the read buffer
         bufio.flush()
         bufio.seek(0, 0)
-        self.assertEquals(b"XYZ", read_func(bufio, 3))
+        self.assertEqual(b"XYZ", read_func(bufio, 3))
 
     def test_flush_and_read(self):
         self.check_flush_and_read(lambda bufio, *args: bufio.read(*args))
@@ -1427,8 +1427,8 @@
         bufio.write(b"45")
         bufio.flush()
         bufio.seek(0, 0)
-        self.assertEquals(b"12345fghi", raw.getvalue())
-        self.assertEquals(b"12345fghi", bufio.read())
+        self.assertEqual(b"12345fghi", raw.getvalue())
+        self.assertEqual(b"12345fghi", bufio.read())
 
     def test_threads(self):
         BufferedReaderTest.test_threads(self)
@@ -1656,12 +1656,12 @@
         # Try a few one-shot test cases.
         for input, eof, output in self.test_cases:
             d = StatefulIncrementalDecoder()
-            self.assertEquals(d.decode(input, eof), output)
+            self.assertEqual(d.decode(input, eof), output)
 
         # Also test an unfinished decode, followed by forcing EOF.
         d = StatefulIncrementalDecoder()
-        self.assertEquals(d.decode(b'oiabcd'), '')
-        self.assertEquals(d.decode(b'', 1), 'abcd.')
+        self.assertEqual(d.decode(b'oiabcd'), '')
+        self.assertEqual(d.decode(b'', 1), 'abcd.')
 
 class TextIOWrapperTest(unittest.TestCase):
 
@@ -1678,12 +1678,12 @@
         b = self.BufferedReader(r, 1000)
         t = self.TextIOWrapper(b)
         t.__init__(b, encoding="latin1", newline="\r\n")
-        self.assertEquals(t.encoding, "latin1")
-        self.assertEquals(t.line_buffering, False)
+        self.assertEqual(t.encoding, "latin1")
+        self.assertEqual(t.line_buffering, False)
         t.__init__(b, encoding="utf8", line_buffering=True)
-        self.assertEquals(t.encoding, "utf8")
-        self.assertEquals(t.line_buffering, True)
-        self.assertEquals("\xe9\n", t.readline())
+        self.assertEqual(t.encoding, "utf8")
+        self.assertEqual(t.line_buffering, True)
+        self.assertEqual("\xe9\n", t.readline())
         self.assertRaises(TypeError, t.__init__, b, newline=42)
         self.assertRaises(ValueError, t.__init__, b, newline='xyzzy')
 
@@ -1719,11 +1719,11 @@
         b = self.BufferedWriter(r, 1000)
         t = self.TextIOWrapper(b, newline="\n", line_buffering=True)
         t.write("X")
-        self.assertEquals(r.getvalue(), b"")  # No flush happened
+        self.assertEqual(r.getvalue(), b"")  # No flush happened
         t.write("Y\nZ")
-        self.assertEquals(r.getvalue(), b"XY\nZ")  # All got flushed
+        self.assertEqual(r.getvalue(), b"XY\nZ")  # All got flushed
         t.write("A\rB")
-        self.assertEquals(r.getvalue(), b"XY\nZA\rB")
+        self.assertEqual(r.getvalue(), b"XY\nZA\rB")
 
     def test_encoding(self):
         # Check the encoding attribute is always set, and valid
@@ -1746,11 +1746,11 @@
         # (3) ignore
         b = self.BytesIO(b"abc\n\xff\n")
         t = self.TextIOWrapper(b, encoding="ascii", errors="ignore")
-        self.assertEquals(t.read(), "abc\n\n")
+        self.assertEqual(t.read(), "abc\n\n")
         # (4) replace
         b = self.BytesIO(b"abc\n\xff\n")
         t = self.TextIOWrapper(b, encoding="ascii", errors="replace")
-        self.assertEquals(t.read(), "abc\n\ufffd\n")
+        self.assertEqual(t.read(), "abc\n\ufffd\n")
 
     def test_encoding_errors_writing(self):
         # (1) default
@@ -1767,14 +1767,14 @@
                              newline="\n")
         t.write("abc\xffdef\n")
         t.flush()
-        self.assertEquals(b.getvalue(), b"abcdef\n")
+        self.assertEqual(b.getvalue(), b"abcdef\n")
         # (4) replace
         b = self.BytesIO()
         t = self.TextIOWrapper(b, encoding="ascii", errors="replace",
                              newline="\n")
         t.write("abc\xffdef\n")
         t.flush()
-        self.assertEquals(b.getvalue(), b"abc?def\n")
+        self.assertEqual(b.getvalue(), b"abc?def\n")
 
     def test_newlines(self):
         input_lines = [ "unix\n", "windows\r\n", "os9\r", "last\n", "nonl" ]
@@ -1809,14 +1809,14 @@
                                 c2 = textio.read(2)
                                 if c2 == '':
                                     break
-                                self.assertEquals(len(c2), 2)
+                                self.assertEqual(len(c2), 2)
                                 got_lines.append(c2 + textio.readline())
                         else:
                             got_lines = list(textio)
 
                         for got_line, exp_line in zip(got_lines, exp_lines):
-                            self.assertEquals(got_line, exp_line)
-                        self.assertEquals(len(got_lines), len(exp_lines))
+                            self.assertEqual(got_line, exp_line)
+                        self.assertEqual(len(got_lines), len(exp_lines))
 
     def test_newlines_input(self):
         testdata = b"AAA\nBB\x00B\nCCC\rDDD\rEEE\r\nFFF\r\nGGG"
@@ -1830,9 +1830,9 @@
             ]:
             buf = self.BytesIO(testdata)
             txt = self.TextIOWrapper(buf, encoding="ascii", newline=newline)
-            self.assertEquals(txt.readlines(), expected)
+            self.assertEqual(txt.readlines(), expected)
             txt.seek(0)
-            self.assertEquals(txt.read(), "".join(expected))
+            self.assertEqual(txt.read(), "".join(expected))
 
     def test_newlines_output(self):
         testdict = {
@@ -1849,8 +1849,8 @@
             txt.write("BB\nCCC\n")
             txt.write("X\rY\r\nZ")
             txt.flush()
-            self.assertEquals(buf.closed, False)
-            self.assertEquals(buf.getvalue(), expected)
+            self.assertEqual(buf.closed, False)
+            self.assertEqual(buf.getvalue(), expected)
 
     def test_destructor(self):
         l = []
@@ -1864,7 +1864,7 @@
         t.write("abc")
         del t
         support.gc_collect()
-        self.assertEquals([b"abc"], l)
+        self.assertEqual([b"abc"], l)
 
     def test_override_destructor(self):
         record = []
@@ -1911,26 +1911,26 @@
             for enc in "ascii", "latin1", "utf8" :# , "utf-16-be", "utf-16-le":
                 f = self.open(support.TESTFN, "w+", encoding=enc)
                 f._CHUNK_SIZE = chunksize
-                self.assertEquals(f.write("abc"), 3)
+                self.assertEqual(f.write("abc"), 3)
                 f.close()
                 f = self.open(support.TESTFN, "r+", encoding=enc)
                 f._CHUNK_SIZE = chunksize
-                self.assertEquals(f.tell(), 0)
-                self.assertEquals(f.read(), "abc")
+                self.assertEqual(f.tell(), 0)
+                self.assertEqual(f.read(), "abc")
                 cookie = f.tell()
-                self.assertEquals(f.seek(0), 0)
-                self.assertEquals(f.read(None), "abc")
+                self.assertEqual(f.seek(0), 0)
+                self.assertEqual(f.read(None), "abc")
                 f.seek(0)
-                self.assertEquals(f.read(2), "ab")
-                self.assertEquals(f.read(1), "c")
-                self.assertEquals(f.read(1), "")
-                self.assertEquals(f.read(), "")
-                self.assertEquals(f.tell(), cookie)
-                self.assertEquals(f.seek(0), 0)
-                self.assertEquals(f.seek(0, 2), cookie)
-                self.assertEquals(f.write("def"), 3)
-                self.assertEquals(f.seek(cookie), cookie)
-                self.assertEquals(f.read(), "def")
+                self.assertEqual(f.read(2), "ab")
+                self.assertEqual(f.read(1), "c")
+                self.assertEqual(f.read(1), "")
+                self.assertEqual(f.read(), "")
+                self.assertEqual(f.tell(), cookie)
+                self.assertEqual(f.seek(0), 0)
+                self.assertEqual(f.seek(0, 2), cookie)
+                self.assertEqual(f.write("def"), 3)
+                self.assertEqual(f.seek(cookie), cookie)
+                self.assertEqual(f.read(), "def")
                 if enc.startswith("utf"):
                     self.multi_line_test(f, enc)
                 f.close()
@@ -1955,7 +1955,7 @@
             if not line:
                 break
             rlines.append((pos, line))
-        self.assertEquals(rlines, wlines)
+        self.assertEqual(rlines, wlines)
 
     def test_telling(self):
         f = self.open(support.TESTFN, "w+", encoding="utf8")
@@ -1965,16 +1965,16 @@
         f.write("\xff\n")
         p2 = f.tell()
         f.seek(0)
-        self.assertEquals(f.tell(), p0)
-        self.assertEquals(f.readline(), "\xff\n")
-        self.assertEquals(f.tell(), p1)
-        self.assertEquals(f.readline(), "\xff\n")
-        self.assertEquals(f.tell(), p2)
+        self.assertEqual(f.tell(), p0)
+        self.assertEqual(f.readline(), "\xff\n")
+        self.assertEqual(f.tell(), p1)
+        self.assertEqual(f.readline(), "\xff\n")
+        self.assertEqual(f.tell(), p2)
         f.seek(0)
         for line in f:
-            self.assertEquals(line, "\xff\n")
+            self.assertEqual(line, "\xff\n")
             self.assertRaises(IOError, f.tell)
-        self.assertEquals(f.tell(), p2)
+        self.assertEqual(f.tell(), p2)
         f.close()
 
     def test_seeking(self):
@@ -1982,7 +1982,7 @@
         prefix_size = chunk_size - 2
         u_prefix = "a" * prefix_size
         prefix = bytes(u_prefix.encode("utf-8"))
-        self.assertEquals(len(u_prefix), len(prefix))
+        self.assertEqual(len(u_prefix), len(prefix))
         u_suffix = "\u8888\n"
         suffix = bytes(u_suffix.encode("utf-8"))
         line = prefix + suffix
@@ -1990,9 +1990,9 @@
             f.write(line*2)
         with self.open(support.TESTFN, "r", encoding="utf-8") as f:
             s = f.read(prefix_size)
-            self.assertEquals(s, str(prefix, "ascii"))
-            self.assertEquals(f.tell(), prefix_size)
-            self.assertEquals(f.readline(), u_suffix)
+            self.assertEqual(s, str(prefix, "ascii"))
+            self.assertEqual(f.tell(), prefix_size)
+            self.assertEqual(f.readline(), u_suffix)
 
     def test_seeking_too(self):
         # Regression test for a specific bug
@@ -2024,11 +2024,11 @@
             for i in range(min_pos, len(decoded) + 1): # seek positions
                 for j in [1, 5, len(decoded) - i]: # read lengths
                     f = self.open(support.TESTFN, encoding='test_decoder')
-                    self.assertEquals(f.read(i), decoded[:i])
+                    self.assertEqual(f.read(i), decoded[:i])
                     cookie = f.tell()
-                    self.assertEquals(f.read(j), decoded[i:i + j])
+                    self.assertEqual(f.read(j), decoded[i:i + j])
                     f.seek(cookie)
-                    self.assertEquals(f.read(), decoded[i:])
+                    self.assertEqual(f.read(), decoded[i:])
                     f.close()
 
         # Enable the test decoder.
@@ -2067,10 +2067,10 @@
             f.write(data)
             f.write(data)
             f.seek(0)
-            self.assertEquals(f.read(), data * 2)
+            self.assertEqual(f.read(), data * 2)
             f.seek(0)
-            self.assertEquals(f.read(), data * 2)
-            self.assertEquals(buf.getvalue(), (data * 2).encode(encoding))
+            self.assertEqual(f.read(), data * 2)
+            self.assertEqual(buf.getvalue(), (data * 2).encode(encoding))
 
     def test_unreadable(self):
         class UnReadable(self.BytesIO):
@@ -2087,7 +2087,7 @@
             if not c:
                 break
             reads += c
-        self.assertEquals(reads, "AA\nBB")
+        self.assertEqual(reads, "AA\nBB")
 
     def test_readlines(self):
         txt = self.TextIOWrapper(self.BytesIO(b"AA\nBB\nCC"))
@@ -2107,7 +2107,7 @@
             if not c:
                 break
             reads += c
-        self.assertEquals(reads, "A"*127+"\nB")
+        self.assertEqual(reads, "A"*127+"\nB")
 
     def test_issue1395_1(self):
         txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
@@ -2119,7 +2119,7 @@
             if not c:
                 break
             reads += c
-        self.assertEquals(reads, self.normalized)
+        self.assertEqual(reads, self.normalized)
 
     def test_issue1395_2(self):
         txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
@@ -2131,7 +2131,7 @@
             if not c:
                 break
             reads += c
-        self.assertEquals(reads, self.normalized)
+        self.assertEqual(reads, self.normalized)
 
     def test_issue1395_3(self):
         txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
@@ -2142,7 +2142,7 @@
         reads += txt.readline()
         reads += txt.readline()
         reads += txt.readline()
-        self.assertEquals(reads, self.normalized)
+        self.assertEqual(reads, self.normalized)
 
     def test_issue1395_4(self):
         txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
@@ -2150,7 +2150,7 @@
 
         reads = txt.read(4)
         reads += txt.read()
-        self.assertEquals(reads, self.normalized)
+        self.assertEqual(reads, self.normalized)
 
     def test_issue1395_5(self):
         txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
@@ -2160,7 +2160,7 @@
         pos = txt.tell()
         txt.seek(0)
         txt.seek(pos)
-        self.assertEquals(txt.read(4), "BBB\n")
+        self.assertEqual(txt.read(4), "BBB\n")
 
     def test_issue2282(self):
         buffer = self.BytesIO(self.testdata)
@@ -2176,12 +2176,12 @@
                 f.write('aaa')
                 pos = f.tell()
             with self.open(filename, 'rb') as f:
-                self.assertEquals(f.read(), 'aaa'.encode(charset))
+                self.assertEqual(f.read(), 'aaa'.encode(charset))
 
             with self.open(filename, 'a', encoding=charset) as f:
                 f.write('xxx')
             with self.open(filename, 'rb') as f:
-                self.assertEquals(f.read(), 'aaaxxx'.encode(charset))
+                self.assertEqual(f.read(), 'aaaxxx'.encode(charset))
 
     def test_seek_bom(self):
         # Same test, but when seeking manually
@@ -2196,7 +2196,7 @@
                 f.seek(0)
                 f.write('bbb')
             with self.open(filename, 'rb') as f:
-                self.assertEquals(f.read(), 'bbbzzz'.encode(charset))
+                self.assertEqual(f.read(), 'bbbzzz'.encode(charset))
 
     def test_errors_property(self):
         with self.open(support.TESTFN, "w") as f:
@@ -2224,7 +2224,7 @@
         with self.open(support.TESTFN) as f:
             content = f.read()
             for n in range(20):
-                self.assertEquals(content.count("Thread%03d\n" % n), 1)
+                self.assertEqual(content.count("Thread%03d\n" % n), 1)
 
     def test_flush_error_on_close(self):
         txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
@@ -2283,9 +2283,9 @@
         def _check_decode(b, s, **kwargs):
             # We exercise getstate() / setstate() as well as decode()
             state = decoder.getstate()
-            self.assertEquals(decoder.decode(b, **kwargs), s)
+            self.assertEqual(decoder.decode(b, **kwargs), s)
             decoder.setstate(state)
-            self.assertEquals(decoder.decode(b, **kwargs), s)
+            self.assertEqual(decoder.decode(b, **kwargs), s)
 
         _check_decode(b'\xe8\xa2\x88', "\u8888")
 
@@ -2334,24 +2334,24 @@
                 # Decode one char at a time
                 for c in s:
                     result.append(decoder.decode(c))
-        self.assertEquals(decoder.newlines, None)
+        self.assertEqual(decoder.newlines, None)
         _decode_bytewise("abc\n\r")
-        self.assertEquals(decoder.newlines, '\n')
+        self.assertEqual(decoder.newlines, '\n')
         _decode_bytewise("\nabc")
-        self.assertEquals(decoder.newlines, ('\n', '\r\n'))
+        self.assertEqual(decoder.newlines, ('\n', '\r\n'))
         _decode_bytewise("abc\r")
-        self.assertEquals(decoder.newlines, ('\n', '\r\n'))
+        self.assertEqual(decoder.newlines, ('\n', '\r\n'))
         _decode_bytewise("abc")
-        self.assertEquals(decoder.newlines, ('\r', '\n', '\r\n'))
+        self.assertEqual(decoder.newlines, ('\r', '\n', '\r\n'))
         _decode_bytewise("abc\r")
-        self.assertEquals("".join(result), "abc\n\nabcabc\nabcabc")
+        self.assertEqual("".join(result), "abc\n\nabcabc\nabcabc")
         decoder.reset()
         input = "abc"
         if encoder is not None:
             encoder.reset()
             input = encoder.encode(input)
-        self.assertEquals(decoder.decode(input), "abc")
-        self.assertEquals(decoder.newlines, None)
+        self.assertEqual(decoder.decode(input), "abc")
+        self.assertEqual(decoder.newlines, None)
 
     def test_newline_decoder(self):
         encodings = (
@@ -2372,11 +2372,11 @@
     def test_newline_bytes(self):
         # Issue 5433: Excessive optimization in IncrementalNewlineDecoder
         def _check(dec):
-            self.assertEquals(dec.newlines, None)
-            self.assertEquals(dec.decode("\u0D00"), "\u0D00")
-            self.assertEquals(dec.newlines, None)
-            self.assertEquals(dec.decode("\u0A00"), "\u0A00")
-            self.assertEquals(dec.newlines, None)
+            self.assertEqual(dec.newlines, None)
+            self.assertEqual(dec.decode("\u0D00"), "\u0D00")
+            self.assertEqual(dec.newlines, None)
+            self.assertEqual(dec.decode("\u0A00"), "\u0A00")
+            self.assertEqual(dec.newlines, None)
         dec = self.IncrementalNewlineDecoder(None, translate=False)
         _check(dec)
         dec = self.IncrementalNewlineDecoder(None, translate=True)
@@ -2409,28 +2409,28 @@
 
     def test_attributes(self):
         f = self.open(support.TESTFN, "wb", buffering=0)
-        self.assertEquals(f.mode, "wb")
+        self.assertEqual(f.mode, "wb")
         f.close()
 
         f = self.open(support.TESTFN, "U")
-        self.assertEquals(f.name,            support.TESTFN)
-        self.assertEquals(f.buffer.name,     support.TESTFN)
-        self.assertEquals(f.buffer.raw.name, support.TESTFN)
-        self.assertEquals(f.mode,            "U")
-        self.assertEquals(f.buffer.mode,     "rb")
-        self.assertEquals(f.buffer.raw.mode, "rb")
+        self.assertEqual(f.name,            support.TESTFN)
+        self.assertEqual(f.buffer.name,     support.TESTFN)
+        self.assertEqual(f.buffer.raw.name, support.TESTFN)
+        self.assertEqual(f.mode,            "U")
+        self.assertEqual(f.buffer.mode,     "rb")
+        self.assertEqual(f.buffer.raw.mode, "rb")
         f.close()
 
         f = self.open(support.TESTFN, "w+")
-        self.assertEquals(f.mode,            "w+")
-        self.assertEquals(f.buffer.mode,     "rb+") # Does it really matter?
-        self.assertEquals(f.buffer.raw.mode, "rb+")
+        self.assertEqual(f.mode,            "w+")
+        self.assertEqual(f.buffer.mode,     "rb+") # Does it really matter?
+        self.assertEqual(f.buffer.raw.mode, "rb+")
 
         g = self.open(f.fileno(), "wb", closefd=False)
-        self.assertEquals(g.mode,     "wb")
-        self.assertEquals(g.raw.mode, "wb")
-        self.assertEquals(g.name,     f.fileno())
-        self.assertEquals(g.raw.name, f.fileno())
+        self.assertEqual(g.mode,     "wb")
+        self.assertEqual(g.raw.mode, "wb")
+        self.assertEqual(g.name,     f.fileno())
+        self.assertEqual(g.raw.name, f.fileno())
         f.close()
         g.close()
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_ioctl.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_ioctl.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_ioctl.py	Mon Nov 22 12:00:42 2010
@@ -50,7 +50,7 @@
         with open("/dev/tty", "r") as tty:
             r = fcntl.ioctl(tty, termios.TIOCGPGRP, buf, 1)
         rpgrp = buf[0]
-        self.assertEquals(r, 0)
+        self.assertEqual(r, 0)
         self.assertIn(rpgrp, ids)
 
     def test_ioctl_mutate(self):

Modified: python/branches/py3k-cdecimal/Lib/test/test_isinstance.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_isinstance.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_isinstance.py	Mon Nov 22 12:00:42 2010
@@ -81,6 +81,20 @@
 
         self.assertRaises(TypeError, isinstance, I(), C())
 
+    # check that we don't mask non AttributeErrors
+    # see: http://bugs.python.org/issue1574217
+    def test_isinstance_dont_mask_non_attribute_error(self):
+        class C(object):
+            def getclass(self):
+                raise RuntimeError
+            __class__ = property(getclass)
+
+        c = C()
+        self.assertRaises(RuntimeError, isinstance, c, bool)
+
+        # test another code path
+        class D: pass
+        self.assertRaises(RuntimeError, isinstance, c, D)
 
 
 # These tests are similar to above, but tickle certain code paths in

Modified: python/branches/py3k-cdecimal/Lib/test/test_itertools.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_itertools.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_itertools.py	Mon Nov 22 12:00:42 2010
@@ -195,7 +195,7 @@
 
                 regular_combs = list(combinations(values, r))           # compare to combs without replacement
                 if n == 0 or r <= 1:
-                    self.assertEquals(result, regular_combs)            # cases that should be identical
+                    self.assertEqual(result, regular_combs)            # cases that should be identical
                 else:
                     self.assertTrue(set(result) >= set(regular_combs))     # rest should be supersets of regular combs
 
@@ -291,20 +291,20 @@
                 comb = list(combinations(s, r))
 
                 # Check size
-                self.assertEquals(len(prod), n**r)
-                self.assertEquals(len(cwr), (fact(n+r-1) / fact(r)/ fact(n-1)) if n else (not r))
-                self.assertEquals(len(perm), 0 if r>n else fact(n) / fact(n-r))
-                self.assertEquals(len(comb), 0 if r>n else fact(n) / fact(r) / fact(n-r))
+                self.assertEqual(len(prod), n**r)
+                self.assertEqual(len(cwr), (fact(n+r-1) / fact(r)/ fact(n-1)) if n else (not r))
+                self.assertEqual(len(perm), 0 if r>n else fact(n) / fact(n-r))
+                self.assertEqual(len(comb), 0 if r>n else fact(n) / fact(r) / fact(n-r))
 
                 # Check lexicographic order without repeated tuples
-                self.assertEquals(prod, sorted(set(prod)))
-                self.assertEquals(cwr, sorted(set(cwr)))
-                self.assertEquals(perm, sorted(set(perm)))
-                self.assertEquals(comb, sorted(set(comb)))
+                self.assertEqual(prod, sorted(set(prod)))
+                self.assertEqual(cwr, sorted(set(cwr)))
+                self.assertEqual(perm, sorted(set(perm)))
+                self.assertEqual(comb, sorted(set(comb)))
 
                 # Check interrelationships
-                self.assertEquals(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted
-                self.assertEquals(perm, [t for t in prod if len(set(t))==r])    # perm: prods with no dups
+                self.assertEqual(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted
+                self.assertEqual(perm, [t for t in prod if len(set(t))==r])    # perm: prods with no dups
                 self.assertEqual(comb, [t for t in perm if sorted(t)==list(t)]) # comb: perms that are sorted
                 self.assertEqual(comb, [t for t in cwr if len(set(t))==r])      # comb: cwrs without dups
                 self.assertEqual(comb, list(filter(set(cwr).__contains__, perm)))     # comb: perm that is a cwr

Modified: python/branches/py3k-cdecimal/Lib/test/test_keywordonlyarg.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_keywordonlyarg.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_keywordonlyarg.py	Mon Nov 22 12:00:42 2010
@@ -101,51 +101,51 @@
             pass
 
     def testFunctionCall(self):
-        self.assertEquals(1, posonly_sum(1))
-        self.assertEquals(1+2, posonly_sum(1,**{"2":2}))
-        self.assertEquals(1+2+3, posonly_sum(1,*(2,3)))
-        self.assertEquals(1+2+3+4, posonly_sum(1,*(2,3),**{"4":4}))
-
-        self.assertEquals(1, keywordonly_sum(k2=1))
-        self.assertEquals(1+2, keywordonly_sum(k1=1, k2=2))
-
-        self.assertEquals(1+2, keywordonly_and_kwarg_sum(k1=1, k2=2))
-        self.assertEquals(1+2+3, keywordonly_and_kwarg_sum(k1=1, k2=2, k3=3))
-        self.assertEquals(1+2+3+4,
-                          keywordonly_and_kwarg_sum(k1=1, k2=2,
+        self.assertEqual(1, posonly_sum(1))
+        self.assertEqual(1+2, posonly_sum(1,**{"2":2}))
+        self.assertEqual(1+2+3, posonly_sum(1,*(2,3)))
+        self.assertEqual(1+2+3+4, posonly_sum(1,*(2,3),**{"4":4}))
+
+        self.assertEqual(1, keywordonly_sum(k2=1))
+        self.assertEqual(1+2, keywordonly_sum(k1=1, k2=2))
+
+        self.assertEqual(1+2, keywordonly_and_kwarg_sum(k1=1, k2=2))
+        self.assertEqual(1+2+3, keywordonly_and_kwarg_sum(k1=1, k2=2, k3=3))
+        self.assertEqual(1+2+3+4,
+                         keywordonly_and_kwarg_sum(k1=1, k2=2,
                                                     **{"a":3,"b":4}))
 
-        self.assertEquals(1+2, mixedargs_sum(1, k1=2))
-        self.assertEquals(1+2+3, mixedargs_sum(1, 2, k1=3))
-        self.assertEquals(1+2+3+4, mixedargs_sum(1, 2, k1=3, k2=4))
-        self.assertEquals(1+2+3+4+5, mixedargs_sum(1, 2, 3, k1=4, k2=5))
-
-        self.assertEquals(1+2, mixedargs_sum2(1, k1=2))
-        self.assertEquals(1+2+3, mixedargs_sum2(1, 2, k1=3))
-        self.assertEquals(1+2+3+4, mixedargs_sum2(1, 2, k1=3, k2=4))
-        self.assertEquals(1+2+3+4+5, mixedargs_sum2(1, 2, 3, k1=4, k2=5))
-        self.assertEquals(1+2+3+4+5+6,
-                          mixedargs_sum2(1, 2, 3, k1=4, k2=5, k3=6))
-        self.assertEquals(1+2+3+4+5+6,
-                          mixedargs_sum2(1, 2, 3, k1=4, **{'k2':5, 'k3':6}))
-
-        self.assertEquals(1, Foo(k1=1).sum())
-        self.assertEquals(1+2, Foo(k1=1,k2=2).sum())
-
-        self.assertEquals([1,2,3], sortnum(3,2,1))
-        self.assertEquals([3,2,1], sortnum(1,2,3, reverse=True))
-
-        self.assertEquals(['a','b','c'], sortwords('a','c','b'))
-        self.assertEquals(['c','b','a'], sortwords('a','c','b', reverse=True))
-        self.assertEquals(['c','b','a'],
-                          sortwords('a','c','b', reverse=True, ignore='ignore'))
+        self.assertEqual(1+2, mixedargs_sum(1, k1=2))
+        self.assertEqual(1+2+3, mixedargs_sum(1, 2, k1=3))
+        self.assertEqual(1+2+3+4, mixedargs_sum(1, 2, k1=3, k2=4))
+        self.assertEqual(1+2+3+4+5, mixedargs_sum(1, 2, 3, k1=4, k2=5))
+
+        self.assertEqual(1+2, mixedargs_sum2(1, k1=2))
+        self.assertEqual(1+2+3, mixedargs_sum2(1, 2, k1=3))
+        self.assertEqual(1+2+3+4, mixedargs_sum2(1, 2, k1=3, k2=4))
+        self.assertEqual(1+2+3+4+5, mixedargs_sum2(1, 2, 3, k1=4, k2=5))
+        self.assertEqual(1+2+3+4+5+6,
+                         mixedargs_sum2(1, 2, 3, k1=4, k2=5, k3=6))
+        self.assertEqual(1+2+3+4+5+6,
+                         mixedargs_sum2(1, 2, 3, k1=4, **{'k2':5, 'k3':6}))
+
+        self.assertEqual(1, Foo(k1=1).sum())
+        self.assertEqual(1+2, Foo(k1=1,k2=2).sum())
+
+        self.assertEqual([1,2,3], sortnum(3,2,1))
+        self.assertEqual([3,2,1], sortnum(1,2,3, reverse=True))
+
+        self.assertEqual(['a','b','c'], sortwords('a','c','b'))
+        self.assertEqual(['c','b','a'], sortwords('a','c','b', reverse=True))
+        self.assertEqual(['c','b','a'],
+                         sortwords('a','c','b', reverse=True, ignore='ignore'))
 
     def testKwDefaults(self):
         def foo(p1,p2=0, *, k1, k2=0):
             return p1 + p2 + k1 + k2
 
-        self.assertEquals(2, foo.__code__.co_kwonlyargcount)
-        self.assertEquals({"k2":0}, foo.__kwdefaults__)
+        self.assertEqual(2, foo.__code__.co_kwonlyargcount)
+        self.assertEqual({"k2":0}, foo.__kwdefaults__)
         foo.__kwdefaults__ = {"k1":0}
         try:
             foo(1,k1=10)

Modified: python/branches/py3k-cdecimal/Lib/test/test_kqueue.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_kqueue.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_kqueue.py	Mon Nov 22 12:00:42 2010
@@ -91,7 +91,7 @@
         try:
             client.connect(('127.0.0.1', serverSocket.getsockname()[1]))
         except socket.error as e:
-            self.assertEquals(e.args[0], errno.EINPROGRESS)
+            self.assertEqual(e.args[0], errno.EINPROGRESS)
         else:
             #raise AssertionError("Connect should have raised EINPROGRESS")
             pass # FreeBSD doesn't raise an exception here
@@ -125,7 +125,7 @@
         events = kq.control(None, 4, 1)
         events = [(e.ident, e.filter, e.flags) for e in events]
         events.sort()
-        self.assertEquals(events, [
+        self.assertEqual(events, [
             (client.fileno(), select.KQ_FILTER_WRITE, flags),
             (server.fileno(), select.KQ_FILTER_WRITE, flags)])
 
@@ -144,7 +144,7 @@
         events = [(e.ident, e.filter, e.flags) for e in events]
         events.sort()
 
-        self.assertEquals(events, [
+        self.assertEqual(events, [
             (client.fileno(), select.KQ_FILTER_WRITE, flags),
             (client.fileno(), select.KQ_FILTER_READ, flags),
             (server.fileno(), select.KQ_FILTER_WRITE, flags),
@@ -167,7 +167,7 @@
         events = kq.control([], 4, 0.99)
         events = [(e.ident, e.filter, e.flags) for e in events]
         events.sort()
-        self.assertEquals(events, [
+        self.assertEqual(events, [
             (server.fileno(), select.KQ_FILTER_WRITE, flags)])
 
         client.close()
@@ -184,7 +184,7 @@
         r = kq.control([event1, event2], 1, 1)
         self.assertTrue(r)
         self.assertFalse(r[0].flags & select.KQ_EV_ERROR)
-        self.assertEquals(b.recv(r[0].data), b'foo')
+        self.assertEqual(b.recv(r[0].data), b'foo')
 
         a.close()
         b.close()

Modified: python/branches/py3k-cdecimal/Lib/test/test_linecache.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_linecache.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_linecache.py	Mon Nov 22 12:00:42 2010
@@ -42,33 +42,33 @@
         getline = linecache.getline
 
         # Bad values for line number should return an empty string
-        self.assertEquals(getline(FILENAME, 2**15), EMPTY)
-        self.assertEquals(getline(FILENAME, -1), EMPTY)
+        self.assertEqual(getline(FILENAME, 2**15), EMPTY)
+        self.assertEqual(getline(FILENAME, -1), EMPTY)
 
         # Float values currently raise TypeError, should it?
         self.assertRaises(TypeError, getline, FILENAME, 1.1)
 
         # Bad filenames should return an empty string
-        self.assertEquals(getline(EMPTY, 1), EMPTY)
-        self.assertEquals(getline(INVALID_NAME, 1), EMPTY)
+        self.assertEqual(getline(EMPTY, 1), EMPTY)
+        self.assertEqual(getline(INVALID_NAME, 1), EMPTY)
 
         # Check whether lines correspond to those from file iteration
         for entry in TESTS:
             filename = os.path.join(TEST_PATH, entry) + '.py'
             with open(filename) as file:
                 for index, line in enumerate(file):
-                    self.assertEquals(line, getline(filename, index + 1))
+                    self.assertEqual(line, getline(filename, index + 1))
 
         # Check module loading
         for entry in MODULES:
             filename = os.path.join(MODULE_PATH, entry) + '.py'
             with open(filename) as file:
                 for index, line in enumerate(file):
-                    self.assertEquals(line, getline(filename, index + 1))
+                    self.assertEqual(line, getline(filename, index + 1))
 
         # Check that bogus data isn't returned (issue #1309567)
         empty = linecache.getlines('a/b/c/__init__.py')
-        self.assertEquals(empty, [])
+        self.assertEqual(empty, [])
 
     def test_no_ending_newline(self):
         self.addCleanup(support.unlink, support.TESTFN)
@@ -86,12 +86,12 @@
 
         # Are all files cached?
         cached_empty = [fn for fn in cached if fn not in linecache.cache]
-        self.assertEquals(cached_empty, [])
+        self.assertEqual(cached_empty, [])
 
         # Can we clear the cache?
         linecache.clearcache()
         cached_empty = [fn for fn in cached if fn in linecache.cache]
-        self.assertEquals(cached_empty, [])
+        self.assertEqual(cached_empty, [])
 
     def test_checkcache(self):
         getline = linecache.getline
@@ -106,7 +106,7 @@
         source_list = []
         with open(source_name) as source:
             for index, line in enumerate(source):
-                self.assertEquals(line, getline(source_name, index + 1))
+                self.assertEqual(line, getline(source_name, index + 1))
                 source_list.append(line)
 
         with open(source_name, 'w') as source:
@@ -117,13 +117,13 @@
 
         # Check that the cache matches the old contents
         for index, line in enumerate(source_list):
-            self.assertEquals(line, getline(source_name, index + 1))
+            self.assertEqual(line, getline(source_name, index + 1))
 
         # Update the cache and check whether it matches the new source file
         linecache.checkcache(source_name)
         with open(source_name) as source:
             for index, line in enumerate(source):
-                self.assertEquals(line, getline(source_name, index + 1))
+                self.assertEqual(line, getline(source_name, index + 1))
                 source_list.append(line)
 
 def test_main():

Modified: python/branches/py3k-cdecimal/Lib/test/test_logging.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_logging.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_logging.py	Mon Nov 22 12:00:42 2010
@@ -127,14 +127,14 @@
         except AttributeError:
             # StringIO.StringIO lacks a reset() method.
             actual_lines = stream.getvalue().splitlines()
-        self.assertEquals(len(actual_lines), len(expected_values),
+        self.assertEqual(len(actual_lines), len(expected_values),
                           '%s vs. %s' % (actual_lines, expected_values))
         for actual, expected in zip(actual_lines, expected_values):
             match = pat.search(actual)
             if not match:
                 self.fail("Log line does not match expected pattern:\n" +
                             actual)
-            self.assertEquals(tuple(match.groups()), expected)
+            self.assertEqual(tuple(match.groups()), expected)
         s = stream.read()
         if s:
             self.fail("Remaining output at end of log stream:\n" + s)
@@ -729,7 +729,7 @@
             except RuntimeError:
                 logging.exception("just testing")
             sys.stdout.seek(0)
-            self.assertEquals(output.getvalue(),
+            self.assertEqual(output.getvalue(),
                 "ERROR:root:just testing\nGot a [RuntimeError]\n")
             # Original logger output is empty
             self.assert_log_lines([])
@@ -848,7 +848,7 @@
         logger = logging.getLogger("tcp")
         logger.error("spam")
         logger.debug("eggs")
-        self.assertEquals(self.get_output(), "spam\neggs\n")
+        self.assertEqual(self.get_output(), "spam\neggs\n")
 
 
 class MemoryTest(BaseTest):
@@ -1564,7 +1564,7 @@
             except RuntimeError:
                 logging.exception("just testing")
             sys.stdout.seek(0)
-            self.assertEquals(output.getvalue(),
+            self.assertEqual(output.getvalue(),
                 "ERROR:root:just testing\nGot a [RuntimeError]\n")
             # Original logger output is empty
             self.assert_log_lines([])
@@ -1579,7 +1579,7 @@
             except RuntimeError:
                 logging.exception("just testing")
             sys.stdout.seek(0)
-            self.assertEquals(output.getvalue(),
+            self.assertEqual(output.getvalue(),
                 "ERROR:root:just testing\nGot a [RuntimeError]\n")
             # Original logger output is empty
             self.assert_log_lines([])
@@ -2001,7 +2001,7 @@
     def test_compute_rollover(self, when=when, exp=exp):
         rh = logging.handlers.TimedRotatingFileHandler(
             self.fn, when=when, interval=1, backupCount=0)
-        self.assertEquals(exp, rh.computeRollover(0.0))
+        self.assertEqual(exp, rh.computeRollover(0.0))
         rh.close()
     setattr(TimedRotatingFileHandlerTest, "test_compute_rollover_%s" % when, test_compute_rollover)
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_marshal.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_marshal.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_marshal.py	Mon Nov 22 12:00:42 2010
@@ -149,8 +149,8 @@
 
     def test_version_argument(self):
         # Python 2.4.0 crashes for any call to marshal.dumps(x, y)
-        self.assertEquals(marshal.loads(marshal.dumps(5, 0)), 5)
-        self.assertEquals(marshal.loads(marshal.dumps(5, 1)), 5)
+        self.assertEqual(marshal.loads(marshal.dumps(5, 0)), 5)
+        self.assertEqual(marshal.loads(marshal.dumps(5, 1)), 5)
 
     def test_fuzz(self):
         # simple test that it's at least not *totally* trivial to

Modified: python/branches/py3k-cdecimal/Lib/test/test_math.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_math.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_math.py	Mon Nov 22 12:00:42 2010
@@ -209,7 +209,7 @@
         self.ftest('acosh(2)', math.acosh(2), 1.3169578969248168)
         self.assertRaises(ValueError, math.acosh, 0)
         self.assertRaises(ValueError, math.acosh, -1)
-        self.assertEquals(math.acosh(INF), INF)
+        self.assertEqual(math.acosh(INF), INF)
         self.assertRaises(ValueError, math.acosh, NINF)
         self.assertTrue(math.isnan(math.acosh(NAN)))
 
@@ -227,8 +227,8 @@
         self.ftest('asinh(0)', math.asinh(0), 0)
         self.ftest('asinh(1)', math.asinh(1), 0.88137358701954305)
         self.ftest('asinh(-1)', math.asinh(-1), -0.88137358701954305)
-        self.assertEquals(math.asinh(INF), INF)
-        self.assertEquals(math.asinh(NINF), NINF)
+        self.assertEqual(math.asinh(INF), INF)
+        self.assertEqual(math.asinh(NINF), NINF)
         self.assertTrue(math.isnan(math.asinh(NAN)))
 
     def testAtan(self):
@@ -314,15 +314,15 @@
 
     def testCeil(self):
         self.assertRaises(TypeError, math.ceil)
-        self.assertEquals(int, type(math.ceil(0.5)))
+        self.assertEqual(int, type(math.ceil(0.5)))
         self.ftest('ceil(0.5)', math.ceil(0.5), 1)
         self.ftest('ceil(1.0)', math.ceil(1.0), 1)
         self.ftest('ceil(1.5)', math.ceil(1.5), 2)
         self.ftest('ceil(-0.5)', math.ceil(-0.5), 0)
         self.ftest('ceil(-1.0)', math.ceil(-1.0), -1)
         self.ftest('ceil(-1.5)', math.ceil(-1.5), -1)
-        #self.assertEquals(math.ceil(INF), INF)
-        #self.assertEquals(math.ceil(NINF), NINF)
+        #self.assertEqual(math.ceil(INF), INF)
+        #self.assertEqual(math.ceil(NINF), NINF)
         #self.assertTrue(math.isnan(math.ceil(NAN)))
 
         class TestCeil:
@@ -348,19 +348,19 @@
 
         self.assertRaises(TypeError, math.copysign)
         # copysign should let us distinguish signs of zeros
-        self.assertEquals(math.copysign(1., 0.), 1.)
-        self.assertEquals(math.copysign(1., -0.), -1.)
-        self.assertEquals(math.copysign(INF, 0.), INF)
-        self.assertEquals(math.copysign(INF, -0.), NINF)
-        self.assertEquals(math.copysign(NINF, 0.), INF)
-        self.assertEquals(math.copysign(NINF, -0.), NINF)
+        self.assertEqual(math.copysign(1., 0.), 1.)
+        self.assertEqual(math.copysign(1., -0.), -1.)
+        self.assertEqual(math.copysign(INF, 0.), INF)
+        self.assertEqual(math.copysign(INF, -0.), NINF)
+        self.assertEqual(math.copysign(NINF, 0.), INF)
+        self.assertEqual(math.copysign(NINF, -0.), NINF)
         # and of infinities
-        self.assertEquals(math.copysign(1., INF), 1.)
-        self.assertEquals(math.copysign(1., NINF), -1.)
-        self.assertEquals(math.copysign(INF, INF), INF)
-        self.assertEquals(math.copysign(INF, NINF), NINF)
-        self.assertEquals(math.copysign(NINF, INF), INF)
-        self.assertEquals(math.copysign(NINF, NINF), NINF)
+        self.assertEqual(math.copysign(1., INF), 1.)
+        self.assertEqual(math.copysign(1., NINF), -1.)
+        self.assertEqual(math.copysign(INF, INF), INF)
+        self.assertEqual(math.copysign(INF, NINF), NINF)
+        self.assertEqual(math.copysign(NINF, INF), INF)
+        self.assertEqual(math.copysign(NINF, NINF), NINF)
         self.assertTrue(math.isnan(math.copysign(NAN, 1.)))
         self.assertTrue(math.isnan(math.copysign(NAN, INF)))
         self.assertTrue(math.isnan(math.copysign(NAN, NINF)))
@@ -370,7 +370,7 @@
         # given platform.
         self.assertTrue(math.isinf(math.copysign(INF, NAN)))
         # similarly, copysign(2., NAN) could be 2. or -2.
-        self.assertEquals(abs(math.copysign(2., NAN)), 2.)
+        self.assertEqual(abs(math.copysign(2., NAN)), 2.)
 
     def testCos(self):
         self.assertRaises(TypeError, math.cos)
@@ -390,8 +390,8 @@
         self.assertRaises(TypeError, math.cosh)
         self.ftest('cosh(0)', math.cosh(0), 1)
         self.ftest('cosh(2)-2*cosh(1)**2', math.cosh(2)-2*math.cosh(1)**2, -1) # Thanks to Lambert
-        self.assertEquals(math.cosh(INF), INF)
-        self.assertEquals(math.cosh(NINF), INF)
+        self.assertEqual(math.cosh(INF), INF)
+        self.assertEqual(math.cosh(NINF), INF)
         self.assertTrue(math.isnan(math.cosh(NAN)))
 
     def testDegrees(self):
@@ -405,8 +405,8 @@
         self.ftest('exp(-1)', math.exp(-1), 1/math.e)
         self.ftest('exp(0)', math.exp(0), 1)
         self.ftest('exp(1)', math.exp(1), math.e)
-        self.assertEquals(math.exp(INF), INF)
-        self.assertEquals(math.exp(NINF), 0.)
+        self.assertEqual(math.exp(INF), INF)
+        self.assertEqual(math.exp(NINF), 0.)
         self.assertTrue(math.isnan(math.exp(NAN)))
 
     def testFabs(self):
@@ -432,7 +432,7 @@
 
     def testFloor(self):
         self.assertRaises(TypeError, math.floor)
-        self.assertEquals(int, type(math.floor(0.5)))
+        self.assertEqual(int, type(math.floor(0.5)))
         self.ftest('floor(0.5)', math.floor(0.5), 0)
         self.ftest('floor(1.0)', math.floor(1.0), 1)
         self.ftest('floor(1.5)', math.floor(1.5), 1)
@@ -443,8 +443,8 @@
         # This fails on some platforms - so check it here
         self.ftest('floor(1.23e167)', math.floor(1.23e167), 1.23e167)
         self.ftest('floor(-1.23e167)', math.floor(-1.23e167), -1.23e167)
-        #self.assertEquals(math.ceil(INF), INF)
-        #self.assertEquals(math.ceil(NINF), NINF)
+        #self.assertEqual(math.ceil(INF), INF)
+        #self.assertEqual(math.ceil(NINF), NINF)
         #self.assertTrue(math.isnan(math.floor(NAN)))
 
         class TestFloor:
@@ -475,12 +475,12 @@
         self.assertRaises(ValueError, math.fmod, INF, 1.)
         self.assertRaises(ValueError, math.fmod, NINF, 1.)
         self.assertRaises(ValueError, math.fmod, INF, 0.)
-        self.assertEquals(math.fmod(3.0, INF), 3.0)
-        self.assertEquals(math.fmod(-3.0, INF), -3.0)
-        self.assertEquals(math.fmod(3.0, NINF), 3.0)
-        self.assertEquals(math.fmod(-3.0, NINF), -3.0)
-        self.assertEquals(math.fmod(0.0, 3.0), 0.0)
-        self.assertEquals(math.fmod(0.0, NINF), 0.0)
+        self.assertEqual(math.fmod(3.0, INF), 3.0)
+        self.assertEqual(math.fmod(-3.0, INF), -3.0)
+        self.assertEqual(math.fmod(3.0, NINF), 3.0)
+        self.assertEqual(math.fmod(-3.0, NINF), -3.0)
+        self.assertEqual(math.fmod(0.0, 3.0), 0.0)
+        self.assertEqual(math.fmod(0.0, NINF), 0.0)
 
     def testFrexp(self):
         self.assertRaises(TypeError, math.frexp)
@@ -496,8 +496,8 @@
         testfrexp('frexp(1)', math.frexp(1), (0.5, 1))
         testfrexp('frexp(2)', math.frexp(2), (0.5, 2))
 
-        self.assertEquals(math.frexp(INF)[0], INF)
-        self.assertEquals(math.frexp(NINF)[0], NINF)
+        self.assertEqual(math.frexp(INF)[0], INF)
+        self.assertEqual(math.frexp(NINF)[0], NINF)
         self.assertTrue(math.isnan(math.frexp(NAN)[0]))
 
     @requires_IEEE_754
@@ -610,28 +610,28 @@
         self.ftest('ldexp(-1,1)', math.ldexp(-1,1), -2)
         self.assertRaises(OverflowError, math.ldexp, 1., 1000000)
         self.assertRaises(OverflowError, math.ldexp, -1., 1000000)
-        self.assertEquals(math.ldexp(1., -1000000), 0.)
-        self.assertEquals(math.ldexp(-1., -1000000), -0.)
-        self.assertEquals(math.ldexp(INF, 30), INF)
-        self.assertEquals(math.ldexp(NINF, -213), NINF)
+        self.assertEqual(math.ldexp(1., -1000000), 0.)
+        self.assertEqual(math.ldexp(-1., -1000000), -0.)
+        self.assertEqual(math.ldexp(INF, 30), INF)
+        self.assertEqual(math.ldexp(NINF, -213), NINF)
         self.assertTrue(math.isnan(math.ldexp(NAN, 0)))
 
         # large second argument
         for n in [10**5, 10**10, 10**20, 10**40]:
-            self.assertEquals(math.ldexp(INF, -n), INF)
-            self.assertEquals(math.ldexp(NINF, -n), NINF)
-            self.assertEquals(math.ldexp(1., -n), 0.)
-            self.assertEquals(math.ldexp(-1., -n), -0.)
-            self.assertEquals(math.ldexp(0., -n), 0.)
-            self.assertEquals(math.ldexp(-0., -n), -0.)
+            self.assertEqual(math.ldexp(INF, -n), INF)
+            self.assertEqual(math.ldexp(NINF, -n), NINF)
+            self.assertEqual(math.ldexp(1., -n), 0.)
+            self.assertEqual(math.ldexp(-1., -n), -0.)
+            self.assertEqual(math.ldexp(0., -n), 0.)
+            self.assertEqual(math.ldexp(-0., -n), -0.)
             self.assertTrue(math.isnan(math.ldexp(NAN, -n)))
 
             self.assertRaises(OverflowError, math.ldexp, 1., n)
             self.assertRaises(OverflowError, math.ldexp, -1., n)
-            self.assertEquals(math.ldexp(0., n), 0.)
-            self.assertEquals(math.ldexp(-0., n), -0.)
-            self.assertEquals(math.ldexp(INF, n), INF)
-            self.assertEquals(math.ldexp(NINF, n), NINF)
+            self.assertEqual(math.ldexp(0., n), 0.)
+            self.assertEqual(math.ldexp(-0., n), -0.)
+            self.assertEqual(math.ldexp(INF, n), INF)
+            self.assertEqual(math.ldexp(NINF, n), NINF)
             self.assertTrue(math.isnan(math.ldexp(NAN, n)))
 
     def testLog(self):
@@ -647,13 +647,13 @@
         self.assertRaises(ValueError, math.log, -1.5)
         self.assertRaises(ValueError, math.log, -10**1000)
         self.assertRaises(ValueError, math.log, NINF)
-        self.assertEquals(math.log(INF), INF)
+        self.assertEqual(math.log(INF), INF)
         self.assertTrue(math.isnan(math.log(NAN)))
 
     def testLog1p(self):
         self.assertRaises(TypeError, math.log1p)
         n= 2**90
-        self.assertAlmostEquals(math.log1p(n), math.log1p(float(n)))
+        self.assertAlmostEqual(math.log1p(n), math.log1p(float(n)))
 
     def testLog10(self):
         self.assertRaises(TypeError, math.log10)
@@ -664,7 +664,7 @@
         self.assertRaises(ValueError, math.log10, -1.5)
         self.assertRaises(ValueError, math.log10, -10**1000)
         self.assertRaises(ValueError, math.log10, NINF)
-        self.assertEquals(math.log(INF), INF)
+        self.assertEqual(math.log(INF), INF)
         self.assertTrue(math.isnan(math.log10(NAN)))
 
     def testModf(self):
@@ -679,8 +679,8 @@
         testmodf('modf(1.5)', math.modf(1.5), (0.5, 1.0))
         testmodf('modf(-1.5)', math.modf(-1.5), (-0.5, -1.0))
 
-        self.assertEquals(math.modf(INF), (0.0, INF))
-        self.assertEquals(math.modf(NINF), (-0.0, NINF))
+        self.assertEqual(math.modf(INF), (0.0, INF))
+        self.assertEqual(math.modf(NINF), (-0.0, NINF))
 
         modf_nan = math.modf(NAN)
         self.assertTrue(math.isnan(modf_nan[0]))
@@ -859,8 +859,8 @@
         self.ftest('sinh(0)', math.sinh(0), 0)
         self.ftest('sinh(1)**2-cosh(1)**2', math.sinh(1)**2-math.cosh(1)**2, -1)
         self.ftest('sinh(1)+sinh(-1)', math.sinh(1)+math.sinh(-1), 0)
-        self.assertEquals(math.sinh(INF), INF)
-        self.assertEquals(math.sinh(NINF), NINF)
+        self.assertEqual(math.sinh(INF), INF)
+        self.assertEqual(math.sinh(NINF), NINF)
         self.assertTrue(math.isnan(math.sinh(NAN)))
 
     def testSqrt(self):
@@ -868,7 +868,7 @@
         self.ftest('sqrt(0)', math.sqrt(0), 0)
         self.ftest('sqrt(1)', math.sqrt(1), 1)
         self.ftest('sqrt(4)', math.sqrt(4), 2)
-        self.assertEquals(math.sqrt(INF), INF)
+        self.assertEqual(math.sqrt(INF), INF)
         self.assertRaises(ValueError, math.sqrt, NINF)
         self.assertTrue(math.isnan(math.sqrt(NAN)))
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_memoryio.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_memoryio.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_memoryio.py	Mon Nov 22 12:00:42 2010
@@ -20,17 +20,17 @@
         buf = self.buftype("1234567890")
         bytesIo = self.ioclass(buf)
 
-        self.assertEquals(buf[:1], bytesIo.read(1))
-        self.assertEquals(buf[1:5], bytesIo.read(4))
-        self.assertEquals(buf[5:], bytesIo.read(900))
-        self.assertEquals(self.EOF, bytesIo.read())
+        self.assertEqual(buf[:1], bytesIo.read(1))
+        self.assertEqual(buf[1:5], bytesIo.read(4))
+        self.assertEqual(buf[5:], bytesIo.read(900))
+        self.assertEqual(self.EOF, bytesIo.read())
 
     def testReadNoArgs(self):
         buf = self.buftype("1234567890")
         bytesIo = self.ioclass(buf)
 
-        self.assertEquals(buf, bytesIo.read())
-        self.assertEquals(self.EOF, bytesIo.read())
+        self.assertEqual(buf, bytesIo.read())
+        self.assertEqual(self.EOF, bytesIo.read())
 
     def testSeek(self):
         buf = self.buftype("1234567890")
@@ -38,21 +38,21 @@
 
         bytesIo.read(5)
         bytesIo.seek(0)
-        self.assertEquals(buf, bytesIo.read())
+        self.assertEqual(buf, bytesIo.read())
 
         bytesIo.seek(3)
-        self.assertEquals(buf[3:], bytesIo.read())
+        self.assertEqual(buf[3:], bytesIo.read())
         self.assertRaises(TypeError, bytesIo.seek, 0.0)
 
     def testTell(self):
         buf = self.buftype("1234567890")
         bytesIo = self.ioclass(buf)
 
-        self.assertEquals(0, bytesIo.tell())
+        self.assertEqual(0, bytesIo.tell())
         bytesIo.seek(5)
-        self.assertEquals(5, bytesIo.tell())
+        self.assertEqual(5, bytesIo.tell())
         bytesIo.seek(10000)
-        self.assertEquals(10000, bytesIo.tell())
+        self.assertEqual(10000, bytesIo.tell())
 
 
 class MemoryTestMixin:
@@ -452,6 +452,11 @@
         self.assertEqual(a.tobytes(), b"1234567890d")
         memio.close()
         self.assertRaises(ValueError, memio.readinto, b)
+        memio = self.ioclass(b"123")
+        b = bytearray()
+        memio.seek(42)
+        memio.readinto(b)
+        self.assertEqual(b, b"")
 
     def test_relative_seek(self):
         buf = self.buftype("1234567890")
@@ -629,7 +634,7 @@
         self.assertEqual(len(state), 3)
         bytearray(state[0]) # Check if state[0] supports the buffer interface.
         self.assertIsInstance(state[1], int)
-        self.assert_(isinstance(state[2], dict) or state[2] is None)
+        self.assertTrue(isinstance(state[2], dict) or state[2] is None)
         memio.close()
         self.assertRaises(ValueError, memio.__getstate__)
 
@@ -675,7 +680,7 @@
         self.assertIsInstance(state[0], str)
         self.assertIsInstance(state[1], str)
         self.assertIsInstance(state[2], int)
-        self.assert_(isinstance(state[3], dict) or state[3] is None)
+        self.assertTrue(isinstance(state[3], dict) or state[3] is None)
         memio.close()
         self.assertRaises(ValueError, memio.__getstate__)
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_memoryview.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_memoryview.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_memoryview.py	Mon Nov 22 12:00:42 2010
@@ -27,11 +27,11 @@
         b = tp(self._source)
         oldrefcount = sys.getrefcount(b)
         m = self._view(b)
-        self.assertEquals(m[0], item(b"a"))
+        self.assertEqual(m[0], item(b"a"))
         self.assertIsInstance(m[0], bytes)
-        self.assertEquals(m[5], item(b"f"))
-        self.assertEquals(m[-1], item(b"f"))
-        self.assertEquals(m[-6], item(b"a"))
+        self.assertEqual(m[5], item(b"f"))
+        self.assertEqual(m[-1], item(b"f"))
+        self.assertEqual(m[-6], item(b"a"))
         # Bounds checking
         self.assertRaises(IndexError, lambda: m[6])
         self.assertRaises(IndexError, lambda: m[-7])
@@ -42,7 +42,7 @@
         self.assertRaises(TypeError, lambda: m[0.0])
         self.assertRaises(TypeError, lambda: m["a"])
         m = None
-        self.assertEquals(sys.getrefcount(b), oldrefcount)
+        self.assertEqual(sys.getrefcount(b), oldrefcount)
 
     def test_getitem(self):
         for tp in self._types:
@@ -66,7 +66,7 @@
         self.assertRaises(TypeError, setitem, 65)
         self.assertRaises(TypeError, setitem, memoryview(b"a"))
         m = None
-        self.assertEquals(sys.getrefcount(b), oldrefcount)
+        self.assertEqual(sys.getrefcount(b), oldrefcount)
 
     def test_setitem_writable(self):
         if not self.rw_type:
@@ -109,7 +109,7 @@
         self.assertRaises(ValueError, setitem, slice(0,2), b"a")
 
         m = None
-        self.assertEquals(sys.getrefcount(b), oldrefcount)
+        self.assertEqual(sys.getrefcount(b), oldrefcount)
 
     def test_delitem(self):
         for tp in self._types:
@@ -127,14 +127,14 @@
             # This calls self.getitem_type() on each separate byte of b"abcdef"
             expected = b"".join(
                 self.getitem_type(bytes([c])) for c in b"abcdef")
-            self.assertEquals(b, expected)
+            self.assertEqual(b, expected)
             self.assertIsInstance(b, bytes)
 
     def test_tolist(self):
         for tp in self._types:
             m = self._view(tp(self._source))
             l = m.tolist()
-            self.assertEquals(l, list(b"abcdef"))
+            self.assertEqual(l, list(b"abcdef"))
 
     def test_compare(self):
         # memoryviews can compare for equality with other objects
@@ -168,26 +168,26 @@
 
     def check_attributes_with_type(self, tp):
         m = self._view(tp(self._source))
-        self.assertEquals(m.format, self.format)
-        self.assertEquals(m.itemsize, self.itemsize)
-        self.assertEquals(m.ndim, 1)
-        self.assertEquals(m.shape, (6,))
-        self.assertEquals(len(m), 6)
-        self.assertEquals(m.strides, (self.itemsize,))
-        self.assertEquals(m.suboffsets, None)
+        self.assertEqual(m.format, self.format)
+        self.assertEqual(m.itemsize, self.itemsize)
+        self.assertEqual(m.ndim, 1)
+        self.assertEqual(m.shape, (6,))
+        self.assertEqual(len(m), 6)
+        self.assertEqual(m.strides, (self.itemsize,))
+        self.assertEqual(m.suboffsets, None)
         return m
 
     def test_attributes_readonly(self):
         if not self.ro_type:
             return
         m = self.check_attributes_with_type(self.ro_type)
-        self.assertEquals(m.readonly, True)
+        self.assertEqual(m.readonly, True)
 
     def test_attributes_writable(self):
         if not self.rw_type:
             return
         m = self.check_attributes_with_type(self.rw_type)
-        self.assertEquals(m.readonly, False)
+        self.assertEqual(m.readonly, False)
 
     def test_getbuffer(self):
         # Test PyObject_GetBuffer() on a memoryview object.
@@ -198,9 +198,9 @@
             oldviewrefcount = sys.getrefcount(m)
             s = str(m, "utf-8")
             self._check_contents(tp, b, s.encode("utf-8"))
-            self.assertEquals(sys.getrefcount(m), oldviewrefcount)
+            self.assertEqual(sys.getrefcount(m), oldviewrefcount)
             m = None
-            self.assertEquals(sys.getrefcount(b), oldrefcount)
+            self.assertEqual(sys.getrefcount(b), oldrefcount)
 
     def test_gc(self):
         for tp in self._types:
@@ -307,7 +307,7 @@
         return memoryview(obj)
 
     def _check_contents(self, tp, obj, contents):
-        self.assertEquals(obj, tp(contents))
+        self.assertEqual(obj, tp(contents))
 
 class BaseMemorySliceTests:
     source_bytes = b"XabcdefY"
@@ -317,14 +317,14 @@
         return m[1:7]
 
     def _check_contents(self, tp, obj, contents):
-        self.assertEquals(obj[1:7], tp(contents))
+        self.assertEqual(obj[1:7], tp(contents))
 
     def test_refs(self):
         for tp in self._types:
             m = memoryview(tp(self._source))
             oldrefcount = sys.getrefcount(m)
             m[1:2]
-            self.assertEquals(sys.getrefcount(m), oldrefcount)
+            self.assertEqual(sys.getrefcount(m), oldrefcount)
 
 class BaseMemorySliceSliceTests:
     source_bytes = b"XabcdefY"
@@ -334,7 +334,7 @@
         return m[:7][1:]
 
     def _check_contents(self, tp, obj, contents):
-        self.assertEquals(obj[1:7], tp(contents))
+        self.assertEqual(obj[1:7], tp(contents))
 
 
 # Concrete test classes
@@ -361,7 +361,7 @@
         m = memoryview(a)
         new_a = array.array('i', range(9, -1, -1))
         m[:] = new_a
-        self.assertEquals(a, new_a)
+        self.assertEqual(a, new_a)
 
 
 class BytesMemorySliceTest(unittest.TestCase,

Modified: python/branches/py3k-cdecimal/Lib/test/test_minidom.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_minidom.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_minidom.py	Mon Nov 22 12:00:42 2010
@@ -755,7 +755,7 @@
     def check_clone_pi(self, deep, testName):
         doc = parseString("<?target data?><doc/>")
         pi = doc.firstChild
-        self.assertEquals(pi.nodeType, Node.PROCESSING_INSTRUCTION_NODE)
+        self.assertEqual(pi.nodeType, Node.PROCESSING_INSTRUCTION_NODE)
         clone = pi.cloneNode(deep)
         self.confirm(clone.target == pi.target
                 and clone.data == pi.data)
@@ -955,7 +955,7 @@
     def testBug0777884(self):
         doc = parseString("<o>text</o>")
         text = doc.documentElement.childNodes[0]
-        self.assertEquals(text.nodeType, Node.TEXT_NODE)
+        self.assertEqual(text.nodeType, Node.TEXT_NODE)
         # Should run quietly, doing nothing.
         text.normalize()
         doc.unlink()
@@ -1233,7 +1233,7 @@
         doc = parseString("<doc>a</doc>")
         elem = doc.documentElement
         text = elem.childNodes[0]
-        self.assertEquals(text.nodeType, Node.TEXT_NODE)
+        self.assertEqual(text.nodeType, Node.TEXT_NODE)
 
         self.checkWholeText(text, "a")
         elem.appendChild(doc.createTextNode("b"))

Modified: python/branches/py3k-cdecimal/Lib/test/test_mmap.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_mmap.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_mmap.py	Mon Nov 22 12:00:42 2010
@@ -413,7 +413,7 @@
                     data = bytes(reversed(data))
                     L[start:stop:step] = data
                     m[start:stop:step] = data
-                    self.assertEquals(m[:], bytes(L))
+                    self.assertEqual(m[:], bytes(L))
 
     def make_mmap_file (self, f, halfsize):
         # Write 2 pages worth of data to the file
@@ -510,27 +510,27 @@
         f.close()
         # Test write_byte()
         for i in range(len(data)):
-            self.assertEquals(m.tell(), i)
+            self.assertEqual(m.tell(), i)
             m.write_byte(data[i])
-            self.assertEquals(m.tell(), i+1)
+            self.assertEqual(m.tell(), i+1)
         self.assertRaises(ValueError, m.write_byte, b"x"[0])
-        self.assertEquals(m[:], data)
+        self.assertEqual(m[:], data)
         # Test read_byte()
         m.seek(0)
         for i in range(len(data)):
-            self.assertEquals(m.tell(), i)
-            self.assertEquals(m.read_byte(), data[i])
-            self.assertEquals(m.tell(), i+1)
+            self.assertEqual(m.tell(), i)
+            self.assertEqual(m.read_byte(), data[i])
+            self.assertEqual(m.tell(), i+1)
         self.assertRaises(ValueError, m.read_byte)
         # Test read()
         m.seek(3)
-        self.assertEquals(m.read(3), b"345")
-        self.assertEquals(m.tell(), 6)
+        self.assertEqual(m.read(3), b"345")
+        self.assertEqual(m.tell(), 6)
         # Test write()
         m.seek(3)
         m.write(b"bar")
-        self.assertEquals(m.tell(), 6)
-        self.assertEquals(m[:], b"012bar6789")
+        self.assertEqual(m.tell(), 6)
+        self.assertEqual(m[:], b"012bar6789")
         m.seek(8)
         self.assertRaises(ValueError, m.write, b"bar")
 
@@ -538,9 +538,9 @@
         for b in (129, 200, 255): # > 128
             m = mmap.mmap(-1, 1)
             m.write_byte(b)
-            self.assertEquals(m[0], b)
+            self.assertEqual(m[0], b)
             m.seek(0)
-            self.assertEquals(m.read_byte(), b)
+            self.assertEqual(m.read_byte(), b)
             m.close()
 
     if os.name == 'nt':
@@ -554,8 +554,8 @@
             m1[:] = data1
             m2 = mmap.mmap(-1, len(data2), tagname="foo")
             m2[:] = data2
-            self.assertEquals(m1[:], data2)
-            self.assertEquals(m2[:], data2)
+            self.assertEqual(m1[:], data2)
+            self.assertEqual(m2[:], data2)
             m2.close()
             m1.close()
 
@@ -564,8 +564,8 @@
             m1[:] = data1
             m2 = mmap.mmap(-1, len(data2), tagname="boo")
             m2[:] = data2
-            self.assertEquals(m1[:], data1)
-            self.assertEquals(m2[:], data2)
+            self.assertEqual(m1[:], data1)
+            self.assertEqual(m2[:], data2)
             m2.close()
             m1.close()
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_multiprocessing.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_multiprocessing.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_multiprocessing.py	Mon Nov 22 12:00:42 2010
@@ -186,30 +186,30 @@
         current = self.current_process()
 
         if self.TYPE != 'threads':
-            self.assertEquals(p.authkey, current.authkey)
-        self.assertEquals(p.is_alive(), False)
-        self.assertEquals(p.daemon, True)
+            self.assertEqual(p.authkey, current.authkey)
+        self.assertEqual(p.is_alive(), False)
+        self.assertEqual(p.daemon, True)
         self.assertNotIn(p, self.active_children())
         self.assertTrue(type(self.active_children()) is list)
         self.assertEqual(p.exitcode, None)
 
         p.start()
 
-        self.assertEquals(p.exitcode, None)
-        self.assertEquals(p.is_alive(), True)
+        self.assertEqual(p.exitcode, None)
+        self.assertEqual(p.is_alive(), True)
         self.assertIn(p, self.active_children())
 
-        self.assertEquals(q.get(), args[1:])
-        self.assertEquals(q.get(), kwargs)
-        self.assertEquals(q.get(), p.name)
+        self.assertEqual(q.get(), args[1:])
+        self.assertEqual(q.get(), kwargs)
+        self.assertEqual(q.get(), p.name)
         if self.TYPE != 'threads':
-            self.assertEquals(q.get(), current.authkey)
-            self.assertEquals(q.get(), p.pid)
+            self.assertEqual(q.get(), current.authkey)
+            self.assertEqual(q.get(), p.pid)
 
         p.join()
 
-        self.assertEquals(p.exitcode, 0)
-        self.assertEquals(p.is_alive(), False)
+        self.assertEqual(p.exitcode, 0)
+        self.assertEqual(p.is_alive(), False)
         self.assertNotIn(p, self.active_children())
 
     @classmethod

Modified: python/branches/py3k-cdecimal/Lib/test/test_nntplib.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_nntplib.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_nntplib.py	Mon Nov 22 12:00:42 2010
@@ -2,7 +2,9 @@
 import datetime
 import textwrap
 import unittest
+import functools
 import contextlib
+import collections
 from test import support
 from nntplib import NNTP, GroupInfo, _have_ssl
 import nntplib
@@ -225,8 +227,32 @@
     def test_zzquit(self):
         # This test must be called last, hence the name
         cls = type(self)
-        self.server.quit()
-        cls.server = None
+        try:
+            self.server.quit()
+        finally:
+            cls.server = None
+
+    @classmethod
+    def wrap_methods(cls):
+        # Wrap all methods in a transient_internet() exception catcher
+        # XXX put a generic version in test.support?
+        def wrap_meth(meth):
+            @functools.wraps(meth)
+            def wrapped(self):
+                with support.transient_internet(self.NNTP_HOST):
+                    meth(self)
+            return wrapped
+        for name in dir(cls):
+            if not name.startswith('test_'):
+                continue
+            meth = getattr(cls, name)
+            if not isinstance(meth, collections.Callable):
+                continue
+            # Need to use a closure so that meth remains bound to its current
+            # value
+            setattr(cls, name, wrap_meth(meth))
+
+NetworkedNNTPTestsMixin.wrap_methods()
 
 
 class NetworkedNNTPTests(NetworkedNNTPTestsMixin, unittest.TestCase):
@@ -235,11 +261,13 @@
     GROUP_NAME = 'fr.comp.lang.python'
     GROUP_PAT = 'fr.comp.lang.*'
 
+    NNTP_CLASS = NNTP
+
     @classmethod
     def setUpClass(cls):
         support.requires("network")
         with support.transient_internet(cls.NNTP_HOST):
-            cls.server = NNTP(cls.NNTP_HOST, timeout=TIMEOUT, usenetrc=False)
+            cls.server = cls.NNTP_CLASS(cls.NNTP_HOST, timeout=TIMEOUT, usenetrc=False)
 
     @classmethod
     def tearDownClass(cls):
@@ -248,7 +276,7 @@
 
 
 if _have_ssl:
-    class NetworkedNNTP_SSLTests(NetworkedNNTPTestsMixin, unittest.TestCase):
+    class NetworkedNNTP_SSLTests(NetworkedNNTPTests):
 
         # Technical limits for this public NNTP server (see http://www.aioe.org):
         # "Only two concurrent connections per IP address are allowed and
@@ -258,17 +286,7 @@
         GROUP_NAME = 'comp.lang.python'
         GROUP_PAT = 'comp.lang.*'
 
-        @classmethod
-        def setUpClass(cls):
-            support.requires("network")
-            with support.transient_internet(cls.NNTP_HOST):
-                cls.server = nntplib.NNTP_SSL(cls.NNTP_HOST, timeout=TIMEOUT,
-                                              usenetrc=False)
-
-        @classmethod
-        def tearDownClass(cls):
-            if cls.server is not None:
-                cls.server.quit()
+        NNTP_CLASS = nntplib.NNTP_SSL
 
         # Disabled as it produces too much data
         test_list = None

Modified: python/branches/py3k-cdecimal/Lib/test/test_opcodes.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_opcodes.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_opcodes.py	Mon Nov 22 12:00:42 2010
@@ -68,35 +68,35 @@
 
         f = eval('lambda: None')
         g = eval('lambda: None')
-        self.assertNotEquals(f, g)
+        self.assertNotEqual(f, g)
 
         f = eval('lambda a: a')
         g = eval('lambda a: a')
-        self.assertNotEquals(f, g)
+        self.assertNotEqual(f, g)
 
         f = eval('lambda a=1: a')
         g = eval('lambda a=1: a')
-        self.assertNotEquals(f, g)
+        self.assertNotEqual(f, g)
 
         f = eval('lambda: 0')
         g = eval('lambda: 1')
-        self.assertNotEquals(f, g)
+        self.assertNotEqual(f, g)
 
         f = eval('lambda: None')
         g = eval('lambda a: None')
-        self.assertNotEquals(f, g)
+        self.assertNotEqual(f, g)
 
         f = eval('lambda a: None')
         g = eval('lambda b: None')
-        self.assertNotEquals(f, g)
+        self.assertNotEqual(f, g)
 
         f = eval('lambda a: None')
         g = eval('lambda a=None: None')
-        self.assertNotEquals(f, g)
+        self.assertNotEqual(f, g)
 
         f = eval('lambda a=0: None')
         g = eval('lambda a=1: None')
-        self.assertNotEquals(f, g)
+        self.assertNotEqual(f, g)
 
     def test_modulo_of_string_subclasses(self):
         class MyString(str):

Modified: python/branches/py3k-cdecimal/Lib/test/test_operator.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_operator.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_operator.py	Mon Nov 22 12:00:42 2010
@@ -360,12 +360,12 @@
         f = operator.methodcaller('foo')
         self.assertRaises(IndexError, f, a)
         f = operator.methodcaller('foo', 1, 2)
-        self.assertEquals(f(a), 3)
+        self.assertEqual(f(a), 3)
         f = operator.methodcaller('bar')
-        self.assertEquals(f(a), 42)
+        self.assertEqual(f(a), 42)
         self.assertRaises(TypeError, f, a, a)
         f = operator.methodcaller('bar', f=5)
-        self.assertEquals(f(a), 5)
+        self.assertEqual(f(a), 5)
 
     def test_inplace(self):
         class C(object):

Modified: python/branches/py3k-cdecimal/Lib/test/test_optparse.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_optparse.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_optparse.py	Mon Nov 22 12:00:42 2010
@@ -423,13 +423,13 @@
 
     def test_str_aliases_string(self):
         self.parser.add_option("-s", type="str")
-        self.assertEquals(self.parser.get_option("-s").type, "string")
+        self.assertEqual(self.parser.get_option("-s").type, "string")
 
     def test_type_object(self):
         self.parser.add_option("-s", type=str)
-        self.assertEquals(self.parser.get_option("-s").type, "string")
+        self.assertEqual(self.parser.get_option("-s").type, "string")
         self.parser.add_option("-x", type=int)
-        self.assertEquals(self.parser.get_option("-x").type, "int")
+        self.assertEqual(self.parser.get_option("-x").type, "int")
 
 
 # Custom type for testing processing of default values.

Modified: python/branches/py3k-cdecimal/Lib/test/test_os.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_os.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_os.py	Mon Nov 22 12:00:42 2010
@@ -229,8 +229,8 @@
         result = os.stat(fname)
 
         # Make sure direct access works
-        self.assertEquals(result[stat.ST_SIZE], 3)
-        self.assertEquals(result.st_size, 3)
+        self.assertEqual(result[stat.ST_SIZE], 3)
+        self.assertEqual(result.st_size, 3)
 
         # Make sure all the attributes are there
         members = dir(result)
@@ -241,7 +241,7 @@
                     def trunc(x): return int(x)
                 else:
                     def trunc(x): return x
-                self.assertEquals(trunc(getattr(result, attr)),
+                self.assertEqual(trunc(getattr(result, attr)),
                                   result[getattr(stat, name)])
                 self.assertIn(attr, members)
 
@@ -305,13 +305,13 @@
                 return
 
         # Make sure direct access works
-        self.assertEquals(result.f_bfree, result[3])
+        self.assertEqual(result.f_bfree, result[3])
 
         # Make sure all the attributes are there.
         members = ('bsize', 'frsize', 'blocks', 'bfree', 'bavail', 'files',
                     'ffree', 'favail', 'flag', 'namemax')
         for value, member in enumerate(members):
-            self.assertEquals(getattr(result, 'f_' + member), result[value])
+            self.assertEqual(getattr(result, 'f_' + member), result[value])
 
         # Make sure that assignment really fails
         try:
@@ -346,7 +346,7 @@
         # time stamps in stat, but not in utime.
         os.utime(support.TESTFN, (st.st_atime, int(st.st_mtime-delta)))
         st2 = os.stat(support.TESTFN)
-        self.assertEquals(st2.st_mtime, int(st.st_mtime-delta))
+        self.assertEqual(st2.st_mtime, int(st.st_mtime-delta))
 
     # Restrict test to Win32, since there is no guarantee other
     # systems support centiseconds
@@ -363,7 +363,7 @@
             def test_1565150(self):
                 t1 = 1159195039.25
                 os.utime(self.fname, (t1, t1))
-                self.assertEquals(os.stat(self.fname).st_mtime, t1)
+                self.assertEqual(os.stat(self.fname).st_mtime, t1)
 
         def test_1686475(self):
             # Verify that an open file can be stat'ed
@@ -408,24 +408,24 @@
             os.environ.update(HELLO="World")
             with os.popen("/bin/sh -c 'echo $HELLO'") as popen:
                 value = popen.read().strip()
-                self.assertEquals(value, "World")
+                self.assertEqual(value, "World")
 
     def test_os_popen_iter(self):
         if os.path.exists("/bin/sh"):
             with os.popen(
                 "/bin/sh -c 'echo \"line1\nline2\nline3\"'") as popen:
                 it = iter(popen)
-                self.assertEquals(next(it), "line1\n")
-                self.assertEquals(next(it), "line2\n")
-                self.assertEquals(next(it), "line3\n")
+                self.assertEqual(next(it), "line1\n")
+                self.assertEqual(next(it), "line2\n")
+                self.assertEqual(next(it), "line3\n")
                 self.assertRaises(StopIteration, next, it)
 
     # Verify environ keys and values from the OS are of the
     # correct str type.
     def test_keyvalue_types(self):
         for key, val in os.environ.items():
-            self.assertEquals(type(key), str)
-            self.assertEquals(type(val), str)
+            self.assertEqual(type(key), str)
+            self.assertEqual(type(val), str)
 
     def test_items(self):
         for key, value in self._reference().items():
@@ -493,15 +493,15 @@
                 sys.getfilesystemencoding(),)
             self.skipTest(msg)
         os.environ['unicode'] = value
-        self.assertEquals(os.environ['unicode'], value)
-        self.assertEquals(os.environb[b'unicode'], value_bytes)
+        self.assertEqual(os.environ['unicode'], value)
+        self.assertEqual(os.environb[b'unicode'], value_bytes)
 
         # os.environb -> os.environ
         value = b'\xff'
         os.environb[b'bytes'] = value
-        self.assertEquals(os.environb[b'bytes'], value)
+        self.assertEqual(os.environb[b'bytes'], value)
         value_str = value.decode(sys.getfilesystemencoding(), 'surrogateescape')
-        self.assertEquals(os.environ['bytes'], value_str)
+        self.assertEqual(os.environ['bytes'], value_str)
 
 class WalkTests(unittest.TestCase):
     """Tests for os.walk()."""
@@ -958,7 +958,7 @@
         def test_listdir(self):
             expected = self.unicodefn
             found = set(os.listdir(self.dir))
-            self.assertEquals(found, expected)
+            self.assertEqual(found, expected)
 
         def test_open(self):
             for fn in self.unicodefn:
@@ -1168,8 +1168,8 @@
 
 class FSEncodingTests(unittest.TestCase):
     def test_nop(self):
-        self.assertEquals(os.fsencode(b'abc\xff'), b'abc\xff')
-        self.assertEquals(os.fsdecode('abc\u0141'), 'abc\u0141')
+        self.assertEqual(os.fsencode(b'abc\xff'), b'abc\xff')
+        self.assertEqual(os.fsdecode('abc\u0141'), 'abc\u0141')
 
     def test_identity(self):
         # assert fsdecode(fsencode(x)) == x
@@ -1178,7 +1178,7 @@
                 bytesfn = os.fsencode(fn)
             except UnicodeEncodeError:
                 continue
-            self.assertEquals(os.fsdecode(bytesfn), fn)
+            self.assertEqual(os.fsdecode(bytesfn), fn)
 
 
 class PidTests(unittest.TestCase):

Modified: python/branches/py3k-cdecimal/Lib/test/test_parser.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_parser.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_parser.py	Mon Nov 22 12:00:42 2010
@@ -20,8 +20,8 @@
         except parser.ParserError as why:
             self.fail("could not roundtrip %r: %s" % (s, why))
 
-        self.assertEquals(t, st2.totuple(),
-                          "could not re-generate syntax tree")
+        self.assertEqual(t, st2.totuple(),
+                         "could not re-generate syntax tree")
 
     def check_expr(self, s):
         self.roundtrip(parser.expr, s)
@@ -498,14 +498,14 @@
     def test_compile_expr(self):
         st = parser.expr('2 + 3')
         code = parser.compilest(st)
-        self.assertEquals(eval(code), 5)
+        self.assertEqual(eval(code), 5)
 
     def test_compile_suite(self):
         st = parser.suite('x = 2; y = x + 3')
         code = parser.compilest(st)
         globs = {}
         exec(code, globs)
-        self.assertEquals(globs['y'], 5)
+        self.assertEqual(globs['y'], 5)
 
     def test_compile_error(self):
         st = parser.suite('1 = 3 + 4')
@@ -560,36 +560,36 @@
         st3_copy = parser.expr('list(x**3 for x in range(20))')
 
         # exercise fast path for object identity
-        self.assertEquals(st1 == st1, True)
-        self.assertEquals(st2 == st2, True)
-        self.assertEquals(st3 == st3, True)
+        self.assertEqual(st1 == st1, True)
+        self.assertEqual(st2 == st2, True)
+        self.assertEqual(st3 == st3, True)
         # slow path equality
         self.assertEqual(st1, st1_copy)
         self.assertEqual(st2, st2_copy)
         self.assertEqual(st3, st3_copy)
-        self.assertEquals(st1 == st2, False)
-        self.assertEquals(st1 == st3, False)
-        self.assertEquals(st2 == st3, False)
-        self.assertEquals(st1 != st1, False)
-        self.assertEquals(st2 != st2, False)
-        self.assertEquals(st3 != st3, False)
-        self.assertEquals(st1 != st1_copy, False)
-        self.assertEquals(st2 != st2_copy, False)
-        self.assertEquals(st3 != st3_copy, False)
-        self.assertEquals(st2 != st1, True)
-        self.assertEquals(st1 != st3, True)
-        self.assertEquals(st3 != st2, True)
+        self.assertEqual(st1 == st2, False)
+        self.assertEqual(st1 == st3, False)
+        self.assertEqual(st2 == st3, False)
+        self.assertEqual(st1 != st1, False)
+        self.assertEqual(st2 != st2, False)
+        self.assertEqual(st3 != st3, False)
+        self.assertEqual(st1 != st1_copy, False)
+        self.assertEqual(st2 != st2_copy, False)
+        self.assertEqual(st3 != st3_copy, False)
+        self.assertEqual(st2 != st1, True)
+        self.assertEqual(st1 != st3, True)
+        self.assertEqual(st3 != st2, True)
         # we don't particularly care what the ordering is;  just that
         # it's usable and self-consistent
-        self.assertEquals(st1 < st2, not (st2 <= st1))
-        self.assertEquals(st1 < st3, not (st3 <= st1))
-        self.assertEquals(st2 < st3, not (st3 <= st2))
-        self.assertEquals(st1 < st2, st2 > st1)
-        self.assertEquals(st1 < st3, st3 > st1)
-        self.assertEquals(st2 < st3, st3 > st2)
-        self.assertEquals(st1 <= st2, st2 >= st1)
-        self.assertEquals(st3 <= st1, st1 >= st3)
-        self.assertEquals(st2 <= st3, st3 >= st2)
+        self.assertEqual(st1 < st2, not (st2 <= st1))
+        self.assertEqual(st1 < st3, not (st3 <= st1))
+        self.assertEqual(st2 < st3, not (st3 <= st2))
+        self.assertEqual(st1 < st2, st2 > st1)
+        self.assertEqual(st1 < st3, st3 > st1)
+        self.assertEqual(st2 < st3, st3 > st2)
+        self.assertEqual(st1 <= st2, st2 >= st1)
+        self.assertEqual(st3 <= st1, st1 >= st3)
+        self.assertEqual(st2 <= st3, st3 >= st2)
         # transitivity
         bottom = min(st1, st2, st3)
         top = max(st1, st2, st3)
@@ -604,8 +604,8 @@
         self.assertTrue(mid <= mid)
         self.assertTrue(top <= top)
         # interaction with other types
-        self.assertEquals(st1 == 1588.602459, False)
-        self.assertEquals('spanish armada' != st2, True)
+        self.assertEqual(st1 == 1588.602459, False)
+        self.assertEqual('spanish armada' != st2, True)
         self.assertRaises(TypeError, operator.ge, st3, None)
         self.assertRaises(TypeError, operator.le, False, st1)
         self.assertRaises(TypeError, operator.lt, st1, 1815)

Modified: python/branches/py3k-cdecimal/Lib/test/test_pep247.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_pep247.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_pep247.py	Mon Nov 22 12:00:42 2010
@@ -30,23 +30,23 @@
             obj3 = cls()
             obj3.update(b'string')
             h2 = obj3.digest()
-        self.assertEquals(h1, h2)
+        self.assertEqual(h1, h2)
         self.assertTrue(hasattr(obj1, 'digest_size'))
 
         if digest_size is not None:
-            self.assertEquals(obj1.digest_size, digest_size)
+            self.assertEqual(obj1.digest_size, digest_size)
 
-        self.assertEquals(obj1.digest_size, len(h1))
+        self.assertEqual(obj1.digest_size, len(h1))
         obj1.update(b'string')
         obj_copy = obj1.copy()
-        self.assertEquals(obj1.digest(), obj_copy.digest())
-        self.assertEquals(obj1.hexdigest(), obj_copy.hexdigest())
+        self.assertEqual(obj1.digest(), obj_copy.digest())
+        self.assertEqual(obj1.hexdigest(), obj_copy.hexdigest())
 
         digest, hexdigest = obj1.digest(), obj1.hexdigest()
         hd2 = ""
         for byte in digest:
             hd2 += '%02x' % byte
-        self.assertEquals(hd2, hexdigest)
+        self.assertEqual(hd2, hexdigest)
 
     def test_md5(self):
         self.check_object(md5, None, None)

Modified: python/branches/py3k-cdecimal/Lib/test/test_pep263.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_pep263.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_pep263.py	Mon Nov 22 12:00:42 2010
@@ -26,7 +26,7 @@
         try:
             compile(b"# coding: cp932\nprint '\x94\x4e'", "dummy", "exec")
         except SyntaxError as v:
-            self.assertEquals(v.text, "print '\u5e74'\n")
+            self.assertEqual(v.text, "print '\u5e74'\n")
         else:
             self.fail()
 
@@ -34,7 +34,7 @@
         c = compile("# coding=latin-1\n\u00c6 = '\u00c6'", "dummy", "exec")
         d = {}
         exec(c, d)
-        self.assertEquals(d['\xc6'], '\xc6')
+        self.assertEqual(d['\xc6'], '\xc6')
 
     def test_issue3297(self):
         c = compile("a, b = '\U0001010F', '\\U0001010F'", "dummy", "exec")

Modified: python/branches/py3k-cdecimal/Lib/test/test_pep3131.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_pep3131.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_pep3131.py	Mon Nov 22 12:00:42 2010
@@ -8,15 +8,15 @@
             ä = 1
             µ = 2 # this is a compatibility character
             蟒 = 3
-        self.assertEquals(getattr(T, "\xe4"), 1)
-        self.assertEquals(getattr(T, "\u03bc"), 2)
-        self.assertEquals(getattr(T, '\u87d2'), 3)
+        self.assertEqual(getattr(T, "\xe4"), 1)
+        self.assertEqual(getattr(T, "\u03bc"), 2)
+        self.assertEqual(getattr(T, '\u87d2'), 3)
 
     def test_invalid(self):
         try:
             from test import badsyntax_3131
         except SyntaxError as s:
-            self.assertEquals(str(s),
+            self.assertEqual(str(s),
               "invalid character in identifier (badsyntax_3131.py, line 2)")
         else:
             self.fail("expected exception didn't occur")

Modified: python/branches/py3k-cdecimal/Lib/test/test_platform.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_platform.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_platform.py	Mon Nov 22 12:00:42 2010
@@ -182,17 +182,17 @@
             # On Snow Leopard, sw_vers reports 10.6.0 as 10.6
             if len_diff > 0:
                 expect_list.extend(['0'] * len_diff)
-            self.assertEquals(result_list, expect_list)
+            self.assertEqual(result_list, expect_list)
 
             # res[1] claims to contain
             # (version, dev_stage, non_release_version)
             # That information is no longer available
-            self.assertEquals(res[1], ('', '', ''))
+            self.assertEqual(res[1], ('', '', ''))
 
             if sys.byteorder == 'little':
-                self.assertEquals(res[2], 'i386')
+                self.assertEqual(res[2], 'i386')
             else:
-                self.assertEquals(res[2], 'PowerPC')
+                self.assertEqual(res[2], 'PowerPC')
 
 
     @unittest.skipUnless(sys.platform == 'darwin', "OSX only test")
@@ -210,8 +210,8 @@
         else:
             # parent
             cpid, sts = os.waitpid(pid, 0)
-            self.assertEquals(cpid, pid)
-            self.assertEquals(sts, 0)
+            self.assertEqual(cpid, pid)
+            self.assertEqual(sts, 0)
 
     def test_dist(self):
         res = platform.dist()

Modified: python/branches/py3k-cdecimal/Lib/test/test_posix.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_posix.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_posix.py	Mon Nov 22 12:00:42 2010
@@ -105,7 +105,7 @@
             try:
                 posix.initgroups(name, 13)
             except OSError as e:
-                self.assertEquals(e.errno, errno.EPERM)
+                self.assertEqual(e.errno, errno.EPERM)
             else:
                 self.fail("Expected OSError to be raised by initgroups")
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_pow.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_pow.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_pow.py	Mon Nov 22 12:00:42 2010
@@ -5,17 +5,17 @@
     def powtest(self, type):
         if type != float:
             for i in range(-1000, 1000):
-                self.assertEquals(pow(type(i), 0), 1)
-                self.assertEquals(pow(type(i), 1), type(i))
-                self.assertEquals(pow(type(0), 1), type(0))
-                self.assertEquals(pow(type(1), 1), type(1))
+                self.assertEqual(pow(type(i), 0), 1)
+                self.assertEqual(pow(type(i), 1), type(i))
+                self.assertEqual(pow(type(0), 1), type(0))
+                self.assertEqual(pow(type(1), 1), type(1))
 
             for i in range(-100, 100):
-                self.assertEquals(pow(type(i), 3), i*i*i)
+                self.assertEqual(pow(type(i), 3), i*i*i)
 
             pow2 = 1
             for i in range(0, 31):
-                self.assertEquals(pow(2, i), pow2)
+                self.assertEqual(pow(2, i), pow2)
                 if i != 30 : pow2 = pow2*2
 
             for othertype in (int,):
@@ -67,30 +67,30 @@
 
     def test_other(self):
         # Other tests-- not very systematic
-        self.assertEquals(pow(3,3) % 8, pow(3,3,8))
-        self.assertEquals(pow(3,3) % -8, pow(3,3,-8))
-        self.assertEquals(pow(3,2) % -2, pow(3,2,-2))
-        self.assertEquals(pow(-3,3) % 8, pow(-3,3,8))
-        self.assertEquals(pow(-3,3) % -8, pow(-3,3,-8))
-        self.assertEquals(pow(5,2) % -8, pow(5,2,-8))
-
-        self.assertEquals(pow(3,3) % 8, pow(3,3,8))
-        self.assertEquals(pow(3,3) % -8, pow(3,3,-8))
-        self.assertEquals(pow(3,2) % -2, pow(3,2,-2))
-        self.assertEquals(pow(-3,3) % 8, pow(-3,3,8))
-        self.assertEquals(pow(-3,3) % -8, pow(-3,3,-8))
-        self.assertEquals(pow(5,2) % -8, pow(5,2,-8))
+        self.assertEqual(pow(3,3) % 8, pow(3,3,8))
+        self.assertEqual(pow(3,3) % -8, pow(3,3,-8))
+        self.assertEqual(pow(3,2) % -2, pow(3,2,-2))
+        self.assertEqual(pow(-3,3) % 8, pow(-3,3,8))
+        self.assertEqual(pow(-3,3) % -8, pow(-3,3,-8))
+        self.assertEqual(pow(5,2) % -8, pow(5,2,-8))
+
+        self.assertEqual(pow(3,3) % 8, pow(3,3,8))
+        self.assertEqual(pow(3,3) % -8, pow(3,3,-8))
+        self.assertEqual(pow(3,2) % -2, pow(3,2,-2))
+        self.assertEqual(pow(-3,3) % 8, pow(-3,3,8))
+        self.assertEqual(pow(-3,3) % -8, pow(-3,3,-8))
+        self.assertEqual(pow(5,2) % -8, pow(5,2,-8))
 
         for i in range(-10, 11):
             for j in range(0, 6):
                 for k in range(-7, 11):
                     if j >= 0 and k != 0:
-                        self.assertEquals(
+                        self.assertEqual(
                             pow(i,j) % k,
                             pow(i,j,k)
                         )
                     if j >= 0 and k != 0:
-                        self.assertEquals(
+                        self.assertEqual(
                             pow(int(i),j) % k,
                             pow(int(i),j,k)
                         )
@@ -104,7 +104,7 @@
     def test_bug705231(self):
         # -1.0 raised to an integer should never blow up.  It did if the
         # platform pow() was buggy, and Python didn't worm around it.
-        eq = self.assertEquals
+        eq = self.assertEqual
         a = -1.0
         # The next two tests can still fail if the platform floor()
         # function doesn't treat all large inputs as integers

Modified: python/branches/py3k-cdecimal/Lib/test/test_pty.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_pty.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_pty.py	Mon Nov 22 12:00:42 2010
@@ -86,7 +86,7 @@
         fcntl.fcntl(master_fd, fcntl.F_SETFL, orig_flags | os.O_NONBLOCK)
         try:
             s1 = os.read(master_fd, 1024)
-            self.assertEquals(b'', s1)
+            self.assertEqual(b'', s1)
         except OSError as e:
             if e.errno != errno.EAGAIN:
                 raise
@@ -96,14 +96,14 @@
         debug("Writing to slave_fd")
         os.write(slave_fd, TEST_STRING_1)
         s1 = os.read(master_fd, 1024)
-        self.assertEquals(b'I wish to buy a fish license.\n',
-                          normalize_output(s1))
+        self.assertEqual(b'I wish to buy a fish license.\n',
+                         normalize_output(s1))
 
         debug("Writing chunked output")
         os.write(slave_fd, TEST_STRING_2[:5])
         os.write(slave_fd, TEST_STRING_2[5:])
         s2 = os.read(master_fd, 1024)
-        self.assertEquals(b'For my pet fish, Eric.\n', normalize_output(s2))
+        self.assertEqual(b'For my pet fish, Eric.\n', normalize_output(s2))
 
         os.close(slave_fd)
         os.close(master_fd)

Modified: python/branches/py3k-cdecimal/Lib/test/test_pyclbr.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_pyclbr.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_pyclbr.py	Mon Nov 22 12:00:42 2010
@@ -45,7 +45,7 @@
     def assertEqualsOrIgnored(self, a, b, ignore):
         ''' succeed iff a == b or a in ignore or b in ignore '''
         if a not in ignore and b not in ignore:
-            self.assertEquals(a, b)
+            self.assertEqual(a, b)
 
     def checkModule(self, moduleName, module=None, ignore=()):
         ''' succeed iff pyclbr.readmodule_ex(modulename) corresponds
@@ -87,7 +87,7 @@
                 self.assertIsInstance(py_item, (FunctionType, BuiltinFunctionType))
                 if py_item.__module__ != moduleName:
                     continue   # skip functions that came from somewhere else
-                self.assertEquals(py_item.__module__, value.module)
+                self.assertEqual(py_item.__module__, value.module)
             else:
                 self.assertIsInstance(py_item, type)
                 if py_item.__module__ != moduleName:
@@ -116,7 +116,7 @@
 
                 try:
                     self.assertListEq(foundMethods, actualMethods, ignore)
-                    self.assertEquals(py_item.__module__, value.module)
+                    self.assertEqual(py_item.__module__, value.module)
 
                     self.assertEqualsOrIgnored(py_item.__name__, value.name,
                                                ignore)

Modified: python/branches/py3k-cdecimal/Lib/test/test_pyexpat.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_pyexpat.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_pyexpat.py	Mon Nov 22 12:00:42 2010
@@ -23,12 +23,12 @@
     def test_ordered_attributes(self):
         for x, y in self.set_get_pairs:
             self.parser.ordered_attributes = x
-            self.assertEquals(self.parser.ordered_attributes, y)
+            self.assertEqual(self.parser.ordered_attributes, y)
 
     def test_specified_attributes(self):
         for x, y in self.set_get_pairs:
             self.parser.specified_attributes = x
-            self.assertEquals(self.parser.specified_attributes, y)
+            self.assertEqual(self.parser.specified_attributes, y)
 
 
 data = b'''\
@@ -190,7 +190,7 @@
             "End element: 'root'",
         ]
         for operation, expected_operation in zip(operations, expected_operations):
-            self.assertEquals(operation, expected_operation)
+            self.assertEqual(operation, expected_operation)
 
     def test_unicode(self):
         # Try the parse again, this time producing Unicode output
@@ -230,14 +230,14 @@
             expat.ParserCreate(namespace_separator=42)
             self.fail()
         except TypeError as e:
-            self.assertEquals(str(e),
+            self.assertEqual(str(e),
                 'ParserCreate() argument 2 must be str or None, not int')
 
         try:
             expat.ParserCreate(namespace_separator='too long')
             self.fail()
         except ValueError as e:
-            self.assertEquals(str(e),
+            self.assertEqual(str(e),
                 'namespace_separator must be at most one character, omitted, or None')
 
     def test_zero_length(self):
@@ -263,7 +263,7 @@
         p.EndElementHandler = collector
         p.Parse("<e> <e/> <e></e> </e>", 1)
         tag = L[0]
-        self.assertEquals(len(L), 6)
+        self.assertEqual(len(L), 6)
         for entry in L:
             # L should have the same string repeated over and over.
             self.assertTrue(tag is entry)
@@ -285,7 +285,7 @@
         out = ExternalOutputter(parser)
         parser.ExternalEntityRefHandler = out.ExternalEntityRefHandler
         parser.Parse(data, 1)
-        self.assertEquals(out.parser_result, 1)
+        self.assertEqual(out.parser_result, 1)
 
 
 class BufferTextTest(unittest.TestCase):
@@ -296,7 +296,7 @@
         self.parser.CharacterDataHandler = self.CharacterDataHandler
 
     def check(self, expected, label):
-        self.assertEquals(self.stuff, expected,
+        self.assertEqual(self.stuff, expected,
                 "%s\nstuff    = %r\nexpected = %r"
                 % (label, self.stuff, map(str, expected)))
 
@@ -329,47 +329,47 @@
         # Make sure buffering is turned on
         self.assertTrue(self.parser.buffer_text)
         self.parser.Parse("<a>1<b/>2<c/>3</a>", 1)
-        self.assertEquals(self.stuff, ['123'],
-                          "buffered text not properly collapsed")
+        self.assertEqual(self.stuff, ['123'],
+                         "buffered text not properly collapsed")
 
     def test1(self):
         # XXX This test exposes more detail of Expat's text chunking than we
         # XXX like, but it tests what we need to concisely.
         self.setHandlers(["StartElementHandler"])
         self.parser.Parse("<a>1<b buffer-text='no'/>2\n3<c buffer-text='yes'/>4\n5</a>", 1)
-        self.assertEquals(self.stuff,
-                          ["<a>", "1", "<b>", "2", "\n", "3", "<c>", "4\n5"],
-                          "buffering control not reacting as expected")
+        self.assertEqual(self.stuff,
+                         ["<a>", "1", "<b>", "2", "\n", "3", "<c>", "4\n5"],
+                         "buffering control not reacting as expected")
 
     def test2(self):
         self.parser.Parse("<a>1<b/>&lt;2&gt;<c/>&#32;\n&#x20;3</a>", 1)
-        self.assertEquals(self.stuff, ["1<2> \n 3"],
-                          "buffered text not properly collapsed")
+        self.assertEqual(self.stuff, ["1<2> \n 3"],
+                         "buffered text not properly collapsed")
 
     def test3(self):
         self.setHandlers(["StartElementHandler"])
         self.parser.Parse("<a>1<b/>2<c/>3</a>", 1)
-        self.assertEquals(self.stuff, ["<a>", "1", "<b>", "2", "<c>", "3"],
-                          "buffered text not properly split")
+        self.assertEqual(self.stuff, ["<a>", "1", "<b>", "2", "<c>", "3"],
+                         "buffered text not properly split")
 
     def test4(self):
         self.setHandlers(["StartElementHandler", "EndElementHandler"])
         self.parser.CharacterDataHandler = None
         self.parser.Parse("<a>1<b/>2<c/>3</a>", 1)
-        self.assertEquals(self.stuff,
-                          ["<a>", "<b>", "</b>", "<c>", "</c>", "</a>"])
+        self.assertEqual(self.stuff,
+                         ["<a>", "<b>", "</b>", "<c>", "</c>", "</a>"])
 
     def test5(self):
         self.setHandlers(["StartElementHandler", "EndElementHandler"])
         self.parser.Parse("<a>1<b></b>2<c/>3</a>", 1)
-        self.assertEquals(self.stuff,
+        self.assertEqual(self.stuff,
             ["<a>", "1", "<b>", "</b>", "2", "<c>", "</c>", "3", "</a>"])
 
     def test6(self):
         self.setHandlers(["CommentHandler", "EndElementHandler",
                     "StartElementHandler"])
         self.parser.Parse("<a>1<b/>2<c></c>345</a> ", 1)
-        self.assertEquals(self.stuff,
+        self.assertEqual(self.stuff,
             ["<a>", "1", "<b>", "</b>", "2", "<c>", "</c>", "345", "</a>"],
             "buffered text not properly split")
 
@@ -377,10 +377,10 @@
         self.setHandlers(["CommentHandler", "EndElementHandler",
                     "StartElementHandler"])
         self.parser.Parse("<a>1<b/>2<c></c>3<!--abc-->4<!--def-->5</a> ", 1)
-        self.assertEquals(self.stuff,
-                          ["<a>", "1", "<b>", "</b>", "2", "<c>", "</c>", "3",
-                           "<!--abc-->", "4", "<!--def-->", "5", "</a>"],
-                          "buffered text not properly split")
+        self.assertEqual(self.stuff,
+                         ["<a>", "1", "<b>", "</b>", "2", "<c>", "</c>", "3",
+                          "<!--abc-->", "4", "<!--def-->", "5", "</a>"],
+                         "buffered text not properly split")
 
 
 # Test handling of exception from callback:
@@ -395,9 +395,9 @@
             parser.Parse("<a><b><c/></b></a>", 1)
             self.fail()
         except RuntimeError as e:
-            self.assertEquals(e.args[0], 'a',
-                              "Expected RuntimeError for element 'a', but" + \
-                              " found %r" % e.args[0])
+            self.assertEqual(e.args[0], 'a',
+                             "Expected RuntimeError for element 'a', but" + \
+                             " found %r" % e.args[0])
 
 
 # Test Current* members:
@@ -416,7 +416,7 @@
         self.assertTrue(self.upto < len(self.expected_list),
                         'too many parser events')
         expected = self.expected_list[self.upto]
-        self.assertEquals(pos, expected,
+        self.assertEqual(pos, expected,
                 'Expected position %s, got position %s' %(pos, expected))
         self.upto += 1
 
@@ -457,10 +457,10 @@
     """
 
     def test_1025_bytes(self):
-        self.assertEquals(self.small_buffer_test(1025), 2)
+        self.assertEqual(self.small_buffer_test(1025), 2)
 
     def test_1000_bytes(self):
-        self.assertEquals(self.small_buffer_test(1000), 1)
+        self.assertEqual(self.small_buffer_test(1000), 1)
 
     def test_wrong_size(self):
         parser = expat.ParserCreate()
@@ -483,15 +483,15 @@
         # once.
         self.n = 0
         parser.Parse(xml1)
-        self.assertEquals(self.n, 1)
+        self.assertEqual(self.n, 1)
 
         # Reassign to buffer_size, but assign the same size.
         parser.buffer_size = parser.buffer_size
-        self.assertEquals(self.n, 1)
+        self.assertEqual(self.n, 1)
 
         # Try parsing rest of the document
         parser.Parse(xml2)
-        self.assertEquals(self.n, 2)
+        self.assertEqual(self.n, 2)
 
 
     def test_disabling_buffer(self):
@@ -502,27 +502,27 @@
         parser.CharacterDataHandler = self.counting_handler
         parser.buffer_text = 1
         parser.buffer_size = 1024
-        self.assertEquals(parser.buffer_size, 1024)
+        self.assertEqual(parser.buffer_size, 1024)
 
         # Parse one chunk of XML
         self.n = 0
         parser.Parse(xml1, 0)
-        self.assertEquals(parser.buffer_size, 1024)
-        self.assertEquals(self.n, 1)
+        self.assertEqual(parser.buffer_size, 1024)
+        self.assertEqual(self.n, 1)
 
         # Turn off buffering and parse the next chunk.
         parser.buffer_text = 0
         self.assertFalse(parser.buffer_text)
-        self.assertEquals(parser.buffer_size, 1024)
+        self.assertEqual(parser.buffer_size, 1024)
         for i in range(10):
             parser.Parse(xml2, 0)
-        self.assertEquals(self.n, 11)
+        self.assertEqual(self.n, 11)
 
         parser.buffer_text = 1
         self.assertTrue(parser.buffer_text)
-        self.assertEquals(parser.buffer_size, 1024)
+        self.assertEqual(parser.buffer_size, 1024)
         parser.Parse(xml3, 1)
-        self.assertEquals(self.n, 12)
+        self.assertEqual(self.n, 12)
 
 
 
@@ -550,14 +550,14 @@
         parser.CharacterDataHandler = self.counting_handler
         parser.buffer_text = 1
         parser.buffer_size = 1024
-        self.assertEquals(parser.buffer_size, 1024)
+        self.assertEqual(parser.buffer_size, 1024)
 
         self.n = 0
         parser.Parse(xml1, 0)
         parser.buffer_size *= 2
-        self.assertEquals(parser.buffer_size, 2048)
+        self.assertEqual(parser.buffer_size, 2048)
         parser.Parse(xml2, 1)
-        self.assertEquals(self.n, 2)
+        self.assertEqual(self.n, 2)
 
     def test_change_size_2(self):
         xml1 = "<?xml version='1.0' encoding='iso8859'?><a>a<s>%s" % ('a' * 1023)
@@ -566,14 +566,14 @@
         parser.CharacterDataHandler = self.counting_handler
         parser.buffer_text = 1
         parser.buffer_size = 2048
-        self.assertEquals(parser.buffer_size, 2048)
+        self.assertEqual(parser.buffer_size, 2048)
 
         self.n=0
         parser.Parse(xml1, 0)
         parser.buffer_size = parser.buffer_size // 2
-        self.assertEquals(parser.buffer_size, 1024)
+        self.assertEqual(parser.buffer_size, 1024)
         parser.Parse(xml2, 1)
-        self.assertEquals(self.n, 4)
+        self.assertEqual(self.n, 4)
 
 class MalformedInputTest(unittest.TestCase):
     def test1(self):
@@ -583,7 +583,7 @@
             parser.Parse(xml, True)
             self.fail()
         except expat.ExpatError as e:
-            self.assertEquals(str(e), 'unclosed token: line 2, column 0')
+            self.assertEqual(str(e), 'unclosed token: line 2, column 0')
 
     def test2(self):
         xml = "<?xml version\xc2\x85='1.0'?>\r\n"
@@ -592,7 +592,7 @@
             parser.Parse(xml, True)
             self.fail()
         except expat.ExpatError as e:
-            self.assertEquals(str(e), 'XML declaration not well-formed: line 1, column 14')
+            self.assertEqual(str(e), 'XML declaration not well-formed: line 1, column 14')
 
 class ErrorMessageTest(unittest.TestCase):
     def test_codes(self):
@@ -607,8 +607,8 @@
             parser.Parse(xml, True)
             self.fail()
         except expat.ExpatError as e:
-            self.assertEquals(e.code,
-                              errors.codes[errors.XML_ERROR_UNCLOSED_TOKEN])
+            self.assertEqual(e.code,
+                             errors.codes[errors.XML_ERROR_UNCLOSED_TOKEN])
 
 
 def test_main():

Modified: python/branches/py3k-cdecimal/Lib/test/test_queue.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_queue.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_queue.py	Mon Nov 22 12:00:42 2010
@@ -100,8 +100,8 @@
                             LifoQueue = [222, 333, 111],
                             PriorityQueue = [111, 222, 333])
         actual_order = [q.get(), q.get(), q.get()]
-        self.assertEquals(actual_order, target_order[q.__class__.__name__],
-                          "Didn't seem to queue the correct data!")
+        self.assertEqual(actual_order, target_order[q.__class__.__name__],
+                         "Didn't seem to queue the correct data!")
         for i in range(QUEUE_SIZE-1):
             q.put(i)
             self.assertTrue(q.qsize(), "Queue should not be empty")
@@ -161,8 +161,8 @@
         for i in range(100):
             q.put(i)
         q.join()
-        self.assertEquals(self.cum, sum(range(100)),
-                          "q.join() did not block until all tasks were done")
+        self.assertEqual(self.cum, sum(range(100)),
+                         "q.join() did not block until all tasks were done")
         for i in (0,1):
             q.put(-1)         # instruct the threads to close
         q.join()                # verify that you can join twice

Modified: python/branches/py3k-cdecimal/Lib/test/test_range.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_range.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_range.py	Mon Nov 22 12:00:42 2010
@@ -90,6 +90,164 @@
         r = range(-sys.maxsize, sys.maxsize, 2)
         self.assertEqual(len(r), sys.maxsize)
 
+    def test_large_operands(self):
+        x = range(10**20, 10**20+10, 3)
+        self.assertEqual(len(x), 4)
+        self.assertEqual(len(list(x)), 4)
+
+        x = range(10**20+10, 10**20, 3)
+        self.assertEqual(len(x), 0)
+        self.assertEqual(len(list(x)), 0)
+
+        x = range(10**20, 10**20+10, -3)
+        self.assertEqual(len(x), 0)
+        self.assertEqual(len(list(x)), 0)
+
+        x = range(10**20+10, 10**20, -3)
+        self.assertEqual(len(x), 4)
+        self.assertEqual(len(list(x)), 4)
+
+        # Now test range() with longs
+        self.assertEqual(list(range(-2**100)), [])
+        self.assertEqual(list(range(0, -2**100)), [])
+        self.assertEqual(list(range(0, 2**100, -1)), [])
+        self.assertEqual(list(range(0, 2**100, -1)), [])
+
+        a = int(10 * sys.maxsize)
+        b = int(100 * sys.maxsize)
+        c = int(50 * sys.maxsize)
+
+        self.assertEqual(list(range(a, a+2)), [a, a+1])
+        self.assertEqual(list(range(a+2, a, -1)), [a+2, a+1])
+        self.assertEqual(list(range(a+4, a, -2)), [a+4, a+2])
+
+        seq = list(range(a, b, c))
+        self.assertIn(a, seq)
+        self.assertNotIn(b, seq)
+        self.assertEqual(len(seq), 2)
+
+        seq = list(range(b, a, -c))
+        self.assertIn(b, seq)
+        self.assertNotIn(a, seq)
+        self.assertEqual(len(seq), 2)
+
+        seq = list(range(-a, -b, -c))
+        self.assertIn(-a, seq)
+        self.assertNotIn(-b, seq)
+        self.assertEqual(len(seq), 2)
+
+        self.assertRaises(OverflowError, len, range(0, sys.maxsize**10))
+
+    def test_invalid_invocation(self):
+        self.assertRaises(TypeError, range)
+        self.assertRaises(TypeError, range, 1, 2, 3, 4)
+        self.assertRaises(ValueError, range, 1, 2, 0)
+        a = int(10 * sys.maxsize)
+        self.assertRaises(ValueError, range, a, a + 1, int(0))
+        self.assertRaises(TypeError, range, 1., 1., 1.)
+        self.assertRaises(TypeError, range, 1e100, 1e101, 1e101)
+        self.assertRaises(TypeError, range, 0, "spam")
+        self.assertRaises(TypeError, range, 0, 42, "spam")
+        # Exercise various combinations of bad arguments, to check
+        # refcounting logic
+        self.assertRaises(TypeError, range, 0.0)
+        self.assertRaises(TypeError, range, 0, 0.0)
+        self.assertRaises(TypeError, range, 0.0, 0)
+        self.assertRaises(TypeError, range, 0.0, 0.0)
+        self.assertRaises(TypeError, range, 0, 0, 1.0)
+        self.assertRaises(TypeError, range, 0, 0.0, 1)
+        self.assertRaises(TypeError, range, 0, 0.0, 1.0)
+        self.assertRaises(TypeError, range, 0.0, 0, 1)
+        self.assertRaises(TypeError, range, 0.0, 0, 1.0)
+        self.assertRaises(TypeError, range, 0.0, 0.0, 1)
+        self.assertRaises(TypeError, range, 0.0, 0.0, 1.0)
+
+    def test_index(self):
+        u = range(2)
+        self.assertEqual(u.index(0), 0)
+        self.assertEqual(u.index(1), 1)
+        self.assertRaises(ValueError, u.index, 2)
+
+        u = range(-2, 3)
+        self.assertEqual(u.count(0), 1)
+        self.assertEqual(u.index(0), 2)
+        self.assertRaises(TypeError, u.index)
+
+        class BadExc(Exception):
+            pass
+
+        class BadCmp:
+            def __eq__(self, other):
+                if other == 2:
+                    raise BadExc()
+                return False
+
+        a = range(4)
+        self.assertRaises(BadExc, a.index, BadCmp())
+
+        a = range(-2, 3)
+        self.assertEqual(a.index(0), 2)
+        self.assertEqual(range(1, 10, 3).index(4), 1)
+        self.assertEqual(range(1, -10, -3).index(-5), 2)
+
+        self.assertEqual(range(10**20).index(1), 1)
+        self.assertEqual(range(10**20).index(10**20 - 1), 10**20 - 1)
+
+        self.assertRaises(ValueError, range(1, 2**100, 2).index, 2**87)
+        self.assertEqual(range(1, 2**100, 2).index(2**87+1), 2**86)
+
+        class AlwaysEqual(object):
+            def __eq__(self, other):
+                return True
+        always_equal = AlwaysEqual()
+        self.assertEqual(range(10).index(always_equal), 0)
+
+    def test_user_index_method(self):
+        bignum = 2*sys.maxsize
+        smallnum = 42
+
+        # User-defined class with an __index__ method
+        class I:
+            def __init__(self, n):
+                self.n = int(n)
+            def __index__(self):
+                return self.n
+        self.assertEqual(list(range(I(bignum), I(bignum + 1))), [bignum])
+        self.assertEqual(list(range(I(smallnum), I(smallnum + 1))), [smallnum])
+
+        # User-defined class with a failing __index__ method
+        class IX:
+            def __index__(self):
+                raise RuntimeError
+        self.assertRaises(RuntimeError, range, IX())
+
+        # User-defined class with an invalid __index__ method
+        class IN:
+            def __index__(self):
+                return "not a number"
+
+        self.assertRaises(TypeError, range, IN())
+
+    def test_count(self):
+        self.assertEqual(range(3).count(-1), 0)
+        self.assertEqual(range(3).count(0), 1)
+        self.assertEqual(range(3).count(1), 1)
+        self.assertEqual(range(3).count(2), 1)
+        self.assertEqual(range(3).count(3), 0)
+        self.assertIs(type(range(3).count(-1)), int)
+        self.assertIs(type(range(3).count(1)), int)
+        self.assertEqual(range(10**20).count(1), 1)
+        self.assertEqual(range(10**20).count(10**20), 0)
+        self.assertEqual(range(3).index(1), 1)
+        self.assertEqual(range(1, 2**100, 2).count(2**87), 0)
+        self.assertEqual(range(1, 2**100, 2).count(2**87+1), 1)
+
+        class AlwaysEqual(object):
+            def __eq__(self, other):
+                return True
+        always_equal = AlwaysEqual()
+        self.assertEqual(range(10).count(always_equal), 10)
+
     def test_repr(self):
         self.assertEqual(repr(range(1)), 'range(0, 1)')
         self.assertEqual(repr(range(1, 2)), 'range(1, 2)')
@@ -101,8 +259,8 @@
         for proto in range(pickle.HIGHEST_PROTOCOL + 1):
             for t in testcases:
                 r = range(*t)
-                self.assertEquals(list(pickle.loads(pickle.dumps(r, proto))),
-                                  list(r))
+                self.assertEqual(list(pickle.loads(pickle.dumps(r, proto))),
+                                 list(r))
 
     def test_odd_bug(self):
         # This used to raise a "SystemError: NULL result without error"

Modified: python/branches/py3k-cdecimal/Lib/test/test_reprlib.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_reprlib.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_reprlib.py	Mon Nov 22 12:00:42 2010
@@ -23,7 +23,7 @@
 class ReprTests(unittest.TestCase):
 
     def test_string(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         eq(r("abc"), "'abc'")
         eq(r("abcdefghijklmnop"),"'abcdefghijklmnop'")
 
@@ -37,7 +37,7 @@
         eq(r(s), expected)
 
     def test_tuple(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         eq(r((1,)), "(1,)")
 
         t3 = (1, 2, 3)
@@ -52,7 +52,7 @@
         from array import array
         from collections import deque
 
-        eq = self.assertEquals
+        eq = self.assertEqual
         # Tuples give up after 6 elements
         eq(r(()), "()")
         eq(r((1,)), "(1,)")
@@ -102,7 +102,7 @@
                    "array('i', [1, 2, 3, 4, 5, ...])")
 
     def test_numbers(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         eq(r(123), repr(123))
         eq(r(123), repr(123))
         eq(r(1.0/3), repr(1.0/3))
@@ -112,7 +112,7 @@
         eq(r(n), expected)
 
     def test_instance(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         i1 = ClassWithRepr("a")
         eq(r(i1), repr(i1))
 
@@ -134,7 +134,7 @@
         # XXX anonymous functions?  see func_repr
 
     def test_builtin_function(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         # Functions
         eq(repr(hash), '<built-in function hash>')
         # Methods
@@ -142,13 +142,13 @@
             '<built-in method split of str object at 0x'))
 
     def test_range(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         eq(repr(range(1)), 'range(0, 1)')
         eq(repr(range(1, 2)), 'range(1, 2)')
         eq(repr(range(1, 4, 3)), 'range(1, 4, 3)')
 
     def test_nesting(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         # everything is meant to give up after 6 levels.
         eq(r([[[[[[[]]]]]]]), "[[[[[[[]]]]]]]")
         eq(r([[[[[[[[]]]]]]]]), "[[[[[[[...]]]]]]]")
@@ -169,7 +169,7 @@
         pass
 
     def test_descriptors(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         # method descriptors
         eq(repr(dict.items), "<method 'items' of 'dict' objects>")
         # XXX member descriptors
@@ -230,7 +230,7 @@
         del sys.path[0]
 
     def test_module(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         touch(os.path.join(self.subpkgname, self.pkgname + '.py'))
         from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import areallylongpackageandmodulenametotestreprtruncation
         eq(repr(areallylongpackageandmodulenametotestreprtruncation),
@@ -238,7 +238,7 @@
         eq(repr(sys), "<module 'sys' (built-in)>")
 
     def test_type(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         touch(os.path.join(self.subpkgname, 'foo.py'), '''\
 class foo(object):
     pass
@@ -259,7 +259,7 @@
 ''')
         from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar
         # Module name may be prefixed with "test.", depending on how run.
-        self.assertEquals(repr(bar.bar), "<class '%s.bar'>" % bar.__name__)
+        self.assertEqual(repr(bar.bar), "<class '%s.bar'>" % bar.__name__)
 
     def test_instance(self):
         touch(os.path.join(self.subpkgname, 'baz.py'), '''\
@@ -272,7 +272,7 @@
             "<%s.baz object at 0x" % baz.__name__))
 
     def test_method(self):
-        eq = self.assertEquals
+        eq = self.assertEqual
         touch(os.path.join(self.subpkgname, 'qux.py'), '''\
 class aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
     def amethod(self): pass

Modified: python/branches/py3k-cdecimal/Lib/test/test_sax.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_sax.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_sax.py	Mon Nov 22 12:00:42 2010
@@ -34,16 +34,16 @@
         self.assertRaises(KeyError, attrs.getNameByQName, "attr")
         self.assertRaises(KeyError, attrs.getQNameByName, "attr")
         self.assertRaises(KeyError, attrs.__getitem__, "attr")
-        self.assertEquals(attrs.getLength(), 0)
-        self.assertEquals(attrs.getNames(), [])
-        self.assertEquals(attrs.getQNames(), [])
-        self.assertEquals(len(attrs), 0)
+        self.assertEqual(attrs.getLength(), 0)
+        self.assertEqual(attrs.getNames(), [])
+        self.assertEqual(attrs.getQNames(), [])
+        self.assertEqual(len(attrs), 0)
         self.assertNotIn("attr", attrs)
-        self.assertEquals(list(attrs.keys()), [])
-        self.assertEquals(attrs.get("attrs"), None)
-        self.assertEquals(attrs.get("attrs", 25), 25)
-        self.assertEquals(list(attrs.items()), [])
-        self.assertEquals(list(attrs.values()), [])
+        self.assertEqual(list(attrs.keys()), [])
+        self.assertEqual(attrs.get("attrs"), None)
+        self.assertEqual(attrs.get("attrs", 25), 25)
+        self.assertEqual(list(attrs.items()), [])
+        self.assertEqual(list(attrs.values()), [])
 
     def verify_empty_nsattrs(self, attrs):
         self.assertRaises(KeyError, attrs.getValue, (ns_uri, "attr"))
@@ -51,33 +51,33 @@
         self.assertRaises(KeyError, attrs.getNameByQName, "ns:attr")
         self.assertRaises(KeyError, attrs.getQNameByName, (ns_uri, "attr"))
         self.assertRaises(KeyError, attrs.__getitem__, (ns_uri, "attr"))
-        self.assertEquals(attrs.getLength(), 0)
-        self.assertEquals(attrs.getNames(), [])
-        self.assertEquals(attrs.getQNames(), [])
-        self.assertEquals(len(attrs), 0)
+        self.assertEqual(attrs.getLength(), 0)
+        self.assertEqual(attrs.getNames(), [])
+        self.assertEqual(attrs.getQNames(), [])
+        self.assertEqual(len(attrs), 0)
         self.assertNotIn((ns_uri, "attr"), attrs)
-        self.assertEquals(list(attrs.keys()), [])
-        self.assertEquals(attrs.get((ns_uri, "attr")), None)
-        self.assertEquals(attrs.get((ns_uri, "attr"), 25), 25)
-        self.assertEquals(list(attrs.items()), [])
-        self.assertEquals(list(attrs.values()), [])
+        self.assertEqual(list(attrs.keys()), [])
+        self.assertEqual(attrs.get((ns_uri, "attr")), None)
+        self.assertEqual(attrs.get((ns_uri, "attr"), 25), 25)
+        self.assertEqual(list(attrs.items()), [])
+        self.assertEqual(list(attrs.values()), [])
 
     def verify_attrs_wattr(self, attrs):
-        self.assertEquals(attrs.getLength(), 1)
-        self.assertEquals(attrs.getNames(), ["attr"])
-        self.assertEquals(attrs.getQNames(), ["attr"])
-        self.assertEquals(len(attrs), 1)
+        self.assertEqual(attrs.getLength(), 1)
+        self.assertEqual(attrs.getNames(), ["attr"])
+        self.assertEqual(attrs.getQNames(), ["attr"])
+        self.assertEqual(len(attrs), 1)
         self.assertIn("attr", attrs)
-        self.assertEquals(list(attrs.keys()), ["attr"])
-        self.assertEquals(attrs.get("attr"), "val")
-        self.assertEquals(attrs.get("attr", 25), "val")
-        self.assertEquals(list(attrs.items()), [("attr", "val")])
-        self.assertEquals(list(attrs.values()), ["val"])
-        self.assertEquals(attrs.getValue("attr"), "val")
-        self.assertEquals(attrs.getValueByQName("attr"), "val")
-        self.assertEquals(attrs.getNameByQName("attr"), "attr")
-        self.assertEquals(attrs["attr"], "val")
-        self.assertEquals(attrs.getQNameByName("attr"), "attr")
+        self.assertEqual(list(attrs.keys()), ["attr"])
+        self.assertEqual(attrs.get("attr"), "val")
+        self.assertEqual(attrs.get("attr", 25), "val")
+        self.assertEqual(list(attrs.items()), [("attr", "val")])
+        self.assertEqual(list(attrs.values()), ["val"])
+        self.assertEqual(attrs.getValue("attr"), "val")
+        self.assertEqual(attrs.getValueByQName("attr"), "val")
+        self.assertEqual(attrs.getNameByQName("attr"), "attr")
+        self.assertEqual(attrs["attr"], "val")
+        self.assertEqual(attrs.getQNameByName("attr"), "attr")
 
 class MakeParserTest(unittest.TestCase):
     def test_make_parser2(self):
@@ -107,47 +107,47 @@
 class SaxutilsTest(unittest.TestCase):
     # ===== escape
     def test_escape_basic(self):
-        self.assertEquals(escape("Donald Duck & Co"), "Donald Duck &amp; Co")
+        self.assertEqual(escape("Donald Duck & Co"), "Donald Duck &amp; Co")
 
     def test_escape_all(self):
-        self.assertEquals(escape("<Donald Duck & Co>"),
-                          "&lt;Donald Duck &amp; Co&gt;")
+        self.assertEqual(escape("<Donald Duck & Co>"),
+                         "&lt;Donald Duck &amp; Co&gt;")
 
     def test_escape_extra(self):
-        self.assertEquals(escape("Hei på deg", {"å" : "&aring;"}),
-                          "Hei p&aring; deg")
+        self.assertEqual(escape("Hei på deg", {"å" : "&aring;"}),
+                         "Hei p&aring; deg")
 
     # ===== unescape
     def test_unescape_basic(self):
-        self.assertEquals(unescape("Donald Duck &amp; Co"), "Donald Duck & Co")
+        self.assertEqual(unescape("Donald Duck &amp; Co"), "Donald Duck & Co")
 
     def test_unescape_all(self):
-        self.assertEquals(unescape("&lt;Donald Duck &amp; Co&gt;"),
-                          "<Donald Duck & Co>")
+        self.assertEqual(unescape("&lt;Donald Duck &amp; Co&gt;"),
+                         "<Donald Duck & Co>")
 
     def test_unescape_extra(self):
-        self.assertEquals(unescape("Hei på deg", {"å" : "&aring;"}),
-                          "Hei p&aring; deg")
+        self.assertEqual(unescape("Hei på deg", {"å" : "&aring;"}),
+                         "Hei p&aring; deg")
 
     def test_unescape_amp_extra(self):
-        self.assertEquals(unescape("&amp;foo;", {"&foo;": "splat"}), "&foo;")
+        self.assertEqual(unescape("&amp;foo;", {"&foo;": "splat"}), "&foo;")
 
     # ===== quoteattr
     def test_quoteattr_basic(self):
-        self.assertEquals(quoteattr("Donald Duck & Co"),
-                          '"Donald Duck &amp; Co"')
+        self.assertEqual(quoteattr("Donald Duck & Co"),
+                         '"Donald Duck &amp; Co"')
 
     def test_single_quoteattr(self):
-        self.assertEquals(quoteattr('Includes "double" quotes'),
-                          '\'Includes "double" quotes\'')
+        self.assertEqual(quoteattr('Includes "double" quotes'),
+                         '\'Includes "double" quotes\'')
 
     def test_double_quoteattr(self):
-        self.assertEquals(quoteattr("Includes 'single' quotes"),
-                          "\"Includes 'single' quotes\"")
+        self.assertEqual(quoteattr("Includes 'single' quotes"),
+                         "\"Includes 'single' quotes\"")
 
     def test_single_double_quoteattr(self):
-        self.assertEquals(quoteattr("Includes 'single' and \"double\" quotes"),
-                    "\"Includes 'single' and &quot;double&quot; quotes\"")
+        self.assertEqual(quoteattr("Includes 'single' and \"double\" quotes"),
+                         "\"Includes 'single' and &quot;double&quot; quotes\"")
 
     # ===== make_parser
     def test_make_parser(self):
@@ -169,7 +169,7 @@
         gen.endElement("doc")
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start + "<doc></doc>")
+        self.assertEqual(result.getvalue(), start + "<doc></doc>")
 
     def test_xmlgen_basic_empty(self):
         result = StringIO()
@@ -179,7 +179,7 @@
         gen.endElement("doc")
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start + "<doc/>")
+        self.assertEqual(result.getvalue(), start + "<doc/>")
 
     def test_xmlgen_content(self):
         result = StringIO()
@@ -191,7 +191,7 @@
         gen.endElement("doc")
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start + "<doc>huhei</doc>")
+        self.assertEqual(result.getvalue(), start + "<doc>huhei</doc>")
 
     def test_xmlgen_content_empty(self):
         result = StringIO()
@@ -203,7 +203,7 @@
         gen.endElement("doc")
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start + "<doc>huhei</doc>")
+        self.assertEqual(result.getvalue(), start + "<doc>huhei</doc>")
 
     def test_xmlgen_pi(self):
         result = StringIO()
@@ -215,7 +215,7 @@
         gen.endElement("doc")
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start + "<?test data?><doc></doc>")
+        self.assertEqual(result.getvalue(), start + "<?test data?><doc></doc>")
 
     def test_xmlgen_content_escape(self):
         result = StringIO()
@@ -227,7 +227,7 @@
         gen.endElement("doc")
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(),
+        self.assertEqual(result.getvalue(),
             start + "<doc>&lt;huhei&amp;</doc>")
 
     def test_xmlgen_attr_escape(self):
@@ -245,7 +245,7 @@
         gen.endElement("doc")
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start +
+        self.assertEqual(result.getvalue(), start +
             ("<doc a='\"'><e a=\"'\"></e>"
              "<e a=\"'&quot;\"></e>"
              "<e a=\"&#10;&#13;&#9;\"></e></doc>"))
@@ -260,7 +260,7 @@
         gen.endElement("doc")
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start + "<doc> </doc>")
+        self.assertEqual(result.getvalue(), start + "<doc> </doc>")
 
     def test_xmlgen_ignorable_empty(self):
         result = StringIO()
@@ -272,7 +272,7 @@
         gen.endElement("doc")
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start + "<doc> </doc>")
+        self.assertEqual(result.getvalue(), start + "<doc> </doc>")
 
     def test_xmlgen_ns(self):
         result = StringIO()
@@ -288,7 +288,7 @@
         gen.endPrefixMapping("ns1")
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start + \
+        self.assertEqual(result.getvalue(), start + \
            ('<ns1:doc xmlns:ns1="%s"><udoc></udoc></ns1:doc>' %
                                          ns_uri))
 
@@ -306,7 +306,7 @@
         gen.endPrefixMapping("ns1")
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start + \
+        self.assertEqual(result.getvalue(), start + \
            ('<ns1:doc xmlns:ns1="%s"><udoc/></ns1:doc>' %
                                          ns_uri))
 
@@ -319,7 +319,7 @@
         gen.endElementNS((None, 'a'), 'a')
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start+'<a b="c"></a>')
+        self.assertEqual(result.getvalue(), start+'<a b="c"></a>')
 
     def test_1463026_1_empty(self):
         result = StringIO()
@@ -330,7 +330,7 @@
         gen.endElementNS((None, 'a'), 'a')
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start+'<a b="c"/>')
+        self.assertEqual(result.getvalue(), start+'<a b="c"/>')
 
     def test_1463026_2(self):
         result = StringIO()
@@ -343,7 +343,7 @@
         gen.endPrefixMapping(None)
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start+'<a xmlns="qux"></a>')
+        self.assertEqual(result.getvalue(), start+'<a xmlns="qux"></a>')
 
     def test_1463026_2_empty(self):
         result = StringIO()
@@ -356,7 +356,7 @@
         gen.endPrefixMapping(None)
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(), start+'<a xmlns="qux"/>')
+        self.assertEqual(result.getvalue(), start+'<a xmlns="qux"/>')
 
     def test_1463026_3(self):
         result = StringIO()
@@ -369,7 +369,7 @@
         gen.endPrefixMapping('my')
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(),
+        self.assertEqual(result.getvalue(),
             start+'<my:a xmlns:my="qux" b="c"></my:a>')
 
     def test_1463026_3_empty(self):
@@ -383,7 +383,7 @@
         gen.endPrefixMapping('my')
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(),
+        self.assertEqual(result.getvalue(),
             start+'<my:a xmlns:my="qux" b="c"/>')
 
     def test_5027_1(self):
@@ -406,11 +406,11 @@
         parser.setContentHandler(gen)
         parser.parse(test_xml)
 
-        self.assertEquals(result.getvalue(),
-                          start + (
-                          '<a:g1 xmlns:a="http://example.com/ns">'
-                           '<a:g2 xml:lang="en">Hello</a:g2>'
-                          '</a:g1>'))
+        self.assertEqual(result.getvalue(),
+                         start + (
+                         '<a:g1 xmlns:a="http://example.com/ns">'
+                          '<a:g2 xml:lang="en">Hello</a:g2>'
+                         '</a:g1>'))
 
     def test_5027_2(self):
         # The xml prefix (as in xml:lang below) is reserved and bound by
@@ -434,11 +434,11 @@
         gen.endPrefixMapping('a')
         gen.endDocument()
 
-        self.assertEquals(result.getvalue(),
-                          start + (
-                          '<a:g1 xmlns:a="http://example.com/ns">'
-                           '<a:g2 xml:lang="en">Hello</a:g2>'
-                          '</a:g1>'))
+        self.assertEqual(result.getvalue(),
+                         start + (
+                         '<a:g1 xmlns:a="http://example.com/ns">'
+                          '<a:g2 xml:lang="en">Hello</a:g2>'
+                         '</a:g1>'))
 
 
 class XMLFilterBaseTest(unittest.TestCase):
@@ -455,7 +455,7 @@
         filter.endElement("doc")
         filter.endDocument()
 
-        self.assertEquals(result.getvalue(), start + "<doc>content </doc>")
+        self.assertEqual(result.getvalue(), start + "<doc>content </doc>")
 
 # ===========================================================================
 #
@@ -479,7 +479,7 @@
         with open(TEST_XMLFILE) as f:
             parser.parse(f)
 
-        self.assertEquals(result.getvalue(), xml_test_out)
+        self.assertEqual(result.getvalue(), xml_test_out)
 
     # ===== DTDHandler support
 
@@ -507,9 +507,9 @@
         parser.feed('<doc></doc>')
         parser.close()
 
-        self.assertEquals(handler._notations,
+        self.assertEqual(handler._notations,
             [("GIF", "-//CompuServe//NOTATION Graphics Interchange Format 89a//EN", None)])
-        self.assertEquals(handler._entities, [("img", None, "expat.gif", "GIF")])
+        self.assertEqual(handler._entities, [("img", None, "expat.gif", "GIF")])
 
     # ===== EntityResolver support
 
@@ -532,8 +532,8 @@
         parser.feed('<doc>&test;</doc>')
         parser.close()
 
-        self.assertEquals(result.getvalue(), start +
-                          "<doc><entity></entity></doc>")
+        self.assertEqual(result.getvalue(), start +
+                         "<doc><entity></entity></doc>")
 
     # ===== Attributes support
 
@@ -585,18 +585,18 @@
 
         attrs = gather._attrs
 
-        self.assertEquals(attrs.getLength(), 1)
-        self.assertEquals(attrs.getNames(), [(ns_uri, "attr")])
+        self.assertEqual(attrs.getLength(), 1)
+        self.assertEqual(attrs.getNames(), [(ns_uri, "attr")])
         self.assertTrue((attrs.getQNames() == [] or
                          attrs.getQNames() == ["ns:attr"]))
-        self.assertEquals(len(attrs), 1)
+        self.assertEqual(len(attrs), 1)
         self.assertIn((ns_uri, "attr"), attrs)
-        self.assertEquals(attrs.get((ns_uri, "attr")), "val")
-        self.assertEquals(attrs.get((ns_uri, "attr"), 25), "val")
-        self.assertEquals(list(attrs.items()), [((ns_uri, "attr"), "val")])
-        self.assertEquals(list(attrs.values()), ["val"])
-        self.assertEquals(attrs.getValue((ns_uri, "attr")), "val")
-        self.assertEquals(attrs[(ns_uri, "attr")], "val")
+        self.assertEqual(attrs.get((ns_uri, "attr")), "val")
+        self.assertEqual(attrs.get((ns_uri, "attr"), 25), "val")
+        self.assertEqual(list(attrs.items()), [((ns_uri, "attr"), "val")])
+        self.assertEqual(list(attrs.values()), ["val"])
+        self.assertEqual(attrs.getValue((ns_uri, "attr")), "val")
+        self.assertEqual(attrs[(ns_uri, "attr")], "val")
 
     # ===== InputSource support
 
@@ -608,7 +608,7 @@
         parser.setContentHandler(xmlgen)
         parser.parse(TEST_XMLFILE)
 
-        self.assertEquals(result.getvalue(), xml_test_out)
+        self.assertEqual(result.getvalue(), xml_test_out)
 
     def test_expat_inpsource_sysid(self):
         parser = create_parser()
@@ -618,7 +618,7 @@
         parser.setContentHandler(xmlgen)
         parser.parse(InputSource(TEST_XMLFILE))
 
-        self.assertEquals(result.getvalue(), xml_test_out)
+        self.assertEqual(result.getvalue(), xml_test_out)
 
     def test_expat_inpsource_stream(self):
         parser = create_parser()
@@ -631,7 +631,7 @@
             inpsrc.setByteStream(f)
             parser.parse(inpsrc)
 
-        self.assertEquals(result.getvalue(), xml_test_out)
+        self.assertEqual(result.getvalue(), xml_test_out)
 
     # ===== IncrementalParser support
 
@@ -645,7 +645,7 @@
         parser.feed("</doc>")
         parser.close()
 
-        self.assertEquals(result.getvalue(), start + "<doc></doc>")
+        self.assertEqual(result.getvalue(), start + "<doc></doc>")
 
     def test_expat_incremental_reset(self):
         result = StringIO()
@@ -666,7 +666,7 @@
         parser.feed("</doc>")
         parser.close()
 
-        self.assertEquals(result.getvalue(), start + "<doc>text</doc>")
+        self.assertEqual(result.getvalue(), start + "<doc>text</doc>")
 
     # ===== Locator support
 
@@ -680,9 +680,9 @@
         parser.feed("</doc>")
         parser.close()
 
-        self.assertEquals(parser.getSystemId(), None)
-        self.assertEquals(parser.getPublicId(), None)
-        self.assertEquals(parser.getLineNumber(), 1)
+        self.assertEqual(parser.getSystemId(), None)
+        self.assertEqual(parser.getPublicId(), None)
+        self.assertEqual(parser.getLineNumber(), 1)
 
     def test_expat_locator_withinfo(self):
         result = StringIO()
@@ -691,8 +691,8 @@
         parser.setContentHandler(xmlgen)
         parser.parse(TEST_XMLFILE)
 
-        self.assertEquals(parser.getSystemId(), TEST_XMLFILE)
-        self.assertEquals(parser.getPublicId(), None)
+        self.assertEqual(parser.getSystemId(), TEST_XMLFILE)
+        self.assertEqual(parser.getPublicId(), None)
 
 
 # ===========================================================================
@@ -713,7 +713,7 @@
             parser.parse(source)
             self.fail()
         except SAXException as e:
-            self.assertEquals(e.getSystemId(), name)
+            self.assertEqual(e.getSystemId(), name)
 
     def test_expat_incomplete(self):
         parser = create_parser()
@@ -777,21 +777,21 @@
         attrs = AttributesNSImpl({(ns_uri, "attr") : "val"},
                                  {(ns_uri, "attr") : "ns:attr"})
 
-        self.assertEquals(attrs.getLength(), 1)
-        self.assertEquals(attrs.getNames(), [(ns_uri, "attr")])
-        self.assertEquals(attrs.getQNames(), ["ns:attr"])
-        self.assertEquals(len(attrs), 1)
+        self.assertEqual(attrs.getLength(), 1)
+        self.assertEqual(attrs.getNames(), [(ns_uri, "attr")])
+        self.assertEqual(attrs.getQNames(), ["ns:attr"])
+        self.assertEqual(len(attrs), 1)
         self.assertIn((ns_uri, "attr"), attrs)
-        self.assertEquals(list(attrs.keys()), [(ns_uri, "attr")])
-        self.assertEquals(attrs.get((ns_uri, "attr")), "val")
-        self.assertEquals(attrs.get((ns_uri, "attr"), 25), "val")
-        self.assertEquals(list(attrs.items()), [((ns_uri, "attr"), "val")])
-        self.assertEquals(list(attrs.values()), ["val"])
-        self.assertEquals(attrs.getValue((ns_uri, "attr")), "val")
-        self.assertEquals(attrs.getValueByQName("ns:attr"), "val")
-        self.assertEquals(attrs.getNameByQName("ns:attr"), (ns_uri, "attr"))
-        self.assertEquals(attrs[(ns_uri, "attr")], "val")
-        self.assertEquals(attrs.getQNameByName((ns_uri, "attr")), "ns:attr")
+        self.assertEqual(list(attrs.keys()), [(ns_uri, "attr")])
+        self.assertEqual(attrs.get((ns_uri, "attr")), "val")
+        self.assertEqual(attrs.get((ns_uri, "attr"), 25), "val")
+        self.assertEqual(list(attrs.items()), [((ns_uri, "attr"), "val")])
+        self.assertEqual(list(attrs.values()), ["val"])
+        self.assertEqual(attrs.getValue((ns_uri, "attr")), "val")
+        self.assertEqual(attrs.getValueByQName("ns:attr"), "val")
+        self.assertEqual(attrs.getNameByQName("ns:attr"), (ns_uri, "attr"))
+        self.assertEqual(attrs[(ns_uri, "attr")], "val")
+        self.assertEqual(attrs.getQNameByName((ns_uri, "attr")), "ns:attr")
 
 
     # During the development of Python 2.5, an attempt to move the "xml"
@@ -827,7 +827,7 @@
         try:
             import xml.sax.expatreader
             module = xml.sax.expatreader
-            self.assertEquals(module.__name__, "xml.sax.expatreader")
+            self.assertEqual(module.__name__, "xml.sax.expatreader")
         finally:
             sys.modules.update(old_modules)
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_scope.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_scope.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_scope.py	Mon Nov 22 12:00:42 2010
@@ -510,7 +510,7 @@
                 def f(self):
                     return x
 
-            self.assertEquals(x, 12) # Used to raise UnboundLocalError
+            self.assertEqual(x, 12) # Used to raise UnboundLocalError
         finally:
             sys.settrace(None)
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_shutil.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_shutil.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_shutil.py	Mon Nov 22 12:00:42 2010
@@ -362,7 +362,7 @@
             copied.append((src, dst))
 
         shutil.copytree(src_dir, dst_dir, copy_function=_copy)
-        self.assertEquals(len(copied), 2)
+        self.assertEqual(len(copied), 2)
 
     @support.skip_unless_symlink
     def test_copytree_dangling_symlinks(self):
@@ -477,7 +477,7 @@
 
         self.assertTrue(os.path.exists(tarball2))
         # let's compare both tarballs
-        self.assertEquals(self._tarinfo(tarball), self._tarinfo(tarball2))
+        self.assertEqual(self._tarinfo(tarball), self._tarinfo(tarball2))
 
         # trying an uncompressed one
         base_name = os.path.join(tmpdir2, 'archive')
@@ -572,8 +572,8 @@
         archive = tarfile.open(archive_name)
         try:
             for member in archive.getmembers():
-                self.assertEquals(member.uid, 0)
-                self.assertEquals(member.gid, 0)
+                self.assertEqual(member.uid, 0)
+                self.assertEqual(member.gid, 0)
         finally:
             archive.close()
 
@@ -588,7 +588,7 @@
                 make_archive('xxx', 'xxx', root_dir=self.mkdtemp())
             except Exception:
                 pass
-            self.assertEquals(os.getcwd(), current_dir)
+            self.assertEqual(os.getcwd(), current_dir)
         finally:
             unregister_archive_format('xxx')
 
@@ -635,16 +635,16 @@
             # let's try to unpack it now
             unpack_archive(filename, tmpdir2)
             diff = self._compare_dirs(tmpdir, tmpdir2)
-            self.assertEquals(diff, [])
+            self.assertEqual(diff, [])
 
     def test_unpack_registery(self):
 
         formats = get_unpack_formats()
 
         def _boo(filename, extract_dir, extra):
-            self.assertEquals(extra, 1)
-            self.assertEquals(filename, 'stuff.boo')
-            self.assertEquals(extract_dir, 'xx')
+            self.assertEqual(extra, 1)
+            self.assertEqual(filename, 'stuff.boo')
+            self.assertEqual(extract_dir, 'xx')
 
         register_unpack_format('Boo', ['.boo', '.b2'], _boo, [('extra', 1)])
         unpack_archive('stuff.boo', 'xx')
@@ -661,7 +661,7 @@
 
         # let's leave a clean state
         unregister_unpack_format('Boo2')
-        self.assertEquals(get_unpack_formats(), formats)
+        self.assertEqual(get_unpack_formats(), formats)
 
 
 class TestMove(unittest.TestCase):

Modified: python/branches/py3k-cdecimal/Lib/test/test_signal.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_signal.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_signal.py	Mon Nov 22 12:00:42 2010
@@ -203,10 +203,10 @@
 
     def test_getsignal(self):
         hup = signal.signal(signal.SIGHUP, self.trivial_signal_handler)
-        self.assertEquals(signal.getsignal(signal.SIGHUP),
-                          self.trivial_signal_handler)
+        self.assertEqual(signal.getsignal(signal.SIGHUP),
+                         self.trivial_signal_handler)
         signal.signal(signal.SIGHUP, hup)
-        self.assertEquals(signal.getsignal(signal.SIGHUP), hup)
+        self.assertEqual(signal.getsignal(signal.SIGHUP), hup)
 
 
 @unittest.skipUnless(sys.platform == "win32", "Windows specific")
@@ -456,9 +456,9 @@
                           "high")
 
         # virtual itimer should be (0.0, 0.0) now
-        self.assertEquals(signal.getitimer(self.itimer), (0.0, 0.0))
+        self.assertEqual(signal.getitimer(self.itimer), (0.0, 0.0))
         # and the handler should have been called
-        self.assertEquals(self.hndl_called, True)
+        self.assertEqual(self.hndl_called, True)
 
     # Issue 3864, unknown if this affects earlier versions of freebsd also
     @unittest.skipIf(sys.platform=='freebsd6',
@@ -479,7 +479,7 @@
                           "high")
 
         # profiling itimer should be (0.0, 0.0) now
-        self.assertEquals(signal.getitimer(self.itimer), (0.0, 0.0))
+        self.assertEqual(signal.getitimer(self.itimer), (0.0, 0.0))
         # and the handler should have been called
         self.assertEqual(self.hndl_called, True)
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_site.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_site.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_site.py	Mon Nov 22 12:00:42 2010
@@ -134,7 +134,7 @@
         user_base = site.getuserbase()
 
         # the call sets site.USER_BASE
-        self.assertEquals(site.USER_BASE, user_base)
+        self.assertEqual(site.USER_BASE, user_base)
 
         # let's set PYTHONUSERBASE and see if it uses it
         site.USER_BASE = None
@@ -152,7 +152,7 @@
         user_site = site.getusersitepackages()
 
         # the call sets USER_BASE *and* USER_SITE
-        self.assertEquals(site.USER_SITE, user_site)
+        self.assertEqual(site.USER_SITE, user_site)
         self.assertTrue(user_site.startswith(site.USER_BASE), user_site)
 
     def test_getsitepackages(self):
@@ -162,19 +162,19 @@
         if sys.platform in ('os2emx', 'riscos'):
             self.assertEqual(len(dirs), 1)
             wanted = os.path.join('xoxo', 'Lib', 'site-packages')
-            self.assertEquals(dirs[0], wanted)
+            self.assertEqual(dirs[0], wanted)
         elif os.sep == '/':
             self.assertEqual(len(dirs), 2)
             wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
                                   'site-packages')
-            self.assertEquals(dirs[0], wanted)
+            self.assertEqual(dirs[0], wanted)
             wanted = os.path.join('xoxo', 'lib', 'site-python')
-            self.assertEquals(dirs[1], wanted)
+            self.assertEqual(dirs[1], wanted)
         else:
             self.assertEqual(len(dirs), 2)
-            self.assertEquals(dirs[0], 'xoxo')
+            self.assertEqual(dirs[0], 'xoxo')
             wanted = os.path.join('xoxo', 'lib', 'site-packages')
-            self.assertEquals(dirs[1], wanted)
+            self.assertEqual(dirs[1], wanted)
 
         # let's try the specific Apple location
         if (sys.platform == "darwin" and
@@ -184,7 +184,7 @@
             self.assertEqual(len(dirs), 3)
             wanted = os.path.join('/Library', 'Python', sys.version[:3],
                                   'site-packages')
-            self.assertEquals(dirs[2], wanted)
+            self.assertEqual(dirs[2], wanted)
 
 class PthFile(object):
     """Helper class for handling testing of .pth files"""

Modified: python/branches/py3k-cdecimal/Lib/test/test_slice.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_slice.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_slice.py	Mon Nov 22 12:00:42 2010
@@ -118,7 +118,7 @@
 
         x = X()
         x[1:2] = 42
-        self.assertEquals(tmp, [(slice(1, 2), 42)])
+        self.assertEqual(tmp, [(slice(1, 2), 42)])
 
     def test_pickle(self):
         s = slice(10, 20, 3)

Modified: python/branches/py3k-cdecimal/Lib/test/test_socket.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_socket.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_socket.py	Mon Nov 22 12:00:42 2010
@@ -446,8 +446,8 @@
             return  # No inet_aton, nothing to check
         # Test that issue1008086 and issue767150 are fixed.
         # It must return 4 bytes.
-        self.assertEquals(b'\x00'*4, socket.inet_aton('0.0.0.0'))
-        self.assertEquals(b'\xff'*4, socket.inet_aton('255.255.255.255'))
+        self.assertEqual(b'\x00'*4, socket.inet_aton('0.0.0.0'))
+        self.assertEqual(b'\xff'*4, socket.inet_aton('255.255.255.255'))
 
     def testIPv4toString(self):
         if not hasattr(socket, 'inet_pton'):
@@ -455,16 +455,16 @@
         from socket import inet_aton as f, inet_pton, AF_INET
         g = lambda a: inet_pton(AF_INET, a)
 
-        self.assertEquals(b'\x00\x00\x00\x00', f('0.0.0.0'))
-        self.assertEquals(b'\xff\x00\xff\x00', f('255.0.255.0'))
-        self.assertEquals(b'\xaa\xaa\xaa\xaa', f('170.170.170.170'))
-        self.assertEquals(b'\x01\x02\x03\x04', f('1.2.3.4'))
-        self.assertEquals(b'\xff\xff\xff\xff', f('255.255.255.255'))
-
-        self.assertEquals(b'\x00\x00\x00\x00', g('0.0.0.0'))
-        self.assertEquals(b'\xff\x00\xff\x00', g('255.0.255.0'))
-        self.assertEquals(b'\xaa\xaa\xaa\xaa', g('170.170.170.170'))
-        self.assertEquals(b'\xff\xff\xff\xff', g('255.255.255.255'))
+        self.assertEqual(b'\x00\x00\x00\x00', f('0.0.0.0'))
+        self.assertEqual(b'\xff\x00\xff\x00', f('255.0.255.0'))
+        self.assertEqual(b'\xaa\xaa\xaa\xaa', f('170.170.170.170'))
+        self.assertEqual(b'\x01\x02\x03\x04', f('1.2.3.4'))
+        self.assertEqual(b'\xff\xff\xff\xff', f('255.255.255.255'))
+
+        self.assertEqual(b'\x00\x00\x00\x00', g('0.0.0.0'))
+        self.assertEqual(b'\xff\x00\xff\x00', g('255.0.255.0'))
+        self.assertEqual(b'\xaa\xaa\xaa\xaa', g('170.170.170.170'))
+        self.assertEqual(b'\xff\xff\xff\xff', g('255.255.255.255'))
 
     def testIPv6toString(self):
         if not hasattr(socket, 'inet_pton'):
@@ -477,10 +477,10 @@
             return
         f = lambda a: inet_pton(AF_INET6, a)
 
-        self.assertEquals(b'\x00' * 16, f('::'))
-        self.assertEquals(b'\x00' * 16, f('0::0'))
-        self.assertEquals(b'\x00\x01' + b'\x00' * 14, f('1::'))
-        self.assertEquals(
+        self.assertEqual(b'\x00' * 16, f('::'))
+        self.assertEqual(b'\x00' * 16, f('0::0'))
+        self.assertEqual(b'\x00\x01' + b'\x00' * 14, f('1::'))
+        self.assertEqual(
             b'\x45\xef\x76\xcb\x00\x1a\x56\xef\xaf\xeb\x0b\xac\x19\x24\xae\xae',
             f('45ef:76cb:1a:56ef:afeb:bac:1924:aeae')
         )
@@ -491,14 +491,14 @@
         from socket import inet_ntoa as f, inet_ntop, AF_INET
         g = lambda a: inet_ntop(AF_INET, a)
 
-        self.assertEquals('1.0.1.0', f(b'\x01\x00\x01\x00'))
-        self.assertEquals('170.85.170.85', f(b'\xaa\x55\xaa\x55'))
-        self.assertEquals('255.255.255.255', f(b'\xff\xff\xff\xff'))
-        self.assertEquals('1.2.3.4', f(b'\x01\x02\x03\x04'))
-
-        self.assertEquals('1.0.1.0', g(b'\x01\x00\x01\x00'))
-        self.assertEquals('170.85.170.85', g(b'\xaa\x55\xaa\x55'))
-        self.assertEquals('255.255.255.255', g(b'\xff\xff\xff\xff'))
+        self.assertEqual('1.0.1.0', f(b'\x01\x00\x01\x00'))
+        self.assertEqual('170.85.170.85', f(b'\xaa\x55\xaa\x55'))
+        self.assertEqual('255.255.255.255', f(b'\xff\xff\xff\xff'))
+        self.assertEqual('1.2.3.4', f(b'\x01\x02\x03\x04'))
+
+        self.assertEqual('1.0.1.0', g(b'\x01\x00\x01\x00'))
+        self.assertEqual('170.85.170.85', g(b'\xaa\x55\xaa\x55'))
+        self.assertEqual('255.255.255.255', g(b'\xff\xff\xff\xff'))
 
     def testStringToIPv6(self):
         if not hasattr(socket, 'inet_ntop'):
@@ -511,9 +511,9 @@
             return
         f = lambda a: inet_ntop(AF_INET6, a)
 
-        self.assertEquals('::', f(b'\x00' * 16))
-        self.assertEquals('::1', f(b'\x00' * 15 + b'\x01'))
-        self.assertEquals(
+        self.assertEqual('::', f(b'\x00' * 16))
+        self.assertEqual('::1', f(b'\x00' * 15 + b'\x01'))
+        self.assertEqual(
             'aef:b01:506:1001:ffff:9997:55:170',
             f(b'\x0a\xef\x0b\x01\x05\x06\x10\x01\xff\xff\x99\x97\x00\x55\x01\x70')
         )
@@ -544,7 +544,11 @@
         # XXX(nnorwitz): http://tinyurl.com/os5jz seems to indicate
         # it reasonable to get the host's addr in addition to 0.0.0.0.
         # At least for eCos.  This is required for the S/390 to pass.
-        my_ip_addr = socket.gethostbyname(socket.gethostname())
+        try:
+            my_ip_addr = socket.gethostbyname(socket.gethostname())
+        except socket.error:
+            # Probably name lookup wasn't set up right; skip this test
+            return
         self.assertIn(name[0], ("0.0.0.0", my_ip_addr), '%s invalid' % name[0])
         self.assertEqual(name[1], port)
 
@@ -1222,8 +1226,8 @@
                 lambda : b"",  # XXX(gps): io library does an extra EOF read
             ])
         fo = mock_sock._textiowrap_for_test(buffering=buffering)
-        self.assertEquals(fo.readline(size), "This is the first line\n")
-        self.assertEquals(fo.readline(size), "And the second line is here\n")
+        self.assertEqual(fo.readline(size), "This is the first line\n")
+        self.assertEqual(fo.readline(size), "And the second line is here\n")
 
     def _test_read(self, size=-1, buffering=-1):
         mock_sock = self.MockSocket(recv_funcs=[
@@ -1246,7 +1250,7 @@
             if not part:
                 break
             data += part
-        self.assertEquals(data, expecting)
+        self.assertEqual(data, expecting)
 
     def test_default(self):
         self._test_readline()
@@ -1270,8 +1274,8 @@
                 lambda : b"",
             ])
         fo = mock_sock._textiowrap_for_test(buffering=0)
-        self.assertEquals(fo.readline(size), b"a\n")
-        self.assertEquals(fo.readline(size), b"Bb")
+        self.assertEqual(fo.readline(size), b"a\n")
+        self.assertEqual(fo.readline(size), b"Bb")
 
     def test_no_buffer(self):
         self._test_readline_no_buffer()
@@ -1521,7 +1525,7 @@
             self.addCleanup(self.cli.close)
         finally:
             socket.setdefaulttimeout(None)
-        self.assertEquals(self.cli.gettimeout(), 42)
+        self.assertEqual(self.cli.gettimeout(), 42)
 
     testTimeoutNone = _justAccept
     def _testTimeoutNone(self):

Modified: python/branches/py3k-cdecimal/Lib/test/test_socketserver.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_socketserver.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_socketserver.py	Mon Nov 22 12:00:42 2010
@@ -57,8 +57,8 @@
         os._exit(72)
     yield None
     pid2, status = os.waitpid(pid, 0)
-    testcase.assertEquals(pid2, pid)
-    testcase.assertEquals(72 << 8, status)
+    testcase.assertEqual(pid2, pid)
+    testcase.assertEqual(72 << 8, status)
 
 
 @unittest.skipUnless(threading, 'Threading required for this test.')
@@ -120,7 +120,7 @@
 
         if verbose: print("creating server")
         server = MyServer(addr, MyHandler)
-        self.assertEquals(server.server_address, server.socket.getsockname())
+        self.assertEqual(server.server_address, server.socket.getsockname())
         return server
 
     @unittest.skipUnless(threading, 'Threading required for this test.')
@@ -161,7 +161,7 @@
         while data and b'\n' not in buf:
             data = receive(s, 100)
             buf += data
-        self.assertEquals(buf, TEST_STR)
+        self.assertEqual(buf, TEST_STR)
         s.close()
 
     def dgram_examine(self, proto, addr):
@@ -171,7 +171,7 @@
         while data and b'\n' not in buf:
             data = receive(s, 100)
             buf += data
-        self.assertEquals(buf, TEST_STR)
+        self.assertEqual(buf, TEST_STR)
         s.close()
 
     def test_TCPServer(self):

Modified: python/branches/py3k-cdecimal/Lib/test/test_structmembers.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_structmembers.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_structmembers.py	Mon Nov 22 12:00:42 2010
@@ -28,64 +28,64 @@
 
     def test_bool(self):
         ts.T_BOOL = True
-        self.assertEquals(ts.T_BOOL, True)
+        self.assertEqual(ts.T_BOOL, True)
         ts.T_BOOL = False
-        self.assertEquals(ts.T_BOOL, False)
+        self.assertEqual(ts.T_BOOL, False)
         self.assertRaises(TypeError, setattr, ts, 'T_BOOL', 1)
 
     def test_byte(self):
         ts.T_BYTE = CHAR_MAX
-        self.assertEquals(ts.T_BYTE, CHAR_MAX)
+        self.assertEqual(ts.T_BYTE, CHAR_MAX)
         ts.T_BYTE = CHAR_MIN
-        self.assertEquals(ts.T_BYTE, CHAR_MIN)
+        self.assertEqual(ts.T_BYTE, CHAR_MIN)
         ts.T_UBYTE = UCHAR_MAX
-        self.assertEquals(ts.T_UBYTE, UCHAR_MAX)
+        self.assertEqual(ts.T_UBYTE, UCHAR_MAX)
 
     def test_short(self):
         ts.T_SHORT = SHRT_MAX
-        self.assertEquals(ts.T_SHORT, SHRT_MAX)
+        self.assertEqual(ts.T_SHORT, SHRT_MAX)
         ts.T_SHORT = SHRT_MIN
-        self.assertEquals(ts.T_SHORT, SHRT_MIN)
+        self.assertEqual(ts.T_SHORT, SHRT_MIN)
         ts.T_USHORT = USHRT_MAX
-        self.assertEquals(ts.T_USHORT, USHRT_MAX)
+        self.assertEqual(ts.T_USHORT, USHRT_MAX)
 
     def test_int(self):
         ts.T_INT = INT_MAX
-        self.assertEquals(ts.T_INT, INT_MAX)
+        self.assertEqual(ts.T_INT, INT_MAX)
         ts.T_INT = INT_MIN
-        self.assertEquals(ts.T_INT, INT_MIN)
+        self.assertEqual(ts.T_INT, INT_MIN)
         ts.T_UINT = UINT_MAX
-        self.assertEquals(ts.T_UINT, UINT_MAX)
+        self.assertEqual(ts.T_UINT, UINT_MAX)
 
     def test_long(self):
         ts.T_LONG = LONG_MAX
-        self.assertEquals(ts.T_LONG, LONG_MAX)
+        self.assertEqual(ts.T_LONG, LONG_MAX)
         ts.T_LONG = LONG_MIN
-        self.assertEquals(ts.T_LONG, LONG_MIN)
+        self.assertEqual(ts.T_LONG, LONG_MIN)
         ts.T_ULONG = ULONG_MAX
-        self.assertEquals(ts.T_ULONG, ULONG_MAX)
+        self.assertEqual(ts.T_ULONG, ULONG_MAX)
 
     def test_py_ssize_t(self):
         ts.T_PYSSIZET = PY_SSIZE_T_MAX
-        self.assertEquals(ts.T_PYSSIZET, PY_SSIZE_T_MAX)
+        self.assertEqual(ts.T_PYSSIZET, PY_SSIZE_T_MAX)
         ts.T_PYSSIZET = PY_SSIZE_T_MIN
-        self.assertEquals(ts.T_PYSSIZET, PY_SSIZE_T_MIN)
+        self.assertEqual(ts.T_PYSSIZET, PY_SSIZE_T_MIN)
 
     @unittest.skipUnless(hasattr(ts, "T_LONGLONG"), "long long not present")
     def test_longlong(self):
         ts.T_LONGLONG = LLONG_MAX
-        self.assertEquals(ts.T_LONGLONG, LLONG_MAX)
+        self.assertEqual(ts.T_LONGLONG, LLONG_MAX)
         ts.T_LONGLONG = LLONG_MIN
-        self.assertEquals(ts.T_LONGLONG, LLONG_MIN)
+        self.assertEqual(ts.T_LONGLONG, LLONG_MIN)
 
         ts.T_ULONGLONG = ULLONG_MAX
-        self.assertEquals(ts.T_ULONGLONG, ULLONG_MAX)
+        self.assertEqual(ts.T_ULONGLONG, ULLONG_MAX)
 
         ## make sure these will accept a plain int as well as a long
         ts.T_LONGLONG = 3
-        self.assertEquals(ts.T_LONGLONG, 3)
+        self.assertEqual(ts.T_LONGLONG, 3)
         ts.T_ULONGLONG = 4
-        self.assertEquals(ts.T_ULONGLONG, 4)
+        self.assertEqual(ts.T_ULONGLONG, 4)
 
     def test_bad_assignments(self):
         integer_attributes = [
@@ -106,7 +106,7 @@
                 self.assertRaises(TypeError, setattr, ts, attr, nonint)
 
     def test_inplace_string(self):
-        self.assertEquals(ts.T_STRING_INPLACE, "hi")
+        self.assertEqual(ts.T_STRING_INPLACE, "hi")
         self.assertRaises(TypeError, setattr, ts, "T_STRING_INPLACE", "s")
         self.assertRaises(TypeError, delattr, ts, "T_STRING_INPLACE")
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_subprocess.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_subprocess.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_subprocess.py	Mon Nov 22 12:00:42 2010
@@ -591,7 +591,7 @@
                 "[sys.executable, '-c', 'print(\"Hello World!\")'])",
             'assert retcode == 0'))
         output = subprocess.check_output([sys.executable, '-c', code])
-        self.assert_(output.startswith(b'Hello World!'), ascii(output))
+        self.assertTrue(output.startswith(b'Hello World!'), ascii(output))
 
     def test_handles_closed_on_exception(self):
         # If CreateProcess exits with an error, ensure the
@@ -666,6 +666,7 @@
             # string and instead capture the exception that we want to see
             # below for comparison.
             desired_exception = e
+            desired_exception.strerror += ': ' + repr(sys.executable)
         else:
             self.fail("chdir to nonexistant directory %s succeeded." %
                       nonexistent_dir)
@@ -927,7 +928,7 @@
                 [sys.executable, "-c", script],
                 env=env)
             stdout = stdout.rstrip(b'\n\r')
-            self.assertEquals(stdout.decode('ascii'), ascii(value))
+            self.assertEqual(stdout.decode('ascii'), ascii(value))
 
             # test bytes
             key = key.encode("ascii", "surrogateescape")
@@ -939,7 +940,7 @@
                 [sys.executable, "-c", script],
                 env=env)
             stdout = stdout.rstrip(b'\n\r')
-            self.assertEquals(stdout.decode('ascii'), ascii(value))
+            self.assertEqual(stdout.decode('ascii'), ascii(value))
 
     def test_bytes_program(self):
         abs_program = os.fsencode(sys.executable)
@@ -948,19 +949,19 @@
 
         # absolute bytes path
         exitcode = subprocess.call([abs_program, "-c", "pass"])
-        self.assertEquals(exitcode, 0)
+        self.assertEqual(exitcode, 0)
 
         # bytes program, unicode PATH
         env = os.environ.copy()
         env["PATH"] = path
         exitcode = subprocess.call([program, "-c", "pass"], env=env)
-        self.assertEquals(exitcode, 0)
+        self.assertEqual(exitcode, 0)
 
         # bytes program, bytes PATH
         envb = os.environb.copy()
         envb[b"PATH"] = os.fsencode(path)
         exitcode = subprocess.call([program, "-c", "pass"], env=envb)
-        self.assertEquals(exitcode, 0)
+        self.assertEqual(exitcode, 0)
 
 
 @unittest.skipUnless(mswindows, "Windows specific tests")

Modified: python/branches/py3k-cdecimal/Lib/test/test_sys.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_sys.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_sys.py	Mon Nov 22 12:00:42 2010
@@ -93,7 +93,7 @@
         try:
             sys.exit(0)
         except SystemExit as exc:
-            self.assertEquals(exc.code, 0)
+            self.assertEqual(exc.code, 0)
         except:
             self.fail("wrong exception")
         else:
@@ -104,7 +104,7 @@
         try:
             sys.exit(42)
         except SystemExit as exc:
-            self.assertEquals(exc.code, 42)
+            self.assertEqual(exc.code, 42)
         except:
             self.fail("wrong exception")
         else:
@@ -114,7 +114,7 @@
         try:
             sys.exit((42,))
         except SystemExit as exc:
-            self.assertEquals(exc.code, 42)
+            self.assertEqual(exc.code, 42)
         except:
             self.fail("wrong exception")
         else:
@@ -124,7 +124,7 @@
         try:
             sys.exit("exit")
         except SystemExit as exc:
-            self.assertEquals(exc.code, "exit")
+            self.assertEqual(exc.code, "exit")
         except:
             self.fail("wrong exception")
         else:
@@ -134,7 +134,7 @@
         try:
             sys.exit((17, 23))
         except SystemExit as exc:
-            self.assertEquals(exc.code, (17, 23))
+            self.assertEqual(exc.code, (17, 23))
         except:
             self.fail("wrong exception")
         else:
@@ -188,7 +188,7 @@
             orig = sys.getcheckinterval()
             for n in 0, 100, 120, orig: # orig last to restore starting state
                 sys.setcheckinterval(n)
-                self.assertEquals(sys.getcheckinterval(), n)
+                self.assertEqual(sys.getcheckinterval(), n)
 
     @unittest.skipUnless(threading, 'Threading required for this test.')
     def test_switchinterval(self):
@@ -202,7 +202,7 @@
         try:
             for n in 0.00001, 0.05, 3.0, orig:
                 sys.setswitchinterval(n)
-                self.assertAlmostEquals(sys.getswitchinterval(), n)
+                self.assertAlmostEqual(sys.getswitchinterval(), n)
         finally:
             sys.setswitchinterval(orig)
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_sysconfig.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_sysconfig.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_sysconfig.py	Mon Nov 22 12:00:42 2010
@@ -88,7 +88,7 @@
             shutil.rmtree(path)
 
     def test_get_path_names(self):
-        self.assertEquals(get_path_names(), sysconfig._SCHEME_KEYS)
+        self.assertEqual(get_path_names(), sysconfig._SCHEME_KEYS)
 
     def test_get_paths(self):
         scheme = get_paths()
@@ -98,7 +98,7 @@
         wanted.sort()
         scheme = list(scheme.items())
         scheme.sort()
-        self.assertEquals(scheme, wanted)
+        self.assertEqual(scheme, wanted)
 
     def test_get_path(self):
         # xxx make real tests here
@@ -117,21 +117,21 @@
         sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
                        '[MSC v.1310 32 bit (Intel)]')
         sys.platform = 'win32'
-        self.assertEquals(get_platform(), 'win32')
+        self.assertEqual(get_platform(), 'win32')
 
         # windows XP, amd64
         os.name = 'nt'
         sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
                        '[MSC v.1310 32 bit (Amd64)]')
         sys.platform = 'win32'
-        self.assertEquals(get_platform(), 'win-amd64')
+        self.assertEqual(get_platform(), 'win-amd64')
 
         # windows XP, itanium
         os.name = 'nt'
         sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
                        '[MSC v.1310 32 bit (Itanium)]')
         sys.platform = 'win32'
-        self.assertEquals(get_platform(), 'win-ia64')
+        self.assertEqual(get_platform(), 'win-ia64')
 
         # macbook
         os.name = 'posix'
@@ -150,9 +150,9 @@
         maxint = sys.maxsize
         try:
             sys.maxsize = 2147483647
-            self.assertEquals(get_platform(), 'macosx-10.3-ppc')
+            self.assertEqual(get_platform(), 'macosx-10.3-ppc')
             sys.maxsize = 9223372036854775807
-            self.assertEquals(get_platform(), 'macosx-10.3-ppc64')
+            self.assertEqual(get_platform(), 'macosx-10.3-ppc64')
         finally:
             sys.maxsize = maxint
 
@@ -169,9 +169,9 @@
         maxint = sys.maxsize
         try:
             sys.maxsize = 2147483647
-            self.assertEquals(get_platform(), 'macosx-10.3-i386')
+            self.assertEqual(get_platform(), 'macosx-10.3-i386')
             sys.maxsize = 9223372036854775807
-            self.assertEquals(get_platform(), 'macosx-10.3-x86_64')
+            self.assertEqual(get_platform(), 'macosx-10.3-x86_64')
         finally:
             sys.maxsize = maxint
 
@@ -182,33 +182,33 @@
                                        '-fno-strict-aliasing -fno-common '
                                        '-dynamic -DNDEBUG -g -O3')
 
-        self.assertEquals(get_platform(), 'macosx-10.4-fat')
+        self.assertEqual(get_platform(), 'macosx-10.4-fat')
 
         get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch i386 -isysroot '
                                        '/Developer/SDKs/MacOSX10.4u.sdk  '
                                        '-fno-strict-aliasing -fno-common '
                                        '-dynamic -DNDEBUG -g -O3')
 
-        self.assertEquals(get_platform(), 'macosx-10.4-intel')
+        self.assertEqual(get_platform(), 'macosx-10.4-intel')
 
         get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc -arch i386 -isysroot '
                                        '/Developer/SDKs/MacOSX10.4u.sdk  '
                                        '-fno-strict-aliasing -fno-common '
                                        '-dynamic -DNDEBUG -g -O3')
-        self.assertEquals(get_platform(), 'macosx-10.4-fat3')
+        self.assertEqual(get_platform(), 'macosx-10.4-fat3')
 
         get_config_vars()['CFLAGS'] = ('-arch ppc64 -arch x86_64 -arch ppc -arch i386 -isysroot '
                                        '/Developer/SDKs/MacOSX10.4u.sdk  '
                                        '-fno-strict-aliasing -fno-common '
                                        '-dynamic -DNDEBUG -g -O3')
-        self.assertEquals(get_platform(), 'macosx-10.4-universal')
+        self.assertEqual(get_platform(), 'macosx-10.4-universal')
 
         get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc64 -isysroot '
                                        '/Developer/SDKs/MacOSX10.4u.sdk  '
                                        '-fno-strict-aliasing -fno-common '
                                        '-dynamic -DNDEBUG -g -O3')
 
-        self.assertEquals(get_platform(), 'macosx-10.4-fat64')
+        self.assertEqual(get_platform(), 'macosx-10.4-fat64')
 
         for arch in ('ppc', 'i386', 'x86_64', 'ppc64'):
             get_config_vars()['CFLAGS'] = ('-arch %s -isysroot '
@@ -216,7 +216,7 @@
                                            '-fno-strict-aliasing -fno-common '
                                            '-dynamic -DNDEBUG -g -O3'%(arch,))
 
-            self.assertEquals(get_platform(), 'macosx-10.4-%s'%(arch,))
+            self.assertEqual(get_platform(), 'macosx-10.4-%s'%(arch,))
 
         # linux debian sarge
         os.name = 'posix'
@@ -226,7 +226,7 @@
         self._set_uname(('Linux', 'aglae', '2.6.21.1dedibox-r7',
                     '#1 Mon Apr 30 17:25:38 CEST 2007', 'i686'))
 
-        self.assertEquals(get_platform(), 'linux-i686')
+        self.assertEqual(get_platform(), 'linux-i686')
 
         # XXX more platforms to tests here
 
@@ -243,7 +243,7 @@
     def test_get_scheme_names(self):
         wanted = ('nt', 'nt_user', 'os2', 'os2_home', 'osx_framework_user',
                   'posix_home', 'posix_prefix', 'posix_user')
-        self.assertEquals(get_scheme_names(), wanted)
+        self.assertEqual(get_scheme_names(), wanted)
 
     @skip_unless_symlink
     def test_symlink(self):
@@ -275,7 +275,7 @@
         for name in ('stdlib', 'platstdlib', 'purelib', 'platlib'):
             global_path = get_path(name, 'posix_prefix')
             user_path = get_path(name, 'posix_user')
-            self.assertEquals(user_path, global_path.replace(base, user))
+            self.assertEqual(user_path, global_path.replace(base, user))
 
     def test_main(self):
         # just making sure _main() runs and returns things in the stdout

Modified: python/branches/py3k-cdecimal/Lib/test/test_tarfile.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_tarfile.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_tarfile.py	Mon Nov 22 12:00:42 2010
@@ -1000,7 +1000,7 @@
             tar = tarfile.open(tmpname, "r")
             try:
                 for t in tar:
-                    self.assert_(t.name == "." or t.name.startswith("./"))
+                    self.assertTrue(t.name == "." or t.name.startswith("./"))
             finally:
                 tar.close()
         finally:

Modified: python/branches/py3k-cdecimal/Lib/test/test_tempfile.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_tempfile.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_tempfile.py	Mon Nov 22 12:00:42 2010
@@ -319,7 +319,7 @@
         f.write(b"blat\x1a")
         f.write(b"extra\n")
         os.lseek(f.fd, 0, os.SEEK_SET)
-        self.assertEquals(os.read(f.fd, 20), b"blat")
+        self.assertEqual(os.read(f.fd, 20), b"blat")
 
 test_classes.append(test__mkstemp_inner)
 
@@ -879,7 +879,7 @@
             with tempfile.TemporaryFile(*args, **kwargs) as fileobj:
                 fileobj.write(input)
                 fileobj.seek(0)
-                self.assertEquals(input, fileobj.read())
+                self.assertEqual(input, fileobj.read())
 
         roundtrip(b"1234", "w+b")
         roundtrip("abdc\n", "w+")

Modified: python/branches/py3k-cdecimal/Lib/test/test_textwrap.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_textwrap.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_textwrap.py	Mon Nov 22 12:00:42 2010
@@ -29,7 +29,7 @@
 
 
     def check(self, result, expect):
-        self.assertEquals(result, expect,
+        self.assertEqual(result, expect,
             'expected:\n%s\nbut got:\n%s' % (
                 self.show(expect), self.show(result)))
 
@@ -39,9 +39,9 @@
 
     def check_split(self, text, expect):
         result = self.wrapper._split(text)
-        self.assertEquals(result, expect,
-                          "\nexpected %r\n"
-                          "but got  %r" % (expect, result))
+        self.assertEqual(result, expect,
+                         "\nexpected %r\n"
+                         "but got  %r" % (expect, result))
 
 
 class WrapTestCase(BaseTestCase):
@@ -490,7 +490,7 @@
 
     def assertUnchanged(self, text):
         """assert that dedent() has no effect on 'text'"""
-        self.assertEquals(text, dedent(text))
+        self.assertEqual(text, dedent(text))
 
     def test_dedent_nomargin(self):
         # No lines indented.
@@ -513,17 +513,17 @@
         # All lines indented by two spaces.
         text = "  Hello there.\n  How are ya?\n  Oh good."
         expect = "Hello there.\nHow are ya?\nOh good."
-        self.assertEquals(expect, dedent(text))
+        self.assertEqual(expect, dedent(text))
 
         # Same, with blank lines.
         text = "  Hello there.\n\n  How are ya?\n  Oh good.\n"
         expect = "Hello there.\n\nHow are ya?\nOh good.\n"
-        self.assertEquals(expect, dedent(text))
+        self.assertEqual(expect, dedent(text))
 
         # Now indent one of the blank lines.
         text = "  Hello there.\n  \n  How are ya?\n  Oh good.\n"
         expect = "Hello there.\n\nHow are ya?\nOh good.\n"
-        self.assertEquals(expect, dedent(text))
+        self.assertEqual(expect, dedent(text))
 
     def test_dedent_uneven(self):
         # Lines indented unevenly.
@@ -537,27 +537,27 @@
     while 1:
         return foo
 '''
-        self.assertEquals(expect, dedent(text))
+        self.assertEqual(expect, dedent(text))
 
         # Uneven indentation with a blank line.
         text = "  Foo\n    Bar\n\n   Baz\n"
         expect = "Foo\n  Bar\n\n Baz\n"
-        self.assertEquals(expect, dedent(text))
+        self.assertEqual(expect, dedent(text))
 
         # Uneven indentation with a whitespace-only line.
         text = "  Foo\n    Bar\n \n   Baz\n"
         expect = "Foo\n  Bar\n\n Baz\n"
-        self.assertEquals(expect, dedent(text))
+        self.assertEqual(expect, dedent(text))
 
     # dedent() should not mangle internal tabs
     def test_dedent_preserve_internal_tabs(self):
         text = "  hello\tthere\n  how are\tyou?"
         expect = "hello\tthere\nhow are\tyou?"
-        self.assertEquals(expect, dedent(text))
+        self.assertEqual(expect, dedent(text))
 
         # make sure that it preserves tabs when it's not making any
         # changes at all
-        self.assertEquals(expect, dedent(expect))
+        self.assertEqual(expect, dedent(expect))
 
     # dedent() should not mangle tabs in the margin (i.e.
     # tabs and spaces both count as margin, but are *not*
@@ -573,17 +573,17 @@
         # dedent() only removes whitespace that can be uniformly removed!
         text = "\thello there\n\thow are you?"
         expect = "hello there\nhow are you?"
-        self.assertEquals(expect, dedent(text))
+        self.assertEqual(expect, dedent(text))
 
         text = "  \thello there\n  \thow are you?"
-        self.assertEquals(expect, dedent(text))
+        self.assertEqual(expect, dedent(text))
 
         text = "  \t  hello there\n  \t  how are you?"
-        self.assertEquals(expect, dedent(text))
+        self.assertEqual(expect, dedent(text))
 
         text = "  \thello there\n  \t  how are you?"
         expect = "hello there\n  how are you?"
-        self.assertEquals(expect, dedent(text))
+        self.assertEqual(expect, dedent(text))
 
 
 def test_main():

Modified: python/branches/py3k-cdecimal/Lib/test/test_threadedtempfile.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_threadedtempfile.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_threadedtempfile.py	Mon Nov 22 12:00:42 2010
@@ -68,8 +68,8 @@
 
         msg = "Errors: errors %d ok %d\n%s" % (len(errors), ok,
             '\n'.join(errors))
-        self.assertEquals(errors, [], msg)
-        self.assertEquals(ok, NUM_THREADS * FILES_PER_THREAD)
+        self.assertEqual(errors, [], msg)
+        self.assertEqual(ok, NUM_THREADS * FILES_PER_THREAD)
 
 def test_main():
     run_unittest(ThreadedTempFileTest)

Modified: python/branches/py3k-cdecimal/Lib/test/test_threading.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_threading.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_threading.py	Mon Nov 22 12:00:42 2010
@@ -398,17 +398,17 @@
         weak_cyclic_object = weakref.ref(cyclic_object)
         cyclic_object.thread.join()
         del cyclic_object
-        self.assertEquals(None, weak_cyclic_object(),
-                          msg=('%d references still around' %
-                               sys.getrefcount(weak_cyclic_object())))
+        self.assertEqual(None, weak_cyclic_object(),
+                         msg=('%d references still around' %
+                              sys.getrefcount(weak_cyclic_object())))
 
         raising_cyclic_object = RunSelfFunction(should_raise=True)
         weak_raising_cyclic_object = weakref.ref(raising_cyclic_object)
         raising_cyclic_object.thread.join()
         del raising_cyclic_object
-        self.assertEquals(None, weak_raising_cyclic_object(),
-                          msg=('%d references still around' %
-                               sys.getrefcount(weak_raising_cyclic_object())))
+        self.assertEqual(None, weak_raising_cyclic_object(),
+                         msg=('%d references still around' %
+                              sys.getrefcount(weak_raising_cyclic_object())))
 
     def test_old_threading_api(self):
         # Just a quick sanity check to make sure the old method names are

Modified: python/branches/py3k-cdecimal/Lib/test/test_time.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_time.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_time.py	Mon Nov 22 12:00:42 2010
@@ -97,7 +97,7 @@
         # based on its value.
         expected = "2000 01 01 00 00 00 1 001"
         result = time.strftime("%Y %m %d %H %M %S %w %j", (0,)*9)
-        self.assertEquals(expected, result)
+        self.assertEqual(expected, result)
 
     def test_strptime(self):
         # Should be able to go round-trip from strftime to strptime without

Modified: python/branches/py3k-cdecimal/Lib/test/test_tokenize.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_tokenize.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_tokenize.py	Mon Nov 22 12:00:42 2010
@@ -689,8 +689,8 @@
         # skip the initial encoding token and the end token
         tokens = list(_tokenize(readline, encoding='utf-8'))[1:-1]
         expected_tokens = [(3, '"ЉЊЈЁЂ"', (1, 0), (1, 7), '"ЉЊЈЁЂ"')]
-        self.assertEquals(tokens, expected_tokens,
-                          "bytes not decoded with encoding")
+        self.assertEqual(tokens, expected_tokens,
+                         "bytes not decoded with encoding")
 
     def test__tokenize_does_not_decode_with_encoding_none(self):
         literal = '"ЉЊЈЁЂ"'
@@ -706,8 +706,8 @@
         # skip the end token
         tokens = list(_tokenize(readline, encoding=None))[:-1]
         expected_tokens = [(3, '"ЉЊЈЁЂ"', (1, 0), (1, 7), '"ЉЊЈЁЂ"')]
-        self.assertEquals(tokens, expected_tokens,
-                          "string not tokenized when encoding is None")
+        self.assertEqual(tokens, expected_tokens,
+                         "string not tokenized when encoding is None")
 
 
 class TestDetectEncoding(TestCase):
@@ -730,8 +730,8 @@
             b'do_something(else)\n'
         )
         encoding, consumed_lines = detect_encoding(self.get_readline(lines))
-        self.assertEquals(encoding, 'utf-8')
-        self.assertEquals(consumed_lines, list(lines[:2]))
+        self.assertEqual(encoding, 'utf-8')
+        self.assertEqual(consumed_lines, list(lines[:2]))
 
     def test_bom_no_cookie(self):
         lines = (
@@ -740,9 +740,9 @@
             b'do_something(else)\n'
         )
         encoding, consumed_lines = detect_encoding(self.get_readline(lines))
-        self.assertEquals(encoding, 'utf-8-sig')
-        self.assertEquals(consumed_lines,
-                          [b'# something\n', b'print(something)\n'])
+        self.assertEqual(encoding, 'utf-8-sig')
+        self.assertEqual(consumed_lines,
+                         [b'# something\n', b'print(something)\n'])
 
     def test_cookie_first_line_no_bom(self):
         lines = (
@@ -751,8 +751,8 @@
             b'do_something(else)\n'
         )
         encoding, consumed_lines = detect_encoding(self.get_readline(lines))
-        self.assertEquals(encoding, 'iso-8859-1')
-        self.assertEquals(consumed_lines, [b'# -*- coding: latin-1 -*-\n'])
+        self.assertEqual(encoding, 'iso-8859-1')
+        self.assertEqual(consumed_lines, [b'# -*- coding: latin-1 -*-\n'])
 
     def test_matched_bom_and_cookie_first_line(self):
         lines = (
@@ -761,8 +761,8 @@
             b'do_something(else)\n'
         )
         encoding, consumed_lines = detect_encoding(self.get_readline(lines))
-        self.assertEquals(encoding, 'utf-8-sig')
-        self.assertEquals(consumed_lines, [b'# coding=utf-8\n'])
+        self.assertEqual(encoding, 'utf-8-sig')
+        self.assertEqual(consumed_lines, [b'# coding=utf-8\n'])
 
     def test_mismatched_bom_and_cookie_first_line_raises_syntaxerror(self):
         lines = (
@@ -781,9 +781,9 @@
             b'do_something(else)\n'
         )
         encoding, consumed_lines = detect_encoding(self.get_readline(lines))
-        self.assertEquals(encoding, 'ascii')
+        self.assertEqual(encoding, 'ascii')
         expected = [b'#! something\n', b'# vim: set fileencoding=ascii :\n']
-        self.assertEquals(consumed_lines, expected)
+        self.assertEqual(consumed_lines, expected)
 
     def test_matched_bom_and_cookie_second_line(self):
         lines = (
@@ -793,9 +793,9 @@
             b'do_something(else)\n'
         )
         encoding, consumed_lines = detect_encoding(self.get_readline(lines))
-        self.assertEquals(encoding, 'utf-8-sig')
-        self.assertEquals(consumed_lines,
-                          [b'#! something\n', b'f# coding=utf-8\n'])
+        self.assertEqual(encoding, 'utf-8-sig')
+        self.assertEqual(consumed_lines,
+                         [b'#! something\n', b'f# coding=utf-8\n'])
 
     def test_mismatched_bom_and_cookie_second_line_raises_syntaxerror(self):
         lines = (
@@ -820,7 +820,7 @@
                          b"do_something += 4\n")
                 rl = self.get_readline(lines)
                 found, consumed_lines = detect_encoding(rl)
-                self.assertEquals(found, "iso-8859-1")
+                self.assertEqual(found, "iso-8859-1")
 
     def test_utf8_normalization(self):
         # See get_normal_name() in tokenizer.c.
@@ -833,27 +833,27 @@
                          b"1 + 3\n")
                 rl = self.get_readline(lines)
                 found, consumed_lines = detect_encoding(rl)
-                self.assertEquals(found, "utf-8")
+                self.assertEqual(found, "utf-8")
 
     def test_short_files(self):
         readline = self.get_readline((b'print(something)\n',))
         encoding, consumed_lines = detect_encoding(readline)
-        self.assertEquals(encoding, 'utf-8')
-        self.assertEquals(consumed_lines, [b'print(something)\n'])
+        self.assertEqual(encoding, 'utf-8')
+        self.assertEqual(consumed_lines, [b'print(something)\n'])
 
         encoding, consumed_lines = detect_encoding(self.get_readline(()))
-        self.assertEquals(encoding, 'utf-8')
-        self.assertEquals(consumed_lines, [])
+        self.assertEqual(encoding, 'utf-8')
+        self.assertEqual(consumed_lines, [])
 
         readline = self.get_readline((b'\xef\xbb\xbfprint(something)\n',))
         encoding, consumed_lines = detect_encoding(readline)
-        self.assertEquals(encoding, 'utf-8-sig')
-        self.assertEquals(consumed_lines, [b'print(something)\n'])
+        self.assertEqual(encoding, 'utf-8-sig')
+        self.assertEqual(consumed_lines, [b'print(something)\n'])
 
         readline = self.get_readline((b'\xef\xbb\xbf',))
         encoding, consumed_lines = detect_encoding(readline)
-        self.assertEquals(encoding, 'utf-8-sig')
-        self.assertEquals(consumed_lines, [])
+        self.assertEqual(encoding, 'utf-8-sig')
+        self.assertEqual(consumed_lines, [])
 
         readline = self.get_readline((b'# coding: bad\n',))
         self.assertRaises(SyntaxError, detect_encoding, readline)
@@ -912,7 +912,7 @@
         tokenize_module._tokenize = mock__tokenize
         try:
             results = tokenize(mock_readline)
-            self.assertEquals(list(results), ['first', 'second', 1, 2, 3, 4])
+            self.assertEqual(list(results), ['first', 'second', 1, 2, 3, 4])
         finally:
             tokenize_module.detect_encoding = orig_detect_encoding
             tokenize_module._tokenize = orig__tokenize

Modified: python/branches/py3k-cdecimal/Lib/test/test_trace.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_trace.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_trace.py	Mon Nov 22 12:00:42 2010
@@ -311,7 +311,7 @@
             self._coverage(tracer)
         if os.path.exists(TESTFN):
             files = os.listdir(TESTFN)
-            self.assertEquals(files, [])
+            self.assertEqual(files, [])
 
     def test_issue9936(self):
         tracer = trace.Trace(trace=0, count=1)

Modified: python/branches/py3k-cdecimal/Lib/test/test_traceback.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_traceback.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_traceback.py	Mon Nov 22 12:00:42 2010
@@ -164,11 +164,11 @@
             raise Error("unable to create test traceback string")
 
         # Make sure that Python and the traceback module format the same thing
-        self.assertEquals(traceback_fmt, python_fmt)
+        self.assertEqual(traceback_fmt, python_fmt)
 
         # Make sure that the traceback is properly indented.
         tb_lines = python_fmt.splitlines()
-        self.assertEquals(len(tb_lines), 3)
+        self.assertEqual(len(tb_lines), 3)
         banner, location, source_line = tb_lines
         self.assertTrue(banner.startswith('Traceback'))
         self.assertTrue(location.startswith('  File'))
@@ -212,7 +212,7 @@
         except ZeroDivisionError as _:
             e = _
         lines = self.get_report(e).splitlines()
-        self.assertEquals(len(lines), 4)
+        self.assertEqual(len(lines), 4)
         self.assertTrue(lines[0].startswith('Traceback'))
         self.assertTrue(lines[1].startswith('  File'))
         self.assertIn('1/0 # Marker', lines[2])
@@ -227,8 +227,8 @@
         def outer_raise():
             inner_raise() # Marker
         blocks = boundaries.split(self.get_report(outer_raise))
-        self.assertEquals(len(blocks), 3)
-        self.assertEquals(blocks[1], cause_message)
+        self.assertEqual(len(blocks), 3)
+        self.assertEqual(blocks[1], cause_message)
         self.check_zero_div(blocks[0])
         self.assertIn('inner_raise() # Marker', blocks[2])
 
@@ -241,8 +241,8 @@
         def outer_raise():
             inner_raise() # Marker
         blocks = boundaries.split(self.get_report(outer_raise))
-        self.assertEquals(len(blocks), 3)
-        self.assertEquals(blocks[1], context_message)
+        self.assertEqual(len(blocks), 3)
+        self.assertEqual(blocks[1], context_message)
         self.check_zero_div(blocks[0])
         self.assertIn('inner_raise() # Marker', blocks[2])
 
@@ -261,8 +261,8 @@
         def outer_raise():
             inner_raise() # Marker
         blocks = boundaries.split(self.get_report(outer_raise))
-        self.assertEquals(len(blocks), 3)
-        self.assertEquals(blocks[1], cause_message)
+        self.assertEqual(len(blocks), 3)
+        self.assertEqual(blocks[1], cause_message)
         self.check_zero_div(blocks[0])
         self.assertIn('inner_raise() # Marker', blocks[2])
 
@@ -279,8 +279,8 @@
         def outer_raise():
             inner_raise() # Marker
         blocks = boundaries.split(self.get_report(outer_raise))
-        self.assertEquals(len(blocks), 3)
-        self.assertEquals(blocks[1], cause_message)
+        self.assertEqual(len(blocks), 3)
+        self.assertEqual(blocks[1], cause_message)
         # The first block is the KeyError raised from the ZeroDivisionError
         self.assertIn('raise KeyError from e', blocks[0])
         self.assertNotIn('1/0', blocks[0])
@@ -313,7 +313,7 @@
             traceback.format_exception(type(e), e, e.__traceback__))
         with captured_output("stderr") as sio:
             traceback.print_exception(type(e), e, e.__traceback__)
-        self.assertEquals(sio.getvalue(), s)
+        self.assertEqual(sio.getvalue(), s)
         return s
 
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_ucn.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_ucn.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_ucn.py	Mon Nov 22 12:00:42 2010
@@ -88,9 +88,13 @@
         self.checkletter("CJK UNIFIED IDEOGRAPH-3400", "\u3400")
         self.checkletter("CJK UNIFIED IDEOGRAPH-4DB5", "\u4db5")
         self.checkletter("CJK UNIFIED IDEOGRAPH-4E00", "\u4e00")
-        self.checkletter("CJK UNIFIED IDEOGRAPH-9FA5", "\u9fa5")
+        self.checkletter("CJK UNIFIED IDEOGRAPH-9FCB", "\u9fCB")
         self.checkletter("CJK UNIFIED IDEOGRAPH-20000", "\U00020000")
         self.checkletter("CJK UNIFIED IDEOGRAPH-2A6D6", "\U0002a6d6")
+        self.checkletter("CJK UNIFIED IDEOGRAPH-2A700", "\U0002A700")
+        self.checkletter("CJK UNIFIED IDEOGRAPH-2B734", "\U0002B734")
+        self.checkletter("CJK UNIFIED IDEOGRAPH-2B740", "\U0002B740")
+        self.checkletter("CJK UNIFIED IDEOGRAPH-2B81D", "\U0002B81D")
 
     def test_bmp_characters(self):
         import unicodedata

Modified: python/branches/py3k-cdecimal/Lib/test/test_unicode.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_unicode.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_unicode.py	Mon Nov 22 12:00:42 2010
@@ -1442,24 +1442,24 @@
         from ctypes import c_wchar, sizeof
 
         wchar, size = unicode_aswidechar('abcdef', 2)
-        self.assertEquals(size, 2)
-        self.assertEquals(wchar, 'ab')
+        self.assertEqual(size, 2)
+        self.assertEqual(wchar, 'ab')
 
         wchar, size = unicode_aswidechar('abc', 3)
-        self.assertEquals(size, 3)
-        self.assertEquals(wchar, 'abc')
+        self.assertEqual(size, 3)
+        self.assertEqual(wchar, 'abc')
 
         wchar, size = unicode_aswidechar('abc', 4)
-        self.assertEquals(size, 3)
-        self.assertEquals(wchar, 'abc\0')
+        self.assertEqual(size, 3)
+        self.assertEqual(wchar, 'abc\0')
 
         wchar, size = unicode_aswidechar('abc', 10)
-        self.assertEquals(size, 3)
-        self.assertEquals(wchar, 'abc\0')
+        self.assertEqual(size, 3)
+        self.assertEqual(wchar, 'abc\0')
 
         wchar, size = unicode_aswidechar('abc\0def', 20)
-        self.assertEquals(size, 7)
-        self.assertEquals(wchar, 'abc\0def\0')
+        self.assertEqual(size, 7)
+        self.assertEqual(wchar, 'abc\0def\0')
 
         nonbmp = chr(0x10ffff)
         if sizeof(c_wchar) == 2:
@@ -1469,8 +1469,8 @@
             buflen = 2
             nchar = 1
         wchar, size = unicode_aswidechar(nonbmp, buflen)
-        self.assertEquals(size, nchar)
-        self.assertEquals(wchar, nonbmp + '\0')
+        self.assertEqual(size, nchar)
+        self.assertEqual(wchar, nonbmp + '\0')
 
     # Test PyUnicode_AsWideCharString()
     def test_aswidecharstring(self):
@@ -1478,12 +1478,12 @@
         from ctypes import c_wchar, sizeof
 
         wchar, size = unicode_aswidecharstring('abc')
-        self.assertEquals(size, 3)
-        self.assertEquals(wchar, 'abc\0')
+        self.assertEqual(size, 3)
+        self.assertEqual(wchar, 'abc\0')
 
         wchar, size = unicode_aswidecharstring('abc\0def')
-        self.assertEquals(size, 7)
-        self.assertEquals(wchar, 'abc\0def\0')
+        self.assertEqual(size, 7)
+        self.assertEqual(wchar, 'abc\0def\0')
 
         nonbmp = chr(0x10ffff)
         if sizeof(c_wchar) == 2:
@@ -1491,8 +1491,8 @@
         else: # sizeof(c_wchar) == 4
             nchar = 1
         wchar, size = unicode_aswidecharstring(nonbmp)
-        self.assertEquals(size, nchar)
-        self.assertEquals(wchar, nonbmp + '\0')
+        self.assertEqual(size, nchar)
+        self.assertEqual(wchar, nonbmp + '\0')
 
 
 def test_main():

Modified: python/branches/py3k-cdecimal/Lib/test/test_unicodedata.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_unicodedata.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_unicodedata.py	Mon Nov 22 12:00:42 2010
@@ -254,7 +254,7 @@
         self.assertTrue(count >= 10) # should have tested at least the ASCII digits
 
     def test_bug_1704793(self):
-        self.assertEquals(self.db.lookup("GOTHIC LETTER FAIHU"), '\U00010346')
+        self.assertEqual(self.db.lookup("GOTHIC LETTER FAIHU"), '\U00010346')
 
     def test_ucd_510(self):
         import unicodedata

Modified: python/branches/py3k-cdecimal/Lib/test/test_urllib2.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_urllib2.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_urllib2.py	Mon Nov 22 12:00:42 2010
@@ -631,22 +631,32 @@
         h = NullFTPHandler(data)
         o = h.parent = MockOpener()
 
-        for url, host, port, type_, dirs, filename, mimetype in [
+        for url, host, port, user, passwd, type_, dirs, filename, mimetype in [
             ("ftp://localhost/foo/bar/baz.html",
-             "localhost", ftplib.FTP_PORT, "I",
+             "localhost", ftplib.FTP_PORT, "", "", "I",
+             ["foo", "bar"], "baz.html", "text/html"),
+            ("ftp://parrot@localhost/foo/bar/baz.html",
+             "localhost", ftplib.FTP_PORT, "parrot", "", "I",
+             ["foo", "bar"], "baz.html", "text/html"),
+            ("ftp://%25parrot@localhost/foo/bar/baz.html",
+             "localhost", ftplib.FTP_PORT, "%parrot", "", "I",
+             ["foo", "bar"], "baz.html", "text/html"),
+            ("ftp://%2542parrot@localhost/foo/bar/baz.html",
+             "localhost", ftplib.FTP_PORT, "%42parrot", "", "I",
              ["foo", "bar"], "baz.html", "text/html"),
             ("ftp://localhost:80/foo/bar/",
-             "localhost", 80, "D",
+             "localhost", 80, "", "", "D",
              ["foo", "bar"], "", None),
             ("ftp://localhost/baz.gif;type=a",
-             "localhost", ftplib.FTP_PORT, "A",
+             "localhost", ftplib.FTP_PORT, "", "", "A",
              [], "baz.gif", None),  # XXX really this should guess image/gif
             ]:
             req = Request(url)
             req.timeout = None
             r = h.ftp_open(req)
             # ftp authentication not yet implemented by FTPHandler
-            self.assertTrue(h.user == h.passwd == "")
+            self.assertEqual(h.user, user)
+            self.assertEqual(h.passwd, passwd)
             self.assertEqual(h.host, socket.gethostbyname(host))
             self.assertEqual(h.port, port)
             self.assertEqual(h.dirs, dirs)
@@ -838,6 +848,25 @@
             p_ds_req = h.do_request_(ds_req)
             self.assertEqual(p_ds_req.unredirected_hdrs["Host"],"example.com")
 
+    def test_fixpath_in_weirdurls(self):
+        # Issue4493: urllib2 to supply '/' when to urls where path does not
+        # start with'/'
+
+        h = urllib.request.AbstractHTTPHandler()
+        o = h.parent = MockOpener()
+
+        weird_url = 'http://www.python.org?getspam'
+        req = Request(weird_url)
+        newreq = h.do_request_(req)
+        self.assertEqual(newreq.host,'www.python.org')
+        self.assertEqual(newreq.selector,'/?getspam')
+
+        url_without_path = 'http://www.python.org'
+        req = Request(url_without_path)
+        newreq = h.do_request_(req)
+        self.assertEqual(newreq.host,'www.python.org')
+        self.assertEqual(newreq.selector,'')
+
 
     def test_errors(self):
         h = urllib.request.HTTPErrorProcessor()

Modified: python/branches/py3k-cdecimal/Lib/test/test_warnings.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_warnings.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_warnings.py	Mon Nov 22 12:00:42 2010
@@ -80,7 +80,7 @@
             self.module.resetwarnings()
             self.module.filterwarnings("ignore", category=UserWarning)
             self.module.warn("FilterTests.test_ignore", UserWarning)
-            self.assertEquals(len(w), 0)
+            self.assertEqual(len(w), 0)
 
     def test_always(self):
         with original_warnings.catch_warnings(record=True,
@@ -102,10 +102,10 @@
             for x in range(2):
                 self.module.warn(message, UserWarning)
                 if x == 0:
-                    self.assertEquals(w[-1].message, message)
+                    self.assertEqual(w[-1].message, message)
                     del w[:]
                 elif x == 1:
-                    self.assertEquals(len(w), 0)
+                    self.assertEqual(len(w), 0)
                 else:
                     raise ValueError("loop variant unhandled")
 
@@ -116,10 +116,10 @@
             self.module.filterwarnings("module", category=UserWarning)
             message = UserWarning("FilterTests.test_module")
             self.module.warn(message, UserWarning)
-            self.assertEquals(w[-1].message, message)
+            self.assertEqual(w[-1].message, message)
             del w[:]
             self.module.warn(message, UserWarning)
-            self.assertEquals(len(w), 0)
+            self.assertEqual(len(w), 0)
 
     def test_once(self):
         with original_warnings.catch_warnings(record=True,
@@ -129,14 +129,14 @@
             message = UserWarning("FilterTests.test_once")
             self.module.warn_explicit(message, UserWarning, "test_warnings.py",
                                     42)
-            self.assertEquals(w[-1].message, message)
+            self.assertEqual(w[-1].message, message)
             del w[:]
             self.module.warn_explicit(message, UserWarning, "test_warnings.py",
                                     13)
-            self.assertEquals(len(w), 0)
+            self.assertEqual(len(w), 0)
             self.module.warn_explicit(message, UserWarning, "test_warnings2.py",
                                     42)
-            self.assertEquals(len(w), 0)
+            self.assertEqual(len(w), 0)
 
     def test_inheritance(self):
         with original_warnings.catch_warnings(module=self.module) as w:
@@ -157,7 +157,7 @@
                 self.module.warn("FilterTests.test_ordering", UserWarning)
             except UserWarning:
                 self.fail("order handling for actions failed")
-            self.assertEquals(len(w), 0)
+            self.assertEqual(len(w), 0)
 
     def test_filterwarnings(self):
         # Test filterwarnings().
@@ -217,7 +217,7 @@
                 self.module.warn(ob)
                 # Don't directly compare objects since
                 # ``Warning() != Warning()``.
-                self.assertEquals(str(w[-1].message), str(UserWarning(ob)))
+                self.assertEqual(str(w[-1].message), str(UserWarning(ob)))
 
     def test_filename(self):
         with warnings_state(self.module):
@@ -448,7 +448,7 @@
                 self.assertEqual(w[-1].message, message)
                 del w[:]
                 self.module.warn_explicit(message, UserWarning, "file", 42)
-                self.assertEquals(len(w), 0)
+                self.assertEqual(len(w), 0)
                 # Test the resetting of onceregistry.
                 self.module.onceregistry = {}
                 __warningregistry__ = {}
@@ -459,7 +459,7 @@
                 del self.module.onceregistry
                 __warningregistry__ = {}
                 self.module.warn_explicit(message, UserWarning, "file", 42)
-                self.assertEquals(len(w), 0)
+                self.assertEqual(len(w), 0)
         finally:
             self.module.onceregistry = original_registry
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_winreg.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_winreg.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_winreg.py	Mon Nov 22 12:00:42 2010
@@ -82,12 +82,12 @@
 
         # Check we wrote as many items as we thought.
         nkeys, nvalues, since_mod = QueryInfoKey(key)
-        self.assertEquals(nkeys, 1, "Not the correct number of sub keys")
-        self.assertEquals(nvalues, 1, "Not the correct number of values")
+        self.assertEqual(nkeys, 1, "Not the correct number of sub keys")
+        self.assertEqual(nvalues, 1, "Not the correct number of values")
         nkeys, nvalues, since_mod = QueryInfoKey(sub_key)
-        self.assertEquals(nkeys, 0, "Not the correct number of sub keys")
-        self.assertEquals(nvalues, len(test_data),
-                          "Not the correct number of values")
+        self.assertEqual(nkeys, 0, "Not the correct number of sub keys")
+        self.assertEqual(nvalues, len(test_data),
+                         "Not the correct number of values")
         # Close this key this way...
         # (but before we do, copy the key as an integer - this allows
         # us to test that the key really gets closed).
@@ -112,8 +112,8 @@
     def _read_test_data(self, root_key, subkeystr="sub_key", OpenKey=OpenKey):
         # Check we can get default value for this key.
         val = QueryValue(root_key, test_key_name)
-        self.assertEquals(val, "Default value",
-                          "Registry didn't give back the correct value")
+        self.assertEqual(val, "Default value",
+                         "Registry didn't give back the correct value")
 
         key = OpenKey(root_key, test_key_name)
         # Read the sub-keys
@@ -125,22 +125,22 @@
                     data = EnumValue(sub_key, index)
                 except EnvironmentError:
                     break
-                self.assertEquals(data in test_data, True,
-                                  "Didn't read back the correct test data")
+                self.assertEqual(data in test_data, True,
+                                 "Didn't read back the correct test data")
                 index = index + 1
-            self.assertEquals(index, len(test_data),
-                              "Didn't read the correct number of items")
+            self.assertEqual(index, len(test_data),
+                             "Didn't read the correct number of items")
             # Check I can directly access each item
             for value_name, value_data, value_type in test_data:
                 read_val, read_typ = QueryValueEx(sub_key, value_name)
-                self.assertEquals(read_val, value_data,
-                                  "Could not directly read the value")
-                self.assertEquals(read_typ, value_type,
-                                  "Could not directly read the value")
+                self.assertEqual(read_val, value_data,
+                                 "Could not directly read the value")
+                self.assertEqual(read_typ, value_type,
+                                 "Could not directly read the value")
         sub_key.Close()
         # Enumerate our main key.
         read_val = EnumKey(key, 0)
-        self.assertEquals(read_val, subkeystr, "Read subkey value wrong")
+        self.assertEqual(read_val, subkeystr, "Read subkey value wrong")
         try:
             EnumKey(key, 1)
             self.fail("Was able to get a second key when I only have one!")
@@ -159,8 +159,8 @@
             DeleteValue(sub_key, value_name)
 
         nkeys, nvalues, since_mod = QueryInfoKey(sub_key)
-        self.assertEquals(nkeys, 0, "subkey not empty before delete")
-        self.assertEquals(nvalues, 0, "subkey not empty before delete")
+        self.assertEqual(nkeys, 0, "subkey not empty before delete")
+        self.assertEqual(nvalues, 0, "subkey not empty before delete")
         sub_key.Close()
         DeleteKey(key, subkeystr)
 
@@ -341,8 +341,8 @@
         with OpenKey(HKEY_LOCAL_MACHINE, "Software") as key:
             # HKLM\Software is redirected but not reflected in all OSes
             self.assertTrue(QueryReflectionKey(key))
-            self.assertEquals(None, EnableReflectionKey(key))
-            self.assertEquals(None, DisableReflectionKey(key))
+            self.assertEqual(None, EnableReflectionKey(key))
+            self.assertEqual(None, DisableReflectionKey(key))
             self.assertTrue(QueryReflectionKey(key))
 
     @unittest.skipUnless(HAS_REFLECTION, "OS doesn't support reflection")

Modified: python/branches/py3k-cdecimal/Lib/test/test_with.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_with.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_with.py	Mon Nov 22 12:00:42 2010
@@ -734,10 +734,10 @@
     def testEnterReturnsTuple(self):
         with self.Dummy(value=(1,2)) as (a1, a2), \
              self.Dummy(value=(10, 20)) as (b1, b2):
-            self.assertEquals(1, a1)
-            self.assertEquals(2, a2)
-            self.assertEquals(10, b1)
-            self.assertEquals(20, b2)
+            self.assertEqual(1, a1)
+            self.assertEqual(2, a2)
+            self.assertEqual(10, b1)
+            self.assertEqual(20, b2)
 
 def test_main():
     run_unittest(FailureTestCase, NonexceptionalTestCase,

Modified: python/branches/py3k-cdecimal/Lib/test/test_xmlrpc.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_xmlrpc.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_xmlrpc.py	Mon Nov 22 12:00:42 2010
@@ -39,7 +39,7 @@
     def test_dump_load(self):
         dump = xmlrpclib.dumps((alist,))
         load = xmlrpclib.loads(dump)
-        self.assertEquals(alist, load[0][0])
+        self.assertEqual(alist, load[0][0])
 
     def test_dump_bare_datetime(self):
         # This checks that an unwrapped datetime.date object can be handled
@@ -49,22 +49,22 @@
         dt = datetime.datetime(2005, 2, 10, 11, 41, 23)
         s = xmlrpclib.dumps((dt,))
         (newdt,), m = xmlrpclib.loads(s, use_datetime=1)
-        self.assertEquals(newdt, dt)
-        self.assertEquals(m, None)
+        self.assertEqual(newdt, dt)
+        self.assertEqual(m, None)
 
         (newdt,), m = xmlrpclib.loads(s, use_datetime=0)
-        self.assertEquals(newdt, xmlrpclib.DateTime('20050210T11:41:23'))
+        self.assertEqual(newdt, xmlrpclib.DateTime('20050210T11:41:23'))
 
     def test_datetime_before_1900(self):
         # same as before but with a date before 1900
         dt = datetime.datetime(1,  2, 10, 11, 41, 23)
         s = xmlrpclib.dumps((dt,))
         (newdt,), m = xmlrpclib.loads(s, use_datetime=1)
-        self.assertEquals(newdt, dt)
-        self.assertEquals(m, None)
+        self.assertEqual(newdt, dt)
+        self.assertEqual(m, None)
 
         (newdt,), m = xmlrpclib.loads(s, use_datetime=0)
-        self.assertEquals(newdt, xmlrpclib.DateTime('00010210T11:41:23'))
+        self.assertEqual(newdt, xmlrpclib.DateTime('00010210T11:41:23'))
 
     def test_cmp_datetime_DateTime(self):
         now = datetime.datetime.now()
@@ -92,7 +92,7 @@
         t.x = 100
         t.y = "Hello"
         ((t2,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((t,)))
-        self.assertEquals(t2, t.__dict__)
+        self.assertEqual(t2, t.__dict__)
 
     def test_dump_big_long(self):
         self.assertRaises(OverflowError, xmlrpclib.dumps, (2**99,))
@@ -138,43 +138,30 @@
         value = alist + [None]
         arg1 = (alist + [None],)
         strg = xmlrpclib.dumps(arg1, allow_none=True)
-        self.assertEquals(value,
+        self.assertEqual(value,
                           xmlrpclib.loads(strg)[0][0])
         self.assertRaises(TypeError, xmlrpclib.dumps, (arg1,))
 
     def test_get_host_info(self):
         # see bug #3613, this raised a TypeError
         transp = xmlrpc.client.Transport()
-        self.assertEquals(transp.get_host_info("user at host.tld"),
+        self.assertEqual(transp.get_host_info("user at host.tld"),
                           ('host.tld',
                            [('Authorization', 'Basic dXNlcg==')], {}))
 
     def test_ssl_presence(self):
-        #Check for ssl support
-        have_ssl = False
-        if hasattr(socket, 'ssl'):
-            have_ssl = True
+        try:
+            import ssl
+        except ImportError:
+            has_ssl = False
         else:
-            try:
-                import ssl
-            except:
-                pass
-            else:
-                have_ssl = True
+            has_ssl = True
         try:
             xmlrpc.client.ServerProxy('https://localhost:9999').bad_function()
-        except:
-            exc = sys.exc_info()
-        if exc[0] == socket.error:
-            self.assertTrue(have_ssl,
-                            "No SSL support, but xmlrpclib reports supported.")
-        elif exc[0] == NotImplementedError and str(exc[1]) == \
-                 "your version of http.client doesn't support HTTPS":
-            self.assertFalse(have_ssl,
-                             "SSL supported, but xmlrpclib reports not.")
-        else:
-            self.fail("Unable to determine status of SSL check.")
-
+        except NotImplementedError:
+            self.assertFalse(has_ssl, "xmlrpc client's error with SSL support")
+        except socket.error:
+            self.assertTrue(has_ssl)
 
 class HelperTestCase(unittest.TestCase):
     def test_escape(self):
@@ -192,8 +179,8 @@
         f = xmlrpclib.Fault(42, 'Test Fault')
         s = xmlrpclib.dumps((f,))
         (newf,), m = xmlrpclib.loads(s)
-        self.assertEquals(newf, {'faultCode': 42, 'faultString': 'Test Fault'})
-        self.assertEquals(m, None)
+        self.assertEqual(newf, {'faultCode': 42, 'faultString': 'Test Fault'})
+        self.assertEqual(m, None)
 
         s = xmlrpclib.Marshaller().dumps(f)
         self.assertRaises(xmlrpclib.Fault, xmlrpclib.loads, s)
@@ -931,7 +918,7 @@
 
         content = handle[handle.find("<?xml"):]
 
-        self.assertEquals(
+        self.assertEqual(
             int(re.search('Content-Length: (\d+)', handle).group(1)),
             len(content))
 

Modified: python/branches/py3k-cdecimal/Lib/test/test_zipimport.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/test_zipimport.py	(original)
+++ python/branches/py3k-cdecimal/Lib/test/test_zipimport.py	Mon Nov 22 12:00:42 2010
@@ -97,8 +97,8 @@
 
             if expected_ext:
                 file = mod.get_file()
-                self.assertEquals(file, os.path.join(TEMP_ZIP,
-                                  *modules) + expected_ext)
+                self.assertEqual(file, os.path.join(TEMP_ZIP,
+                                 *modules) + expected_ext)
         finally:
             z.close()
             os.remove(TEMP_ZIP)
@@ -211,32 +211,32 @@
             z.close()
 
             zi = zipimport.zipimporter(TEMP_ZIP)
-            self.assertEquals(zi.archive, TEMP_ZIP)
-            self.assertEquals(zi.is_package(TESTPACK), True)
+            self.assertEqual(zi.archive, TEMP_ZIP)
+            self.assertEqual(zi.is_package(TESTPACK), True)
             mod = zi.load_module(TESTPACK)
-            self.assertEquals(zi.get_filename(TESTPACK), mod.__file__)
+            self.assertEqual(zi.get_filename(TESTPACK), mod.__file__)
 
-            self.assertEquals(zi.is_package(packdir + '__init__'), False)
-            self.assertEquals(zi.is_package(packdir + TESTPACK2), True)
-            self.assertEquals(zi.is_package(packdir2 + TESTMOD), False)
+            self.assertEqual(zi.is_package(packdir + '__init__'), False)
+            self.assertEqual(zi.is_package(packdir + TESTPACK2), True)
+            self.assertEqual(zi.is_package(packdir2 + TESTMOD), False)
 
             mod_path = packdir2 + TESTMOD
             mod_name = module_path_to_dotted_name(mod_path)
             __import__(mod_name)
             mod = sys.modules[mod_name]
-            self.assertEquals(zi.get_source(TESTPACK), None)
-            self.assertEquals(zi.get_source(mod_path), None)
-            self.assertEquals(zi.get_filename(mod_path), mod.__file__)
+            self.assertEqual(zi.get_source(TESTPACK), None)
+            self.assertEqual(zi.get_source(mod_path), None)
+            self.assertEqual(zi.get_filename(mod_path), mod.__file__)
             # To pass in the module name instead of the path, we must use the
             # right importer
             loader = mod.__loader__
-            self.assertEquals(loader.get_source(mod_name), None)
-            self.assertEquals(loader.get_filename(mod_name), mod.__file__)
+            self.assertEqual(loader.get_source(mod_name), None)
+            self.assertEqual(loader.get_filename(mod_name), mod.__file__)
 
             # test prefix and archivepath members
             zi2 = zipimport.zipimporter(TEMP_ZIP + os.sep + TESTPACK)
-            self.assertEquals(zi2.archive, TEMP_ZIP)
-            self.assertEquals(zi2.prefix, TESTPACK + os.sep)
+            self.assertEqual(zi2.archive, TEMP_ZIP)
+            self.assertEqual(zi2.prefix, TESTPACK + os.sep)
         finally:
             z.close()
             os.remove(TEMP_ZIP)
@@ -256,29 +256,29 @@
             z.close()
 
             zi = zipimport.zipimporter(TEMP_ZIP + os.sep + packdir)
-            self.assertEquals(zi.archive, TEMP_ZIP)
-            self.assertEquals(zi.prefix, packdir)
-            self.assertEquals(zi.is_package(TESTPACK2), True)
+            self.assertEqual(zi.archive, TEMP_ZIP)
+            self.assertEqual(zi.prefix, packdir)
+            self.assertEqual(zi.is_package(TESTPACK2), True)
             mod = zi.load_module(TESTPACK2)
-            self.assertEquals(zi.get_filename(TESTPACK2), mod.__file__)
+            self.assertEqual(zi.get_filename(TESTPACK2), mod.__file__)
 
-            self.assertEquals(
+            self.assertEqual(
                 zi.is_package(TESTPACK2 + os.sep + '__init__'), False)
-            self.assertEquals(
+            self.assertEqual(
                 zi.is_package(TESTPACK2 + os.sep + TESTMOD), False)
 
             mod_path = TESTPACK2 + os.sep + TESTMOD
             mod_name = module_path_to_dotted_name(mod_path)
             __import__(mod_name)
             mod = sys.modules[mod_name]
-            self.assertEquals(zi.get_source(TESTPACK2), None)
-            self.assertEquals(zi.get_source(mod_path), None)
-            self.assertEquals(zi.get_filename(mod_path), mod.__file__)
+            self.assertEqual(zi.get_source(TESTPACK2), None)
+            self.assertEqual(zi.get_source(mod_path), None)
+            self.assertEqual(zi.get_filename(mod_path), mod.__file__)
             # To pass in the module name instead of the path, we must use the
             # right importer
             loader = mod.__loader__
-            self.assertEquals(loader.get_source(mod_name), None)
-            self.assertEquals(loader.get_filename(mod_name), mod.__file__)
+            self.assertEqual(loader.get_source(mod_name), None)
+            self.assertEqual(loader.get_filename(mod_name), mod.__file__)
         finally:
             z.close()
             os.remove(TEMP_ZIP)
@@ -292,7 +292,7 @@
             z.writestr(name, data)
             z.close()
             zi = zipimport.zipimporter(TEMP_ZIP)
-            self.assertEquals(data, zi.get_data(name))
+            self.assertEqual(data, zi.get_data(name))
             self.assertIn('zipimporter object', repr(zi))
         finally:
             z.close()

Modified: python/branches/py3k-cdecimal/Lib/trace.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/trace.py	(original)
+++ python/branches/py3k-cdecimal/Lib/trace.py	Mon Nov 22 12:00:42 2010
@@ -47,7 +47,7 @@
   r = tracer.results()
   r.write_results(show_missing=True, coverdir="/tmp")
 """
-
+__all__ = ['Trace', 'CoverageResults']
 import io
 import linecache
 import os
@@ -60,6 +60,7 @@
 import gc
 import dis
 import pickle
+from warnings import warn as _warn
 
 try:
     import threading
@@ -77,7 +78,7 @@
         sys.settrace(None)
         threading.settrace(None)
 
-def usage(outfile):
+def _usage(outfile):
     outfile.write("""Usage: %s [OPTIONS] <file> [ARGS]
 
 Meta-options:
@@ -127,7 +128,7 @@
 # Simple rx to find lines with no code.
 rx_blank = re.compile(r'^\s*(#.*)?$')
 
-class Ignore:
+class _Ignore:
     def __init__(self, modules=None, dirs=None):
         self._mods = set() if not modules else set(modules)
         self._dirs = [] if not dirs else [os.path.normpath(d)
@@ -177,14 +178,14 @@
         self._ignore[modulename] = 0
         return 0
 
-def modname(path):
+def _modname(path):
     """Return a plausible module name for the patch."""
 
     base = os.path.basename(path)
     filename, ext = os.path.splitext(base)
     return filename
 
-def fullmodname(path):
+def _fullmodname(path):
     """Return a plausible module name for the path."""
 
     # If the file 'path' is part of a package, then the filename isn't
@@ -311,17 +312,17 @@
 
             if coverdir is None:
                 dir = os.path.dirname(os.path.abspath(filename))
-                modulename = modname(filename)
+                modulename = _modname(filename)
             else:
                 dir = coverdir
                 if not os.path.exists(dir):
                     os.makedirs(dir)
-                modulename = fullmodname(filename)
+                modulename = _fullmodname(filename)
 
             # If desired, get a list of the line numbers which represent
             # executable content (returned as a dict for better lookup speed)
             if show_missing:
-                lnotab = find_executable_linenos(filename)
+                lnotab = _find_executable_linenos(filename)
             else:
                 lnotab = {}
 
@@ -384,7 +385,7 @@
 
         return n_hits, n_lines
 
-def find_lines_from_code(code, strs):
+def _find_lines_from_code(code, strs):
     """Return dict where keys are lines in the line number table."""
     linenos = {}
 
@@ -394,19 +395,19 @@
 
     return linenos
 
-def find_lines(code, strs):
+def _find_lines(code, strs):
     """Return lineno dict for all code objects reachable from code."""
     # get all of the lineno information from the code of this scope level
-    linenos = find_lines_from_code(code, strs)
+    linenos = _find_lines_from_code(code, strs)
 
     # and check the constants for references to other code objects
     for c in code.co_consts:
         if inspect.iscode(c):
             # find another code object, so recurse into it
-            linenos.update(find_lines(c, strs))
+            linenos.update(_find_lines(c, strs))
     return linenos
 
-def find_strings(filename, encoding=None):
+def _find_strings(filename, encoding=None):
     """Return a dict of possible docstring positions.
 
     The dict maps line numbers to strings.  There is an entry for
@@ -429,7 +430,7 @@
             prev_ttype = ttype
     return d
 
-def find_executable_linenos(filename):
+def _find_executable_linenos(filename):
     """Return dict where keys are line numbers in the line number table."""
     try:
         with tokenize.open(filename) as f:
@@ -440,8 +441,8 @@
                               % (filename, err)), file=sys.stderr)
         return {}
     code = compile(prog, filename, "exec")
-    strs = find_strings(filename, encoding)
-    return find_lines(code, strs)
+    strs = _find_strings(filename, encoding)
+    return _find_lines(code, strs)
 
 class Trace:
     def __init__(self, count=1, trace=1, countfuncs=0, countcallers=0,
@@ -466,7 +467,7 @@
         """
         self.infile = infile
         self.outfile = outfile
-        self.ignore = Ignore(ignoremods, ignoredirs)
+        self.ignore = _Ignore(ignoremods, ignoredirs)
         self.counts = {}   # keys are (filename, linenumber)
         self.pathtobasename = {} # for memoizing os.path.basename
         self.donothing = 0
@@ -525,7 +526,7 @@
         code = frame.f_code
         filename = code.co_filename
         if filename:
-            modulename = modname(filename)
+            modulename = _modname(filename)
         else:
             modulename = None
 
@@ -592,9 +593,9 @@
             code = frame.f_code
             filename = frame.f_globals.get('__file__', None)
             if filename:
-                # XXX modname() doesn't work right for packages, so
+                # XXX _modname() doesn't work right for packages, so
                 # the ignore support won't work right for packages
-                modulename = modname(filename)
+                modulename = _modname(filename)
                 if modulename is not None:
                     ignore_it = self.ignore.names(filename, modulename)
                     if not ignore_it:
@@ -810,5 +811,47 @@
         if not no_report:
             results.write_results(missing, summary=summary, coverdir=coverdir)
 
+#  Deprecated API
+def usage(outfile):
+    _warn("The trace.usage() function is deprecated",
+         DeprecationWarning, 2)
+    _usage(outfile)
+
+class Ignore(_Ignore):
+    def __init__(self, modules=None, dirs=None):
+        _warn("The class trace.Ignore is deprecated",
+             DeprecationWarning, 2)
+        _Ignore.__init__(self, modules, dirs)
+
+def modname(path):
+    _warn("The trace.modname() function is deprecated",
+         DeprecationWarning, 2)
+    return _modname(path)
+
+def fullmodname(path):
+    _warn("The trace.fullmodname() function is deprecated",
+         DeprecationWarning, 2)
+    return _fullmodname(path)
+
+def find_lines_from_code(code, strs):
+    _warn("The trace.find_lines_from_code() function is deprecated",
+         DeprecationWarning, 2)
+    return _find_lines_from_code(code, strs)
+
+def find_lines(code, strs):
+    _warn("The trace.find_lines() function is deprecated",
+         DeprecationWarning, 2)
+    return _find_lines(code, strs)
+
+def find_strings(filename, encoding=None):
+    _warn("The trace.find_strings() function is deprecated",
+         DeprecationWarning, 2)
+    return _find_strings(filename, encoding=None)
+
+def find_executable_linenos(filename):
+    _warn("The trace.find_executable_linenos() function is deprecated",
+         DeprecationWarning, 2)
+    return _find_executable_linenos(filename)
+
 if __name__=='__main__':
     main()

Modified: python/branches/py3k-cdecimal/Lib/unittest/case.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/unittest/case.py	(original)
+++ python/branches/py3k-cdecimal/Lib/unittest/case.py	Mon Nov 22 12:00:42 2010
@@ -191,6 +191,27 @@
                 .format(exc_name))
 
 
+class _TypeEqualityDict(object):
+
+    def __init__(self, testcase):
+        self.testcase = testcase
+        self._store = {}
+
+    def __setitem__(self, key, value):
+        self._store[key] = value
+
+    def __getitem__(self, key):
+        value = self._store[key]
+        if isinstance(value, str):
+            return getattr(self.testcase, value)
+        return value
+
+    def get(self, key, default=None):
+        if key in self._store:
+            return self[key]
+        return default
+
+
 class TestCase(object):
     """A class whose instances are single test cases.
 
@@ -253,13 +274,13 @@
         # Map types to custom assertEqual functions that will compare
         # instances of said type in more detail to generate a more useful
         # error message.
-        self._type_equality_funcs = {}
-        self.addTypeEqualityFunc(dict, self.assertDictEqual)
-        self.addTypeEqualityFunc(list, self.assertListEqual)
-        self.addTypeEqualityFunc(tuple, self.assertTupleEqual)
-        self.addTypeEqualityFunc(set, self.assertSetEqual)
-        self.addTypeEqualityFunc(frozenset, self.assertSetEqual)
-        self.addTypeEqualityFunc(str, self.assertMultiLineEqual)
+        self._type_equality_funcs = _TypeEqualityDict(self)
+        self.addTypeEqualityFunc(dict, 'assertDictEqual')
+        self.addTypeEqualityFunc(list, 'assertListEqual')
+        self.addTypeEqualityFunc(tuple, 'assertTupleEqual')
+        self.addTypeEqualityFunc(set, 'assertSetEqual')
+        self.addTypeEqualityFunc(frozenset, 'assertSetEqual')
+        self.addTypeEqualityFunc(str, 'assertMultiLineEqual')
 
     def addTypeEqualityFunc(self, typeobj, function):
         """Add a type specific assertEqual style function to compare a type.
@@ -899,8 +920,8 @@
             self.fail(self._formatMessage(msg, standardMsg))
 
     def assertDictEqual(self, d1, d2, msg=None):
-        self.assert_(isinstance(d1, dict), 'First argument is not a dictionary')
-        self.assert_(isinstance(d2, dict), 'Second argument is not a dictionary')
+        self.assertIsInstance(d1, dict, 'First argument is not a dictionary')
+        self.assertIsInstance(d2, dict, 'Second argument is not a dictionary')
 
         if d1 != d2:
             standardMsg = '%s != %s' % (safe_repr(d1, True), safe_repr(d2, True))
@@ -1018,10 +1039,8 @@
 
     def assertMultiLineEqual(self, first, second, msg=None):
         """Assert that two multi-line strings are equal."""
-        self.assert_(isinstance(first, str), (
-                'First argument is not a string'))
-        self.assert_(isinstance(second, str), (
-                'Second argument is not a string'))
+        self.assertIsInstance(first, str, 'First argument is not a string')
+        self.assertIsInstance(second, str, 'Second argument is not a string')
 
         if first != second:
             firstlines = first.splitlines(True)

Modified: python/branches/py3k-cdecimal/Lib/unittest/loader.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/unittest/loader.py	(original)
+++ python/branches/py3k-cdecimal/Lib/unittest/loader.py	Mon Nov 22 12:00:42 2010
@@ -147,9 +147,9 @@
 
     def discover(self, start_dir, pattern='test*.py', top_level_dir=None):
         """Find and return all test modules from the specified start
-        directory, recursing into subdirectories to find them. Only test files
-        that match the pattern will be loaded. (Using shell style pattern
-        matching.)
+        directory, recursing into subdirectories to find them and return all
+        tests found within them. Only test files that match the pattern will
+        be loaded. (Using shell style pattern matching.)
 
         All test modules must be importable from the top level of the project.
         If the start directory is not the top level directory then the top

Modified: python/branches/py3k-cdecimal/Lib/unittest/main.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/unittest/main.py	(original)
+++ python/branches/py3k-cdecimal/Lib/unittest/main.py	Mon Nov 22 12:00:42 2010
@@ -109,7 +109,8 @@
         sys.exit(2)
 
     def parseArgs(self, argv):
-        if len(argv) > 1 and argv[1].lower() == 'discover':
+        if ((len(argv) > 1 and argv[1].lower() == 'discover') or
+            (len(argv) == 1 and self.module is None)):
             self._do_discovery(argv[2:])
             return
 

Modified: python/branches/py3k-cdecimal/Lib/unittest/test/test_assertions.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/unittest/test/test_assertions.py	(original)
+++ python/branches/py3k-cdecimal/Lib/unittest/test/test_assertions.py	Mon Nov 22 12:00:42 2010
@@ -130,11 +130,11 @@
         self.assertFalse(unittest.TestCase.longMessage)
 
     def test_formatMsg(self):
-        self.assertEquals(self.testableFalse._formatMessage(None, "foo"), "foo")
-        self.assertEquals(self.testableFalse._formatMessage("foo", "bar"), "foo")
+        self.assertEqual(self.testableFalse._formatMessage(None, "foo"), "foo")
+        self.assertEqual(self.testableFalse._formatMessage("foo", "bar"), "foo")
 
-        self.assertEquals(self.testableTrue._formatMessage(None, "foo"), "foo")
-        self.assertEquals(self.testableTrue._formatMessage("foo", "bar"), "bar : foo")
+        self.assertEqual(self.testableTrue._formatMessage(None, "foo"), "foo")
+        self.assertEqual(self.testableTrue._formatMessage("foo", "bar"), "bar : foo")
 
         # This blows up if _formatMessage uses string concatenation
         self.testableTrue._formatMessage(object(), 'foo')

Modified: python/branches/py3k-cdecimal/Lib/unittest/test/test_case.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/unittest/test/test_case.py	(original)
+++ python/branches/py3k-cdecimal/Lib/unittest/test/test_case.py	Mon Nov 22 12:00:42 2010
@@ -1,5 +1,6 @@
 import difflib
 import pprint
+import pickle
 import re
 import sys
 import warnings
@@ -1095,3 +1096,20 @@
 
         # This shouldn't blow up
         deepcopy(test)
+
+    def testPickle(self):
+        # Issue 10326
+
+        # Can't use TestCase classes defined in Test class as
+        # pickle does not work with inner classes
+        test = unittest.TestCase('run')
+        for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
+
+            # blew up prior to fix
+            pickled_test = pickle.dumps(test, protocol=protocol)
+            unpickled_test = pickle.loads(pickled_test)
+            self.assertEqual(test, unpickled_test)
+
+            # exercise the TestCase instance in a way that will invoke
+            # the type equality lookup mechanism
+            unpickled_test.assertEqual(set(), set())

Modified: python/branches/py3k-cdecimal/Lib/unittest/test/test_discovery.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/unittest/test/test_discovery.py	(original)
+++ python/branches/py3k-cdecimal/Lib/unittest/test/test_discovery.py	Mon Nov 22 12:00:42 2010
@@ -5,6 +5,18 @@
 import unittest
 
 
+class TestableTestProgram(unittest.TestProgram):
+    module = '__main__'
+    exit = True
+    defaultTest = failfast = catchbreak = buffer = None
+    verbosity = 1
+    progName = ''
+    testRunner = testLoader = None
+
+    def __init__(self):
+        pass
+
+
 class TestDiscovery(unittest.TestCase):
 
     # Heavily mocked tests so I can avoid hitting the filesystem
@@ -195,8 +207,7 @@
             test.test_this_does_not_exist()
 
     def test_command_line_handling_parseArgs(self):
-        # Haha - take that uninstantiable class
-        program = object.__new__(unittest.TestProgram)
+        program = TestableTestProgram()
 
         args = []
         def do_discovery(argv):
@@ -208,13 +219,26 @@
         program.parseArgs(['something', 'discover', 'foo', 'bar'])
         self.assertEqual(args, ['foo', 'bar'])
 
+    def test_command_line_handling_discover_by_default(self):
+        program = TestableTestProgram()
+        program.module = None
+
+        self.called = False
+        def do_discovery(argv):
+            self.called = True
+            self.assertEqual(argv, [])
+        program._do_discovery = do_discovery
+        program.parseArgs(['something'])
+        self.assertTrue(self.called)
+
+
     def test_command_line_handling_do_discovery_too_many_arguments(self):
         class Stop(Exception):
             pass
         def usageExit():
             raise Stop
 
-        program = object.__new__(unittest.TestProgram)
+        program = TestableTestProgram()
         program.usageExit = usageExit
 
         with self.assertRaises(Stop):
@@ -223,7 +247,7 @@
 
 
     def test_command_line_handling_do_discovery_calls_loader(self):
-        program = object.__new__(unittest.TestProgram)
+        program = TestableTestProgram()
 
         class Loader(object):
             args = []
@@ -237,49 +261,49 @@
         self.assertEqual(Loader.args, [('.', 'test*.py', None)])
 
         Loader.args = []
-        program = object.__new__(unittest.TestProgram)
+        program = TestableTestProgram()
         program._do_discovery(['--verbose'], Loader=Loader)
         self.assertEqual(program.test, 'tests')
         self.assertEqual(Loader.args, [('.', 'test*.py', None)])
 
         Loader.args = []
-        program = object.__new__(unittest.TestProgram)
+        program = TestableTestProgram()
         program._do_discovery([], Loader=Loader)
         self.assertEqual(program.test, 'tests')
         self.assertEqual(Loader.args, [('.', 'test*.py', None)])
 
         Loader.args = []
-        program = object.__new__(unittest.TestProgram)
+        program = TestableTestProgram()
         program._do_discovery(['fish'], Loader=Loader)
         self.assertEqual(program.test, 'tests')
         self.assertEqual(Loader.args, [('fish', 'test*.py', None)])
 
         Loader.args = []
-        program = object.__new__(unittest.TestProgram)
+        program = TestableTestProgram()
         program._do_discovery(['fish', 'eggs'], Loader=Loader)
         self.assertEqual(program.test, 'tests')
         self.assertEqual(Loader.args, [('fish', 'eggs', None)])
 
         Loader.args = []
-        program = object.__new__(unittest.TestProgram)
+        program = TestableTestProgram()
         program._do_discovery(['fish', 'eggs', 'ham'], Loader=Loader)
         self.assertEqual(program.test, 'tests')
         self.assertEqual(Loader.args, [('fish', 'eggs', 'ham')])
 
         Loader.args = []
-        program = object.__new__(unittest.TestProgram)
+        program = TestableTestProgram()
         program._do_discovery(['-s', 'fish'], Loader=Loader)
         self.assertEqual(program.test, 'tests')
         self.assertEqual(Loader.args, [('fish', 'test*.py', None)])
 
         Loader.args = []
-        program = object.__new__(unittest.TestProgram)
+        program = TestableTestProgram()
         program._do_discovery(['-t', 'fish'], Loader=Loader)
         self.assertEqual(program.test, 'tests')
         self.assertEqual(Loader.args, [('.', 'test*.py', 'fish')])
 
         Loader.args = []
-        program = object.__new__(unittest.TestProgram)
+        program = TestableTestProgram()
         program._do_discovery(['-p', 'fish'], Loader=Loader)
         self.assertEqual(program.test, 'tests')
         self.assertEqual(Loader.args, [('.', 'fish', None)])
@@ -287,7 +311,7 @@
         self.assertFalse(program.catchbreak)
 
         Loader.args = []
-        program = object.__new__(unittest.TestProgram)
+        program = TestableTestProgram()
         program._do_discovery(['-p', 'eggs', '-s', 'fish', '-v', '-f', '-c'],
                               Loader=Loader)
         self.assertEqual(program.test, 'tests')

Modified: python/branches/py3k-cdecimal/Lib/unittest/test/test_loader.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/unittest/test/test_loader.py	(original)
+++ python/branches/py3k-cdecimal/Lib/unittest/test/test_loader.py	Mon Nov 22 12:00:42 2010
@@ -167,11 +167,11 @@
         loader = unittest.TestLoader()
         suite = loader.loadTestsFromModule(m)
         self.assertIsInstance(suite, unittest.TestSuite)
-        self.assertEquals(load_tests_args, [loader, suite, None])
+        self.assertEqual(load_tests_args, [loader, suite, None])
 
         load_tests_args = []
         suite = loader.loadTestsFromModule(m, use_load_tests=False)
-        self.assertEquals(load_tests_args, [])
+        self.assertEqual(load_tests_args, [])
 
     def test_loadTestsFromModule__faulty_load_tests(self):
         m = types.ModuleType('m')

Modified: python/branches/py3k-cdecimal/Lib/urllib/parse.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/urllib/parse.py	(original)
+++ python/branches/py3k-cdecimal/Lib/urllib/parse.py	Mon Nov 22 12:00:42 2010
@@ -699,7 +699,12 @@
         _hostprog = re.compile('^//([^/?]*)(.*)$')
 
     match = _hostprog.match(url)
-    if match: return match.group(1, 2)
+    if match:
+        host_port = match.group(1)
+        path = match.group(2)
+        if path and not path.startswith('/'):
+            path = '/' + path
+        return host_port, path
     return None, url
 
 _userprog = None
@@ -711,7 +716,7 @@
         _userprog = re.compile('^(.*)@(.*)$')
 
     match = _userprog.match(host)
-    if match: return map(unquote, match.group(1, 2))
+    if match: return match.group(1, 2)
     return None, host
 
 _passwdprog = None

Modified: python/branches/py3k-cdecimal/Lib/urllib/request.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/urllib/request.py	(original)
+++ python/branches/py3k-cdecimal/Lib/urllib/request.py	Mon Nov 22 12:00:42 2010
@@ -105,7 +105,7 @@
 # check for SSL
 try:
     import ssl
-except:
+except ImportError:
     _have_ssl = False
 else:
     _have_ssl = True
@@ -1300,8 +1300,8 @@
         else:
             passwd = None
         host = unquote(host)
-        user = unquote(user or '')
-        passwd = unquote(passwd or '')
+        user = user or ''
+        passwd = passwd or ''
 
         try:
             host = socket.gethostbyname(host)

Modified: python/branches/py3k-cdecimal/Lib/xmlrpc/client.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/xmlrpc/client.py	(original)
+++ python/branches/py3k-cdecimal/Lib/xmlrpc/client.py	Mon Nov 22 12:00:42 2010
@@ -1330,7 +1330,7 @@
         if self._connection and host == self._connection[0]:
             return self._connection[1]
 
-        if not hasattr(http.client, "ssl"):
+        if not hasattr(http.client, "HTTPSConnection"):
             raise NotImplementedError(
             "your version of http.client doesn't support HTTPS")
         # create a HTTPS connection object from a host descriptor

Modified: python/branches/py3k-cdecimal/Misc/ACKS
==============================================================================
--- python/branches/py3k-cdecimal/Misc/ACKS	(original)
+++ python/branches/py3k-cdecimal/Misc/ACKS	Mon Nov 22 12:00:42 2010
@@ -235,6 +235,7 @@
 Maxim Dzumanenko
 Walter Dörwald
 Hans Eckardt
+Rodolpho Eckhardt
 Grant Edwards
 John Ehresman
 Eric Eisner
@@ -337,6 +338,7 @@
 Lynda Hardman
 Derek Harland
 Jason Harper
+Brian Harring
 Larry Hastings
 Shane Hathaway
 Rycharde Hawkes
@@ -693,6 +695,7 @@
 Mark Roberts
 Jim Robinson
 Andy Robinson
+Mark Roddy
 Kevin Rodgers
 Giampaolo Rodola
 Mike Romberg
@@ -725,6 +728,7 @@
 Mark Sapiro
 Ty Sarna
 Ben Sayer
+Andrew Schaaf
 Michael Scharf
 Andreas Schawo
 Neil Schemenauer

Modified: python/branches/py3k-cdecimal/Misc/NEWS
==============================================================================
--- python/branches/py3k-cdecimal/Misc/NEWS	(original)
+++ python/branches/py3k-cdecimal/Misc/NEWS	Mon Nov 22 12:00:42 2010
@@ -10,6 +10,20 @@
 Core and Builtins
 -----------------
 
+- Issue #10474: range().count() should return integers.
+
+- Issue #10255: Fix reference leak in Py_InitializeEx().  Patch by Neil
+  Schemenauer.
+
+- Issue #4925: Add filename to error message when executable can't be found in
+  subprocess.
+
+- Issue #1574217: isinstance now catches only AttributeError, rather than
+  masking all errors.
+
+- Issue #10391: Don't dereference invalid memory in error messages in the ast
+  module.
+
 - Issue #9518: Extend the PyModuleDef_HEAD_INIT macro to explicitly
   zero-initialize all fields, fixing compiler warnings seen when building
   extension modules with gcc with "-Wmissing-field-initializers" (implied
@@ -18,6 +32,62 @@
 Library
 -------
 
+- Issue #10459: Update CJK character names to Unicode 6.0.
+
+- Issue #4493: urllib.request adds '/' in front of path components which does not
+  start with '/. Common behavior exhibited by browsers and other clients.
+
+- Issue #6378: idle.bat now runs with the appropriate Python version rather than
+  the system default. Patch by Sridhar Ratnakumar.
+
+- Issue #10470: 'python -m unittest' will now run test discovery by default,
+  when no extra arguments have been provided.
+
+- Issue #3709: BaseHTTPRequestHandler will buffer the headers and write to
+  output stream only when end_headers is invoked. This is a speedup and an
+  internal optimization.  Patch by endian.
+
+- Issue #10220: Added inspect.getgeneratorstate. Initial patch by
+  Rodolpho Eckhardt.
+
+- Issue #10453: compileall now uses argparse instead of getopt, and thus
+  provides clean output when called with '-h'.
+
+- Issue #8078: Add constants for higher baud rates in the termios module.
+  Patch by Rodolpho Eckhardt.
+
+- Issue #10407: Fix two NameErrors in distutils.
+
+- Issue #10371: Deprecated undocumented functions in the trace module.
+
+- Issue #10467: Fix BytesIO.readinto() after seeking into a position after the
+  end of the file.
+
+- Issue #1682942: configparser supports alternative option/value delimiters.
+
+- Issue #5412: configparser supports mapping protocol access.
+
+- Issue #9411: configparser supports specifying encoding for read operations.
+
+- Issue #9421: configparser's getint(), getfloat() and getboolean() methods
+  accept vars and default arguments just like get() does.
+
+- Issue #9452: configparser supports reading from strings and dictionaries.
+
+- configparser: accepted INI file structure is now customizable, including
+  comment prefixes, name of the DEFAULT section, empty lines in multiline
+  values, and indentation.
+
+- Issue 10326: unittest.TestCase instances can be pickled.
+
+- Issue 9926: Wrapped TestSuite subclass does not get __call__ executed.
+
+- Issue #9920: Skip tests for cmath.atan and cmath.atanh applied to
+  complex zeros on systems where the log1p function fails to respect
+  the sign of zero.  This fixes a test failure on AIX.
+
+- Issue #9732: Addition of getattr_static to the inspect module.
+
 - Issue #10446: Module documentation generated by pydoc now links to a
   version-specific online reference manual.
 
@@ -39,8 +109,19 @@
 Tests
 -----
 
-- Issue #8886: Use context managers throughout test_zipfile. Patch by
-  Eric Carstensen.
+- Issue #9424: Replace deprecated assert* methods in the Python test suite.
+
+- Do not fail test_socket when the IP address of the local hostname
+  cannot be looked up.
+
+- Issue #8886: Use context managers throughout test_zipfile. Patch by Eric
+  Carstensen.
+
+Build
+-----
+
+- Issue #10325: Fix two issues in the fallback definitions for PY_ULLONG_MAX and
+  PY_LLONG_MAX that made them unsuitable for use in preprocessor conditionals.
 
 
 What's New in Python 3.2 Alpha 4?
@@ -58,7 +139,7 @@
   undocumented value PyBUF_SHADOW, and strangely-looking code in
   PyMemoryView_GetContiguous.
 
-- Issue #6081: Add str.format_map, similar to str.format(**mapping).
+- Issue #6081: Add str.format_map(), similar to ``str.format(**mapping)``.
 
 - If FileIO.__init__ fails, close the file descriptor.
 
@@ -104,8 +185,7 @@
 Library
 -------
 
-- Issue #10356: hash(Decimal("sNaN")) now raises ValueError instead of
-  TypeError.
+- Issue #10465: fix broken delegating of attributes by gzip._PaddedFile.
 
 - Issue #10356: Decimal.__hash__(-1) should return -2.
 
@@ -123,7 +203,7 @@
   there are non-base64 alphabet characters in the input.
 
 - Issue #10386: Add __all__ to token module; this simplifies importing in
-  tokenize module and prevents leaking of private names through import *.
+  tokenize module and prevents leaking of private names through ``import *``.
 
 - Issue #4471: Properly shutdown socket in IMAP.shutdown().  Patch by Lorenzo
   M. Catucci.

Modified: python/branches/py3k-cdecimal/Misc/indent.pro
==============================================================================
--- python/branches/py3k-cdecimal/Misc/indent.pro	(original)
+++ python/branches/py3k-cdecimal/Misc/indent.pro	Mon Nov 22 12:00:42 2010
@@ -1,15 +1,24 @@
--sob
--nbad
--bap
--br
--nce
--ncs
--npcs
--i8
--ip8
--c25
+--blank-lines-after-declarations
+--blank-lines-after-procedures
+--braces-after-func-def-line
+--braces-on-if-line
+--braces-on-struct-decl-line
+--break-after-boolean-operator
+--comment-indentation25
+--comment-line-length79
+--continue-at-parentheses
+--dont-cuddle-do-while
+--dont-cuddle-else
+--indent-level4
+--line-length79
+--no-space-after-casts
+--no-space-after-function-call-names
+--no-space-after-parentheses
+--no-tabs
+--procnames-start-lines
+--space-after-for
+--space-after-if
+--space-after-while
+--swallow-optional-blank-lines
+-T PyCFunction
 -T PyObject
-
-
-
-

Modified: python/branches/py3k-cdecimal/Misc/maintainers.rst
==============================================================================
--- python/branches/py3k-cdecimal/Misc/maintainers.rst	(original)
+++ python/branches/py3k-cdecimal/Misc/maintainers.rst	Mon Nov 22 12:00:42 2010
@@ -63,7 +63,7 @@
 bisect              rhettinger
 builtins
 bz2
-calendar
+calendar            rhettinger
 cgi
 cgitb
 chunk
@@ -72,7 +72,8 @@
 code
 codecs              lemburg, doerwalter
 codeop
-collections         rhettinger, stutzbach
+collections         rhettinger
+collections._abcoll rhettinger, stutzbach
 colorsys
 compileall
 concurrent.futures  brian.quinlan
@@ -82,10 +83,10 @@
 copyreg             alexandre.vassalotti
 cProfile
 crypt
-csv
+csv                 skip.montanaro
 ctypes              theller
 curses
-datetime            alexander.belopolsky
+datetime            belopolsky
 dbm
 decimal             facundobatista, rhettinger, mark.dickinson
 difflib             tim_one
@@ -105,7 +106,7 @@
 fpectl
 fractions           mark.dickinson, rhettinger
 ftplib              giampaolo.rodola
-functools
+functools           ncoghlan, rhettinger
 gc                  pitrou
 getopt
 getpass
@@ -126,7 +127,7 @@
 inspect
 io                  pitrou, benjamin.peterson, stutzbach
 itertools           rhettinger
-json                bob.ippolito (inactive)
+json                bob.ippolito (inactive), rhettinger
 keyword
 lib2to3             benjamin.peterson
 linecache
@@ -213,18 +214,18 @@
 test
 textwrap            georg.brandl
 threading           pitrou
-time                alexander.belopolsky
+time                belopolsky
 timeit              georg.brandl
 tkinter             gpolo
 token               georg.brandl
 tokenize
-trace               alexander.belopolsky
+trace               belopolsky
 traceback           georg.brandl*
 tty
 turtle              gregorlingl
 types
 unicodedata         loewis, lemburg, ezio.melotti
-unittest            michael.foord
+unittest            michael.foord, ezio.melotti
 urllib              orsenthil
 uu
 uuid
@@ -301,9 +302,9 @@
 release management  tarek, lemburg, benjamin.peterson, barry, loewis,
                     gvanrossum, anthonybaxter
 str.format          eric.smith
-testing             michael.foord, pitrou, giampaolo.rodola
+testing             michael.foord, pitrou, giampaolo.rodola, ezio.melotti
 threads             pitrou
-time and dates      lemburg
+time and dates      lemburg, belopolsky
 unicode             lemburg, ezio.melotti, haypo
 version control
 ==================  ===========

Modified: python/branches/py3k-cdecimal/Misc/python-wing4.wpr
==============================================================================
--- python/branches/py3k-cdecimal/Misc/python-wing4.wpr	(original)
+++ python/branches/py3k-cdecimal/Misc/python-wing4.wpr	Mon Nov 22 12:00:42 2010
@@ -5,7 +5,9 @@
 ##################################################################
 [project attributes]
 proj.directory-list = [{'dirloc': loc('..'),
-                        'excludes': [u'Lib/__pycache__'],
+                        'excludes': [u'Lib/__pycache__',
+                                     u'Doc/build',
+                                     u'build'],
                         'filter': '*',
                         'include_hidden': False,
                         'recursive': True,

Modified: python/branches/py3k-cdecimal/Modules/_io/bytesio.c
==============================================================================
--- python/branches/py3k-cdecimal/Modules/_io/bytesio.c	(original)
+++ python/branches/py3k-cdecimal/Modules/_io/bytesio.c	Mon Nov 22 12:00:42 2010
@@ -430,15 +430,20 @@
 bytesio_readinto(bytesio *self, PyObject *buffer)
 {
     void *raw_buffer;
-    Py_ssize_t len;
+    Py_ssize_t len, n;
 
     CHECK_CLOSED(self);
 
     if (PyObject_AsWriteBuffer(buffer, &raw_buffer, &len) == -1)
         return NULL;
 
-    if (self->pos + len > self->string_size)
-        len = self->string_size - self->pos;
+    /* adjust invalid sizes */
+    n = self->string_size - self->pos;
+    if (len > n) {
+        len = n;
+        if (len < 0)
+            len = 0;
+    }
 
     memcpy(raw_buffer, self->buf + self->pos, len);
     assert(self->pos + len < PY_SSIZE_T_MAX);

Modified: python/branches/py3k-cdecimal/Modules/termios.c
==============================================================================
--- python/branches/py3k-cdecimal/Modules/termios.c	(original)
+++ python/branches/py3k-cdecimal/Modules/termios.c	Mon Nov 22 12:00:42 2010
@@ -347,6 +347,43 @@
 #ifdef B230400
     {"B230400", B230400},
 #endif
+#ifdef B460800
+    {"B460800", B460800},
+#endif
+#ifdef B500000
+    {"B500000", B500000},
+#endif
+#ifdef B576000
+    {"B576000", B576000},
+#endif
+#ifdef B921600
+    {"B921600", B921600},
+#endif
+#ifdef B1000000
+    {"B1000000", B1000000},
+#endif
+#ifdef B1152000
+    {"B1152000", B1152000},
+#endif
+#ifdef B1500000
+    {"B1500000", B1500000},
+#endif
+#ifdef B2000000
+    {"B2000000", B2000000},
+#endif
+#ifdef B2500000
+    {"B2500000", B2500000},
+#endif
+#ifdef B3000000
+    {"B3000000", B3000000},
+#endif
+#ifdef B3500000
+    {"B3500000", B3500000},
+#endif
+#ifdef B4000000
+    {"B4000000", B4000000},
+#endif
+
 #ifdef CBAUDEX
     {"CBAUDEX", CBAUDEX},
 #endif

Modified: python/branches/py3k-cdecimal/Modules/unicodedata.c
==============================================================================
--- python/branches/py3k-cdecimal/Modules/unicodedata.c	(original)
+++ python/branches/py3k-cdecimal/Modules/unicodedata.c	Mon Nov 22 12:00:42 2010
@@ -866,13 +866,16 @@
     { 0,    0,     "H"  }
 };
 
+/* These ranges need to match makeunicodedata.py:cjk_ranges. */
 static int
 is_unified_ideograph(Py_UCS4 code)
 {
-    return (
-        (0x3400 <= code && code <= 0x4DB5) || /* CJK Ideograph Extension A */
-        (0x4E00 <= code && code <= 0x9FBB) || /* CJK Ideograph */
-        (0x20000 <= code && code <= 0x2A6D6));/* CJK Ideograph Extension B */
+    return
+        (0x3400 <= code && code <= 0x4DB5)   || /* CJK Ideograph Extension A */
+        (0x4E00 <= code && code <= 0x9FCB)   || /* CJK Ideograph */
+        (0x20000 <= code && code <= 0x2A6D6) || /* CJK Ideograph Extension B */
+        (0x2A700 <= code && code <= 0x2B734) || /* CJK Ideograph Extension C */
+        (0x2B740 <= code && code <= 0x2B81D);   /* CJK Ideograph Extension D */
 }
 
 static int

Modified: python/branches/py3k-cdecimal/Objects/abstract.c
==============================================================================
--- python/branches/py3k-cdecimal/Objects/abstract.c	(original)
+++ python/branches/py3k-cdecimal/Objects/abstract.c	Mon Nov 22 12:00:42 2010
@@ -2500,7 +2500,10 @@
         if (retval == 0) {
             PyObject *c = PyObject_GetAttr(inst, __class__);
             if (c == NULL) {
-                PyErr_Clear();
+                if (PyErr_ExceptionMatches(PyExc_AttributeError))
+                    PyErr_Clear();
+                else
+                    retval = -1;
             }
             else {
                 if (c != (PyObject *)(inst->ob_type) &&
@@ -2518,8 +2521,10 @@
             return -1;
         icls = PyObject_GetAttr(inst, __class__);
         if (icls == NULL) {
-            PyErr_Clear();
-            retval = 0;
+            if (PyErr_ExceptionMatches(PyExc_AttributeError))
+                PyErr_Clear();
+            else
+                retval = -1;
         }
         else {
             retval = abstract_issubclass(icls, cls);

Modified: python/branches/py3k-cdecimal/Objects/rangeobject.c
==============================================================================
--- python/branches/py3k-cdecimal/Objects/rangeobject.c	(original)
+++ python/branches/py3k-cdecimal/Objects/rangeobject.c	Mon Nov 22 12:00:42 2010
@@ -325,7 +325,8 @@
 }
 
 static int
-range_contains(rangeobject *r, PyObject *ob) {
+range_contains(rangeobject *r, PyObject *ob)
+{
     if (PyLong_CheckExact(ob) || PyBool_Check(ob))
         return range_contains_long(r, ob);
 
@@ -337,10 +338,13 @@
 range_count(rangeobject *r, PyObject *ob)
 {
     if (PyLong_CheckExact(ob) || PyBool_Check(ob)) {
-        if (range_contains_long(r, ob))
-            Py_RETURN_TRUE;
+        int result = range_contains_long(r, ob);
+        if (result == -1)
+            return NULL;
+        else if (result)
+            return PyLong_FromLong(1);
         else
-            Py_RETURN_FALSE;
+            return PyLong_FromLong(0);
     } else {
         Py_ssize_t count;
         count = _PySequence_IterSearch((PyObject*)r, ob, PY_ITERSEARCH_COUNT);
@@ -353,10 +357,7 @@
 static PyObject *
 range_index(rangeobject *r, PyObject *ob)
 {
-    PyObject *idx, *tmp;
     int contains;
-    PyObject *format_tuple, *err_string;
-    static PyObject *err_format = NULL;
 
     if (!PyLong_CheckExact(ob) && !PyBool_Check(ob)) {
         Py_ssize_t index;
@@ -370,35 +371,18 @@
     if (contains == -1)
         return NULL;
 
-    if (!contains)
-        goto value_error;
-
-    tmp = PyNumber_Subtract(ob, r->start);
-    if (tmp == NULL)
-        return NULL;
-
-    /* idx = (ob - r.start) // r.step */
-    idx = PyNumber_FloorDivide(tmp, r->step);
-    Py_DECREF(tmp);
-    return idx;
-
-value_error:
-
-    /* object is not in the range */
-    if (err_format == NULL) {
-        err_format = PyUnicode_FromString("%r is not in range");
-        if (err_format == NULL)
+    if (contains) {
+        PyObject *idx, *tmp = PyNumber_Subtract(ob, r->start);
+        if (tmp == NULL)
             return NULL;
+        /* idx = (ob - r.start) // r.step */
+        idx = PyNumber_FloorDivide(tmp, r->step);
+        Py_DECREF(tmp);
+        return idx;
     }
-    format_tuple = PyTuple_Pack(1, ob);
-    if (format_tuple == NULL)
-        return NULL;
-    err_string = PyUnicode_Format(err_format, format_tuple);
-    Py_DECREF(format_tuple);
-    if (err_string == NULL)
-        return NULL;
-    PyErr_SetObject(PyExc_ValueError, err_string);
-    Py_DECREF(err_string);
+
+    /* object is not in the range */
+    PyErr_Format(PyExc_ValueError, "%R is not in range", ob);
     return NULL;
 }
 

Modified: python/branches/py3k-cdecimal/Parser/asdl_c.py
==============================================================================
--- python/branches/py3k-cdecimal/Parser/asdl_c.py	(original)
+++ python/branches/py3k-cdecimal/Parser/asdl_c.py	Mon Nov 22 12:00:42 2010
@@ -365,20 +365,18 @@
         self.emit("int", 0)
         self.emit("obj2ast_%s(PyObject* obj, %s* out, PyArena* arena)" % (name, ctype), 0)
         self.emit("{", 0)
-        self.emit("PyObject* tmp = NULL;", 1)
         self.emit("int isinstance;", 1)
         self.emit("", 0)
 
-    def sumTrailer(self, name):
+    def sumTrailer(self, name, add_label=False):
         self.emit("", 0)
-        self.emit("tmp = PyObject_Repr(obj);", 1)
         # there's really nothing more we can do if this fails ...
-        self.emit("if (tmp == NULL) goto failed;", 1)
-        error = "expected some sort of %s, but got %%.400s" % name
-        format = "PyErr_Format(PyExc_TypeError, \"%s\", PyBytes_AS_STRING(tmp));"
+        error = "expected some sort of %s, but got %%R" % name
+        format = "PyErr_Format(PyExc_TypeError, \"%s\", obj);"
         self.emit(format % error, 1, reflow=False)
-        self.emit("failed:", 0)
-        self.emit("Py_XDECREF(tmp);", 1)
+        if add_label:
+            self.emit("failed:", 1)
+            self.emit("Py_XDECREF(tmp);", 1)
         self.emit("return 1;", 1)
         self.emit("}", 0)
         self.emit("", 0)
@@ -403,6 +401,7 @@
 
     def complexSum(self, sum, name):
         self.funcHeader(name)
+        self.emit("PyObject *tmp = NULL;", 1)
         for a in sum.attributes:
             self.visitAttributeDeclaration(a, name, sum=sum)
         self.emit("", 0)
@@ -430,7 +429,7 @@
             self.emit("if (*out == NULL) goto failed;", 2)
             self.emit("return 0;", 2)
             self.emit("}", 1)
-        self.sumTrailer(name)
+        self.sumTrailer(name, True)
 
     def visitAttributeDeclaration(self, a, name, sum=sum):
         ctype = get_c_type(a.type)

Modified: python/branches/py3k-cdecimal/Python/Python-ast.c
==============================================================================
--- python/branches/py3k-cdecimal/Python/Python-ast.c	(original)
+++ python/branches/py3k-cdecimal/Python/Python-ast.c	Mon Nov 22 12:00:42 2010
@@ -3374,9 +3374,9 @@
 int
 obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
 {
-        PyObject* tmp = NULL;
         int isinstance;
 
+        PyObject *tmp = NULL;
 
         if (obj == Py_None) {
                 *out = NULL;
@@ -3514,10 +3514,8 @@
                 return 0;
         }
 
-        tmp = PyObject_Repr(obj);
-        if (tmp == NULL) goto failed;
-        PyErr_Format(PyExc_TypeError, "expected some sort of mod, but got %.400s", PyBytes_AS_STRING(tmp));
-failed:
+        PyErr_Format(PyExc_TypeError, "expected some sort of mod, but got %R", obj);
+        failed:
         Py_XDECREF(tmp);
         return 1;
 }
@@ -3525,9 +3523,9 @@
 int
 obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
 {
-        PyObject* tmp = NULL;
         int isinstance;
 
+        PyObject *tmp = NULL;
         int lineno;
         int col_offset;
 
@@ -4712,10 +4710,8 @@
                 return 0;
         }
 
-        tmp = PyObject_Repr(obj);
-        if (tmp == NULL) goto failed;
-        PyErr_Format(PyExc_TypeError, "expected some sort of stmt, but got %.400s", PyBytes_AS_STRING(tmp));
-failed:
+        PyErr_Format(PyExc_TypeError, "expected some sort of stmt, but got %R", obj);
+        failed:
         Py_XDECREF(tmp);
         return 1;
 }
@@ -4723,9 +4719,9 @@
 int
 obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
 {
-        PyObject* tmp = NULL;
         int isinstance;
 
+        PyObject *tmp = NULL;
         int lineno;
         int col_offset;
 
@@ -5830,10 +5826,8 @@
                 return 0;
         }
 
-        tmp = PyObject_Repr(obj);
-        if (tmp == NULL) goto failed;
-        PyErr_Format(PyExc_TypeError, "expected some sort of expr, but got %.400s", PyBytes_AS_STRING(tmp));
-failed:
+        PyErr_Format(PyExc_TypeError, "expected some sort of expr, but got %R", obj);
+        failed:
         Py_XDECREF(tmp);
         return 1;
 }
@@ -5841,7 +5835,6 @@
 int
 obj2ast_expr_context(PyObject* obj, expr_context_ty* out, PyArena* arena)
 {
-        PyObject* tmp = NULL;
         int isinstance;
 
         isinstance = PyObject_IsInstance(obj, (PyObject *)Load_type);
@@ -5893,20 +5886,16 @@
                 return 0;
         }
 
-        tmp = PyObject_Repr(obj);
-        if (tmp == NULL) goto failed;
-        PyErr_Format(PyExc_TypeError, "expected some sort of expr_context, but got %.400s", PyBytes_AS_STRING(tmp));
-failed:
-        Py_XDECREF(tmp);
+        PyErr_Format(PyExc_TypeError, "expected some sort of expr_context, but got %R", obj);
         return 1;
 }
 
 int
 obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena)
 {
-        PyObject* tmp = NULL;
         int isinstance;
 
+        PyObject *tmp = NULL;
 
         if (obj == Py_None) {
                 *out = NULL;
@@ -6018,10 +6007,8 @@
                 return 0;
         }
 
-        tmp = PyObject_Repr(obj);
-        if (tmp == NULL) goto failed;
-        PyErr_Format(PyExc_TypeError, "expected some sort of slice, but got %.400s", PyBytes_AS_STRING(tmp));
-failed:
+        PyErr_Format(PyExc_TypeError, "expected some sort of slice, but got %R", obj);
+        failed:
         Py_XDECREF(tmp);
         return 1;
 }
@@ -6029,7 +6016,6 @@
 int
 obj2ast_boolop(PyObject* obj, boolop_ty* out, PyArena* arena)
 {
-        PyObject* tmp = NULL;
         int isinstance;
 
         isinstance = PyObject_IsInstance(obj, (PyObject *)And_type);
@@ -6049,18 +6035,13 @@
                 return 0;
         }
 
-        tmp = PyObject_Repr(obj);
-        if (tmp == NULL) goto failed;
-        PyErr_Format(PyExc_TypeError, "expected some sort of boolop, but got %.400s", PyBytes_AS_STRING(tmp));
-failed:
-        Py_XDECREF(tmp);
+        PyErr_Format(PyExc_TypeError, "expected some sort of boolop, but got %R", obj);
         return 1;
 }
 
 int
 obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena)
 {
-        PyObject* tmp = NULL;
         int isinstance;
 
         isinstance = PyObject_IsInstance(obj, (PyObject *)Add_type);
@@ -6160,18 +6141,13 @@
                 return 0;
         }
 
-        tmp = PyObject_Repr(obj);
-        if (tmp == NULL) goto failed;
-        PyErr_Format(PyExc_TypeError, "expected some sort of operator, but got %.400s", PyBytes_AS_STRING(tmp));
-failed:
-        Py_XDECREF(tmp);
+        PyErr_Format(PyExc_TypeError, "expected some sort of operator, but got %R", obj);
         return 1;
 }
 
 int
 obj2ast_unaryop(PyObject* obj, unaryop_ty* out, PyArena* arena)
 {
-        PyObject* tmp = NULL;
         int isinstance;
 
         isinstance = PyObject_IsInstance(obj, (PyObject *)Invert_type);
@@ -6207,18 +6183,13 @@
                 return 0;
         }
 
-        tmp = PyObject_Repr(obj);
-        if (tmp == NULL) goto failed;
-        PyErr_Format(PyExc_TypeError, "expected some sort of unaryop, but got %.400s", PyBytes_AS_STRING(tmp));
-failed:
-        Py_XDECREF(tmp);
+        PyErr_Format(PyExc_TypeError, "expected some sort of unaryop, but got %R", obj);
         return 1;
 }
 
 int
 obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena)
 {
-        PyObject* tmp = NULL;
         int isinstance;
 
         isinstance = PyObject_IsInstance(obj, (PyObject *)Eq_type);
@@ -6302,11 +6273,7 @@
                 return 0;
         }
 
-        tmp = PyObject_Repr(obj);
-        if (tmp == NULL) goto failed;
-        PyErr_Format(PyExc_TypeError, "expected some sort of cmpop, but got %.400s", PyBytes_AS_STRING(tmp));
-failed:
-        Py_XDECREF(tmp);
+        PyErr_Format(PyExc_TypeError, "expected some sort of cmpop, but got %R", obj);
         return 1;
 }
 
@@ -6377,9 +6344,9 @@
 int
 obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena)
 {
-        PyObject* tmp = NULL;
         int isinstance;
 
+        PyObject *tmp = NULL;
         int lineno;
         int col_offset;
 
@@ -6473,10 +6440,8 @@
                 return 0;
         }
 
-        tmp = PyObject_Repr(obj);
-        if (tmp == NULL) goto failed;
-        PyErr_Format(PyExc_TypeError, "expected some sort of excepthandler, but got %.400s", PyBytes_AS_STRING(tmp));
-failed:
+        PyErr_Format(PyExc_TypeError, "expected some sort of excepthandler, but got %R", obj);
+        failed:
         Py_XDECREF(tmp);
         return 1;
 }

Modified: python/branches/py3k-cdecimal/Python/pythonrun.c
==============================================================================
--- python/branches/py3k-cdecimal/Python/pythonrun.c	(original)
+++ python/branches/py3k-cdecimal/Python/pythonrun.c	Mon Nov 22 12:00:42 2010
@@ -893,8 +893,10 @@
 
     /* Set builtins.open */
     if (PyObject_SetAttrString(bimod, "open", wrapper) == -1) {
+        Py_DECREF(wrapper);
         goto error;
     }
+    Py_DECREF(wrapper);
 
     encoding = Py_GETENV("PYTHONIOENCODING");
     errors = NULL;

Modified: python/branches/py3k-cdecimal/Tools/scripts/patchcheck.py
==============================================================================
--- python/branches/py3k-cdecimal/Tools/scripts/patchcheck.py	(original)
+++ python/branches/py3k-cdecimal/Tools/scripts/patchcheck.py	Mon Nov 22 12:00:42 2010
@@ -45,13 +45,16 @@
         sys.exit('need a checkout to get modified files')
 
     st = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
-    st.wait()
-    if vcs == 'hg':
-        return [x.decode().rstrip() for x in st.stdout]
-    else:
-        output = (x.decode().rstrip().rsplit(None, 1)[-1]
-                  for x in st.stdout if x[0] in b'AM')
+    try:
+        st.wait()
+        if vcs == 'hg':
+            return [x.decode().rstrip() for x in st.stdout]
+        else:
+            output = (x.decode().rstrip().rsplit(None, 1)[-1]
+                      for x in st.stdout if x[0] in b'AM')
         return set(path for path in output if os.path.isfile(path))
+    finally:
+        st.stdout.close()
 
 
 def report_modified_files(file_paths):

Modified: python/branches/py3k-cdecimal/Tools/unicode/makeunicodedata.py
==============================================================================
--- python/branches/py3k-cdecimal/Tools/unicode/makeunicodedata.py	(original)
+++ python/branches/py3k-cdecimal/Tools/unicode/makeunicodedata.py	Mon Nov 22 12:00:42 2010
@@ -70,6 +70,15 @@
 NODELTA_MASK = 0x800
 NUMERIC_MASK = 0x1000
 
+# these ranges need to match unicodedata.c:is_unified_ideograph
+cjk_ranges = [
+    ('3400', '4DB5'),
+    ('4E00', '9FCB'),
+    ('20000', '2A6D6'),
+    ('2A700', '2B734'),
+    ('2B740', '2B81D')
+]
+
 def maketables(trace=0):
 
     print("--- Reading", UNICODE_DATA % "", "...")
@@ -81,7 +90,7 @@
 
     for version in old_versions:
         print("--- Reading", UNICODE_DATA % ("-"+version), "...")
-        old_unicode = UnicodeData(version)
+        old_unicode = UnicodeData(version, cjk_check=False)
         print(len(list(filter(None, old_unicode.table))), "characters")
         merge_old_version(version, unicode, old_unicode)
 
@@ -804,7 +813,8 @@
 
     def __init__(self, version,
                  linebreakprops=False,
-                 expand=1):
+                 expand=1,
+                 cjk_check=True):
         self.changed = []
         file = open_data(UNICODE_DATA, version)
         table = [None] * 0x110000
@@ -816,6 +826,8 @@
             char = int(s[0], 16)
             table[char] = s
 
+        cjk_ranges_found = []
+
         # expand first-last ranges
         if expand:
             field = None
@@ -826,12 +838,17 @@
                         s[1] = ""
                         field = s
                     elif s[1][-5:] == "Last>":
+                        if s[1].startswith("<CJK Ideograph"):
+                            cjk_ranges_found.append((field[0],
+                                                     s[0]))
                         s[1] = ""
                         field = None
                 elif field:
                     f2 = field[:]
                     f2[0] = "%X" % i
                     table[i] = f2
+            if cjk_check and cjk_ranges != cjk_ranges_found:
+                raise ValueError("CJK ranges deviate: have %r" % cjk_ranges_found)
 
         # public attributes
         self.filename = UNICODE_DATA % ''

Modified: python/branches/py3k-cdecimal/configure
==============================================================================
--- python/branches/py3k-cdecimal/configure	(original)
+++ python/branches/py3k-cdecimal/configure	Mon Nov 22 12:00:42 2010
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 82926 .
+# From configure.in Revision: 86306 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.67 for python 3.2.
 #
@@ -11821,52 +11821,6 @@
 LIBS_SAVE=$LIBS
 LIBS="$LIBS $LIBM"
 
-# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
-# -0. on some architectures.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tanh preserves the sign of zero" >&5
-$as_echo_n "checking whether tanh preserves the sign of zero... " >&6; }
-if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-if test "$cross_compiling" = yes; then :
-  ac_cv_tanh_preserves_zero_sign=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <math.h>
-#include <stdlib.h>
-int main() {
-    /* return 0 if either negative zeros don't exist
-       on this platform or if negative zeros exist
-       and tanh(-0.) == -0. */
-  if (atan2(0., -1.) == atan2(-0., -1.) ||
-      atan2(tanh(-0.), -1.) == atan2(-0., -1.)) exit(0);
-  else exit(1);
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_tanh_preserves_zero_sign=yes
-else
-  ac_cv_tanh_preserves_zero_sign=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tanh_preserves_zero_sign" >&5
-$as_echo "$ac_cv_tanh_preserves_zero_sign" >&6; }
-if test "$ac_cv_tanh_preserves_zero_sign" = yes
-then
-
-$as_echo "#define TANH_PRESERVES_ZERO_SIGN 1" >>confdefs.h
-
-fi
-
 for ac_func in acosh asinh atanh copysign erf erfc expm1 finite gamma
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -11926,6 +11880,101 @@
 _ACEOF
 
 
+# On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
+# -0. on some architectures.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tanh preserves the sign of zero" >&5
+$as_echo_n "checking whether tanh preserves the sign of zero... " >&6; }
+if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+if test "$cross_compiling" = yes; then :
+  ac_cv_tanh_preserves_zero_sign=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <math.h>
+#include <stdlib.h>
+int main() {
+    /* return 0 if either negative zeros don't exist
+       on this platform or if negative zeros exist
+       and tanh(-0.) == -0. */
+  if (atan2(0., -1.) == atan2(-0., -1.) ||
+      atan2(tanh(-0.), -1.) == atan2(-0., -1.)) exit(0);
+  else exit(1);
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_tanh_preserves_zero_sign=yes
+else
+  ac_cv_tanh_preserves_zero_sign=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tanh_preserves_zero_sign" >&5
+$as_echo "$ac_cv_tanh_preserves_zero_sign" >&6; }
+if test "$ac_cv_tanh_preserves_zero_sign" = yes
+then
+
+$as_echo "#define TANH_PRESERVES_ZERO_SIGN 1" >>confdefs.h
+
+fi
+
+if test "$ac_cv_func_log1p" = yes
+then
+    # On some versions of AIX, log1p(-0.) returns 0. instead of
+    # -0.  See issue #9920.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether log1p drops the sign of negative zero" >&5
+$as_echo_n "checking whether log1p drops the sign of negative zero... " >&6; }
+    if test "${ac_cv_log1p_drops_zero_sign+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    if test "$cross_compiling" = yes; then :
+  ac_cv_log1p_drops_zero_sign=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+    #include <math.h>
+    #include <stdlib.h>
+    int main() {
+        /* Fail if the signs of log1p(-0.) and -0. can be
+	   distinguished. */
+        if (atan2(log1p(-0.), -1.) == atan2(-0., -1.))
+            return 0;
+        else
+            return 1;
+    }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_log1p_drops_zero_sign=no
+else
+  ac_cv_log1p_drops_zero_sign=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_log1p_drops_zero_sign" >&5
+$as_echo "$ac_cv_log1p_drops_zero_sign" >&6; }
+fi
+if test "$ac_cv_log1p_drops_zero_sign" = yes
+then
+
+$as_echo "#define LOG1P_DROPS_ZERO_SIGN 1" >>confdefs.h
+
+fi
+
 LIBS=$LIBS_SAVE
 
 # For multiprocessing module, check that sem_open

Modified: python/branches/py3k-cdecimal/configure.in
==============================================================================
--- python/branches/py3k-cdecimal/configure.in	(original)
+++ python/branches/py3k-cdecimal/configure.in	Mon Nov 22 12:00:42 2010
@@ -3389,6 +3389,10 @@
 LIBS_SAVE=$LIBS
 LIBS="$LIBS $LIBM"
 
+AC_CHECK_FUNCS([acosh asinh atanh copysign erf erfc expm1 finite gamma])
+AC_CHECK_FUNCS([hypot lgamma log1p round tgamma])
+AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]])
+
 # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of
 # -0. on some architectures.
 AC_MSG_CHECKING(whether tanh preserves the sign of zero)
@@ -3415,9 +3419,34 @@
   [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros])
 fi
 
-AC_CHECK_FUNCS([acosh asinh atanh copysign erf erfc expm1 finite gamma])
-AC_CHECK_FUNCS([hypot lgamma log1p round tgamma])
-AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include <math.h>]])
+if test "$ac_cv_func_log1p" = yes
+then
+    # On some versions of AIX, log1p(-0.) returns 0. instead of
+    # -0.  See issue #9920.
+    AC_MSG_CHECKING(whether log1p drops the sign of negative zero)
+    AC_CACHE_VAL(ac_cv_log1p_drops_zero_sign, [
+    AC_RUN_IFELSE([AC_LANG_SOURCE([[
+    #include <math.h>
+    #include <stdlib.h>
+    int main() {
+        /* Fail if the signs of log1p(-0.) and -0. can be
+	   distinguished. */
+        if (atan2(log1p(-0.), -1.) == atan2(-0., -1.))
+            return 0;
+        else
+            return 1;
+    }
+    ]])],
+    [ac_cv_log1p_drops_zero_sign=no],
+    [ac_cv_log1p_drops_zero_sign=yes],
+    [ac_cv_log1p_drops_zero_sign=no])])
+    AC_MSG_RESULT($ac_cv_log1p_drops_zero_sign)
+fi
+if test "$ac_cv_log1p_drops_zero_sign" = yes
+then
+  AC_DEFINE(LOG1P_DROPS_ZERO_SIGN, 1,
+  [Define if log1p(-0.) is 0. rather than -0.])
+fi
 
 LIBS=$LIBS_SAVE
 

Modified: python/branches/py3k-cdecimal/pyconfig.h.in
==============================================================================
--- python/branches/py3k-cdecimal/pyconfig.h.in	(original)
+++ python/branches/py3k-cdecimal/pyconfig.h.in	Mon Nov 22 12:00:42 2010
@@ -917,6 +917,9 @@
 /* Define if you are using Mach cthreads directly under /include */
 #undef HURD_C_THREADS
 
+/* Define if log1p(-0.) is 0. rather than -0. */
+#undef LOG1P_DROPS_ZERO_SIGN
+
 /* Define if you are using Mach cthreads under mach / */
 #undef MACH_C_THREADS
 


More information about the Python-checkins mailing list