--- python3.3-3.3.0.orig/debian/libPVER.overrides.in
+++ python3.3-3.3.0/debian/libPVER.overrides.in
@@ -0,0 +1 @@
+lib@PVER@ binary: package-name-doesnt-match-sonames
--- python3.3-3.3.0.orig/debian/PVER-minimal.preinst.in
+++ python3.3-3.3.0/debian/PVER-minimal.preinst.in
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    install)
+	# remember newly installed runtime
+	mkdir -p /var/lib/python
+	touch /var/lib/python/@PVER@_installed
+    ;;
+    upgrade)
+	:
+    ;;
+
+    abort-upgrade)
+    ;;
+
+    *)
+        echo "preinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- python3.3-3.3.0.orig/debian/README.Debian.in
+++ python3.3-3.3.0/debian/README.Debian.in
@@ -0,0 +1,8 @@
+The documentation for this package is in /usr/share/doc/@PVER@/.
+
+A draft of the "Debian Python Policy" can be found in
+
+        /usr/share/doc/python
+
+Sometime it will be moved to /usr/share/doc/debian-policy in the
+debian-policy package.
--- python3.3-3.3.0.orig/debian/sitecustomize.py.in
+++ python3.3-3.3.0/debian/sitecustomize.py.in
@@ -0,0 +1,7 @@
+# install the apport exception handler if available
+try:
+    import apport_python_hook
+except ImportError:
+    pass
+else:
+    apport_python_hook.install()
--- python3.3-3.3.0.orig/debian/idle-PVER.postrm.in
+++ python3.3-3.3.0/debian/idle-PVER.postrm.in
@@ -0,0 +1,9 @@
+#! /bin/sh -e
+
+if [ "$1" = "purge" ]; then
+    rm -rf /etc/idle-@PVER@
+fi
+
+#DEBHELPER#
+
+exit 0
--- python3.3-3.3.0.orig/debian/idle-PVER.postinst.in
+++ python3.3-3.3.0/debian/idle-PVER.postinst.in
@@ -0,0 +1,30 @@
+#! /bin/sh -e
+#
+# postinst script for the Debian idle-@PVER@ package.
+# Written 1998 by Gregor Hoffleit <flight@debian.org>.
+#
+
+DIRLIST="/usr/lib/python@VER@/idlelib"
+
+case "$1" in
+    configure|abort-upgrade|abort-remove|abort-deconfigure)
+
+        for i in $DIRLIST ; do
+	    @PVER@ /usr/lib/@PVER@/compileall.py -q $i
+	    if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config
+	    then
+		@PVER@ -O /usr/lib/@PVER@/compileall.py -q $i
+	    fi
+	done
+    ;;
+
+    *)
+	echo "postinst called with unknown argument \`$1'" >&2
+	exit 1
+    ;;
+
+esac
+
+#DEBHELPER#
+
+exit 0
--- python3.3-3.3.0.orig/debian/pdb.1.in
+++ python3.3-3.3.0/debian/pdb.1.in
@@ -0,0 +1,16 @@
+.TH PDB@VER@ 1
+.SH NAME
+pdb@VER@ \- the Python debugger
+.SH SYNOPSIS
+.PP
+.B pdb@VER@
+.I script [...]
+.SH DESCRIPTION
+.PP
+See /usr/lib/python@VER@/pdb.doc for more information on the use
+of pdb.  When the debugger is started, help is available via the
+help command.
+.SH SEE ALSO
+python@VER@(1). Chapter 9 of the Python Library Reference
+(The Python Debugger). Available in the python@VER@-doc package at
+/usr/share/doc/python@VER@/html/lib/module-pdb.html.
--- python3.3-3.3.0.orig/debian/PVER-doc.doc-base.PVER-tut.in
+++ python3.3-3.3.0/debian/PVER-doc.doc-base.PVER-tut.in
@@ -0,0 +1,13 @@
+Document: @PVER@-tut
+Title: Python Tutorial (v@VER@)
+Author: Guido van Rossum, Fred L. Drake, Jr., editor
+Abstract: This tutorial introduces the reader informally to the basic
+ concepts and features of the Python language and system.  It helps
+ to have a Python interpreter handy for hands-on experience, but
+ all examples are self-contained, so the tutorial can be read
+ off-line as well.
+Section: Programming/Python
+
+Format: HTML
+Index: /usr/share/doc/@PVER@/html/tutorial/index.html
+Files: /usr/share/doc/@PVER@/html/tutorial/*.html
--- python3.3-3.3.0.orig/debian/PVER-dbg.README.Debian.in
+++ python3.3-3.3.0/debian/PVER-dbg.README.Debian.in
@@ -0,0 +1,52 @@
+Contents of the @PVER@-dbg package
+-------------------------------------
+
+For debugging python and extension modules, you may want to add the contents
+of /usr/share/doc/@PVER@/gdbinit (found in the @PVER@-dev package) to your
+~/.gdbinit file.
+
+@PVER@-dbg contains two sets of packages:
+
+ - debugging symbols for the standard @PVER@ build. When this package
+   is installed, gdb will automatically load up the debugging symbols
+   from it when debugging @PVER@ or one of the included extension
+   modules.
+
+ - a separate @PVER@-dbg binary, configured --with-pydebug, enabling the
+   additional debugging code to help debug memory management problems.
+
+For the latter, all extension modules have to be recompiled to
+correctly load with an pydebug enabled build.
+
+
+Debian and Ubuntu specific changes to the debug interpreter
+-----------------------------------------------------------
+The python2.4 and python2.5 packages in Ubuntu feisty are modified to
+first look for extension modules under a different name.
+
+  normal build: foo.so
+  debug build:  foo_d.so foo.so
+
+This naming schema allows installation of the extension modules into
+the same path (The naming is directly taken from the Windows builds
+which already uses this naming scheme).
+
+See https://wiki.ubuntu.com/PyDbgBuilds for more information.
+
+
+Using the python-dbg builds
+---------------------------
+
+ * Call the python-dbg or the pythonX.Y-dbg binaries instead of the
+   python or pythonX.Y binaries.
+
+ * Properties of the debug build are described in
+   /usr/share/doc/@PVER@/SpecialBuilds.txt.gz.
+   The debug interpreter is built with Py_DEBUG defined.
+
+ * From SpecialBuilds.txt: This is what is generally meant by "a debug
+   build" of Python.  Py_DEBUG implies LLTRACE, Py_REF_DEBUG,
+   Py_TRACE_REFS, and PYMALLOC_DEBUG (if WITH_PYMALLOC is enabled).
+   In addition, C assert()s are enabled (via the C way: by not defining
+   NDEBUG), and some routines do additional sanity checks inside
+   "#ifdef Py_DEBUG" blocks.
--- python3.3-3.3.0.orig/debian/libPVER-dev.overrides.in
+++ python3.3-3.3.0/debian/libPVER-dev.overrides.in
@@ -0,0 +1,3 @@
+lib@PVER@-dev binary: python-script-but-no-python-dep
+
+lib@PVER@-dev binary: arch-dependent-file-not-in-arch-specific-directory
--- python3.3-3.3.0.orig/debian/PVER-doc.overrides.in
+++ python3.3-3.3.0/debian/PVER-doc.overrides.in
@@ -0,0 +1,2 @@
+# this is referenced by the html docs
+@PVER@-doc binary: extra-license-file
--- python3.3-3.3.0.orig/debian/libPVER-minimal.postinst.in
+++ python3.3-3.3.0/debian/libPVER-minimal.postinst.in
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+set -e
+
+if [ ! -f /etc/@PVER@/sitecustomize.py ]; then
+    cat <<-EOF
+	# Empty sitecustomize.py to avoid a dangling symlink
+EOF
+fi
+
+#DEBHELPER#
+
+exit 0
--- python3.3-3.3.0.orig/debian/libPVER-dbg.symbols.i386.in
+++ python3.3-3.3.0/debian/libPVER-dbg.symbols.i386.in
@@ -0,0 +1,40 @@
+libpython@VER@dm.so.1.0 libpython@VER@-dbg #MINVER#
+#include "libpython.symbols"
+ _Py_force_double@Base @SVER@
+ _Py_get_387controlword@Base @SVER@
+ _Py_set_387controlword@Base @SVER@
+ _PyDict_Dummy@Base @SVER@
+ _PyMem_DebugFree@Base @SVER@
+ _PyMem_DebugMalloc@Base @SVER@
+ _PyMem_DebugRealloc@Base @SVER@
+ _PyObject_DebugCheckAddress@Base @SVER@
+ _PyObject_DebugCheckAddressApi@Base @SVER@
+ _PyObject_DebugDumpAddress@Base @SVER@
+ _PyObject_DebugFree@Base @SVER@
+ _PyObject_DebugFreeApi@Base @SVER@
+ _PyObject_DebugMalloc@Base @SVER@
+ _PyObject_DebugMallocApi@Base @SVER@
+ _PyObject_DebugMallocStats@Base @SVER@
+ _PyObject_DebugRealloc@Base @SVER@
+ _PyObject_DebugReallocApi@Base @SVER@
+ _PySet_Dummy@Base @SVER@
+ _PyUnicode_CheckConsistency@Base @SVER@
+ _PyUnicode_Dump@Base @SVER@
+ _PyUnicode_compact_data@Base @SVER@
+ _PyUnicode_data@Base @SVER@
+ _PyUnicode_utf8@Base @SVER@
+ _Py_AddToAllObjects@Base @SVER@
+ _Py_Dealloc@Base @SVER@
+ _Py_ForgetReference@Base @SVER@
+ _Py_GetObjects@Base @SVER@
+ _Py_GetRefTotal@Base @SVER@
+ _Py_NegativeRefcount@Base @SVER@
+ _Py_NewReference@Base @SVER@
+ _Py_PrintReferenceAddresses@Base @SVER@
+ _Py_PrintReferences@Base @SVER@
+ _Py_RefTotal@Base @SVER@
+ _Py_dumptree@Base @SVER@
+ _Py_printtree@Base @SVER@
+ _Py_showtree@Base @SVER@
+ _Py_tok_dump@Base @SVER@
+ PyModule_Create2TraceRefs@Base @SVER@
--- python3.3-3.3.0.orig/debian/PVER-doc.doc-base.PVER-new.in
+++ python3.3-3.3.0/debian/PVER-doc.doc-base.PVER-new.in
@@ -0,0 +1,10 @@
+Document: @PVER@-new
+Title: What's new in Python @VER@
+Author: A.M. Kuchling
+Abstract: This documents lists new features and changes worth mentioning
+ in Python @VER@.
+Section: Programming/Python
+
+Format: HTML
+Index: /usr/share/doc/@PVER@/html/whatsnew/@VER@.html
+Files: /usr/share/doc/@PVER@/html/whatsnew/@VER@.html
--- python3.3-3.3.0.orig/debian/script.py
+++ python3.3-3.3.0/debian/script.py
@@ -0,0 +1,51 @@
+#! /usr/bin/python3
+
+# Copyright (C) 2012 Colin Watson <cjwatson@ubuntu.com>.
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject
+# to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+"""Trivial script(1) workalike, but without reading from standard input."""
+
+import os
+import pty
+import select
+import sys
+
+filename = sys.argv[1]
+command = sys.argv[2]
+
+pid, master = pty.fork()
+if pid == 0:  # child
+    os.execlp("sh", "sh", "-c", command)
+
+# parent
+with open(filename, "wb") as logfile:
+    try:
+        while True:
+            rfds, _, _ = select.select([master], [], [])
+            if master in rfds:
+                data = os.read(master, 65536)
+                os.write(1, data)
+                logfile.write(data)
+                logfile.flush()
+    except (IOError, OSError):
+        pass
+
+os.close(master)
--- python3.3-3.3.0.orig/debian/mincheck.py
+++ python3.3-3.3.0/debian/mincheck.py
@@ -0,0 +1,41 @@
+
+import sys
+
+def get_listed(fn):
+    modules = set()
+    for line in open(fn).readlines():
+        modules.add(line.split()[1])
+    return modules
+
+def get_dependencies(fn):
+    t = eval(open(fn).read())
+    modules = set()
+    depgraph = t['depgraph']
+    for mod, deps in list(depgraph.items()):
+        if mod != '__main__':
+            modules.add(mod)
+        modules.update(list(deps.keys()))
+    return depgraph, modules
+
+def main():
+    mods = get_listed(sys.argv[1])
+    depgraph, deps = get_dependencies(sys.argv[2])
+    print(("Listed modules:", sorted(mods)))
+    print("")
+    print(("Dependent modules:", sorted(deps)))
+    print("")
+
+    missing = deps.difference(mods)
+    if missing:
+        print("Missing modules in python-minimal:")
+        print(missing)
+    for m in missing:
+        users = []
+        for caller, callees in list(depgraph.items()):
+            if m in callees:
+                users.append(caller)
+        print((m, "used in: ", users))
+    sys.exit(len(missing))
+
+main()
+
--- python3.3-3.3.0.orig/debian/control
+++ python3.3-3.3.0/debian/control
@@ -0,0 +1,193 @@
+Source: python3.3
+Section: python
+Priority: optional
+Maintainer: Matthias Klose <doko@debian.org>
+Build-Depends: debhelper (>= 5.0.51~), quilt, autoconf, lsb-release, sharutils,
+  libreadline6-dev, libncursesw5-dev (>= 5.3),
+  zlib1g-dev, libbz2-dev, liblzma-dev,
+  libgdbm-dev, libdb-dev,
+  tk8.5-dev, blt-dev (>= 2.4z), libssl-dev,
+  libexpat1-dev,
+  libbluetooth-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64],
+  locales [!armel !avr32 !hppa !ia64 !mipsel],
+  libsqlite3-dev, libffi-dev (>= 3.0.5),
+  libgpm2 [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64],
+  mime-support, netbase, bzip2, gdb, python3,
+  xvfb, xauth
+Build-Depends-Indep: python-sphinx
+Standards-Version: 3.9.4
+Vcs-Browser: https://code.launchpad.net/~doko/python/pkg3.3-debian
+Vcs-Bzr: http://bazaar.launchpad.net/~doko/python/pkg3.3-debian
+
+Package: python3.3
+Architecture: any
+Multi-Arch: allowed
+Priority: optional
+Depends: python3.3-minimal (= ${binary:Version}), libpython3.3-stdlib (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends}
+Suggests: python3.3-doc, binutils
+Description: Interactive high-level object-oriented language (version 3.3)
+ Version 3.3 of the high-level, interactive object oriented language,
+ includes an extensive class library with lots of goodies for
+ network programming, system administration, sounds and graphics.
+
+Package: libpython3.3-stdlib
+Architecture: any
+Multi-Arch: same
+Priority: optional
+Pre-Depends: multiarch-support
+Depends: libpython3.3-minimal (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends}
+Suggests: python3.3-profiler
+Provides: python3.3-cjkcodecs, python3.3-ctypes, python3.3-elementtree, python3.3-celementtree, python3.3-wsgiref, python3.3-gdbm, python3.3-profiler, python3.3-lzma
+Replaces: python3.3 (<< 3.3.0~rc1-1~)
+Description: Interactive high-level object-oriented language (version 3.3)
+ Version 3.3 of the high-level, interactive object oriented language,
+ includes an extensive class library with lots of goodies for
+ network programming, system administration, sounds and graphics.
+ .
+ This package contains the standard library. It is normally not
+ used on it's own, but as a dependency of python3.3.
+
+Package: python3.3-minimal
+Architecture: any
+Multi-Arch: allowed
+Priority: optional
+Depends: libpython3.3-minimal (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Recommends: python3.3
+Suggests: binfmt-support
+Replaces: python3.3 (<< 3.3~a4-1~)
+Conflicts: binfmt-support (<< 1.1.2)
+Description: Minimal subset of the Python language (version 3.3)
+ This package contains the interpreter and some essential modules.  It can
+ be used in the boot process for some basic tasks.
+ See /usr/share/doc/python3.3-minimal/README.Debian for a list of the modules
+ contained in this package.
+
+Package: libpython3.3-minimal
+Architecture: any
+Multi-Arch: same
+Priority: optional
+Pre-Depends: multiarch-support
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Recommends: libpython3.3-stdlib
+Replaces: python3.3 (<< 3.3~a4-1~), python3.3-minimal (<< 3.3.0~rc1-1~)
+Conflicts: binfmt-support (<< 1.1.2)
+Description: Minimal subset of the Python language (version 3.3)
+ This package contains some essential modules. It is normally not
+ used on it's own, but as a dependency of python3.3-minimal.
+
+Package: libpython3.3
+Architecture: any
+Multi-Arch: same
+Section: libs
+Priority: optional
+Pre-Depends: multiarch-support
+Depends: libpython3.3-stdlib (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Replaces: python3.3 (<< 3.0~rc1)
+Description: Shared Python runtime library (version 3.3)
+ Version 3.3 of the high-level, interactive object oriented language,
+ includes an extensive class library with lots of goodies for
+ network programming, system administration, sounds and graphics.
+ .
+ This package contains the shared runtime library, normally not needed
+ for programs using the statically linked interpreter.
+
+Package: python3.3-examples
+Architecture: all
+Depends: python3.3 (>= ${source:Version}), ${misc:Depends}
+Description: Examples for the Python language (v3.3)
+ Examples, Demos and Tools for Python (v3.3). These are files included in
+ the upstream Python distribution (v3.3).
+
+Package: python3.3-dev
+Architecture: any
+Multi-Arch: allowed
+Depends: python3.3 (= ${binary:Version}), libpython3.3-dev (= ${binary:Version}), libpython3.3 (= ${binary:Version}), libexpat1-dev, ${shlibs:Depends}, ${misc:Depends}
+Replaces: python3.3 (<< 3.2~rc1-2)
+Recommends: libc6-dev | libc-dev
+Description: Header files and a static library for Python (v3.3)
+ Header files, a static library and development tools for building
+ Python (v3.3) modules, extending the Python interpreter or embedding
+ Python (v3.3) in applications.
+ .
+ Maintainers of Python packages should read README.maintainers.
+
+Package: libpython3.3-dev
+Section: libdevel
+Architecture: any
+Multi-Arch: same
+Pre-Depends: multiarch-support
+Depends: libpython3.3-stdlib (= ${binary:Version}), libpython3.3 (= ${binary:Version}), libexpat1-dev, ${shlibs:Depends}, ${misc:Depends}
+Replaces: python3.3 (<< 3.2~rc1-2), python3.3-dev (<< 3.3.0~b1-2), python3.3-minimal (<< 3.3.0~rc1-1~)
+Recommends: libc6-dev | libc-dev
+Description: Header files and a static library for Python (v3.3)
+ Header files, a static library and development tools for building
+ Python (v3.3) modules, extending the Python interpreter or embedding
+ Python (v3.3) in applications.
+ .
+ Maintainers of Python packages should read README.maintainers.
+ .
+ This package contains development files. It is normally not
+ used on it's own, but as a dependency of python3.3-dev.
+
+Package: idle-python3.3
+Architecture: all
+Depends: python3.3, python3-tk, python3.3-tk, ${misc:Depends}
+Enhances: python3.3
+Description: IDE for Python (v3.3) using Tkinter
+ IDLE is an Integrated Development Environment for Python (v3.3).
+ IDLE is written using Tkinter and therefore quite platform-independent.
+
+Package: python3.3-doc
+Section: doc
+Architecture: all
+Depends: libjs-jquery, libjs-underscore, ${misc:Depends}
+Suggests: python3.3
+Description: Documentation for the high-level object-oriented language Python (v3.3)
+ These is the official set of documentation for the interactive high-level
+ object-oriented language Python (v3.3). All documents are provided
+ in HTML format. The package consists of ten documents:
+ .
+   * What's New in Python3.3
+   * Tutorial
+   * Python Library Reference
+   * Macintosh Module Reference
+   * Python Language Reference
+   * Extending and Embedding Python
+   * Python/C API Reference
+   * Installing Python Modules
+   * Documenting Python
+   * Distributing Python Modules
+
+Package: python3.3-dbg
+Section: debug
+Architecture: any
+Multi-Arch: allowed
+Priority: extra
+Depends: python3.3 (= ${binary:Version}), libpython3.3-dbg (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Recommends: gdb
+Suggests: python3-gdbm-dbg, python3-tk-dbg
+Description: Debug Build of the Python Interpreter (version 3.3)
+ The package holds two things:
+ .
+ - A Python interpreter configured with --pydebug. Dynamically loaded modules
+   are searched as <foo>_d.so first. Third party extensions need a separate
+   build to be used by this interpreter.
+ - Debug information for standard python interpreter and extensions.
+ .
+ See the README.debug for more information.
+
+Package: libpython3.3-dbg
+Section: debug
+Architecture: any
+Multi-Arch: same
+Priority: extra
+Pre-Depends: multiarch-support
+Depends: libpython3.3-stdlib (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Replaces: python3.3-dbg (<< 3.3.0~rc1-1)
+Description: Debug Build of the Python Interpreter (version 3.3)
+ The package holds two things:
+ .
+ - Extensions for a Python interpreter configured with --pydebug.
+ - Debug information for standard python extensions.
+ .
+ See the README.debug for more information.
--- python3.3-3.3.0.orig/debian/PVER-doc.doc-base.PVER-ref.in
+++ python3.3-3.3.0/debian/PVER-doc.doc-base.PVER-ref.in
@@ -0,0 +1,18 @@
+Document: @PVER@-ref
+Title: Python Reference Manual (v@VER@)
+Author: Guido van Rossum
+Abstract: This reference manual describes the syntax and "core semantics" of
+ the language.  It is terse, but attempts to be exact and complete.
+ The semantics of non-essential built-in object types and of the
+ built-in functions and modules are described in the *Python
+ Library Reference*.  For an informal introduction to the language,
+ see the *Python Tutorial*.  For C or C++ programmers, two
+ additional manuals exist: *Extending and Embedding the Python
+ Interpreter* describes the high-level picture of how to write a
+ Python extension module, and the *Python/C API Reference Manual*
+ describes the interfaces available to C/C++ programmers in detail.
+Section: Programming/Python
+
+Format: HTML
+Index: /usr/share/doc/@PVER@/html/reference/index.html
+Files: /usr/share/doc/@PVER@/html/reference/*.html
--- python3.3-3.3.0.orig/debian/README.source
+++ python3.3-3.3.0/debian/README.source
@@ -0,0 +1,7 @@
+The source tarball is lacking the files Lib/profile.py and Lib/pstats.py,
+which Debian considers to have a license non-suitable for main (the use
+of these modules limited to python).
+
+The package uses quilt to apply / unapply patches.
+See /usr/share/doc/quilt/README.source.  The series file is generated
+during the build.
--- python3.3-3.3.0.orig/debian/dh_doclink
+++ python3.3-3.3.0/debian/dh_doclink
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+pkg=`echo $1 | sed 's/^-p//'`
+target=$2
+
+ln -sf $target debian/$pkg/usr/share/doc/$pkg
+
+f=debian/$pkg.postinst.debhelper
+if [ ! -e $f ] || [ "`grep -c '^# dh_doclink' $f`" -eq 0 ]; then
+cat >> $f <<EOF
+# dh_doclink
+if [ "\$1" = "configure" ]; then
+  if [ -d /usr/doc -a ! -e /usr/doc/$pkg -a -d /usr/share/doc/$pkg ]; then
+    ln -sf ../share/doc/$pkg /usr/doc/$pkg
+  fi
+fi
+EOF
+fi
+
+f=debian/$pkg.prerm.debhelper
+if [ ! -e $f ] || [ "`grep -c '^# dh_doclink' $f`" -eq 0 ]; then
+cat >> $f <<EOF
+# dh_doclink
+if [ \( "\$1" = "upgrade" -o "\$1" = "remove" \) -a -L /usr/doc/$pkg ]; then
+  rm -f /usr/doc/$pkg
+fi
+EOF
+fi
--- python3.3-3.3.0.orig/debian/locale-gen
+++ python3.3-3.3.0/debian/locale-gen
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+LOCPATH=`pwd`/locales
+export LOCPATH
+
+[ -d $LOCPATH ] || mkdir -p $LOCPATH
+
+umask 022
+
+echo "Generating locales..."
+while read locale charset; do
+	case $locale in \#*) continue;; esac
+	[ -n "$locale" -a -n "$charset" ] || continue
+	echo -n "  `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"
+	echo -n ".$charset"
+	echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`
+	echo -n '...'
+        if [ -f $LOCPATH/$locale ]; then
+	    input=$locale
+	else
+            input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`
+	fi
+	localedef -i $input -c -f $charset $LOCPATH/$locale #-A /etc/locale.alias
+	echo ' done'; \
+done <<EOF
+# This file lists locales that the python testsuite depends on
+en_US			ISO-8859-1
+en_US.UTF-8		UTF-8
+EOF
+
+echo "Generation complete."
--- python3.3-3.3.0.orig/debian/PVER-minimal.postinst.in
+++ python3.3-3.3.0/debian/PVER-minimal.postinst.in
@@ -0,0 +1,91 @@
+#! /bin/sh
+
+set -e
+
+if [ ! -f /etc/@PVER@/sitecustomize.py ]; then
+    cat <<-EOF
+	# Empty sitecustomize.py to avoid a dangling symlink
+EOF
+fi
+
+if [ "$1" = configure ]; then
+  if [ -d /usr/lib/@PVER@/config ] && [ ! -h /usr/lib/@PVER@/config ]; then
+    if rmdir /usr/lib/@PVER@/config 2> /dev/null; then
+      ln -sf config-@VER@mu /usr/lib/@PVER@/config
+    else
+      echo >&2 "WARNING: non-empty directory on upgrade: /usr/lib/@PVER@/config"
+      ls -l /usr/lib/@PVER@/config
+    fi
+  fi
+fi
+
+syssite=/usr/lib/@PVER@/site-packages
+localsite=/usr/local/lib/@PVER@/dist-packages
+syslink=../../${localsite#/usr/*}
+
+case "$1" in
+    configure)
+        # Create empty directories in /usr/local
+        if [ ! -e /usr/local/lib/@PVER@ ]; then
+            mkdir -p /usr/local/lib/@PVER@ 2> /dev/null || true
+            chmod 2775 /usr/local/lib/@PVER@ 2> /dev/null || true
+            chown root:staff /usr/local/lib/@PVER@ 2> /dev/null || true
+        fi
+        if [ ! -e $localsite ]; then
+            mkdir -p $localsite 2> /dev/null || true
+            chmod 2775 $localsite 2> /dev/null || true
+            chown root:staff $localsite 2> /dev/null || true
+        fi
+	#if [ ! -h $syssite ]; then
+	#    ln -s $syslink $syssite
+	#fi
+
+	if which update-binfmts >/dev/null; then
+	    update-binfmts --import @PVER@
+	fi
+
+    ;;
+esac
+
+if [ "$1" = configure ]; then
+
+    # only available before removal of the packaging package
+    rm -f /etc/@PVER@/sysconfig.cfg
+
+    (
+    files=$(dpkg -L @PVER@-minimal | sed -n '/^\/usr\/lib\/@PVER@\/.*\.py$/p')
+	@PVER@ /usr/lib/@PVER@/py_compile.py $files
+	if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then
+	    @PVER@ -O /usr/lib/@PVER@/py_compile.py $files
+	fi
+    )
+    bc=no
+    #if [ -z "$2" ] || dpkg --compare-versions "$2" lt 2.5-3 \
+    #    || [ -f /var/lib/python/@PVER@_installed ]; then
+    #	bc=yes
+    #fi
+    if ! grep -sq '^supported-versions[^#]*@PVER@' /usr/share/python/debian_defaults
+    then
+	# FIXME: byte compile anyway?
+	bc=no
+    fi
+    if [ "$bc" = yes ]; then
+	# new installation or installation of first version with hook support
+	if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
+	    echo "Linking and byte-compiling packages for runtime @PVER@..."
+	fi
+	version=$(dpkg -s @PVER@-minimal | awk '/^Version:/ {print $2}')
+	for hook in /usr/share/python3/runtime.d/*.rtinstall; do
+	    [ -x $hook ] || continue
+	    $hook rtinstall @PVER@ "$2" "$version"
+	done
+	if [ -f /var/lib/python/@PVER@_installed ]; then
+	    rm -f /var/lib/python/@PVER@_installed
+	    rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null
+	fi
+    fi
+fi
+
+#DEBHELPER#
+
+exit 0
--- python3.3-3.3.0.orig/debian/source.lintian-overrides
+++ python3.3-3.3.0/debian/source.lintian-overrides
@@ -0,0 +1,2 @@
+# generated during the build
+python3.3 source: quilt-build-dep-but-no-series-file
--- python3.3-3.3.0.orig/debian/PVER-minimal.README.Debian.in
+++ python3.3-3.3.0/debian/PVER-minimal.README.Debian.in
@@ -0,0 +1,154 @@
+Contents of the @PVER@-minimal package
+-----------------------------------------
+
+@PVER@-minimal consists of a minimum set of modules which may be needed
+for python scripts used during the boot process.  If other packages
+are needed in these scripts, don't work around the missing module, but
+file a bug report against this package. The modules in this package
+are:
+
+  __builtin__		builtin
+  __future__		module
+  _bisect		extension
+  _bytesio		builtin
+  _codecs		builtin
+  _collections		extension
+  _compat_pickle	module
+  _datetime		extension
+  _elementtree		extension
+  _fileio		builtin
+  _functools		extension
+  _hashlib		extensionx
+  _heapq		extension
+  _imp			builtin
+  _io			builtin
+  _locale		extension
+  _md5			extension
+  _pickle		extension
+  _posixsubprocess	extension
+  _random		extension
+  _sha1			extension
+  _sha256		extension
+  _sha512		extension
+  _socket		extension
+  _sre			builtin
+  _ssl			extensionx
+  _stringio		extension
+  _struct		extension
+  _string		builtin
+  _stringio		builtin
+  _symtable		builtin
+  _sysconfigdata	module
+  _thread		builtin
+  _types		builtin
+  _weakref		builtin
+  _weakrefset		module
+  _warnings		builtin
+  configparser		module
+  abc			module
+  argparse		module
+  array			extension
+  atexit		extension
+  base64		module
+  binascii		extension
+  bisect		module
+  builtins		builtin
+  codecs		module
+  collections		package
+  compileall		module
+  copy			module
+  copyreg		module
+  dis			module
+  errno			builtin
+  exceptions		builtin
+  fcntl			extension
+  fnmatch		module
+  functools		module
+  gc			builtin
+  genericpath		module
+  getopt		module
+  glob			module
+  grp			extension
+  hashlib		module
+  heapq			module
+  imp			module
+  importlib		package
+  inspect		module
+  io			module
+  itertools		extension
+  keyword		module
+  linecache		module
+  locale		module
+  logging		package
+  marshal		builtin
+  math			extension
+  opcode		module
+  operator		extension
+  optparse		module
+  os			module
+  pickle		module
+  pkgutil		module
+  platform		module
+  posix			builtin
+  posixpath		module
+  pwd			builtin
+  pyexpat		extension
+  py_compile		module
+  random		module
+  re			module
+  reprlib		module
+  runpy			module
+  select		extension
+  signal		builtin
+  socket		module
+  spwd			extension
+  sre_compile		module
+  sre_constants		module
+  sre_parse		module
+  ssl			module
+  stat			module
+  string		module
+  struct		module
+  subprocess		module
+  sys			builtin
+  sysconfig		module
+  syslog		extension
+  tempfile		module
+  textwrap		module
+  time			extension
+  token			module
+  tokenize		module
+  traceback		module
+  types			module
+  unicodedata		extension
+  warnings		module
+  weakref		module
+  zipimport		extension
+  zlib			extension
+
+Included are as well the codecs and stringprep modules, and the encodings
+modules for all encodings except the multibyte encodings and the bz2 codec.
+
+The following modules are excluded, their import is guarded from the
+importing module:
+
+  Used in       Excluded
+  ------------  ------------------------------------
+  io		_dummy_thread
+  os		nt ntpath os2 os2emxpath mac macpath
+		riscos riscospath riscosenviron
+  optparse	gettext
+  pickle	doctest
+  subprocess	threading
+
+This list was derived by looking at the modules in the perl-base package,
+then adding python specific "core modules".
+
+TODO's
+------
+
+- time.strptime cannot be used. The required _strptime module is not
+  included in the -minimal package yet. _strptime, locale, _locale and
+  calendar have to be added.
+
+- modules used very often in the testsuite: copy, cPickle, operator.
--- python3.3-3.3.0.orig/debian/PVER-minimal.postrm.in
+++ python3.3-3.3.0/debian/PVER-minimal.postrm.in
@@ -0,0 +1,17 @@
+#! /bin/sh -e
+
+if [ "$1" = "remove" ]; then
+
+    (find /usr/lib/@PVER@ -name '*.py[co]' | xargs rm -f {}) 2>/dev/null || true
+
+    for d in `find /usr/lib/@PVER@ -depth -type d -empty 2> /dev/null`; do \
+        while rmdir $d 2> /dev/null; do d=`dirname $d`; done; \
+    done
+
+    if [ -f /var/lib/python/@PVER@_installed ]; then
+	rm -f /var/lib/python/@PVER@_installed
+	rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null
+    fi
+
+    rmdir --parents /usr/local/lib/@PVER@ 2>/dev/null || true
+fi
--- python3.3-3.3.0.orig/debian/pymindeps.py
+++ python3.3-3.3.0/debian/pymindeps.py
@@ -0,0 +1,175 @@
+#! /usr/bin/python3
+
+# Matthias Klose
+# Modified to only exclude module imports from a given module.
+
+# Copyright 2004 Toby Dickenson
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject
+# to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+import os, sys, pprint
+import modulefinder
+import imp
+
+class mymf(modulefinder.ModuleFinder):
+    def __init__(self,*args,**kwargs):
+        self._depgraph = {}
+        self._types = {}
+        self._last_caller = None
+        modulefinder.ModuleFinder.__init__(self, *args, **kwargs)
+        
+    def import_hook(self, name, caller=None, fromlist=None, level=-1):
+        old_last_caller = self._last_caller
+        try:
+            self._last_caller = caller
+            return modulefinder.ModuleFinder.import_hook(self, name, caller,
+                                                         fromlist, level)
+        finally:
+            self._last_caller = old_last_caller
+            
+    def import_module(self, partnam, fqname, parent):
+        m = modulefinder.ModuleFinder.import_module(self,
+                                                    partnam, fqname, parent)
+        if m is not None and self._last_caller:
+            caller = self._last_caller.__name__
+            if '.' in caller:
+                caller = caller[:caller.index('.')]
+            callee =  m.__name__
+            if '.' in callee:
+                callee = callee[:callee.index('.')]
+            #print "XXX last_caller", caller, "MOD", callee
+            #self._depgraph.setdefault(self._last_caller.__name__,{})[r.__name__] = 1
+            #if caller in ('pdb', 'doctest') or callee in ('pdb', 'doctest'):
+            #    print caller, "-->", callee
+            if caller != callee:
+                self._depgraph.setdefault(caller,{})[callee] = 1
+        return m
+    
+    def find_module(self, name, path, parent=None):
+        if parent is not None:
+            # assert path is not None
+            fullname = parent.__name__+'.'+name
+        elif name == "__init__":
+            fullname = os.path.basename(path[0])
+        else:
+            fullname = name
+        if self._last_caller:
+            caller = self._last_caller.__name__
+            if fullname in excluded_imports.get(caller, []):
+                #self.msgout(3, "find_module -> Excluded", fullname)
+                raise ImportError(name)
+
+        if fullname in self.excludes:
+            #self.msgout(3, "find_module -> Excluded", fullname)
+            raise ImportError(name)
+
+        if path is None:
+            if name in sys.builtin_module_names:
+                return (None, None, ("", "", imp.C_BUILTIN))
+
+            path = self.path
+        return imp.find_module(name, path)
+
+    def load_module(self, fqname, fp, pathname, file_info):
+        suffix, mode, type = file_info
+        m = modulefinder.ModuleFinder.load_module(self, fqname,
+                                                  fp, pathname, file_info)
+        if m is not None:
+            self._types[m.__name__] = type
+        return m
+
+    def load_package(self, fqname, pathname):
+        m = modulefinder.ModuleFinder.load_package(self, fqname,pathname)
+        if m is not None:
+            self._types[m.__name__] = imp.PKG_DIRECTORY
+        return m
+ 
+def reduce_depgraph(dg):
+    pass
+
+# guarded imports, which don't need to be included in python-minimal
+excluded_imports = {
+    'argparse': set(('gettext',)),
+    'codecs': set(('encodings',)),
+    'collections': set(('cPickle', 'pickle', 'doctest')),
+    'copy': set(('reprlib',)),
+    'functools': set(('_dummy_thread',)),
+    'hashlib': set(('logging', '_hashlib')),
+    #'hashlib': set(('_hashlib', '_md5', '_sha', '_sha256','_sha512',)),
+    'heapq': set(('doctest',)),
+    'io': set(('_dummy_thread',)),
+    'logging': set(('multiprocessing',)),
+    'os': set(('nt', 'ntpath', 'os2', 'os2emxpath', 'mac', 'macpath',
+               'riscos', 'riscospath', 'riscosenviron')),
+    'optparse': set(('gettext',)),
+    'pickle': set(('argparse', 'doctest', 'pprint')),
+    'platform': set(('plistlib', 'tempfile')),
+    #'socket': set(('_ssl',)),
+    'subprocess': set(('threading',)),
+    'sysconfig': set(('pprint','_osx_support')),
+    }
+
+def main(argv):
+    # Parse command line
+    import getopt
+    try:
+        opts, args = getopt.getopt(sys.argv[1:], "dmp:qx:")
+    except getopt.error as msg:
+        print(msg)
+        return
+
+    # Process options
+    debug = 1
+    domods = 0
+    addpath = []
+    exclude = []
+    for o, a in opts:
+        if o == '-d':
+            debug = debug + 1
+        if o == '-m':
+            domods = 1
+        if o == '-p':
+            addpath = addpath + a.split(os.pathsep)
+        if o == '-q':
+            debug = 0
+        if o == '-x':
+            exclude.append(a)
+
+    path = sys.path[:]
+    path = addpath + path
+
+    if debug > 1:
+        print(("version:", sys.version))
+        print("path:")
+        for item in path:
+            print(("   ", repr(item)))
+
+    #exclude = ['__builtin__', 'sys', 'os']
+    exclude = []
+    mf = mymf(path, debug, exclude)
+    for arg in args:
+        mf.run_script(arg)
+
+    depgraph = reduce_depgraph(mf._depgraph)
+    
+    pprint.pprint({'depgraph':mf._depgraph, 'types':mf._types})
+    
+if __name__=='__main__':
+    main(sys.argv[1:])
--- python3.3-3.3.0.orig/debian/rules
+++ python3.3-3.3.0/debian/rules
@@ -0,0 +1,1338 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+
+unexport LANG LC_ALL LC_CTYPE LC_COLLATE LC_TIME LC_NUMERIC LC_MESSAGES
+unexport CFLAGS CXXFLAGS LDFLAGS CPPFLAGS
+
+export SHELL = /bin/bash
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+vafilt		= $(subst $(2)=,,$(filter $(2)=%,$(1)))
+DPKG_VARS	:= $(shell dpkg-architecture)
+DEB_BUILD_ARCH		?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_ARCH)
+DEB_BUILD_GNU_TYPE	?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE)
+DEB_HOST_ARCH		?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH)
+DEB_HOST_ARCH_ENDIAN	?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH_ENDIAN)
+DEB_HOST_ARCH_OS	?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH_OS)
+DEB_HOST_GNU_TYPE	?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE)
+DEB_HOST_MULTIARCH	?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH)
+
+CHANGELOG_VARS := $(shell dpkg-parsechangelog | \
+	sed -n 's/ /_/g;/^[^_]/s/^\([^:]*\):_\(.*\)/\1=\2/p')
+PKGSOURCE  := $(call vafilt,$(CHANGELOG_VARS),Source)
+PKGVERSION := $(call vafilt,$(CHANGELOG_VARS),Version)
+
+on_buildd := $(shell [ -f /CurrentlyBuilding -o "$$LOGNAME" = buildd ] && echo yes)
+
+ifneq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
+  WITHOUT_CHECK := yes
+endif
+WITHOUT_BENCH :=
+ifneq (,$(findstring nobench, $(DEB_BUILD_OPTIONS)))
+  WITHOUT_BENCH := yes
+endif
+ifeq ($(on_buildd),yes)
+  ifneq (,$(findstring $(DEB_HOST_ARCH), armel hppa mips mipsel s390))
+    WITHOUT_CHECK := yes
+  endif
+  ifneq (,$(findstring $(DEB_HOST_ARCH), armel hppa mips mipsel s390))
+    WITHOUT_BENCH := yes
+  endif
+endif
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+  WITHOUT_BENCH := yes
+  WITHOUT_CHECK := yes
+endif
+WITHOUT_CHECK := yes
+
+COMMA = ,
+ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
+  NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
+endif
+
+distribution := $(shell lsb_release -is)
+
+VER=3.3
+SVER=3.3.0~b1
+NVER=3.4
+PVER=python3.3
+PRIORITY=$(shell echo $(VER) | tr -d '.')0
+
+PREVVER	:= $(shell awk '/^python/ && NR > 1 {print substr($$2,2,length($$2)-2); exit}' debian/changelog)
+
+# default versions are built from the python-defaults source package
+# keep the definition to adjust package priorities.
+DEFAULT_VERSION = no
+STATIC_PYTHON=yes
+
+MIN_MODS := $(shell awk '/^  / && $$2 == "module" { print $$1 }' \
+		debian/PVER-minimal.README.Debian.in)
+MIN_EXTS := $(shell awk '/^  / && $$2 ~ /^extension/ { print $$1 }' \
+		debian/PVER-minimal.README.Debian.in)
+MIN_BUILTINS := $(shell awk '/^  / && $$2 == "builtin" { print $$1 }' \
+		debian/PVER-minimal.README.Debian.in)
+MIN_PACKAGES := $(shell awk '/^  / && $$2 == "package" { print $$1 }' \
+		debian/PVER-minimal.README.Debian.in)
+MIN_ENCODINGS := $(foreach i, \
+			$(filter-out \
+			  big5% bz2% cp932.py cp949.py cp950.py euc_% \
+			  gb% iso2022% johab.py shift_jis% , \
+			  $(shell cd Lib/encodings && echo *.py)), \
+			encodings/$(i)) \
+		 codecs.py stringprep.py
+
+with_tk := no
+with_interp := static
+#with_interp := shared
+
+PY_INTERPRETER = /usr/bin/python$(VER)
+
+ifeq ($(DEFAULT_VERSION),yes)
+  PY_PRIO = standard
+  #PYSTDDEP = , python (>= $(VER))
+else
+  PY_PRIO = optional
+endif
+ifeq ($(distribution),Ubuntu)
+  PY_MINPRIO = required
+  PY_MINPRIO = optional
+  with_fpectl = yes
+  #with_udeb = yes
+else
+  PY_MINPRIO = $(PY_PRIO)
+  with_fpectl = yes
+endif
+
+CC=$(DEB_HOST_GNU_TYPE)-gcc
+CXX=$(DEB_HOST_GNU_TYPE)-g++
+
+DPKG_CPPFLAGS:= $(shell dpkg-buildflags --get CPPFLAGS)
+DPKG_CFLAGS  := $(shell dpkg-buildflags --get CFLAGS)
+DPKG_LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
+OPT_CFLAGS   := $(filter-out -O%,$(DPKG_CFLAGS)) # default is -O3
+DEBUG_CFLAGS := $(patsubst -O%,-O0,$(DPKG_CFLAGS))
+
+# on alpha, use -O2 only, use -mieee
+ifeq ($(DEB_HOST_ARCH),alpha)
+    OPT_CFLAGS += -mieee
+    DEBUG_CFLAGS += -mieee
+    EXTRA_OPT_FLAGS += -O2
+endif
+ifeq ($(DEB_HOST_ARCH),m68k)
+    EXTRA_OPT_FLAGS += -O2
+endif
+
+ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+  ifeq ($(DEB_HOST_ARCH_OS),linux)
+    ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 armel armhf i386 powerpc ppc64))
+      with_pgo := yes
+    endif
+  endif
+endif
+
+ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 armel armhf i386))
+  with_lto := yes
+endif
+
+ifneq (,$(findstring noopt, $(DEB_BUILD_OPTIONS)))
+    OPT_CFLAGS := $(filter-out -O%, $(OPT_CFLAGS))
+    EXTRA_OPT_CFLAGS = -O0
+    with_pgo =
+    with_lto =
+endif
+
+ifeq ($(with_lto),yes)
+    LTO_CFLAGS = -g -flto -fuse-linker-plugin
+    EXTRA_OPT_CFLAGS += $(LTO_CFLAGS)
+endif
+
+make_build_target = $(if $(with_pgo),profile-opt)
+
+buildd_static	:= $(CURDIR)/build-static
+buildd_shared	:= $(CURDIR)/build-shared
+buildd_debug	:= $(CURDIR)/build-debug
+buildd_shdebug	:= $(CURDIR)/build-shdebug
+
+d		:= debian/tmp
+scriptdir	=  usr/share/lib/python$(VER)
+scriptdir	=  usr/share/python$(VER)
+scriptdir	=  usr/lib/python$(VER)
+
+# package names and directories
+p_base	:= $(PVER)
+p_min	:= $(PVER)-minimal
+p_lib	:= lib$(PVER)
+p_tk	:= $(PVER)-tk
+p_dev	:= $(PVER)-dev
+p_exam	:= $(PVER)-examples
+p_idle	:= idle-$(PVER)
+p_doc	:= $(PVER)-doc
+p_dbg	:= $(PVER)-dbg
+p_udeb	:= $(PVER)-udeb
+
+p_lbase	:= lib$(PVER)-stdlib
+p_lmin	:= lib$(PVER)-minimal
+p_ldev	:= lib$(PVER)-dev
+p_ldbg	:= lib$(PVER)-dbg
+
+d_base	:= debian/$(p_base)
+d_min	:= debian/$(p_min)
+d_lib	:= debian/$(p_lib)
+d_tk	:= debian/$(p_tk)
+d_dev	:= debian/$(p_dev)
+d_exam	:= debian/$(p_exam)
+d_idle	:= debian/$(p_idle)
+d_doc	:= debian/$(p_doc)
+d_dbg	:= debian/$(p_dbg)
+d_udeb	:= debian/$(p_udeb)
+
+d_lbase	:= debian/$(p_lbase)
+d_lmin	:= debian/$(p_lmin)
+d_ldev	:= debian/$(p_ldev)
+d_ldbg	:= debian/$(p_ldbg)
+
+build-arch: stamps/stamp-build
+build-indep: stamps/stamp-build-doc
+build: build-arch
+stamps/stamp-build: stamps/stamp-build-static stamps/stamp-mincheck \
+    stamps/stamp-build-shared stamps/stamp-build-debug \
+    stamps/stamp-build-shared-debug \
+    stamps/stamp-check stamps/stamp-pystone stamps/stamp-pybench
+	touch $@
+
+PROFILE_EXCLUDES = test_compiler test_distutils test_platform test_subprocess \
+	test_multiprocessing test_socketserver \
+	test_thread test_threaded_import test_threadedtempfile \
+	test_threading test_threading_local test_threadsignals \
+	test_dbm_dumb test_dbm_ndbm test_pydoc test_sundry \
+	test_signal test_ioctl test_gdb test_io
+# FIXME: test_mailxbox breaks, 20090703
+PROFILE_EXCLUDES += test_mailbox
+# FIXME: test_xmlrpc breaks, 20090818
+PROFILE_EXCLUDES += test_xmlrpc
+# FIXME: test_telnetlib uses network resources
+PROFILE_EXCLUDES += test_telnetlib
+
+PROFILE_TASK = ../Lib/test/regrtest.py \
+	-x $(sort $(TEST_EXCLUDES) $(PROFILE_EXCLUDES))
+
+stamps/stamp-build-static: stamps/stamp-configure-static
+	dh_testdir
+	$(MAKE) $(NJOBS) -C $(buildd_static) \
+		EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" \
+		PROFILE_TASK='$(PROFILE_TASK)' $(make_build_target)
+	touch stamps/stamp-build-static
+
+stamps/stamp-build-shared: stamps/stamp-configure-shared
+	dh_testdir
+	$(MAKE) $(NJOBS) -C $(buildd_shared) \
+		EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)"
+	: # build a static library with PIC objects
+	$(MAKE) $(NJOBS) -C $(buildd_shared) \
+		EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" \
+		LIBRARY=libpython$(VER)m-pic.a libpython$(VER)m-pic.a
+	touch stamps/stamp-build-shared
+
+stamps/stamp-build-debug: stamps/stamp-configure-debug
+	dh_testdir
+	$(MAKE) $(NJOBS) -C $(buildd_debug) \
+		EXTRA_CFLAGS="$(DEBUG_CFLAGS)"
+	touch stamps/stamp-build-debug
+
+stamps/stamp-build-shared-debug: stamps/stamp-configure-shared-debug
+	dh_testdir
+	: # build the shared debug library
+	$(MAKE) $(NJOBS) -C $(buildd_shdebug) \
+		EXTRA_CFLAGS="$(DEBUG_CFLAGS)" \
+		libpython$(VER)dm.so pybuilddir.txt
+	touch stamps/stamp-build-shared-debug
+
+common_configure_args = \
+		--prefix=/usr \
+		--enable-ipv6 \
+		--enable-loadable-sqlite-extensions \
+		--with-dbmliborder=bdb:gdbm \
+		--with-computed-gotos \
+		--with-system-expat \
+
+ifeq ($(DEB_HOST_ARCH), avr32)
+  common_configure_args += --without-ffi
+else
+  common_configure_args += --with-system-ffi
+endif
+
+ifeq ($(with_fpectl),yes)
+  common_configure_args += \
+		--with-fpectl
+endif
+
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+  common_configure_args += --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
+  config_site = ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=yes
+  ifeq (,$(filter $(DEB_HOST_ARCH),arm m68k))
+    ifeq ($(DEB_HOST_ARCH_ENDIAN),little)
+      config_site += ac_cv_little_endian_double=yes
+    else
+      config_site += ac_cv_big_endian_double=yes
+    endif
+  endif
+endif
+
+stamps/stamp-configure-shared: stamps/stamp-patch
+	rm -rf $(buildd_shared)
+	mkdir -p $(buildd_shared)
+	cd $(buildd_shared) && \
+	  CC="$(CC)" CXX="$(CXX)" CFLAGS="$(OPT_CFLAGS)" \
+	  CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \
+	    $(config_site) \
+	    ../configure \
+		--enable-shared \
+		$(common_configure_args)
+
+	$(call __post_configure,$(buildd_shared))
+
+	@echo XXXXXXX pyconfig.h
+	-cat $(buildd_shared)/pyconfig.h
+
+	touch $@
+
+stamps/stamp-configure-static: stamps/stamp-patch
+	rm -rf $(buildd_static)
+	mkdir -p $(buildd_static)
+	cd $(buildd_static) && \
+	  CC="$(CC)" CXX="$(CXX)" CFLAGS="$(OPT_CFLAGS)" \
+	  CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \
+	    $(config_site) \
+	    ../configure \
+		$(common_configure_args)
+
+	$(call __post_configure,$(buildd_static))
+	touch $@
+
+stamps/stamp-configure-debug: stamps/stamp-patch
+	rm -rf $(buildd_debug)
+	mkdir -p $(buildd_debug)
+	cd $(buildd_debug) && \
+	  CC="$(CC)" CXX="$(CXX)" CFLAGS="$(DEBUG_CFLAGS)" \
+	  CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \
+	    $(config_site) \
+	    ../configure \
+		$(common_configure_args) \
+		--with-pydebug
+
+	$(call __post_configure,$(buildd_debug))
+	touch $@
+
+stamps/stamp-configure-shared-debug: stamps/stamp-patch
+	rm -rf $(buildd_shdebug)
+	mkdir -p $(buildd_shdebug)
+	cd $(buildd_shdebug) && \
+	  CC="$(CC)" CXX="$(CXX)" CFLAGS="$(DEBUG_CFLAGS)" \
+	  CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \
+	    $(config_site) \
+	    ../configure \
+		$(common_configure_args) \
+		--enable-shared \
+		--with-pydebug
+
+	$(call __post_configure,$(buildd_shdebug))
+	touch $@
+
+define __post_configure
+	egrep \
+	  "^#($$(awk -v ORS='|' '$$2 ~ /^extension$$/ {print $$1}' debian/PVER-minimal.README.Debian.in)XX)" \
+	  Modules/Setup.dist \
+	    | sed -e 's/^#//' -e 's/-Wl,-Bdynamic//;s/-Wl,-Bstatic//' \
+	    >> $(1)/Modules/Setup.local
+
+	: # unconditionally run makesetup
+	cd $(1) && \
+	  ../Modules/makesetup -c ../Modules/config.c.in -s Modules \
+	    Modules/Setup.config Modules/Setup.local Modules/Setup
+	mv $(1)/config.c $(1)/Modules/
+
+	: # and fix the timestamps
+	$(MAKE) -C $(1) Makefile Modules/config.c
+
+	: # apply workaround for missing os.fsync
+	sed 's/HAVE_SYNC/HAVE_FSYNC/g' $(1)/pyconfig.h \
+		> $(1)/pyconfig.h.new
+	touch -r $(1)/pyconfig.h $(1)/pyconfig.h.new
+	mv -f $(1)/pyconfig.h.new $(1)/pyconfig.h
+endef
+
+stamps/stamp-mincheck: stamps/stamp-build-static debian/PVER-minimal.README.Debian.in
+ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+	for m in $(MIN_MODS) $(MIN_PACKAGES) $(MIN_EXTS) $(MIN_BUILTINS); do \
+	  echo "import $$m"; \
+	done > $(buildd_static)/minmods.py
+	cd $(buildd_static) && ./python ../debian/pymindeps.py minmods.py \
+	  > $(buildd_static)/mindeps.txt
+	-if [ -x /usr/bin/dot ]; then \
+	  cd $(buildd_static) && ./python ../debian/depgraph.py \
+	    < $(buildd_static)/mindeps.txt > $(buildd_static)/mindeps.dot; \
+	  dot -Tpng -o $(buildd_static)/mindeps.png \
+	    $(buildd_static)/mindeps.dot; \
+	else true; fi
+	cd $(buildd_static) && ./python ../debian/mincheck.py \
+		minmods.py mindeps.txt
+endif
+	touch stamps/stamp-mincheck
+
+TEST_RESOURCES = all
+ifeq ($(on_buildd),yes)
+  TEST_RESOURCES := $(TEST_RESOURCES),-network,-urlfetch
+endif
+TESTOPTS = $(NJOBS) -w -u$(TEST_RESOURCES)
+TEST_EXCLUDES =
+# profile.py and pstats.py removed from sources
+TEST_EXCLUDES += test_pstats test_profile test_cprofile
+ifeq ($(on_buildd),yes)
+  TEST_EXCLUDES += test_tcl test_codecmaps_cn test_codecmaps_hk \
+        test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw \
+        test_normalization test_ossaudiodev
+endif
+ifeq (,$(wildcard /dev/dsp))
+  TEST_EXCLUDES += test_linuxaudiodev test_ossaudiodev
+endif
+ifneq (,$(filter $(DEB_HOST_ARCH), hppa))
+  TEST_EXCLUDES += test_fork1 test_multiprocessing test_socketserver test_threading test_wait3 test_wait4 test_gdb
+endif
+ifneq (,$(filter $(DEB_HOST_ARCH), arm avr32))
+  TEST_EXCLUDES += test_ctypes
+endif
+ifneq (,$(filter $(DEB_HOST_ARCH), arm armel avr32 m68k))
+  ifeq ($(on_buildd),yes)
+    TEST_EXCLUDES += test_compiler
+  endif
+endif
+ifneq (,$(filter $(DEB_HOST_ARCH), sparc sparc64))
+  TEST_EXCLUDES += test_gdb
+endif
+ifneq (,$(filter $(DEB_HOST_ARCH), hurd-i386))
+  TEST_EXCLUDES += test_imaplib test_io test_logging test_random test_signal test_socket test_socketserver test_ssl test_threading
+endif
+
+# in debug builds only
+TEST_EXCLUDES += test_gdb
+
+# for debug builds only
+TEST_EXCLUDES += test_gdb
+
+ifneq (,$(TEST_EXCLUDES))
+  TESTOPTS += -x $(sort $(TEST_EXCLUDES))
+endif
+
+ifneq (,$(wildcard /usr/bin/localedef))
+  SET_LOCPATH = LOCPATH=$(CURDIR)/locales
+endif
+
+stamps/stamp-check:
+ifeq ($(WITHOUT_CHECK),yes)
+	echo "check run disabled for this build" > $(buildd_static)/test_results
+else
+	: # build locales needed by the testsuite
+	rm -rf locales
+	mkdir locales
+	if which localedef >/dev/null 2>&1; then \
+	  sh debian/locale-gen; \
+	fi
+
+	@echo ========== test environment ============
+	@env
+	@echo ========================================
+
+  ifeq (,$(findstring $(DEB_HOST_ARCH), alpha))
+	( \
+	  echo '#! /bin/sh'; \
+	  echo 'set -x'; \
+	  echo 'export $(SET_LOCPATH)'; \
+	  echo '$(buildd_static)/python $(CURDIR)/debian/script.py test_results '\''make test TESTOPTS="$(filter-out test_gdb,$(TESTOPTS))"'\'; \
+	  echo 'echo DONE'; \
+	) > $(buildd_debug)/run_tests
+	chmod 755 $(buildd_debug)/run_tests
+	@echo "BEGIN test debug"
+	-cd $(buildd_debug) && time xvfb-run -a -e xvfb-run.log ./run_tests
+	@echo "END test debug"
+  endif
+
+	( \
+	  echo '#! /bin/sh'; \
+	  echo 'set -x'; \
+	  echo 'export $(SET_LOCPATH)'; \
+	  echo '$(buildd_static)/python $(CURDIR)/debian/script.py test_results '\''make test EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" TESTOPTS="$(TESTOPTS)"'\'; \
+	  echo 'echo DONE'; \
+	) > $(buildd_static)/run_tests
+	chmod 755 $(buildd_static)/run_tests
+	@echo "BEGIN test static"
+	-cd $(buildd_static) && time xvfb-run -a -e xvfb-run.log ./run_tests
+	@echo "END test static"
+
+	( \
+	  echo '#! /bin/sh'; \
+	  echo 'set -x'; \
+	  echo 'export $(SET_LOCPATH)'; \
+	  echo '$(buildd_static)/python $(CURDIR)/debian/script.py test_results '\''make test EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" TESTOPTS="$(TESTOPTS)"'\'; \
+	  echo 'echo DONE'; \
+	) > $(buildd_shared)/run_tests
+	chmod 755 $(buildd_shared)/run_tests
+	@echo "BEGIN test shared"
+	-cd $(buildd_shared) && time xvfb-run -a -e xvfb-run.log ./run_tests
+	@echo "END test shared"
+endif
+	cp -p $(buildd_static)/test_results debian/
+	touch stamps/stamp-check
+
+stamps/stamp-pystone:
+ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+	@echo "BEGIN pystone static"
+	cd $(buildd_static) && ./python ../Lib/test/pystone.py
+	cd $(buildd_static) && ./python ../Lib/test/pystone.py
+	@echo "END pystone static"
+	@echo "BEGIN pystone shared"
+	cd $(buildd_shared) \
+		&& LD_LIBRARY_PATH=. ./python ../Lib/test/pystone.py
+	cd $(buildd_shared) \
+		&& LD_LIBRARY_PATH=. ./python ../Lib/test/pystone.py
+	@echo "END pystone shared"
+	@echo "BEGIN pystone debug"
+	cd $(buildd_debug) && ./python ../Lib/test/pystone.py
+	cd $(buildd_debug) && ./python ../Lib/test/pystone.py
+	@echo "END pystone debug"
+endif
+	touch stamps/stamp-pystone
+
+stamps/stamp-pybench:
+	echo "pybench run disabled for this build" > $(buildd_static)/pybench.log
+
+#ifeq (,$(filter $(DEB_HOST_ARCH), arm armel avr32 hppa mips mipsel m68k))
+  pybench_options = -C 2 -n 5 -w 4
+#endif
+
+stamps/stamp-pybenchx:
+ifeq ($(WITHOUT_BENCH),yes)
+	echo "pybench run disabled for this build" > $(buildd_static)/pybench.log
+else
+	@echo "BEGIN pybench static"
+	cd $(buildd_static) \
+	  && time ./python ../Tools/pybench/pybench.py -f run1.pybench $(pybench_options)
+	cd $(buildd_static) \
+	  && ./python ../Tools/pybench/pybench.py -f run2.pybench -c run1.pybench $(pybench_options)
+	@echo "END pybench static"
+	@echo "BEGIN pybench shared"
+	cd $(buildd_shared) \
+	  && LD_LIBRARY_PATH=. ./python ../Tools/pybench/pybench.py -f run1.pybench $(pybench_options)
+	cd $(buildd_shared) \
+	  && LD_LIBRARY_PATH=. ./python ../Tools/pybench/pybench.py -f run2.pybench -c run1.pybench $(pybench_options)
+	@echo "END pybench shared"
+	@echo "BEGIN shared/static comparision"
+	$(buildd_static)/python Tools/pybench/pybench.py \
+	  -s $(buildd_static)/run2.pybench -c $(buildd_shared)/run2.pybench \
+	  | tee $(buildd_static)/pybench.log
+	@echo "END shared/static comparision"
+endif
+	touch stamps/stamp-pybench
+
+minimal-test:
+	rm -rf mintest
+	mkdir -p mintest/lib mintest/dynlib mintest/testlib mintest/all-lib
+	cp -p $(buildd_static)/python mintest/
+	cp -p $(foreach i,$(MIN_MODS),Lib/$(i).py) \
+		mintest/lib/
+	cp -a $(foreach i,$(MIN_PACKAGES),Lib/$(i)) \
+		mintest/lib/
+	cp -p $(wildcard $(foreach i,$(MIN_EXTS),$(buildd_static)/build/lib*/$(i).*.so)) \
+		mintest/dynlib/
+	cp -p Lib/unittest.py mintest/lib/
+	cp -pr Lib/test mintest/lib/
+	cp -pr Lib mintest/all-lib
+	cp -p $(buildd_static)/build/lib*/*.so mintest/all-lib/
+	( \
+	  echo "import sys"; \
+	  echo "sys.path = ["; \
+	  echo "    '$(CURDIR)/mintest/lib',"; \
+	  echo "    '$(CURDIR)/mintest/dynlib',"; \
+	  echo "]"; \
+	  cat Lib/test/regrtest.py; \
+	) > mintest/lib/test/mintest.py
+	cd mintest && ./python -E -S lib/test/mintest.py \
+	     -x test_codecencodings_cn test_codecencodings_hk \
+		test_codecencodings_jp test_codecencodings_kr \
+		test_codecencodings_tw test_codecs test_multibytecodec \
+
+stamps/stamp-doc-html:
+	dh_testdir
+	$(MAKE) -C Doc html
+	touch stamps/stamp-doc-html
+
+build-doc: stamps/stamp-patch stamps/stamp-build-doc
+stamps/stamp-build-doc: stamps/stamp-doc-html
+	touch stamps/stamp-build-doc
+
+control-file:
+	sed -e "s/@PVER@/$(PVER)/g" \
+	    -e "s/@VER@/$(VER)/g" \
+	    -e "s/@PYSTDDEP@/$(PYSTDDEP)/g" \
+	    -e "s/@PRIO@/$(PY_PRIO)/g" \
+	    -e "s/@MINPRIO@/$(PY_MINPRIO)/g" \
+		debian/control.in \
+		$(if $(with_udeb),debian/control.udeb) \
+		> debian/control.tmp
+ifeq ($(distribution),Ubuntu)
+  ifneq (,$(findstring ubuntu, $(PKGVERSION)))
+	m='Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>'; \
+	sed -i "/^Maintainer:/s/\(.*\)/Maintainer: $$m\nXSBC-Original-\1/" \
+	  debian/control.tmp
+  endif
+endif
+	[ -e debian/control ] \
+	  && cmp -s debian/control debian/control.tmp \
+	  && rm -f debian/control.tmp && exit 0; \
+	  mv debian/control.tmp debian/control
+
+
+
+clean: control-file
+	dh_testdir
+	dh_testroot
+	$(MAKE) -f debian/rules unpatch
+	rm -rf stamps .pc
+	rm -f debian/test_results
+
+	$(MAKE) -C Doc clean
+	sed 's/^@/#/' Makefile.pre.in | $(MAKE) -f - srcdir=. distclean
+	rm -rf $(buildd_static) $(buildd_shared) $(buildd_debug) $(buildd_shdebug)
+	find -name '*.py[co]' | xargs -r rm -f
+	rm -f Lib/lib2to3/*.pickle
+	rm -rf Lib/plat-$(DEB_HOST_MULTIARCH)
+	rm -rf locales
+	rm -rf $(d)-dbg
+
+	for f in debian/*.in; do \
+	  f2=`echo $$f | sed "s,PVER,$(PVER),g;s/@VER@/$(VER)/g;s,\.in$$,,"`; \
+	  if [ $$f2 != debian/control ] && [ $$f2 != debian/source.lintian-overrides ]; then \
+	    rm -f $$f2; \
+	  fi; \
+	done
+	dh_clean
+
+stamps/stamp-control:
+	: # We have to prepare the various control files
+
+	for f in debian/*.in; do \
+	  f2=`echo $$f | sed "s,PVER,$(PVER),g;s/@VER@/$(VER)/g;s,\.in$$,,"`; \
+	  if [ $$f2 != debian/control ]; then \
+	    sed -e "s/@PVER@/$(PVER)/g;s/@VER@/$(VER)/g;s/@SVER@/$(SVER)/g" \
+		    -e "s/@PRIORITY@/$(PRIORITY)/g" \
+		    -e "s,@SCRIPTDIR@,/$(scriptdir),g" \
+		    -e "s,@INFO@,$(info_docs),g" \
+		  <$$f >$$f2; \
+	  fi; \
+	done
+
+2to3-man:
+	help2man --no-info --version-string=$(VER) --no-discard-stderr \
+	  --name 'Python2 to Python3 converter' \
+	  2to3-$(VER) > debian/2to3-3.1
+	help2man --no-info --version-string=$(VER) --no-discard-stderr \
+	  --name 'pysetup tool' \
+	  pysetup$(VER) > debian/pysetup3.1
+	help2man --no-info --version-string=$(VER) --no-discard-stderr \
+	  --name 'create virtual python environments' \
+	  pyvenv-$(VER) > debian/pyvenv3.1
+
+install: build-arch stamps/stamp-install
+stamps/stamp-install: stamps/stamp-build control-file stamps/stamp-control
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	: # make install into tmp and subsequently move the files into
+	: # their packages' directories.
+	install -d $(d)/usr
+ifeq ($(with_interp),static)
+	$(MAKE) -C $(buildd_static) install prefix=$(CURDIR)/$(d)/usr
+	sed -e '/^OPT/s,-O3,-O2,' \
+	    -e 's/$(LTO_CFLAGS)//g' \
+	    -e 's,^RUNSHARED *=.*,RUNSHARED=,' \
+	    -e '/BLDLIBRARY/s/-L\. //' \
+		$(buildd_shared)/$(shell cat $(buildd_shared)/pybuilddir.txt)/_sysconfigdata.py \
+		> $(d)/$(scriptdir)/_sysconfigdata.py
+else
+	$(MAKE) -C $(buildd_shared) install prefix=$(CURDIR)/$(d)/usr
+endif
+	mv $(d)/usr/bin/python-config.sh $(d)/usr/bin/python$(VER)m-config
+	rm -f $(d)/$(scriptdir)/lib-dynload/*.py
+	sed -i 's/ -O3 / -O2 /g;s/$(LTO_CFLAGS)//g;s/-fprofile-use *-fprofile-correction//g' \
+		$(d)/$(scriptdir)/_sysconfigdata.py
+	mv $(d)/$(scriptdir)/_sysconfigdata.py \
+	  $(d)/$(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/_sysconfigdata_m.py
+	cp -p debian/_sysconfigdata.py $(d)/$(scriptdir)/
+
+	-find $(d)/usr/lib/python$(VER) -name '*_failed*.so'
+	find $(d)/usr/lib/python$(VER) -name '*_failed*.so' | xargs -r rm -f
+
+	for i in $(d)/$(scriptdir)/lib-dynload/*.so; do \
+	  b=$$(basename $$i .cpython-33m.so); \
+	  d=$${b}.cpython-33m-$(DEB_HOST_MULTIARCH).so; \
+	  mv $$i $(d)/$(scriptdir)/lib-dynload/$$d; \
+	done
+
+	mv $(d)/usr/lib/libpython*.a $(d)/usr/lib/$(DEB_HOST_MULTIARCH)/
+
+	mkdir -p $(d)/usr/lib/python3
+	mv $(d)/usr/lib/python$(VER)/site-packages \
+		$(d)/usr/lib/python3/dist-packages
+	rm -f $(d)/usr/lib/python3/dist-packages/README
+
+	: # remove files, which are not packaged
+	rm -rf $(d)/usr/lib/python$(VER)/ctypes/macholib
+	rm -f $(d)/$(scriptdir)/plat-*/regen
+	rm -f $(d)/$(scriptdir)/lib2to3/*.pickle
+
+	: # cannot build it, zlib maintainer won't provide a mingw build
+	find $(d) -name 'wininst*.exe' | xargs -r rm -f
+
+	: # fix some file permissions
+	chmod a-x $(d)/$(scriptdir)/{runpy,fractions,lib2to3/refactor,tkinter/tix}.py
+
+#	: # move manpages to new names
+#	if [ -d $(d)/usr/man/man1 ]; then \
+#	    mkdir -p $(d)/usr/share/man
+#	    mv $(d)/usr/man/man1/* $(d)/usr/share/man/man1/; \
+#	    rm -rf $(d)/usr/man/; \
+#	fi
+
+	mkdir -p $(d)/usr/share/man/man1
+	cp -p Misc/python.man $(d)/usr/share/man/man1/python$(VER).1
+	ln -sf python$(VER).1 $(d)/usr/share/man/man1/python$(VER)m.1
+	cp -p debian/pydoc.1 $(d)/usr/share/man/man1/pydoc$(VER).1
+
+	: # Symlinks to /usr/bin for some tools
+	ln -sf ../lib/python$(VER)/pdb.py $(d)/usr/bin/pdb$(VER)
+	cp -p debian/pdb.1 $(d)/usr/share/man/man1/pdb$(VER).1
+	cp -p debian/2to3-3.1 $(d)/usr/share/man/man1/2to3-$(VER).1
+	cp -p debian/pysetup3.1 $(d)/usr/share/man/man1/pysetup$(VER).1
+	cp -p debian/pyvenv3.1 $(d)/usr/share/man/man1/pyvenv-$(VER).1
+
+	: # versioned install only
+	rm -f $(d)/usr/bin/{2to3,idle3,pydoc3,pysetup3,python3,python3-config}
+	rm -f $(d)/usr/lib/*/pkgconfig/python3.pc
+
+	dh_installdirs -p$(p_lib) \
+		usr/lib/$(DEB_HOST_MULTIARCH) \
+		$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH) \
+		usr/share/doc
+	: # install the shared library
+	cp -p $(buildd_shared)/libpython$(VER)m.so.1.0 \
+		$(d_lib)/usr/lib/$(DEB_HOST_MULTIARCH)/
+	dh_link -p$(p_lib) \
+	    /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so.1.0 \
+		/usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so.1 \
+	    /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so.1 \
+		/$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so \
+	    /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so.1 \
+		/$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/libpython$(VER).so
+
+	ln -sf $(p_base) $(d_lib)/usr/share/doc/$(p_lib)
+
+	ln -sf libpython$(VER)m.so.1 $(d)/usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so
+
+ifeq ($(with_interp),shared)
+	: # install the statically linked runtime
+	install -m755 $(buildd_static)/python $(d)/usr/bin/python$(VER)-static
+endif
+
+	cp -p Tools/i18n/pygettext.py $(d)/usr/bin/pygettext$(VER)
+	cp -p debian/pygettext.1 $(d)/usr/share/man/man1/pygettext$(VER).1
+
+	: # install the Makefile of the shared python build
+	sed -e '/^OPT/s,-O3,-O2,' \
+	    -e 's/$(LTO_CFLAGS)//g' \
+	    -e 's,^RUNSHARED *=.*,RUNSHARED=,' \
+	    -e '/BLDLIBRARY/s/-L\. //' \
+		$(buildd_shared)/Makefile \
+		> $(d)/$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/Makefile
+
+	: # Move the the minimal libraries into $(p_lmin).
+	dh_installdirs -p$(p_lmin) \
+		etc/$(PVER) \
+		usr/bin \
+		usr/share/man/man1 \
+		$(scriptdir)/lib-dynload
+	-cd $(d); for i in $(MIN_EXTS); do \
+			test -e $(scriptdir)/lib-dynload/$$i.*.so \
+			  && echo $(scriptdir)/lib-dynload/$$i.*.so; \
+		  done
+
+	DH_COMPAT=2 dh_movefiles -p$(p_lmin) --sourcedir=$(d) \
+		$(foreach i,$(MIN_MODS),$(scriptdir)/$(i).py) \
+		$(foreach i,$(MIN_PACKAGES),$(scriptdir)/$(i)) \
+		$(foreach i,$(MIN_ENCODINGS),$(scriptdir)/$(i)) \
+		$(scriptdir)/site.py \
+		$(scriptdir)/_sysconfigdata.py \
+		$(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/_sysconfigdata_m.py \
+		$(shell cd $(d); for i in $(MIN_EXTS); do \
+			test -e $(scriptdir)/lib-dynload/$$i.*.so \
+			  && echo $(scriptdir)/lib-dynload/$$i.*.so; \
+		  done)
+	ls -l  $(d_lmin)/$(scriptdir)/lib-dynload
+	rm -rf $(d_lmin)/$(scriptdir)/importlib/test
+
+	: # Move the binary and the minimal libraries into $(p_min).
+	dh_installdirs -p$(p_min) \
+		usr/bin \
+		usr/share/man/man1
+	DH_COMPAT=2 dh_movefiles -p$(p_min) --sourcedir=$(d) \
+		usr/bin/python$(VER) \
+		usr/bin/python$(VER)m \
+		usr/share/man/man1/python$(VER).1 \
+		usr/share/man/man1/python$(VER)m.1
+
+	rv=0; \
+	for i in $(MIN_EXTS); do \
+	  if [ -f $(d)/$(scriptdir)/lib-dynload/$$i.so ]; then \
+	    echo >&2 "extension $$i not mentioned in Setup.dist"; \
+	    rv=1; \
+	  fi; \
+	done; \
+	exit $$rv;
+
+	: # Install sitecustomize.py
+	cp -p debian/sitecustomize.py $(d_lmin)/etc/$(PVER)/
+	dh_link -p$(p_lmin) \
+		/etc/$(PVER)/sitecustomize.py /$(scriptdir)/sitecustomize.py
+
+	: # Move the static library and the header files into $(p_dev).
+#	mv $(d)/usr/share/include/python$(VER)/* $(d)/usr/include/python$(VER)/.
+#	rm -rf $(d)/usr/share/include
+
+	cp $(d)/usr/bin/$(PVER)m-config $(d)/usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)m-config
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config $(d)/usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)-config
+
+	dh_installdirs -p$(p_ldev) \
+		usr/bin \
+		$(scriptdir) \
+		usr/include \
+		usr/share/man/man1
+
+	DH_COMPAT=2 dh_movefiles -p$(p_ldev) --sourcedir=$(d) \
+		usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)*-config \
+		usr/lib/python$(VER)/config-$(VER)m-$(DEB_HOST_MULTIARCH) \
+		usr/include \
+		usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.{a,so} \
+		usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER)*.pc \
+		usr/lib/python$(VER)/distutils/command/wininst-*.exe
+
+#	sed 's/@subdir@/$(PVER)m/;s/@header@/pyconfig.h/' \
+#		debian/multiarch.h.in > $(d_ldev)/usr/include/$(PVER)m/pyconfig.h
+
+	sed -i '/^Cflags:/s,$$, -I$${includedir}/$(DEB_HOST_MULTIARCH)/python$(VER)m,' \
+		$(d_ldev)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER).pc
+
+	dh_link -p$(p_ldev) \
+	    /usr/lib/$(PVER)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/libpython$(VER)m.a \
+		/usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.a
+
+	cp -p $(buildd_shared)/libpython$(VER)m-pic.a \
+		$(d_ldev)/usr/lib/python$(VER)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/
+
+	: # symlinks for the "old" include directory name
+	ln -sf python$(VER)m $(d_ldev)/usr/include/python$(VER)
+
+	dh_installdirs -p$(p_dev) \
+		usr/share/doc/python$(VER) \
+		usr/share/man/man1 \
+		$(scriptdir) \
+		$(scriptdir)/doc/html
+	cp -p Misc/HISTORY Misc/README.valgrind Misc/gdbinit \
+		debian/README.maintainers \
+		debian/test_results $(buildd_static)/pybench.log \
+	    $(d_dev)/usr/share/doc/python$(VER)/
+
+	DH_COMPAT=2 dh_movefiles -p$(p_dev) --sourcedir=$(d) \
+		usr/bin/python$(VER)*-config
+
+	: # in $(p_ldev), prefix python-config with triplets
+	cp -p debian/python3-config.1 \
+		$(d_ldev)/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-$(PVER)m-config.1
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config.1.gz \
+		$(d_ldev)/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz
+ifneq ($(DEB_HOST_MULTIARCH),$(DEB_HOST_GNU_TYPE))
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config \
+		$(d_ldev)/usr/bin/$(DEB_HOST_GNU_TYPE)-$(PVER)m-config
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config \
+		$(d_ldev)/usr/bin/$(DEB_HOST_GNU_TYPE)-$(PVER)-config
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz \
+		$(d_ldev)/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-$(PVER)-config.1.gz
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz \
+		$(d_ldev)/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-$(PVER)m-config.1.gz
+endif
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config $(d_dev)/usr/bin/$(PVER)m-config
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config.1.gz $(d_dev)/usr/share/man/man1/$(PVER)m-config.1.gz
+
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config $(d_dev)/usr/bin/$(PVER)-config
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz $(d_dev)/usr/share/man/man1/$(PVER)-config.1.gz
+
+ifeq ($(with_tk),yes)
+	: # Move the Tkinter files into $(p_tk).
+	dh_installdirs -p$(p_tk) \
+		$(scriptdir) \
+		usr/lib/python$(VER)/lib-dynload
+	DH_COMPAT=2 dh_movefiles -p$(p_tk) --sourcedir=$(d) \
+		usr/lib/python$(VER)/lib-dynload/_tkinter*.so
+endif
+
+#	: # The test framework into $(p_base), regression tests dropped
+	DH_COMPAT=2 dh_movefiles -p$(p_base) --sourcedir=$(d) \
+		$(scriptdir)/test/{regrtest.py,support.py,__init__.py,pystone.py}
+	rm -rf $(d)/$(scriptdir)/test
+	rm -rf $(d)/$(scriptdir)/ctypes/test
+	rm -rf $(d)/$(scriptdir)/bsddb/test
+	rm -rf $(d)/$(scriptdir)/distutils/tests
+	rm -rf $(d)/$(scriptdir)/email/test
+	rm -rf $(d)/$(scriptdir)/importlib/test
+	rm -rf $(d)/$(scriptdir)/json/tests
+	rm -rf $(d)/$(scriptdir)/lib2to3/tests
+	rm -rf $(d)/$(scriptdir)/sqlite3/test
+	rm -rf $(d)/$(scriptdir)/packaging/tests
+	rm -rf $(d)/$(scriptdir)/tkinter/test
+	rm -rf $(d)/$(scriptdir)/unittest/test
+
+	: # IDLE
+	mv $(d)/usr/bin/idle$(VER) $(d)/usr/bin/idle-python$(VER)
+	rm -f $(d)/usr/lib/python$(VER)/idlelib/idle.bat
+	dh_installdirs -p$(p_idle) \
+		usr/bin \
+		usr/share/man/man1
+	DH_COMPAT=2 dh_movefiles -p$(p_idle) --sourcedir=$(d) \
+		usr/bin/idle-python$(VER)
+	cp -p debian/idle-$(PVER).1 $(d_idle)/usr/share/man/man1/
+
+	: # Move the demos and tools into $(p_exam)'s doc directory
+	dh_installdirs -p$(p_exam) \
+		usr/share/doc/python$(VER)/examples
+
+	cp -rp Tools/* $(d_exam)/usr/share/doc/python$(VER)/examples/
+	rm -rf $(d_exam)/usr/share/doc/python$(VER)/examples/Tools/{buildbot,msi}
+	: # XXX: We don't need rgb.txt, we'll use our own:
+	rm -rf $(d_exam)/usr/share/doc/python$(VER)/examples/Tools/pynche/X
+
+	: # Replace all '#!' calls to python with $(PY_INTERPRETER)
+	: # and make them executable
+	for i in `find debian -mindepth 3 -type f ! -name '*.dpatch'`; do \
+	  sed '1s,#!.*python[^ ]*\(.*\),#! $(PY_INTERPRETER)\1,' \
+		$$i > $$i.temp; \
+	  if cmp --quiet $$i $$i.temp; then \
+	    rm -f $$i.temp; \
+	  else \
+	    mv -f $$i.temp $$i; \
+	    chmod 755 $$i; \
+	    echo "fixed interpreter: $$i"; \
+	  fi; \
+	done
+
+	: # Move the docs into $(p_base)'s /usr/share/doc/$(PVER) directory,
+	: # all other packages only have a copyright file.
+	dh_installdocs -p$(p_base) \
+		README Misc/NEWS Misc/ACKS
+	ln -sf NEWS.gz $(d_base)/usr/share/doc/$(p_base)/changelog.gz
+	dh_installdocs --all -N$(p_base) -N$(p_dev) -N$(p_dbg) -N$(p_lib) debian/README.Debian
+
+	: # IDLE has its own changelogs, docs...
+	dh_installchangelogs -p$(p_idle) Lib/idlelib/ChangeLog
+	dh_installdocs -p$(p_idle) Lib/idlelib/{NEWS,README,TODO,extend}.txt
+
+	mkdir -p $(d_idle)/usr/share/applications
+	cp -p debian/idle.desktop \
+		$(d_idle)/usr/share/applications/idle-$(PVER).desktop
+
+	: # those packages have own README.Debian's
+	install -m 644 -p debian/README.$(p_base) \
+		$(d_base)/usr/share/doc/$(PVER)/README.Debian
+	install -m 644 -p debian/README.$(p_idle) \
+		$(d_idle)/usr/share/doc/$(p_idle)/README.Debian
+ifeq ($(with_tk),yes)
+	cp -p debian/README.Tk $(d_tk)/usr/share/doc/$(p_tk)/
+endif
+
+	: # library files into $(p_lbase)
+	dh_installdirs -p$(p_lbase) \
+		usr/lib
+	dh_movefiles -p$(p_lbase) \
+		usr/lib/python$(VER)
+
+	: # The rest goes into $(p_base)
+	mkdir -p $(d)/usr/lib/python3/dist-packages
+	(cd $(d) && tar cf - .) | (cd $(d_base) && tar xpf -)
+	rm -f $(d_base)/usr/bin/python
+	rm -f $(d_base)/usr/bin/pyvenv
+
+	: # Install menu icon
+	dh_installdirs -p$(p_base) usr/share/pixmaps
+	cp -p debian/pylogo.xpm $(d_base)/usr/share/pixmaps/$(PVER).xpm
+
+	: # generate binfmt file
+	mkdir -p $(d_min)/usr/share/binfmts
+ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+	$(buildd_static)/python debian/mkbinfmt.py $(PVER) \
+		> $(d_min)/usr/share/binfmts/$(PVER)
+else
+	$(PVER) debian/mkbinfmt.py $(PVER) > $(d_min)/usr/share/binfmts/$(PVER)
+endif
+
+	: # desktop entry
+	mkdir -p $(d_base)/usr/share/applications
+	cp -p debian/$(PVER).desktop \
+		$(d_base)/usr/share/applications/$(PVER).desktop
+
+	: # remove some things
+	-find debian -name .cvsignore | xargs rm -f
+	-find debian -name '*.py[co]' | xargs rm -f
+
+	: # remove empty directories, when all components are in place
+	-find debian ! -name lib-dynload ! -name dist-packages -type d -empty -delete
+
+	: # install debug package
+	rm -rf $(d)-dbg
+	$(MAKE) -C $(buildd_debug) install DESTDIR=$(CURDIR)/$(d)-dbg
+	: # install the Makefile of the shared python debug build
+	sed -e '/^OPT/s,-O3,-O2,' \
+	    -e 's/$(LTO_CFLAGS)//g' \
+	    -e 's,^RUNSHARED *=.*,RUNSHARED=,' \
+	    -e '/BLDLIBRARY/s/-L\. //' \
+		$(buildd_shdebug)/Makefile \
+		> $(d)-dbg/$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH)/Makefile
+	sed -e 's,^RUNSHARED *=.*,RUNSHARED=,' \
+	    -e '/BLDLIBRARY/s/-L\. //' \
+		$(buildd_shdebug)/$(shell cat $(buildd_shdebug)/pybuilddir.txt)/_sysconfigdata.py \
+		> $(d)-dbg/$(scriptdir)/_sysconfigdata.py
+	rm -f $(d)-dbg/$(scriptdir)/lib-dynload/_sysconfigdata.py
+	sed -i 's/ -O3 / -O2 /g;s/$(LTO_CFLAGS)//g;s/-fprofile-use *-fprofile-correction//g' \
+		$(d)-dbg/$(scriptdir)/_sysconfigdata.py
+	mv $(d)-dbg/$(scriptdir)/_sysconfigdata.py \
+	  $(d)-dbg/$(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/_sysconfigdata_dm.py
+
+	mv $(d)-dbg/usr/lib/libpython*.a $(d)-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/
+
+	for i in $(d)-dbg/$(scriptdir)/lib-dynload/*.so; do \
+	  b=$$(basename $$i .cpython-33dm.so); \
+	  d=$${b}.cpython-33dm-$(DEB_HOST_MULTIARCH).so; \
+	  mv $$i $(d)-dbg/$(scriptdir)/lib-dynload/$$d; \
+	done
+
+	dh_installdirs -p$(p_ldbg) \
+		usr/bin \
+		usr/share/man/man1 \
+		$(scriptdir)/lib-dynload \
+		$(scriptdir)/plat-$(DEB_HOST_MULTIARCH) \
+		usr/include/$(PVER)dm \
+		usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)dm \
+		usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
+
+	cp -p $(d)-dbg/$(scriptdir)/lib-dynload/*.so \
+		$(d_ldbg)/$(scriptdir)/lib-dynload/
+	cp -p $(d)-dbg/$(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/_sysconfigdata_dm.py \
+		$(d_ldbg)/$(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/
+	cp -p $(buildd_shdebug)/libpython$(VER)dm.so.1.0 \
+		$(d_ldbg)/usr/lib/$(DEB_HOST_MULTIARCH)/
+	dh_link -p$(p_ldbg) \
+	    /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so.1.0 \
+		/usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so.1 \
+	    /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so.1 \
+		/usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so
+	sed -e '/^Libs:/s,-lpython$(VER),-lpython$(VER)dm,' \
+	  -e '/^Cflags:/s,$$, -I$${includedir}/$(DEB_HOST_MULTIARCH)/python$(VER)dm,' \
+	  $(d)-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER).pc \
+	  > $(d_ldbg)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER)-dbg.pc
+
+	dh_installdirs -p$(p_dbg) \
+		usr/bin \
+		usr/share/man/man1 \
+		usr/share/doc/$(p_base)
+	cp -p Misc/SpecialBuilds.txt $(d_dbg)/usr/share/doc/$(p_base)/
+	cp -p debian/$(PVER)-dbg.README.Debian \
+		$(d_dbg)/usr/share/doc/$(p_base)/README.debug
+	cp -p $(buildd_debug)/python $(d_dbg)/usr/bin/$(PVER)dm
+	ln -sf python$(VER)dm $(d_dbg)/usr/bin/$(PVER)-dbg
+
+ifneq ($(with_tk),yes)
+	rm -f $(d_ldbg)/$(scriptdir)/lib-dynload/_tkinter*.so
+	rm -f $(d_ldbg)/usr/lib/debug/$(scriptdir)/lib-dynload/_tkinter*.so
+endif
+ifneq ($(with_gdbm),yes)
+	rm -f $(d_ldbg)/$(scriptdir)/lib-dynload/_gdbm*.so
+	rm -f $(d_ldbg)/usr/lib/debug/$(scriptdir)/lib-dynload/_gdbm*.so
+endif
+
+	cp -a $(d)-dbg/$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH) \
+		$(d_ldbg)/$(scriptdir)/
+	dh_link -p$(p_ldbg) \
+	    /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so \
+		/$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so \
+	    /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so \
+		/$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH)/libpython$(VER).so \
+	    /$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.a \
+	    	/usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.a
+
+	for i in $(d_ldev)/usr/include/$(PVER)m/*; do \
+	  i=$$(basename $$i); \
+	  case $$i in pyconfig.h) continue; esac; \
+	  ln -sf ../$(PVER)m/$$i $(d_ldbg)/usr/include/$(PVER)dm/$$i; \
+	done
+	cp -p $(buildd_debug)/pyconfig.h $(d_ldbg)/usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)dm/
+#	sed 's/@subdir@/$(PVER)dm/;s/@header@/pyconfig.h/' \
+#		debian/multiarch.h.in > $(d_ldbg)/usr/include/$(PVER)dm/pyconfig.h
+
+	ln -sf $(PVER).1.gz $(d_dbg)/usr/share/man/man1/$(PVER)-dbg.1.gz
+
+	: # in $(p_ldbg), prefix python-config with triplets
+	cp $(d)-dbg/usr/bin/python-config.sh \
+		$(d_ldbg)/usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)dm-config
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config \
+		$(d_ldbg)/usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)-dbg-config
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config.1.gz \
+		$(d_ldbg)/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-$(PVER)dm-config.1.gz
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config.1.gz \
+		$(d_ldbg)/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-$(PVER)-dbg-config.1.gz
+ifneq ($(DEB_HOST_MULTIARCH),$(DEB_HOST_GNU_TYPE))
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config \
+		$(d_ldbg)/usr/bin/$(DEB_HOST_GNU_TYPE)-$(PVER)dm-config
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz \
+		$(d_ldbg)/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-$(PVER)dm-config.1.gz
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config \
+		$(d_ldbg)/usr/bin/$(DEB_HOST_GNU_TYPE)-$(PVER)-dbg-config
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config.1.gz \
+		$(d_ldbg)/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-$(PVER)-dbg-config.1.gz
+endif
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config $(d_dbg)/usr/bin/$(PVER)dm-config
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config.1.gz $(d_dbg)/usr/share/man/man1/$(PVER)dm-config.1.gz
+
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-dbg-config $(d_dbg)/usr/bin/$(PVER)-dbg-config
+	ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-dbg-config.1.gz $(d_dbg)/usr/share/man/man1/$(PVER)-dbg-config.1.gz
+
+	: # symlinks for the "old" include / config directory names
+	ln -sf $(PVER)-config.1.gz $(d_dbg)/usr/share/man/man1/$(PVER)-dbg-config.1.gz
+	ln -sf $(PVER).1.gz $(d_dbg)/usr/share/man/man1/$(PVER)dm.1.gz
+	ln -sf $(PVER)-config.1.gz $(d_dbg)/usr/share/man/man1/$(PVER)dm-config.1.gz
+
+ifeq ($(with_udeb),yes)
+	: # Copy the most important files from $(p_min) into $(p_udeb).
+	dh_installdirs -p$(p_udeb) \
+		etc/$(PVER) \
+		usr/bin \
+		usr/include/$(PVER)mu \
+		$(scriptdir)/lib-dynload \
+		$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)
+	cp -p $(d_min)/usr/bin/python$(VER) $(d_udeb)/usr/bin/
+	ln -sf python$(VER)mu $(d_udeb)/usr/bin/python$(VER)
+	ln -sf python$(VER) $(d_udeb)/usr/bin/python3
+	cp -p $(foreach i,$(MIN_MODS),$(d_min)/$(scriptdir)/$(i).py) \
+		$(d_udeb)/$(scriptdir)/
+	cp -a $(foreach i,$(MIN_PACKAGES),$(d_min)/$(scriptdir)/$(i)) \
+		$(d_udeb)/$(scriptdir)/
+	cp -p $(foreach i,$(MIN_ENCODINGS),$(d_min)/$(scriptdir)/$(i)) \
+		$(d_udeb)/$(scriptdir)/
+	cp -p $(d_min)/$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/Makefile \
+		$(d_udeb)/$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/
+	cp -p $(d_min)/usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)m/pyconfig.h \
+		$(d_udeb)/usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)m/
+	cp -p $(d_min)/$(scriptdir)/site.py $(d_udeb)/$(scriptdir)/
+	cp -p debian/sitecustomize.py $(d_udeb)/etc/$(PVER)/
+	dh_link -p$(p_udeb) /etc/$(PVER)/sitecustomize.py \
+		/$(scriptdir)/sitecustomize.py
+endif
+
+	for i in debian/*.overrides; do \
+	  b=$$(basename $$i .overrides); \
+	  install -D -m 644 $$i debian/$$b/usr/share/lintian/overrides/$$b; \
+	done
+
+	touch stamps/stamp-install
+
+# Build architecture-independent files here.
+binary-indep: build-indep install stamps/stamp-control
+	dh_testdir -i
+	dh_testroot -i
+
+	: # $(p_doc) package
+	dh_installdirs -p$(p_doc) \
+		usr/share/doc/$(p_base) \
+		usr/share/doc/$(p_doc)
+	dh_installdocs -p$(p_doc)
+	cp -a Doc/build/html $(d_doc)/usr/share/doc/$(p_base)/
+	rm -f $(d_doc)/usr/share/doc/$(p_base)/html/_static/jquery.js
+	dh_link -p$(p_doc) \
+		/usr/share/doc/$(p_base)/html /usr/share/doc/$(p_doc)/html \
+		/usr/share/javascript/jquery/jquery.js /usr/share/doc/$(p_base)/html/_static/jquery.js \
+		/usr/share/javascript/underscore/underscore.js /usr/share/doc/$(p_base)/html/_static/underscore.js
+
+	: # devhelp docs
+	cd $(buildd_static) && ./python ../debian/pyhtml2devhelp.py \
+		../$(d_doc)/usr/share/doc/$(p_base)/html index.html $(VER) \
+		> ../$(d_doc)/usr/share/doc/$(p_base)/html/$(PVER).devhelp
+	gzip -9v $(d_doc)/usr/share/doc/$(p_base)/html/$(PVER).devhelp
+	dh_link -p$(p_doc) \
+		/usr/share/doc/$(p_base)/html /usr/share/devhelp/books/$(PVER)
+
+	dh_installdebconf -i $(dh_args)
+	dh_installexamples -i $(dh_args)
+	dh_installmenu -i $(dh_args)
+	-dh_icons -i $(dh_args) || dh_iconcache -i $(dh_args)
+	dh_installchangelogs -i $(dh_args)
+	dh_link -i $(dh_args)
+	dh_compress -i $(dh_args) -X.py -X.cls -X.css -X.txt -X.json -X.js -Xobjects.inv -Xgdbinit
+	dh_fixperms -i $(dh_args)
+
+	: # make python scripts starting with '#!' executable
+	for i in `find debian -mindepth 3 -type f ! -name '*.dpatch' ! -perm 755`; do \
+	  if head -1 $$i | grep -q '^#!'; then \
+	    chmod 755 $$i; \
+	    echo "make executable: $$i"; \
+	  fi; \
+	done
+	-find $(d_doc) -name '*.txt' -perm 755 -exec chmod 644 {} \;
+
+	dh_installdeb -i $(dh_args)
+	dh_gencontrol -i $(dh_args)
+	dh_md5sums -i $(dh_args)
+	dh_builddeb -i $(dh_args)
+
+# Build architecture-dependent files here.
+binary-arch: build-arch install
+	dh_testdir -a
+	dh_testroot -a
+#	dh_installdebconf -a
+	dh_installexamples -a
+	dh_installmenu -a
+	-dh_icons -a || dh_iconcache -a
+#	dh_installmime -a
+	dh_installchangelogs -a
+	for i in $(p_dev) $(p_dbg); do \
+	  rm -rf debian/$$i/usr/share/doc/$$i; \
+	  ln -s $(p_base) debian/$$i/usr/share/doc/$$i; \
+	done
+	for i in $(p_lbase); do \
+	  rm -rf debian/$$i/usr/share/doc/$$i; \
+	  ln -s $(p_lmin) debian/$$i/usr/share/doc/$$i; \
+	done
+	for i in $(p_ldev) $(p_ldbg) $(p_lib); do \
+	  rm -rf debian/$$i/usr/share/doc/$$i; \
+	  ln -s $(p_lbase) debian/$$i/usr/share/doc/$$i; \
+	done
+	-find debian ! -perm -200 -print -exec chmod +w {} \;
+ifneq ($(with_tk),yes)
+	rm -f $(d_lbase)/$(scriptdir)/lib-dynload/_tkinter*.so
+endif
+ifneq ($(with_gdbm),yes)
+	rm -f $(d_lbase)/$(scriptdir)/lib-dynload/_gdbm*.so
+endif
+
+	dh_strip -a -N$(p_dbg) -Xdebug -Xdbg --dbg-package=$(p_dbg)
+	cp Tools/gdb/libpython.py $(d_dbg)/usr/lib/debug/usr/bin/$(PVER)m-gdb.py
+	ln -sf $(PVER)m-gdb.py $(d_dbg)/usr/lib/debug/usr/bin/$(PVER)dm-gdb.py
+	ln -sf $(PVER)m-gdb.py $(d_dbg)/usr/lib/debug/usr/bin/$(PVER)-dbg-gdb.py
+	ln -sf ../bin/$(PVER)m-gdb.py \
+		$(d_dbg)/usr/lib/debug/usr/lib/lib$(PVER)m.so.1.0-gdb.py
+	ln -sf ../bin/$(PVER)m-gdb.py \
+		$(d_dbg)/usr/lib/lib$(PVER)dm.so.1.0-gdb.py
+	dh_link -a
+	dh_compress -a -X.py
+	dh_fixperms -a
+	chmod 644 $(d_lmin)/$(scriptdir)/token.py
+
+	: # make python scripts starting with '#!' executable
+	for i in `find debian -mindepth 3 -type f ! -name '*.dpatch' ! -perm 755`; do \
+	  if head -1 $$i | grep -q '^#!'; then \
+	    chmod 755 $$i; \
+	    echo "make executable: $$i"; \
+	  fi; \
+	done
+
+	dh_makeshlibs -p$(p_lib) -V '$(p_lib)'
+	dh_makeshlibs -p$(p_ldbg) -V '$(p_ldbg)'
+# don't include the following symbols, found in extensions
+# which either can be built as builtin or extension.
+	sed -ri \
+	  -e '/^ (PyInit_|_add_one_to_index|asdl_)/d' \
+	  -e '/^ (PyExpat_XML_|PyExpat_Xml)/d' \
+	  -e '/^ (ffi_type_|_ctypes_)/d' \
+	    $(d_lib)/DEBIAN/symbols $(d_ldbg)/DEBIAN/symbols
+	dh_installdeb -a
+	dh_shlibdeps -a
+	dh_gencontrol -a
+	dh_md5sums -a
+	dh_builddeb -a
+
+# rules to patch the unpacked files in the source directory
+# ---------------------------------------------------------------------------
+# various rules to unpack addons and (un)apply patches.
+# 	- patch / apply-patches
+#	- unpatch / reverse-patches
+
+patchdir	= debian/patches
+
+glibc_version := $(shell dpkg -s locales | awk '/^Version:/ {print $$2}')
+broken_utimes := $(shell dpkg --compare-versions $(glibc_version) lt 2.3.5 && echo yes || echo no)
+old_sphinx := $(shell dpkg --compare-versions $$(dpkg -l python-sphinx | awk '/^ii *python-sphinx/ {print $$3}') lt 1 && echo yes || echo no)
+
+$(patchdir)/series: $(patchdir)/series.in
+	cpp -E \
+	  -D$(distribution) \
+	  $(if $(filter $(broken_utimes),yes),-DBROKEN_UTIMES) \
+	  $(if $(filter $(old_sphinx),yes),-DOLD_SPHINX) \
+	  -Darch_os_$(DEB_HOST_ARCH_OS) -Darch_$(DEB_HOST_ARCH) \
+	  -o - $(patchdir)/series.in \
+	  | egrep -v '^(#.*|$$)' > $(patchdir)/series
+
+patch-stamp: stamps/stamp-patch
+patch: stamps/stamp-patch
+stamps/stamp-patch: $(patchdir)/series
+	dh_testdir
+	QUILT_PATCHES=$(patchdir) quilt push -a || test $$? = 2
+	rm -rf autom4te.cache configure
+	autoconf
+	mkdir -p stamps
+	echo ""; echo "Patches applied in this version:" > stamps/pxx
+	for i in $$(cat $(patchdir)/series); do \
+	  echo ""; echo "$$i:"; \
+	  sed -n 's/^# *DP: */  /p' $(patchdir)/$$i; \
+	done >> stamps/pxx
+
+	touch Parser/acceler.c Parser/grammar1.c Parser/listnode.c \
+	  Parser/node.c Parser/parser.c Parser/bitset.c Parser/metagrammar.c \
+	  Parser/firstsets.c Parser/grammar.c Parser/pgen.c
+	touch Objects/obmalloc.c Python/dynamic_annotations.c \
+	  Python/mysnprintf.c Python/pyctype.c Parser/tokenizer_pgen.c \
+	  Parser/printgrammar.c Parser/parsetok_pgen.c Parser/pgenmain.c
+	@sleep 1
+	touch Grammar/Grammar 
+	@sleep 1
+	touch Include/graminit.h
+	@sleep 1
+	touch Python/graminit.c
+
+	mv stamps/pxx $@
+
+reverse-patches: unpatch
+unpatch:
+	QUILT_PATCHES=$(patchdir) quilt pop -a -R || test $$? = 2
+	rm -f stamps/stamp-patch $(patchdir)/series
+	rm -rf configure autom4te.cache
+
+update-patches: $(patchdir)/series
+	export QUILT_PATCHES=$(patchdir); \
+	export QUILT_REFRESH_ARGS="--no-timestamps --no-index -pab"; \
+	export QUILT_DIFF_ARGS="--no-timestamps --no-index -pab"; \
+	while quilt push; do quilt refresh; done
+
+binary: binary-indep binary-arch
+
+.PHONY: control-file configure build clean binary-indep binary-arch binary install
+
+# Local Variables:
+# mode: makefile
+# end:
--- python3.3-3.3.0.orig/debian/README.Tk
+++ python3.3-3.3.0/debian/README.Tk
@@ -0,0 +1,8 @@
+Tkinter documentation can be found at
+
+    http://www.pythonware.com/library/index.htm
+
+more specific:
+
+    http://www.pythonware.com/library/tkinter/introduction/index.htm
+    http://www.pythonware.com/library/tkinter/an-introduction-to-tkinter.pdf
--- python3.3-3.3.0.orig/debian/libPVER-dbg.overrides.in
+++ python3.3-3.3.0/debian/libPVER-dbg.overrides.in
@@ -0,0 +1,13 @@
+lib@PVER@-dbg binary: package-name-doesnt-match-sonames
+lib@PVER@-dbg binary: non-dev-pkg-with-shlib-symlink
+
+# no, it's not unusual
+lib@PVER@-dbg binary: unusual-interpreter
+
+# just the gdb debug file
+lib@PVER@-dbg binary: python-script-but-no-python-dep
+
+# pointless lintian ...
+lib@PVER@-dbg binary: hardening-no-fortify-functions
+
+lib@PVER@-dbg binary: arch-dependent-file-not-in-arch-specific-directory
--- python3.3-3.3.0.orig/debian/2to3-3.1
+++ python3.3-3.3.0/debian/2to3-3.1
@@ -0,0 +1,41 @@
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
+.TH 2TO3-3.3 "1" "January 2012" "2to3-3.3 3.3" "User Commands"
+.SH NAME
+2to3-3.3 \- Python2 to Python3 converter
+.SH SYNOPSIS
+.B 2to3
+[\fIoptions\fR] \fIfile|dir \fR...
+.SH OPTIONS
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+show this help message and exit
+.TP
+\fB\-d\fR, \fB\-\-doctests_only\fR
+Fix up doctests only
+.TP
+\fB\-f\fR FIX, \fB\-\-fix\fR=\fIFIX\fR
+Each FIX specifies a transformation; default: all
+.TP
+\fB\-j\fR PROCESSES, \fB\-\-processes\fR=\fIPROCESSES\fR
+Run 2to3 concurrently
+.TP
+\fB\-x\fR NOFIX, \fB\-\-nofix\fR=\fINOFIX\fR
+Prevent a transformation from being run
+.TP
+\fB\-l\fR, \fB\-\-list\-fixes\fR
+List available transformations
+.TP
+\fB\-p\fR, \fB\-\-print\-function\fR
+Modify the grammar so that print() is a function
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+More verbose logging
+.TP
+\fB\-\-no\-diffs\fR
+Don't show diffs of the refactoring
+.TP
+\fB\-w\fR, \fB\-\-write\fR
+Write back modified files
+.TP
+\fB\-n\fR, \fB\-\-nobackups\fR
+Don't write backups for modified files
--- python3.3-3.3.0.orig/debian/libPVER.symbols.i386.in
+++ python3.3-3.3.0/debian/libPVER.symbols.i386.in
@@ -0,0 +1,8 @@
+libpython@VER@m.so.1.0 libpython@VER@ #MINVER#
+#include "libpython.symbols"
+ PyModule_Create2@Base @SVER@
+ _Py_force_double@Base @SVER@
+ _Py_get_387controlword@Base @SVER@
+ _Py_set_387controlword@Base @SVER@
+
+ (optional)__gnu_lto_v1@Base @SVER@
--- python3.3-3.3.0.orig/debian/changelog
+++ python3.3-3.3.0/debian/changelog
@@ -0,0 +1,2513 @@
+python3.3 (3.3.0-11) wheezy; urgency=low
+
+  * Update to 20130220 from the 3.3 branch.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 20 Feb 2013 15:40:05 +0100
+
+python3.3 (3.3.0-10) experimental; urgency=low
+
+  * Update to 20130126 from the 3.3 branch.
+  * Update hurd patches.
+  * python3.3-dbg, libpython3.3-dbg: Drop dependency on python.
+  * python3.3-dbg: Make gdb (not gdb-minimal) a recommendation.
+  * Git rid of build-dependency on python.
+  * Add site-packages in virtual environments created by pyvenv.
+    Closes: #698777.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 26 Jan 2013 12:17:05 +0100
+
+python3.3 (3.3.0-9) experimental; urgency=low
+
+  * Update to 20130125 from the 3.3 branch.
+  * Update cross build patches, and allow the package to cross build.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 25 Jan 2013 17:06:25 +0100
+
+python3.3 (3.3.0-8) experimental; urgency=low
+
+  * Update to 20130105 from the 3.3 branch.
+  * python-config --help returns with an exit value 0. LP: #1093860.
+  * Update package description for the -dbg packages. Closes: #696616.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 05 Jan 2013 18:39:32 +0100
+
+python3.3 (3.3.0-7) experimental; urgency=low
+
+  * Update to 20121220 from the 3.3 branch.
+  * debian/patches/sys-multiarch.diff: Expose multiarch triplet value
+    as sys.implementation._multiarch (Barry Warsaw).  Closes: #695959.
+    Note: Usage of sysconfig.get_config_var('MULTIARCH') is preferred.
+  * Set the install schema to `unix_prefix', if a virtual environment
+    is detected (VIRTUAL_ENV env var present). Closes: #695758.
+  * python3.3-dev, libpython3.3-dev: Drop the dependency on libssl-dev.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 21 Dec 2012 07:24:41 +0100
+
+python3.3 (3.3.0-6) experimental; urgency=low
+
+  * Don't use xattrs on kfreebsd and the Hurd.
+
+ -- Matthias Klose <doko@debian.org>  Tue, 04 Dec 2012 04:36:42 +0100
+
+python3.3 (3.3.0-5) experimental; urgency=low
+
+  * Update to 20121203 from the 3.3 branch.
+  * Make python3.3, python3.3-{minimal,dev,dbg} Multi-Arch: allowed.
+  * Use a shell implementation for the python-config script.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 03 Dec 2012 21:52:33 +0100
+
+python3.3 (3.3.0-4) experimental; urgency=low
+
+  * Update to 20121128 from the 3.3 branch.
+  * Don't link extensions with the shared libpython library.
+  * Override pointless lintian warning `hardening-no-fortify-functions'
+    for binaries built without optimization.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 28 Nov 2012 13:47:16 +0100
+
+python3.3 (3.3.0-3) experimental; urgency=low
+
+  * Update to 20121106 from the 3.3 branch.
+  * Filter-out cflags for profiled builds from _sysconfigdata.
+  * Fix multiarch plat-linux installation. LP: #1075891.
+  * Install _sysconfigdata.py from the shared builds. LP: #1075903.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 07 Nov 2012 14:31:02 +0100
+
+python3.3 (3.3.0-2) experimental; urgency=low
+
+  * Update to 20121021 from the 3.3 branch.
+  * Fix the interpreter name for the python3.3-dbg-config script.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 21 Oct 2012 09:51:05 +0200
+
+python3.3 (3.3.0-1) experimental; urgency=low
+
+  * Python 3.3.0 release.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 29 Sep 2012 12:59:24 +0200
+
+python3.3 (3.3.0~rc3-1) experimental; urgency=low
+
+  * Python 3.3.0 release candidate 3.
+  * Don't try to write lib2to3's pickled grammar files. Closes: #687200.
+  * Fix python-config manpage symlink. Closes: #687201.
+
+ -- Matthias Klose <doko@ubuntu.com>  Mon, 24 Sep 2012 16:22:17 +0200
+
+python3.3 (3.3.0~rc2-2ubuntu1) quantal; urgency=low
+
+  * Encode the version in the devhelp documentation name. LP: #787039.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 10 Sep 2012 12:56:13 +0200
+
+python3.3 (3.3.0~rc2-2) experimental; urgency=low
+
+  * Fix typo fixing the pkgconfig file.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 10 Sep 2012 11:13:51 +0200
+
+python3.3 (3.3.0~rc2-1) experimental; urgency=low
+
+  * Python 3.3.0 release candidate 2.
+  * Add the platform include dir to pkgconfig's CFlags.
+  * Hint on installing the python-gdbm package on failing _gdbm import.
+    LP: #995616.
+  * libpython3.3: Fix libpython3.3.so symlink. Closes: #686377.
+  * Don't use `-n' anymore to start idle in the desktop/menu files.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 09 Sep 2012 13:38:55 +0200
+
+python3.3 (3.3.0~rc1-2) experimental; urgency=low
+
+  * distutils: Add the multiarch python path to the include directories.
+    Closes: #685041.
+  * Remove /etc/python3.3 in libpython3.3-minimal instead of python3.3-minimal.
+    Closes: #681979.
+  * Remove /etc/python/sysconfig.cfg, not available anymore in python3.3.
+    Closes: #685016.
+  * Don't ship the _gdbm and _tkinter extensions in the -dbg package.
+    Closes: #685261.
+  * Fix verbose parallel builds for the sharedmods target.
+  * Don't install the pickled lib2to3 grammar files. Closes: #685214.
+  * Build extensions with fortify flags.
+  * Overwrite arch-dependent-file-not-in-arch-specific-directory warnings.
+
+ -- Matthias Klose <doko@debian.org>  Tue, 28 Aug 2012 19:47:58 +0200
+
+python3.3 (3.3.0~rc1-1) experimental; urgency=low
+
+  * Python 3.3.0 release candidate 1.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 26 Aug 2012 23:15:00 +0200
+
+python3.3 (3.3.0~b2-1) experimental; urgency=low
+
+  * Python 3.3.0 beta2 release.
+  * Fix removal of the _tkinter and dbm extensions for multiarch builds.
+    Closes: #684461.
+  * Use _sysconfigdata.py in distutils to initialize distutils.
+    Closes: #682475.
+  * Fix symlink for static libpython. Closes: #684608.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 13 Aug 2012 11:05:00 +0200
+
+python3.3 (3.3.0~b1-3) experimental; urgency=low
+
+  * Update to 20120712 from the trunk.
+  * Install separate _sysconfigdata.py for normal and debug builds.
+  * Install into multiarch locations.
+  * Split out multiarch packages libpython3.3-{minimal,stdlib,dev,dbg}.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 13 Jul 2012 00:43:42 +0200
+
+python3.3 (3.3.0~b1-2) experimental; urgency=low
+
+   * Update to 20120701 from the trunk.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 01 Jul 2012 11:45:12 +0200
+
+python3.3 (3.3.0~b1-1) experimental; urgency=low
+
+  * Python 3.3.0 beta1 release.
+  * Fix symlink for the -gdb.py file.
+  * debian/copyright: Add libmpdec license.
+  * Enable fortified build.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 27 Jun 2012 08:44:56 +0200
+
+python3.3 (3.3.0~a4-1) experimental; urgency=low
+
+  * Python 3.3.0 alpha4 release.
+  * Update to 20120620 from the trunk.
+  * Build _ctypes as an extension, not a builtin.
+  * Mark symbols defined in the _ctypes extension as optional.
+  * Remove references to the removed pyton3.3-documenting file.
+  * The wininst-* files cannot be built within Debian from the included
+    sources, needing a zlib mingw build, which the zlib maintainer isn't
+    going to provide.
+  * Use the underscore.js file provided by the libjs-underscore package.
+  * Let pydoc handle dist-packages the same as site-packages.
+  * Avoid runtime path for the sqlite extension.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 20 Jun 2012 13:09:19 +0200
+
+python3.3 (3.3.0~a3-1) experimental; urgency=low
+
+  * Python 3.3.0 alpha3 release.
+  * Build the dbm extension using db5.3.
+  * Update symbols file for a3.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 02 May 2012 23:28:46 +0200
+
+python3.3 (3.3.0~a2-1) experimental; urgency=low
+
+  * Python 3.3.0 alpha2 release.
+  * Update to 20120404 from the trunk.
+  * Build-depend on expat (>= 2.1).
+
+ -- Matthias Klose <doko@debian.org>  Wed, 04 Apr 2012 16:31:34 +0200
+
+python3.3 (3.3.0~a1-1) experimental; urgency=low
+
+  * Python 3.3.0 alpha1 release.
+  * Update to 20120321 from the trunk.
+  * Update debian/copyright.
+  * Build-depend on expat (>= 2.1~).
+
+ -- Matthias Klose <doko@debian.org>  Thu, 22 Mar 2012 06:14:01 +0100
+
+python3.3 (3.3~20120109-1) experimental; urgency=low
+
+  * 3.3 20120109 snapshot from the trunk.
+  * Merge packaging from python3.2 3.2.2-4.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 08 Jan 2012 09:44:33 +0100
+
+python3.3 (3.3~20110523-1) experimental; urgency=low
+
+  * Initial Python 3.3 packaging.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 23 May 2011 09:20:52 +0200
+
+python3.2 (3.2.2-4) unstable; urgency=low
+
+  * The static library belongs into the -dev package.
+  * Remove obsolete attributes in the control file.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 07 Jan 2012 20:46:39 +0100
+
+python3.2 (3.2.2-3) unstable; urgency=low
+
+  * Update to 20120106 from the 3.2 branch.
+  * Install manual pages for 2to3 and python-config.
+  * Fix file permission of token.py module.
+  * Add the ability to build an python3.x udeb, as copy of the
+    python3.x-minimal package (Colin Watson).
+  * Overwrite some lintian warnings:
+    - The -dbg interpreters are not unusual.
+    - The -gdb.py files don't need a python dependency.
+    - lintian can't handle a whatis entry starting with one word on the line.
+  * Fix test failures related to distutils debian installation layout.
+  * Update symbols files.
+  * Add build-arch/build-indep targets.
+  * Regenerate Setup and Makefiles after correcting Setup.local.
+  * profiled-build.diff: Pass PY_CFLAGS instead of CFLAGS for the profiled
+    build.
+  * Pass dpkg-buildflags to the build process, and build third party
+    extensions with these flags.
+  * Add support to build using -flto (and -g1) on some architectures.
+  * Disable pgo builds for some architectures (for now, keep just
+    amd64 armel armhf i386 powerpc ppc64).
+  * Build-depend on libgdbm-dev to build and run the gdbm tests.
+  * Build-depend on xvfb to run the tkinter tests.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 06 Jan 2012 20:10:13 +0100
+
+python3.2 (3.2.2-2) unstable; urgency=low
+
+  * Update platform patches (alpha, hppa, mips, sparc).
+
+ -- Matthias Klose <doko@debian.org>  Fri, 02 Dec 2011 10:24:05 +0100
+
+python3.2 (3.2.2-1) unstable; urgency=low
+
+  * Python 3.2.2 release.
+  * Update to 20111201 from the 3.2 branch.
+  * Search headers in /usr/include/ncursesw for the curses/panel extensions.
+  * New patch, ctypes-arm, allow for ",hard-float" after libc6 in ldconfig -p
+    output (Loic Minier). LP: #898172.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 01 Dec 2011 13:19:16 +0100
+
+python3.2 (3.2.2~rc1-1) unstable; urgency=low
+
+  * Python 3.2.2 release candidate 1.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 14 Aug 2011 20:25:35 +0200
+
+python3.2 (3.2.1-2) unstable; urgency=low
+
+  * Update to 20110803 from the 3.2 branch.
+  * Revert previous change to treat Linux 3.x as Linux 2. Use the
+    plat-linux3 directory instead.
+  * Use linux-any for some build dependencies. Closes: #634310.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 03 Aug 2011 15:16:05 +0200
+
+python3.2 (3.2.1-1) unstable; urgency=medium
+
+  * Python 3.2.1 release.
+  * Update lib-argparse patch (Pino Toscano). Closes: #631635.
+  * Treat Linux 3.x as Linux 2. Closes: #633015.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 10 Jul 2011 21:46:36 +0200
+
+python3.2 (3.2.1~rc2-1) unstable; urgency=low
+
+  * Python 3.2.1 release candidate 2.
+  * Add profile/pstats to the python3.2 package, update debian copyright.
+  * Don't run the benchmark on hurd-i386.
+  * Disable threading tests on hurd-i386. Closes: #631634.
+  * Don't add the bsddb multilib path, if already in the standard lib path.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 04 Jul 2011 20:27:52 +0200
+
+python3.2 (3.2.1~rc1-1) unstable; urgency=low
+
+  * Python 3.2.1 release candidate 1.
+  * Only enable sphinx-0.x patches when building with sphinx-0.x.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 18 May 2011 12:15:47 +0200
+
+python3.2 (3.2-4) unstable; urgency=low
+
+  * Update to 20110504 from the 3.2 branch.
+  * Disable the profiled build on ia64 and m68k.
+  * Update symbols file for m68k (Thorsten Glaser).
+
+ -- Matthias Klose <doko@debian.org>  Wed, 04 May 2011 21:32:08 +0200
+
+python3.2 (3.2-3) unstable; urgency=low
+
+  * Update to 20110427 from the 3.2 branch.
+    - Fix argparse import. Closes: #624277.
+  * Keep the ssl.PROTOCOL_SSLv2 module constant , just raise an exception
+    when trying to create a PySSL object. #624127.
+  * Don't depend on the locale and specific awk implementations in prerm.
+    Closes: #623466, #620836.
+  * Remove the old local site directory. Closes: #623057.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 27 Apr 2011 20:40:29 +0200
+
+python3.2 (3.2-2) unstable; urgency=low
+
+  * Update to 20110419 from the 3.2 branch.
+  * Re-enable profile-guided builds.
+  * Build without OpenSSL v2 support. Closes: #622004.
+  * Force linking the curses module against libncursesw. Closes: #622064.
+  * Re-enable running the testsuite during the build.
+
+ -- Matthias Klose <doko@debian.org>  Tue, 19 Apr 2011 17:54:36 +0200
+
+python3.2 (3.2-1) unstable; urgency=low
+
+  * Python 3.2 final release.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 20 Feb 2011 19:22:24 +0100
+
+python3.2 (3.2~rc3-1) experimental; urgency=low
+
+  * Python 3.2 release candidate 3.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 14 Feb 2011 16:12:14 +0100
+
+python3.2 (3.2~rc1-2) experimental; urgency=low
+
+  * Fix upgrade of the python3.2-dev package. Closes: #610370.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 19 Jan 2011 02:21:19 +0100
+
+python3.2 (3.2~rc1-1) experimental; urgency=low
+
+  * Python 3.2 release candidate 1.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 16 Jan 2011 22:17:09 +0100
+
+python3.2 (3.2~b2-1) experimental; urgency=low
+
+  * Python 3.2 beta2 release.
+  * Fix FTBFS on hurd-i386 (Pino Toscano). Closes: #606152).
+
+ -- Matthias Klose <doko@debian.org>  Tue, 21 Dec 2010 21:23:21 +0100
+
+python3.2 (3.2~b1-1) experimental; urgency=low
+
+  * Python 3.2 beta1 release.
+  * Configure with --enable-loadable-sqlite-extensions.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 06 Dec 2010 12:19:09 +0100
+
+python3.2 (3.2~a4-2) experimental; urgency=low
+
+  * Fix build failure on the hurd.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 26 Nov 2010 06:38:41 +0100
+
+python3.2 (3.2~a4-1) experimental; urgency=low
+
+  * Python 3.2 alpha4 release.
+  * Update to the py3k branch (20101124).
+  * Move the Makefile into the -min package, required by sysconfig.
+    Addresses: #603237.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 24 Nov 2010 22:20:32 +0100
+
+python3.2 (3.2~a3-2) experimental; urgency=low
+
+  * Update to the py3k branch (20101018).
+    - Issue #10094: Use versioned .so files on GNU/kfreeBSD and the GNU Hurd.
+      Closes: #600183.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 18 Oct 2010 19:34:39 +0200
+
+python3.2 (3.2~a3-1) experimental; urgency=low
+
+  * Python 3.2 alpha3 release.
+  * Make Lib/plat-gnukfreebsd[78] ready for python3. Closes: #597874.
+
+ -- Matthias Klose <doko@debian.org>  Tue, 12 Oct 2010 16:13:15 +0200
+
+python3.2 (3.2~a2-7) experimental; urgency=low
+
+  * Update to the py3k branch (20100926).
+
+ -- Matthias Klose <doko@debian.org>  Sun, 26 Sep 2010 14:41:18 +0200
+
+python3.2 (3.2~a2-6) experimental; urgency=low
+
+  * Update to the py3k branch (20100919).
+  * Update GNU/Hurd patches (Pino Toscano). Closes: #597320.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 19 Sep 2010 12:45:14 +0200
+
+python3.2 (3.2~a2-5) experimental; urgency=low
+
+  * Update to the py3k branch (20100916).
+  * Provide Lib/plat-gnukfreebsd[78] (Jakub Wilk). Addresses: #593818.
+  * Assume working semaphores, don't rely on running kernel for the check.
+    LP: #630511.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 16 Sep 2010 14:41:58 +0200
+
+python3.2 (3.2~a2-4) experimental; urgency=low
+
+  * Update to the py3k branch (20100911).
+  * Add the sysconfig module to python3.2-minimal.
+  * Remove dist-packages/README.
+  * Make xargs --show-limits in the maintainer scripts independent from
+    the locale.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 11 Sep 2010 20:59:47 +0200
+
+python3.2 (3.2~a2-3) experimental; urgency=low
+
+  * Update to the py3k branch (20100910).
+  * Disable profile feedback based optimization on armel.
+  * Add copyright information for expat, libffi and zlib. Sources
+    for the wininst-* files are in PC/bdist_wininst. Closes: #596276.
+  * Run the testsuite in parallel, when parallel= is set in DEB_BUILD_OPTIONS.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 10 Sep 2010 20:28:16 +0200
+
+python3.2 (3.2~a2-2) experimental; urgency=low
+
+  * Fix distutils.sysconfig.get_makefile_name for debug builds.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 09 Sep 2010 02:40:11 +0200
+
+python3.2 (3.2~a2-1) experimental; urgency=low
+
+  * Python 3.2 alpha2 release.
+  * Update to the py3k branch (20100908).
+  * Provide /usr/lib/python3/dist-packages as location for public python
+    packages.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 08 Sep 2010 17:36:06 +0200
+
+python3.2 (3.2~a1-1) experimental; urgency=low
+
+  * Python 3.2 alpha1 release.
+    - Files removed: Lib/profile.py, Lib/pstats.py, PC/icons/source.xar.
+  * Update to the py3k branch (20100827).
+  * Fix detection of ffi.h header file. Closes: #591408.
+  * python3.1-dev: Depend on libssl-dev. LP: #611845.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 27 Aug 2010 21:40:31 +0200
+
+python3.2 (3.2~~20100707-0ubuntu1) maverick; urgency=low
+
+  * Move the pkgconfig file into the -dev package.
+  * Update preremoval scripts for __pycache__ layout.
+  * Run hooks from /usr/share/python3/runtime.d/
+  * Update distutils-install-layout and debug-build patches.
+
+ -- Matthias Klose <doko@ubuntu.com>  Wed, 07 Jul 2010 12:38:52 +0200
+
+python3.2 (3.2~~20100706-0ubuntu1) maverick; urgency=low
+
+  * Test build, taken from the py3k branch (20100706).
+  * Merge with the python3.1 packaging.
+
+ -- Matthias Klose <doko@ubuntu.com>  Tue, 06 Jul 2010 17:10:51 +0200
+
+python3.2 (3.2~~20100704-0ubuntu1) maverick; urgency=low
+
+  * Test build, taken from the py3k branch (20100704).
+
+ -- Matthias Klose <doko@ubuntu.com>  Sun, 04 Jul 2010 16:04:45 +0200
+
+python3.2 (3.2~~20100421-0ubuntu1) lucid; urgency=low
+
+  * Test build, taken from the py3k branch (20100421).
+
+ -- Matthias Klose <doko@ubuntu.com>  Wed, 21 Apr 2010 22:04:14 +0200
+
+python3.1 (3.1.2+20100703-1) unstable; urgency=low
+
+  * Update to the 3.1 release branch, 20100703.
+  * Convert internal dpatch system to quilt.
+  * Update module list for python3-minimal.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 03 Jul 2010 14:18:18 +0200
+
+python3.1 (3.1.2-3) unstable; urgency=low
+
+  * Update to the 3.1 release branch, 20100508.
+  * Fix backport of issue #8140. Closes: #578896.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 08 May 2010 15:37:35 +0200
+
+python3.1 (3.1.2-2) unstable; urgency=low
+
+  * Update to the 3.1 release branch, 20100421.
+  * Update patch for issue #8032, gdb7 hooks for debugging.
+  * Fix issue #8233: When run as a script, py_compile.py optionally
+    takes a single argument `-`.
+  * Don't build-depend on locales on avr32.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 21 Apr 2010 21:12:37 +0200
+
+python3.1 (3.1.2-1) unstable; urgency=low
+
+  * Python 3.1.2 release.
+  * Fix issue #4961: Inconsistent/wrong result of askyesno function in
+    tkMessageBox with Tcl8.5. LP: #462950.
+  * Don't complain when /usr/local is not writable on installation.
+  * Apply proposed patch for issue #8032, gdb7 hooks for debugging.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 21 Mar 2010 17:59:49 +0100
+
+python3.1 (3.1.2~rc1-2) unstable; urgency=low
+
+  * Update to the 3.1 release branch, 20100316.
+  * Backport issue #8140: Extend compileall to compile single files.
+    Add -i option.
+
+ -- Matthias Klose <doko@debian.org>  Tue, 16 Mar 2010 02:38:45 +0100
+
+python3.1 (3.1.2~rc1-1) unstable; urgency=low
+
+  * Python 3.1.2 release candidate 1.
+    - Replace the Monty Python audio test file. Closes: #568676.
+  * Build using libdb4.8-dev. Only used for the dbm extension; the bsddb3
+    extension isn't built from the core packages anymore.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 11 Mar 2010 17:26:17 +0100
+
+python3.1 (3.1.1-3) unstable; urgency=low
+
+  * Update to the 3.1 release branch, 20100119.
+  * Hurd fixes (Pino Toscano):
+    - hurd-broken-poll.dpatch: ported from 2.5.
+    - hurd-disable-nonworking-constants.dpatch: disable a few constants from
+      the public API whose C counterparts are not implemented, so using them
+      either always blocks or always fails (caused issues in the test suite).
+    - hurd-path_max.dpatch (hurd only): change few PATH_MAX occurrences to
+      MAXPATHLEN (which is defined by the python lib if not defined by the OS).
+    - cthreads.dpatch: Refresh.
+    - Exclude the profiled build for hurd.
+    - Disable six blocking tests from the test suite.
+  * Don't run the testsuite on armel and hppa until someone figures out
+    the blocking tests.
+
+ -- Matthias Klose <doko@debian.org>  Tue, 19 Jan 2010 22:02:14 +0100
+
+python3.1 (3.1.1-2) unstable; urgency=low
+
+  * Update to the 3.1 release branch, 20100116.
+  * Fix bashism in makesetup shell script. Closes: #530170, #530171.
+  * Fix build issues on avr (Bradley Smith). Closes: #528439.
+    - Configure --without-ffi.
+    - Don't run lengthly tests.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 16 Jan 2010 23:28:05 +0100
+
+python3.1 (3.1.1-1) experimental; urgency=low
+
+  * Python 3.1.1 final release.
+  * Update to the 3.1 release branch, 20091011.
+  * Remove /usr/local/lib/python3.1 on package removal, if empty.
+  * Build _hashlib as a builtin. LP: #445530.
+  * python3.1-doc: Don't compress the sphinx inventory.
+  * python3.1-doc: Fix jquery.js symlink. LP: #447370.
+  * Run the benchmark with -C 2 -n 5 -w 4 on all architectures.
+  * python3.1-dbg: Don't create debug subdirectory in /usr/local. No
+    separate debug directory needed anymore.
+  * Fix title of devhelp document. LP: #423551.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 11 Oct 2009 22:01:57 +0200
+
+python3.1 (3.1-1) experimental; urgency=low
+
+  * Python 3.1 final release.
+  * Update to the 3.1 release branch, 20090723.
+  * Add explicit build dependency on tk8.5-dev.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 23 Jul 2009 15:20:35 +0200
+
+python3.1 (3.1-0ubuntu2) karmic; urgency=low
+
+  * Disable profile feedback based optimization on amd64 (GCC
+    PR gcov-profile/38292).
+
+ -- Matthias Klose <doko@ubuntu.com>  Fri, 24 Jul 2009 16:27:22 +0200
+
+python3.1 (3.1-0ubuntu1) karmic; urgency=low
+
+  * Python 3.1 final release.
+  * Update to the 3.1 release branch, 20090723.
+  * Add explicit build dependency on tk8.5-dev.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 23 Jul 2009 18:52:17 +0200
+
+python3.1 (3.1~rc2+20090622-1) experimental; urgency=low
+
+  [Matthias Klose]
+  * Python 3.1 rc2 release. Closes: #529320.
+  * Update to the trunk, 20090622, remove patches integrated upstream.
+  * Configure with --with-fpectl --with-dbmliborder=bdb --with-wide-unicode.
+    NOTE: The --with-wide-unicode configuration will break most extensions
+    built with 3.1~a1, but is consistent with python2.x configurations.
+  * Add symbols files for libpython3.1 and python3.1-dbg, don't include symbols
+    from builtins, which can either be built as builtins or extensions.
+  * Keep an empty lib-dynload in python3.1-minimal to avoid a warning on
+    startup.
+  * python3.1-doc: Depend on libjs-jquery, use jquery.js from this package.
+    Closes: #523485.
+  * Do not add /usr/lib/pythonXY.zip on sys.path.
+  * Add symbols files for libpython3.1 and python3.1-dbg, don't include symbols
+    from builtins, which can either be built as builtins or extensions.
+  * Keep an empty lib-dynload in python3.1-minimal to avoid a warning on
+    startup.
+  * Fix some lintian warnings.
+  * Use the information in /etc/lsb-release for platform.dist(). LP: #196526.
+  * Move the bdist_wininst files into the -dev package (only needed to build
+    windows installers).
+  * Document changes to the site directory name in the installation manual.
+  * Don't build a profiled binary. Closes: #521811.
+
+  * Address issues when working with PYTHONUSERBASE and non standard prefix
+    (pointed out by Larry Hastings):
+    - distutils.sysconfig.get_python_lib(): Only return ".../dist-packages" if
+      prefix is the default prefix and if PYTHONUSERBASE is not set in the
+      environment.
+    - site.addusersitepackages(): Add USER_BASE/.../dist-packages to sys.path.
+  * Always use the `unix_prefix' scheme for setup.py install in a virtualenv
+    setup. LP: #339904.
+  * Don't make the setup.py install options --install-layout=deb and --prefix
+    conflict with each other.
+  * distutils: Always install into `/usr/local/lib/python3.1/dist-packages'
+    if an option `--prefix=/usr/local' is present (except for virtualenv
+    and PYTHONUSERBASE installations). LP: #362570.
+  * Always use `site-packages' as site directory name in virtualenv.
+
+  [Marc Deslauriers]
+  * debian/pyhtml2devhelp.py: update for sphinx generated documentation.
+  * debian/rules: re-enable documentation files for devhelp.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 22 Jun 2009 16:18:39 +0200
+
+python3.1 (3.1~a1+20090322-1) experimental; urgency=low
+
+  * Python 3.1 alpha1 release.
+  * Update to the trunk, 20090322.
+  * Update installation schemes: LP: #338395.
+    - When the --prefix option is used for setup.py install, Use the
+      `unix_prefix' scheme.
+    - Use the `deb_system' scheme if --install-layout=deb is specified.
+    - Use the the `unix_local' scheme if neither --install-layout=deb
+      nor --prefix is specified.
+  * Use the information in /etc/lsb-release for platform.dist(). LP: #196526.
+  * pydoc: Fix detection of local documentation files.
+  * Build a shared library configured --with-pydebug. LP: #322580.
+  * Fix some lintian warnings.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 23 Mar 2009 00:01:27 +0100
+
+python3.1 (3.1~~20090226-1) experimental; urgency=low
+
+  * Python-3.1 snapshot (20090226), upload to experimental.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 26 Feb 2009 16:18:41 +0100
+
+python3.1 (3.1~~20090222-0ubuntu1) jaunty; urgency=low
+
+  * Python-3.1 snapshot (20090222).
+  * Build the _dbm extension using the Berkeley DB backend.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sun, 22 Feb 2009 12:58:58 +0100
+
+python3.0 (3.0.1-0ubuntu4) jaunty; urgency=low
+
+  * Don't build-depend on locales on sparc. Currently not installable.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sun, 22 Feb 2009 12:48:38 +0100
+
+python3.0 (3.0.1-0ubuntu3) jaunty; urgency=low
+
+  * Update to 20090222 from the release30-maint branch.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sun, 22 Feb 2009 11:09:58 +0100
+
+python3.0 (3.0.1-0ubuntu2) jaunty; urgency=low
+
+  * Allow docs to be built with Sphinx 0.5.x.
+
+ -- Matthias Klose <doko@ubuntu.com>  Tue, 17 Feb 2009 12:58:02 +0100
+
+python3.0 (3.0.1-0ubuntu1) jaunty; urgency=low
+
+  * New upstream version.
+
+ -- Matthias Klose <doko@ubuntu.com>  Mon, 16 Feb 2009 17:18:23 +0100
+
+python3.0 (3.0-0ubuntu2) jaunty; urgency=low
+
+  * Update to 20090213 from the release30-maint branch.
+
+ -- Matthias Klose <doko@ubuntu.com>  Fri, 13 Feb 2009 15:49:12 +0100
+
+python3.0 (3.0-0ubuntu1) jaunty; urgency=low
+
+  * Final Python-3.0 release.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 04 Dec 2008 09:00:09 +0100
+
+python3.0 (3.0~rc3-0ubuntu4) jaunty; urgency=low
+
+  * Update to 20081127 from the py3k branch.
+  * Ensure that all extensions from the -minimal package are statically
+    linked into the interpreter. LP: #301597.
+  * Include expat, _elementtree, datetime in -minimal to link
+    these extensions statically.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 27 Nov 2008 08:49:02 +0100
+
+python3.0 (3.0~rc3-0ubuntu3) jaunty; urgency=low
+
+  * Ignore errors when running the profile task.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sun, 23 Nov 2008 15:50:17 +0100
+
+python3.0 (3.0~rc3-0ubuntu2) jaunty; urgency=low
+
+  * Don't run test_ioctl on the buildd, before the buildd chroot is fixed:
+    Unable to open /dev/tty.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sun, 23 Nov 2008 15:28:02 +0100
+
+python3.0 (3.0~rc3-0ubuntu1) jaunty; urgency=low
+
+  * Update to the python-3.0 release candidate 3.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sun, 23 Nov 2008 13:14:20 +0100
+
+python3.0 (3.0~rc1+20081027-0ubuntu1) intrepid; urgency=low
+
+  * Update to 20081027 from the py3k branch. LP: #279227.
+  * Fix typos and section names in doc-base files. LP: #273344.
+  * Build a new package libpython3.0.
+  * For locally installed packages, create a directory
+    /usr/local/lib/python3.0/dist-packages. This is the default for
+    installations done with distutils and setuptools. Third party stuff
+    packaged within the distribution goes to /usr/lib/python3.0/dist-packages.
+    There is no /usr/lib/python3.0/site-packages in the file system and
+    on sys.path. No package within the distribution must not install
+    anything in this location.
+  * distutils: Add an option --install-layout=deb, which
+    - installs into $prefix/dist-packages instead of $prefix/site-packages.
+    - doesn't encode the python version into the egg name.
+
+ -- Matthias Klose <doko@ubuntu.com>  Mon, 27 Oct 2008 23:38:42 +0100
+
+python3.0 (3.0~b3+20080915-0ubuntu1) intrepid; urgency=low
+
+  * Update to 20080915 from the py3k branch.
+  * Build gdbm
+
+ -- Matthias Klose <doko@ubuntu.com>  Mon, 15 Sep 2008 23:56:44 +0200
+
+python3.0 (3.0~b3-0ubuntu1~ppa1) intrepid; urgency=low
+
+  * Python 3.0 beta3 release.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sun, 24 Aug 2008 03:49:26 +0200
+
+python3.0 (3.0~b2-0ubuntu1~ppa1) intrepid; urgency=low
+
+  * Python 3.0 beta2 release.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 07 Aug 2008 14:57:02 +0000
+
+python3.0 (3.0~b1-0ubuntu1~ppa1) intrepid; urgency=low
+
+  * Python 3.0 beta1 release.
+
+ -- Matthias Klose <doko@ubuntu.com>  Tue, 15 Jul 2008 16:10:52 +0200
+
+python3.0 (3.0~a5+0530-0ubuntu1) intrepid; urgency=low
+
+  * Update to snapshot taken from the py3k branch.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 29 May 2008 15:50:55 +0200
+
+python3.0 (3.0~a1-0ubuntu2) gutsy; urgency=low
+
+  * Disable running the benchmark.
+
+ -- Matthias Klose <doko@ubuntu.com>  Fri, 31 Aug 2007 23:22:34 +0000
+
+python3.0 (3.0~a1-0ubuntu1) gutsy; urgency=low
+
+  * First Python-3.0 alpha release.
+
+ -- Matthias Klose <doko@ubuntu.com>  Fri, 31 Aug 2007 21:26:21 +0200
+
+python2.6 (2.6~alpha~pre1-~0ubuntu1~ppa1) gutsy; urgency=low
+
+  * Snapshot build, an "how to use tilde in version numbers" upload.
+  * SVN 20070831.
+
+ -- Matthias Klose <doko@ubuntu.com>  Fri, 31 Aug 2007 15:56:09 +0200
+
+python2.5 (2.5.2-4) unstable; urgency=low
+
+  * Update to 20080427, taken from the 2.5 release branch.
+    - Fix issues #2670, #2682.
+  * Disable running pybench on the hppa buildd (ftbfs).
+  * Allow setting BASECFLAGS, OPT and EXTRA_LDFLAGS (like, CC, CXX, CPP,
+    CFLAGS, CPPFLAGS, CCSHARED, LDSHARED) from the environment.
+  * Support parallel=<n> in DEB_BUILD_OPTIONS (see #209008).
+
+ -- Matthias Klose <doko@debian.org>  Sun, 27 Apr 2008 10:40:51 +0200
+
+python2.5 (2.5.2-3) unstable; urgency=medium
+
+  * Update to 20080416, taken from the 2.5 release branch.
+    - Fix CVE-2008-1721, integer signedness error in the zlib extension module.
+    - Fix urllib2 file descriptor happens byte-at-a-time, reverting
+      a fix for excessively large memory allocations when calling .read()
+      on a socket object wrapped with makefile(). 
+  * Disable some regression tests on some architectures:
+    - arm: test_compiler, test_ctypes.
+    - armel: test_compiler.
+    - hppa: test_fork1, test_wait3.
+    - m68k: test_bsddb3, test_compiler.
+  * Build-depend on libffi-dev instead of libffi4-dev.
+  * Fix CVE-2008-1679, integer overflows in the imageop module.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 16 Apr 2008 23:37:46 +0200
+
+python2.5 (2.5.2-2) unstable; urgency=low
+
+  * Use site.addsitedir() to add directories in /usr/local to sys.path.
+    Addresses: #469157, #469818.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 08 Mar 2008 16:11:23 +0100
+
+python2.5 (2.5.2-1) unstable; urgency=low
+
+  * Python 2.5.2 release.
+  * Merge from Ubuntu:
+    - Move site customization into sitecustomize.py, don't make site.py
+      a config file. Addresses: #309719, #413172, #457361.
+    - Move site.py to python2.4-minimal, remove `addbuilddir' from site.py,
+      which is unnecessary for installed builds.
+    - python2.5-dev: Recommend libc-dev instead of suggesting it. LP: #164909.
+    - Fix issue 961805, Tk Text.edit_modified() fails. LP: #84720.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 28 Feb 2008 23:18:52 +0100
+
+python2.5 (2.5.1-7) unstable; urgency=low
+
+  * Update to 20080209, taken from the 2.5 release branch.
+  * Build the _bsddb extension with db-4.5 again; 4.6 is seriously
+    broken when used with the _bsddb extension.
+  * Do not run pybench on arm and armel.
+  * python2.5: Provide python2.5-wsgiref.
+  * Fix a pseudo RC report with duplicated attributes in the control
+    file. Closes: #464307.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 10 Feb 2008 00:22:57 +0100
+
+python2.5 (2.5.1-6) unstable; urgency=low
+
+  * Update to 20080102, taken from the 2.5 release branch.
+    - Only define _BSD_SOURCE on OpenBSD systems. Closes: #455400.
+  * Fix handling of packages in linecache.py (Kevin Goodsell). LP: #70902.
+  * Bump debhelper to v5.
+  * Register binfmt for .py[co] files.
+  * Use absolute paths when byte-compiling files. Addresses: #453346.
+    Closes: #413566, LP: #177722.
+  * CVE-2007-4965, http://bugs.python.org/issue1179:
+    Multiple integer overflows in the imageop module in Python 2.5.1 and
+    earlier allow context-dependent attackers to cause a denial of service
+    (application crash) and possibly obtain sensitive information (memory
+    contents) via crafted arguments to (1) the tovideo method, and unspecified
+    other vectors related to (2) imageop.c, (3) rbgimgmodule.c, and other
+    files, which trigger heap-based buffer overflows.
+    Patch prepared by Stephan Herrmann. Closes: #443333, LP: #163845.
+  * Register info docs when doing source only uploads. LP: #174786.
+  * Remove deprecated value from categories in desktop file. LP: #172874.
+  * python2.5-dbg: Don't include the gdbm and _tkinter extensions, now provided
+    in separate packages.
+  * Provide a symlink changelog -> NEWS. Closes: #439271.
+  * Fix build failure on hurd, working around poll() on systems on which it
+    returns an error on invalid FDs. Closes: #438914.
+  * Configure --with-system-ffi on all architectures. Closes: #448520.
+  * Fix version numbers in copyright and README files (Dan O'Huiginn).
+    Closes: #446682.
+  * Move some documents from python2.5 to python2.5-dev.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 02 Jan 2008 22:22:19 +0100
+
+python2.5 (2.5.1-5) unstable; urgency=low
+
+  * Build the _bsddb extension with db-4.6.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 17 Aug 2007 00:39:35 +0200
+
+python2.5 (2.5.1-4) unstable; urgency=low
+
+  * Update to 20070813, taken from the 2.5 release branch.
+  * Include plat-mac/plistlib.py (plat-mac is not in sys.path by default.
+    Closes: #435826.
+  * Use emacs22 to build the documentation in info format. Closes: #434969.
+  * Build-depend on db-dev (>= 4.6). Closes: #434965.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 13 Aug 2007 22:22:44 +0200
+
+python2.5 (2.5.1-3) unstable; urgency=high
+
+  * Support mixed-endian IEEE floating point, as found in the ARM old-ABI
+    (Aurelien Jarno). Closes: #434905.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 27 Jul 2007 20:01:35 +0200
+
+python2.5 (2.5.1-2) unstable; urgency=low
+
+  * Update to 20070717, taken from the 2.5 release branch.
+  * Fix reference count for sys.pydebug variable. Addresses: #431393.
+  * Build depend on libbluetooth-dev instead of libbluetooth2-dev.
+
+ -- Matthias Klose <doko@debian.org>  Tue, 17 Jul 2007 14:09:47 +0200
+
+python2.5 (2.5.1-1) unstable; urgency=low
+
+  * Python-2.5.1 release.
+  * Build-depend on gcc-4.1 (>= 4.1.2-4) on alpha, powerpc, s390, sparc.
+  * Merge from Ubuntu:
+    - Add debian/patches/subprocess-eintr-safety.dpatch (LP: #87292):
+      - Create and use wrappers around read(), write(), and os.waitpid() in the
+        subprocess module which retry the operation on an EINTR (which happens
+        if e. g. an alarm was raised while the system call was in progress).
+        It is incredibly hard and inconvenient to sensibly handle this in
+        applications, so let's fix this at the right level.
+      - Patch based on original proposal of Peter <C3><85>strand
+        in http://python.org/sf/1068268.
+      - Add two test cases.
+    - Change the interpreter to build and install python extensions
+      built with the python-dbg interpreter with a different name into
+      the same path (by appending `_d' to the extension name). The debug build
+      of the interpreter tries to first load a foo_d.so or foomodule_d.so
+      extension, then tries again with the normal name.
+    - When trying to import the profile and pstats modules, don't
+      exit, add a hint to the exception pointing to the python-profiler
+      package, don't exit.
+    - Keep the module version in the .egg-info name, only remove the
+      python version.
+    - python2.5-dbg: Install Misc/SpecialBuilds.txt, document the
+      debug changes in README.debug.
+  * Update to 20070425, taken from the 2.5 release branch.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 25 Apr 2007 22:12:50 +0200
+
+python2.5 (2.5-6) unstable; urgency=medium
+
+  * webbrowser.py: Recognize other browsers: www-browser, x-www-browser,
+    iceweasel, iceape.
+  * Move pyconfig.h from the python2.5-dev into the python2.5 package;
+    required by builds for pure python modules without having python2.5-dev
+    installed (matching the functionality in python2.4).
+  * Move the unicodedata module into python2.5-minimal; allows byte compilation
+    of UTF8 encoded files.
+  * Do not install anymore outdated debhelper sample scripts.
+  * Install Misc/SpecialBuilds.txt as python2.5-dbg document.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 21 Feb 2007 01:17:12 +0100
+
+python2.5 (2.5-5) unstable; urgency=high
+
+  * Do not run the python benchmark on m68k. Timer problems.
+    Fixes FTBFS on m68k.
+  * Update to 20061209, taken from the 2.5 release branch.
+    -  Fixes building the library reference in info format.
+
+ -- Matthias Klose <doko@debian.org>  Sat,  9 Dec 2006 13:40:48 +0100
+
+python2.5 (2.5-4) unstable; urgency=medium
+
+  * Update to 20061203, taken from the 2.5 release branch.
+    - Fixes build failures on knetfreebsd and the hurd. Closes: #397000.
+  * Clarify README about distutils. Closes: #396394.
+  * Move python2.5-config to python2.5-dev. Closes: #401451.
+  * Cleanup build-conflicts. Addresses: #394512.
+
+ -- Matthias Klose <doko@debian.org>  Sun,  3 Dec 2006 18:22:49 +0100
+
+python2.5 (2.5-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * python2.5-minimal depends on python-minimal (>= 2.4.4-1) because it's the
+    first version which lists python2.5 as an unsupported runtime (ie a
+    runtime that is available but for which modules are not auto-compiled).
+    And being listed there is required for python-central to accept the
+    installation of python2.5-minimal. Closes: #397006
+
+ -- Raphael Hertzog <hertzog@debian.org>  Wed, 22 Nov 2006 15:41:06 +0100
+
+python2.5 (2.5-3) unstable; urgency=medium
+
+  * Update to 20061029 (2.4.4 was released on 20061019), taken from
+    the 2.5 release branch. We do not want to have regressions in
+    2.5 compared to the 2.4.4 release.
+  * Don't run pybench on m68k, fails in the calibration loop. Closes: #391030.
+  * Run the installation/removal hooks. Closes: #383292, #391036.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 29 Oct 2006 11:35:19 +0100
+
+python2.5 (2.5-2) unstable; urgency=medium
+
+  * Update to 20061003, taken from the 2.5 release branch.
+  * On arm and m68k, don't run the pybench in debug mode.
+  * Fix building the source within exec_prefix (Alexander Wirt).
+    Closes: #385336.
+
+ -- Matthias Klose <doko@debian.org>  Tue,  3 Oct 2006 10:08:36 +0200
+
+python2.5 (2.5-1) unstable; urgency=low
+
+  * Python 2.5 release.
+  * Update to 20060926, taken from the 2.5 release branch.
+  * Run the Python benchmark during the build, compare the results
+    of the static and shared builds.
+  * Fix invalid html in python2.5.devhelp.gz.
+  * Add a python2.5 console entry to the menu (hidden by default).
+  * python2.5: Suggest python-profiler.
+
+ -- Matthias Klose <doko@debian.org>  Tue, 26 Sep 2006 02:36:11 +0200
+
+python2.5 (2.5~c1-1) unstable; urgency=low
+
+  * Python 2.5 release candidate 1.
+  * Update to trunk 20060818.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 19 Aug 2006 19:21:05 +0200
+
+python2.5 (2.5~b3-1) unstable; urgency=low
+
+  * Build the _ctypes module for m68k-linux.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 11 Aug 2006 18:19:19 +0000
+
+python2.5 (2.5~b3-0ubuntu1) edgy; urgency=low
+
+  * Python 2.5 beta3 release.
+  * Update to trunk 20060811.
+  * Rebuild the documentation.
+  * Fix value of sys.exec_prefix in the debug build.
+  * Do not build the library reference in info format; fails to build.
+  * Link the interpreter against the shared runtime library. With
+    gcc-4.1 the difference in the pystones benchmark dropped from about
+    12% to about 6%.
+  * Install the statically linked version of the interpreter as
+    python2.5-static for now.
+  * Link the shared libpython with -O1.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 10 Aug 2006 14:04:48 +0000
+
+python2.5 (2.4.3+2.5b2-3) unstable; urgency=low
+
+  * Disable the testsuite on s390; don't care about "minimally configured"
+    buildd's.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 23 Jul 2006 11:45:03 +0200
+
+python2.5 (2.4.3+2.5b2-2) unstable; urgency=low
+
+  * Update to trunk 20060722.
+  * Merge idle-lib from idle-python2.5 into python2.5.
+  * Merge lib-tk from python-tk into python2.5.
+  * Tkinter.py: Suggest installation of python-tk package on failed
+    import of the _tkinter extension.
+  * Don't run the testsuite for the debug build on alpha.
+  * Don't run the test_compiler test on m68k. Just takes too long.
+  * Disable building ctypes on m68k (requires support for closures).
+
+ -- Matthias Klose <doko@debian.org>  Sat, 22 Jul 2006 22:26:42 +0200
+
+python2.5 (2.4.3+2.5b2-1) unstable; urgency=low
+
+  * Python 2.5 beta2 release.
+  * Update to trunk 20060716.
+  * When built on a buildd, do not run the following test which try to
+    access the network: test_codecmaps_cn, test_codecmaps_hk, test_codecmaps_jp,
+    test_codecmaps_kr, test_codecmaps_tw, test_normalization.
+  * When built on a buildd, do not run tests requiring missing write permissions:
+    test_ossaudiodev.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 16 Jul 2006 02:53:50 +0000
+
+python2.5 (2.4.3+2.5b2-0ubuntu1) edgy; urgency=low
+
+  * Python 2.5 beta2 release.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 13 Jul 2006 17:16:52 +0000
+
+python2.5 (2.4.3+2.5b1-1ubuntu2) edgy; urgency=low
+
+  * Fix python-dev dependencies.
+  * Update to trunk 20060709.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sun,  9 Jul 2006 18:50:32 +0200
+
+python2.5 (2.4.3+2.5b1-1ubuntu1) edgy; urgency=low
+
+  * Python 2.5 beta1 release.
+  * Update to trunk 20060623.
+  * Merge changes from the python2.4 packages.
+  * python2.5-minimal: Add _struct.
+
+ -- Matthias Klose <doko@ubuntu.com>  Fri, 23 Jun 2006 16:04:46 +0200
+
+python2.5 (2.4.3+2.5a1-1) experimental; urgency=low
+
+  * Update to trunk 20060409.
+  * Run testsuite for debug build as well.
+  * Build-depend on gcc-4.1.
+
+ -- Matthias Klose <doko@debian.org>  Sun,  9 Apr 2006 22:27:05 +0200
+
+python2.5 (2.4.3+2.5a1-0ubuntu1) dapper; urgency=low
+
+  * Python 2.5 alpha1 release.
+  * Drop integrated patches.
+  * Add build dependencies on libsqlite3-dev and libffi4-dev.
+  * Add (build-)dependency on mime-support, libgpmg1 (test suite).
+  * Build using the system FFI.
+  * python2.5 provides python2.5-ctypes and python2.5-pysqlite2,
+    python2.5-elementtree.
+  * Move hashlib.py to python-minimal.
+  * Lib/hotshot/pstats.py: Error out on missing profile/pstats modules.
+
+ -- Matthias Klose <doko@ubuntu.com>  Wed,  5 Apr 2006 14:56:15 +0200
+
+python2.4 (2.4.3-8ubuntu1) edgy; urgency=low
+
+  * Resynchronize with Debian unstable. Remaining changes:
+    - Apply langpack-gettext patch.
+    - diff.gz contains pregenerated html and info docs.
+    - Build the -doc package from this source.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 22 Jun 2006 18:39:57 +0200
+
+python2.4 (2.4.3-8) unstable; urgency=low
+
+  * Remove python2.4's dependency on python-central. On installation of
+    the runtime, call hooks /usr/share/python/runtime.d/*.rtinstall.
+    On removal, call hooks /usr/share/python/runtime.d/*.rtremove.
+    Addresses: #372658.
+  * Call the rtinstall hooks only, if it's a new installation, or the first
+    installation using the hooks. Adresses: #373677.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 18 Jun 2006 00:56:13 +0200
+
+python2.4 (2.4.3-7) unstable; urgency=medium
+
+  * Reupload, depend on python-central (>= 0.4.15).
+  * Add build-conflict on python-xml.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 14 Jun 2006 18:56:57 +0200
+
+python2.4 (2.4.3-6) medium; urgency=low
+
+  * idle-python2.4: Remove the old postinst and prerm scripts.
+  * Name the runtime correctly in python2.4-minimal's installation
+    scripts.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 12 Jun 2006 17:39:56 +0000
+
+python2.4 (2.4.3-5) unstable; urgency=low
+
+  * python2.4-prerm: Handle the case, when python-central is not installed.
+  * idle-python2.4: Depend on python-tk instead of python2.4-tk.
+
+ -- Matthias Klose <doko@debian.org>  Fri,  9 Jun 2006 05:17:17 +0200
+
+python2.4 (2.4.3-4) unstable; urgency=low
+
+  * SVN update up to 2006-06-07
+  * Use python-central.
+  * Don't build the -tk and -gdbm packages from this source; now built
+    from the python-stdlib-extensions source.
+  * Remove leftover build dependency on libgmp3-dev.
+  * Do not build-depend on libbluetooth1-dev and libgpmg1-dev on
+    hurd-i386, kfreebsd-i386, kfreebsd-amd64. Closes: #365830.
+  * Do not run the test_tcl test; hangs for unknown reasons on at least
+    the following buildds: vivaldi(m68k), goedel (alpha), mayer (mipsel).
+    And no virtual package to file bug reports for the buildds ...
+    Closes: #364419.
+  * Move the Makefile from python2.4-dev to python2.4. Closes: #366473.
+  * Fix typo in pdb(1). Closes: #365772.
+  * New autoconf likes the mandir in /usr/share instead of /usr; work
+    with both locations. Closes: #367618.
+	
+ -- Matthias Klose <doko@debian.org>  Wed,  7 Jun 2006 21:37:20 +0200
+
+python2.4 (2.4.3-3) unstable; urgency=low
+
+  * SVN update up to 2006-04-21
+  * Update locale aliases from /usr/share/X11/locale/locale.alias.
+  * Start idle with option -n from the desktop menu, so that the program
+    can be started in parallel.
+  * Testsuite related changes only:
+    - Add build dependencies mime-support, libgpmg1 (needed by test cases).
+    - Run the testsuite with bsddb, audio and curses resources enabled.
+    - Re-run the failed tests in verbose mode.
+    - Run the test suite for the debug build as well.
+    - Build depend on netbase, needed by test_socketmodule.
+    - Build depend on libgpmg1, needed by test_curses.
+    - On the buildds do not run the tests needing the network resource.
+  * Update python logo.
+  * Check for the availability of the profile and pstats modules when
+    importing hotshot.pstats. Closes: #334067.
+  * Don't build the -doc package from the python2.4 source.
+  * Set OPT in the installed Makefile to -O2.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 21 Apr 2006 19:58:43 +0200
+
+python2.4 (2.4.3-2) unstable; urgency=low
+
+  * Add (build-)dependency on mime-support.
+
+ -- Matthias Klose <doko@ubuntu.com>  Tue,  4 Apr 2006 22:21:41 +0200
+
+python2.4 (2.4.3-1) unstable; urgency=low
+
+  * Python 2.4.3 release.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 30 Mar 2006 23:42:37 +0200
+
+python2.4 (2.4.3-0ubuntu1) dapper; urgency=low
+
+  * Python 2.4.3 release.
+    - Fixed a bug that the gb18030 codec raises RuntimeError on encoding
+      surrogate pair area on UCS4 build. Ubuntu: #29289.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 30 Mar 2006 10:57:32 +0200
+
+python2.4 (2.4.2+2.4.3c1-0ubuntu1) dapper; urgency=low
+
+  * SVN update up to 2006-03-25 (2.4.3 candidate 1).
+    - Regenerate the documentation.
+
+ -- Matthias Klose <doko@ubuntu.com>  Mon, 27 Mar 2006 12:03:05 +0000
+
+python2.4 (2.4.2-1ubuntu3) dapper; urgency=low
+
+  * SVN update up to 2006-03-04
+    - Regenerate the documentation.
+    - map.mmap(-1, size, ...) can return anonymous memory again on Unix.
+      Ubuntu #26201.
+  * Build-depend on libncursesw5-dev, ncursesw5 is preferred for linking.
+    Provides UTF-8 compliant curses bindings.
+  * Fix difflib where certain patterns of differences were making difflib
+    touch the recursion limit.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sat,  4 Mar 2006 21:38:24 +0000
+
+python2.4 (2.4.2-1ubuntu2) dapper; urgency=low
+
+  * SVN update up to 2006-01-17
+    - pwd is now a builtin module, remove it from python-minimal.
+    - Regenerate the documentation.
+  * python2.4-tk: Suggest tix instead of tix8.1.
+  * Move config/Makefile from the -dev package into the runtime package
+    to be able to use the bdist_wininst distutils command. Closes: #348335.
+
+ -- Matthias Klose <doko@ubuntu.com>  Tue, 17 Jan 2006 11:02:24 +0000
+
+python2.4 (2.4.2-1ubuntu1) dapper; urgency=low
+
+  * Temporarily remove build dependency on lsb-release.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sun, 20 Nov 2005 17:40:18 +0100
+
+python2.4 (2.4.2-1build1) dapper; urgency=low
+
+  * Rebuild (openssl-0.9.8).
+
+ -- Matthias Klose <doko@ubuntu.com>  Sun, 20 Nov 2005 15:27:24 +0000
+
+python2.4 (2.4.2-1) unstable; urgency=low
+
+  * Python 2.4.2 release.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 29 Sep 2005 01:49:28 +0200
+
+python2.4 (2.4.1+2.4.2rc1-1) unstable; urgency=low
+
+  * Python 2.4.2 release candidate 1.
+  * Fix "Fatal Python error" from cStringIO's writelines.
+    Patch by Andrew Bennetts.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 22 Sep 2005 10:33:22 +0200
+
+python2.4 (2.4.1-5) unstable; urgency=low
+
+  * CVS update up to 2005-09-14
+    - Regenerate the html and info docs.
+  * Add some more locale aliases.
+  * Fix substitution pf python version in README.python2.4-minimal.
+    Closes: #327487.
+  * On m68k, build using -O2 (closes: #326903).
+  * On Debian, don't configure --with-fpectl, which stopped working with
+    glibc-2.3.5.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 14 Sep 2005 17:32:56 +0200
+
+python2.4 (2.4.1-4) unstable; urgency=low
+
+  * CVS update up to 2005-09-04
+    - teTeX 3.0 related fixes (closes: #322407).
+    - Regenerate the html and info docs.
+  * Add entry for IDLE in the Gnome menus.
+  * Don't build-depend on libbluetooth-dev on the Hurd (closes: #307037).
+  * Reenable the cthreads patch for the Hurd (closes: #307052).
+
+ -- Matthias Klose <doko@debian.org>  Sun,  4 Sep 2005 18:31:42 +0200
+
+python2.4 (2.4.1-3) unstable; urgency=low
+
+  * Synchronise with Ubuntu:
+    - Build a python2.4-minimal package.
+
+ -- Matthias Klose <doko@debian.org>  Tue, 12 Jul 2005 00:23:10 +0000
+
+python2.4 (2.4.1-2ubuntu3) breezy; urgency=low
+
+  * CVS update up to 2005-07-07
+  * Regenerate the documentation.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu,  7 Jul 2005 09:21:28 +0200
+
+python2.4 (2.4.1-2ubuntu2) breezy; urgency=low
+
+  * CVS update up to 2005-06-15
+  * Regenerate the documentation.
+  * Synchronize with Debian. Ubuntu 10485.
+  * idle-python2.4 enhances python2.4. Ubuntu 11562.
+  * README.Debian: Fix reference to the doc directory (closes: #311677).
+
+ -- Matthias Klose <doko@debian.org>  Wed, 15 Jun 2005 08:56:57 +0200
+
+python2.4 (2.4.1-2ubuntu1) breezy; urgency=low
+
+  * Update build dependencies:
+      db4.2-dev -> db4.3-dev,
+      libreadline4-dev -> libreadline5-dev.
+  * python2.4-dev: Add missing templates to generate HTML docs. Ubuntu 11531.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sun, 29 May 2005 00:01:05 +0200
+
+python2.4 (2.4.1-2) unstable; urgency=low
+
+  * Add the debug symbols for the python2.4, python2.4-gdbm
+    and python2.4-tk packages to the python2.4-dbg package.
+  * Add gdbinit example to doc directory.
+
+ -- Matthias Klose <doko@debian.org>  Thu,  5 May 2005 11:12:32 +0200
+
+python2.4 (2.4.1-1ubuntu2) breezy; urgency=low
+
+  * Add the debug symbols for the python2.4, python2.4-minimal, python2.4-gdbm
+    and python2.4-tk packages to the python2.4-dbg package. Ubuntu 10261, 
+  * Add gdbinit example to doc directory.
+  * For os.utime, use utimes(2), correctly working with glibc-2.3.5.
+    Ubuntu 10294.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu,  5 May 2005 09:06:07 +0200
+
+python2.4 (2.4.1-1ubuntu1) breezy; urgency=low
+
+  * Reupload as 2.4.1-1ubuntu1.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 14 Apr 2005 10:46:32 +0200
+
+python2.4 (2.4.1-1) unstable; urgency=low
+
+  * Python 2.4.1 release.
+  * Fix noise in python-doc installation/removal.
+  * New Python section for the info docs.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 30 Mar 2005 19:42:03 +0200
+
+python2.4 (2.4.1-0) hoary; urgency=low
+
+  * Python 2.4.1 release.
+  * Fix noise in python-doc installation/removal.
+  * New Python section for the info docs.
+
+ -- Matthias Klose <doko@ubuntu.com>  Wed, 30 Mar 2005 16:35:34 +0200
+
+python2.4 (2.4+2.4.1rc2-2) unstable; urgency=low
+
+  * Add the valgrind support file to /etc/python2.4
+  * Build the -dbg package with -DPy_USING_MEMORY_DEBUGGER.
+  * Lib/locale.py:
+    - correctly parse LANGUAGE as a colon separated list of languages.
+    - prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE to get the correct
+      encoding.
+    - Don't map 'utf8', 'utf-8' to 'utf', which is not a known encoding
+      for glibc.
+  * Fix two typos in python(1). Addresses: #300124.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 19 Mar 2005 21:50:14 +0100
+
+python2.4 (2.4+2.4.1rc2-1) unstable; urgency=low
+
+  * Python 2.4.1 release candidate 2.
+  * Build-depend on libbluetooth1-dev.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 19 Mar 2005 00:57:14 +0100
+
+python2.4 (2.4dfsg-2) unstable; urgency=low
+
+  * CVS update up to 2005-03-03
+
+ -- Matthias Klose <doko@debian.org>  Thu,  3 Mar 2005 22:22:16 +0100
+
+python2.4 (2.4dfsg-1ubuntu4) hoary; urgency=medium
+
+  * Move exception finalisation later in the shutdown process - this
+    fixes the crash seen in bug #1165761, taken from CVS.
+  * codecs.StreamReader: Reset codec when seeking. Ubuntu #6972.
+  * Apply fix for SF1124295, fixing an obscure bit of Zope's security machinery.
+  * distutils: Don't add standard library dirs to library_dirs
+    and runtime_library_dirs. On amd64, runtime paths pointing to /usr/lib64
+    aren't recognized by dpkg-shlibdeps, and the packages containing these
+    libraries aren't added to ${shlibs:Depends}.
+  * Lib/locale.py:
+    - correctly parse LANGUAGE as a colon separated list of languages.
+    - prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE to get the correct
+      encoding.
+    - Don't map 'utf8', 'utf-8' to 'utf', which is not a known encoding
+      for glibc.
+  * os.py: Avoid using items() in environ.update(). Fixes #1124513.
+  * Python/pythonrun.c: 
+  * Build depend on locales, generate the locales needed for the
+    testsuite.
+  * Add build dependency on libbluetooth1-dev, adding some bluetooth
+    functionality to the socket module.
+  * Lib/test/test_sundry.py: Don't fail on import of profile & pstats,
+    which are separated out to the python-profiler package.
+  * Fix typos in manpage.
+
+ -- Matthias Klose <doko@ubuntu.com>  Tue, 29 Mar 2005 13:35:53 +0200
+
+
+python2.4 (2.4dfsg-1ubuntu3) hoary; urgency=low
+
+  * debian/patches/langpack-gettext.dpatch:
+    - langpack support for python-gettext added
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Tue,  1 Mar 2005 13:13:36 +0100
+
+python2.4 (2.4dfsg-1ubuntu2) hoary; urgency=low
+
+  * Revert 'essential' status on python2.4-minimal. This status on
+    on python-minimal is sufficient (Ubuntu #6392).
+
+ -- Matthias Klose <doko@ubuntu.com>  Wed,  9 Feb 2005 23:09:42 +0100
+
+python2.4 (2.4dfsg-1ubuntu1) hoary; urgency=low
+
+  * Resyncronise with Debian.
+  * Mark the python2.4-minimal package as 'essential'.
+
+ -- Matthias Klose <doko@ubuntu.com>  Wed,  9 Feb 2005 13:31:09 +0100
+
+python2.4 (2.4dfsg-1) unstable; urgency=medium
+
+  * Add licenses and acknowledgements for incorporated software in the
+    debian/copyright file (addresses: #293932).
+  * Replace md5 implementation with one having a DFSG conforming license.
+  * Remove the profile.py and pstats.py modules from the source package,
+    not having a DFSG conforming license. The modules can be found in
+    the python2.x-profile package in the non-free section.
+    Addresses: #293932.
+  * Add missing norwegian locales (Tollef Fog Heen).
+  * CVS updates of the release24-maint branch upto 2005-02-08 (date of
+    the Python 2.3.5 release).
+
+ -- Matthias Klose <doko@debian.org>  Tue,  8 Feb 2005 19:13:10 +0100
+
+python2.4 (2.4-7ubuntu1) hoary; urgency=low
+
+  * Fix the name of the python-dbg man page.
+  * Resyncronise with Debian.
+  * Move more modules to -minimal (new code in copy.py requires these):
+    dis, inspect, opcode, token, tokenize.
+
+ -- Matthias Klose <doko@ubuntu.com>  Tue,  8 Feb 2005 19:13:10 +0100
+
+python2.4 (2.4-7) unstable; urgency=medium
+
+  * Add licenses and acknowledgements for incorporated software in the
+    debian/copyright file (addresses: #293932).
+  * Replace md5 implementation with one having a DFSG conforming license.
+  * Add missing norwegian locales (Tollef Fog Heen).
+  * CVS updates of the release24-maint branch upto 2005-02-08 (date of
+    the Python 2.3.5 release).
+
+ -- Matthias Klose <doko@debian.org>  Tue,  8 Feb 2005 19:13:10 +0100
+
+python2.4 (2.4-6) unstable; urgency=low
+
+  * Build a python2.4-dbg package using --with-pydebug. Add a debug
+    directory <prefix>/lib-dynload/debug to sys.path instead of
+    <prefix>/lib-dynload und install the extension modules of the
+    debug build in this directory.
+    Change the module load path to load extension modules from other
+    site-packages/debug directories (for further details see the
+    README in the python2.4-dbg package).  Closes: #5415.
+  * Apply the pydebug-path patch. The package was already built in -5.
+
+ -- Matthias Klose <doko@debian.org>  Fri,  4 Feb 2005 22:15:13 +0100
+
+python2.4 (2.4-5) unstable; urgency=high
+
+  * Fix a flaw in SimpleXMLRPCServerthat can affect any XML-RPC servers.  
+    This affects any programs have been written that allow remote 
+    untrusted users to do unrestricted traversal and can allow them to
+    access or change function internals using the im_* and func_* attributes.
+    References: CAN-2005-0089.
+  * CVS updates of the release24-maint branch upto 2005-02-04.
+
+ -- Matthias Klose <doko@debian.org>  Fri,  4 Feb 2005 08:12:10 +0100
+
+python2.4 (2.4-4) unstable; urgency=medium
+
+  * Update debian/copyright to the 2.4 license text (closes: #290898).
+  * Remove /usr/bin/smtpd.py (closes: #291049).
+
+ -- Matthias Klose <doko@debian.org>  Mon, 17 Jan 2005 23:54:37 +0100
+
+python2.4 (2.4-3ubuntu6) hoary; urgency=low
+
+  * Use old-style dpatches instead of dpatch-run.
+
+ -- Tollef Fog Heen <tfheen@canonical.com>  Mon,  7 Feb 2005 15:58:05 +0100
+
+python2.4 (2.4-3ubuntu5) hoary; urgency=low
+
+  * Actually apply the patch as well (add to list of patches in
+    debian/rules)
+
+ -- Tollef Fog Heen <tfheen@canonical.com>  Sun,  6 Feb 2005 15:12:58 +0100
+
+python2.4 (2.4-3ubuntu4) hoary; urgency=low
+
+  * Add nb_NO and nn_NO locales to Lib/locale.py
+
+ -- Tollef Fog Heen <tfheen@canonical.com>  Sun,  6 Feb 2005 14:33:05 +0100
+
+python2.4 (2.4-3ubuntu3) hoary; urgency=low
+
+  * Fix a flaw in SimpleXMLRPCServerthat can affect any XML-RPC servers.
+    This affects any programs have been written that allow remote
+    untrusted users to do unrestricted traversal and can allow them to
+    access or change function internals using the im_* and func_* attributes.
+    References: CAN-2005-0089.
+
+ -- Matthias Klose <doko@ubuntu.com>  Wed,  2 Feb 2005 09:08:20 +0000
+
+python2.4 (2.4-3ubuntu2) hoary; urgency=low
+
+  * Build a python2.4-dbg package using --with-pydebug. Add a debug
+    directory <prefix>/lib-dynload/debug to sys.path instead of
+    <prefix>/lib-dynload und install the extension modules of the
+    debug build in this directory.
+    Change the module load path to load extension modules from other
+    site-packages/debug directories (for further details see the
+    README in the python2.4-dbg package).  Closes: #5415.
+  * Update debian/copyright to the 2.4 license text (closes: #290898).
+  * Add operator and copy to the -minimal package.
+
+ -- Matthias Klose <m@klose.in-berlin.de>  Mon, 17 Jan 2005 23:19:47 +0100
+
+python2.4 (2.4-3ubuntu1) hoary; urgency=low
+
+  * Resynchronise with Debian.
+  * python2.4: Depend on the very same version of python2.4-minimal.
+  * Docment, that time.strptime currently cannot be used, if the
+    python-minimal package is installed without the python package.
+
+ -- Matthias Klose <m@klose.in-berlin.de>  Sun,  9 Jan 2005 19:35:48 +0100
+
+python2.4 (2.4-3) unstable; urgency=medium
+
+  * Build the fpectl module.
+  * Updated to CVS release24-maint 20050107.
+
+ -- Matthias Klose <doko@debian.org>  Sat,  8 Jan 2005 19:05:21 +0100
+
+python2.4 (2.4-2ubuntu5) hoary; urgency=low
+
+  * Updated to CVS release24-maint 20050102.
+  * python-minimal:
+    - os.py: Use dict instead of UserDict, remove UserDict from -minimal.
+    - add pickle, threading, needed for subprocess module.
+    - optparse.py: conditionally import gettext, if not available,
+      define _ as the identity function. Patch taken from the trunk.
+      Avoids import of _locale, locale, gettext, copy, repr, itertools,
+      collections, token, tokenize.
+    - Add a build check to make sure that the minimal module list is
+      closed under dependency.
+  * Fix lintian warnings.
+
+ -- Matthias Klose <m@klose.in-berlin.de>  Sun,  2 Jan 2005 22:00:14 +0100
+
+python2.4 (2.4-2ubuntu4) hoary; urgency=low
+
+  * Add UserDict.py to the -minimal package, since os.py needs it.
+
+ -- Colin Watson <cjwatson@canonical.com>  Thu, 30 Dec 2004 20:41:28 +0000
+
+python2.4 (2.4-2ubuntu3) hoary; urgency=low
+
+  * Add os.py and traceback.py to the -minimal package, get the list
+    of modules from the README.
+
+ -- Matthias Klose <m@klose.in-berlin.de>  Mon, 27 Dec 2004 08:20:45 +0100
+
+python2.4 (2.4-2ubuntu2) hoary; urgency=low
+
+  * Add compileall.py and py_compile.py to the -minimal package, not
+    just to the README ...
+
+ -- Matthias Klose <m@klose.in-berlin.de>  Sat, 25 Dec 2004 22:24:56 +0100
+
+python2.4 (2.4-2ubuntu1) hoary; urgency=low
+
+  * Separate the interpreter and a minimal subset of modules into
+    a python2.4-minimal package. See the README.Debian.gz in this
+    package.
+  * Move site.py to python2.4-minimal as well.
+  * Add documentation files for devhelp.
+
+ -- Matthias Klose <m@klose.in-berlin.de>  Sun, 19 Dec 2004 22:47:32 +0100
+
+python2.4 (2.4-2) unstable; urgency=medium
+
+  * Updated patch for #283108. Thanks to Jim Meyering.
+
+ -- Matthias Klose <doko@debian.org>  Fri,  3 Dec 2004 17:00:16 +0100
+
+python2.4 (2.4-1) unstable; urgency=low
+
+  * Final 2.4 release.
+  * Flush stdout/stderr if closed (SF #1074011).
+
+ -- Matthias Klose <doko@debian.org>  Wed,  1 Dec 2004 07:54:34 +0100
+
+python2.4 (2.3.97-2) unstable; urgency=low
+
+  * Don't run test_tcl, hanging on the buildds.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 19 Nov 2004 23:48:42 +0100
+
+python2.4 (2.3.97-1) unstable; urgency=low
+
+  * Python 2.4 Release Candidate 1.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 19 Nov 2004 21:27:02 +0100
+
+python2.4 (2.3.96-1) experimental; urgency=low
+
+  * Updated to CVS release24-maint 20041113.
+  * Build the docs in info format again.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 13 Nov 2004 21:21:10 +0100
+
+python2.4 (2.3.95-2) experimental; urgency=low
+
+  * Move distutils package from the python2.4-dev into the python2.4
+    package.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 11 Nov 2004 22:56:14 +0100
+
+python2.4 (2.3.95-1) experimental; urgency=low
+
+  * Python 2.4 beta2 release.
+
+ -- Matthias Klose <doko@debian.org>  Thu,  4 Nov 2004 23:43:47 +0100
+
+python2.4 (2.3.94-1) experimental; urgency=low
+
+  * Python 2.4 beta1 release.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 16 Oct 2004 08:33:57 +0200
+
+python2.4 (2.3.93-1) experimental; urgency=low
+
+  * Python 2.4 alpha3 release.
+
+ -- Matthias Klose <doko@debian.org>  Fri,  3 Sep 2004 21:53:47 +0200
+
+python2.4 (2.3.92-1) experimental; urgency=low
+
+  * Python 2.4 alpha2 release.
+
+ -- Matthias Klose <doko@debian.org>  Thu,  5 Aug 2004 23:53:18 +0200
+
+python2.4 (2.3.91-1) experimental; urgency=low
+
+  * Python 2.4 alpha1 release.
+    Highlights: http://www.python.org/2.4/highlights.html
+
+ -- Matthias Klose <doko@debian.org>  Fri,  9 Jul 2004 17:38:54 +0200
+
+python2.4 (2.3.90-1) experimental; urgency=low
+
+  * Package HEAD branch (pre alpha ..).
+
+ -- Matthias Klose <doko@debian.org>  Mon, 14 Jun 2004 23:19:57 +0200
+
+python2.3 (2.3.4-1) unstable; urgency=medium
+
+  * Final Python 2.3.4 Release.
+  * In the API docs, fix signature of PyModule_AddIntConstant (closes: #250826).
+  * locale.getdefaultlocale: don't fail with empty environment variables.
+    Closes: #249816.
+  * Include distutils/command/wininst.exe in -dev package (closes: #249006).
+  * Disable cthreads on the Hurd (Michael Banck). Closes: #247211.
+  * Add a note to pygettext(1), that this program is deprecated in favour
+    of xgettext, which now includes support for Python as well.
+    Closes: #246332.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 28 May 2004 22:59:42 +0200
+
+python2.3 (2.3.3.91-1) unstable; urgency=low
+
+  * Python 2.3.4 Release Candidate 1.
+  * Do not use the default namespace for attributes. Patch taken from the
+    2.3 maintenance branch.
+    The xmllib module is obsolete.  Use xml.sax instead.
+  * http://python.org/sf/945642 - fix nonblocking i/o with ssl socket.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 13 May 2004 21:24:52 +0200
+
+python2.3 (2.3.3-7) unstable; urgency=low
+
+  * Add a workaround for GNU libc nl_langinfo()'s returning NULL.
+    Closes: #239237.
+    Patch taken from 2.3 maintenance branch.
+  * threading.py: Remove calls to currentThread() in _Condition methods that
+    were side-effect. Side-effects were deemed unnecessary and were causing
+    problems at shutdown time when threads were catching exceptions at start
+    time and then triggering exceptions trying to call currentThread() after
+    gc'ed.  Masked the initial exception which was deemed bad.
+    Closes: #195812.
+  * Properly support normalization of empty unicode strings. Closes: #239986.
+    Patch taken from 2.3 maintenance branch.
+  * README.maintainers: Add section where to find the documentation tools.
+  * Fix crash in pyexpat module (closes: #229281).
+  * For the Hurd, set the interpreters recursion limit to 930.
+  * Do not try to byte-compile the test files on installation; this
+    currently breaks the Hurd install.
+
+ -- Matthias Klose <doko@debian.org>  Sat,  1 May 2004 07:50:46 +0200
+
+python2.3 (2.3.3-6) unstable; urgency=low
+
+  * Don't build the unversioned python{,-*} packages anymore. Now
+    built from the python-defaults package.
+  * Update to the proposed python-policy: byte-compile using -E.
+  * Remove python-elisp's dependency on emacs20 (closes: #232785).
+  * Don't build python-elisp from the python2.3 source anymore,
+    get it from python-mode.sf.net as a separate source package.
+  * python2.3-dev suggests libc-dev (closes: #231091).
+  * get LDSHARED and CCSHARED (like, CC, CXX, CPP, CFLAGS) from 
+    the environment
+  * Set CXX in installed config/Makefile (closes: #230273).
+
+ -- Matthias Klose <doko@debian.org>  Tue, 24 Feb 2004 07:07:51 +0100
+
+python2.3 (2.3.3-5) unstable; urgency=low
+
+  * Build-depend on libdb4.2-dev, instead of libdb4.1-dev. According
+    to the docs the file format is compatible.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 12 Jan 2004 10:37:45 +0100
+
+python2.3 (2.3.3-4) unstable; urgency=low
+
+  * Fix broken _bsddb module. setup.py picked up the wrong library.
+
+ -- Matthias Klose <doko@debian.org>  Sun,  4 Jan 2004 11:30:00 +0100
+
+python2.3 (2.3.3-3) unstable; urgency=low
+
+  * Fix typo in patch (closes: #224797, #226064).
+
+ -- Matthias Klose <doko@debian.org>  Sun,  4 Jan 2004 09:23:21 +0100
+
+python2.3 (2.3.3-2) unstable; urgency=medium
+
+  * Lib/email/Charset: use locale unaware function to lower case of locale
+    name (closes: #224797).
+  * Update python-mode to version from python-mode.sf.net. Fixes highlighting
+    problems (closes: #223520).
+  * Backport from mainline: Add IPV6_ socket options from RFCs 3493 and 3542.
+
+ -- Matthias Klose <doko@debian.org>  Fri,  2 Jan 2004 14:03:26 +0100
+
+python2.3 (2.3.3-1) unstable; urgency=low
+
+  * New upstream release.
+  * Copy the templates, tools and scripts from the Doc dir in the source
+    to /usr/share/lib/python2.3/doc in the python2.3-dev package. Needed
+    for packages building documentation like python does (closes: #207337).
+
+ -- Matthias Klose <doko@debian.org>  Fri, 19 Dec 2003 10:57:39 +0100
+
+python2.3 (2.3.2.91-1) unstable; urgency=low
+
+  * New upstream version (2.3.3 release candidate).
+  * Update python-mode.el (closes: #158811, #159630).
+    Closing unreproducible report (closes: #159628).
+
+ -- Matthias Klose <doko@debian.org>  Sat,  6 Dec 2003 14:41:14 +0100
+
+python2.3 (2.3.2-7) unstable; urgency=low
+
+  * Put the conflict in the correct direction. python2.3 (2.3.2-6) doesn't
+    conflict with python (<= 2.3.2-5) but python (2.3.2-6) conflicts with
+    python2.3 (<= 2.3.2-5) (thanks to Brian May). Really closes #221791.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 21 Nov 2003 00:20:02 +0100
+
+python2.3 (2.3.2-6) unstable; urgency=low
+
+  * Add conflicts with older python{,2.3} packages to fix overwrite
+    errors (closes: #221791).
+
+ -- Matthias Klose <doko@debian.org>  Thu, 20 Nov 2003 07:24:36 +0100
+
+python2.3 (2.3.2-5) unstable; urgency=low
+
+  * Updated to CVS release23-maint 20031119.
+  * Re-upgrade the dependency of python2.3 on python (>= 2.3) to
+    a dependency (closes: #221523).
+
+ -- Matthias Klose <doko@debian.org>  Wed, 19 Nov 2003 00:30:27 +0100
+
+python2.3 (2.3.2-4) unstable; urgency=low
+
+  * Don't build-depend on latex2html (moved to non-free), but keep
+    the prebuilt docs in debian/patches (closes: #221347).
+  * Fix typos in the library reference (closes: #220510, #220954).
+  * Fix typo in python-elisp's autoloading code (closes: #220308).
+  * Update proposed python policy: private modules can be installed
+    into /usr/lib/<module> (arch dependent) and into /usr/share/<module>
+    (arch independent).
+
+ -- Matthias Klose <doko@debian.org>  Tue, 18 Nov 2003 00:41:39 +0100
+
+python2.3 (2.3.2-3) unstable; urgency=low
+
+  * Downgrade the dependency of python2.3 on python (>= 2.3) to
+    a recommendation.
+  * Fix path to interpreter in binfmt file.
+  * Fix segfault in unicodedata module (closes: #218697).
+  * Adjust python-elisp autoload code (closes: #219821).
+
+ -- Matthias Klose <doko@debian.org>  Sun,  9 Nov 2003 19:43:37 +0100
+
+python2.3 (2.3.2-2) unstable; urgency=medium
+
+  * Fix broken doc link (closes: #214217).
+  * Disable wrongly detected large file support for GNU/Hurd.
+  * Really fix the  FTBFS for the binary-indep target (closes: #214303).
+
+ -- Matthias Klose <doko@debian.org>  Mon,  6 Oct 2003 07:54:58 +0200
+
+python2.3 (2.3.2-1) unstable; urgency=low
+
+  * New upstream version.
+  * Fix a FTBFS for the binary-indep target.
+
+ -- Matthias Klose <doko@debian.org>  Sat,  4 Oct 2003 10:20:15 +0200
+
+python2.3 (2.3.1-3) unstable; urgency=low
+
+  * Fix names of codec packages in recommends.
+  * On alpha compile using -mieee (see #212912).
+
+ -- Matthias Klose <doko@debian.org>  Sun, 28 Sep 2003 10:48:12 +0200
+
+python2.3 (2.3.1-2) unstable; urgency=low
+
+  * Update python policy draft (closes: #128911, #163785).
+  * Re-add os.fsync function (closes: #212672).
+  * Let python2.3-doc conflict with older python2.3 versions (closes: #211882).
+  * Add recommends for pythonX.Y-japanese-codecs, pythonX.Y-iconvcodec,
+    pythonX.Y-cjkcodecs, pythonX.Y-korean-codecs (closes: #207161).
+  * Generate binfmt file (closes: #208005).
+  * Add IPPROTO_IPV6 option to the socketmodule (closes: #206569).
+  * Bugs reported against python2.2 and fixed in python2.3:
+    - Crashes in idle (closes: #186887, #200084).
+
+ -- Matthias Klose <doko@debian.org>  Sat, 27 Sep 2003 11:21:47 +0200
+
+python2.3 (2.3.1-1) unstable; urgency=low
+
+  * New upstream version (bug fix release).
+
+ -- Matthias Klose <doko@debian.org>  Wed, 24 Sep 2003 11:27:43 +0200
+
+python2.3 (2.3-4) unstable; urgency=high
+
+  * Disable check for utimes function, which is broken in glibc-2.3.2.
+    Packages using distutils had '1970/01/01-01:00:01' timestamps in files.
+  * Bugs fixed by making python2.3 the default python version:
+    - Canvas.scan_dragto() takes a 3rd optional parmeter "gain".
+      Closes: #158168.
+    - New command line parsing module (closes: #38628).
+    - compileall.py allows compiling single files (closes: #139971).
+  * Bugs reported for 2.2 and fixed in 2.3:
+    - Idle does save files with ASCII characters (closes: #179313).
+    - imaplib support for prefix-quoted strings (closes: #150485).
+    - posixpath includes getctime (closes: #173827).
+    - pydoc has support for keywords (closes: #186775).
+  * Bugs reported for 2.1 and fixed in 2.3:
+    - Fix handling of "#anchor" URLs in urlparse (closes: #147844).
+    - Fix readline if C stdin is not a tty, even if sys.stdin is.
+      Closes: #131810.
+  * Updated to CVS release23-maint 20030810 (fixing memory leaks in
+    array and socket modules).
+  * pydoc's usage output uses the basename of the script.
+  * Don't explicitely remove /etc/python2.3 on purge (closes: #202864).
+  * python conflicts with python-xmlbase (closes: #204773).
+  * Add dependency python (>= 2.3) to python2.3, so make sure the
+    unversioned names can be used.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 10 Aug 2003 09:27:52 +0200
+
+python2.3 (2.3-3) unstable; urgency=medium
+
+  * Fix shlibs file.
+
+ -- Matthias Klose <doko@debian.org>  Fri,  8 Aug 2003 08:45:12 +0200
+
+python2.3 (2.3-2) unstable; urgency=medium
+
+  * Make python2.3 the default python version.
+
+ -- Matthias Klose <doko@debian.org>  Tue,  5 Aug 2003 22:13:22 +0200
+
+python2.3 (2.3-1) unstable; urgency=low
+
+  * Python 2.3 final release.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 30 Jul 2003 08:12:28 +0200
+
+python2.3 (2.2.107-1rc2) unstable; urgency=medium
+
+  * Python 2.3 release candidate 2.
+  * Don't compress .txt files referenced by the html docs (closes: #200298).
+  * Include the email/_compat* files (closes: #200349).
+
+ -- Matthias Klose <doko@debian.org>  Fri, 25 Jul 2003 07:08:09 +0200
+
+python2.3 (2.2.106-2beta2) unstable; urgency=medium
+
+  * Python 2.3 beta2 release, updated to CVS 20030704.
+    - Fixes AssertionError in httplib (closed: #192452).
+    - Fixes uncaught division by zero in difflib.py (closed: #199287).
+  * Detect presence of setgroups(2) at configure time (closes: #199839).
+  * Use default gcc on arm as well.
+
+ -- Matthias Klose <doko@debian.org>  Sat,  5 Jul 2003 10:21:33 +0200
+
+python2.3 (2.2.105-1beta2) unstable; urgency=low
+
+  * Python 2.3 beta2 release.
+    - Includes merged idle fork.
+    - Fixed socket.setdefaulttimeout(). Closes: #189380.
+    - socket.ssl works with _socketobj. Closes: #196082.
+  * Do not link libtix to the _tkinter module. It's loaded via
+   'package require tix' at runtime. python2.3-tkinter now
+    suggests tix8.1 instead.
+  * On arm, use gcc-3.2 to build.
+  * Add -fno-strict-aliasing rules to OPT to avoid warnings
+    "dereferencing type-punned pointer will break strict-aliasing rules",
+    when building with gcc-3.3.
+
+ -- Matthias Klose <doko@debian.org>  Mon, 30 Jun 2003 00:19:32 +0200
+
+python2.3 (2.2.104-1beta1.1) unstable; urgency=low
+
+  * Non-maintainer upload with maintainer consent.
+  * debian/control (Build-Depends): s/libgdbmg1-dev/libgdbm-dev/.
+
+ -- James Troup <james@nocrew.org>  Wed,  4 Jun 2003 02:24:27 +0100
+
+python2.3 (2.2.104-1beta1) unstable; urgency=low
+
+  * Python 2.3 beta1 release, updated to CVS 20030514.
+    - build the current documentation.
+  * Reenable Tix support.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 14 May 2003 07:38:57 +0200
+
+python2.3 (2.2.103-1beta1) unstable; urgency=low
+
+  * Python 2.3 beta1 release, updated to CVS 20030506.
+    - updated due to build problems on mips/mipsel.
+    - keep the 2.3b1 documentation (doc build problems with cvs).
+
+ -- Matthias Klose <doko@debian.org>  Wed,  7 May 2003 06:26:39 +0200
+
+python2.3 (2.2.102-1beta1) unstable; urgency=low
+
+  * Python 2.3 beta1 release.
+
+ -- Matthias Klose <doko@debian.org>  Sat,  3 May 2003 22:45:16 +0200
+
+python2.3 (2.2.101-1exp1) unstable; urgency=medium
+
+  * Python 2.3 alpha2 release, updated to CVS 20030321.
+  * Tkinter: Catch exceptions thrown for undefined substitutions in
+    events (needed for tk 8.4.2).
+
+ -- Matthias Klose <doko@debian.org>  Fri, 21 Mar 2003 21:32:14 +0100
+
+python2.3 (2.2.100-1exp1) unstable; urgency=low
+
+  * Python 2.3 alpha2 release, updated to CVS 20030221.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 21 Feb 2003 19:37:17 +0100
+
+python2.3 (2.2.99-1exp1) unstable; urgency=low
+
+  * Python 2.3 alpha1 release updated to CVS 20030123.
+    - should fix the testsuite (and package build) failure on alpha.
+  * Remove build dependency on libexpat1-dev. Merge the python2.3-xmlbase
+    package into python2.3 (closes: #177739).
+
+ -- Matthias Klose <doko@debian.org>  Thu, 23 Jan 2003 22:48:12 +0100
+
+python2.3 (2.2.98-1exp1) unstable; urgency=low
+
+  * Python 2.3 alpha1 release updated to CVS 20030117.
+  * Build using libdb4.1.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 18 Jan 2003 00:14:01 +0100
+
+python2.3 (2.2.97-1exp1) unstable; urgency=low
+
+  * Python 2.3 alpha1 release updated to CVS 20030109.
+  * Build-Depend on g++ (>= 3:3.2).
+  * Python package maintainers: please wait uploading python dependent
+    packages until python2.2 and python2.1 are compiled using gcc-3.2.
+
+ -- Matthias Klose <doko@debian.org>  Thu,  9 Jan 2003 23:56:42 +0100
+
+python2.3 (2.2.96-1exp1) unstable; urgency=low
+
+  * Python 2.3 alpha1 release (not exactly the tarball, but taken from
+    CVS 20030101).
+    - Includes support for linking with threaded tk8.4 (closes: #172714).
+  * Install and register whatsnew document (closes: #173859).
+  * Properly unregister info documentation.
+
+ -- Matthias Klose <doko@debian.org>  Wed,  1 Jan 2003 17:38:54 +0100
+
+python2.3 (2.2.95-1exp1) unstable; urgency=low
+
+  * Experimental packages from CVS 021212.
+    - data in unicodedate module is up to date (closes: #171061).
+  * Fix idle packaging (closes: #170394).
+  * Configure using unicode UCS-4 (closes: #171062).
+    This change breaks compatibility with binary modules, but what do you
+    expect from experimental packages ... Please recompile dependent packages.
+  * Don't strip binaries for now.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 12 Dec 2002 21:42:27 +0100
+
+python2.3 (2.2.94-1exp1) unstable; urgency=low
+
+  * Experimental packages from CVS 021120.
+  * Remove outdated README.dbm.
+  * Depend on tk8.4.
+  * python-elisp: Install emacsen install file with mode 644 (closes: #167718).
+
+ -- Matthias Klose <doko@debian.org>  Thu, 21 Nov 2002 01:04:51 +0100
+
+python2.3 (2.2.93-1exp1) unstable; urgency=medium
+
+  * Experimental packages from CVS 021015.
+  * Build a static library libpython2.3-pic.a.
+  * Enable large file support for the Hurd (closes: #164602).
+
+ -- Matthias Klose <doko@debian.org>  Tue, 15 Oct 2002 21:06:27 +0200
+
+python2.3 (2.2.92-1exp1) unstable; urgency=low
+
+  * Experimental packages from CVS 020922.
+  * Fix build error on ia64 (closes: #161234).
+  * Build depend on gcc-3.2-3.2.1-0pre2 to fix build error on arm.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 22 Sep 2002 18:30:28 +0200
+
+python2.3 (2.2.91-1exp1) unstable; urgency=low
+
+  * Experimental packages from CVS 020906.
+  * idle-python2.3: Fix conflict (closes: #159267).
+  * Fix location of python-mode.el (closes: #159564, #159619).
+  * Use tix8.1.
+  * Apply fix for distutils/ccompiler problem (closes: #159288).
+
+ -- Matthias Klose <doko@debian.org>  Sat,  7 Sep 2002 09:55:07 +0200
+
+python2.3 (2.2.90-1exp1) unstable; urgency=low
+
+  * Experimental packages from CVS 020820.
+  * Don't build python2.3-elisp, but put the latest version into
+    python-elisp.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 22 Aug 2002 21:52:04 +0200
+
+python2.2 (2.2.1-6) unstable; urgency=low
+
+  * CVS updates of the release22-maint branch upto 2002-07-23.
+  * Enable IPv6 support (closes: #152543).
+  * Add python2.2-tk suggestion for python2.2 (pydoc -g).
+  * Fix from SF patch #527518: proxy config with user+pass authentication.
+  * Point pydoc to the correct location of the docs (closes: #147579).
+  * Remove '*.py[co]' files, when removing the python package,
+    not when purging (closes: #147130).
+  * Update to new py2texi.el version (Milan Zamazal).
+
+ -- Matthias Klose <doko@debian.org>  Mon, 29 Jul 2002 23:11:32 +0200
+
+python2.2 (2.2.1-5) unstable; urgency=low
+
+  * CVS updates of the release22-maint branch upto 2002-05-03.
+  * Build the info docs (closes: #145653).
+
+ -- Matthias Klose <doko@debian.org>  Fri,  3 May 2002 22:35:46 +0200
+
+python2.2 (2.2.1-4) unstable; urgency=high
+
+  * Fix indentation errors introduced in last upload (closes: #143809).
+
+ -- Matthias Klose <doko@debian.org>  Sun, 21 Apr 2002 01:00:14 +0200
+
+python2.2 (2.2.1-3) unstable; urgency=high
+
+  * Add Build-Conflicts: tcl8.0-dev, tk8.0-dev, tcl8.2-dev, tk8.2-dev.
+    Closes: #143534 (build a working _tkinter module, on machines, where
+    8.0's tk.h gets included).
+  * CVS updates of the release22-maint branch upto 2002-04-20.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 20 Apr 2002 09:22:37 +0200
+
+python2.2 (2.2.1-2) unstable; urgency=low
+
+  * Forgot to copy the dlmodule patch from the 2.1.3 package. Really
+    closes: #141681.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 13 Apr 2002 01:28:05 +0200
+
+python2.2 (2.2.1-1) unstable; urgency=high
+
+  * Final 2.2.1 release.
+  * According to report #131813, the python interpreter is much faster on some
+    architectures, when beeing linked statically with the python library (25%).
+    Gregor and me tested on i386, m68k and alpha, but we could not reproduce
+    such a speedup (generally between 5% and 10%). But we are linking the
+    python executable now statically ...
+  * Build info docs from the tex source, merge the python-doc-info
+    package into the python-doc package.
+  * Always build the dl module. Failure in case of
+        sizeof(int)!=sizeof(long)!=sizeof(void*)
+    is delayed until dl.open is called. Closes: #141681.
+
+ -- Matthias Klose <doko@debian.org>  Thu, 11 Apr 2002 00:19:19 +0200
+
+python2.2 (2.2.0.92-0) unstable; urgency=low
+
+  * Package CVS sources, omit cvs-updates.dpatch (closes: #140977).
+
+ -- Matthias Klose <doko@debian.org>  Wed,  3 Apr 2002 08:20:52 +0200
+
+python2.2 (2.2-6) unstable; urgency=medium
+
+  * Update to python-2.2.1 release candidate 2 (final release scheduled
+    for April 10).
+  * Enable dl module (closes: #138992).
+  * Build doc files with python binary from package (closes: #139657).
+  * Build _tkinter module with BLT and Tix support.
+  * python2.2-elisp: Conflict with python2-elisp (closes: #138970).
+  * string.split docs updated in python-2.2.1 (closes: #129272).
+
+ -- Matthias Klose <doko@debian.org>  Mon,  1 Apr 2002 13:52:36 +0200
+
+python2.2 (2.2-5) unstable; urgency=low
+
+  * CVS updates of the release22-maint branch upto 20020310 (aproaching
+    the first 2.2.1 release candidate).
+  * Stolen from HEAD: check argument of locale.nl_langinfo (closes: #137371).
+
+ -- Matthias Klose <doko@debian.org>  Fri, 15 Mar 2002 01:05:59 +0100
+
+python2.2 (2.2-4) unstable; urgency=medium
+
+  * Include test/{__init__.py,README,pystone.py} in package (closes: #129013).
+  * Fix python-elisp conflict (closes: #129046).
+  * Don't compress stylesheets (closes: #133179).
+  * CVS updates of the release22-maint branch upto 20020310.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 10 Mar 2002 23:32:28 +0100
+
+python2.2 (2.2-3) unstable; urgency=medium
+
+  * Updates from the CVS python22-maint branch up to 20020107.
+    webbrowser.py: properly escape url's.
+  * The Hurd does not have large file support: disabled.
+
+ -- Matthias Klose <doko@debian.org>  Mon,  7 Jan 2002 21:55:57 +0100
+
+python2.2 (2.2-2) unstable; urgency=medium
+
+  * CVS updates of the release22-maint branch upto 20011229. Fixes:
+    - Include TCP_CORK flag in plat-linux2 headers (fixes: #84340).
+    - Update CDROM.py module (fixes: #125785).
+  * Add missing chunk of the GNU/Hurd patch (therefore urgency medium).
+  * Send anonymous password when using anonftp (closes: #126814).
+
+ -- Matthias Klose <doko@debian.org>  Sat, 29 Dec 2001 20:18:26 +0100
+
+python2.2 (2.2-1) unstable; urgency=low
+
+  * New upstream version: 2.2.
+  * Bugs fixed upstream:
+    - Docs for os.kill reference the signal module for constants.
+    - Documentation strings in the tutorial end with a period (closes: #94770).
+    - Tk: grid_location method moved from Grid to Misc (closes: #98338).
+    - mhlib.SubMessage.getbodytext takes decode parameter (closes: #31876).
+    - Strings in modules are locale aware (closes: #51444).
+    - Printable 8-bit characters in strings are correctly printed
+      (closes: #64354).
+    - Dictionary can be updated with abstract mapping object (closes: #46566).
+  * Make site.py a config files.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 22 Dec 2001 00:51:46 +0100
+
+python2.2 (2.1.99c1-1) unstable; urgency=low
+
+  * New upstream version: 2.2c1 (release candidate).
+  * Do not provide python2.2-base anymore.
+  * Install correct README.Debian for python2.2 package. Include hint
+    where to find Makefile.pre.in.
+  * Suggest installation of python-ssl.
+  * Remove idle config files on purge.
+  * Remove empty /usr/lib/python2.2 directory on purge.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 15 Dec 2001 17:56:27 +0100
+
+python2.2 (2.1.99beta2-1) unstable; urgency=high
+
+  * debian/rules: Reflect removal of regrtest package (closes: #122278).
+    Resulted in build failures on all architectures.
+  * Build -doc package from source.
+
+ -- Matthias Klose <doko@debian.org>  Sat,  8 Dec 2001 00:38:41 +0100
+
+python2.2 (2.1.99beta2-0.1) unstable; urgency=low
+
+  * Non maintainer upload.
+  * New upstream version (this is 2.2beta2).
+  * Do not build the python-regrtest package anymore; keep the test framework
+    components test/regrtest.py and test/test_support.py in the python
+    package (closes: #119408).
+
+ -- Gregor Hoffleit <flight@debian.org>  Tue, 27 Nov 2001 09:53:26 +0100
+
+python2.2 (2.1.99beta1-4) unstable; urgency=low
+
+  * Configure with --with-fpectl (closes: #118125).
+  * setup.py: Remove broken check for _curses_panel module (#116081).
+  * idle: Move config-* files to /etc and mark as conffiles (#106390).
+  * Move idle packages to section `devel'.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 31 Oct 2001 10:56:45 +0100
+
+python2.2 (2.1.99beta1-3) unstable; urgency=low
+
+  * Fix shlibs file (was still referring to 2.1). Closes: #116810.
+  * README.Debian: point to draft of python-policy in the python package.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 31 Oct 2001 10:56:45 +0100
+
+python2.2 (2.1.99beta1-2) unstable; urgency=medium
+
+  * Fix shlibs file (was still referring to 2.1). Closes: #116810.
+  * Rename package python2.2-base to python2.2.
+
+ -- Matthias Klose <doko@debian.org>  Wed, 24 Oct 2001 23:00:50 +0200
+
+python2.2 (2.1.99beta1-1) unstable; urgency=low
+
+  * New upstream version (beta). Call the package version 2.1.99beta1-1.
+  * New maintainer until the final 2.2 release.
+  * Updated the debian patches.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 20 Oct 2001 18:56:26 +0200
+
+python2.1 (2.1.1-1.2) unstable; urgency=low
+
+  * Really remove the python alternative.
+
+ -- Matthias Klose <doko@debian.org>  Sat, 20 Oct 2001 15:16:56 +0200
+
+python2.1 (2.1.1-1.1) unstable; urgency=low
+
+  * README FOR PACKAGE MAINTAINERS: It is planned to remove the python2-XXX
+    packages from unstable and move on to python2.1.
+    If you repackage/adapt your modules for python2.1, don't build
+    python2-XXX and python2.1-XXX packages from the same source package,
+    so that the python2-XXX package can be removed without influencing the
+    python2.1-XXX package.
+
+    See the debian-python mailing list at http://lists.debian.org/devel.html
+    for details and the current discussion and a draft for a debian-python
+    policy (August to October 2001).
+
+  * Remove alternative for /usr/bin/python. The python-base package now
+    provides the default python version.
+
+  * Regenerate control file to fix build dependencies (closes: #116190).
+  * Remove alternative for /usr/bin/{python,pydoc}.
+  * Provide a libpython2.1.so symlink in /usr/lib/python2.1/config,
+    so that the shared library is found when -L/usr/lib/python2.1/config
+    is specified.
+  * Conflict with old package versions, where /usr/bin/python is a real
+    program (closes: #115943).
+  * python2.1-elisp conflicts with python-elisp (closes: #115895).
+  * We now have 2.1 (closes: #96851, #107849, #110243).
+
+ -- Matthias Klose <doko@debian.org>  Fri, 19 Oct 2001 17:34:41 +0200
+
+python2.1 (2.1.1-1) unstable; urgency=low
+
+  * Incorporated Matthias' modifications.
+
+ -- Gregor Hoffleit <flight@debian.org>  Thu, 11 Oct 2001 00:16:42 +0200
+
+python2.1 (2.1.1-0.2) unstable; urgency=low
+
+  * New upstream 2.1.1.
+  * GPL compatible licence (fixes #84080, #102949, #110643).
+  * Fixed upstream (closes: #99692, #111340).
+  * Build in separate build directory.
+  * Split Debian patches into debian/patches directory.
+  * Build dependencies: Add libgmp3-dev, libexpat1-dev, tighten
+    debhelper dependency.
+  * debian/rules: Updated a "bit".
+  * python-elisp: Remove custom dependency (closes: #87783),
+    fix emacs path (closes: #89712), remove emacs19 dependency (#82694).
+  * Mention distutils in python-dev package description (closes: #108170).
+  * Update README.Debian (closes: #85430).
+  * Run versioned python in postinsts (closes: #113349).
+  * debian/sample.{postinst,prerm}: Change to version independent scripts.
+  * Use '/usr/bin/env python2.1' as interpreter for all python scripts.
+  * Add libssl-dev to Build-Conflicts.
+  * python-elisp: Add support for emacs21 (closes: #98635).
+  * Do not compress .py files in doc directories.
+  * Don't link explicitely with libc.
+
+ -- Matthias Klose <doko@debian.org>  Wed,  3 Oct 2001 09:53:08 +0200
+
+python2.1 (2.1.1-0.1) unstable; urgency=low
+
+  * New upstream version (CVS branch release21-maint, will become 2.1.1):
+    This CVS branch will be released as 2.1.1 under a GPL compatible
+    license.
+
+ -- Gregor Hoffleit <flight@debian.org>  Wed, 27 Jun 2001 22:47:58 +0200
+
+python2 (2.1-0.1) unstable; urgency=low
+
+  * Fixed Makefile.pre.in.
+  * Fixed the postinst files in order to use 2.1 (instead of 2.0).
+  * Mention the immanent release of 2.0.1 and 2.1.1, with a GPL
+    compatible license.
+
+ -- Gregor Hoffleit <flight@debian.org>  Sun, 17 Jun 2001 21:05:25 +0200
+
+python2 (2.1-0) unstable; urgency=low
+
+  * New upstream version.
+  * Experimental packages.
+
+ -- Gregor Hoffleit <flight@debian.org>  Thu, 10 May 2001 00:20:04 +0200
+
+python2 (2.0-7) unstable; urgency=low
+
+  * Rebuilt with recent tcl8.3-dev/tk8.3-dev in order to fix a
+    dependency problem with python2-tk (closes: #87793, #92962).
+  * Change postinst to create and update /usr/local/lib/python2.0 and
+    site-python with permissions and owner as mandated by policy:
+    2775 and root:staff (closes: #89047).
+  * Fix to compileall.py: A superfluous argument made compileall without
+    options fail (cf. #92990 for python).
+  * Move the distutils module into python2-dev. It needs Makefile.pre.in
+    in order to work (closes: #89900).
+  * Remove build-dependency on libgdbm2-dev (which isn't built anyway).
+  * Add a build-dependency on libdb2-dev (cf. #90220 for python).
+
+ -- Gregor Hoffleit <flight@debian.org>  Sat, 14 Apr 2001 21:07:51 +0200
+
+python2 (2.0-6) unstable; urgency=low
+
+  * Remove python-zlib package; merge it into python-base.
+  * Mark that README.python2 is not yet updated.
+
+ -- Gregor Hoffleit <flight@debian.org>  Wed, 21 Feb 2001 12:34:18 +0100
+
+python2 (2.0-5) unstable; urgency=low
+
+  * Recompile with tcl/tk8.3 (closes: #82088).
+  * Modifications to README.why-python2 (closes: #82116).
+  * Add menu hint to idle2 menu entry.
+  * idle2 is renamed idle-python2 and now build correctly (closes: #82218).
+  * Add build-dependency on autoconf (closes: #85339).
+  * Build bsddbmodule as shared module (Modules/Setup.config.in),
+    and link libpython2.so with -lm in Makefile (closes: #86027).
+  * various cleanups in debian/rules, e.g. removing dh_suidregister.
+  * Make pdb available as /usr/bin/pdb-python2 in python2-dev
+    (cf. #79870 in python-base).
+  * Remove libgmp3 from build-dependencies, since we currently can't
+    build the mpzmodule for Python2 due to license problems.
+
+ -- Gregor Hoffleit <flight@debian.org>  Sun, 18 Feb 2001 00:12:17 +0100
+
+python2 (2.0-4) unstable; urgency=low
+
+  * control: make python2-elisp conflict with python-elisp (it doesn't
+    make sense to have both of them installed, does it ?)
+  * include build-depend on libxmltok1-dev.
+  * again, build with tcl/tk8.0.
+
+ -- Gregor Hoffleit <flight@debian.org>  Wed, 10 Jan 2001 23:37:01 +0100
+
+python2 (2.0-3) unstable; urgency=low
+
+  * Modules/Setup.in: Added a missing \ that made _tkinter be built
+    incorrectly.
+  * rules: on the fly, change all '#!' python scripts to use python2.
+
+ -- Gregor Hoffleit <flight@debian.org>  Wed, 13 Dec 2000 20:07:24 +0100
+
+python2 (2.0-2) unstable; urgency=low
+
+  * Aaargh. Remove conflicts/provides/replaces on python-base to make
+    parallel installation of python-base and python2-base possible.
+  * Install examples into /usr/share/doc/python2 (not python) and fix
+    symlink to python2.0 (thanks to Rick Younie <younie@home.com> for
+    pointing out this).
+  * Rename man page to python2.1.
+
+ -- Gregor Hoffleit <flight@debian.org>  Wed, 13 Dec 2000 09:31:05 +0100
+
+python2 (2.0-1) unstable; urgency=low
+
+  * New upstream version. Initial release for python2.
+
+ -- Gregor Hoffleit <flight@debian.org>  Mon, 11 Dec 2000 22:39:46 +0100
--- python3.3-3.3.0.orig/debian/README.maintainers.in
+++ python3.3-3.3.0/debian/README.maintainers.in
@@ -0,0 +1,88 @@
+
+Hints for maintainers of Debian packages of Python extensions
+-------------------------------------------------------------
+
+Most of the content of this README can be found in the Debian Python policy.
+See /usr/share/doc/python/python-policy.txt.gz.
+
+Documentation Tools
+-------------------
+
+If your package ships documentation produced in the Python
+documentation format, you can generate it at build-time by
+build-depending on @PVER@-dev, and you will find the
+templates, tools and scripts in /usr/lib/@PVER@/doc/tools --
+adjust your build scripts accordingly.
+
+
+Makefile.pre.in issues
+----------------------
+
+Python comes with a `universal Unix Makefile for Python extensions' in
+/usr/lib/@PVER@/config/Makefile.pre.in (with Debian, this is included
+in the python-dev package), which is used by most Python extensions.
+
+In general, packages using the Makefile.pre.in approach can be packaged
+simply by running dh_make or by using one of debhelper's rules' templates
+(see /usr/doc/debhelper/examples/). Makefile.pre.in works fine with e.g.
+"make prefix=debian/tmp/usr install".
+
+One glitch: You may be running into the problem that Makefile.pre.in
+doesn't try to create all the directories when they don't exist. Therefore,
+you may have to create them manually before "make install". In most cases,
+the following should work:
+
+	...
+	dh_installdirs /usr/lib/@PVER@
+	$(MAKE) prefix=debian/tmp/usr install
+	...
+
+
+Byte-compilation
+----------------
+
+For speed reasons, Python internally compiles source files into a byte-code.
+To speed up subsequent imports, it tries to save the byte-code along with
+the source with an extension .pyc (resp. pyo). This will fail if the
+libraries are installed in a non-writable directory, which may be the
+case for /usr/lib/@PVER@/.
+
+Not that .pyc and .pyo files should not be relocated, since for debugging
+purposes the path of the source for is hard-coded into them.
+
+To precompile files in batches after installation, Python has a script
+compileall.py, which compiles all files in a given directory tree. The
+Debian version of compileall has been enhanced to support incremental
+compilation and to feature a ddir (destination dir) option. ddir is
+used to compile files in debian/usr/lib/python/ when they will be
+installed into /usr/lib/python/.
+
+
+Currently, there are two ways to use compileall for Debian packages. The
+first has a speed penalty, the second has a space penalty in the package.
+
+1.) Compiling and removing .pyc files in postinst/prerm:
+
+  Use dh_python(1) from the debhelper packages to add commands to byte-
+  compile on installation and to remove the byte-compiled files on removal.
+  Your package has to build-depend on: debhelper (>= 4.1.67), python.
+
+  In /usr/share/doc/@PVER@, you'll find sample.postinst and sample.prerm.
+  If you set the directory where the .py files are installed, these
+  scripts will install and remove the .pyc and .pyo files for your
+  package after unpacking resp. before removing the package.
+
+2.) Compiling the .pyc files `out of place' during installation:
+
+  As of 1.5.1, compileall.py allows you to specify a faked installation
+  directory using the "-d destdir" option, so that you can precompile
+  the files in their temporary directory
+  (e.g. debian/tmp/usr/lib/python2.1/site-packages/PACKAGE).
+
+
+
+    11/02/98                             
+    Gregor Hoffleit <flight@debian.org>
+
+
+Last modified: 2007-10-14
--- python3.3-3.3.0.orig/debian/PVER-examples.overrides.in
+++ python3.3-3.3.0/debian/PVER-examples.overrides.in
@@ -0,0 +1,2 @@
+# don't care about permissions of the example files
+@PVER@-examples binary: executable-not-elf-or-script
--- python3.3-3.3.0.orig/debian/README.idle-PVER.in
+++ python3.3-3.3.0/debian/README.idle-PVER.in
@@ -0,0 +1,14 @@
+
+  The Python IDLE package for Debian
+  ----------------------------------
+
+This package contains Python @VER@'s Integrated DeveLopment Environment, IDLE.
+
+IDLE is included in the Python @VER@ upstream distribution (Tools/idle) and
+depends on Tkinter (available as @PVER@-tk package).
+
+I have written a simple man page.
+
+
+    06/16/1999
+    Gregor Hoffleit <flight@debian.org>
--- python3.3-3.3.0.orig/debian/libPVER-minimal.overrides.in
+++ python3.3-3.3.0/debian/libPVER-minimal.overrides.in
@@ -0,0 +1,5 @@
+# intentional
+lib@PVER@-minimal binary: python-script-but-no-python-dep
+
+# lintian omission, multiarch string is encoded in the filename
+lib@PVER@-minimal binary: arch-dependent-file-not-in-arch-specific-directory
--- python3.3-3.3.0.orig/debian/README.dbm
+++ python3.3-3.3.0/debian/README.dbm
@@ -0,0 +1,72 @@
+
+ Python and dbm modules on Debian
+ --------------------------------
+
+This file documents the configuration of the dbm modules for Debian. It
+gives hints at the preferred use of the dbm modules.
+
+
+The preferred way to access dbm databases in Python is the anydbm module.
+dbm databases behave like mappings (dictionaries).
+
+Since there exist several dbm database formats, we choose the following
+layout for Python on Debian:
+
+  * creating a new database with anydbm will create a Berkeley DB 2.X Hash
+    database file. This is the standard format used by libdb starting
+    with glibc 2.1.
+
+  * opening an existing database with anydbm will try to guess the format
+    of the file (using whichdb) and then load it using one of the bsddb,
+    bsddb1, gdbm or dbm (only if the python-gdbm package is installed)
+    or dumbdbm modules.
+
+  * The modules use the following database formats:
+
+    - bsddb:   Berkeley DB 2.X Hash (as in libc6 >=2.1 or libdb2)
+    - bsddb1:  Berkeley DB 1.85 Hash (as in libc6 >=2.1 or libdb2)
+    - gdbm:    GNU dbm 1.x or ndbm
+    - dbm:     " (nearly the same as the gdbm module for us)
+    - dumbdbm: a hand-crafted format only used in this module
+
+    That means that all usual formats should be readable with anydbm.
+
+  * If you want to create a database in a format different from DB 2.X,
+    you can still directly use the specified module.
+
+  * I.e. bsddb is the preferred module, and DB 2.X is the preferred format.
+
+  * Note that the db1hash and bsddb1 modules are Debian specific. anydbm
+    and whichdb have been modified to support DB 2.X Hash files (see
+    below for details).
+    
+
+
+For experts only:
+----------------
+
+Although bsddb employs the new DB 2.X format and uses the new Sleepycat
+DB 2 library as included with glibc >= 2.1, it's still using the old
+DB 1.85 API (which is still supported by DB 2).
+
+A more recent version 1.1 of the BSD DB module (available from
+http://starship.skyport.net/robind/python/) directly uses the DB 2.X API.
+It has a richer set of features.
+
+
+On a glibc 2.1 system, bsddb is linked with -ldb, bsddb1 is linked with
+-ldb1 and gdbm as well as dbm are linked with -lgdbm.
+
+On a glibc 2.0 system (e.g. potato for m68k or slink), bsddb will be
+linked with -ldb2 while bsddb1 will be linked with -ldb (therefore
+python-base here depends on libdb2).
+
+
+db1hash and bsddb1 nearly completely identical to dbhash and bsddb. The
+only difference is that bsddb is linked with the real DB 2 library, while
+bsddb1 is linked with an library which provides compatibility with legacy
+DB 1.85 databases.
+
+
+    July 16, 1999
+    Gregor Hoffleit <flight@debian.org>
--- python3.3-3.3.0.orig/debian/idle-PVER.1.in
+++ python3.3-3.3.0/debian/idle-PVER.1.in
@@ -0,0 +1,104 @@
+.TH IDLE 1 "21 September 2004"
+.SH NAME
+\fBIDLE\fP \- An Integrated DeveLopment Environment for Python
+.SH SYNTAX
+.B idle [ \fI-dins\fP ] [ \fI-t title\fP ] [ \fIfile\fP ...]
+.PP
+.B idle [ \fI-dins\fP ] [ \fI-t title\fP ] ( \fI-c cmd\fP | \fI-r file\fP ) [ \fIarg\fP ...]
+.PP
+.B idle [ \fI-dins\fP ] [ \fI-t title\fP ] - [ \fIarg\fP ...]
+.SH DESCRIPTION
+This manual page documents briefly the
+.BR idle
+command.
+This manual page was written for Debian
+because the original program does not have a manual page.
+For more information, refer to IDLE's help menu.
+.PP
+.B IDLE
+is an Integrated DeveLopment Environment for Python. IDLE is based on
+Tkinter, Python's bindings to the Tk widget set. Features are 100% pure
+Python, multi-windows with multiple undo and Python colorizing, a Python
+shell window subclass, a debugger. IDLE is cross-platform, i.e. it works
+on all platforms where Tk is installed.
+.LP
+.SH OPTIONS
+.TP
+.B \-h
+.PD
+Print this help message and exit.
+.TP
+.B \-n
+.PD
+Run IDLE without a subprocess (see Help/IDLE Help for details).
+.PP
+The following options will override the IDLE 'settings' configuration:
+.TP
+.B \-e
+.PD
+Open an edit window.
+.TP
+.B \-i
+.PD
+Open a shell window.
+.PP
+The following options imply -i and will open a shell:
+.TP
+.B \-c cmd
+.PD
+Run the command in a shell, or
+.TP
+.B \-r file
+.PD
+Run script from file.
+.PP
+.TP
+.B \-d
+.PD
+Enable the debugger.
+.TP
+.B \-s
+.PD
+Run $IDLESTARTUP or $PYTHONSTARTUP before anything else.
+.TP
+.B \-t title
+.PD
+Set title of shell window.
+.PP
+A default edit window will be bypassed when -c, -r, or - are used.
+.PP
+[arg]* and [file]* are passed to the command (-c) or script (-r) in sys.argv[1:].
+.SH EXAMPLES
+.TP
+idle
+.PD
+Open an edit window or shell depending on IDLE's configuration.
+.TP
+idle foo.py foobar.py
+.PD
+Edit the files, also open a shell if configured to start with shell.
+.TP
+idle -est "Baz" foo.py
+.PD
+Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell
+window with the title "Baz".
+.TP
+idle -c "import sys; print sys.argv" "foo"
+.PD
+Open a shell window and run the command, passing "-c" in sys.argv[0]
+and "foo" in sys.argv[1].
+.TP
+idle -d -s -r foo.py "Hello World"
+.PD
+Open a shell window, run a startup script, enable the debugger, and
+run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in
+sys.argv[1].
+.TP
+echo "import sys; print sys.argv" | idle - "foobar"
+.PD
+Open a shell window, run the script piped in, passing '' in sys.argv[0]
+and "foobar" in sys.argv[1].
+.SH SEE ALSO
+python(1).
+.SH AUTHORS
+Various.
--- python3.3-3.3.0.orig/debian/python3-config.1
+++ python3.3-3.3.0/debian/python3-config.1
@@ -0,0 +1,102 @@
+.TH PYTHON\-CONFIG 1 "November 27, 2011"
+.SH NAME
+python\-config \- output build options for python C/C++ extensions or embedding
+.SH SYNOPSIS
+.BI "python\-config"
+[
+.BI "\-\-prefix"
+]
+[
+.BI "\-\-exec\-prefix"
+]
+[
+.BI "\-\-includes"
+]
+[
+.BI "\-\-libs"
+]
+[
+.BI "\-\-cflags"
+]
+[
+.BI "\-\-ldflags"
+]
+[
+.BI "\-\-extension\-suffix"
+]
+[
+.BI "\-\-abiflags"
+]
+[
+.BI "\-\-help"
+]
+.SH DESCRIPTION
+.B python\-config
+helps compiling and linking programs, which embed the Python interpreter, or
+extension modules that can be loaded dynamically (at run time) into
+the interpreter.
+.SH OPTIONS
+.TP
+.BI "\-\-abiflags"
+print the the ABI flags as specified by PEP 3149.
+.TP
+.BI "\-\-cflags"
+print the C compiler flags.
+.TP
+.BI "\-\-ldflags"
+print the flags that should be passed to the linker.
+.TP
+.BI "\-\-includes"
+similar to \fI\-\-cflags\fP but only with \-I options (path to python header files).
+.TP
+.BI "\-\-libs"
+similar to \fI\-\-ldflags\fP but only with \-l options (used libraries).
+.TP
+.BI "\-\-prefix"
+prints the prefix (base directory) under which python can be found.
+.TP
+.BI "\-\-exec\-prefix"
+print the prefix used for executable program directories (such as bin, sbin, etc).
+.TP
+.BI "\-\-extension\-suffix"
+print the extension suffix used for binary extensions.
+.TP
+.BI "\-\-help"
+print the usage message.
+.PP
+
+.SH EXAMPLES
+To build the singe\-file c program \fIprog\fP against the python library, use
+.PP
+.RS
+gcc $(python\-config \-\-cflags \-\-ldflags) progr.cpp \-o progr.cpp
+.RE
+.PP
+The same in a makefile:
+.PP
+.RS
+CFLAGS+=$(shell python\-config \-\-cflags)
+.RE
+.RS
+LDFLAGS+=$(shell python\-config \-\-ldflags)
+.RE
+.RS
+all: progr
+.RE
+
+To build a dynamically loadable python module, use
+.PP
+.RS
+gcc $(python\-config \-\-cflags \-\-ldflags) \-shared \-fPIC progr.cpp \-o progr.so
+.RE
+
+.SH "SEE ALSO"
+python (1)
+.br
+http://docs.python.org/extending/extending.html
+.br
+/usr/share/doc/python/faq/extending.html
+
+.SH AUTHORS
+This manual page was written by Johann Felix Soden <johfel@gmx.de>
+for the Debian project (and may be used by others).
--- python3.3-3.3.0.orig/debian/control.in
+++ python3.3-3.3.0/debian/control.in
@@ -0,0 +1,193 @@
+Source: @PVER@
+Section: python
+Priority: optional
+Maintainer: Matthias Klose <doko@debian.org>
+Build-Depends: debhelper (>= 5.0.51~), quilt, autoconf, lsb-release, sharutils,
+  libreadline6-dev, libncursesw5-dev (>= 5.3),
+  zlib1g-dev, libbz2-dev, liblzma-dev,
+  libgdbm-dev, libdb-dev,
+  tk8.5-dev, blt-dev (>= 2.4z), libssl-dev,
+  libexpat1-dev,
+  libbluetooth-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64],
+  locales [!armel !avr32 !hppa !ia64 !mipsel],
+  libsqlite3-dev, libffi-dev (>= 3.0.5),
+  libgpm2 [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64],
+  mime-support, netbase, bzip2, gdb, python3,
+  xvfb, xauth
+Build-Depends-Indep: python-sphinx
+Standards-Version: 3.9.4
+Vcs-Browser: https://code.launchpad.net/~doko/python/pkg@VER@-debian
+Vcs-Bzr: http://bazaar.launchpad.net/~doko/python/pkg@VER@-debian
+
+Package: @PVER@
+Architecture: any
+Multi-Arch: allowed
+Priority: @PRIO@
+Depends: @PVER@-minimal (= ${binary:Version}), lib@PVER@-stdlib (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends}
+Suggests: @PVER@-doc, binutils
+Description: Interactive high-level object-oriented language (version @VER@)
+ Version @VER@ of the high-level, interactive object oriented language,
+ includes an extensive class library with lots of goodies for
+ network programming, system administration, sounds and graphics.
+
+Package: lib@PVER@-stdlib
+Architecture: any
+Multi-Arch: same
+Priority: @PRIO@
+Pre-Depends: multiarch-support
+Depends: lib@PVER@-minimal (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends}
+Suggests: @PVER@-profiler
+Provides: python@VER@-cjkcodecs, python@VER@-ctypes, python@VER@-elementtree, python@VER@-celementtree, python@VER@-wsgiref, @PVER@-gdbm, @PVER@-profiler, @PVER@-lzma
+Replaces: @PVER@ (<< 3.3.0~rc1-1~)
+Description: Interactive high-level object-oriented language (version @VER@)
+ Version @VER@ of the high-level, interactive object oriented language,
+ includes an extensive class library with lots of goodies for
+ network programming, system administration, sounds and graphics.
+ .
+ This package contains the standard library. It is normally not
+ used on it's own, but as a dependency of @PVER@.
+
+Package: @PVER@-minimal
+Architecture: any
+Multi-Arch: allowed
+Priority: @MINPRIO@
+Depends: lib@PVER@-minimal (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Recommends: @PVER@
+Suggests: binfmt-support
+Replaces: @PVER@ (<< 3.3~a4-1~)
+Conflicts: binfmt-support (<< 1.1.2)
+Description: Minimal subset of the Python language (version @VER@)
+ This package contains the interpreter and some essential modules.  It can
+ be used in the boot process for some basic tasks.
+ See /usr/share/doc/@PVER@-minimal/README.Debian for a list of the modules
+ contained in this package.
+
+Package: lib@PVER@-minimal
+Architecture: any
+Multi-Arch: same
+Priority: @MINPRIO@
+Pre-Depends: multiarch-support
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Recommends: lib@PVER@-stdlib
+Replaces: @PVER@ (<< 3.3~a4-1~), @PVER@-minimal (<< 3.3.0~rc1-1~)
+Conflicts: binfmt-support (<< 1.1.2)
+Description: Minimal subset of the Python language (version @VER@)
+ This package contains some essential modules. It is normally not
+ used on it's own, but as a dependency of @PVER@-minimal.
+
+Package: lib@PVER@
+Architecture: any
+Multi-Arch: same
+Section: libs
+Priority: @PRIO@
+Pre-Depends: multiarch-support
+Depends: lib@PVER@-stdlib (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Replaces: @PVER@ (<< 3.0~rc1)
+Description: Shared Python runtime library (version @VER@)
+ Version @VER@ of the high-level, interactive object oriented language,
+ includes an extensive class library with lots of goodies for
+ network programming, system administration, sounds and graphics.
+ .
+ This package contains the shared runtime library, normally not needed
+ for programs using the statically linked interpreter.
+
+Package: @PVER@-examples
+Architecture: all
+Depends: @PVER@ (>= ${source:Version}), ${misc:Depends}
+Description: Examples for the Python language (v@VER@)
+ Examples, Demos and Tools for Python (v@VER@). These are files included in
+ the upstream Python distribution (v@VER@).
+
+Package: @PVER@-dev
+Architecture: any
+Multi-Arch: allowed
+Depends: @PVER@ (= ${binary:Version}), lib@PVER@-dev (= ${binary:Version}), lib@PVER@ (= ${binary:Version}), libexpat1-dev, ${shlibs:Depends}, ${misc:Depends}
+Replaces: @PVER@ (<< 3.2~rc1-2)
+Recommends: libc6-dev | libc-dev
+Description: Header files and a static library for Python (v@VER@)
+ Header files, a static library and development tools for building
+ Python (v@VER@) modules, extending the Python interpreter or embedding
+ Python (v@VER@) in applications.
+ .
+ Maintainers of Python packages should read README.maintainers.
+
+Package: lib@PVER@-dev
+Section: libdevel
+Architecture: any
+Multi-Arch: same
+Pre-Depends: multiarch-support
+Depends: lib@PVER@-stdlib (= ${binary:Version}), lib@PVER@ (= ${binary:Version}), libexpat1-dev, ${shlibs:Depends}, ${misc:Depends}
+Replaces: @PVER@ (<< 3.2~rc1-2), @PVER@-dev (<< 3.3.0~b1-2), @PVER@-minimal (<< 3.3.0~rc1-1~)
+Recommends: libc6-dev | libc-dev
+Description: Header files and a static library for Python (v@VER@)
+ Header files, a static library and development tools for building
+ Python (v@VER@) modules, extending the Python interpreter or embedding
+ Python (v@VER@) in applications.
+ .
+ Maintainers of Python packages should read README.maintainers.
+ .
+ This package contains development files. It is normally not
+ used on it's own, but as a dependency of @PVER@-dev.
+
+Package: idle-@PVER@
+Architecture: all
+Depends: @PVER@, python3-tk, @PVER@-tk, ${misc:Depends}
+Enhances: @PVER@
+Description: IDE for Python (v@VER@) using Tkinter
+ IDLE is an Integrated Development Environment for Python (v@VER@).
+ IDLE is written using Tkinter and therefore quite platform-independent.
+
+Package: @PVER@-doc
+Section: doc
+Architecture: all
+Depends: libjs-jquery, libjs-underscore, ${misc:Depends}
+Suggests: @PVER@
+Description: Documentation for the high-level object-oriented language Python (v@VER@)
+ These is the official set of documentation for the interactive high-level
+ object-oriented language Python (v@VER@). All documents are provided
+ in HTML format. The package consists of ten documents:
+ .
+   * What's New in Python@VER@
+   * Tutorial
+   * Python Library Reference
+   * Macintosh Module Reference
+   * Python Language Reference
+   * Extending and Embedding Python
+   * Python/C API Reference
+   * Installing Python Modules
+   * Documenting Python
+   * Distributing Python Modules
+
+Package: @PVER@-dbg
+Section: debug
+Architecture: any
+Multi-Arch: allowed
+Priority: extra
+Depends: @PVER@ (= ${binary:Version}), lib@PVER@-dbg (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Recommends: gdb
+Suggests: python3-gdbm-dbg, python3-tk-dbg
+Description: Debug Build of the Python Interpreter (version @VER@)
+ The package holds two things:
+ .
+ - A Python interpreter configured with --pydebug. Dynamically loaded modules
+   are searched as <foo>_d.so first. Third party extensions need a separate
+   build to be used by this interpreter.
+ - Debug information for standard python interpreter and extensions.
+ .
+ See the README.debug for more information.
+
+Package: lib@PVER@-dbg
+Section: debug
+Architecture: any
+Multi-Arch: same
+Priority: extra
+Pre-Depends: multiarch-support
+Depends: lib@PVER@-stdlib (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Replaces: @PVER@-dbg (<< 3.3.0~rc1-1)
+Description: Debug Build of the Python Interpreter (version @VER@)
+ The package holds two things:
+ .
+ - Extensions for a Python interpreter configured with --pydebug.
+ - Debug information for standard python extensions.
+ .
+ See the README.debug for more information.
--- python3.3-3.3.0.orig/debian/README.python
+++ python3.3-3.3.0/debian/README.python
@@ -0,0 +1,153 @@
+
+  Python 2.x for Debian
+  ---------------------
+
+This is Python 2.x packaged for Debian.
+
+This document contains information specific to the Debian packages of
+Python 2.x.
+
+
+
+   [TODO: This document is not yet up-to-date with the packages.]
+
+
+
+
+
+
+Currently, it features those two main topics:
+
+  1. Release notes for the Debian packages:
+  2. Notes for developers using the Debian Python packages:
+
+Release notes and documentation from the upstream package are installed
+in /usr/share/doc/python/.
+
+Up-to-date information regarding Python on Debian systems is also
+available as http://www.debian.org/~flight/python/.
+
+There's a mailing list for discussion of issues related to Python on Debian
+systems: debian-python@lists.debian.org. The list is not intended for
+general Python problems, but as a forum for maintainers of Python-related
+packages and interested third parties.
+
+
+
+1. Release notes for the Debian packages:
+
+
+Results of the regression test:
+------------------------------
+
+The package does successfully run the regression tests for all included
+modules. Seven packages are skipped since they are platform-dependent and
+can't be used with Linux.
+
+
+Noteworthy changes since the 1.4 packages:
+-----------------------------------------
+
+- Threading support enabled.
+- Tkinter for Tcl/Tk 8.x.
+- New package python-zlib.
+- The dbmmodule was dropped. Use bsddb instead. gdbmmodule is provided
+  for compatibility's sake.
+- python-elisp adheres to the new emacs add-on policy; it now depends
+  on emacsen. python-elisp probably won't work correctly with emacs19.
+  Refer to /usr/doc/python-elisp/ for more information.
+- Remember that 1.5 has dropped the `ni' interface in favor of a generic
+  `packages' concept.
+- Python 1.5 regression test as additional package python-regrtest. You
+  don't need to install this package unless you don't trust the
+  maintainer ;-).
+- once again, modified upstream's compileall.py and py_compile.py.
+  Now they support compilation of optimized byte-code (.pyo) for use
+  with "python -O", removal of .pyc and .pyo files where the .py source
+  files are missing (-d) and finally the fake of a installation directory
+  when .py files have to be compiled out of place for later installation
+  in a different directory (-i destdir, used in ./debian/rules).
+- The Debian packages for python 1.4 do call 
+  /usr/lib/python1.4/compileall.py in their postrm script. Therefore
+  I had to provide a link from /usr/lib/python1.5/compileall.py, otherwise
+  the old packages won't be removed completely. THIS IS A SILLY HACK!
+
+
+
+2. Notes for developers using the Debian python packages:
+
+
+Embedding python:
+----------------
+
+The files for embedding python resp. extending the python interpreter
+are included in the python-dev package. With the configuration in the
+Debian GNU/Linux packages of python 1.5, you will want to use something
+like
+
+    -I/usr/include/python1.5                  (e.g. for config.h)
+    -L/usr/lib/python1.5/config -lpython1.5   (... -lpthread)
+                           (also for Makefile.pre.in, Setup etc.)
+
+Makefile.pre.in automatically gets that right.  Note that unlike 1.4,
+python 1.5 has only one library, libpython1.5.a.
+
+Currently, there's no shared version of libpython. Future version of
+the Debian python packages will support this.
+
+
+Python extension packages:
+-------------------------
+
+According to www.python.org/doc/essays/packages.html, extension packages
+should only install into /usr/lib/python1.5/site-packages/ (resp.
+/usr/lib/site-python/ for packages that are definitely version independent).
+No extension package should install files directly into /usr/lib/python1.5/.
+
+But according to the FSSTND, only Debian packages are allowed to use
+/usr/lib/python1.5/. Therefore Debian Python additionally by default
+searches a second hierarchy in /usr/local/lib/. These directories take
+precedence over their equivalents in /usr/lib/.
+
+a) Locally installed Python add-ons
+
+    /usr/local/lib/python1.5/site-packages/
+    /usr/local/lib/site-python/ (version-independent modules)
+
+b) Python add-ons packaged for Debian
+
+    /usr/lib/python1.5/site-packages/
+    /usr/lib/site-python/ (version-independent modules)
+
+Note that no package must install files directly into /usr/lib/python1.5/
+or /usr/local/lib/python1.5/. Only the site-packages directory is allowed
+for third-party extensions.
+
+Use of the new `package' scheme is strongly encouraged. The `ni' interface
+is obsolete in python 1.5.
+
+Header files for extensions go into /usr/include/python1.5/.
+
+
+Installing extensions for local use only:
+----------------------------------------
+
+Most extensions use Python's Makefile.pre.in. Note that Makefile.pre.in
+by default will install files into /usr/lib/, not into /usr/local/lib/,
+which is not allowed for local extensions. You'll have to change the
+Makefile accordingly. Most times, "make prefix=/usr/local install" will
+work.
+
+
+Packaging python extensions for Debian:
+--------------------------------------
+
+Maintainers of Python extension packages should read README.maintainers.
+
+ 
+
+
+    03/09/98
+    Gregor Hoffleit <flight@debian.org>
+
+Last change: 07/16/1999
--- python3.3-3.3.0.orig/debian/PVER.prerm.in
+++ python3.3-3.3.0/debian/PVER.prerm.in
@@ -0,0 +1,38 @@
+#! /bin/sh -e
+#
+# prerm script for the Debian @PVER@-base package.
+# Written 1998 by Gregor Hoffleit <flight@debian.org>.
+#
+
+remove_bytecode()
+{
+    pkg=$1
+    max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}')
+    dpkg -L $pkg \
+	| awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \
+	| xargs --max-chars="$max" echo \
+	| while read files; do rm -f $files; done
+    find /usr/lib/python3 /usr/lib/@PVER@ -name dist-packages -prune -o -name __pycache__ -empty -print \
+	| xargs -r rm -rf
+}
+
+case "$1" in
+    remove|upgrade)
+	remove_bytecode @PVER@
+	oldlocalsite=/usr/local/lib/@PVER@/site-packages
+	# issue #623057
+	if [ -d $oldlocalsite -a ! -h $oldlocalsite ]; then
+	    rmdir --ignore-fail-on-non-empty $oldlocalsite 2>/dev/null || true
+	fi
+        ;;
+    deconfigure)
+        ;;
+    failed-upgrade)
+        ;;
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
--- python3.3-3.3.0.orig/debian/PVER-dbg.overrides.in
+++ python3.3-3.3.0/debian/PVER-dbg.overrides.in
@@ -0,0 +1,5 @@
+# just the gdb debug file
+@PVER@-dbg binary: python-script-but-no-python-dep
+
+# pointless lintian ...
+@PVER@-dbg binary: hardening-no-fortify-functions
--- python3.3-3.3.0.orig/debian/idle-PVER.overrides.in
+++ python3.3-3.3.0/debian/idle-PVER.overrides.in
@@ -0,0 +1,2 @@
+# icon in dependent package
+idle-@PVER@ binary: menu-icon-missing
--- python3.3-3.3.0.orig/debian/libPVER.symbols.lpia.in
+++ python3.3-3.3.0/debian/libPVER.symbols.lpia.in
@@ -0,0 +1,6 @@
+libpython@VER@m.so.1.0 libpython@VER@ #MINVER#
+#include "libpython.symbols"
+ PyModule_Create2@Base @SVER@
+ _Py_force_double@Base @SVER@
+ _Py_get_387controlword@Base @SVER@
+ _Py_set_387controlword@Base @SVER@
--- python3.3-3.3.0.orig/debian/pyvenv3.1
+++ python3.3-3.3.0/debian/pyvenv3.1
@@ -0,0 +1,34 @@
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.10.
+.TH PYVENV-3.3 "1" "June 2012" "pyvenv-3.3 3.3" "User Commands"
+.SH NAME
+pyvenv-3.3 \- create virtual python environments
+.SH DESCRIPTION
+usage: venv [\-h] [\-\-system\-site\-packages] [\-\-symlinks] [\-\-clear] [\-\-upgrade]
+.IP
+ENV_DIR [ENV_DIR ...]
+.PP
+Creates virtual Python environments in one or more target directories.
+.SS "positional arguments:"
+.TP
+ENV_DIR
+A directory to create the environment in.
+.SS "optional arguments:"
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+show this help message and exit
+.TP
+\fB\-\-system\-site\-packages\fR
+Give the virtual environment access to the system
+site\-packages dir.
+.TP
+\fB\-\-symlinks\fR
+Attempt to symlink rather than copy.
+.TP
+\fB\-\-clear\fR
+Delete the environment directory if it already exists.
+If not specified and the directory exists, an error is
+raised.
+.TP
+\fB\-\-upgrade\fR
+Upgrade the environment directory to use this version
+of Python, assuming Python has been upgraded in\-place.
--- python3.3-3.3.0.orig/debian/idle-PVER.menu.in
+++ python3.3-3.3.0/debian/idle-PVER.menu.in
@@ -0,0 +1,5 @@
+?package(idle-@PVER@):needs="X11" section="Applications/Programming"\
+	title="IDLE (Python v@VER@)"\
+	icon="/usr/share/pixmaps/@PVER@.xpm"\
+	command="/usr/bin/idle-@PVER@" \
+	hints="Environments"
--- python3.3-3.3.0.orig/debian/libpython.symbols.in
+++ python3.3-3.3.0/debian/libpython.symbols.in
@@ -0,0 +1,1466 @@
+ PyAST_Check@Base @SVER@
+ PyAST_Compile@Base @SVER@
+ PyAST_CompileEx@Base @SVER@
+ PyAST_FromNode@Base @SVER@
+ PyAST_Validate@Base @SVER@
+ PyAST_mod2obj@Base @SVER@
+ PyAST_obj2mod@Base @SVER@
+ PyArena_AddPyObject@Base @SVER@
+ PyArena_Free@Base @SVER@
+ PyArena_Malloc@Base @SVER@
+ PyArena_New@Base @SVER@
+ PyArg_Parse@Base @SVER@
+ PyArg_ParseTuple@Base @SVER@
+ PyArg_ParseTupleAndKeywords@Base @SVER@
+ PyArg_UnpackTuple@Base @SVER@
+ PyArg_VaParse@Base @SVER@
+ PyArg_VaParseTupleAndKeywords@Base @SVER@
+ PyArg_ValidateKeywordArguments@Base @SVER@
+ PyBaseObject_Type@Base @SVER@
+ PyBool_FromLong@Base @SVER@
+ PyBool_Type@Base @SVER@
+ PyBuffer_FillContiguousStrides@Base @SVER@
+ PyBuffer_FillInfo@Base @SVER@
+ PyBuffer_FromContiguous@Base @SVER@
+ PyBuffer_GetPointer@Base @SVER@
+ PyBuffer_IsContiguous@Base @SVER@
+ PyBuffer_Release@Base @SVER@
+ PyBuffer_ToContiguous@Base @SVER@
+ PyBufferedIOBase_Type@Base @SVER@
+ PyBufferedRWPair_Type@Base @SVER@
+ PyBufferedRandom_Type@Base @SVER@
+ PyBufferedReader_Type@Base @SVER@
+ PyBufferedWriter_Type@Base @SVER@
+ PyByteArrayIter_Type@Base @SVER@
+ PyByteArray_AsString@Base @SVER@
+ PyByteArray_Concat@Base @SVER@
+ PyByteArray_Fini@Base @SVER@
+ PyByteArray_FromObject@Base @SVER@
+ PyByteArray_FromStringAndSize@Base @SVER@
+ PyByteArray_Init@Base @SVER@
+ PyByteArray_Resize@Base @SVER@
+ PyByteArray_Size@Base @SVER@
+ PyByteArray_Type@Base @SVER@
+ PyBytesIO_Type@Base @SVER@
+ PyBytesIter_Type@Base @SVER@
+ PyBytes_AsString@Base @SVER@
+ PyBytes_AsStringAndSize@Base @SVER@
+ PyBytes_Concat@Base @SVER@
+ PyBytes_ConcatAndDel@Base @SVER@
+ PyBytes_DecodeEscape@Base @SVER@
+ PyBytes_Fini@Base @SVER@
+ PyBytes_FromFormat@Base @SVER@
+ PyBytes_FromFormatV@Base @SVER@
+ PyBytes_FromObject@Base @SVER@
+ PyBytes_FromString@Base @SVER@
+ PyBytes_FromStringAndSize@Base @SVER@
+ PyBytes_Repr@Base @SVER@
+ PyBytes_Size@Base @SVER@
+ PyBytes_Type@Base @SVER@
+ (optional)PyCArgObject_new@Base @SVER@
+ (optional)PyCArg_Type@Base @SVER@
+ (optional)PyCArrayType_Type@Base @SVER@
+ (optional)PyCArrayType_from_ctype@Base @SVER@
+ (optional)PyCArray_Type@Base @SVER@
+ (optional)PyCData_AtAddress@Base @SVER@
+ (optional)PyCData_FromBaseObj@Base @SVER@
+ (optional)PyCData_Type@Base @SVER@
+ (optional)PyCData_get@Base @SVER@
+ (optional)PyCData_set@Base @SVER@
+ (optional)PyCField_FromDesc@Base @SVER@
+ (optional)PyCField_Type@Base @SVER@
+ (optional)PyCFuncPtrType_Type@Base @SVER@
+ (optional)PyCFuncPtr_Type@Base @SVER@
+ PyCFunction_Call@Base @SVER@
+ PyCFunction_ClearFreeList@Base @SVER@
+ PyCFunction_Fini@Base @SVER@
+ PyCFunction_GetFlags@Base @SVER@
+ PyCFunction_GetFunction@Base @SVER@
+ PyCFunction_GetSelf@Base @SVER@
+ PyCFunction_New@Base @SVER@
+ PyCFunction_NewEx@Base @SVER@
+ PyCFunction_Type@Base @SVER@
+ (optional)PyCPointerType_Type@Base @SVER@
+ (optional)PyCPointer_Type@Base @SVER@
+ (optional)PyCSimpleType_Type@Base @SVER@
+ (optional)PyCStgDict_Type@Base @SVER@
+ (optional)PyCStgDict_clone@Base @SVER@
+ (optional)PyCStructType_Type@Base @SVER@
+ (optional)PyCStructUnionType_update_stgdict@Base @SVER@
+ (optional)PyCThunk_Type@Base @SVER@
+ PyCallIter_New@Base @SVER@
+ PyCallIter_Type@Base @SVER@
+ PyCallable_Check@Base @SVER@
+ PyCapsule_GetContext@Base @SVER@
+ PyCapsule_GetDestructor@Base @SVER@
+ PyCapsule_GetName@Base @SVER@
+ PyCapsule_GetPointer@Base @SVER@
+ PyCapsule_Import@Base @SVER@
+ PyCapsule_IsValid@Base @SVER@
+ PyCapsule_New@Base @SVER@
+ PyCapsule_SetContext@Base @SVER@
+ PyCapsule_SetDestructor@Base @SVER@
+ PyCapsule_SetName@Base @SVER@
+ PyCapsule_SetPointer@Base @SVER@
+ PyCapsule_Type@Base @SVER@
+ PyCell_Get@Base @SVER@
+ PyCell_New@Base @SVER@
+ PyCell_Set@Base @SVER@
+ PyCell_Type@Base @SVER@
+ PyClassMethodDescr_Type@Base @SVER@
+ PyClassMethod_New@Base @SVER@
+ PyClassMethod_Type@Base @SVER@
+ PyCode_Addr2Line@Base @SVER@
+ PyCode_New@Base @SVER@
+ PyCode_NewEmpty@Base @SVER@
+ PyCode_Optimize@Base @SVER@
+ PyCode_Type@Base @SVER@
+ PyCodec_BackslashReplaceErrors@Base @SVER@
+ PyCodec_Decode@Base @SVER@
+ PyCodec_Decoder@Base @SVER@
+ PyCodec_Encode@Base @SVER@
+ PyCodec_Encoder@Base @SVER@
+ PyCodec_IgnoreErrors@Base @SVER@
+ PyCodec_IncrementalDecoder@Base @SVER@
+ PyCodec_IncrementalEncoder@Base @SVER@
+ PyCodec_KnownEncoding@Base @SVER@
+ PyCodec_LookupError@Base @SVER@
+ PyCodec_Register@Base @SVER@
+ PyCodec_RegisterError@Base @SVER@
+ PyCodec_ReplaceErrors@Base @SVER@
+ PyCodec_StreamReader@Base @SVER@
+ PyCodec_StreamWriter@Base @SVER@
+ PyCodec_StrictErrors@Base @SVER@
+ PyCodec_XMLCharRefReplaceErrors@Base @SVER@
+ PyCompileString@Base @SVER@
+ PyComplex_AsCComplex@Base @SVER@
+ PyComplex_FromCComplex@Base @SVER@
+ PyComplex_FromDoubles@Base @SVER@
+ PyComplex_ImagAsDouble@Base @SVER@
+ PyComplex_RealAsDouble@Base @SVER@
+ PyComplex_Type@Base @SVER@
+ PyDescr_NewClassMethod@Base @SVER@
+ PyDescr_NewGetSet@Base @SVER@
+ PyDescr_NewMember@Base @SVER@
+ PyDescr_NewMethod@Base @SVER@
+ PyDescr_NewWrapper@Base @SVER@
+ PyDictItems_Type@Base @SVER@
+ PyDictIterItem_Type@Base @SVER@
+ PyDictIterKey_Type@Base @SVER@
+ PyDictIterValue_Type@Base @SVER@
+ PyDictKeys_Type@Base @SVER@
+ PyDictProxy_New@Base @SVER@
+ PyDictProxy_Type@Base @SVER@
+ PyDictValues_Type@Base @SVER@
+ PyDict_Clear@Base @SVER@
+ PyDict_ClearFreeList@Base @SVER@
+ PyDict_Contains@Base @SVER@
+ PyDict_Copy@Base @SVER@
+ PyDict_DelItem@Base @SVER@
+ PyDict_DelItemString@Base @SVER@
+ PyDict_Fini@Base @SVER@
+ PyDict_GetItem@Base @SVER@
+ (optional)PyDict_GetItemProxy@Base @SVER@
+ PyDict_GetItemString@Base @SVER@
+ PyDict_GetItemWithError@Base @SVER@
+ PyDict_Items@Base @SVER@
+ PyDict_Keys@Base @SVER@
+ PyDict_Merge@Base @SVER@
+ PyDict_MergeFromSeq2@Base @SVER@
+ PyDict_New@Base @SVER@
+ PyDict_Next@Base @SVER@
+ PyDict_SetItem@Base @SVER@
+ (optional)PyDict_SetItemProxy@Base @SVER@
+ PyDict_SetItemString@Base @SVER@
+ PyDict_Size@Base @SVER@
+ PyDict_Type@Base @SVER@
+ PyDict_Update@Base @SVER@
+ PyDict_Values@Base @SVER@
+ PyEllipsis_Type@Base @SVER@
+ PyEnum_Type@Base @SVER@
+ PyErr_BadArgument@Base @SVER@
+ PyErr_BadInternalCall@Base @SVER@
+ PyErr_CheckSignals@Base @SVER@
+ PyErr_Clear@Base @SVER@
+ PyErr_Display@Base @SVER@
+ PyErr_ExceptionMatches@Base @SVER@
+ PyErr_Fetch@Base @SVER@
+ PyErr_Format@Base @SVER@
+ PyErr_GetExcInfo@Base @SVER@
+ PyErr_GivenExceptionMatches@Base @SVER@
+ PyErr_NewException@Base @SVER@
+ PyErr_NewExceptionWithDoc@Base @SVER@
+ PyErr_NoMemory@Base @SVER@
+ PyErr_NormalizeException@Base @SVER@
+ PyErr_Occurred@Base @SVER@
+ PyErr_Print@Base @SVER@
+ PyErr_PrintEx@Base @SVER@
+ PyErr_ProgramText@Base @SVER@
+ PyErr_Restore@Base @SVER@
+ PyErr_SetExcInfo@Base @SVER@
+ PyErr_SetFromErrno@Base @SVER@
+ PyErr_SetFromErrnoWithFilename@Base @SVER@
+ PyErr_SetFromErrnoWithFilenameObject@Base @SVER@
+ PyErr_SetImportError@Base @SVER@
+ PyErr_SetInterrupt@Base @SVER@
+ PyErr_SetNone@Base @SVER@
+ PyErr_SetObject@Base @SVER@
+ PyErr_SetString@Base @SVER@
+ PyErr_SyntaxLocation@Base @SVER@
+ PyErr_SyntaxLocationEx@Base @SVER@
+ PyErr_Warn@Base @SVER@
+ PyErr_WarnEx@Base @SVER@
+ PyErr_WarnExplicit@Base @SVER@
+ PyErr_WarnFormat@Base @SVER@
+ PyErr_WriteUnraisable@Base @SVER@
+ PyEval_AcquireLock@Base @SVER@
+ PyEval_AcquireThread@Base @SVER@
+ PyEval_CallFunction@Base @SVER@
+ PyEval_CallMethod@Base @SVER@
+ PyEval_CallObjectWithKeywords@Base @SVER@
+ PyEval_EvalCode@Base @SVER@
+ PyEval_EvalCodeEx@Base @SVER@
+ PyEval_EvalFrame@Base @SVER@
+ PyEval_EvalFrameEx@Base @SVER@
+ PyEval_GetBuiltins@Base @SVER@
+ PyEval_GetCallStats@Base @SVER@
+ PyEval_GetFrame@Base @SVER@
+ PyEval_GetFuncDesc@Base @SVER@
+ PyEval_GetFuncName@Base @SVER@
+ PyEval_GetGlobals@Base @SVER@
+ PyEval_GetLocals@Base @SVER@
+ PyEval_InitThreads@Base @SVER@
+ PyEval_MergeCompilerFlags@Base @SVER@
+ PyEval_ReInitThreads@Base @SVER@
+ PyEval_ReleaseLock@Base @SVER@
+ PyEval_ReleaseThread@Base @SVER@
+ PyEval_RestoreThread@Base @SVER@
+ PyEval_SaveThread@Base @SVER@
+ PyEval_SetProfile@Base @SVER@
+ PyEval_SetTrace@Base @SVER@
+ PyEval_ThreadsInitialized@Base @SVER@
+ (optional)PyExc_ArgError@Base @SVER@
+ PyExc_ArithmeticError@Base @SVER@
+ PyExc_AssertionError@Base @SVER@
+ PyExc_AttributeError@Base @SVER@
+ PyExc_BaseException@Base @SVER@
+ PyExc_BlockingIOError@Base @SVER@
+ PyExc_BrokenPipeError@Base @SVER@
+ PyExc_BufferError@Base @SVER@
+ PyExc_BytesWarning@Base @SVER@
+ PyExc_ChildProcessError@Base @SVER@
+ PyExc_ConnectionAbortedError@Base @SVER@
+ PyExc_ConnectionError@Base @SVER@
+ PyExc_ConnectionRefusedError@Base @SVER@
+ PyExc_ConnectionResetError@Base @SVER@
+ PyExc_DeprecationWarning@Base @SVER@
+ PyExc_EOFError@Base @SVER@
+ PyExc_EnvironmentError@Base @SVER@
+ PyExc_Exception@Base @SVER@
+ PyExc_FileExistsError@Base @SVER@
+ PyExc_FileNotFoundError@Base @SVER@
+ PyExc_FloatingPointError@Base @SVER@
+ PyExc_FutureWarning@Base @SVER@
+ PyExc_GeneratorExit@Base @SVER@
+ PyExc_IOError@Base @SVER@
+ PyExc_ImportError@Base @SVER@
+ PyExc_ImportWarning@Base @SVER@
+ PyExc_IndentationError@Base @SVER@
+ PyExc_IndexError@Base @SVER@
+ PyExc_InterruptedError@Base @SVER@
+ PyExc_IsADirectoryError@Base @SVER@
+ PyExc_KeyError@Base @SVER@
+ PyExc_KeyboardInterrupt@Base @SVER@
+ PyExc_LookupError@Base @SVER@
+ PyExc_MemoryError@Base @SVER@
+ PyExc_NameError@Base @SVER@
+ PyExc_NotADirectoryError@Base @SVER@
+ PyExc_NotImplementedError@Base @SVER@
+ PyExc_OSError@Base @SVER@
+ PyExc_OverflowError@Base @SVER@
+ PyExc_PendingDeprecationWarning@Base @SVER@
+ PyExc_PermissionError@Base @SVER@
+ PyExc_ProcessLookupError@Base @SVER@
+ PyExc_RecursionErrorInst@Base @SVER@
+ PyExc_ReferenceError@Base @SVER@
+ PyExc_ResourceWarning@Base @SVER@
+ PyExc_RuntimeError@Base @SVER@
+ PyExc_RuntimeWarning@Base @SVER@
+ PyExc_StopIteration@Base @SVER@
+ PyExc_SyntaxError@Base @SVER@
+ PyExc_SyntaxWarning@Base @SVER@
+ PyExc_SystemError@Base @SVER@
+ PyExc_SystemExit@Base @SVER@
+ PyExc_TabError@Base @SVER@
+ PyExc_TimeoutError@Base @SVER@
+ PyExc_TypeError@Base @SVER@
+ PyExc_UnboundLocalError@Base @SVER@
+ PyExc_UnicodeDecodeError@Base @SVER@
+ PyExc_UnicodeEncodeError@Base @SVER@
+ PyExc_UnicodeError@Base @SVER@
+ PyExc_UnicodeTranslateError@Base @SVER@
+ PyExc_UnicodeWarning@Base @SVER@
+ PyExc_UserWarning@Base @SVER@
+ PyExc_ValueError@Base @SVER@
+ PyExc_Warning@Base @SVER@
+ PyExc_ZeroDivisionError@Base @SVER@
+ PyException_GetCause@Base @SVER@
+ PyException_GetContext@Base @SVER@
+ PyException_GetTraceback@Base @SVER@
+ PyException_SetCause@Base @SVER@
+ PyException_SetContext@Base @SVER@
+ PyException_SetTraceback@Base @SVER@
+ PyFPE_counter@Base @SVER@
+ PyFPE_dummy@Base @SVER@
+ PyFPE_jbuf@Base @SVER@
+ PyFileIO_Type@Base @SVER@
+ PyFile_FromFd@Base @SVER@
+ PyFile_GetLine@Base @SVER@
+ PyFile_NewStdPrinter@Base @SVER@
+ PyFile_WriteObject@Base @SVER@
+ PyFile_WriteString@Base @SVER@
+ PyFilter_Type@Base @SVER@
+ PyFloat_AsDouble@Base @SVER@
+ PyFloat_ClearFreeList@Base @SVER@
+ PyFloat_Fini@Base @SVER@
+ PyFloat_FromDouble@Base @SVER@
+ PyFloat_FromString@Base @SVER@
+ PyFloat_GetInfo@Base @SVER@
+ PyFloat_GetMax@Base @SVER@
+ PyFloat_GetMin@Base @SVER@
+ PyFloat_Type@Base @SVER@
+ PyFrame_BlockPop@Base @SVER@
+ PyFrame_BlockSetup@Base @SVER@
+ PyFrame_ClearFreeList@Base @SVER@
+ PyFrame_FastToLocals@Base @SVER@
+ PyFrame_Fini@Base @SVER@
+ PyFrame_GetLineNumber@Base @SVER@
+ PyFrame_LocalsToFast@Base @SVER@
+ PyFrame_New@Base @SVER@
+ PyFrame_Type@Base @SVER@
+ PyFrozenSet_New@Base @SVER@
+ PyFrozenSet_Type@Base @SVER@
+ PyFunction_GetAnnotations@Base @SVER@
+ PyFunction_GetClosure@Base @SVER@
+ PyFunction_GetCode@Base @SVER@
+ PyFunction_GetDefaults@Base @SVER@
+ PyFunction_GetGlobals@Base @SVER@
+ PyFunction_GetKwDefaults@Base @SVER@
+ PyFunction_GetModule@Base @SVER@
+ PyFunction_New@Base @SVER@
+ PyFunction_NewWithQualName@Base @SVER@
+ PyFunction_SetAnnotations@Base @SVER@
+ PyFunction_SetClosure@Base @SVER@
+ PyFunction_SetDefaults@Base @SVER@
+ PyFunction_SetKwDefaults@Base @SVER@
+ PyFunction_Type@Base @SVER@
+ PyFuture_FromAST@Base @SVER@
+ PyGC_Collect@Base @SVER@
+ PyGILState_Ensure@Base @SVER@
+ PyGILState_GetThisThreadState@Base @SVER@
+ PyGILState_Release@Base @SVER@
+ PyGen_NeedsFinalizing@Base @SVER@
+ PyGen_New@Base @SVER@
+ PyGen_Type@Base @SVER@
+ PyGetSetDescr_Type@Base @SVER@
+ PyGrammar_AddAccelerators@Base @SVER@
+ PyGrammar_FindDFA@Base @SVER@
+ PyGrammar_LabelRepr@Base @SVER@
+ PyGrammar_RemoveAccelerators@Base @SVER@
+ PyIOBase_Type@Base @SVER@
+ PyImport_AddModule@Base @SVER@
+ PyImport_AddModuleObject@Base @SVER@
+ PyImport_AppendInittab@Base @SVER@
+ PyImport_Cleanup@Base @SVER@
+ PyImport_ExecCodeModule@Base @SVER@
+ PyImport_ExecCodeModuleEx@Base @SVER@
+ PyImport_ExecCodeModuleObject@Base @SVER@
+ PyImport_ExecCodeModuleWithPathnames@Base @SVER@
+ PyImport_ExtendInittab@Base @SVER@
+ PyImport_FrozenModules@Base @SVER@
+ PyImport_GetImporter@Base @SVER@
+ PyImport_GetMagicNumber@Base @SVER@
+ PyImport_GetMagicTag@Base @SVER@
+ PyImport_GetModuleDict@Base @SVER@
+ PyImport_Import@Base @SVER@
+ PyImport_ImportFrozenModule@Base @SVER@
+ PyImport_ImportFrozenModuleObject@Base @SVER@
+ PyImport_ImportModule@Base @SVER@
+ PyImport_ImportModuleLevel@Base @SVER@
+ PyImport_ImportModuleLevelObject@Base @SVER@
+ PyImport_ImportModuleNoBlock@Base @SVER@
+ PyImport_Inittab@Base @SVER@
+ PyImport_ReloadModule@Base @SVER@
+ PyIncrementalNewlineDecoder_Type@Base @SVER@
+ PyInstanceMethod_Function@Base @SVER@
+ PyInstanceMethod_New@Base @SVER@
+ PyInstanceMethod_Type@Base @SVER@
+ PyInterpreterState_Clear@Base @SVER@
+ PyInterpreterState_Delete@Base @SVER@
+ PyInterpreterState_Head@Base @SVER@
+ PyInterpreterState_New@Base @SVER@
+ PyInterpreterState_Next@Base @SVER@
+ PyInterpreterState_ThreadHead@Base @SVER@
+ PyIter_Next@Base @SVER@
+ PyListIter_Type@Base @SVER@
+ PyListRevIter_Type@Base @SVER@
+ PyList_Append@Base @SVER@
+ PyList_AsTuple@Base @SVER@
+ PyList_ClearFreeList@Base @SVER@
+ PyList_Fini@Base @SVER@
+ PyList_GetItem@Base @SVER@
+ PyList_GetSlice@Base @SVER@
+ PyList_Insert@Base @SVER@
+ PyList_New@Base @SVER@
+ PyList_Reverse@Base @SVER@
+ PyList_SetItem@Base @SVER@
+ PyList_SetSlice@Base @SVER@
+ PyList_Size@Base @SVER@
+ PyList_Sort@Base @SVER@
+ PyList_Type@Base @SVER@
+ PyLongRangeIter_Type@Base @SVER@
+ PyLong_AsDouble@Base @SVER@
+ PyLong_AsLong@Base @SVER@
+ PyLong_AsLongAndOverflow@Base @SVER@
+ PyLong_AsLongLong@Base @SVER@
+ PyLong_AsLongLongAndOverflow@Base @SVER@
+ PyLong_AsSize_t@Base @SVER@
+ PyLong_AsSsize_t@Base @SVER@
+ PyLong_AsUnsignedLong@Base @SVER@
+ PyLong_AsUnsignedLongLong@Base @SVER@
+ PyLong_AsUnsignedLongLongMask@Base @SVER@
+ PyLong_AsUnsignedLongMask@Base @SVER@
+ PyLong_AsVoidPtr@Base @SVER@
+ PyLong_Fini@Base @SVER@
+ PyLong_FromDouble@Base @SVER@
+ PyLong_FromLong@Base @SVER@
+ PyLong_FromLongLong@Base @SVER@
+ PyLong_FromSize_t@Base @SVER@
+ PyLong_FromSsize_t@Base @SVER@
+ PyLong_FromString@Base @SVER@
+ PyLong_FromUnicode@Base @SVER@
+ PyLong_FromUnicodeObject@Base @SVER@
+ PyLong_FromUnsignedLong@Base @SVER@
+ PyLong_FromUnsignedLongLong@Base @SVER@
+ PyLong_FromVoidPtr@Base @SVER@
+ PyLong_GetInfo@Base @SVER@
+ PyLong_Type@Base @SVER@
+ PyMap_Type@Base @SVER@
+ PyMapping_Check@Base @SVER@
+ PyMapping_GetItemString@Base @SVER@
+ PyMapping_HasKey@Base @SVER@
+ PyMapping_HasKeyString@Base @SVER@
+ PyMapping_Items@Base @SVER@
+ PyMapping_Keys@Base @SVER@
+ PyMapping_Length@Base @SVER@
+ PyMapping_SetItemString@Base @SVER@
+ PyMapping_Size@Base @SVER@
+ PyMapping_Values@Base @SVER@
+ PyMarshal_Init@Base @SVER@
+ PyMarshal_ReadLastObjectFromFile@Base @SVER@
+ PyMarshal_ReadLongFromFile@Base @SVER@
+ PyMarshal_ReadObjectFromFile@Base @SVER@
+ PyMarshal_ReadObjectFromString@Base @SVER@
+ PyMarshal_ReadShortFromFile@Base @SVER@
+ PyMarshal_WriteLongToFile@Base @SVER@
+ PyMarshal_WriteObjectToFile@Base @SVER@
+ PyMarshal_WriteObjectToString@Base @SVER@
+ PyMem_Free@Base @SVER@
+ PyMem_Malloc@Base @SVER@
+ PyMem_Realloc@Base @SVER@
+ PyMemberDescr_Type@Base @SVER@
+ PyMember_GetOne@Base @SVER@
+ PyMember_SetOne@Base @SVER@
+ PyMemoryView_FromBuffer@Base @SVER@
+ PyMemoryView_FromMemory@Base @SVER@
+ PyMemoryView_FromObject@Base @SVER@
+ PyMemoryView_GetContiguous@Base @SVER@
+ PyMemoryView_Type@Base @SVER@
+ PyMethodDescr_Type@Base @SVER@
+ PyMethod_ClearFreeList@Base @SVER@
+ PyMethod_Fini@Base @SVER@
+ PyMethod_Function@Base @SVER@
+ PyMethod_New@Base @SVER@
+ PyMethod_Self@Base @SVER@
+ PyMethod_Type@Base @SVER@
+ PyModule_AddIntConstant@Base @SVER@
+ PyModule_AddObject@Base @SVER@
+ PyModule_AddStringConstant@Base @SVER@
+ PyModule_GetDef@Base @SVER@
+ PyModule_GetDict@Base @SVER@
+ PyModule_GetFilename@Base @SVER@
+ PyModule_GetFilenameObject@Base @SVER@
+ PyModule_GetName@Base @SVER@
+ PyModule_GetNameObject@Base @SVER@
+ PyModule_GetState@Base @SVER@
+ PyModule_GetWarningsModule@Base @SVER@
+ PyModule_New@Base @SVER@
+ PyModule_NewObject@Base @SVER@
+ PyModule_Type@Base @SVER@
+ PyNode_AddChild@Base @SVER@
+ PyNode_Compile@Base @SVER@
+ PyNode_Free@Base @SVER@
+ PyNode_ListTree@Base @SVER@
+ PyNode_New@Base @SVER@
+ PyNumber_Absolute@Base @SVER@
+ PyNumber_Add@Base @SVER@
+ PyNumber_And@Base @SVER@
+ PyNumber_AsOff_t@Base @SVER@
+ PyNumber_AsSsize_t@Base @SVER@
+ PyNumber_Check@Base @SVER@
+ PyNumber_Divmod@Base @SVER@
+ PyNumber_Float@Base @SVER@
+ PyNumber_FloorDivide@Base @SVER@
+ PyNumber_InPlaceAdd@Base @SVER@
+ PyNumber_InPlaceAnd@Base @SVER@
+ PyNumber_InPlaceFloorDivide@Base @SVER@
+ PyNumber_InPlaceLshift@Base @SVER@
+ PyNumber_InPlaceMultiply@Base @SVER@
+ PyNumber_InPlaceOr@Base @SVER@
+ PyNumber_InPlacePower@Base @SVER@
+ PyNumber_InPlaceRemainder@Base @SVER@
+ PyNumber_InPlaceRshift@Base @SVER@
+ PyNumber_InPlaceSubtract@Base @SVER@
+ PyNumber_InPlaceTrueDivide@Base @SVER@
+ PyNumber_InPlaceXor@Base @SVER@
+ PyNumber_Index@Base @SVER@
+ PyNumber_Invert@Base @SVER@
+ PyNumber_Long@Base @SVER@
+ PyNumber_Lshift@Base @SVER@
+ PyNumber_Multiply@Base @SVER@
+ PyNumber_Negative@Base @SVER@
+ PyNumber_Or@Base @SVER@
+ PyNumber_Positive@Base @SVER@
+ PyNumber_Power@Base @SVER@
+ PyNumber_Remainder@Base @SVER@
+ PyNumber_Rshift@Base @SVER@
+ PyNumber_Subtract@Base @SVER@
+ PyNumber_ToBase@Base @SVER@
+ PyNumber_TrueDivide@Base @SVER@
+ PyNumber_Xor@Base @SVER@
+ PyOS_AfterFork@Base @SVER@
+ PyOS_FiniInterrupts@Base @SVER@
+ PyOS_InitInterrupts@Base @SVER@
+ PyOS_InputHook@Base @SVER@
+ PyOS_InterruptOccurred@Base @SVER@
+ PyOS_Readline@Base @SVER@
+ PyOS_ReadlineFunctionPointer@Base @SVER@
+ PyOS_StdioReadline@Base @SVER@
+ PyOS_double_to_string@Base @SVER@
+ PyOS_getsig@Base @SVER@
+ PyOS_mystricmp@Base @SVER@
+ PyOS_mystrnicmp@Base @SVER@
+ PyOS_setsig@Base @SVER@
+ PyOS_snprintf@Base @SVER@
+ PyOS_string_to_double@Base @SVER@
+ PyOS_strtol@Base @SVER@
+ PyOS_strtoul@Base @SVER@
+ PyOS_vsnprintf@Base @SVER@
+ PyObject_ASCII@Base @SVER@
+ PyObject_AsCharBuffer@Base @SVER@
+ PyObject_AsFileDescriptor@Base @SVER@
+ PyObject_AsReadBuffer@Base @SVER@
+ PyObject_AsWriteBuffer@Base @SVER@
+ PyObject_Bytes@Base @SVER@
+ PyObject_Call@Base @SVER@
+ PyObject_CallFunction@Base @SVER@
+ PyObject_CallFunctionObjArgs@Base @SVER@
+ PyObject_CallMethod@Base @SVER@
+ PyObject_CallMethodObjArgs@Base @SVER@
+ PyObject_CallObject@Base @SVER@
+ PyObject_CheckReadBuffer@Base @SVER@
+ PyObject_ClearWeakRefs@Base @SVER@
+ PyObject_CopyData@Base @SVER@
+ PyObject_DelItem@Base @SVER@
+ PyObject_DelItemString@Base @SVER@
+ PyObject_Dir@Base @SVER@
+ PyObject_Format@Base @SVER@
+ PyObject_Free@Base @SVER@
+ PyObject_GC_Del@Base @SVER@
+ PyObject_GC_Track@Base @SVER@
+ PyObject_GC_UnTrack@Base @SVER@
+ PyObject_GenericGetAttr@Base @SVER@
+ PyObject_GenericGetDict@Base @SVER@
+ PyObject_GenericSetAttr@Base @SVER@
+ PyObject_GenericSetDict@Base @SVER@
+ PyObject_GetAttr@Base @SVER@
+ PyObject_GetAttrString@Base @SVER@
+ PyObject_GetBuffer@Base @SVER@
+ PyObject_GetItem@Base @SVER@
+ PyObject_GetIter@Base @SVER@
+ PyObject_HasAttr@Base @SVER@
+ PyObject_HasAttrString@Base @SVER@
+ PyObject_Hash@Base @SVER@
+ PyObject_HashNotImplemented@Base @SVER@
+ PyObject_Init@Base @SVER@
+ PyObject_InitVar@Base @SVER@
+ PyObject_IsInstance@Base @SVER@
+ PyObject_IsSubclass@Base @SVER@
+ PyObject_IsTrue@Base @SVER@
+ PyObject_Length@Base @SVER@
+ PyObject_Malloc@Base @SVER@
+ PyObject_Not@Base @SVER@
+ PyObject_Print@Base @SVER@
+ PyObject_Realloc@Base @SVER@
+ PyObject_Repr@Base @SVER@
+ PyObject_RichCompare@Base @SVER@
+ PyObject_RichCompareBool@Base @SVER@
+ PyObject_SelfIter@Base @SVER@
+ PyObject_SetAttr@Base @SVER@
+ PyObject_SetAttrString@Base @SVER@
+ PyObject_SetItem@Base @SVER@
+ PyObject_Size@Base @SVER@
+ PyObject_Str@Base @SVER@
+ PyObject_Type@Base @SVER@
+ (optional)PyObject_stgdict@Base @SVER@
+ PyParser_ASTFromFile@Base @SVER@
+ PyParser_ASTFromString@Base @SVER@
+ PyParser_AddToken@Base @SVER@
+ PyParser_ClearError@Base @SVER@
+ PyParser_Delete@Base @SVER@
+ PyParser_New@Base @SVER@
+ PyParser_ParseFile@Base @SVER@
+ PyParser_ParseFileFlags@Base @SVER@
+ PyParser_ParseFileFlagsEx@Base @SVER@
+ PyParser_ParseString@Base @SVER@
+ PyParser_ParseStringFlags@Base @SVER@
+ PyParser_ParseStringFlagsFilename@Base @SVER@
+ PyParser_ParseStringFlagsFilenameEx@Base @SVER@
+ PyParser_SetError@Base @SVER@
+ PyParser_SimpleParseFile@Base @SVER@
+ PyParser_SimpleParseFileFlags@Base @SVER@
+ PyParser_SimpleParseString@Base @SVER@
+ PyParser_SimpleParseStringFilename@Base @SVER@
+ PyParser_SimpleParseStringFlags@Base @SVER@
+ PyParser_SimpleParseStringFlagsFilename@Base @SVER@
+ PyProperty_Type@Base @SVER@
+ PyRangeIter_Type@Base @SVER@
+ PyRange_Type@Base @SVER@
+ PyRawIOBase_Type@Base @SVER@
+ PyReversed_Type@Base @SVER@
+ PyRun_AnyFile@Base @SVER@
+ PyRun_AnyFileEx@Base @SVER@
+ PyRun_AnyFileExFlags@Base @SVER@
+ PyRun_AnyFileFlags@Base @SVER@
+ PyRun_File@Base @SVER@
+ PyRun_FileEx@Base @SVER@
+ PyRun_FileExFlags@Base @SVER@
+ PyRun_FileFlags@Base @SVER@
+ PyRun_InteractiveLoop@Base @SVER@
+ PyRun_InteractiveLoopFlags@Base @SVER@
+ PyRun_InteractiveOne@Base @SVER@
+ PyRun_InteractiveOneFlags@Base @SVER@
+ PyRun_SimpleFile@Base @SVER@
+ PyRun_SimpleFileEx@Base @SVER@
+ PyRun_SimpleFileExFlags@Base @SVER@
+ PyRun_SimpleString@Base @SVER@
+ PyRun_SimpleStringFlags@Base @SVER@
+ PyRun_String@Base @SVER@
+ PyRun_StringFlags@Base @SVER@
+ PySTEntry_Type@Base @SVER@
+ PyST_GetScope@Base @SVER@
+ PySeqIter_New@Base @SVER@
+ PySeqIter_Type@Base @SVER@
+ PySequence_Check@Base @SVER@
+ PySequence_Concat@Base @SVER@
+ PySequence_Contains@Base @SVER@
+ PySequence_Count@Base @SVER@
+ PySequence_DelItem@Base @SVER@
+ PySequence_DelSlice@Base @SVER@
+ PySequence_Fast@Base @SVER@
+ PySequence_GetItem@Base @SVER@
+ PySequence_GetSlice@Base @SVER@
+ PySequence_In@Base @SVER@
+ PySequence_InPlaceConcat@Base @SVER@
+ PySequence_InPlaceRepeat@Base @SVER@
+ PySequence_Index@Base @SVER@
+ PySequence_Length@Base @SVER@
+ PySequence_List@Base @SVER@
+ PySequence_Repeat@Base @SVER@
+ PySequence_SetItem@Base @SVER@
+ PySequence_SetSlice@Base @SVER@
+ PySequence_Size@Base @SVER@
+ PySequence_Tuple@Base @SVER@
+ PySetIter_Type@Base @SVER@
+ PySet_Add@Base @SVER@
+ PySet_Clear@Base @SVER@
+ PySet_ClearFreeList@Base @SVER@
+ PySet_Contains@Base @SVER@
+ PySet_Discard@Base @SVER@
+ PySet_Fini@Base @SVER@
+ PySet_New@Base @SVER@
+ PySet_Pop@Base @SVER@
+ PySet_Size@Base @SVER@
+ PySet_Type@Base @SVER@
+ PySignal_SetWakeupFd@Base @SVER@
+ PySlice_Fini@Base @SVER@
+ PySlice_GetIndices@Base @SVER@
+ PySlice_GetIndicesEx@Base @SVER@
+ PySlice_New@Base @SVER@
+ PySlice_Type@Base @SVER@
+ PyState_AddModule@Base @SVER@
+ PyState_FindModule@Base @SVER@
+ PyState_RemoveModule@Base @SVER@
+ PyStaticMethod_New@Base @SVER@
+ PyStaticMethod_Type@Base @SVER@
+ PyStdPrinter_Type@Base @SVER@
+ PyStringIO_Type@Base @SVER@
+ PyStructSequence_GetItem@Base @SVER@
+ PyStructSequence_InitType@Base @SVER@
+ PyStructSequence_New@Base @SVER@
+ PyStructSequence_NewType@Base @SVER@
+ PyStructSequence_SetItem@Base @SVER@
+ PyStructSequence_UnnamedField@Base @SVER@
+ PySuper_Type@Base @SVER@
+ PySymtable_Build@Base @SVER@
+ PySymtable_Free@Base @SVER@
+ PySymtable_Lookup@Base @SVER@
+ PySys_AddWarnOption@Base @SVER@
+ PySys_AddWarnOptionUnicode@Base @SVER@
+ PySys_AddXOption@Base @SVER@
+ PySys_FormatStderr@Base @SVER@
+ PySys_FormatStdout@Base @SVER@
+ PySys_GetObject@Base @SVER@
+ PySys_GetXOptions@Base @SVER@
+ PySys_HasWarnOptions@Base @SVER@
+ PySys_ResetWarnOptions@Base @SVER@
+ PySys_SetArgv@Base @SVER@
+ PySys_SetArgvEx@Base @SVER@
+ PySys_SetObject@Base @SVER@
+ PySys_SetPath@Base @SVER@
+ PySys_WriteStderr@Base @SVER@
+ PySys_WriteStdout@Base @SVER@
+ PyTextIOBase_Type@Base @SVER@
+ PyTextIOWrapper_Type@Base @SVER@
+ PyThreadState_Clear@Base @SVER@
+ PyThreadState_Delete@Base @SVER@
+ PyThreadState_DeleteCurrent@Base @SVER@
+ PyThreadState_Get@Base @SVER@
+ PyThreadState_GetDict@Base @SVER@
+ PyThreadState_New@Base @SVER@
+ PyThreadState_Next@Base @SVER@
+ PyThreadState_SetAsyncExc@Base @SVER@
+ PyThreadState_Swap@Base @SVER@
+ PyThread_GetInfo@Base @SVER@
+ PyThread_ReInitTLS@Base @SVER@
+ PyThread_acquire_lock@Base @SVER@
+ PyThread_acquire_lock_timed@Base @SVER@
+ PyThread_allocate_lock@Base @SVER@
+ PyThread_create_key@Base @SVER@
+ PyThread_delete_key@Base @SVER@
+ PyThread_delete_key_value@Base @SVER@
+ PyThread_exit_thread@Base @SVER@
+ PyThread_free_lock@Base @SVER@
+ PyThread_get_key_value@Base @SVER@
+ PyThread_get_stacksize@Base @SVER@
+ PyThread_get_thread_ident@Base @SVER@
+ PyThread_init_thread@Base @SVER@
+ PyThread_release_lock@Base @SVER@
+ PyThread_set_key_value@Base @SVER@
+ PyThread_set_stacksize@Base @SVER@
+ PyThread_start_new_thread@Base @SVER@
+ PyToken_OneChar@Base @SVER@
+ PyToken_ThreeChars@Base @SVER@
+ PyToken_TwoChars@Base @SVER@
+ PyTokenizer_FindEncoding@Base @SVER@
+ PyTokenizer_FindEncodingFilename@Base @SVER@
+ PyTokenizer_Free@Base @SVER@
+ PyTokenizer_FromFile@Base @SVER@
+ PyTokenizer_FromString@Base @SVER@
+ PyTokenizer_FromUTF8@Base @SVER@
+ PyTokenizer_Get@Base @SVER@
+ PyTraceBack_Here@Base @SVER@
+ PyTraceBack_Print@Base @SVER@
+ PyTraceBack_Type@Base @SVER@
+ PyTupleIter_Type@Base @SVER@
+ PyTuple_ClearFreeList@Base @SVER@
+ PyTuple_Fini@Base @SVER@
+ PyTuple_GetItem@Base @SVER@
+ PyTuple_GetSlice@Base @SVER@
+ PyTuple_New@Base @SVER@
+ PyTuple_Pack@Base @SVER@
+ PyTuple_SetItem@Base @SVER@
+ PyTuple_Size@Base @SVER@
+ PyTuple_Type@Base @SVER@
+ PyType_ClearCache@Base @SVER@
+ PyType_FromSpec@Base @SVER@
+ PyType_FromSpecWithBases@Base @SVER@
+ PyType_GenericAlloc@Base @SVER@
+ PyType_GenericNew@Base @SVER@
+ PyType_GetFlags@Base @SVER@
+ PyType_IsSubtype@Base @SVER@
+ PyType_Modified@Base @SVER@
+ PyType_Ready@Base @SVER@
+ PyType_Type@Base @SVER@
+ (optional)PyType_stgdict@Base @SVER@
+ PyUnicodeDecodeError_Create@Base @SVER@
+ PyUnicodeDecodeError_GetEncoding@Base @SVER@
+ PyUnicodeDecodeError_GetEnd@Base @SVER@
+ PyUnicodeDecodeError_GetObject@Base @SVER@
+ PyUnicodeDecodeError_GetReason@Base @SVER@
+ PyUnicodeDecodeError_GetStart@Base @SVER@
+ PyUnicodeDecodeError_SetEnd@Base @SVER@
+ PyUnicodeDecodeError_SetReason@Base @SVER@
+ PyUnicodeDecodeError_SetStart@Base @SVER@
+ PyUnicodeEncodeError_Create@Base @SVER@
+ PyUnicodeEncodeError_GetEncoding@Base @SVER@
+ PyUnicodeEncodeError_GetEnd@Base @SVER@
+ PyUnicodeEncodeError_GetObject@Base @SVER@
+ PyUnicodeEncodeError_GetReason@Base @SVER@
+ PyUnicodeEncodeError_GetStart@Base @SVER@
+ PyUnicodeEncodeError_SetEnd@Base @SVER@
+ PyUnicodeEncodeError_SetReason@Base @SVER@
+ PyUnicodeEncodeError_SetStart@Base @SVER@
+ PyUnicodeIter_Type@Base @SVER@
+ PyUnicodeTranslateError_Create@Base @SVER@
+ PyUnicodeTranslateError_GetEnd@Base @SVER@
+ PyUnicodeTranslateError_GetObject@Base @SVER@
+ PyUnicodeTranslateError_GetReason@Base @SVER@
+ PyUnicodeTranslateError_GetStart@Base @SVER@
+ PyUnicodeTranslateError_SetEnd@Base @SVER@
+ PyUnicodeTranslateError_SetReason@Base @SVER@
+ PyUnicodeTranslateError_SetStart@Base @SVER@
+ PyUnicode_Append@Base @SVER@
+ PyUnicode_AppendAndDel@Base @SVER@
+ PyUnicode_AsASCIIString@Base @SVER@
+ PyUnicode_AsCharmapString@Base @SVER@
+ PyUnicode_AsDecodedObject@Base @SVER@
+ PyUnicode_AsDecodedUnicode@Base @SVER@
+ PyUnicode_AsEncodedObject@Base @SVER@
+ PyUnicode_AsEncodedString@Base @SVER@
+ PyUnicode_AsEncodedUnicode@Base @SVER@
+ PyUnicode_AsLatin1String@Base @SVER@
+ PyUnicode_AsRawUnicodeEscapeString@Base @SVER@
+ PyUnicode_AsUCS4@Base @SVER@
+ PyUnicode_AsUCS4Copy@Base @SVER@
+ PyUnicode_AsUTF16String@Base @SVER@
+ PyUnicode_AsUTF32String@Base @SVER@
+ PyUnicode_AsUTF8@Base @SVER@
+ PyUnicode_AsUTF8AndSize@Base @SVER@
+ PyUnicode_AsUTF8String@Base @SVER@
+ PyUnicode_AsUnicode@Base @SVER@
+ PyUnicode_AsUnicodeAndSize@Base @SVER@
+ PyUnicode_AsUnicodeCopy@Base @SVER@
+ PyUnicode_AsUnicodeEscapeString@Base @SVER@
+ PyUnicode_AsWideChar@Base @SVER@
+ PyUnicode_AsWideCharString@Base @SVER@
+ PyUnicode_BuildEncodingMap@Base @SVER@
+ PyUnicode_ClearFreeList@Base @SVER@
+ PyUnicode_Compare@Base @SVER@
+ PyUnicode_CompareWithASCIIString@Base @SVER@
+ PyUnicode_Concat@Base @SVER@
+ PyUnicode_Contains@Base @SVER@
+ PyUnicode_CopyCharacters@Base @SVER@
+ PyUnicode_Count@Base @SVER@
+ PyUnicode_Decode@Base @SVER@
+ PyUnicode_DecodeASCII@Base @SVER@
+ PyUnicode_DecodeCharmap@Base @SVER@
+ PyUnicode_DecodeFSDefault@Base @SVER@
+ PyUnicode_DecodeFSDefaultAndSize@Base @SVER@
+ PyUnicode_DecodeLatin1@Base @SVER@
+ PyUnicode_DecodeLocale@Base @SVER@
+ PyUnicode_DecodeLocaleAndSize@Base @SVER@
+ PyUnicode_DecodeRawUnicodeEscape@Base @SVER@
+ PyUnicode_DecodeUTF16@Base @SVER@
+ PyUnicode_DecodeUTF16Stateful@Base @SVER@
+ PyUnicode_DecodeUTF32@Base @SVER@
+ PyUnicode_DecodeUTF32Stateful@Base @SVER@
+ PyUnicode_DecodeUTF7@Base @SVER@
+ PyUnicode_DecodeUTF7Stateful@Base @SVER@
+ PyUnicode_DecodeUTF8@Base @SVER@
+ PyUnicode_DecodeUTF8Stateful@Base @SVER@
+ PyUnicode_DecodeUnicodeEscape@Base @SVER@
+ PyUnicode_Encode@Base @SVER@
+ PyUnicode_EncodeASCII@Base @SVER@
+ PyUnicode_EncodeCharmap@Base @SVER@
+ PyUnicode_EncodeDecimal@Base @SVER@
+ PyUnicode_EncodeFSDefault@Base @SVER@
+ PyUnicode_EncodeUTF8@Base @SVER@
+ PyUnicode_EncodeUnicodeEscape@Base @SVER@
+ PyUnicode_FSConverter@Base @SVER@
+ PyUnicode_FSDecoder@Base @SVER@
+ PyUnicode_Fill@Base @SVER@
+ PyUnicode_Find@Base @SVER@
+ PyUnicode_FindChar@Base @SVER@
+ PyUnicode_Format@Base @SVER@
+ PyUnicode_FromEncodedObject@Base @SVER@
+ PyUnicode_FromFormat@Base @SVER@
+ PyUnicode_FromFormatV@Base @SVER@
+ PyUnicode_FromKindAndData@Base @SVER@
+ PyUnicode_FromObject@Base @SVER@
+ PyUnicode_FromOrdinal@Base @SVER@
+ PyUnicode_FromString@Base @SVER@
+ PyUnicode_FromStringAndSize@Base @SVER@
+ PyUnicode_FromUnicode@Base @SVER@
+ PyUnicode_FromWideChar@Base @SVER@
+ PyUnicode_GetDefaultEncoding@Base @SVER@
+ PyUnicode_GetLength@Base @SVER@
+ PyUnicode_GetMax@Base @SVER@
+ PyUnicode_GetSize@Base @SVER@
+ PyUnicode_EncodeLatin1@Base @SVER@
+ PyUnicode_EncodeLocale@Base @SVER@
+ PyUnicode_EncodeRawUnicodeEscape@Base @SVER@
+ PyUnicode_EncodeUTF16@Base @SVER@
+ PyUnicode_EncodeUTF32@Base @SVER@
+ PyUnicode_EncodeUTF7@Base @SVER@
+ PyUnicode_InternFromString@Base @SVER@
+ PyUnicode_InternImmortal@Base @SVER@
+ PyUnicode_InternInPlace@Base @SVER@
+ PyUnicode_IsIdentifier@Base @SVER@
+ PyUnicode_Join@Base @SVER@
+ PyUnicode_New@Base @SVER@
+ PyUnicode_Partition@Base @SVER@
+ PyUnicode_RPartition@Base @SVER@
+ PyUnicode_RSplit@Base @SVER@
+ PyUnicode_ReadChar@Base @SVER@
+ PyUnicode_Replace@Base @SVER@
+ PyUnicode_Resize@Base @SVER@
+ PyUnicode_RichCompare@Base @SVER@
+ PyUnicode_Split@Base @SVER@
+ PyUnicode_Splitlines@Base @SVER@
+ PyUnicode_Substring@Base @SVER@
+ PyUnicode_Tailmatch@Base @SVER@
+ PyUnicode_TransformDecimalToASCII@Base @SVER@
+ PyUnicode_Translate@Base @SVER@
+ PyUnicode_TranslateCharmap@Base @SVER@
+ PyUnicode_Type@Base @SVER@
+ PyUnicode_WriteChar@Base @SVER@
+ PyWeakref_GetObject@Base @SVER@
+ PyWeakref_NewProxy@Base @SVER@
+ PyWeakref_NewRef@Base @SVER@
+ PyWrapperDescr_Type@Base @SVER@
+ PyWrapper_New@Base @SVER@
+ PyZip_Type@Base @SVER@
+ Py_AddPendingCall@Base @SVER@
+ Py_AtExit@Base @SVER@
+ Py_BuildValue@Base @SVER@
+ Py_BytesWarningFlag@Base @SVER@
+ Py_CompileString@Base @SVER@
+ Py_CompileStringExFlags@Base @SVER@
+ Py_CompileStringFlags@Base @SVER@
+ Py_DebugFlag@Base @SVER@
+ Py_DecRef@Base @SVER@
+ Py_DontWriteBytecodeFlag@Base @SVER@
+ Py_EndInterpreter@Base @SVER@
+ Py_Exit@Base @SVER@
+ Py_FatalError@Base @SVER@
+ Py_FdIsInteractive@Base @SVER@
+ Py_FileSystemDefaultEncoding@Base @SVER@
+ Py_Finalize@Base @SVER@
+ Py_FrozenFlag@Base @SVER@
+ Py_FrozenMain@Base @SVER@
+ Py_GetArgcArgv@Base @SVER@
+ Py_GetBuildInfo@Base @SVER@
+ Py_GetCompiler@Base @SVER@
+ Py_GetCopyright@Base @SVER@
+ Py_GetExecPrefix@Base @SVER@
+ Py_GetPath@Base @SVER@
+ Py_GetPlatform@Base @SVER@
+ Py_GetPrefix@Base @SVER@
+ Py_GetProgramFullPath@Base @SVER@
+ Py_GetProgramName@Base @SVER@
+ Py_GetPythonHome@Base @SVER@
+ Py_GetRecursionLimit@Base @SVER@
+ Py_GetVersion@Base @SVER@
+ Py_HasFileSystemDefaultEncoding@Base @SVER@
+ Py_HashRandomizationFlag@Base @SVER@
+ Py_IgnoreEnvironmentFlag@Base @SVER@
+ Py_IncRef@Base @SVER@
+ Py_Initialize@Base @SVER@
+ Py_InitializeEx@Base @SVER@
+ Py_InspectFlag@Base @SVER@
+ Py_InteractiveFlag@Base @SVER@
+ Py_IsInitialized@Base @SVER@
+ Py_Main@Base @SVER@
+ Py_MakePendingCalls@Base @SVER@
+ Py_NewInterpreter@Base @SVER@
+ Py_NoSiteFlag@Base @SVER@
+ Py_NoUserSiteDirectory@Base @SVER@
+ Py_OptimizeFlag@Base @SVER@
+ Py_QuietFlag@Base @SVER@
+ Py_ReprEnter@Base @SVER@
+ Py_ReprLeave@Base @SVER@
+ Py_SetPath@Base @SVER@
+ Py_SetProgramName@Base @SVER@
+ Py_SetPythonHome@Base @SVER@
+ Py_SetRecursionLimit@Base @SVER@
+ Py_SymtableString@Base @SVER@
+ Py_UNICODE_strcat@Base @SVER@
+ Py_UNICODE_strchr@Base @SVER@
+ Py_UNICODE_strcmp@Base @SVER@
+ Py_UNICODE_strcpy@Base @SVER@
+ Py_UNICODE_strlen@Base @SVER@
+ Py_UNICODE_strncmp@Base @SVER@
+ Py_UNICODE_strncpy@Base @SVER@
+ Py_UNICODE_strrchr@Base @SVER@
+ Py_UnbufferedStdioFlag@Base @SVER@
+ Py_UniversalNewlineFgets@Base @SVER@
+ Py_UseClassExceptionsFlag@Base @SVER@
+ Py_VaBuildValue@Base @SVER@
+ Py_VerboseFlag@Base @SVER@
+ Py_hexdigits@Base @SVER@
+ Py_meta_grammar@Base @SVER@
+ Py_pgen@Base @SVER@
+ _PyAccu_Accumulate@Base @SVER@
+ _PyAccu_Destroy@Base @SVER@
+ _PyAccu_Finish@Base @SVER@
+ _PyAccu_FinishAsList@Base @SVER@
+ _PyAccu_Init@Base @SVER@
+ _PyArg_NoKeywords@Base @SVER@
+ _PyArg_ParseTupleAndKeywords_SizeT@Base @SVER@
+ _PyArg_ParseTuple_SizeT@Base @SVER@
+ _PyArg_Parse_SizeT@Base @SVER@
+ _PyArg_VaParseTupleAndKeywords_SizeT@Base @SVER@
+ _PyArg_VaParse_SizeT@Base @SVER@
+ _PyBuiltin_Init@Base @SVER@
+ _PyByteArray_empty_string@Base @SVER@
+ _PyBytesIOBuffer_Type@Base @SVER@
+ _PyBytes_Join@Base @SVER@
+ _PyBytes_Resize@Base @SVER@
+ _PyCFunction_DebugMallocStats@Base @SVER@
+ _PyCapsule_hack@Base @SVER@
+ _PyCode_CheckLineNumber@Base @SVER@
+ _PyCodec_Lookup@Base @SVER@
+ _PyComplex_FormatAdvancedWriter@Base @SVER@
+ _PyDebugAllocatorStats@Base @SVER@
+ _PyDictKeys_DecRef@Base @SVER@
+ _PyDict_Contains@Base @SVER@
+ _PyDict_DebugMallocStats@Base @SVER@
+ _PyDict_GetItemId@Base @SVER@
+ _PyDict_GetItemIdWithError@Base @SVER@
+ _PyDict_HasOnlyStringKeys@Base @SVER@
+ _PyDict_KeysSize@Base @SVER@
+ _PyDict_LoadGlobal@Base @SVER@
+ _PyDict_MaybeUntrack@Base @SVER@
+ _PyDict_NewKeysForClass@Base @SVER@
+ _PyDict_NewPresized@Base @SVER@
+ _PyDict_Next@Base @SVER@
+ _PyErr_BadInternalCall@Base @SVER@
+ _PyDict_SetItemId@Base @SVER@
+ _PyEval_CallTracing@Base @SVER@
+ _PyEval_FiniThreads@Base @SVER@
+ _PyEval_GetSwitchInterval@Base @SVER@
+ _PyEval_SetSwitchInterval@Base @SVER@
+ _PyEval_SignalAsyncExc@Base @SVER@
+ _PyEval_SliceIndex@Base @SVER@
+ _PyExc_Fini@Base @SVER@
+ _PyExc_Init@Base @SVER@
+ _PyFaulthandler_Fini@Base @SVER@
+ _PyFaulthandler_Init@Base @SVER@
+ _PyFileIO_closed@Base @SVER@
+ _PyFloat_DebugMallocStats@Base @SVER@
+ _PyFloat_FormatAdvancedWriter@Base @SVER@
+ _PyFloat_Init@Base @SVER@
+ _PyFloat_Pack4@Base @SVER@
+ _PyFloat_Pack8@Base @SVER@
+ _PyFloat_Unpack4@Base @SVER@
+ _PyFloat_Unpack8@Base @SVER@
+ _PyFrame_DebugMallocStats@Base @SVER@
+ _PyFrame_Init@Base @SVER@
+ _PyGC_Dump@Base @SVER@
+ _PyGC_Fini@Base @SVER@
+ _PyGC_generation0@Base @SVER@
+ _PyGILState_Fini@Base @SVER@
+ _PyGILState_Init@Base @SVER@
+ _PyGILState_Reinit@Base @SVER@
+ _PyGen_FetchStopIterationValue@Base @SVER@
+ _PyGen_Send@Base @SVER@
+ _PyIOBase_check_closed@Base @SVER@
+ _PyIOBase_check_readable@Base @SVER@
+ _PyIOBase_check_seekable@Base @SVER@
+ _PyIOBase_check_writable@Base @SVER@
+ _PyIOBase_finalize@Base @SVER@
+ _PyIO_ConvertSsize_t@Base @SVER@
+ _PyIO_Module@Base @SVER@
+ _PyIO_empty_bytes@Base @SVER@
+ _PyIO_empty_str@Base @SVER@
+ _PyIO_find_line_ending@Base @SVER@
+ _PyIO_str_close@Base @SVER@
+ _PyIO_str_closed@Base @SVER@
+ _PyIO_str_decode@Base @SVER@
+ _PyIO_str_encode@Base @SVER@
+ _PyIO_str_fileno@Base @SVER@
+ _PyIO_str_flush@Base @SVER@
+ _PyIO_str_getstate@Base @SVER@
+ _PyIO_str_isatty@Base @SVER@
+ _PyIO_str_newlines@Base @SVER@
+ _PyIO_str_nl@Base @SVER@
+ _PyIO_str_read1@Base @SVER@
+ _PyIO_str_read@Base @SVER@
+ _PyIO_str_readable@Base @SVER@
+ _PyIO_str_readall@Base @SVER@
+ _PyIO_str_readinto@Base @SVER@
+ _PyIO_str_readline@Base @SVER@
+ _PyIO_str_reset@Base @SVER@
+ _PyIO_str_seek@Base @SVER@
+ _PyIO_str_seekable@Base @SVER@
+ _PyIO_str_setstate@Base @SVER@
+ _PyIO_str_tell@Base @SVER@
+ _PyIO_str_truncate@Base @SVER@
+ _PyIO_str_writable@Base @SVER@
+ _PyIO_str_write@Base @SVER@
+ _PyIO_trap_eintr@Base @SVER@
+ _PyIO_zero@Base @SVER@
+ _PyImportHooks_Init@Base @SVER@
+ _PyImportZip_Init@Base @SVER@
+ _PyImport_AcquireLock@Base @SVER@
+ _PyImport_DynLoadFiletab@Base @SVER@
+ _PyImport_FindBuiltin@Base @SVER@
+ _PyImport_FindExtensionObject@Base @SVER@
+ _PyImport_Fini@Base @SVER@
+ _PyImport_FixupBuiltin@Base @SVER@
+ _PyImport_FixupExtensionObject@Base @SVER@
+ _PyImport_GetDynLoadFunc@Base @SVER@
+ _PyImport_Init@Base @SVER@
+ _PyImport_Inittab@Base @SVER@
+ _PyImport_LoadDynamicModule@Base @SVER@
+ _PyImport_ReInitLock@Base @SVER@
+ _PyImport_ReleaseLock@Base @SVER@
+ _PyIncrementalNewlineDecoder_decode@Base @SVER@
+ _PyList_DebugMallocStats@Base @SVER@
+ _PyList_Extend@Base @SVER@
+ _PyLong_AsByteArray@Base @SVER@
+ _PyLong_AsInt@Base @SVER@
+ _PyLong_AsTime_t@Base @SVER@
+ _PyLong_Copy@Base @SVER@
+ _PyLong_DigitValue@Base @SVER@
+ _PyLong_DivmodNear@Base @SVER@
+ _PyLong_Format@Base @SVER@
+ _PyLong_FormatAdvancedWriter@Base @SVER@
+ _PyLong_FormatWriter@Base @SVER@
+ _PyLong_Frexp@Base @SVER@
+ _PyLong_FromByteArray@Base @SVER@
+ _PyLong_FromTime_t@Base @SVER@
+ _PyLong_Init@Base @SVER@
+ _PyLong_New@Base @SVER@
+ _PyLong_NumBits@Base @SVER@
+ _PyLong_Sign@Base @SVER@
+ _PyManagedBuffer_Type@Base @SVER@
+ _PyMethodWrapper_Type@Base @SVER@
+ _PyMethod_DebugMallocStats@Base @SVER@
+ _PyModule_Clear@Base @SVER@
+ _PyNamespace_New@Base @SVER@
+ _PyNamespace_Type@Base @SVER@
+ _PyNode_SizeOf@Base @SVER@
+ _PyOS_GetOpt@Base @SVER@
+ _PyOS_IsMainThread@Base @SVER@
+ _PyOS_ReadlineTState@Base @SVER@
+ _PyOS_ResetGetOpt@Base @SVER@
+ _PyOS_URandom@Base @SVER@
+ _PyOS_optarg@Base @SVER@
+ _PyOS_opterr@Base @SVER@
+ _PyOS_optind@Base @SVER@
+ _PyObjectDict_SetItem@Base @SVER@
+ _PyObject_CallFunction_SizeT@Base @SVER@
+ _PyObject_CallMethodId@Base @SVER@
+ _PyObject_CallMethodObjIdArgs@Base @SVER@
+ _PyObject_CallMethodId_SizeT@Base @SVER@
+ _PyObject_CallMethod_SizeT@Base @SVER@
+ _PyObject_DebugMallocStats@Base @SVER@
+ _PyObject_DebugTypeStats@Base @SVER@
+ _PyObject_Dump@Base @SVER@
+ _PyObject_GC_Malloc@Base @SVER@
+ _PyObject_GC_New@Base @SVER@
+ _PyObject_GC_NewVar@Base @SVER@
+ _PyObject_GC_Resize@Base @SVER@
+ _PyObject_GC_Track@Base @SVER@
+ _PyObject_GC_UnTrack@Base @SVER@
+ _PyObject_GenericGetAttrWithDict@Base @SVER@
+ _PyObject_GenericSetAttrWithDict@Base @SVER@
+ _PyObject_GetAttrId@Base @SVER@
+ _PyObject_GetBuiltin@Base @SVER@
+ _PyObject_GetDictPtr@Base @SVER@
+ _PyObject_HasAttrId@Base @SVER@
+ _PyObject_IsAbstract@Base @SVER@
+ _PyObject_LengthHint@Base @SVER@
+ _PyObject_LookupSpecial@Base @SVER@
+ _PyObject_New@Base @SVER@
+ _PyObject_NewVar@Base @SVER@
+ _PyObject_NextNotImplemented@Base @SVER@
+ _PyObject_RealIsInstance@Base @SVER@
+ _PyObject_RealIsSubclass@Base @SVER@
+ _PyObject_SetAttrId@Base @SVER@
+ _PyParser_Grammar@Base @SVER@
+ _PyParser_TokenNames@Base @SVER@
+ _PyRandom_Init@Base @SVER@
+ _PySequence_BytesToCharpArray@Base @SVER@
+ _PySequence_IterSearch@Base @SVER@
+ _PySet_DebugMallocStats@Base @SVER@
+ _PySet_NextEntry@Base @SVER@
+ _PySet_Update@Base @SVER@
+ _PySlice_FromIndices@Base @SVER@
+ _PyState_AddModule@Base @SVER@
+ _PySys_ImplCacheTag@Base @SVER@
+ _PySys_ImplName@Base @SVER@
+ _PySys_Init@Base @SVER@
+ _PyThreadState_Current@Base @SVER@
+ _PyThreadState_GetFrame@Base @SVER@
+ _PyThreadState_Init@Base @SVER@
+ _PyThreadState_Prealloc@Base @SVER@
+ _PyThread_CurrentFrames@Base @SVER@
+ _PyTime_Init@Base @SVER@
+ _PyTime_ObjectToTime_t@Base @SVER@
+ _PyTime_ObjectToTimespec@Base @SVER@
+ _PyTime_ObjectToTimeval@Base @SVER@
+ _PyTime_gettimeofday@Base @SVER@
+ _PyTime_gettimeofday_info@Base @SVER@
+ _PyTrash_delete_later@Base @SVER@
+ _PyTrash_delete_nesting@Base @SVER@
+ _PyTrash_deposit_object@Base @SVER@
+ _PyTrash_destroy_chain@Base @SVER@
+ _PyTrash_thread_deposit_object@Base @SVER@
+ _PyTrash_thread_destroy_chain@Base @SVER@
+ _PyTuple_DebugMallocStats@Base @SVER@
+ _PyTuple_MaybeUntrack@Base @SVER@
+ _PyTuple_Resize@Base @SVER@
+ _PyType_CalculateMetaclass@Base @SVER@
+ _PyType_Lookup@Base @SVER@
+ _PyUnicodeTranslateError_Create@Base @SVER@
+ _PyUnicodeWriter_Dealloc@Base @SVER@
+ _PyUnicodeWriter_Finish@Base @SVER@
+ _PyUnicodeWriter_Init@Base @SVER@
+ _PyUnicodeWriter_PrepareInternal@Base @SVER@
+ _PyUnicodeWriter_WriteStr@Base @SVER@
+ _PyUnicode_AsASCIIString@Base @SVER@
+ _PyUnicode_AsKind@Base @SVER@
+ _PyUnicode_AsLatin1String@Base @SVER@
+ _PyUnicode_AsUTF8String@Base @SVER@
+ _PyUnicode_BidirectionalNames@Base @SVER@
+ _PyUnicode_CategoryNames@Base @SVER@
+ _PyUnicode_ClearStaticStrings@Base @SVER@
+ _PyUnicode_Copy@Base @SVER@
+ _PyUnicode_Database_Records@Base @SVER@
+ _PyUnicode_DecodeUnicodeInternal@Base @SVER@
+ _PyUnicode_EastAsianWidthNames@Base @SVER@
+ _PyUnicode_EncodeCharmap@Base @SVER@
+ _PyUnicode_EncodeUTF16@Base @SVER@
+ _PyUnicode_EncodeUTF32@Base @SVER@
+ _PyUnicode_EncodeUTF7@Base @SVER@
+ _PyUnicode_ExtendedCase@Base @SVER@
+ _PyUnicode_FastCopyCharacters@Base @SVER@
+ _PyUnicode_FastFill@Base @SVER@
+ _PyUnicode_FindMaxChar@Base @SVER@
+ _PyUnicode_Fini@Base @SVER@
+ _PyUnicode_FormatAdvancedWriter@Base @SVER@
+ _PyUnicode_FromASCII@Base @SVER@
+ _PyUnicode_FromId@Base @SVER@
+ _PyUnicode_Init@Base @SVER@
+ _PyUnicode_HasNULChars@Base @SVER@
+ _PyUnicode_InsertThousandsGrouping@Base @SVER@
+ _PyUnicode_IsAlpha@Base @SVER@
+ _PyUnicode_IsCaseIgnorable@Base @SVER@
+ _PyUnicode_IsCased@Base @SVER@
+ _PyUnicode_IsDecimalDigit@Base @SVER@
+ _PyUnicode_IsDigit@Base @SVER@
+ _PyUnicode_IsLinebreak@Base @SVER@
+ _PyUnicode_IsLowercase@Base @SVER@
+ _PyUnicode_IsNumeric@Base @SVER@
+ _PyUnicode_IsPrintable@Base @SVER@
+ _PyUnicode_IsTitlecase@Base @SVER@
+ _PyUnicode_IsUppercase@Base @SVER@
+ _PyUnicode_IsWhitespace@Base @SVER@
+ _PyUnicode_IsXidContinue@Base @SVER@
+ _PyUnicode_IsXidStart@Base @SVER@
+ _PyUnicode_Ready@Base @SVER@
+ _PyUnicode_ToDecimalDigit@Base @SVER@
+ _PyUnicode_ToDigit@Base @SVER@
+ _PyUnicode_ToFoldedFull@Base @SVER@
+ _PyUnicode_ToLowerFull@Base @SVER@
+ _PyUnicode_ToLowercase@Base @SVER@
+ _PyUnicode_ToNumeric@Base @SVER@
+ _PyUnicode_ToTitleFull@Base @SVER@
+ _PyUnicode_ToTitlecase@Base @SVER@
+ _PyUnicode_ToUpperFull@Base @SVER@
+ _PyUnicode_ToUppercase@Base @SVER@
+ _PyUnicode_TransformDecimalAndSpaceToASCII@Base @SVER@
+ _PyUnicode_TranslateCharmap@Base @SVER@
+ _PyUnicode_TypeRecords@Base @SVER@
+ _PyUnicode_XStrip@Base @SVER@
+ _PyWarnings_Init@Base @SVER@
+ _PyWeakref_CallableProxyType@Base @SVER@
+ _PyWeakref_ClearRef@Base @SVER@
+ _PyWeakref_GetWeakrefCount@Base @SVER@
+ _PyWeakref_ProxyType@Base @SVER@
+ _PyWeakref_RefType@Base @SVER@
+ _Py_Assert@Base @SVER@
+ _Py_Assign@Base @SVER@
+ _Py_Attribute@Base @SVER@
+ _Py_AugAssign@Base @SVER@
+ _Py_BinOp@Base @SVER@
+ _Py_BoolOp@Base @SVER@
+ _Py_Break@Base @SVER@
+ _Py_BreakPoint@Base @SVER@
+ _Py_BuildValue_SizeT@Base @SVER@
+ _Py_Bytes@Base @SVER@
+ _Py_Call@Base @SVER@
+ _Py_CheckRecursionLimit@Base @SVER@
+ _Py_CheckRecursiveCall@Base @SVER@
+ _Py_ClassDef@Base @SVER@
+ _Py_Compare@Base @SVER@
+ _Py_Continue@Base @SVER@
+ _Py_Dealloc@Base @SVER@
+ _Py_Delete@Base @SVER@
+ _Py_Dict@Base @SVER@
+ _Py_DictComp@Base @SVER@
+ _Py_DisplaySourceLine@Base @SVER@
+ _Py_DumpTraceback@Base @SVER@
+ _Py_DumpTracebackThreads@Base @SVER@
+ _Py_Ellipsis@Base @SVER@
+ _Py_EllipsisObject@Base @SVER@
+ _Py_ExceptHandler@Base @SVER@
+ _Py_Expr@Base @SVER@
+ _Py_Expression@Base @SVER@
+ _Py_ExtSlice@Base @SVER@
+ _Py_FalseStruct@Base @SVER@
+ _Py_Finalizing@Base @SVER@
+ _Py_For@Base @SVER@
+ _Py_FreeCharPArray@Base @SVER@
+ _Py_FunctionDef@Base @SVER@
+ _Py_GeneratorExp@Base @SVER@
+ _Py_Global@Base @SVER@
+ _Py_HashBytes@Base @SVER@
+ _Py_HashDouble@Base @SVER@
+ _Py_HashPointer@Base @SVER@
+ _Py_HashSecret@Base @SVER@
+ _Py_If@Base @SVER@
+ _Py_IfExp@Base @SVER@
+ _Py_Import@Base @SVER@
+ _Py_ImportFrom@Base @SVER@
+ _Py_Index@Base @SVER@
+ _Py_InitializeEx_Private@Base @SVER@
+ _Py_Interactive@Base @SVER@
+ _Py_Lambda@Base @SVER@
+ _Py_List@Base @SVER@
+ _Py_ListComp@Base @SVER@
+ _Py_M__importlib@Base @SVER@
+ _Py_Mangle@Base @SVER@
+ _Py_Module@Base @SVER@
+ _Py_Name@Base @SVER@
+ _Py_NoneStruct@Base @SVER@
+ _Py_Nonlocal@Base @SVER@
+ _Py_NotImplementedStruct@Base @SVER@
+ _Py_Num@Base @SVER@
+ _Py_PackageContext@Base @SVER@
+ _Py_Pass@Base @SVER@
+ _Py_PyAtExit@Base @SVER@
+ _Py_Raise@Base @SVER@
+ _Py_ReadyTypes@Base @SVER@
+ _Py_ReleaseInternedUnicodeStrings@Base @SVER@
+ _Py_RestoreSignals@Base @SVER@
+ _Py_Return@Base @SVER@
+ _Py_Set@Base @SVER@
+ _Py_SetComp@Base @SVER@
+ _Py_Slice@Base @SVER@
+ _Py_Starred@Base @SVER@
+ _Py_Str@Base @SVER@
+ _Py_Subscript@Base @SVER@
+ _Py_Suite@Base @SVER@
+ _Py_SwappedOp@Base @SVER@
+ _Py_TrueStruct@Base @SVER@
+ _Py_Try@Base @SVER@
+ _Py_Tuple@Base @SVER@
+ _Py_UnaryOp@Base @SVER@
+ _Py_VaBuildValue_SizeT@Base @SVER@
+ _Py_While@Base @SVER@
+ _Py_With@Base @SVER@
+ _Py_Yield@Base @SVER@
+ _Py_YieldFrom@Base @SVER@
+ _Py_abstract_hack@Base @SVER@
+ _Py_acosh@Base @SVER@
+ _Py_add_one_to_index_C@Base @SVER@
+ _Py_add_one_to_index_F@Base @SVER@
+ _Py_addarc@Base @SVER@
+ _Py_addbit@Base @SVER@
+ _Py_adddfa@Base @SVER@
+ _Py_addfirstsets@Base @SVER@
+ _Py_addlabel@Base @SVER@
+ _Py_addstate@Base @SVER@
+ _Py_alias@Base @SVER@
+ _Py_arg@Base @SVER@
+ _Py_arguments@Base @SVER@
+ _Py_ascii_whitespace@Base @SVER@
+ _Py_asinh@Base @SVER@
+ _Py_atanh@Base @SVER@
+ _Py_bytes_capitalize@Base @SVER@
+ _Py_bytes_isalnum@Base @SVER@
+ _Py_bytes_isalpha@Base @SVER@
+ _Py_bytes_isdigit@Base @SVER@
+ _Py_bytes_islower@Base @SVER@
+ _Py_bytes_isspace@Base @SVER@
+ _Py_bytes_istitle@Base @SVER@
+ _Py_bytes_isupper@Base @SVER@
+ _Py_bytes_lower@Base @SVER@
+ _Py_bytes_maketrans@Base @SVER@
+ _Py_bytes_swapcase@Base @SVER@
+ _Py_bytes_title@Base @SVER@
+ _Py_bytes_upper@Base @SVER@
+ _Py_c_abs@Base @SVER@
+ _Py_c_diff@Base @SVER@
+ _Py_c_neg@Base @SVER@
+ _Py_c_pow@Base @SVER@
+ _Py_c_prod@Base @SVER@
+ _Py_c_quot@Base @SVER@
+ _Py_c_sum@Base @SVER@
+ _Py_capitalize__doc__@Base @SVER@
+ _Py_char2wchar@Base @SVER@
+ _Py_comprehension@Base @SVER@
+ _Py_ctype_table@Base @SVER@
+ _Py_ctype_tolower@Base @SVER@
+ _Py_ctype_toupper@Base @SVER@
+ _Py_delbitset@Base @SVER@
+ _Py_device_encoding@Base @SVER@
+ (arch=!m68k)_Py_dg_dtoa@Base @SVER@
+ (arch=!m68k)_Py_dg_freedtoa@Base @SVER@
+ _Py_dg_infinity@Base @SVER@
+ _Py_dg_stdnan@Base @SVER@
+ (arch=!m68k)_Py_dg_strtod@Base @SVER@
+ _Py_dg_infinity@Base @SVER@
+ _Py_dg_stdnan@Base @SVER@
+ _Py_expm1@Base @SVER@
+ _Py_findlabel@Base @SVER@
+ _Py_fopen@Base @SVER@
+ (arch=i386 lpia m68k)_Py_force_double@Base @SVER@
+ (arch=amd64 i386 lpia)_Py_get_387controlword@Base @SVER@
+ _Py_hgidentifier@Base @SVER@
+ _Py_hgversion@Base @SVER@
+ _Py_isalnum__doc__@Base @SVER@
+ _Py_isalpha__doc__@Base @SVER@
+ _Py_isdigit__doc__@Base @SVER@
+ _Py_islower__doc__@Base @SVER@
+ _Py_isspace__doc__@Base @SVER@
+ _Py_istitle__doc__@Base @SVER@
+ _Py_isupper__doc__@Base @SVER@
+ _Py_keyword@Base @SVER@
+ _Py_log1p@Base @SVER@
+ _Py_lower__doc__@Base @SVER@
+ _Py_maketrans__doc__@Base @SVER@
+ _Py_mergebitset@Base @SVER@
+ _Py_meta_grammar@Base @SVER@
+ _Py_newbitset@Base @SVER@
+ _Py_newgrammar@Base @SVER@
+ _Py_normalize_encoding@Base @SVER@
+ _Py_parse_inf_or_nan@Base @SVER@
+ _Py_pgen@Base @SVER@
+ _Py_samebitset@Base @SVER@
+ (arch=amd64 i386 lpia)_Py_set_387controlword@Base @SVER@
+ _Py_stat@Base @SVER@
+ _Py_swapcase__doc__@Base @SVER@
+ _Py_title__doc__@Base @SVER@
+ _Py_translatelabels@Base @SVER@
+ _Py_upper__doc__@Base @SVER@
+ _Py_wchar2char@Base @SVER@
+ _Py_wfopen@Base @SVER@
+ _Py_wgetcwd@Base @SVER@
+ _Py_withitem@Base @SVER@
+ _Py_wreadlink@Base @SVER@
+ _Py_wrealpath@Base @SVER@
+ _Py_wstat@Base @SVER@
+
+ asdl_int_seq_new@Base @SVER@
+ asdl_seq_new@Base @SVER@
+
+ (optional|regex)"^_ctypes_.*@Base$" @SVER@
+ (optional|regex)"^ffi_type_.*@Base$" @SVER@
+ (optional|regex)"^ffi_closure_.*@Base$" @SVER@
+
+ (optional|regex)"^PyInit_.*@Base$" @SVER@
--- python3.3-3.3.0.orig/debian/PVER-doc.doc-base.PVER-api.in
+++ python3.3-3.3.0/debian/PVER-doc.doc-base.PVER-api.in
@@ -0,0 +1,13 @@
+Document: @PVER@-api
+Title: Python/C API Reference Manual (v@VER@)
+Author: Guido van Rossum
+Abstract: This manual documents the API used by C (or C++) programmers who
+ want to write extension modules or embed Python.  It is a
+ companion to *Extending and Embedding the Python Interpreter*,
+ which describes the general principles of extension writing but
+ does not document the API functions in detail.
+Section: Programming/Python
+
+Format: HTML
+Index: /usr/share/doc/@PVER@/html/c-api/index.html
+Files: /usr/share/doc/@PVER@/html/c-api/*.html
--- python3.3-3.3.0.orig/debian/pydoc.1.in
+++ python3.3-3.3.0/debian/pydoc.1.in
@@ -0,0 +1,53 @@
+.TH PYDOC@VER@ 1
+.SH NAME
+pydoc@VER@ \- the Python documentation tool
+.SH SYNOPSIS
+.PP
+.B pydoc@VER@
+.I name
+.PP
+.B pydoc@VER@ -k
+.I keyword
+.PP
+.B pydoc@VER@ -p
+.I port
+.PP
+.B pydoc@VER@ -g
+.PP
+.B pydoc@VER@ -w
+.I module [...]
+.SH DESCRIPTION
+.PP
+.B pydoc@VER@
+.I name
+Show text documentation on something.
+.I name
+may be the name of a
+Python keyword, topic, function, module, or package, or a dotted
+reference to a class or function within a module or module in a
+package.  If
+.I name
+contains a '/', it is used as the path to a
+Python source file to document. If name is 'keywords', 'topics',
+or 'modules', a listing of these things is displayed.
+.PP
+.B pydoc@VER@ -k
+.I keyword
+Search for a keyword in the synopsis lines of all available modules.
+.PP
+.B pydoc@VER@ -p
+.I port
+Start an HTTP server on the given port on the local machine.
+.PP
+.B pydoc@VER@ -g
+Pop up a graphical interface for finding and serving documentation.
+.PP
+.B pydoc@VER@ -w
+.I name [...]
+Write out the HTML documentation for a module to a file in the current
+directory.  If
+.I name
+contains a '/', it is treated as a filename; if
+it names a directory, documentation is written for all the contents.
+.SH AUTHOR
+Moshe Zadka, based on "pydoc --help"
--- python3.3-3.3.0.orig/debian/control.stdlib
+++ python3.3-3.3.0/debian/control.stdlib
@@ -0,0 +1,16 @@
+Package: @PVER@-tk
+Architecture: any
+Depends: @PVER@ (= ${Source-Version}), ${shlibs:Depends}
+Suggests: tix
+XB-Python-Version: @VER@
+Description: Tkinter - Writing Tk applications with Python (v@VER@)
+ A module for writing portable GUI applications with Python (v@VER@) using Tk.
+ Also known as Tkinter.
+
+Package: @PVER@-gdbm
+Architecture: any
+Depends: @PVER@ (= ${Source-Version}), ${shlibs:Depends}
+Description: GNU dbm database support for Python (v@VER@)
+ GNU dbm database module for Python. Install this if you want to
+ create or read GNU dbm database files with Python.
+
--- python3.3-3.3.0.orig/debian/libPVER-stdlib.overrides.in
+++ python3.3-3.3.0/debian/libPVER-stdlib.overrides.in
@@ -0,0 +1,15 @@
+# idlelib images
+lib@PVER@-stdlib binary: image-file-in-usr-lib
+
+# license file referred by the standard library
+lib@PVER@-stdlib binary: extra-license-file
+
+# template files
+lib@PVER@-stdlib binary: interpreter-not-absolute usr/lib/python3.3/venv/scripts/posix/pydoc #!__VENV_PYTHON__
+lib@PVER@-stdlib binary: unusual-interpreter usr/lib/python3.3/venv/scripts/posix/pydoc #!__VENV_PYTHON__
+
+# the split is the reason for that
+lib@PVER@-stdlib binary: python-script-but-no-python-dep
+
+# lintian omission, multiarch string is encoded in the filename
+lib@PVER@-stdlib binary: arch-dependent-file-not-in-arch-specific-directory
--- python3.3-3.3.0.orig/debian/pyhtml2devhelp.py
+++ python3.3-3.3.0/debian/pyhtml2devhelp.py
@@ -0,0 +1,273 @@
+#! /usr/bin/python3
+
+from html.parser import HTMLParser
+import formatter
+import os, sys, re
+
+class PyHTMLParser(HTMLParser):
+    pages_to_include = set(('whatsnew/index.html', 'tutorial/index.html', 'using/index.html',
+                            'reference/index.html', 'library/index.html', 'howto/index.html',
+                            'extending/index.html', 'c-api/index.html', 'install/index.html',
+                            'distutils/index.html'))
+
+    def __init__(self, formatter, basedir, fn, indent, parents=set()):
+        HTMLParser.__init__(self, formatter)
+        self.basedir = basedir
+        self.dir, self.fn = os.path.split(fn)
+        self.data = ''
+        self.parents = parents
+        self.link = {}
+        self.indent = indent
+        self.last_indent = indent - 1
+        self.sub_indent = 0
+        self.sub_count = 0
+        self.next_link = False
+
+    def process_link(self):
+        new_href = os.path.join(self.dir, self.link['href'])
+        text = self.link['text']
+        indent = self.indent + self.sub_indent
+        if self.last_indent == indent:
+            print('%s</sub>' % ('  ' * self.last_indent))
+            self.sub_count -= 1
+        print('%s<sub link="%s" name="%s">' % ('  ' * indent, new_href, text))
+        self.sub_count += 1
+        self.last_indent = self.indent + self.sub_indent
+
+    def handle_starttag(self, tag, attrs):
+        if tag == 'a':
+            self.start_a(attrs)
+        elif tag == 'li':
+            self.start_li(attrs)
+
+    def handle_endtag(self, tag):
+        if tag == 'a':
+            self.end_a()
+        elif tag == 'li':
+            self.end_li()
+
+    def start_li(self, attrs):
+        self.sub_indent += 1
+        self.next_link = True
+
+    def end_li(self):
+        indent = self.indent + self.sub_indent
+        if self.sub_count > 0:
+            print('%s</sub>' % ('  ' * self.last_indent))
+            self.sub_count -= 1
+            self.last_indent -= 1
+        self.sub_indent -= 1
+
+    def start_a(self, attrs):
+        self.link = {}
+        for attr in attrs:
+            self.link[attr[0]] = attr[1]
+        self.data = ''
+        
+    def end_a(self):
+        process = False
+        text = self.data.replace('\t', '').replace('\n', ' ').replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
+        self.link['text'] = text
+        # handle a tag without href attribute
+        try:
+            href = self.link['href']
+        except KeyError:
+            return
+
+        abs_href = os.path.join(self.basedir, href)
+        if abs_href in self.parents:
+            return
+        if href.startswith('..') or href.startswith('http:') \
+               or href.startswith('mailto:') or href.startswith('news:'):
+            return
+        if href in ('', 'about.html', 'modindex.html', 'genindex.html', 'glossary.html',
+                    'search.html', 'contents.html', 'download.html', 'bugs.html',
+                    'license.html', 'copyright.html'):
+            return
+
+        if 'class' in self.link:
+            if self.link['class'] in ('biglink'):
+                process = True
+            if self.link['class'] in ('reference external'):
+                if self.next_link:
+                    process = True
+                    next_link = False
+
+        if process == True:
+            self.process_link()
+            if href in self.pages_to_include:
+                self.parse_file(os.path.join(self.dir, href))
+
+    def finish(self):
+        if self.sub_count > 0:
+            print('%s</sub>' % ('  ' * self.last_indent))
+
+    def handle_data(self, data):
+        self.data += data
+
+    def parse_file(self, href):
+        # TODO basedir bestimmen
+        parent = os.path.join(self.basedir, self.fn)
+        self.parents.add(parent)
+        parser = PyHTMLParser(formatter.NullFormatter(),
+                              self.basedir, href, self.indent + 1,
+                              self.parents)
+        text = open(self.basedir + '/' + href, encoding='latin_1').read()
+        parser.feed(text)
+        parser.finish()
+        parser.close()
+        if parent in self.parents:
+            self.parents.remove(parent)
+
+class PyIdxHTMLParser(HTMLParser):
+    def __init__(self, formatter, basedir, fn, indent):
+        HTMLParser.__init__(self, formatter)
+        self.basedir = basedir
+        self.dir, self.fn = os.path.split(fn)
+        self.data = ''
+        self.link = {}
+        self.indent = indent
+        self.active = False
+        self.indented = False
+        self.nolink = False
+        self.header = ''
+        self.last_letter = 'Z'
+        self.last_text = ''
+
+    def process_link(self):
+        new_href = os.path.join(self.dir, self.link['href'])
+        text = self.link['text']
+        if not self.active:
+            return
+        if text.startswith('['):
+            return
+        if self.link.get('rel', None) in ('prev', 'parent', 'next', 'contents', 'index'):
+            return
+        if self.indented:
+            text = self.last_text + ' ' + text
+        else:
+            # Save it in case we need it again
+            self.last_text = re.sub(' \([\w\-\.\s]+\)', '', text)
+        indent = self.indent
+        print('%s<function link="%s" name="%s"/>' % ('  ' * indent, new_href, text))
+
+    def handle_starttag(self, tag, attrs):
+        if tag == 'a':
+            self.start_a(attrs)
+        elif tag == 'dl':
+            self.start_dl(attrs)
+        elif tag == 'dt':
+            self.start_dt(attrs)
+        elif tag == 'h2':
+            self.start_h2(attrs)
+        elif tag == 'td':
+            self.start_td(attrs)
+        elif tag == 'table':
+            self.start_table(attrs)
+
+    def handle_endtag(self, tag):
+        if tag == 'a':
+            self.end_a()
+        elif tag == 'dl':
+            self.end_dl()
+        elif tag == 'dt':
+            self.end_dt()
+        elif tag == 'h2':
+            self.end_h2()
+        elif tag == 'td':
+            self.end_td()
+        elif tag == 'table':
+            self.end_table()
+
+    def start_dl(self, attrs):
+        if self.last_text:
+            # Looks like we found the second part to a command
+            self.indented = True
+
+    def end_dl(self):
+        self.indented = False
+
+    def start_dt(self, attrs):
+        self.data = ''
+        self.nolink = True
+
+    def end_dt(self):
+        if not self.active:
+            return
+        if self.nolink == True:
+            # Looks like we found the first part to a command
+            self.last_text = re.sub(' \([\w\-\.\s]+\)', '', self.data)
+            self.nolink = False
+
+    def start_h2(self, attrs):
+        for k, v in attrs:
+            if k == 'id':
+                self.header = v
+                if v == '_':
+                    self.active = True
+
+    def end_h2(self):
+        pass
+
+    def start_td(self, attrs):
+        self.indented = False
+        self.last_text = ''
+
+    def end_td(self):
+        pass
+
+    def start_table(self, attrs):
+        pass
+
+    def end_table(self):
+        if self.header == self.last_letter:
+            self.active = False
+
+    def start_a(self, attrs):
+        self.nolink = False
+        self.link = {}
+        for attr in attrs:
+            self.link[attr[0]] = attr[1]
+        self.data = ''
+        
+    def end_a(self):
+        text = self.data.replace('\t', '').replace('\n', ' ')
+        text = text.replace("Whats ", "What's ")
+        self.link['text'] = text
+        # handle a tag without href attribute
+        try:
+            href = self.link['href']
+        except KeyError:
+            return
+        self.process_link()
+
+    def handle_data(self, data):
+        self.data += data
+
+    def handle_entityref(self, name):
+        self.data += '&%s;' % name
+
+def main():
+    base = sys.argv[1]
+    fn = sys.argv[2]
+    version = sys.argv[3]
+
+    parser = PyHTMLParser(formatter.NullFormatter(), base, fn, indent=0)
+    print('<?xml version="1.0" encoding="iso-8859-1"?>')
+    print('<book title="Python %s Documentation" name="Python %s" version="%s" link="index.html">' % (version, version, version))
+    print('<chapters>')
+    parser.parse_file(fn)
+    print('</chapters>')
+
+    print('<functions>')
+
+    fn = 'genindex-all.html'
+    parser = PyIdxHTMLParser(formatter.NullFormatter(), base, fn, indent=1)
+    text = open(base + '/' + fn, encoding='latin_1').read()
+    parser.feed(text)
+    parser.close()
+
+    print('</functions>')
+    print('</book>')
+
+main()
--- python3.3-3.3.0.orig/debian/idle.desktop.in
+++ python3.3-3.3.0/debian/idle.desktop.in
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=IDLE (using Python-@VER@)
+Comment=Integrated Development Environment for Python (using Python-@VER@)
+Exec=/usr/bin/idle-@PVER@
+Icon=/usr/share/pixmaps/@PVER@.xpm
+Terminal=false
+Type=Application
+Categories=Application;Development;
+StartupNotify=true
--- python3.3-3.3.0.orig/debian/copyright
+++ python3.3-3.3.0/debian/copyright
@@ -0,0 +1,1027 @@
+This package was put together by Klee Dienes <klee@debian.org> from 
+sources from ftp.python.org:/pub/python, based on the Debianization by 
+the previous maintainers Bernd S. Brentrup <bsb@uni-muenster.de> and 
+Bruce Perens. Current maintainer is Matthias Klose <doko@debian.org>. 
+
+It was downloaded from http://python.org/
+
+Copyright:
+
+Upstream Author: Guido van Rossum <guido@cwi.nl> and others.
+
+License:
+
+The following text includes the Python license and licenses and
+acknowledgements for incorporated software. The licenses can be read
+in the HTML and texinfo versions of the documentation as well, after
+installing the pythonx.y-doc package. Licenses for files not licensed
+under the Python Licenses are found at the end of this file.
+
+
+Python License
+==============
+
+A. HISTORY OF THE SOFTWARE
+==========================
+
+Python was created in the early 1990s by Guido van Rossum at Stichting
+Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
+as a successor of a language called ABC.  Guido remains Python's
+principal author, although it includes many contributions from others.
+
+In 1995, Guido continued his work on Python at the Corporation for
+National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
+in Reston, Virginia where he released several versions of the
+software.
+
+In May 2000, Guido and the Python core development team moved to
+BeOpen.com to form the BeOpen PythonLabs team.  In October of the same
+year, the PythonLabs team moved to Digital Creations (now Zope
+Corporation, see http://www.zope.com).  In 2001, the Python Software
+Foundation (PSF, see http://www.python.org/psf/) was formed, a
+non-profit organization created specifically to own Python-related
+Intellectual Property.  Zope Corporation is a sponsoring member of
+the PSF.
+
+All Python releases are Open Source (see http://www.opensource.org for
+the Open Source Definition).  Historically, most, but not all, Python
+releases have also been GPL-compatible; the table below summarizes
+the various releases.
+
+    Release         Derived     Year        Owner       GPL-
+                    from                                compatible? (1)
+
+    0.9.0 thru 1.2              1991-1995   CWI         yes
+    1.3 thru 1.5.2  1.2         1995-1999   CNRI        yes
+    1.6             1.5.2       2000        CNRI        no
+    2.0             1.6         2000        BeOpen.com  no
+    1.6.1           1.6         2001        CNRI        yes (2)
+    2.1             2.0+1.6.1   2001        PSF         no
+    2.0.1           2.0+1.6.1   2001        PSF         yes
+    2.1.1           2.1+2.0.1   2001        PSF         yes
+    2.2             2.1.1       2001        PSF         yes
+    2.1.2           2.1.1       2002        PSF         yes
+    2.1.3           2.1.2       2002        PSF         yes
+    2.2.1           2.2         2002        PSF         yes
+    2.2.2           2.2.1       2002        PSF         yes
+    2.2.3           2.2.2       2003        PSF         yes
+    2.3             2.2.2       2002-2003   PSF         yes
+    2.3.1           2.3         2002-2003   PSF         yes
+    2.3.2           2.3.1       2002-2003   PSF         yes
+    2.3.3           2.3.2       2002-2003   PSF         yes
+    2.3.4           2.3.3       2004        PSF         yes
+    2.3.5           2.3.4       2005        PSF         yes
+    2.4             2.3         2004        PSF         yes
+    2.4.1           2.4         2005        PSF         yes
+    2.4.2           2.4.1       2005        PSF         yes
+    2.4.3           2.4.2       2006        PSF         yes
+    2.5             2.4         2006        PSF         yes
+    2.5.1           2.5         2007        PSF         yes
+    2.5.2           2.5.1       2008        PSF         yes
+    2.5.3           2.5.2       2008        PSF         yes
+    2.6             2.5         2008        PSF         yes
+    2.6.1           2.6         2008        PSF         yes
+    2.6.2           2.6.1       2009        PSF         yes
+    2.6.3           2.6.2       2009        PSF         yes
+    2.6.4           2.6.3       2009        PSF         yes
+    2.6.5           2.6.4       2010        PSF         yes
+    3.0             2.6         2008        PSF         yes
+    3.0.1           3.0         2009        PSF         yes
+    3.1             3.0.1       2009        PSF         yes
+    3.1.1           3.1         2009        PSF         yes
+    3.1.2           3.1.1       2010        PSF         yes
+    3.1.3           3.1.2       2010        PSF         yes
+    3.1.4           3.1.3       2011        PSF         yes
+    3.2             3.1         2011        PSF         yes
+    3.2.1           3.2         2011        PSF         yes
+    3.2.2           3.2.1       2011        PSF         yes
+    3.3             3.2         2012        PSF         yes
+
+Footnotes:
+
+(1) GPL-compatible doesn't mean that we're distributing Python under
+    the GPL.  All Python licenses, unlike the GPL, let you distribute
+    a modified version without making your changes open source.  The
+    GPL-compatible licenses make it possible to combine Python with
+    other software that is released under the GPL; the others don't.
+
+(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
+    because its license has a choice of law clause.  According to
+    CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
+    is "not incompatible" with the GPL.
+
+Thanks to the many outside volunteers who have worked under Guido's
+direction to make these releases possible.
+
+
+B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
+===============================================================
+
+PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
+--------------------------------------------
+
+1. This LICENSE AGREEMENT is between the Python Software Foundation
+("PSF"), and the Individual or Organization ("Licensee") accessing and
+otherwise using this software ("Python") in source or binary form and
+its associated documentation.
+
+2. Subject to the terms and conditions of this License Agreement, PSF
+hereby grants Licensee a nonexclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display publicly,
+prepare derivative works, distribute, and otherwise use Python
+alone or in any derivative version, provided, however, that PSF's
+License Agreement and PSF's notice of copyright, i.e., "Copyright (c)
+2001, 2002, 2003, 2004, 2005, 2006, 2007 Python Software Foundation; 
+All Rights Reserved" are retained in Python alone or in any derivative 
+version prepared by Licensee.
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates Python or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python.
+
+4. PSF is making Python available to Licensee on an "AS IS"
+basis.  PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. Nothing in this License Agreement shall be deemed to create any
+relationship of agency, partnership, or joint venture between PSF and
+Licensee.  This License Agreement does not grant permission to use PSF
+trademarks or trade name in a trademark sense to endorse or promote
+products or services of Licensee, or any third party.
+
+8. By copying, installing or otherwise using Python, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+
+
+BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
+-------------------------------------------
+
+BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
+
+1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
+office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
+Individual or Organization ("Licensee") accessing and otherwise using
+this software in source or binary form and its associated
+documentation ("the Software").
+
+2. Subject to the terms and conditions of this BeOpen Python License
+Agreement, BeOpen hereby grants Licensee a non-exclusive,
+royalty-free, world-wide license to reproduce, analyze, test, perform
+and/or display publicly, prepare derivative works, distribute, and
+otherwise use the Software alone or in any derivative version,
+provided, however, that the BeOpen Python License is retained in the
+Software, alone or in any derivative version prepared by Licensee.
+
+3. BeOpen is making the Software available to Licensee on an "AS IS"
+basis.  BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
+SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
+AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
+DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+5. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+6. This License Agreement shall be governed by and interpreted in all
+respects by the law of the State of California, excluding conflict of
+law provisions.  Nothing in this License Agreement shall be deemed to
+create any relationship of agency, partnership, or joint venture
+between BeOpen and Licensee.  This License Agreement does not grant
+permission to use BeOpen trademarks or trade names in a trademark
+sense to endorse or promote products or services of Licensee, or any
+third party.  As an exception, the "BeOpen Python" logos available at
+http://www.pythonlabs.com/logos.html may be used according to the
+permissions granted on that web page.
+
+7. By copying, installing or otherwise using the software, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+
+
+CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
+---------------------------------------
+
+1. This LICENSE AGREEMENT is between the Corporation for National
+Research Initiatives, having an office at 1895 Preston White Drive,
+Reston, VA 20191 ("CNRI"), and the Individual or Organization
+("Licensee") accessing and otherwise using Python 1.6.1 software in
+source or binary form and its associated documentation.
+
+2. Subject to the terms and conditions of this License Agreement, CNRI
+hereby grants Licensee a nonexclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display publicly,
+prepare derivative works, distribute, and otherwise use Python 1.6.1
+alone or in any derivative version, provided, however, that CNRI's
+License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
+1995-2001 Corporation for National Research Initiatives; All Rights
+Reserved" are retained in Python 1.6.1 alone or in any derivative
+version prepared by Licensee.  Alternately, in lieu of CNRI's License
+Agreement, Licensee may substitute the following text (omitting the
+quotes): "Python 1.6.1 is made available subject to the terms and
+conditions in CNRI's License Agreement.  This Agreement together with
+Python 1.6.1 may be located on the Internet using the following
+unique, persistent identifier (known as a handle): 1895.22/1013.  This
+Agreement may also be obtained from a proxy server on the Internet
+using the following URL: http://hdl.handle.net/1895.22/1013".
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates Python 1.6.1 or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python 1.6.1.
+
+4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
+basis.  CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. This License Agreement shall be governed by the federal
+intellectual property law of the United States, including without
+limitation the federal copyright law, and, to the extent such
+U.S. federal law does not apply, by the law of the Commonwealth of
+Virginia, excluding Virginia's conflict of law provisions.
+Notwithstanding the foregoing, with regard to derivative works based
+on Python 1.6.1 that incorporate non-separable material that was
+previously distributed under the GNU General Public License (GPL), the
+law of the Commonwealth of Virginia shall govern this License
+Agreement only as to issues arising under or with respect to
+Paragraphs 4, 5, and 7 of this License Agreement.  Nothing in this
+License Agreement shall be deemed to create any relationship of
+agency, partnership, or joint venture between CNRI and Licensee.  This
+License Agreement does not grant permission to use CNRI trademarks or
+trade name in a trademark sense to endorse or promote products or
+services of Licensee, or any third party.
+
+8. By clicking on the "ACCEPT" button where indicated, or by copying,
+installing or otherwise using Python 1.6.1, Licensee agrees to be
+bound by the terms and conditions of this License Agreement.
+
+        ACCEPT
+
+
+CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
+--------------------------------------------------
+
+Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
+The Netherlands.  All rights reserved.
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Stichting Mathematisch
+Centrum or CWI not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
+FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+Licenses and Acknowledgements for Incorporated Software
+=======================================================
+
+Mersenne Twister
+----------------
+
+The `_random' module includes code based on a download from
+`http://www.math.keio.ac.jp/~matumoto/MT2002/emt19937ar.html'.  The
+following are the verbatim comments from the original code:
+
+     A C-program for MT19937, with initialization improved 2002/1/26.
+     Coded by Takuji Nishimura and Makoto Matsumoto.
+
+     Before using, initialize the state by using init_genrand(seed)
+     or init_by_array(init_key, key_length).
+
+     Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+     All rights reserved.
+
+     Redistribution and use in source and binary forms, with or without
+     modification, are permitted provided that the following conditions
+     are met:
+
+      1. Redistributions of source code must retain the above copyright
+         notice, this list of conditions and the following disclaimer.
+
+      2. Redistributions in binary form must reproduce the above copyright
+         notice, this list of conditions and the following disclaimer in the
+         documentation and/or other materials provided with the distribution.
+
+      3. The names of its contributors may not be used to endorse or promote
+         products derived from this software without specific prior written
+         permission.
+
+     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+     A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
+     OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+     TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+     PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+     LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+     NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+     Any feedback is very welcome.
+     http://www.math.keio.ac.jp/matumoto/emt.html
+     email: matumoto@math.keio.ac.jp
+
+
+Sockets
+-------
+
+The `socket' module uses the functions, `getaddrinfo', and
+`getnameinfo', which are coded in separate source files from the WIDE
+Project, `http://www.wide.ad.jp/about/index.html'.
+
+     Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+     All rights reserved.
+
+     Redistribution and use in source and binary forms, with or without
+     modification, are permitted provided that the following conditions
+     are met:
+     1. Redistributions of source code must retain the above copyright
+        notice, this list of conditions and the following disclaimer.
+     2. Redistributions in binary form must reproduce the above copyright
+        notice, this list of conditions and the following disclaimer in the
+        documentation and/or other materials provided with the distribution.
+     3. Neither the name of the project nor the names of its contributors
+        may be used to endorse or promote products derived from this software
+        without specific prior written permission.
+
+     THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+     GAI_ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+     ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+     FOR GAI_ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+     INTERRUPTION) HOWEVER CAUSED AND ON GAI_ANY THEORY OF LIABILITY, WHETHER
+     IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+     ARISING IN GAI_ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+     OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Floating point exception control
+--------------------------------
+
+The source for the `fpectl' module includes the following notice:
+
+     ---------------------------------------------------------------------  
+    /                       Copyright (c) 1996.                           \ 
+   |          The Regents of the University of California.                 |
+   |                        All rights reserved.                           |
+   |                                                                       |
+   |   Permission to use, copy, modify, and distribute this software for   |
+   |   any purpose without fee is hereby granted, provided that this en-   |
+   |   tire notice is included in all copies of any software which is or   |
+   |   includes  a  copy  or  modification  of  this software and in all   |
+   |   copies of the supporting documentation for such software.           |
+   |                                                                       |
+   |   This  work was produced at the University of California, Lawrence   |
+   |   Livermore National Laboratory under  contract  no.  W-7405-ENG-48   |
+   |   between  the  U.S.  Department  of  Energy and The Regents of the   |
+   |   University of California for the operation of UC LLNL.              |
+   |                                                                       |
+   |                              DISCLAIMER                               |
+   |                                                                       |
+   |   This  software was prepared as an account of work sponsored by an   |
+   |   agency of the United States Government. Neither the United States   |
+   |   Government  nor the University of California nor any of their em-   |
+   |   ployees, makes any warranty, express or implied, or  assumes  any   |
+   |   liability  or  responsibility  for the accuracy, completeness, or   |
+   |   usefulness of any information,  apparatus,  product,  or  process   |
+   |   disclosed,   or  represents  that  its  use  would  not  infringe   |
+   |   privately-owned rights. Reference herein to any specific  commer-   |
+   |   cial  products,  process,  or  service  by trade name, trademark,   |
+   |   manufacturer, or otherwise, does not  necessarily  constitute  or   |
+   |   imply  its endorsement, recommendation, or favoring by the United   |
+   |   States Government or the University of California. The views  and   |
+   |   opinions  of authors expressed herein do not necessarily state or   |
+   |   reflect those of the United States Government or  the  University   |
+   |   of  California,  and shall not be used for advertising or product   |
+    \  endorsement purposes.                                              / 
+     ---------------------------------------------------------------------
+
+
+Cookie management
+-----------------
+
+The `Cookie' module contains the following notice:
+
+      Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
+
+                     All Rights Reserved
+
+      Permission to use, copy, modify, and distribute this software
+      and its documentation for any purpose and without fee is hereby
+      granted, provided that the above copyright notice appear in all
+      copies and that both that copyright notice and this permission
+      notice appear in supporting documentation, and that the name of
+      Timothy O'Malley  not be used in advertising or publicity
+      pertaining to distribution of the software without specific, written
+      prior permission.
+
+      Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+      SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+      AND FITNESS, IN NO EVENT SHALL Timothy O'Malley BE LIABLE FOR
+      ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+      WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+      WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+      ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+      PERFORMANCE OF THIS SOFTWARE.
+
+
+Execution tracing
+-----------------
+
+The `trace' module contains the following notice:
+
+      portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
+      err...  reserved and offered to the public under the terms of the
+      Python 2.2 license.
+      Author: Zooko O'Whielacronx
+      http://zooko.com/
+      mailto:zooko@zooko.com
+
+      Copyright 2000, Mojam Media, Inc., all rights reserved.
+      Author: Skip Montanaro
+
+      Copyright 1999, Bioreason, Inc., all rights reserved.
+      Author: Andrew Dalke
+
+      Copyright 1995-1997, Automatrix, Inc., all rights reserved.
+      Author: Skip Montanaro
+
+      Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved.
+
+      Permission to use, copy, modify, and distribute this Python software and
+      its associated documentation for any purpose without fee is hereby
+      granted, provided that the above copyright notice appears in all copies,
+      and that both that copyright notice and this permission notice appear in
+      supporting documentation, and that the name of neither Automatrix,
+      Bioreason or Mojam Media be used in advertising or publicity pertaining
+      to distribution of the software without specific, written prior
+      permission.
+
+
+UUencode and UUdecode functions
+-------------------------------
+
+The `uu' module contains the following notice:
+
+      Copyright 1994 by Lance Ellinghouse
+      Cathedral City, California Republic, United States of America.
+                             All Rights Reserved
+      Permission to use, copy, modify, and distribute this software and its
+      documentation for any purpose and without fee is hereby granted,
+      provided that the above copyright notice appear in all copies and that
+      both that copyright notice and this permission notice appear in
+      supporting documentation, and that the name of Lance Ellinghouse
+      not be used in advertising or publicity pertaining to distribution
+      of the software without specific, written prior permission.
+      LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
+      THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+      FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE CENTRUM BE LIABLE
+      FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+      WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+      ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+      OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+      Modified by Jack Jansen, CWI, July 1995:
+      - Use binascii module to do the actual line-by-line conversion
+        between ascii and binary. This results in a 1000-fold speedup. The C
+        version is still 5 times faster, though.
+      - Arguments more compliant with python standard
+
+
+XML Remote Procedure Calls
+--------------------------
+
+The `xmlrpclib' module contains the following notice:
+
+          The XML-RPC client interface is
+
+      Copyright (c) 1999-2002 by Secret Labs AB
+      Copyright (c) 1999-2002 by Fredrik Lundh
+
+      By obtaining, using, and/or copying this software and/or its
+      associated documentation, you agree that you have read, understood,
+      and will comply with the following terms and conditions:
+
+      Permission to use, copy, modify, and distribute this software and
+      its associated documentation for any purpose and without fee is
+      hereby granted, provided that the above copyright notice appears in
+      all copies, and that both that copyright notice and this permission
+      notice appear in supporting documentation, and that the name of
+      Secret Labs AB or the author not be used in advertising or publicity
+      pertaining to distribution of the software without specific, written
+      prior permission.
+
+      SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+      TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+      ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+      BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+      DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+      WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+      ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+      OF THIS SOFTWARE.
+
+Licenses for Software linked to
+===============================
+
+Note that the choice of GPL compatibility outlined above doesn't extend
+to modules linked to particular libraries, since they change the
+effective License of the module binary.
+
+
+GNU Readline
+------------
+
+The 'readline' module makes use of GNU Readline.
+
+      The GNU Readline Library is free software; you can redistribute it
+      and/or modify it under the terms of the GNU General Public License as
+      published by the Free Software Foundation; either version 2, or (at
+      your option) any later version.
+
+      On Debian systems, you can find the complete statement in
+      /usr/share/doc/readline-common/copyright'. A copy of the GNU General
+      Public License is available in /usr/share/common-licenses/GPL-2'.
+
+
+OpenSSL
+-------
+
+The '_ssl' module makes use of OpenSSL.
+
+      The OpenSSL toolkit stays under a dual license, i.e. both the
+      conditions of the OpenSSL License and the original SSLeay license
+      apply to the toolkit. Actually both licenses are BSD-style Open
+      Source licenses. Note that both licenses are incompatible with
+      the GPL.
+
+      On Debian systems, you can find the complete license text in
+      /usr/share/doc/openssl/copyright'.
+
+
+Files with other licenses than the Python License
+-------------------------------------------------
+
+Files: Include/dynamic_annotations.h
+Files: Python/dynamic_annotations.c
+Copyright: (c) 2008-2009, Google Inc.
+License: Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are
+  met:
+ 
+      * Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+      * Neither the name of Google Inc. nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: Include/unicodeobject.h
+Copyright: (c) Corporation for National Research Initiatives.
+Copyright: (c) 1999 by Secret Labs AB.
+Copyright: (c) 1999 by Fredrik Lundh.
+License: By obtaining, using, and/or copying this software and/or its
+  associated documentation, you agree that you have read, understood,
+  and will comply with the following terms and conditions:
+ 
+  Permission to use, copy, modify, and distribute this software and its
+  associated documentation for any purpose and without fee is hereby
+  granted, provided that the above copyright notice appears in all
+  copies, and that both that copyright notice and this permission notice
+  appear in supporting documentation, and that the name of Secret Labs
+  AB or the author not be used in advertising or publicity pertaining to
+  distribution of the software without specific, written prior
+  permission.
+ 
+  SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
+  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+  FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR
+  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+  OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: Lib/logging/*
+Copyright: 2001-2010 by Vinay Sajip. All Rights Reserved.
+License: Permission to use, copy, modify, and distribute this software and
+ its documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of Vinay Sajip
+ not be used in advertising or publicity pertaining to distribution
+ of the software without specific, written prior permission.
+ VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
+ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: Lib/multiprocessing/*
+Files: Modules/_multiprocessing/*
+Copyright: (c) 2006-2008, R Oudkerk. All rights reserved.
+License: Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. Neither the name of author nor the names of any contributors may be
+    used to endorse or promote products derived from this software
+    without specific prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+Files: Lib/sqlite3/*
+Files: Modules/_sqlite/*
+Copyright: (C) 2004-2005 Gerhard Häring <gh@ghaering.de>
+License: This software is provided 'as-is', without any express or implied
+ warranty.  In no event will the authors be held liable for any damages
+ arising from the use of this software.
+ 
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+ 
+ 1. The origin of this software must not be misrepresented; you must not
+    claim that you wrote the original software. If you use this software
+    in a product, an acknowledgment in the product documentation would be
+    appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+    misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+Files: Lib/async*
+Copyright: Copyright 1996 by Sam Rushing
+License: Permission to use, copy, modify, and distribute this software and
+ its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that copyright notice and this permission
+ notice appear in supporting documentation, and that the name of Sam
+ Rushing not be used in advertising or publicity pertaining to
+ distribution of the software without specific, written prior
+ permission.
+ 
+ SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: Lib/tarfile.py
+Copyright: (C) 2002 Lars Gustaebel <lars@gustaebel.de>
+License: Permission  is  hereby granted,  free  of charge,  to  any person
+ obtaining a  copy of  this software  and associated documentation
+ files  (the  "Software"),  to   deal  in  the  Software   without
+ restriction,  including  without limitation  the  rights to  use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies  of  the  Software,  and to  permit  persons  to  whom the
+ Software  is  furnished  to  do  so,  subject  to  the  following
+ conditions:
+ 
+ The above copyright  notice and this  permission notice shall  be
+ included in all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS  IS", WITHOUT WARRANTY OF ANY  KIND,
+ EXPRESS OR IMPLIED, INCLUDING  BUT NOT LIMITED TO  THE WARRANTIES
+ OF  MERCHANTABILITY,  FITNESS   FOR  A  PARTICULAR   PURPOSE  AND
+ NONINFRINGEMENT.  IN  NO  EVENT SHALL  THE  AUTHORS  OR COPYRIGHT
+ HOLDERS  BE LIABLE  FOR ANY  CLAIM, DAMAGES  OR OTHER  LIABILITY,
+ WHETHER  IN AN  ACTION OF  CONTRACT, TORT  OR OTHERWISE,  ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+Files: Lib/turtle.py
+Copyright: (C) 2006 - 2010  Gregor Lingl
+License: This software is provided 'as-is', without any express or implied
+ warranty.  In no event will the authors be held liable for any damages
+ arising from the use of this software.
+ 
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+ 
+ 1. The origin of this software must not be misrepresented; you must not
+    claim that you wrote the original software. If you use this software
+    in a product, an acknowledgment in the product documentation would be
+    appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+    misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ is copyright Gregor Lingl and licensed under a BSD-like license
+
+Files: Modules/_ctypes/libffi/*
+Copyright: Copyright (C) 1996-2011 Red Hat, Inc and others.
+    Copyright (C) 1996-2011 Anthony Green
+    Copyright (C) 1996-2010 Free Software Foundation, Inc
+    Copyright (c) 2003, 2004, 2006, 2007, 2008 Kaz Kojima
+    Copyright (c) 2010, 2011, Plausible Labs Cooperative , Inc.
+    Copyright (c) 2010 CodeSourcery
+    Copyright (c) 1998 Andreas Schwab
+    Copyright (c) 2000 Hewlett Packard Company
+    Copyright (c) 2009 Bradley Smith
+    Copyright (c) 2008 David Daney
+    Copyright (c) 2004 Simon Posnjak
+    Copyright (c) 2005 Axis Communications AB
+    Copyright (c) 1998 Cygnus Solutions
+    Copyright (c) 2004 Renesas Technology
+    Copyright (c) 2002, 2007  Bo Thorsen <bo@suse.de>
+    Copyright (c) 2002 Ranjit Mathew
+    Copyright (c) 2002 Roger Sayle
+    Copyright (c) 2000, 2007 Software AG
+    Copyright (c) 2003 Jakub Jelinek
+    Copyright (c) 2000, 2001 John Hornkvist
+    Copyright (c) 1998 Geoffrey Keating
+    Copyright (c) 2008 Björn König
+
+License: Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
+   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+   NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+   DEALINGS IN THE SOFTWARE.
+
+   Documentation:
+   Permission is granted to copy, distribute and/or modify this document
+   under the terms of the GNU General Public License as published by the
+   Free Software Foundation; either version 2, or (at your option) any
+   later version.  A copy of the license is included in the
+   section entitled ``GNU General Public License''.
+
+Files: Modules/_gestalt.c
+Copyright: 1991-1997 by Stichting Mathematisch Centrum, Amsterdam.
+License: Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+ supporting documentation, and that the names of Stichting Mathematisch
+ Centrum or CWI not be used in advertising or publicity pertaining to
+ distribution of the software without specific, written prior permission.
+ 
+ STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
+ FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: Modules/syslogmodule.c
+Copyright: 1994 by Lance Ellinghouse
+License: Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of Lance Ellinghouse
+ not be used in advertising or publicity pertaining to distribution
+ of the software without specific, written prior permission.
+ 
+ LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE BE LIABLE FOR ANY SPECIAL,
+ INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: Modules/zlib/*
+Copyright: (C) 1995-2010 Jean-loup Gailly and Mark Adler
+License: This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
+
+ If you use the zlib library in a product, we would appreciate *not* receiving
+ lengthy legal documents to sign.  The sources are provided for free but without
+ warranty of any kind.  The library has been entirely written by Jean-loup
+ Gailly and Mark Adler; it does not include third-party code.
+
+Files: Modules/expat/*
+Copyright: Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
+  and Clark Cooper
+  Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers
+License: Permission is hereby granted, free of charge, to any person obtaining
+  a copy of this software and associated documentation files (the
+  "Software"), to deal in the Software without restriction, including
+  without limitation the rights to use, copy, modify, merge, publish,
+  distribute, sublicense, and/or sell copies of the Software, and to
+  permit persons to whom the Software is furnished to do so, subject to
+  the following conditions:
+ 
+  The above copyright notice and this permission notice shall be included
+  in all copies or substantial portions of the Software.
+ 
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Files: Modules/_decimal/libmpdec/*
+Copyright: Copyright (c) 2008-2012 Stefan Krah. All rights reserved.
+License: Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ ,
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+Files: Misc/python-mode.el
+Copyright: Copyright (C) 1992,1993,1994  Tim Peters
+License: This software is provided as-is, without express or implied
+	warranty.  Permission to use, copy, modify, distribute or sell this
+	software, without fee, for any purpose and by any individual or
+	organization, is hereby granted, provided that the above copyright
+	notice and this paragraph appear in all copies.
+
+Files: Python/dtoa.c
+Copyright: (c) 1991, 2000, 2001 by Lucent Technologies.
+License: Permission to use, copy, modify, and distribute this software for any
+  purpose without fee is hereby granted, provided that this entire notice
+  is included in all copies of any software which is or includes a copy
+  or modification of this software and in all copies of the supporting
+  documentation for such software.
+  
+  THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
+  WARRANTY.  IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
+  REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
+  OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
+
+Files: Python/getopt.c
+Copyright: 1992-1994, David Gottner
+License: Permission to use, copy, modify, and distribute this software and its
+  documentation for any purpose and without fee is hereby granted,
+  provided that the above copyright notice, this permission notice and
+  the following disclaimer notice appear unmodified in all copies.
+  
+  I DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL I
+  BE LIABLE FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+  DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER
+  IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+  OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: PC/_subprocess.c
+Copyright: Copyright (c) 2004 by Fredrik Lundh <fredrik@pythonware.com>
+	Copyright (c) 2004 by Secret Labs AB, http://www.pythonware.com
+	Copyright (c) 2004 by Peter Astrand <astrand@lysator.liu.se>
+License:
+ * Permission to use, copy, modify, and distribute this software and
+ * its associated documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice appears in
+ * all copies, and that both that copyright notice and this permission
+ * notice appear in supporting documentation, and that the name of the
+ * authors not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission.
+ *
+ * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: PC/winsound.c
+Copyright: Copyright (c) 1999 Toby Dickenson
+License:  * Permission to use this software in any way is granted without
+ * fee, provided that the copyright notice above appears in all
+ * copies. This software is provided "as is" without any warranty.
+ */
+
+/* Modified by Guido van Rossum */
+/* Beep added by Mark Hammond */
+/* Win9X Beep and platform identification added by Uncle Timmy */
+
+Files: Tools/pybench/*
+Copyright: (c), 1997-2006, Marc-Andre Lemburg (mal@lemburg.com)
+  (c), 2000-2006, eGenix.com Software GmbH (info@egenix.com)
+License: Permission to use, copy, modify, and distribute this software and its
+  documentation for any purpose and without fee or royalty is hereby
+  granted, provided that the above copyright notice appear in all copies
+  and that both that copyright notice and this permission notice appear
+  in supporting documentation or portions thereof, including
+  modifications, that you make.
+  
+  THE AUTHOR MARC-ANDRE LEMBURG DISCLAIMS ALL WARRANTIES WITH REGARD TO
+  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+  FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
+  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+  FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+  NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+  WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
--- python3.3-3.3.0.orig/debian/PVER.menu.in
+++ python3.3-3.3.0/debian/PVER.menu.in
@@ -0,0 +1,4 @@
+?package(@PVER@):needs="text" section="Applications/Programming"\
+	title="Python (v@VER@)"\
+	icon="/usr/share/pixmaps/@PVER@.xpm"\
+	command="/usr/bin/python@VER@"
--- python3.3-3.3.0.orig/debian/README.PVER.in
+++ python3.3-3.3.0/debian/README.PVER.in
@@ -0,0 +1,95 @@
+
+  Python @VER@ for Debian
+  ---------------------
+
+This is Python @VER@ packaged for Debian.
+
+This document contains information specific to the Debian packages of
+Python @VER@.
+
+
+
+   [TODO: This document is not yet up-to-date with the packages.]
+
+Currently, it features those two main topics:
+
+  1. Release notes for the Debian packages:
+  2. Notes for developers using the Debian Python packages:
+
+Release notes and documentation from the upstream package are installed
+in /usr/share/doc/@PVER@/.
+
+There's a mailing list for discussion of issues related to Python on Debian
+systems: debian-python@lists.debian.org. The list is not intended for
+general Python problems, but as a forum for maintainers of Python-related
+packages and interested third parties.
+
+
+
+1. Release notes for the Debian packages:
+
+
+Results of the regression test:
+------------------------------
+
+The package does successfully run the regression tests for all included
+modules. Seven packages are skipped since they are platform-dependent and
+can't be used with Linux.
+
+
+2. Notes for developers using the Debian python packages:
+
+See the draft of the Debian Python policy in /usr/share/doc/python.
+
+distutils can be found in the @PVER@-dev package. Development files
+like the python library or Makefiles can be found in the @PVER@-dev
+package in /usr/lib/@PVER@/config. Therefore, if you need to install 
+a pure python extension, you only need @PVER@. On the other hand, to 
+install a C extension, you need @PVER@-dev.
+
+a) Locally installed Python add-ons
+
+    /usr/local/lib/@PVER@/site-packages/
+    /usr/local/lib/site-python/ (version-independent modules)
+
+b) Python add-ons packaged for Debian
+
+    /usr/lib/@PVER@/site-packages/
+    /usr/lib/site-python/ (version-independent modules)
+
+Note that no package must install files directly into /usr/lib/@PVER@/
+or /usr/local/lib/@PVER@/. Only the site-packages directory is allowed
+for third-party extensions.
+
+Use of the new `package' scheme is strongly encouraged. The `ni' interface
+is obsolete in python 1.5.
+
+Header files for extensions go into /usr/include/@PVER@/.
+
+
+Installing extensions for local use only:
+----------------------------------------
+
+Consider using distutils ...
+
+Most extensions use Python's Makefile.pre.in. Note that Makefile.pre.in
+by default will install files into /usr/lib/, not into /usr/local/lib/,
+which is not allowed for local extensions. You'll have to change the
+Makefile accordingly. Most times, "make prefix=/usr/local install" will
+work.
+
+
+Packaging python extensions for Debian:
+--------------------------------------
+
+Maintainers of Python extension packages should read
+
+	/usr/share/doc/python/python-policy.txt.gz
+
+ 
+
+
+    03/09/98
+    Gregor Hoffleit <flight@debian.org>
+
+Last change: 2001-12-14
--- python3.3-3.3.0.orig/debian/PVER-doc.doc-base.PVER-lib.in
+++ python3.3-3.3.0/debian/PVER-doc.doc-base.PVER-lib.in
@@ -0,0 +1,15 @@
+Document: @PVER@-lib
+Title: Python Library Reference (v@VER@)
+Author: Guido van Rossum
+Abstract: This library reference manual documents Python's standard library,
+ as well as many optional library modules (which may or may not be
+ available, depending on whether the underlying platform supports
+ them and on the configuration choices made at compile time).  It
+ also documents the standard types of the language and its built-in
+ functions and exceptions, many of which are not or incompletely
+ documented in the Reference Manual.
+Section: Programming/Python
+
+Format: HTML
+Index: /usr/share/doc/@PVER@/html/library/index.html
+Files: /usr/share/doc/@PVER@/html/library/*.html
--- python3.3-3.3.0.orig/debian/PVER.desktop.in
+++ python3.3-3.3.0/debian/PVER.desktop.in
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Python (v@VER@)
+Comment=Python Interpreter (v@VER@)
+Exec=/usr/bin/@PVER@
+Icon=/usr/share/pixmaps/@PVER@.xpm
+Terminal=true
+Type=Application
+Categories=Development;
+StartupNotify=true
+NoDisplay=true
--- python3.3-3.3.0.orig/debian/source.lintian-overrides.in
+++ python3.3-3.3.0/debian/source.lintian-overrides.in
@@ -0,0 +1,2 @@
+# generated during the build
+@PVER@ source: quilt-build-dep-but-no-series-file
--- python3.3-3.3.0.orig/debian/compat
+++ python3.3-3.3.0/debian/compat
@@ -0,0 +1 @@
+5
--- python3.3-3.3.0.orig/debian/pysetup3.1
+++ python3.3-3.3.0/debian/pysetup3.1
@@ -0,0 +1,42 @@
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
+.TH PYSETUP3.3 "1" "January 2012" "pysetup3.3 3.3" "User Commands"
+.SH NAME
+pysetup3.3 \- pysetup tool
+.SH SYNOPSIS
+.B pysetup
+[\fIoptions\fR] \fIaction \fR[\fIaction_options\fR]
+.SH DESCRIPTION
+.SS "Actions:"
+.IP
+run: Run one or several commands
+metadata: Display the metadata of a project
+install: Install a project
+remove: Remove a project
+search: Search for a project in the indexes
+list: List installed projects
+graph: Display a graph
+create: Create a project
+generate\-setup: Generate a backward\-compatible setup.py
+.PP
+To get more help on an action, use:
+.IP
+pysetup action \fB\-\-help\fR
+.SS "Global options:"
+.TP
+\fB\-\-verbose\fR (\fB\-v\fR)
+run verbosely (default)
+.TP
+\fB\-\-quiet\fR (\fB\-q\fR)
+run quietly (turns verbosity off)
+.TP
+\fB\-\-dry\-run\fR (\fB\-n\fR)
+don't actually do anything
+.TP
+\fB\-\-help\fR (\fB\-h\fR)
+show detailed help message
+.TP
+\fB\-\-no\-user\-cfg\fR
+ignore pydistutils.cfg in your home directory
+.TP
+\fB\-\-version\fR
+Display the version
--- python3.3-3.3.0.orig/debian/watch
+++ python3.3-3.3.0/debian/watch
@@ -0,0 +1,3 @@
+version=3
+opts=dversionmangle=s/.*\+//,uversionmangle=s/([abcr]+[1-9])$/~$1/ \
+  http://www.python.org/ftp/python/3\.2(\.\d)?/Python-(3\.2[.\dabcr]*)\.tgz
--- python3.3-3.3.0.orig/debian/PVER.overrides.in
+++ python3.3-3.3.0/debian/PVER.overrides.in
@@ -0,0 +1,8 @@
+# yes, we have to
+@PVER@ binary: depends-on-python-minimal
+
+@PVER@ binary: desktop-command-not-in-package
+@PVER@ binary: menu-command-not-in-package
+
+# no, not useless
+@PVER@ binary: manpage-has-useless-whatis-entry
--- python3.3-3.3.0.orig/debian/PVER-doc.doc-base.PVER-dist.in
+++ python3.3-3.3.0/debian/PVER-doc.doc-base.PVER-dist.in
@@ -0,0 +1,13 @@
+Document: @PVER@-dist
+Title: Distributing Python Modules (v@VER@)
+Author: Greg Ward
+Abstract: This document describes the Python Distribution Utilities
+ (``Distutils'') from the module developer's point-of-view, describing
+ how to use the Distutils to make Python modules and extensions easily
+ available to a wider audience with very little overhead for
+ build/release/install mechanics.
+Section: Programming/Python
+
+Format: HTML
+Index: /usr/share/doc/@PVER@/html/distutils/index.html
+Files: /usr/share/doc/@PVER@/html/distutils/*.html
--- python3.3-3.3.0.orig/debian/control.udeb
+++ python3.3-3.3.0/debian/control.udeb
@@ -0,0 +1,11 @@
+
+Package: @PVER@-udeb
+XC-Package-Type: udeb
+Section: debian-installer
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+XB-Python-Runtime: @PVER@
+XB-Python-Version: @VER@
+Description: A minimal subset of the Python language (version @VER@)
+ This package contains the interpreter and some essential modules, packaged
+ for use in the installer.
--- python3.3-3.3.0.orig/debian/libPVER-minimal.postrm.in
+++ python3.3-3.3.0/debian/libPVER-minimal.postrm.in
@@ -0,0 +1,15 @@
+#! /bin/sh -e
+
+if [ "$1" = "purge" ]; then
+    for d in `find /usr/lib/@PVER@ -depth -type d -empty 2> /dev/null`; do \
+        while rmdir $d 2> /dev/null; do d=`dirname $d`; done; \
+    done
+    rm -rf /etc/@PVER@/site.py /etc/@PVER@/sitecustomize.py /etc/@PVER@/__pycache__
+    if [ -d /etc/@PVER@ ]; then
+	rmdir --ignore-fail-on-non-empty /etc/@PVER@
+    fi
+fi
+
+#DEBHELPER#
+
+exit 0
--- python3.3-3.3.0.orig/debian/depgraph.py
+++ python3.3-3.3.0/debian/depgraph.py
@@ -0,0 +1,199 @@
+#! /usr/bin/python3
+
+# Copyright 2004 Toby Dickenson
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject
+# to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+import sys, getopt, colorsys, imp, md5
+
+class pydepgraphdot:
+
+    def main(self,argv):    
+        opts,args = getopt.getopt(argv,'',['mono'])
+        self.colored = 1
+        for o,v in opts:
+            if o=='--mono':
+                self.colored = 0
+        self.render()
+
+    def fix(self,s):
+        # Convert a module name to a syntactically correct node name
+        return s.replace('.','_')
+    
+    def render(self):
+        p,t = self.get_data()
+
+        # normalise our input data
+        for k,d in list(p.items()):
+            for v in list(d.keys()):
+                if v not in p:
+                    p[v] = {}
+                    
+        f = self.get_output_file()                    
+                    
+        f.write('digraph G {\n')
+        #f.write('concentrate = true;\n')
+        #f.write('ordering = out;\n')
+        f.write('ranksep=1.0;\n')
+        f.write('node [style=filled,fontname=Helvetica,fontsize=10];\n')
+        allkd = list(p.items())
+        allkd.sort()
+        for k,d in allkd:
+            tk = t.get(k)
+            if self.use(k,tk):
+                allv = list(d.keys())
+                allv.sort()
+                for v in allv:
+                    tv = t.get(v)
+                    if self.use(v,tv) and not self.toocommon(v,tv):
+                        f.write('%s -> %s' % ( self.fix(k),self.fix(v) ) )
+                        self.write_attributes(f,self.edge_attributes(k,v))
+                        f.write(';\n')
+                f.write(self.fix(k))
+                self.write_attributes(f,self.node_attributes(k,tk))
+                f.write(';\n')
+        f.write('}\n')
+
+    def write_attributes(self,f,a):
+        if a:
+            f.write(' [')
+            f.write(','.join(a))
+            f.write(']')
+
+    def node_attributes(self,k,type):
+        a = []
+        a.append('label="%s"' % self.label(k))
+        if self.colored:
+            a.append('fillcolor="%s"' % self.color(k,type))
+        else:
+            a.append('fillcolor=white')
+        if self.toocommon(k,type):
+            a.append('peripheries=2')
+        return a
+                
+    def edge_attributes(self,k,v):
+        a = []
+        weight = self.weight(k,v)
+        if weight!=1:
+            a.append('weight=%d' % weight)
+        length = self.alien(k,v)
+        if length:
+            a.append('minlen=%d' % length)
+        return a
+            
+    def get_data(self):
+        t = eval(sys.stdin.read())
+        return t['depgraph'],t['types']
+    
+    def get_output_file(self):
+        return sys.stdout
+
+    def use(self,s,type):
+        # Return true if this module is interesting and should be drawn. Return false
+        # if it should be completely omitted. This is a default policy - please override.
+        if s=='__main__':
+            return 0
+        #if s in ('os','sys','time','__future__','types','re','string'):
+        if s in ('sys'):
+            # nearly all modules use all of these... more or less. They add nothing to
+            # our diagram.
+            return 0
+        if s.startswith('encodings.'):
+            return 0
+        if self.toocommon(s,type):
+            # A module where we dont want to draw references _to_. Dot doesnt handle these
+            # well, so it is probably best to not draw them at all.
+            return 0
+        return 1
+
+    def toocommon(self,s,type):
+        # Return true if references to this module are uninteresting. Such references
+        # do not get drawn. This is a default policy - please override.
+        #
+        if s=='__main__':
+            # references *to* __main__ are never interesting. omitting them means
+            # that main floats to the top of the page
+            return 1
+        #if type==imp.PKG_DIRECTORY:
+        #    # dont draw references to packages.
+        #    return 1
+        return 0
+        
+    def weight(self,a,b):
+        # Return the weight of the dependency from a to b. Higher weights
+        # usually have shorter straighter edges. Return 1 if it has normal weight.
+        # A value of 4 is usually good for ensuring that a related pair of modules 
+        # are drawn next to each other. This is a default policy - please override.
+        #
+        if b.split('.')[-1].startswith('_'):
+            # A module that starts with an underscore. You need a special reason to
+            # import these (for example random imports _random), so draw them close
+            # together
+            return 4
+        return 1
+    
+    def alien(self,a,b):
+        # Return non-zero if references to this module are strange, and should be drawn
+        # extra-long. the value defines the length, in rank. This is also good for putting some
+        # vertical space between seperate subsystems. This is a default policy - please override.
+        #
+        return 0
+
+    def label(self,s):
+        # Convert a module name to a formatted node label. This is a default policy - please override.
+        #
+        return '\\.\\n'.join(s.split('.'))
+
+    def color(self,s,type):
+        # Return the node color for this module name. This is a default policy - please override.
+        #
+        # Calculate a color systematically based on the hash of the module name. Modules in the
+        # same package have the same color. Unpackaged modules are grey
+        t = self.normalise_module_name_for_hash_coloring(s,type)
+        return self.color_from_name(t)
+        
+    def normalise_module_name_for_hash_coloring(self,s,type):
+        if type==imp.PKG_DIRECTORY:
+            return s
+        else:
+            i = s.rfind('.')
+            if i<0:
+                return ''
+            else:
+                return s[:i]
+        
+    def color_from_name(self,name):
+        n = md5.md5(name).digest()
+        hf = float(ord(n[0])+ord(n[1])*0xff)/0xffff
+        sf = float(ord(n[2]))/0xff
+        vf = float(ord(n[3]))/0xff
+        r,g,b = colorsys.hsv_to_rgb(hf, 0.3+0.6*sf, 0.8+0.2*vf)
+        return '#%02x%02x%02x' % (r*256,g*256,b*256)
+
+
+def main():
+    pydepgraphdot().main(sys.argv[1:])
+
+if __name__=='__main__':
+    main()
+
+
+
--- python3.3-3.3.0.orig/debian/libPVER-dbg.symbols.in
+++ python3.3-3.3.0/debian/libPVER-dbg.symbols.in
@@ -0,0 +1,38 @@
+libpython@VER@dm.so.1.0 libpython@VER@-dbg #MINVER#
+#include "libpython.symbols"
+ _PyDict_Dummy@Base @SVER@
+ _PyMem_DebugFree@Base @SVER@
+ _PyMem_DebugMalloc@Base @SVER@
+ _PyMem_DebugRealloc@Base @SVER@
+ _PyObject_DebugCheckAddress@Base @SVER@
+ _PyObject_DebugCheckAddressApi@Base @SVER@
+ _PyObject_DebugDumpAddress@Base @SVER@
+ _PyObject_DebugFree@Base @SVER@
+ _PyObject_DebugFreeApi@Base @SVER@
+ _PyObject_DebugMalloc@Base @SVER@
+ _PyObject_DebugMallocApi@Base @SVER@
+ _PyObject_DebugMallocStats@Base @SVER@
+ _PyObject_DebugRealloc@Base @SVER@
+ _PyObject_DebugReallocApi@Base @SVER@
+ _PySet_Dummy@Base @SVER@
+ _PyUnicode_CheckConsistency@Base @SVER@
+ _PyUnicode_Dump@Base @SVER@
+ _PyUnicode_compact_data@Base @SVER@
+ _PyUnicode_data@Base @SVER@
+ _PyUnicode_utf8@Base @SVER@
+ _Py_AddToAllObjects@Base @SVER@
+ _Py_Dealloc@Base @SVER@
+ _Py_ForgetReference@Base @SVER@
+ _Py_GetObjects@Base @SVER@
+ _Py_GetRefTotal@Base @SVER@
+ _Py_HashSecret_Initialized@Base @SVER@
+ _Py_NegativeRefcount@Base @SVER@
+ _Py_NewReference@Base @SVER@
+ _Py_PrintReferenceAddresses@Base @SVER@
+ _Py_PrintReferences@Base @SVER@
+ _Py_RefTotal@Base @SVER@
+ _Py_dumptree@Base @SVER@
+ _Py_printtree@Base @SVER@
+ _Py_showtree@Base @SVER@
+ _Py_tok_dump@Base @SVER@
+ PyModule_Create2TraceRefs@Base @SVER@
--- python3.3-3.3.0.orig/debian/pylogo.xpm
+++ python3.3-3.3.0/debian/pylogo.xpm
@@ -0,0 +1,351 @@
+/* XPM */
+static char * pylogo_xpm[] = {
+"32 32 316 2",
+"  	c None",
+". 	c #8DB0CE",
+"+ 	c #6396BF",
+"@ 	c #4985B7",
+"# 	c #4181B5",
+"$ 	c #417EB2",
+"% 	c #417EB1",
+"& 	c #4D83B0",
+"* 	c #6290B6",
+"= 	c #94B2CA",
+"- 	c #70A1C8",
+"; 	c #3D83BC",
+"> 	c #3881BD",
+", 	c #387DB6",
+"' 	c #387CB5",
+") 	c #387BB3",
+"! 	c #3779B0",
+"~ 	c #3778AE",
+"{ 	c #3776AB",
+"] 	c #3776AA",
+"^ 	c #3775A9",
+"/ 	c #4A7FAC",
+"( 	c #709FC5",
+"_ 	c #3A83BE",
+": 	c #5795C7",
+"< 	c #94B9DB",
+"[ 	c #73A4CE",
+"} 	c #3D80B7",
+"| 	c #387CB4",
+"1 	c #377AB2",
+"2 	c #377AB0",
+"3 	c #3777AC",
+"4 	c #3774A7",
+"5 	c #3773A5",
+"6 	c #3C73A5",
+"7 	c #4586BB",
+"8 	c #4489C1",
+"9 	c #A7C7E1",
+"0 	c #F7F9FD",
+"a 	c #E1E9F1",
+"b 	c #4C89BC",
+"c 	c #3779AF",
+"d 	c #3778AD",
+"e 	c #3873A5",
+"f 	c #4B7CA4",
+"g 	c #3982BE",
+"h 	c #4389C1",
+"i 	c #A6C6E1",
+"j 	c #F6F9FC",
+"k 	c #D6E4F0",
+"l 	c #4A88BB",
+"m 	c #3773A6",
+"n 	c #366F9F",
+"o 	c #366E9D",
+"p 	c #376E9C",
+"q 	c #4A8BC0",
+"r 	c #79A7CD",
+"s 	c #548EBD",
+"t 	c #387AB0",
+"u 	c #3773A4",
+"v 	c #366D9C",
+"w 	c #387FBA",
+"x 	c #387DB7",
+"y 	c #387BB4",
+"z 	c #3775A8",
+"A 	c #366FA0",
+"B 	c #4981AF",
+"C 	c #427BAA",
+"D 	c #3772A4",
+"E 	c #376B97",
+"F 	c #77A3C8",
+"G 	c #4586BC",
+"H 	c #3882BE",
+"I 	c #3B76A7",
+"J 	c #3B76A6",
+"K 	c #366E9E",
+"L 	c #376B98",
+"M 	c #376B96",
+"N 	c #5681A3",
+"O 	c #F5EEB8",
+"P 	c #FFED60",
+"Q 	c #FFE85B",
+"R 	c #FFE659",
+"S 	c #FDE55F",
+"T 	c #5592C4",
+"U 	c #3A83BF",
+"V 	c #3882BD",
+"W 	c #387FB9",
+"X 	c #3779AE",
+"Y 	c #366F9E",
+"Z 	c #366C98",
+"` 	c #376A94",
+" .	c #5D85A7",
+"..	c #F5EDB7",
+"+.	c #FFEA5D",
+"@.	c #FFE75A",
+"#.	c #FFE354",
+"$.	c #FDDD56",
+"%.	c #669DC8",
+"&.	c #3885C3",
+"*.	c #3884C2",
+"=.	c #387EB8",
+"-.	c #387CB6",
+";.	c #377AB1",
+">.	c #3772A3",
+",.	c #366D9B",
+"'.	c #F5EBB5",
+").	c #FFE557",
+"!.	c #FFE455",
+"~.	c #FFDF50",
+"{.	c #FFDB4C",
+"].	c #FAD862",
+"^.	c #8EB4D2",
+"/.	c #3C86C1",
+"(.	c #3883C0",
+"_.	c #3882BF",
+":.	c #3881BC",
+"<.	c #3880BB",
+"[.	c #3775AA",
+"}.	c #F5EAB3",
+"|.	c #FFE051",
+"1.	c #FFDE4F",
+"2.	c #FFDA4A",
+"3.	c #FED446",
+"4.	c #F5DF9D",
+"5.	c #77A5CA",
+"6.	c #3885C2",
+"7.	c #387BB2",
+"8.	c #6B8EA8",
+"9.	c #F8E7A1",
+"0.	c #FFE153",
+"a.	c #FFDD4E",
+"b.	c #FFDB4B",
+"c.	c #FFD746",
+"d.	c #FFD645",
+"e.	c #FFD342",
+"f.	c #F6DB8D",
+"g.	c #508DBE",
+"h.	c #3771A3",
+"i.	c #376A95",
+"j.	c #3D6F97",
+"k.	c #C3CBC2",
+"l.	c #FBD964",
+"m.	c #FFDC4D",
+"n.	c #FFD544",
+"o.	c #FFD040",
+"p.	c #F9CF58",
+"q.	c #3F83BB",
+"r.	c #376B95",
+"s.	c #3A6C95",
+"t.	c #4E7BA0",
+"u.	c #91AABC",
+"v.	c #F6E4A3",
+"w.	c #FFDA4B",
+"x.	c #FFD646",
+"y.	c #FFD443",
+"z.	c #FFD241",
+"A.	c #FFCE3D",
+"B.	c #FFCC3B",
+"C.	c #FCC83E",
+"D.	c #3880BC",
+"E.	c #3C79AC",
+"F.	c #5F8DB4",
+"G.	c #7AA0C0",
+"H.	c #82A6C3",
+"I.	c #82A3BF",
+"J.	c #82A2BE",
+"K.	c #82A1BB",
+"L.	c #82A1B9",
+"M.	c #8BA4B5",
+"N.	c #C1C5AE",
+"O.	c #F2E19F",
+"P.	c #FDD74C",
+"Q.	c #FFD94A",
+"R.	c #FFD343",
+"S.	c #FFCE3E",
+"T.	c #FFCB39",
+"U.	c #FFC937",
+"V.	c #FEC636",
+"W.	c #3D79AB",
+"X.	c #9DB6C6",
+"Y.	c #D0CFA2",
+"Z.	c #EFE598",
+"`.	c #F8EE9B",
+" +	c #F8EB97",
+".+	c #F8E996",
+"++	c #F8E894",
+"@+	c #FAE489",
+"#+	c #FCDB64",
+"$+	c #FFDA4D",
+"%+	c #FFCF3E",
+"&+	c #FFCB3A",
+"*+	c #FFC734",
+"=+	c #FFC532",
+"-+	c #3F82B7",
+";+	c #387EB9",
+">+	c #9EB9D0",
+",+	c #F2E287",
+"'+	c #FDEB69",
+")+	c #FEEC60",
+"!+	c #FFEB5E",
+"~+	c #FFE254",
+"{+	c #FFE152",
+"]+	c #FFD747",
+"^+	c #FFC633",
+"/+	c #FCC235",
+"(+	c #578FBE",
+"_+	c #6996BC",
+":+	c #DED9A8",
+"<+	c #FEEC62",
+"[+	c #FFE658",
+"}+	c #FFDF51",
+"|+	c #FFDE50",
+"1+	c #FFD03F",
+"2+	c #FFCD3C",
+"3+	c #FFC431",
+"4+	c #FFBF2C",
+"5+	c #FAC244",
+"6+	c #85AACA",
+"7+	c #A1BBD2",
+"8+	c #F7E47C",
+"9+	c #FFE456",
+"0+	c #FFC735",
+"a+	c #FFBC29",
+"b+	c #F7D280",
+"c+	c #9DBAD2",
+"d+	c #3B7CB2",
+"e+	c #ABC2D6",
+"f+	c #FDEB7B",
+"g+	c #FFC12E",
+"h+	c #FDBD30",
+"i+	c #F4DEA8",
+"j+	c #5F91BA",
+"k+	c #ABC1D4",
+"l+	c #FDEE7E",
+"m+	c #FFE253",
+"n+	c #FFCC3C",
+"o+	c #FFBA27",
+"p+	c #FAC75B",
+"q+	c #4A82B0",
+"r+	c #3877AB",
+"s+	c #3774A6",
+"t+	c #AAC0D4",
+"u+	c #FDEE7D",
+"v+	c #FFEC5F",
+"w+	c #FFE255",
+"x+	c #FFD848",
+"y+	c #FFD444",
+"z+	c #FFCF3F",
+"A+	c #FFBC2A",
+"B+	c #FFBB28",
+"C+	c #FDBA32",
+"D+	c #447AA8",
+"E+	c #4379A7",
+"F+	c #FFE95C",
+"G+	c #FFE558",
+"H+	c #FFE355",
+"I+	c #FED84B",
+"J+	c #FCD149",
+"K+	c #FBCE47",
+"L+	c #FBCD46",
+"M+	c #FBC840",
+"N+	c #FBC63E",
+"O+	c #FBC037",
+"P+	c #FAC448",
+"Q+	c #FDD44C",
+"R+	c #FCD14E",
+"S+	c #FFC836",
+"T+	c #FFC22F",
+"U+	c #FFC02D",
+"V+	c #FFE052",
+"W+	c #FFC636",
+"X+	c #FFCF5C",
+"Y+	c #FFD573",
+"Z+	c #FFC33E",
+"`+	c #FEBD2D",
+" @	c #FFDB4D",
+".@	c #FFD949",
+"+@	c #FFD545",
+"@@	c #FFD140",
+"#@	c #FFCB48",
+"$@	c #FFF7E4",
+"%@	c #FFFCF6",
+"&@	c #FFE09D",
+"*@	c #FFBA2E",
+"=@	c #FDBE2F",
+"-@	c #FFD748",
+";@	c #FFCA38",
+">@	c #FFC844",
+",@	c #FFF2D7",
+"'@	c #FFF9EC",
+")@	c #FFDB94",
+"!@	c #FFB92D",
+"~@	c #FAC54D",
+"{@	c #FDD54E",
+"]@	c #FFBD2D",
+"^@	c #FFC858",
+"/@	c #FFD174",
+"(@	c #FFBF3E",
+"_@	c #FCBD3C",
+":@	c #FAD66A",
+"<@	c #FECD3F",
+"[@	c #FFC330",
+"}@	c #FFBD2A",
+"|@	c #FFB724",
+"1@	c #FFB521",
+"2@	c #FFB526",
+"3@	c #FBC457",
+"4@	c #F7E09E",
+"5@	c #F8D781",
+"6@	c #FAC349",
+"7@	c #FCC134",
+"8@	c #FEBE2C",
+"9@	c #FBBE3F",
+"0@	c #F7CF79",
+"a@	c #F5D795",
+"                      . + @ # $ % % & * =                       ",
+"                  - ; > > , ' ) ! ~ { ] ^ /                     ",
+"                ( _ : < [ } | 1 2 ~ 3 4 5 5 6                   ",
+"                7 8 9 0 a b 2 c d 3 { 5 5 5 e f                 ",
+"                g h i j k l c ~ { { m 5 5 n o p                 ",
+"                > > q r s t c c d 4 5 u n v v v                 ",
+"                w x ' y 2 c d d z 5 u A v v v v                 ",
+"                              B C 5 D v v v v E                 ",
+"      F G H H H x ' ) c c c d I J 5 K v v L M N O P Q R S       ",
+"    T U H V V W ' ) c c X ~ 5 5 5 Y v v Z ` `  ...+.@.#.#.$.    ",
+"  %.&.*.> w W =.-.;.c 3 { ^ 5 5 >.o v ,.E ` `  .'.).!.#.~.{.].  ",
+"^./.(._.:.<., ' ) ;.X d [.5 5 >.K v ,.E ` ` `  .}.#.|.1.{.2.3.4.",
+"5.6.(.H H x ' 7.c c 3 3 4 5 D K v v ,.` ` ` ` 8.9.0.a.b.c.d.e.f.",
+"g._.> <.w ' ' | 2 3 { z 5 5 h.v v v i.` ` ` j.k.l.m.{.d.n.e.o.p.",
+"q.> > :.-.' 1 c c c ] 5 5 >.v v ,.r.` ` s.t.u.v.{.w.x.y.z.A.B.C.",
+"D.D.w -.' 1 c c c E.F.G.H.I.J.J.K.L.L.L.M.N.O.P.Q.c.R.S.B.T.U.V.",
+"D.D.=.' ' 1 c c W.X.Y.Z.`.`.`.`.`. +.+++@+#+$+Q.d.R.%+B.&+*+=+=+",
+"-+;+-.' ;.2 c c >+,+'+)+P P P !+Q R ~+{+1.{.]+d.y.%+B.&+^+=+=+/+",
+"(+' ' ;.c X X _+:+<+P P P P !+R [+~+}+|+{.]+n.R.1+2+&+^+=+3+4+5+",
+"6+' ) ! ~ { { 7+8+P P P P !+R 9+#.{+{.w.]+y.z.S.&+0+=+=+3+4+a+b+",
+"c+d+7.! d 3 z e+f+P P P !+R 9+#.{+m.{.]+y.1+B.&+0+=+=+g+4+a+h+i+",
+"  j+c d 3 { 4 k+l+P P !+@.9+m+1.m.{.]+y.1+n+B.*+=+=+g+a+a+o+p+  ",
+"    q+r+{ s+m t+u+v+@.R w+{+}+{.x+d.y+z+n+B.0+=+=+g+A+a+B+C+    ",
+"      * D+E+E+  +.F+G+H+}+}+{.I+J+K+L+M+M+M+M+N+O+O+O+O+P+      ",
+"                ).).#.{+a.{.x+Q+R+                              ",
+"                #.m+1.a.{.x+y.o.2+B.S+=+=+T+U+O+                ",
+"                0.V+{.{.x+n.o.2+B.B.W+X+Y+Z+a+`+                ",
+"                 @{..@+@n.@@B.B.S+^+#@$@%@&@*@=@                ",
+"                ].-@x.y.o.%+;@S+=+=+>@,@'@)@!@~@                ",
+"                  {@z.z+2+U.=+=+=+T+]@^@/@(@_@                  ",
+"                    :@<@U.=+=+[@4+}@|@1@2@3@                    ",
+"                      4@5@6@7@8@a+a+9@0@a@                      "};
--- python3.3-3.3.0.orig/debian/_sysconfigdata.py
+++ python3.3-3.3.0/debian/_sysconfigdata.py
@@ -0,0 +1,6 @@
+import sys
+
+if hasattr(sys, 'gettotalrefcount'):
+    from _sysconfigdata_dm import *
+else:
+    from _sysconfigdata_m import *
--- python3.3-3.3.0.orig/debian/libPVER.symbols.in
+++ python3.3-3.3.0/debian/libPVER.symbols.in
@@ -0,0 +1,5 @@
+libpython@VER@m.so.1.0 libpython@VER@ #MINVER#
+#include "libpython.symbols"
+ PyModule_Create2@Base @SVER@
+
+ (optional)__gnu_lto_v1@Base @SVER@
--- python3.3-3.3.0.orig/debian/PVER-dev.postinst.in
+++ python3.3-3.3.0/debian/PVER-dev.postinst.in
@@ -0,0 +1,24 @@
+#! /bin/sh -e
+
+if [ "$1" = configure ]; then
+  if [ -d /usr/include/@PVER@ ] && [ ! -h /usr/include/@PVER@ ]; then
+    if rmdir /usr/include/@PVER@ 2> /dev/null; then
+      ln -sf @PVER@mu /usr/include/@PVER@
+    else
+      echo >&2 "WARNING: non-empty directory on upgrade: /usr/include/@PVER@"
+      ls -l /usr/include/@PVER@
+    fi
+  fi
+  if [ -d /usr/lib/@PVER@/config ] && [ ! -h /usr/lib/@PVER@/config ]; then
+    if rmdir /usr/lib/@PVER@/config 2> /dev/null; then
+      ln -sf config-@VER@mu /usr/lib/@PVER@/config
+    else
+      echo >&2 "WARNING: non-empty directory on upgrade: /usr/lib/@PVER@/config"
+      ls -l /usr/lib/@PVER@/config
+    fi
+  fi
+fi
+
+#DEBHELPER#
+
+exit 0
--- python3.3-3.3.0.orig/debian/idle-PVER.prerm.in
+++ python3.3-3.3.0/debian/idle-PVER.prerm.in
@@ -0,0 +1,31 @@
+#! /bin/sh -e
+
+remove_bytecode()
+{
+    pkg=$1
+    max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}')
+    dpkg -L $pkg \
+	| awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \
+	| xargs --max-chars=$max echo \
+	| while read files; do rm -f $files; done
+    find /usr/lib/@PVER@ -name dist-packages -prune -o -name __pycache__ -empty -print \
+	| xargs -r rm -rf
+}
+
+case "$1" in
+    remove|upgrade)
+	remove_bytecode idle-@PVER@
+        ;;
+    deconfigure)
+        ;;
+    failed-upgrade)
+        ;;
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- python3.3-3.3.0.orig/debian/PVER-dbg.postinst.in
+++ python3.3-3.3.0/debian/PVER-dbg.postinst.in
@@ -0,0 +1,24 @@
+#! /bin/sh -e
+
+if [ "$1" = configure ]; then
+  if [ -d /usr/include/@PVER@_d ] && [ ! -h /usr/include/@PVER@_d ]; then
+    if rmdir /usr/include/@PVER@_d 2> /dev/null; then
+      ln -sf @PVER@dmu /usr/include/@PVER@_d
+    else
+      echo >&2 "WARNING: non-empty directory on upgrade: /usr/include/@PVER@_d"
+      ls -l /usr/include/@PVER@_d
+    fi
+  fi
+  if [ -d /usr/lib/@PVER@/config_d ] && [ ! -h /usr/lib/@PVER@/config_d ]; then
+    if rmdir /usr/lib/@PVER@/config_d 2> /dev/null; then
+      ln -sf config-dmu /usr/lib/@PVER@/config_d
+    else
+      echo >&2 "WARNING: non-empty directory on upgrade: /usr/lib/@PVER@/config_d"
+      ls -l /usr/lib/@PVER@/config_d
+    fi
+  fi
+fi
+
+#DEBHELPER#
+
+exit 0
--- python3.3-3.3.0.orig/debian/changelog.shared
+++ python3.3-3.3.0/debian/changelog.shared
@@ -0,0 +1,3 @@
+  * Link the interpreter against the shared runtime library. With
+    gcc-4.1 the difference in the pystones benchmark dropped from about
+    12% to about 5%.
--- python3.3-3.3.0.orig/debian/PVER-dbg.prerm.in
+++ python3.3-3.3.0/debian/PVER-dbg.prerm.in
@@ -0,0 +1,35 @@
+#! /bin/sh
+
+set -e
+
+remove_bytecode()
+{
+    pkg=$1
+    max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}')
+    dpkg -L $pkg \
+	| awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \
+	| xargs --max-chars=$max echo \
+	| while read files; do rm -f $files; done
+    if [ -d /usr/bin/__pycache__ ]; then
+	rmdir --ignore-fail-on-non-empty /usr/bin/__pycache__
+    fi
+}
+
+case "$1" in
+    remove)
+	remove_bytecode @PVER@-dbg
+        ;;
+    upgrade)
+	remove_bytecode @PVER@-dbg
+        ;;
+    deconfigure)
+        ;;
+    failed-upgrade)
+        ;;
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
--- python3.3-3.3.0.orig/debian/FAQ.html
+++ python3.3-3.3.0/debian/FAQ.html
@@ -0,0 +1,8997 @@
+<HTML>
+<HEAD>
+<TITLE>The Whole Python FAQ</TITLE>
+</HEAD>
+
+<BODY BACKGROUND="http://www.python.org/pics/RedShort.gif"
+      BGCOLOR="#FFFFFF"
+      TEXT="#000000"
+      LINK="#AA0000"
+      VLINK="#906A6A">
+<H1>The Whole Python FAQ</H1>
+Last changed on Wed Feb 12 21:31:08 2003 CET
+
+<P>(Entries marked with ** were changed within the last 24 hours;
+entries marked with * were changed within the last 7 days.)
+<P>
+
+<P>
+<HR>
+<H2>1. General information and availability</H2>
+<UL>
+<LI><A HREF="#1.1">1.1. What is Python?</A>
+<LI><A HREF="#1.2">1.2. Why is it called Python?</A>
+<LI><A HREF="#1.3">1.3. How do I obtain a copy of the Python source?</A>
+<LI><A HREF="#1.4">1.4. How do I get documentation on Python?</A>
+<LI><A HREF="#1.5">1.5. Are there other ftp sites that mirror the Python distribution?</A>
+<LI><A HREF="#1.6">1.6. Is there a newsgroup or mailing list devoted to Python?</A>
+<LI><A HREF="#1.7">1.7. Is there a WWW page devoted to Python?</A>
+<LI><A HREF="#1.8">1.8. Is the Python documentation available on the WWW?</A>
+<LI><A HREF="#1.9">1.9. Are there any books on Python?</A>
+<LI><A HREF="#1.10">1.10. Are there any published articles about Python that I can reference?</A>
+<LI><A HREF="#1.11">1.11. Are there short introductory papers or talks on Python?</A>
+<LI><A HREF="#1.12">1.12. How does the Python version numbering scheme work?</A>
+<LI><A HREF="#1.13">1.13. How do I get a beta test version of Python?</A>
+<LI><A HREF="#1.14">1.14. Are there copyright restrictions on the use of Python?</A>
+<LI><A HREF="#1.15">1.15. Why was Python created in the first place?</A>
+<LI><A HREF="#1.16">1.16. Do I have to like &quot;Monty Python's Flying Circus&quot;?</A>
+<LI><A HREF="#1.17">1.17. What is Python good for?</A>
+<LI><A HREF="#1.18">1.18. Can I use the FAQ Wizard software to maintain my own FAQ?</A>
+<LI><A HREF="#1.19">1.19. Which editor has good support for editing Python source code?</A>
+<LI><A HREF="#1.20">1.20. I've never programmed before. Is there a Python tutorial?</A>
+<LI><A HREF="#1.21">1.21. Where in the world is www.python.org located?</A>
+
+</UL>
+
+<P>
+<HR>
+<H2>2. Python in the real world</H2>
+<UL>
+<LI><A HREF="#2.1">2.1. How many people are using Python?</A>
+<LI><A HREF="#2.2">2.2. Have any significant projects been done in Python?</A>
+<LI><A HREF="#2.3">2.3. Are there any commercial projects going on using Python?</A>
+<LI><A HREF="#2.4">2.4. How stable is Python?</A>
+<LI><A HREF="#2.5">2.5. What new developments are expected for Python in the future?</A>
+<LI><A HREF="#2.6">2.6. Is it reasonable to propose incompatible changes to Python?</A>
+<LI><A HREF="#2.7">2.7. What is the future of Python?</A>
+<LI><A HREF="#2.8">2.8. What was the PSA, anyway?</A>
+<LI><A HREF="#2.9">2.9. Deleted</A>
+<LI><A HREF="#2.10">2.10. Deleted</A>
+<LI><A HREF="#2.11">2.11. Is Python Y2K (Year 2000) Compliant?</A>
+<LI><A HREF="#2.12">2.12. Is Python a good language in a class for beginning programmers?</A>
+
+</UL>
+
+<P>
+<HR>
+<H2>3. Building Python and Other Known Bugs</H2>
+<UL>
+<LI><A HREF="#3.1">3.1. Is there a test set?</A>
+<LI><A HREF="#3.2">3.2. When running the test set, I get complaints about floating point operations, but when playing with floating point operations I cannot find anything wrong with them.</A>
+<LI><A HREF="#3.3">3.3. Link errors after rerunning the configure script.</A>
+<LI><A HREF="#3.4">3.4. The python interpreter complains about options passed to a script (after the script name).</A>
+<LI><A HREF="#3.5">3.5. When building on the SGI, make tries to run python to create glmodule.c, but python hasn't been built or installed yet.</A>
+<LI><A HREF="#3.6">3.6. I use VPATH but some targets are built in the source directory.</A>
+<LI><A HREF="#3.7">3.7. Trouble building or linking with the GNU readline library.</A>
+<LI><A HREF="#3.8">3.8. Trouble with socket I/O on older Linux 1.x versions.</A>
+<LI><A HREF="#3.9">3.9. Trouble with prototypes on Ultrix.</A>
+<LI><A HREF="#3.10">3.10. Other trouble building Python on platform X.</A>
+<LI><A HREF="#3.11">3.11. How to configure dynamic loading on Linux.</A>
+<LI><A HREF="#3.12">3.12. I can't get shared modules to work on Linux 2.0 (Slackware96)?</A>
+<LI><A HREF="#3.13">3.13. Trouble when making modules shared on Linux.</A>
+<LI><A HREF="#3.14">3.14. [deleted]</A>
+<LI><A HREF="#3.15">3.15. Errors when linking with a shared library containing C++ code.</A>
+<LI><A HREF="#3.16">3.16. Deleted</A>
+<LI><A HREF="#3.17">3.17. Deleted.</A>
+<LI><A HREF="#3.18">3.18. Compilation or link errors for the _tkinter module</A>
+<LI><A HREF="#3.19">3.19. I configured and built Python for Tcl/Tk but &quot;import Tkinter&quot; fails.</A>
+<LI><A HREF="#3.20">3.20. [deleted]</A>
+<LI><A HREF="#3.21">3.21. Several common system calls are missing from the posix module.</A>
+<LI><A HREF="#3.22">3.22. ImportError: No module named string, on MS Windows.</A>
+<LI><A HREF="#3.23">3.23. Core dump on SGI when using the gl module.</A>
+<LI><A HREF="#3.24">3.24. &quot;Initializer not a constant&quot; while building DLL on MS-Windows</A>
+<LI><A HREF="#3.25">3.25. Output directed to a pipe or file disappears on Linux.</A>
+<LI><A HREF="#3.26">3.26. [deleted]</A>
+<LI><A HREF="#3.27">3.27. [deleted]</A>
+<LI><A HREF="#3.28">3.28. How can I test if Tkinter is working?</A>
+<LI><A HREF="#3.29">3.29. Is there a way to get the interactive mode of the python interpreter to perform function/variable name completion?</A>
+<LI><A HREF="#3.30">3.30. Why is the Python interpreter not built as a shared library?</A>
+<LI><A HREF="#3.31">3.31. Build with GCC on Solaris 2.6 (SunOS 5.6) fails</A>
+<LI><A HREF="#3.32">3.32. Running &quot;make clean&quot; seems to leave problematic files that cause subsequent builds to fail.</A>
+<LI><A HREF="#3.33">3.33. Submitting bug reports and patches</A>
+<LI><A HREF="#3.34">3.34. I can't load shared libraries under Python 1.5.2, Solaris 7, and gcc 2.95.2</A>
+<LI><A HREF="#3.35">3.35. In the regression test, test___all__ fails for the profile module. What's wrong?</A>
+<LI><A HREF="#3.36">3.36. relocations remain against allocatable but non-writable sections</A>
+
+</UL>
+
+<P>
+<HR>
+<H2>4. Programming in Python</H2>
+<UL>
+<LI><A HREF="#4.1">4.1. Is there a source code level debugger with breakpoints, step, etc.?</A>
+<LI><A HREF="#4.2">4.2. Can I create an object class with some methods implemented in C and others in Python (e.g. through inheritance)? (Also phrased as: Can I use a built-in type as base class?)</A>
+<LI><A HREF="#4.3">4.3. Is there a curses/termcap package for Python?</A>
+<LI><A HREF="#4.4">4.4. Is there an equivalent to C's onexit() in Python?</A>
+<LI><A HREF="#4.5">4.5. [deleted]</A>
+<LI><A HREF="#4.6">4.6. How do I iterate over a sequence in reverse order?</A>
+<LI><A HREF="#4.7">4.7. My program is too slow. How do I speed it up?</A>
+<LI><A HREF="#4.8">4.8. When I have imported a module, then edit it, and import it again (into the same Python process), the changes don't seem to take place. What is going on?</A>
+<LI><A HREF="#4.9">4.9. How do I find the current module name?</A>
+<LI><A HREF="#4.10">4.10. I have a module in which I want to execute some extra code when it is run as a script. How do I find out whether I am running as a script?</A>
+<LI><A HREF="#4.11">4.11. I try to run a program from the Demo directory but it fails with ImportError: No module named ...; what gives?</A>
+<LI><A HREF="#4.12">4.12. [deleted]</A>
+<LI><A HREF="#4.13">4.13. What GUI toolkits exist for Python?</A>
+<LI><A HREF="#4.14">4.14. Are there any interfaces to database packages in Python?</A>
+<LI><A HREF="#4.15">4.15. Is it possible to write obfuscated one-liners in Python?</A>
+<LI><A HREF="#4.16">4.16. Is there an equivalent of C's &quot;?:&quot; ternary operator?</A>
+<LI><A HREF="#4.17">4.17. My class defines __del__ but it is not called when I delete the object.</A>
+<LI><A HREF="#4.18">4.18. How do I change the shell environment for programs called using os.popen() or os.system()? Changing os.environ doesn't work.</A>
+<LI><A HREF="#4.19">4.19. What is a class?</A>
+<LI><A HREF="#4.20">4.20. What is a method?</A>
+<LI><A HREF="#4.21">4.21. What is self?</A>
+<LI><A HREF="#4.22">4.22. What is an unbound method?</A>
+<LI><A HREF="#4.23">4.23. How do I call a method defined in a base class from a derived class that overrides it?</A>
+<LI><A HREF="#4.24">4.24. How do I call a method from a base class without using the name of the base class?</A>
+<LI><A HREF="#4.25">4.25. How can I organize my code to make it easier to change the base class?</A>
+<LI><A HREF="#4.26">4.26. How can I find the methods or attributes of an object?</A>
+<LI><A HREF="#4.27">4.27. I can't seem to use os.read() on a pipe created with os.popen().</A>
+<LI><A HREF="#4.28">4.28. How can I create a stand-alone binary from a Python script?</A>
+<LI><A HREF="#4.29">4.29. What WWW tools are there for Python?</A>
+<LI><A HREF="#4.30">4.30. How do I run a subprocess with pipes connected to both input and output?</A>
+<LI><A HREF="#4.31">4.31. How do I call a function if I have the arguments in a tuple?</A>
+<LI><A HREF="#4.32">4.32. How do I enable font-lock-mode for Python in Emacs?</A>
+<LI><A HREF="#4.33">4.33. Is there a scanf() or sscanf() equivalent?</A>
+<LI><A HREF="#4.34">4.34. Can I have Tk events handled while waiting for I/O?</A>
+<LI><A HREF="#4.35">4.35. How do I write a function with output parameters (call by reference)?</A>
+<LI><A HREF="#4.36">4.36. Please explain the rules for local and global variables in Python.</A>
+<LI><A HREF="#4.37">4.37. How can I have modules that mutually import each other?</A>
+<LI><A HREF="#4.38">4.38. How do I copy an object in Python?</A>
+<LI><A HREF="#4.39">4.39. How to implement persistent objects in Python? (Persistent == automatically saved to and restored from disk.)</A>
+<LI><A HREF="#4.40">4.40. I try to use __spam and I get an error about _SomeClassName__spam.</A>
+<LI><A HREF="#4.41">4.41. How do I delete a file? And other file questions.</A>
+<LI><A HREF="#4.42">4.42. How to modify urllib or httplib to support HTTP/1.1?</A>
+<LI><A HREF="#4.43">4.43. Unexplicable syntax errors in compile() or exec.</A>
+<LI><A HREF="#4.44">4.44. How do I convert a string to a number?</A>
+<LI><A HREF="#4.45">4.45. How do I convert a number to a string?</A>
+<LI><A HREF="#4.46">4.46. How do I copy a file?</A>
+<LI><A HREF="#4.47">4.47. How do I check if an object is an instance of a given class or of a subclass of it?</A>
+<LI><A HREF="#4.48">4.48. What is delegation?</A>
+<LI><A HREF="#4.49">4.49. How do I test a Python program or component.</A>
+<LI><A HREF="#4.50">4.50. My multidimensional list (array) is broken! What gives?</A>
+<LI><A HREF="#4.51">4.51. I want to do a complicated sort: can you do a Schwartzian Transform in Python?</A>
+<LI><A HREF="#4.52">4.52. How to convert between tuples and lists?</A>
+<LI><A HREF="#4.53">4.53. Files retrieved with urllib contain leading garbage that looks like email headers.</A>
+<LI><A HREF="#4.54">4.54. How do I get a list of all instances of a given class?</A>
+<LI><A HREF="#4.55">4.55. A regular expression fails with regex.error: match failure.</A>
+<LI><A HREF="#4.56">4.56. I can't get signal handlers to work.</A>
+<LI><A HREF="#4.57">4.57. I can't use a global variable in a function? Help!</A>
+<LI><A HREF="#4.58">4.58. What's a negative index? Why doesn't list.insert() use them?</A>
+<LI><A HREF="#4.59">4.59. How can I sort one list by values from another list?</A>
+<LI><A HREF="#4.60">4.60. Why doesn't dir() work on builtin types like files and lists?</A>
+<LI><A HREF="#4.61">4.61. How can I mimic CGI form submission (METHOD=POST)?</A>
+<LI><A HREF="#4.62">4.62. If my program crashes with a bsddb (or anydbm) database open, it gets corrupted. How come?</A>
+<LI><A HREF="#4.63">4.63. How do I make a Python script executable on Unix?</A>
+<LI><A HREF="#4.64">4.64. How do you remove duplicates from a list?</A>
+<LI><A HREF="#4.65">4.65. Are there any known year 2000 problems in Python?</A>
+<LI><A HREF="#4.66">4.66. I want a version of map that applies a method to a sequence of objects! Help!</A>
+<LI><A HREF="#4.67">4.67. How do I generate random numbers in Python?</A>
+<LI><A HREF="#4.68">4.68. How do I access the serial (RS232) port?</A>
+<LI><A HREF="#4.69">4.69. Images on Tk-Buttons don't work in Py15?</A>
+<LI><A HREF="#4.70">4.70. Where is the math.py (socket.py, regex.py, etc.) source file?</A>
+<LI><A HREF="#4.71">4.71. How do I send mail from a Python script?</A>
+<LI><A HREF="#4.72">4.72. How do I avoid blocking in connect() of a socket?</A>
+<LI><A HREF="#4.73">4.73. How do I specify hexadecimal and octal integers?</A>
+<LI><A HREF="#4.74">4.74. How to get a single keypress at a time?</A>
+<LI><A HREF="#4.75">4.75. How can I overload constructors (or methods) in Python?</A>
+<LI><A HREF="#4.76">4.76. How do I pass keyword arguments from one method to another?</A>
+<LI><A HREF="#4.77">4.77. What module should I use to help with generating HTML?</A>
+<LI><A HREF="#4.78">4.78. How do I create documentation from doc strings?</A>
+<LI><A HREF="#4.79">4.79. How do I read (or write) binary data?</A>
+<LI><A HREF="#4.80">4.80. I can't get key bindings to work in Tkinter</A>
+<LI><A HREF="#4.81">4.81. &quot;import crypt&quot; fails</A>
+<LI><A HREF="#4.82">4.82. Are there coding standards or a style guide for Python programs?</A>
+<LI><A HREF="#4.83">4.83. How do I freeze Tkinter applications?</A>
+<LI><A HREF="#4.84">4.84. How do I create static class data and static class methods?</A>
+<LI><A HREF="#4.85">4.85. __import__('x.y.z') returns &lt;module 'x'&gt;; how do I get z?</A>
+<LI><A HREF="#4.86">4.86. Basic thread wisdom</A>
+<LI><A HREF="#4.87">4.87. Why doesn't closing sys.stdout (stdin, stderr) really close it?</A>
+<LI><A HREF="#4.88">4.88. What kinds of global value mutation are thread-safe?</A>
+<LI><A HREF="#4.89">4.89. How do I modify a string in place?</A>
+<LI><A HREF="#4.90">4.90. How to pass on keyword/optional parameters/arguments</A>
+<LI><A HREF="#4.91">4.91. How can I get a dictionary to display its keys in a consistent order?</A>
+<LI><A HREF="#4.92">4.92. Is there a Python tutorial?</A>
+<LI><A HREF="#4.93">4.93. Deleted</A>
+<LI><A HREF="#4.94">4.94. How do I get a single keypress without blocking?</A>
+<LI><A HREF="#4.95">4.95. Is there an equivalent to Perl chomp()? (Remove trailing newline from string)</A>
+<LI><A HREF="#4.96">4.96. Why is join() a string method when I'm really joining the elements of a (list, tuple, sequence)?</A>
+<LI><A HREF="#4.97">4.97. How can my code discover the name of an object?</A>
+<LI><A HREF="#4.98">4.98. Why are floating point calculations so inaccurate?</A>
+<LI><A HREF="#4.99">4.99. I tried to open Berkeley DB file, but bsddb produces bsddb.error: (22, 'Invalid argument'). Help! How can I restore my data?</A>
+<LI><A HREF="#4.100">4.100. What are the &quot;best practices&quot; for using import in a module?</A>
+<LI><A HREF="#4.101">4.101. Is there a tool to help find bugs or perform static analysis?</A>
+<LI><A HREF="#4.102">4.102. UnicodeError: ASCII [decoding,encoding] error: ordinal not in range(128)</A>
+<LI><A HREF="#4.103">4.103. Using strings to call functions/methods</A>
+<LI><A HREF="#4.104">4.104. How fast are exceptions?</A>
+<LI><A HREF="#4.105">4.105. Sharing global variables across modules</A>
+<LI><A HREF="#4.106">4.106. Why is cPickle so slow?</A>
+<LI><A HREF="#4.107">4.107. When importing module XXX, why do I get &quot;undefined symbol: PyUnicodeUCS2_...&quot; ?</A>
+<LI><A HREF="#4.108">4.108. How do I create a .pyc file?</A>
+
+</UL>
+
+<P>
+<HR>
+<H2>5. Extending Python</H2>
+<UL>
+<LI><A HREF="#5.1">5.1. Can I create my own functions in C?</A>
+<LI><A HREF="#5.2">5.2. Can I create my own functions in C++?</A>
+<LI><A HREF="#5.3">5.3. How can I execute arbitrary Python statements from C?</A>
+<LI><A HREF="#5.4">5.4. How can I evaluate an arbitrary Python expression from C?</A>
+<LI><A HREF="#5.5">5.5. How do I extract C values from a Python object?</A>
+<LI><A HREF="#5.6">5.6. How do I use Py_BuildValue() to create a tuple of arbitrary length?</A>
+<LI><A HREF="#5.7">5.7. How do I call an object's method from C?</A>
+<LI><A HREF="#5.8">5.8. How do I catch the output from PyErr_Print() (or anything that prints to stdout/stderr)?</A>
+<LI><A HREF="#5.9">5.9. How do I access a module written in Python from C?</A>
+<LI><A HREF="#5.10">5.10. How do I interface to C++ objects from Python?</A>
+<LI><A HREF="#5.11">5.11. mSQLmodule (or other old module) won't build with Python 1.5 (or later)</A>
+<LI><A HREF="#5.12">5.12. I added a module using the Setup file and the make fails! Huh?</A>
+<LI><A HREF="#5.13">5.13. I want to compile a Python module on my Red Hat Linux system, but some files are missing.</A>
+<LI><A HREF="#5.14">5.14. What does &quot;SystemError: _PyImport_FixupExtension: module yourmodule not loaded&quot; mean?</A>
+<LI><A HREF="#5.15">5.15. How to tell &quot;incomplete input&quot; from &quot;invalid input&quot;?</A>
+<LI><A HREF="#5.16">5.16. How do I debug an extension?</A>
+<LI><A HREF="#5.17">5.17. How do I find undefined Linux g++ symbols, __builtin_new or __pure_virtural</A>
+<LI><A HREF="#5.18">5.18. How do I define and create objects corresponding to built-in/extension types</A>
+
+</UL>
+
+<P>
+<HR>
+<H2>6. Python's design</H2>
+<UL>
+<LI><A HREF="#6.1">6.1. Why isn't there a switch or case statement in Python?</A>
+<LI><A HREF="#6.2">6.2. Why does Python use indentation for grouping of statements?</A>
+<LI><A HREF="#6.3">6.3. Why are Python strings immutable?</A>
+<LI><A HREF="#6.4">6.4. Delete</A>
+<LI><A HREF="#6.5">6.5. Why does Python use methods for some functionality (e.g. list.index()) but functions for other (e.g. len(list))?</A>
+<LI><A HREF="#6.6">6.6. Why can't I derive a class from built-in types (e.g. lists or files)?</A>
+<LI><A HREF="#6.7">6.7. Why must 'self' be declared and used explicitly in method definitions and calls?</A>
+<LI><A HREF="#6.8">6.8. Can't you emulate threads in the interpreter instead of relying on an OS-specific thread implementation?</A>
+<LI><A HREF="#6.9">6.9. Why can't lambda forms contain statements?</A>
+<LI><A HREF="#6.10">6.10. [deleted]</A>
+<LI><A HREF="#6.11">6.11. [deleted]</A>
+<LI><A HREF="#6.12">6.12. Why is there no more efficient way of iterating over a dictionary than first constructing the list of keys()?</A>
+<LI><A HREF="#6.13">6.13. Can Python be compiled to machine code, C or some other language?</A>
+<LI><A HREF="#6.14">6.14. How does Python manage memory?</A>
+<LI><A HREF="#6.15">6.15. Why are there separate tuple and list data types?</A>
+<LI><A HREF="#6.16">6.16. How are lists implemented?</A>
+<LI><A HREF="#6.17">6.17. How are dictionaries implemented?</A>
+<LI><A HREF="#6.18">6.18. Why must dictionary keys be immutable?</A>
+<LI><A HREF="#6.19">6.19. How the heck do you make an array in Python?</A>
+<LI><A HREF="#6.20">6.20. Why doesn't list.sort() return the sorted list?</A>
+<LI><A HREF="#6.21">6.21. How do you specify and enforce an interface spec in Python?</A>
+<LI><A HREF="#6.22">6.22. Why do all classes have the same type? Why do instances all have the same type?</A>
+<LI><A HREF="#6.23">6.23. Why isn't all memory freed when Python exits?</A>
+<LI><A HREF="#6.24">6.24. Why no class methods or mutable class variables?</A>
+<LI><A HREF="#6.25">6.25. Why are default values sometimes shared between objects?</A>
+<LI><A HREF="#6.26">6.26. Why no goto?</A>
+<LI><A HREF="#6.27">6.27. How do you make a higher order function in Python?</A>
+<LI><A HREF="#6.28">6.28. Why do I get a SyntaxError for a 'continue' inside a 'try'?</A>
+<LI><A HREF="#6.29">6.29. Why can't raw strings (r-strings) end with a backslash?</A>
+<LI><A HREF="#6.30">6.30. Why can't I use an assignment in an expression?</A>
+<LI><A HREF="#6.31">6.31. Why doesn't Python have a &quot;with&quot; statement like some other languages?</A>
+<LI><A HREF="#6.32">6.32. Why are colons required for if/while/def/class?</A>
+<LI><A HREF="#6.33">6.33. Can't we get rid of the Global Interpreter Lock?</A>
+
+</UL>
+
+<P>
+<HR>
+<H2>7. Using Python on non-UNIX platforms</H2>
+<UL>
+<LI><A HREF="#7.1">7.1. Is there a Mac version of Python?</A>
+<LI><A HREF="#7.2">7.2. Are there DOS and Windows versions of Python?</A>
+<LI><A HREF="#7.3">7.3. Is there an OS/2 version of Python?</A>
+<LI><A HREF="#7.4">7.4. Is there a VMS version of Python?</A>
+<LI><A HREF="#7.5">7.5. What about IBM mainframes, or other non-UNIX platforms?</A>
+<LI><A HREF="#7.6">7.6. Where are the source or Makefiles for the non-UNIX versions?</A>
+<LI><A HREF="#7.7">7.7. What is the status and support for the non-UNIX versions?</A>
+<LI><A HREF="#7.8">7.8. I have a PC version but it appears to be only a binary. Where's the library?</A>
+<LI><A HREF="#7.9">7.9. Where's the documentation for the Mac or PC version?</A>
+<LI><A HREF="#7.10">7.10. How do I create a Python program file on the Mac or PC?</A>
+<LI><A HREF="#7.11">7.11. How can I use Tkinter on Windows 95/NT?</A>
+<LI><A HREF="#7.12">7.12. cgi.py (or other CGI programming) doesn't work sometimes on NT or win95!</A>
+<LI><A HREF="#7.13">7.13. Why doesn't os.popen() work in PythonWin on NT?</A>
+<LI><A HREF="#7.14">7.14. How do I use different functionality on different platforms with the same program?</A>
+<LI><A HREF="#7.15">7.15. Is there an Amiga version of Python?</A>
+<LI><A HREF="#7.16">7.16. Why doesn't os.popen()/win32pipe.popen() work on Win9x?</A>
+
+</UL>
+
+<P>
+<HR>
+<H2>8. Python on Windows</H2>
+<UL>
+<LI><A HREF="#8.1">8.1. Using Python for CGI on Microsoft Windows</A>
+<LI><A HREF="#8.2">8.2. How to check for a keypress without blocking?</A>
+<LI><A HREF="#8.3">8.3. $PYTHONPATH</A>
+<LI><A HREF="#8.4">8.4. dedent syntax errors</A>
+<LI><A HREF="#8.5">8.5. How do I emulate os.kill() in Windows?</A>
+<LI><A HREF="#8.6">8.6. Why does os.path.isdir() fail on NT shared directories?</A>
+<LI><A HREF="#8.7">8.7. PyRun_SimpleFile() crashes on Windows but not on Unix</A>
+<LI><A HREF="#8.8">8.8. Import of _tkinter fails on Windows 95/98</A>
+<LI><A HREF="#8.9">8.9. Can't extract the downloaded documentation on Windows</A>
+<LI><A HREF="#8.10">8.10. Can't get Py_RunSimpleFile() to work.</A>
+<LI><A HREF="#8.11">8.11. Where is Freeze for Windows?</A>
+<LI><A HREF="#8.12">8.12. Is a *.pyd file the same as a DLL?</A>
+<LI><A HREF="#8.13">8.13. Missing cw3215mt.dll (or missing cw3215.dll)</A>
+<LI><A HREF="#8.14">8.14. How to make python scripts executable:</A>
+<LI><A HREF="#8.15">8.15. Warning about CTL3D32 version from installer</A>
+<LI><A HREF="#8.16">8.16. How can I embed Python into a Windows application?</A>
+<LI><A HREF="#8.17">8.17. Setting up IIS 5 to use Python for CGI</A>
+<LI><A HREF="#8.18">8.18. How do I run a Python program under Windows?</A>
+
+</UL>
+
+<HR>
+<H1>1. General information and availability</H1>
+
+<HR>
+<H2><A NAME="1.1">1.1. What is Python?</A></H2>
+Python is an interpreted, interactive, object-oriented programming
+language.  It incorporates modules, exceptions, dynamic typing, very
+high level dynamic data types, and classes.  Python combines
+remarkable power with very clear syntax.  It has interfaces to many
+system calls and libraries, as well as to various window systems, and
+is extensible in C or C++.  It is also usable as an extension language
+for applications that need a programmable interface.  Finally, Python
+is portable: it runs on many brands of UNIX, on the Mac, and on PCs
+under MS-DOS, Windows, Windows NT, and OS/2.
+<P>
+To find out more, the best thing to do is to start reading the
+tutorial from the documentation set (see a few questions further
+down).
+<P>
+See also question 1.17 (what is Python good for).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.001.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.001.htp">Log info</A>
+
+/ Last changed on Mon May 26 16:05:18 1997 by
+<A HREF="mailto:guido@cnri.reston.va.us">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="1.2">1.2. Why is it called Python?</A></H2>
+Apart from being a computer scientist, I'm also a fan of "Monty
+Python's Flying Circus" (a BBC comedy series from the seventies, in
+the -- unlikely -- case you didn't know).  It occurred to me one day
+that I needed a name that was short, unique, and slightly mysterious.
+And I happened to be reading some scripts from the series at the
+time...  So then I decided to call my language Python.
+<P>
+By now I don't care any more whether you use a Python, some other
+snake, a foot or 16-ton weight, or a wood rat as a logo for Python!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.002.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.002.htp">Log info</A>
+
+/ Last changed on Thu Aug 24 00:50:41 2000 by
+<A HREF="mailto:guido@beopen.com">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="1.3">1.3. How do I obtain a copy of the Python source?</A></H2>
+The latest Python source distribution is always available from
+python.org, at <A HREF="http://www.python.org/download">http://www.python.org/download</A>.  The latest development sources can be obtained via anonymous CVS from SourceForge, at <A HREF="http://www.sf.net/projects/python">http://www.sf.net/projects/python</A> .
+<P>
+The source distribution is a gzipped tar file containing the complete C source, LaTeX
+documentation, Python library modules, example programs, and several
+useful pieces of freely distributable software.  This will compile and
+run out of the box on most UNIX platforms.  (See section 7 for
+non-UNIX information.)
+<P>
+Older versions of Python are also available from python.org.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.003.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.003.htp">Log info</A>
+
+/ Last changed on Tue Apr  9 17:06:16 2002 by
+<A HREF="mailto:akuchlin@mems-exchange.org">A.M. Kuchling</A>
+<P>
+
+<HR>
+<H2><A NAME="1.4">1.4. How do I get documentation on Python?</A></H2>
+All documentation is available on-line, starting at <A HREF="http://www.python.org/doc">http://www.python.org/doc</A>/. 
+<P>
+The LaTeX source for the documentation is part of the source
+distribution.  If you don't have LaTeX, the latest Python
+documentation set is available, in various formats like postscript 
+and html, by anonymous ftp - visit the above URL for links to the
+current versions.
+<P>
+PostScript for a high-level description of Python is in the file nluug-paper.ps 
+(a separate file on the ftp site).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.004.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.004.htp">Log info</A>
+
+/ Last changed on Wed Jan 21 12:02:55 1998 by
+<A HREF="mailto:klm@python.org">Ken Manheimer</A>
+<P>
+
+<HR>
+<H2><A NAME="1.5">1.5. Are there other ftp sites that mirror the Python distribution?</A></H2>
+The following anonymous ftp sites keep mirrors of the Python
+distribution:
+<P>
+USA:
+<P>
+<PRE>
+        <A HREF="ftp://ftp.python.org/pub/python">ftp://ftp.python.org/pub/python</A>/
+        <A HREF="ftp://gatekeeper.dec.com/pub/plan/python">ftp://gatekeeper.dec.com/pub/plan/python</A>/
+        <A HREF="ftp://ftp.uu.net/languages/python">ftp://ftp.uu.net/languages/python</A>/
+        <A HREF="ftp://ftp.wustl.edu/graphics/graphics/sgi-stuff/python">ftp://ftp.wustl.edu/graphics/graphics/sgi-stuff/python</A>/
+        <A HREF="ftp://ftp.sterling.com/programming/languages/python">ftp://ftp.sterling.com/programming/languages/python</A>/
+        <A HREF="ftp://uiarchive.cso.uiuc.edu/pub/lang/python">ftp://uiarchive.cso.uiuc.edu/pub/lang/python</A>/
+        <A HREF="ftp://ftp.pht.com/mirrors/python/python">ftp://ftp.pht.com/mirrors/python/python</A>/
+	<A HREF="ftp://ftp.cdrom.com/pub/python">ftp://ftp.cdrom.com/pub/python</A>/
+</PRE>
+Europe:
+<P>
+<PRE>
+        <A HREF="ftp://ftp.cwi.nl/pub/python">ftp://ftp.cwi.nl/pub/python</A>/
+        <A HREF="ftp://ftp.funet.fi/pub/languages/python">ftp://ftp.funet.fi/pub/languages/python</A>/
+        <A HREF="ftp://ftp.sunet.se/pub/lang/python">ftp://ftp.sunet.se/pub/lang/python</A>/
+        <A HREF="ftp://unix.hensa.ac.uk/mirrors/uunet/languages/python">ftp://unix.hensa.ac.uk/mirrors/uunet/languages/python</A>/
+        <A HREF="ftp://ftp.lip6.fr/pub/python">ftp://ftp.lip6.fr/pub/python</A>/
+        <A HREF="ftp://sunsite.cnlab-switch.ch/mirror/python">ftp://sunsite.cnlab-switch.ch/mirror/python</A>/
+        <A HREF="ftp://ftp.informatik.tu-muenchen.de/pub/comp/programming/languages/python">ftp://ftp.informatik.tu-muenchen.de/pub/comp/programming/languages/python</A>/
+</PRE>
+Australia:
+<P>
+<PRE>
+        <A HREF="ftp://ftp.dstc.edu.au/pub/python">ftp://ftp.dstc.edu.au/pub/python</A>/
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.005.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.005.htp">Log info</A>
+
+/ Last changed on Wed Mar 24 09:20:49 1999 by
+<A HREF="mailto:akuchlin@cnri.reston.va.us">A.M. Kuchling</A>
+<P>
+
+<HR>
+<H2><A NAME="1.6">1.6. Is there a newsgroup or mailing list devoted to Python?</A></H2>
+There is a newsgroup, comp.lang.python,
+and a mailing list.  The newsgroup and mailing list are gatewayed into
+each other -- if you can read news it's unnecessary to subscribe to
+the mailing list.  To subscribe to the mailing list
+(<A HREF="mailto:python-list@python.org">python-list@python.org</A>) visit its Mailman webpage at
+<A HREF="http://www.python.org/mailman/listinfo/python-list">http://www.python.org/mailman/listinfo/python-list</A>
+<P>
+More info about the newsgroup and mailing list, and about other lists,
+can be found at
+<A HREF="http://www.python.org/psa/MailingLists.html">http://www.python.org/psa/MailingLists.html</A>.
+<P>
+Archives of the newsgroup are kept by Deja News and accessible
+through the "Python newsgroup search" web page,
+<A HREF="http://www.python.org/search/search_news.html">http://www.python.org/search/search_news.html</A>.
+This page also contains pointer to other archival collections.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.006.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.006.htp">Log info</A>
+
+/ Last changed on Wed Jun 23 09:29:36 1999 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="1.7">1.7. Is there a WWW page devoted to Python?</A></H2>
+Yes, <A HREF="http://www.python.org">http://www.python.org</A>/ is the official Python home page.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.007.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.007.htp">Log info</A>
+
+/ Last changed on Fri May 23 14:42:59 1997 by
+<A HREF="mailto:klm@python.org">Ken Manheimer</A>
+<P>
+
+<HR>
+<H2><A NAME="1.8">1.8. Is the Python documentation available on the WWW?</A></H2>
+Yes. Python 2.0 documentation is available from
+<A HREF="http://www.pythonlabs.com/tech/python2.0/doc">http://www.pythonlabs.com/tech/python2.0/doc</A>/ and from
+<A HREF="http://www.python.org/doc">http://www.python.org/doc</A>/.  Note that most documentation
+is available for on-line browsing as well as for downloading.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.008.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.008.htp">Log info</A>
+
+/ Last changed on Tue Jan  2 03:14:08 2001 by
+<A HREF="mailto:moshez@zadka.site.co.il">Moshe Zadka</A>
+<P>
+
+<HR>
+<H2><A NAME="1.9">1.9. Are there any books on Python?</A></H2>
+Yes, many, and more are being published.  See
+the python.org Wiki at <A HREF="http://www.python.org/cgi-bin/moinmoin/PythonBooks">http://www.python.org/cgi-bin/moinmoin/PythonBooks</A> for a list.
+<P>
+You can also search online bookstores for "Python"
+(and filter out the Monty Python references; or
+perhaps search for "Python" and "language").
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.009.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.009.htp">Log info</A>
+
+/ Last changed on Mon Aug  5 19:08:49 2002 by
+<A HREF="mailto:akuchlin@mems-exchange.org">amk</A>
+<P>
+
+<HR>
+<H2><A NAME="1.10">1.10. Are there any published articles about Python that I can reference?</A></H2>
+If you can't reference the web site, and you don't want to reference the books
+(see previous question), there are several articles on Python that you could
+reference.
+<P>
+Most publications about Python are collected on the Python web site:
+<P>
+<PRE>
+    <A HREF="http://www.python.org/doc/Publications.html">http://www.python.org/doc/Publications.html</A>
+</PRE>
+It is no longer recommended to reference this
+very old article by Python's author:
+<P>
+<PRE>
+    Guido van Rossum and Jelke de Boer, "Interactively Testing Remote
+    Servers Using the Python Programming Language", CWI Quarterly, Volume
+    4, Issue 4 (December 1991), Amsterdam, pp 283-303.
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.010.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.010.htp">Log info</A>
+
+/ Last changed on Sat Jul  4 20:52:31 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="1.11">1.11. Are there short introductory papers or talks on Python?</A></H2>
+There are several - you can find links to some of them collected at
+<A HREF="http://www.python.org/doc/Hints.html#intros">http://www.python.org/doc/Hints.html#intros</A>.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.011.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.011.htp">Log info</A>
+
+/ Last changed on Fri May 23 15:04:05 1997 by
+<A HREF="mailto:klm@python.org">Ken Manheimer</A>
+<P>
+
+<HR>
+<H2><A NAME="1.12">1.12. How does the Python version numbering scheme work?</A></H2>
+Python versions are numbered A.B.C or A.B.  A is the major version
+number -- it is only incremented for really major changes in the
+language.  B is the minor version number, incremented for less
+earth-shattering changes.  C is the micro-level -- it is
+incremented for each bugfix release.  See PEP 6 for more information
+about bugfix releases.
+<P>
+Not all releases have bugfix releases.
+Note that in the past (ending with 1.5.2),
+micro releases have added significant changes;
+in fact the changeover from 0.9.9 to 1.0.0 was the first time
+that either A or B changed!
+<P>
+Alpha, beta and release candidate versions have an additional suffixes.
+The suffix for an alpha version is "aN" for some small number N, the
+suffix for a beta version is "bN" for some small number N, and the
+suffix for a release candidate version is "cN" for some small number N.
+<P>
+Note that (for instance) all versions labeled 2.0aN precede the
+versions labeled 2.0bN, which precede versions labeled 2.0cN, and
+<I>those</I> precede 2.0.
+<P>
+As a rule, no changes are made between release candidates and the final
+release unless there are show-stopper bugs.
+<P>
+You may also find version numbers with a "+" suffix, e.g. "2.2+".
+These are unreleased versions, built directly from the CVS trunk.
+<P>
+See also the documentation for sys.version, sys.hexversion, and
+sys.version_info.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.012.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.012.htp">Log info</A>
+
+/ Last changed on Mon Jan 14 06:34:17 2002 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="1.13">1.13. How do I get a beta test version of Python?</A></H2>
+All releases, including alphas, betas and release candidates, are announced on
+comp.lang.python and comp.lang.python.announce newsgroups,
+which are gatewayed into the <A HREF="mailto:python-list@python.org">python-list@python.org</A> and
+<A HREF="mailto:python-announce@python.org">python-announce@python.org</A>. In addition, all these announcements appear on
+the Python home page, at <A HREF="http://www.python.org">http://www.python.org</A>.
+<P>
+You can also access the development version of Python through CVS.  See <A HREF="http://sourceforge.net/cvs/?group_id=5470">http://sourceforge.net/cvs/?group_id=5470</A> for details.  If you're not familiar with CVS, documents like <A HREF="http://linux.oreillynet.com/pub/a/linux/2002/01/03/cvs_intro.html">http://linux.oreillynet.com/pub/a/linux/2002/01/03/cvs_intro.html</A>
+provide an introduction.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.013.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.013.htp">Log info</A>
+
+/ Last changed on Mon Jun  3 00:57:08 2002 by
+<A HREF="mailto:neal@metaslash.com">Neal Norwitz</A>
+<P>
+
+<HR>
+<H2><A NAME="1.14">1.14. Are there copyright restrictions on the use of Python?</A></H2>
+Hardly.  You can do anything you want with the source, as long as
+you leave the copyrights in, and display those copyrights in any
+documentation about Python that you produce.  Also, don't use the
+author's institute's name in publicity without prior written
+permission, and don't hold them responsible for anything (read the
+actual copyright for a precise legal wording).
+<P>
+In particular, if you honor the copyright rules, it's OK to use Python
+for commercial use, to sell copies of Python in source or binary form,
+or to sell products that enhance Python or incorporate Python (or part
+of it) in some form.  I would still like to know about all commercial
+use of Python!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.014.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.014.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="1.15">1.15. Why was Python created in the first place?</A></H2>
+Here's a <I>very</I> brief summary of what got me started:
+<P>
+I had extensive experience with implementing an interpreted language
+in the ABC group at CWI, and from working with this group I had
+learned a lot about language design.  This is the origin of many
+Python features, including the use of indentation for statement
+grouping and the inclusion of very-high-level data types (although the
+details are all different in Python).
+<P>
+I had a number of gripes about the ABC language, but also liked many
+of its features.  It was impossible to extend the ABC language (or its
+implementation) to remedy my complaints -- in fact its lack of
+extensibility was one of its biggest problems.
+I had some experience with using Modula-2+ and talked with the
+designers of Modula-3 (and read the M3 report).  M3 is the origin of
+the syntax and semantics used for exceptions, and some other Python
+features.
+<P>
+I was working in the Amoeba distributed operating system group at
+CWI.  We needed a better way to do system administration than by
+writing either C programs or Bourne shell scripts, since Amoeba had
+its own system call interface which wasn't easily accessible from the
+Bourne shell.  My experience with error handling in Amoeba made me
+acutely aware of the importance of exceptions as a programming
+language feature.
+<P>
+It occurred to me that a scripting language with a syntax like ABC
+but with access to the Amoeba system calls would fill the need.  I
+realized that it would be foolish to write an Amoeba-specific
+language, so I decided that I needed a language that was generally
+extensible.
+<P>
+During the 1989 Christmas holidays, I had a lot of time on my hand,
+so I decided to give it a try.  During the next year, while still
+mostly working on it in my own time, Python was used in the Amoeba
+project with increasing success, and the feedback from colleagues made
+me add many early improvements.
+<P>
+In February 1991, after just over a year of development, I decided
+to post to USENET.  The rest is in the Misc/HISTORY file.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.015.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.015.htp">Log info</A>
+
+/ Last changed on Fri May 23 00:06:23 1997 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="1.16">1.16. Do I have to like &quot;Monty Python's Flying Circus&quot;?</A></H2>
+No, but it helps.  Pythonistas like the occasional reference to SPAM,
+and of course, nobody expects the Spanish Inquisition
+<P>
+The two main reasons to use Python are:
+<P>
+<PRE>
+ - Portable
+ - Easy to learn
+</PRE>
+The <I>three</I> main reasons to use Python are:
+<P>
+<PRE>
+ - Portable
+ - Easy to learn
+ - Powerful standard library
+</PRE>
+(And nice red uniforms.)
+<P>
+And remember, there is <I>no</I> rule six.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.016.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.016.htp">Log info</A>
+
+/ Last changed on Wed May 28 10:39:21 1997 by
+<A HREF="mailto:guido@cnri.reston.va.us">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="1.17">1.17. What is Python good for?</A></H2>
+Python is used in many situations where a great deal of dynamism,
+ease of use, power, and flexibility are required.  
+<P>
+In the area of basic text
+manipulation core Python (without any non-core extensions) is easier
+to use and is roughly as fast as just  about any language, and this makes Python
+good for many system administration type tasks and for CGI programming
+and other application areas that manipulate text and strings and such.
+<P>
+When augmented with
+standard extensions (such as PIL, COM, Numeric, oracledb, kjbuckets, 
+tkinter, win32api, etc.)
+or special purpose extensions (that you write, perhaps using helper tools such
+as SWIG, or using object protocols such as ILU/CORBA or COM) Python 
+becomes a very convenient "glue" or "steering"
+language that helps make heterogeneous collections of unrelated
+software packages work together.
+For example by combining Numeric with oracledb you can help your
+SQL database do statistical analysis, or even Fourier transforms.
+One of the features that makes Python excel in the "glue language" role
+is Python's simple, usable, and powerful C language runtime API.
+<P>
+Many developers also use Python extensively as a graphical user
+interface development aide.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.017.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.017.htp">Log info</A>
+
+/ Last changed on Sat May 24 10:13:11 1997 by
+<A HREF="mailto:aaron_watters@msn.com">Aaron Watters</A>
+<P>
+
+<HR>
+<H2><A NAME="1.18">1.18. Can I use the FAQ Wizard software to maintain my own FAQ?</A></H2>
+Sure.  It's in Tools/faqwiz/ of the python source tree.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.018.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.018.htp">Log info</A>
+
+/ Last changed on Fri Mar 29 06:50:32 2002 by
+<A HREF="mailto:aahz@pythoncraft.com">Aahz</A>
+<P>
+
+<HR>
+<H2><A NAME="1.19">1.19. Which editor has good support for editing Python source code?</A></H2>
+On Unix, the first choice is Emacs/XEmacs.  There's an elaborate
+mode for editing Python code, which is available from the Python
+source distribution (Misc/python-mode.el).  It's also bundled
+with XEmacs (we're still working on legal details to make it possible
+to bundle it with FSF Emacs).  And it has its own web page:
+<P>
+<PRE>
+    <A HREF="http://www.python.org/emacs/python-mode/index.html">http://www.python.org/emacs/python-mode/index.html</A>
+</PRE>
+There are many other choices, for Unix, Windows or Macintosh.
+Richard Jones compiled a table from postings on the Python newsgroup:
+<P>
+<PRE>
+    <A HREF="http://www.bofh.asn.au/~richard/editors.html">http://www.bofh.asn.au/~richard/editors.html</A>
+</PRE>
+See also FAQ question 7.10 for some more Mac and Win options.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.019.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.019.htp">Log info</A>
+
+/ Last changed on Mon Jun 15 23:21:04 1998 by
+<A HREF="mailto:guido@python.org">Gvr</A>
+<P>
+
+<HR>
+<H2><A NAME="1.20">1.20. I've never programmed before. Is there a Python tutorial?</A></H2>
+There are several, and at least one book.  
+All information for beginning Python programmers is collected here:
+<P>
+<PRE>
+    <A HREF="http://www.python.org/doc/Newbies.html">http://www.python.org/doc/Newbies.html</A>
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.020.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.020.htp">Log info</A>
+
+/ Last changed on Wed Sep  5 05:34:07 2001 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="1.21">1.21. Where in the world is www.python.org located?</A></H2>
+It's currently in Amsterdam, graciously hosted by XS4ALL:
+<P>
+<PRE>
+    <A HREF="http://www.xs4all.nl">http://www.xs4all.nl</A>
+</PRE>
+Thanks to Thomas Wouters for setting this up!!!!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq01.021.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq01.021.htp">Log info</A>
+
+/ Last changed on Fri Aug  3 21:49:27 2001 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H1>2. Python in the real world</H1>
+
+<HR>
+<H2><A NAME="2.1">2.1. How many people are using Python?</A></H2>
+Certainly thousands, and quite probably tens of thousands of users.
+More are seeing the light each day.  The comp.lang.python newsgroup is
+very active, but overall there is no accurate estimate of the number of subscribers or Python users.
+<P>
+Jacek Artymiak has created a Python Users Counter; you can see the 
+current count by visiting
+<A HREF="http://www.wszechnica.safenet.pl/cgi-bin/checkpythonuserscounter.py">http://www.wszechnica.safenet.pl/cgi-bin/checkpythonuserscounter.py</A>
+(this will not increment the counter; use the link there if you haven't
+added yourself already). Most Python users appear not to have registered themselves.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq02.001.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq02.001.htp">Log info</A>
+
+/ Last changed on Thu Feb 21 23:29:18 2002 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="2.2">2.2. Have any significant projects been done in Python?</A></H2>
+At CWI (the former home of Python), we have written a 20,000 line
+authoring environment for transportable hypermedia presentations, a
+5,000 line multimedia teleconferencing tool, as well as many many
+smaller programs.
+<P>
+At CNRI (Python's new home), we have written two large applications:
+Grail, a fully featured web browser (see
+<A HREF="http://grail.cnri.reston.va.us">http://grail.cnri.reston.va.us</A>),
+and the Knowbot Operating Environment,
+a distributed environment for mobile code.
+<P>
+The University of Virginia uses Python to control a virtual reality
+engine.  See <A HREF="http://alice.cs.cmu.edu">http://alice.cs.cmu.edu</A>.
+<P>
+The ILU project at Xerox PARC can generate Python glue for ILU
+interfaces.  See <A HREF="ftp://ftp.parc.xerox.com/pub/ilu/ilu.html">ftp://ftp.parc.xerox.com/pub/ilu/ilu.html</A>.  ILU
+is a free CORBA compliant ORB which supplies distributed object
+connectivity to a host of platforms using a host of languages.
+<P>
+Mark Hammond and Greg Stein and others are interfacing Python to
+Microsoft's COM and ActiveX architectures.  This means, among other
+things, that Python may be used in active server pages or as a COM
+controller (for example to automatically extract from or insert information
+into Excel or MSAccess or any other COM aware application).
+Mark claims Python can even be a ActiveX scripting host (which
+means you could embed JScript inside a Python application, if you
+had a strange sense of humor).  Python/AX/COM is distributed as part
+of the PythonWin distribution.
+<P>
+The University of California, Irvine uses a student administration
+system called TELE-Vision written entirely in Python.  Contact: Ray
+Price <A HREF="mailto:rlprice@uci.edu">rlprice@uci.edu</A>.
+<P>
+The Melbourne Cricket Ground (MCG) in Australia (a 100,000+ person venue)
+has it's scoreboard system written largely in Python on MS Windows.
+Python expressions are used to create almost every scoring entry that
+appears on the board.  The move to Python/C++ away from exclusive C++
+has provided a level of functionality that would simply not have been
+viable otherwise.
+<P>
+See also the next question.
+<P>
+Note: this FAQ entry is really old.
+See <A HREF="http://www.python.org/psa/Users.html">http://www.python.org/psa/Users.html</A> for a more recent list.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq02.002.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq02.002.htp">Log info</A>
+
+/ Last changed on Wed Oct 25 13:24:15 2000 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="2.3">2.3. Are there any commercial projects going on using Python?</A></H2>
+Yes, there's lots of commercial activity using Python.  See
+<A HREF="http://www.python.org/psa/Users.html">http://www.python.org/psa/Users.html</A> for a list.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq02.003.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq02.003.htp">Log info</A>
+
+/ Last changed on Wed Oct 14 18:17:33 1998 by
+<A HREF="mailto:klm@python.org">ken</A>
+<P>
+
+<HR>
+<H2><A NAME="2.4">2.4. How stable is Python?</A></H2>
+Very stable.  New, stable releases have been coming out roughly every 3 to 12 months since 1991, and this seems likely to continue.
+<P>
+With the introduction of retrospective "bugfix" releases the stability of the language implementations can be, and is being, improved independently of the new features offered by more recent major or minor releases. Bugfix releases, indicated by a third component of the version number, only fix known problems and do not gratuitously introduce new and possibly incompatible features or modified library functionality.
+<P>
+Release 2.2 got its first bugfix on April 10, 2002. The new version
+number is now 2.2.1. The 2.1 release, at 2.1.3, can probably be
+considered the "most stable" platform because it has been bugfixed
+twice.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq02.004.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq02.004.htp">Log info</A>
+
+/ Last changed on Tue Jul 23 10:20:04 2002 by
+<A HREF="mailto:kubieziel@gmx.de">Jens Kubieziel</A>
+<P>
+
+<HR>
+<H2><A NAME="2.5">2.5. What new developments are expected for Python in the future?</A></H2>
+See <A HREF="http://www.python.org/peps">http://www.python.org/peps</A>/ for the Python Enhancement 
+Proposals (PEPs). PEPs are design
+documents 
+describing a  suggested new feature for Python, providing
+a concise technical specification and a rationale.
+<P>
+Also, follow the discussions on the python-dev mailing list.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq02.005.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq02.005.htp">Log info</A>
+
+/ Last changed on Tue Apr  9 17:09:51 2002 by
+<A HREF="mailto:akuchlin@mems-exchange.org">A.M. Kuchling</A>
+<P>
+
+<HR>
+<H2><A NAME="2.6">2.6. Is it reasonable to propose incompatible changes to Python?</A></H2>
+In general, no.  There are already millions of lines of Python code
+around the world, so any changes in the language that invalidates more
+than a very small fraction of existing programs has to be frowned
+upon.  Even if you can provide a conversion program, there still is
+the problem of updating all documentation.  Providing a gradual
+upgrade path is the only way if a feature has to be changed.
+<P>
+See <A HREF="http://www.python.org/peps/pep-0005.html">http://www.python.org/peps/pep-0005.html</A> for the proposed
+mechanism for creating backwards-incompatibilities.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq02.006.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq02.006.htp">Log info</A>
+
+/ Last changed on Mon Apr  1 22:13:47 2002 by
+<A HREF="mailto:fdrake@acm.org">Fred Drake</A>
+<P>
+
+<HR>
+<H2><A NAME="2.7">2.7. What is the future of Python?</A></H2>
+Please see <A HREF="http://www.python.org/peps">http://www.python.org/peps</A>/ for proposals of future
+activities. One of the PEPs (Python Enhancement Proposals) deals
+with the PEP process and PEP format -- see
+<A HREF="http://www.python.org/peps/pep-0001.html">http://www.python.org/peps/pep-0001.html</A> if you want to
+submit a PEP. In <A HREF="http://www.python.org/peps/pep-0042.html">http://www.python.org/peps/pep-0042.html</A> there
+is a list of wishlists the Python Development team plans to tackle.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq02.007.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq02.007.htp">Log info</A>
+
+/ Last changed on Mon Apr  1 22:15:46 2002 by
+<A HREF="mailto:fdrake@acm.org">Fred Drake</A>
+<P>
+
+<HR>
+<H2><A NAME="2.8">2.8. What was the PSA, anyway?</A></H2>
+The Python Software Activity was
+created by a number of Python aficionados who want Python to be more
+than the product and responsibility of a single individual.
+The PSA was not an independent organization, but lived
+under the umbrealla of CNRI.
+<P>
+The PSA has been superseded by the Python Software Foundation,
+an independent non-profit organization.  The PSF's home page
+is at <A HREF="http://www.python.org/psf">http://www.python.org/psf</A>/.
+<P>
+Some pages created by the PSA still live at
+<A HREF="http://www.python.org/psa">http://www.python.org/psa</A>/
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq02.008.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq02.008.htp">Log info</A>
+
+/ Last changed on Thu Jul 25 18:19:44 2002 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="2.9">2.9. Deleted</A></H2>
+<P>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq02.009.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq02.009.htp">Log info</A>
+
+/ Last changed on Tue Jan  2 02:51:30 2001 by
+<A HREF="mailto:moshez@zadka.site.co.il">Moshe Zadka</A>
+<P>
+
+<HR>
+<H2><A NAME="2.10">2.10. Deleted</A></H2>
+<P>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq02.010.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq02.010.htp">Log info</A>
+
+/ Last changed on Tue Jan  2 02:52:19 2001 by
+<A HREF="mailto:moshez@zadka.site.co.il">Moshe Zadka</A>
+<P>
+
+<HR>
+<H2><A NAME="2.11">2.11. Is Python Y2K (Year 2000) Compliant?</A></H2>
+As of January, 2001 no major problems have been reported and Y2K
+compliance seems to be a non-issue.
+<P>
+Since Python is available free of charge, there are no absolute
+guarantees.  If there <I>are</I> unforeseen problems, liability is the
+user's rather than the developers', and there is nobody you can sue for damages.
+<P>
+Python does few 
+date manipulations, and what it does is all based on the Unix
+representation for time (even on non-Unix systems) which uses seconds
+since 1970 and won't overflow until 2038.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq02.011.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq02.011.htp">Log info</A>
+
+/ Last changed on Mon Jan  8 17:19:32 2001 by
+<A HREF="mailto:sholden@holdenweb.com">Steve Holden</A>
+<P>
+
+<HR>
+<H2><A NAME="2.12">2.12. Is Python a good language in a class for beginning programmers?</A></H2>
+Yes.  This long answer attempts to address any concerns you might
+have with teaching Python as a programmer's first language.  
+(If you want to discuss Python's use in education, then 
+you may be interested in joining the edu-sig mailinglist.
+See <A HREF="http://www.python.org/sigs/edu-sig">http://www.python.org/sigs/edu-sig</A>/ )
+<P>
+It is still common to start students with a procedural
+(subset of a) statically typed language such as Pascal, C, or
+a subset of C++ or Java.  I think that students may be better
+served by learning Python as their first language.  Python has
+a very simple and consistent syntax and a large standard library.
+Most importantly, using Python in a beginning programming course
+permits students to concentrate on important programming skills,
+such as problem decomposition and data type design.
+<P>
+With Python, students can be quickly introduced to basic concepts
+such as loops and procedures.  They can even probably work with
+user-defined objects in their very first course.  They could
+implement a tree structure as nested Python lists, for example.
+They could be introduced to objects in their first course if
+desired.  For a student who has never programmed before, using
+a statically typed language seems unnatural.  It presents
+additional complexity that the student must master and slows
+the pace of the course.  The students are trying to learn to
+think like a computer, decompose problems, design consistent
+interfaces, and encapsulate data.  While learning to use a
+statically typed language is important, it is not necessarily the
+best topic to address in the students' first programming course.
+<P>
+Many other aspects of Python make it a good first language.
+Python has a large standard library (like Java) so that
+students can be assigned programming projects very early in the
+course that <I>do</I> something.  Assignments aren't restricted to the
+standard four-function calculator and check balancing programs.
+By using the standard library, students can gain the satisfaction
+of working on realistic applications as they learn the fundamentals
+of programming.  Using the standard library also teaches students
+about code reuse.
+<P>
+Python's interactive interpreter also enables students to
+test language features while they're programming.  They can keep
+a window with the interpreter running while they enter their
+programs' source in another window.  If they can't remember the
+methods for a list, they can do something like this:
+<P>
+<PRE>
+ >>> L = []
+ >>> dir(L)
+ ['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
+ 'reverse', 'sort']
+ >>> print L.append.__doc__
+ L.append(object) -- append object to end
+ >>> L.append(1)
+ >>> L
+ [1]
+</PRE>
+With the interpreter, documentation is never far from the
+student as he's programming.
+<P>
+There are also good IDEs for Python.  Guido van Rossum's IDLE
+is a cross-platform IDE for Python that is written in Python
+using Tk.  There is also a Windows specific IDE called PythonWin.
+Emacs users will be happy to know that there is a very good Python
+mode for Emacs.  All of these programming environments provide
+syntax highlighting, auto-indenting, and access to the interactive
+interpreter while coding.  For more information about IDEs, see XXX.
+<P>
+If your department is currently using Pascal because it was
+designed to be a teaching language, then you'll be happy to
+know that Guido van Rossum designed Python to be simple to
+teach to everyone but powerful enough to implement real world
+applications.  Python makes a good language for first time
+programmers because that was one of Python's design goals.
+There are papers at <A HREF="http://www.python.org/doc/essays">http://www.python.org/doc/essays</A>/ on the Python website 
+by Python's creator explaining his objectives for the language.
+One that may interest you is titled "Computer Programming for Everybody" 
+<A HREF="http://www.python.org/doc/essays/cp4e.html">http://www.python.org/doc/essays/cp4e.html</A>
+<P>
+If you're seriously considering Python as a language for your
+school,  Guido van Rossum may even be willing to correspond with
+you about how the language would fit in your curriculum.
+See <A HREF="http://www.python.org/doc/FAQ.html#2.2">http://www.python.org/doc/FAQ.html#2.2</A> for examples of
+Python's use in the "real world."
+<P>
+While Python, its source code, and its IDEs are freely
+available, this consideration should not rule 
+out other languages.  There are other free languages (Java, 
+free C compilers), and many companies are willing to waive some
+or all of their fees for student programming tools if it
+guarantees that a whole graduating class will know how to
+use their tools.  That is, if one of the requirements for 
+the language that will be taught is that it be freely 
+available, then Python qualifies, but this requirement 
+does not preclude other languages.
+<P>
+While Python jobs may not be as prevalent as C/C++/Java jobs,
+teachers should not worry about teaching students critical job
+skills in their first course.  The skills that win students a
+job are those they learn in their senior classes and internships.
+Their first programming courses are there to lay a solid
+foundation in programming fundamentals.  The primary question
+in choosing the language for such a course should be which
+language permits the students to learn this material without
+hindering or limiting them.
+<P>
+Another argument for Python is that there are many tasks for
+which something like C++ is overkill.  That's where languages
+like Python, Perl, Tcl, and Visual Basic thrive.  It's critical
+for students to know something about these languages.   (Every
+employer for whom I've worked used at least one such language.)
+Of the languages listed above, Python probably makes the best
+language in a programming curriculum since its syntax is simple,
+consistent, and not unlike other languages (C/C++/Java) that
+are probably in the curriculum.  By starting students with
+Python, a department simultaneously lays the foundations for
+other programming courses and introduces students to the type
+of language that is often used as a "glue" language.  As an
+added bonus, Python can be used to interface with Microsoft's
+COM components (thanks to Mark Hammond).  There is also Jython, 
+a Java implementation of the Python interpreter, that can be 
+used to connect Java components.
+<P>
+If you currently start students with Pascal or C/C++ or Java,
+you may be worried they will have trouble learning a statically
+typed language after starting with Python.  I think that this
+fear most often stems from the fact that the teacher started
+with a statically typed language, and we tend to like to teach
+others in the same way we were taught.  In reality, the
+transition from Python to one of these other languages is
+quite simple.
+<P>
+To motivate a statically typed language such as C++, begin the
+course by explaining that unlike Python, their first language,
+C++ is compiled to a machine dependent executable.  Explain
+that the point is to make a very fast executable.  To permit
+the compiler to make optimizations, programmers must help it
+by specifying the "types" of variables.  By restricting each
+variable to a specific type, the compiler can reduce the
+book-keeping it has to do to permit dynamic types.  The compiler
+also has to resolve references at compile time.  Thus, the
+language gains speed by sacrificing some of Python's dynamic
+features.  Then again, the C++ compiler provides type safety
+and catches many bugs at compile time instead of run time (a
+critical consideration for many commercial applications).  C++
+is also designed for very large programs where one may want to
+guarantee that others don't touch an object's implementation.
+C++ provides very strong language features to separate an object's
+implementation from its interface.  Explain why this separation
+is a good thing.
+<P>
+The first day of a C++ course could then be a whirlwind introduction
+to what C++ requires and provides.  The point here is that after
+a semester or two of Python, students are hopefully competent
+programmers.  They know how to handle loops and write procedures.
+They've also worked with objects, thought about the benefits of
+consistent interfaces, and used the technique of subclassing to
+specialize behavior.  Thus, a whirlwind introduction to C++ could
+show them how objects and subclassing looks in C++.  The
+potentially difficult concepts of object-oriented design were
+taught without the additional obstacles presented by a language
+such as C++ or Java.  When learning one of these languages,
+the students would already understand the "road map."  They
+understand objects; they would just be learning how objects
+fit in a statically typed languages.  Language requirements
+and compiler errors that seem unnatural to beginning programmers
+make sense in this new context.  Many students will find it
+helpful to be able to write a fast prototype of their algorithms
+in Python.  Thus, they can test and debug their ideas before
+they attempt to write the code in the new language, saving the
+effort of working with C++ types for when they've discovered a
+working solution for their assignments.  When they get annoyed
+with the rigidity of types, they'll be happy to learn about
+containers and templates to regain some of the lost flexibility
+Python afforded them.  Students may also gain an appreciation
+for the fact that no language is best for every task.  They'll
+see that C++ is faster, but they'll know that they can gain
+flexibility and development speed with a Python when execution
+speed isn't critical.
+<P>
+If you have any concerns that weren't addressed here, try
+posting to the Python newsgroup.  Others there have done some
+work with using Python as an instructional tool.  Good luck.
+We'd love to hear about it if you choose Python for your course.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq02.012.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq02.012.htp">Log info</A>
+
+/ Last changed on Mon Dec  2 19:32:35 2002 by
+<A HREF="mailto:sconce@in-spec-inc.com">Bill Sconce</A>
+<P>
+
+<HR>
+<H1>3. Building Python and Other Known Bugs</H1>
+
+<HR>
+<H2><A NAME="3.1">3.1. Is there a test set?</A></H2>
+Sure.  You can run it after building with "make test", or you can
+run it manually with this command at the Python prompt:
+<P>
+<PRE>
+ import test.autotest
+</PRE>
+In Python 1.4 or earlier, use
+<P>
+<PRE>
+ import autotest
+</PRE>
+The test set doesn't test <I>all</I> features of Python,
+but it goes a long way to confirm that Python is actually working.
+<P>
+NOTE: if "make test" fails, don't just mail the output to the
+newsgroup -- this doesn't give enough information to debug the
+problem.  Instead, find out which test fails, and run that test
+manually from an interactive interpreter.  For example, if
+"make test" reports that test_spam fails, try this interactively:
+<P>
+<PRE>
+ import test.test_spam
+</PRE>
+This generally produces more verbose output which can be diagnosed
+to debug the problem.  If you find a bug in Python or the libraries, or in the tests, please report this in the Python bug tracker at SourceForge:
+<P>
+<A HREF="http://sourceforge.net/tracker/?func=add&amp;group_id=5470&amp;atid=105470">http://sourceforge.net/tracker/?func=add&amp;group_id=5470&amp;atid=105470</A>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.001.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.001.htp">Log info</A>
+
+/ Last changed on Fri Apr 27 10:29:36 2001 by
+<A HREF="mailto:fdrake@acm.org">Fred Drake</A>
+<P>
+
+<HR>
+<H2><A NAME="3.2">3.2. When running the test set, I get complaints about floating point operations, but when playing with floating point operations I cannot find anything wrong with them.</A></H2>
+The test set makes occasional unwarranted assumptions about the
+semantics of C floating point operations.  Until someone donates a
+better floating point test set, you will have to comment out the
+offending floating point tests and execute similar tests manually.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.002.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.002.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="3.3">3.3. Link errors after rerunning the configure script.</A></H2>
+It is generally necessary to run "make clean" after a configuration
+change.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.003.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.003.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="3.4">3.4. The python interpreter complains about options passed to a script (after the script name).</A></H2>
+You are probably linking with GNU getopt, e.g. through -liberty.
+Don't.  The reason for the complaint is that GNU getopt, unlike System
+V getopt and other getopt implementations, doesn't consider a
+non-option to be the end of the option list.  A quick (and compatible)
+fix for scripts is to add "--" to the interpreter, like this:
+<P>
+<PRE>
+        #! /usr/local/bin/python --
+</PRE>
+You can also use this interactively:
+<P>
+<PRE>
+        python -- script.py [options]
+</PRE>
+Note that a working getopt implementation is provided in the Python
+distribution (in Python/getopt.c) but not automatically used.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.004.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.004.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="3.5">3.5. When building on the SGI, make tries to run python to create glmodule.c, but python hasn't been built or installed yet.</A></H2>
+Comment out the line mentioning glmodule.c in Setup and build a
+python without gl first; install it or make sure it is in your $PATH,
+then edit the Setup file again to turn on the gl module, and make
+again.  You don't need to do "make clean"; you do need to run "make
+Makefile" in the Modules subdirectory (or just run "make" at the
+toplevel).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.005.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.005.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="3.6">3.6. I use VPATH but some targets are built in the source directory.</A></H2>
+On some systems (e.g. Sun), if the target already exists in the
+source directory, it is created there instead of in the build
+directory.  This is usually because you have previously built without
+VPATH.  Try running "make clobber" in the source directory.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.006.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.006.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="3.7">3.7. Trouble building or linking with the GNU readline library.</A></H2>
+You can use the GNU readline library to improve the interactive user
+interface: this gives you line editing and command history when
+calling python interactively. Its sources are distributed with 
+Python (at least for 2.0).  Uncomment the line 
+<P>
+#readline readline.c -lreadline -ltermcap
+<P>
+in Modules/Setup.  The configuration option --with-readline 
+is no longer supported, at least in Python 2.0.  Some hints on 
+building and using the readline library:
+On SGI IRIX 5, you may have to add the following
+to rldefs.h:
+<P>
+<PRE>
+        #ifndef sigmask
+        #define sigmask(sig) (1L &lt;&lt; ((sig)-1))
+        #endif
+</PRE>
+On some systems, you will have to add #include "rldefs.h" to the
+top of several source files, and if you use the VPATH feature, you
+will have to add dependencies of the form foo.o: foo.c to the
+Makefile for several values of foo.
+The readline library requires use of the termcap library. A
+known problem with this is that it contains entry points which
+cause conflicts with the STDWIN and SGI GL libraries. The STDWIN
+conflict can be solved by adding a line saying '#define werase w_erase' to the
+stdwin.h file (in the STDWIN distribution, subdirectory H). The
+GL conflict has been solved in the Python configure script by a
+hack that forces use of the static version of the termcap library.
+Check the newsgroup gnu.bash.bug news:gnu.bash.bug for
+specific problems with the readline library (I don't read this group
+but I've been told that it is the place for readline bugs).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.007.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.007.htp">Log info</A>
+
+/ Last changed on Sat Dec  2 18:23:48 2000 by
+<A HREF="mailto:trotts@llnl.gov">Issac Trotts</A>
+<P>
+
+<HR>
+<H2><A NAME="3.8">3.8. Trouble with socket I/O on older Linux 1.x versions.</A></H2>
+Once you've built Python, use it to run the regen script in the
+Lib/plat-linux2 directory.  Apparently the files as distributed don't match the system headers on some Linux versions.
+<P>
+Note that this FAQ entry only applies to Linux kernel versions 1.x.y;
+these are hardly around any more.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.008.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.008.htp">Log info</A>
+
+/ Last changed on Tue Jul 30 20:05:52 2002 by
+<A HREF="mailto:kubieziel@gmx.de">Jens Kubieziel</A>
+<P>
+
+<HR>
+<H2><A NAME="3.9">3.9. Trouble with prototypes on Ultrix.</A></H2>
+Ultrix cc seems broken -- use gcc, or edit config.h to #undef
+HAVE_PROTOTYPES.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.009.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.009.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="3.10">3.10. Other trouble building Python on platform X.</A></H2>
+Please submit the details to the SourceForge bug tracker:
+<P>
+<PRE>
+  <A HREF="http://sourceforge.net/tracker/?group_id=5470&amp;atid=105470">http://sourceforge.net/tracker/?group_id=5470&amp;atid=105470</A>
+</PRE>
+and we'll look
+into it.  Please provide as many details as possible.  In particular,
+if you don't tell us what type of computer and what operating system
+(and version) you are using it will be difficult for us to figure out
+what is the matter.  If you have compilation output logs,
+please use file uploads -- don't paste everything in the message box.
+<P>
+In many cases, we won't have access to the same hardware or operating system version, so <I>please</I>, if you have a SourceForge account, log in before filing your report, or if you don't have an account, include an email address at which we can reach you for further questions.  Logging in to SourceForge first will also cause SourceForge to send you updates as we act on your report.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.010.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.010.htp">Log info</A>
+
+/ Last changed on Fri Apr 27 10:53:18 2001 by
+<A HREF="mailto:fdrake@acm.org">Fred Drake</A>
+<P>
+
+<HR>
+<H2><A NAME="3.11">3.11. How to configure dynamic loading on Linux.</A></H2>
+This is now automatic as long as your Linux version uses the ELF
+object format (all recent Linuxes do).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.011.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.011.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="3.12">3.12. I can't get shared modules to work on Linux 2.0 (Slackware96)?</A></H2>
+This is a bug in the Slackware96 release. The fix is simple: Make sure
+that there is a link from /lib/libdl.so to /lib/libdl.so.1 so that the
+following links are setup: /lib/libdl.so -&gt; /lib/libdl.so.1
+/lib/libdl.so.1 -&gt; /lib/libdl.so.1.7.14 You may have to rerun the
+configure script, after rm'ing the config.cache file, before you
+attempt to rebuild python after this fix.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.012.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.012.htp">Log info</A>
+
+/ Last changed on Wed May 21 15:45:03 1997 by
+<A HREF="mailto:guido2@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="3.13">3.13. Trouble when making modules shared on Linux.</A></H2>
+This happens when you have built Python for static linking and then
+enable
+<PRE>
+  *shared*
+</PRE>
+in the Setup file.  Shared library code must be
+compiled with "-fpic".  If a .o file for the module already exist that
+was compiled for static linking, you must remove it or do "make clean"
+in the Modules directory.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.013.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.013.htp">Log info</A>
+
+/ Last changed on Fri May 23 13:42:30 1997 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="3.14">3.14. [deleted]</A></H2>
+[ancient information on threads on linux (when thread support
+was not standard) used to be here]
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.014.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.014.htp">Log info</A>
+
+/ Last changed on Sun Jun  2 17:27:13 2002 by
+<A HREF="mailto:erno-pyfaq@erno.iki.fi">Erno Kuusela</A>
+<P>
+
+<HR>
+<H2><A NAME="3.15">3.15. Errors when linking with a shared library containing C++ code.</A></H2>
+Link the main Python binary with C++.  Change the definition of
+LINKCC in Modules/Makefile to be your C++ compiler.  You may have to
+edit config.c slightly to make it compilable with C++.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.015.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.015.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="3.16">3.16. Deleted</A></H2>
+<P>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.016.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.016.htp">Log info</A>
+
+/ Last changed on Tue Sep 11 16:02:22 2001 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="3.17">3.17. Deleted.</A></H2>
+<P>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.017.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.017.htp">Log info</A>
+
+/ Last changed on Tue Sep 11 15:54:57 2001 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="3.18">3.18. Compilation or link errors for the _tkinter module</A></H2>
+Most likely, there's a version mismatch between the Tcl/Tk header
+files (tcl.h and tk.h) and the Tcl/Tk libraries you are using e.g.
+"-ltk8.0" and "-ltcl8.0" arguments for _tkinter in the Setup file).
+It is possible to install several versions of the Tcl/Tk libraries,
+but there can only be one version of the tcl.h and tk.h header
+files.  If the library doesn't match the header, you'll get
+problems, either when linking the module, or when importing it.
+Fortunately, the version number is clearly stated in each file,
+so this is easy to find.  Reinstalling and using the latest
+version usually fixes the problem.
+<P>
+(Also note that when compiling unpatched Python 1.5.1 against
+Tcl/Tk 7.6/4.2 or older, you get an error on Tcl_Finalize.  See
+the 1.5.1 patch page at <A HREF="http://www.python.org/1.5/patches-1.5.1">http://www.python.org/1.5/patches-1.5.1</A>/.)
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.018.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.018.htp">Log info</A>
+
+/ Last changed on Thu Jun 11 00:49:14 1998 by
+<A HREF="mailto:guido@python.org">Gvr</A>
+<P>
+
+<HR>
+<H2><A NAME="3.19">3.19. I configured and built Python for Tcl/Tk but &quot;import Tkinter&quot; fails.</A></H2>
+Most likely, you forgot to enable the line in Setup that says
+"TKPATH=:$(DESTLIB)/tkinter".
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.019.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.019.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="3.20">3.20. [deleted]</A></H2>
+[ancient information on a gcc+tkinter bug on alpha was here]
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.020.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.020.htp">Log info</A>
+
+/ Last changed on Mon Jun  3 16:46:23 2002 by
+<A HREF="mailto:erno-pyfaq@erno.iki.fi">Erno Kuusela</A>
+<P>
+
+<HR>
+<H2><A NAME="3.21">3.21. Several common system calls are missing from the posix module.</A></H2>
+Most likely, <I>all</I> test compilations run by the configure script
+are failing for some reason or another.  Have a look in config.log to
+see what could be the reason.  A common reason is specifying a
+directory to the --with-readline option that doesn't contain the
+libreadline.a file.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.021.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.021.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="3.22">3.22. ImportError: No module named string, on MS Windows.</A></H2>
+Most likely, your PYTHONPATH environment variable should be set to
+something like:
+<P>
+set PYTHONPATH=c:\python;c:\python\lib;c:\python\scripts
+<P>
+(assuming Python was installed in c:\python)
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.022.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.022.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="3.23">3.23. Core dump on SGI when using the gl module.</A></H2>
+There are conflicts between entry points in the termcap and curses
+libraries and an entry point in the GL library.  There's a hack of a
+fix for the termcap library if it's needed for the GNU readline
+library, but it doesn't work when you're using curses.  Concluding,
+you can't build a Python binary containing both the curses and gl
+modules.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.023.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.023.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="3.24">3.24. &quot;Initializer not a constant&quot; while building DLL on MS-Windows</A></H2>
+Static type object initializers in extension modules may cause compiles to
+fail with an error message like "initializer not a constant".  
+Fredrik Lundh &lt;<A HREF="mailto:Fredrik.Lundh@image.combitech.se">Fredrik.Lundh@image.combitech.se</A>&gt; explains:
+<P>
+This shows up when building DLL under MSVC.  There's two ways to
+address this: either compile the module as C++, or change your code to
+something like:
+<P>
+<PRE>
+  statichere PyTypeObject bstreamtype = {
+      PyObject_HEAD_INIT(NULL) /* must be set by init function */
+      0,
+      "bstream",
+      sizeof(bstreamobject),
+</PRE>
+<PRE>
+  ...
+</PRE>
+<PRE>
+  void
+  initbstream()
+  {
+      /* Patch object type */
+      bstreamtype.ob_type = &amp;PyType_Type;
+      Py_InitModule("bstream", functions);
+      ...
+  }
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.024.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.024.htp">Log info</A>
+
+/ Last changed on Sun May 25 14:58:05 1997 by
+<A HREF="mailto:aaron_watters@msn.com">Aaron Watters</A>
+<P>
+
+<HR>
+<H2><A NAME="3.25">3.25. Output directed to a pipe or file disappears on Linux.</A></H2>
+Some people have reported that when they run their script
+interactively, it runs great, but that when they redirect it
+to a pipe or file, no output appears.
+<P>
+<PRE>
+    % python script.py
+    ...some output...
+    % python script.py >file
+    % cat file
+    % # no output
+    % python script.py | cat
+    % # no output
+    %
+</PRE>
+This was a bug in Linux kernel. It is fixed and should not appear anymore. So most Linux users are <I>not</I> affected by this.
+<P>
+If redirection doesn't work on your Linux system, check what shell you are using. Shells like (t)csh doesn't support redirection.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.025.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.025.htp">Log info</A>
+
+/ Last changed on Thu Jan 16 13:38:30 2003 by
+<A HREF="mailto:kubieziel@gmx.de">Jens Kubieziel</A>
+<P>
+
+<HR>
+<H2><A NAME="3.26">3.26. [deleted]</A></H2>
+[ancient libc/linux problem was here]
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.026.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.026.htp">Log info</A>
+
+/ Last changed on Mon Jun  3 16:48:08 2002 by
+<A HREF="mailto:erno-pyfaq@erno.iki.fi">Erno Kuusela</A>
+<P>
+
+<HR>
+<H2><A NAME="3.27">3.27. [deleted]</A></H2>
+[ancient linux + threads + tk problem was described here]
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.027.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.027.htp">Log info</A>
+
+/ Last changed on Mon Jun  3 16:49:08 2002 by
+<A HREF="mailto:erno-pyfaq@erno.iki.fi">Erno Kuusela</A>
+<P>
+
+<HR>
+<H2><A NAME="3.28">3.28. How can I test if Tkinter is working?</A></H2>
+Try the following:
+<P>
+<PRE>
+  python
+  >>> import _tkinter
+  >>> import Tkinter
+  >>> Tkinter._test()
+</PRE>
+This should pop up a window with two buttons,
+one "Click me" and one "Quit".
+<P>
+If the first statement (import _tkinter) fails, your Python
+installation probably has not been configured to support Tcl/Tk.
+On Unix, if you have installed Tcl/Tk, you have to rebuild Python
+after editing the Modules/Setup file to enable the _tkinter module
+and the TKPATH environment variable.
+<P>
+It is also possible to get complaints about Tcl/Tk version
+number mismatches or missing TCL_LIBRARY or TK_LIBRARY
+environment variables.  These have to do with Tcl/Tk installation
+problems.
+<P>
+A common problem is to have installed versions of tcl.h and tk.h
+that don't match the installed version of the Tcl/Tk libraries;
+this usually results in linker errors or (when using dynamic
+loading) complaints about missing symbols during loading
+the shared library.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.028.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.028.htp">Log info</A>
+
+/ Last changed on Thu Aug 28 17:01:46 1997 by
+<A HREF="mailto:guido@python.org">Guido van Rossum</A>
+<P>
+
+<HR>
+<H2><A NAME="3.29">3.29. Is there a way to get the interactive mode of the python interpreter to perform function/variable name completion?</A></H2>
+(From a posting by Guido van Rossum)
+<P>
+On Unix, if you have enabled the readline module (i.e. if Emacs-style
+command line editing and bash-style history works for you), you can
+add this by importing the undocumented standard library module
+"rlcompleter".  When completing a simple identifier, it
+completes keywords, built-ins and globals in __main__; when completing
+NAME.NAME..., it evaluates (!) the expression up to the last dot and
+completes its attributes.
+<P>
+This way, you can do "import string", type "string.", hit the
+completion key twice, and see the list of names defined by the
+string module.
+<P>
+Tip: to use the tab key as the completion key, call
+<P>
+<PRE>
+    readline.parse_and_bind("tab: complete")
+</PRE>
+You can put this in a ~/.pythonrc file, and set the PYTHONSTARTUP
+environment variable to ~/.pythonrc.  This will cause the completion to be enabled
+whenever you run Python interactively.  
+<P>
+Notes (see the docstring for rlcompleter.py for more information):
+<P>
+* The evaluation of the NAME.NAME... form may cause arbitrary 
+application defined code to be executed if an object with a
+__getattr__ hook is found.  Since it is the responsibility of the
+application (or the user) to enable this feature, I consider this an
+acceptable risk.  More complicated expressions (e.g. function calls or
+indexing operations) are <I>not</I> evaluated.
+<P>
+* GNU readline is also used by the built-in functions input() and
+raw_input(), and thus these also benefit/suffer from the complete
+features.  Clearly an interactive application can benefit by
+specifying its own completer function and using raw_input() for all
+its input.
+<P>
+* When stdin is not a tty device, GNU readline is never
+used, and this module (and the readline module) are silently inactive.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.029.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.029.htp">Log info</A>
+
+/ Last changed on Fri Jun 12 09:55:24 1998 by
+<A HREF="mailto:akuchlin@cnri.reston.va.us">A.M. Kuchling</A>
+<P>
+
+<HR>
+<H2><A NAME="3.30">3.30. Why is the Python interpreter not built as a shared library?</A></H2>
+(This is a Unix question; on Mac and Windows, it <I>is</I> a shared
+library.)
+<P>
+It's just a nightmare to get this to work on all different platforms.
+Shared library portability is a pain.  And yes, I know about GNU libtool
+-- but it requires me to use its conventions for filenames etc, and it 
+would require a complete and utter rewrite of all the makefile and
+config tools I'm currently using.
+<P>
+In practice, few applications embed Python -- it's much more common to
+have Python extensions, which already are shared libraries.  Also,
+serious embedders often want total control over which Python version
+and configuration they use so they wouldn't want to use a standard
+shared library anyway.  So while the motivation of saving space
+when lots of apps embed Python is nice in theory, I
+doubt that it will save much in practice.  (Hence the low priority I
+give to making a shared library.)
+<P>
+For Linux systems, the simplest method of producing libpython1.5.so seems to 
+be (originally from the Minotaur project web page,  
+<A HREF="http://www.equi4.com/minotaur/minotaur.html">http://www.equi4.com/minotaur/minotaur.html</A>): 
+<P>
+<PRE>
+  make distclean 
+  ./configure 
+  make OPT="-fpic -O2" 
+  mkdir .extract 
+  (cd .extract; ar xv ../libpython1.5.a) 
+  gcc -shared -o libpython1.5.so .extract/*.o 
+  rm -rf .extract
+</PRE>
+In Python 2.3 this will be supported by the standard build routine
+(at least on Linux) with --enable-shared.  Note however that there
+is little advantage, and it slows down Python because of the need
+for PIC code and the extra cost at startup time to find the library.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.030.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.030.htp">Log info</A>
+
+/ Last changed on Thu May 30 13:36:55 2002 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="3.31">3.31. Build with GCC on Solaris 2.6 (SunOS 5.6) fails</A></H2>
+If you have upgraded Solaris 2.5 or 2.5.1 to Solaris 2.6,
+but you have not upgraded
+your GCC installation, the compile may fail, e.g. like this:
+<P>
+<PRE>
+ In file included from /usr/include/sys/stream.h:26,
+                  from /usr/include/netinet/in.h:38,
+                  from /usr/include/netdb.h:96,
+                  from ./socketmodule.c:121:
+ /usr/include/sys/model.h:32: #error "No DATAMODEL_NATIVE specified"
+</PRE>
+Solution: rebuild GCC for Solaris 2.6. 
+You might be able to simply re-run fixincludes, but
+people have had mixed success with doing that.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.031.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.031.htp">Log info</A>
+
+/ Last changed on Wed Oct 21 11:18:46 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="3.32">3.32. Running &quot;make clean&quot; seems to leave problematic files that cause subsequent builds to fail.</A></H2>
+Use "make clobber" instead.  
+<P>
+Use "make clean" to reduce the size of the source/build directory
+after you're happy with your build and installation.
+If you have already tried to build python and you'd like to start 
+over, you should use "make clobber".  It does a "make clean" and also 
+removes files such as the partially built Python library from a previous build.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.032.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.032.htp">Log info</A>
+
+/ Last changed on Thu Jun 24 20:39:26 1999 by
+<A HREF="mailto:tbryan@python.net">TAB</A>
+<P>
+
+<HR>
+<H2><A NAME="3.33">3.33. Submitting bug reports and patches</A></H2>
+To report a bug or submit a patch, please use the relevant service
+from the Python project at SourceForge.
+<P>
+Bugs: <A HREF="http://sourceforge.net/tracker/?group_id=5470&amp;atid=105470">http://sourceforge.net/tracker/?group_id=5470&amp;atid=105470</A>
+<P>
+Patches: <A HREF="http://sourceforge.net/tracker/?group_id=5470&amp;atid=305470">http://sourceforge.net/tracker/?group_id=5470&amp;atid=305470</A>
+<P>
+If you have a SourceForge account, please log in before submitting your bug report; this will make it easier for us to contact you regarding your report in the event we have follow-up questions.  It will also enable SourceForge to send you update information as we act on your bug.  If you do not have a SourceForge account, please consider leaving your name and email address as part of the report.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.033.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.033.htp">Log info</A>
+
+/ Last changed on Fri Apr 27 10:58:26 2001 by
+<A HREF="mailto:fdrake@acm.org">Fred Drake</A>
+<P>
+
+<HR>
+<H2><A NAME="3.34">3.34. I can't load shared libraries under Python 1.5.2, Solaris 7, and gcc 2.95.2</A></H2>
+When trying to load shared libraries, you may see errors like:
+ImportError: ld.so.1: python: fatal: relocation error: file /usr/local/lib/python1.5/site-packages/Perp/util/du_SweepUtilc.so:
+<PRE>
+ symbol PyExc_RuntimeError: referenced symbol not found
+</PRE>
+<P>
+There is a problem with the configure script for Python 1.5.2
+under Solaris 7 with gcc 2.95 .  configure should set the make variable
+LINKFORSHARED=-Xlinker -export-dynamic
+<P>
+<P>
+in Modules/Makefile, 
+<P>
+Manually add this line to the Modules/Makefile.
+This builds a Python executable that can load shared library extensions (xxx.so) .
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.034.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.034.htp">Log info</A>
+
+/ Last changed on Mon Feb 19 10:37:05 2001 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="3.35">3.35. In the regression test, test___all__ fails for the profile module. What's wrong?</A></H2>
+If you have been using the profile module, and have properly calibrated a copy of the module as described in the documentation for the profiler:
+<P>
+<A HREF="http://www.python.org/doc/current/lib/profile-calibration.html">http://www.python.org/doc/current/lib/profile-calibration.html</A>
+<P>
+then it is possible that the regression test "test___all__" will fail if you run the regression test manually rather than using "make test" in the Python source directory.  This will happen if you have set your PYTHONPATH environment variable to include the directory containing your calibrated profile module.  You have probably calibrated the profiler using an older version of the profile module which does not define the __all__ value, added to the module as of Python 2.1.
+<P>
+The problem can be fixed by removing the old calibrated version of the profile module and using the latest version to do a fresh calibration. In general, you will need to re-calibrate for each version of Python anyway, since the performance characteristics can change in subtle ways that impact profiling.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.035.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.035.htp">Log info</A>
+
+/ Last changed on Fri Apr 27 10:44:10 2001 by
+<A HREF="mailto:fdrake@acm.org">Fred Drake</A>
+<P>
+
+<HR>
+<H2><A NAME="3.36">3.36. relocations remain against allocatable but non-writable sections</A></H2>
+This linker error occurs on Solaris if you attempt to build an extension module which incorporates position-dependent (non-PIC) code. A common source of problems is that a static library (.a file), such as libreadline.a or libcrypto.a is linked with the extension module. The error specifically occurs when using gcc as the compiler, but /usr/ccs/bin/ld as the linker.
+<P>
+The following solutions and work-arounds are known:
+<P>
+1. Rebuild the libraries (libreadline, libcrypto) with -fPIC (-KPIC if using the system compiler). This is recommended; all object files in a shared library should be position-independent.
+<P>
+2. Statically link the extension module and its libraries into the Python interpreter, by editing Modules/Setup.
+<P>
+3. Use GNU ld instead of /usr/ccs/bin/ld; GNU ld will accept non-PIC code in shared libraries (and mark the section writable)
+<P>
+4. Pass -mimpure-text to GCC when linking the module. This will force gcc to not pass -z text to ld; in turn, ld will make all text sections writable.
+<P>
+Options 3 and 4 are not recommended, since the ability to share code across processes is lost.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq03.036.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq03.036.htp">Log info</A>
+
+/ Last changed on Tue Jan 29 12:05:11 2002 by
+<A HREF="mailto:loewis@informatik.hu-berlin.de">Martin v. Löwis</A>
+<P>
+
+<HR>
+<H1>4. Programming in Python</H1>
+
+<HR>
+<H2><A NAME="4.1">4.1. Is there a source code level debugger with breakpoints, step, etc.?</A></H2>
+Yes.  
+<P>
+Module pdb is a rudimentary but adequate console-mode debugger for Python. It is part of the standard Python library, and is documented in the Library Reference Manual. (You can also write your own debugger by using the code for pdb as an example.)
+<P>
+The IDLE interactive development environment, which is part of the standard Python distribution (normally available in Tools/idle), includes a graphical debugger.  There is documentation for the IDLE debugger at <A HREF="http://www.python.org/idle/doc/idle2.html#Debugger">http://www.python.org/idle/doc/idle2.html#Debugger</A>
+<P>
+Pythonwin is a Python IDE that includes a GUI debugger based on bdb.  The Pythonwin debugger colors breakpoints and has quite a few cool features (including debugging non-Pythonwin programs).  A reference can be found at <A HREF="http://www.python.org/ftp/python/pythonwin/pwindex.html">http://www.python.org/ftp/python/pythonwin/pwindex.html</A>
+More recent versions of PythonWin are available as a part of the ActivePython distribution (see   <A HREF="http://www.activestate.com/Products/ActivePython/index.html">http://www.activestate.com/Products/ActivePython/index.html</A>).
+<P>
+Pydb is a version of the standard Python debugger pdb, modified for use with DDD (Data Display Debugger), a popular graphical debugger front end.  Pydb can be found at  <A HREF="http://packages.debian.org/unstable/devel/pydb.html">http://packages.debian.org/unstable/devel/pydb.html</A>
+and DDD can be found at <A HREF="http://www.gnu.org/software/ddd">http://www.gnu.org/software/ddd</A>/
+<P>
+There are a number of commmercial Python IDEs that include graphical debuggers.  They include:
+<P>
+<PRE>
+ * Wing IDE (<A HREF="http://wingide.com">http://wingide.com</A>/) 
+ * Komodo IDE (<A HREF="http://www.activestate.com/Products/Komodo">http://www.activestate.com/Products/Komodo</A>/)
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.001.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.001.htp">Log info</A>
+
+/ Last changed on Tue Jan 28 01:43:41 2003 by
+<A HREF="mailto:steve@ferg.org">Stephen Ferg</A>
+<P>
+
+<HR>
+<H2><A NAME="4.2">4.2. Can I create an object class with some methods implemented in C and others in Python (e.g. through inheritance)? (Also phrased as: Can I use a built-in type as base class?)</A></H2>
+In Python 2.2, you can inherit from builtin classes such as int, list, dict, etc.
+<P>
+In previous versions of Python, you can easily create a Python class which serves as a wrapper around a built-in object, e.g. (for dictionaries):
+<P>
+<PRE>
+        # A user-defined class behaving almost identical
+        # to a built-in dictionary.
+        class UserDict:
+                def __init__(self): self.data = {}
+                def __repr__(self): return repr(self.data)
+                def __cmp__(self, dict):
+                        if type(dict) == type(self.data):
+                                return cmp(self.data, dict)
+                        else:
+                                return cmp(self.data, dict.data)
+                def __len__(self): return len(self.data)
+                def __getitem__(self, key): return self.data[key]
+                def __setitem__(self, key, item): self.data[key] = item
+                def __delitem__(self, key): del self.data[key]
+                def keys(self): return self.data.keys()
+                def items(self): return self.data.items()
+                def values(self): return self.data.values()
+                def has_key(self, key): return self.data.has_key(key)
+</PRE>
+A2. See Jim Fulton's ExtensionClass for an example of a mechanism
+which allows you to have superclasses which you can inherit from in
+Python -- that way you can have some methods from a C superclass (call
+it a mixin) and some methods from either a Python superclass or your
+subclass.  ExtensionClass is distributed as a part of Zope (see
+<A HREF="http://www.zope.org">http://www.zope.org</A>), but will be phased out with Zope 3, since
+Zope 3 uses Python 2.2 or later which supports direct inheritance
+from built-in types.  Here's a link to the original paper about
+ExtensionClass:
+<A HREF="http://debian.acm.ndsu.nodak.edu/doc/python-extclass/ExtensionClass.html">http://debian.acm.ndsu.nodak.edu/doc/python-extclass/ExtensionClass.html</A>
+<P>
+A3. The Boost Python Library (BPL, <A HREF="http://www.boost.org/libs/python/doc/index.html">http://www.boost.org/libs/python/doc/index.html</A>)
+provides a way of doing this from C++ (i.e. you can inherit from an
+extension class written in C++ using the BPL).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.002.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.002.htp">Log info</A>
+
+/ Last changed on Tue May 28 21:09:52 2002 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.3">4.3. Is there a curses/termcap package for Python?</A></H2>
+The standard Python source distribution comes with a curses module in
+the Modules/ subdirectory, though it's not compiled by default (note
+that this is not available in the Windows distribution -- there is
+no curses module for Windows).
+<P>
+In Python versions before 2.0 the module only supported plain curses; 
+you couldn't use ncurses features like colors with it (though it would 
+link with ncurses).
+<P>
+In Python 2.0, the curses module has been greatly extended, starting 
+from Oliver Andrich's enhanced version, to provide many additional 
+functions from ncurses and SYSV curses, such as colour, alternative
+character set support, pads, and mouse support. This means the
+module is no longer compatible with operating systems that only
+have BSD curses, but there don't seem to be any currently
+maintained OSes that fall into this category.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.003.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.003.htp">Log info</A>
+
+/ Last changed on Sun Jun 23 20:24:06 2002 by
+<A HREF="mailto:tim.one@comcast.net">Tim Peters</A>
+<P>
+
+<HR>
+<H2><A NAME="4.4">4.4. Is there an equivalent to C's onexit() in Python?</A></H2>
+For Python 2.0: The new atexit module provides a register function that
+is similar to C's onexit. See the Library Reference for details. For
+2.0 you should <I>not</I> assign to sys.exitfunc!
+<P>
+For Python 1.5.2: You need to import sys and assign a function to 
+sys.exitfunc, it will be called when your program exits, is 
+killed by an unhandled exception, or (on UNIX) receives a 
+SIGHUP or SIGTERM signal.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.004.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.004.htp">Log info</A>
+
+/ Last changed on Thu Dec 28 12:14:55 2000 by
+<A HREF="mailto:pbjorn@uswest.net">Bjorn Pettersen</A>
+<P>
+
+<HR>
+<H2><A NAME="4.5">4.5. [deleted]</A></H2>
+[python used to lack nested scopes, it was explained here]
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.005.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.005.htp">Log info</A>
+
+/ Last changed on Thu Mar 21 05:18:22 2002 by
+<A HREF="mailto:erno-pyfaq@erno.iki.fi">Erno Kuusela</A>
+<P>
+
+<HR>
+<H2><A NAME="4.6">4.6. How do I iterate over a sequence in reverse order?</A></H2>
+If it is a list, the fastest solution is
+<P>
+<PRE>
+        list.reverse()
+        try:
+                for x in list:
+                        "do something with x"
+        finally:
+                list.reverse()
+</PRE>
+This has the disadvantage that while you are in the loop, the list
+is temporarily reversed.  If you don't like this, you can make a copy.
+This appears expensive but is actually faster than other solutions:
+<P>
+<PRE>
+        rev = list[:]
+        rev.reverse()
+        for x in rev:
+                &lt;do something with x&gt;
+</PRE>
+If it's not a list, a more general but slower solution is:
+<P>
+<PRE>
+        for i in range(len(sequence)-1, -1, -1):
+                x = sequence[i]
+                &lt;do something with x&gt;
+</PRE>
+A more elegant solution, is to define a class which acts as a sequence
+and yields the elements in reverse order (solution due to Steve
+Majewski):
+<P>
+<PRE>
+        class Rev:
+                def __init__(self, seq):
+                        self.forw = seq
+                def __len__(self):
+                        return len(self.forw)
+                def __getitem__(self, i):
+                        return self.forw[-(i + 1)]
+</PRE>
+You can now simply write:
+<P>
+<PRE>
+        for x in Rev(list):
+                &lt;do something with x&gt;
+</PRE>
+Unfortunately, this solution is slowest of all, due to the method
+call overhead...
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.006.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.006.htp">Log info</A>
+
+/ Last changed on Sun May 25 21:10:50 1997 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.7">4.7. My program is too slow. How do I speed it up?</A></H2>
+That's a tough one, in general.  There are many tricks to speed up
+Python code; I would consider rewriting parts in C only as a last
+resort.  One thing to notice is that function and (especially) method
+calls are rather expensive; if you have designed a purely OO interface
+with lots of tiny functions that don't do much more than get or set an
+instance variable or call another method, you may consider using a
+more direct way, e.g. directly accessing instance variables.  Also see
+the standard module "profile" (described in the Library Reference
+manual) which makes it possible to find out where
+your program is spending most of its time (if you have some patience
+-- the profiling itself can slow your program down by an order of
+magnitude).
+<P>
+Remember that many standard optimization heuristics you
+may know from other programming experience may well apply
+to Python.  For example it may be faster to send output to output
+devices using larger writes rather than smaller ones in order to
+avoid the overhead of kernel system calls.  Thus CGI scripts
+that write all output in "one shot" may be notably faster than
+those that write lots of small pieces of output.
+<P>
+Also, be sure to use "aggregate" operations where appropriate.
+For example the "slicing" feature allows programs to chop up
+lists and other sequence objects in a single tick of the interpreter
+mainloop using highly optimized C implementations.  Thus to 
+get the same effect as
+<P>
+<PRE>
+  L2 = []
+  for i in range[3]:
+       L2.append(L1[i])
+</PRE>
+it is much shorter and far faster to use
+<P>
+<PRE>
+  L2 = list(L1[:3]) # "list" is redundant if L1 is a list.
+</PRE>
+Note that the map() function, particularly used with
+builtin methods or builtin functions can be a convenient
+accelerator.  For example to pair the elements of two
+lists together:
+<P>
+<PRE>
+  >>> map(None, [1,2,3], [4,5,6])
+  [(1, 4), (2, 5), (3, 6)]
+</PRE>
+or to compute a number of sines:
+<P>
+<PRE>
+  >>> map( math.sin, (1,2,3,4))
+  [0.841470984808, 0.909297426826, 0.14112000806,   -0.756802495308]
+</PRE>
+The map operation completes very quickly in such cases.
+<P>
+Other examples of aggregate operations include the join and split
+methods of string objects.  For example if s1..s7 are large (10K+) strings then
+"".join([s1,s2,s3,s4,s5,s6,s7]) may be far faster than
+the more obvious s1+s2+s3+s4+s5+s6+s7, since the "summation"
+will compute many subexpressions, whereas join does all
+copying in one pass.  For manipulating strings also consider the 
+regular expression libraries and the "substitution" operations
+String % tuple and String % dictionary.  Also be sure to use
+the list.sort builtin method to do sorting, and see FAQ's 4.51
+and 4.59 for examples of moderately advanced usage -- list.sort beats
+other techniques for sorting in all but the most extreme
+circumstances.
+<P>
+There are many other aggregate operations
+available in the standard libraries and in contributed libraries
+and extensions.
+<P>
+Another common trick is to "push loops into functions or methods."
+For example suppose you have a program that runs slowly and you
+use the profiler (profile.run) to determine that a Python function ff
+is being called lots of times.  If you notice that ff 
+<P>
+<PRE>
+   def ff(x):
+       ...do something with x computing result...
+       return result
+</PRE>
+tends to be called in loops like (A)
+<P>
+<PRE>
+   list = map(ff, oldlist)
+</PRE>
+or (B)
+<P>
+<PRE>
+   for x in sequence:
+       value = ff(x)
+       ...do something with value...
+</PRE>
+then you can often eliminate function call overhead by rewriting
+ff to
+<P>
+<PRE>
+   def ffseq(seq):
+       resultseq = []
+       for x in seq:
+           ...do something with x computing result...
+           resultseq.append(result)
+       return resultseq
+</PRE>
+and rewrite (A) to
+<P>
+<PRE>
+    list = ffseq(oldlist)
+</PRE>
+and (B) to
+<P>
+<PRE>
+    for value in ffseq(sequence):
+        ...do something with value...
+</PRE>
+Other single calls ff(x) translate to ffseq([x])[0] with little
+penalty.  Of course this technique is not always appropriate
+and there are other variants, which you can figure out.
+<P>
+You can gain some performance by explicitly storing the results of
+a function or method lookup into a local variable.  A loop like
+<P>
+<PRE>
+    for key in token:
+        dict[key] = dict.get(key, 0) + 1
+</PRE>
+resolves dict.get every iteration.  If the method isn't going to
+change, a faster implementation is
+<P>
+<PRE>
+    dict_get = dict.get  # look up the method once
+    for key in token:
+        dict[key] = dict_get(key, 0) + 1
+</PRE>
+Default arguments can be used to determine values once, at
+compile time instead of at run time.  This can only be done for
+functions or objects which will not be changed during program
+execution, such as replacing
+<P>
+<PRE>
+    def degree_sin(deg):
+        return math.sin(deg * math.pi / 180.0)
+</PRE>
+with
+<P>
+<PRE>
+    def degree_sin(deg, factor = math.pi/180.0, sin = math.sin):
+        return sin(deg * factor)
+</PRE>
+Because this trick uses default arguments for terms which should
+not be changed, it should only be used when you are not concerned
+with presenting a possibly confusing API to your users.
+<P>
+<P>
+For an anecdote related to optimization, see
+<P>
+<PRE>
+	<A HREF="http://www.python.org/doc/essays/list2str.html">http://www.python.org/doc/essays/list2str.html</A>
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.007.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.007.htp">Log info</A>
+
+/ Last changed on Mon Jun  3 01:03:54 2002 by
+<A HREF="mailto:neal@metaslash.com">Neal Norwitz</A>
+<P>
+
+<HR>
+<H2><A NAME="4.8">4.8. When I have imported a module, then edit it, and import it again (into the same Python process), the changes don't seem to take place. What is going on?</A></H2>
+For reasons of efficiency as well as consistency, Python only reads
+the module file on the first time a module is imported.  (Otherwise a
+program consisting of many modules, each of which imports the same
+basic module, would read the basic module over and over again.)  To
+force rereading of a changed module, do this:
+<P>
+<PRE>
+        import modname
+        reload(modname)
+</PRE>
+Warning: this technique is not 100% fool-proof.  In particular,
+modules containing statements like
+<P>
+<PRE>
+        from modname import some_objects
+</PRE>
+will continue to work with the old version of the imported objects.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.008.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.008.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="4.9">4.9. How do I find the current module name?</A></H2>
+A module can find out its own module name by looking at the
+(predefined) global variable __name__.  If this has the value
+'__main__' you are running as a script.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.009.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.009.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="4.10">4.10. I have a module in which I want to execute some extra code when it is run as a script. How do I find out whether I am running as a script?</A></H2>
+See the previous question.  E.g. if you put the following on the
+last line of your module, main() is called only when your module is
+running as a script:
+<P>
+<PRE>
+        if __name__ == '__main__': main()
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.010.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.010.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="4.11">4.11. I try to run a program from the Demo directory but it fails with ImportError: No module named ...; what gives?</A></H2>
+This is probably an optional module (written in C!) which hasn't
+been configured on your system.  This especially happens with modules
+like "Tkinter", "stdwin", "gl", "Xt" or "Xm".  For Tkinter, STDWIN and
+many other modules, see Modules/Setup.in for info on how to add these
+modules to your Python, if it is possible at all.  Sometimes you will
+have to ftp and build another package first (e.g. Tcl and Tk for Tkinter).
+Sometimes the module only works on specific platforms (e.g. gl only works
+on SGI machines).
+<P>
+NOTE: if the complaint is about "Tkinter" (upper case T) and you have
+already configured module "tkinter" (lower case t), the solution is
+<I>not</I> to rename tkinter to Tkinter or vice versa.  There is probably
+something wrong with your module search path.  Check out the value of
+sys.path.
+<P>
+For X-related modules (Xt and Xm) you will have to do more work: they
+are currently not part of the standard Python distribution.  You will
+have to ftp the Extensions tar file, i.e.
+<A HREF="ftp://ftp.python.org/pub/python/src/X-extension.tar.gz">ftp://ftp.python.org/pub/python/src/X-extension.tar.gz</A> and follow
+the instructions there.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.011.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.011.htp">Log info</A>
+
+/ Last changed on Wed Feb 12 21:31:08 2003 by
+<A HREF="mailto:kubieziel@gmx.de">Jens Kubieziel</A>
+<P>
+
+<HR>
+<H2><A NAME="4.12">4.12. [deleted]</A></H2>
+[stdwin (long dead windowing library) entry deleted]
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.012.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.012.htp">Log info</A>
+
+/ Last changed on Thu Mar 21 08:30:13 2002 by
+<A HREF="mailto:erno-pyfaq@erno.iki.fi">Erno Kuusela</A>
+<P>
+
+<HR>
+<H2><A NAME="4.13">4.13. What GUI toolkits exist for Python?</A></H2>
+Depending on what platform(s) you are aiming at, there are several.
+<P>
+Currently supported solutions:
+<P>
+Cross-platform:
+<P>
+Tk:
+<P>
+There's a neat object-oriented interface to the Tcl/Tk widget set,
+called Tkinter.  It is part of the standard Python distribution and
+well-supported -- all you need to do is build and install Tcl/Tk and
+enable the _tkinter module and the TKPATH definition in Modules/Setup
+when building Python.  This is probably the easiest to install and
+use, and the most complete widget set.  It is also very likely that in
+the future the standard Python GUI API will be based on or at least
+look very much like the Tkinter interface.  For more info about Tk,
+including pointers to the source, see the Tcl/Tk home page at
+<A HREF="http://www.scriptics.com">http://www.scriptics.com</A>.  Tcl/Tk is now fully
+portable to the Mac and Windows platforms (NT and 95 only); you need
+Python 1.4beta3 or later and Tk 4.1patch1 or later.
+<P>
+wxWindows:
+<P>
+There's an interface to wxWindows called wxPython.  wxWindows is a 
+portable GUI class library written in C++.  It supports GTK, Motif, 
+MS-Windows and Mac as targets.  Ports to other platforms are being 
+contemplated or have already had some work done on them.  wxWindows 
+preserves the look and feel of the underlying graphics toolkit, and 
+there is quite a rich widget set and collection of GDI classes.  
+See the wxWindows page at <A HREF="http://www.wxwindows.org">http://www.wxwindows.org</A>/ for more details.  
+wxPython is a python extension module that wraps many of the wxWindows 
+C++ classes, and is quickly gaining popularity amongst Python 
+developers.  You can get wxPython as part of the source or CVS 
+distribution of wxWindows, or directly from its home page at 
+<A HREF="http://alldunn.com/wxPython">http://alldunn.com/wxPython</A>/.
+<P>
+Gtk+:
+<P>
+PyGtk bindings for the Gtk+ Toolkit by James Henstridge exist; see <A HREF="ftp://ftp.daa.com.au/pub/james/python">ftp://ftp.daa.com.au/pub/james/python</A>/.  Note that there are two incompatible bindings.  If you are using Gtk+ 1.2.x you should get the 0.6.x PyGtk bindings from
+<P>
+<PRE>
+    <A HREF="ftp://ftp.gtk.org/pub/python/v1.2">ftp://ftp.gtk.org/pub/python/v1.2</A>
+</PRE>
+If you plan to use Gtk+ 2.0 with Python (highly recommended if you are just starting with Gtk), get the most recent distribution from
+<P>
+<PRE>
+    <A HREF="ftp://ftp.gtk.org/pub/python/v2.0">ftp://ftp.gtk.org/pub/python/v2.0</A>
+</PRE>
+If you are adventurous, you can also check out the source from the Gnome CVS repository.  Set your CVS directory to :pserver:<A HREF="mailto:anonymous@anoncvs.gnome.org">anonymous@anoncvs.gnome.org</A>:/cvs/gnome and check the gnome-python module out from the repository.
+<P>
+Other:
+<P>
+There are also bindings available for the Qt toolkit (PyQt), and for KDE (PyKDE); see <A HREF="http://www.thekompany.com/projects/pykde">http://www.thekompany.com/projects/pykde</A>/.
+<P>
+For OpenGL bindings, see <A HREF="http://starship.python.net/~da/PyOpenGL">http://starship.python.net/~da/PyOpenGL</A>.
+<P>
+Platform specific:
+<P>
+The Mac port has a rich and ever-growing set of modules that support
+the native Mac toolbox calls.  See the documentation that comes with
+the Mac port.  See <A HREF="ftp://ftp.python.org/pub/python/mac">ftp://ftp.python.org/pub/python/mac</A>.  Support
+by Jack Jansen <A HREF="mailto:jack@cwi.nl">jack@cwi.nl</A>.
+<P>
+Pythonwin by Mark Hammond (<A HREF="mailto:MHammond@skippinet.com.au">MHammond@skippinet.com.au</A>)
+includes an interface to the Microsoft Foundation
+Classes and a Python programming environment using it that's written
+mostly in Python.  See <A HREF="http://www.python.org/windows">http://www.python.org/windows</A>/.
+<P>
+There's an object-oriented GUI based on the Microsoft Foundation
+Classes model called WPY, supported by Jim Ahlstrom <A HREF="mailto:jim@interet.com">jim@interet.com</A>.
+Programs written in WPY run unchanged and with native look and feel on
+Windows NT/95, Windows 3.1 (using win32s), and on Unix (using Tk).
+Source and binaries for Windows and Linux are available in
+<A HREF="ftp://ftp.python.org/pub/python/wpy">ftp://ftp.python.org/pub/python/wpy</A>/.
+<P>
+Obsolete or minority solutions:
+<P>
+There's an interface to X11, including the Athena and Motif widget
+sets (and a few individual widgets, like Mosaic's HTML widget and
+SGI's GL widget) available from
+<A HREF="ftp://ftp.python.org/pub/python/src/X-extension.tar.gz">ftp://ftp.python.org/pub/python/src/X-extension.tar.gz</A>.
+Support by Sjoerd Mullender <A HREF="mailto:sjoerd@cwi.nl">sjoerd@cwi.nl</A>.
+<P>
+On top of the X11 interface there's the vpApp
+toolkit by Per Spilling, now also maintained by Sjoerd Mullender
+<A HREF="mailto:sjoerd@cwi.nl">sjoerd@cwi.nl</A>.  See <A HREF="ftp://ftp.cwi.nl/pub/sjoerd/vpApp.tar.gz">ftp://ftp.cwi.nl/pub/sjoerd/vpApp.tar.gz</A>.
+<P>
+For SGI IRIX only, there are unsupported interfaces to the complete
+GL (Graphics Library -- low level but very good 3D capabilities) as
+well as to FORMS (a buttons-and-sliders-etc package built on top of GL
+by Mark Overmars -- ftp'able from
+<A HREF="ftp://ftp.cs.ruu.nl/pub/SGI/FORMS">ftp://ftp.cs.ruu.nl/pub/SGI/FORMS</A>/).  This is probably also
+becoming obsolete, as OpenGL takes over (see above).
+<P>
+There's an interface to STDWIN, a platform-independent low-level
+windowing interface for Mac and X11.  This is totally unsupported and
+rapidly becoming obsolete.  The STDWIN sources are at
+<A HREF="ftp://ftp.cwi.nl/pub/stdwin">ftp://ftp.cwi.nl/pub/stdwin</A>/.
+<P>
+There is an interface to WAFE, a Tcl interface to the X11
+Motif and Athena widget sets.  WAFE is at
+<A HREF="http://www.wu-wien.ac.at/wafe/wafe.html">http://www.wu-wien.ac.at/wafe/wafe.html</A>.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.013.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.013.htp">Log info</A>
+
+/ Last changed on Mon May 13 21:40:39 2002 by
+<A HREF="mailto:skip@pobox.com">Skip Montanaro</A>
+<P>
+
+<HR>
+<H2><A NAME="4.14">4.14. Are there any interfaces to database packages in Python?</A></H2>
+Yes!  See the Database Topic Guide at 
+<A HREF="http://www.python.org/topics/database">http://www.python.org/topics/database</A>/ for details.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.014.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.014.htp">Log info</A>
+
+/ Last changed on Tue Jan  4 20:12:19 2000 by
+<A HREF="mailto:bwarsaw@python.org">Barney Warplug</A>
+<P>
+
+<HR>
+<H2><A NAME="4.15">4.15. Is it possible to write obfuscated one-liners in Python?</A></H2>
+Yes.  See the following three examples, due to Ulf Bartelt:
+<P>
+<PRE>
+        # Primes &lt; 1000
+        print filter(None,map(lambda y:y*reduce(lambda x,y:x*y!=0,
+        map(lambda x,y=y:y%x,range(2,int(pow(y,0.5)+1))),1),range(2,1000)))
+</PRE>
+<PRE>
+        # First 10 Fibonacci numbers
+        print map(lambda x,f=lambda x,f:(x&lt;=1) or (f(x-1,f)+f(x-2,f)): f(x,f),
+        range(10))
+</PRE>
+<PRE>
+        # Mandelbrot set
+        print (lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y,
+        Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,Sy=Sy,L=lambda yc,Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,i=IM,
+        Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,
+        i=i,Sx=Sx,F=lambda xc,yc,x,y,k,f=lambda xc,yc,x,y,k,f:(k&lt;=0)or (x*x+y*y
+        >=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr(
+        64+F(Ru+x*(Ro-Ru)/Sx,yc,0,0,i)),range(Sx))):L(Iu+y*(Io-Iu)/Sy),range(Sy
+        ))))(-2.1, 0.7, -1.2, 1.2, 30, 80, 24)
+        #    \___ ___/  \___ ___/  |   |   |__ lines on screen
+        #        V          V      |   |______ columns on screen
+        #        |          |      |__________ maximum of "iterations"
+        #        |          |_________________ range on y axis
+        #        |____________________________ range on x axis
+</PRE>
+Don't try this at home, kids!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.015.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.015.htp">Log info</A>
+
+/ Last changed on Wed May 21 15:48:33 1997 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.16">4.16. Is there an equivalent of C's &quot;?:&quot; ternary operator?</A></H2>
+Not directly.  In many cases you can mimic a?b:c with "a and b or
+c", but there's a flaw: if b is zero (or empty, or None -- anything
+that tests false) then c will be selected instead.  In many cases you
+can prove by looking at the code that this can't happen (e.g. because
+b is a constant or has a type that can never be false), but in general
+this can be a problem.
+<P>
+Tim Peters (who wishes it was Steve Majewski) suggested the following
+solution: (a and [b] or [c])[0].  Because [b] is a singleton list it
+is never false, so the wrong path is never taken; then applying [0] to
+the whole thing gets the b or c that you really wanted.  Ugly, but it
+gets you there in the rare cases where it is really inconvenient to
+rewrite your code using 'if'.
+<P>
+As a last resort it is possible to implement the "?:" operator as a function:
+<P>
+<PRE>
+    def q(cond,on_true,on_false):
+        from inspect import isfunction
+</PRE>
+<PRE>
+        if cond:
+            if not isfunction(on_true): return on_true
+            else: return apply(on_true)
+        else:
+            if not isfunction(on_false): return on_false 
+            else: return apply(on_false)
+</PRE>
+In most cases you'll pass b and c directly: q(a,b,c).  To avoid evaluating b
+or c when they shouldn't be, encapsulate them
+within a lambda function, e.g.: q(a,lambda: b, lambda: c).
+<P>
+<P>
+<P>
+It has been asked <I>why</I> Python has no if-then-else expression,
+since most language have one; it is a frequently requested feature.
+<P>
+There are several possible answers: just as many languages do
+just fine without one; it can easily lead to less readable code;
+no sufficiently "Pythonic" syntax has been discovered; a search
+of the standard library found remarkably few places where using an
+if-then-else expression would make the code more understandable.
+<P>
+Nevertheless, in an effort to decide once and for all whether
+an if-then-else expression should be added to the language,
+PEP 308 (<A HREF="http://www.python.org/peps/pep-0308.html">http://www.python.org/peps/pep-0308.html</A>) has been
+put forward, proposing a specific syntax.  The community can
+now vote on this issue.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.016.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.016.htp">Log info</A>
+
+/ Last changed on Fri Feb  7 19:41:13 2003 by
+<A HREF="mailto:goodger@python.org">David Goodger</A>
+<P>
+
+<HR>
+<H2><A NAME="4.17">4.17. My class defines __del__ but it is not called when I delete the object.</A></H2>
+There are several possible reasons for this.
+<P>
+The del statement does not necessarily call __del__ -- it simply
+decrements the object's reference count, and if this reaches zero
+__del__ is called.
+<P>
+If your data structures contain circular links (e.g. a tree where
+each child has a parent pointer and each parent has a list of
+children) the reference counts will never go back to zero.  You'll
+have to define an explicit close() method which removes those
+pointers.  Please don't ever call __del__ directly -- __del__ should
+call close() and close() should make sure that it can be called more
+than once for the same object.
+<P>
+If the object has ever been a local variable (or argument, which is
+really the same thing) to a function that caught an expression in an
+except clause, chances are that a reference to the object still exists
+in that function's stack frame as contained in the stack trace.
+Normally, deleting (better: assigning None to) sys.exc_traceback will
+take care of this.  If a stack was printed for an unhandled
+exception in an interactive interpreter, delete sys.last_traceback
+instead.
+<P>
+There is code that deletes all objects when the interpreter exits,
+but it is not called if your Python has been configured to support
+threads (because other threads may still be active).  You can define
+your own cleanup function using sys.exitfunc (see question 4.4).
+<P>
+Finally, if your __del__ method raises an exception, a warning message is printed to sys.stderr.
+<P>
+<P>
+Starting with Python 2.0, a garbage collector periodically reclaims the space used by most cycles with no external references. (See the "gc" module documentation for details.) There <I>are</I>, however, pathological cases where it can be expected to fail. Moreover, the garbage collector runs some time after the last reference to your data structure vanishes, so your __del__ method may be called at an inconvenient and random time. This is inconvenient if you're trying to reproduce a problem. Worse, the order in which object's __del__ methods are executed is arbitrary.
+<P>
+Another way to avoid cyclical references is to use the "weakref" module, which allows you to point to objects without incrementing their reference count. Tree data structures, for instance, should use weak references for their parent  and sibling pointers (if they need them!).
+<P>
+Question 6.14 is intended to explain the new garbage collection algorithm.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.017.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.017.htp">Log info</A>
+
+/ Last changed on Mon Jun 10 15:27:28 2002 by
+<A HREF="mailto:smurf@noris.de">Matthias Urlichs</A>
+<P>
+
+<HR>
+<H2><A NAME="4.18">4.18. How do I change the shell environment for programs called using os.popen() or os.system()? Changing os.environ doesn't work.</A></H2>
+You must be using either a version of python before 1.4, or on a
+(rare) system that doesn't have the putenv() library function.
+<P>
+Before Python 1.4, modifying the environment passed to subshells was
+left out of the interpreter because there seemed to be no
+well-established portable way to do it (in particular, some systems,
+have putenv(), others have setenv(), and some have none at all).  As
+of Python 1.4, almost all Unix systems <I>do</I> have putenv(), and so does
+the Win32 API, and thus the os module was modified so that changes to
+os.environ are trapped and the corresponding putenv() call is made.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.018.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.018.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="4.19">4.19. What is a class?</A></H2>
+A class is the particular object type created by executing
+a class statement.  Class objects are used as templates, to create
+instance objects, which embody both the data structure
+(attributes) and program routines (methods) specific to a datatype.
+<P>
+A class can be based on one or more other classes, called its base
+class(es). It then inherits the attributes and methods of its base classes. This allows an object model to be successively refined
+by inheritance.
+<P>
+The term "classic class" is used to refer to the original
+class implementation in Python. One problem with classic
+classes is their inability to use the built-in data types
+(such as list and dictionary) as base classes. Starting
+with Python 2.2 an attempt is in progress to unify user-defined
+classes and built-in types. It is now possible to declare classes
+that inherit from built-in types.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.019.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.019.htp">Log info</A>
+
+/ Last changed on Mon May 27 01:31:21 2002 by
+<A HREF="mailto:sholden@holdenweb.com">Steve Holden</A>
+<P>
+
+<HR>
+<H2><A NAME="4.20">4.20. What is a method?</A></H2>
+A method is a function that you normally call as
+x.name(arguments...) for some object x.  The term is used for methods
+of classes and class instances as well as for methods of built-in
+objects.  (The latter have a completely different implementation and
+only share the way their calls look in Python code.)  Methods of
+classes (and class instances) are defined as functions inside the
+class definition.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.020.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.020.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="4.21">4.21. What is self?</A></H2>
+Self is merely a conventional name for the first argument of a
+method -- i.e. a function defined inside a class definition.  A method
+defined as meth(self, a, b, c) should be called as x.meth(a, b, c) for
+some instance x of the class in which the definition occurs;
+the called method will think it is called as meth(x, a, b, c).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.021.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.021.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="4.22">4.22. What is an unbound method?</A></H2>
+An unbound method is a method defined in a class that is not yet
+bound to an instance.  You get an unbound method if you ask for a
+class attribute that happens to be a function. You get a bound method
+if you ask for an instance attribute.  A bound method knows which
+instance it belongs to and calling it supplies the instance automatically;
+an unbound method only knows which class it wants for its first
+argument (a derived class is also OK).  Calling an unbound method
+doesn't "magically" derive the first argument from the context -- you
+have to provide it explicitly.
+<P>
+Trivia note regarding bound methods:  each reference to a bound
+method of a particular object creates a bound method object.  If you
+have two such references (a = inst.meth; b = inst.meth), they will
+compare equal (a == b) but are not the same (a is not b).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.022.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.022.htp">Log info</A>
+
+/ Last changed on Wed May  6 18:07:25 1998 by
+<A HREF="mailto:clarence@avtel.com">Clarence Gardner</A>
+<P>
+
+<HR>
+<H2><A NAME="4.23">4.23. How do I call a method defined in a base class from a derived class that overrides it?</A></H2>
+If your class definition starts with "class Derived(Base): ..."
+then you can call method meth defined in Base (or one of Base's base
+classes) as Base.meth(self, arguments...).  Here, Base.meth is an
+unbound method (see previous question).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.023.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.023.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="4.24">4.24. How do I call a method from a base class without using the name of the base class?</A></H2>
+DON'T DO THIS.  REALLY.  I MEAN IT.  It appears that you could call
+self.__class__.__bases__[0].meth(self, arguments...) but this fails when
+a doubly-derived method is derived from your class: for its instances,
+self.__class__.__bases__[0] is your class, not its base class -- so
+(assuming you are doing this from within Derived.meth) you would start
+a recursive call.
+<P>
+Often when you want to do this you are forgetting that classes
+are first class in Python.  You can "point to" the class you want
+to delegate an operation to either at the instance or at the
+subclass level.  For example if you want to use a "glorp"
+operation of a superclass you can point to the right superclass
+to use.
+<P>
+<PRE>
+  class subclass(superclass1, superclass2, superclass3):
+      delegate_glorp = superclass2
+      ...
+      def glorp(self, arg1, arg2):
+            ... subclass specific stuff ...
+            self.delegate_glorp.glorp(self, arg1, arg2)
+       ...
+</PRE>
+<PRE>
+  class subsubclass(subclass):
+       delegate_glorp = superclass3
+       ...
+</PRE>
+Note, however that setting delegate_glorp to subclass in
+subsubclass would cause an infinite recursion on subclass.delegate_glorp.  Careful!  Maybe you are getting too fancy for your own good.  Consider simplifying the design (?).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.024.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.024.htp">Log info</A>
+
+/ Last changed on Mon Jul 28 13:58:22 1997 by
+<A HREF="mailto:aaron_watters@msn.com">aaron watters</A>
+<P>
+
+<HR>
+<H2><A NAME="4.25">4.25. How can I organize my code to make it easier to change the base class?</A></H2>
+You could define an alias for the base class, assign the real base
+class to it before your class definition, and use the alias throughout
+your class.  Then all you have to change is the value assigned to the
+alias.  Incidentally, this trick is also handy if you want to decide
+dynamically (e.g. depending on availability of resources) which base
+class to use.  Example:
+<P>
+<PRE>
+        BaseAlias = &lt;real base class&gt;
+        class Derived(BaseAlias):
+                def meth(self):
+                        BaseAlias.meth(self)
+                        ...
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.025.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.025.htp">Log info</A>
+
+/ Last changed on Wed May 21 15:49:57 1997 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.26">4.26. How can I find the methods or attributes of an object?</A></H2>
+This depends on the object type.
+<P>
+For an instance x of a user-defined class, instance attributes are
+found in the dictionary x.__dict__, and methods and attributes defined
+by its class are found in x.__class__.__bases__[i].__dict__ (for i in
+range(len(x.__class__.__bases__))).  You'll have to walk the tree of
+base classes to find <I>all</I> class methods and attributes.
+<P>
+Many, but not all built-in types define a list of their method names
+in x.__methods__, and if they have data attributes, their names may be
+found in x.__members__.  However this is only a convention.
+<P>
+For more information, read the source of the standard (but
+undocumented) module newdir.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.026.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.026.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="4.27">4.27. I can't seem to use os.read() on a pipe created with os.popen().</A></H2>
+os.read() is a low-level function which takes a file descriptor (a
+small integer).  os.popen() creates a high-level file object -- the
+same type used for sys.std{in,out,err} and returned by the builtin
+open() function.  Thus, to read n bytes from a pipe p created with
+os.popen(), you need to use p.read(n).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.027.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.027.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="4.28">4.28. How can I create a stand-alone binary from a Python script?</A></H2>
+Even though there are Python compilers being developed,
+you probably don't need a <I>real</I> compiler, if all you want
+is a stand-alone program. There are three solutions to that. 
+<P>
+One is to use the freeze tool, which is included in the Python
+source tree as Tools/freeze. It converts Python byte
+code to C arrays.  Using a C compiler, you can embed all
+your modules into a new program, which is then linked
+with the standard Python modules. 
+<P>
+It works by scanning your source recursively for import statements
+(in both forms) and looking for the modules in the standard Python path
+as well as in the source directory (for built-in modules).  It then
+1 the modules written in Python to C code (array initializers
+that can be turned into code objects using the marshal module) and
+creates a custom-made config file that only contains those built-in
+modules which are actually used in the program.  It then compiles the
+generated C code and links it with the rest of the Python interpreter
+to form a self-contained binary which acts exactly like your script.
+<P>
+(Hint: the freeze program only works if your script's filename ends in
+".py".)
+<P>
+There are several utilities which may be helpful.  The first is Gordon McMillan's installer at
+<P>
+<PRE>
+    <A HREF="http://www.mcmillan-inc.com/install1.html">http://www.mcmillan-inc.com/install1.html</A>
+</PRE>
+which works on Windows, Linux and at least some forms of Unix.
+<P>
+Another is Thomas Heller's py2exe (Windows only) at
+<P>
+<PRE>
+    <A HREF="http://starship.python.net/crew/theller/py2exe">http://starship.python.net/crew/theller/py2exe</A>/
+</PRE>
+A third is Christian Tismer's SQFREEZE
+(<A HREF="http://starship.python.net/crew/pirx">http://starship.python.net/crew/pirx</A>/) which appends the byte code
+to a specially-prepared Python interpreter, which
+will find the byte code in executable. 
+<P>
+A fourth is Fredrik Lundh's Squeeze
+(<A HREF="http://www.pythonware.com/products/python/squeeze">http://www.pythonware.com/products/python/squeeze</A>/).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.028.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.028.htp">Log info</A>
+
+/ Last changed on Wed Jun 19 14:01:30 2002 by
+<A HREF="mailto:gmcm@hypernet.com">Gordon McMillan</A>
+<P>
+
+<HR>
+<H2><A NAME="4.29">4.29. What WWW tools are there for Python?</A></H2>
+See the chapters titled "Internet Protocols and Support" and
+"Internet Data Handling" in the Library Reference
+Manual. Python is full of good things which will help you build server-side and client-side web systems.
+<P>
+A summary of available frameworks is maintained by Paul Boddie at
+<P>
+<PRE>
+    <A HREF="http://thor.prohosting.com/~pboddie/Python/web_modules.html">http://thor.prohosting.com/~pboddie/Python/web_modules.html</A>
+</PRE>
+Cameron Laird maintains a useful set of pages about Python web technologies at
+<P>
+<PRE>
+   <A HREF="http://starbase.neosoft.com/~claird/comp.lang.python/web_python.html">http://starbase.neosoft.com/~claird/comp.lang.python/web_python.html</A>/
+</PRE>
+There was a web browser written in Python, called Grail --
+see <A HREF="http://sourceforge.net/project/grail">http://sourceforge.net/project/grail</A>/. This project has been terminated; <A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/grail/grail/README">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/grail/grail/README</A> gives more details.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.029.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.029.htp">Log info</A>
+
+/ Last changed on Mon Nov 11 22:48:25 2002 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.30">4.30. How do I run a subprocess with pipes connected to both input and output?</A></H2>
+Use the standard popen2 module.  For example:
+<P>
+<PRE>
+	import popen2
+	fromchild, tochild = popen2.popen2("command")
+	tochild.write("input\n")
+	tochild.flush()
+	output = fromchild.readline()
+</PRE>
+Warning: in general, it is unwise to
+do this, because you can easily cause a deadlock where your
+process is blocked waiting for output from the child, while the child
+is blocked waiting for input from you.  This can be caused
+because the parent expects the child to output more text than it does,
+or it can be caused by data being stuck in stdio buffers due to lack
+of flushing.  The Python parent can of course explicitly flush the data
+it sends to the child before it reads any output, but if the child is
+a naive C program it can easily have been written to never explicitly
+flush its output, even if it is interactive, since flushing is
+normally automatic.
+<P>
+Note that a deadlock is also possible if you use popen3 to read
+stdout and stderr. If one of the two is too large for the internal
+buffer (increasing the buffersize does not help) and you read()
+the other one first, there is a deadlock, too.
+<P>
+Note on a bug in popen2: unless your program calls wait()
+or waitpid(), finished child processes are never removed,
+and eventually calls to popen2 will fail because of a limit on
+the number of child processes.  Calling os.waitpid with the
+os.WNOHANG option can prevent this; a good place to insert such
+a call would be before calling popen2 again.
+<P>
+Another way to produce a deadlock: Call a wait() and there is
+still more output from the program than what fits into the 
+internal buffers.
+<P>
+In many cases, all you really need is to run some data through a
+command and get the result back.  Unless the data is infinite in size,
+the easiest (and often the most efficient!) way to do this is to write
+it to a temporary file and run the command with that temporary file as
+input.  The standard module tempfile exports a function mktemp() which
+generates unique temporary file names.
+<P>
+<PRE>
+ import tempfile
+ import os
+ class Popen3:
+    """
+    This is a deadlock-save version of popen, that returns
+    an object with errorlevel, out (a string) and err (a string).
+    (capturestderr may not work under windows.)
+    Example: print Popen3('grep spam','\n\nhere spam\n\n').out
+    """
+    def __init__(self,command,input=None,capturestderr=None):
+        outfile=tempfile.mktemp()
+        command="( %s ) > %s" % (command,outfile)
+        if input:
+            infile=tempfile.mktemp()
+            open(infile,"w").write(input)
+            command=command+" &lt;"+infile
+        if capturestderr:
+            errfile=tempfile.mktemp()
+            command=command+" 2>"+errfile
+        self.errorlevel=os.system(command) >> 8
+        self.out=open(outfile,"r").read()
+        os.remove(outfile)
+        if input:
+            os.remove(infile)
+        if capturestderr:
+            self.err=open(errfile,"r").read()
+            os.remove(errfile)
+</PRE>
+Note that many interactive programs (e.g. vi) don't work well with
+pipes substituted for standard input and output.  You will have to use
+pseudo ttys ("ptys") instead of pipes.  There is some undocumented
+code to use these in the library module pty.py -- I'm afraid you're on
+your own here.
+<P>
+A different answer is a Python interface to Don Libes' "expect"
+library.  A Python extension that interfaces to expect is called "expy"
+and available from
+<A HREF="http://expectpy.sourceforge.net">http://expectpy.sourceforge.net</A>/.
+<P>
+A pure Python solution that works like expect is pexpect of Noah Spurrier.
+A beta version is available from
+<A HREF="http://pexpect.sourceforge.net">http://pexpect.sourceforge.net</A>/
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.030.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.030.htp">Log info</A>
+
+/ Last changed on Tue Sep  3 16:31:31 2002 by
+<A HREF="mailto:polzin@gmx.de">Tobias Polzin</A>
+<P>
+
+<HR>
+<H2><A NAME="4.31">4.31. How do I call a function if I have the arguments in a tuple?</A></H2>
+Use the built-in function apply().  For instance,
+<P>
+<PRE>
+    func(1, 2, 3)
+</PRE>
+is equivalent to
+<P>
+<PRE>
+    args = (1, 2, 3)
+    apply(func, args)
+</PRE>
+Note that func(args) is not the same -- it calls func() with exactly
+one argument, the tuple args, instead of three arguments, the integers
+1, 2 and 3.
+<P>
+In Python 2.0, you can also use extended call syntax:
+<P>
+f(*args) is equivalent to apply(f, args)
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.031.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.031.htp">Log info</A>
+
+/ Last changed on Tue Jan  2 03:42:50 2001 by
+<A HREF="mailto:moshez@zadka.site.co.il">Moshe Zadka</A>
+<P>
+
+<HR>
+<H2><A NAME="4.32">4.32. How do I enable font-lock-mode for Python in Emacs?</A></H2>
+If you are using XEmacs 19.14 or later, any XEmacs 20, FSF Emacs 19.34
+or any Emacs 20, font-lock should work automatically for you if you
+are using the latest python-mode.el.
+<P>
+If you are using an older version of XEmacs or Emacs you will need 
+to put this in your .emacs file:
+<P>
+<PRE>
+        (defun my-python-mode-hook ()
+          (setq font-lock-keywords python-font-lock-keywords)
+          (font-lock-mode 1))
+        (add-hook 'python-mode-hook 'my-python-mode-hook)
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.032.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.032.htp">Log info</A>
+
+/ Last changed on Mon Apr  6 16:18:46 1998 by
+<A HREF="mailto:bwarsaw@python.org">Barry Warsaw</A>
+<P>
+
+<HR>
+<H2><A NAME="4.33">4.33. Is there a scanf() or sscanf() equivalent?</A></H2>
+Not as such.
+<P>
+For simple input parsing, the easiest approach is usually to split
+the line into whitespace-delimited words using string.split(), and to
+convert decimal strings to numeric values using int(),
+long() or float().  (Python's int() is 32-bit and its
+long() is arbitrary precision.)  string.split supports an optional
+"sep" parameter which is useful if the line uses something other
+than whitespace as a delimiter.
+<P>
+For more complicated input parsing, regular expressions (see module re)
+are better suited and more powerful than C's sscanf().
+<P>
+There's a contributed module that emulates sscanf(), by Steve Clift;
+see contrib/Misc/sscanfmodule.c of the ftp site:
+<P>
+<PRE>
+    <A HREF="http://www.python.org/ftp/python/contrib-09-Dec-1999/Misc">http://www.python.org/ftp/python/contrib-09-Dec-1999/Misc</A>/
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.033.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.033.htp">Log info</A>
+
+/ Last changed on Mon Jun  3 01:07:51 2002 by
+<A HREF="mailto:neal@metaslash.com">Neal Norwitz</A>
+<P>
+
+<HR>
+<H2><A NAME="4.34">4.34. Can I have Tk events handled while waiting for I/O?</A></H2>
+Yes, and you don't even need threads!  But you'll have to
+restructure your I/O code a bit.  Tk has the equivalent of Xt's
+XtAddInput() call, which allows you to register a callback function
+which will be called from the Tk mainloop when I/O is possible on a
+file descriptor.  Here's what you need:
+<P>
+<PRE>
+        from Tkinter import tkinter
+        tkinter.createfilehandler(file, mask, callback)
+</PRE>
+The file may be a Python file or socket object (actually, anything
+with a fileno() method), or an integer file descriptor.  The mask is
+one of the constants tkinter.READABLE or tkinter.WRITABLE.  The
+callback is called as follows:
+<P>
+<PRE>
+        callback(file, mask)
+</PRE>
+You must unregister the callback when you're done, using
+<P>
+<PRE>
+        tkinter.deletefilehandler(file)
+</PRE>
+Note: since you don't know *how many bytes* are available for reading,
+you can't use the Python file object's read or readline methods, since
+these will insist on reading a predefined number of bytes.  For
+sockets, the recv() or recvfrom() methods will work fine; for other
+files, use os.read(file.fileno(), maxbytecount).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.034.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.034.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="4.35">4.35. How do I write a function with output parameters (call by reference)?</A></H2>
+[Mark Lutz] The thing to remember is that arguments are passed by
+assignment in Python.  Since assignment just creates references to
+objects, there's no alias between an argument name in the caller and
+callee, and so no call-by-reference per se.  But you can simulate it
+in a number of ways:
+<P>
+1) By using global variables; but you probably shouldn't :-)
+<P>
+2) By passing a mutable (changeable in-place) object:
+<P>
+<PRE>
+      def func1(a):
+          a[0] = 'new-value'     # 'a' references a mutable list
+          a[1] = a[1] + 1        # changes a shared object
+</PRE>
+<PRE>
+      args = ['old-value', 99]
+      func1(args)
+      print args[0], args[1]     # output: new-value 100
+</PRE>
+3) By returning a tuple, holding the final values of arguments:
+<P>
+<PRE>
+      def func2(a, b):
+          a = 'new-value'        # a and b are local names
+          b = b + 1              # assigned to new objects
+          return a, b            # return new values
+</PRE>
+<PRE>
+      x, y = 'old-value', 99
+      x, y = func2(x, y)
+      print x, y                 # output: new-value 100
+</PRE>
+4) And other ideas that fall-out from Python's object model. For instance, it might be clearer to pass in a mutable dictionary:
+<P>
+<PRE>
+      def func3(args):
+          args['a'] = 'new-value'     # args is a mutable dictionary
+          args['b'] = args['b'] + 1   # change it in-place
+</PRE>
+<PRE>
+      args = {'a':' old-value', 'b': 99}
+      func3(args)
+      print args['a'], args['b']
+</PRE>
+5) Or bundle-up values in a class instance:
+<P>
+<PRE>
+      class callByRef:
+          def __init__(self, **args):
+              for (key, value) in args.items():
+                  setattr(self, key, value)
+</PRE>
+<PRE>
+      def func4(args):
+          args.a = 'new-value'        # args is a mutable callByRef
+          args.b = args.b + 1         # change object in-place
+</PRE>
+<PRE>
+      args = callByRef(a='old-value', b=99)
+      func4(args)
+      print args.a, args.b
+</PRE>
+<PRE>
+   But there's probably no good reason to get this complicated :-).
+</PRE>
+[Python's author favors solution 3 in most cases.]
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.035.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.035.htp">Log info</A>
+
+/ Last changed on Sun Jun  8 23:49:46 1997 by
+<A HREF="mailto:david_ascher@brown.edu">David Ascher</A>
+<P>
+
+<HR>
+<H2><A NAME="4.36">4.36. Please explain the rules for local and global variables in Python.</A></H2>
+[Ken Manheimer] In Python, procedure variables are implicitly
+global, unless they are assigned anywhere within the block.
+In that case
+they are implicitly local, and you need to explicitly declare them as
+'global'.
+<P>
+Though a bit surprising at first, a moment's consideration explains
+this.  On one hand, requirement of 'global' for assigned vars provides
+a bar against unintended side-effects.  On the other hand, if global
+were required for all global references, you'd be using global all the
+time.  Eg, you'd have to declare as global every reference to a
+builtin function, or to a component of an imported module.  This
+clutter would defeat the usefulness of the 'global' declaration for
+identifying side-effects.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.036.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.036.htp">Log info</A>
+
+/ Last changed on Fri Aug 28 09:53:27 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.37">4.37. How can I have modules that mutually import each other?</A></H2>
+Suppose you have the following modules:
+<P>
+foo.py:
+<P>
+<PRE>
+	from bar import bar_var
+	foo_var=1
+</PRE>
+bar.py:
+<P>
+<PRE>
+	from foo import foo_var
+	bar_var=2
+</PRE>
+The problem is that the above is processed by the interpreter thus:
+<P>
+<PRE>
+	main imports foo
+	Empty globals for foo are created
+	foo is compiled and starts executing
+	foo imports bar
+	Empty globals for bar are created
+	bar is compiled and starts executing
+	bar imports foo (which is a no-op since there already is a module named foo)
+	bar.foo_var = foo.foo_var
+	...
+</PRE>
+The last step fails, because Python isn't done with interpreting foo yet and the global symbol dict for foo is still empty.
+<P>
+The same thing happens when you use "import foo", and then try to access "foo.one" in global code.
+<P>
+<P>
+There are (at least) three possible workarounds for this problem. 
+<P>
+Guido van Rossum recommends to avoid all uses of "from &lt;module&gt; import ..." (so everything from an imported module is referenced as &lt;module&gt;.&lt;name&gt;) and to place all code inside functions. Initializations of global variables and class variables should use constants or built-in functions only.
+<P>
+<P>
+Jim Roskind suggests the following order in each module:
+<P>
+<PRE>
+ exports (globals, functions, and classes that don't need imported base classes)
+ import statements
+ active code (including globals that are initialized from imported values).
+</PRE>
+Python's author doesn't like this approach much because the imports
+appear in a strange place, but has to admit that it works.
+<P>
+<P>
+<P>
+Matthias Urlichs recommends to restructure your code so that the recursive import is not necessary in the first place.
+<P>
+<P>
+These solutions are not mutually exclusive.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.037.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.037.htp">Log info</A>
+
+/ Last changed on Mon Jun  3 06:52:51 2002 by
+<A HREF="mailto:smurf@noris.de">Matthias Urlichs</A>
+<P>
+
+<HR>
+<H2><A NAME="4.38">4.38. How do I copy an object in Python?</A></H2>
+Try copy.copy() or copy.deepcopy() for the general case. Not all objects can be copied, but most can.
+<P>
+Dictionaries have a copy method. Sequences can be copied by slicing:
+<PRE>
+ new_l = l[:]
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.038.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.038.htp">Log info</A>
+
+/ Last changed on Thu Mar 21 05:40:26 2002 by
+<A HREF="mailto:erno-pyfaq@erno.iki.fi">Erno Kuusela</A>
+<P>
+
+<HR>
+<H2><A NAME="4.39">4.39. How to implement persistent objects in Python? (Persistent == automatically saved to and restored from disk.)</A></H2>
+The library module "pickle" now solves this in a very general way
+(though you still can't store things like open files, sockets or
+windows), and the library module "shelve" uses pickle and (g)dbm to
+create persistent mappings containing arbitrary Python objects.
+For possibly better performance also look for the latest version
+of the relatively recent cPickle module.
+<P>
+A more awkward way of doing things is to use pickle's little sister,
+marshal.  The marshal module provides very fast ways to store
+noncircular basic Python types to files and strings, and back again.
+Although marshal does not do fancy things like store instances or
+handle shared references properly, it does run extremely fast.  For
+example loading a half megabyte of data may take less than a
+third of a second (on some machines).  This often beats doing
+something more complex and general such as using gdbm with
+pickle/shelve.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.039.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.039.htp">Log info</A>
+
+/ Last changed on Sun Jun  8 22:59:00 1997 by
+<A HREF="mailto:david_ascher@brown.edu">David Ascher</A>
+<P>
+
+<HR>
+<H2><A NAME="4.40">4.40. I try to use __spam and I get an error about _SomeClassName__spam.</A></H2>
+Variables with double leading underscore are "mangled" to provide a
+simple but effective way to define class private variables.  See the
+chapter "New in Release 1.4" in the Python Tutorial.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.040.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.040.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="4.41">4.41. How do I delete a file? And other file questions.</A></H2>
+Use os.remove(filename) or os.unlink(filename); for documentation,
+see the posix section of the library manual.  They are the same,
+unlink() is simply the Unix name for this function.  In earlier
+versions of Python, only os.unlink() was available.
+<P>
+To remove a directory, use os.rmdir(); use os.mkdir() to create one.
+<P>
+To rename a file, use os.rename().
+<P>
+To truncate a file, open it using f = open(filename, "r+"), and use
+f.truncate(offset); offset defaults to the current seek position.
+(The "r+" mode opens the file for reading and writing.)
+There's also os.ftruncate(fd, offset) for files opened with os.open()
+-- for advanced Unix hacks only.
+<P>
+The shutil module also contains a number of functions to work on files
+including copyfile, copytree, and rmtree amongst others.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.041.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.041.htp">Log info</A>
+
+/ Last changed on Thu Dec 28 12:30:01 2000 by
+<A HREF="mailto:pbjorn@uswest.net">Bjorn Pettersen</A>
+<P>
+
+<HR>
+<H2><A NAME="4.42">4.42. How to modify urllib or httplib to support HTTP/1.1?</A></H2>
+Recent versions of Python (2.0 and onwards) support HTTP/1.1 natively.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.042.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.042.htp">Log info</A>
+
+/ Last changed on Tue Jan  2 02:56:56 2001 by
+<A HREF="mailto:moshez@zadka.site.co.il">Moshe Zadka</A>
+<P>
+
+<HR>
+<H2><A NAME="4.43">4.43. Unexplicable syntax errors in compile() or exec.</A></H2>
+When a statement suite (as opposed to an expression) is compiled by
+compile(), exec or execfile(), it <I>must</I> end in a newline.  In some
+cases, when the source ends in an indented block it appears that at
+least two newlines are required.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.043.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.043.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="4.44">4.44. How do I convert a string to a number?</A></H2>
+For integers, use the built-in int() function, e.g. int('144') == 144.  Similarly, long() converts from string to long integer, e.g. long('144') == 144L; and float() to floating-point, e.g. float('144') == 144.0.
+<P>
+Note that these are restricted to decimal interpretation, so 
+that int('0144') == 144 and int('0x144') raises ValueError. For Python
+2.0 int takes the base to convert from as a second optional argument, so
+int('0x144', 16) == 324.
+<P>
+For greater flexibility, or before Python 1.5, import the module 
+string and use the string.atoi() function for integers, 
+string.atol() for long integers, or string.atof() for 
+floating-point.  E.g., 
+string.atoi('100', 16) == string.atoi('0x100', 0) == 256.  
+See the library reference manual section for the string module for 
+more details.
+<P>
+While you could use the built-in function eval() instead of
+any of those, this is not recommended, because someone could pass you
+a Python expression that might have unwanted side effects (like
+reformatting your disk). It also has the effect of interpreting numbers
+as Python expressions, so that e.g. eval('09') gives a syntax error
+since Python regards numbers starting with '0' as octal (base 8).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.044.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.044.htp">Log info</A>
+
+/ Last changed on Thu Dec 28 12:37:34 2000 by
+<A HREF="mailto:pbjorn@uswest.net">Bjorn Pettersen</A>
+<P>
+
+<HR>
+<H2><A NAME="4.45">4.45. How do I convert a number to a string?</A></H2>
+To convert, e.g., the number 144 to the string '144', use the
+built-in function repr() or the backquote notation (these are
+equivalent).  If you want a hexadecimal or octal representation, use
+the built-in functions hex() or oct(), respectively.  For fancy
+formatting, use the % operator on strings, just like C printf formats,
+e.g. "%04d" % 144 yields '0144' and "%.3f" % (1/3.0) yields '0.333'.
+See the library reference manual for details.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.045.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.045.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="4.46">4.46. How do I copy a file?</A></H2>
+There's the shutil module which contains a copyfile()
+function that implements a copy loop;
+it isn't good enough for the Macintosh, though:
+it doesn't copy the resource fork and Finder info.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.046.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.046.htp">Log info</A>
+
+/ Last changed on Tue Jan  2 02:59:40 2001 by
+<A HREF="mailto:moshez@zadka.site.co.il">Moshe Zadka</A>
+<P>
+
+<HR>
+<H2><A NAME="4.47">4.47. How do I check if an object is an instance of a given class or of a subclass of it?</A></H2>
+If you are developing the classes from scratch it might be better to
+program in a more proper object-oriented style -- instead of doing a different
+thing based on class membership, why not use a method and define the
+method differently in different classes?
+<P>
+However, there are some legitimate situations
+where you need to test for class membership.
+<P>
+In Python 1.5, you can use the built-in function isinstance(obj, cls).
+<P>
+The following approaches can be used with earlier Python versions:
+<P>
+An unobvious method is to raise the object
+as an exception and to try to catch the exception with the class you're
+testing for:
+<P>
+<PRE>
+	def is_instance_of(the_instance, the_class):
+	    try:
+		raise the_instance
+	    except the_class:
+		return 1
+	    except:
+		return 0
+</PRE>
+This technique can be used to distinguish "subclassness"
+from a collection of classes as well
+<P>
+<PRE>
+                try:
+                              raise the_instance
+                except Audible:
+                              the_instance.play(largo)
+                except Visual:
+                              the_instance.display(gaudy)
+                except Olfactory:
+                              sniff(the_instance)
+                except:
+                              raise ValueError, "dunno what to do with this!"
+</PRE>
+This uses the fact that exception catching tests for class or subclass
+membership.
+<P>
+A different approach is to test for the presence of a class attribute that
+is presumably unique for the given class.  For instance:
+<P>
+<PRE>
+	class MyClass:
+	    ThisIsMyClass = 1
+	    ...
+</PRE>
+<PRE>
+	def is_a_MyClass(the_instance):
+	    return hasattr(the_instance, 'ThisIsMyClass')
+</PRE>
+This version is easier to inline, and probably faster (inlined it
+is definitely faster).  The disadvantage is that someone else could cheat:
+<P>
+<PRE>
+	class IntruderClass:
+	    ThisIsMyClass = 1    # Masquerade as MyClass
+	    ...
+</PRE>
+but this may be seen as a feature (anyway, there are plenty of other ways
+to cheat in Python).  Another disadvantage is that the class must be
+prepared for the membership test.  If you do not "control the
+source code" for the class it may not be advisable to modify the
+class to support testability.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.047.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.047.htp">Log info</A>
+
+/ Last changed on Fri Jan  2 15:16:04 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.48">4.48. What is delegation?</A></H2>
+Delegation refers to an object oriented technique Python programmers
+may implement with particular ease.  Consider the following:
+<P>
+<PRE>
+  from string import upper
+</PRE>
+<PRE>
+  class UpperOut:
+        def __init__(self, outfile):
+              self.__outfile = outfile
+        def write(self, str):
+              self.__outfile.write( upper(str) )
+        def __getattr__(self, name):
+              return getattr(self.__outfile, name)
+</PRE>
+Here the UpperOut class redefines the write method
+to convert the argument string to upper case before
+calling the underlying self.__outfile.write method, but
+all other methods are delegated to the underlying 
+self.__outfile object.  The delegation is accomplished
+via the "magic" __getattr__ method.  Please see the
+language reference for more information on the use
+of this method.
+<P>
+Note that for more general cases delegation can
+get trickier. Particularly when attributes must be set
+as well as gotten the class must define a __settattr__
+method too, and it must do so carefully.
+<P>
+The basic implementation of __setattr__ is roughly
+equivalent to the following:
+<P>
+<PRE>
+   class X:
+        ...
+        def __setattr__(self, name, value):
+             self.__dict__[name] = value
+        ...
+</PRE>
+Most __setattr__ implementations must modify
+self.__dict__ to store local state for self without
+causing an infinite recursion.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.048.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.048.htp">Log info</A>
+
+/ Last changed on Wed Aug 13 07:11:24 1997 by
+<A HREF="mailto:aaron_watters@msn.com">aaron watters</A>
+<P>
+
+<HR>
+<H2><A NAME="4.49">4.49. How do I test a Python program or component.</A></H2>
+We presume for the purposes of this question you are interested
+in standalone testing, rather than testing your components inside
+a testing framework. The best-known testing framework for Python
+is the PyUnit module, maintained at
+<P>
+<PRE>
+    <A HREF="http://pyunit.sourceforge.net">http://pyunit.sourceforge.net</A>/
+</PRE>
+For standalone testing, it helps to write the program so that
+it may be easily tested by using good modular design.
+In particular your program
+should have almost all functionality encapsulated in either functions
+or class methods -- and this sometimes has the surprising and
+delightful effect of making the program run faster (because
+local variable accesses are faster than global accesses).
+Furthermore the program should avoid depending on mutating
+global variables, since this makes testing much more difficult to do.
+<P>
+The "global main logic" of your program may be as simple
+as
+<P>
+<PRE>
+  if __name__=="__main__":
+       main_logic()
+</PRE>
+at the bottom of the main module of your program.
+<P>
+Once your program is organized as a tractable collection
+of functions and class behaviours you should write test
+functions that exercise the behaviours.  A test suite 
+can be associated with each module which automates
+a sequence of tests.  This sounds like a lot of work, but
+since Python is so terse and flexible it's surprisingly easy.
+You can make coding much more pleasant and fun by
+writing your test functions in parallel with the "production
+code", since this makes it easy to find bugs and even
+design flaws earlier.
+<P>
+"Support modules" that are not intended to be the main
+module of a program may include a "test script interpretation"
+which invokes a self test of the module.
+<P>
+<PRE>
+   if __name__ == "__main__":
+      self_test()
+</PRE>
+Even programs that interact with complex external
+interfaces may be tested when the external interfaces are
+unavailable by using "fake" interfaces implemented in
+Python.  For an example of a "fake" interface, the following
+class defines (part of) a "fake" file interface:
+<P>
+<PRE>
+ import string
+ testdata = "just a random sequence of characters"
+</PRE>
+<PRE>
+ class FakeInputFile:
+   data = testdata
+   position = 0
+   closed = 0
+</PRE>
+<PRE>
+   def read(self, n=None):
+       self.testclosed()
+       p = self.position
+       if n is None:
+          result= self.data[p:]
+       else:
+          result= self.data[p: p+n]
+       self.position = p + len(result)
+       return result
+</PRE>
+<PRE>
+   def seek(self, n, m=0):
+       self.testclosed()
+       last = len(self.data)
+       p = self.position
+       if m==0: 
+          final=n
+       elif m==1:
+          final=n+p
+       elif m==2:
+          final=len(self.data)+n
+       else:
+          raise ValueError, "bad m"
+       if final&lt;0:
+          raise IOError, "negative seek"
+       self.position = final
+</PRE>
+<PRE>
+   def isatty(self):
+       return 0
+</PRE>
+<PRE>
+   def tell(self):
+       return self.position
+</PRE>
+<PRE>
+   def close(self):
+       self.closed = 1
+</PRE>
+<PRE>
+   def testclosed(self):
+       if self.closed:
+          raise IOError, "file closed"
+</PRE>
+Try f=FakeInputFile() and test out its operations.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.049.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.049.htp">Log info</A>
+
+/ Last changed on Mon Jun  3 01:12:10 2002 by
+<A HREF="mailto:neal@metaslash.com">Neal Norwitz</A>
+<P>
+
+<HR>
+<H2><A NAME="4.50">4.50. My multidimensional list (array) is broken! What gives?</A></H2>
+You probably tried to make a multidimensional array like this.
+<P>
+<PRE>
+   A = [[None] * 2] * 3
+</PRE>
+This makes a list containing 3 references to the same list of length
+two.  Changes to one row will show in all rows, which is probably not
+what you want.  The following works much better:
+<P>
+<PRE>
+   A = [None]*3
+   for i in range(3):
+        A[i] = [None] * 2
+</PRE>
+This generates a list containing 3 different lists of length two.
+<P>
+If you feel weird, you can also do it in the following way:
+<P>
+<PRE>
+   w, h = 2, 3
+   A = map(lambda i,w=w: [None] * w, range(h))
+</PRE>
+For Python 2.0 the above can be spelled using a list comprehension:
+<P>
+<PRE>
+   w,h = 2,3
+   A = [ [None]*w for i in range(h) ]
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.050.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.050.htp">Log info</A>
+
+/ Last changed on Thu Dec 28 12:18:35 2000 by
+<A HREF="mailto:pbjorn@uswest.net">Bjorn Pettersen</A>
+<P>
+
+<HR>
+<H2><A NAME="4.51">4.51. I want to do a complicated sort: can you do a Schwartzian Transform in Python?</A></H2>
+Yes, and in Python you only have to write it once:
+<P>
+<PRE>
+ def st(List, Metric):
+     def pairing(element, M = Metric):
+           return (M(element), element)
+     paired = map(pairing, List)
+     paired.sort()
+     return map(stripit, paired)
+</PRE>
+<PRE>
+ def stripit(pair):
+     return pair[1]
+</PRE>
+This technique, attributed to Randal Schwartz, sorts the elements
+of a list by a metric which maps each element to its "sort value".
+For example, if L is a list of string then
+<P>
+<PRE>
+   import string
+   Usorted = st(L, string.upper)
+</PRE>
+<PRE>
+   def intfield(s):
+         return string.atoi( string.strip(s[10:15] ) )
+</PRE>
+<PRE>
+   Isorted = st(L, intfield)
+</PRE>
+Usorted gives the elements of L sorted as if they were upper
+case, and Isorted gives the elements of L sorted by the integer
+values that appear in the string slices starting at position 10
+and ending at position 15. In Python 2.0 this can be done more
+naturally with list comprehensions:
+<P>
+<PRE>
+  tmp1 = [ (x.upper(), x) for x in L ] # Schwartzian transform
+  tmp1.sort()
+  Usorted = [ x[1] for x in tmp1 ]
+</PRE>
+<PRE>
+  tmp2 = [ (int(s[10:15]), s) for s in L ] # Schwartzian transform
+  tmp2.sort()
+  Isorted = [ x[1] for x in tmp2 ]
+</PRE>
+<P>
+Note that Isorted may also be computed by
+<P>
+<PRE>
+   def Icmp(s1, s2):
+         return cmp( intfield(s1), intfield(s2) )
+</PRE>
+<PRE>
+   Isorted = L[:]
+   Isorted.sort(Icmp)
+</PRE>
+but since this method computes intfield many times for each
+element of L, it is slower than the Schwartzian Transform.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.051.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.051.htp">Log info</A>
+
+/ Last changed on Sat Jun  1 19:18:46 2002 by
+<A HREF="mailto:neal@metaslash.com">Neal Norwitz</A>
+<P>
+
+<HR>
+<H2><A NAME="4.52">4.52. How to convert between tuples and lists?</A></H2>
+The function tuple(seq) converts any sequence into a tuple with
+the same items in the same order.
+For example, tuple([1, 2, 3]) yields (1, 2, 3) and tuple('abc')
+yields ('a', 'b', 'c').  If the argument is
+a tuple, it does not make a copy but returns the same object, so
+it is cheap to call tuple() when you aren't sure that an object
+is already a tuple.
+<P>
+The function list(seq) converts any sequence into a list with
+the same items in the same order.
+For example, list((1, 2, 3)) yields [1, 2, 3] and list('abc')
+yields ['a', 'b', 'c'].  If the argument is a list,
+it makes a copy just like seq[:] would.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.052.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.052.htp">Log info</A>
+
+/ Last changed on Sun Jun 14 14:18:53 1998 by
+<A HREF="mailto:tim_one@email.msn.com">Tim Peters</A>
+<P>
+
+<HR>
+<H2><A NAME="4.53">4.53. Files retrieved with urllib contain leading garbage that looks like email headers.</A></H2>
+<I>Extremely</I> old  versions of Python supplied libraries which
+did not support HTTP/1.1; the vanilla httplib in Python 1.4
+only recognized HTTP/1.0.  In Python 2.0 full HTTP/1.1 support is included.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.053.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.053.htp">Log info</A>
+
+/ Last changed on Mon Jan  8 17:26:18 2001 by
+<A HREF="mailto:sholden@holdenweb.com">Steve Holden</A>
+<P>
+
+<HR>
+<H2><A NAME="4.54">4.54. How do I get a list of all instances of a given class?</A></H2>
+Python does not keep track of all instances of a class (or of a
+built-in type).
+<P>
+You can program the class's constructor to keep track of all
+instances, but unless you're very clever, this has the disadvantage
+that the instances never get deleted,because your list of all
+instances keeps a reference to them.
+<P>
+(The trick is to regularly inspect the reference counts of the
+instances you've retained, and if the reference count is below a
+certain level, remove it from the list.  Determining that level is
+tricky -- it's definitely larger than 1.)
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.054.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.054.htp">Log info</A>
+
+/ Last changed on Tue May 27 23:52:16 1997 by
+<A HREF="mailto:guido@cnri.reston.va.us">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.55">4.55. A regular expression fails with regex.error: match failure.</A></H2>
+This is usually caused by too much backtracking; the regular
+expression engine has a fixed size stack which holds at most 4000
+backtrack points.  Every character matched by e.g. ".*" accounts for a
+backtrack point, so even a simple search like
+<P>
+<PRE>
+  regex.match('.*x',"x"*5000)
+</PRE>
+will fail.
+<P>
+This is fixed in the re module introduced with 
+Python 1.5; consult the Library Reference section on re for more information.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.055.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.055.htp">Log info</A>
+
+/ Last changed on Thu Jul 30 12:35:49 1998 by
+<A HREF="mailto:akuchlin@cnri.reston.va.us">A.M. Kuchling</A>
+<P>
+
+<HR>
+<H2><A NAME="4.56">4.56. I can't get signal handlers to work.</A></H2>
+The most common problem is that the signal handler is declared
+with the wrong argument list.  It is called as
+<P>
+<PRE>
+	handler(signum, frame)
+</PRE>
+so it should be declared with two arguments:
+<P>
+<PRE>
+	def handler(signum, frame):
+		...
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.056.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.056.htp">Log info</A>
+
+/ Last changed on Wed May 28 09:29:08 1997 by
+<A HREF="mailto:guido@cnri.reston.va.us">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.57">4.57. I can't use a global variable in a function? Help!</A></H2>
+Did you do something like this?
+<P>
+<PRE>
+   x = 1 # make a global
+</PRE>
+<PRE>
+   def f():
+         print x # try to print the global
+         ...
+         for j in range(100):
+              if q>3:
+                 x=4
+</PRE>
+Any variable assigned in a function is local to that function.
+unless it is specifically declared global. Since a value is bound
+to x as the last statement of the function body, the compiler
+assumes that x is local. Consequently the "print x"
+attempts to print an uninitialized local variable and will
+trigger a NameError.
+<P>
+In such cases the solution is to insert an explicit global
+declaration at the start of the function, making it
+<P>
+<P>
+<PRE>
+   def f():
+         global x
+         print x # try to print the global
+         ...
+         for j in range(100):
+              if q>3:
+                 x=4
+</PRE>
+<P>
+In this case, all references to x are interpreted as references
+to the x from the module namespace.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.057.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.057.htp">Log info</A>
+
+/ Last changed on Mon Feb 12 15:52:12 2001 by
+<A HREF="mailto:sholden@holdenweb.com">Steve Holden</A>
+<P>
+
+<HR>
+<H2><A NAME="4.58">4.58. What's a negative index? Why doesn't list.insert() use them?</A></H2>
+Python sequences are indexed with positive numbers and
+negative numbers.  For positive numbers 0 is the first index
+1 is the second index and so forth.  For negative indices -1
+is the last index and -2 is the pentultimate (next to last) index
+and so forth.  Think of seq[-n] as the same as seq[len(seq)-n].
+<P>
+Using negative indices can be very convenient.  For example
+if the string Line ends in a newline then Line[:-1] is all of Line except
+the newline.
+<P>
+Sadly the list builtin method L.insert does not observe negative
+indices.  This feature could be considered a mistake but since
+existing programs depend on this feature it may stay around 
+forever.  L.insert for negative indices inserts at the start of the
+list.  To get "proper" negative index behaviour use L[n:n] = [x]
+in place of the insert method.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.058.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.058.htp">Log info</A>
+
+/ Last changed on Wed Aug 13 07:03:18 1997 by
+<A HREF="mailto:aaron_watters@msn.com">aaron watters</A>
+<P>
+
+<HR>
+<H2><A NAME="4.59">4.59. How can I sort one list by values from another list?</A></H2>
+You can sort lists of  tuples.
+<P>
+<PRE>
+  >>> list1 = ["what", "I'm", "sorting", "by"]
+  >>> list2 = ["something", "else", "to", "sort"]
+  >>> pairs = map(None, list1, list2)
+  >>> pairs
+  [('what', 'something'), ("I'm", 'else'), ('sorting', 'to'), ('by', 'sort')]
+  >>> pairs.sort()
+  >>> pairs
+  [("I'm", 'else'), ('by', 'sort'), ('sorting', 'to'), ('what', 'something')]
+  >>> result = pairs[:]
+  >>> for i in xrange(len(result)): result[i] = result[i][1]
+  ...
+  >>> result
+  ['else', 'sort', 'to', 'something']
+</PRE>
+And if you didn't understand the question, please see the
+example above ;c).  Note that "I'm" sorts before "by" because
+uppercase "I" comes before lowercase "b" in the ascii order.
+Also see 4.51.
+<P>
+In Python 2.0 this can be done like:
+<P>
+<PRE>
+ >>> list1 = ["what", "I'm", "sorting", "by"]
+ >>> list2 = ["something", "else", "to", "sort"]
+ >>> pairs = zip(list1, list2)
+ >>> pairs
+ [('what', 'something'), ("I'm", 'else'), ('sorting', 'to'), ('by', 'sort')]
+ >>> pairs.sort()
+ >>> result = [ x[1] for x in pairs ]
+ >>> result
+ ['else', 'sort', 'to', 'something']
+</PRE>
+[Followup]
+<P>
+Someone asked, why not this for the last steps:
+<P>
+<PRE>
+  result = []
+  for p in pairs: result.append(p[1])
+</PRE>
+This is much more legible.  However, a quick test shows that
+it is almost twice as slow for long lists.  Why?  First of all,
+the append() operation has to reallocate memory, and while it
+uses some tricks to avoid doing that each time, it still has
+to do it occasionally, and apparently that costs quite a bit.
+Second, the expression "result.append" requires an extra
+attribute lookup.  The attribute lookup could be done away
+with by rewriting as follows:
+<P>
+<PRE>
+  result = []
+  append = result.append
+  for p in pairs: append(p[1])
+</PRE>
+which gains back some speed, but is still considerably slower
+than the original solution, and hardly less convoluted.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.059.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.059.htp">Log info</A>
+
+/ Last changed on Thu Dec 28 12:56:35 2000 by
+<A HREF="mailto:pbjorn@uswest.net">Bjorn Pettersen</A>
+<P>
+
+<HR>
+<H2><A NAME="4.60">4.60. Why doesn't dir() work on builtin types like files and lists?</A></H2>
+It does starting with Python 1.5.
+<P>
+Using 1.4, you can find out which methods a given object supports
+by looking at its __methods__ attribute:
+<P>
+<PRE>
+    >>> List = []
+    >>> List.__methods__
+    ['append', 'count', 'index', 'insert', 'remove', 'reverse', 'sort']
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.060.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.060.htp">Log info</A>
+
+/ Last changed on Thu Sep 16 14:56:42 1999 by
+<A HREF="mailto:skip@mojam.com">Skip Montanaro</A>
+<P>
+
+<HR>
+<H2><A NAME="4.61">4.61. How can I mimic CGI form submission (METHOD=POST)?</A></H2>
+I would like to retrieve web pages that are the result of POSTing a
+form. Is there existing code that would let me do this easily?
+<P>
+Yes. Here's a simple example that uses httplib.  
+<P>
+<PRE>
+    #!/usr/local/bin/python
+</PRE>
+<PRE>
+    import httplib, sys, time
+</PRE>
+<PRE>
+    ### build the query string
+    qs = "First=Josephine&amp;MI=Q&amp;Last=Public"
+</PRE>
+<PRE>
+    ### connect and send the server a path
+    httpobj = httplib.HTTP('www.some-server.out-there', 80)
+    httpobj.putrequest('POST', '/cgi-bin/some-cgi-script')
+    ### now generate the rest of the HTTP headers...
+    httpobj.putheader('Accept', '*/*')
+    httpobj.putheader('Connection', 'Keep-Alive')
+    httpobj.putheader('Content-type', 'application/x-www-form-urlencoded')
+    httpobj.putheader('Content-length', '%d' % len(qs))
+    httpobj.endheaders()
+    httpobj.send(qs)
+    ### find out what the server said in response...
+    reply, msg, hdrs = httpobj.getreply()
+    if reply != 200:
+	sys.stdout.write(httpobj.getfile().read())
+</PRE>
+Note that in general for "url encoded posts" (the default) query strings must be "quoted" to, for example, change equals signs and spaces to an encoded form when they occur in name or value.  Use urllib.quote to perform this quoting.  For example to send name="Guy Steele, Jr.":
+<P>
+<PRE>
+   >>> from urllib import quote
+   >>> x = quote("Guy Steele, Jr.")
+   >>> x
+   'Guy%20Steele,%20Jr.'
+   >>> query_string = "name="+x
+   >>> query_string
+   'name=Guy%20Steele,%20Jr.'
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.061.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.061.htp">Log info</A>
+
+/ Last changed on Mon Jun 21 03:47:07 1999 by
+<A HREF="mailto:tbryan@python.net">TAB</A>
+<P>
+
+<HR>
+<H2><A NAME="4.62">4.62. If my program crashes with a bsddb (or anydbm) database open, it gets corrupted. How come?</A></H2>
+Databases opened for write access with the bsddb module (and often by
+the anydbm module, since it will preferentially use bsddb) must
+explicitly be closed using the close method of the database.  The
+underlying libdb package caches database contents which need to be
+converted to on-disk form and written, unlike regular open files which
+already have the on-disk bits in the kernel's write buffer, where they
+can just be dumped by the kernel with the program exits.
+<P>
+If you have initialized a new bsddb database but not written anything to
+it before the program crashes, you will often wind up with a zero-length
+file and encounter an exception the next time the file is opened.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.062.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.062.htp">Log info</A>
+
+/ Last changed on Mon Jun  3 01:15:01 2002 by
+<A HREF="mailto:neal@metaslash.com">Neal Norwitz</A>
+<P>
+
+<HR>
+<H2><A NAME="4.63">4.63. How do I make a Python script executable on Unix?</A></H2>
+You need to do two things: the script file's mode must be executable
+(include the 'x' bit), and the first line must begin with #!
+followed by the pathname for the Python interpreter.
+<P>
+The first is done by executing 'chmod +x scriptfile' or perhaps
+'chmod 755 scriptfile'.
+<P>
+The second can be done in a number of way.  The most straightforward
+way is to write
+<P>
+<PRE>
+  #!/usr/local/bin/python
+</PRE>
+as the very first line of your file - or whatever the pathname is
+where the python interpreter is installed on your platform.
+<P>
+If you would like the script to be independent of where the python
+interpreter lives, you can use the "env" program.  On almost all
+platforms, the following will work, assuming the python interpreter
+is in a directory on the user's $PATH:
+<P>
+<PRE>
+  #! /usr/bin/env python
+</PRE>
+Note -- *don't* do this for CGI scripts.  The $PATH variable for
+CGI scripts is often very minimal, so you need to use the actual
+absolute pathname of the interpreter.
+<P>
+Occasionally, a user's environment is so full that the /usr/bin/env
+program fails; or there's no env program at all.
+In that case, you can try the following hack (due to Alex Rezinsky):
+<P>
+<PRE>
+  #! /bin/sh
+  """:"
+  exec python $0 ${1+"$@"}
+  """
+</PRE>
+The disadvantage is that this defines the script's __doc__ string.
+However, you can fix that by adding
+<P>
+<PRE>
+  __doc__ = """...Whatever..."""
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.063.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.063.htp">Log info</A>
+
+/ Last changed on Mon Jan 15 09:19:16 2001 by
+<A HREF="mailto:neal@metaslash.com">Neal Norwitz</A>
+<P>
+
+<HR>
+<H2><A NAME="4.64">4.64. How do you remove duplicates from a list?</A></H2>
+See the Python Cookbook for a long discussion of many cool ways:
+<P>
+<PRE>
+    <A HREF="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560">http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560</A>
+</PRE>
+Generally, if you don't mind reordering the List
+<P>
+<PRE>
+   if List:
+      List.sort()
+      last = List[-1]
+      for i in range(len(List)-2, -1, -1):
+          if last==List[i]: del List[i]
+          else: last=List[i]
+</PRE>
+If all elements of the list may be used as
+dictionary keys (ie, they are all hashable)
+this is often faster
+<P>
+<PRE>
+   d = {}
+   for x in List: d[x]=x
+   List = d.values()
+</PRE>
+Also, for extremely large lists you might
+consider more optimal alternatives to the first one.
+The second one is pretty good whenever it can
+be used.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.064.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.064.htp">Log info</A>
+
+/ Last changed on Fri May 24 21:56:33 2002 by
+<A HREF="mailto:tim.one@comcast.net">Tim Peters</A>
+<P>
+
+<HR>
+<H2><A NAME="4.65">4.65. Are there any known year 2000 problems in Python?</A></H2>
+I am not aware of year 2000 deficiencies in Python 1.5.  Python does
+very few date calculations and for what it does, it relies on the C
+library functions.  Python generally represent times either as seconds
+since 1970 or as a tuple (year, month, day, ...) where the year is
+expressed with four digits, which makes Y2K bugs unlikely.  So as long
+as your C library is okay, Python should be okay.  Of course, I cannot
+vouch for <I>your</I> Python code!
+<P>
+Given the nature of freely available software, I have to add that this statement is not
+legally binding.  The Python copyright notice contains the following
+disclaimer:
+<P>
+<PRE>
+  STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
+  REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+  MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
+  CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+  PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+  PERFORMANCE OF THIS SOFTWARE.
+</PRE>
+The good news is that <I>if</I> you encounter a problem, you have full
+source available to track it down and fix it!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.065.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.065.htp">Log info</A>
+
+/ Last changed on Fri Apr 10 14:59:31 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.66">4.66. I want a version of map that applies a method to a sequence of objects! Help!</A></H2>
+Get fancy!
+<P>
+<PRE>
+  def method_map(objects, method, arguments):
+       """method_map([a,b], "flog", (1,2)) gives [a.flog(1,2), b.flog(1,2)]"""
+       nobjects = len(objects)
+       methods = map(getattr, objects, [method]*nobjects)
+       return map(apply, methods, [arguments]*nobjects)
+</PRE>
+It's generally a good idea to get to know the mysteries of map and apply
+and getattr and the other dynamic features of Python.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.066.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.066.htp">Log info</A>
+
+/ Last changed on Mon Jan  5 14:21:14 1998 by
+<A HREF="mailto:aaron_watters@msn.com">Aaron Watters</A>
+<P>
+
+<HR>
+<H2><A NAME="4.67">4.67. How do I generate random numbers in Python?</A></H2>
+The standard library module "random" implements a random number
+generator.  Usage is simple:
+<P>
+<PRE>
+    import random
+</PRE>
+<PRE>
+    random.random()
+</PRE>
+This returns a random floating point number in the range [0, 1).
+<P>
+There are also many other specialized generators in this module, such
+as
+<P>
+<PRE>
+    randrange(a, b) chooses an integer in the range [a, b)
+    uniform(a, b) chooses a floating point number in the range [a, b)
+    normalvariate(mean, sdev) sample from normal (Gaussian) distribution
+</PRE>
+Some higher-level functions operate on sequences directly, such as
+<P>
+<PRE>
+    choice(S) chooses random element from a given sequence
+    shuffle(L) shuffles a list in-place, i.e. permutes it randomly
+</PRE>
+There's also a class, Random, which you can instantiate
+to create independent multiple random number generators.
+<P>
+All this is documented in the library reference manual.  Note that
+the module "whrandom" is obsolete.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.067.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.067.htp">Log info</A>
+
+/ Last changed on Mon Jun  3 01:16:51 2002 by
+<A HREF="mailto:neal@metaslash.com">Neal Norwitz</A>
+<P>
+
+<HR>
+<H2><A NAME="4.68">4.68. How do I access the serial (RS232) port?</A></H2>
+There's a Windows serial communication module (for communication
+over RS 232 serial ports) at
+<P>
+<PRE>
+  <A HREF="ftp://ftp.python.org/pub/python/contrib/sio-151.zip">ftp://ftp.python.org/pub/python/contrib/sio-151.zip</A>
+  <A HREF="http://www.python.org/ftp/python/contrib/sio-151.zip">http://www.python.org/ftp/python/contrib/sio-151.zip</A>
+</PRE>
+For DOS, try Hans Nowak's Python-DX, which supports this, at:
+<P>
+<PRE>
+  <A HREF="http://www.cuci.nl/~hnowak">http://www.cuci.nl/~hnowak</A>/
+</PRE>
+For Unix, see a usenet post by Mitch Chapman:
+<P>
+<PRE>
+  <A HREF="http://groups.google.com/groups?selm=34A04430.CF9@ohioee.com">http://groups.google.com/groups?selm=34A04430.CF9@ohioee.com</A>
+</PRE>
+For Win32, POSIX(Linux, BSD, *), Jython, Chris':
+<P>
+<PRE>
+  <A HREF="http://pyserial.sourceforge.net">http://pyserial.sourceforge.net</A>
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.068.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.068.htp">Log info</A>
+
+/ Last changed on Tue Jul  2 21:11:07 2002 by
+<A HREF="mailto:cliechti@gmx.net">Chris Liechti</A>
+<P>
+
+<HR>
+<H2><A NAME="4.69">4.69. Images on Tk-Buttons don't work in Py15?</A></H2>
+They <I>do</I> work, but you must keep your own <I>reference</I> to the image 
+object now. More verbosely, you must make sure that, say, a global 
+variable or a class attribute refers to the object.
+<P>
+Quoting Fredrik Lundh from the mailinglist:
+<P>
+<PRE>
+  Well, the Tk button widget keeps a reference to the internal
+  photoimage object, but Tkinter does not.  So when the last
+  Python reference goes away, Tkinter tells Tk to release the
+  photoimage.  But since the image is in use by a widget, Tk
+  doesn't destroy it.  Not completely.  It just blanks the image,
+  making it completely transparent...
+</PRE>
+<PRE>
+  And yes, there was a bug in the keyword argument handling
+  in 1.4 that kept an extra reference around in some cases.  And
+  when Guido fixed that bug in 1.5, he broke quite a few Tkinter
+  programs...
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.069.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.069.htp">Log info</A>
+
+/ Last changed on Tue Feb  3 11:31:03 1998 by
+<A HREF="mailto:cjr@euronet.nl">Case Roole</A>
+<P>
+
+<HR>
+<H2><A NAME="4.70">4.70. Where is the math.py (socket.py, regex.py, etc.) source file?</A></H2>
+If you can't find a source file for a module it may be a builtin
+or dynamically loaded module implemented in C, C++ or other
+compiled language.  In this case you may not have the source
+file or it may be something like mathmodule.c, somewhere in
+a C source directory (not on the Python Path).
+<P>
+Fredrik Lundh (<A HREF="mailto:fredrik@pythonware.com">fredrik@pythonware.com</A>) explains (on the python-list):
+<P>
+There are (at least) three kinds of modules in Python:
+1) modules written in Python (.py);
+2) modules written in C and dynamically loaded (.dll, .pyd, .so, .sl, etc);
+3) modules written in C and linked with the interpreter; to get a list
+of these, type:
+<P>
+<PRE>
+    import sys
+    print sys.builtin_module_names
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.070.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.070.htp">Log info</A>
+
+/ Last changed on Tue Feb  3 13:55:33 1998 by
+<A HREF="mailto:aaron_watters@msn.com">Aaron Watters</A>
+<P>
+
+<HR>
+<H2><A NAME="4.71">4.71. How do I send mail from a Python script?</A></H2>
+The standard library module smtplib does this.
+Here's a very simple interactive mail
+sender that uses it.  This method will work on any host that
+supports an SMTP listener.
+<P>
+<PRE>
+    import sys, smtplib
+</PRE>
+<PRE>
+    fromaddr = raw_input("From: ")
+    toaddrs  = raw_input("To: ").split(',')
+    print "Enter message, end with ^D:"
+    msg = ''
+    while 1:
+        line = sys.stdin.readline()
+        if not line:
+            break
+        msg = msg + line
+</PRE>
+<PRE>
+    # The actual mail send
+    server = smtplib.SMTP('localhost')
+    server.sendmail(fromaddr, toaddrs, msg)
+    server.quit()
+</PRE>
+If the local host doesn't have an SMTP listener, you need to find one. The simple method is to ask the user. Alternately, you can use the DNS system to find the mail gateway(s) responsible for the source address.
+<P>
+A Unix-only alternative uses sendmail.  The location of the
+sendmail program varies between systems; sometimes it is
+/usr/lib/sendmail, sometime /usr/sbin/sendmail.  The sendmail manual
+page will help you out.  Here's some sample code:
+<P>
+<PRE>
+  SENDMAIL = "/usr/sbin/sendmail" # sendmail location
+  import os
+  p = os.popen("%s -t -i" % SENDMAIL, "w")
+  p.write("To: <A HREF="mailto:cary@ratatosk.org">cary@ratatosk.org</A>\n")
+  p.write("Subject: test\n")
+  p.write("\n") # blank line separating headers from body
+  p.write("Some text\n")
+  p.write("some more text\n")
+  sts = p.close()
+  if sts != 0:
+      print "Sendmail exit status", sts
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.071.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.071.htp">Log info</A>
+
+/ Last changed on Mon Jun  3 07:05:12 2002 by
+<A HREF="mailto:smurf@noris.de">Matthias Urlichs</A>
+<P>
+
+<HR>
+<H2><A NAME="4.72">4.72. How do I avoid blocking in connect() of a socket?</A></H2>
+The select module is widely known to help with asynchronous
+I/O on sockets once they are connected.  However, it is less
+than common knowledge how to avoid blocking on the initial
+connect() call.  Jeremy Hylton has the following advice (slightly
+edited):
+<P>
+To prevent the TCP connect from blocking, you can set the socket to 
+non-blocking mode.  Then when you do the connect(), you will either 
+connect immediately (unlikely) or get an exception that contains the 
+errno.  errno.EINPROGRESS indicates that the connection is in 
+progress, but hasn't finished yet.  Different OSes will return 
+different errnos, so you're going to have to check.  I can tell you 
+that different versions of Solaris return different errno values. 
+<P>
+In Python 1.5 and later, you can use connect_ex() to avoid
+creating an exception.  It will just return the errno value. 
+<P>
+To poll, you can call connect_ex() again later -- 0 or errno.EISCONN 
+indicate that you're connected -- or you can pass this socket to 
+select (checking to see if it is writeable).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.072.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.072.htp">Log info</A>
+
+/ Last changed on Tue Feb 24 21:30:45 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.73">4.73. How do I specify hexadecimal and octal integers?</A></H2>
+To specify an octal digit, precede the octal value with a zero.  For example,
+to set the variable "a" to the octal value "10" (8 in decimal), type:
+<P>
+<PRE>
+    >>> a = 010
+</PRE>
+To verify that this works, you can type "a" and hit enter while in the
+interpreter, which will cause Python to spit out the current value of "a"
+in decimal:
+<P>
+<PRE>
+    >>> a
+    8
+</PRE>
+Hexadecimal is just as easy.  Simply precede the hexadecimal number with a
+zero, and then a lower or uppercase "x".  Hexadecimal digits can be specified
+in lower or uppercase.  For example, in the Python interpreter:
+<P>
+<PRE>
+    >>> a = 0xa5
+    >>> a
+    165
+    >>> b = 0XB2
+    >>> b
+    178
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.073.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.073.htp">Log info</A>
+
+/ Last changed on Tue Mar  3 12:53:16 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.74">4.74. How to get a single keypress at a time?</A></H2>
+For Windows, see question 8.2.  Here is an answer for Unix (see also 4.94).
+<P>
+There are several solutions; some involve using curses, which is a
+pretty big thing to learn.  Here's a solution without curses, due
+to Andrew Kuchling (adapted from code to do a PGP-style
+randomness pool):
+<P>
+<PRE>
+        import termios, sys, os
+        fd = sys.stdin.fileno()
+        old = termios.tcgetattr(fd)
+        new = termios.tcgetattr(fd)
+        new[3] = new[3] &amp; ~termios.ICANON &amp; ~termios.ECHO
+        new[6][termios.VMIN] = 1
+        new[6][termios.VTIME] = 0
+        termios.tcsetattr(fd, termios.TCSANOW, new)
+        s = ''    # We'll save the characters typed and add them to the pool.
+        try:
+            while 1:
+                c = os.read(fd, 1)
+                print "Got character", `c`
+                s = s+c
+        finally:
+            termios.tcsetattr(fd, termios.TCSAFLUSH, old)
+</PRE>
+You need the termios module for any of this to work, and I've only
+tried it on Linux, though it should work elsewhere.  It turns off
+stdin's echoing and disables canonical mode, and then reads a
+character at a time from stdin, noting the time after each keystroke.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.074.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.074.htp">Log info</A>
+
+/ Last changed on Thu Oct 24 00:36:56 2002 by
+<A HREF="mailto:cliechti@gmx.net">chris</A>
+<P>
+
+<HR>
+<H2><A NAME="4.75">4.75. How can I overload constructors (or methods) in Python?</A></H2>
+(This actually applies to all methods, but somehow the question
+usually comes up first in the context of constructors.)
+<P>
+Where in C++ you'd write
+<P>
+<PRE>
+    class C {
+        C() { cout &lt;&lt; "No arguments\n"; }
+        C(int i) { cout &lt;&lt; "Argument is " &lt;&lt; i &lt;&lt; "\n"; }
+    }
+</PRE>
+in Python you have to write a single constructor that catches all
+cases using default arguments.  For example:
+<P>
+<PRE>
+    class C:
+        def __init__(self, i=None):
+            if i is None:
+                print "No arguments"
+            else:
+                print "Argument is", i
+</PRE>
+This is not entirely equivalent, but close enough in practice.
+<P>
+You could also try a variable-length argument list, e.g.
+<P>
+<PRE>
+        def __init__(self, *args):
+            ....
+</PRE>
+The same approach works for all method definitions.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.075.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.075.htp">Log info</A>
+
+/ Last changed on Mon Apr 20 11:55:55 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.76">4.76. How do I pass keyword arguments from one method to another?</A></H2>
+Use apply.  For example:
+<P>
+<PRE>
+    class Account:
+        def __init__(self, **kw):
+            self.accountType = kw.get('accountType')
+            self.balance = kw.get('balance')
+</PRE>
+<PRE>
+    class CheckingAccount(Account):
+        def __init__(self, **kw):
+            kw['accountType'] = 'checking'
+            apply(Account.__init__, (self,), kw)
+</PRE>
+<PRE>
+    myAccount = CheckingAccount(balance=100.00)
+</PRE>
+In Python 2.0 you can call it directly using the new ** syntax:
+<P>
+<PRE>
+    class CheckingAccount(Account):
+        def __init__(self, **kw):
+            kw['accountType'] = 'checking'
+            Account.__init__(self, **kw)
+</PRE>
+or more generally:
+<P>
+<PRE>
+ >>> def f(x, *y, **z):
+ ...  print x,y,z
+ ...
+ >>> Y = [1,2,3]
+ >>> Z = {'foo':3,'bar':None}
+ >>> f('hello', *Y, **Z)
+ hello (1, 2, 3) {'foo': 3, 'bar': None}
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.076.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.076.htp">Log info</A>
+
+/ Last changed on Thu Dec 28 13:04:01 2000 by
+<A HREF="mailto:pbjorn@uswest.net">Bjorn Pettersen</A>
+<P>
+
+<HR>
+<H2><A NAME="4.77">4.77. What module should I use to help with generating HTML?</A></H2>
+Check out HTMLgen written by Robin Friedrich. It's a class library
+of objects corresponding to all the HTML 3.2 markup tags. It's used
+when you are writing in Python and wish to synthesize HTML pages for
+generating a web or for CGI forms, etc. 
+<P>
+It can be found in the FTP contrib area on python.org or on the 
+Starship. Use the search engines there to locate the latest version.
+<P>
+It might also be useful to consider DocumentTemplate, which offers clear 
+separation between Python code and HTML code.  DocumentTemplate is part 
+of the Bobo objects publishing system (http:/www.digicool.com/releases) 
+but can be used independantly of course!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.077.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.077.htp">Log info</A>
+
+/ Last changed on Fri Aug 28 09:54:58 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.78">4.78. How do I create documentation from doc strings?</A></H2>
+Use gendoc, by Daniel Larson.  See
+<P>
+<A HREF="http://starship.python.net/crew/danilo">http://starship.python.net/crew/danilo</A>/
+<P>
+It can create HTML from the doc strings in your Python source code.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.078.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.078.htp">Log info</A>
+
+/ Last changed on Mon Oct  7 17:15:51 2002 by
+<A HREF="mailto:phil@dspfactory.com">Phil Rittenhouse</A>
+<P>
+
+<HR>
+<H2><A NAME="4.79">4.79. How do I read (or write) binary data?</A></H2>
+For complex data formats, it's best to use
+use the struct module.  It's documented in the library reference.
+It allows you to take a string read from a file containing binary
+data (usually numbers) and convert it to Python objects; and vice
+versa.
+<P>
+For example, the following code reads two 2-byte integers
+and one 4-byte integer in big-endian format from a file:
+<P>
+<PRE>
+  import struct
+</PRE>
+<PRE>
+  f = open(filename, "rb")  # Open in binary mode for portability
+  s = f.read(8)
+  x, y, z = struct.unpack(">hhl", s)
+</PRE>
+The '>' in the format string forces bin-endian data; the letter
+'h' reads one "short integer" (2 bytes), and 'l' reads one
+"long integer" (4 bytes) from the string.
+<P>
+For data that is more regular (e.g. a homogeneous list of ints or
+floats), you can also use the array module, also documented
+in the library reference.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.079.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.079.htp">Log info</A>
+
+/ Last changed on Wed Oct  7 09:16:45 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.80">4.80. I can't get key bindings to work in Tkinter</A></H2>
+An oft-heard complaint is that event handlers bound to events
+with the bind() method don't get handled even when the appropriate
+key is pressed.
+<P>
+The most common cause is that the widget to which the binding applies
+doesn't have "keyboard focus".  Check out the Tk documentation
+for the focus command.  Usually a widget is given the keyboard
+focus by clicking in it (but not for labels; see the taketocus
+option).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.080.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.080.htp">Log info</A>
+
+/ Last changed on Fri Jun 12 09:37:33 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.81">4.81. &quot;import crypt&quot; fails</A></H2>
+[Unix]
+<P>
+Starting with Python 1.5, the crypt module is disabled by default.
+In order to enable it, you must go into the Python source tree and
+edit the file Modules/Setup to enable it (remove a '#' sign in
+front of the line starting with '#crypt').  Then rebuild.
+You may also have to add the string '-lcrypt' to that same line.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.081.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.081.htp">Log info</A>
+
+/ Last changed on Wed Aug  5 08:57:09 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.82">4.82. Are there coding standards or a style guide for Python programs?</A></H2>
+Yes, Guido has written the "Python Style Guide".  See
+<A HREF="http://www.python.org/doc/essays/styleguide.html">http://www.python.org/doc/essays/styleguide.html</A>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.082.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.082.htp">Log info</A>
+
+/ Last changed on Tue Sep 29 09:50:27 1998 by
+<A HREF="mailto:vanandel@ucar.edu">Joseph VanAndel</A>
+<P>
+
+<HR>
+<H2><A NAME="4.83">4.83. How do I freeze Tkinter applications?</A></H2>
+Freeze is a tool to create stand-alone applications (see 4.28).
+<P>
+When freezing Tkinter applications, the applications will not be
+truly stand-alone, as the application will still need the tcl and
+tk libraries.
+<P>
+One solution is to ship the application with the tcl and tk libraries,
+and point to them at run-time using the TCL_LIBRARY and TK_LIBRARY
+environment variables.
+<P>
+To get truly stand-alone applications, the Tcl scripts that form
+the library have to be integrated into the application as well. One
+tool supporting that is SAM (stand-alone modules), which is part
+of the Tix distribution (<A HREF="http://tix.mne.com">http://tix.mne.com</A>). Build Tix with SAM 
+enabled, perform the appropriate call to Tclsam_init etc inside 
+Python's Modules/tkappinit.c, and link with libtclsam
+and libtksam (you might include the Tix libraries as well).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.083.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.083.htp">Log info</A>
+
+/ Last changed on Wed Jan 20 17:35:01 1999 by
+<A HREF="mailto:loewis@informatik.hu-berlin.de">Martin v. Löwis</A>
+<P>
+
+<HR>
+<H2><A NAME="4.84">4.84. How do I create static class data and static class methods?</A></H2>
+[Tim Peters, <A HREF="mailto:tim_one@email.msn.com">tim_one@email.msn.com</A>]
+<P>
+Static data (in the sense of C++ or Java) is easy; static methods (again in the sense of C++ or Java) are not supported directly.
+<P>
+STATIC DATA
+<P>
+For example,
+<P>
+<PRE>
+    class C:
+        count = 0   # number of times C.__init__ called
+</PRE>
+<PRE>
+        def __init__(self):
+            C.count = C.count + 1
+</PRE>
+<PRE>
+        def getcount(self):
+            return C.count  # or return self.count
+</PRE>
+c.count also refers to C.count for any c such that isinstance(c, C) holds, unless overridden by c itself or by some class on the base-class search path from c.__class__ back to C.
+<P>
+Caution:  within a method of C,
+<P>
+<PRE>
+    self.count = 42
+</PRE>
+creates a new and unrelated instance vrbl named "count" in self's own dict.  So rebinding of a class-static data name needs the
+<P>
+<PRE>
+    C.count = 314
+</PRE>
+form whether inside a method or not.
+<P>
+<P>
+STATIC METHODS
+<P>
+Static methods (as opposed to static data) are unnatural in Python, because
+<P>
+<PRE>
+    C.getcount
+</PRE>
+returns an unbound method object, which can't be invoked without supplying an instance of C as the first argument.
+<P>
+The intended way to get the effect of a static method is via a module-level function:
+<P>
+<PRE>
+    def getcount():
+        return C.count
+</PRE>
+If your code is structured so as to define one class (or tightly related class hierarchy) per module, this supplies the desired encapsulation.
+<P>
+Several tortured schemes for faking static methods can be found by searching DejaNews.  Most people feel such cures are worse than the disease.  Perhaps the least obnoxious is due to Pekka Pessi (mailto:<A HREF="mailto:ppessi@hut.fi">ppessi@hut.fi</A>):
+<P>
+<PRE>
+    # helper class to disguise function objects
+    class _static:
+        def __init__(self, f):
+            self.__call__ = f
+</PRE>
+<PRE>
+    class C:
+        count = 0
+</PRE>
+<PRE>
+        def __init__(self):
+            C.count = C.count + 1
+</PRE>
+<PRE>
+        def getcount():
+            return C.count
+        getcount = _static(getcount)
+</PRE>
+<PRE>
+        def sum(x, y):
+            return x + y
+        sum = _static(sum)
+</PRE>
+<PRE>
+    C(); C()
+    c = C()
+    print C.getcount()  # prints 3
+    print c.getcount()  # prints 3
+    print C.sum(27, 15) # prints 42
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.084.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.084.htp">Log info</A>
+
+/ Last changed on Thu Jan 21 21:35:38 1999 by
+<A HREF="mailto:tim_one@email.msn.com">Tim Peters</A>
+<P>
+
+<HR>
+<H2><A NAME="4.85">4.85. __import__('x.y.z') returns &lt;module 'x'&gt;; how do I get z?</A></H2>
+Try
+<P>
+<PRE>
+   __import__('x.y.z').y.z
+</PRE>
+For more realistic situations, you may have to do something like
+<P>
+<PRE>
+   m = __import__(s)
+   for i in string.split(s, ".")[1:]:
+       m = getattr(m, i)
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.085.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.085.htp">Log info</A>
+
+/ Last changed on Thu Jan 28 11:01:43 1999 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.86">4.86. Basic thread wisdom</A></H2>
+Please note that there is no way to take advantage of
+multiprocessor hardware using the Python thread model. The interpreter
+uses a global interpreter lock (GIL),
+which does not allow multiple threads to be concurrently active.
+<P>
+If you write a simple test program like this:
+<P>
+<PRE>
+  import thread
+  def run(name, n):
+      for i in range(n): print name, i
+  for i in range(10):
+      thread.start_new(run, (i, 100))
+</PRE>
+none of the threads seem to run!  The reason is that as soon as
+the main thread exits, all threads are killed.
+<P>
+A simple fix is to add a sleep to the end of the program,
+sufficiently long for all threads to finish:
+<P>
+<PRE>
+  import thread, time
+  def run(name, n):
+      for i in range(n): print name, i
+  for i in range(10):
+      thread.start_new(run, (i, 100))
+  time.sleep(10) # &lt;----------------------------!
+</PRE>
+But now (on many platforms) the threads don't run in parallel,
+but appear to run sequentially, one at a time!  The reason is
+that the OS thread scheduler doesn't start a new thread until
+the previous thread is blocked.
+<P>
+A simple fix is to add a tiny sleep to the start of the run
+function:
+<P>
+<PRE>
+  import thread, time
+  def run(name, n):
+      time.sleep(0.001) # &lt;---------------------!
+      for i in range(n): print name, i
+  for i in range(10):
+      thread.start_new(run, (i, 100))
+  time.sleep(10)
+</PRE>
+Some more hints:
+<P>
+Instead of using a time.sleep() call at the end, it's
+better to use some kind of semaphore mechanism.  One idea is to
+use a the Queue module to create a queue object, let each thread
+append a token to the queue when it finishes, and let the main
+thread read as many tokens from the queue as there are threads.
+<P>
+Use the threading module instead of the thread module.  It's part
+of Python since version 1.5.1.  It takes care of all these details,
+and has many other nice features too!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.086.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.086.htp">Log info</A>
+
+/ Last changed on Fri Feb  7 16:21:55 2003 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.87">4.87. Why doesn't closing sys.stdout (stdin, stderr) really close it?</A></H2>
+Python file objects are a high-level layer of abstraction on top of C streams, which in turn are a medium-level layer of abstraction on top of (among other things) low-level C file descriptors.
+<P>
+For most file objects f you create in Python via the builtin "open" function, f.close() marks the Python file object as being closed from Python's point of view, and also arranges to close the underlying C stream.  This happens automatically too, in f's destructor, when f becomes garbage.
+<P>
+But stdin, stdout and stderr are treated specially by Python, because of the special status also given to them by C:  doing
+<P>
+<PRE>
+    sys.stdout.close() # ditto for stdin and stderr
+</PRE>
+marks the Python-level file object as being closed, but does <I>not</I> close the associated C stream (provided sys.stdout is still bound to its default value, which is the stream C also calls "stdout").
+<P>
+To close the underlying C stream for one of these three, you should first be sure that's what you really want to do (e.g., you may confuse the heck out of extension modules trying to do I/O).  If it is, use os.close:
+<P>
+<PRE>
+    os.close(0)   # close C's stdin stream
+    os.close(1)   # close C's stdout stream
+    os.close(2)   # close C's stderr stream
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.087.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.087.htp">Log info</A>
+
+/ Last changed on Sat Apr 17 02:22:35 1999 by
+<A HREF="mailto:tim_one@email.msn.com">Tim Peters</A>
+<P>
+
+<HR>
+<H2><A NAME="4.88">4.88. What kinds of global value mutation are thread-safe?</A></H2>
+[adapted from c.l.py responses by Gordon McMillan &amp; GvR]
+<P>
+A global interpreter lock (GIL) is used internally to ensure that only one thread runs in the Python VM at a time.  In general, Python offers to switch among threads only between bytecode instructions (how frequently it offers to switch can be set via sys.setcheckinterval).  Each bytecode instruction-- and all the C implementation code reached from it --is therefore atomic.
+<P>
+In theory, this means an exact accounting requires an exact understanding of the PVM bytecode implementation.  In practice, it means that operations on shared vrbls of builtin data types (ints, lists, dicts, etc) that "look atomic" really are.
+<P>
+For example, these are atomic (L, L1, L2 are lists, D, D1, D2 are dicts, x, y
+are objects, i, j are ints):
+<P>
+<PRE>
+    L.append(x)
+    L1.extend(L2)
+    x = L[i]
+    x = L.pop()
+    L1[i:j] = L2
+    L.sort()
+    x = y
+    x.field = y
+    D[x] = y
+    D1.update(D2)
+    D.keys()
+</PRE>
+These aren't:
+<P>
+<PRE>
+    i = i+1
+    L.append(L[-1])
+    L[i] = L[j]
+    D[x] = D[x] + 1
+</PRE>
+Note: operations that replace other objects may invoke those other objects' __del__ method when their reference count reaches zero, and that can affect things.  This is especially true for the mass updates to dictionaries and lists.  When in doubt, use a mutex!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.088.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.088.htp">Log info</A>
+
+/ Last changed on Fri Feb  7 16:21:03 2003 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.89">4.89. How do I modify a string in place?</A></H2>
+Strings are immutable (see question 6.2) so you cannot modify a string
+directly.  If you need an object with this ability, try converting the
+string to a list or take a look at the array module.
+<P>
+<PRE>
+    >>> s = "Hello, world"
+    >>> a = list(s)
+    >>> print a
+    ['H', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd']
+    >>> a[7:] = list("there!")
+    >>> import string
+    >>> print string.join(a, '')
+    'Hello, there!'
+</PRE>
+<PRE>
+    >>> import array
+    >>> a = array.array('c', s)
+    >>> print a
+    array('c', 'Hello, world')
+    >>> a[0] = 'y' ; print a
+    array('c', 'yello world')
+    >>> a.tostring()
+    'yello, world'
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.089.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.089.htp">Log info</A>
+
+/ Last changed on Tue May 18 01:22:47 1999 by
+<A HREF="mailto:dalke@bioreason.com">Andrew Dalke</A>
+<P>
+
+<HR>
+<H2><A NAME="4.90">4.90. How to pass on keyword/optional parameters/arguments</A></H2>
+Q: How can I pass on optional or keyword parameters from one function to another?
+<P>
+<PRE>
+	def f1(a, *b, **c):
+		...
+</PRE>
+A: In Python 2.0 and above:
+<P>
+<PRE>
+	def f2(x, *y, **z):
+		...
+		z['width']='14.3c'
+		...
+		f1(x, *y, **z)
+</PRE>
+<PRE>
+   Note: y can be any sequence (e.g., list or tuple) and z must be a dict.
+</PRE>
+<P>
+A: For versions prior to 2.0, use 'apply', like:
+<P>
+<PRE>
+	def f2(x, *y, **z):
+		...
+		z['width']='14.3c'
+		...
+		apply(f1, (x,)+y, z)
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.090.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.090.htp">Log info</A>
+
+/ Last changed on Mon Jun  3 07:20:56 2002 by
+<A HREF="mailto:smurf@noris.de">Matthias Urlichs</A>
+<P>
+
+<HR>
+<H2><A NAME="4.91">4.91. How can I get a dictionary to display its keys in a consistent order?</A></H2>
+In general, dictionaries store their keys in an unpredictable order,
+so the display order of a dictionary's elements will be similarly
+unpredictable.
+(See 
+<a href="http://www.python.org/doc/FAQ.html#6.12">Question 6.12</a>
+to understand why this is so.)
+<P>
+This can be frustrating if you want to save a printable version to a 
+file, make some changes and then compare it with some other printed
+dictionary.  If you have such needs you can subclass UserDict.UserDict
+to create a SortedDict class that prints itself in a predictable order.
+Here's one simpleminded implementation of such a class:
+<P>
+<PRE>
+  import UserDict, string
+</PRE>
+<PRE>
+  class SortedDict(UserDict.UserDict):
+    def __repr__(self):
+      result = []
+      append = result.append
+      keys = self.data.keys()
+      keys.sort()
+      for k in keys:
+        append("%s: %s" % (`k`, `self.data[k]`))
+      return "{%s}" % string.join(result, ", ")
+</PRE>
+<PRE>
+    ___str__ = __repr__
+</PRE>
+<P>
+This will work for many common situations you might encounter, though
+it's far from a perfect solution. (It won't have any effect on the
+pprint module and does not transparently handle values that are or
+contain dictionaries.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.091.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.091.htp">Log info</A>
+
+/ Last changed on Thu Sep 16 17:31:06 1999 by
+<A HREF="mailto:skip@mojam.com">Skip Montanaro</A>
+<P>
+
+<HR>
+<H2><A NAME="4.92">4.92. Is there a Python tutorial?</A></H2>
+Yes.  See question 1.20 at 
+<A HREF="http://www.python.org/doc/FAQ.html#1.20">http://www.python.org/doc/FAQ.html#1.20</A>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.092.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.092.htp">Log info</A>
+
+/ Last changed on Sat Dec  4 16:04:00 1999 by
+<A HREF="mailto:tbryan@python.net">TAB</A>
+<P>
+
+<HR>
+<H2><A NAME="4.93">4.93. Deleted</A></H2>
+See 4.28
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.093.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.093.htp">Log info</A>
+
+/ Last changed on Tue May 28 20:40:37 2002 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="4.94">4.94. How do I get a single keypress without blocking?</A></H2>
+There are several solutions; some involve using curses, which is a
+pretty big thing to learn.  Here's a solution without curses. (see also 4.74, for Windows, see question 8.2)
+<P>
+<PRE>
+  import termios, fcntl, sys, os
+  fd = sys.stdin.fileno()
+</PRE>
+<PRE>
+  oldterm = termios.tcgetattr(fd)
+  newattr = termios.tcgetattr(fd)
+  newattr[3] = newattr[3] &amp; ~termios.ICANON &amp; ~termios.ECHO
+  termios.tcsetattr(fd, termios.TCSANOW, newattr)
+</PRE>
+<PRE>
+  oldflags = fcntl.fcntl(fd, fcntl.F_GETFL)
+  fcntl.fcntl(fd, fcntl.F_SETFL, oldflags | os.O_NONBLOCK)
+</PRE>
+<PRE>
+  try:
+      while 1:
+          try:
+              c = sys.stdin.read(1)
+              print "Got character", `c`
+          except IOError: pass
+  finally:
+      termios.tcsetattr(fd, termios.TCSAFLUSH, oldterm)
+      fcntl.fcntl(fd, fcntl.F_SETFL, oldflags)
+</PRE>
+<P>
+You need the termios and the fcntl module for any of this to work, 
+and I've only tried it on Linux, though it should work elsewhere. 
+<P>
+In this code, characters are read and printed one at a time.
+<P>
+termios.tcsetattr() turns off stdin's echoing and disables canonical
+mode.  fcntl.fnctl() is used to obtain stdin's file descriptor flags
+and modify them for non-blocking mode.  Since reading stdin when it is
+empty results in an IOError, this error is caught and ignored.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.094.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.094.htp">Log info</A>
+
+/ Last changed on Thu Oct 24 00:39:06 2002 by
+<A HREF="mailto:cliechti@gmx.net">chris</A>
+<P>
+
+<HR>
+<H2><A NAME="4.95">4.95. Is there an equivalent to Perl chomp()? (Remove trailing newline from string)</A></H2>
+There are two partial substitutes. If you want to remove all trailing
+whitespace, use the method string.rstrip(). Otherwise, if there is only
+one line in the string, use string.splitlines()[0].
+<P>
+<PRE>
+ -----------------------------------------------------------------------
+</PRE>
+<PRE>
+ rstrip() is too greedy, it strips all trailing white spaces.
+ splitlines() takes ControlM as line boundary.
+ Consider these strings as input:
+   "python python    \r\n"
+   "python\rpython\r\n"
+   "python python   \r\r\r\n"
+ The results from rstrip()/splitlines() are perhaps not what we want.
+</PRE>
+<PRE>
+ It seems re can perform this task.
+</PRE>
+<P>
+<PRE>
+ #!/usr/bin/python 
+ # requires python2                                                             
+</PRE>
+<PRE>
+ import re, os, StringIO
+</PRE>
+<PRE>
+ lines=StringIO.StringIO(
+   "The Python Programming Language\r\n"
+   "The Python Programming Language \r \r \r\r\n"
+   "The\rProgramming\rLanguage\r\n"
+   "The\rProgramming\rLanguage\r\r\r\r\n"
+   "The\r\rProgramming\r\rLanguage\r\r\r\r\n"
+ )
+</PRE>
+<PRE>
+ ln=re.compile("(?:[\r]?\n|\r)$") # dos:\r\n, unix:\n, mac:\r, others: unknown
+ # os.linesep does not work if someone ftps(in binary mode) a dos/mac text file
+ # to your unix box
+ #ln=re.compile(os.linesep + "$")
+</PRE>
+<PRE>
+ while 1:
+   s=lines.readline()
+   if not s: break
+   print "1.(%s)" % `s.rstrip()`
+   print "2.(%s)" % `ln.sub( "", s, 1)`
+   print "3.(%s)" % `s.splitlines()[0]`
+   print "4.(%s)" % `s.splitlines()`
+   print
+</PRE>
+<PRE>
+ lines.close()
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.095.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.095.htp">Log info</A>
+
+/ Last changed on Wed Aug  8 09:51:34 2001 by
+<A HREF="mailto:serpent@ms5.hinet.net">Crystal</A>
+<P>
+
+<HR>
+<H2><A NAME="4.96">4.96. Why is join() a string method when I'm really joining the elements of a (list, tuple, sequence)?</A></H2>
+Strings became much more like other standard types starting in release 1.6, when methods were added which give the same functionality that has always been available using the functions of the string module.  These new methods have been widely accepted, but the one which appears to make (some) programmers feel uncomfortable is:
+<P>
+<PRE>
+    ", ".join(['1', '2', '4', '8', '16'])
+</PRE>
+which gives the result
+<P>
+<PRE>
+    "1, 2, 4, 8, 16"
+</PRE>
+There are two usual arguments against this usage.
+<P>
+The first runs along the lines of: "It looks really ugly using a method of a string literal (string constant)", to which the answer is that it might, but a string literal is just a fixed value. If the methods are to be allowed on names bound to strings there is no logical reason to make them unavailable on literals. Get over it!
+<P>
+The second objection is typically cast as: "I am really telling a sequence to join its members together with a string constant". Sadly, you aren't. For some reason there seems to be much less difficulty with having split() as a string method, since in that case it is easy to see that
+<P>
+<PRE>
+    "1, 2, 4, 8, 16".split(", ")
+</PRE>
+is an instruction to a string literal to return the substrings delimited by the given separator (or, by default, arbitrary runs of white space). In this case a Unicode string returns a list of Unicode strings, an ASCII string returns a list of ASCII strings, and everyone is happy.
+<P>
+join() is a string method because in using it you are telling the separator string to iterate over an arbitrary sequence, forming string representations of each of the elements, and inserting itself between the elements' representations.  This method can be used with any argument which obeys the rules for sequence objects, inluding any new classes you might define yourself.
+<P>
+Because this is a string method it can work for Unicode strings as well as plain ASCII strings. If join() were a method of the sequence types then the sequence types would have to decide which type of string to return depending on the type of the separator.
+<P>
+If none of these arguments persuade you, then for the moment you can continue to use the join() function from the string module, which allows you to write
+<P>
+<PRE>
+    string.join(['1', '2', '4', '8', '16'], ", ")
+</PRE>
+You will just have to try and forget that the string module actually uses the syntax you are compaining about to implement the syntax you prefer!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.096.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.096.htp">Log info</A>
+
+/ Last changed on Fri Aug  2 15:51:58 2002 by
+<A HREF="mailto:sholden@holdenweb.com">Steve Holden</A>
+<P>
+
+<HR>
+<H2><A NAME="4.97">4.97. How can my code discover the name of an object?</A></H2>
+Generally speaking, it can't, because objects don't really have names. The assignment statement does not store the assigned value in the name but a reference to it. Essentially, assignment creates a binding of a name to a value. The same is true of <I>def</I> and <I>class</I> statements, but in that case the value is a callable. Consider the following code:
+<P>
+<PRE>
+    class A:
+        pass
+</PRE>
+<PRE>
+    B = A
+</PRE>
+<PRE>
+    a = B()
+    b = a
+    print b
+    &lt;__main__.A instance at 016D07CC&gt;
+    print a
+    &lt;__main__.A instance at 016D07CC&gt;
+</PRE>
+<P>
+Arguably the class has a name: even though it is bound to two names and invoked through the name B the created instance is still reported as an instance of class A. However, it is impossible to say whether the instance's name is a or b, since both names are bound to the same value.
+<P>
+Generally speaking it should not be necessary for your code to "know the names" of particular values. Unless you are deliberately writing introspective programs, this is usually an indication that a change of approach might be beneficial.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.097.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.097.htp">Log info</A>
+
+/ Last changed on Thu Mar  8 03:53:39 2001 by
+<A HREF="mailto:sholden@holdenweb.com">Steve Holden</A>
+<P>
+
+<HR>
+<H2><A NAME="4.98">4.98. Why are floating point calculations so inaccurate?</A></H2>
+The development version of the Python Tutorial now contains an Appendix with more info:
+<PRE>
+    <A HREF="http://www.python.org/doc/current/tut/node14.html">http://www.python.org/doc/current/tut/node14.html</A>
+</PRE>
+People are often very surprised by results like this:
+<P>
+<PRE>
+ >>> 1.2-1.0
+ 0.199999999999999996
+</PRE>
+And think it is a bug in Python. It's not. It's a problem caused by
+the internal representation of a floating point number. A floating point
+number is stored as a fixed number of binary digits.
+<P>
+In decimal math, there are many numbers that can't be represented
+with a fixed number of decimal digits, i.e.
+1/3 = 0.3333333333.......
+<P>
+In the binary case, 1/2 = 0.1, 1/4 = 0.01, 1/8 = 0.001, etc. There are 
+a lot of numbers that can't be represented. The digits are cut off at
+some point.
+<P>
+Since Python 1.6, a floating point's repr() function prints as many
+digits are necessary to make eval(repr(f)) == f true for any float f.
+The str() function prints the more sensible number that was probably
+intended:
+<P>
+<PRE>
+ >>> 0.2
+ 0.20000000000000001
+ >>> print 0.2
+ 0.2
+</PRE>
+Again, this has nothing to do with Python, but with the way the
+underlying C platform handles floating points, and ultimately with
+the inaccuracy you'll always have when writing down numbers of fixed
+number of digit strings.
+<P>
+One of the consequences of this is that it is dangerous to compare 
+the result of some computation to a float with == ! 
+Tiny inaccuracies may mean that == fails.
+<P>
+Instead try something like this:
+<P>
+<PRE>
+ epsilon = 0.0000000000001 # Tiny allowed error
+ expected_result = 0.4
+</PRE>
+<PRE>
+ if expected_result-epsilon &lt;= computation() &lt;= expected_result+epsilon:
+    ...
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.098.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.098.htp">Log info</A>
+
+/ Last changed on Mon Apr  1 22:18:47 2002 by
+<A HREF="mailto:fdrake@acm.org">Fred Drake</A>
+<P>
+
+<HR>
+<H2><A NAME="4.99">4.99. I tried to open Berkeley DB file, but bsddb produces bsddb.error: (22, 'Invalid argument'). Help! How can I restore my data?</A></H2>
+Don't panic! Your data are probably intact. The most frequent cause
+for the error is that you tried to open an earlier Berkeley DB file
+with a later version of the Berkeley DB library.
+<P>
+Many Linux systems now have all three versions of Berkeley DB
+available.  If you are migrating from version 1 to a newer version use
+db_dump185 to dump a plain text version of the database.
+If you are migrating from version 2 to version 3 use db2_dump to create
+a plain text version of the database.  In either case, use db_load to
+create a new native database for the latest version installed on your
+computer.  If you have version 3 of Berkeley DB installed, you should
+be able to use db2_load to create a native version 2 database.
+<P>
+You should probably move away from Berkeley DB version 1 files because
+the hash file code contains known bugs that can corrupt your data.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.099.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.099.htp">Log info</A>
+
+/ Last changed on Wed Aug 29 16:04:29 2001 by
+<A HREF="mailto:skip@pobox.com">Skip Montanaro</A>
+<P>
+
+<HR>
+<H2><A NAME="4.100">4.100. What are the &quot;best practices&quot; for using import in a module?</A></H2>
+First, the standard modules are great.  Use them!  The standard Python library is large and varied.  Using modules can save you time and effort and will reduce maintainenance cost of your code.  (Other programs are dedicated to supporting and fixing bugs in the standard Python modules.  Coworkers may also be familiar with themodules that you use, reducing the amount of time it takes them to understand your code.)
+<P>
+The rest of this answer is largely a matter of personal preference, but here's what some newsgroup posters said (thanks to all who responded)
+<P>
+In general, don't use 
+<PRE>
+ from modulename import *
+</PRE>
+Doing so clutters the importer's namespace.  Some avoid this idiom even with the few modules that were designed to be imported in this manner.  (Modules designed in this manner include Tkinter, thread, and wxPython.)
+<P>
+Import modules at the top of a file, one module per line.  Doing so makes it clear what other modules your code requires and avoids questions of whether the module name is in scope.  Using one import per line makes it easy to add and delete module imports.
+<P>
+Move imports into a local scope (such as at the top of a function definition) if there are a lot of imports, and you're trying to avoid the cost (lots of initialization time) of many imports.  This technique is especially helpful if many of the imports are unnecessary depending on how the program executes.  You may also want to move imports into a function if the modules are only ever used in that function.  Note that loading a module the first time may be expensive (because of the one time initialization of the module) but that loading a module multiple times is virtually free (a couple of dictionary lookups).  Even if the module name has gone out of scope, the module is probably available in sys.modules.  Thus, there isn't really anything wrong with putting no imports at the module level (if they aren't needed) and putting all of the imports at the function level.  
+<P>
+It is sometimes necessary to move imports to a function or class to avoid problems with circular imports.  Gordon says:
+<PRE>
+ Circular imports are fine where both modules use the "import &lt;module&gt;"
+ form of import. They fail when the 2nd module wants to grab a name
+ out of the first ("from module import name") and the import is at
+ the top level. That's because names in the 1st are not yet available,
+ (the first module is busy importing the 2nd).  
+</PRE>
+In this case, if the 2nd module is only used in one function, then the  import can easily be moved into that function.  By the time the import is called, the first module will have finished initializing, and the second module can do its import.
+<P>
+It may also be necessary to move imports out of the top level of code 
+if some of the modules are platform-specific.  In that case, it may not even be possible to import all of the modules at the top of the file.  In this case, importing the correct modules in the corresponding platform-specific code is a good option.   
+<P>
+If only instances of a specific class uses a module, then it is reasonable to import the module in the class's __init__ method and then assign the module to an instance variable so that the module is always available (via that instance variable) during the life of the object.  Note that to delay an import until the class is instantiated, the import must be inside a method.  Putting the import inside the class but outside of any method still causes the import to occur when the module is initialized.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.100.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.100.htp">Log info</A>
+
+/ Last changed on Sat Aug  4 04:44:47 2001 by
+<A HREF="mailto:tbryan@python.net">TAB</A>
+<P>
+
+<HR>
+<H2><A NAME="4.101">4.101. Is there a tool to help find bugs or perform static analysis?</A></H2>
+Yes.  PyChecker is a static analysis tool for finding bugs 
+in Python source code as well as warning about code complexity 
+and style.
+<P>
+You can get PyChecker from:  <A HREF="http://pychecker.sf.net">http://pychecker.sf.net</A>.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.101.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.101.htp">Log info</A>
+
+/ Last changed on Fri Aug 10 15:42:11 2001 by
+<A HREF="mailto:neal@metaslash.com">Neal</A>
+<P>
+
+<HR>
+<H2><A NAME="4.102">4.102. UnicodeError: ASCII [decoding,encoding] error: ordinal not in range(128)</A></H2>
+This error indicates that your Python installation can handle
+only 7-bit ASCII strings.  There are a couple ways to fix or
+workaround the problem.
+<P>
+If your programs must handle data in arbitary character set encodings, the environment the application runs in will generally identify the encoding of the data it is handing you.  You need to convert the input to Unicode data using that encoding.  For instance, a program that handles email or web input will typically find character set encoding information in Content-Type headers.  This can then be used to properly convert input data to Unicode. Assuming the string referred to by "value" is encoded as UTF-8:
+<P>
+<PRE>
+    value = unicode(value, "utf-8")
+</PRE>
+will return a Unicode object.  If the data is not correctly encoded as UTF-8, the above call will raise a UnicodeError.
+<P>
+If you only want strings coverted to Unicode which have non-ASCII data, you can try converting them first assuming an ASCII encoding, and then generate Unicode objects if that fails:
+<P>
+<PRE>
+    try:
+        x = unicode(value, "ascii")
+    except UnicodeError:
+        value = unicode(value, "utf-8")
+    else:
+        # value was valid ASCII data
+        pass
+</PRE>
+<P>
+If you normally use a character set encoding other than US-ASCII and only need to handle data in that encoding, the simplest way to fix the problem may be simply to set the encoding in sitecustomize.py. The following code is just a modified version of the encoding setup code from site.py with the relevant lines uncommented.
+<P>
+<PRE>
+    # Set the string encoding used by the Unicode implementation.
+    # The default is 'ascii'
+    encoding = "ascii" # &lt;= CHANGE THIS if you wish
+</PRE>
+<PRE>
+    # Enable to support locale aware default string encodings.
+    import locale
+    loc = locale.getdefaultlocale()
+    if loc[1]:
+        encoding = loc[1]
+    if encoding != "ascii":
+        import sys
+        sys.setdefaultencoding(encoding)
+</PRE>
+<P>
+Also note that on Windows, there is an encoding known as "mbcs", which uses an encoding specific to your current locale.  In many cases, and particularly when working with COM, this may be an appropriate default encoding to use.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.102.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.102.htp">Log info</A>
+
+/ Last changed on Sat Apr 13 04:45:41 2002 by
+<A HREF="mailto:skip@pobox.com">Skip Montanaro</A>
+<P>
+
+<HR>
+<H2><A NAME="4.103">4.103. Using strings to call functions/methods</A></H2>
+There are various techniques:
+<P>
+* Use a dictionary pre-loaded with strings and functions.  The primary
+advantage of this technique is that the strings do not need to match the
+names of the functions.  This is also the primary technique used to
+emulate a case construct:
+<P>
+<PRE>
+    def a():
+        pass
+</PRE>
+<PRE>
+    def b():
+        pass
+</PRE>
+<PRE>
+    dispatch = {'go': a, 'stop': b}  # Note lack of parens for funcs
+</PRE>
+<PRE>
+    dispatch[get_input()]()  # Note trailing parens to call function
+</PRE>
+* Use the built-in function getattr():
+<P>
+<PRE>
+    import foo
+    getattr(foo, 'bar')()
+</PRE>
+Note that getattr() works on any object, including classes, class
+instances, modules, and so on.
+<P>
+This is used in several places in the standard library, like
+this:
+<P>
+<PRE>
+    class Foo:
+        def do_foo(self):
+            ...
+</PRE>
+<PRE>
+        def do_bar(self):
+            ...
+</PRE>
+<PRE>
+     f = getattr(foo_instance, 'do_' + opname)
+     f()
+</PRE>
+<P>
+* Use locals() or eval() to resolve the function name:
+<P>
+def myFunc():
+<PRE>
+    print "hello"
+</PRE>
+fname = "myFunc"
+<P>
+f = locals()[fname]
+f()
+<P>
+f = eval(fname)
+f()
+<P>
+Note: Using eval() can be dangerous. If you don't have absolute control
+over the contents of the string, all sorts of things could happen...
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.103.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.103.htp">Log info</A>
+
+/ Last changed on Thu Mar 21 08:14:58 2002 by
+<A HREF="mailto:erno-pyfaq@erno.iki.fi">Erno Kuusela</A>
+<P>
+
+<HR>
+<H2><A NAME="4.104">4.104. How fast are exceptions?</A></H2>
+A try/except block is extremely efficient.  Actually executing an
+exception is expensive.  In older versions of Python (prior to 2.0), it
+was common to code this idiom:
+<P>
+<PRE>
+    try:
+        value = dict[key]
+    except KeyError:
+        dict[key] = getvalue(key)
+        value = dict[key]
+</PRE>
+This idiom only made sense when you expected the dict to have the key
+95% of the time or more; other times, you coded it like this:
+<P>
+<PRE>
+    if dict.has_key(key):
+        value = dict[key]
+    else:
+        dict[key] = getvalue(key)
+        value = dict[key]
+</PRE>
+In Python 2.0 and higher, of course, you can code this as
+<P>
+<PRE>
+    value = dict.setdefault(key, getvalue(key))
+</PRE>
+However this evaluates getvalue(key) always, regardless of whether it's needed or not.  So if it's slow or has a side effect you should use one of the above variants.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.104.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.104.htp">Log info</A>
+
+/ Last changed on Mon Dec  9 10:12:30 2002 by
+<A HREF="mailto:yeti@physics.muni.cz">Yeti</A>
+<P>
+
+<HR>
+<H2><A NAME="4.105">4.105. Sharing global variables across modules</A></H2>
+The canonical way to share information across modules within a single
+program is to create a special module (often called config or cfg).
+Just import the config module in all modules of your application; the
+module then becomes available as a global name.  Because there is only
+one instance of each module, any changes made to the module object get
+reflected everywhere.  For example:
+<P>
+config.py:
+<P>
+<PRE>
+    pass
+</PRE>
+mod.py:
+<P>
+<PRE>
+    import config
+    config.x = 1
+</PRE>
+main.py:
+<P>
+<PRE>
+    import config
+    import mod
+    print config.x
+</PRE>
+Note that using a module is also the basis for implementing the
+Singleton design pattern, for the same reason.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.105.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.105.htp">Log info</A>
+
+/ Last changed on Tue Apr 23 23:07:19 2002 by
+<A HREF="mailto:aahz@pythoncraft.com">Aahz</A>
+<P>
+
+<HR>
+<H2><A NAME="4.106">4.106. Why is cPickle so slow?</A></H2>
+Use the binary option.  We'd like to make that the default, but it would
+break backward compatibility:
+<P>
+<PRE>
+    largeString = 'z' * (100 * 1024)
+    myPickle = cPickle.dumps(largeString, 1)
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.106.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.106.htp">Log info</A>
+
+/ Last changed on Thu Aug 22 19:54:25 2002 by
+<A HREF="mailto:aahz@pythoncraft.com">Aahz</A>
+<P>
+
+<HR>
+<H2><A NAME="4.107">4.107. When importing module XXX, why do I get &quot;undefined symbol: PyUnicodeUCS2_...&quot; ?</A></H2>
+You are using a version of Python that uses a 4-byte representation for
+Unicode characters, but the extension module you are importing (possibly
+indirectly) was compiled using a Python that uses a 2-byte representation
+for Unicode characters (the default).
+<P>
+If instead the name of the undefined symbol starts with PyUnicodeUCS4_,
+the problem is the same by the relationship is reversed:  Python was
+built using 2-byte Unicode characters, and the extension module was
+compiled using a Python with 4-byte Unicode characters.
+<P>
+This can easily occur when using pre-built extension packages.  RedHat
+Linux 7.x, in particular, provides a "python2" binary that is compiled
+with 4-byte Unicode.  This only causes the link failure if the extension
+uses any of the PyUnicode_*() functions.  It is also a problem if if an
+extension uses any of the Unicode-related format specifiers for
+Py_BuildValue (or similar) or parameter-specifications for
+PyArg_ParseTuple().
+<P>
+You can check the size of the Unicode character a Python interpreter is
+using by checking the value of sys.maxunicode:
+<P>
+<PRE>
+  >>> import sys
+  >>> if sys.maxunicode > 65535:
+  ...     print 'UCS4 build'
+  ... else:
+  ...     print 'UCS2 build'
+</PRE>
+The only way to solve this problem is to use extension modules compiled
+with a Python binary built using the same size for Unicode characters.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.107.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.107.htp">Log info</A>
+
+/ Last changed on Tue Aug 27 15:00:17 2002 by
+<A HREF="mailto:fdrake@acm.org">Fred Drake</A>
+<P>
+
+<HR>
+<H2><A NAME="4.108">4.108. How do I create a .pyc file?</A></H2>
+QUESTION:
+<P>
+I have a module and I wish to generate a .pyc file.  
+How do I do it? Everything I read says that generation of a .pyc file is 
+"automatic", but I'm not getting anywhere.  
+<P>
+<P>
+ANSWER: 
+<P>
+When a module is imported for the first time (or when the source is more
+recent than the current compiled file) a .pyc file containing the compiled code should be created in the
+same directory as the .py file.
+<P>
+One reason that a .pyc file may not be created is permissions problems with the directory. This can happen, for example, if you develop as one user but run as another, such as if you are testing with a web server.
+<P>
+However, in most cases, that's not the problem.
+<P>
+Creation of a .pyc file is "automatic" if you are importing a module and Python has the
+ability (permissions, free space, etc...) to write the compiled module
+back to the directory. But note that running Python on a top level script is not considered an
+import and so no .pyc will be created automatically.  For example, if you have a top-level module abc.py that imports another module xyz.py, when you run abc, xyz.pyc will be created since xyz is imported, but no abc.pyc file will be created since abc isn't imported.
+<P>
+If you need to create abc.pyc -- that is, to create a .pyc file for a
+module that is not imported -- you can.  (Look up
+the py_compile and compileall modules in the Library Reference.) 
+<P>
+You can manually compile any module using the "py_compile" module.  One
+way is to use the compile() function in that module interactively:
+<P>
+<PRE>
+    >>> import py_compile
+    >>> py_compile.compile('abc.py')
+</PRE>
+This will write the .pyc to the same location as abc.py (or you
+can override that with the optional parameter cfile).
+<P>
+You can also automatically compile all files in a directory or
+directories using the "compileall" module, which can also be run
+straight from the command line.
+<P>
+You can do it from the shell (or DOS) prompt by entering:
+<PRE>
+       python compile.py abc.py
+</PRE>
+or 
+<PRE>
+       python compile.py *
+</PRE>
+Or you can write a script to do it on a list of filenames that you enter.
+<P>
+<PRE>
+     import sys
+     from py_compile import compile
+</PRE>
+<PRE>
+     if len(sys.argv) &lt;= 1:
+        sys.exit(1)
+</PRE>
+<PRE>
+     for file in sys.argv[1:]:
+        compile(file)
+</PRE>
+ACKNOWLEDGMENTS:
+<P>
+Steve Holden, David Bolen, Rich Somerfield,  Oleg Broytmann, Steve Ferg
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq04.108.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq04.108.htp">Log info</A>
+
+/ Last changed on Wed Feb 12 15:58:25 2003 by
+<A HREF="mailto:steve@ferg.org">Stephen Ferg</A>
+<P>
+
+<HR>
+<H1>5. Extending Python</H1>
+
+<HR>
+<H2><A NAME="5.1">5.1. Can I create my own functions in C?</A></H2>
+Yes, you can create built-in modules containing functions,
+variables, exceptions and even new types in C.  This is explained in
+the document "Extending and Embedding the Python Interpreter" (<A HREF="http://www.python.org/doc/current/ext/ext.html">http://www.python.org/doc/current/ext/ext.html</A>).  Also read the chapter
+on dynamic loading.
+<P>
+There's more information on this in each of the Python books:
+Programming Python, Internet Programming with Python, and Das Python-Buch
+(in German).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.001.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.001.htp">Log info</A>
+
+/ Last changed on Mon Dec 10 05:18:57 2001 by
+<A HREF="mailto:fdrake@acm.org">Fred L. Drake, Jr.</A>
+<P>
+
+<HR>
+<H2><A NAME="5.2">5.2. Can I create my own functions in C++?</A></H2>
+Yes, using the C-compatibility features found in C++.  Basically
+you place extern "C" { ... } around the Python include files and put
+extern "C" before each function that is going to be called by the
+Python interpreter.  Global or static C++ objects with constructors
+are probably not a good idea.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.002.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.002.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="5.3">5.3. How can I execute arbitrary Python statements from C?</A></H2>
+The highest-level function to do this is PyRun_SimpleString() which takes
+a single string argument which is executed in the context of module
+__main__ and returns 0 for success and -1 when an exception occurred
+(including SyntaxError).  If you want more control, use PyRun_String();
+see the source for PyRun_SimpleString() in Python/pythonrun.c.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.003.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.003.htp">Log info</A>
+
+/ Last changed on Fri May 23 20:08:14 1997 by
+<A HREF="mailto:billtut@microsoft.com">Bill Tutt</A>
+<P>
+
+<HR>
+<H2><A NAME="5.4">5.4. How can I evaluate an arbitrary Python expression from C?</A></H2>
+Call the function PyRun_String() from the previous question with the
+start symbol eval_input (Py_eval_input starting with 1.5a1); it 
+parses an expression, evaluates it and returns its value.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.004.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.004.htp">Log info</A>
+
+/ Last changed on Wed May 21 22:23:18 1997 by
+<A HREF="mailto:david_ascher@brown.edu">David Ascher</A>
+<P>
+
+<HR>
+<H2><A NAME="5.5">5.5. How do I extract C values from a Python object?</A></H2>
+That depends on the object's type.  If it's a tuple,
+PyTupleSize(o) returns its length and PyTuple_GetItem(o, i)
+returns its i'th item; similar for lists with PyListSize(o)
+and PyList_GetItem(o, i).  For strings, PyString_Size(o) returns
+its length and PyString_AsString(o) a pointer to its value
+(note that Python strings may contain null bytes so strlen()
+is not safe).  To test which type an object is, first make sure
+it isn't NULL, and then use PyString_Check(o), PyTuple_Check(o),
+PyList_Check(o), etc.
+<P>
+There is also a high-level API to Python objects which is
+provided by the so-called 'abstract' interface -- read
+Include/abstract.h for further details.  It allows for example 
+interfacing with any kind of Python sequence (e.g. lists and tuples)
+using calls like PySequence_Length(), PySequence_GetItem(), etc.)
+as well as many other useful protocols.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.005.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.005.htp">Log info</A>
+
+/ Last changed on Wed May 21 22:34:20 1997 by
+<A HREF="mailto:david_ascher@brown.edu">David Ascher</A>
+<P>
+
+<HR>
+<H2><A NAME="5.6">5.6. How do I use Py_BuildValue() to create a tuple of arbitrary length?</A></H2>
+You can't.  Use t = PyTuple_New(n) instead, and fill it with
+objects using PyTuple_SetItem(t, i, o) -- note that this "eats" a
+reference count of o.  Similar for lists with PyList_New(n) and
+PyList_SetItem(l, i, o).  Note that you <I>must</I> set all the tuple items to
+some value before you pass the tuple to Python code --
+PyTuple_New(n) initializes them to NULL, which isn't a valid Python
+value.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.006.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.006.htp">Log info</A>
+
+/ Last changed on Thu Jul 31 18:15:29 1997 by
+<A HREF="mailto:guido@python.org">Guido van Rossum</A>
+<P>
+
+<HR>
+<H2><A NAME="5.7">5.7. How do I call an object's method from C?</A></H2>
+The PyObject_CallMethod() function can be used to call an arbitrary
+method of an object.  The parameters are the object, the name of the
+method to call, a format string like that used with Py_BuildValue(), and the argument values:
+<P>
+<PRE>
+    PyObject *
+    PyObject_CallMethod(PyObject *object, char *method_name,
+                        char *arg_format, ...);
+</PRE>
+This works for any object that has methods -- whether built-in or
+user-defined.  You are responsible for eventually DECREF'ing the
+return value.
+<P>
+To call, e.g., a file object's "seek" method with arguments 10, 0
+(assuming the file object pointer is "f"):
+<P>
+<PRE>
+        res = PyObject_CallMethod(f, "seek", "(ii)", 10, 0);
+        if (res == NULL) {
+                ... an exception occurred ...
+        }
+        else {
+                Py_DECREF(res);
+        }
+</PRE>
+Note that since PyObject_CallObject() <I>always</I> wants a tuple for the
+argument list, to call a function without arguments, pass "()" for the
+format, and to call a function with one argument, surround the argument
+in parentheses, e.g. "(i)".
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.007.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.007.htp">Log info</A>
+
+/ Last changed on Thu Jun  6 16:15:46 2002 by
+<A HREF="mailto:neal@metaslash.com">Neal Norwitz</A>
+<P>
+
+<HR>
+<H2><A NAME="5.8">5.8. How do I catch the output from PyErr_Print() (or anything that prints to stdout/stderr)?</A></H2>
+(Due to Mark Hammond):
+<P>
+In Python code, define an object that supports the "write()" method.
+Redirect sys.stdout and sys.stderr to this object.
+Call print_error, or just allow the standard traceback mechanism to
+work. Then, the output will go wherever your write() method sends it.
+<P>
+The easiest way to do this is to use the StringIO class in the standard
+library.
+<P>
+Sample code and use for catching stdout:
+<PRE>
+	>>> class StdoutCatcher:
+	...  def __init__(self):
+	...   self.data = ''
+	...  def write(self, stuff):
+	...   self.data = self.data + stuff
+	...  
+	>>> import sys
+	>>> sys.stdout = StdoutCatcher()
+	>>> print 'foo'
+	>>> print 'hello world!'
+	>>> sys.stderr.write(sys.stdout.data)
+	foo
+	hello world!
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.008.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.008.htp">Log info</A>
+
+/ Last changed on Wed Dec 16 18:34:25 1998 by
+<A HREF="mailto:richard@bofh.asn.au">Richard Jones</A>
+<P>
+
+<HR>
+<H2><A NAME="5.9">5.9. How do I access a module written in Python from C?</A></H2>
+You can get a pointer to the module object as follows:
+<P>
+<PRE>
+        module = PyImport_ImportModule("&lt;modulename&gt;");
+</PRE>
+If the module hasn't been imported yet (i.e. it is not yet present in
+sys.modules), this initializes the module; otherwise it simply returns
+the value of sys.modules["&lt;modulename&gt;"].  Note that it doesn't enter
+the module into any namespace -- it only ensures it has been
+initialized and is stored in sys.modules.
+<P>
+You can then access the module's attributes (i.e. any name defined in
+the module) as follows:
+<P>
+<PRE>
+        attr = PyObject_GetAttrString(module, "&lt;attrname&gt;");
+</PRE>
+Calling PyObject_SetAttrString(), to assign to variables in the module, also works.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.009.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.009.htp">Log info</A>
+
+/ Last changed on Wed May 21 22:56:40 1997 by
+<A HREF="mailto:david_ascher@brown.edu">david ascher</A>
+<P>
+
+<HR>
+<H2><A NAME="5.10">5.10. How do I interface to C++ objects from Python?</A></H2>
+Depending on your requirements, there are many approaches.  To do
+this manually, begin by reading the "Extending and Embedding" document
+(Doc/ext.tex, see also <A HREF="http://www.python.org/doc">http://www.python.org/doc</A>/).  Realize
+that for the Python run-time system, there isn't a whole lot of
+difference between C and C++ -- so the strategy to build a new Python
+type around a C structure (pointer) type will also work for C++
+objects.
+<P>
+A useful automated approach (which also works for C) is SWIG:
+<A HREF="http://www.swig.org">http://www.swig.org</A>/.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.010.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.010.htp">Log info</A>
+
+/ Last changed on Fri Oct 15 05:14:01 1999 by
+<A HREF="mailto:sjoerd.mullender@oratrix.nl">Sjoerd Mullender</A>
+<P>
+
+<HR>
+<H2><A NAME="5.11">5.11. mSQLmodule (or other old module) won't build with Python 1.5 (or later)</A></H2>
+Since python-1.4 "Python.h" will have the file includes needed in an 
+extension module.
+Backward compatibility is dropped after version 1.4 and therefore 
+mSQLmodule.c will not build as "allobjects.h" cannot be found. 
+The following change in mSQLmodule.c is harmless when building it with
+1.4 and necessary when doing so for later python versions:
+<P>
+Remove lines:
+<P>
+<PRE>
+	#include "allobjects.h"
+	#include "modsupport.h"
+</PRE>
+And insert instead:
+<P>
+<PRE>
+	#include "Python.h"
+</PRE>
+You may also need to add
+<P>
+<PRE>
+                #include "rename2.h"
+</PRE>
+if the module uses "old names".
+<P>
+This may happen with other ancient python modules as well,
+and the same fix applies.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.011.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.011.htp">Log info</A>
+
+/ Last changed on Sun Dec 21 02:03:35 1997 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="5.12">5.12. I added a module using the Setup file and the make fails! Huh?</A></H2>
+Setup must end in a newline, if there is no newline there it gets
+very sad.  Aside from this possibility, maybe you have other
+non-Python-specific linkage problems.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.012.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.012.htp">Log info</A>
+
+/ Last changed on Tue Jun 24 15:54:01 1997 by
+<A HREF="mailto:aaron_watters@msn.com">aaron watters</A>
+<P>
+
+<HR>
+<H2><A NAME="5.13">5.13. I want to compile a Python module on my Red Hat Linux system, but some files are missing.</A></H2>
+Red Hat's RPM for Python doesn't include the 
+/usr/lib/python1.x/config/ directory, which contains various files required 
+for compiling Python extensions.
+Install the python-devel RPM to get the necessary files.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.013.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.013.htp">Log info</A>
+
+/ Last changed on Tue Jan 26 13:44:04 1999 by
+<A HREF="mailto:akuchling@acm.org">A.M. Kuchling</A>
+<P>
+
+<HR>
+<H2><A NAME="5.14">5.14. What does &quot;SystemError: _PyImport_FixupExtension: module yourmodule not loaded&quot; mean?</A></H2>
+This means that you have created an extension module named "yourmodule", but your module init function does not initialize with that name.
+<P>
+Every module init function will have a line similar to:
+<P>
+<PRE>
+  module = Py_InitModule("yourmodule", yourmodule_functions);
+</PRE>
+If the string passed to this function is not the same name as your extenion module, the SystemError will be raised.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.014.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.014.htp">Log info</A>
+
+/ Last changed on Thu Mar 25 07:16:08 1999 by
+<A HREF="mailto:mhammond@skippinet.com.au">Mark Hammond</A>
+<P>
+
+<HR>
+<H2><A NAME="5.15">5.15. How to tell &quot;incomplete input&quot; from &quot;invalid input&quot;?</A></H2>
+Sometimes you want to emulate the Python interactive interpreter's
+behavior, where it gives you a continuation prompt when the input
+is incomplete (e.g. you typed the start of an "if" statement
+or you didn't close your parentheses or triple string quotes),
+but it gives you a syntax error message immediately when the input
+is invalid.
+<P>
+In Python you can use the codeop module, which approximates the
+parser's behavior sufficiently.  IDLE uses this, for example.
+<P>
+The easiest way to do it in C is to call PyRun_InteractiveLoop()
+(in a separate thread maybe) and let the Python interpreter handle
+the input for you. You can also set the PyOS_ReadlineFunctionPointer
+to point at your custom input function. See Modules/readline.c and
+Parser/myreadline.c for more hints.
+<P>
+However sometimes you have to run the embedded Python interpreter
+in the same thread as your rest application and you can't allow the
+PyRun_InteractiveLoop() to stop while waiting for user input.
+The one solution then is to call PyParser_ParseString()
+and test for e.error equal to E_EOF (then the input is incomplete).
+Sample code fragment, untested, inspired by code from  Alex Farber:
+<P>
+<PRE>
+  #include &lt;Python.h&gt;
+  #include &lt;node.h&gt;
+  #include &lt;errcode.h&gt;
+  #include &lt;grammar.h&gt;
+  #include &lt;parsetok.h&gt;
+  #include &lt;compile.h&gt;
+</PRE>
+<PRE>
+  int testcomplete(char *code)
+    /* code should end in \n */
+    /* return -1 for error, 0 for incomplete, 1 for complete */
+  {
+    node *n;
+    perrdetail e;
+</PRE>
+<PRE>
+    n = PyParser_ParseString(code, &amp;_PyParser_Grammar,
+                             Py_file_input, &amp;e);
+    if (n == NULL) {
+      if (e.error == E_EOF) 
+        return 0;
+      return -1;
+    }
+</PRE>
+<PRE>
+    PyNode_Free(n);
+    return 1;
+  }
+</PRE>
+Another solution is trying to compile the received string with 
+Py_CompileString(). If it compiles fine - try to execute the returned 
+code object by calling PyEval_EvalCode(). Otherwise save the input for 
+later. If the compilation fails, find out if it's an error or just 
+more input is required - by extracting the message string from the 
+exception tuple and comparing it to the "unexpected EOF while parsing".
+Here is a complete example using the GNU readline library (you may
+want to ignore SIGINT while calling readline()):
+<P>
+<PRE>
+  #include &lt;stdio.h&gt;
+  #include &lt;readline.h&gt;
+</PRE>
+<PRE>
+  #include &lt;Python.h&gt;
+  #include &lt;object.h&gt;
+  #include &lt;compile.h&gt;
+  #include &lt;eval.h&gt;
+</PRE>
+<PRE>
+  int main (int argc, char* argv[])
+  {
+    int i, j, done = 0;                          /* lengths of line, code */
+    char ps1[] = ">>> ";
+    char ps2[] = "... ";
+    char *prompt = ps1;
+    char *msg, *line, *code = NULL;
+    PyObject *src, *glb, *loc;
+    PyObject *exc, *val, *trb, *obj, *dum;
+</PRE>
+<PRE>
+    Py_Initialize ();
+    loc = PyDict_New ();
+    glb = PyDict_New ();
+    PyDict_SetItemString (glb, "__builtins__", PyEval_GetBuiltins ());
+</PRE>
+<PRE>
+    while (!done)
+    {
+      line = readline (prompt);
+</PRE>
+<PRE>
+      if (NULL == line)                          /* CTRL-D pressed */
+      {
+        done = 1;
+      }
+      else
+      {
+        i = strlen (line);
+</PRE>
+<PRE>
+        if (i > 0)
+          add_history (line);                    /* save non-empty lines */
+</PRE>
+<PRE>
+        if (NULL == code)                        /* nothing in code yet */
+          j = 0;
+        else
+          j = strlen (code);
+</PRE>
+<PRE>
+        code = realloc (code, i + j + 2);
+        if (NULL == code)                        /* out of memory */
+          exit (1);
+</PRE>
+<PRE>
+        if (0 == j)                              /* code was empty, so */
+          code[0] = '\0';                        /* keep strncat happy */
+</PRE>
+<PRE>
+        strncat (code, line, i);                 /* append line to code */
+        code[i + j] = '\n';                      /* append '\n' to code */
+        code[i + j + 1] = '\0';
+</PRE>
+<PRE>
+        src = Py_CompileString (code, "&lt;stdin&gt;", Py_single_input);       
+</PRE>
+<PRE>
+        if (NULL != src)                         /* compiled just fine - */
+        {
+          if (ps1  == prompt ||                  /* "&gt;&gt;&gt; " or */
+              '\n' == code[i + j - 1])           /* "... " and double '\n' */
+          {                                               /* so execute it */
+            dum = PyEval_EvalCode ((PyCodeObject *)src, glb, loc);
+            Py_XDECREF (dum);
+            Py_XDECREF (src);
+            free (code);
+            code = NULL;
+            if (PyErr_Occurred ())
+              PyErr_Print ();
+            prompt = ps1;
+          }
+        }                                        /* syntax error or E_EOF? */
+        else if (PyErr_ExceptionMatches (PyExc_SyntaxError))           
+        {
+          PyErr_Fetch (&amp;exc, &amp;val, &amp;trb);        /* clears exception! */
+</PRE>
+<PRE>
+          if (PyArg_ParseTuple (val, "sO", &amp;msg, &amp;obj) &amp;&amp;
+              !strcmp (msg, "unexpected EOF while parsing")) /* E_EOF */
+          {
+            Py_XDECREF (exc);
+            Py_XDECREF (val);
+            Py_XDECREF (trb);
+            prompt = ps2;
+          }
+          else                                   /* some other syntax error */
+          {
+            PyErr_Restore (exc, val, trb);
+            PyErr_Print ();
+            free (code);
+            code = NULL;
+            prompt = ps1;
+          }
+        }
+        else                                     /* some non-syntax error */
+        {
+          PyErr_Print ();
+          free (code);
+          code = NULL;
+          prompt = ps1;
+        }
+</PRE>
+<PRE>
+        free (line);
+      }
+    }
+</PRE>
+<PRE>
+    Py_XDECREF(glb);
+    Py_XDECREF(loc);
+    Py_Finalize();
+    exit(0);
+  }
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.015.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.015.htp">Log info</A>
+
+/ Last changed on Wed Mar 15 09:47:24 2000 by
+<A HREF="mailto:farber@cpan.org">Alex Farber</A>
+<P>
+
+<HR>
+<H2><A NAME="5.16">5.16. How do I debug an extension?</A></H2>
+When using gdb with dynamically loaded extensions, you can't set a 
+breakpoint in your extension until your extension is loaded.
+<P>
+In your .gdbinit file (or interactively), add the command
+<P>
+br _PyImport_LoadDynamicModule
+<P>
+<P>
+$ gdb /local/bin/python
+<P>
+gdb) run myscript.py
+<P>
+gdb) continue # repeat until your extension is loaded
+<P>
+gdb) finish   # so that your extension is loaded
+<P>
+gdb) br myfunction.c:50
+<P>
+gdb) continue
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.016.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.016.htp">Log info</A>
+
+/ Last changed on Fri Oct 20 11:10:32 2000 by
+<A HREF="mailto:vanandel@ucar.edu">Joe VanAndel</A>
+<P>
+
+<HR>
+<H2><A NAME="5.17">5.17. How do I find undefined Linux g++ symbols, __builtin_new or __pure_virtural</A></H2>
+To dynamically load g++ extension modules, you must recompile python, relink python using g++ (change LINKCC in the python Modules Makefile), and link your extension module using g++ (e.g., "g++ -shared -o mymodule.so mymodule.o").
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.017.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.017.htp">Log info</A>
+
+/ Last changed on Sun Jan 14 18:03:51 2001 by
+<A HREF="mailto:dbo@angryduck.com">douglas orr</A>
+<P>
+
+<HR>
+<H2><A NAME="5.18">5.18. How do I define and create objects corresponding to built-in/extension types</A></H2>
+Usually you would like to be able to inherit from a Python type when
+you ask this question. The bottom line for Python 2.2 is: types and classes are miscible. You build instances by calling classes, and you can build subclasses to your heart's desire.
+<P>
+You need to be careful when instantiating immutable types like integers or strings. See <A HREF="http://www.amk.ca/python/2.2">http://www.amk.ca/python/2.2</A>/, section 2, for details.
+<P>
+Prior to version 2.2, Python (like Java) insisted that there are first-class and second-class objects (the former are types, the latter classes), and never the twain shall meet.
+<P>
+The library has, however, done a good job of providing class wrappers for the more commonly desired objects (see UserDict, UserList and UserString for examples), and more are always welcome if you happen to be in the mood to write code. These wrappers still exist in Python 2.2.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq05.018.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq05.018.htp">Log info</A>
+
+/ Last changed on Mon Jun 10 15:14:07 2002 by
+<A HREF="mailto:smurf@noris.de">Matthias Urlichs</A>
+<P>
+
+<HR>
+<H1>6. Python's design</H1>
+
+<HR>
+<H2><A NAME="6.1">6.1. Why isn't there a switch or case statement in Python?</A></H2>
+You can do this easily enough with a sequence of
+if... elif... elif... else.  There have been some proposals for switch
+statement syntax, but there is no consensus (yet) on whether and how
+to do range tests.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.001.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.001.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="6.2">6.2. Why does Python use indentation for grouping of statements?</A></H2>
+Basically I believe that using indentation for grouping is
+extremely elegant and contributes a lot to the clarity of the average
+Python program.  Most people learn to love this feature after a while.
+Some arguments for it:
+<P>
+Since there are no begin/end brackets there cannot be a disagreement
+between grouping perceived by the parser and the human reader.  I
+remember long ago seeing a C fragment like this:
+<P>
+<PRE>
+        if (x &lt;= y)
+                x++;
+                y--;
+        z++;
+</PRE>
+and staring a long time at it wondering why y was being decremented
+even for x > y...  (And I wasn't a C newbie then either.)
+<P>
+Since there are no begin/end brackets, Python is much less prone to
+coding-style conflicts.  In C there are loads of different ways to
+place the braces (including the choice whether to place braces around
+single statements in certain cases, for consistency).  If you're used
+to reading (and writing) code that uses one style, you will feel at
+least slightly uneasy when reading (or being required to write)
+another style.
+Many coding styles place begin/end brackets on a line by themself.
+This makes programs considerably longer and wastes valuable screen
+space, making it harder to get a good overview over a program.
+Ideally, a function should fit on one basic tty screen (say, 20
+lines).  20 lines of Python are worth a LOT more than 20 lines of C.
+This is not solely due to the lack of begin/end brackets (the lack of
+declarations also helps, and the powerful operations of course), but
+it certainly helps!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.002.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.002.htp">Log info</A>
+
+/ Last changed on Wed May 21 16:00:15 1997 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="6.3">6.3. Why are Python strings immutable?</A></H2>
+There are two advantages.  One is performance: knowing that a
+string is immutable makes it easy to lay it out at construction time
+-- fixed and unchanging storage requirements.  (This is also one of
+the reasons for the distinction between tuples and lists.)  The
+other is that strings in Python are considered as "elemental" as
+numbers.  No amount of activity will change the value 8 to anything
+else, and in Python, no amount of activity will change the string
+"eight" to anything else.  (Adapted from Jim Roskind)
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.003.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.003.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="6.4">6.4. Delete</A></H2>
+<P>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.004.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.004.htp">Log info</A>
+
+/ Last changed on Tue Jan  2 03:05:25 2001 by
+<A HREF="mailto:moshez@zadka.site.co.il">Moshe Zadka</A>
+<P>
+
+<HR>
+<H2><A NAME="6.5">6.5. Why does Python use methods for some functionality (e.g. list.index()) but functions for other (e.g. len(list))?</A></H2>
+The major reason is history. Functions were used for those
+operations that were generic for a group of types and which
+were intended to work even for objects that didn't have
+methods at all (e.g. numbers before type/class unification
+began, or tuples).
+<P>
+It is also convenient to have a function that can readily be applied
+to an amorphous collection of objects when you use the functional features of Python (map(), apply() et al).
+<P>
+In fact, implementing len(), max(), min() as a built-in function is
+actually less code than implementing them as methods for each type.
+One can quibble about individual cases but it's a part of Python,
+and it's too late to change such things fundamentally now. The
+functions have to remain to avoid massive code breakage.
+<P>
+Note that for string operations Python has moved from external functions
+(the string module) to methods.  However, len() is still a function.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.005.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.005.htp">Log info</A>
+
+/ Last changed on Thu May 30 14:08:58 2002 by
+<A HREF="mailto:sholden@holdenweb.com">Steve Holden</A>
+<P>
+
+<HR>
+<H2><A NAME="6.6">6.6. Why can't I derive a class from built-in types (e.g. lists or files)?</A></H2>
+As of Python 2.2, you can derive from built-in types.  For previous versions, the answer is:
+<P>
+This is caused by the relatively late addition of (user-defined)
+classes to the language -- the implementation framework doesn't easily
+allow it.  See the answer to question 4.2 for a work-around.  This
+<I>may</I> be fixed in the (distant) future.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.006.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.006.htp">Log info</A>
+
+/ Last changed on Thu May 23 02:53:22 2002 by
+<A HREF="mailto:neal@metaslash.com">Neal Norwitz</A>
+<P>
+
+<HR>
+<H2><A NAME="6.7">6.7. Why must 'self' be declared and used explicitly in method definitions and calls?</A></H2>
+So, is your current programming language C++ or Java? :-)
+When classes were added to Python, this was (again) the simplest way of
+implementing methods without too many changes to the interpreter.  The
+idea was borrowed from Modula-3.  It turns out to be very useful, for
+a variety of reasons.
+<P>
+First, it makes it more obvious that you are using a method or
+instance attribute instead of a local variable.  Reading "self.x" or
+"self.meth()" makes it absolutely clear that an instance variable or
+method is used even if you don't know the class definition by heart.
+In C++, you can sort of tell by the lack of a local variable
+declaration (assuming globals are rare or easily recognizable) -- but
+in Python, there are no local variable declarations, so you'd have to
+look up the class definition to be sure.
+<P>
+Second, it means that no special syntax is necessary if you want to
+explicitly reference or call the method from a particular class.  In
+C++, if you want to use a method from base class that is overridden in
+a derived class, you have to use the :: operator -- in Python you can
+write baseclass.methodname(self, &lt;argument list&gt;).  This is
+particularly useful for __init__() methods, and in general in cases
+where a derived class method wants to extend the base class method of
+the same name and thus has to call the base class method somehow.
+<P>
+Lastly, for instance variables, it solves a syntactic problem with
+assignment: since local variables in Python are (by definition!) those
+variables to which a value assigned in a function body (and that
+aren't explicitly declared global), there has to be some way to tell
+the interpreter that an assignment was meant to assign to an instance
+variable instead of to a local variable, and it should preferably be
+syntactic (for efficiency reasons).  C++ does this through
+declarations, but Python doesn't have declarations and it would be a
+pity having to introduce them just for this purpose.  Using the
+explicit "self.var" solves this nicely.  Similarly, for using instance
+variables, having to write "self.var" means that references to
+unqualified names inside a method don't have to search the instance's
+directories.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.007.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.007.htp">Log info</A>
+
+/ Last changed on Fri Jan 12 08:01:50 2001 by
+<A HREF="mailto:sholden@holdenweb.com">Steve Holden</A>
+<P>
+
+<HR>
+<H2><A NAME="6.8">6.8. Can't you emulate threads in the interpreter instead of relying on an OS-specific thread implementation?</A></H2>
+Answer 1: Unfortunately, the interpreter pushes at least one C stack
+frame for each Python stack frame.  Also, extensions can call back into
+Python at almost random moments.  Therefore a complete threads
+implementation requires thread support for C.
+<P>
+Answer 2: Fortunately, there is Stackless Python, which has a completely redesigned interpreter loop that avoids the C stack. It's still experimental but looks very promising. Although it is binary compatible with standard Python, it's still unclear whether Stackless will make it into the core -- maybe it's just too revolutionary. Stackless Python currently lives here: <A HREF="http://www.stackless.com">http://www.stackless.com</A>. A microthread implementation that uses it can be found here: <A HREF="http://world.std.com/~wware/uthread.html">http://world.std.com/~wware/uthread.html</A>.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.008.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.008.htp">Log info</A>
+
+/ Last changed on Sat Apr 15 08:18:16 2000 by
+<A HREF="mailto:just@letterror.com">Just van Rossum</A>
+<P>
+
+<HR>
+<H2><A NAME="6.9">6.9. Why can't lambda forms contain statements?</A></H2>
+Python lambda forms cannot contain statements because Python's
+syntactic framework can't handle statements nested inside expressions.
+<P>
+However, in Python, this is not a serious problem.  Unlike lambda
+forms in other languages, where they add functionality, Python lambdas
+are only a shorthand notation if you're too lazy to define a function.
+<P>
+Functions are already first class objects in Python, and can be
+declared in a local scope.  Therefore the only advantage of using a
+lambda form instead of a locally-defined function is that you don't need to invent a name for the function -- but that's just a local variable to which the function object (which is exactly the same type of object that a lambda form yields) is assigned!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.009.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.009.htp">Log info</A>
+
+/ Last changed on Sun Jun 14 14:15:17 1998 by
+<A HREF="mailto:tim_one@email.msn.com">Tim Peters</A>
+<P>
+
+<HR>
+<H2><A NAME="6.10">6.10. [deleted]</A></H2>
+[lambda vs non-nested scopes used to be here]
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.010.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.010.htp">Log info</A>
+
+/ Last changed on Thu Mar 21 05:20:56 2002 by
+<A HREF="mailto:erno-pyfaq@erno.iki.fi">Erno Kuusela</A>
+<P>
+
+<HR>
+<H2><A NAME="6.11">6.11. [deleted]</A></H2>
+[recursive functions vs non-nested scopes used to be here]
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.011.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.011.htp">Log info</A>
+
+/ Last changed on Thu Mar 21 05:22:04 2002 by
+<A HREF="mailto:erno-pyfaq@erno.iki.fi">Erno Kuusela</A>
+<P>
+
+<HR>
+<H2><A NAME="6.12">6.12. Why is there no more efficient way of iterating over a dictionary than first constructing the list of keys()?</A></H2>
+As of Python 2.2, you can now iterate over a dictionary directly,
+using the new implied dictionary iterator:
+<P>
+<PRE>
+    for k in d: ...
+</PRE>
+There are also methods returning iterators over the values and items:
+<P>
+<PRE>
+    for k in d.iterkeys(): # same as above
+    for v in d.itervalues(): # iterate over values
+    for k, v in d.iteritems(): # iterate over items
+</PRE>
+All these require that you do not modify the dictionary during the loop.
+<P>
+For previous Python versions, the following defense should do:
+<P>
+Have you tried it?  I bet it's fast enough for your purposes!  In
+most cases such a list takes only a few percent of the space occupied
+by the dictionary.  Apart from the fixed header,
+the list needs only 4 bytes (the size of a pointer) per
+key.  A dictionary uses 12 bytes per key plus between 30 and 70
+percent hash table overhead, plus the space for the keys and values.
+By necessity, all keys are distinct objects, and a string object (the most
+common key type) costs at least 20 bytes plus the length of the
+string.  Add to that the values contained in the dictionary, and you
+see that 4 bytes more per item really isn't that much more memory...
+<P>
+A call to dict.keys() makes one fast scan over the dictionary
+(internally, the iteration function does exist) copying the pointers
+to the key objects into a pre-allocated list object of the right size.
+The iteration time isn't lost (since you'll have to iterate anyway --
+unless in the majority of cases your loop terminates very prematurely
+(which I doubt since you're getting the keys in random order).
+<P>
+I don't expose the dictionary iteration operation to Python
+programmers because the dictionary shouldn't be modified during the
+entire iteration -- if it is, there's a small chance that the
+dictionary is reorganized because the hash table becomes too full, and
+then the iteration may miss some items and see others twice.  Exactly
+because this only occurs rarely, it would lead to hidden bugs in
+programs: it's easy never to have it happen during test runs if you
+only insert or delete a few items per iteration -- but your users will 
+surely hit upon it sooner or later.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.012.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.012.htp">Log info</A>
+
+/ Last changed on Fri May 24 21:24:08 2002 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="6.13">6.13. Can Python be compiled to machine code, C or some other language?</A></H2>
+Not easily.  Python's high level data types, dynamic typing of
+objects and run-time invocation of the interpreter (using eval() or
+exec) together mean that a "compiled" Python program would probably
+consist mostly of calls into the Python run-time system, even for
+seemingly simple operations like "x+1".
+<P>
+Several projects described in the Python newsgroup or at past
+Python conferences have shown that this approach is feasible,
+although the speedups reached so far are only modest (e.g. 2x).
+JPython uses the same strategy for compiling to Java bytecode.
+(Jim Hugunin has demonstrated that in combination with whole-program
+analysis, speedups of 1000x are feasible for small demo programs.
+See the website for the 1997 Python conference.)
+<P>
+Internally, Python source code is always translated into a "virtual
+machine code" or "byte code" representation before it is interpreted
+(by the "Python virtual machine" or "bytecode interpreter").  In order
+to avoid the overhead of parsing and translating modules that rarely
+change over and over again, this byte code is written on a file whose
+name ends in ".pyc" whenever a module is parsed (from a file whose
+name ends in ".py").  When the corresponding .py file is changed, it
+is parsed and translated again and the .pyc file is rewritten.
+<P>
+There is no performance difference once the .pyc file has been loaded
+(the bytecode read from the .pyc file is exactly the same as the bytecode
+created by direct translation).  The only difference is that loading
+code from a .pyc file is faster than parsing and translating a .py
+file, so the presence of precompiled .pyc files will generally improve
+start-up time of Python scripts.  If desired, the Lib/compileall.py
+module/script can be used to force creation of valid .pyc files for a
+given set of modules.
+<P>
+Note that the main script executed by Python, even if its filename
+ends in .py, is not compiled to a .pyc file.  It is compiled to
+bytecode, but the bytecode is not saved to a file.
+<P>
+If you are looking for a way to translate Python programs in order to
+distribute them in binary form, without the need to distribute the
+interpreter and library as well, have a look at the freeze.py script
+in the Tools/freeze directory.  This creates a single binary file
+incorporating your program, the Python interpreter, and those parts of
+the Python library that are needed by your program.  Of course, the
+resulting binary will only run on the same type of platform as that
+used to create it.
+<P>
+Newsflash: there are now several programs that do this, to some extent.
+Look for Psyco, Pyrex, PyInline, Py2Cmod, and Weave.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.013.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.013.htp">Log info</A>
+
+/ Last changed on Fri May 24 21:26:19 2002 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="6.14">6.14. How does Python manage memory?</A></H2>
+The details of Python memory management depend on the implementation.
+The standard Python implementation (the C implementation) uses reference
+counting and another mechanism to collect reference cycles.
+<P>
+Jython relies on the Java runtime; so it uses
+the JVM's garbage collector.  This difference can cause some subtle
+porting problems if your Python code depends on the behavior of
+the reference counting implementation.
+<P>
+The reference cycle collector was added in CPython 2.0. It
+periodically executes a cycle detection algorithm which looks for inaccessible cycles and deletes the objects involved. A new gc module provides functions to perform a garbage collection, obtain debugging statistics, and tuning the collector's parameters. 
+<P>
+The detection of cycles can be disabled when Python is compiled, if you can't afford even a tiny speed penalty or suspect that the cycle collection is buggy, by specifying the "--without-cycle-gc" switch when running the configure script. 
+<P>
+Sometimes objects get stuck in "tracebacks" temporarily and hence are not deallocated when you might expect.  Clear the tracebacks via
+<P>
+<PRE>
+       import sys
+       sys.exc_traceback = sys.last_traceback = None
+</PRE>
+Tracebacks are used for reporting errors and implementing debuggers and related things.  They contain a portion of the program state extracted during the handling of an exception (usually the most recent exception).
+<P>
+In the absence of circularities and modulo tracebacks, Python programs need not explicitly manage memory.
+<P>
+Why python doesn't use a more traditional garbage collection
+scheme? For one thing, unless this were
+added to C as a standard feature, it's a portability pain in the ass.
+And yes, I know about the Xerox library.  It has bits of assembler
+code for <I>most</I> <I>common</I> platforms.  Not for all.  And although it is
+mostly transparent, it isn't completely transparent (when I once
+linked Python with it, it dumped core).
+<P>
+Traditional GC also becomes a problem when Python gets embedded into
+other applications.  While in a stand-alone Python it may be fine to
+replace the standard malloc() and free() with versions provided by the
+GC library, an application embedding Python may want to have its <I>own</I>
+substitute for malloc() and free(), and may not want Python's.  Right
+now, Python works with anything that implements malloc() and free()
+properly.
+<P>
+In Jython, the following code (which is 
+fine in C Python) will probably run out of file descriptors long before
+it runs out of memory:
+<P>
+<PRE>
+        for file in &lt;very long list of files&gt;:
+                f = open(file)
+                c = f.read(1)
+</PRE>
+Using the current reference counting and destructor scheme, each new
+assignment to f closes the previous file.  Using GC, this is not
+guaranteed.  Sure, you can think of ways to fix this.  But it's not
+off-the-shelf technology.  If you want to write code that will
+work with any Python implementation, you should explicitly close
+the file; this will work regardless of GC:
+<P>
+<PRE>
+       for file in &lt;very long list of files&gt;:
+                f = open(file)
+                c = f.read(1)
+                f.close()
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.014.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.014.htp">Log info</A>
+
+/ Last changed on Thu Mar 21 05:35:38 2002 by
+<A HREF="mailto:erno-pyfaq@erno.iki.fi">Erno Kuusela</A>
+<P>
+
+<HR>
+<H2><A NAME="6.15">6.15. Why are there separate tuple and list data types?</A></H2>
+This is done so that tuples can be immutable while lists are mutable.
+<P>
+Immutable tuples are useful in situations where you need to pass a few
+items to a function and don't want the function to modify the tuple;
+for example,
+<P>
+<PRE>
+	point1 = (120, 140)
+	point2 = (200, 300)
+	record(point1, point2)
+	draw(point1, point2)
+</PRE>
+You don't want to have to think about what would happen if record()
+changed the coordinates -- it can't, because the tuples are immutable.
+<P>
+On the other hand, when creating large lists dynamically, it is
+absolutely crucial that they are mutable -- adding elements to a tuple
+one by one requires using the concatenation operator, which makes it
+quadratic in time.
+<P>
+As a general guideline, use tuples like you would use structs in C or
+records in Pascal, use lists like (variable length) arrays.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.015.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.015.htp">Log info</A>
+
+/ Last changed on Fri May 23 15:26:03 1997 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="6.16">6.16. How are lists implemented?</A></H2>
+Despite what a Lisper might think, Python's lists are really
+variable-length arrays.  The implementation uses a contiguous
+array of references to other objects, and keeps a pointer
+to this array (as well as its length) in a list head structure.
+<P>
+This makes indexing a list (a[i]) an operation whose cost is
+independent of the size of the list or the value of the index.
+<P>
+When items are appended or inserted, the array of references is resized.
+Some cleverness is applied to improve the performance of appending
+items repeatedly; when the array must be grown, some extra space
+is allocated so the next few times don't require an actual resize.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.016.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.016.htp">Log info</A>
+
+/ Last changed on Fri May 23 15:32:24 1997 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="6.17">6.17. How are dictionaries implemented?</A></H2>
+Python's dictionaries are implemented as resizable hash tables.
+<P>
+Compared to B-trees, this gives better performance for lookup
+(the most common operation by far) under most circumstances,
+and the implementation is simpler.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.017.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.017.htp">Log info</A>
+
+/ Last changed on Fri May 23 23:51:14 1997 by
+<A HREF="mailto:Vladimir.Marangozov@inrialpes.fr">Vladimir Marangozov</A>
+<P>
+
+<HR>
+<H2><A NAME="6.18">6.18. Why must dictionary keys be immutable?</A></H2>
+The hash table implementation of dictionaries uses a hash value
+calculated from the key value to find the key.  If the key were
+a mutable object, its value could change, and thus its hash could
+change.  But since whoever changes the key object can't tell that
+is incorporated in a dictionary, it can't move the entry around in
+the dictionary.  Then, when you try to look up the same object
+in the dictionary, it won't be found, since its hash value is different;
+and if you try to look up the old value, it won't be found either,
+since the value of the object found in that hash bin differs.
+<P>
+If you think you need to have a dictionary indexed with a list,
+try to use a tuple instead.  The function tuple(l) creates a tuple
+with the same entries as the list l.
+<P>
+Some unacceptable solutions that have been proposed:
+<P>
+- Hash lists by their address (object ID).  This doesn't work because
+if you construct a new list with the same value it won't be found;
+e.g.,
+<P>
+<PRE>
+  d = {[1,2]: '12'}
+  print d[[1,2]]
+</PRE>
+will raise a KeyError exception because the id of the [1,2] used
+in the second line differs from that in the first line.
+In other words, dictionary keys should be compared using '==', not using 'is'.
+<P>
+- Make a copy when using a list as a key.  This doesn't work because
+the list (being a mutable object) could contain a reference to itself,
+and then the copying code would run into an infinite loop.
+<P>
+- Allow lists as keys but tell the user not to modify them.  This would
+allow a class of hard-to-track bugs in programs that I'd rather not see;
+it invalidates an important invariant of dictionaries (every value in
+d.keys() is usable as a key of the dictionary).
+<P>
+- Mark lists as read-only once they are used as a dictionary key.
+The problem is that it's not just the top-level object that could change
+its value; you could use a tuple containing a list as a key.  Entering
+anything as a key into a dictionary would require marking all objects
+reachable from there as read-only -- and again, self-referential objects
+could cause an infinite loop again (and again and again).
+<P>
+There is a trick to get around this if you need to, but
+use it at your own risk:  You
+can wrap a mutable structure inside a class instance which
+has both a __cmp__ and a __hash__ method.  
+<P>
+<PRE>
+   class listwrapper:
+        def __init__(self, the_list):
+              self.the_list = the_list
+        def __cmp__(self, other):
+              return self.the_list == other.the_list
+        def __hash__(self):
+              l = self.the_list
+              result = 98767 - len(l)*555
+              for i in range(len(l)):
+                   try:
+                        result = result + (hash(l[i]) % 9999999) * 1001 + i
+                   except:
+                        result = (result % 7777777) + i * 333
+              return result
+</PRE>
+Note that the hash computation is complicated by the
+possibility that some members of the list may be unhashable
+and also by the possibility of arithmetic overflow.
+<P>
+You must make
+sure that the hash value for all such wrapper objects that reside in a
+dictionary (or other hash based structure), remain fixed while
+the object is in the dictionary (or other structure).
+<P>
+Furthermore it must always be the case that if
+o1 == o2 (ie o1.__cmp__(o2)==0) then hash(o1)==hash(o2)
+(ie, o1.__hash__() == o2.__hash__()), regardless of whether
+the object is in a dictionary or not.
+If you fail to meet these restrictions dictionaries and other
+hash based structures may misbehave!
+<P>
+In the case of listwrapper above whenever the wrapper
+object is in a dictionary the wrapped list must not change
+to avoid anomalies.  Don't do this unless you are prepared
+to think hard about the requirements and the consequences
+of not meeting them correctly.  You've been warned!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.018.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.018.htp">Log info</A>
+
+/ Last changed on Thu Jul 10 10:08:40 1997 by
+<A HREF="mailto:aaron_watters@msn.com">aaron watters</A>
+<P>
+
+<HR>
+<H2><A NAME="6.19">6.19. How the heck do you make an array in Python?</A></H2>
+["this", 1, "is", "an", "array"]
+<P>
+Lists are arrays in the C or Pascal sense of the word (see question
+6.16).  The array module also provides methods for creating arrays
+of fixed types with compact representations (but they are slower to
+index than lists).  Also note that the Numerics extensions and others
+define array-like structures with various characteristics as well.
+<P>
+To get Lisp-like lists, emulate cons cells
+<P>
+<PRE>
+    lisp_list = ("like",  ("this",  ("example", None) ) )
+</PRE>
+using tuples (or lists, if you want mutability).  Here the analogue
+of lisp car is lisp_list[0] and the analogue of cdr is lisp_list[1].
+Only do this if you're sure you really need to (it's usually a lot
+slower than using Python lists).
+<P>
+Think of Python lists as mutable heterogeneous arrays of
+Python objects (say that 10 times fast :) ).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.019.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.019.htp">Log info</A>
+
+/ Last changed on Wed Aug 13 07:08:27 1997 by
+<A HREF="mailto:aaron_watters@msn.com">aaron watters</A>
+<P>
+
+<HR>
+<H2><A NAME="6.20">6.20. Why doesn't list.sort() return the sorted list?</A></H2>
+In situations where performance matters, making a copy of the list
+just to sort it would be wasteful.  Therefore, list.sort() sorts
+the list in place.  In order to remind you of that fact, it does
+not return the sorted list.  This way, you won't be fooled into
+accidentally overwriting a list when you need a sorted copy but also
+need to keep the unsorted version around.
+<P>
+As a result, here's the idiom to iterate over the keys of a dictionary
+in sorted order:
+<P>
+<PRE>
+	keys = dict.keys()
+	keys.sort()
+	for key in keys:
+		...do whatever with dict[key]...
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.020.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.020.htp">Log info</A>
+
+/ Last changed on Thu Dec  2 17:01:52 1999 by
+<A HREF="mailto:fdrake@acm.org">Fred L. Drake, Jr.</A>
+<P>
+
+<HR>
+<H2><A NAME="6.21">6.21. How do you specify and enforce an interface spec in Python?</A></H2>
+An interfaces specification for a module as provided
+by languages such as C++ and java describes the prototypes
+for the methods and functions of the module.  Many feel
+that compile time enforcement of interface specifications
+help aid in the construction of large programs.  Python
+does not support interface specifications directly, but many
+of their advantages can be obtained by an appropriate
+test discipline for components, which can often be very
+easily accomplished in Python.  There is also a tool, PyChecker,
+which can be used to find problems due to subclassing.
+<P>
+A good test suite for a module can at
+once provide a regression test and serve as a module interface
+specification (even better since it also gives example usage).  Look to
+many of the standard libraries which often have a "script
+interpretation" which provides a simple "self test."  Even
+modules which use complex external interfaces can often
+be tested in isolation using trivial "stub" emulations of the
+external interface.
+<P>
+An appropriate testing discipline (if enforced) can help
+build large complex applications in Python as well as having interface
+specifications would do (or better).  Of course Python allows you 
+to get sloppy and not do it.  Also you might want to design
+your code with an eye to make it easily tested.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.021.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.021.htp">Log info</A>
+
+/ Last changed on Thu May 23 03:05:29 2002 by
+<A HREF="mailto:neal@metaslash.com">Neal Norwitz</A>
+<P>
+
+<HR>
+<H2><A NAME="6.22">6.22. Why do all classes have the same type? Why do instances all have the same type?</A></H2>
+The Pythonic use of the word "type" is quite different from
+common usage in much of the rest of the programming language
+world.  A "type" in Python is a description for an object's operations
+as implemented in C.  All classes have the same operations
+implemented in C which sometimes "call back" to differing program
+fragments implemented in Python, and hence all classes have the
+same type.  Similarly at the C level all class instances have the
+same C implementation, and hence all instances have the same
+type.
+<P>
+Remember that in Python usage "type" refers to a C implementation
+of an object.  To distinguish among instances of different classes
+use Instance.__class__, and also look to 4.47.  Sorry for the
+terminological confusion, but at this point in Python's development
+nothing can be done!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.022.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.022.htp">Log info</A>
+
+/ Last changed on Tue Jul  1 12:35:47 1997 by
+<A HREF="mailto:aaron_watters@msn.com">aaron watters</A>
+<P>
+
+<HR>
+<H2><A NAME="6.23">6.23. Why isn't all memory freed when Python exits?</A></H2>
+Objects referenced from Python module global name spaces are
+not always deallocated when Python exits.
+<P>
+This may happen if there are circular references (see question
+4.17).  There are also certain bits of memory that are allocated
+by the C library that are impossible to free (e.g. a tool
+like Purify will complain about these).
+<P>
+But in general, Python 1.5 and beyond
+(in contrast with earlier versions) is quite agressive about
+cleaning up memory on exit.
+<P>
+If you want to force Python to delete certain things on deallocation
+use the sys.exitfunc hook to force those deletions.  For example
+if you are debugging an extension module using a memory analysis
+tool and you wish to make Python deallocate almost everything
+you might use an exitfunc like this one:
+<P>
+<PRE>
+  import sys
+</PRE>
+<PRE>
+  def my_exitfunc():
+       print "cleaning up"
+       import sys
+       # do order dependant deletions here
+       ...
+       # now delete everything else in arbitrary order
+       for x in sys.modules.values():
+            d = x.__dict__
+            for name in d.keys():
+                 del d[name]
+</PRE>
+<PRE>
+  sys.exitfunc = my_exitfunc
+</PRE>
+Other exitfuncs can be less drastic, of course.
+<P>
+(In fact, this one just does what Python now already does itself;
+but the example of using sys.exitfunc to force cleanups is still
+useful.)
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.023.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.023.htp">Log info</A>
+
+/ Last changed on Tue Sep 29 09:46:26 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="6.24">6.24. Why no class methods or mutable class variables?</A></H2>
+The notation
+<P>
+<PRE>
+    instance.attribute(arg1, arg2)
+</PRE>
+usually translates to the equivalent of
+<P>
+<PRE>
+    Class.attribute(instance, arg1, arg2)
+</PRE>
+where Class is a (super)class of instance.  Similarly
+<P>
+<PRE>
+    instance.attribute = value
+</PRE>
+sets an attribute of an instance (overriding any attribute of a class
+that instance inherits).  
+<P>
+Sometimes programmers want to have
+different behaviours -- they want a method which does not bind
+to the instance and a class attribute which changes in place.
+Python does not preclude these behaviours, but you have to
+adopt a convention to implement them.  One way to accomplish
+this is to use "list wrappers" and global functions.
+<P>
+<PRE>
+   def C_hello():
+         print "hello"
+</PRE>
+<PRE>
+   class C:
+        hello = [C_hello]
+        counter = [0]
+</PRE>
+<PRE>
+    I = C()
+</PRE>
+Here I.hello[0]() acts very much like a "class method" and
+I.counter[0] = 2 alters C.counter (and doesn't override it).
+If you don't understand why you'd ever want to do this, that's
+because you are pure of mind, and you probably never will
+want to do it!  This is dangerous trickery, not recommended
+when avoidable.  (Inspired by Tim Peter's discussion.)
+<P>
+In Python 2.2, you can do this using the new built-in operations
+classmethod and staticmethod.
+See <A HREF="http://www.python.org/2.2/descrintro.html#staticmethods">http://www.python.org/2.2/descrintro.html#staticmethods</A>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.024.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.024.htp">Log info</A>
+
+/ Last changed on Tue Sep 11 15:59:37 2001 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="6.25">6.25. Why are default values sometimes shared between objects?</A></H2>
+It is often expected that a function CALL creates new objects for default
+values. This is not what happens. Default values are created when the
+function is DEFINED, that is, there is only one such object that all 
+functions refer to. If that object is changed, subsequent calls to the 
+function will refer to this changed object. By definition, immutable objects
+(like numbers, strings, tuples, None) are safe from change. Changes to mutable 
+objects (like dictionaries, lists, class instances) is what causes the
+confusion.
+<P>
+Because of this feature it is good programming practice not to use mutable
+objects as default values, but to introduce them in the function.
+Don't write:
+<P>
+<PRE>
+	def foo(dict={}):  # XXX shared reference to one dict for all calls
+	    ...
+</PRE>
+but:
+<PRE>
+	def foo(dict=None):
+		if dict is None:
+			dict = {} # create a new dict for local namespace
+</PRE>
+See page 182 of "Internet Programming with Python" for one discussion
+of this feature. Or see the top of page 144 or bottom of page 277 in 
+"Programming Python" for another discussion.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.025.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.025.htp">Log info</A>
+
+/ Last changed on Sat Aug 16 07:03:35 1997 by
+<A HREF="mailto:cjr@bound.xs4all.nl">Case Roole</A>
+<P>
+
+<HR>
+<H2><A NAME="6.26">6.26. Why no goto?</A></H2>
+Actually, you can use exceptions to provide a "structured goto"
+that even works across function calls.  Many feel that exceptions
+can conveniently emulate all reasonable uses of the "go" or "goto"
+constructs of C, Fortran, and other languages.  For example:
+<P>
+<PRE>
+   class label: pass # declare a label
+   try:
+        ...
+        if (condition): raise label() # goto label
+        ...
+   except label: # where to goto
+        pass
+   ...
+</PRE>
+This doesn't allow you to jump into the middle of a loop, but
+that's usually considered an abuse of goto anyway.  Use sparingly.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.026.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.026.htp">Log info</A>
+
+/ Last changed on Wed Sep 10 07:16:44 1997 by
+<A HREF="mailto:aaron_watters@msn.com">aaron watters</A>
+<P>
+
+<HR>
+<H2><A NAME="6.27">6.27. How do you make a higher order function in Python?</A></H2>
+You have two choices: you can use default arguments and override
+them or you can use "callable objects."  For example suppose you
+wanted to define linear(a,b) which returns a function f where f(x)
+computes the value a*x+b.  Using default arguments:
+<P>
+<PRE>
+     def linear(a,b):
+         def result(x, a=a, b=b):
+             return a*x + b
+         return result
+</PRE>
+Or using callable objects:
+<P>
+<PRE>
+     class linear:
+        def __init__(self, a, b):
+            self.a, self.b = a,b
+        def __call__(self, x):
+            return self.a * x + self.b
+</PRE>
+In both cases:
+<P>
+<PRE>
+     taxes = linear(0.3,2)
+</PRE>
+gives a callable object where taxes(10e6) == 0.3 * 10e6 + 2.
+<P>
+The defaults strategy has the disadvantage that the default arguments
+could be accidentally or maliciously overridden.  The callable objects
+approach has the disadvantage that it is a bit slower and a bit
+longer.  Note however that a collection of callables can share
+their signature via inheritance.  EG
+<P>
+<PRE>
+      class exponential(linear):
+         # __init__ inherited
+         def __call__(self, x):
+             return self.a * (x ** self.b)
+</PRE>
+On comp.lang.python, <A HREF="mailto:zenin@bawdycaste.org">zenin@bawdycaste.org</A> points out that
+an object can encapsulate state for several methods in order
+to emulate the "closure" concept from functional programming
+languages, for example:
+<P>
+<PRE>
+    class counter:
+        value = 0
+        def set(self, x): self.value = x
+        def up(self): self.value=self.value+1
+        def down(self): self.value=self.value-1
+</PRE>
+<PRE>
+    count = counter()
+    inc, dec, reset = count.up, count.down, count.set
+</PRE>
+Here inc, dec and reset act like "functions which share the
+same closure containing the variable count.value" (if you
+like that way of thinking).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.027.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.027.htp">Log info</A>
+
+/ Last changed on Fri Sep 25 08:38:35 1998 by
+<A HREF="mailto:arw@pythonpros.com">Aaron Watters</A>
+<P>
+
+<HR>
+<H2><A NAME="6.28">6.28. Why do I get a SyntaxError for a 'continue' inside a 'try'?</A></H2>
+This is an implementation limitation,
+caused by the extremely simple-minded
+way Python generates bytecode.  The try block pushes something on the
+"block stack" which the continue would have to pop off again.  The
+current code generator doesn't have the data structures around so that 
+'continue' can generate the right code.
+<P>
+Note that JPython doesn't have this restriction!
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.028.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.028.htp">Log info</A>
+
+/ Last changed on Fri May 22 15:01:07 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="6.29">6.29. Why can't raw strings (r-strings) end with a backslash?</A></H2>
+More precisely, they can't end with an odd number of backslashes:
+the unpaired backslash at the end escapes the closing quote character,
+leaving an unterminated string.
+<P>
+Raw strings were designed to ease creating input for processors (chiefly
+regular expression engines) that want to do their own backslash escape processing. Such processors consider an unmatched trailing backslash to be an error anyway, so raw strings disallow that.  In return, they allow you to pass on the string quote character by escaping it with a backslash.  These rules work well when r-strings are used for their intended purpose.
+<P>
+If you're trying to build Windows pathnames, note that all Windows system calls accept forward slashes too:
+<P>
+<PRE>
+    f = open("/mydir/file.txt") # works fine!
+</PRE>
+If you're trying to build a pathname for a DOS command, try e.g. one of
+<P>
+<PRE>
+    dir = r"\this\is\my\dos\dir" "\\"
+    dir = r"\this\is\my\dos\dir\ "[:-1]
+    dir = "\\this\\is\\my\\dos\\dir\\"
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.029.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.029.htp">Log info</A>
+
+/ Last changed on Mon Jul 13 20:50:20 1998 by
+<A HREF="mailto:tim_one@email.msn.com">Tim Peters</A>
+<P>
+
+<HR>
+<H2><A NAME="6.30">6.30. Why can't I use an assignment in an expression?</A></H2>
+Many people used to C or Perl complain that they want to be able to
+use e.g. this C idiom:
+<P>
+<PRE>
+    while (line = readline(f)) {
+        ...do something with line...
+    }
+</PRE>
+where in Python you're forced to write this:
+<P>
+<PRE>
+    while 1:
+        line = f.readline()
+        if not line:
+            break
+        ...do something with line...
+</PRE>
+This issue comes up in the Python newsgroup with alarming frequency
+-- search Deja News for past messages about assignment expression.
+The reason for not allowing assignment in Python expressions
+is a common, hard-to-find bug in those other languages,
+caused by this construct:
+<P>
+<PRE>
+    if (x = 0) {
+        ...error handling...
+    }
+    else {
+        ...code that only works for nonzero x...
+    }
+</PRE>
+Many alternatives have been proposed.  Most are hacks that save some
+typing but use arbitrary or cryptic syntax or keywords,
+and fail the simple criterion that I use for language change proposals:
+it should intuitively suggest the proper meaning to a human reader
+who has not yet been introduced with the construct.
+<P>
+The earliest time something can be done about this will be with
+Python 2.0 -- if it is decided that it is worth fixing.
+An interesting phenomenon is that most experienced Python programmers
+recognize the "while 1" idiom and don't seem to be missing the
+assignment in expression construct much; it's only the newcomers
+who express a strong desire to add this to the language.
+<P>
+One fairly elegant solution would be to introduce a new operator
+for assignment in expressions spelled ":=" -- this avoids the "="
+instead of "==" problem.  It would have the same precedence
+as comparison operators but the parser would flag combination with
+other comparisons (without disambiguating parentheses) as an error.
+<P>
+Finally -- there's an alternative way of spelling this that seems
+attractive but is generally less robust than the "while 1" solution:
+<P>
+<PRE>
+    line = f.readline()
+    while line:
+        ...do something with line...
+        line = f.readline()
+</PRE>
+The problem with this is that if you change your mind about exactly
+how you get the next line (e.g. you want to change it into
+sys.stdin.readline()) you have to remember to change two places
+in your program -- the second one hidden at the bottom of the loop.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.030.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.030.htp">Log info</A>
+
+/ Last changed on Tue May 18 00:57:41 1999 by
+<A HREF="mailto:dalke@bioreason.com">Andrew Dalke</A>
+<P>
+
+<HR>
+<H2><A NAME="6.31">6.31. Why doesn't Python have a &quot;with&quot; statement like some other languages?</A></H2>
+Basically, because such a construct would be terribly ambiguous. Thanks to Carlos Ribeiro for the following remarks:
+<P>
+Some languages, such as Object Pascal, Delphi, and C++, use static types. So it is possible to know, in an unambiguous way, what member is being assigned in a "with" clause. This is the main point - the compiler <I>always</I>  knows the scope of every variable at compile time.
+<P>
+Python uses dynamic types. It is impossible to know in advance which 
+attribute will be referenced at runtime. Member attributes may be added or removed from objects on the fly. This would make it impossible to know, from a simple reading, what attribute is being referenced - a local one, a global one, or a member attribute.
+<P>
+For instance, take the following snippet (it is incomplete btw, just to 
+give you the idea):
+<P>
+<PRE>
+   def with_is_broken(a):
+      with a:
+         print x
+</PRE>
+The snippet assumes that "a" must have a member attribute called "x". 
+However, there is nothing in Python that guarantees that. What should 
+happen if "a" is, let us say, an integer? And if I have a global variable named "x", will it end up being used inside the with block? As you see, the dynamic nature of Python makes such choices much harder.
+<P>
+The primary benefit of "with" and similar language features (reduction of code volume) can, however, easily be achieved in Python by assignment. Instead of:
+<P>
+<PRE>
+    function(args).dict[index][index].a = 21
+    function(args).dict[index][index].b = 42
+    function(args).dict[index][index].c = 63
+</PRE>
+would become:
+<P>
+<PRE>
+    ref = function(args).dict[index][index]
+    ref.a = 21
+    ref.b = 42
+    ref.c = 63
+</PRE>
+This also has the happy side-effect of increasing execution speed, since name bindings are resolved at run-time in Python, and the second method only needs to perform the resolution once. If the referenced object does not have a, b and c attributes, of course, the end result is still a run-time exception.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.031.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.031.htp">Log info</A>
+
+/ Last changed on Fri Jan 11 14:32:58 2002 by
+<A HREF="mailto:sholden@holdenweb.com">Steve Holden</A>
+<P>
+
+<HR>
+<H2><A NAME="6.32">6.32. Why are colons required for if/while/def/class?</A></H2>
+The colon is required primarily to enhance readability (one of the
+results of the experimental ABC language).  Consider this:
+<P>
+<PRE>
+    if a==b
+        print a
+</PRE>
+versus
+<P>
+<PRE>
+    if a==b:
+        print a
+</PRE>
+Notice how the second one is slightly easier to read.  Notice further how
+a colon sets off the example in the second line of this FAQ answer; it's
+a standard usage in English.  Finally, the colon makes it easier for
+editors with syntax highlighting.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.032.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.032.htp">Log info</A>
+
+/ Last changed on Mon Jun  3 07:22:57 2002 by
+<A HREF="mailto:smurf@noris.de">Matthias Urlichs</A>
+<P>
+
+<HR>
+<H2><A NAME="6.33">6.33. Can't we get rid of the Global Interpreter Lock?</A></H2>
+The Global Interpreter Lock (GIL) is often seen as a hindrance to
+Python's deployment on high-end multiprocessor server machines,
+because a multi-threaded Python program effectively only uses
+one CPU, due to the insistence that (almost) all Python code
+can only run while the GIL is held.
+<P>
+Back in the days of Python 1.5, Greg Stein actually implemented
+a comprehensive patch set ("free threading")
+that removed the GIL, replacing it with
+fine-grained locking.  Unfortunately, even on Windows (where locks
+are very efficient) this ran ordinary Python code about twice as
+slow as the interpreter using the GIL.  On Linux the performance
+loss was even worse (pthread locks aren't as efficient).
+<P>
+Since then, the idea of getting rid of the GIL has occasionally
+come up but nobody has found a way to deal with the expected slowdown;
+Greg's free threading patch set has not been kept up-to-date for
+later Python versions.
+<P>
+This doesn't mean that you can't make good use of Python on
+multi-CPU machines!  You just have to be creative with dividing
+the work up between multiple <I>processes</I> rather than multiple
+<I>threads</I>.
+<P>
+<P>
+It has been suggested that the GIL should be a per-interpreter-state
+lock rather than truly global; interpreters then wouldn't be able
+to share objects.  Unfortunately, this isn't likely to happen either.
+<P>
+It would be a tremendous amount of work, because many object
+implementations currently have global state.  E.g. small ints and
+small strings are cached; these caches would have to be moved to the
+interpreter state.  Other object types have their own free list; these
+free lists would have to be moved to the interpreter state.  And so
+on.
+<P>
+And I doubt that it can even be done in finite time, because the same
+problem exists for 3rd party extensions.  It is likely that 3rd party
+extensions are being written at a faster rate than you can convert
+them to store all their global state in the interpreter state.
+<P>
+And finally, once you have multiple interpreters not sharing any
+state, what have you gained over running each interpreter
+in a separate process?
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq06.033.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq06.033.htp">Log info</A>
+
+/ Last changed on Fri Feb  7 16:34:01 2003 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H1>7. Using Python on non-UNIX platforms</H1>
+
+<HR>
+<H2><A NAME="7.1">7.1. Is there a Mac version of Python?</A></H2>
+Yes, it is maintained by Jack Jansen.  See Jack's MacPython Page:
+<P>
+<PRE>
+  <A HREF="http://www.cwi.nl/~jack/macpython.html">http://www.cwi.nl/~jack/macpython.html</A>
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.001.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.001.htp">Log info</A>
+
+/ Last changed on Fri May  4 09:33:42 2001 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="7.2">7.2. Are there DOS and Windows versions of Python?</A></H2>
+Yes.  The core windows binaries are available from <A HREF="http://www.python.org/windows">http://www.python.org/windows</A>/. There is a plethora of Windows extensions available, including a large number of not-always-compatible GUI toolkits.  The core binaries include the standard Tkinter GUI extension.
+<P>
+Most windows extensions can be found (or referenced) at <A HREF="http://www.python.org/windows">http://www.python.org/windows</A>/ 
+<P>
+Windows 3.1/DOS support seems to have dropped off recently.  You may need to settle for an old version of Python one these platforms.  One such port is WPY
+<P>
+WPY: Ports to DOS, Windows 3.1(1), Windows 95, Windows NT and OS/2.
+Also contains a GUI package that offers portability between Windows 
+(not DOS) and Unix, and native look and feel on both.
+<A HREF="ftp://ftp.python.org/pub/python/wpy">ftp://ftp.python.org/pub/python/wpy</A>/.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.002.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.002.htp">Log info</A>
+
+/ Last changed on Tue Jun  2 20:21:57 1998 by
+<A HREF="mailto:MHammond@skippinet.com.au">Mark Hammond</A>
+<P>
+
+<HR>
+<H2><A NAME="7.3">7.3. Is there an OS/2 version of Python?</A></H2>
+Yes, see <A HREF="http://www.python.org/download/download_os2.html">http://www.python.org/download/download_os2.html</A>.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.003.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.003.htp">Log info</A>
+
+/ Last changed on Tue Sep  7 11:33:16 1999 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="7.4">7.4. Is there a VMS version of Python?</A></H2>
+Jean-François Piéronne has ported 2.1.3 to OpenVMS.  It can be found at
+&lt;<A HREF="http://vmspython.dyndns.org">http://vmspython.dyndns.org</A>/&gt;.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.004.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.004.htp">Log info</A>
+
+/ Last changed on Thu Sep 19 15:40:38 2002 by
+<A HREF="mailto:skip@pobox.com">Skip Montanaro</A>
+<P>
+
+<HR>
+<H2><A NAME="7.5">7.5. What about IBM mainframes, or other non-UNIX platforms?</A></H2>
+I haven't heard about these, except I remember hearing about an
+OS/9 port and a port to Vxworks (both operating systems for embedded
+systems).  If you're interested in any of this, go directly to the
+newsgroup and ask there, you may find exactly what you need.  For
+example, a port to MPE/iX 5.0 on HP3000 computers was just announced,
+see <A HREF="http://www.allegro.com/software">http://www.allegro.com/software</A>/.
+<P>
+On the IBM mainframe side, for Z/OS there's a port of python 1.4 that goes with their open-unix package, formely OpenEdition MVS, (<A HREF="http://www-1.ibm.com/servers/eserver/zseries/zos/unix/python.html">http://www-1.ibm.com/servers/eserver/zseries/zos/unix/python.html</A>). On a side note, there's also a java vm ported - so, in theory, jython could run too.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.005.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.005.htp">Log info</A>
+
+/ Last changed on Mon Nov 18 03:18:39 2002 by
+<A HREF="mailto:bjessen@uol.com.br">Bruno Jessen</A>
+<P>
+
+<HR>
+<H2><A NAME="7.6">7.6. Where are the source or Makefiles for the non-UNIX versions?</A></H2>
+The standard sources can (almost) be used.  Additional sources can
+be found in the platform-specific subdirectories of the distribution.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.006.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.006.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="7.7">7.7. What is the status and support for the non-UNIX versions?</A></H2>
+I don't have access to most of these platforms, so in general I am
+dependent on material submitted by volunteers.  However I strive to
+integrate all changes needed to get it to compile on a particular
+platform back into the standard sources, so porting of the next
+version to the various non-UNIX platforms should be easy.
+(Note that Linux is classified as a UNIX platform here. :-)
+<P>
+Some specific platforms:
+<P>
+Windows: all versions (95, 98, ME, NT, 2000, XP) are supported,
+all python.org releases come with a Windows installer.
+<P>
+MacOS: Jack Jansen does an admirable job of keeping the Mac version
+up to date (both MacOS X and older versions);
+see <A HREF="http://www.cwi.nl/~jack/macpython.html">http://www.cwi.nl/~jack/macpython.html</A>
+<P>
+For all supported platforms, see <A HREF="http://www.python.org/download">http://www.python.org/download</A>/
+(follow the link to "Other platforms" for less common platforms)
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.007.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.007.htp">Log info</A>
+
+/ Last changed on Fri May 24 21:34:24 2002 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="7.8">7.8. I have a PC version but it appears to be only a binary. Where's the library?</A></H2>
+If you are running any version of Windows, then you have the wrong distribution.  The FAQ lists current Windows versions.  Notably, Pythonwin and wpy provide fully functional installations.
+<P>
+But if you are sure you have the only distribution with a hope of working on
+your system, then...
+<P>
+You still need to copy the files from the distribution directory
+"python/Lib" to your system.  If you don't have the full distribution,
+you can get the file lib&lt;version&gt;.tar.gz from most ftp sites carrying
+Python; this is a subset of the distribution containing just those
+files, e.g.  <A HREF="ftp://ftp.python.org/pub/python/src/lib1.4.tar.gz">ftp://ftp.python.org/pub/python/src/lib1.4.tar.gz</A>.
+<P>
+Once you have installed the library, you need to point sys.path to it.
+Assuming the library is in C:\misc\python\lib, the following commands
+will point your Python interpreter to it (note the doubled backslashes
+-- you can also use single forward slashes instead):
+<P>
+<PRE>
+        >>> import sys
+        >>> sys.path.insert(0, 'C:\\misc\\python\\lib')
+        >>>
+</PRE>
+For a more permanent effect, set the environment variable PYTHONPATH,
+as follows (talking to a DOS prompt):
+<P>
+<PRE>
+        C> SET PYTHONPATH=C:\misc\python\lib
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.008.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.008.htp">Log info</A>
+
+/ Last changed on Fri May 23 16:28:27 1997 by
+<A HREF="mailto:klm@python.org">Ken Manheimer</A>
+<P>
+
+<HR>
+<H2><A NAME="7.9">7.9. Where's the documentation for the Mac or PC version?</A></H2>
+The documentation for the Unix version also applies to the Mac and
+PC versions.  Where applicable, differences are indicated in the text.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.009.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.009.htp">Log info</A>
+<P>
+
+<HR>
+<H2><A NAME="7.10">7.10. How do I create a Python program file on the Mac or PC?</A></H2>
+Use an external editor.  On the Mac, BBEdit seems to be a popular
+no-frills text editor.  I work like this: start the interpreter; edit
+a module file using BBedit; import and test it in the interpreter;
+edit again in BBedit; then use the built-in function reload() to
+re-read the imported module; etc. In the 1.4 distribution 
+you will find a BBEdit extension that makes life a little easier: 
+it can tell the interpreter to execute the current window. 
+See :Mac:Tools:BBPy:README. 
+<P>
+Regarding the same question for the PC, Kurt Wm. Hemr writes: "While
+anyone with a pulse could certainly figure out how to do the same on
+MS-Windows, I would recommend the NotGNU Emacs clone for MS-Windows.
+Not only can you easily resave and "reload()" from Python after making
+changes, but since WinNot auto-copies to the clipboard any text you
+select, you can simply select the entire procedure (function) which
+you changed in WinNot, switch to QWPython, and shift-ins to reenter
+the changed program unit."
+<P>
+If you're using Windows95 or Windows NT, you should also know about
+PythonWin, which provides a GUI framework, with an mouse-driven
+editor, an object browser, and a GUI-based debugger.  See
+<PRE>
+       <A HREF="http://www.python.org/ftp/python/pythonwin">http://www.python.org/ftp/python/pythonwin</A>/
+</PRE>
+for details.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.010.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.010.htp">Log info</A>
+
+/ Last changed on Sun May 25 10:04:25 1997 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="7.11">7.11. How can I use Tkinter on Windows 95/NT?</A></H2>
+Starting from Python 1.5, it's very easy -- just download and install
+Python and Tcl/Tk and you're in business.  See 
+<P>
+<PRE>
+  <A HREF="http://www.python.org/download/download_windows.html">http://www.python.org/download/download_windows.html</A>
+</PRE>
+One warning: don't attempt to use Tkinter from PythonWin
+(Mark Hammond's IDE).  Use it from the command line interface
+(python.exe) or the windowless interpreter (pythonw.exe).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.011.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.011.htp">Log info</A>
+
+/ Last changed on Fri Jun 12 09:32:48 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="7.12">7.12. cgi.py (or other CGI programming) doesn't work sometimes on NT or win95!</A></H2>
+Be sure you have the latest python.exe, that you are using
+python.exe rather than a GUI version of python and that you
+have configured the server to execute
+<P>
+<PRE>
+     "...\python.exe -u ..."
+</PRE>
+for the cgi execution.  The -u (unbuffered) option on NT and
+win95 prevents the interpreter from altering newlines in the
+standard input and output.  Without it post/multipart requests
+will seem to have the wrong length and binary (eg, GIF)
+responses may get garbled (resulting in, eg, a "broken image").
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.012.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.012.htp">Log info</A>
+
+/ Last changed on Wed Jul 30 10:48:02 1997 by
+<A HREF="mailto:aaron_watters@msn.com">aaron watters</A>
+<P>
+
+<HR>
+<H2><A NAME="7.13">7.13. Why doesn't os.popen() work in PythonWin on NT?</A></H2>
+The reason that os.popen() doesn't work from within PythonWin is due to a bug in Microsoft's C Runtime Library (CRT). The CRT assumes you  have a Win32 console attached to the process.
+<P>
+You should use the win32pipe module's popen() instead which doesn't depend on having an attached Win32 console.
+<P>
+Example:
+<PRE>
+ import win32pipe
+ f = win32pipe.popen('dir /c c:\\')
+ print f.readlines()
+ f.close()
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.013.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.013.htp">Log info</A>
+
+/ Last changed on Thu Jul 31 15:34:09 1997 by
+<A HREF="mailto:billtut@microsoft.com">Bill Tutt</A>
+<P>
+
+<HR>
+<H2><A NAME="7.14">7.14. How do I use different functionality on different platforms with the same program?</A></H2>
+Remember that Python is extremely dynamic and that you
+can use this dynamism to configure a program at run-time to
+use available functionality on different platforms.  For example
+you can test the sys.platform and import different modules based
+on its value.
+<P>
+<PRE>
+   import sys
+   if sys.platform == "win32":
+      import win32pipe
+      popen = win32pipe.popen
+   else:
+      import os
+      popen = os.popen
+</PRE>
+(See FAQ 7.13 for an explanation of why you might want to
+do something like this.)  Also you can try to import a module
+and use a fallback if the import fails:
+<P>
+<PRE>
+    try:
+         import really_fast_implementation
+         choice = really_fast_implementation
+    except ImportError:
+         import slower_implementation
+         choice = slower_implementation
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.014.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.014.htp">Log info</A>
+
+/ Last changed on Wed Aug 13 07:39:06 1997 by
+<A HREF="mailto:aaron_watters@msn.com">aaron watters</A>
+<P>
+
+<HR>
+<H2><A NAME="7.15">7.15. Is there an Amiga version of Python?</A></H2>
+Yes. See the AmigaPython homepage at <A HREF="http://www.bigfoot.com/~irmen/python.html">http://www.bigfoot.com/~irmen/python.html</A>.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.015.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.015.htp">Log info</A>
+
+/ Last changed on Mon Dec 14 06:53:32 1998 by
+<A HREF="mailto:irmen@bigfoot.com">Irmen de Jong</A>
+<P>
+
+<HR>
+<H2><A NAME="7.16">7.16. Why doesn't os.popen()/win32pipe.popen() work on Win9x?</A></H2>
+There is a bug in Win9x that prevents os.popen/win32pipe.popen* from working. The good news is there is a way to work around this problem.
+The Microsoft Knowledge Base article that you need to lookup is: Q150956. You will find links to the knowledge base at:
+<A HREF="http://www.microsoft.com/kb">http://www.microsoft.com/kb</A>.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq07.016.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq07.016.htp">Log info</A>
+
+/ Last changed on Fri Jun 25 10:45:38 1999 by
+<A HREF="mailto:billtut@microsoft.com">Bill Tutt</A>
+<P>
+
+<HR>
+<H1>8. Python on Windows</H1>
+
+<HR>
+<H2><A NAME="8.1">8.1. Using Python for CGI on Microsoft Windows</A></H2>
+** Setting up the Microsoft IIS Server/Peer Server
+<P>
+On the Microsoft IIS 
+server or on the Win95 MS Personal Web Server
+you set up python in the same way that you 
+would set up any other scripting engine. 
+<P>
+Run regedt32 and go to: 
+<P>
+HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\ScriptMap 
+<P>
+and enter the following line (making any specific changes that your system may need) 
+<P>
+.py :REG_SZ: c:\&lt;path to python&gt;\python.exe -u %s %s 
+<P>
+This line will allow you to call your script with a simple reference like:
+http://yourserver/scripts/yourscript.py 
+provided "scripts" is an "executable" directory for your server (which
+it usually is by default).
+The "-u" flag specifies unbuffered and binary mode for stdin - needed when working with binary data
+<P>
+In addition, it is recommended by people who would know that using ".py" may 
+not be a good idea for the file extensions when used in this context
+(you might want to reserve *.py for support modules and use *.cgi or *.cgp
+for "main program" scripts).
+However, that issue is beyond this Windows FAQ entry.
+<P>
+<P>
+** Apache configuration
+<P>
+In the Apache configuration file httpd.conf, add the following line at 
+the end of the file:
+<P>
+ScriptInterpreterSource Registry
+<P>
+Then, give your Python CGI-scripts the extension .py and put them in the cgi-bin directory.
+<P>
+<P>
+** Netscape Servers:
+Information on this topic exists at:
+<A HREF="http://home.netscape.com/comprod/server_central/support/fasttrack_man/programs.htm#1010870">http://home.netscape.com/comprod/server_central/support/fasttrack_man/programs.htm#1010870</A>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.001.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.001.htp">Log info</A>
+
+/ Last changed on Wed Mar 27 12:25:54 2002 by
+<A HREF="mailto:gerhard@bigfoot.de">Gerhard Häring</A>
+<P>
+
+<HR>
+<H2><A NAME="8.2">8.2. How to check for a keypress without blocking?</A></H2>
+Use the msvcrt module.  This is a standard Windows-specific extensions
+in Python 1.5 and beyond.  It defines a function kbhit() which checks
+whether a keyboard hit is present; also getch() which gets one
+character without echo.  Plus a few other goodies.
+<P>
+(Search for "keypress" to find an answer for Unix as well.)
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.002.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.002.htp">Log info</A>
+
+/ Last changed on Mon Mar 30 16:21:46 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="8.3">8.3. $PYTHONPATH</A></H2>
+In MS-DOS derived environments, a unix variable such as $PYTHONPATH is 
+set as PYTHONPATH, without the dollar sign.  PYTHONPATH is useful for
+specifying the location of library files.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.003.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.003.htp">Log info</A>
+
+/ Last changed on Thu Jun 11 00:41:26 1998 by
+<A HREF="mailto:guido@python.org">Gvr</A>
+<P>
+
+<HR>
+<H2><A NAME="8.4">8.4. dedent syntax errors</A></H2>
+The FAQ does not recommend using tabs, and Guido's Python Style Guide recommends 4 spaces for distributed Python code; this is also the Emacs python-mode default; see
+<P>
+<PRE>
+    <A HREF="http://www.python.org/doc/essays/styleguide.html">http://www.python.org/doc/essays/styleguide.html</A>
+</PRE>
+Under any editor mixing tabs and spaces is a bad idea.  MSVC is no different in this respect, and is easily configured to use spaces:  Take Tools -> Options -> Tabs, and for file type "Default" set "Tab size" and "Indent size" to 4, and select the "Insert spaces" radio button.
+<P>
+If you suspect mixed tabs and spaces are causing problems in leading whitespace, run Python with the -t switch or, run Tools/Scripts/tabnanny.py to check a directory tree in batch mode.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.004.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.004.htp">Log info</A>
+
+/ Last changed on Mon Feb 12 15:04:14 2001 by
+<A HREF="mailto:sholden@holdenweb.com">Steve Holden</A>
+<P>
+
+<HR>
+<H2><A NAME="8.5">8.5. How do I emulate os.kill() in Windows?</A></H2>
+Use win32api:
+<P>
+<PRE>
+    def kill(pid):
+        """kill function for Win32"""
+        import win32api
+        handle = win32api.OpenProcess(1, 0, pid)
+        return (0 != win32api.TerminateProcess(handle, 0))
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.005.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.005.htp">Log info</A>
+
+/ Last changed on Sat Aug  8 18:55:06 1998 by
+<A HREF="mailto:jeffbauer@bigfoot.com">Jeff Bauer</A>
+<P>
+
+<HR>
+<H2><A NAME="8.6">8.6. Why does os.path.isdir() fail on NT shared directories?</A></H2>
+The solution appears to be always append the "\\" on 
+the end of shared drives.
+<P>
+<PRE>
+  >>> import os
+  >>> os.path.isdir( '\\\\rorschach\\public')
+  0
+  >>> os.path.isdir( '\\\\rorschach\\public\\')
+  1
+</PRE>
+[Blake Winton responds:]
+I've had the same problem doing "Start >> Run" and then a
+directory on a shared drive.  If I use "\\rorschach\public", 
+it will fail, but if I use "\\rorschach\public\", it will 
+work.  For that matter, os.stat() does the same thing (well, 
+it gives an error for "\\\\rorschach\\public", but you get 
+the idea)...
+<P>
+I've got a theory about why this happens, but it's only 
+a theory.  NT knows the difference between shared directories, 
+and regular directories.  "\\rorschach\public" isn't a 
+directory, it's _really_ an IPC abstraction.  This is sort 
+of lended credence to by the fact that when you're mapping 
+a network drive, you can't map "\\rorschach\public\utils", 
+but only "\\rorschach\public".
+<P>
+[Clarification by <A HREF="mailto:funkster@midwinter.com">funkster@midwinter.com</A>]
+It's not actually a Python 
+question, as Python is working just fine; it's clearing up something 
+a bit muddled about Windows networked drives.
+<P>
+It helps to think of share points as being like drive letters.
+Example:
+<PRE>
+        k: is not a directory
+        k:\ is a directory
+        k:\media is a directory
+        k:\media\ is not a directory
+</PRE>
+The same rules apply if you substitute "k:" with "\\conky\foo":
+<PRE>
+        \\conky\foo  is not a directory
+        \\conky\foo\ is a directory
+        \\conky\foo\media is a directory
+        \\conky\foo\media\ is not a directory
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.006.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.006.htp">Log info</A>
+
+/ Last changed on Sun Jan 31 08:44:48 1999 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="8.7">8.7. PyRun_SimpleFile() crashes on Windows but not on Unix</A></H2>
+I've seen a number of reports of PyRun_SimpleFile() failing
+in a Windows port of an application embedding Python that worked
+fine on Unix.  PyRun_SimpleString() works fine on both platforms.
+<P>
+I think this happens because the application was compiled with a 
+different set of compiler flags than Python15.DLL.  It seems that some 
+compiler flags affect the standard I/O library in such a way that 
+using different flags makes calls fail.  You need to set it for 
+the non-debug multi-threaded DLL (/MD on the command line, or can be set via MSVC under Project Settings-&gt;C++/Code Generation then the "Use rum-time library" dropdown.)
+<P>
+Also note that you can not mix-and-match Debug and Release versions.  If you wish to use the Debug Multithreaded DLL, then your module _must_ have an "_d" appended to the base name.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.007.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.007.htp">Log info</A>
+
+/ Last changed on Wed Nov 17 17:37:07 1999 by
+<A HREF="mailto:mhammond@skippinet.com.au">Mark Hammond</A>
+<P>
+
+<HR>
+<H2><A NAME="8.8">8.8. Import of _tkinter fails on Windows 95/98</A></H2>
+Sometimes, the import of _tkinter fails on Windows 95 or 98,
+complaining with a message like the following:
+<P>
+<PRE>
+  ImportError: DLL load failed: One of the library files needed
+  to run this application cannot be found.
+</PRE>
+It could be that you haven't installed Tcl/Tk, but if you did
+install Tcl/Tk, and the Wish application works correctly,
+the problem may be that its installer didn't
+manage to edit the autoexec.bat file correctly.  It tries to add a
+statement that changes the PATH environment variable to include
+the Tcl/Tk 'bin' subdirectory, but sometimes this edit doesn't
+quite work.  Opening it with notepad usually reveals what the
+problem is.
+<P>
+(One additional hint, noted by David Szafranski: you can't use
+long filenames here; e.g. use C:\PROGRA~1\Tcl\bin instead of
+C:\Program Files\Tcl\bin.)
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.008.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.008.htp">Log info</A>
+
+/ Last changed on Wed Dec  2 22:32:41 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="8.9">8.9. Can't extract the downloaded documentation on Windows</A></H2>
+Sometimes, when you download the documentation package to a Windows
+machine using a web browser, the file extension of the saved file
+ends up being .EXE.  This is a mistake; the extension should be .TGZ.
+<P>
+Simply rename the downloaded file to have the .TGZ extension, and
+WinZip will be able to handle it.  (If your copy of WinZip doesn't,
+get a newer one from <A HREF="http://www.winzip.com">http://www.winzip.com</A>.)
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.009.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.009.htp">Log info</A>
+
+/ Last changed on Sat Nov 21 13:41:35 1998 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="8.10">8.10. Can't get Py_RunSimpleFile() to work.</A></H2>
+This is very sensitive to the compiler vendor, version and (perhaps)
+even options.  If the FILE* structure in your embedding program isn't
+the same as is assumed by the Python interpreter it won't work.
+<P>
+The Python 1.5.* DLLs (python15.dll) are all compiled
+with MS VC++ 5.0 and with multithreading-DLL options (/MD, I think).
+<P>
+If you can't change compilers or flags, try using Py_RunSimpleString().
+A trick to get it to run an arbitrary file is to construct a call to
+execfile() with the name of your file as argument.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.010.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.010.htp">Log info</A>
+
+/ Last changed on Wed Jan 13 10:58:14 1999 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="8.11">8.11. Where is Freeze for Windows?</A></H2>
+("Freeze" is a program that allows you to ship a Python program
+as a single stand-alone executable file.  It is <I>not</I> a compiler,
+your programs don't run any faster, but they are more easily
+distributable (to platforms with the same OS and CPU).  Read the
+README file of the freeze program for more disclaimers.)
+<P>
+You can use freeze on Windows, but you must download the source
+tree (see <A HREF="http://www.python.org/download/download_source.html">http://www.python.org/download/download_source.html</A>).
+This is recommended for Python 1.5.2 (and betas thereof) only;
+older versions don't quite work.
+<P>
+You need the Microsoft VC++ 5.0 compiler (maybe it works with
+6.0 too).  You probably need to build Python -- the project files
+are all in the PCbuild directory.
+<P>
+The freeze program is in the Tools\freeze subdirectory of the source
+tree.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.011.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.011.htp">Log info</A>
+
+/ Last changed on Wed Feb 17 18:47:24 1999 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="8.12">8.12. Is a *.pyd file the same as a DLL?</A></H2>
+Yes, .pyd files are dll's.  But there are a few differences.  If you
+have a DLL named foo.pyd, then it must have a function initfoo().  You
+can then write Python "import foo", and Python will search for foo.pyd
+(as well as foo.py, foo.pyc) and if it finds it, will attempt to call
+initfoo() to initialize it.  You do not link your .exe with foo.lib,
+as that would cause Windows to require the DLL to be present.
+<P>
+Note that the search path for foo.pyd is PYTHONPATH, not the same as
+the path that Windows uses to search for foo.dll.  Also, foo.pyd need
+not be present to run your program, whereas if you linked your program
+with a dll, the dll is required.  Of course, foo.pyd is required if
+you want to say "import foo".  In a dll, linkage is declared in the
+source code with __declspec(dllexport).  In a .pyd, linkage is defined
+in a list of available functions.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.012.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.012.htp">Log info</A>
+
+/ Last changed on Tue Nov 23 02:40:08 1999 by
+<A HREF="mailto:jquinn+psa@cs.oberlin.edu">Jameson Quinn</A>
+<P>
+
+<HR>
+<H2><A NAME="8.13">8.13. Missing cw3215mt.dll (or missing cw3215.dll)</A></H2>
+Sometimes, when using Tkinter on Windows, you get an error that
+cw3215mt.dll or cw3215.dll is missing.
+<P>
+Cause: you have an old Tcl/Tk DLL built with cygwin in your path
+(probably C:\Windows).  You must use the Tcl/Tk DLLs from the
+standard Tcl/Tk installation (Python 1.5.2 comes with one).
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.013.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.013.htp">Log info</A>
+
+/ Last changed on Fri Jun 11 00:54:13 1999 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="8.14">8.14. How to make python scripts executable:</A></H2>
+[Blake Coverett]
+<P>
+Win2K:
+<P>
+The standard installer already associates the .py extension with a file type
+(Python.File) and gives that file type an open command that runs the
+interpreter (D:\Program Files\Python\python.exe "%1" %*).  This is enough to
+make scripts executable from the command prompt as 'foo.py'.  If you'd
+rather be able to execute the script by simple typing 'foo' with no
+extension you need to add .py to the PATHEXT environment variable.
+<P>
+WinNT:
+<P>
+The steps taken by the installed as described above allow you do run a
+script with 'foo.py', but a long time bug in the NT command processor
+prevents you from redirecting the input or output of any script executed in
+this way.  This is often important.
+<P>
+An appropriate incantation for making a Python script executable under WinNT
+is to give the file an extension of .cmd and add the following as the first
+line:
+<P>
+<PRE>
+    @setlocal enableextensions &amp; python -x %~f0 %* &amp; goto :EOF
+</PRE>
+Win9x:
+<P>
+[Due to Bruce Eckel]
+<P>
+<PRE>
+  @echo off
+  rem = """
+  rem run python on this bat file. Needs the full path where
+  rem you keep your python files. The -x causes python to skip
+  rem the first line of the file:
+  python -x c:\aaa\Python\\"%0".bat %1 %2 %3 %4 %5 %6 %7 %8 %9
+  goto endofpython
+  rem """
+</PRE>
+<PRE>
+  # The python program goes here:
+</PRE>
+<PRE>
+  print "hello, Python"
+</PRE>
+<PRE>
+  # For the end of the batch file:
+  rem = """
+  :endofpython
+  rem """
+</PRE>
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.014.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.014.htp">Log info</A>
+
+/ Last changed on Tue Nov 30 10:25:17 1999 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="8.15">8.15. Warning about CTL3D32 version from installer</A></H2>
+The Python installer issues a warning like this:
+<P>
+<PRE>
+  This version uses CTL3D32.DLL whitch is not the correct version.
+  This version is used for windows NT applications only.
+</PRE>
+[Tim Peters]
+This is a Microsoft DLL, and a notorious
+source of problems.  The msg means what it says:  you have the wrong version
+of this DLL for your operating system.  The Python installation did not
+cause this -- something else you installed previous to this overwrote the
+DLL that came with your OS (probably older shareware of some sort, but
+there's no way to tell now).  If you search for "CTL3D32" using any search
+engine (AltaVista, for example), you'll find hundreds and hundreds of web
+pages complaining about the same problem with all sorts of installation
+programs.  They'll point you to ways to get the correct version reinstalled
+on your system (since Python doesn't cause this, we can't fix it).
+<P>
+David A Burton has written a little program to fix this.  Go to
+<A HREF="http://www.burtonsys.com/download.html">http://www.burtonsys.com/download.html</A> and click on "ctl3dfix.zip"
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.015.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.015.htp">Log info</A>
+
+/ Last changed on Thu Oct 26 15:42:00 2000 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<H2><A NAME="8.16">8.16. How can I embed Python into a Windows application?</A></H2>
+Edward K. Ream &lt;<A HREF="mailto:edream@tds.net">edream@tds.net</A>&gt; writes
+<P>
+When '##' appears in a file name below, it is an abbreviated version number.  For example, for Python 2.1.1, ## will be replaced by 21.
+<P>
+Embedding the Python interpreter in a Windows app can be summarized as
+follows:
+<P>
+1. Do _not_ build Python into your .exe file directly.  On Windows,
+Python must be a DLL to handle importing modules that are themselves
+DLL's.  (This is the first key undocumented fact.) Instead, link to
+python##.dll; it is typically installed in c:\Windows\System.  
+<P>
+You can link to Python statically or dynamically.  Linking statically
+means linking against python##.lib The drawback is that your app won't
+run if python##.dll does not exist on your system.
+<P>
+General note: python##.lib is the so-called "import lib" corresponding
+to python.dll.  It merely defines symbols for the linker.
+<P>
+Borland note: convert python##.lib to OMF format using Coff2Omf.exe
+first.
+<P>
+Linking dynamically greatly simplifies link options; everything happens
+at run time.  Your code must load python##.dll using the Windows
+LoadLibraryEx() routine.  The code must also use access routines and
+data in python##.dll (that is, Python's C API's) using pointers
+obtained by the Windows GetProcAddress() routine.  Macros can make
+using these pointers transparent to any C code that calls routines in
+Python's C API.
+<P>
+2. If you use SWIG, it is easy to create a Python "extension module"
+that will make the app's data and methods available to Python.  SWIG
+will handle just about all the grungy details for you.  The result is C
+code that you link _into your .exe file_ (!)  You do _not_ have to
+create a DLL file, and this also simplifies linking.
+<P>
+3.  SWIG will create an init function (a C function) whose name depends
+on the name of the extension module.  For example, if the name of the
+module is leo, the init function will be called initleo().  If you use
+SWIG shadow classes, as you should, the init function will be called
+initleoc().  This initializes a mostly hidden helper class used by the
+shadow class.
+<P>
+The reason you can link the C code in step 2 into your .exe file is that
+calling the initialization function is equivalent to importing the
+module into Python! (This is the second key undocumented fact.)
+<P>
+4. In short, you can use the following code to initialize the Python
+interpreter with your extension module.
+<P>
+<PRE>
+    #include "python.h"
+    ...
+    Py_Initialize();  // Initialize Python.
+    initmyAppc();  // Initialize (import) the helper class. 
+    PyRun_SimpleString("import myApp") ;  // Import the shadow class.
+</PRE>
+5. There are two problems with Python's C API which will become apparent
+if you use a compiler other than MSVC, the compiler used to build
+python##.dll.
+<P>
+Problem 1: The so-called "Very High Level" functions that take FILE *
+arguments will not work in a multi-compiler environment; each compiler's
+notion of a struct FILE will be different.  From an implementation
+standpoint these are very _low_ level functions.
+<P>
+Problem 2: SWIG generates the following code when generating wrappers to
+void functions:
+<P>
+<PRE>
+    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+</PRE>
+Alas, Py_None is a macro that expands to a reference to a complex data
+structure called _Py_NoneStruct inside python##.dll.  Again, this code
+will fail in a mult-compiler environment.  Replace such code by:
+<P>
+<PRE>
+    return Py_BuildValue("");
+</PRE>
+It may be possible to use SWIG's %typemap command to make the change
+automatically, though I have not been able to get this to work (I'm a
+complete SWIG newbie).
+<P>
+6. Using a Python shell script to put up a Python interpreter window
+from inside your Windows app is not a good idea; the resulting window
+will be independent of your app's windowing system.  Rather, you (or the
+wxPythonWindow class) should create a "native" interpreter window.  It
+is easy to connect that window to the Python interpreter.  You can
+redirect Python's i/o to _any_ object that supports read and write, so
+all you need is a Python object (defined in your extension module) that
+contains read() and write() methods.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.016.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.016.htp">Log info</A>
+
+/ Last changed on Thu Jan 31 16:29:34 2002 by
+<A HREF="mailto:vkryukov@ufg.com">Victor Kryukov</A>
+<P>
+
+<HR>
+<H2><A NAME="8.17">8.17. Setting up IIS 5 to use Python for CGI</A></H2>
+In order to set up Internet Information Services 5 to use Python for CGI processing, please see the following links:
+<P>
+<A HREF="http://www.e-coli.net/pyiis_server.html">http://www.e-coli.net/pyiis_server.html</A> (for Win2k Server)
+<A HREF="http://www.e-coli.net/pyiis.html">http://www.e-coli.net/pyiis.html</A> (for Win2k pro)
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.017.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.017.htp">Log info</A>
+
+/ Last changed on Fri Mar 22 22:05:51 2002 by
+<A HREF="mailto:dsavitsk@e-coli.net">douglas savitsky</A>
+<P>
+
+<HR>
+<H2><A NAME="8.18">8.18. How do I run a Python program under Windows?</A></H2>
+This is not necessarily quite the straightforward question it appears
+to be. If you are already familiar with running programs from the
+Windows command line then everything will seem really easy and
+obvious. If your computer experience is limited then you might need a
+little more guidance. Also there are differences between Windows 95,
+98, NT, ME, 2000 and XP which can add to the confusion. You might
+think of this as "why I pay software support charges" if you have a
+helpful and friendly administrator to help you set things up without
+having to understand all this yourself. If so, then great! Show them
+this page and it should be a done deal.
+<P>
+Unless you use some sort of integrated development environment (such
+as PythonWin or IDLE, to name only two in a growing family) then you
+will end up <I>typing</I> Windows commands into what is variously referred
+to as a "DOS window" or "Command prompt window". Usually you can
+create such a window from your Start menu (under Windows 2000 I use
+"Start | Programs | Accessories | Command Prompt").  You should be
+able to recognize when you have started such a window because you will
+see a Windows "command prompt", which usually looks like this:
+<P>
+<PRE>
+    C:\>
+</PRE>
+The letter may be different, and there might be other things after it,
+so you might just as easily see something like:
+<P>
+<PRE>
+    D:\Steve\Projects\Python>
+</PRE>
+depending on how your computer has been set up and what else you have
+recently done with it. Once you have started such a window, you are
+well on the way to running Python programs.
+<P>
+You need to realize that your Python scripts have to be processed by
+another program, usually called the "Python interpreter". The
+interpreter reads your script, "compiles" it into "Python bytecodes"
+(which are instructions for an imaginary computer known as the "Python
+Virtual Machine") and then executes the bytecodes to run your
+program. So, how do you arrange for the interpreter to handle your
+Python?
+<P>
+First, you need to make sure that your command window recognises the
+word "python" as an instruction to start the interpreter. If you have
+opened a command window, you should try entering the command:
+<P>
+<PRE>
+    python
+</PRE>
+and hitting return. If you then see something like:
+<P>
+<PRE>
+    Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32
+    Type "help", "copyright", "credits" or "license" for more information.
+    >>>
+</PRE>
+then this part of the job has been correctly managed during Python's
+installation process, and you have started the interpreter in
+"interactive mode". That means you can enter Python statements or
+expressions interactively and have them executed or evaluated while
+you wait. This is one of Python's strongest features, but it takes a
+little getting used to. Check it by entering a few expressions of your
+choice and seeing the results...
+<P>
+<PRE>
+    >>> print "Hello"
+    Hello
+    >>> "Hello" * 3
+    HelloHelloHello
+</PRE>
+When you want to end your interactive Python session, enter a
+terminator (hold the Ctrl key down while you enter a Z, then hit the
+"Enter" key) to get back to your Windows command prompt.  You may also
+find that you have a Start-menu entry such as "Start | Programs |
+Python 2.2 | Python (command line)" that results in you seeing the
+">>>" prompt in a new window. If so, the window will disappear after
+you enter the terminator -- Windows runs a single "python" command in
+the window, which terminates when you terminate the interpreter.
+<P>
+If the "python" command, instead of displaying the interpreter prompt ">>>", gives you a message like
+<P>
+<PRE>
+    'python' is not recognized as an internal or external command,
+    operable program or batch file.
+</PRE>
+or
+<P>
+<PRE>
+    Bad command or filename
+</PRE>
+then you need to make sure that your computer knows where to find the
+Python interpreter. To do this you will have to modify a setting
+called the PATH, which is a just list of directories where Windows
+will look for programs. Rather than just enter the right command every
+time you create a command window, you should arrange for Python's
+installation directory to be added to the PATH of every command window
+as it starts. If you installed Python fairly recently then the command
+<P>
+<PRE>
+    dir C:\py*
+</PRE>
+will probably tell you where it is installed. Alternatively, perhaps
+you made a note. Otherwise you will be reduced to a search of your
+whole disk ... break out the Windows explorer and use "Tools | Find"
+or hit the "Search" button and look for "python.exe". Suppose you
+discover that Python is installed in the C:\Python22 directory (the
+default at the time of writing) then you should make sure that
+entering the command
+<P>
+<PRE>
+    c:\Python22\python
+</PRE>
+starts up the interpreter as above (and don't forget you'll need a
+"CTRL-Z" and an "Enter" to get out of it). Once you have verified the
+directory, you need to add it to the start-up routines your computer
+goes through.  For older versions of Windows the easiest way to do
+this is to edit the C:\AUTOEXEC.BAT file. You would want to add a line
+like the following to AUTOEXEC.BAT:
+<P>
+<PRE>
+    PATH C:\Python22;%PATH%
+</PRE>
+For Windows NT, 2000 and (I assume) XP, you will need to add a string
+such as
+<P>
+<PRE>
+    ;C:\Python22
+</PRE>
+to the current setting for the PATH environment variable, which you
+will find in the properties window of "My Computer" under the
+"Advanced" tab. Note that if you have sufficient privilege you might
+get a choice of installing the settings either for the Current User or
+for System. The latter is preferred if you want everybody to be able
+to run Python on the machine.
+<P>
+If you aren't confident doing any of these manipulations yourself, ask
+for help!  At this stage you may or may not want to reboot your system
+to make absolutely sure the new setting has "taken" (don't you love
+the way Windows gives you these freqeuent coffee breaks). You probably
+won't need to for Windows NT, XP or 2000. You can also avoid it in
+earlier versions by editing the file C:\WINDOWS\COMMAND\CMDINIT.BAT
+instead of AUTOEXEC.BAT.
+<P>
+You should now be able to start a new command window, enter
+<P>
+<PRE>
+    python
+</PRE>
+at the "C:>" (or whatever) prompt, and see the ">>>" prompt that
+indicates the Python interpreter is reading interactive commands.
+<P>
+Let's suppose you have a program called "pytest.py" in directory
+"C:\Steve\Projects\Python". A session to run that program might look
+like this:
+<P>
+<PRE>
+    C:\> cd \Steve\Projects\Python
+    C:\Steve\Projects\Python> python pytest.py
+</PRE>
+Because you added a file name to the command to start the interpreter,
+when it starts up it reads the Python script in the named file,
+compiles it, executes it, and terminates (so you see another "C:\>"
+prompt).  You might also have entered
+<P>
+<PRE>
+    C:\> python \Steve\Projects\Python\pytest.py
+</PRE>
+if you hadn't wanted to change your current directory.
+<P>
+Under NT, 2000 and XP you may well find that the installation process
+has also arranged that the command
+<P>
+<PRE>
+    pytest.py
+</PRE>
+(or, if the file isn't in the current directory)
+<P>
+<PRE>
+    C:\Steve\Projects\Python\pytest.py
+</PRE>
+will automatically recognize the ".py" extension and run the Python
+interpreter on the named file. Using this feature is fine, but <I>some</I>
+versions of Windows have bugs which mean that this form isn't exactly
+equivalent to using the interpreter explicitly, so be careful. Easier
+to remember, for now, that
+<P>
+<PRE>
+    python C:\Steve\Projects\Python\pytest.py
+</PRE>
+works pretty close to the same, and redirection will work (more)
+reliably.
+<P>
+The important things to remember are:
+<P>
+1. Start Python from the Start Menu, or make sure the PATH is set
+correctly so Windows can find the Python interpreter.
+<P>
+<PRE>
+    python
+</PRE>
+should give you a '>>>" prompt from the Python interpreter. Don't
+forget the CTRL-Z and ENTER to terminate the interpreter (and, if you
+started the window from the Start Menu, make the window disappear).
+<P>
+2. Once this works, you run programs with commands:
+<P>
+<PRE>
+    python {program-file}
+</PRE>
+3. When you know the commands to use you can build Windows shortcuts
+to run the Python interpreter on any of your scripts, naming
+particular working directories, and adding them to your menus, but
+that's another lessFAQ. Take a look at
+<P>
+<PRE>
+    python --help
+</PRE>
+if your needs are complex.
+<P>
+4. Interactive mode (where you see the ">>>" prompt) is best used
+<I>not</I> for running programs, which are better executed as in steps 2
+and 3, but for checking that individual statements and expressions do
+what you think they will, and for developing code by experiment.
+<P>
+
+<A HREF="faqw.py?req=edit&amp;file=faq08.018.htp">Edit this entry</A> /
+<A HREF="faqw.py?req=log&amp;file=faq08.018.htp">Log info</A>
+
+/ Last changed on Tue Aug 20 16:19:53 2002 by
+<A HREF="mailto:guido@python.org">GvR</A>
+<P>
+
+<HR>
+<A HREF="http://www.python.org">Python home</A> /
+<A HREF="faqw.py?req=home">Python FAQ Wizard 1.0.3</A> /
+Feedback to <A HREF="mailto:guido@python.org">GvR</A>
+<P><A HREF="http://www.python.org/"><IMG
+SRC="http://www.python.org/pics/PythonPowered.gif" 
+ALIGN=top WIDTH=110 HEIGHT=44 ALT="Python Powered" BORDER=0></A><BR>
+</BODY>
+</HTML>
--- python3.3-3.3.0.orig/debian/PVER-doc.doc-base.PVER-inst.in
+++ python3.3-3.3.0/debian/PVER-doc.doc-base.PVER-inst.in
@@ -0,0 +1,12 @@
+Document: @PVER@-inst
+Title: Installing Python Modules (v@VER@)
+Author: Greg Ward
+Abstract: This document describes the Python Distribution Utilities
+ (``Distutils'') from the end-user's point-of-view, describing how to
+ extend the capabilities of a standard Python installation by building
+ and installing third-party Python modules and extensions.
+Section: Programming/Python
+
+Format: HTML
+Index: /usr/share/doc/@PVER@/html/install/index.html
+Files: /usr/share/doc/@PVER@/html/install/*.html
--- python3.3-3.3.0.orig/debian/mkbinfmt.py
+++ python3.3-3.3.0/debian/mkbinfmt.py
@@ -0,0 +1,18 @@
+# mkbinfmt.py
+import imp, sys, os.path
+
+magic = "".join(["\\x%.2x" % c for c in imp.get_magic()])
+
+name = sys.argv[1]
+ 
+binfmt = '''\
+package %s
+interpreter /usr/bin/%s
+magic %s\
+''' % (name, name, magic)
+
+#filename = '/usr/share/binfmts/' + name
+#open(filename,'w+').write(binfmt)
+
+sys.stdout.write(binfmt)
+sys.stdout.write('\n')
--- python3.3-3.3.0.orig/debian/PVER.postinst.in
+++ python3.3-3.3.0/debian/PVER.postinst.in
@@ -0,0 +1,30 @@
+#! /bin/sh -e
+
+if [ "$1" = configure ]; then
+    (
+    files=$(dpkg -L @PVER@ | sed -n '/^\/usr\/lib\/@PVER@\/.*\.py$/p')
+	@PVER@ /usr/lib/@PVER@/py_compile.py $files
+	if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then
+	    @PVER@ -O /usr/lib/@PVER@/py_compile.py $files
+	fi
+    )
+fi
+
+oldlocalsite=/usr/local/lib/@PVER@/site-packages
+case "$1" in
+    configure|abort-upgrade|abort-remove|abort-deconfigure)
+	# issue #623057
+	if [ -d $oldlocalsite -a ! -h $oldlocalsite ]; then
+	    rmdir --ignore-fail-on-non-empty $oldlocalsite 2>/dev/null || true
+	fi
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- python3.3-3.3.0.orig/debian/pygettext.1
+++ python3.3-3.3.0/debian/pygettext.1
@@ -0,0 +1,108 @@
+.TH PYGETTEXT 1 "" "pygettext 1.4"
+.SH NAME
+pygettext \- Python equivalent of xgettext(1)
+.SH SYNOPSIS
+.B pygettext
+[\fIOPTIONS\fR] \fIINPUTFILE \fR...
+.SH DESCRIPTION
+pygettext is deprecated. The current version of xgettext supports
+many languages, including Python.
+
+pygettext uses Python's standard tokenize module to scan Python
+source code, generating .pot files identical to what GNU xgettext generates
+for C and C++ code.  From there, the standard GNU tools can be used.
+.PP
+pygettext searches only for _() by default, even though GNU xgettext
+recognizes the following keywords: gettext, dgettext, dcgettext,
+and gettext_noop. See the \fB\-k\fR/\fB\--keyword\fR flag below for how to
+augment this.
+.PP
+.SH OPTIONS
+.TP
+\fB\-a\fR, \fB\-\-extract\-all\fR
+Extract all strings.
+.TP
+\fB\-d\fR, \fB\-\-default\-domain\fR=\fINAME\fR
+Rename the default output file from messages.pot to name.pot.
+.TP
+\fB\-E\fR, \fB\-\-escape\fR
+Replace non-ASCII characters with octal escape sequences.
+.TP
+\fB\-D\fR, \fB\-\-docstrings\fR
+Extract module, class, method, and function docstrings.
+These do not need to be wrapped in _() markers, and in fact cannot
+be for Python to consider them docstrings. (See also the \fB\-X\fR option).
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Print this help message and exit.
+.TP
+\fB\-k\fR, \fB\-\-keyword\fR=\fIWORD\fR
+Keywords to look for in addition to the default set, which are: _
+.IP
+You can have multiple \fB\-k\fR flags on the command line.
+.TP
+\fB\-K\fR, \fB\-\-no\-default\-keywords\fR
+Disable the default set of keywords (see above).
+Any keywords explicitly added with the \fB\-k\fR/\fB\--keyword\fR option
+are still recognized.
+.TP
+\fB\-\-no\-location\fR
+Do not write filename/lineno location comments.
+.TP
+\fB\-n\fR, \fB\-\-add\-location\fR
+Write filename/lineno location comments indicating where each
+extracted string is found in the source.  These lines appear before
+each msgid.  The style of comments is controlled by the
+\fB\-S\fR/\fB\--style\fR option.  This is the default.
+.TP
+\fB\-o\fR, \fB\-\-output\fR=\fIFILENAME\fR
+Rename the default output file from messages.pot to FILENAME.
+If FILENAME is `-' then the output is sent to standard out.
+.TP
+\fB\-p\fR, \fB\-\-output\-dir\fR=\fIDIR\fR
+Output files will be placed in directory DIR.
+.TP
+\fB\-S\fR, \fB\-\-style\fR=\fISTYLENAME\fR
+Specify which style to use for location comments.
+Two styles are supported:
+.RS
+.IP \(bu 4
+Solaris	# File: filename, line: line-number
+.IP \(bu 4
+GNU		#: filename:line
+.RE
+.IP
+The style name is case insensitive.
+GNU style is the default.
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+Print the names of the files being processed.
+.TP
+\fB\-V\fR, \fB\-\-version\fR
+Print the version of pygettext and exit.
+.TP
+\fB\-w\fR, \fB\-\-width\fR=\fICOLUMNS\fR
+Set width of output to columns.
+.TP
+\fB\-x\fR, \fB\-\-exclude\-file\fR=\fIFILENAME\fR
+Specify a file that contains a list of strings that are not be
+extracted from the input files.  Each string to be excluded must
+appear on a line by itself in the file.
+.TP
+\fB\-X\fR, \fB\-\-no\-docstrings\fR=\fIFILENAME\fR
+Specify a file that contains a list of files (one per line) that
+should not have their docstrings extracted.  This is only useful in
+conjunction with the \fB\-D\fR option above.
+.PP
+If `INPUTFILE' is -, standard input is read.
+.SH BUGS
+pygettext attempts to be option and feature compatible with GNU xgettext
+where ever possible.  However some options are still missing or are not fully
+implemented.  Also, xgettext's use of command line switches with option
+arguments is broken, and in these cases, pygettext just defines additional
+switches.
+.SH AUTHOR
+pygettext is written by Barry Warsaw <barry@zope.com>.
+.PP
+Joonas Paalasmaa <joonas.paalasmaa@iki.fi> put this manual page together
+based on "pygettext --help".
--- python3.3-3.3.0.orig/debian/PVER-doc.doc-base.PVER-ext.in
+++ python3.3-3.3.0/debian/PVER-doc.doc-base.PVER-ext.in
@@ -0,0 +1,16 @@
+Document: @PVER@-ext
+Title: Extending and Embedding the Python Interpreter (v@VER@)
+Author: Guido van Rossum
+Abstract: This document describes how to write modules in C or C++ to extend
+ the Python interpreter with new modules.  Those modules can define
+ new functions but also new object types and their methods.  The
+ document also describes how to embed the Python interpreter in
+ another application, for use as an extension language.  Finally,
+ it shows how to compile and link extension modules so that they
+ can be loaded dynamically (at run time) into the interpreter, if
+ the underlying operating system supports this feature.
+Section: Programming/Python
+
+Format: HTML
+Index: /usr/share/doc/@PVER@/html/extending/index.html
+Files: /usr/share/doc/@PVER@/html/extending/*.html
--- python3.3-3.3.0.orig/debian/PVER-minimal.prerm.in
+++ python3.3-3.3.0/debian/PVER-minimal.prerm.in
@@ -0,0 +1,53 @@
+#! /bin/sh -e
+
+syssite=/usr/lib/@PVER@/site-packages
+localsite=/usr/local/lib/@PVER@/dist-packages
+
+remove_bytecode()
+{
+    pkg=$1
+    max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}')
+    dpkg -L $pkg \
+	| awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \
+	| xargs --max-chars="$max" echo \
+	| while read files; do rm -f $files; done
+    find /usr/lib/python3 /usr/lib/@PVER@ -name dist-packages -prune -o -name __pycache__ -empty -print \
+	| xargs -r rm -rf
+}
+
+case "$1" in
+    remove)
+	if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
+	    echo "Unlinking and removing bytecode for runtime @PVER@"
+	fi
+	for hook in /usr/share/python3/runtime.d/*.rtremove; do
+	    [ -x $hook ] || continue
+	    $hook rtremove @PVER@ || continue
+	done
+
+	remove_bytecode @PVER@-minimal
+
+	if which update-binfmts >/dev/null; then
+	    update-binfmts --package @PVER@ --remove @PVER@ /usr/bin/@PVER@
+	fi
+
+	if [ -h $syssite ]; then
+	    rm -f $syssite
+	fi
+	[ -d $localsite ] && rmdir $localsite 2>/dev/null || true
+	[ -d $(dirname $localsite) ] && rmdir $(dirname $localsite) 2>/dev/null || true
+        ;;
+    upgrade)
+	remove_bytecode @PVER@-minimal
+        ;;
+    deconfigure)
+        ;;
+    failed-upgrade)
+        ;;
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
--- python3.3-3.3.0.orig/debian/patches/langpack-gettext.diff
+++ python3.3-3.3.0/debian/patches/langpack-gettext.diff
@@ -0,0 +1,36 @@
+# DP: Description: support alternative gettext tree in
+# DP: /usr/share/locale-langpack; if a file is present in both trees,
+# DP: prefer the newer one
+# DP: Upstream status: Ubuntu-Specific
+
+Index: b/Lib/gettext.py
+===================================================================
+--- a/Lib/gettext.py
++++ b/Lib/gettext.py
+@@ -378,11 +378,26 @@
+         if lang == 'C':
+             break
+         mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain)
++        mofile_lp = os.path.join("/usr/share/locale-langpack", lang,
++                               'LC_MESSAGES', '%s.mo' % domain)
++
++	# first look into the standard locale dir, then into the 
++	# langpack locale dir
++
++	# standard mo file
+         if os.path.exists(mofile):
+             if all:
+                 result.append(mofile)
+             else:
+                 return mofile
++        
++	# langpack mofile -> use it
++        if os.path.exists(mofile_lp): 
++            if all:
++                result.append(mofile_lp)
++            else:
++                return mofile_lp
++
+     return result
+ 
+ 
--- python3.3-3.3.0.orig/debian/patches/site-locations.diff
+++ python3.3-3.3.0/debian/patches/site-locations.diff
@@ -0,0 +1,51 @@
+# DP: Set site-packages/dist-packages
+
+Index: b/Lib/site.py
+===================================================================
+--- a/Lib/site.py
++++ b/Lib/site.py
+@@ -7,12 +7,18 @@
+ This will append site-specific paths to the module search path.  On
+ Unix (including Mac OSX), it starts with sys.prefix and
+ sys.exec_prefix (if different) and appends
+-lib/python<version>/site-packages as well as lib/site-python.
++lib/python3/dist-packages as well as lib/site-python.
+ On other platforms (such as Windows), it tries each of the
+ prefixes directly, as well as with lib/site-packages appended.  The
+ resulting directories, if they exist, are appended to sys.path, and
+ also inspected for path configuration files.
+ 
++For Debian and derivatives, this sys.path is augmented with directories
++for packages distributed within the distribution. Local addons go
++into /usr/local/lib/python<version>/dist-packages, Debian addons
++install into /usr/lib/python3/dist-packages.
++/usr/lib/python<version>/site-packages is not used.
++
+ If a file named "pyvenv.cfg" exists one directory above sys.executable,
+ sys.prefix and sys.exec_prefix are set to that directory and
+ it is also checked for site-packages and site-python (sys.base_prefix and
+@@ -303,10 +309,21 @@
+         if sys.platform in ('os2emx', 'riscos'):
+             sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
+         elif os.sep == '/':
++            if 'VIRTUAL_ENV' in os.environ:
++                sitepackages.append(os.path.join(prefix, "lib",
++                                                 "python" + sys.version[:3],
++                                                 "site-packages"))
++            sitepackages.append(os.path.join(prefix, "local/lib",
++                                             "python" + sys.version[:3],
++                                             "dist-packages"))
++            sitepackages.append(os.path.join(prefix, "lib",
++                                             "python3",
++                                             "dist-packages"))
++            # this one is deprecated for Debian
+             sitepackages.append(os.path.join(prefix, "lib",
+-                                        "python" + sys.version[:3],
+-                                        "site-packages"))
+-            sitepackages.append(os.path.join(prefix, "lib", "site-python"))
++                                             "python" + sys.version[:3],
++                                             "dist-packages"))
++            sitepackages.append(os.path.join(prefix, "lib", "dist-python"))
+         else:
+             sitepackages.append(prefix)
+             sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
--- python3.3-3.3.0.orig/debian/patches/doc-faq.dpatch
+++ python3.3-3.3.0/debian/patches/doc-faq.dpatch
@@ -0,0 +1,52 @@
+#! /bin/sh -e
+
+# DP: Mention the FAQ on the documentation index page.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+    pdir="-d $3"
+    dir="$3/"
+elif [ $# -ne 1 ]; then
+    echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
+    exit 1
+fi
+case "$1" in
+    -patch)
+        patch $pdir -f --no-backup-if-mismatch -p0 < $0
+        ;;
+    -unpatch)
+        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+        ;;
+    *)
+	echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
+        exit 1
+esac
+exit 0
+
+--- Doc/html/index.html.in~	2002-04-01 18:11:27.000000000 +0200
++++ Doc/html/index.html.in	2003-04-05 13:33:35.000000000 +0200
+@@ -123,6 +123,24 @@
+           </ul>
+           </td>
+         </tr>
++        <tr>
++          <td valign="baseline" class="left-column">
++          &nbsp;
++          <ul>
++            <li> <a href="../../python/FAQ.html" class="title"
++                >FAQ (local copy)</a>
++              <br>(python package must be installed)
++          </ul>
++          </td>
++          <td valign="baseline" class="right-column">
++          &nbsp;
++          <ul>
++            <li> <a href="http://www.python.org/cgi-bin/faqw.py" class="title"
++                >FAQ (online wizard)</a>
++              <br>(maybe more recent)
++          </ul>
++          </td>
++        </tr>
+       </tbody>
+     </table>
+     <p>
--- python3.3-3.3.0.orig/debian/patches/deb-locations.diff
+++ python3.3-3.3.0/debian/patches/deb-locations.diff
@@ -0,0 +1,30 @@
+# DP: adjust locations of directories to debian policy
+
+Index: b/Lib/pydoc.py
+===================================================================
+--- a/Lib/pydoc.py
++++ b/Lib/pydoc.py
+@@ -27,6 +27,10 @@
+ 
+ Module docs for core modules are assumed to be in
+ 
++    /usr/share/doc/pythonX.Y/html/library
++
++if the pythonX.Y-doc package is installed or in
++
+     http://docs.python.org/X.Y/library/
+ 
+ This can be overridden by setting the PYTHONDOCS environment variable
+Index: b/Misc/python.man
+===================================================================
+--- a/Misc/python.man
++++ b/Misc/python.man
+@@ -305,7 +305,7 @@
+ These are subject to difference depending on local installation
+ conventions; ${prefix} and ${exec_prefix} are installation-dependent
+ and should be interpreted as for GNU software; they may be the same.
+-The default for both is \fI/usr/local\fP.
++On Debian GNU/{Hurd,Linux} the default for both is \fI/usr\fP.
+ .IP \fI${exec_prefix}/bin/python\fP
+ Recommended location of the interpreter.
+ .PP
--- python3.3-3.3.0.orig/debian/patches/no-large-file-support.diff
+++ python3.3-3.3.0/debian/patches/no-large-file-support.diff
@@ -0,0 +1,14 @@
+# DP: disable large file support for GNU/Hurd
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1402,6 +1402,9 @@
+   use_lfs=no
+ fi
+ 
++# Don't use largefile support anyway.
++use_lfs=no
++
+ if test "$use_lfs" = "yes"; then
+ # Two defines needed to enable largefile support on various platforms
+ # These may affect some typedefs
--- python3.3-3.3.0.orig/debian/patches/hurd-path_max.diff
+++ python3.3-3.3.0/debian/patches/hurd-path_max.diff
@@ -0,0 +1,83 @@
+# DP: Replace PATH_MAX with MAXPATHLEN.
+
+--- a/Python/pythonrun.c
++++ b/Python/pythonrun.c
+@@ -680,7 +680,7 @@
+ }
+ 
+ static wchar_t *default_home = NULL;
+-static wchar_t env_home[PATH_MAX+1];
++static wchar_t env_home[MAXPATHLEN+1];
+ 
+ void
+ Py_SetPythonHome(wchar_t *home)
+@@ -695,8 +695,8 @@
+     if (home == NULL && !Py_IgnoreEnvironmentFlag) {
+         char* chome = Py_GETENV("PYTHONHOME");
+         if (chome) {
+-            size_t r = mbstowcs(env_home, chome, PATH_MAX+1);
+-            if (r != (size_t)-1 && r <= PATH_MAX)
++            size_t r = mbstowcs(env_home, chome, MAXPATHLEN+1);
++            if (r != (size_t)-1 && r <= MAXPATHLEN)
+                 home = env_home;
+         }
+ 
+--- a/Python/sysmodule.c
++++ b/Python/sysmodule.c
+@@ -1804,7 +1804,7 @@
+ #else /* All other filename syntaxes */
+     if (_HAVE_SCRIPT_ARGUMENT(argc, argv)) {
+ #if defined(HAVE_REALPATH)
+-        if (_Py_wrealpath(argv0, fullpath, PATH_MAX)) {
++        if (_Py_wrealpath(argv0, fullpath, MAXPATHLEN)) {
+             argv0 = fullpath;
+         }
+ #endif
+--- a/Python/fileutils.c
++++ b/Python/fileutils.c
+@@ -325,7 +326,7 @@
+ _Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t bufsiz)
+ {
+     char *cpath;
+-    char cbuf[PATH_MAX];
++    char cbuf[MAXPATHLEN];
+     wchar_t *wbuf;
+     int res;
+     size_t r1;
+@@ -335,11 +336,11 @@
+         errno = EINVAL;
+         return -1;
+     }
+-    res = (int)readlink(cpath, cbuf, PATH_MAX);
++    res = (int)readlink(cpath, cbuf, MAXPATHLEN);
+     PyMem_Free(cpath);
+     if (res == -1)
+         return -1;
+-    if (res == PATH_MAX) {
++    if (res == MAXPATHLEN) {
+         errno = EINVAL;
+         return -1;
+     }
+@@ -370,7 +371,7 @@
+               wchar_t *resolved_path, size_t resolved_path_size)
+ {
+     char *cpath;
+-    char cresolved_path[PATH_MAX];
++    char cresolved_path[MAXPATHLEN];
+     wchar_t *wresolved_path;
+     char *res;
+     size_t r;
+@@ -409,11 +410,11 @@
+ #ifdef MS_WINDOWS
+     return _wgetcwd(buf, size);
+ #else
+-    char fname[PATH_MAX];
++    char fname[MAXPATHLEN];
+     wchar_t *wname;
+     size_t len;
+ 
+-    if (getcwd(fname, PATH_MAX) == NULL)
++    if (getcwd(fname, MAXPATHLEN) == NULL)
+         return NULL;
+     wname = _Py_char2wchar(fname, &len);
+     if (wname == NULL)
--- python3.3-3.3.0.orig/debian/patches/lib2to3-no-pickled-grammar.diff
+++ python3.3-3.3.0/debian/patches/lib2to3-no-pickled-grammar.diff
@@ -0,0 +1,14 @@
+--- a/Lib/lib2to3/pgen2/driver.py
++++ b/Lib/lib2to3/pgen2/driver.py
+@@ -119,7 +119,10 @@
+     if force or not _newer(gp, gt):
+         logger.info("Generating grammar tables from %s", gt)
+         g = pgen.generate_grammar(gt)
+-        if save:
++        # the pickle files mismatch, when built on different architectures.
++        # don't save these for now. An alternative solution might be to
++        # include the multiarch triplet into the file name
++        if False:
+             logger.info("Writing grammar tables to %s", gp)
+             try:
+                 g.dump(gp)
--- python3.3-3.3.0.orig/debian/patches/config-update.diff
+++ python3.3-3.3.0/debian/patches/config-update.diff
@@ -0,0 +1,320 @@
+Index: b/Modules/_ctypes/libffi/config.guess
+===================================================================
+--- a/Modules/_ctypes/libffi/config.guess
++++ b/Modules/_ctypes/libffi/config.guess
+@@ -2,9 +2,9 @@
+ # Attempt to guess a canonical system name.
+ #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+-#   2011 Free Software Foundation, Inc.
++#   2011, 2012 Free Software Foundation, Inc.
+ 
+-timestamp='2011-06-03'
++timestamp='2012-02-10'
+ 
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+@@ -17,9 +17,7 @@
+ # General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+-# 02110-1301, USA.
++# along with this program; if not, see <http://www.gnu.org/licenses/>.
+ #
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+@@ -57,8 +55,8 @@
+ 
+ Originally written by Per Bothner.
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+-Software Foundation, Inc.
++2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
++Free Software Foundation, Inc.
+ 
+ This is free software; see the source for copying conditions.  There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -145,7 +143,7 @@
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+     *:NetBSD:*:*)
+ 	# NetBSD (nbsd) targets should (where applicable) match one or
+-	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
++	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+ 	# switched to ELF, *-*-netbsd* would select the old
+ 	# object file format.  This provides both forward
+@@ -792,13 +790,12 @@
+ 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ 	exit ;;
+     *:FreeBSD:*:*)
+-	case ${UNAME_MACHINE} in
+-	    pc98)
+-		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++	UNAME_PROCESSOR=`/usr/bin/uname -p`
++	case ${UNAME_PROCESSOR} in
+ 	    amd64)
+ 		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ 	    *)
+-		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ 	esac
+ 	exit ;;
+     i*:CYGWIN*:*)
+@@ -807,6 +804,9 @@
+     *:MINGW*:*)
+ 	echo ${UNAME_MACHINE}-pc-mingw32
+ 	exit ;;
++    i*:MSYS*:*)
++	echo ${UNAME_MACHINE}-pc-msys
++	exit ;;
+     i*:windows32*:*)
+ 	# uname -m includes "-pc" on this system.
+ 	echo ${UNAME_MACHINE}-mingw32
+@@ -861,6 +861,13 @@
+     i*86:Minix:*:*)
+ 	echo ${UNAME_MACHINE}-pc-minix
+ 	exit ;;
++    aarch64:Linux:*:*)
++	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	exit ;;
++    aarch64_be:Linux:*:*)
++	UNAME_MACHINE=aarch64_be
++	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	exit ;;
+     alpha:Linux:*:*)
+ 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ 	  EV5)   UNAME_MACHINE=alphaev5 ;;
+@@ -895,13 +902,16 @@
+ 	echo ${UNAME_MACHINE}-unknown-linux-gnu
+ 	exit ;;
+     cris:Linux:*:*)
+-	echo cris-axis-linux-gnu
++	echo ${UNAME_MACHINE}-axis-linux-gnu
+ 	exit ;;
+     crisv32:Linux:*:*)
+-	echo crisv32-axis-linux-gnu
++	echo ${UNAME_MACHINE}-axis-linux-gnu
+ 	exit ;;
+     frv:Linux:*:*)
+-	echo frv-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	exit ;;
++    hexagon:Linux:*:*)
++	echo ${UNAME_MACHINE}-unknown-linux-gnu
+ 	exit ;;
+     i*86:Linux:*:*)
+ 	LIBC=gnu
+@@ -943,7 +953,7 @@
+ 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ 	;;
+     or32:Linux:*:*)
+-	echo or32-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-gnu
+ 	exit ;;
+     padre:Linux:*:*)
+ 	echo sparc-unknown-linux-gnu
+@@ -984,7 +994,7 @@
+ 	echo ${UNAME_MACHINE}-dec-linux-gnu
+ 	exit ;;
+     x86_64:Linux:*:*)
+-	echo x86_64-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-gnu
+ 	exit ;;
+     xtensa*:Linux:*:*)
+ 	echo ${UNAME_MACHINE}-unknown-linux-gnu
+@@ -1315,6 +1325,9 @@
+     i*86:AROS:*:*)
+ 	echo ${UNAME_MACHINE}-pc-aros
+ 	exit ;;
++    x86_64:VMkernel:*:*)
++	echo ${UNAME_MACHINE}-unknown-esx
++	exit ;;
+ esac
+ 
+ #echo '(No uname command or uname output not recognized.)' 1>&2
+Index: b/Modules/_ctypes/libffi/config.sub
+===================================================================
+--- a/Modules/_ctypes/libffi/config.sub
++++ b/Modules/_ctypes/libffi/config.sub
+@@ -2,9 +2,9 @@
+ # Configuration validation subroutine script.
+ #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+-#   2011 Free Software Foundation, Inc.
++#   2011, 2012 Free Software Foundation, Inc.
+ 
+-timestamp='2011-10-29'
++timestamp='2012-04-18'
+ 
+ # This file is (in principle) common to ALL GNU software.
+ # The presence of a machine in this file suggests that SOME GNU software
+@@ -21,9 +21,7 @@
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+-# 02110-1301, USA.
++# along with this program; if not, see <http://www.gnu.org/licenses/>.
+ #
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+@@ -76,8 +74,8 @@
+ GNU config.sub ($timestamp)
+ 
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+-Software Foundation, Inc.
++2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
++Free Software Foundation, Inc.
+ 
+ This is free software; see the source for copying conditions.  There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -132,6 +130,10 @@
+     os=-$maybe_os
+     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+     ;;
++  android-linux)
++    os=-linux-android
++    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
++    ;;
+   *)
+     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+     if [ $basic_machine != $1 ]
+@@ -223,6 +225,12 @@
+ 	-isc*)
+ 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ 		;;
++	-lynx*178)
++		os=-lynxos178
++		;;
++	-lynx*5)
++		os=-lynxos5
++		;;
+ 	-lynx*)
+ 		os=-lynxos
+ 		;;
+@@ -247,6 +255,7 @@
+ 	# Some are omitted here because they have special meanings below.
+ 	1750a | 580 \
+ 	| a29k \
++	| aarch64 | aarch64_be \
+ 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ 	| am33_2.0 \
+@@ -319,8 +328,7 @@
+ 	c6x)
+ 		basic_machine=tic6x-unknown
+ 		;;
+-	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+-		# Motorola 68HC11/12.
++	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+ 		basic_machine=$basic_machine-unknown
+ 		os=-none
+ 		;;
+@@ -333,7 +341,10 @@
+ 	strongarm | thumb | xscale)
+ 		basic_machine=arm-unknown
+ 		;;
+-
++	xgate)
++		basic_machine=$basic_machine-unknown
++		os=-none
++		;;
+ 	xscaleeb)
+ 		basic_machine=armeb-unknown
+ 		;;
+@@ -356,6 +367,7 @@
+ 	# Recognize the basic CPU types with company name.
+ 	580-* \
+ 	| a29k-* \
++	| aarch64-* | aarch64_be-* \
+ 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+@@ -719,7 +731,6 @@
+ 	i370-ibm* | ibm*)
+ 		basic_machine=i370-ibm
+ 		;;
+-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+ 	i*86v32)
+ 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ 		os=-sysv32
+@@ -816,6 +827,10 @@
+ 	ms1-*)
+ 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ 		;;
++	msys)
++		basic_machine=i386-pc
++		os=-msys
++		;;
+ 	mvs)
+ 		basic_machine=i370-ibm
+ 		os=-mvs
+@@ -1343,7 +1358,7 @@
+ 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ 	      | -chorusos* | -chorusrdb* | -cegcc* \
+-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
++	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ 	      | -mingw32* | -linux-gnu* | -linux-android* \
+ 	      | -linux-newlib* | -linux-uclibc* \
+ 	      | -uxpv* | -beos* | -mpeix* | -udk* \
+@@ -1528,6 +1543,9 @@
+ 	c4x-* | tic4x-*)
+ 		os=-coff
+ 		;;
++	hexagon-*)
++		os=-elf
++		;;
+ 	tic54x-*)
+ 		os=-coff
+ 		;;
+@@ -1555,9 +1573,6 @@
+ 		;;
+ 	m68000-sun)
+ 		os=-sunos3
+-		# This also exists in the configure program, but was not the
+-		# default.
+-		# os=-sunos4
+ 		;;
+ 	m68*-cisco)
+ 		os=-aout
+Index: b/config.sub
+===================================================================
+--- a/config.sub
++++ b/config.sub
+@@ -4,7 +4,7 @@
+ #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+ #   2011, 2012 Free Software Foundation, Inc.
+ 
+-timestamp='2012-02-10'
++timestamp='2012-04-18'
+ 
+ # This file is (in principle) common to ALL GNU software.
+ # The presence of a machine in this file suggests that SOME GNU software
+@@ -225,6 +225,12 @@
+ 	-isc*)
+ 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ 		;;
++	-lynx*178)
++		os=-lynxos178
++		;;
++	-lynx*5)
++		os=-lynxos5
++		;;
+ 	-lynx*)
+ 		os=-lynxos
+ 		;;
+@@ -1537,6 +1543,9 @@
+ 	c4x-* | tic4x-*)
+ 		os=-coff
+ 		;;
++	hexagon-*)
++		os=-elf
++		;;
+ 	tic54x-*)
+ 		os=-coff
+ 		;;
--- python3.3-3.3.0.orig/debian/patches/ncurses-configure.diff
+++ python3.3-3.3.0/debian/patches/ncurses-configure.diff
@@ -0,0 +1,61 @@
+# DP: Fix ncurses configure checks
+
+--- a/configure.ac	Tue Jul 10 18:27:54 2012 +0200
++++ b/configure.ac	Thu Jul 12 19:28:17 2012 +0200
+@@ -1485,11 +1485,9 @@
+ 
+ # checks for header files
+ AC_HEADER_STDC
+-ac_save_cppflags="$CPPFLAGS"
+-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
+-AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
++AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \
+ fcntl.h grp.h \
+-ieeefp.h io.h langinfo.h libintl.h ncurses.h process.h pthread.h \
++ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
+ sched.h shadow.h signal.h stdint.h stropts.h termios.h \
+ unistd.h utime.h \
+ poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
+@@ -1500,7 +1498,6 @@
+ sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
+ libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
+ bluetooth/bluetooth.h linux/tipc.h spawn.h util.h)
+-CPPFLAGS=$ac_save_cppflags
+ AC_HEADER_DIRENT
+ AC_HEADER_MAJOR
+ 
+@@ -1520,14 +1517,6 @@
+ #endif
+ ])
+ 
+-
+-# On Solaris, term.h requires curses.h
+-AC_CHECK_HEADERS(term.h,,,[
+-#ifdef HAVE_CURSES_H
+-#include <curses.h>
+-#endif
+-])
+-
+ # On Linux, netlink.h requires asm/types.h
+ AC_CHECK_HEADERS(linux/netlink.h,,,[
+ #ifdef HAVE_ASM_TYPES_H
+@@ -4208,8 +4197,19 @@
+   [Define if you have struct stat.st_mtimensec])
+ fi
+ 
++# first curses header check
+ ac_save_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
++
++AC_CHECK_HEADERS(curses.h ncurses.h)
++
++# On Solaris, term.h requires curses.h
++AC_CHECK_HEADERS(term.h,,,[
++#ifdef HAVE_CURSES_H
++#include <curses.h>
++#endif
++])
++
+ # On HP/UX 11.0, mvwdelch is a block with a return statement
+ AC_MSG_CHECKING(whether mvwdelch is an expression)
+ AC_CACHE_VAL(ac_cv_mvwdelch_is_expression,
--- python3.3-3.3.0.orig/debian/patches/lto-link-flags.diff
+++ python3.3-3.3.0/debian/patches/lto-link-flags.diff
@@ -0,0 +1,22 @@
+Index: b/Makefile.pre.in
+===================================================================
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -120,7 +120,7 @@
+ # Symbols used for using shared libraries
+ SO=		@SO@
+ LDSHARED=	@LDSHARED@ $(PY_LDFLAGS)
+-BLDSHARED=	@BLDSHARED@ $(PY_LDFLAGS)
++BLDSHARED=	@BLDSHARED@ $(PY_LDFLAGS) $(PY_CFLAGS)
+ LDCXXSHARED=	@LDCXXSHARED@
+ DESTSHARED=	$(BINLIBDEST)/lib-dynload
+ 
+@@ -464,7 +464,7 @@
+ 
+ # Build the interpreter
+ $(BUILDPYTHON):	Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
+-	$(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
++	$(LINKCC) $(PY_LDFLAGS) $(PY_CFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+ 
+ platform: $(BUILDPYTHON) $(SYSCONFIGDATA)
+ 	$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
--- python3.3-3.3.0.orig/debian/patches/revert-r83234.diff
+++ python3.3-3.3.0/debian/patches/revert-r83234.diff
@@ -0,0 +1,227 @@
+--- a/Doc/conf.py
++++ b/Doc/conf.py
+@@ -13,7 +13,7 @@
+ # ---------------------
+ 
+ extensions = ['sphinx.ext.refcounting', 'sphinx.ext.coverage',
+-              'sphinx.ext.doctest', 'pyspecific']
++              'sphinx.ext.doctest']
+ templates_path = ['tools/sphinxext']
+ 
+ # General substitutions.
+--- a/Doc/tools/sphinxext/pyspecific.py
++++ b/Doc/tools/sphinxext/pyspecific.py
+@@ -84,32 +84,6 @@
+         return [pnode]
+ 
+ 
+-# Support for documenting decorators
+-
+-from sphinx import addnodes
+-from sphinx.domains.python import PyModulelevel, PyClassmember
+-
+-class PyDecoratorMixin(object):
+-    def handle_signature(self, sig, signode):
+-        ret = super(PyDecoratorMixin, self).handle_signature(sig, signode)
+-        signode.insert(0, addnodes.desc_addname('@', '@'))
+-        return ret
+-
+-    def needs_arglist(self):
+-        return False
+-
+-class PyDecoratorFunction(PyDecoratorMixin, PyModulelevel):
+-    def run(self):
+-        # a decorator function is a function after all
+-        self.name = 'py:function'
+-        return PyModulelevel.run(self)
+-
+-class PyDecoratorMethod(PyDecoratorMixin, PyClassmember):
+-    def run(self):
+-        self.name = 'py:method'
+-        return PyClassmember.run(self)
+-
+-
+ # Support for documenting version of removal in deprecations
+ 
+ from sphinx.locale import versionlabels
+@@ -227,6 +201,7 @@
+ # Support for documenting Opcodes
+ 
+ import re
++from sphinx import addnodes
+ 
+ opcode_sig_re = re.compile(r'(\w+(?:\+\d)?)(?:\s*\((.*)\))?')
+ 
+@@ -280,5 +255,3 @@
+     app.add_description_unit('pdbcommand', 'pdbcmd', '%s (pdb command)',
+                              parse_pdb_command)
+     app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)')
+-    app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction)
+-    app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod)
+--- a/Doc/library/contextlib.rst
++++ b/Doc/library/contextlib.rst
+@@ -15,7 +15,7 @@
+ Functions provided:
+ 
+ 
+-.. decorator:: contextmanager
++.. function:: contextmanager(func)
+ 
+    This function is a :term:`decorator` that can be used to define a factory
+    function for :keyword:`with` statement context managers, without needing to
+--- a/Doc/library/abc.rst
++++ b/Doc/library/abc.rst
+@@ -126,7 +126,7 @@
+ 
+ It also provides the following decorators:
+ 
+-.. decorator:: abstractmethod(function)
++.. function:: abstractmethod(function)
+ 
+    A decorator indicating abstract methods.
+ 
+--- a/Doc/library/unittest.rst
++++ b/Doc/library/unittest.rst
+@@ -666,20 +666,20 @@
+ 
+ The following decorators implement test skipping and expected failures:
+ 
+-.. decorator:: skip(reason)
++.. function:: skip(reason)
+ 
+    Unconditionally skip the decorated test.  *reason* should describe why the
+    test is being skipped.
+ 
+-.. decorator:: skipIf(condition, reason)
++.. function:: skipIf(condition, reason)
+ 
+    Skip the decorated test if *condition* is true.
+ 
+-.. decorator:: skipUnless(condition, reason)
++.. function:: skipUnless(condition, reason)
+ 
+    Skip the decorated test unless *condition* is true.
+ 
+-.. decorator:: expectedFailure
++.. function:: expectedFailure
+ 
+    Mark the test as an expected failure.  If the test fails when run, the test
+    is not counted as a failure.
+@@ -973,11 +973,11 @@
+       :attr:`exception` attribute.  This can be useful if the intention
+       is to perform additional checks on the exception raised::
+ 
+-         with self.assertRaises(SomeException) as cm:
+-             do_something()
++        with self.assertRaises(SomeException) as cm:
++            do_something()
+ 
+-         the_exception = cm.exception
+-         self.assertEqual(the_exception.error_code, 3)
++        the_exception = cm.exception
++        self.assertEqual(the_exception.error_code, 3)
+ 
+       .. versionchanged:: 3.1
+          Added the ability to use :meth:`assertRaises` as a context manager.
+--- a/Doc/library/importlib.rst
++++ b/Doc/library/importlib.rst
+@@ -469,7 +469,7 @@
+ This module contains the various objects that help in the construction of
+ an :term:`importer`.
+ 
+-.. decorator:: module_for_loader
++.. function:: module_for_loader(method)
+ 
+     A :term:`decorator` for a :term:`loader` method,
+     to handle selecting the proper
+@@ -494,7 +494,7 @@
+     Use of this decorator handles all the details of which module object a
+     loader should initialize as specified by :pep:`302`.
+ 
+-.. decorator:: set_loader
++.. function:: set_loader(fxn)
+ 
+     A :term:`decorator` for a :term:`loader` method,
+     to set the :attr:`__loader__`
+@@ -502,7 +502,7 @@
+     does nothing. It is assumed that the first positional argument to the
+     wrapped method is what :attr:`__loader__` should be set to.
+ 
+-.. decorator:: set_package
++.. function:: set_package(fxn)
+ 
+     A :term:`decorator` for a :term:`loader` to set the :attr:`__package__`
+     attribute on the module returned by the loader. If :attr:`__package__` is
+--- a/Doc/library/functools.rst
++++ b/Doc/library/functools.rst
+@@ -111,7 +111,7 @@
+ 
+    .. versionadded:: 3.2
+ 
+-.. decorator:: total_ordering
++.. function:: total_ordering(cls)
+ 
+    Given a class defining one or more rich comparison ordering methods, this
+    class decorator supplies the rest.  This simplifies the effort involved
+@@ -217,7 +217,7 @@
+       Missing attributes no longer trigger an :exc:`AttributeError`.
+ 
+ 
+-.. decorator:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)
++.. function:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES)
+ 
+    This is a convenience function for invoking ``partial(update_wrapper,
+    wrapped=wrapped, assigned=assigned, updated=updated)`` as a function decorator
+--- a/Doc/documenting/markup.rst
++++ b/Doc/documenting/markup.rst
+@@ -177,37 +177,6 @@
+    are modified), side effects, and possible exceptions.  A small example may be
+    provided.
+ 
+-.. describe:: decorator
+-
+-   Describes a decorator function.  The signature should *not* represent the
+-   signature of the actual function, but the usage as a decorator.  For example,
+-   given the functions
+-
+-   .. code-block:: python
+-
+-      def removename(func):
+-          func.__name__ = ''
+-          return func
+-
+-      def setnewname(name):
+-          def decorator(func):
+-              func.__name__ = name
+-              return func
+-          return decorator
+-
+-   the descriptions should look like this::
+-
+-      .. decorator:: removename
+-
+-         Remove name of the decorated function.
+-
+-      .. decorator:: setnewname(name)
+-
+-         Set name of the decorated function to *name*.
+-
+-   There is no ``deco`` role to link to a decorator that is marked up with
+-   this directive; rather, use the ``:func:`` role.
+-
+ .. describe:: class
+ 
+    Describes a class.  The signature can include parentheses with parameters
+@@ -225,12 +194,6 @@
+    parameter.  The description should include similar information to that
+    described for ``function``.
+ 
+-.. describe:: decoratormethod
+-
+-   Same as ``decorator``, but for decorators that are methods.
+-
+-   Refer to a decorator method using the ``:meth:`` role.
+-
+ .. describe:: opcode
+ 
+    Describes a Python :term:`bytecode` instruction.
--- python3.3-3.3.0.orig/debian/patches/statvfs-f_flag-constants.diff
+++ python3.3-3.3.0/debian/patches/statvfs-f_flag-constants.diff
@@ -0,0 +1,57 @@
+# DP: Modules/posixmodule.c: Add flags for statvfs.f_flag to constant list.
+
+From: Peter Jones <pjones@redhat.com>
+Date: Wed, 6 Jan 2010 15:22:38 -0500
+Subject: [PATCH] Add flags for statvfs.f_flag to constant list.
+
+ Modules/posixmodule.c |   37 +++++++++++++++++++++++++++++++++++++
+ 1 files changed, 37 insertions(+), 0 deletions(-)
+
+Index: b/Modules/posixmodule.c
+===================================================================
+--- a/Modules/posixmodule.c
++++ b/Modules/posixmodule.c
+@@ -11704,6 +11704,43 @@
+     if (ins(d, "F_TEST", (long)F_TEST)) return -1;
+ #endif
+ 
++	/* These came from statvfs.h */
++#ifdef ST_RDONLY
++	if (ins(d, "ST_RDONLY", (long)ST_RDONLY)) return -1;
++#endif /* ST_RDONLY */
++#ifdef ST_NOSUID
++	if (ins(d, "ST_NOSUID", (long)ST_NOSUID)) return -1;
++#endif /* ST_NOSUID */
++
++	/* GNU extensions */
++#ifdef ST_NODEV
++	if (ins(d, "ST_NODEV", (long)ST_NODEV)) return -1;
++#endif /* ST_NODEV */
++#ifdef ST_NOEXEC
++	if (ins(d, "ST_NOEXEC", (long)ST_NOEXEC)) return -1;
++#endif /* ST_NOEXEC */
++#ifdef ST_SYNCHRONOUS
++	if (ins(d, "ST_SYNCHRONOUS", (long)ST_SYNCHRONOUS)) return -1;
++#endif /* ST_SYNCHRONOUS */
++#ifdef ST_MANDLOCK
++	if (ins(d, "ST_MANDLOCK", (long)ST_MANDLOCK)) return -1;
++#endif /* ST_MANDLOCK */
++#ifdef ST_WRITE
++	if (ins(d, "ST_WRITE", (long)ST_WRITE)) return -1;
++#endif /* ST_WRITE */
++#ifdef ST_APPEND
++	if (ins(d, "ST_APPEND", (long)ST_APPEND)) return -1;
++#endif /* ST_APPEND */
++#ifdef ST_NOATIME
++	if (ins(d, "ST_NOATIME", (long)ST_NOATIME)) return -1;
++#endif /* ST_NOATIME */
++#ifdef ST_NODIRATIME
++	if (ins(d, "ST_NODIRATIME", (long)ST_NODIRATIME)) return -1;
++#endif /* ST_NODIRATIME */
++#ifdef ST_RELATIME
++	if (ins(d, "ST_RELATIME", (long)ST_RELATIME)) return -1;
++#endif /* ST_RELATIME */
++
+ #ifdef HAVE_SPAWNV
+ #if defined(PYOS_OS2) && defined(PYCC_GCC)
+     if (ins(d, "P_WAIT", (long)P_WAIT)) return -1;
--- python3.3-3.3.0.orig/debian/patches/deb-setup.diff
+++ python3.3-3.3.0/debian/patches/deb-setup.diff
@@ -0,0 +1,33 @@
+# DP: Don't include /usr/local/include and /usr/local/lib as gcc search paths
+
+Index: b/setup.py
+===================================================================
+--- a/setup.py
++++ b/setup.py
+@@ -248,8 +248,10 @@
+         # unfortunately, distutils doesn't let us provide separate C and C++
+         # compilers
+         if compiler is not None:
+-            (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
+-            args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
++            (ccshared, cppflags, cflags) = \
++                sysconfig.get_config_vars('CCSHARED', 'CPPFLAGS', 'CFLAGS')
++            cppflags = ' '.join([f for f in cppflags.split() if not f.startswith('-I')])
++            args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cppflags + ' ' + cflags
+         self.compiler.set_executables(**args)
+ 
+         # Not only do we write the builddir cookie, but we manually install
+@@ -455,12 +457,7 @@
+             os.unlink(tmpfile)
+ 
+     def detect_modules(self):
+-        # Ensure that /usr/local is always used, but the local build
+-        # directories (i.e. '.' and 'Include') must be first.  See issue
+-        # 10520.
+-        if not cross_compiling:
+-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+-            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
++        # On Debian /usr/local is always used, so we don't include it twice
+         # only change this for cross builds for 3.3, issues on Mageia
+         if cross_compiling:
+             self.add_gcc_paths()
--- python3.3-3.3.0.orig/debian/patches/revert-r83274.diff
+++ python3.3-3.3.0/debian/patches/revert-r83274.diff
@@ -0,0 +1,12 @@
+--- a/Doc/conf.py
++++ b/Doc/conf.py
+@@ -65,9 +65,6 @@
+ # Options for HTML output
+ # -----------------------
+ 
+-html_theme = 'default'
+-html_theme_options = {'collapsiblesidebar': True}
+-
+ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+ # using the given strftime format.
+ html_last_updated_fmt = '%b %d, %Y'
--- python3.3-3.3.0.orig/debian/patches/tkinter-import.diff
+++ python3.3-3.3.0/debian/patches/tkinter-import.diff
@@ -0,0 +1,18 @@
+# DP: suggest installation of python-tk package on failing _tkinter import
+
+Index: b/Lib/tkinter/__init__.py
+===================================================================
+--- a/Lib/tkinter/__init__.py
++++ b/Lib/tkinter/__init__.py
+@@ -37,7 +37,10 @@
+ 
+ import warnings
+ 
+-import _tkinter # If this fails your Python may not be configured for Tk
++try:
++    import _tkinter
++except ImportError as msg:
++    raise ImportError(str(msg) + ', please install the python-tk package')
+ TclError = _tkinter.TclError
+ from tkinter.constants import *
+ 
--- python3.3-3.3.0.orig/debian/patches/link-opt.diff
+++ python3.3-3.3.0/debian/patches/link-opt.diff
@@ -0,0 +1,26 @@
+# DP: Call the linker with -O1 -Bsymbolic-functions
+
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -1801,8 +1801,8 @@
+ 		fi
+ 		;;
+ 	Linux*|GNU*|QNX*)
+-		LDSHARED='$(CC) -shared'
+-		LDCXXSHARED='$(CXX) -shared';;
++		LDSHARED='$(CC) -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
++		LDCXXSHARED='$(CXX) -shared -Wl,-O1 -Wl,-Bsymbolic-functions';;
+ 	BSD/OS*/4*)
+ 		LDSHARED="gcc -shared"
+ 		LDCXXSHARED="g++ -shared";;
+@@ -1900,7 +1900,7 @@
+ 	    LINKFORSHARED="-Wl,-E -Wl,+s";;
+ #	    LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
+ 	BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
+-	Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
++	Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions";;
+ 	# -u libsys_s pulls in all symbols in libsys
+ 	Darwin/*) 
+ 		LINKFORSHARED="$extra_undefs -framework CoreFoundation"
--- python3.3-3.3.0.orig/debian/patches/kfreebsd-xattrs.diff
+++ python3.3-3.3.0/debian/patches/kfreebsd-xattrs.diff
@@ -0,0 +1,13 @@
+# DP: Don't define USE_XATTRS on kfreebsd and the Hurd.
+
+--- a/Modules/posixmodule.c
++++ b/Modules/posixmodule.c
+@@ -111,7 +111,7 @@
+ #undef HAVE_SCHED_SETAFFINITY
+ #endif
+ 
+-#if defined(HAVE_SYS_XATTR_H) && defined(__GLIBC__)
++#if defined(HAVE_SYS_XATTR_H) && defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
+ #define USE_XATTRS
+ #endif
+ 
--- python3.3-3.3.0.orig/debian/patches/link-timemodule.diff
+++ python3.3-3.3.0/debian/patches/link-timemodule.diff
@@ -0,0 +1,13 @@
+Index: b/Modules/Setup.dist
+===================================================================
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -166,7 +166,7 @@
+ #cmath cmathmodule.c _math.c # -lm # complex math library functions
+ #math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
+ #_struct _struct.c	# binary structure packing/unpacking
+-#time timemodule.c # -lm # time operations and variables
++#time timemodule.c -lrt # -lm # time operations and variables
+ #_weakref _weakref.c	# basic weak reference support
+ #_testcapi _testcapimodule.c    # Python C API test module
+ #_random _randommodule.c	# Random number generator
--- python3.3-3.3.0.orig/debian/patches/distutils-link.diff
+++ python3.3-3.3.0/debian/patches/distutils-link.diff
@@ -0,0 +1,20 @@
+# DP: Don't add standard library dirs to library_dirs and runtime_library_dirs.
+
+Index: b/Lib/distutils/unixccompiler.py
+===================================================================
+--- a/Lib/distutils/unixccompiler.py
++++ b/Lib/distutils/unixccompiler.py
+@@ -211,6 +211,13 @@
+                                         runtime_library_dirs)
+         libraries, library_dirs, runtime_library_dirs = fixed_args
+ 
++        # filter out standard library paths, which are not explicitely needed
++        # for linking
++        library_dirs = [dir for dir in library_dirs
++                        if not dir in ('/lib', '/lib64', '/usr/lib', '/usr/lib64')]
++        runtime_library_dirs = [dir for dir in runtime_library_dirs
++                                if not dir in ('/lib', '/lib64', '/usr/lib', '/usr/lib64')]
++
+         lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs,
+                                    libraries)
+         if not isinstance(output_dir, (str, type(None))):
--- python3.3-3.3.0.orig/debian/patches/doc-build.diff
+++ python3.3-3.3.0/debian/patches/doc-build.diff
@@ -0,0 +1,38 @@
+# DP: Allow docs to be built with Sphinx 0.5.x.
+
+--- a/Doc/tools/sphinxext/pyspecific.py
++++ b/Doc/tools/sphinxext/pyspecific.py
+@@ -171,8 +171,15 @@
+ from docutils.io import StringOutput
+ from docutils.utils import new_document
+ 
+-from sphinx.builders import Builder
+-from sphinx.writers.text import TextWriter
++try:
++    from sphinx.builders import Builder
++except ImportError:
++    from sphinx.builder import Builder
++
++try:
++    from sphinx.writers.text import TextWriter
++except ImportError:
++    from sphinx.textwriter import TextWriter
+ 
+ 
+ class PydocTopicsBuilder(Builder):
+--- a/Doc/tools/sphinxext/suspicious.py
++++ b/Doc/tools/sphinxext/suspicious.py
+@@ -47,7 +47,12 @@
+ import sys
+ 
+ from docutils import nodes
+-from sphinx.builders import Builder
++
++try:
++    from sphinx.builders import Builder
++except ImportError:
++    from sphinx.builder import Builder
++
+ 
+ detect_all = re.compile(r'''
+     ::(?=[^=])|            # two :: (but NOT ::=)
--- python3.3-3.3.0.orig/debian/patches/disable-sem-check.diff
+++ python3.3-3.3.0/debian/patches/disable-sem-check.diff
@@ -0,0 +1,38 @@
+# DP: Assume working semaphores, don't rely on running kernel for the check.
+
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -3595,8 +3595,13 @@
+ AC_MSG_RESULT($ac_cv_posix_semaphores_enabled)
+ if test $ac_cv_posix_semaphores_enabled = no
+ then
+-  AC_DEFINE(POSIX_SEMAPHORES_NOT_ENABLED, 1,
+-            [Define if POSIX semaphores aren't enabled on your system])
++  case $ac_sys_system in
++    Linux*) # assume yes, see https://launchpad.net/bugs/630511
++      ;;
++    *)
++      AC_DEFINE(POSIX_SEMAPHORES_NOT_ENABLED, 1,
++                [Define if POSIX semaphores aren't enabled on your system])
++  esac
+ fi
+ 
+ # Multiprocessing check for broken sem_getvalue
+@@ -3631,8 +3636,13 @@
+ AC_MSG_RESULT($ac_cv_broken_sem_getvalue)
+ if test $ac_cv_broken_sem_getvalue = yes
+ then
+-  AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1,
+-  [define to 1 if your sem_getvalue is broken.])
++  case $ac_sys_system in
++    Linux*) # assume yes, see https://launchpad.net/bugs/630511
++      ;;
++    *)
++      AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1,
++      [define to 1 if your sem_getvalue is broken.])
++  esac
+ fi
+ 
+ # determine what size digit to use for Python's longs
--- python3.3-3.3.0.orig/debian/patches/apport-support.dpatch
+++ python3.3-3.3.0/debian/patches/apport-support.dpatch
@@ -0,0 +1,40 @@
+#! /bin/sh -e
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+    pdir="-d $3"
+    dir="$3/"
+elif [ $# -ne 1 ]; then
+    echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
+    exit 1
+fi
+case "$1" in
+    -patch)
+        patch $pdir -f --no-backup-if-mismatch -p0 < $0
+        ;;
+    -unpatch)
+        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+        ;;
+    *)
+	echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
+        exit 1
+esac
+exit 0
+
+--- Lib/site.py	2004-07-20 12:28:28.000000000 +1000
++++ Lib/site.py	2006-11-09 09:28:32.000000000 +1100
+@@ -393,6 +393,14 @@
+     # this module is run as a script, because this code is executed twice.
+     if hasattr(sys, "setdefaultencoding"):
+         del sys.setdefaultencoding
++    # install the apport exception handler if available
++    try:
++        import apport_python_hook
++    except ImportError:
++        pass
++    else:
++        apport_python_hook.install()
++
+ 
+ main()
+ 
--- python3.3-3.3.0.orig/debian/patches/series.in
+++ python3.3-3.3.0/debian/patches/series.in
@@ -0,0 +1,57 @@
+hg-updates.diff
+config-update.diff
+deb-setup.diff
+deb-locations.diff
+site-locations.diff
+distutils-install-layout.diff
+locale-module.diff
+distutils-link.diff
+distutils-sysconfig.diff
+test-sundry.diff
+tkinter-import.diff
+gdbm-import.diff
+link-opt.diff
+profile-doc.diff
+webbrowser.diff
+linecache.diff
+setup-modules.diff
+platform-lsbrelease.diff
+bdist-wininst-notfound.diff
+no-zip-on-sys.path.diff
+doc-nodownload.diff
+profiled-build.diff
+makesetup-bashism.diff
+hurd-disable-nonworking-constants.diff
+enable-fpectl.diff
+statvfs-f_flag-constants.diff
+#if defined (BROKEN_UTIMES)
+disable-utimes.diff
+#endif
+#if defined (Ubuntu)
+langpack-gettext.diff
+#endif
+#if defined (arch_os_hurd)
+no-large-file-support.diff
+hurd-path_max.diff
+#endif
+#ifdef OLD_SPHINX
+doc-build.diff
+revert-r83234.diff
+revert-r83274.diff
+#endif
+#link-system-expat.diff
+disable-sem-check.diff
+lib-argparse.diff
+ctypes-arm.diff
+link-timemodule.diff
+lto-link-flags.diff
+libffi-shared.diff
+avoid-rpath.diff
+multiarch.diff
+ncurses-configure.diff
+distutils-init.diff
+lib2to3-no-pickled-grammar.diff
+ext-no-libpython-link.diff
+add-python-config-sh.diff
+kfreebsd-xattrs.diff
+sys-multiarch.diff
--- python3.3-3.3.0.orig/debian/patches/test-sundry.diff
+++ python3.3-3.3.0/debian/patches/test-sundry.diff
@@ -0,0 +1,17 @@
+# DP: test_sundry: Don't fail on import of the profile and pstats module
+
+--- a/Lib/test/test_sundry.py
++++ b/Lib/test/test_sundry.py
+@@ -50,7 +50,11 @@
+             import mailcap
+             import nturl2path
+             import os2emxpath
+-            import pstats
++            try:
++                import pstats	# separated out into the python-profiler package
++            except ImportError:
++                if test_support.verbose:
++                    print("skipping profile and pstats")
+             import py_compile
+             import sndhdr
+             import tabnanny
--- python3.3-3.3.0.orig/debian/patches/sys-multiarch.diff
+++ python3.3-3.3.0/debian/patches/sys-multiarch.diff
@@ -0,0 +1,28 @@
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -647,6 +647,7 @@
+ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile
+ 	$(CC) -c $(PY_CORE_CFLAGS) \
+ 		-DABIFLAGS='"$(ABIFLAGS)"' \
++		-DMULTIARCH='"$(MULTIARCH)"' \
+ 		-o $@ $(srcdir)/Python/sysmodule.c
+ 
+ $(IO_OBJS): $(IO_H)
+--- a/Python/sysmodule.c
++++ b/Python/sysmodule.c
+@@ -1534,6 +1534,15 @@
+     if (res < 0)
+         goto error;
+ 
++    /* For Debian multiarch support. */
++    value = PyUnicode_FromString(MULTIARCH);
++    if (value == NULL)
++        goto error;
++    res = PyDict_SetItemString(impl_info, "_multiarch", value);
++    Py_DECREF(value);
++    if (res < 0)
++        goto error;
++
+     /* dict ready */
+ 
+     ns = _PyNamespace_New(impl_info);
--- python3.3-3.3.0.orig/debian/patches/doc-nodownload.diff
+++ python3.3-3.3.0/debian/patches/doc-nodownload.diff
@@ -0,0 +1,13 @@
+# DP: Don't try to download documentation tools
+
+--- a/Doc/Makefile
++++ b/Doc/Makefile
+@@ -58,7 +58,7 @@
+ 
+ update: clean checkout
+ 
+-build: checkout
++build:
+ 	mkdir -p build/$(BUILDER) build/doctrees
+ 	$(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS)
+ 	@echo
--- python3.3-3.3.0.orig/debian/patches/ctypes-arm.diff
+++ python3.3-3.3.0/debian/patches/ctypes-arm.diff
@@ -0,0 +1,34 @@
+Index: b/Lib/ctypes/util.py
+===================================================================
+--- a/Lib/ctypes/util.py
++++ b/Lib/ctypes/util.py
+@@ -170,16 +170,27 @@
+ 
+         def _findSoname_ldconfig(name):
+             import struct
++            # XXX this code assumes that we know all unames and that a single
++            # ABI is supported per uname; instead we should find what the
++            # ABI is (e.g. check ABI of current process) or simply ask libc
++            # to load the library for us
++            uname = os.uname()
++            # ARM has a variety of unames, e.g. armv7l
++            if uname.machine.startswith("arm"):
++                machine = "arm"
+             if struct.calcsize('l') == 4:
+-                machine = os.uname().machine + '-32'
++                machine = uname.machine + '-32'
+             else:
+-                machine = os.uname().machine + '-64'
++                machine = uname.machine + '-64'
+             mach_map = {
+                 'x86_64-64': 'libc6,x86-64',
+                 'ppc64-64': 'libc6,64bit',
+                 'sparc64-64': 'libc6,64bit',
+                 's390x-64': 'libc6,64bit',
+                 'ia64-64': 'libc6,IA-64',
++                # this actually breaks on biarch or multiarch as the first
++                # library wins; uname doesn't tell us which ABI we're using
++                'arm-32': 'libc6(,hard-float)?',
+                 }
+             abi_type = mach_map.get(machine, 'libc6')
+ 
--- python3.3-3.3.0.orig/debian/patches/gdbm-import.diff
+++ python3.3-3.3.0/debian/patches/gdbm-import.diff
@@ -0,0 +1,12 @@
+# DP: suggest installation of python-gdbm package on failing _gdbm import
+
+--- a/Lib/dbm/gnu.py
++++ b/Lib/dbm/gnu.py
+@@ -1,3 +1,6 @@
+ """Provide the _gdbm module as a dbm submodule."""
+ 
+-from _gdbm import *
++try:
++    from _gdbm import *
++except ImportError as msg:
++    raise ImportError(str(msg) + ', please install the python-gdbm package')
--- python3.3-3.3.0.orig/debian/patches/hg-updates.diff
+++ python3.3-3.3.0/debian/patches/hg-updates.diff
@@ -0,0 +1,71434 @@
+# DP: hg updates of the 3.3 release branch (until 2013-02-20, 82269:662f97427acf).
+
+# hg diff -r v3.3.0 | filterdiff --exclude=.hgignore --exclude=.hgeol --exclude=.hgtags --remove-timestamps
+
+diff -r bd8afb90ebf2 Doc/ACKS.txt
+--- a/Doc/ACKS.txt
++++ /dev/null
+@@ -1,239 +0,0 @@
+-Contributors to the Python Documentation
+-----------------------------------------
+-
+-This section lists people who have contributed in some way to the Python
+-documentation.  It is probably not complete -- if you feel that you or
+-anyone else should be on this list, please let us know (send email to
+-docs@python.org), and we'll be glad to correct the problem.
+-
+-.. acks::
+-
+-   * Aahz
+-   * Michael Abbott
+-   * Steve Alexander
+-   * Jim Ahlstrom
+-   * Fred Allen
+-   * A. Amoroso
+-   * Pehr Anderson
+-   * Oliver Andrich
+-   * Heidi Annexstad
+-   * Jesús Cea Avión
+-   * Manuel Balsera
+-   * Daniel Barclay
+-   * Chris Barker
+-   * Don Bashford
+-   * Anthony Baxter
+-   * Alexander Belopolsky
+-   * Bennett Benson
+-   * Jonathan Black
+-   * Robin Boerdijk
+-   * Michal Bozon
+-   * Aaron Brancotti
+-   * Georg Brandl
+-   * Keith Briggs
+-   * Ian Bruntlett
+-   * Lee Busby
+-   * Arnaud Calmettes
+-   * Lorenzo M. Catucci
+-   * Carl Cerecke
+-   * Mauro Cicognini
+-   * Gilles Civario
+-   * Mike Clarkson
+-   * Steve Clift
+-   * Dave Cole
+-   * Matthew Cowles
+-   * Jeremy Craven
+-   * Andrew Dalke
+-   * Ben Darnell
+-   * L. Peter Deutsch
+-   * Robert Donohue
+-   * Fred L. Drake, Jr.
+-   * Jacques Ducasse
+-   * Josip Dzolonga
+-   * Jeff Epler
+-   * Michael Ernst
+-   * Blame Andy Eskilsson
+-   * Carey Evans
+-   * Martijn Faassen
+-   * Carl Feynman
+-   * Dan Finnie
+-   * Hernán Martínez Foffani
+-   * Michael Foord
+-   * Stefan Franke
+-   * Jim Fulton
+-   * Peter Funk
+-   * Ethan Furman
+-   * Lele Gaifax
+-   * Matthew Gallagher
+-   * Gabriel Genellina
+-   * Ben Gertzfield
+-   * Nadim Ghaznavi
+-   * Jonathan Giddy
+-   * Matt Giuca
+-   * Shelley Gooch
+-   * Nathaniel Gray
+-   * Grant Griffin
+-   * Thomas Guettler
+-   * Anders Hammarquist
+-   * Mark Hammond
+-   * Harald Hanche-Olsen
+-   * Manus Hand
+-   * Gerhard Häring
+-   * Travis B. Hartwell
+-   * Tim Hatch
+-   * Janko Hauser
+-   * Ben Hayden
+-   * Thomas Heller
+-   * Bernhard Herzog
+-   * Magnus L. Hetland
+-   * Konrad Hinsen
+-   * Stefan Hoffmeister
+-   * Albert Hofkamp
+-   * Gregor Hoffleit
+-   * Steve Holden
+-   * Thomas Holenstein
+-   * Gerrit Holl
+-   * Rob Hooft
+-   * Brian Hooper
+-   * Randall Hopper
+-   * Michael Hudson
+-   * Eric Huss
+-   * Jeremy Hylton
+-   * Roger Irwin
+-   * Jack Jansen
+-   * Philip H. Jensen
+-   * Pedro Diaz Jimenez
+-   * Kent Johnson
+-   * Lucas de Jonge
+-   * Andreas Jung
+-   * Robert Kern
+-   * Jim Kerr
+-   * Jan Kim
+-   * Kamil Kisiel
+-   * Greg Kochanski
+-   * Guido Kollerie
+-   * Peter A. Koren
+-   * Daniel Kozan
+-   * Andrew M. Kuchling
+-   * Dave Kuhlman
+-   * Erno Kuusela
+-   * Ross Lagerwall
+-   * Thomas Lamb
+-   * Detlef Lannert
+-   * Piers Lauder
+-   * Julia Lawall
+-   * Glyph Lefkowitz
+-   * Robert Lehmann
+-   * Marc-André Lemburg
+-   * Ross Light
+-   * Gediminas Liktaras
+-   * Ulf A. Lindgren
+-   * Everett Lipman
+-   * Mirko Liss
+-   * Martin von Löwis
+-   * Fredrik Lundh
+-   * Jeff MacDonald
+-   * John Machin
+-   * Andrew MacIntyre
+-   * Vladimir Marangozov
+-   * Vincent Marchetti
+-   * Westley Martínez
+-   * Laura Matson
+-   * Daniel May
+-   * Rebecca McCreary
+-   * Doug Mennella
+-   * Paolo Milani
+-   * Skip Montanaro
+-   * Paul Moore
+-   * Ross Moore
+-   * Sjoerd Mullender
+-   * Dale Nagata
+-   * Trent Nelson
+-   * Michal Nowikowski
+-   * Steffen Daode Nurpmeso
+-   * Ng Pheng Siong
+-   * Koray Oner
+-   * Tomas Oppelstrup
+-   * Denis S. Otkidach
+-   * Zooko O'Whielacronx
+-   * Shriphani Palakodety
+-   * William Park
+-   * Joonas Paalasmaa
+-   * Harri Pasanen
+-   * Bo Peng
+-   * Tim Peters
+-   * Benjamin Peterson
+-   * Christopher Petrilli
+-   * Justin D. Pettit
+-   * Chris Phoenix
+-   * François Pinard
+-   * Paul Prescod
+-   * Eric S. Raymond
+-   * Edward K. Ream
+-   * Terry J. Reedy
+-   * Sean Reifschneider
+-   * Bernhard Reiter
+-   * Armin Rigo
+-   * Wes Rishel
+-   * Armin Ronacher
+-   * Jim Roskind
+-   * Guido van Rossum
+-   * Donald Wallace Rouse II
+-   * Mark Russell
+-   * Nick Russo
+-   * Chris Ryland
+-   * Constantina S.
+-   * Hugh Sasse
+-   * Bob Savage
+-   * Scott Schram
+-   * Neil Schemenauer
+-   * Barry Scott
+-   * Joakim Sernbrant
+-   * Justin Sheehy
+-   * Charlie Shepherd
+-   * Yue Shuaijie
+-   * SilentGhost
+-   * Michael Simcich
+-   * Ionel Simionescu
+-   * Michael Sloan
+-   * Gregory P. Smith
+-   * Roy Smith
+-   * Clay Spence
+-   * Nicholas Spies
+-   * Tage Stabell-Kulo
+-   * Frank Stajano
+-   * Anthony Starks
+-   * Greg Stein
+-   * Peter Stoehr
+-   * Mark Summerfield
+-   * Reuben Sumner
+-   * Kalle Svensson
+-   * Jim Tittsler
+-   * David Turner
+-   * Sandro Tosi
+-   * Ville Vainio
+-   * Nadeem Vawda
+-   * Martijn Vries
+-   * Charles G. Waldman
+-   * Greg Ward
+-   * Barry Warsaw
+-   * Corran Webster
+-   * Glyn Webster
+-   * Bob Weiner
+-   * Eddy Welbourne
+-   * Jeff Wheeler
+-   * Mats Wichmann
+-   * Gerry Wiener
+-   * Timothy Wild
+-   * Paul Winkler
+-   * Collin Winter
+-   * Blake Winton
+-   * Dan Wolfe
+-   * Adam Woodbeck
+-   * Steven Work
+-   * Thomas Wouters
+-   * Ka-Ping Yee
+-   * Rory Yorke
+-   * Moshe Zadka
+-   * Milan Zamazal
+-   * Cheng Zhang
+diff -r bd8afb90ebf2 Doc/Makefile
+--- a/Doc/Makefile
++++ b/Doc/Makefile
+@@ -53,7 +53,7 @@
+ 	fi
+ 	@if [ ! -d tools/pygments ]; then \
+ 	  echo "Checking out Pygments..."; \
+-	  svn checkout $(SVNROOT)/external/Pygments-1.3.1/pygments tools/pygments; \
++	  svn checkout $(SVNROOT)/external/Pygments-1.5dev-20120930/pygments tools/pygments; \
+ 	fi
+ 
+ update: clean checkout
+@@ -185,7 +185,11 @@
+ # for development releases: always build
+ autobuild-dev:
+ 	make update
+-	make dist SPHINXOPTS='-A daily=1'
++	make dist SPHINXOPTS='-A daily=1 -A versionswitcher=1'
++
++# for quick rebuilds (HTML only)
++autobuild-html:
++	make html SPHINXOPTS='-A daily=1 -A versionswitcher=1'
+ 
+ # for stable releases: only build if not in pre-release stage (alpha, beta, rc)
+ autobuild-stable:
+@@ -194,3 +198,4 @@
+ 		exit 1;; \
+ 	esac
+ 	@make autobuild-dev
++
+diff -r bd8afb90ebf2 Doc/README.txt
+--- a/Doc/README.txt
++++ b/Doc/README.txt
+@@ -135,7 +135,7 @@
+ as long as you don't change or remove the copyright notice:
+ 
+ ----------------------------------------------------------------------
+-Copyright (c) 2000-2012 Python Software Foundation.
++Copyright (c) 2000-2013 Python Software Foundation.
+ All rights reserved.
+ 
+ Copyright (c) 2000 BeOpen.com.
+diff -r bd8afb90ebf2 Doc/about.rst
+--- a/Doc/about.rst
++++ b/Doc/about.rst
+@@ -29,8 +29,13 @@
+ See :ref:`reporting-bugs` for information how to report bugs in this
+ documentation, or Python itself.
+ 
+-.. including the ACKS file here so that it can be maintained separately
+-.. include:: ACKS.txt
++
++Contributors to the Python Documentation
++----------------------------------------
++
++Many people have contributed to the Python language, the Python standard
++library, and the Python documentation.  See :source:`Misc/ACKS` in the Python
++source distribution for a partial list of contributors.
+ 
+ It is only with the input and contributions of the Python community
+ that Python has such wonderful documentation -- Thank You!
+diff -r bd8afb90ebf2 Doc/c-api/buffer.rst
+--- a/Doc/c-api/buffer.rst
++++ b/Doc/c-api/buffer.rst
+@@ -1,5 +1,10 @@
+ .. highlightlang:: c
+ 
++.. index::
++   single: buffer protocol
++   single: buffer interface; (see buffer protocol)
++   single: buffer object; (see buffer protocol)
++
+ .. _bufferobjects:
+ 
+ Buffer Protocol
+@@ -10,9 +15,6 @@
+ .. sectionauthor:: Stefan Krah
+ 
+ 
+-.. index::
+-   single: buffer interface
+-
+ Certain objects available in Python wrap access to an underlying memory
+ array or *buffer*.  Such objects include the built-in :class:`bytes` and
+ :class:`bytearray`, and some extension types like :class:`array.array`.
+@@ -24,8 +26,8 @@
+ then desirable, in some situations, to access that buffer directly and
+ without intermediate copying.
+ 
+-Python provides such a facility at the C level in the form of the *buffer
+-protocol*.  This protocol has two sides:
++Python provides such a facility at the C level in the form of the :ref:`buffer
++protocol <bufferobjects>`.  This protocol has two sides:
+ 
+ .. index:: single: PyBufferProcs
+ 
+diff -r bd8afb90ebf2 Doc/c-api/import.rst
+--- a/Doc/c-api/import.rst
++++ b/Doc/c-api/import.rst
+@@ -76,7 +76,7 @@
+    UTF-8 encoded string instead of a Unicode object.
+ 
+    .. versionchanged:: 3.3
+-         Negative values for **level** are no longer accepted.
++         Negative values for *level* are no longer accepted.
+ 
+ .. c:function:: PyObject* PyImport_Import(PyObject *name)
+ 
+diff -r bd8afb90ebf2 Doc/c-api/index.rst
+--- a/Doc/c-api/index.rst
++++ b/Doc/c-api/index.rst
+@@ -4,9 +4,6 @@
+   Python/C API Reference Manual
+ ##################################
+ 
+-:Release: |version|
+-:Date: |today|
+-
+ This manual documents the API used by C and C++ programmers who want to write
+ extension modules or embed Python.  It is a companion to :ref:`extending-index`,
+ which describes the general principles of extension writing but does not
+diff -r bd8afb90ebf2 Doc/c-api/object.rst
+--- a/Doc/c-api/object.rst
++++ b/Doc/c-api/object.rst
+@@ -160,11 +160,11 @@
+    a string similar to that returned by :c:func:`PyObject_Repr` in Python 2.
+    Called by the :func:`ascii` built-in function.
+ 
++   .. index:: string; PyObject_Str (C function)
++
+ 
+ .. c:function:: PyObject* PyObject_Str(PyObject *o)
+ 
+-   .. index:: builtin: str
+-
+    Compute a string representation of object *o*.  Returns the string
+    representation on success, *NULL* on failure.  This is the equivalent of the
+    Python expression ``str(o)``.  Called by the :func:`str` built-in function
+diff -r bd8afb90ebf2 Doc/c-api/sys.rst
+--- a/Doc/c-api/sys.rst
++++ b/Doc/c-api/sys.rst
+@@ -61,12 +61,6 @@
+    Return the object *name* from the :mod:`sys` module or *NULL* if it does
+    not exist, without setting an exception.
+ 
+-.. c:function:: FILE *PySys_GetFile(char *name, FILE *def)
+-
+-   Return the :c:type:`FILE*` associated with the object *name* in the
+-   :mod:`sys` module, or *def* if *name* is not in the module or is not associated
+-   with a :c:type:`FILE*`.
+-
+ .. c:function:: int PySys_SetObject(char *name, PyObject *v)
+ 
+    Set *name* in the :mod:`sys` module to *v* unless *v* is *NULL*, in which
+diff -r bd8afb90ebf2 Doc/c-api/unicode.rst
+--- a/Doc/c-api/unicode.rst
++++ b/Doc/c-api/unicode.rst
+@@ -735,15 +735,15 @@
+ The current locale encoding can be used to decode text from the operating
+ system.
+ 
+-.. c:function:: PyObject* PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len, int surrogateescape)
+-
+-   Decode a string from the current locale encoding. The decoder is strict if
+-   *surrogateescape* is equal to zero, otherwise it uses the
+-   ``'surrogateescape'`` error handler (:pep:`383`) to escape undecodable
+-   bytes. If a byte sequence can be decoded as a surrogate character and
+-   *surrogateescape* is not equal to zero, the byte sequence is escaped using
+-   the ``'surrogateescape'`` error handler instead of being decoded.  *str*
+-   must end with a null character but cannot contain embedded null characters.
++.. c:function:: PyObject* PyUnicode_DecodeLocaleAndSize(const char *str, \
++                                                        Py_ssize_t len, \
++                                                        const char *errors)
++
++   Decode a string from the current locale encoding. The supported
++   error handlers are ``"strict"`` and ``"surrogateescape"``
++   (:pep:`383`). The decoder uses ``"strict"`` error handler if
++   *errors* is ``NULL``.  *str* must end with a null character but
++   cannot contain embedded null characters.
+ 
+    .. seealso::
+ 
+@@ -754,7 +754,7 @@
+    .. versionadded:: 3.3
+ 
+ 
+-.. c:function:: PyObject* PyUnicode_DecodeLocale(const char *str, int surrogateescape)
++.. c:function:: PyObject* PyUnicode_DecodeLocale(const char *str, const char *errors)
+ 
+    Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string
+    length using :c:func:`strlen`.
+@@ -762,12 +762,13 @@
+    .. versionadded:: 3.3
+ 
+ 
+-.. c:function:: PyObject* PyUnicode_EncodeLocale(PyObject *unicode, int surrogateescape)
+-
+-   Encode a Unicode object to the current locale encoding. The encoder is
+-   strict if *surrogateescape* is equal to zero, otherwise it uses the
+-   ``'surrogateescape'`` error handler (:pep:`383`). Return a :class:`bytes`
+-   object. *str* cannot contain embedded null characters.
++.. c:function:: PyObject* PyUnicode_EncodeLocale(PyObject *unicode, const char *errors)
++
++   Encode a Unicode object to the current locale encoding. The
++   supported error handlers are ``"strict"`` and ``"surrogateescape"``
++   (:pep:`383`). The encoder uses ``"strict"`` error handler if
++   *errors* is ``NULL``. Return a :class:`bytes` object. *str* cannot
++   contain embedded null characters.
+ 
+    .. seealso::
+ 
+@@ -813,7 +814,7 @@
+ .. c:function:: PyObject* PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
+ 
+    Decode a string using :c:data:`Py_FileSystemDefaultEncoding` and the
+-   ``'surrogateescape'`` error handler, or ``'strict'`` on Windows.
++   ``"surrogateescape"`` error handler, or ``"strict"`` on Windows.
+ 
+    If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to the
+    locale encoding.
+@@ -826,13 +827,13 @@
+       :c:func:`PyUnicode_DecodeLocaleAndSize`.
+ 
+    .. versionchanged:: 3.2
+-      Use ``'strict'`` error handler on Windows.
++      Use ``"strict"`` error handler on Windows.
+ 
+ 
+ .. c:function:: PyObject* PyUnicode_DecodeFSDefault(const char *s)
+ 
+    Decode a null-terminated string using :c:data:`Py_FileSystemDefaultEncoding`
+-   and the ``'surrogateescape'`` error handler, or ``'strict'`` on Windows.
++   and the ``"surrogateescape"`` error handler, or ``"strict"`` on Windows.
+ 
+    If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to the
+    locale encoding.
+@@ -840,13 +841,13 @@
+    Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` if you know the string length.
+ 
+    .. versionchanged:: 3.2
+-      Use ``'strict'`` error handler on Windows.
++      Use ``"strict"`` error handler on Windows.
+ 
+ 
+ .. c:function:: PyObject* PyUnicode_EncodeFSDefault(PyObject *unicode)
+ 
+    Encode a Unicode object to :c:data:`Py_FileSystemDefaultEncoding` with the
+-   ``'surrogateescape'`` error handler, or ``'strict'`` on Windows, and return
++   ``"surrogateescape"`` error handler, or ``"strict"`` on Windows, and return
+    :class:`bytes`. Note that the resulting :class:`bytes` object may contain
+    null bytes.
+ 
+@@ -1083,8 +1084,6 @@
+    After completion, *\*byteorder* is set to the current byte order at the end
+    of input data.
+ 
+-   In a narrow build codepoints outside the BMP will be decoded as surrogate pairs.
+-
+    If *byteorder* is *NULL*, the codec starts in native order mode.
+ 
+    Return *NULL* if an exception was raised by the codec.
+diff -r bd8afb90ebf2 Doc/copyright.rst
+--- a/Doc/copyright.rst
++++ b/Doc/copyright.rst
+@@ -4,7 +4,7 @@
+ 
+ Python and this documentation is:
+ 
+-Copyright © 2001-2012 Python Software Foundation. All rights reserved.
++Copyright © 2001-2013 Python Software Foundation. All rights reserved.
+ 
+ Copyright © 2000 BeOpen.com. All rights reserved.
+ 
+diff -r bd8afb90ebf2 Doc/data/refcounts.dat
+--- a/Doc/data/refcounts.dat
++++ b/Doc/data/refcounts.dat
+@@ -1315,10 +1315,6 @@
+ PySys_AddXOption:void:::
+ PySys_AddXOption:const wchar_t*:s::
+ 
+-PySys_GetFile:FILE*:::
+-PySys_GetFile:char*:name::
+-PySys_GetFile:FILE*:def::
+-
+ PySys_GetObject:PyObject*::0:
+ PySys_GetObject:char*:name::
+ 
+diff -r bd8afb90ebf2 Doc/distutils/apiref.rst
+--- a/Doc/distutils/apiref.rst
++++ b/Doc/distutils/apiref.rst
+@@ -992,6 +992,12 @@
+    destination of the symlink will be copied.  *update* and *verbose* are the same
+    as for :func:`copy_file`.
+ 
++   Files in *src* that begin with :file:`.nfs` are skipped (more information on
++   these files is available in answer D2 of the `NFS FAQ page
++   <http://nfs.sourceforge.net/#section_d>`_.
++
++   .. versionchanged:: 3.3.1
++      NFS files are ignored.
+ 
+ .. function:: remove_tree(directory[, verbose=0, dry_run=0])
+ 
+diff -r bd8afb90ebf2 Doc/distutils/index.rst
+--- a/Doc/distutils/index.rst
++++ b/Doc/distutils/index.rst
+@@ -6,8 +6,6 @@
+ 
+ :Authors: Greg Ward, Anthony Baxter
+ :Email: distutils-sig@python.org
+-:Release: |version|
+-:Date: |today|
+ 
+ This document describes the Python Distribution Utilities ("Distutils") from
+ the module developer's point of view, describing how to use the Distutils to
+diff -r bd8afb90ebf2 Doc/distutils/packageindex.rst
+--- a/Doc/distutils/packageindex.rst
++++ b/Doc/distutils/packageindex.rst
+@@ -43,9 +43,9 @@
+ Maintainers may edit the package information, but not designate other Owners or
+ Maintainers.
+ 
+-By default PyPI will list all versions of a given package. To hide certain
+-versions, the Hidden property should be set to yes. This must be edited through
+-the web interface.
++By default PyPI displays only the newest version of a given package. The web
++interface lets one change this default behavior and manually select which
++versions to display and hide.
+ 
+ 
+ .. _pypirc:
+diff -r bd8afb90ebf2 Doc/distutils/uploading.rst
+--- a/Doc/distutils/uploading.rst
++++ b/Doc/distutils/uploading.rst
+@@ -25,21 +25,21 @@
+ entered password. This is useful if you do not want to store a clear text
+ password in the :file:`$HOME/.pypirc` file.
+ 
+-You can specify another PyPI server with the :option:`--repository=*url*` option::
++You can specify another PyPI server with the ``--repository=url`` option::
+ 
+     python setup.py sdist bdist_wininst upload -r http://example.com/pypi
+ 
+ See section :ref:`pypirc` for more on defining several servers.
+ 
+-You can use the :option:`--sign` option to tell :command:`upload` to sign each
++You can use the ``--sign`` option to tell :command:`upload` to sign each
+ uploaded file using GPG (GNU Privacy Guard).  The  :program:`gpg` program must
+ be available for execution on the system :envvar:`PATH`.  You can also specify
+-which key to use for signing using the :option:`--identity=*name*` option.
++which key to use for signing using the ``--identity=name`` option.
+ 
+-Other :command:`upload` options include :option:`--repository=<url>` or
+-:option:`--repository=<section>` where *url* is the url of the server and
++Other :command:`upload` options include ``--repository=url`` or
++``--repository=section`` where *url* is the url of the server and
+ *section* the name of the section in :file:`$HOME/.pypirc`, and
+-:option:`--show-response` (which displays the full response text from the PyPI
++``--show-response`` (which displays the full response text from the PyPI
+ server for help in debugging upload problems).
+ 
+ PyPI package display
+diff -r bd8afb90ebf2 Doc/extending/embedding.rst
+--- a/Doc/extending/embedding.rst
++++ b/Doc/extending/embedding.rst
+@@ -58,6 +58,7 @@
+    int
+    main(int argc, char *argv[])
+    {
++     Py_SetProgramName(argv[0]);  /* optional but recommended */
+      Py_Initialize();
+      PyRun_SimpleString("from time import time,ctime\n"
+                         "print('Today is', ctime(time()))\n");
+@@ -65,9 +66,11 @@
+      return 0;
+    }
+ 
+-The above code first initializes the Python interpreter with
++The :c:func:`Py_SetProgramName` function should be called before
++:c:func:`Py_Initialize` to inform the interpreter about paths to Python run-time
++libraries.  Next, the Python interpreter is initialized with
+ :c:func:`Py_Initialize`, followed by the execution of a hard-coded Python script
+-that print the date and time.  Afterwards, the :c:func:`Py_Finalize` call shuts
++that prints the date and time.  Afterwards, the :c:func:`Py_Finalize` call shuts
+ the interpreter down, followed by the end of the program.  In a real program,
+ you may want to get the Python script from another source, perhaps a text-editor
+ routine, a file, or a database.  Getting the Python code from a file can better
+diff -r bd8afb90ebf2 Doc/extending/index.rst
+--- a/Doc/extending/index.rst
++++ b/Doc/extending/index.rst
+@@ -4,9 +4,6 @@
+   Extending and Embedding the Python Interpreter
+ ##################################################
+ 
+-:Release: |version|
+-:Date: |today|
+-
+ This document describes how to write modules in C or C++ to extend the Python
+ interpreter with new modules.  Those modules can define new functions but also
+ new object types and their methods.  The document also describes how to embed
+diff -r bd8afb90ebf2 Doc/extending/newtypes.rst
+--- a/Doc/extending/newtypes.rst
++++ b/Doc/extending/newtypes.rst
+@@ -982,13 +982,13 @@
+    }
+ 
+ 
++.. index::
++   single: string; object representation
++   builtin: repr
++
+ Object Presentation
+ -------------------
+ 
+-.. index::
+-   builtin: repr
+-   builtin: str
+-
+ In Python, there are two ways to generate a textual representation of an object:
+ the :func:`repr` function, and the :func:`str` function.  (The :func:`print`
+ function just calls :func:`str`.)  These handlers are both optional.
+@@ -1277,9 +1277,9 @@
+ bit does not indicate that the slot values are non-*NULL*. The flag may be set
+ to indicate the presence of a slot, but a slot may still be unfilled.) ::
+ 
+-   PyNumberMethods   tp_as_number;
+-   PySequenceMethods tp_as_sequence;
+-   PyMappingMethods  tp_as_mapping;
++   PyNumberMethods   *tp_as_number;
++   PySequenceMethods *tp_as_sequence;
++   PyMappingMethods  *tp_as_mapping;
+ 
+ If you wish your object to be able to act like a number, a sequence, or a
+ mapping object, then you place the address of a structure that implements the C
+diff -r bd8afb90ebf2 Doc/faq/design.rst
+--- a/Doc/faq/design.rst
++++ b/Doc/faq/design.rst
+@@ -214,7 +214,7 @@
+ generic for a group of types and which were intended to work even for objects
+ that didn't have methods at all (e.g. tuples).  It is also convenient to have a
+ function that can readily be applied to an amorphous collection of objects when
+-you use the functional features of Python (``map()``, ``apply()`` et al).
++you use the functional features of Python (``map()``, ``zip()`` et al).
+ 
+ In fact, implementing ``len()``, ``max()``, ``min()`` as a built-in function is
+ actually less code than implementing them as methods for each type.  One can
+@@ -345,9 +345,6 @@
+ 
+ Answer 2: Fortunately, there is `Stackless Python <http://www.stackless.com>`_,
+ which has a completely redesigned interpreter loop that avoids the C stack.
+-It's still experimental but looks very promising.  Although it is binary
+-compatible with standard Python, it's still unclear whether Stackless will make
+-it into the core -- maybe it's just too revolutionary.
+ 
+ 
+ Why can't lambda forms contain statements?
+@@ -709,7 +706,7 @@
+ requested again.  This is called "memoizing", and can be implemented like this::
+ 
+    # Callers will never provide a third parameter for this function.
+-   def expensive (arg1, arg2, _cache={}):
++   def expensive(arg1, arg2, _cache={}):
+        if (arg1, arg2) in _cache:
+            return _cache[(arg1, arg2)]
+ 
+@@ -730,11 +727,11 @@
+ reasonable uses of the "go" or "goto" constructs of C, Fortran, and other
+ languages.  For example::
+ 
+-   class label: pass  # declare a label
++   class label(Exception): pass  # declare a label
+ 
+    try:
+         ...
+-        if (condition): raise label()  # goto label
++        if condition: raise label()  # goto label
+         ...
+    except label:  # where to goto
+         pass
+diff -r bd8afb90ebf2 Doc/faq/index.rst
+--- a/Doc/faq/index.rst
++++ b/Doc/faq/index.rst
+@@ -1,10 +1,9 @@
++.. _faq-index:
++
+ ###################################
+   Python Frequently Asked Questions
+ ###################################
+ 
+-:Release: |version|
+-:Date: |today|
+-
+ .. toctree::
+    :maxdepth: 1
+ 
+diff -r bd8afb90ebf2 Doc/faq/programming.rst
+--- a/Doc/faq/programming.rst
++++ b/Doc/faq/programming.rst
+@@ -206,6 +206,58 @@
+ declaration for identifying side-effects.
+ 
+ 
++Why do lambdas defined in a loop with different values all return the same result?
++----------------------------------------------------------------------------------
++
++Assume you use a for loop to define a few different lambdas (or even plain
++functions), e.g.::
++
++   squares = []
++   for x in range(5):
++      squares.append(lambda: x**2)
++
++This gives you a list that contains 5 lambdas that calculate ``x**2``.  You
++might expect that, when called, they would return, respectively, ``0``, ``1``,
++``4``, ``9``, and ``16``.  However, when you actually try you will see that
++they all return ``16``::
++
++   >>> squares[2]()
++   16
++   >>> squares[4]()
++   16
++
++This happens because ``x`` is not local to the lambdas, but is defined in
++the outer scope, and it is accessed when the lambda is called --- not when it
++is defined.  At the end of the loop, the value of ``x`` is ``4``, so all the
++functions now return ``4**2``, i.e. ``16``.  You can also verify this by
++changing the value of ``x`` and see how the results of the lambdas change::
++
++   >>> x = 8
++   >>> squares[2]()
++   64
++
++In order to avoid this, you need to save the values in variables local to the
++lambdas, so that they don't rely on the value of the global ``x``::
++
++   squares = []
++   for x in range(5):
++      squares.append(lambda n=x: n**2)
++
++Here, ``n=x`` creates a new variable ``n`` local to the lambda and computed
++when the lambda is defined so that it has the same value that ``x`` had at
++that point in the loop.  This means that the value of ``n`` will be ``0``
++in the first lambda, ``1`` in the second, ``2`` in the third, and so on.
++Therefore each lambda will now return the correct result::
++
++   >>> squares[2]()
++   4
++   >>> squares[4]()
++   16
++
++Note that this behaviour is not peculiar to lambdas, but applies to regular
++functions too.
++
++
+ How do I share global variables across modules?
+ ------------------------------------------------
+ 
+@@ -313,6 +365,31 @@
+        g(x, *args, **kwargs)
+ 
+ 
++.. index::
++   single: argument; difference from parameter
++   single: parameter; difference from argument
++
++.. _faq-argument-vs-parameter:
++
++What is the difference between arguments and parameters?
++--------------------------------------------------------
++
++:term:`Parameters <parameter>` are defined by the names that appear in a
++function definition, whereas :term:`arguments <argument>` are the values
++actually passed to a function when calling it.  Parameters define what types of
++arguments a function can accept.  For example, given the function definition::
++
++   def func(foo, bar=None, **kwargs):
++       pass
++
++*foo*, *bar* and *kwargs* are parameters of ``func``.  However, when calling
++``func``, for example::
++
++   func(42, bar=314, extra=somevar)
++
++the values ``42``, ``314``, and ``somevar`` are arguments.
++
++
+ How do I write a function with output parameters (call by reference)?
+ ---------------------------------------------------------------------
+ 
+diff -r bd8afb90ebf2 Doc/faq/windows.rst
+--- a/Doc/faq/windows.rst
++++ b/Doc/faq/windows.rst
+@@ -17,9 +17,7 @@
+ 
+ This is not necessarily a straightforward question. If you are already familiar
+ with running programs from the Windows command line then everything will seem
+-obvious; otherwise, you might need a little more guidance.  There are also
+-differences between Windows 95, 98, NT, ME, 2000 and XP which can add to the
+-confusion.
++obvious; otherwise, you might need a little more guidance.
+ 
+ .. sidebar:: |Python Development on XP|_
+    :subtitle: `Python Development on XP`_
+@@ -36,7 +34,7 @@
+ Unless you use some sort of integrated development environment, you will end up
+ *typing* Windows commands into what is variously referred to as a "DOS window"
+ or "Command prompt window".  Usually you can create such a window from your
+-Start menu; under Windows 2000 the menu selection is :menuselection:`Start -->
++Start menu; under Windows 7 the menu selection is :menuselection:`Start -->
+ Programs --> Accessories --> Command Prompt`.  You should be able to recognize
+ when you have started such a window because you will see a Windows "command
+ prompt", which usually looks like this::
+@@ -46,23 +44,27 @@
+ The letter may be different, and there might be other things after it, so you
+ might just as easily see something like::
+ 
+-   D:\Steve\Projects\Python>
++   D:\YourName\Projects\Python>
+ 
+ depending on how your computer has been set up and what else you have recently
+ done with it.  Once you have started such a window, you are well on the way to
+ running Python programs.
+ 
+ You need to realize that your Python scripts have to be processed by another
+-program called the Python interpreter.  The interpreter reads your script,
++program called the Python *interpreter*.  The interpreter reads your script,
+ compiles it into bytecodes, and then executes the bytecodes to run your
+ program. So, how do you arrange for the interpreter to handle your Python?
+ 
+ First, you need to make sure that your command window recognises the word
+ "python" as an instruction to start the interpreter.  If you have opened a
+ command window, you should try entering the command ``python`` and hitting
+-return.  You should then see something like::
++return.::
+ 
+-   Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32
++   C:\Users\YourName> python
++
++You should then see something like::
++
++   Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32
+    Type "help", "copyright", "credits" or "license" for more information.
+    >>>
+ 
+@@ -82,7 +84,7 @@
+ Windows command prompt.
+ 
+ You may also find that you have a Start-menu entry such as :menuselection:`Start
+---> Programs --> Python 2.2 --> Python (command line)` that results in you
++--> Programs --> Python 3.3 --> Python (command line)` that results in you
+ seeing the ``>>>`` prompt in a new window.  If so, the window will disappear
+ after you enter the Ctrl-Z character; Windows is running a single "python"
+ command in the window, and closes it when you terminate the interpreter.
+@@ -90,8 +92,7 @@
+ If the ``python`` command, instead of displaying the interpreter prompt ``>>>``,
+ gives you a message like::
+ 
+-   'python' is not recognized as an internal or external command,
+-   operable program or batch file.
++   'python' is not recognized as an internal or external command, operable program or batch file.
+ 
+ .. sidebar:: |Adding Python to DOS Path|_
+    :subtitle: `Adding Python to DOS Path`_
+@@ -120,115 +121,33 @@
+    dir C:\py*
+ 
+ will probably tell you where it is installed; the usual location is something
+-like ``C:\Python23``.  Otherwise you will be reduced to a search of your whole
++like ``C:\Python33``.  Otherwise you will be reduced to a search of your whole
+ disk ... use :menuselection:`Tools --> Find` or hit the :guilabel:`Search`
+ button and look for "python.exe".  Supposing you discover that Python is
+-installed in the ``C:\Python23`` directory (the default at the time of writing),
++installed in the ``C:\Python33`` directory (the default at the time of writing),
+ you should make sure that entering the command ::
+ 
+-   c:\Python23\python
++   c:\Python33\python
+ 
+ starts up the interpreter as above (and don't forget you'll need a "CTRL-Z" and
+-an "Enter" to get out of it). Once you have verified the directory, you need to
+-add it to the start-up routines your computer goes through.  For older versions
+-of Windows the easiest way to do this is to edit the ``C:\AUTOEXEC.BAT``
+-file. You would want to add a line like the following to ``AUTOEXEC.BAT``::
++an "Enter" to get out of it). Once you have verified the directory, you can
++add it to the system path to make it easier to start Python by just running
++the ``python`` command. This is currently an option in the installer as of
++CPython 3.3.
+ 
+-   PATH C:\Python23;%PATH%
+-
+-For Windows NT, 2000 and (I assume) XP, you will need to add a string such as ::
+-
+-   ;C:\Python23
+-
+-to the current setting for the PATH environment variable, which you will find in
+-the properties window of "My Computer" under the "Advanced" tab.  Note that if
+-you have sufficient privilege you might get a choice of installing the settings
+-either for the Current User or for System.  The latter is preferred if you want
+-everybody to be able to run Python on the machine.
+-
+-If you aren't confident doing any of these manipulations yourself, ask for help!
+-At this stage you may want to reboot your system to make absolutely sure the new
+-setting has taken effect.  You probably won't need to reboot for Windows NT, XP
+-or 2000.  You can also avoid it in earlier versions by editing the file
+-``C:\WINDOWS\COMMAND\CMDINIT.BAT`` instead of ``AUTOEXEC.BAT``.
+-
+-You should now be able to start a new command window, enter ``python`` at the
+-``C:\>`` (or whatever) prompt, and see the ``>>>`` prompt that indicates the
+-Python interpreter is reading interactive commands.
+-
+-Let's suppose you have a program called ``pytest.py`` in directory
+-``C:\Steve\Projects\Python``.  A session to run that program might look like
+-this::
+-
+-   C:\> cd \Steve\Projects\Python
+-   C:\Steve\Projects\Python> python pytest.py
+-
+-Because you added a file name to the command to start the interpreter, when it
+-starts up it reads the Python script in the named file, compiles it, executes
+-it, and terminates, so you see another ``C:\>`` prompt.  You might also have
+-entered ::
+-
+-   C:\> python \Steve\Projects\Python\pytest.py
+-
+-if you hadn't wanted to change your current directory.
+-
+-Under NT, 2000 and XP you may well find that the installation process has also
+-arranged that the command ``pytest.py`` (or, if the file isn't in the current
+-directory, ``C:\Steve\Projects\Python\pytest.py``) will automatically recognize
+-the ".py" extension and run the Python interpreter on the named file. Using this
+-feature is fine, but *some* versions of Windows have bugs which mean that this
+-form isn't exactly equivalent to using the interpreter explicitly, so be
+-careful.
+-
+-The important things to remember are:
+-
+-1. Start Python from the Start Menu, or make sure the PATH is set correctly so
+-   Windows can find the Python interpreter. ::
+-
+-      python
+-
+-   should give you a '>>>' prompt from the Python interpreter. Don't forget the
+-   CTRL-Z and ENTER to terminate the interpreter (and, if you started the window
+-   from the Start Menu, make the window disappear).
+-
+-2. Once this works, you run programs with commands::
+-
+-      python {program-file}
+-
+-3. When you know the commands to use you can build Windows shortcuts to run the
+-   Python interpreter on any of your scripts, naming particular working
+-   directories, and adding them to your menus.  Take a look at ::
+-
+-      python --help
+-
+-   if your needs are complex.
+-
+-4. Interactive mode (where you see the ``>>>`` prompt) is best used for checking
+-   that individual statements and expressions do what you think they will, and
+-   for developing code by experiment.
+-
++More information about environment variables can be found on the
++:ref:`Using Python on Windows <setting-envvars>` page.
+ 
+ How do I make Python scripts executable?
+ ----------------------------------------
+ 
+-On Windows 2000, the standard Python installer already associates the .py
++On Windows, the standard Python installer already associates the .py
+ extension with a file type (Python.File) and gives that file type an open
+ command that runs the interpreter (``D:\Program Files\Python\python.exe "%1"
+ %*``).  This is enough to make scripts executable from the command prompt as
+ 'foo.py'.  If you'd rather be able to execute the script by simple typing 'foo'
+ with no extension you need to add .py to the PATHEXT environment variable.
+ 
+-On Windows NT, the steps taken by the installer as described above allow you to
+-run a script with 'foo.py', but a longtime bug in the NT command processor
+-prevents you from redirecting the input or output of any script executed in this
+-way.  This is often important.
+-
+-The incantation for making a Python script executable under WinNT is to give the
+-file an extension of .cmd and add the following as the first line::
+-
+-   @setlocal enableextensions & python -x %~f0 %* & goto :EOF
+-
+-
+ Why does Python sometimes take so long to start?
+ ------------------------------------------------
+ 
+@@ -246,22 +165,11 @@
+ offender.
+ 
+ 
+-Where is Freeze for Windows?
+-----------------------------
++How do I make an executable from a Python script?
++-------------------------------------------------
+ 
+-"Freeze" is a program that allows you to ship a Python program as a single
+-stand-alone executable file.  It is *not* a compiler; your programs don't run
+-any faster, but they are more easily distributable, at least to platforms with
+-the same OS and CPU.  Read the README file of the freeze program for more
+-disclaimers.
+-
+-You can use freeze on Windows, but you must download the source tree (see
+-http://www.python.org/download/source).  The freeze program is in the
+-``Tools\freeze`` subdirectory of the source tree.
+-
+-You need the Microsoft VC++ compiler, and you probably need to build Python.
+-The required project files are in the PCbuild directory.
+-
++See http://www.py2exe.org/ for a distutils extension that allows you
++to create console and GUI executables from Python code.
+ 
+ Is a ``*.pyd`` file the same as a DLL?
+ --------------------------------------
+@@ -292,7 +200,7 @@
+    be a DLL to handle importing modules that are themselves DLL's.  (This is the
+    first key undocumented fact.)  Instead, link to :file:`python{NN}.dll`; it is
+    typically installed in ``C:\Windows\System``.  *NN* is the Python version, a
+-   number such as "23" for Python 2.3.
++   number such as "33" for Python 3.3.
+ 
+    You can link to Python in two different ways.  Load-time linking means
+    linking against :file:`python{NN}.lib`, while run-time linking means linking
+@@ -376,47 +284,6 @@
+    object that supports read and write, so all you need is a Python object
+    (defined in your extension module) that contains read() and write() methods.
+ 
+-
+-How do I use Python for CGI?
+-----------------------------
+-
+-On the Microsoft IIS server or on the Win95 MS Personal Web Server you set up
+-Python in the same way that you would set up any other scripting engine.
+-
+-Run regedt32 and go to::
+-
+-    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\ScriptMap
+-
+-and enter the following line (making any specific changes that your system may
+-need)::
+-
+-    .py :REG_SZ: c:\<path to python>\python.exe -u %s %s
+-
+-This line will allow you to call your script with a simple reference like:
+-``http://yourserver/scripts/yourscript.py`` provided "scripts" is an
+-"executable" directory for your server (which it usually is by default).  The
+-:option:`-u` flag specifies unbuffered and binary mode for stdin - needed when
+-working with binary data.
+-
+-In addition, it is recommended that using ".py" may not be a good idea for the
+-file extensions when used in this context (you might want to reserve ``*.py``
+-for support modules and use ``*.cgi`` or ``*.cgp`` for "main program" scripts).
+-
+-In order to set up Internet Information Services 5 to use Python for CGI
+-processing, please see the following links:
+-
+-   http://www.e-coli.net/pyiis_server.html (for Win2k Server)
+-   http://www.e-coli.net/pyiis.html (for Win2k pro)
+-
+-Configuring Apache is much simpler.  In the Apache configuration file
+-``httpd.conf``, add the following line at the end of the file::
+-
+-    ScriptInterpreterSource Registry
+-
+-Then, give your Python CGI-scripts the extension .py and put them in the cgi-bin
+-directory.
+-
+-
+ How do I keep editors from inserting tabs into my Python source?
+ ----------------------------------------------------------------
+ 
+@@ -460,116 +327,6 @@
+ to console subprocesses which are designed to handle those signals. See
+ :func:`os.kill` for further details.
+ 
+-
+-Why does os.path.isdir() fail on NT shared directories?
+--------------------------------------------------------
+-
+-The solution appears to be always append the "\\" on the end of shared
+-drives.
+-
+-   >>> import os
+-   >>> os.path.isdir( '\\\\rorschach\\public')
+-   0
+-   >>> os.path.isdir( '\\\\rorschach\\public\\')
+-   1
+-
+-It helps to think of share points as being like drive letters.  Example::
+-
+-   k: is not a directory
+-   k:\ is a directory
+-   k:\media is a directory
+-   k:\media\ is not a directory
+-
+-The same rules apply if you substitute "k:" with "\\conky\foo"::
+-
+-   \\conky\foo  is not a directory
+-   \\conky\foo\ is a directory
+-   \\conky\foo\media is a directory
+-   \\conky\foo\media\ is not a directory
+-
+-
+-cgi.py (or other CGI programming) doesn't work sometimes on NT or win95!
+-------------------------------------------------------------------------
+-
+-Be sure you have the latest python.exe, that you are using python.exe rather
+-than a GUI version of Python and that you have configured the server to execute
+-::
+-
+-   "...\python.exe -u ..."
+-
+-for the CGI execution.  The :option:`-u` (unbuffered) option on NT and Win95
+-prevents the interpreter from altering newlines in the standard input and
+-output.  Without it post/multipart requests will seem to have the wrong length
+-and binary (e.g. GIF) responses may get garbled (resulting in broken images, PDF
+-files, and other binary downloads failing).
+-
+-
+-Why doesn't os.popen() work in PythonWin on NT?
+------------------------------------------------
+-
+-The reason that os.popen() doesn't work from within PythonWin is due to a bug in
+-Microsoft's C Runtime Library (CRT). The CRT assumes you have a Win32 console
+-attached to the process.
+-
+-You should use the win32pipe module's popen() instead which doesn't depend on
+-having an attached Win32 console.
+-
+-Example::
+-
+-   import win32pipe
+-   f = win32pipe.popen('dir /c c:\\')
+-   print(f.readlines())
+-   f.close()
+-
+-
+-Why doesn't os.popen()/win32pipe.popen() work on Win9x?
+--------------------------------------------------------
+-
+-There is a bug in Win9x that prevents os.popen/win32pipe.popen* from
+-working. The good news is there is a way to work around this problem.  The
+-Microsoft Knowledge Base article that you need to lookup is: Q150956. You will
+-find links to the knowledge base at: http://support.microsoft.com/.
+-
+-
+-PyRun_SimpleFile() crashes on Windows but not on Unix; why?
+------------------------------------------------------------
+-
+-This is very sensitive to the compiler vendor, version and (perhaps) even
+-options.  If the FILE* structure in your embedding program isn't the same as is
+-assumed by the Python interpreter it won't work.
+-
+-The Python 1.5.* DLLs (``python15.dll``) are all compiled with MS VC++ 5.0 and
+-with multithreading-DLL options (``/MD``).
+-
+-If you can't change compilers or flags, try using :c:func:`Py_RunSimpleString`.
+-A trick to get it to run an arbitrary file is to construct a call to
+-:func:`exec` and :func:`open` with the name of your file as argument.
+-
+-Also note that you can not mix-and-match Debug and Release versions.  If you
+-wish to use the Debug Multithreaded DLL, then your module *must* have ``_d``
+-appended to the base name.
+-
+-
+-Importing _tkinter fails on Windows 95/98: why?
+-------------------------------------------------
+-
+-Sometimes, the import of _tkinter fails on Windows 95 or 98, complaining with a
+-message like the following::
+-
+-   ImportError: DLL load failed: One of the library files needed
+-   to run this application cannot be found.
+-
+-It could be that you haven't installed Tcl/Tk, but if you did install Tcl/Tk,
+-and the Wish application works correctly, the problem may be that its installer
+-didn't manage to edit the autoexec.bat file correctly.  It tries to add a
+-statement that changes the PATH environment variable to include the Tcl/Tk 'bin'
+-subdirectory, but sometimes this edit doesn't quite work.  Opening it with
+-notepad usually reveals what the problem is.
+-
+-(One additional hint, noted by David Szafranski: you can't use long filenames
+-here; e.g. use ``C:\PROGRA~1\Tcl\bin`` instead of ``C:\Program Files\Tcl\bin``.)
+-
+-
+ How do I extract the downloaded documentation on Windows?
+ ---------------------------------------------------------
+ 
+@@ -581,38 +338,3 @@
+ able to handle it.  (If your copy of WinZip doesn't, get a newer one from
+ http://www.winzip.com.)
+ 
+-
+-Missing cw3215mt.dll (or missing cw3215.dll)
+---------------------------------------------
+-
+-Sometimes, when using Tkinter on Windows, you get an error that cw3215mt.dll or
+-cw3215.dll is missing.
+-
+-Cause: you have an old Tcl/Tk DLL built with cygwin in your path (probably
+-``C:\Windows``).  You must use the Tcl/Tk DLLs from the standard Tcl/Tk
+-installation (Python 1.5.2 comes with one).
+-
+-
+-Warning about CTL3D32 version from installer
+---------------------------------------------
+-
+-The Python installer issues a warning like this::
+-
+-   This version uses CTL3D32.DLL which is not the correct version.
+-   This version is used for windows NT applications only.
+-
+-Tim Peters:
+-
+-   This is a Microsoft DLL, and a notorious source of problems.  The message
+-   means what it says: you have the wrong version of this DLL for your operating
+-   system.  The Python installation did not cause this -- something else you
+-   installed previous to this overwrote the DLL that came with your OS (probably
+-   older shareware of some sort, but there's no way to tell now).  If you search
+-   for "CTL3D32" using any search engine (AltaVista, for example), you'll find
+-   hundreds and hundreds of web pages complaining about the same problem with
+-   all sorts of installation programs.  They'll point you to ways to get the
+-   correct version reinstalled on your system (since Python doesn't cause this,
+-   we can't fix it).
+-
+-David A Burton has written a little program to fix this.  Go to
+-http://www.burtonsys.com/downloads.html and click on "ctl3dfix.zip".
+diff -r bd8afb90ebf2 Doc/glossary.rst
+--- a/Doc/glossary.rst
++++ b/Doc/glossary.rst
+@@ -40,16 +40,34 @@
+       ABCs with the :mod:`abc` module.
+ 
+    argument
+-      A value passed to a function or method, assigned to a named local
+-      variable in the function body.  A function or method may have both
+-      positional arguments and keyword arguments in its definition.
+-      Positional and keyword arguments may be variable-length: ``*`` accepts
+-      or passes (if in the function definition or call) several positional
+-      arguments in a list, while ``**`` does the same for keyword arguments
+-      in a dictionary.
++      A value passed to a :term:`function` (or :term:`method`) when calling the
++      function.  There are two types of arguments:
+ 
+-      Any expression may be used within the argument list, and the evaluated
+-      value is passed to the local variable.
++      * :dfn:`keyword argument`: an argument preceded by an identifier (e.g.
++        ``name=``) in a function call or passed as a value in a dictionary
++        preceded by ``**``.  For example, ``3`` and ``5`` are both keyword
++        arguments in the following calls to :func:`complex`::
++
++           complex(real=3, imag=5)
++           complex(**{'real': 3, 'imag': 5})
++
++      * :dfn:`positional argument`: an argument that is not a keyword argument.
++        Positional arguments can appear at the beginning of an argument list
++        and/or be passed as elements of an :term:`iterable` preceded by ``*``.
++        For example, ``3`` and ``5`` are both positional arguments in the
++        following calls::
++
++           complex(3, 5)
++           complex(*(3, 5))
++
++      Arguments are assigned to the named local variables in a function body.
++      See the :ref:`calls` section for the rules governing this assignment.
++      Syntactically, any expression can be used to represent an argument; the
++      evaluated value is assigned to the local variable.
++
++      See also the :term:`parameter` glossary entry, the FAQ question on
++      :ref:`the difference between arguments and parameters
++      <faq-argument-vs-parameter>`, and :pep:`362`.
+ 
+    attribute
+       A value associated with an object which is referenced by name using
+@@ -222,8 +240,9 @@
+ 
+    function
+       A series of statements which returns some value to a caller. It can also
+-      be passed zero or more arguments which may be used in the execution of
+-      the body. See also :term:`argument` and :term:`method`.
++      be passed zero or more :term:`arguments <argument>` which may be used in
++      the execution of the body. See also :term:`parameter`, :term:`method`,
++      and the :ref:`function` section.
+ 
+    __future__
+       A pseudo-module which programmers can use to enable new language features
+@@ -301,7 +320,8 @@
+       All of Python's immutable built-in objects are hashable, while no mutable
+       containers (such as lists or dictionaries) are.  Objects which are
+       instances of user-defined classes are hashable by default; they all
+-      compare unequal, and their hash value is their :func:`id`.
++      compare unequal (except with themselves), and their hash value is their
++      :func:`id`.
+ 
+    IDLE
+       An Integrated Development Environment for Python.  IDLE is a basic editor
+@@ -348,24 +368,24 @@
+       slowly.  See also :term:`interactive`.
+ 
+    iterable
+-      An object capable of returning its members one at a
+-      time. Examples of iterables include all sequence types (such as
+-      :class:`list`, :class:`str`, and :class:`tuple`) and some non-sequence
+-      types like :class:`dict` and :class:`file` and objects of any classes you
+-      define with an :meth:`__iter__` or :meth:`__getitem__` method.  Iterables
+-      can be used in a :keyword:`for` loop and in many other places where a
+-      sequence is needed (:func:`zip`, :func:`map`, ...).  When an iterable
+-      object is passed as an argument to the built-in function :func:`iter`, it
+-      returns an iterator for the object.  This iterator is good for one pass
+-      over the set of values.  When using iterables, it is usually not necessary
+-      to call :func:`iter` or deal with iterator objects yourself.  The ``for``
++      An object capable of returning its members one at a time. Examples of
++      iterables include all sequence types (such as :class:`list`, :class:`str`,
++      and :class:`tuple`) and some non-sequence types like :class:`dict`,
++      :term:`file objects <file object>`, and objects of any classes you define
++      with an :meth:`__iter__` or :meth:`__getitem__` method.  Iterables can be
++      used in a :keyword:`for` loop and in many other places where a sequence is
++      needed (:func:`zip`, :func:`map`, ...).  When an iterable object is passed
++      as an argument to the built-in function :func:`iter`, it returns an
++      iterator for the object.  This iterator is good for one pass over the set
++      of values.  When using iterables, it is usually not necessary to call
++      :func:`iter` or deal with iterator objects yourself.  The ``for``
+       statement does that automatically for you, creating a temporary unnamed
+       variable to hold the iterator for the duration of the loop.  See also
+       :term:`iterator`, :term:`sequence`, and :term:`generator`.
+ 
+    iterator
+       An object representing a stream of data.  Repeated calls to the iterator's
+-      :meth:`__next__` method (or passing it to the built-in function
++      :meth:`~iterator.__next__` method (or passing it to the built-in function
+       :func:`next`) return successive items in the stream.  When no more data
+       are available a :exc:`StopIteration` exception is raised instead.  At this
+       point, the iterator object is exhausted and any further calls to its
+@@ -402,10 +422,7 @@
+       <sortinghowto>` for examples of how to create and use key functions.
+ 
+    keyword argument
+-      Arguments which are preceded with a ``variable_name=`` in the call.
+-      The variable name designates the local name in the function to which the
+-      value is assigned.  ``**`` is used to accept or pass a dictionary of
+-      keyword arguments.  See :term:`argument`.
++      See :term:`argument`.
+ 
+    lambda
+       An anonymous inline function consisting of a single :term:`expression`
+@@ -548,6 +565,53 @@
+       subpackages.  Technically, a package is a Python module with an
+       ``__path__`` attribute.
+ 
++   parameter
++      A named entity in a :term:`function` (or method) definition that
++      specifies an :term:`argument` (or in some cases, arguments) that the
++      function can accept.  There are five types of parameters:
++
++      * :dfn:`positional-or-keyword`: specifies an argument that can be passed
++        either :term:`positionally <argument>` or as a :term:`keyword argument
++        <argument>`.  This is the default kind of parameter, for example *foo*
++        and *bar* in the following::
++
++           def func(foo, bar=None): ...
++
++      * :dfn:`positional-only`: specifies an argument that can be supplied only
++        by position.  Python has no syntax for defining positional-only
++        parameters.  However, some built-in functions have positional-only
++        parameters (e.g. :func:`abs`).
++
++      * :dfn:`keyword-only`: specifies an argument that can be supplied only
++        by keyword.  Keyword-only parameters can be defined by including a
++        single var-positional parameter or bare ``*`` in the parameter list
++        of the function definition before them, for example *kw_only1* and
++        *kw_only2* in the following::
++
++           def func(arg, *, kw_only1, kw_only2): ...
++
++      * :dfn:`var-positional`: specifies that an arbitrary sequence of
++        positional arguments can be provided (in addition to any positional
++        arguments already accepted by other parameters).  Such a parameter can
++        be defined by prepending the parameter name with ``*``, for example
++        *args* in the following::
++
++           def func(*args, **kwargs): ...
++
++      * :dfn:`var-keyword`: specifies that arbitrarily many keyword arguments
++        can be provided (in addition to any keyword arguments already accepted
++        by other parameters).  Such a parameter can be defined by prepending
++        the parameter name with ``**``, for example *kwargs* in the example
++        above.
++
++      Parameters can specify both optional and required arguments, as well as
++      default values for some optional arguments.
++
++      See also the :term:`argument` glossary entry, the FAQ question on
++      :ref:`the difference between arguments and parameters
++      <faq-argument-vs-parameter>`, the :class:`inspect.Parameter` class, the
++      :ref:`function` section, and :pep:`362`.
++
+    path entry
+       A single location on the :term:`import path` which the :term:`path
+       based finder` consults to find modules for importing.
+@@ -571,11 +635,7 @@
+       that contribute to a namespace package, as defined in :pep:`420`.
+ 
+    positional argument
+-      The arguments assigned to local names inside a function or method,
+-      determined by the order in which they were given in the call.  ``*`` is
+-      used to either accept multiple positional arguments (when in the
+-      definition), or pass several arguments as a list to a function.  See
+-      :term:`argument`.
++      See :term:`argument`.
+ 
+    provisional package
+       A provisional package is one which has been deliberately excluded from
+@@ -660,7 +720,7 @@
+    sequence
+       An :term:`iterable` which supports efficient element access using integer
+       indices via the :meth:`__getitem__` special method and defines a
+-      :meth:`len` method that returns the length of the sequence.
++      :meth:`__len__` method that returns the length of the sequence.
+       Some built-in sequence types are :class:`list`, :class:`str`,
+       :class:`tuple`, and :class:`bytes`. Note that :class:`dict` also
+       supports :meth:`__getitem__` and :meth:`__len__`, but is considered a
+diff -r bd8afb90ebf2 Doc/howto/argparse.rst
+--- a/Doc/howto/argparse.rst
++++ b/Doc/howto/argparse.rst
+@@ -2,7 +2,7 @@
+ Argparse Tutorial
+ *****************
+ 
+-:author: Tshepang Lekhonkhobe <tshepang@gmail.com>
++:author: Tshepang Lekhonkhobe
+ 
+ .. _argparse-tutorial:
+ 
+diff -r bd8afb90ebf2 Doc/howto/cporting.rst
+--- a/Doc/howto/cporting.rst
++++ b/Doc/howto/cporting.rst
+@@ -100,25 +100,6 @@
+ used in Python 2 was removed.  In the C-API, ``PyInt_*`` functions
+ are replaced by their ``PyLong_*`` equivalents.
+ 
+-The best course of action here is using the ``PyInt_*`` functions aliased to
+-``PyLong_*`` found in :file:`intobject.h`.  The abstract ``PyNumber_*`` APIs
+-can also be used in some cases. ::
+-
+-   #include "Python.h"
+-   #include "intobject.h"
+-
+-   static PyObject *
+-   add_ints(PyObject *self, PyObject *args) {
+-       int one, two;
+-       PyObject *result;
+-
+-       if (!PyArg_ParseTuple(args, "ii:add_ints", &one, &two))
+-           return NULL;
+-
+-       return PyInt_FromLong(one + two);
+-   }
+-
+-
+ 
+ Module initialization and state
+ ===============================
+@@ -253,7 +234,7 @@
+ 
+   * :c:func:`PyCapsule_GetName` always returns NULL.
+ 
+-  * :c:func:`PyCapsule_SetName` always throws an exception and
++  * :c:func:`PyCapsule_SetName` always raises an exception and
+     returns failure.  (Since there's no way to store a name
+     in a CObject, noisy failure of :c:func:`PyCapsule_SetName`
+     was deemed preferable to silent failure here.  If this is
+diff -r bd8afb90ebf2 Doc/howto/functional.rst
+--- a/Doc/howto/functional.rst
++++ b/Doc/howto/functional.rst
+@@ -181,26 +181,26 @@
+ 
+ An iterator is an object representing a stream of data; this object returns the
+ data one element at a time.  A Python iterator must support a method called
+-``__next__()`` that takes no arguments and always returns the next element of
+-the stream.  If there are no more elements in the stream, ``__next__()`` must
+-raise the ``StopIteration`` exception.  Iterators don't have to be finite,
+-though; it's perfectly reasonable to write an iterator that produces an infinite
+-stream of data.
++:meth:`~iterator.__next__` that takes no arguments and always returns the next
++element of the stream.  If there are no more elements in the stream,
++:meth:`~iterator.__next__` must raise the :exc:`StopIteration` exception.
++Iterators don't have to be finite, though; it's perfectly reasonable to write
++an iterator that produces an infinite stream of data.
+ 
+ The built-in :func:`iter` function takes an arbitrary object and tries to return
+ an iterator that will return the object's contents or elements, raising
+ :exc:`TypeError` if the object doesn't support iteration.  Several of Python's
+ built-in data types support iteration, the most common being lists and
+-dictionaries.  An object is called an **iterable** object if you can get an
+-iterator for it.
++dictionaries.  An object is called :term:`iterable` if you can get an iterator
++for it.
+ 
+ You can experiment with the iteration interface manually:
+ 
+     >>> L = [1,2,3]
+     >>> it = iter(L)
+-    >>> it
++    >>> it  #doctest: +ELLIPSIS
+     <...iterator object at ...>
+-    >>> it.__next__()
++    >>> it.__next__()  # same as next(it)
+     1
+     >>> next(it)
+     2
+@@ -213,9 +213,9 @@
+     >>>
+ 
+ Python expects iterable objects in several different contexts, the most
+-important being the ``for`` statement.  In the statement ``for X in Y``, Y must
+-be an iterator or some object for which ``iter()`` can create an iterator.
+-These two statements are equivalent::
++important being the :keyword:`for` statement.  In the statement ``for X in Y``,
++Y must be an iterator or some object for which :func:`iter` can create an
++iterator.  These two statements are equivalent::
+ 
+ 
+     for i in iter(obj):
+@@ -246,16 +246,16 @@
+ iterator argument and will return the largest or smallest element.  The ``"in"``
+ and ``"not in"`` operators also support iterators: ``X in iterator`` is true if
+ X is found in the stream returned by the iterator.  You'll run into obvious
+-problems if the iterator is infinite; ``max()``, ``min()``
++problems if the iterator is infinite; :func:`max`, :func:`min`
+ will never return, and if the element X never appears in the stream, the
+ ``"in"`` and ``"not in"`` operators won't return either.
+ 
+ Note that you can only go forward in an iterator; there's no way to get the
+ previous element, reset the iterator, or make a copy of it.  Iterator objects
+ can optionally provide these additional capabilities, but the iterator protocol
+-only specifies the ``next()`` method.  Functions may therefore consume all of
+-the iterator's output, and if you need to do something different with the same
+-stream, you'll have to create a new iterator.
++only specifies the :meth:`~iterator.__next__` method.  Functions may therefore
++consume all of the iterator's output, and if you need to do something different
++with the same stream, you'll have to create a new iterator.
+ 
+ 
+ 
+@@ -267,15 +267,11 @@
+ iterator.
+ 
+ Calling :func:`iter` on a dictionary returns an iterator that will loop over the
+-dictionary's keys:
+-
+-.. not a doctest since dict ordering varies across Pythons
+-
+-::
++dictionary's keys::
+ 
+     >>> m = {'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6,
+     ...      'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12}
+-    >>> for key in m:
++    >>> for key in m:  #doctest: +SKIP
+     ...     print(key, m[key])
+     Mar 3
+     Feb 2
+@@ -296,18 +292,19 @@
+ Applying :func:`iter` to a dictionary always loops over the keys, but
+ dictionaries have methods that return other iterators.  If you want to iterate
+ over values or key/value pairs, you can explicitly call the
+-:meth:`values` or :meth:`items` methods to get an appropriate iterator.
++:meth:`~dict.values` or :meth:`~dict.items` methods to get an appropriate
++iterator.
+ 
+ The :func:`dict` constructor can accept an iterator that returns a finite stream
+ of ``(key, value)`` tuples:
+ 
+     >>> L = [('Italy', 'Rome'), ('France', 'Paris'), ('US', 'Washington DC')]
+-    >>> dict(iter(L))
++    >>> dict(iter(L))  #doctest: +SKIP
+     {'Italy': 'Rome', 'US': 'Washington DC', 'France': 'Paris'}
+ 
+-Files also support iteration by calling the ``readline()`` method until there
+-are no more lines in the file.  This means you can read each line of a file like
+-this::
++Files also support iteration by calling the :meth:`~io.TextIOBase.readline`
++method until there are no more lines in the file.  This means you can read each
++line of a file like this::
+ 
+     for line in file:
+         # do something for each line
+@@ -410,12 +407,9 @@
+ lengths of all the sequences.  If you have two lists of length 3, the output
+ list is 9 elements long:
+ 
+-.. doctest::
+-    :options: +NORMALIZE_WHITESPACE
+-
+     >>> seq1 = 'abc'
+     >>> seq2 = (1,2,3)
+-    >>> [(x,y) for x in seq1 for y in seq2]
++    >>> [(x, y) for x in seq1 for y in seq2]  #doctest: +NORMALIZE_WHITESPACE
+     [('a', 1), ('a', 2), ('a', 3),
+      ('b', 1), ('b', 2), ('b', 3),
+      ('c', 1), ('c', 2), ('c', 3)]
+@@ -425,9 +419,9 @@
+ comprehension below is a syntax error, while the second one is correct::
+ 
+     # Syntax error
+-    [ x,y for x in seq1 for y in seq2]
++    [x, y for x in seq1 for y in seq2]
+     # Correct
+-    [ (x,y) for x in seq1 for y in seq2]
++    [(x, y) for x in seq1 for y in seq2]
+ 
+ 
+ Generators
+@@ -448,15 +442,13 @@
+ 
+ Here's the simplest example of a generator function:
+ 
+-.. testcode::
++    >>> def generate_ints(N):
++    ...    for i in range(N):
++    ...        yield i
+ 
+-    def generate_ints(N):
+-        for i in range(N):
+-            yield i
+-
+-Any function containing a ``yield`` keyword is a generator function; this is
+-detected by Python's :term:`bytecode` compiler which compiles the function
+-specially as a result.
++Any function containing a :keyword:`yield` keyword is a generator function;
++this is detected by Python's :term:`bytecode` compiler which compiles the
++function specially as a result.
+ 
+ When you call a generator function, it doesn't return a single value; instead it
+ returns a generator object that supports the iterator protocol.  On executing
+@@ -464,12 +456,13 @@
+ ``return`` statement.  The big difference between ``yield`` and a ``return``
+ statement is that on reaching a ``yield`` the generator's state of execution is
+ suspended and local variables are preserved.  On the next call to the
+-generator's ``.__next__()`` method, the function will resume executing.
++generator's :meth:`~generator.__next__` method, the function will resume
++executing.
+ 
+ Here's a sample usage of the ``generate_ints()`` generator:
+ 
+     >>> gen = generate_ints(3)
+-    >>> gen
++    >>> gen  #doctest: +ELLIPSIS
+     <generator object generate_ints at ...>
+     >>> next(gen)
+     0
+@@ -486,22 +479,21 @@
+ You could equally write ``for i in generate_ints(5)``, or ``a,b,c =
+ generate_ints(3)``.
+ 
+-Inside a generator function, the ``return`` statement can only be used without a
+-value, and signals the end of the procession of values; after executing a
+-``return`` the generator cannot return any further values.  ``return`` with a
+-value, such as ``return 5``, is a syntax error inside a generator function.  The
+-end of the generator's results can also be indicated by raising
+-``StopIteration`` manually, or by just letting the flow of execution fall off
+-the bottom of the function.
++Inside a generator function, ``return value`` is semantically equivalent to
++``raise StopIteration(value)``.  If no value is returned or the bottom of the
++function is reached, the procession of values ends and the generator cannot
++return any further values.
+ 
+ You could achieve the effect of generators manually by writing your own class
+ and storing all the local variables of the generator as instance variables.  For
+ example, returning a list of integers could be done by setting ``self.count`` to
+-0, and having the ``__next__()`` method increment ``self.count`` and return it.
++0, and having the :meth:`~iterator.__next__` method increment ``self.count`` and
++return it.
+ However, for a moderately complicated generator, writing a corresponding class
+ can be much messier.
+ 
+-The test suite included with Python's library, ``test_generators.py``, contains
++The test suite included with Python's library,
++:source:`Lib/test/test_generators.py`, contains
+ a number of more interesting examples.  Here's one generator that implements an
+ in-order traversal of a tree using generators recursively. ::
+ 
+@@ -544,23 +536,23 @@
+ The parentheses aren't always necessary, but it's easier to always add them
+ instead of having to remember when they're needed.
+ 
+-(PEP 342 explains the exact rules, which are that a ``yield``-expression must
++(:pep:`342` explains the exact rules, which are that a ``yield``-expression must
+ always be parenthesized except when it occurs at the top-level expression on the
+ right-hand side of an assignment.  This means you can write ``val = yield i``
+ but have to use parentheses when there's an operation, as in ``val = (yield i)
+ + 12``.)
+ 
+-Values are sent into a generator by calling its ``send(value)`` method.  This
+-method resumes the generator's code and the ``yield`` expression returns the
+-specified value.  If the regular ``__next__()`` method is called, the ``yield``
+-returns ``None``.
++Values are sent into a generator by calling its :meth:`send(value)
++<generator.send>` method.  This method resumes the generator's code and the
++``yield`` expression returns the specified value.  If the regular
++:meth:`~generator.__next__` method is called, the ``yield`` returns ``None``.
+ 
+ Here's a simple counter that increments by 1 and allows changing the value of
+ the internal counter.
+ 
+ .. testcode::
+ 
+-    def counter (maximum):
++    def counter(maximum):
+         i = 0
+         while i < maximum:
+             val = (yield i)
+@@ -572,16 +564,16 @@
+ 
+ And here's an example of changing the counter:
+ 
+-    >>> it = counter(10)
+-    >>> next(it)
++    >>> it = counter(10)  #doctest: +SKIP
++    >>> next(it)  #doctest: +SKIP
+     0
+-    >>> next(it)
++    >>> next(it)  #doctest: +SKIP
+     1
+-    >>> it.send(8)
++    >>> it.send(8)  #doctest: +SKIP
+     8
+-    >>> next(it)
++    >>> next(it)  #doctest: +SKIP
+     9
+-    >>> next(it)
++    >>> next(it)  #doctest: +SKIP
+     Traceback (most recent call last):
+       File "t.py", line 15, in ?
+         it.next()
+@@ -589,20 +581,23 @@
+ 
+ Because ``yield`` will often be returning ``None``, you should always check for
+ this case.  Don't just use its value in expressions unless you're sure that the
+-``send()`` method will be the only method used resume your generator function.
++:meth:`~generator.send` method will be the only method used resume your
++generator function.
+ 
+-In addition to ``send()``, there are two other new methods on generators:
++In addition to :meth:`~generator.send`, there are two other methods on
++generators:
+ 
+-* ``throw(type, value=None, traceback=None)`` is used to raise an exception
+-  inside the generator; the exception is raised by the ``yield`` expression
+-  where the generator's execution is paused.
++* :meth:`throw(type, value=None, traceback=None) <generator.throw>` is used to
++  raise an exception inside the generator; the exception is raised by the
++  ``yield`` expression where the generator's execution is paused.
+ 
+-* ``close()`` raises a :exc:`GeneratorExit` exception inside the generator to
+-  terminate the iteration.  On receiving this exception, the generator's code
+-  must either raise :exc:`GeneratorExit` or :exc:`StopIteration`; catching the
+-  exception and doing anything else is illegal and will trigger a
+-  :exc:`RuntimeError`.  ``close()`` will also be called by Python's garbage
+-  collector when the generator is garbage-collected.
++* :meth:`~generator.close` raises a :exc:`GeneratorExit` exception inside the
++  generator to terminate the iteration.  On receiving this exception, the
++  generator's code must either raise :exc:`GeneratorExit` or
++  :exc:`StopIteration`; catching the exception and doing anything else is
++  illegal and will trigger a :exc:`RuntimeError`.  :meth:`~generator.close`
++  will also be called by Python's garbage collector when the generator is
++  garbage-collected.
+ 
+   If you need to run cleanup code when a :exc:`GeneratorExit` occurs, I suggest
+   using a ``try: ... finally:`` suite instead of catching :exc:`GeneratorExit`.
+@@ -624,13 +619,12 @@
+ Two of Python's built-in functions, :func:`map` and :func:`filter` duplicate the
+ features of generator expressions:
+ 
+-``map(f, iterA, iterB, ...)`` returns an iterator over the sequence
++:func:`map(f, iterA, iterB, ...) <map>` returns an iterator over the sequence
+  ``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``.
+ 
+     >>> def upper(s):
+     ...     return s.upper()
+ 
+-
+     >>> list(map(upper, ['sentence', 'fragment']))
+     ['SENTENCE', 'FRAGMENT']
+     >>> [upper(s) for s in ['sentence', 'fragment']]
+@@ -638,11 +632,11 @@
+ 
+ You can of course achieve the same effect with a list comprehension.
+ 
+-``filter(predicate, iter)`` returns an iterator over all the sequence elements
+-that meet a certain condition, and is similarly duplicated by list
+-comprehensions.  A **predicate** is a function that returns the truth value of
+-some condition; for use with :func:`filter`, the predicate must take a single
+-value.
++:func:`filter(predicate, iter) <filter>` returns an iterator over all the
++sequence elements that meet a certain condition, and is similarly duplicated by
++list comprehensions.  A **predicate** is a function that returns the truth
++value of some condition; for use with :func:`filter`, the predicate must take a
++single value.
+ 
+     >>> def is_even(x):
+     ...     return (x % 2) == 0
+@@ -657,8 +651,8 @@
+     [0, 2, 4, 6, 8]
+ 
+ 
+-``enumerate(iter)`` counts off the elements in the iterable, returning 2-tuples
+-containing the count and each element. ::
++:func:`enumerate(iter) <enumerate>` counts off the elements in the iterable,
++returning 2-tuples containing the count and each element. ::
+ 
+     >>> for item in enumerate(['subject', 'verb', 'object']):
+     ...     print(item)
+@@ -674,29 +668,28 @@
+         if line.strip() == '':
+             print('Blank line at line #%i' % i)
+ 
+-``sorted(iterable, [key=None], [reverse=False])`` collects all the elements of
+-the iterable into a list, sorts the list, and returns the sorted result.  The
+-``key``, and ``reverse`` arguments are passed through to the constructed list's
+-``.sort()`` method. ::
++:func:`sorted(iterable, key=None, reverse=False) <sorted>` collects all the
++elements of the iterable into a list, sorts the list, and returns the sorted
++result.  The *key*, and *reverse* arguments are passed through to the
++constructed list's :meth:`~list.sort` method. ::
+ 
+     >>> import random
+     >>> # Generate 8 random numbers between [0, 10000)
+     >>> rand_list = random.sample(range(10000), 8)
+-    >>> rand_list
++    >>> rand_list  #doctest: +SKIP
+     [769, 7953, 9828, 6431, 8442, 9878, 6213, 2207]
+-    >>> sorted(rand_list)
++    >>> sorted(rand_list)  #doctest: +SKIP
+     [769, 2207, 6213, 6431, 7953, 8442, 9828, 9878]
+-    >>> sorted(rand_list, reverse=True)
++    >>> sorted(rand_list, reverse=True)  #doctest: +SKIP
+     [9878, 9828, 8442, 7953, 6431, 6213, 2207, 769]
+ 
+-(For a more detailed discussion of sorting, see the Sorting mini-HOWTO in the
+-Python wiki at http://wiki.python.org/moin/HowTo/Sorting.)
++(For a more detailed discussion of sorting, see the :ref:`sortinghowto`.)
+ 
+ 
+-The ``any(iter)`` and ``all(iter)`` built-ins look at the truth values of an
+-iterable's contents.  :func:`any` returns True if any element in the iterable is
+-a true value, and :func:`all` returns True if all of the elements are true
+-values:
++The :func:`any(iter) <any>` and :func:`all(iter) <all>` built-ins look at the
++truth values of an iterable's contents.  :func:`any` returns True if any element
++in the iterable is a true value, and :func:`all` returns True if all of the
++elements are true values:
+ 
+     >>> any([0,1,0])
+     True
+@@ -712,7 +705,7 @@
+     True
+ 
+ 
+-``zip(iterA, iterB, ...)`` takes one element from each iterable and
++:func:`zip(iterA, iterB, ...) <zip>` takes one element from each iterable and
+ returns them in a tuple::
+ 
+     zip(['a', 'b', 'c'], (1, 2, 3)) =>
+@@ -752,42 +745,44 @@
+ Creating new iterators
+ ----------------------
+ 
+-``itertools.count(n)`` returns an infinite stream of integers, increasing by 1
+-each time.  You can optionally supply the starting number, which defaults to 0::
++:func:`itertools.count(n) <itertools.count>` returns an infinite stream of
++integers, increasing by 1 each time.  You can optionally supply the starting
++number, which defaults to 0::
+ 
+     itertools.count() =>
+       0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
+     itertools.count(10) =>
+       10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...
+ 
+-``itertools.cycle(iter)`` saves a copy of the contents of a provided iterable
+-and returns a new iterator that returns its elements from first to last.  The
+-new iterator will repeat these elements infinitely. ::
++:func:`itertools.cycle(iter) <itertools.cycle>` saves a copy of the contents of
++a provided iterable and returns a new iterator that returns its elements from
++first to last.  The new iterator will repeat these elements infinitely. ::
+ 
+     itertools.cycle([1,2,3,4,5]) =>
+       1, 2, 3, 4, 5, 1, 2, 3, 4, 5, ...
+ 
+-``itertools.repeat(elem, [n])`` returns the provided element ``n`` times, or
+-returns the element endlessly if ``n`` is not provided. ::
++:func:`itertools.repeat(elem, [n]) <itertools.repeat>` returns the provided
++element *n* times, or returns the element endlessly if *n* is not provided. ::
+ 
+     itertools.repeat('abc') =>
+       abc, abc, abc, abc, abc, abc, abc, abc, abc, abc, ...
+     itertools.repeat('abc', 5) =>
+       abc, abc, abc, abc, abc
+ 
+-``itertools.chain(iterA, iterB, ...)`` takes an arbitrary number of iterables as
+-input, and returns all the elements of the first iterator, then all the elements
+-of the second, and so on, until all of the iterables have been exhausted. ::
++:func:`itertools.chain(iterA, iterB, ...) <itertools.chain>` takes an arbitrary
++number of iterables as input, and returns all the elements of the first
++iterator, then all the elements of the second, and so on, until all of the
++iterables have been exhausted. ::
+ 
+     itertools.chain(['a', 'b', 'c'], (1, 2, 3)) =>
+       a, b, c, 1, 2, 3
+ 
+-``itertools.islice(iter, [start], stop, [step])`` returns a stream that's a
+-slice of the iterator.  With a single ``stop`` argument, it will return the
+-first ``stop`` elements.  If you supply a starting index, you'll get
+-``stop-start`` elements, and if you supply a value for ``step``, elements will
+-be skipped accordingly.  Unlike Python's string and list slicing, you can't use
+-negative values for ``start``, ``stop``, or ``step``. ::
++:func:`itertools.islice(iter, [start], stop, [step]) <itertools.islice>` returns
++a stream that's a slice of the iterator.  With a single *stop* argument, it
++will return the first *stop* elements.  If you supply a starting index, you'll
++get *stop-start* elements, and if you supply a value for *step*, elements
++will be skipped accordingly.  Unlike Python's string and list slicing, you can't
++use negative values for *start*, *stop*, or *step*. ::
+ 
+     itertools.islice(range(10), 8) =>
+       0, 1, 2, 3, 4, 5, 6, 7
+@@ -796,9 +791,10 @@
+     itertools.islice(range(10), 2, 8, 2) =>
+       2, 4, 6
+ 
+-``itertools.tee(iter, [n])`` replicates an iterator; it returns ``n``
+-independent iterators that will all return the contents of the source iterator.
+-If you don't supply a value for ``n``, the default is 2.  Replicating iterators
++:func:`itertools.tee(iter, [n]) <itertools.tee>` replicates an iterator; it
++returns *n* independent iterators that will all return the contents of the
++source iterator.
++If you don't supply a value for *n*, the default is 2.  Replicating iterators
+ requires saving some of the contents of the source iterator, so this can consume
+ significant memory if the iterator is large and one of the new iterators is
+ consumed more than the others. ::
+@@ -816,19 +812,21 @@
+ Calling functions on elements
+ -----------------------------
+ 
+-The ``operator`` module contains a set of functions corresponding to Python's
+-operators.  Some examples are ``operator.add(a, b)`` (adds two values),
+-``operator.ne(a, b)`` (same as ``a!=b``), and ``operator.attrgetter('id')``
+-(returns a callable that fetches the ``"id"`` attribute).
++The :mod:`operator` module contains a set of functions corresponding to Python's
++operators.  Some examples are :func:`operator.add(a, b) <operator.add>` (adds
++two values), :func:`operator.ne(a, b)  <operator.ne>` (same as ``a != b``), and
++:func:`operator.attrgetter('id') <operator.attrgetter>`
++(returns a callable that fetches the ``.id`` attribute).
+ 
+-``itertools.starmap(func, iter)`` assumes that the iterable will return a stream
+-of tuples, and calls ``f()`` using these tuples as the arguments::
++:func:`itertools.starmap(func, iter) <itertools.starmap>` assumes that the
++iterable will return a stream of tuples, and calls *func* using these tuples as
++the arguments::
+ 
+     itertools.starmap(os.path.join,
+-                      [('/usr', 'bin', 'java'), ('/bin', 'python'),
+-                       ('/usr', 'bin', 'perl'),('/usr', 'bin', 'ruby')])
++                      [('/bin', 'python'), ('/usr', 'bin', 'java'),
++                       ('/usr', 'bin', 'perl'), ('/usr', 'bin', 'ruby')])
+     =>
+-      /usr/bin/java, /bin/python, /usr/bin/perl, /usr/bin/ruby
++      /bin/python, /usr/bin/java, /usr/bin/perl, /usr/bin/ruby
+ 
+ 
+ Selecting elements
+@@ -837,20 +835,18 @@
+ Another group of functions chooses a subset of an iterator's elements based on a
+ predicate.
+ 
+-``itertools.filterfalse(predicate, iter)`` is the opposite, returning all
+-elements for which the predicate returns false::
++:func:`itertools.filterfalse(predicate, iter) <itertools.filterfalse>` is the
++opposite, returning all elements for which the predicate returns false::
+ 
+     itertools.filterfalse(is_even, itertools.count()) =>
+       1, 3, 5, 7, 9, 11, 13, 15, ...
+ 
+-``itertools.takewhile(predicate, iter)`` returns elements for as long as the
+-predicate returns true.  Once the predicate returns false, the iterator will
+-signal the end of its results.
+-
+-::
++:func:`itertools.takewhile(predicate, iter) <itertools.takewhile>` returns
++elements for as long as the predicate returns true.  Once the predicate returns
++false, the iterator will signal the end of its results. ::
+ 
+     def less_than_10(x):
+-        return (x < 10)
++        return x < 10
+ 
+     itertools.takewhile(less_than_10, itertools.count()) =>
+       0, 1, 2, 3, 4, 5, 6, 7, 8, 9
+@@ -858,10 +854,9 @@
+     itertools.takewhile(is_even, itertools.count()) =>
+       0
+ 
+-``itertools.dropwhile(predicate, iter)`` discards elements while the predicate
+-returns true, and then returns the rest of the iterable's results.
+-
+-::
++:func:`itertools.dropwhile(predicate, iter) <itertools.dropwhile>` discards
++elements while the predicate returns true, and then returns the rest of the
++iterable's results. ::
+ 
+     itertools.dropwhile(less_than_10, itertools.count()) =>
+       10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...
+@@ -873,14 +868,14 @@
+ Grouping elements
+ -----------------
+ 
+-The last function I'll discuss, ``itertools.groupby(iter, key_func=None)``, is
+-the most complicated.  ``key_func(elem)`` is a function that can compute a key
+-value for each element returned by the iterable.  If you don't supply a key
+-function, the key is simply each element itself.
++The last function I'll discuss, :func:`itertools.groupby(iter, key_func=None)
++<itertools.groupby>`, is the most complicated.  ``key_func(elem)`` is a function
++that can compute a key value for each element returned by the iterable.  If you
++don't supply a key function, the key is simply each element itself.
+ 
+-``groupby()`` collects all the consecutive elements from the underlying iterable
+-that have the same key value, and returns a stream of 2-tuples containing a key
+-value and an iterator for the elements with that key.
++:func:`~itertools.groupby` collects all the consecutive elements from the
++underlying iterable that have the same key value, and returns a stream of
++2-tuples containing a key value and an iterator for the elements with that key.
+ 
+ ::
+ 
+@@ -890,7 +885,7 @@
+                  ...
+                 ]
+ 
+-    def get_state (city_state):
++    def get_state(city_state):
+         return city_state[1]
+ 
+     itertools.groupby(city_list, get_state) =>
+@@ -906,9 +901,9 @@
+     iterator-3 =>
+       ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')
+ 
+-``groupby()`` assumes that the underlying iterable's contents will already be
+-sorted based on the key.  Note that the returned iterators also use the
+-underlying iterable, so you have to consume the results of iterator-1 before
++:func:`~itertools.groupby` assumes that the underlying iterable's contents will
++already be sorted based on the key.  Note that the returned iterators also use
++the underlying iterable, so you have to consume the results of iterator-1 before
+ requesting iterator-2 and its corresponding key.
+ 
+ 
+@@ -926,33 +921,34 @@
+ ``g(b, c)`` that's equivalent to ``f(1, b, c)``; you're filling in a value for
+ one of ``f()``'s parameters.  This is called "partial function application".
+ 
+-The constructor for ``partial`` takes the arguments ``(function, arg1, arg2,
+-... kwarg1=value1, kwarg2=value2)``.  The resulting object is callable, so you
+-can just call it to invoke ``function`` with the filled-in arguments.
++The constructor for :func:`~functools.partial` takes the arguments
++``(function, arg1, arg2, ..., kwarg1=value1, kwarg2=value2)``.  The resulting
++object is callable, so you can just call it to invoke ``function`` with the
++filled-in arguments.
+ 
+ Here's a small but realistic example::
+ 
+     import functools
+ 
+-    def log (message, subsystem):
+-        "Write the contents of 'message' to the specified subsystem."
++    def log(message, subsystem):
++        """Write the contents of 'message' to the specified subsystem."""
+         print('%s: %s' % (subsystem, message))
+         ...
+ 
+     server_log = functools.partial(log, subsystem='server')
+     server_log('Unable to open socket')
+ 
+-``functools.reduce(func, iter, [initial_value])`` cumulatively performs an
+-operation on all the iterable's elements and, therefore, can't be applied to
+-infinite iterables.  (Note it is not in :mod:`builtins`, but in the
+-:mod:`functools` module.)  ``func`` must be a function that takes two elements
+-and returns a single value.  :func:`functools.reduce` takes the first two
+-elements A and B returned by the iterator and calculates ``func(A, B)``.  It
+-then requests the third element, C, calculates ``func(func(A, B), C)``, combines
+-this result with the fourth element returned, and continues until the iterable
+-is exhausted.  If the iterable returns no values at all, a :exc:`TypeError`
+-exception is raised.  If the initial value is supplied, it's used as a starting
+-point and ``func(initial_value, A)`` is the first calculation. ::
++:func:`functools.reduce(func, iter, [initial_value]) <functools.reduce>`
++cumulatively performs an operation on all the iterable's elements and,
++therefore, can't be applied to infinite iterables. *func* must be a function
++that takes two elements and returns a single value.  :func:`functools.reduce`
++takes the first two elements A and B returned by the iterator and calculates
++``func(A, B)``.  It then requests the third element, C, calculates
++``func(func(A, B), C)``, combines this result with the fourth element returned,
++and continues until the iterable is exhausted.  If the iterable returns no
++values at all, a :exc:`TypeError` exception is raised.  If the initial value is
++supplied, it's used as a starting point and ``func(initial_value, A)`` is the
++first calculation. ::
+ 
+     >>> import operator, functools
+     >>> functools.reduce(operator.concat, ['A', 'BB', 'C'])
+@@ -978,8 +974,8 @@
+     >>> sum([])
+     0
+ 
+-For many uses of :func:`functools.reduce`, though, it can be clearer to just write the
+-obvious :keyword:`for` loop::
++For many uses of :func:`functools.reduce`, though, it can be clearer to just
++write the obvious :keyword:`for` loop::
+ 
+    import functools
+    # Instead of:
+@@ -1023,28 +1019,23 @@
+     existing_files = filter(os.path.exists, file_list)
+ 
+ If the function you need doesn't exist, you need to write it.  One way to write
+-small functions is to use the ``lambda`` statement.  ``lambda`` takes a number
+-of parameters and an expression combining these parameters, and creates a small
+-function that returns the value of the expression::
++small functions is to use the :keyword:`lambda` statement.  ``lambda`` takes a
++number of parameters and an expression combining these parameters, and creates
++an anonymous function that returns the value of the expression::
+ 
+-    lowercase = lambda x: x.lower()
++    adder = lambda x, y: x+y
+ 
+     print_assign = lambda name, value: name + '=' + str(value)
+ 
+-    adder = lambda x, y: x+y
+-
+ An alternative is to just use the ``def`` statement and define a function in the
+ usual way::
+ 
+-    def lowercase(x):
+-        return x.lower()
++    def adder(x, y):
++        return x + y
+ 
+     def print_assign(name, value):
+         return name + '=' + str(value)
+ 
+-    def adder(x,y):
+-        return x + y
+-
+ Which alternative is preferable?  That's a style question; my usual course is to
+ avoid using ``lambda``.
+ 
+@@ -1053,9 +1044,7 @@
+ expression, which means you can't have multiway ``if... elif... else``
+ comparisons or ``try... except`` statements.  If you try to do too much in a
+ ``lambda`` statement, you'll end up with an overly complicated expression that's
+-hard to read.  Quick, what's the following code doing?
+-
+-::
++hard to read.  Quick, what's the following code doing? ::
+ 
+     import functools
+     total = functools.reduce(lambda a, b: (0, a[1] + b[1]), items)[1]
+@@ -1065,7 +1054,7 @@
+ little bit better::
+ 
+     import functools
+-    def combine (a, b):
++    def combine(a, b):
+         return 0, a[1] + b[1]
+ 
+     total = functools.reduce(combine, items)[1]
+@@ -1085,12 +1074,12 @@
+ Fredrik Lundh once suggested the following set of rules for refactoring uses of
+ ``lambda``:
+ 
+-1) Write a lambda function.
+-2) Write a comment explaining what the heck that lambda does.
+-3) Study the comment for a while, and think of a name that captures the essence
++1. Write a lambda function.
++2. Write a comment explaining what the heck that lambda does.
++3. Study the comment for a while, and think of a name that captures the essence
+    of the comment.
+-4) Convert the lambda to a def statement, using that name.
+-5) Remove the comment.
++4. Convert the lambda to a def statement, using that name.
++5. Remove the comment.
+ 
+ I really like these rules, but you're free to disagree
+ about whether this lambda-free style is better.
+diff -r bd8afb90ebf2 Doc/howto/ipaddress.rst
+--- a/Doc/howto/ipaddress.rst
++++ b/Doc/howto/ipaddress.rst
+@@ -1,7 +1,7 @@
+ .. _ipaddress-howto:
+ 
+ ***************************************
+-An Introduction to the ipaddress module
++An introduction to the ipaddress module
+ ***************************************
+ 
+ :author: Peter Moody
+@@ -47,7 +47,12 @@
+ when working with IP addressing. The simplest way to create addresses is
+ to use the :func:`ipaddress.ip_address` factory function, which automatically
+ determines whether to create an IPv4 or IPv6 address based on the passed in
+-value::
++value:
++
++.. testsetup::
++   >>> import ipaddress
++
++::
+ 
+    >>> ipaddress.ip_address('192.0.2.1')
+    IPv4Address('192.0.2.1')
+@@ -142,7 +147,7 @@
+ 
+    >>> ipaddress.ip_interface('192.0.2.1/24')
+    IPv4Interface('192.0.2.1/24')
+-   >>> ipaddress.ip_network('2001:db8::1/96')
++   >>> ipaddress.ip_interface('2001:db8::1/96')
+    IPv6Interface('2001:db8::1/96')
+ 
+ Integer inputs are accepted (as with networks), and use of a particular IP
+@@ -177,22 +182,22 @@
+ Finding out how many individual addresses are in a network::
+ 
+    >>> net4 = ipaddress.ip_network('192.0.2.0/24')
+-   >>> net4.numhosts
++   >>> net4.num_addresses
+    256
+    >>> net6 = ipaddress.ip_network('2001:db8::0/96')
+-   >>> net6.numhosts
++   >>> net6.num_addresses
+    4294967296
+ 
+ Iterating through the "usable" addresses on a network::
+ 
+    >>> net4 = ipaddress.ip_network('192.0.2.0/24')
+    >>> for x in net4.hosts():
+-          print(x)
++   ...     print(x)  # doctest: +ELLIPSIS
+    192.0.2.1
+    192.0.2.2
+    192.0.2.3
+    192.0.2.4
+-   <snip>
++   ...
+    192.0.2.252
+    192.0.2.253
+    192.0.2.254
+@@ -216,9 +221,9 @@
+ Exploding or compressing the address::
+ 
+    >>> addr6.exploded
+-   '2001:0db8:0000:0000:0000:0000:0000:0000'
++   '2001:0db8:0000:0000:0000:0000:0000:0001'
+    >>> addr6.compressed
+-   '2001:db8::'
++   '2001:db8::1'
+    >>> net6.exploded
+    '2001:0db8:0000:0000:0000:0000:0000:0000/96'
+    >>> net6.compressed
+@@ -241,9 +246,9 @@
+    >>> net4[-1]
+    IPv4Address('192.0.2.255')
+    >>> net6[1]
+-   IPv6Address('2001::1')
++   IPv6Address('2001:db8::1')
+    >>> net6[-1]
+-   IPv6Address('2001::ffff:ffff')
++   IPv6Address('2001:db8::ffff:ffff')
+ 
+ 
+ It also means that network objects lend themselves to using the list
+diff -r bd8afb90ebf2 Doc/howto/logging-cookbook.rst
+--- a/Doc/howto/logging-cookbook.rst
++++ b/Doc/howto/logging-cookbook.rst
+@@ -1615,3 +1615,85 @@
+ RFC 5424-compliant messages. If you don't, logging may not complain, but your
+ messages will not be RFC 5424-compliant, and your syslog daemon may complain.
+ 
++
++Implementing structured logging
++-------------------------------
++
++Although most logging messages are intended for reading by humans, and thus not
++readily machine-parseable, there might be cirumstances where you want to output
++messages in a structured format which *is* capable of being parsed by a program
++(without needing complex regular expressions to parse the log message). This is
++straightforward to achieve using the logging package. There are a number of
++ways in which this could be achieved, but the following is a simple approach
++which uses JSON to serialise the event in a machine-parseable manner::
++
++    import json
++    import logging
++
++    class StructuredMessage(object):
++        def __init__(self, message, **kwargs):
++            self.message = message
++            self.kwargs = kwargs
++
++        def __str__(self):
++            return '%s >>> %s' % (self.message, json.dumps(self.kwargs))
++
++    _ = StructuredMessage   # optional, to improve readability
++
++    logging.basicConfig(level=logging.INFO, format='%(message)s')
++    logging.info(_('message 1', foo='bar', bar='baz', num=123, fnum=123.456))
++
++If the above script is run, it prints::
++
++    message 1 >>> {"fnum": 123.456, "num": 123, "bar": "baz", "foo": "bar"}
++
++Note that the order of items might be different according to the version of
++Python used.
++
++If you need more specialised processing, you can use a custom JSON encoder,
++as in the following complete example::
++
++    from __future__ import unicode_literals
++
++    import json
++    import logging
++
++    # This next bit is to ensure the script runs unchanged on 2.x and 3.x
++    try:
++        unicode
++    except NameError:
++        unicode = str
++
++    class Encoder(json.JSONEncoder):
++        def default(self, o):
++            if isinstance(o, set):
++                return tuple(o)
++            elif isinstance(o, unicode):
++                return o.encode('unicode_escape').decode('ascii')
++            return super(Encoder, self).default(o)
++
++    class StructuredMessage(object):
++        def __init__(self, message, **kwargs):
++            self.message = message
++            self.kwargs = kwargs
++
++        def __str__(self):
++            s = Encoder().encode(self.kwargs)
++            return '%s >>> %s' % (self.message, s)
++
++    _ = StructuredMessage   # optional, to improve readability
++
++    def main():
++        logging.basicConfig(level=logging.INFO, format='%(message)s')
++        logging.info(_('message 1', set_value=set([1, 2, 3]), snowman='\u2603'))
++
++    if __name__ == '__main__':
++        main()
++
++When the above script is run, it prints::
++
++    message 1 >>> {"snowman": "\u2603", "set_value": [1, 2, 3]}
++
++Note that the order of items might be different according to the version of
++Python used.
++
+diff -r bd8afb90ebf2 Doc/howto/logging.rst
+--- a/Doc/howto/logging.rst
++++ b/Doc/howto/logging.rst
+@@ -330,6 +330,9 @@
+   to output.
+ * Formatters specify the layout of log records in the final output.
+ 
++Log event information is passed between loggers, handlers, filters and
++formatters in a :class:`LogRecord` instance.
++
+ Logging is performed by calling methods on instances of the :class:`Logger`
+ class (hereafter called :dfn:`loggers`). Each instance has a name, and they are
+ conceptually arranged in a namespace hierarchy using dots (periods) as
+@@ -374,6 +377,13 @@
+ *format* keyword argument. For all options regarding how a format string is
+ constructed, see :ref:`formatter-objects`.
+ 
++Logging Flow
++^^^^^^^^^^^^
++
++The flow of log event information in loggers and handlers is illustrated in the
++following diagram.
++
++.. image:: logging_flow.png
+ 
+ Loggers
+ ^^^^^^^
+@@ -780,13 +790,14 @@
+ libraries, then the logger name specified can be 'orgname.foo' rather than
+ just 'foo'.
+ 
+-**PLEASE NOTE:** It is strongly advised that you *do not add any handlers other
+-than* :class:`~logging.NullHandler` *to your library's loggers*. This is
+-because the configuration of handlers is the prerogative of the application
+-developer who uses your library. The application developer knows their target
+-audience and what handlers are most appropriate for their application: if you
+-add handlers 'under the hood', you might well interfere with their ability to
+-carry out unit tests and deliver logs which suit their requirements.
++.. note:: It is strongly advised that you *do not add any handlers other
++   than* :class:`~logging.NullHandler` *to your library's loggers*. This is
++   because the configuration of handlers is the prerogative of the application
++   developer who uses your library. The application developer knows their
++   target audience and what handlers are most appropriate for their
++   application: if you add handlers 'under the hood', you might well interfere
++   with their ability to carry out unit tests and deliver logs which suit their
++   requirements.
+ 
+ 
+ Logging Levels
+@@ -969,10 +980,10 @@
+ to see if a module-level variable, :data:`raiseExceptions`, is set. If set, a
+ traceback is printed to :data:`sys.stderr`. If not set, the exception is swallowed.
+ 
+-**Note:** The default value of :data:`raiseExceptions` is ``True``. This is because
+-during development, you typically want to be notified of any exceptions that
+-occur. It's advised that you set :data:`raiseExceptions` to ``False`` for production
+-usage.
++.. note:: The default value of :data:`raiseExceptions` is ``True``. This is
++   because during development, you typically want to be notified of any
++   exceptions that occur. It's advised that you set :data:`raiseExceptions` to
++   ``False`` for production usage.
+ 
+ .. currentmodule:: logging
+ 
+diff -r bd8afb90ebf2 Doc/howto/logging_flow.png
+Binary file Doc/howto/logging_flow.png has changed
+diff -r bd8afb90ebf2 Doc/howto/regex.rst
+--- a/Doc/howto/regex.rst
++++ b/Doc/howto/regex.rst
+@@ -260,7 +260,7 @@
+ 
+    >>> import re
+    >>> p = re.compile('ab*')
+-   >>> p
++   >>> p  #doctest: +ELLIPSIS
+    <_sre.SRE_Pattern object at 0x...>
+ 
+ :func:`re.compile` also accepts an optional *flags* argument, used to enable
+@@ -354,9 +354,9 @@
+ +------------------+-----------------------------------------------+
+ 
+ :meth:`match` and :meth:`search` return ``None`` if no match can be found.  If
+-they're successful, a ``MatchObject`` instance is returned, containing
+-information about the match: where it starts and ends, the substring it matched,
+-and more.
++they're successful, a :ref:`match object <match-objects>` instance is returned,
++containing information about the match: where it starts and ends, the substring
++it matched, and more.
+ 
+ You can learn about this by interactively experimenting with the :mod:`re`
+ module.  If you have :mod:`tkinter` available, you may also want to look at
+@@ -372,7 +372,7 @@
+ 
+    >>> import re
+    >>> p = re.compile('[a-z]+')
+-   >>> p
++   >>> p  #doctest: +ELLIPSIS
+    <_sre.SRE_Pattern object at 0x...>
+ 
+ Now, you can try matching various strings against the RE ``[a-z]+``.  An empty
+@@ -386,16 +386,16 @@
+    None
+ 
+ Now, let's try it on a string that it should match, such as ``tempo``.  In this
+-case, :meth:`match` will return a :class:`MatchObject`, so you should store the
+-result in a variable for later use. ::
++case, :meth:`match` will return a :ref:`match object <match-objects>`, so you
++should store the result in a variable for later use. ::
+ 
+    >>> m = p.match('tempo')
+-   >>> m
++   >>> m  #doctest: +ELLIPSIS
+    <_sre.SRE_Match object at 0x...>
+ 
+-Now you can query the :class:`MatchObject` for information about the matching
+-string.   :class:`MatchObject` instances also have several methods and
+-attributes; the most important ones are:
++Now you can query the :ref:`match object <match-objects>` for information
++about the matching string.  :ref:`match object <match-objects>` instances
++also have several methods and attributes; the most important ones are:
+ 
+ +------------------+--------------------------------------------+
+ | Method/Attribute | Purpose                                    |
+@@ -429,15 +429,16 @@
+ 
+    >>> print(p.match('::: message'))
+    None
+-   >>> m = p.search('::: message') ; print(m)
++   >>> m = p.search('::: message'); print(m)  #doctest: +ELLIPSIS
+    <_sre.SRE_Match object at 0x...>
+    >>> m.group()
+    'message'
+    >>> m.span()
+    (4, 11)
+ 
+-In actual programs, the most common style is to store the :class:`MatchObject`
+-in a variable, and then check if it was ``None``.  This usually looks like::
++In actual programs, the most common style is to store the
++:ref:`match object <match-objects>` in a variable, and then check if it was
++``None``.  This usually looks like::
+ 
+    p = re.compile( ... )
+    m = p.match( 'string goes here' )
+@@ -454,11 +455,11 @@
+    ['12', '11', '10']
+ 
+ :meth:`findall` has to create the entire list before it can be returned as the
+-result.  The :meth:`finditer` method returns a sequence of :class:`MatchObject`
+-instances as an :term:`iterator`::
++result.  The :meth:`finditer` method returns a sequence of
++:ref:`match object <match-objects>` instances as an :term:`iterator`::
+ 
+    >>> iterator = p.finditer('12 drummers drumming, 11 ... 10 ...')
+-   >>> iterator
++   >>> iterator  #doctest: +ELLIPSIS
+    <callable_iterator object at 0x...>
+    >>> for match in iterator:
+    ...     print(match.span())
+@@ -476,11 +477,11 @@
+ :func:`search`, :func:`findall`, :func:`sub`, and so forth.  These functions
+ take the same arguments as the corresponding pattern method, with
+ the RE string added as the first argument, and still return either ``None`` or a
+-:class:`MatchObject` instance. ::
++:ref:`match object <match-objects>` instance. ::
+ 
+    >>> print(re.match(r'From\s+', 'Fromage amk'))
+    None
+-   >>> re.match(r'From\s+', 'From amk Thu May 14 19:12:10 1998')
++   >>> re.match(r'From\s+', 'From amk Thu May 14 19:12:10 1998')  #doctest: +ELLIPSIS
+    <_sre.SRE_Match object at 0x...>
+ 
+ Under the hood, these functions simply create a pattern object for you
+@@ -682,7 +683,7 @@
+    For example, if you wish to match the word ``From`` only at the beginning of a
+    line, the RE to use is ``^From``. ::
+ 
+-      >>> print(re.search('^From', 'From Here to Eternity'))
++      >>> print(re.search('^From', 'From Here to Eternity'))  #doctest: +ELLIPSIS
+       <_sre.SRE_Match object at 0x...>
+       >>> print(re.search('^From', 'Reciting From Memory'))
+       None
+@@ -694,11 +695,11 @@
+    Matches at the end of a line, which is defined as either the end of the string,
+    or any location followed by a newline character.     ::
+ 
+-      >>> print(re.search('}$', '{block}'))
++      >>> print(re.search('}$', '{block}'))  #doctest: +ELLIPSIS
+       <_sre.SRE_Match object at 0x...>
+       >>> print(re.search('}$', '{block} '))
+       None
+-      >>> print(re.search('}$', '{block}\n'))
++      >>> print(re.search('}$', '{block}\n'))  #doctest: +ELLIPSIS
+       <_sre.SRE_Match object at 0x...>
+ 
+    To match a literal ``'$'``, use ``\$`` or enclose it inside a character class,
+@@ -723,7 +724,7 @@
+    match when it's contained inside another word. ::
+ 
+       >>> p = re.compile(r'\bclass\b')
+-      >>> print(p.search('no class at all'))
++      >>> print(p.search('no class at all'))  #doctest: +ELLIPSIS
+       <_sre.SRE_Match object at 0x...>
+       >>> print(p.search('the declassified algorithm'))
+       None
+@@ -741,7 +742,7 @@
+       >>> p = re.compile('\bclass\b')
+       >>> print(p.search('no class at all'))
+       None
+-      >>> print(p.search('\b' + 'class' + '\b')  )
++      >>> print(p.search('\b' + 'class' + '\b'))  #doctest: +ELLIPSIS
+       <_sre.SRE_Match object at 0x...>
+ 
+    Second, inside a character class, where there's no use for this assertion,
+@@ -786,9 +787,9 @@
+ index of the text that they match; this can be retrieved by passing an argument
+ to :meth:`group`, :meth:`start`, :meth:`end`, and :meth:`span`.  Groups are
+ numbered starting with 0.  Group 0 is always present; it's the whole RE, so
+-:class:`MatchObject` methods all have group 0 as their default argument.  Later
+-we'll see how to express groups that don't capture the span of text that they
+-match. ::
++:ref:`match object <match-objects>` methods all have group 0 as their default
++argument.  Later we'll see how to express groups that don't capture the span
++of text that they match. ::
+ 
+    >>> p = re.compile('(a)b')
+    >>> m = p.match('ab')
+@@ -908,10 +909,10 @@
+ The syntax for a named group is one of the Python-specific extensions:
+ ``(?P<name>...)``.  *name* is, obviously, the name of the group.  Named groups
+ also behave exactly like capturing groups, and additionally associate a name
+-with a group.  The :class:`MatchObject` methods that deal with capturing groups
+-all accept either integers that refer to the group by number or strings that
+-contain the desired group's name.  Named groups are still given numbers, so you
+-can retrieve information about a group in two ways::
++with a group.  The :ref:`match object <match-objects>` methods that deal with
++capturing groups all accept either integers that refer to the group by number
++or strings that contain the desired group's name.  Named groups are still
++given numbers, so you can retrieve information about a group in two ways::
+ 
+    >>> p = re.compile(r'(?P<word>\b\w+\b)')
+    >>> m = p.search( '(((( Lots of punctuation )))' )
+@@ -1175,16 +1176,16 @@
+ 
+ *replacement* can also be a function, which gives you even more control.  If
+ *replacement* is a function, the function is called for every non-overlapping
+-occurrence of *pattern*.  On each call, the function is  passed a
+-:class:`MatchObject` argument for the match and can use this information to
+-compute the desired replacement string and return it.
++occurrence of *pattern*.  On each call, the function is passed a
++:ref:`match object <match-objects>` argument for the match and can use this
++information to compute the desired replacement string and return it.
+ 
+-In the following example, the replacement function translates  decimals into
++In the following example, the replacement function translates decimals into
+ hexadecimal::
+ 
+-   >>> def hexrepl( match ):
++   >>> def hexrepl(match):
+    ...     "Return the hex string for a decimal number"
+-   ...     value = int( match.group() )
++   ...     value = int(match.group())
+    ...     return hex(value)
+    ...
+    >>> p = re.compile(r'\d+')
+diff -r bd8afb90ebf2 Doc/howto/unicode.rst
+--- a/Doc/howto/unicode.rst
++++ b/Doc/howto/unicode.rst
+@@ -44,7 +44,7 @@
+ machines had different codes, however, which led to problems exchanging files.
+ 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
++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
+@@ -62,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 through 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
+@@ -87,9 +87,11 @@
+ 
+ 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 (4,810 decimal).  The Unicode standard contains a lot
+-of tables listing characters and their corresponding code points::
++standard, a code point is written using the notation ``U+12CA`` to mean the
++character with value ``0x12ca`` (4,810 decimal).  The Unicode standard contains
++a lot of tables listing characters and their corresponding code points:
++
++.. code-block:: none
+ 
+    0061    'a'; LATIN SMALL LETTER A
+    0062    'b'; LATIN SMALL LETTER B
+@@ -98,7 +100,7 @@
+    007B    '{'; LEFT CURLY BRACKET
+ 
+ Strictly, these definitions imply that it's meaningless to say 'this is
+-character U+12ca'.  U+12ca is a code point, which represents some particular
++character ``U+12CA``'.  ``U+12CA`` is a code point, which represents some particular
+ character; in this case, it represents the character 'ETHIOPIC SYLLABLE WI'.  In
+ informal contexts, this distinction between code points and characters will
+ sometimes be forgotten.
+@@ -115,13 +117,15 @@
+ ---------
+ 
+ To summarize the previous section: a Unicode string is a sequence of code
+-points, which are numbers from 0 through 0x10ffff (1,114,111 decimal).  This
++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::
++representation, the string "Python" would look like this:
++
++.. code-block:: none
+ 
+        P           y           t           h           o           n
+     0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00
+@@ -133,10 +137,10 @@
+ 1. It's not portable; different processors order the bytes differently.
+ 
+ 2. It's very wasteful of space.  In most texts, the majority of the code points
+-   are less than 127, or less than 255, so a lot of space is occupied by zero
++   are less than 127, or less than 255, so a lot of space is occupied by ``0x00``
+    bytes.  The above string takes 24 bytes compared to the 6 bytes needed for an
+    ASCII representation.  Increased RAM usage doesn't matter too much (desktop
+-   computers have megabytes of RAM, and strings aren't usually that large), but
++   computers have gigabytes of RAM, and strings aren't usually that large), but
+    expanding our usage of disk and network bandwidth by a factor of 4 is
+    intolerable.
+ 
+@@ -175,14 +179,12 @@
+ 
+ UTF-8 is one of the most commonly used encodings.  UTF stands for "Unicode
+ Transformation Format", and the '8' means that 8-bit numbers are used in the
+-encoding.  (There's also a UTF-16 encoding, but it's less frequently used than
+-UTF-8.)  UTF-8 uses the following rules:
++encoding.  (There are also a UTF-16 and UTF-32 encodings, but they are less
++frequently used than UTF-8.)  UTF-8 uses the following rules:
+ 
+-1. If the code point is <128, it's represented by the corresponding byte value.
+-2. If the code point is between 128 and 0x7ff, it's turned into two byte values
+-   between 128 and 255.
+-3. Code points >0x7ff are turned into three- or four-byte sequences, where each
+-   byte of the sequence is between 128 and 255.
++1. If the code point is < 128, it's represented by the corresponding byte value.
++2. If the code point is >= 128, it's turned into a sequence of two, three, or
++   four bytes, where each byte of the sequence is between 128 and 255.
+ 
+ UTF-8 has several convenient properties:
+ 
+@@ -192,8 +194,8 @@
+    processed by C functions such as ``strcpy()`` and sent through protocols that
+    can't handle zero bytes.
+ 3. A string of ASCII text is also valid UTF-8 text.
+-4. UTF-8 is fairly compact; the majority of code points are turned into two
+-   bytes, and values less than 128 occupy only a single byte.
++4. UTF-8 is fairly compact; the majority of commonly used characters can be
++   represented with one or two bytes.
+ 5. If bytes are corrupted or lost, it's possible to determine the start of the
+    next UTF-8-encoded code point and resynchronize.  It's also unlikely that
+    random 8-bit data will look like valid UTF-8.
+@@ -203,25 +205,25 @@
+ References
+ ----------
+ 
+-The Unicode Consortium site at <http://www.unicode.org> has character charts, a
++The `Unicode Consortium site <http://www.unicode.org>`_ has character charts, a
+ glossary, and PDF versions of the Unicode specification.  Be prepared for some
+-difficult reading.  <http://www.unicode.org/history/> is a chronology of the
+-origin and development of Unicode.
++difficult reading.  `A chronology <http://www.unicode.org/history/>`_ of the
++origin and development of Unicode is also available on the site.
+ 
+-To help understand the standard, Jukka Korpela has written an introductory guide
+-to reading the Unicode character tables, available at
+-<http://www.cs.tut.fi/~jkorpela/unicode/guide.html>.
++To help understand the standard, Jukka Korpela has written `an introductory
++guide <http://www.cs.tut.fi/~jkorpela/unicode/guide.html>`_ to reading the
++Unicode character tables.
+ 
+-Another good introductory article was written by Joel Spolsky
+-<http://www.joelonsoftware.com/articles/Unicode.html>.
++Another `good introductory article <http://www.joelonsoftware.com/articles/Unicode.html>`_
++was written by Joel Spolsky.
+ If this introduction didn't make things clear to you, you should try reading this
+ alternate article before continuing.
+ 
+ .. Jason Orendorff XXX http://www.jorendorff.com/articles/unicode/ is broken
+ 
+-Wikipedia entries are often helpful; see the entries for "character encoding"
+-<http://en.wikipedia.org/wiki/Character_encoding> and UTF-8
+-<http://en.wikipedia.org/wiki/UTF-8>, for example.
++Wikipedia entries are often helpful; see the entries for "`character encoding
++<http://en.wikipedia.org/wiki/Character_encoding>`_" and `UTF-8
++<http://en.wikipedia.org/wiki/UTF-8>`_, for example.
+ 
+ 
+ Python's Unicode Support
+@@ -233,11 +235,11 @@
+ The String Type
+ ---------------
+ 
+-Since Python 3.0, the language features a ``str`` type that contain Unicode
++Since Python 3.0, the language features a :class:`str` type that contain Unicode
+ characters, meaning any string created using ``"unicode rocks!"``, ``'unicode
+ rocks!'``, or the triple-quoted string syntax is stored as Unicode.
+ 
+-To insert a Unicode character that is not part ASCII, e.g., any letters with
++To insert a non-ASCII Unicode character, e.g., any letters with
+ accents, one can use escape sequences in their string literals as such::
+ 
+    >>> "\N{GREEK CAPITAL LETTER DELTA}"  # Using the character name
+@@ -247,23 +249,24 @@
+    >>> "\U00000394"                      # Using a 32-bit hex value
+    '\u0394'
+ 
+-In addition, one can create a string using the :func:`decode` method of
+-:class:`bytes`.  This method takes an encoding, such as UTF-8, and, optionally,
+-an *errors* argument.
++In addition, one can create a string using the :func:`~bytes.decode` method of
++:class:`bytes`.  This method takes an *encoding* argument, such as ``UTF-8``,
++and optionally, an *errors* argument.
+ 
+ The *errors* argument specifies the response when the input string can't be
+ converted according to the encoding's rules.  Legal values for this argument are
+-'strict' (raise a :exc:`UnicodeDecodeError` exception), 'replace' (use U+FFFD,
+-'REPLACEMENT CHARACTER'), or 'ignore' (just leave the character out of the
+-Unicode result).  The following examples show the differences::
++``'strict'`` (raise a :exc:`UnicodeDecodeError` exception), ``'replace'`` (use
++``U+FFFD``, ``REPLACEMENT CHARACTER``), or ``'ignore'`` (just leave the
++character out of the Unicode result).
++The following examples show the differences::
+ 
+-    >>> b'\x80abc'.decode("utf-8", "strict")
++    >>> b'\x80abc'.decode("utf-8", "strict")  #doctest: +NORMALIZE_WHITESPACE
+     Traceback (most recent call last):
+-      File "<stdin>", line 1, in ?
+-    UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 0:
+-                        unexpected code byte
++        ...
++    UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0:
++      invalid start byte
+     >>> b'\x80abc'.decode("utf-8", "replace")
+-    '?abc'
++    '\ufffdabc'
+     >>> b'\x80abc'.decode("utf-8", "ignore")
+     'abc'
+ 
+@@ -273,8 +276,8 @@
+ 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
+-example, 'latin-1', 'iso_8859_1' and '8859' are all synonyms for the same
+-encoding.
++example, ``'latin-1'``, ``'iso_8859_1'`` and ``'8859``' are all synonyms for
++the same encoding.
+ 
+ One-character Unicode strings can also be created with the :func:`chr`
+ built-in function, which takes integers and returns a Unicode string of length 1
+@@ -290,22 +293,23 @@
+ Converting to Bytes
+ -------------------
+ 
+-Another important str method is ``.encode([encoding], [errors='strict'])``,
+-which returns a ``bytes`` representation of the Unicode string, encoded in the
+-requested encoding.  The ``errors`` parameter is the same as the parameter of
+-the :meth:`decode` method, with one additional possibility; as well as 'strict',
+-'ignore', and 'replace' (which in this case inserts a question mark instead of
+-the unencodable character), you can also pass 'xmlcharrefreplace' which uses
+-XML's character references.  The following example shows the different results::
++The opposite method of :meth:`bytes.decode` is :meth:`str.encode`,
++which returns a :class:`bytes` representation of the Unicode string, encoded in the
++requested *encoding*.  The *errors* parameter is the same as the parameter of
++the :meth:`~bytes.decode` method, with one additional possibility; as well as
++``'strict'``, ``'ignore'``, and ``'replace'`` (which in this case inserts a
++question mark instead of the unencodable character), you can also pass
++``'xmlcharrefreplace'`` which uses XML's character references.
++The following example shows the different results::
+ 
+     >>> u = chr(40960) + 'abcd' + chr(1972)
+     >>> u.encode('utf-8')
+     b'\xea\x80\x80abcd\xde\xb4'
+-    >>> u.encode('ascii')
++    >>> u.encode('ascii')  #doctest: +NORMALIZE_WHITESPACE
+     Traceback (most recent call last):
+-      File "<stdin>", line 1, in ?
++        ...
+     UnicodeEncodeError: 'ascii' codec can't encode character '\ua000' in
+-                        position 0: ordinal not in range(128)
++      position 0: ordinal not in range(128)
+     >>> u.encode('ascii', 'ignore')
+     b'abcd'
+     >>> u.encode('ascii', 'replace')
+@@ -313,6 +317,8 @@
+     >>> u.encode('ascii', 'xmlcharrefreplace')
+     b'&#40960;abcd&#1972;'
+ 
++.. XXX mention the surrogate* error handlers
++
+ The low-level routines for registering and accessing the available encodings are
+ found in the :mod:`codecs` module.  However, the encoding and decoding functions
+ returned by this module are usually more low-level than is comfortable, so I'm
+@@ -331,12 +337,11 @@
+ not four::
+ 
+     >>> s = "a\xac\u1234\u20ac\U00008000"
+-              ^^^^ two-digit hex escape
+-                   ^^^^^ four-digit Unicode escape
+-                              ^^^^^^^^^^ eight-digit Unicode escape
+-    >>> for c in s:  print(ord(c), end=" ")
+-    ...
+-    97 172 4660 8364 32768
++    ... #     ^^^^ two-digit hex escape
++    ... #         ^^^^^^ four-digit Unicode escape
++    ... #                     ^^^^^^^^^^ eight-digit Unicode escape
++    >>> [ord(c) for c in s]
++    [97, 172, 4660, 8364, 32768]
+ 
+ Using escape sequences for code points greater than 127 is fine in small doses,
+ but becomes an annoyance if you're using many accented characters, as you would
+@@ -366,14 +371,14 @@
+ ``coding: name`` or ``coding=name`` in the comment.
+ 
+ If you don't include such a comment, the default encoding used will be UTF-8 as
+-already mentioned.
++already mentioned.  See also :pep:`263` for more information.
+ 
+ 
+ Unicode Properties
+ ------------------
+ 
+ The Unicode specification includes a database of information about code points.
+-For each code point that's defined, the information includes the character's
++For each defined code point, the information includes the character's
+ name, its category, the numeric value if applicable (Unicode has characters
+ representing the Roman numerals and fractions such as one-third and
+ four-fifths).  There are also properties related to the code point's use in
+@@ -393,7 +398,9 @@
+     # Get numeric value of second character
+     print(unicodedata.numeric(u[1]))
+ 
+-When run, this prints::
++When run, this prints:
++
++.. code-block:: none
+ 
+     0 00e9 Ll LATIN SMALL LETTER E WITH ACUTE
+     1 0bf2 No TAMIL NUMBER ONE THOUSAND
+@@ -414,8 +421,8 @@
+ References
+ ----------
+ 
+-The ``str`` type is described in the Python library reference at
+-:ref:`typesseq`.
++The :class:`str` type is described in the Python library reference at
++:ref:`textseq`.
+ 
+ The documentation for the :mod:`unicodedata` module.
+ 
+@@ -444,16 +451,16 @@
+ 
+ Unicode data is usually converted to a particular encoding before it gets
+ written to disk or sent over a socket.  It's possible to do all the work
+-yourself: open a file, read an 8-bit byte string from it, and convert the string
+-with ``str(bytes, encoding)``.  However, the manual approach is not recommended.
++yourself: open a file, read an 8-bit bytes object from it, and convert the string
++with ``bytes.decode(encoding)``.  However, the manual approach is not recommended.
+ 
+ One problem is the multi-byte nature of encodings; one Unicode character can be
+ represented by several bytes.  If you want to read the file in arbitrary-sized
+-chunks (say, 1K or 4K), you need to write error-handling code to catch the case
++chunks (say, 1024 or 4096 bytes), you need to write error-handling code to catch the case
+ where only part of the bytes encoding a single Unicode character are read at the
+ end of a chunk.  One solution would be to read the entire file into memory and
+ then perform the decoding, but that prevents you from working with files that
+-are extremely large; if you need to read a 2Gb file, you need 2Gb of RAM.
++are extremely large; if you need to read a 2 GiB file, you need 2 GiB of RAM.
+ (More, really, since for at least a moment you'd need to have both the encoded
+ string and its Unicode version in memory.)
+ 
+@@ -461,9 +468,9 @@
+ of partial coding sequences.  The work of implementing this has already been
+ done for you: the built-in :func:`open` function can return a file-like object
+ that assumes the file's contents are in a specified encoding and accepts Unicode
+-parameters for methods such as ``.read()`` and ``.write()``.  This works through
++parameters for methods such as :meth:`read` and :meth:`write`.  This works through
+ :func:`open`\'s *encoding* and *errors* parameters which are interpreted just
+-like those in string objects' :meth:`encode` and :meth:`decode` methods.
++like those in :meth:`str.encode` and :meth:`bytes.decode`.
+ 
+ Reading Unicode from a file is therefore simple::
+ 
+@@ -479,7 +486,7 @@
+         f.seek(0)
+         print(repr(f.readline()[:1]))
+ 
+-The Unicode character U+FEFF is used as a byte-order mark (BOM), and is often
++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
+ of the file's byte ordering.  Some encodings, such as UTF-16, expect a BOM to be
+ present at the start of a file; when such an encoding is used, the BOM will be
+@@ -521,12 +528,12 @@
+ filenames.
+ 
+ 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 Unicode version of filenames, or should it return bytes 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
++provided the directory path as bytes or a Unicode string.  If you pass a
+ Unicode string as the path, filenames will be decoded using the filesystem's
+ encoding and a list of Unicode strings will be returned, while passing a byte
+-path will return the byte string versions of the filenames.  For example,
++path will return the bytes versions of the filenames.  For example,
+ assuming the default filesystem encoding is UTF-8, running the following
+ program::
+ 
+@@ -560,13 +567,13 @@
+ 
+ The most important tip is:
+ 
+-    Software should only work with Unicode strings internally, converting to a
+-    particular encoding on output.
++    Software should only work with Unicode strings internally, decoding the input
++    data as soon as possible and encoding the output only at the end.
+ 
+ If you attempt to write processing functions that accept both Unicode and byte
+ strings, you will find your program vulnerable to bugs wherever you combine the
+-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.
++two different kinds of strings.  There is no automatic encoding or decoding: if
++you do e.g. ``str + bytes``, a :exc:`TypeError` will be raised.
+ 
+ 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
+@@ -611,7 +618,6 @@
+    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
+ .. comment Describe use of codecs.StreamRecoder and StreamReaderWriter
+ 
+ .. comment
+@@ -641,5 +647,3 @@
+        - [ ] Writing Unicode programs
+            - [ ] Do everything in Unicode
+            - [ ] Declaring source code encodings (PEP 263)
+-       - [ ] Other issues
+-           - [ ] Building Python (UCS2, UCS4)
+diff -r bd8afb90ebf2 Doc/howto/urllib2.rst
+--- a/Doc/howto/urllib2.rst
++++ b/Doc/howto/urllib2.rst
+@@ -144,7 +144,7 @@
+     >>> data['location'] = 'Northampton'
+     >>> data['language'] = 'Python'
+     >>> url_values = urllib.parse.urlencode(data)
+-    >>> print(url_values)
++    >>> print(url_values)  # The order may differ from below.  #doctest: +SKIP
+     name=Somebody+Here&language=Python&location=Northampton
+     >>> url = 'http://www.example.com/example.cgi'
+     >>> full_url = url + '?' + url_values
+@@ -214,9 +214,9 @@
+ 
+     >>> req = urllib.request.Request('http://www.pretend_server.org')
+     >>> try: urllib.request.urlopen(req)
+-    >>> except urllib.error.URLError as e:
+-    >>>    print(e.reason)
+-    >>>
++    ... except urllib.error.URLError as e:
++    ...    print(e.reason)      #doctest: +SKIP
++    ...
+     (4, 'getaddrinfo failed')
+ 
+ 
+@@ -322,18 +322,17 @@
+ 
+     >>> req = urllib.request.Request('http://www.python.org/fish.html')
+     >>> try:
+-    >>>     urllib.request.urlopen(req)
+-    >>> except urllib.error.HTTPError as e:
+-    >>>     print(e.code)
+-    >>>     print(e.read())
+-    >>>
++    ...     urllib.request.urlopen(req)
++    ... except urllib.error.HTTPError as e:
++    ...     print(e.code)
++    ...     print(e.read())  #doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
++    ...
+     404
+-    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+-        "http://www.w3.org/TR/html4/loose.dtd">
+-    <?xml-stylesheet href="./css/ht2html.css"
+-        type="text/css"?>
+-    <html><head><title>Error 404: File Not Found</title>
+-    ...... etc...
++    b'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
++      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n\n\n<html
++      ...
++      <title>Page Not Found</title>\n
++      ...
+ 
+ Wrapping it Up
+ --------------
+diff -r bd8afb90ebf2 Doc/install/index.rst
+--- a/Doc/install/index.rst
++++ b/Doc/install/index.rst
+@@ -7,8 +7,6 @@
+ *****************************
+ 
+ :Author: Greg Ward
+-:Release: |version|
+-:Date: |today|
+ 
+ .. TODO: Fill in XXX comments
+ 
+diff -r bd8afb90ebf2 Doc/library/2to3.rst
+--- a/Doc/library/2to3.rst
++++ b/Doc/library/2to3.rst
+@@ -23,7 +23,7 @@
+ also located in the :file:`Tools/scripts` directory of the Python root.
+ 
+ 2to3's basic arguments are a list of files or directories to transform.  The
+-directories are to recursively traversed for Python sources.
++directories are recursively traversed for Python sources.
+ 
+ Here is a sample Python 2.x source file, :file:`example.py`::
+ 
+@@ -264,8 +264,7 @@
+ 
+ .. 2to3fixer:: long
+ 
+-   Strips the ``L`` prefix on long literals and renames :class:`long` to
+-   :class:`int`.
++   Renames :class:`long` to :class:`int`.
+ 
+ .. 2to3fixer:: map
+ 
+diff -r bd8afb90ebf2 Doc/library/_dummy_thread.rst
+--- a/Doc/library/_dummy_thread.rst
++++ b/Doc/library/_dummy_thread.rst
+@@ -17,7 +17,7 @@
+    try:
+        import _thread
+    except ImportError:
+-       import dummy_thread as _thread
++       import _dummy_thread as _thread
+ 
+ Be careful to not use this module where deadlock might occur from a thread being
+ created that blocks waiting for another thread to be created.  This often occurs
+diff -r bd8afb90ebf2 Doc/library/_thread.rst
+--- a/Doc/library/_thread.rst
++++ b/Doc/library/_thread.rst
+@@ -93,15 +93,15 @@
+    Return the thread stack size used when creating new threads.  The optional
+    *size* argument specifies the stack size to be used for subsequently created
+    threads, and must be 0 (use platform or configured default) or a positive
+-   integer value of at least 32,768 (32kB). If changing the thread stack size is
++   integer value of at least 32,768 (32 KiB). If changing the thread stack size is
+    unsupported, a :exc:`RuntimeError` is raised.  If the specified stack size is
+-   invalid, a :exc:`ValueError` is raised and the stack size is unmodified.  32kB
++   invalid, a :exc:`ValueError` is raised and the stack size is unmodified.  32 KiB
+    is currently the minimum supported stack size value to guarantee sufficient
+    stack space for the interpreter itself.  Note that some platforms may have
+    particular restrictions on values for the stack size, such as requiring a
+-   minimum stack size > 32kB or requiring allocation in multiples of the system
++   minimum stack size > 32 KiB or requiring allocation in multiples of the system
+    memory page size - platform documentation should be referred to for more
+-   information (4kB pages are common; using multiples of 4096 for the stack size is
++   information (4 KiB pages are common; using multiples of 4096 for the stack size is
+    the suggested approach in the absence of more specific information).
+    Availability: Windows, systems with POSIX threads.
+ 
+diff -r bd8afb90ebf2 Doc/library/abc.rst
+--- a/Doc/library/abc.rst
++++ b/Doc/library/abc.rst
+@@ -129,7 +129,7 @@
+ 
+ The :mod:`abc` module also provides the following decorators:
+ 
+-.. decorator:: abstractmethod(function)
++.. decorator:: abstractmethod
+ 
+    A decorator indicating abstract methods.
+ 
+@@ -203,43 +203,52 @@
+       multiple-inheritance.
+ 
+ 
+-.. decorator:: abstractclassmethod(function)
++.. decorator:: abstractclassmethod
+ 
+    A subclass of the built-in :func:`classmethod`, indicating an abstract
+    classmethod. Otherwise it is similar to :func:`abstractmethod`.
+ 
+-   Usage::
++   This special case is deprecated, as the :func:`classmethod` decorator
++   is now correctly identified as abstract when applied to an abstract
++   method::
+ 
+       class C(metaclass=ABCMeta):
+-          @abstractclassmethod
++          @classmethod
++          @abstractmethod
+           def my_abstract_classmethod(cls, ...):
+               ...
+ 
+    .. versionadded:: 3.2
+    .. deprecated:: 3.3
+-       Use :class:`classmethod` with :func:`abstractmethod` instead.
++       It is now possible to use :class:`classmethod` with
++       :func:`abstractmethod`, making this decorator redundant.
+ 
+ 
+-.. decorator:: abstractstaticmethod(function)
++.. decorator:: abstractstaticmethod
+ 
+    A subclass of the built-in :func:`staticmethod`, indicating an abstract
+    staticmethod. Otherwise it is similar to :func:`abstractmethod`.
+ 
+-   Usage::
++   This special case is deprecated, as the :func:`staticmethod` decorator
++   is now correctly identified as abstract when applied to an abstract
++   method::
+ 
+       class C(metaclass=ABCMeta):
+-          @abstractstaticmethod
++          @staticmethod
++          @abstractmethod
+           def my_abstract_staticmethod(...):
+               ...
+ 
+    .. versionadded:: 3.2
+    .. deprecated:: 3.3
+-       Use :class:`staticmethod` with :func:`abstractmethod` instead.
++       It is now possible to use :class:`staticmethod` with
++       :func:`abstractmethod`, making this decorator redundant.
+ 
+ 
+ .. decorator:: abstractproperty(fget=None, fset=None, fdel=None, doc=None)
+ 
+-   A subclass of the built-in :func:`property`, indicating an abstract property.
++   A subclass of the built-in :func:`property`, indicating an abstract
++   property.
+ 
+    Using this function requires that the class's metaclass is :class:`ABCMeta`
+    or is derived from it. A class that has a metaclass derived from
+@@ -247,23 +256,43 @@
+    and properties are overridden. The abstract properties can be called using
+    any of the normal 'super' call mechanisms.
+ 
+-   Usage::
++   This special case is deprecated, as the :func:`property` decorator
++   is now correctly identified as abstract when applied to an abstract
++   method::
+ 
+       class C(metaclass=ABCMeta):
+-          @abstractproperty
++          @property
++          @abstractmethod
+           def my_abstract_property(self):
+               ...
+ 
+-   This defines a read-only property; you can also define a read-write abstract
+-   property using the 'long' form of property declaration::
++   The above example defines a read-only property; you can also define a
++   read-write abstract property by appropriately marking one or more of the
++   underlying methods as abstract::
+ 
+       class C(metaclass=ABCMeta):
+-          def getx(self): ...
+-          def setx(self, value): ...
+-          x = abstractproperty(getx, setx)
++          @property
++          def x(self):
++              ...
++
++          @x.setter
++          @abstractmethod
++          def x(self, val):
++              ...
++
++   If only some components are abstract, only those components need to be
++   updated to create a concrete property in a subclass::
++
++      class D(C):
++          @C.x.setter
++          def x(self, val):
++              ...
++
+ 
+    .. deprecated:: 3.3
+-       Use :class:`property` with :func:`abstractmethod` instead
++       It is now possible to use :class:`property`, :meth:`property.getter`,
++       :meth:`property.setter` and :meth:`property.deleter` with
++       :func:`abstractmethod`, making this decorator redundant.
+ 
+ 
+ .. rubric:: Footnotes
+diff -r bd8afb90ebf2 Doc/library/argparse.rst
+--- a/Doc/library/argparse.rst
++++ b/Doc/library/argparse.rst
+@@ -130,9 +130,12 @@
+ ArgumentParser objects
+ ----------------------
+ 
+-.. class:: ArgumentParser([description], [epilog], [prog], [usage], [add_help], \
+-                          [argument_default], [parents], [prefix_chars], \
+-                          [conflict_handler], [formatter_class])
++.. class:: ArgumentParser(prog=None, usage=None, description=None, \
++                          epilog=None, parents=[], \
++                          formatter_class=argparse.HelpFormatter, \
++                          prefix_chars='-', fromfile_prefix_chars=None, \
++                          argument_default=None, conflict_handler='error', \
++                          add_help=True)
+ 
+    Create a new :class:`ArgumentParser` object.  Each parameter has its own more
+    detailed description below, but in short they are:
+@@ -920,6 +923,17 @@
+    >>> parser.parse_args(''.split())
+    Namespace(foo=42)
+ 
++If the ``default`` value is a string, the parser parses the value as if it
++were a command-line argument.  In particular, the parser applies any type_
++conversion argument, if provided, before setting the attribute on the
++:class:`Namespace` return value.  Otherwise, the parser uses the value as is::
++
++   >>> parser = argparse.ArgumentParser()
++   >>> parser.add_argument('--length', default='10', type=int)
++   >>> parser.add_argument('--width', default=10.5, type=int)
++   >>> parser.parse_args()
++   Namespace(length=10, width=10.5)
++
+ For positional arguments with nargs_ equal to ``?`` or ``*``, the ``default`` value
+ is used when no command-line argument was present::
+ 
+@@ -958,6 +972,9 @@
+    >>> parser.parse_args('2 temp.txt'.split())
+    Namespace(bar=<_io.TextIOWrapper name='temp.txt' encoding='UTF-8'>, foo=2)
+ 
++See the section on the default_ keyword argument for information on when the
++``type`` argument is applied to default arguments.
++
+ To ease the use of various types of files, the argparse module provides the
+ factory FileType which takes the ``mode=`` and ``bufsize=`` arguments of the
+ :func:`open` function.  For example, ``FileType('w')`` can be used to create a
+@@ -1005,32 +1022,33 @@
+ ^^^^^^^
+ 
+ Some command-line arguments should be selected from a restricted set of values.
+-These can be handled by passing a container object as the ``choices`` keyword
++These can be handled by passing a container object as the *choices* keyword
+ argument to :meth:`~ArgumentParser.add_argument`.  When the command line is
+-parsed, argument values will be checked, and an error message will be displayed if
+-the argument was not one of the acceptable values::
++parsed, argument values will be checked, and an error message will be displayed
++if the argument was not one of the acceptable values::
+ 
+-   >>> parser = argparse.ArgumentParser(prog='PROG')
+-   >>> parser.add_argument('foo', choices='abc')
+-   >>> parser.parse_args('c'.split())
+-   Namespace(foo='c')
+-   >>> parser.parse_args('X'.split())
+-   usage: PROG [-h] {a,b,c}
+-   PROG: error: argument foo: invalid choice: 'X' (choose from 'a', 'b', 'c')
++   >>> parser = argparse.ArgumentParser(prog='game.py')
++   >>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])
++   >>> parser.parse_args(['rock'])
++   Namespace(move='rock')
++   >>> parser.parse_args(['fire'])
++   usage: game.py [-h] {rock,paper,scissors}
++   game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',
++   'paper', 'scissors')
+ 
+-Note that inclusion in the ``choices`` container is checked after any type_
+-conversions have been performed, so the type of the objects in the ``choices``
++Note that inclusion in the *choices* container is checked after any type_
++conversions have been performed, so the type of the objects in the *choices*
+ container should match the type_ specified::
+ 
+-   >>> parser = argparse.ArgumentParser(prog='PROG')
+-   >>> parser.add_argument('foo', type=complex, choices=[1, 1j])
+-   >>> parser.parse_args('1j'.split())
+-   Namespace(foo=1j)
+-   >>> parser.parse_args('-- -4'.split())
+-   usage: PROG [-h] {1,1j}
+-   PROG: error: argument foo: invalid choice: (-4+0j) (choose from 1, 1j)
++   >>> parser = argparse.ArgumentParser(prog='doors.py')
++   >>> parser.add_argument('door', type=int, choices=range(1, 4))
++   >>> print(parser.parse_args(['3']))
++   Namespace(door=3)
++   >>> parser.parse_args(['4'])
++   usage: doors.py [-h] {1,2,3}
++   doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)
+ 
+-Any object that supports the ``in`` operator can be passed as the ``choices``
++Any object that supports the ``in`` operator can be passed as the *choices*
+ value, so :class:`dict` objects, :class:`set` objects, custom containers,
+ etc. are all supported.
+ 
+@@ -1119,7 +1137,7 @@
+ metavar
+ ^^^^^^^
+ 
+-When :class:`ArgumentParser` generates help messages, it need some way to refer
++When :class:`ArgumentParser` generates help messages, it needs some way to refer
+ to each expected argument.  By default, ArgumentParser objects use the dest_
+ value as the "name" of each object.  By default, for positional argument
+ actions, the dest_ value is used directly, and for optional argument actions,
+@@ -1442,7 +1460,7 @@
+    different functions which require different kinds of command-line arguments.
+    :class:`ArgumentParser` supports the creation of such sub-commands with the
+    :meth:`add_subparsers` method.  The :meth:`add_subparsers` method is normally
+-   called with no arguments and returns an special action object.  This object
++   called with no arguments and returns a special action object.  This object
+    has a single method, :meth:`~ArgumentParser.add_parser`, which takes a
+    command name and any :class:`ArgumentParser` constructor arguments, and
+    returns an :class:`ArgumentParser` object that can be modified as usual.
+@@ -1488,8 +1506,8 @@
+ 
+      positional arguments:
+        {a,b}   sub-command help
+-     a     a help
+-     b     b help
++         a     a help
++         b     b help
+ 
+      optional arguments:
+        -h, --help  show this help message and exit
+diff -r bd8afb90ebf2 Doc/library/audioop.rst
+--- a/Doc/library/audioop.rst
++++ b/Doc/library/audioop.rst
+@@ -7,7 +7,7 @@
+ 
+ The :mod:`audioop` module contains some useful operations on sound fragments.
+ It operates on sound fragments consisting of signed integer samples 8, 16 or 32
+-bits wide, stored in Python strings.  All scalar items are integers, unless
++bits wide, stored in bytes objects.  All scalar items are integers, unless
+ specified otherwise.
+ 
+ .. index::
+@@ -36,7 +36,7 @@
+ 
+    Return a fragment which is the addition of the two samples passed as parameters.
+    *width* is the sample width in bytes, either ``1``, ``2`` or ``4``.  Both
+-   fragments should have the same length.
++   fragments should have the same length.  Samples are truncated in case of overflow.
+ 
+ 
+ .. function:: adpcm2lin(adpcmfragment, width, state)
+@@ -67,7 +67,7 @@
+ .. function:: bias(fragment, width, bias)
+ 
+    Return a fragment that is the original fragment with a bias added to each
+-   sample.
++   sample.  Samples wrap around in case of overflow.
+ 
+ 
+ .. function:: cross(fragment, width)
+@@ -126,7 +126,7 @@
+ .. function:: lin2alaw(fragment, width)
+ 
+    Convert samples in the audio fragment to a-LAW encoding and return this as a
+-   Python string.  a-LAW is an audio encoding format whereby you get a dynamic
++   bytes object.  a-LAW is an audio encoding format whereby you get a dynamic
+    range of about 13 bits using only 8 bit samples.  It is used by the Sun audio
+    hardware, among others.
+ 
+@@ -151,31 +151,31 @@
+ .. function:: lin2ulaw(fragment, width)
+ 
+    Convert samples in the audio fragment to u-LAW encoding and return this as a
+-   Python string.  u-LAW is an audio encoding format whereby you get a dynamic
++   bytes object.  u-LAW is an audio encoding format whereby you get a dynamic
+    range of about 14 bits using only 8 bit samples.  It is used by the Sun audio
+    hardware, among others.
+ 
+ 
++.. function:: max(fragment, width)
++
++   Return the maximum of the *absolute value* of all samples in a fragment.
++
++
++.. function:: maxpp(fragment, width)
++
++   Return the maximum peak-peak value in the sound fragment.
++
++
+ .. function:: minmax(fragment, width)
+ 
+    Return a tuple consisting of the minimum and maximum values of all samples in
+    the sound fragment.
+ 
+ 
+-.. function:: max(fragment, width)
+-
+-   Return the maximum of the *absolute value* of all samples in a fragment.
+-
+-
+-.. function:: maxpp(fragment, width)
+-
+-   Return the maximum peak-peak value in the sound fragment.
+-
+-
+ .. function:: mul(fragment, width, factor)
+ 
+    Return a fragment that has all samples in the original fragment multiplied by
+-   the floating-point value *factor*.  Overflow is silently ignored.
++   the floating-point value *factor*.  Samples are truncated in case of overflow.
+ 
+ 
+ .. function:: ratecv(fragment, width, nchannels, inrate, outrate, state[, weightA[, weightB]])
+diff -r bd8afb90ebf2 Doc/library/codecs.rst
+--- a/Doc/library/codecs.rst
++++ b/Doc/library/codecs.rst
+@@ -155,13 +155,16 @@
+    when *name* is specified as the errors parameter.
+ 
+    For encoding *error_handler* will be called with a :exc:`UnicodeEncodeError`
+-   instance, which contains information about the location of the error. The error
+-   handler must either raise this or a different exception or return a tuple with a
+-   replacement for the unencodable part of the input and a position where encoding
+-   should continue. The encoder will encode the replacement and continue encoding
+-   the original input at the specified position. Negative position values will be
+-   treated as being relative to the end of the input string. If the resulting
+-   position is out of bound an :exc:`IndexError` will be raised.
++   instance, which contains information about the location of the error. The
++   error handler must either raise this or a different exception or return a
++   tuple with a replacement for the unencodable part of the input and a position
++   where encoding should continue. The replacement may be either :class:`str` or
++   :class:`bytes`.  If the replacement is bytes, the encoder will simply copy
++   them into the output buffer. If the replacement is a string, the encoder will
++   encode the replacement.  Encoding continues on original input at the
++   specified position. Negative position values will be treated as being
++   relative to the end of the input string. If the resulting position is out of
++   bound an :exc:`IndexError` will be raised.
+ 
+    Decoding and translating works similar, except :exc:`UnicodeDecodeError` or
+    :exc:`UnicodeTranslateError` will be passed to the handler and that the
+diff -r bd8afb90ebf2 Doc/library/collections.abc.rst
+--- a/Doc/library/collections.abc.rst
++++ b/Doc/library/collections.abc.rst
+@@ -90,7 +90,7 @@
+ 
+ .. class:: Iterator
+ 
+-   ABC for classes that provide the :meth:`__iter__` and :meth:`next` methods.
++   ABC for classes that provide the :meth:`__iter__` and :meth:`__next__` methods.
+    See also the definition of :term:`iterator`.
+ 
+ .. class:: Sequence
+diff -r bd8afb90ebf2 Doc/library/collections.rst
+--- a/Doc/library/collections.rst
++++ b/Doc/library/collections.rst
+@@ -159,7 +159,7 @@
+ 
+         d['x']                # Get first key in the chain of contexts
+         d['x'] = 1            # Set value in current context
+-        del['x']              # Delete from current context
++        del d['x']            # Delete from current context
+         list(d)               # All nested values
+         k in d                # Check all nested values
+         len(d)                # Number of nested values
+@@ -279,6 +279,7 @@
+             >>> c = Counter(a=4, b=2, c=0, d=-2)
+             >>> d = Counter(a=1, b=2, c=3, d=4)
+             >>> c.subtract(d)
++            >>> c
+             Counter({'a': 3, 'b': 0, 'c': -3, 'd': -6})
+ 
+         .. versionadded:: 3.2
+@@ -347,24 +348,24 @@
+     this section documents the minimum range and type restrictions.
+ 
+     * The :class:`Counter` class itself is a dictionary subclass with no
+-        restrictions on its keys and values.  The values are intended to be numbers
+-        representing counts, but you *could* store anything in the value field.
++      restrictions on its keys and values.  The values are intended to be numbers
++      representing counts, but you *could* store anything in the value field.
+ 
+     * The :meth:`most_common` method requires only that the values be orderable.
+ 
+     * For in-place operations such as ``c[key] += 1``, the value type need only
+-        support addition and subtraction.  So fractions, floats, and decimals would
+-        work and negative values are supported.  The same is also true for
+-        :meth:`update` and :meth:`subtract` which allow negative and zero values
+-        for both inputs and outputs.
++      support addition and subtraction.  So fractions, floats, and decimals would
++      work and negative values are supported.  The same is also true for
++      :meth:`update` and :meth:`subtract` which allow negative and zero values
++      for both inputs and outputs.
+ 
+     * The multiset methods are designed only for use cases with positive values.
+-        The inputs may be negative or zero, but only outputs with positive values
+-        are created.  There are no type restrictions, but the value type needs to
+-        support addition, subtraction, and comparison.
++      The inputs may be negative or zero, but only outputs with positive values
++      are created.  There are no type restrictions, but the value type needs to
++      support addition, subtraction, and comparison.
+ 
+     * The :meth:`elements` method requires integer counts.  It ignores zero and
+-        negative counts.
++      negative counts.
+ 
+ .. seealso::
+ 
+@@ -1012,7 +1013,7 @@
+ to the end and the sort is not maintained.
+ 
+ It is also straight-forward to create an ordered dictionary variant
+-that the remembers the order the keys were *last* inserted.
++that remembers the order the keys were *last* inserted.
+ If a new entry overwrites an existing entry, the
+ original insertion position is changed and moved to the end::
+ 
+diff -r bd8afb90ebf2 Doc/library/colorsys.rst
+--- a/Doc/library/colorsys.rst
++++ b/Doc/library/colorsys.rst
+@@ -58,7 +58,7 @@
+ Example::
+ 
+    >>> import colorsys
+-   >>> colorsys.rgb_to_hsv(.3, .4, .2)
+-   (0.25, 0.5, 0.4)
+-   >>> colorsys.hsv_to_rgb(0.25, 0.5, 0.4)
+-   (0.3, 0.4, 0.2)
++   >>> colorsys.rgb_to_hsv(0.2, 0.4, 0.4)
++   (0.5, 0.5, 0.4)
++   >>> colorsys.hsv_to_rgb(0.5, 0.5, 0.4)
++   (0.2, 0.4, 0.4)
+diff -r bd8afb90ebf2 Doc/library/concurrency.rst
+--- a/Doc/library/concurrency.rst
++++ b/Doc/library/concurrency.rst
+@@ -15,6 +15,7 @@
+ 
+    threading.rst
+    multiprocessing.rst
++   concurrent.rst
+    concurrent.futures.rst
+    subprocess.rst
+    sched.rst
+diff -r bd8afb90ebf2 Doc/library/concurrent.futures.rst
+--- a/Doc/library/concurrent.futures.rst
++++ b/Doc/library/concurrent.futures.rst
+@@ -42,12 +42,13 @@
+ 
+        Equivalent to ``map(func, *iterables)`` except *func* is executed
+        asynchronously and several calls to *func* may be made concurrently.  The
+-       returned iterator raises a :exc:`TimeoutError` if :meth:`__next__()` is
+-       called and the result isn't available after *timeout* seconds from the
+-       original call to :meth:`Executor.map`. *timeout* can be an int or a
+-       float.  If *timeout* is not specified or ``None``, there is no limit to
+-       the wait time.  If a call raises an exception, then that exception will
+-       be raised when its value is retrieved from the iterator.
++       returned iterator raises a :exc:`TimeoutError` if
++       :meth:`~iterator.__next__` is called and the result isn't available
++       after *timeout* seconds from the original call to :meth:`Executor.map`.
++       *timeout* can be an int or a float.  If *timeout* is not specified or
++       ``None``, there is no limit to the wait time.  If a call raises an
++       exception, then that exception will be raised when its value is
++       retrieved from the iterator.
+ 
+     .. method:: shutdown(wait=True)
+ 
+@@ -135,20 +136,23 @@
+            'http://www.bbc.co.uk/',
+            'http://some-made-up-domain.com/']
+ 
++   # Retrieve a single page and report the url and contents
+    def load_url(url, timeout):
+-       return urllib.request.urlopen(url, timeout=timeout).read()
++       conn = urllib.request.urlopen(url, timeout=timeout)
++       return conn.readall()
+ 
++   # We can use a with statement to ensure threads are cleaned up promptly
+    with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
+-       future_to_url = dict((executor.submit(load_url, url, 60), url)
+-                            for url in URLS)
+-
++       # Start the load operations and mark each future with its URL
++       future_to_url = {executor.submit(load_url, url, 60):url for url in URLS}
+        for future in concurrent.futures.as_completed(future_to_url):
+            url = future_to_url[future]
+-           if future.exception() is not None:
+-               print('%r generated an exception: %s' % (url,
+-                                                        future.exception()))
++           try:
++               data = future.result()
++           except Exception as exc:
++               print('%r generated an exception: %s' % (url, exc))
+            else:
+-               print('%r page is %d bytes' % (url, len(future.result())))
++               print('%r page is %d bytes' % (url, len(data)))
+ 
+ 
+ ProcessPoolExecutor
+@@ -364,10 +368,11 @@
+    different :class:`Executor` instances) given by *fs* that yields futures as
+    they complete (finished or were cancelled).  Any futures that completed
+    before :func:`as_completed` is called will be yielded first.  The returned
+-   iterator raises a :exc:`TimeoutError` if :meth:`__next__` is called and the
+-   result isn't available after *timeout* seconds from the original call to
+-   :func:`as_completed`.  *timeout* can be an int or float.  If *timeout* is not
+-   specified or ``None``, there is no limit to the wait time.
++   iterator raises a :exc:`TimeoutError` if :meth:`~iterator.__next__` is
++   called and the result isn't available after *timeout* seconds from the
++   original call to :func:`as_completed`.  *timeout* can be an int or float.
++   If *timeout* is not specified or ``None``, there is no limit to the wait
++   time.
+ 
+ 
+ .. seealso::
+diff -r bd8afb90ebf2 Doc/library/concurrent.rst
+--- /dev/null
++++ b/Doc/library/concurrent.rst
+@@ -0,0 +1,6 @@
++The :mod:`concurrent` package
++=============================
++
++Currently, there is only one module in this package:
++
++* :mod:`concurrent.futures` -- Launching parallel tasks
+diff -r bd8afb90ebf2 Doc/library/configparser.rst
+--- a/Doc/library/configparser.rst
++++ b/Doc/library/configparser.rst
+@@ -389,7 +389,13 @@
+   the default value to be visible again.  Trying to delete a default value
+   causes a ``KeyError``.
+ 
+-* Trying to delete the ``DEFAULTSECT`` raises ``ValueError``.
++* ``DEFAULTSECT`` cannot be removed from the parser:
++
++  * trying to delete it raises ``ValueError``,
++
++  * ``parser.clear()`` leaves it intact,
++
++  * ``parser.popitem()`` never returns it.
+ 
+ * ``parser.get(section, option, **kwargs)`` - the second argument is **not**
+   a fallback value. Note however that the section-level ``get()`` methods are
+@@ -770,9 +776,9 @@
+    # values using the mapping protocol or ConfigParser's set() does not allow
+    # such assignments to take place.
+    config.add_section('Section1')
+-   config.set('Section1', 'int', '15')
+-   config.set('Section1', 'bool', 'true')
+-   config.set('Section1', 'float', '3.1415')
++   config.set('Section1', 'an_int', '15')
++   config.set('Section1', 'a_bool', 'true')
++   config.set('Section1', 'a_float', '3.1415')
+    config.set('Section1', 'baz', 'fun')
+    config.set('Section1', 'bar', 'Python')
+    config.set('Section1', 'foo', '%(bar)s is %(baz)s!')
+@@ -790,13 +796,13 @@
+ 
+    # getfloat() raises an exception if the value is not a float
+    # getint() and getboolean() also do this for their respective types
+-   float = config.getfloat('Section1', 'float')
+-   int = config.getint('Section1', 'int')
+-   print(float + int)
++   a_float = config.getfloat('Section1', 'a_float')
++   an_int = config.getint('Section1', 'an_int')
++   print(a_float + an_int)
+ 
+    # Notice that the next output does not interpolate '%(bar)s' or '%(baz)s'.
+    # This is because we are using a RawConfigParser().
+-   if config.getboolean('Section1', 'bool'):
++   if config.getboolean('Section1', 'a_bool'):
+        print(config.get('Section1', 'foo'))
+ 
+ To get interpolation, use :class:`ConfigParser`::
+@@ -1007,7 +1013,7 @@
+       .. versionadded:: 3.2
+ 
+ 
+-   .. method:: get(section, option, raw=False, [vars, fallback])
++   .. method:: get(section, option, *, raw=False, vars=None[, fallback])
+ 
+       Get an *option* value for the named *section*.  If *vars* is provided, it
+       must be a dictionary.  The *option* is looked up in *vars* (if provided),
+@@ -1025,21 +1031,21 @@
+          (especially when using the mapping protocol).
+ 
+ 
+-   .. method:: getint(section, option, raw=False, [vars, fallback])
++   .. method:: getint(section, option, *, raw=False, vars=None[, fallback])
+ 
+       A convenience method which coerces the *option* in the specified *section*
+       to an integer.  See :meth:`get` for explanation of *raw*, *vars* and
+       *fallback*.
+ 
+ 
+-   .. method:: getfloat(section, option, raw=False, [vars, fallback])
++   .. method:: getfloat(section, option, *, raw=False, vars=None[, fallback])
+ 
+       A convenience method which coerces the *option* in the specified *section*
+       to a floating point number.  See :meth:`get` for explanation of *raw*,
+       *vars* and *fallback*.
+ 
+ 
+-   .. method:: getboolean(section, option, raw=False, [vars, fallback])
++   .. method:: getboolean(section, option, *, raw=False, vars=None[, fallback])
+ 
+       A convenience method which coerces the *option* in the specified *section*
+       to a Boolean value.  Note that the accepted values for the option are
+@@ -1051,7 +1057,8 @@
+       *fallback*.
+ 
+ 
+-   .. method:: items([section], raw=False, vars=None)
++   .. method:: items(raw=False, vars=None)
++               items(section, raw=False, vars=None)
+ 
+       When *section* is not given, return a list of *section_name*,
+       *section_proxy* pairs, including DEFAULTSECT.
+@@ -1149,7 +1156,13 @@
+ RawConfigParser Objects
+ -----------------------
+ 
+-.. class:: RawConfigParser(defaults=None, dict_type=collections.OrderedDict, allow_no_value=False, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section=configaparser.DEFAULTSECT, interpolation=None)
++.. class:: RawConfigParser(defaults=None, dict_type=collections.OrderedDict, \
++                           allow_no_value=False, *, delimiters=('=', ':'), \
++                           comment_prefixes=('#', ';'), \
++                           inline_comment_prefixes=None, strict=True, \
++                           empty_lines_in_values=True, \
++                           default_section=configparser.DEFAULTSECT[, \
++                           interpolation])
+ 
+    Legacy variant of the :class:`ConfigParser` with interpolation disabled
+    by default and unsafe ``add_section`` and ``set`` methods.
+diff -r bd8afb90ebf2 Doc/library/contextlib.rst
+--- a/Doc/library/contextlib.rst
++++ b/Doc/library/contextlib.rst
+@@ -184,7 +184,7 @@
+           files = [stack.enter_context(open(fname)) for fname in filenames]
+           # All opened files will automatically be closed at the end of
+           # the with statement, even if attempts to open files later
+-          # in the list throw an exception
++          # in the list raise an exception
+ 
+    Each instance maintains a stack of registered callbacks that are called in
+    reverse order when the instance is closed (either explicitly or implicitly
+diff -r bd8afb90ebf2 Doc/library/copy.rst
+--- a/Doc/library/copy.rst
++++ b/Doc/library/copy.rst
+@@ -67,8 +67,8 @@
+ 
+ Classes can use the same interfaces to control copying that they use to control
+ pickling.  See the description of module :mod:`pickle` for information on these
+-methods.  The :mod:`copy` module does not use the :mod:`copyreg` registration
+-module.
++methods.  In fact, :mod:`copy` module uses the registered pickle functions from
++:mod:`copyreg` module.
+ 
+ .. index::
+    single: __copy__() (copy protocol)
+diff -r bd8afb90ebf2 Doc/library/copyreg.rst
+--- a/Doc/library/copyreg.rst
++++ b/Doc/library/copyreg.rst
+@@ -9,9 +9,10 @@
+    module: pickle
+    module: copy
+ 
+-The :mod:`copyreg` module provides support for the :mod:`pickle` module.  The
+-:mod:`copy` module is likely to use this in the future as well.  It provides
+-configuration information about object constructors which are not classes.
++The :mod:`copyreg` module offers a way to define fuctions used while pickling
++specific objects.  The :mod:`pickle` and :mod:`copy` modules use those functions
++when pickling/copying those objects.  The module provides configuration
++information about object constructors which are not classes.
+ Such constructors may be factory functions or class instances.
+ 
+ 
+@@ -37,3 +38,25 @@
+    :attr:`~pickle.Pickler.dispatch_table` attribute of a pickler
+    object or subclass of :class:`pickle.Pickler` can also be used for
+    declaring reduction functions.
++
++Example
++-------
++
++The example below would like to show how to register a pickle function and how
++it will be used:
++
++   >>> import copyreg, copy, pickle
++   >>> class C(object):
++   ...     def __init__(self, a):
++   ...         self.a = a
++   ...
++   >>> def pickle_c(c):
++   ...     print("pickling a C instance...")
++   ...     return C, (c.a,)
++   ...
++   >>> copyreg.pickle(C, pickle_c)
++   >>> c = C(1)
++   >>> d = copy.copy(c)
++   pickling a C instance...
++   >>> p = pickle.dumps(c)
++   pickling a C instance...
+diff -r bd8afb90ebf2 Doc/library/crypt.rst
+--- a/Doc/library/crypt.rst
++++ b/Doc/library/crypt.rst
+@@ -121,11 +121,14 @@
+ Examples
+ --------
+ 
+-A simple example illustrating typical use::
++A simple example illustrating typical use (a constant-time comparison
++operation is needed to limit exposure to timing attacks.
++:func:`hmac.compare_digest` is suitable for this purpose)::
+ 
+    import pwd
+    import crypt
+    import getpass
++   from hmac import compare_digest as compare_hash
+ 
+    def login():
+        username = input('Python login: ')
+@@ -134,7 +137,7 @@
+            if cryptedpasswd == 'x' or cryptedpasswd == '*':
+                raise ValueError('no support for shadow passwords')
+            cleartext = getpass.getpass()
+-           return crypt.crypt(cleartext, cryptedpasswd) == cryptedpasswd
++           return compare_hash(crypt.crypt(cleartext, cryptedpasswd), cryptedpasswd)
+        else:
+            return True
+ 
+@@ -142,7 +145,8 @@
+ check it against the original::
+ 
+    import crypt
++   from hmac import compare_digest as compare_hash
+ 
+    hashed = crypt.crypt(plaintext)
+-   if hashed != crypt.crypt(plaintext, hashed):
++   if not compare_hash(hashed, crypt.crypt(plaintext, hashed)):
+       raise ValueError("hashed version doesn't validate against original")
+diff -r bd8afb90ebf2 Doc/library/crypto.rst
+--- a/Doc/library/crypto.rst
++++ b/Doc/library/crypto.rst
+@@ -8,6 +8,7 @@
+ 
+ The modules described in this chapter implement various algorithms of a
+ cryptographic nature.  They are available at the discretion of the installation.
++On Unix systems, the :mod:`crypt` module may also be available.
+ Here's an overview:
+ 
+ 
+diff -r bd8afb90ebf2 Doc/library/csv.rst
+--- a/Doc/library/csv.rst
++++ b/Doc/library/csv.rst
+@@ -71,9 +71,10 @@
+    A short usage example::
+ 
+       >>> import csv
+-      >>> spamReader = csv.reader(open('eggs.csv', newline=''), delimiter=' ', quotechar='|')
+-      >>> for row in spamReader:
+-      ...     print(', '.join(row))
++      >>> with open('eggs.csv', newline='') as csvfile:
++      ...     spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
++      ...     for row in spamreader:
++      ...         print(', '.join(row))
+       Spam, Spam, Spam, Spam, Spam, Baked Beans
+       Spam, Lovely Spam, Wonderful Spam
+ 
+@@ -99,11 +100,12 @@
+ 
+    A short usage example::
+ 
+-      >>> import csv
+-      >>> spamWriter = csv.writer(open('eggs.csv', 'w', newline=''), delimiter=' ',
+-      ...                         quotechar='|', quoting=csv.QUOTE_MINIMAL)
+-      >>> spamWriter.writerow(['Spam'] * 5 + ['Baked Beans'])
+-      >>> spamWriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])
++      import csv
++      with open('eggs.csv', 'w', newline='') as csvfile:
++          spamwriter = csv.writer(csvfile, delimiter=' ',
++                                  quotechar='|', quoting=csv.QUOTE_MINIMAL)
++          spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])
++          spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])
+ 
+ 
+ .. function:: register_dialect(name[, dialect], **fmtparams)
+@@ -221,11 +223,11 @@
+ 
+ An example for :class:`Sniffer` use::
+ 
+-   csvfile = open("example.csv")
+-   dialect = csv.Sniffer().sniff(csvfile.read(1024))
+-   csvfile.seek(0)
+-   reader = csv.reader(csvfile, dialect)
+-   # ... process CSV file contents here ...
++   with open('example.csv') as csvfile:
++       dialect = csv.Sniffer().sniff(csvfile.read(1024))
++       csvfile.seek(0)
++       reader = csv.reader(csvfile, dialect)
++       # ... process CSV file contents here ...
+ 
+ 
+ The :mod:`csv` module defines the following constants:
+@@ -339,6 +341,11 @@
+    The default is :const:`False`.
+ 
+ 
++.. attribute:: Dialect.strict
++
++   When ``True``, raise exception :exc:`Error` on bad CSV input.
++   The default is ``False``.
++
+ Reader Objects
+ --------------
+ 
+diff -r bd8afb90ebf2 Doc/library/ctypes.rst
+--- a/Doc/library/ctypes.rst
++++ b/Doc/library/ctypes.rst
+@@ -1094,8 +1094,8 @@
+ Surprises
+ ^^^^^^^^^
+ 
+-There are some edges in :mod:`ctypes` where you may be expect something else than
+-what actually happens.
++There are some edges in :mod:`ctypes` where you might expect something other
++than what actually happens.
+ 
+ Consider the following example::
+ 
+diff -r bd8afb90ebf2 Doc/library/curses.rst
+--- a/Doc/library/curses.rst
++++ b/Doc/library/curses.rst
+@@ -377,7 +377,8 @@
+    is to be displayed.
+ 
+ 
+-.. function:: newwin([nlines, ncols,] begin_y, begin_x)
++.. function:: newwin(begin_y, begin_x)
++              newwin(nlines, ncols, begin_y, begin_x)
+ 
+    Return a new window, whose left-upper corner is at  ``(begin_y, begin_x)``, and
+    whose height/width is  *nlines*/*ncols*.
+@@ -656,7 +657,8 @@
+ the following methods and attributes:
+ 
+ 
+-.. method:: window.addch([y, x,] ch[, attr])
++.. method:: window.addch(ch[, attr])
++            window.addch(y, x, ch[, attr])
+ 
+    .. note::
+ 
+@@ -670,13 +672,15 @@
+    position and attributes are the current settings for the window object.
+ 
+ 
+-.. method:: window.addnstr([y, x,] str, n[, attr])
++.. method:: window.addnstr(str, n[, attr])
++            window.addnstr(y, x, str, n[, attr])
+ 
+    Paint at most *n* characters of the  string *str* at ``(y, x)`` with attributes
+    *attr*, overwriting anything previously on the display.
+ 
+ 
+-.. method:: window.addstr([y, x,] str[, attr])
++.. method:: window.addstr(str[, attr])
++            window.addstr(y, x, str[, attr])
+ 
+    Paint the string *str* at ``(y, x)`` with attributes *attr*, overwriting
+    anything previously on the display.
+@@ -763,7 +767,10 @@
+    *bs* are *horch*.  The default corner characters are always used by this function.
+ 
+ 
+-.. method:: window.chgat([y, x, ] [num,] attr)
++.. method:: window.chgat(attr)
++            window.chgat(num, attr)
++            window.chgat(y, x, attr)
++            window.chgat(y, x, num, attr)
+ 
+    Set the attributes of *num* characters at the current cursor position, or at
+    position ``(y, x)`` if supplied. If no value of *num* is given or *num* = -1,
+@@ -812,7 +819,8 @@
+    Delete the line under the cursor. All following lines are moved up by one line.
+ 
+ 
+-.. method:: window.derwin([nlines, ncols,] begin_y, begin_x)
++.. method:: window.derwin(begin_y, begin_x)
++            window.derwin(nlines, ncols, begin_y, begin_x)
+ 
+    An abbreviation for "derive window", :meth:`derwin` is the same as calling
+    :meth:`subwin`, except that *begin_y* and *begin_x* are relative to the origin
+@@ -837,7 +845,7 @@
+ .. attribute:: window.encoding
+ 
+    Encoding used to encode method arguments (Unicode strings and characters).
+-   The encoding attribute is inherited from by parent window when a subwindow
++   The encoding attribute is inherited from the parent window when a subwindow
+    is created, for example with :meth:`window.subwin`. By default, the locale
+    encoding is used (see :func:`locale.getpreferredencoding`).
+ 
+@@ -906,7 +914,8 @@
+    upper-left corner.
+ 
+ 
+-.. method:: window.hline([y, x,] ch, n)
++.. method:: window.hline(ch, n)
++            window.hline(y, x, ch, n)
+ 
+    Display a horizontal line starting at ``(y, x)`` with length *n* consisting of
+    the character *ch*.
+@@ -940,7 +949,8 @@
+    the character proper, and upper bits are the attributes.
+ 
+ 
+-.. method:: window.insch([y, x,] ch[, attr])
++.. method:: window.insch(ch[, attr])
++            window.insch(y, x, ch[, attr])
+ 
+    Paint character *ch* at ``(y, x)`` with attributes *attr*, moving the line from
+    position *x* right by one character.
+@@ -961,7 +971,8 @@
+    line.
+ 
+ 
+-.. method:: window.insnstr([y, x,] str, n [, attr])
++.. method:: window.insnstr(str, n[, attr])
++            window.insnstr(y, x, str, n[, attr])
+ 
+    Insert a character string (as many characters as will fit on the line) before
+    the character under the cursor, up to *n* characters.   If *n* is zero or
+@@ -970,7 +981,8 @@
+    The cursor position does not change (after moving to *y*, *x*, if specified).
+ 
+ 
+-.. method:: window.insstr([y, x, ] str [, attr])
++.. method:: window.insstr(str[, attr])
++            window.insstr(y, x, str[, attr])
+ 
+    Insert a character string (as many characters as will fit on the line) before
+    the character under the cursor.  All characters to the right of the cursor are
+@@ -978,7 +990,8 @@
+    position does not change (after moving to *y*, *x*, if specified).
+ 
+ 
+-.. method:: window.instr([y, x] [, n])
++.. method:: window.instr([n])
++            window.instr(y, x[, n])
+ 
+    Return a string of characters, extracted from the window starting at the
+    current cursor position, or at *y*, *x* if specified. Attributes are stripped
+@@ -1153,13 +1166,15 @@
+    Turn on attribute *A_STANDOUT*.
+ 
+ 
+-.. method:: window.subpad([nlines, ncols,] begin_y, begin_x)
++.. method:: window.subpad(begin_y, begin_x)
++            window.subpad(nlines, ncols, begin_y, begin_x)
+ 
+    Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, and
+    whose width/height is *ncols*/*nlines*.
+ 
+ 
+-.. method:: window.subwin([nlines, ncols,] begin_y, begin_x)
++.. method:: window.subwin(begin_y, begin_x)
++            window.subwin(nlines, ncols, begin_y, begin_x)
+ 
+    Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, and
+    whose width/height is *ncols*/*nlines*.
+@@ -1216,7 +1231,8 @@
+    :meth:`refresh`.
+ 
+ 
+-.. method:: window.vline([y, x,] ch, n)
++.. method:: window.vline(ch, n)
++            window.vline(y, x, ch, n)
+ 
+    Display a vertical line starting at ``(y, x)`` with length *n* consisting of the
+    character *ch*.
+diff -r bd8afb90ebf2 Doc/library/datetime.rst
+--- a/Doc/library/datetime.rst
++++ b/Doc/library/datetime.rst
+@@ -1442,7 +1442,7 @@
+ instantiated directly.  You need to derive a concrete subclass, and (at least)
+ supply implementations of the standard :class:`tzinfo` methods needed by the
+ :class:`.datetime` methods you use.  The :mod:`datetime` module supplies
+-a simple concrete subclass of :class:`tzinfo` :class:`timezone` which can reprsent
++a simple concrete subclass of :class:`tzinfo` :class:`timezone` which can represent
+ timezones with fixed offset from UTC such as UTC itself or North American EST and
+ EDT.
+ 
+diff -r bd8afb90ebf2 Doc/library/decimal.rst
+--- a/Doc/library/decimal.rst
++++ b/Doc/library/decimal.rst
+@@ -400,6 +400,29 @@
+    compared, sorted, and coerced to another type (such as :class:`float` or
+    :class:`int`).
+ 
++   There are some small differences between arithmetic on Decimal objects and
++   arithmetic on integers and floats.  When the remainder operator ``%`` is
++   applied to Decimal objects, the sign of the result is the sign of the
++   *dividend* rather than the sign of the divisor::
++
++      >>> (-7) % 4
++      1
++      >>> Decimal(-7) % Decimal(4)
++      Decimal('-3')
++
++   The integer division operator ``//`` behaves analogously, returning the
++   integer part of the true quotient (truncating towards zero) rather than its
++   floor, so as to preserve the usual identity ``x == (x // y) * y + x % y``::
++
++      >>> -7 // 4
++      -2
++      >>> Decimal(-7) // Decimal(4)
++      Decimal('-1')
++
++   The ``%`` and ``//`` operators implement the ``remainder`` and
++   ``divide-integer`` operations (respectively) as described in the
++   specification.
++
+    Decimal objects cannot generally be combined with floats or
+    instances of :class:`fractions.Fraction` in arithmetic operations:
+    an attempt to add a :class:`Decimal` to a :class:`float`, for
+@@ -436,7 +459,7 @@
+       a :class:`Decimal` instance is always canonical, so this operation returns
+       its argument unchanged.
+ 
+-   .. method:: compare(other[, context])
++   .. method:: compare(other, context=None)
+ 
+       Compare the values of two Decimal instances.  :meth:`compare` returns a
+       Decimal instance, and if either operand is a NaN then the result is a
+@@ -447,13 +470,13 @@
+          a == b           ==> Decimal('0')
+          a > b            ==> Decimal('1')
+ 
+-   .. method:: compare_signal(other[, context])
++   .. method:: compare_signal(other, context=None)
+ 
+       This operation is identical to the :meth:`compare` method, except that all
+       NaNs signal.  That is, if neither operand is a signaling NaN then any
+       quiet NaN operand is treated as though it were a signaling NaN.
+ 
+-   .. method:: compare_total(other)
++   .. method:: compare_total(other, context=None)
+ 
+       Compare two operands using their abstract representation rather than their
+       numerical value.  Similar to the :meth:`compare` method, but the result
+@@ -471,13 +494,21 @@
+       higher in the total order than the second operand.  See the specification
+       for details of the total order.
+ 
+-   .. method:: compare_total_mag(other)
++      This operation is unaffected by context and is quiet: no flags are changed
++      and no rounding is performed.  As an exception, the C version may raise
++      InvalidOperation if the second operand cannot be converted exactly.
++
++   .. method:: compare_total_mag(other, context=None)
+ 
+       Compare two operands using their abstract representation rather than their
+       value as in :meth:`compare_total`, but ignoring the sign of each operand.
+       ``x.compare_total_mag(y)`` is equivalent to
+       ``x.copy_abs().compare_total(y.copy_abs())``.
+ 
++      This operation is unaffected by context and is quiet: no flags are changed
++      and no rounding is performed.  As an exception, the C version may raise
++      InvalidOperation if the second operand cannot be converted exactly.
++
+    .. method:: conjugate()
+ 
+       Just returns self, this method is only to comply with the Decimal
+@@ -494,7 +525,7 @@
+       Return the negation of the argument.  This operation is unaffected by the
+       context and is quiet: no flags are changed and no rounding is performed.
+ 
+-   .. method:: copy_sign(other)
++   .. method:: copy_sign(other, context=None)
+ 
+       Return a copy of the first operand with the sign set to be the same as the
+       sign of the second operand.  For example:
+@@ -502,10 +533,11 @@
+          >>> Decimal('2.3').copy_sign(Decimal('-1.5'))
+          Decimal('-2.3')
+ 
+-      This operation is unaffected by the context and is quiet: no flags are
+-      changed and no rounding is performed.
+-
+-   .. method:: exp([context])
++      This operation is unaffected by context and is quiet: no flags are changed
++      and no rounding is performed.  As an exception, the C version may raise
++      InvalidOperation if the second operand cannot be converted exactly.
++
++   .. method:: exp(context=None)
+ 
+       Return the value of the (natural) exponential function ``e**x`` at the
+       given number.  The result is correctly rounded using the
+@@ -542,7 +574,7 @@
+ 
+       .. versionadded:: 3.1
+ 
+-   .. method:: fma(other, third[, context])
++   .. method:: fma(other, third, context=None)
+ 
+       Fused multiply-add.  Return self*other+third with no rounding of the
+       intermediate product self*other.
+@@ -571,7 +603,7 @@
+       Return :const:`True` if the argument is a (quiet or signaling) NaN and
+       :const:`False` otherwise.
+ 
+-   .. method:: is_normal()
++   .. method:: is_normal(context=None)
+ 
+       Return :const:`True` if the argument is a *normal* finite number.  Return
+       :const:`False` if the argument is zero, subnormal, infinite or a NaN.
+@@ -591,7 +623,7 @@
+       Return :const:`True` if the argument is a signaling NaN and :const:`False`
+       otherwise.
+ 
+-   .. method:: is_subnormal()
++   .. method:: is_subnormal(context=None)
+ 
+       Return :const:`True` if the argument is subnormal, and :const:`False`
+       otherwise.
+@@ -601,17 +633,17 @@
+       Return :const:`True` if the argument is a (positive or negative) zero and
+       :const:`False` otherwise.
+ 
+-   .. method:: ln([context])
++   .. method:: ln(context=None)
+ 
+       Return the natural (base e) logarithm of the operand.  The result is
+       correctly rounded using the :const:`ROUND_HALF_EVEN` rounding mode.
+ 
+-   .. method:: log10([context])
++   .. method:: log10(context=None)
+ 
+       Return the base ten logarithm of the operand.  The result is correctly
+       rounded using the :const:`ROUND_HALF_EVEN` rounding mode.
+ 
+-   .. method:: logb([context])
++   .. method:: logb(context=None)
+ 
+       For a nonzero number, return the adjusted exponent of its operand as a
+       :class:`Decimal` instance.  If the operand is a zero then
+@@ -619,73 +651,73 @@
+       is raised.  If the operand is an infinity then ``Decimal('Infinity')`` is
+       returned.
+ 
+-   .. method:: logical_and(other[, context])
++   .. method:: logical_and(other, context=None)
+ 
+       :meth:`logical_and` is a logical operation which takes two *logical
+       operands* (see :ref:`logical_operands_label`).  The result is the
+       digit-wise ``and`` of the two operands.
+ 
+-   .. method:: logical_invert([context])
++   .. method:: logical_invert(context=None)
+ 
+       :meth:`logical_invert` is a logical operation.  The
+       result is the digit-wise inversion of the operand.
+ 
+-   .. method:: logical_or(other[, context])
++   .. method:: logical_or(other, context=None)
+ 
+       :meth:`logical_or` is a logical operation which takes two *logical
+       operands* (see :ref:`logical_operands_label`).  The result is the
+       digit-wise ``or`` of the two operands.
+ 
+-   .. method:: logical_xor(other[, context])
++   .. method:: logical_xor(other, context=None)
+ 
+       :meth:`logical_xor` is a logical operation which takes two *logical
+       operands* (see :ref:`logical_operands_label`).  The result is the
+       digit-wise exclusive or of the two operands.
+ 
+-   .. method:: max(other[, context])
++   .. method:: max(other, context=None)
+ 
+       Like ``max(self, other)`` except that the context rounding rule is applied
+       before returning and that :const:`NaN` values are either signaled or
+       ignored (depending on the context and whether they are signaling or
+       quiet).
+ 
+-   .. method:: max_mag(other[, context])
++   .. method:: max_mag(other, context=None)
+ 
+       Similar to the :meth:`.max` method, but the comparison is done using the
+       absolute values of the operands.
+ 
+-   .. method:: min(other[, context])
++   .. method:: min(other, context=None)
+ 
+       Like ``min(self, other)`` except that the context rounding rule is applied
+       before returning and that :const:`NaN` values are either signaled or
+       ignored (depending on the context and whether they are signaling or
+       quiet).
+ 
+-   .. method:: min_mag(other[, context])
++   .. method:: min_mag(other, context=None)
+ 
+       Similar to the :meth:`.min` method, but the comparison is done using the
+       absolute values of the operands.
+ 
+-   .. method:: next_minus([context])
++   .. method:: next_minus(context=None)
+ 
+       Return the largest number representable in the given context (or in the
+       current thread's context if no context is given) that is smaller than the
+       given operand.
+ 
+-   .. method:: next_plus([context])
++   .. method:: next_plus(context=None)
+ 
+       Return the smallest number representable in the given context (or in the
+       current thread's context if no context is given) that is larger than the
+       given operand.
+ 
+-   .. method:: next_toward(other[, context])
++   .. method:: next_toward(other, context=None)
+ 
+       If the two operands are unequal, return the number closest to the first
+       operand in the direction of the second operand.  If both operands are
+       numerically equal, return a copy of the first operand with the sign set to
+       be the same as the sign of the second operand.
+ 
+-   .. method:: normalize([context])
++   .. method:: normalize(context=None)
+ 
+       Normalize the number by stripping the rightmost trailing zeros and
+       converting any result equal to :const:`Decimal('0')` to
+@@ -694,7 +726,7 @@
+       ``Decimal('0.321000e+2')`` both normalize to the equivalent value
+       ``Decimal('32.1')``.
+ 
+-   .. method:: number_class([context])
++   .. method:: number_class(context=None)
+ 
+       Return a string describing the *class* of the operand.  The returned value
+       is one of the following ten strings.
+@@ -710,7 +742,7 @@
+       * ``"NaN"``, indicating that the operand is a quiet NaN (Not a Number).
+       * ``"sNaN"``, indicating that the operand is a signaling NaN.
+ 
+-   .. method:: quantize(exp[, rounding[, context[, watchexp]]])
++   .. method:: quantize(exp, rounding=None, context=None, watchexp=True)
+ 
+       Return a value equal to the first operand after rounding and having the
+       exponent of the second operand.
+@@ -748,16 +780,25 @@
+       class does all its arithmetic.  Included for compatibility with the
+       specification.
+ 
+-   .. method:: remainder_near(other[, context])
+-
+-      Compute the modulo as either a positive or negative value depending on
+-      which is closest to zero.  For instance, ``Decimal(10).remainder_near(6)``
+-      returns ``Decimal('-2')`` which is closer to zero than ``Decimal('4')``.
+-
+-      If both are equally close, the one chosen will have the same sign as
+-      *self*.
+-
+-   .. method:: rotate(other[, context])
++   .. method:: remainder_near(other, context=None)
++
++      Return the remainder from dividing *self* by *other*.  This differs from
++      ``self % other`` in that the sign of the remainder is chosen so as to
++      minimize its absolute value.  More precisely, the return value is
++      ``self - n * other`` where ``n`` is the integer nearest to the exact
++      value of ``self / other``, and if two integers are equally near then the
++      even one is chosen.
++
++      If the result is zero then its sign will be the sign of *self*.
++
++      >>> Decimal(18).remainder_near(Decimal(10))
++      Decimal('-2')
++      >>> Decimal(25).remainder_near(Decimal(10))
++      Decimal('5')
++      >>> Decimal(35).remainder_near(Decimal(10))
++      Decimal('-5')
++
++   .. method:: rotate(other, context=None)
+ 
+       Return the result of rotating the digits of the first operand by an amount
+       specified by the second operand.  The second operand must be an integer in
+@@ -768,18 +809,22 @@
+       length precision if necessary.  The sign and exponent of the first operand
+       are unchanged.
+ 
+-   .. method:: same_quantum(other[, context])
++   .. method:: same_quantum(other, context=None)
+ 
+       Test whether self and other have the same exponent or whether both are
+       :const:`NaN`.
+ 
+-   .. method:: scaleb(other[, context])
++      This operation is unaffected by context and is quiet: no flags are changed
++      and no rounding is performed.  As an exception, the C version may raise
++      InvalidOperation if the second operand cannot be converted exactly.
++
++   .. method:: scaleb(other, context=None)
+ 
+       Return the first operand with exponent adjusted by the second.
+       Equivalently, return the first operand multiplied by ``10**other``.  The
+       second operand must be an integer.
+ 
+-   .. method:: shift(other[, context])
++   .. method:: shift(other, context=None)
+ 
+       Return the result of shifting the digits of the first operand by an amount
+       specified by the second operand.  The second operand must be an integer in
+@@ -789,12 +834,12 @@
+       right.  Digits shifted into the coefficient are zeros.  The sign and
+       exponent of the first operand are unchanged.
+ 
+-   .. method:: sqrt([context])
++   .. method:: sqrt(context=None)
+ 
+       Return the square root of the argument to full precision.
+ 
+ 
+-   .. method:: to_eng_string([context])
++   .. method:: to_eng_string(context=None)
+ 
+       Convert to an engineering-type string.
+ 
+@@ -802,12 +847,12 @@
+       are up to 3 digits left of the decimal place.  For example, converts
+       ``Decimal('123E+1')`` to ``Decimal('1.23E+3')``
+ 
+-   .. method:: to_integral([rounding[, context]])
++   .. method:: to_integral(rounding=None, context=None)
+ 
+       Identical to the :meth:`to_integral_value` method.  The ``to_integral``
+       name has been kept for compatibility with older versions.
+ 
+-   .. method:: to_integral_exact([rounding[, context]])
++   .. method:: to_integral_exact(rounding=None, context=None)
+ 
+       Round to the nearest integer, signaling :const:`Inexact` or
+       :const:`Rounded` as appropriate if rounding occurs.  The rounding mode is
+@@ -815,7 +860,7 @@
+       ``context``.  If neither parameter is given then the rounding mode of the
+       current context is used.
+ 
+-   .. method:: to_integral_value([rounding[, context]])
++   .. method:: to_integral_value(rounding=None, context=None)
+ 
+       Round to the nearest integer without signaling :const:`Inexact` or
+       :const:`Rounded`.  If given, applies *rounding*; otherwise, uses the
+@@ -861,10 +906,10 @@
+ You can also use the :keyword:`with` statement and the :func:`localcontext`
+ function to temporarily change the active context.
+ 
+-.. function:: localcontext([c])
++.. function:: localcontext(ctx=None)
+ 
+    Return a context manager that will set the current context for the active thread
+-   to a copy of *c* on entry to the with-statement and restore the previous context
++   to a copy of *ctx* on entry to the with-statement and restore the previous context
+    when exiting the with-statement. If no context is specified, a copy of the
+    current context is used.
+ 
+@@ -1283,7 +1328,7 @@
+       identity operation.
+ 
+ 
+-   .. method:: power(x, y[, modulo])
++   .. method:: power(x, y, modulo=None)
+ 
+       Return ``x`` to the power of ``y``, reduced modulo ``modulo`` if given.
+ 
+diff -r bd8afb90ebf2 Doc/library/dis.rst
+--- a/Doc/library/dis.rst
++++ b/Doc/library/dis.rst
+@@ -660,10 +660,10 @@
+ 
+ .. opcode:: FOR_ITER (delta)
+ 
+-   ``TOS`` is an :term:`iterator`.  Call its :meth:`__next__` method.  If this
+-   yields a new value, push it on the stack (leaving the iterator below it).  If
+-   the iterator indicates it is exhausted ``TOS`` is popped, and the byte code
+-   counter is incremented by *delta*.
++   ``TOS`` is an :term:`iterator`.  Call its :meth:`~iterator.__next__` method.
++   If this yields a new value, push it on the stack (leaving the iterator below
++   it).  If the iterator indicates it is exhausted ``TOS`` is popped, and the
++   byte code counter is incremented by *delta*.
+ 
+ 
+ .. opcode:: LOAD_GLOBAL (namei)
+@@ -763,9 +763,10 @@
+ .. opcode:: MAKE_CLOSURE (argc)
+ 
+    Creates a new function object, sets its *__closure__* slot, and pushes it on
+-   the stack.  TOS is the code associated with the function, TOS1 the tuple
+-   containing cells for the closure's free variables.  The function also has
+-   *argc* default parameters, which are found below the cells.
++   the stack.  TOS is the :term:`qualified name` of the function, TOS1 is the
++   code associated with the function, and TOS2 is the tuple containing cells for
++   the closure's free variables.  The function also has *argc* default parameters,
++   which are found below the cells.
+ 
+ 
+ .. opcode:: BUILD_SLICE (argc)
+diff -r bd8afb90ebf2 Doc/library/doctest.rst
+--- a/Doc/library/doctest.rst
++++ b/Doc/library/doctest.rst
+@@ -1,3 +1,5 @@
++:keepdoctest:
++
+ :mod:`doctest` --- Test interactive Python examples
+ ===================================================
+ 
+@@ -318,7 +320,8 @@
+   Tabs in output generated by the tested code are not modified.  Because any
+   hard tabs in the sample output *are* expanded, this means that if the code
+   output includes hard tabs, the only way the doctest can pass is if the
+-  :const:`NORMALIZE_WHITESPACE` option or directive is in effect.
++  :const:`NORMALIZE_WHITESPACE` option or :ref:`directive <doctest-directives>`
++  is in effect.
+   Alternatively, the test can be rewritten to capture the output and compare it
+   to an expected value as part of the test.  This handling of tabs in the
+   source was arrived at through trial and error, and has proven to be the least
+@@ -338,7 +341,7 @@
+      Backslashes in a raw docstring: m\n
+ 
+   Otherwise, the backslash will be interpreted as part of the string. For example,
+-  the "\\" above would be interpreted as a newline character.  Alternatively, you
++  the ``\n`` above would be interpreted as a newline character.  Alternatively, you
+   can double each backslash in the doctest version (and not use a raw string)::
+ 
+      >>> def f(x):
+@@ -483,15 +486,16 @@
+      SyntaxError: invalid syntax
+ 
+ 
++.. _option-flags-and-directives:
+ .. _doctest-options:
+ 
+-Option Flags and Directives
+-^^^^^^^^^^^^^^^^^^^^^^^^^^^
++Option Flags
++^^^^^^^^^^^^
+ 
+ A number of option flags control various aspects of doctest's behavior.
+ Symbolic names for the flags are supplied as module constants, which can be
+ or'ed together and passed to various functions.  The names can also be used in
+-doctest directives (see below).
++:ref:`doctest directives <doctest-directives>`.
+ 
+ The first group of options define test semantics, controlling aspects of how
+ doctest decides whether actual output matches an example's expected output:
+@@ -545,14 +549,14 @@
+    :exc:`TypeError` is raised.
+ 
+    It will also ignore the module name used in Python 3 doctest reports. Hence
+-   both these variations will work regardless of whether the test is run under
+-   Python 2.7 or Python 3.2 (or later versions):
++   both of these variations will work with the flag specified, regardless of
++   whether the test is run under Python 2.7 or Python 3.2 (or later versions)::
+ 
+-      >>> raise CustomError('message') #doctest: +IGNORE_EXCEPTION_DETAIL
++      >>> raise CustomError('message')
+       Traceback (most recent call last):
+       CustomError: message
+ 
+-      >>> raise CustomError('message') #doctest: +IGNORE_EXCEPTION_DETAIL
++      >>> raise CustomError('message')
+       Traceback (most recent call last):
+       my_module.CustomError: message
+ 
+@@ -562,15 +566,16 @@
+    exception name. Using :const:`IGNORE_EXCEPTION_DETAIL` and the details
+    from Python 2.3 is also the only clear way to write a doctest that doesn't
+    care about the exception detail yet continues to pass under Python 2.3 or
+-   earlier (those releases do not support doctest directives and ignore them
+-   as irrelevant comments). For example, ::
++   earlier (those releases do not support :ref:`doctest directives
++   <doctest-directives>` and ignore them as irrelevant comments). For example::
+ 
+-      >>> (1, 2)[3] = 'moo' #doctest: +IGNORE_EXCEPTION_DETAIL
++      >>> (1, 2)[3] = 'moo'
+       Traceback (most recent call last):
+         File "<stdin>", line 1, in ?
+       TypeError: object doesn't support item assignment
+ 
+-   passes under Python 2.3 and later Python versions, even though the detail
++   passes under Python 2.3 and later Python versions with the flag specified,
++   even though the detail
+    changed in Python 2.4 to say "does not" instead of "doesn't".
+ 
+    .. versionchanged:: 3.2
+@@ -632,9 +637,30 @@
+ 
+    A bitmask or'ing together all the reporting flags above.
+ 
+-"Doctest directives" may be used to modify the option flags for individual
+-examples.  Doctest directives are expressed as a special Python comment
+-following an example's source code:
++
++There is also a way to register new option flag names, though this isn't
++useful unless you intend to extend :mod:`doctest` internals via subclassing:
++
++
++.. function:: register_optionflag(name)
++
++   Create a new option flag with a given name, and return the new flag's integer
++   value.  :func:`register_optionflag` can be used when subclassing
++   :class:`OutputChecker` or :class:`DocTestRunner` to create new options that are
++   supported by your subclasses.  :func:`register_optionflag` should always be
++   called using the following idiom::
++
++      MY_FLAG = register_optionflag('MY_FLAG')
++
++
++.. _doctest-directives:
++
++Directives
++^^^^^^^^^^
++
++Doctest directives may be used to modify the :ref:`option flags
++<doctest-options>` for an individual example.  Doctest directives are
++special Python comments following an example's source code:
+ 
+ .. productionlist:: doctest
+    directive: "#" "doctest:" `directive_options`
+@@ -652,7 +678,7 @@
+ 
+ For example, this test passes::
+ 
+-   >>> print(list(range(20))) #doctest: +NORMALIZE_WHITESPACE
++   >>> print(list(range(20))) # doctest: +NORMALIZE_WHITESPACE
+    [0,   1,  2,  3,  4,  5,  6,  7,  8,  9,
+    10,  11, 12, 13, 14, 15, 16, 17, 18, 19]
+ 
+@@ -664,7 +690,8 @@
+    >>> print(list(range(20))) # doctest: +ELLIPSIS
+    [0, 1, ..., 18, 19]
+ 
+-Multiple directives can be used on a single physical line, separated by commas::
++Multiple directives can be used on a single physical line, separated by
++commas::
+ 
+    >>> print(list(range(20))) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
+    [0,    1, ...,   18,    19]
+@@ -690,20 +717,6 @@
+ functions that run doctests, establishing different defaults.  In such cases,
+ disabling an option via ``-`` in a directive can be useful.
+ 
+-There's also a way to register new option flag names, although this isn't useful
+-unless you intend to extend :mod:`doctest` internals via subclassing:
+-
+-
+-.. function:: register_optionflag(name)
+-
+-   Create a new option flag with a given name, and return the new flag's integer
+-   value.  :func:`register_optionflag` can be used when subclassing
+-   :class:`OutputChecker` or :class:`DocTestRunner` to create new options that are
+-   supported by your subclasses.  :func:`register_optionflag` should always be
+-   called using the following idiom::
+-
+-      MY_FLAG = register_optionflag('MY_FLAG')
+-
+ 
+ .. _doctest-warnings:
+ 
+@@ -1024,6 +1037,16 @@
+ 
+    This function uses the same search technique as :func:`testmod`.
+ 
++   .. note::
++      Unlike :func:`testmod` and :class:`DocTestFinder`, this function raises
++      a :exc:`ValueError` if *module* contains no docstrings.  You can prevent
++      this error by passing a :class:`DocTestFinder` instance as the
++      *test_finder* argument with its *exclude_empty* keyword argument set
++      to ``False``::
++
++         >>> finder = doctest.DocTestFinder(exclude_empty=False)
++         >>> suite = doctest.DocTestSuite(test_finder=finder)
++
+ 
+ Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` out
+ of :class:`doctest.DocTestCase` instances, and :class:`DocTestCase` is a
+diff -r bd8afb90ebf2 Doc/library/dummy_threading.rst
+--- a/Doc/library/dummy_threading.rst
++++ b/Doc/library/dummy_threading.rst
+@@ -17,7 +17,7 @@
+    try:
+        import threading
+    except ImportError:
+-       import dummy_threading
++       import dummy_threading as threading
+ 
+ Be careful to not use this module where deadlock might occur from a thread being
+ created that blocks waiting for another thread to be created.  This often occurs
+diff -r bd8afb90ebf2 Doc/library/exceptions.rst
+--- a/Doc/library/exceptions.rst
++++ b/Doc/library/exceptions.rst
+@@ -39,17 +39,31 @@
+ new exception is not handled the traceback that is eventually displayed will
+ include the originating exception(s) and the final exception.
+ 
+-This implicit exception chain can be made explicit by using :keyword:`from` with
+-:keyword:`raise`.  The single argument to :keyword:`from` must be an exception
+-or ``None``. It will be set as :attr:`__cause__` on the raised exception.
+-Setting :attr:`__cause__` implicitly sets the :attr:`__suppress_context__` to
+-``True``. If :attr:`__cause__` is an exception, it will be displayed. If
+-:attr:`__cause__` is present or :attr:`__suppress_context__` has a true value,
+-:attr:`__context__` will not be displayed.
++When raising a new exception (rather than using a bare ``raise`` to re-raise
++the exception currently being handled), the implicit exception context can be
++supplemented with an explicit cause by using :keyword:`from` with
++:keyword:`raise`::
+ 
+-In either case, the default exception handling code will not display any of the
+-remaining links in the :attr:`__context__` chain if :attr:`__cause__` has been
+-set.
++   raise new_exc from original_exc
++
++The expression following :keyword:`from` must be an exception or ``None``. It
++will be set as :attr:`__cause__` on the raised exception. Setting
++:attr:`__cause__` also implicitly sets the :attr:`__suppress_context__`
++attribute to ``True``, so that using ``raise new_exc from None``
++effectively replaces the old exception with the new one for display
++purposes (e.g. converting :exc:`KeyError` to :exc:`AttributeError`, while
++leaving the old exception available in :attr:`__context__` for introspection
++when debugging.
++
++The default traceback display code shows these chained exceptions in
++addition to the traceback for the exception itself. An explicitly chained
++exception in :attr:`__cause__` is always shown when present. An implicitly
++chained exception in :attr:`__context__` is shown only if :attr:`__cause__`
++is :const:`None` and :attr:`__suppress_context__` is false.
++
++In either case, the exception itself is always shown after any chained
++exceptions so that the final line of the traceback always shows the last
++exception that was raised.
+ 
+ 
+ Base classes
+@@ -275,8 +289,8 @@
+ .. exception:: StopIteration
+ 
+    Raised by built-in function :func:`next` and an :term:`iterator`\'s
+-   :meth:`__next__` method to signal that there are no further items to be
+-   produced by the iterator.
++   :meth:`~iterator.__next__` method to signal that there are no further
++   items produced by the iterator.
+ 
+    The exception object has a single attribute :attr:`value`, which is
+    given as an argument when constructing the exception, and defaults
+@@ -371,6 +385,30 @@
+    Raised when a Unicode-related encoding or decoding error occurs.  It is a
+    subclass of :exc:`ValueError`.
+ 
++   :exc:`UnicodeError` has attributes that describe the encoding or decoding
++   error.  For example, ``err.object[err.start:err.end]`` gives the particular
++   invalid input that the codec failed on.
++
++   .. attribute:: encoding
++
++       The name of the encoding that raised the error.
++
++   .. attribute:: reason
++
++       A string describing the specific codec error.
++
++   .. attribute:: object
++
++       The object the codec was attempting to encode or decode.
++
++   .. attribute:: start
++
++       The first index of invalid data in :attr:`object`.
++
++   .. attribute:: end
++
++       The index after the last invalid data in :attr:`object`.
++
+ 
+ .. exception:: UnicodeEncodeError
+ 
+@@ -449,34 +487,35 @@
+ 
+ .. exception:: ConnectionError
+ 
+-   A base class for connection-related issues.  Subclasses are
+-   :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`,
++   A base class for connection-related issues.
++
++   Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`,
+    :exc:`ConnectionRefusedError` and :exc:`ConnectionResetError`.
+ 
+-   .. exception:: BrokenPipeError
++.. exception:: BrokenPipeError
+ 
+-      A subclass of :exc:`ConnectionError`, raised when trying to write on a
+-      pipe while the other end has been closed, or trying to write on a socket
+-      which has been shutdown for writing.
+-      Corresponds to :c:data:`errno` ``EPIPE`` and ``ESHUTDOWN``.
++   A subclass of :exc:`ConnectionError`, raised when trying to write on a
++   pipe while the other end has been closed, or trying to write on a socket
++   which has been shutdown for writing.
++   Corresponds to :c:data:`errno` ``EPIPE`` and ``ESHUTDOWN``.
+ 
+-   .. exception:: ConnectionAbortedError
++.. exception:: ConnectionAbortedError
+ 
+-      A subclass of :exc:`ConnectionError`, raised when a connection attempt
+-      is aborted by the peer.
+-      Corresponds to :c:data:`errno` ``ECONNABORTED``.
++   A subclass of :exc:`ConnectionError`, raised when a connection attempt
++   is aborted by the peer.
++   Corresponds to :c:data:`errno` ``ECONNABORTED``.
+ 
+-   .. exception:: ConnectionRefusedError
++.. exception:: ConnectionRefusedError
+ 
+-      A subclass of :exc:`ConnectionError`, raised when a connection attempt
+-      is refused by the peer.
+-      Corresponds to :c:data:`errno` ``ECONNREFUSED``.
++   A subclass of :exc:`ConnectionError`, raised when a connection attempt
++   is refused by the peer.
++   Corresponds to :c:data:`errno` ``ECONNREFUSED``.
+ 
+-   .. exception:: ConnectionResetError
++.. exception:: ConnectionResetError
+ 
+-      A subclass of :exc:`ConnectionError`, raised when a connection is
+-      reset by the peer.
+-      Corresponds to :c:data:`errno` ``ECONNRESET``.
++   A subclass of :exc:`ConnectionError`, raised when a connection is
++   reset by the peer.
++   Corresponds to :c:data:`errno` ``ECONNRESET``.
+ 
+ .. exception:: FileExistsError
+ 
+@@ -491,7 +530,7 @@
+ .. exception:: InterruptedError
+ 
+    Raised when a system call is interrupted by an incoming signal.
+-   Corresponds to :c:data:`errno` ``EEINTR``.
++   Corresponds to :c:data:`errno` ``EINTR``.
+ 
+ .. exception:: IsADirectoryError
+ 
+diff -r bd8afb90ebf2 Doc/library/filecmp.rst
+--- a/Doc/library/filecmp.rst
++++ b/Doc/library/filecmp.rst
+@@ -176,6 +176,6 @@
+     ...     for sub_dcmp in dcmp.subdirs.values():
+     ...         print_diff_files(sub_dcmp)
+     ...
+-    >>> dcmp = dircmp('dir1', 'dir2')
+-    >>> print_diff_files(dcmp)
++    >>> dcmp = dircmp('dir1', 'dir2') # doctest: +SKIP
++    >>> print_diff_files(dcmp) # doctest: +SKIP
+ 
+diff -r bd8afb90ebf2 Doc/library/fnmatch.rst
+--- a/Doc/library/fnmatch.rst
++++ b/Doc/library/fnmatch.rst
+@@ -29,6 +29,9 @@
+ | ``[!seq]`` | matches any character not in *seq* |
+ +------------+------------------------------------+
+ 
++For a literal match, wrap the meta-characters in brackets.
++For example, ``'[?]'`` matches the character ``'?'``.
++
+ .. index:: module: glob
+ 
+ Note that the filename separator (``'/'`` on Unix) is *not* special to this
+@@ -74,8 +77,6 @@
+ 
+    Return the shell-style *pattern* converted to a regular expression.
+ 
+-   Be aware there is no way to quote meta-characters.
+-
+    Example:
+ 
+       >>> import fnmatch, re
+diff -r bd8afb90ebf2 Doc/library/fractions.rst
+--- a/Doc/library/fractions.rst
++++ b/Doc/library/fractions.rst
+@@ -56,7 +56,6 @@
+       Fraction(0, 1)
+       >>> Fraction('3/7')
+       Fraction(3, 7)
+-      [40794 refs]
+       >>> Fraction(' -3/7 ')
+       Fraction(-3, 7)
+       >>> Fraction('1.414213 \t\n')
+diff -r bd8afb90ebf2 Doc/library/ftplib.rst
+--- a/Doc/library/ftplib.rst
++++ b/Doc/library/ftplib.rst
+@@ -270,12 +270,12 @@
+ .. method:: FTP.storbinary(cmd, file, blocksize=8192, callback=None, rest=None)
+ 
+    Store a file in binary transfer mode.  *cmd* should be an appropriate
+-   ``STOR`` command: ``"STOR filename"``. *file* is an open :term:`file object`
+-   which is read until EOF using its :meth:`read` method in blocks of size
+-   *blocksize* to provide the data to be stored.  The *blocksize* argument
+-   defaults to 8192.  *callback* is an optional single parameter callable that
+-   is called on each block of data after it is sent. *rest* means the same thing
+-   as in the :meth:`transfercmd` method.
++   ``STOR`` command: ``"STOR filename"``. *file* is a :term:`file object`
++   (opened in binary mode) which is read until EOF using its :meth:`read`
++   method in blocks of size *blocksize* to provide the data to be stored.
++   The *blocksize* argument defaults to 8192.  *callback* is an optional single
++   parameter callable that is called on each block of data after it is sent.
++   *rest* means the same thing as in the :meth:`transfercmd` method.
+ 
+    .. versionchanged:: 3.2
+       *rest* parameter added.
+@@ -285,9 +285,9 @@
+ 
+    Store a file in ASCII transfer mode.  *cmd* should be an appropriate
+    ``STOR`` command (see :meth:`storbinary`).  Lines are read until EOF from the
+-   open :term:`file object` *file* using its :meth:`readline` method to provide
+-   the data to be stored.  *callback* is an optional single parameter callable
+-   that is called on each line after it is sent.
++   :term:`file object` *file* (opened in binary mode) using its :meth:`readline`
++   method to provide the data to be stored.  *callback* is an optional single
++   parameter callable that is called on each line after it is sent.
+ 
+ 
+ .. method:: FTP.transfercmd(cmd, rest=None)
+@@ -406,10 +406,10 @@
+ .. method:: FTP.close()
+ 
+    Close the connection unilaterally.  This should not be applied to an already
+-   closed connection such as after a successful call to :meth:`quit`.  After this
+-   call the :class:`FTP` instance should not be used any more (after a call to
+-   :meth:`close` or :meth:`quit` you cannot reopen the connection by issuing
+-   another :meth:`login` method).
++   closed connection such as after a successful call to :meth:`~FTP.quit`.
++   After this call the :class:`FTP` instance should not be used any more (after
++   a call to :meth:`close` or :meth:`~FTP.quit` you cannot reopen the
++   connection by issuing another :meth:`login` method).
+ 
+ 
+ FTP_TLS Objects
+diff -r bd8afb90ebf2 Doc/library/functions.rst
+--- a/Doc/library/functions.rst
++++ b/Doc/library/functions.rst
+@@ -14,7 +14,7 @@
+ :func:`all`          :func:`dir`        :func:`hex`         :func:`next`      :func:`slice`
+ :func:`any`          :func:`divmod`     :func:`id`          :func:`object`    :func:`sorted`
+ :func:`ascii`        :func:`enumerate`  :func:`input`       :func:`oct`       :func:`staticmethod`
+-:func:`bin`          :func:`eval`       :func:`int`         :func:`open`      :func:`str`
++:func:`bin`          :func:`eval`       :func:`int`         :func:`open`      |func-str|_
+ :func:`bool`         :func:`exec`       :func:`isinstance`  :func:`ord`       :func:`sum`
+ :func:`bytearray`    :func:`filter`     :func:`issubclass`  :func:`pow`       :func:`super`
+ :func:`bytes`        :func:`float`      :func:`iter`        :func:`print`     |func-tuple|_
+@@ -34,6 +34,7 @@
+ .. |func-memoryview| replace:: ``memoryview()``
+ .. |func-set| replace:: ``set()``
+ .. |func-list| replace:: ``list()``
++.. |func-str| replace:: ``str()``
+ .. |func-tuple| replace:: ``tuple()``
+ .. |func-range| replace:: ``range()``
+ 
+@@ -122,6 +123,8 @@
+ 
+    Without an argument, an array of size 0 is created.
+ 
++   See also :ref:`binaryseq` and :ref:`typebytearray`.
++
+ 
+ .. _func-bytes:
+ .. function:: bytes([source[, encoding[, errors]]])
+@@ -135,6 +138,8 @@
+ 
+    Bytes objects can also be created with literals, see :ref:`strings`.
+ 
++   See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`.
++
+ 
+ .. function:: callable(object)
+ 
+@@ -267,14 +272,17 @@
+ 
+ 
+ .. _func-dict:
+-.. function:: dict([arg])
++.. function:: dict(**kwarg)
++              dict(mapping, **kwarg)
++              dict(iterable, **kwarg)
+    :noindex:
+ 
+-   Create a new data dictionary, optionally with items taken from *arg*.
+-   The dictionary type is described in :ref:`typesmapping`.
++   Create a new dictionary.  The :class:`dict` object is the dictionary class.
++   See :class:`dict` and :ref:`typesmapping` for documentation about this
++   class.
+ 
+-   For other containers see the built in :class:`list`, :class:`set`, and
+-   :class:`tuple` classes, and the :mod:`collections` module.
++   For other containers see the built-in :class:`list`, :class:`set`, and
++   :class:`tuple` classes, as well as the :mod:`collections` module.
+ 
+ 
+ .. function:: dir([object])
+@@ -348,10 +356,10 @@
+ .. function:: enumerate(iterable, start=0)
+ 
+    Return an enumerate object. *iterable* must be a sequence, an
+-   :term:`iterator`, or some other object which supports iteration.  The
+-   :meth:`__next__` method of the iterator returned by :func:`enumerate` returns a
+-   tuple containing a count (from *start* which defaults to 0) and the
+-   values obtained from iterating over *iterable*.
++   :term:`iterator`, or some other object which supports iteration.
++   The :meth:`~iterator.__next__` method of the iterator returned by
++   :func:`enumerate` returns a tuple containing a count (from *start* which
++   defaults to 0) and the values obtained from iterating over *iterable*.
+ 
+       >>> seasons = ['Spring', 'Summer', 'Fall', 'Winter']
+       >>> list(enumerate(seasons))
+@@ -514,20 +522,20 @@
+ 
+    The float type is described in :ref:`typesnumeric`.
+ 
++   .. index::
++      single: __format__
++      single: string; format() (built-in function)
++
+ 
+ .. function:: format(value[, format_spec])
+ 
+-   .. index::
+-      pair: str; format
+-      single: __format__
+-
+    Convert a *value* to a "formatted" representation, as controlled by
+    *format_spec*.  The interpretation of *format_spec* will depend on the type
+    of the *value* argument, however there is a standard formatting syntax that
+    is used by most built-in types: :ref:`formatspec`.
+ 
+    The default *format_spec* is an empty string which usually gives the same
+-   effect as calling ``str(value)``.
++   effect as calling :func:`str(value) <str>`.
+ 
+    A call to ``format(value, format_spec)`` is translated to
+    ``type(value).__format__(format_spec)`` which bypasses the instance
+@@ -540,11 +548,13 @@
+ .. function:: frozenset([iterable])
+    :noindex:
+ 
+-   Return a frozenset object, optionally with elements taken from *iterable*.
+-   The frozenset type is described in :ref:`types-set`.
++   Return a new :class:`frozenset` object, optionally with elements taken from
++   *iterable*.  ``frozenset`` is a built-in class.  See :class:`frozenset` and
++   :ref:`types-set` for documentation about this class.
+ 
+-   For other containers see the built in :class:`dict`, :class:`list`, and
+-   :class:`tuple` classes, and the :mod:`collections` module.
++   For other containers see the built-in :class:`set`, :class:`list`,
++   :class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections`
++   module.
+ 
+ 
+ .. function:: getattr(object, name[, default])
+@@ -629,14 +639,19 @@
+    to provide elaborate line editing and history features.
+ 
+ 
+-.. function:: int([number | string[, base]])
++.. function:: int(x=0)
++              int(x, base=10)
+ 
+-   Convert a number or string to an integer.  If no arguments are given, return
+-   ``0``.  If a number is given, return ``number.__int__()``.  Conversion of
+-   floating point numbers to integers truncates towards zero.  A string must be
+-   a base-radix integer literal optionally preceded by '+' or '-' (with no space
+-   in between) and optionally surrounded by whitespace.  A base-n literal
+-   consists of the digits 0 to n-1, with 'a' to 'z' (or 'A' to 'Z') having
++   Convert a number or string *x* to an integer, or return ``0`` if no
++   arguments are given.  If *x* is a number, return :meth:`x.__int__()
++   <object.__int__>`.  For floating point numbers, this truncates towards zero.
++
++   If *x* is not a number or if *base* is given, then *x* must be a string,
++   :class:`bytes`, or :class:`bytearray` instance representing an :ref:`integer
++   literal <integers>` in radix *base*.  Optionally, the literal can be
++   preceded by ``+`` or ``-`` (with no space in between) and surrounded by
++   whitespace.  A base-n literal consists of the digits 0 to n-1, with ``a``
++   to ``z`` (or ``A`` to ``Z``) having
+    values 10 to 35.  The default *base* is 10. The allowed values are 0 and 2-36.
+    Base-2, -8, and -16 literals can be optionally prefixed with ``0b``/``0B``,
+    ``0o``/``0O``, or ``0x``/``0X``, as with integer literals in code.  Base 0
+@@ -678,9 +693,12 @@
+    starting at ``0``).  If it does not support either of those protocols,
+    :exc:`TypeError` is raised. If the second argument, *sentinel*, is given,
+    then *object* must be a callable object.  The iterator created in this case
+-   will call *object* with no arguments for each call to its :meth:`__next__`
+-   method; if the value returned is equal to *sentinel*, :exc:`StopIteration`
+-   will be raised, otherwise the value will be returned.
++   will call *object* with no arguments for each call to its
++   :meth:`~iterator.__next__` method; if the value returned is equal to
++   *sentinel*, :exc:`StopIteration` will be raised, otherwise the value will
++   be returned.
++
++   See also :ref:`typeiter`.
+ 
+    One useful application of the second form of :func:`iter` is to read lines of
+    a file until a certain line is reached.  The following example reads a file
+@@ -702,7 +720,7 @@
+    :noindex:
+ 
+    Rather than being a function, :class:`list` is actually a mutable
+-   sequence type, as documented in :ref:`typesseq`.
++   sequence type, as documented in :ref:`typesseq-list` and :ref:`typesseq`.
+ 
+ 
+ .. function:: locals()
+@@ -725,11 +743,16 @@
+    already arranged into argument tuples, see :func:`itertools.starmap`\.
+ 
+ 
+-.. function:: max(iterable[, args...], *[, key])
++.. function:: max(iterable, *[, key])
++              max(arg1, arg2, *args[, key])
+ 
+-   With a single argument *iterable*, return the largest item of a non-empty
+-   iterable (such as a string, tuple or list).  With more than one argument, return
+-   the largest of the arguments.
++   Return the largest item in an iterable or the largest of two or more
++   arguments.
++
++   If one positional argument is provided, *iterable* must be a non-empty
++   iterable (such as a non-empty string, tuple or list).  The largest item
++   in the iterable is returned.  If two or more positional arguments are
++   provided, the largest of the positional arguments is returned.
+ 
+    The optional keyword-only *key* argument specifies a one-argument ordering
+    function like that used for :meth:`list.sort`.
+@@ -748,11 +771,16 @@
+    :ref:`typememoryview` for more information.
+ 
+ 
+-.. function:: min(iterable[, args...], *[, key])
++.. function:: min(iterable, *[, key])
++              min(arg1, arg2, *args[, key])
+ 
+-   With a single argument *iterable*, return the smallest item of a non-empty
+-   iterable (such as a string, tuple or list).  With more than one argument, return
+-   the smallest of the arguments.
++   Return the smallest item in an iterable or the smallest of two or more
++   arguments.
++
++   If one positional argument is provided, *iterable* must be a non-empty
++   iterable (such as a non-empty string, tuple or list).  The smallest item
++   in the iterable is returned.  If two or more positional arguments are
++   provided, the smallest of the positional arguments is returned.
+ 
+    The optional keyword-only *key* argument specifies a one-argument ordering
+    function like that used for :meth:`list.sort`.
+@@ -764,9 +792,9 @@
+ 
+ .. function:: next(iterator[, default])
+ 
+-   Retrieve the next item from the *iterator* by calling its :meth:`__next__`
+-   method.  If *default* is given, it is returned if the iterator is exhausted,
+-   otherwise :exc:`StopIteration` is raised.
++   Retrieve the next item from the *iterator* by calling its
++   :meth:`~iterator.__next__` method.  If *default* is given, it is returned
++   if the iterator is exhausted, otherwise :exc:`StopIteration` is raised.
+ 
+ 
+ .. function:: object()
+@@ -910,6 +938,19 @@
+    :mod:`os.open` as *opener* results in functionality similar to passing
+    ``None``).
+ 
++   The following example uses the :ref:`dir_fd <dir_fd>` parameter of the
++   :func:`os.open` function to open a file relative to a given directory::
++
++      >>> import os
++      >>> dir_fd = os.open('somedir', os.O_RDONLY)
++      >>> def opener(path, flags):
++      ...     return os.open(path, flags, dir_fd=dir_fd)
++      ...
++      >>> with open('spamspam.txt', 'w', opener=opener) as f:
++      ...     print('This will be written to somedir/spamspam.txt', file=f)
++      ...
++      >>> os.close(dir_fd)  # don't leak a file descriptor
++
+    .. versionchanged:: 3.3
+       The *opener* parameter was added.
+       The ``'x'`` mode was added.
+@@ -970,16 +1011,16 @@
+    must be of integer types, and *y* must be non-negative.
+ 
+ 
+-.. function:: print([object, ...], *, sep=' ', end='\\n', file=sys.stdout, flush=False)
++.. function:: print(*objects, sep=' ', end='\\n', file=sys.stdout, flush=False)
+ 
+-   Print *object*\(s) to the stream *file*, separated by *sep* and followed by
++   Print *objects* to the stream *file*, separated by *sep* and followed by
+    *end*.  *sep*, *end* and *file*, if present, must be given as keyword
+    arguments.
+ 
+    All non-keyword arguments are converted to strings like :func:`str` does and
+    written to the stream, separated by *sep* and followed by *end*.  Both *sep*
+    and *end* must be strings; they can also be ``None``, which means to use the
+-   default values.  If no *object* is given, :func:`print` will just write
++   default values.  If no *objects* are given, :func:`print` will just write
+    *end*.
+ 
+    The *file* argument must be an object with a ``write(string)`` method; if it
+@@ -1061,11 +1102,12 @@
+ 
+ 
+ .. _func-range:
+-.. function:: range([start,] stop[, step])
++.. function:: range(stop)
++              range(start, stop[, step])
+    :noindex:
+ 
+    Rather than being a function, :class:`range` is actually an immutable
+-   sequence type, as documented in :ref:`typesseq`.
++   sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`.
+ 
+ 
+ .. function:: repr(object)
+@@ -1087,18 +1129,18 @@
+    arguments starting at ``0``).
+ 
+ 
+-.. function:: round(x[, n])
++.. function:: round(number[, ndigits])
+ 
+-   Return the floating point value *x* rounded to *n* digits after the decimal
+-   point.  If *n* is omitted, it defaults to zero.  Delegates to
+-   ``x.__round__(n)``.
++   Return the floating point value *number* rounded to *ndigits* digits after
++   the decimal point.  If *ndigits* is omitted, it defaults to zero. Delegates
++   to ``number.__round__(ndigits)``.
+ 
+    For the built-in types supporting :func:`round`, values are rounded to the
+-   closest multiple of 10 to the power minus *n*; if two multiples are equally
+-   close, rounding is done toward the even choice (so, for example, both
+-   ``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is ``2``).
+-   The return value is an integer if called with one argument, otherwise of the
+-   same type as *x*.
++   closest multiple of 10 to the power minus *ndigits*; if two multiples are
++   equally close, rounding is done toward the even choice (so, for example,
++   both ``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is
++   ``2``).  The return value is an integer if called with one argument,
++   otherwise of the same type as *number*.
+ 
+    .. note::
+ 
+@@ -1113,8 +1155,13 @@
+ .. function:: set([iterable])
+    :noindex:
+ 
+-   Return a new set, optionally with elements taken from *iterable*.
+-   The set type is described in :ref:`types-set`.
++   Return a new :class:`set` object, optionally with elements taken from
++   *iterable*.  ``set`` is a built-in class.  See :class:`set` and
++   :ref:`types-set` for documentation about this class.
++
++   For other containers see the built-in :class:`frozenset`, :class:`list`,
++   :class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections`
++   module.
+ 
+ 
+ .. function:: setattr(object, name, value)
+@@ -1126,7 +1173,8 @@
+    ``x.foobar = 123``.
+ 
+ 
+-.. function:: slice([start,] stop[, step])
++.. function:: slice(stop)
++              slice(start, stop[, step])
+ 
+    .. index:: single: Numerical Python
+ 
+@@ -1184,38 +1232,19 @@
+    For more information on static methods, consult the documentation on the
+    standard type hierarchy in :ref:`types`.
+ 
++   .. index::
++      single: string; str() (built-in function)
++
+ 
+ .. _func-str:
+-.. function:: str([object[, encoding[, errors]]])
++.. function:: str(object='')
++              str(object=b'', encoding='utf-8', errors='strict')
++   :noindex:
+ 
+-   Return a string version of an object, using one of the following modes:
++   Return a :class:`str` version of *object*.  See :func:`str` for details.
+ 
+-   If *encoding* and/or *errors* are given, :func:`str` will decode the
+-   *object* which can either be a byte string or a character buffer using
+-   the codec for *encoding*. The *encoding* parameter is a string giving
+-   the name of an encoding; if the encoding is not known, :exc:`LookupError`
+-   is raised.  Error handling is done according to *errors*; this specifies the
+-   treatment of characters which are invalid in the input encoding. If
+-   *errors* is ``'strict'`` (the default), a :exc:`ValueError` is raised on
+-   errors, while a value of ``'ignore'`` causes errors to be silently ignored,
+-   and a value of ``'replace'`` causes the official Unicode replacement character,
+-   U+FFFD, to be used to replace input characters which cannot be decoded.
+-   See also the :mod:`codecs` module.
+-
+-   When only *object* is given, this returns its nicely printable representation.
+-   For strings, this is the string itself.  The difference with ``repr(object)``
+-   is that ``str(object)`` does not always attempt to return a string that is
+-   acceptable to :func:`eval`; its goal is to return a printable string.
+-   With no arguments, this returns the empty string.
+-
+-   Objects can specify what ``str(object)`` returns by defining a :meth:`__str__`
+-   special method.
+-
+-   For more information on strings see :ref:`typesseq` which describes sequence
+-   functionality (strings are sequences), and also the string-specific methods
+-   described in the :ref:`string-methods` section. To output formatted strings,
+-   see the :ref:`string-formatting` section. In addition see the
+-   :ref:`stringservices` section.
++   ``str`` is the built-in string :term:`class`.  For general information
++   about strings, see :ref:`textseq`.
+ 
+ 
+ .. function:: sum(iterable[, start])
+@@ -1292,39 +1321,37 @@
+    :noindex:
+ 
+    Rather than being a function, :class:`tuple` is actually an immutable
+-   sequence type, as documented in :ref:`typesseq`.
++   sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`.
+ 
+ 
+ .. function:: type(object)
++              type(name, bases, dict)
+ 
+    .. index:: object: type
+ 
+-   Return the type of an *object*.  The return value is a type object and
+-   generally the same object as returned by ``object.__class__``.
++
++   With one argument, return the type of an *object*.  The return value is a
++   type object and generally the same object as returned by ``object.__class__``.
+ 
+    The :func:`isinstance` built-in function is recommended for testing the type
+    of an object, because it takes subclasses into account.
+ 
+-   With three arguments, :func:`type` functions as a constructor as detailed
+-   below.
+ 
+-
+-.. function:: type(name, bases, dict)
+-   :noindex:
+-
+-   Return a new type object.  This is essentially a dynamic form of the
+-   :keyword:`class` statement. The *name* string is the class name and becomes the
+-   :attr:`__name__` attribute; the *bases* tuple itemizes the base classes and
+-   becomes the :attr:`__bases__` attribute; and the *dict* dictionary is the
+-   namespace containing definitions for class body and becomes the :attr:`__dict__`
+-   attribute.  For example, the following two statements create identical
+-   :class:`type` objects:
++   With three arguments, return a new type object.  This is essentially a
++   dynamic form of the :keyword:`class` statement. The *name* string is the
++   class name and becomes the :attr:`__name__` attribute; the *bases* tuple
++   itemizes the base classes and becomes the :attr:`__bases__` attribute;
++   and the *dict* dictionary is the namespace containing definitions for class
++   body and becomes the :attr:`__dict__` attribute.  For example, the
++   following two statements create identical :class:`type` objects:
+ 
+       >>> class X:
+       ...     a = 1
+       ...
+       >>> X = type('X', (object,), dict(a=1))
+ 
++   See also :ref:`bltin-type-objects`.
++
+ 
+ .. function:: vars([object])
+ 
+diff -r bd8afb90ebf2 Doc/library/gc.rst
+--- a/Doc/library/gc.rst
++++ b/Doc/library/gc.rst
+@@ -189,13 +189,13 @@
+    after collection.  The callbacks will be called with two arguments,
+    *phase* and *info*.
+ 
+-   *phase* can one of two values:
++   *phase* can be one of two values:
+ 
+       "start": The garbage collection is about to start.
+ 
+       "stop": The garbage collection has finished.
+ 
+-   *info* provides more information for the callback.  The following
++   *info* is a dict providing more information for the callback.  The following
+    keys are currently defined:
+ 
+       "generation": The oldest generation being collected.
+@@ -203,7 +203,7 @@
+       "collected": When *phase* is "stop", the number of objects
+       successfully collected.
+ 
+-      "uncollectable": when *phase* is "stop", the number of objects
++      "uncollectable": When *phase* is "stop", the number of objects
+       that could not be collected and were put in :data:`garbage`.
+ 
+    Applications can add their own callbacks to this list.  The primary
+diff -r bd8afb90ebf2 Doc/library/glob.rst
+--- a/Doc/library/glob.rst
++++ b/Doc/library/glob.rst
+@@ -19,6 +19,9 @@
+ subshell.  (For tilde and shell variable expansion, use
+ :func:`os.path.expanduser` and :func:`os.path.expandvars`.)
+ 
++For a literal match, wrap the meta-characters in brackets.
++For example, ``'[?]'`` matches the character ``'?'``.
++
+ 
+ .. function:: glob(pathname)
+ 
+diff -r bd8afb90ebf2 Doc/library/gzip.rst
+--- a/Doc/library/gzip.rst
++++ b/Doc/library/gzip.rst
+@@ -38,7 +38,7 @@
+    ``'w'``, or ``'wb'`` for binary mode, or ``'rt'``, ``'at'``, or ``'wt'`` for
+    text mode. The default is ``'rb'``.
+ 
+-   The *compresslevel* argument is an integer from 1 to 9, as for the
++   The *compresslevel* argument is an integer from 0 to 9, as for the
+    :class:`GzipFile` constructor.
+ 
+    For binary mode, this function is equivalent to the :class:`GzipFile`
+@@ -80,9 +80,10 @@
+    in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with an
+    :class:`io.TextIOWrapper`).
+ 
+-   The *compresslevel* argument is an integer from ``1`` to ``9`` controlling the
+-   level of compression; ``1`` is fastest and produces the least compression, and
+-   ``9`` is slowest and produces the most compression.  The default is ``9``.
++   The *compresslevel* argument is an integer from ``0`` to ``9`` controlling
++   the level of compression; ``1`` is fastest and produces the least
++   compression, and ``9`` is slowest and produces the most compression. ``0``
++   is no compression. The default is ``9``.
+ 
+    The *mtime* argument is an optional numeric timestamp to be written to
+    the stream when compressing.  All :program:`gzip` compressed streams are
+diff -r bd8afb90ebf2 Doc/library/hashlib.rst
+--- a/Doc/library/hashlib.rst
++++ b/Doc/library/hashlib.rst
+@@ -40,12 +40,12 @@
+ 
+ .. note::
+ 
+-   For better multithreading performance, the Python GIL is released for
++   For better multithreading performance, the Python :term:`GIL` is released for
+    strings of more than 2047 bytes at object creation or on update.
+ 
+ .. note::
+ 
+-   Feeding string objects is to :meth:`update` is not supported, as hashes work
++   Feeding string objects into :meth:`update` is not supported, as hashes work
+    on bytes, not on characters.
+ 
+ .. index:: single: OpenSSL; (use in module hashlib)
+diff -r bd8afb90ebf2 Doc/library/html.rst
+--- a/Doc/library/html.rst
++++ b/Doc/library/html.rst
+@@ -19,3 +19,10 @@
+    attribute value delimited by quotes, as in ``<a href="...">``.
+ 
+    .. versionadded:: 3.2
++
++--------------
++
++Submodules in the ``html`` package are:
++
++* :mod:`html.parser` -- HTML/XHTML parser with lenient parsing mode
++* :mod:`html.entities` -- HTML entity definitions
+diff -r bd8afb90ebf2 Doc/library/http.client.rst
+--- a/Doc/library/http.client.rst
++++ b/Doc/library/http.client.rst
+@@ -27,7 +27,8 @@
+ The module provides the following classes:
+ 
+ 
+-.. class:: HTTPConnection(host, port=None[, strict[, timeout[, source_address]]])
++.. class:: HTTPConnection(host, port=None[, strict][, timeout], \
++                          source_address=None)
+ 
+    An :class:`HTTPConnection` instance represents one transaction with an HTTP
+    server.  It should be instantiated passing it a host and optional port
+@@ -55,7 +56,10 @@
+       are not supported anymore.
+ 
+ 
+-.. class:: HTTPSConnection(host, port=None, key_file=None, cert_file=None[, strict[, timeout[, source_address]]], *, context=None, check_hostname=None)
++.. class:: HTTPSConnection(host, port=None, key_file=None, \
++                           cert_file=None[, strict][, timeout], \
++                           source_address=None, *, context=None, \
++                           check_hostname=None)
+ 
+    A subclass of :class:`HTTPConnection` that uses SSL for communication with
+    secure servers.  Default port is ``443``.  If *context* is specified, it
+diff -r bd8afb90ebf2 Doc/library/http.rst
+--- /dev/null
++++ b/Doc/library/http.rst
+@@ -0,0 +1,11 @@
++:mod:`http` --- HTTP modules
++============================
++
++``http`` is a package that collects several modules for working with the
++HyperText Transfer Protocol:
++
++* :mod:`http.client` is a low-level HTTP protocol client; for high-level URL
++  opening use :mod:`urllib.request`
++* :mod:`http.server` contains basic HTTP server classes based on :mod:`socketserver`
++* :mod:`http.cookies` has utilities for implementing state management with cookies
++* :mod:`http.cookiejar` provides persistence of cookies
+diff -r bd8afb90ebf2 Doc/library/idle.rst
+--- a/Doc/library/idle.rst
++++ b/Doc/library/idle.rst
+@@ -154,27 +154,77 @@
+ it to the foreground (deiconifying it if necessary).
+ 
+ 
+-Debug menu (in the Python Shell window only)
+-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
++Debug menu
++^^^^^^^^^^
++
++* in the Python Shell window only
+ 
+ Go to file/line
+-   look around the insert point for a filename and linenumber, open the file, and
+-   show the line.
++   Look around the insert point for a filename and line number, open the file,
++   and show the line.  Useful to view the source lines referenced in an
++   exception traceback.
+ 
+-Open stack viewer
+-   show the stack traceback of the last exception
++Debugger
++   Run commands in the shell under the debugger.
+ 
+-Debugger toggle
+-   Run commands in the shell under the debugger
++Stack viewer
++   Show the stack traceback of the last exception.
+ 
+-JIT Stack viewer toggle
+-   Open stack viewer on traceback
++Auto-open Stack Viewer
++   Open stack viewer on traceback.
+ 
+ .. index::
+    single: stack viewer
+    single: debugger
+ 
+ 
++Edit context menu
++^^^^^^^^^^^^^^^^^
++
++* Right-click in Edit window (Control-click on OS X)
++
++Cut
++   Copy selection into system-wide clipboard; then delete selection
++
++Copy
++   Copy selection into system-wide clipboard
++
++Paste
++   Insert system-wide clipboard into window
++
++Set Breakpoint
++   Sets a breakpoint.  Breakpoints are only enabled when the debugger is open.
++
++Clear Breakpoint
++   Clears the breakpoint on that line.
++
++.. index::
++   single: Cut
++   single: Copy
++   single: Paste
++   single: Set Breakpoint
++   single: Clear Breakpoint
++   single: breakpoints
++
++
++Shell context menu
++^^^^^^^^^^^^^^^^^^
++
++* Right-click in Python Shell window (Control-click on OS X)
++
++Cut
++   Copy selection into system-wide clipboard; then delete selection
++
++Copy
++   Copy selection into system-wide clipboard
++
++Paste
++   Insert system-wide clipboard into window
++
++Go to file/line
++   Same as in Debug menu.
++
++
+ Basic editing and navigation
+ ----------------------------
+ 
+diff -r bd8afb90ebf2 Doc/library/imaplib.rst
+--- a/Doc/library/imaplib.rst
++++ b/Doc/library/imaplib.rst
+@@ -75,7 +75,7 @@
+    :class:`ssl.SSLContext` object which allows bundling SSL configuration
+    options, certificates and private keys into a single (potentially long-lived)
+    structure. Note that the *keyfile*/*certfile* parameters are mutually exclusive with *ssl_context*,
+-   a :class:`ValueError` is thrown if *keyfile*/*certfile* is provided along with *ssl_context*.
++   a :class:`ValueError` is raised if *keyfile*/*certfile* is provided along with *ssl_context*.
+ 
+    .. versionchanged:: 3.3
+       *ssl_context* parameter added.
+@@ -185,9 +185,10 @@
+ 
+       data = authobject(response)
+ 
+-   It will be called to process server continuation responses. It should return
+-   ``data`` that will be encoded and sent to server. It should return ``None`` if
+-   the client abort response ``*`` should be sent instead.
++   It will be called to process server continuation responses; the *response*
++   argument it is passed will be ``bytes``.  It should return ``bytes`` *data*
++   that will be base64 encoded and sent to the server.  It should return
++   ``None`` if the client abort response ``*`` should be sent instead.
+ 
+ 
+ .. method:: IMAP4.check()
+diff -r bd8afb90ebf2 Doc/library/importlib.rst
+--- a/Doc/library/importlib.rst
++++ b/Doc/library/importlib.rst
+@@ -94,11 +94,10 @@
+    :exc:`ValueError` is raised). Otherwise a search using :attr:`sys.meta_path`
+    is done. ``None`` is returned if no loader is found.
+ 
+-   A dotted name does not have its parent's implicitly imported. If that is
+-   desired (although not nessarily required to find the loader, it will most
+-   likely be needed if the loader actually is used to load the module), then
+-   you will have to import the packages containing the module prior to calling
+-   this function.
++   A dotted name does not have its parent's implicitly imported as that requires
++   loading them and that may not be desired. To properly import a submodule you
++   will need to import all parent packages of the submodule and use the correct
++   argument to *path*.
+ 
+ .. function:: invalidate_caches()
+ 
+@@ -162,7 +161,7 @@
+ 
+       An abstract method for finding a :term:`loader` for the specified
+       module.  If this is a top-level import, *path* will be ``None``.
+-      Otheriwse, this is a search for a subpackage or module and *path*
++      Otherwise, this is a search for a subpackage or module and *path*
+       will be the value of :attr:`__path__` from the parent
+       package. If a loader cannot be found, ``None`` is returned.
+ 
+@@ -329,7 +328,7 @@
+ .. class:: FileLoader(fullname, path)
+ 
+    An abstract base class which inherits from :class:`ResourceLoader` and
+-   :class:`ExecutionLoader`, providing concreate implementations of
++   :class:`ExecutionLoader`, providing concrete implementations of
+    :meth:`ResourceLoader.get_data` and :meth:`ExecutionLoader.get_filename`.
+ 
+    The *fullname* argument is a fully resolved name of the module the loader is
+diff -r bd8afb90ebf2 Doc/library/index.rst
+--- a/Doc/library/index.rst
++++ b/Doc/library/index.rst
+@@ -4,9 +4,6 @@
+   The Python Standard Library
+ ###############################
+ 
+-:Release: |version|
+-:Date: |today|
+-
+ While :ref:`reference-index` describes the exact syntax and
+ semantics of the Python language, this library reference manual
+ describes the standard library that is distributed with Python. It also
+diff -r bd8afb90ebf2 Doc/library/inspect.rst
+--- a/Doc/library/inspect.rst
++++ b/Doc/library/inspect.rst
+@@ -471,7 +471,7 @@
+       Returns :class:`BoundArguments`, or raises a :exc:`TypeError` if the
+       passed arguments do not match the signature.
+ 
+-   .. method:: Signature.replace([parameters], *, [return_annotation])
++   .. method:: Signature.replace(*[, parameters][, return_annotation])
+ 
+       Create a new Signature instance based on the instance replace was invoked
+       on.  It is possible to pass different ``parameters`` and/or
+@@ -565,7 +565,7 @@
+          ...         print('Parameter:', param)
+          Parameter: c
+ 
+-   .. method:: Parameter.replace(*, [name], [kind], [default], [annotation])
++   .. method:: Parameter.replace(*[, name][, kind][, default][, annotation])
+ 
+       Create a new Parameter instance based on the instance replaced was invoked
+       on.  To override a :class:`Parameter` attribute, pass the corresponding
+@@ -716,7 +716,7 @@
+    locals dictionary of the given frame.
+ 
+ 
+-.. function:: formatargspec(args[, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations, formatarg, formatvarargs, formatvarkw, formatvalue, formatreturns, formatannotations])
++.. function:: formatargspec(args[, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations[, formatarg, formatvarargs, formatvarkw, formatvalue, formatreturns, formatannotations]])
+ 
+    Format a pretty argument spec from the values returned by
+    :func:`getargspec` or :func:`getfullargspec`.
+@@ -725,7 +725,14 @@
+    ``defaults``, ``kwonlyargs``, ``kwonlydefaults``, ``annotations``). The
+    other five arguments are the corresponding optional formatting functions
+    that are called to turn names and values into strings. The last argument
+-   is an optional function to format the sequence of arguments.
++   is an optional function to format the sequence of arguments. For example::
++
++    >>> from inspect import formatargspec, getfullargspec
++    >>> def f(a: int, b: float):
++    ...     pass
++    ...
++    >>> formatargspec(*getfullargspec(f))
++    '(a: int, b: float)'
+ 
+ 
+ .. function:: formatargvalues(args[, varargs, varkw, locals, formatarg, formatvarargs, formatvarkw, formatvalue])
+diff -r bd8afb90ebf2 Doc/library/internet.rst
+--- a/Doc/library/internet.rst
++++ b/Doc/library/internet.rst
+@@ -23,10 +23,12 @@
+    cgi.rst
+    cgitb.rst
+    wsgiref.rst
++   urllib.rst
+    urllib.request.rst
+    urllib.parse.rst
+    urllib.error.rst
+    urllib.robotparser.rst
++   http.rst
+    http.client.rst
+    ftplib.rst
+    poplib.rst
+@@ -40,6 +42,7 @@
+    http.server.rst
+    http.cookies.rst
+    http.cookiejar.rst
++   xmlrpc.rst
+    xmlrpc.client.rst
+    xmlrpc.server.rst
+    ipaddress.rst
+diff -r bd8afb90ebf2 Doc/library/io.rst
+--- a/Doc/library/io.rst
++++ b/Doc/library/io.rst
+@@ -110,7 +110,7 @@
+    :func:`os.stat`) if possible.
+ 
+ 
+-.. function:: open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True)
++.. function:: open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
+ 
+    This is an alias for the builtin :func:`open` function.
+ 
+@@ -185,6 +185,25 @@
+ Argument names are not part of the specification, and only the arguments of
+ :func:`open` are intended to be used as keyword arguments.
+ 
++The following table summarizes the ABCs provided by the :mod:`io` module:
++
++=========================  ==================  ========================  ==================================================
++ABC                        Inherits            Stub Methods              Mixin Methods and Properties
++=========================  ==================  ========================  ==================================================
++:class:`IOBase`                                ``fileno``, ``seek``,     ``close``, ``closed``, ``__enter__``,
++                                               and ``truncate``          ``__exit__``, ``flush``, ``isatty``, ``__iter__``,
++                                                                         ``__next__``, ``readable``, ``readline``,
++                                                                         ``readlines``, ``seekable``, ``tell``,
++                                                                         ``writable``, and ``writelines``
++:class:`RawIOBase`         :class:`IOBase`     ``readinto`` and          Inherited :class:`IOBase` methods, ``read``,
++                                               ``write``                 and ``readall``
++:class:`BufferedIOBase`    :class:`IOBase`     ``detach``, ``read``,     Inherited :class:`IOBase` methods, ``readinto``
++                                               ``read1``, and ``write``
++:class:`TextIOBase`        :class:`IOBase`     ``detach``, ``read``,     Inherited :class:`IOBase` methods, ``encoding``,
++                                               ``readline``, and         ``errors``, and ``newlines``
++                                               ``write``
++=========================  ==================  ========================  ==================================================
++
+ 
+ I/O Base Classes
+ ^^^^^^^^^^^^^^^^
+@@ -213,7 +232,7 @@
+    Note that calling any method (even inquiries) on a closed stream is
+    undefined.  Implementations may raise :exc:`ValueError` in this case.
+ 
+-   :class:`IOBase` (and its subclasses) support the iterator protocol, meaning
++   :class:`IOBase` (and its subclasses) supports the iterator protocol, meaning
+    that an :class:`IOBase` object can be iterated over yielding the lines in a
+    stream.  Lines are defined slightly differently depending on whether the
+    stream is a binary stream (yielding bytes), or a text stream (yielding
+@@ -498,6 +517,9 @@
+    :mod:`os.open` as *opener* results in functionality similar to passing
+    ``None``).
+ 
++   See the :func:`open` built-in function for examples on using the *opener*
++   parameter.
++
+    .. versionchanged:: 3.3
+       The *opener* parameter was added.
+       The ``'x'`` mode was added.
+diff -r bd8afb90ebf2 Doc/library/ipaddress.rst
+--- a/Doc/library/ipaddress.rst
++++ b/Doc/library/ipaddress.rst
+@@ -42,8 +42,15 @@
+    Return an :class:`IPv4Address` or :class:`IPv6Address` object depending on
+    the IP address passed as argument.  Either IPv4 or IPv6 addresses may be
+    supplied; integers less than 2**32 will be considered to be IPv4 by default.
+-   A :exc:`ValueError` is raised if *address* does not represent a valid IPv4 or
+-   IPv6 address.
++   A :exc:`ValueError` is raised if *address* does not represent a valid IPv4
++   or IPv6 address.
++
++.. testsetup::
++   >>> import ipaddress
++   >>> from ipaddress import (ip_network, IPv4Address, IPv4Interface,
++   ...                        IPv4Network)
++
++::
+ 
+    >>> ipaddress.ip_address('192.168.0.1')
+    IPv4Address('192.168.0.1')
+@@ -111,7 +118,7 @@
+ 
+    >>> ipaddress.IPv4Address('192.168.0.1')
+    IPv4Address('192.168.0.1')
+-   >>> ipaddress.IPv4Address(3221225985)
++   >>> ipaddress.IPv4Address(3232235521)
+    IPv4Address('192.168.0.1')
+    >>> ipaddress.IPv4Address(b'\xC0\xA8\x00\x01')
+    IPv4Address('192.168.0.1')
+@@ -437,7 +444,7 @@
+       hosts are all the IP addresses that belong to the network, except the
+       network address itself and the network broadcast address.
+ 
+-         >>> list(ip_network('192.0.2.0/29').hosts())
++         >>> list(ip_network('192.0.2.0/29').hosts())  #doctest: +NORMALIZE_WHITESPACE
+          [IPv4Address('192.0.2.1'), IPv4Address('192.0.2.2'),
+           IPv4Address('192.0.2.3'), IPv4Address('192.0.2.4'),
+           IPv4Address('192.0.2.5'), IPv4Address('192.0.2.6')]
+@@ -456,7 +463,7 @@
+ 
+          >>> n1 = ip_network('192.0.2.0/28')
+          >>> n2 = ip_network('192.0.2.1/32')
+-         >>> list(n1.address_exclude(n2))
++         >>> list(n1.address_exclude(n2))  #doctest: +NORMALIZE_WHITESPACE
+          [IPv4Network('192.0.2.8/29'), IPv4Network('192.0.2.4/30'),
+           IPv4Network('192.0.2.2/31'), IPv4Network('192.0.2.0/32')]
+ 
+@@ -471,10 +478,10 @@
+ 
+          >>> list(ip_network('192.0.2.0/24').subnets())
+          [IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/25')]
+-         >>> list(ip_network('192.0.2.0/24').subnets(prefixlen_diff=2))
++         >>> list(ip_network('192.0.2.0/24').subnets(prefixlen_diff=2))  #doctest: +NORMALIZE_WHITESPACE
+          [IPv4Network('192.0.2.0/26'), IPv4Network('192.0.2.64/26'),
+           IPv4Network('192.0.2.128/26'), IPv4Network('192.0.2.192/26')]
+-         >>> list(ip_network('192.0.2.0/24').subnets(new_prefix=26))
++         >>> list(ip_network('192.0.2.0/24').subnets(new_prefix=26))  #doctest: +NORMALIZE_WHITESPACE
+          [IPv4Network('192.0.2.0/26'), IPv4Network('192.0.2.64/26'),
+           IPv4Network('192.0.2.128/26'), IPv4Network('192.0.2.192/26')]
+          >>> list(ip_network('192.0.2.0/24').subnets(new_prefix=23))
+diff -r bd8afb90ebf2 Doc/library/itertools.rst
+--- a/Doc/library/itertools.rst
++++ b/Doc/library/itertools.rst
+@@ -401,7 +401,8 @@
+                   self.currkey = self.keyfunc(self.currvalue)
+ 
+ 
+-.. function:: islice(iterable, [start,] stop [, step])
++.. function:: islice(iterable, stop)
++              islice(iterable, start, stop[, step])
+ 
+    Make an iterator that returns selected elements from the iterable. If *start* is
+    non-zero, then elements from the iterable are skipped until start is reached.
+diff -r bd8afb90ebf2 Doc/library/json.rst
+--- a/Doc/library/json.rst
++++ b/Doc/library/json.rst
+@@ -42,7 +42,8 @@
+ Pretty printing::
+ 
+     >>> import json
+-    >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4))
++    >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True,
++    ...                  indent=4, separators=(',', ': ')))
+     {
+         "4": 5,
+         "6": 7
+@@ -116,7 +117,10 @@
+ Basic Usage
+ -----------
+ 
+-.. function:: dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, **kw)
++.. function:: dump(obj, fp, skipkeys=False, ensure_ascii=True, \
++                   check_circular=True, allow_nan=True, cls=None, \
++                   indent=None, separators=None, default=None, \
++                   sort_keys=False, **kw)
+ 
+    Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting
+    :term:`file-like object`).
+@@ -146,9 +150,18 @@
+    object members will be pretty-printed with that indent level.  An indent level
+    of 0, negative, or ``""`` will only insert newlines.  ``None`` (the default)
+    selects the most compact representation. Using a positive integer indent
+-   indents that many spaces per level.  If *indent* is a string (such at '\t'),
++   indents that many spaces per level.  If *indent* is a string (such as ``"\t"``),
+    that string is used to indent each level.
+ 
++   .. versionchanged:: 3.2
++      Allow strings for *indent* in addition to integers.
++
++   .. note::
++
++      Since the default item separator is ``', '``,  the output might include
++      trailing whitespace when *indent* is specified.  You can use
++      ``separators=(',', ': ')`` to avoid this.
++
+    If *separators* is an ``(item_separator, dict_separator)`` tuple, then it
+    will be used instead of the default ``(', ', ': ')`` separators.  ``(',',
+    ':')`` is the most compact JSON representation.
+@@ -156,12 +169,18 @@
+    *default(obj)* is a function that should return a serializable version of
+    *obj* or raise :exc:`TypeError`.  The default simply raises :exc:`TypeError`.
+ 
++   If *sort_keys* is ``True`` (default: ``False``), then the output of
++   dictionaries will be sorted by key.
++
+    To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the
+    :meth:`default` method to serialize additional types), specify it with the
+    *cls* kwarg; otherwise :class:`JSONEncoder` is used.
+ 
+ 
+-.. function:: dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, **kw)
++.. function:: dumps(obj, skipkeys=False, ensure_ascii=True, \
++                    check_circular=True, allow_nan=True, cls=None, \
++                    indent=None, separators=None, default=None, \
++                    sort_keys=False, **kw)
+ 
+    Serialize *obj* to a JSON formatted :class:`str`.  The arguments have the
+    same meaning as in :func:`dump`.
+@@ -371,10 +390,21 @@
+    will be sorted by key; this is useful for regression tests to ensure that
+    JSON serializations can be compared on a day-to-day basis.
+ 
+-   If *indent* is a non-negative integer (it is ``None`` by default), then JSON
+-   array elements and object members will be pretty-printed with that indent
+-   level.  An indent level of 0 will only insert newlines.  ``None`` is the most
+-   compact representation.
++   If *indent* is a non-negative integer or string, then JSON array elements and
++   object members will be pretty-printed with that indent level.  An indent level
++   of 0, negative, or ``""`` will only insert newlines.  ``None`` (the default)
++   selects the most compact representation. Using a positive integer indent
++   indents that many spaces per level.  If *indent* is a string (such as ``"\t"``),
++   that string is used to indent each level.
++
++   .. versionchanged:: 3.2
++      Allow strings for *indent* in addition to integers.
++
++   .. note::
++
++      Since the default item separator is ``', '``,  the output might include
++      trailing whitespace when *indent* is specified.  You can use
++      ``separators=(',', ': ')`` to avoid this.
+ 
+    If specified, *separators* should be an ``(item_separator, key_separator)``
+    tuple.  The default is ``(', ', ': ')``.  To get the most compact JSON
+diff -r bd8afb90ebf2 Doc/library/logging.rst
+--- a/Doc/library/logging.rst
++++ b/Doc/library/logging.rst
+@@ -70,16 +70,25 @@
+ 
+ .. attribute:: Logger.propagate
+ 
+-   If this evaluates to true, logging messages are passed by this logger and by
+-   its child loggers to the handlers of higher level (ancestor) loggers.
+-   Messages are passed directly to the ancestor loggers' handlers - neither the
+-   level nor filters of the ancestor loggers in question are considered.
++   If this evaluates to true, events logged to this logger will be passed to the
++   handlers of higher level (ancestor) loggers, in addition to any handlers
++   attached to this logger. Messages are passed directly to the ancestor
++   loggers' handlers - neither the level nor filters of the ancestor loggers in
++   question are considered.
+ 
+    If this evaluates to false, logging messages are not passed to the handlers
+    of ancestor loggers.
+ 
+    The constructor sets this attribute to ``True``.
+ 
++   .. note:: If you attach a handler to a logger *and* one or more of its
++      ancestors, it may emit the same record multiple times. In general, you
++      should not need to attach a handler to more than one logger - if you just
++      attach it to the appropriate logger which is highest in the logger
++      hierarchy, then it will see all events logged by all descendant loggers,
++      provided that their propagate setting is left set to ``True``. A common
++      scenario is to attach handlers only to the root logger, and to let
++      propagation take care of the rest.
+ 
+ .. method:: Logger.setLevel(lvl)
+ 
+@@ -255,7 +264,10 @@
+ .. method:: Logger.filter(record)
+ 
+    Applies this logger's filters to the record and returns a true value if the
+-   record is to be processed.
++   record is to be processed. The filters are consulted in turn, until one of
++   them returns a false value. If none of them return a false value, the record
++   will be processed (passed to handlers). If one returns a false value, no
++   further processing of the record occurs.
+ 
+ 
+ .. method:: Logger.addHandler(hdlr)
+@@ -364,7 +376,10 @@
+ .. method:: Handler.filter(record)
+ 
+    Applies this handler's filters to the record and returns a true value if the
+-   record is to be processed.
++   record is to be processed. The filters are consulted in turn, until one of
++   them returns a false value. If none of them return a false value, the record
++   will be emitted. If one returns a false value, the handler will not emit the
++   record.
+ 
+ 
+ .. method:: Handler.flush()
+@@ -547,12 +562,12 @@
+       yes. If deemed appropriate, the record may be modified in-place by this
+       method.
+ 
+-Note that filters attached to handlers are consulted whenever an event is
++Note that filters attached to handlers are consulted before an event is
+ emitted by the handler, whereas filters attached to loggers are consulted
+-whenever an event is logged to the handler (using :meth:`debug`, :meth:`info`,
+-etc.) This means that events which have been generated by descendant loggers
+-will not be filtered by a logger's filter setting, unless the filter has also
+-been applied to those descendant loggers.
++whenever an event is logged (using :meth:`debug`, :meth:`info`,
++etc.), before sending an event to handlers. This means that events which have
++been generated by descendant loggers will not be filtered by a logger's filter
++setting, unless the filter has also been applied to those descendant loggers.
+ 
+ You don't actually need to subclass ``Filter``: you can pass any instance
+ which has a ``filter`` method with the same semantics.
+@@ -596,7 +611,9 @@
+    record.
+ 
+    :param name:  The name of the logger used to log the event represented by
+-                 this LogRecord.
++                 this LogRecord. Note that this name will always have this
++                 value, even though it may be emitted by a handler attached to
++                 a different (ancestor) logger.
+    :param level: The numeric level of the logging event (one of DEBUG, INFO etc.)
+                  Note that this is converted to *two* attributes of the LogRecord:
+                  ``levelno`` for the numeric value and ``levelname`` for the
+@@ -948,14 +965,14 @@
+    Logs a message with level *level* on the root logger. The other arguments are
+    interpreted as for :func:`debug`.
+ 
+-   PLEASE NOTE: The above module-level functions which delegate to the root
+-   logger should *not* be used in threads, in versions of Python earlier than
+-   2.7.1 and 3.2, unless at least one handler has been added to the root
+-   logger *before* the threads are started. These convenience functions call
+-   :func:`basicConfig` to ensure that at least one handler is available; in
+-   earlier versions of Python, this can (under rare circumstances) lead to
+-   handlers being added multiple times to the root logger, which can in turn
+-   lead to multiple messages for the same event.
++   .. note:: The above module-level functions which delegate to the root
++      logger should *not* be used in threads, in versions of Python earlier
++      than 2.7.1 and 3.2, unless at least one handler has been added to the
++      root logger *before* the threads are started. These convenience functions
++      call :func:`basicConfig` to ensure that at least one handler is
++      available; in earlier versions of Python, this can (under rare
++      circumstances) lead to handlers being added multiple times to the root
++      logger, which can in turn lead to multiple messages for the same event.
+ 
+ .. function:: disable(lvl)
+ 
+@@ -978,8 +995,8 @@
+    registered using this function, levels should be positive integers and they
+    should increase in increasing order of severity.
+ 
+-   NOTE: If you are thinking of defining your own levels, please see the section
+-   on :ref:`custom-levels`.
++   .. note:: If you are thinking of defining your own levels, please see the
++      section on :ref:`custom-levels`.
+ 
+ .. function:: getLevelName(lvl)
+ 
+@@ -1011,12 +1028,12 @@
+    This function does nothing if the root logger already has handlers
+    configured for it.
+ 
+-   PLEASE NOTE: This function should be called from the main thread
+-   before other threads are started. In versions of Python prior to
+-   2.7.1 and 3.2, if this function is called from multiple threads,
+-   it is possible (in rare circumstances) that a handler will be added
+-   to the root logger more than once, leading to unexpected results
+-   such as messages being duplicated in the log.
++   .. note:: This function should be called from the main thread
++      before other threads are started. In versions of Python prior to
++      2.7.1 and 3.2, if this function is called from multiple threads,
++      it is possible (in rare circumstances) that a handler will be added
++      to the root logger more than once, leading to unexpected results
++      such as messages being duplicated in the log.
+ 
+    The following keyword arguments are supported.
+ 
+@@ -1115,6 +1132,21 @@
+       :kwargs: Additional keyword arguments.
+ 
+ 
++Module-Level Attributes
++-----------------------
++
++.. attribute:: lastResort
++
++   A "handler of last resort" is available through this attribute. This
++   is a :class:`StreamHandler` writing to ``sys.stderr`` with a level of
++   ``WARNING``, and is used to handle logging events in the absence of any
++   logging configuration. The end result is to just print the message to
++   ``sys.stderr``. This replaces the earlier error message saying that
++   "no handlers could be found for logger XYZ". If you need the earlier
++   behaviour for some reason, ``lastResort`` can be set to ``None``.
++
++   .. versionadded:: 3.2
++
+ Integration with the warnings module
+ ------------------------------------
+ 
+diff -r bd8afb90ebf2 Doc/library/lzma.rst
+--- a/Doc/library/lzma.rst
++++ b/Doc/library/lzma.rst
+@@ -158,7 +158,7 @@
+       In addition to being more CPU-intensive, compression with higher presets
+       also requires much more memory (and produces output that needs more memory
+       to decompress). With preset ``9`` for example, the overhead for an
+-      :class:`LZMACompressor` object can be as high as 800MiB. For this reason,
++      :class:`LZMACompressor` object can be as high as 800 MiB. For this reason,
+       it is generally best to stick with the default preset.
+ 
+    The *filters* argument (if provided) should be a filter chain specifier.
+@@ -302,8 +302,8 @@
+ 
+    * ``preset``: A compression preset to use as a source of default values for
+      options that are not specified explicitly.
+-   * ``dict_size``: Dictionary size in bytes. This should be between 4KiB and
+-     1.5GiB (inclusive).
++   * ``dict_size``: Dictionary size in bytes. This should be between 4 KiB and
++     1.5 GiB (inclusive).
+    * ``lc``: Number of literal context bits.
+    * ``lp``: Number of literal position bits. The sum ``lc + lp`` must be at
+      most 4.
+@@ -335,15 +335,15 @@
+ Reading in a compressed file::
+ 
+    import lzma
+-   with lzma.LZMAFile("file.xz") as f:
+-      file_content = f.read()
++   with lzma.open("file.xz") as f:
++       file_content = f.read()
+ 
+ Creating a compressed file::
+ 
+    import lzma
+    data = b"Insert Data Here"
+-   with lzma.LZMAFile("file.xz", "w") as f:
+-      f.write(data)
++   with lzma.open("file.xz", "w") as f:
++       f.write(data)
+ 
+ Compressing data in memory::
+ 
+@@ -367,7 +367,7 @@
+    import lzma
+    with open("file.xz", "wb") as f:
+        f.write(b"This data will not be compressed\n")
+-       with lzma.LZMAFile(f, "w") as lzf:
++       with lzma.open(f, "w") as lzf:
+            lzf.write(b"This *will* be compressed\n")
+        f.write(b"Not compressed\n")
+ 
+@@ -378,5 +378,5 @@
+        {"id": lzma.FILTER_DELTA, "dist": 5},
+        {"id": lzma.FILTER_LZMA2, "preset": 7 | lzma.PRESET_EXTREME},
+    ]
+-   with lzma.LZMAFile("file.xz", "w", filters=my_filters) as f:
++   with lzma.open("file.xz", "w", filters=my_filters) as f:
+        f.write(b"blah blah blah")
+diff -r bd8afb90ebf2 Doc/library/mailbox.rst
+--- a/Doc/library/mailbox.rst
++++ b/Doc/library/mailbox.rst
+@@ -10,9 +10,9 @@
+ This module defines two classes, :class:`Mailbox` and :class:`Message`, for
+ accessing and manipulating on-disk mailboxes and the messages they contain.
+ :class:`Mailbox` offers a dictionary-like mapping from keys to messages.
+-:class:`Message` extends the :mod:`email.Message` module's :class:`Message`
+-class with format-specific state and behavior. Supported mailbox formats are
+-Maildir, mbox, MH, Babyl, and MMDF.
++:class:`Message` extends the :mod:`email.message` module's
++:class:`~email.message.Message` class with format-specific state and behavior.
++Supported mailbox formats are Maildir, mbox, MH, Babyl, and MMDF.
+ 
+ 
+ .. seealso::
+@@ -81,7 +81,7 @@
+       it.
+ 
+       Parameter *message* may be a :class:`Message` instance, an
+-      :class:`email.Message.Message` instance, a string, a byte string, or a
++      :class:`email.message.Message` instance, a string, a byte string, or a
+       file-like object (which should be open in binary mode). If *message* is
+       an instance of the
+       appropriate format-specific :class:`Message` subclass (e.g., if it's an
+@@ -112,7 +112,7 @@
+       :exc:`KeyError` exception if no message already corresponds to *key*.
+ 
+       As with :meth:`add`, parameter *message* may be a :class:`Message`
+-      instance, an :class:`email.Message.Message` instance, a string, a byte
++      instance, an :class:`email.message.Message` instance, a string, a byte
+       string, or a file-like object (which should be open in binary mode). If
+       *message* is an
+       instance of the appropriate format-specific :class:`Message` subclass
+@@ -757,11 +757,12 @@
+ 
+ .. class:: Message(message=None)
+ 
+-   A subclass of the :mod:`email.Message` module's :class:`Message`. Subclasses of
+-   :class:`mailbox.Message` add mailbox-format-specific state and behavior.
++   A subclass of the :mod:`email.message` module's
++   :class:`~email.message.Message`. Subclasses of :class:`mailbox.Message` add
++   mailbox-format-specific state and behavior.
+ 
+    If *message* is omitted, the new instance is created in a default, empty state.
+-   If *message* is an :class:`email.Message.Message` instance, its contents are
++   If *message* is an :class:`email.message.Message` instance, its contents are
+    copied; furthermore, any format-specific information is converted insofar as
+    possible if *message* is a :class:`Message` instance. If *message* is a string,
+    a byte string,
+@@ -1267,7 +1268,7 @@
+ 
+       Set the message's visible headers to be the same as the headers in
+       *message*.  Parameter *visible* should be a :class:`Message` instance, an
+-      :class:`email.Message.Message` instance, a string, or a file-like object
++      :class:`email.message.Message` instance, a string, or a file-like object
+       (which should be open in text mode).
+ 
+ 
+diff -r bd8afb90ebf2 Doc/library/markup.rst
+--- a/Doc/library/markup.rst
++++ b/Doc/library/markup.rst
+@@ -9,20 +9,13 @@
+ Language (SGML) and the Hypertext Markup Language (HTML), and several interfaces
+ for working with the Extensible Markup Language (XML).
+ 
+-It is important to note that modules in the :mod:`xml` package require that
+-there be at least one SAX-compliant XML parser available. The Expat parser is
+-included with Python, so the :mod:`xml.parsers.expat` module will always be
+-available.
+-
+-The documentation for the :mod:`xml.dom` and :mod:`xml.sax` packages are the
+-definition of the Python bindings for the DOM and SAX interfaces.
+-
+ 
+ .. toctree::
+ 
+    html.rst
+    html.parser.rst
+    html.entities.rst
++   xml.rst
+    xml.etree.elementtree.rst
+    xml.dom.rst
+    xml.dom.minidom.rst
+diff -r bd8afb90ebf2 Doc/library/math.rst
+--- a/Doc/library/math.rst
++++ b/Doc/library/math.rst
+@@ -4,6 +4,9 @@
+ .. module:: math
+    :synopsis: Mathematical functions (sin() etc.).
+ 
++.. testsetup::
++
++   from math import fsum
+ 
+ This module is always available.  It provides access to the mathematical
+ functions defined by the C standard.
+diff -r bd8afb90ebf2 Doc/library/multiprocessing.rst
+--- a/Doc/library/multiprocessing.rst
++++ b/Doc/library/multiprocessing.rst
+@@ -29,7 +29,7 @@
+     Functionality within this package requires that the ``__main__`` module be
+     importable by the children. This is covered in :ref:`multiprocessing-programming`
+     however it is worth pointing out here. This means that some examples, such
+-    as the :class:`multiprocessing.Pool` examples will not work in the
++    as the :class:`multiprocessing.pool.Pool` examples will not work in the
+     interactive interpreter. For example::
+ 
+         >>> from multiprocessing import Pool
+@@ -279,7 +279,7 @@
+        return x*x
+ 
+    if __name__ == '__main__':
+-       with Pool(processes=4) as pool         # start 4 worker processes
++       with Pool(processes=4) as pool:        # start 4 worker processes
+            result = pool.apply_async(f, [10]) # evaluate "f(10)" asynchronously
+            print(result.get(timeout=1))       # prints "100" unless your computer is *very* slow
+            print(pool.map(f, range(10)))      # prints "[0, 1, 4,..., 81]"
+@@ -295,7 +295,8 @@
+ :class:`Process` and exceptions
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+-.. class:: Process([group[, target[, name[, args[, kwargs]]]]], *, daemon=None)
++.. class:: Process(group=None, target=None, name=None, args=(), kwargs={}, \
++                   *, daemon=None)
+ 
+    Process objects represent activity that is run in a separate process. The
+    :class:`Process` class has equivalents of all the methods of
+@@ -915,7 +916,7 @@
+ 
+ .. class:: Condition([lock])
+ 
+-   A condition variable: a clone of :class:`threading.Condition`.
++   A condition variable: an alias for :class:`threading.Condition`.
+ 
+    If *lock* is specified then it should be a :class:`Lock` or :class:`RLock`
+    object from :mod:`multiprocessing`.
+@@ -1147,7 +1148,7 @@
+ 
+        n = Value('i', 7)
+        x = Value(c_double, 1.0/3.0, lock=False)
+-       s = Array('c', 'hello world', lock=lock)
++       s = Array('c', b'hello world', lock=lock)
+        A = Array(Point, [(1.875,-6.25), (-5.75,2.0), (2.375,9.5)], lock=lock)
+ 
+        p = Process(target=modify, args=(n, x, s, A))
+@@ -1637,7 +1638,7 @@
+ One can create a pool of processes which will carry out tasks submitted to it
+ with the :class:`Pool` class.
+ 
+-.. class:: multiprocessing.Pool([processes[, initializer[, initargs[, maxtasksperchild]]]])
++.. class:: Pool([processes[, initializer[, initargs[, maxtasksperchild]]]])
+ 
+    A process pool object which controls a pool of worker processes to which jobs
+    can be submitted.  It supports asynchronous results with timeouts and
+diff -r bd8afb90ebf2 Doc/library/nntplib.rst
+--- a/Doc/library/nntplib.rst
++++ b/Doc/library/nntplib.rst
+@@ -487,10 +487,10 @@
+ them have been superseded by newer commands in :rfc:`3977`.
+ 
+ 
+-.. method:: NNTP.xhdr(header, string, *, file=None)
++.. method:: NNTP.xhdr(hdr, str, *, file=None)
+ 
+-   Send an ``XHDR`` command.  The *header* argument is a header keyword, e.g.
+-   ``'subject'``.  The *string* argument should have the form ``'first-last'``
++   Send an ``XHDR`` command.  The *hdr* argument is a header keyword, e.g.
++   ``'subject'``.  The *str* argument should have the form ``'first-last'``
+    where *first* and *last* are the first and last article numbers to search.
+    Return a pair ``(response, list)``, where *list* is a list of pairs ``(id,
+    text)``, where *id* is an article number (as a string) and *text* is the text of
+diff -r bd8afb90ebf2 Doc/library/optparse.rst
+--- a/Doc/library/optparse.rst
++++ b/Doc/library/optparse.rst
+@@ -273,7 +273,8 @@
+ strings as you like (including zero), as long as there is at least one option
+ string overall.
+ 
+-The option strings passed to :meth:`add_option` are effectively labels for the
++The option strings passed to :meth:`OptionParser.add_option` are effectively
++labels for the
+ option defined by that call.  For brevity, we will frequently refer to
+ *encountering an option* on the command line; in reality, :mod:`optparse`
+ encounters *option strings* and looks up options from them.
+@@ -892,7 +893,8 @@
+ The canonical way to create an :class:`Option` instance is with the
+ :meth:`add_option` method of :class:`OptionParser`.
+ 
+-.. method:: OptionParser.add_option(opt_str[, ...], attr=value, ...)
++.. method:: OptionParser.add_option(option)
++            OptionParser.add_option(*opt_str, attr=value, ...)
+ 
+    To define an option with only a short option string::
+ 
+@@ -1165,6 +1167,17 @@
+ 
+      options.tracks.append(int("4"))
+ 
++  The ``append`` action calls the ``append`` method on the current value of the
++  option.  This means that any default value specified must have an ``append``
++  method.  It also means that if the default value is non-empty, the default
++  elements will be present in the parsed value for the option, with any values
++  from the command line appended after those default values::
++
++     >>> parser.add_option("--files", action="append", default=['~/.mypkg/defaults'])
++     >>> opts, args = parser.parse_args(['--files', 'overrides.mypkg'])
++     >>> opts.files
++     ['~/.mypkg/defaults', 'overrides.mypkg']
++
+ * ``"append_const"`` [required: :attr:`~Option.const`; relevant:
+   :attr:`~Option.dest`]
+ 
+diff -r bd8afb90ebf2 Doc/library/os.path.rst
+--- a/Doc/library/os.path.rst
++++ b/Doc/library/os.path.rst
+@@ -17,6 +17,11 @@
+ names on Windows (in the standard ``mbcs`` encoding), hence Windows
+ applications should use string objects to access all files.
+ 
++Unlike a unix shell, Python does not do any *automatic* path expansions.
++Functions such as :func:`expanduser` and :func:`expandvars` can be invoked
++explicitly when an application desires shell-like path expansion.  (See also
++the :mod:`glob` module.)
++
+ .. note::
+ 
+    All of these functions accept either only bytes or only string objects as
+@@ -43,13 +48,15 @@
+ .. function:: abspath(path)
+ 
+    Return a normalized absolutized version of the pathname *path*. On most
+-   platforms, this is equivalent to ``normpath(join(os.getcwd(), path))``.
++   platforms, this is equivalent to calling the function :func:`normpath` as
++   follows: ``normpath(join(os.getcwd(), path))``.
+ 
+ 
+ .. function:: basename(path)
+ 
+-   Return the base name of pathname *path*.  This is the second half of the pair
+-   returned by ``split(path)``.  Note that the result of this function is different
++   Return the base name of pathname *path*.  This is the second element of the
++   pair returned by passing *path* to the function :func:`split`.  Note that
++   the result of this function is different
+    from the Unix :program:`basename` program; where :program:`basename` for
+    ``'/foo/bar/'`` returns ``'bar'``, the :func:`basename` function returns an
+    empty string (``''``).
+@@ -64,8 +71,8 @@
+ 
+ .. function:: dirname(path)
+ 
+-   Return the directory name of pathname *path*.  This is the first half of the
+-   pair returned by ``split(path)``.
++   Return the directory name of pathname *path*.  This is the first element of
++   the pair returned by passing *path* to the function :func:`split`.
+ 
+ 
+ .. function:: exists(path)
+@@ -124,7 +131,7 @@
+ 
+    Return the time of last access of *path*.  The return value is a number giving
+    the number of seconds since the epoch (see the  :mod:`time` module).  Raise
+-   :exc:`os.error` if the file does not exist or is inaccessible.
++   :exc:`OSError` if the file does not exist or is inaccessible.
+ 
+    If :func:`os.stat_float_times` returns True, the result is a floating point
+    number.
+@@ -134,7 +141,7 @@
+ 
+    Return the time of last modification of *path*.  The return value is a number
+    giving the number of seconds since the epoch (see the  :mod:`time` module).
+-   Raise :exc:`os.error` if the file does not exist or is inaccessible.
++   Raise :exc:`OSError` if the file does not exist or is inaccessible.
+ 
+    If :func:`os.stat_float_times` returns True, the result is a floating point
+    number.
+@@ -145,13 +152,13 @@
+    Return the system's ctime which, on some systems (like Unix) is the time of the
+    last change, and, on others (like Windows), is the creation time for *path*.
+    The return value is a number giving the number of seconds since the epoch (see
+-   the  :mod:`time` module).  Raise :exc:`os.error` if the file does not exist or
++   the  :mod:`time` module).  Raise :exc:`OSError` if the file does not exist or
+    is inaccessible.
+ 
+ 
+ .. function:: getsize(path)
+ 
+-   Return the size, in bytes, of *path*.  Raise :exc:`os.error` if the file does
++   Return the size, in bytes, of *path*.  Raise :exc:`OSError` if the file does
+    not exist or is inaccessible.
+ 
+ 
+@@ -282,7 +289,8 @@
+    *path* is empty, both *head* and *tail* are empty.  Trailing slashes are
+    stripped from *head* unless it is the root (one or more slashes only).  In
+    all cases, ``join(head, tail)`` returns a path to the same location as *path*
+-   (but the strings may differ).
++   (but the strings may differ).  Also see the functions :func:`dirname` and
++   :func:`basename`.
+ 
+ 
+ .. function:: splitdrive(path)
+diff -r bd8afb90ebf2 Doc/library/os.rst
+--- a/Doc/library/os.rst
++++ b/Doc/library/os.rst
+@@ -105,7 +105,7 @@
+ 
+ .. data:: environ
+ 
+-   A mapping object representing the string environment. For example,
++   A :term:`mapping` object representing the string environment. For example,
+    ``environ['HOME']`` is the pathname of your home directory (on some platforms),
+    and is equivalent to ``getenv("HOME")`` in C.
+ 
+@@ -145,7 +145,7 @@
+ 
+ .. data:: environb
+ 
+-   Bytes version of :data:`environ`: a mapping object representing the
++   Bytes version of :data:`environ`: a :term:`mapping` object representing the
+    environment as byte strings. :data:`environ` and :data:`environb` are
+    synchronized (modify :data:`environb` updates :data:`environ`, and vice
+    versa).
+@@ -1171,7 +1171,7 @@
+    output) specifies which file descriptor should be queried.
+ 
+    If the file descriptor is not connected to a terminal, an :exc:`OSError`
+-   is thrown.
++   is raised.
+ 
+    :func:`shutil.get_terminal_size` is the high-level function which
+    should normally be used, ``os.get_terminal_size`` is the low-level
+@@ -1555,18 +1555,21 @@
+       single: UNC paths; and os.makedirs()
+ 
+    Recursive directory creation function.  Like :func:`mkdir`, but makes all
+-   intermediate-level directories needed to contain the leaf directory.  If
+-   the target directory with the same mode as specified already exists,
+-   raises an :exc:`OSError` exception if *exist_ok* is False, otherwise no
+-   exception is raised.  If the directory cannot be created in other cases,
+-   raises an :exc:`OSError` exception.  The default *mode* is ``0o777`` (octal).
+-   On some systems, *mode* is ignored.  Where it is used, the current umask
+-   value is first masked out.
++   intermediate-level directories needed to contain the leaf directory.
++
++   The default *mode* is ``0o777`` (octal).  On some systems, *mode* is
++   ignored.  Where it is used, the current umask value is first masked out.
++
++   If *exists_ok* is ``False`` (the default), an :exc:`OSError` is raised if
++   the target directory already exists.  If *exists_ok* is ``True`` an
++   :exc:`OSError` is still raised if the umask-masked *mode* is different from
++   the existing mode, on systems where the mode is used.  :exc:`OSError` will
++   also be raised if the directory creation fails.
+ 
+    .. note::
+ 
+       :func:`makedirs` will become confused if the path elements to create
+-      include :data:`pardir`.
++      include :data:`pardir` (eg. ".." on UNIX systems).
+ 
+    This function handles UNC paths correctly.
+ 
+@@ -1855,9 +1858,8 @@
+    :attr:`st_mtime`, :attr:`st_ctime`. More items may be added at the end by
+    some implementations.
+ 
+-   This function can support :ref:`specifying a file descriptor
+-   <path_fd>`, :ref:`specifying a file descriptor <path_fd>` and :ref:`not
+-   following symlinks <follow_symlinks>`.
++   This function can support :ref:`specifying a file descriptor <path_fd>` and
++   :ref:`not following symlinks <follow_symlinks>`.
+ 
+    .. index:: module: stat
+ 
+@@ -1943,7 +1945,7 @@
+    :mod:`os` module permit use of their *dir_fd* parameter.  Different platforms
+    provide different functionality, and an option that might work on one might
+    be unsupported on another.  For consistency's sakes, functions that support
+-   *dir_fd* always allow specifying the parameter, but will throw an exception
++   *dir_fd* always allow specifying the parameter, but will raise an exception
+    if the functionality is not actually available.
+ 
+    To check whether a particular function permits use of its *dir_fd*
+@@ -1984,7 +1986,7 @@
+    descriptor.  Different platforms provide different functionality, and an
+    option that might work on one might be unsupported on another.  For
+    consistency's sakes, functions that support *fd* always allow specifying
+-   the parameter, but will throw an exception if the functionality is not
++   the parameter, but will raise an exception if the functionality is not
+    actually available.
+ 
+    To check whether a particular function permits specifying an open file
+@@ -2005,7 +2007,7 @@
+    platforms provide different functionality, and an option that might work on
+    one might be unsupported on another.  For consistency's sakes, functions that
+    support *follow_symlinks* always allow specifying the parameter, but will
+-   throw an exception if the functionality is not actually available.
++   raise an exception if the functionality is not actually available.
+ 
+    To check whether a particular function permits use of its *follow_symlinks*
+    parameter, use the ``in`` operator on ``supports_follow_symlinks``.  As an
+@@ -2327,7 +2329,7 @@
+ .. data:: XATTR_SIZE_MAX
+ 
+    The maximum size the value of an extended attribute can be. Currently, this
+-   is 64 kilobytes on Linux.
++   is 64 KiB on Linux.
+ 
+ 
+ .. data:: XATTR_CREATE
+@@ -2923,7 +2925,7 @@
+    with :const:`P_NOWAIT` return suitable process handles.
+ 
+ 
+-.. function:: wait3([options])
++.. function:: wait3(options)
+ 
+    Similar to :func:`waitpid`, except no process id argument is given and a
+    3-element tuple containing the child's process id, exit status indication, and
+@@ -3307,3 +3309,6 @@
+    though its exact quality depends on the OS implementation.  On a Unix-like
+    system this will query /dev/urandom, and on Windows it will use CryptGenRandom.
+    If a randomness source is not found, :exc:`NotImplementedError` will be raised.
++
++   For an easy-to-use interface to the random number generator
++   provided by your platform, please see :class:`random.SystemRandom`.
+diff -r bd8afb90ebf2 Doc/library/ossaudiodev.rst
+--- a/Doc/library/ossaudiodev.rst
++++ b/Doc/library/ossaudiodev.rst
+@@ -67,7 +67,8 @@
+    ``ossaudiodev.error``.)
+ 
+ 
+-.. function:: open([device, ]mode)
++.. function:: open(mode)
++              open(device, mode)
+ 
+    Open an audio device and return an OSS audio device object.  This object
+    supports many file-like methods, such as :meth:`read`, :meth:`write`, and
+diff -r bd8afb90ebf2 Doc/library/pickle.rst
+--- a/Doc/library/pickle.rst
++++ b/Doc/library/pickle.rst
+@@ -390,8 +390,9 @@
+ 
+ * classes that are defined at the top level of a module
+ 
+-* instances of such classes whose :attr:`__dict__` or :meth:`__setstate__` is
+-  picklable  (see section :ref:`pickle-inst` for details)
++* instances of such classes whose :attr:`__dict__` or the result of calling
++  :meth:`__getstate__` is picklable  (see section :ref:`pickle-inst` for
++  details).
+ 
+ Attempts to pickle unpicklable objects will raise the :exc:`PicklingError`
+ exception; when this happens, an unspecified number of bytes may have already
+@@ -402,8 +403,8 @@
+ 
+ Note that functions (built-in and user-defined) are pickled by "fully qualified"
+ name reference, not by value.  This means that only the function name is
+-pickled, along with the name of the module the function is defined in.  Neither the
+-function's code, nor any of its function attributes are pickled.  Thus the
++pickled, along with the name of the module the function is defined in.  Neither
++the function's code, nor any of its function attributes are pickled.  Thus the
+ defining module must be importable in the unpickling environment, and the module
+ must contain the named object, otherwise an exception will be raised. [#]_
+ 
+diff -r bd8afb90ebf2 Doc/library/poplib.rst
+--- a/Doc/library/poplib.rst
++++ b/Doc/library/poplib.rst
+@@ -24,7 +24,7 @@
+ mailserver supports IMAP, you would be better off using the
+ :class:`imaplib.IMAP4` class, as IMAP servers tend to be better implemented.
+ 
+-A single class is provided by the :mod:`poplib` module:
++The :mod:`poplib` module provides two classes:
+ 
+ 
+ .. class:: POP3(host, port=POP3_PORT[, timeout])
+@@ -105,7 +105,7 @@
+ .. method:: POP3.pass_(password)
+ 
+    Send password, response includes message count and mailbox size. Note: the
+-   mailbox on the server is locked until :meth:`quit` is called.
++   mailbox on the server is locked until :meth:`~poplib.quit` is called.
+ 
+ 
+ .. method:: POP3.apop(user, secret)
+diff -r bd8afb90ebf2 Doc/library/posix.rst
+--- a/Doc/library/posix.rst
++++ b/Doc/library/posix.rst
+@@ -37,7 +37,7 @@
+ .. sectionauthor:: Steve Clift <clift@mail.anacapa.net>
+ 
+ Several operating systems (including AIX, HP-UX, Irix and Solaris) provide
+-support for files that are larger than 2 GB from a C programming model where
++support for files that are larger than 2 GiB from a C programming model where
+ :c:type:`int` and :c:type:`long` are 32-bit values. This is typically accomplished
+ by defining the relevant size and offset types as 64-bit values. Such files are
+ sometimes referred to as :dfn:`large files`.
+diff -r bd8afb90ebf2 Doc/library/profile.rst
+--- a/Doc/library/profile.rst
++++ b/Doc/library/profile.rst
+@@ -240,11 +240,12 @@
+         43/3    0.533    0.012    0.749    0.250 pobject.py:99(evaluate)
+        ...
+ 
+-   The first line indicates that 2706 calls were monitored.  Of those calls, 2004
+-   were :dfn:`primitive`.  We define :dfn:`primitive` to mean that the call was not
+-   induced via recursion. The next line: ``Ordered by: standard name``, indicates
+-   that the text string in the far right column was used to sort the output. The
+-   column headings include:
++   The first line indicates that 2706 calls were monitored.  Of those
++   calls, 2004 were :dfn:`primitive`.  We define :dfn:`primitive` to
++   mean that the call was not induced via recursion. The next line:
++   ``Ordered by: standard name``, indicates that the text string in
++   the far right column was used to sort the output. The column
++   headings include:
+ 
+    ncalls
+       for the number of calls,
+@@ -266,14 +267,14 @@
+    filename:lineno(function)
+       provides the respective data of each function
+ 
+-   When there are two numbers in the first column (for example, ``43/3``), then the
+-   latter is the number of primitive calls, and the former is the actual number of
+-   calls.  Note that when the function does not recurse, these two values are the
+-   same, and only the single figure is printed.
++   When there are two numbers in the first column (for example,
++   ``43/3``), then the latter is the number of primitive calls, and
++   the former is the actual number of calls.  Note that when the
++   function does not recurse, these two values are the same, and only
++   the single figure is printed.
+ 
+-   If *sort* is given, it can be one of ``'stdname'`` (sort by filename:lineno),
+-   ``'calls'`` (sort by number of calls), ``'time'`` (sort by total time) or
+-   ``'cumulative'`` (sort by cumulative time).  The default is ``'stdname'``.
++   If *sort* is given, it can be one of values allowed for *key*
++   parameter from :meth:`pstats.Stats.sort_stats`.
+ 
+ 
+ .. function:: runctx(command, globals, locals, filename=None)
+@@ -291,19 +292,22 @@
+ 
+ .. class:: Stats(*filenames, stream=sys.stdout)
+ 
+-   This class constructor creates an instance of a "statistics object" from a
+-   *filename* (or set of filenames).  :class:`Stats` objects are manipulated by
+-   methods, in order to print useful reports.  You may specify an alternate output
+-   stream by giving the keyword argument, ``stream``.
++   This class constructor creates an instance of a "statistics object"
++   from a *filename* (or set of filenames).  :class:`Stats` objects
++   are manipulated by methods, in order to print useful reports.  You
++   may specify an alternate output stream by giving the keyword
++   argument, ``stream``.
+ 
+-   The file selected by the above constructor must have been created by the
+-   corresponding version of :mod:`profile` or :mod:`cProfile`.  To be specific,
+-   there is *no* file compatibility guaranteed with future versions of this
+-   profiler, and there is no compatibility with files produced by other profilers.
+-   If several files are provided, all the statistics for identical functions will
+-   be coalesced, so that an overall view of several processes can be considered in
+-   a single report.  If additional files need to be combined with data in an
+-   existing :class:`Stats` object, the :meth:`add` method can be used.
++   The file selected by the above constructor must have been created
++   by the corresponding version of :mod:`profile` or :mod:`cProfile`.
++   To be specific, there is *no* file compatibility guaranteed with
++   future versions of this profiler, and there is no compatibility
++   with files produced by other profilers.  If several files are
++   provided, all the statistics for identical functions will be
++   coalesced, so that an overall view of several processes can be
++   considered in a single report.  If additional files need to be
++   combined with data in an existing :class:`Stats` object, the
++   :meth:`add` method can be used.
+ 
+    .. (such as the old system profiler).
+ 
+@@ -318,15 +322,17 @@
+ 
+ .. method:: Stats.strip_dirs()
+ 
+-   This method for the :class:`Stats` class removes all leading path information
+-   from file names.  It is very useful in reducing the size of the printout to fit
+-   within (close to) 80 columns.  This method modifies the object, and the stripped
+-   information is lost.  After performing a strip operation, the object is
+-   considered to have its entries in a "random" order, as it was just after object
+-   initialization and loading.  If :meth:`strip_dirs` causes two function names to
+-   be indistinguishable (they are on the same line of the same filename, and have
+-   the same function name), then the statistics for these two entries are
+-   accumulated into a single entry.
++   This method for the :class:`Stats` class removes all leading path
++   information from file names.  It is very useful in reducing the
++   size of the printout to fit within (close to) 80 columns.  This
++   method modifies the object, and the stripped information is lost.
++   After performing a strip operation, the object is considered to
++   have its entries in a "random" order, as it was just after object
++   initialization and loading.  If :meth:`strip_dirs` causes two
++   function names to be indistinguishable (they are on the same line
++   of the same filename, and have the same function name), then the
++   statistics for these two entries are accumulated into a single
++   entry.
+ 
+ 
+ .. method:: Stats.add(*filenames)
+@@ -340,23 +346,25 @@
+ 
+ .. method:: Stats.dump_stats(filename)
+ 
+-   Save the data loaded into the :class:`Stats` object to a file named *filename*.
+-   The file is created if it does not exist, and is overwritten if it already
+-   exists.  This is equivalent to the method of the same name on the
+-   :class:`profile.Profile` and :class:`cProfile.Profile` classes.
++   Save the data loaded into the :class:`Stats` object to a file named
++   *filename*.  The file is created if it does not exist, and is
++   overwritten if it already exists.  This is equivalent to the method
++   of the same name on the :class:`profile.Profile` and
++   :class:`cProfile.Profile` classes.
+ 
+ 
+ .. method:: Stats.sort_stats(*keys)
+ 
+-   This method modifies the :class:`Stats` object by sorting it according to the
+-   supplied criteria.  The argument is typically a string identifying the basis of
+-   a sort (example: ``'time'`` or ``'name'``).
++   This method modifies the :class:`Stats` object by sorting it
++   according to the supplied criteria.  The argument is typically a
++   string identifying the basis of a sort (example: ``'time'`` or
++   ``'name'``).
+ 
+-   When more than one key is provided, then additional keys are used as secondary
+-   criteria when there is equality in all keys selected before them.  For example,
+-   ``sort_stats('name', 'file')`` will sort all the entries according to their
+-   function name, and resolve all ties (identical function names) by sorting by
+-   file name.
++   When more than one key is provided, then additional keys are used
++   as secondary criteria when there is equality in all keys selected
++   before them.  For example, ``sort_stats('name', 'file')`` will sort
++   all the entries according to their function name, and resolve all
++   ties (identical function names) by sorting by file name.
+ 
+    Abbreviations can be used for any key names, as long as the abbreviation is
+    unambiguous.  The following are the keys currently defined:
+@@ -368,10 +376,16 @@
+    +------------------+----------------------+
+    | ``'cumulative'`` | cumulative time      |
+    +------------------+----------------------+
++   | ``'cumtime'``    | cumulative time      |
++   +------------------+----------------------+
+    | ``'file'``       | file name            |
+    +------------------+----------------------+
++   | ``'filename'``   | file name            |
++   +------------------+----------------------+
+    | ``'module'``     | file name            |
+    +------------------+----------------------+
++   | ``'ncalls'``     | call count           |
++   +------------------+----------------------+
+    | ``'pcalls'``     | primitive call count |
+    +------------------+----------------------+
+    | ``'line'``       | line number          |
+@@ -384,51 +398,60 @@
+    +------------------+----------------------+
+    | ``'time'``       | internal time        |
+    +------------------+----------------------+
++   | ``'tottime'``    | internal time        |
++   +------------------+----------------------+
+ 
+-   Note that all sorts on statistics are in descending order (placing most time
+-   consuming items first), where as name, file, and line number searches are in
+-   ascending order (alphabetical). The subtle distinction between ``'nfl'`` and
+-   ``'stdname'`` is that the standard name is a sort of the name as printed, which
+-   means that the embedded line numbers get compared in an odd way.  For example,
+-   lines 3, 20, and 40 would (if the file names were the same) appear in the string
+-   order 20, 3 and 40.  In contrast, ``'nfl'`` does a numeric compare of the line
+-   numbers.  In fact, ``sort_stats('nfl')`` is the same as ``sort_stats('name',
+-   'file', 'line')``.
++   Note that all sorts on statistics are in descending order (placing
++   most time consuming items first), where as name, file, and line
++   number searches are in ascending order (alphabetical). The subtle
++   distinction between ``'nfl'`` and ``'stdname'`` is that the
++   standard name is a sort of the name as printed, which means that
++   the embedded line numbers get compared in an odd way.  For example,
++   lines 3, 20, and 40 would (if the file names were the same) appear
++   in the string order 20, 3 and 40.  In contrast, ``'nfl'`` does a
++   numeric compare of the line numbers.  In fact,
++   ``sort_stats('nfl')`` is the same as ``sort_stats('name', 'file',
++   'line')``.
+ 
+-   For backward-compatibility reasons, the numeric arguments ``-1``, ``0``, ``1``,
+-   and ``2`` are permitted.  They are interpreted as ``'stdname'``, ``'calls'``,
+-   ``'time'``, and ``'cumulative'`` respectively.  If this old style format
+-   (numeric) is used, only one sort key (the numeric key) will be used, and
+-   additional arguments will be silently ignored.
++   For backward-compatibility reasons, the numeric arguments ``-1``,
++   ``0``, ``1``, and ``2`` are permitted.  They are interpreted as
++   ``'stdname'``, ``'calls'``, ``'time'``, and ``'cumulative'``
++   respectively.  If this old style format (numeric) is used, only one
++   sort key (the numeric key) will be used, and additional arguments
++   will be silently ignored.
+ 
+    .. For compatibility with the old profiler,
+ 
+ 
+ .. method:: Stats.reverse_order()
+ 
+-   This method for the :class:`Stats` class reverses the ordering of the basic list
+-   within the object.  Note that by default ascending vs descending order is
+-   properly selected based on the sort key of choice.
++   This method for the :class:`Stats` class reverses the ordering of
++   the basic list within the object.  Note that by default ascending
++   vs descending order is properly selected based on the sort key of
++   choice.
+ 
+    .. This method is provided primarily for compatibility with the old profiler.
+ 
+ 
+ .. method:: Stats.print_stats(*restrictions)
+ 
+-   This method for the :class:`Stats` class prints out a report as described in the
+-   :func:`profile.run` definition.
++   This method for the :class:`Stats` class prints out a report as
++   described in the :func:`profile.run` definition.
+ 
+-   The order of the printing is based on the last :meth:`sort_stats` operation done
+-   on the object (subject to caveats in :meth:`add` and :meth:`strip_dirs`).
++   The order of the printing is based on the last :meth:`sort_stats`
++   operation done on the object (subject to caveats in :meth:`add` and
++   :meth:`strip_dirs`).
+ 
+-   The arguments provided (if any) can be used to limit the list down to the
+-   significant entries.  Initially, the list is taken to be the complete set of
+-   profiled functions.  Each restriction is either an integer (to select a count of
+-   lines), or a decimal fraction between 0.0 and 1.0 inclusive (to select a
+-   percentage of lines), or a regular expression (to pattern match the standard
+-   name that is printed; as of Python 1.5b1, this uses the Perl-style regular
+-   expression syntax defined by the :mod:`re` module).  If several restrictions are
+-   provided, then they are applied sequentially.  For example::
++   The arguments provided (if any) can be used to limit the list down
++   to the significant entries.  Initially, the list is taken to be the
++   complete set of profiled functions.  Each restriction is either an
++   integer (to select a count of lines), or a decimal fraction between
++   0.0 and 1.0 inclusive (to select a percentage of lines), or a
++   regular expression (to pattern match the standard name that is
++   printed; as of Python 1.5b1, this uses the Perl-style regular
++   expression syntax defined by the :mod:`re` module).  If several
++   restrictions are provided, then they are applied sequentially.  For
++   example::
+ 
+       print_stats(.1, 'foo:')
+ 
+@@ -455,17 +478,19 @@
+      non-parenthesized number repeats the cumulative time spent in the function
+      at the right.
+ 
+-   * With :mod:`cProfile`, each caller is preceded by three numbers: the number of
+-     times this specific call was made, and the total and cumulative times spent in
+-     the current function while it was invoked by this specific caller.
++   * With :mod:`cProfile`, each caller is preceded by three numbers:
++     the number of times this specific call was made, and the total
++     and cumulative times spent in the current function while it was
++     invoked by this specific caller.
+ 
+ 
+ .. method:: Stats.print_callees(*restrictions)
+ 
+-   This method for the :class:`Stats` class prints a list of all function that were
+-   called by the indicated function.  Aside from this reversal of direction of
+-   calls (re: called vs was called by), the arguments and ordering are identical to
+-   the :meth:`print_callers` method.
++   This method for the :class:`Stats` class prints a list of all
++   function that were called by the indicated function.  Aside from
++   this reversal of direction of calls (re: called vs was called by),
++   the arguments and ordering are identical to the
++   :meth:`print_callers` method.
+ 
+ 
+ .. _profile-limits:
+@@ -566,29 +591,33 @@
+ The resulting profiler will then call :func:`your_time_func`.
+ 
+ :class:`profile.Profile`
+-   :func:`your_time_func` should return a single number, or a list of numbers whose
+-   sum is the current time (like what :func:`os.times` returns).  If the function
+-   returns a single time number, or the list of returned numbers has length 2, then
+-   you will get an especially fast version of the dispatch routine.
++   :func:`your_time_func` should return a single number, or a list of
++   numbers whose sum is the current time (like what :func:`os.times`
++   returns).  If the function returns a single time number, or the
++   list of returned numbers has length 2, then you will get an
++   especially fast version of the dispatch routine.
+ 
+-   Be warned that you should calibrate the profiler class for the timer function
+-   that you choose.  For most machines, a timer that returns a lone integer value
+-   will provide the best results in terms of low overhead during profiling.
+-   (:func:`os.times` is *pretty* bad, as it returns a tuple of floating point
+-   values).  If you want to substitute a better timer in the cleanest fashion,
+-   derive a class and hardwire a replacement dispatch method that best handles your
+-   timer call, along with the appropriate calibration constant.
++   Be warned that you should calibrate the profiler class for the
++   timer function that you choose.  For most machines, a timer that
++   returns a lone integer value will provide the best results in terms
++   of low overhead during profiling.  (:func:`os.times` is *pretty*
++   bad, as it returns a tuple of floating point values).  If you want
++   to substitute a better timer in the cleanest fashion, derive a
++   class and hardwire a replacement dispatch method that best handles
++   your timer call, along with the appropriate calibration constant.
+ 
+ :class:`cProfile.Profile`
+-   :func:`your_time_func` should return a single number.  If it returns
+-   integers, you can also invoke the class constructor with a second argument
+-   specifying the real duration of one unit of time.  For example, if
+-   :func:`your_integer_time_func` returns times measured in thousands of seconds,
+-   you would construct the :class:`Profile` instance as follows::
++   :func:`your_time_func` should return a single number.  If it
++   returns integers, you can also invoke the class constructor with a
++   second argument specifying the real duration of one unit of time.
++   For example, if :func:`your_integer_time_func` returns times
++   measured in thousands of seconds, you would construct the
++   :class:`Profile` instance as follows::
+ 
+       pr = profile.Profile(your_integer_time_func, 0.001)
+ 
+-   As the :mod:`cProfile.Profile` class cannot be calibrated, custom timer
+-   functions should be used with care and should be as fast as possible.  For the
+-   best results with a custom timer, it might be necessary to hard-code it in the C
+-   source of the internal :mod:`_lsprof` module.
++   As the :mod:`cProfile.Profile` class cannot be calibrated, custom
++   timer functions should be used with care and should be as fast as
++   possible.  For the best results with a custom timer, it might be
++   necessary to hard-code it in the C source of the internal
++   :mod:`_lsprof` module.
+diff -r bd8afb90ebf2 Doc/library/pyexpat.rst
+--- a/Doc/library/pyexpat.rst
++++ b/Doc/library/pyexpat.rst
+@@ -402,7 +402,7 @@
+ .. method:: xmlparser.CommentHandler(data)
+ 
+    Called for comments.  *data* is the text of the comment, excluding the leading
+-   '``<!-``\ ``-``' and trailing '``-``\ ``->``'.
++   ``'<!-``\ ``-'`` and trailing ``'-``\ ``->'``.
+ 
+ 
+ .. method:: xmlparser.StartCdataSectionHandler()
+diff -r bd8afb90ebf2 Doc/library/random.rst
+--- a/Doc/library/random.rst
++++ b/Doc/library/random.rst
+@@ -52,20 +52,20 @@
+ 
+ Bookkeeping functions:
+ 
+-.. function:: seed([x], version=2)
++.. function:: seed(a=None, version=2)
+ 
+    Initialize the random number generator.
+ 
+-   If *x* is omitted or ``None``, the current system time is used.  If
++   If *a* is omitted or ``None``, the current system time is used.  If
+    randomness sources are provided by the operating system, they are used
+    instead of the system time (see the :func:`os.urandom` function for details
+    on availability).
+ 
+-   If *x* is an int, it is used directly.
++   If *a* is an int, it is used directly.
+ 
+    With version 2 (the default), a :class:`str`, :class:`bytes`, or :class:`bytearray`
+    object gets converted to an :class:`int` and all of its bits are used.  With version 1,
+-   the :func:`hash` of *x* is used instead.
++   the :func:`hash` of *a* is used instead.
+ 
+    .. versionchanged:: 3.2
+       Moved to the version 2 scheme which uses all of the bits in a string seed.
+@@ -93,7 +93,8 @@
+ 
+ Functions for integers:
+ 
+-.. function:: randrange([start,] stop[, step])
++.. function:: randrange(stop)
++              randrange(start, stop[, step])
+ 
+    Return a randomly selected element from ``range(start, stop, step)``.  This is
+    equivalent to ``choice(range(start, stop, step))``, but doesn't actually build a
+diff -r bd8afb90ebf2 Doc/library/re.rst
+--- a/Doc/library/re.rst
++++ b/Doc/library/re.rst
+@@ -824,9 +824,16 @@
+ Match Objects
+ -------------
+ 
+-Match objects always have a boolean value of :const:`True`.  This lets you
+-use a simple if-statement to test whether a match was found.  Match objects
+-support the following methods and attributes:
++Match objects always have a boolean value of ``True``.
++Since :meth:`~regex.match` and :meth:`~regex.search` return ``None``
++when there is no match, you can test whether there was a match with a simple
++``if`` statement::
++
++   match = re.search(pattern, string)
++   if match:
++       process(match)
++
++Match objects support the following methods and attributes:
+ 
+ 
+ .. method:: match.expand(template)
+diff -r bd8afb90ebf2 Doc/library/sched.rst
+--- a/Doc/library/sched.rst
++++ b/Doc/library/sched.rst
+@@ -27,6 +27,7 @@
+ 
+    .. versionchanged:: 3.3
+       *timefunc* and *delayfunc* parameters are optional.
++
+    .. versionchanged:: 3.3
+       :class:`scheduler` class can be safely used in multi-threaded
+       environments.
+@@ -35,19 +36,22 @@
+ 
+    >>> import sched, time
+    >>> s = sched.scheduler(time.time, time.sleep)
+-   >>> def print_time(): print("From print_time", time.time())
++   >>> def print_time(a='default'):
++   ...     print("From print_time", time.time(), a)
+    ...
+    >>> def print_some_times():
+    ...     print(time.time())
+-   ...     s.enter(5, 1, print_time, ())
+-   ...     s.enter(10, 1, print_time, ())
++   ...     s.enter(10, 1, print_time)
++   ...     s.enter(5, 2, print_time, argument=('positional',))
++   ...     s.enter(5, 1, print_time, kwargs={'a': 'keyword'})
+    ...     s.run()
+    ...     print(time.time())
+    ...
+    >>> print_some_times()
+    930343690.257
+-   From print_time 930343695.274
+-   From print_time 930343700.273
++   From print_time 930343695.274 positional
++   From print_time 930343695.275 keyword
++   From print_time 930343700.273 default
+    930343700.276
+ 
+ .. _scheduler-objects:
+@@ -58,7 +62,7 @@
+ :class:`scheduler` instances have the following methods and attributes:
+ 
+ 
+-.. method:: scheduler.enterabs(time, priority, action, argument=[], kwargs={})
++.. method:: scheduler.enterabs(time, priority, action, argument=(), kwargs={})
+ 
+    Schedule a new event. The *time* argument should be a numeric type compatible
+    with the return value of the *timefunc* function passed  to the constructor.
+@@ -66,8 +70,8 @@
+    *priority*.
+ 
+    Executing the event means executing ``action(*argument, **kwargs)``.
+-   *argument* must be a sequence holding the parameters for *action*.
+-   *kwargs* must be a dictionary holding the keyword parameters for *action*.
++   *argument* is a sequence holding the positional arguments for *action*.
++   *kwargs* is a dictionary holding the keyword arguments for *action*.
+ 
+    Return value is an event which may be used for later cancellation of the event
+    (see :meth:`cancel`).
+@@ -79,7 +83,7 @@
+       *kwargs* parameter was added.
+ 
+ 
+-.. method:: scheduler.enter(delay, priority, action, argument=[], kwargs={})
++.. method:: scheduler.enter(delay, priority, action, argument=(), kwargs={})
+ 
+    Schedule an event for *delay* more time units. Other than the relative time, the
+    other arguments, the effect and the return value are the same as those for
+@@ -129,4 +133,4 @@
+ 
+    Read-only attribute returning a list of upcoming events in the order they
+    will be run.  Each event is shown as a :term:`named tuple` with the
+-   following fields:  time, priority, action, argument.
++   following fields:  time, priority, action, argument, kwargs.
+diff -r bd8afb90ebf2 Doc/library/shutil.rst
+--- a/Doc/library/shutil.rst
++++ b/Doc/library/shutil.rst
+@@ -335,7 +335,7 @@
+    directories.  For example, on Windows::
+ 
+       >>> shutil.which("python")
+-      'c:\\python33\\python.exe'
++      'C:\\Python33\\python.EXE'
+ 
+    .. versionadded:: 3.3
+ 
+@@ -372,7 +372,7 @@
+                else:
+                    copy2(srcname, dstname)
+                # XXX What about devices, sockets etc.?
+-           except (IOError, os.error) as why:
++           except OSError as why:
+                errors.append((srcname, dstname, str(why)))
+            # catch the Error from the recursive copytree so that we can
+            # continue with other files
+diff -r bd8afb90ebf2 Doc/library/site.rst
+--- a/Doc/library/site.rst
++++ b/Doc/library/site.rst
+@@ -33,7 +33,7 @@
+ For the head part, it uses ``sys.prefix`` and ``sys.exec_prefix``; empty heads
+ are skipped.  For the tail part, it uses the empty string and then
+ :file:`lib/site-packages` (on Windows) or
+-:file:`lib/python|version|/site-packages` and then :file:`lib/site-python` (on
++:file:`lib/python{X.Y}/site-packages` and then :file:`lib/site-python` (on
+ Unix and Macintosh).  For each of the distinct head-tail combinations, it sees
+ if it refers to an existing directory, and if so, adds it to ``sys.path`` and
+ also inspects the newly added path for configuration files.
+diff -r bd8afb90ebf2 Doc/library/smtpd.rst
+--- a/Doc/library/smtpd.rst
++++ b/Doc/library/smtpd.rst
+@@ -111,12 +111,13 @@
+    .. attribute:: addr
+ 
+       Holds the address of the client, the second value returned by
+-      socket.accept()
++      :func:`socket.accept <socket.socket.accept>`
+ 
+    .. attribute:: received_lines
+ 
+       Holds a list of the line strings (decoded using UTF-8) received from
+-      the client. The lines have their "\\r\\n" line ending translated to "\\n".
++      the client. The lines have their ``"\r\n"`` line ending translated to
++      ``"\n"``.
+ 
+    .. attribute:: smtp_state
+ 
+@@ -141,12 +142,12 @@
+    .. attribute:: received_data
+ 
+       Holds a string containing all of the data sent by the client during the
+-      DATA state, up to but not including the terminating "\r\n.\r\n".
++      DATA state, up to but not including the terminating ``"\r\n.\r\n"``.
+ 
+    .. attribute:: fqdn
+ 
+       Holds the fully-qualified domain name of the server as returned by
+-      ``socket.getfqdn()``.
++      :func:`socket.getfqdn`.
+ 
+    .. attribute:: peer
+ 
+@@ -170,14 +171,14 @@
+    MAIL     Accepts the "MAIL FROM:" syntax and stores the supplied address as
+             :attr:`mailfrom`.  In extended command mode, accepts the
+             :rfc:`1870` SIZE attribute and responds appropriately based on the
+-            value of ``data_size_limit``.
++            value of *data_size_limit*.
+    RCPT     Accepts the "RCPT TO:" syntax and stores the supplied addresses in
+             the :attr:`rcpttos` list.
+    RSET     Resets the :attr:`mailfrom`, :attr:`rcpttos`, and
+             :attr:`received_data`, but not the greeting.
+    DATA     Sets the internal state to :attr:`DATA` and stores remaining lines
+             from the client in :attr:`received_data` until the terminator
+-            "\r\n.\r\n" is received.
++            ``"\r\n.\r\n"`` is received.
+    HELP     Returns minimal information on command syntax
+    VRFY     Returns code 252 (the server doesn't know if the address is valid)
+    EXPN     Reports that the command is not implemented.
+diff -r bd8afb90ebf2 Doc/library/smtplib.rst
+--- a/Doc/library/smtplib.rst
++++ b/Doc/library/smtplib.rst
+@@ -37,7 +37,8 @@
+    behavior will be used.
+ 
+    For normal use, you should only require the initialization/connect,
+-   :meth:`sendmail`, and :meth:`quit` methods.  An example is included below.
++   :meth:`sendmail`, and :meth:`~smtplib.quit` methods.
++   An example is included below.
+ 
+    The :class:`SMTP` class supports the :keyword:`with` statement.  When used
+    like this, the SMTP ``QUIT`` command is issued automatically when the
+diff -r bd8afb90ebf2 Doc/library/socket.rst
+--- a/Doc/library/socket.rst
++++ b/Doc/library/socket.rst
+@@ -1005,7 +1005,8 @@
+    much data, if any, was successfully sent.
+ 
+ 
+-.. method:: socket.sendto(bytes[, flags], address)
++.. method:: socket.sendto(bytes, address)
++            socket.sendto(bytes, flags, address)
+ 
+    Send data to the socket.  The socket should not be connected to a remote socket,
+    since the destination socket is specified by *address*.  The optional *flags*
+diff -r bd8afb90ebf2 Doc/library/socketserver.rst
+--- a/Doc/library/socketserver.rst
++++ b/Doc/library/socketserver.rst
+@@ -153,20 +153,22 @@
+ 
+ .. method:: BaseServer.serve_forever(poll_interval=0.5)
+ 
+-   Handle requests until an explicit :meth:`shutdown` request.
+-   Poll for shutdown every *poll_interval* seconds. Ignores :attr:`self.timeout`.  It also calls
+-   :meth:`service_actions` which may be used by a subclass or Mixin to provide
+-   various cleanup actions.  For e.g. ForkingMixin class uses
+-   :meth:`service_actions` to cleanup the zombie child processes.
++   Handle requests until an explicit :meth:`shutdown` request.  Poll for
++   shutdown every *poll_interval* seconds. Ignores :attr:`self.timeout`.  It
++   also calls :meth:`service_actions`, which may be used by a subclass or mixin
++   to provide actions specific to a given service.  For example, the
++   :class:`ForkingMixIn` class uses :meth:`service_actions` to clean up zombie
++   child processes.
+ 
+    .. versionchanged:: 3.3
+-       Added service_actions call to the serve_forever method.
++       Added ``service_actions`` call to the ``serve_forever`` method.
+ 
+ 
+ .. method:: BaseServer.service_actions()
+ 
+-   This is called by the serve_forever loop. This method is can be overridden
+-   by Mixin's to add cleanup or service specific actions.
++   This is called in the :meth:`serve_forever` loop. This method is can be
++   overridden by subclasses or mixin classes to perform actions specific to
++   a given service, such as cleanup actions.
+ 
+    .. versionadded:: 3.3
+ 
+@@ -311,8 +313,8 @@
+ .. method:: RequestHandler.finish()
+ 
+    Called after the :meth:`handle` method to perform any clean-up actions
+-   required.  The default implementation does nothing.  If :meth:`setup` or
+-   :meth:`handle` raise an exception, this function will not be called.
++   required.  The default implementation does nothing.  If :meth:`setup`
++   raises an exception, this function will not be called.
+ 
+ 
+ .. method:: RequestHandler.handle()
+diff -r bd8afb90ebf2 Doc/library/sqlite3.rst
+--- a/Doc/library/sqlite3.rst
++++ b/Doc/library/sqlite3.rst
+@@ -109,6 +109,28 @@
+ ------------------------------
+ 
+ 
++.. data:: version
++
++   The version number of this module, as a string. This is not the version of
++   the SQLite library.
++
++
++.. data:: version_info
++
++   The version number of this module, as a tuple of integers. This is not the
++   version of the SQLite library.
++
++
++.. data:: sqlite_version
++
++   The version number of the run-time SQLite library, as a string.
++
++
++.. data:: sqlite_version_info
++
++   The version number of the run-time SQLite library, as a tuple of integers.
++
++
+ .. data:: PARSE_DECLTYPES
+ 
+    This constant is meant to be used with the *detect_types* parameter of the
+@@ -222,250 +244,254 @@
+ 
+    A SQLite database connection has the following attributes and methods:
+ 
+-.. attribute:: Connection.isolation_level
++   .. attribute:: isolation_level
+ 
+-   Get or set the current isolation level. :const:`None` for autocommit mode or
+-   one of "DEFERRED", "IMMEDIATE" or "EXCLUSIVE". See section
+-   :ref:`sqlite3-controlling-transactions` for a more detailed explanation.
++      Get or set the current isolation level. :const:`None` for autocommit mode or
++      one of "DEFERRED", "IMMEDIATE" or "EXCLUSIVE". See section
++      :ref:`sqlite3-controlling-transactions` for a more detailed explanation.
+ 
+-.. attribute:: Connection.in_transaction
++   .. attribute:: in_transaction
+ 
+-   :const:`True` if a transaction is active (there are uncommitted changes),
+-   :const:`False` otherwise.  Read-only attribute.
++      :const:`True` if a transaction is active (there are uncommitted changes),
++      :const:`False` otherwise.  Read-only attribute.
+ 
+-   .. versionadded:: 3.2
++      .. versionadded:: 3.2
+ 
+-.. method:: Connection.cursor([cursorClass])
++   .. method:: cursor([cursorClass])
+ 
+-   The cursor method accepts a single optional parameter *cursorClass*. If
+-   supplied, this must be a custom cursor class that extends
+-   :class:`sqlite3.Cursor`.
++      The cursor method accepts a single optional parameter *cursorClass*. If
++      supplied, this must be a custom cursor class that extends
++      :class:`sqlite3.Cursor`.
+ 
+-.. method:: Connection.commit()
++   .. method:: commit()
+ 
+-   This method commits the current transaction. If you don't call this method,
+-   anything you did since the last call to ``commit()`` is not visible from
+-   other database connections. If you wonder why you don't see the data you've
+-   written to the database, please check you didn't forget to call this method.
++      This method commits the current transaction. If you don't call this method,
++      anything you did since the last call to ``commit()`` is not visible from
++      other database connections. If you wonder why you don't see the data you've
++      written to the database, please check you didn't forget to call this method.
+ 
+-.. method:: Connection.rollback()
++   .. method:: rollback()
+ 
+-   This method rolls back any changes to the database since the last call to
+-   :meth:`commit`.
++      This method rolls back any changes to the database since the last call to
++      :meth:`commit`.
+ 
+-.. method:: Connection.close()
++   .. method:: close()
+ 
+-   This closes the database connection. Note that this does not automatically
+-   call :meth:`commit`. If you just close your database connection without
+-   calling :meth:`commit` first, your changes will be lost!
++      This closes the database connection. Note that this does not automatically
++      call :meth:`commit`. If you just close your database connection without
++      calling :meth:`commit` first, your changes will be lost!
+ 
+-.. method:: Connection.execute(sql, [parameters])
++   .. method:: execute(sql, [parameters])
+ 
+-   This is a nonstandard shortcut that creates an intermediate cursor object by
+-   calling the cursor method, then calls the cursor's :meth:`execute
+-   <Cursor.execute>` method with the parameters given.
++      This is a nonstandard shortcut that creates an intermediate cursor object by
++      calling the cursor method, then calls the cursor's :meth:`execute
++      <Cursor.execute>` method with the parameters given.
+ 
+ 
+-.. method:: Connection.executemany(sql, [parameters])
++   .. method:: executemany(sql, [parameters])
+ 
+-   This is a nonstandard shortcut that creates an intermediate cursor object by
+-   calling the cursor method, then calls the cursor's :meth:`executemany
+-   <Cursor.executemany>` method with the parameters given.
++      This is a nonstandard shortcut that creates an intermediate cursor object by
++      calling the cursor method, then calls the cursor's :meth:`executemany
++      <Cursor.executemany>` method with the parameters given.
+ 
+-.. method:: Connection.executescript(sql_script)
++   .. method:: executescript(sql_script)
+ 
+-   This is a nonstandard shortcut that creates an intermediate cursor object by
+-   calling the cursor method, then calls the cursor's :meth:`executescript
+-   <Cursor.executescript>` method with the parameters given.
++      This is a nonstandard shortcut that creates an intermediate cursor object by
++      calling the cursor method, then calls the cursor's :meth:`executescript
++      <Cursor.executescript>` method with the parameters given.
+ 
+ 
+-.. method:: Connection.create_function(name, num_params, func)
++   .. method:: create_function(name, num_params, func)
+ 
+-   Creates a user-defined function that you can later use from within SQL
+-   statements under the function name *name*. *num_params* is the number of
+-   parameters the function accepts, and *func* is a Python callable that is called
+-   as the SQL function.
++      Creates a user-defined function that you can later use from within SQL
++      statements under the function name *name*. *num_params* is the number of
++      parameters the function accepts, and *func* is a Python callable that is called
++      as the SQL function.
+ 
+-   The function can return any of the types supported by SQLite: bytes, str, int,
+-   float and None.
++      The function can return any of the types supported by SQLite: bytes, str, int,
++      float and None.
+ 
+-   Example:
++      Example:
+ 
+-   .. literalinclude:: ../includes/sqlite3/md5func.py
++      .. literalinclude:: ../includes/sqlite3/md5func.py
+ 
+ 
+-.. method:: Connection.create_aggregate(name, num_params, aggregate_class)
++   .. method:: create_aggregate(name, num_params, aggregate_class)
+ 
+-   Creates a user-defined aggregate function.
++      Creates a user-defined aggregate function.
+ 
+-   The aggregate class must implement a ``step`` method, which accepts the number
+-   of parameters *num_params*, and a ``finalize`` method which will return the
+-   final result of the aggregate.
++      The aggregate class must implement a ``step`` method, which accepts the number
++      of parameters *num_params*, and a ``finalize`` method which will return the
++      final result of the aggregate.
+ 
+-   The ``finalize`` method can return any of the types supported by SQLite:
+-   bytes, str, int, float and None.
++      The ``finalize`` method can return any of the types supported by SQLite:
++      bytes, str, int, float and None.
+ 
+-   Example:
++      Example:
+ 
+-   .. literalinclude:: ../includes/sqlite3/mysumaggr.py
++      .. literalinclude:: ../includes/sqlite3/mysumaggr.py
+ 
+ 
+-.. method:: Connection.create_collation(name, callable)
++   .. method:: create_collation(name, callable)
+ 
+-   Creates a collation with the specified *name* and *callable*. The callable will
+-   be passed two string arguments. It should return -1 if the first is ordered
+-   lower than the second, 0 if they are ordered equal and 1 if the first is ordered
+-   higher than the second.  Note that this controls sorting (ORDER BY in SQL) so
+-   your comparisons don't affect other SQL operations.
++      Creates a collation with the specified *name* and *callable*. The callable will
++      be passed two string arguments. It should return -1 if the first is ordered
++      lower than the second, 0 if they are ordered equal and 1 if the first is ordered
++      higher than the second.  Note that this controls sorting (ORDER BY in SQL) so
++      your comparisons don't affect other SQL operations.
+ 
+-   Note that the callable will get its parameters as Python bytestrings, which will
+-   normally be encoded in UTF-8.
++      Note that the callable will get its parameters as Python bytestrings, which will
++      normally be encoded in UTF-8.
+ 
+-   The following example shows a custom collation that sorts "the wrong way":
++      The following example shows a custom collation that sorts "the wrong way":
+ 
+-   .. literalinclude:: ../includes/sqlite3/collation_reverse.py
++      .. literalinclude:: ../includes/sqlite3/collation_reverse.py
+ 
+-   To remove a collation, call ``create_collation`` with None as callable::
++      To remove a collation, call ``create_collation`` with None as callable::
+ 
+-      con.create_collation("reverse", None)
++         con.create_collation("reverse", None)
+ 
+ 
+-.. method:: Connection.interrupt()
++   .. method:: interrupt()
+ 
+-   You can call this method from a different thread to abort any queries that might
+-   be executing on the connection. The query will then abort and the caller will
+-   get an exception.
++      You can call this method from a different thread to abort any queries that might
++      be executing on the connection. The query will then abort and the caller will
++      get an exception.
+ 
+ 
+-.. method:: Connection.set_authorizer(authorizer_callback)
++   .. method:: set_authorizer(authorizer_callback)
+ 
+-   This routine registers a callback. The callback is invoked for each attempt to
+-   access a column of a table in the database. The callback should return
+-   :const:`SQLITE_OK` if access is allowed, :const:`SQLITE_DENY` if the entire SQL
+-   statement should be aborted with an error and :const:`SQLITE_IGNORE` if the
+-   column should be treated as a NULL value. These constants are available in the
+-   :mod:`sqlite3` module.
++      This routine registers a callback. The callback is invoked for each attempt to
++      access a column of a table in the database. The callback should return
++      :const:`SQLITE_OK` if access is allowed, :const:`SQLITE_DENY` if the entire SQL
++      statement should be aborted with an error and :const:`SQLITE_IGNORE` if the
++      column should be treated as a NULL value. These constants are available in the
++      :mod:`sqlite3` module.
+ 
+-   The first argument to the callback signifies what kind of operation is to be
+-   authorized. The second and third argument will be arguments or :const:`None`
+-   depending on the first argument. The 4th argument is the name of the database
+-   ("main", "temp", etc.) if applicable. The 5th argument is the name of the
+-   inner-most trigger or view that is responsible for the access attempt or
+-   :const:`None` if this access attempt is directly from input SQL code.
++      The first argument to the callback signifies what kind of operation is to be
++      authorized. The second and third argument will be arguments or :const:`None`
++      depending on the first argument. The 4th argument is the name of the database
++      ("main", "temp", etc.) if applicable. The 5th argument is the name of the
++      inner-most trigger or view that is responsible for the access attempt or
++      :const:`None` if this access attempt is directly from input SQL code.
+ 
+-   Please consult the SQLite documentation about the possible values for the first
+-   argument and the meaning of the second and third argument depending on the first
+-   one. All necessary constants are available in the :mod:`sqlite3` module.
++      Please consult the SQLite documentation about the possible values for the first
++      argument and the meaning of the second and third argument depending on the first
++      one. All necessary constants are available in the :mod:`sqlite3` module.
+ 
+ 
+-.. method:: Connection.set_progress_handler(handler, n)
++   .. method:: set_progress_handler(handler, n)
+ 
+-   This routine registers a callback. The callback is invoked for every *n*
+-   instructions of the SQLite virtual machine. This is useful if you want to
+-   get called from SQLite during long-running operations, for example to update
+-   a GUI.
++      This routine registers a callback. The callback is invoked for every *n*
++      instructions of the SQLite virtual machine. This is useful if you want to
++      get called from SQLite during long-running operations, for example to update
++      a GUI.
+ 
+-   If you want to clear any previously installed progress handler, call the
+-   method with :const:`None` for *handler*.
++      If you want to clear any previously installed progress handler, call the
++      method with :const:`None` for *handler*.
+ 
+ 
+-.. method:: Connection.set_trace_callback(trace_callback)
++   .. method:: set_trace_callback(trace_callback)
+ 
+-   Registers *trace_callback* to be called for each SQL statement that is
+-   actually executed by the SQLite backend.
++      Registers *trace_callback* to be called for each SQL statement that is
++      actually executed by the SQLite backend.
+ 
+-   The only argument passed to the callback is the statement (as string) that
+-   is being executed. The return value of the callback is ignored. Note that
+-   the backend does not only run statements passed to the :meth:`Cursor.execute`
+-   methods.  Other sources include the transaction management of the Python
+-   module and the execution of triggers defined in the current database.
++      The only argument passed to the callback is the statement (as string) that
++      is being executed. The return value of the callback is ignored. Note that
++      the backend does not only run statements passed to the :meth:`Cursor.execute`
++      methods.  Other sources include the transaction management of the Python
++      module and the execution of triggers defined in the current database.
+ 
+-   Passing :const:`None` as *trace_callback* will disable the trace callback.
++      Passing :const:`None` as *trace_callback* will disable the trace callback.
+ 
+-   .. versionadded:: 3.3
++      .. versionadded:: 3.3
+ 
+ 
+-.. method:: Connection.enable_load_extension(enabled)
++   .. method:: enable_load_extension(enabled)
+ 
+-   This routine allows/disallows the SQLite engine to load SQLite extensions
+-   from shared libraries.  SQLite extensions can define new functions,
+-   aggregates or whole new virtual table implementations.  One well-known
+-   extension is the fulltext-search extension distributed with SQLite.
++      This routine allows/disallows the SQLite engine to load SQLite extensions
++      from shared libraries.  SQLite extensions can define new functions,
++      aggregates or whole new virtual table implementations.  One well-known
++      extension is the fulltext-search extension distributed with SQLite.
+ 
+-   Loadable extensions are disabled by default. See [#f1]_.
++      Loadable extensions are disabled by default. See [#f1]_.
+ 
+-   .. versionadded:: 3.2
++      .. versionadded:: 3.2
+ 
+-   .. literalinclude:: ../includes/sqlite3/load_extension.py
++      .. literalinclude:: ../includes/sqlite3/load_extension.py
+ 
+-.. method:: Connection.load_extension(path)
++   .. method:: load_extension(path)
+ 
+-   This routine loads a SQLite extension from a shared library.  You have to
+-   enable extension loading with :meth:`enable_load_extension` before you can
+-   use this routine.
++      This routine loads a SQLite extension from a shared library.  You have to
++      enable extension loading with :meth:`enable_load_extension` before you can
++      use this routine.
+ 
+-   Loadable extensions are disabled by default. See [#f1]_.
++      Loadable extensions are disabled by default. See [#f1]_.
+ 
+-   .. versionadded:: 3.2
++      .. versionadded:: 3.2
+ 
+-.. attribute:: Connection.row_factory
++   .. attribute:: row_factory
+ 
+-   You can change this attribute to a callable that accepts the cursor and the
+-   original row as a tuple and will return the real result row.  This way, you can
+-   implement more advanced ways of returning results, such  as returning an object
+-   that can also access columns by name.
++      You can change this attribute to a callable that accepts the cursor and the
++      original row as a tuple and will return the real result row.  This way, you can
++      implement more advanced ways of returning results, such  as returning an object
++      that can also access columns by name.
+ 
+-   Example:
++      Example:
+ 
+-   .. literalinclude:: ../includes/sqlite3/row_factory.py
++      .. literalinclude:: ../includes/sqlite3/row_factory.py
+ 
+-   If returning a tuple doesn't suffice and you want name-based access to
+-   columns, you should consider setting :attr:`row_factory` to the
+-   highly-optimized :class:`sqlite3.Row` type. :class:`Row` provides both
+-   index-based and case-insensitive name-based access to columns with almost no
+-   memory overhead. It will probably be better than your own custom
+-   dictionary-based approach or even a db_row based solution.
++      If returning a tuple doesn't suffice and you want name-based access to
++      columns, you should consider setting :attr:`row_factory` to the
++      highly-optimized :class:`sqlite3.Row` type. :class:`Row` provides both
++      index-based and case-insensitive name-based access to columns with almost no
++      memory overhead. It will probably be better than your own custom
++      dictionary-based approach or even a db_row based solution.
+ 
+-   .. XXX what's a db_row-based solution?
++      .. XXX what's a db_row-based solution?
+ 
+ 
+-.. attribute:: Connection.text_factory
++   .. attribute:: text_factory
+ 
+-   Using this attribute you can control what objects are returned for the ``TEXT``
+-   data type. By default, this attribute is set to :class:`str` and the
+-   :mod:`sqlite3` module will return Unicode objects for ``TEXT``. If you want to
+-   return bytestrings instead, you can set it to :class:`bytes`.
++      Using this attribute you can control what objects are returned for the ``TEXT``
++      data type. By default, this attribute is set to :class:`str` and the
++      :mod:`sqlite3` module will return Unicode objects for ``TEXT``. If you want to
++      return bytestrings instead, you can set it to :class:`bytes`.
+ 
+-   You can also set it to any other callable that accepts a single bytestring
+-   parameter and returns the resulting object.
++      For efficiency reasons, there's also a way to return :class:`str` objects
++      only for non-ASCII data, and :class:`bytes` otherwise. To activate it, set
++      this attribute to :const:`sqlite3.OptimizedUnicode`.
+ 
+-   See the following example code for illustration:
++      You can also set it to any other callable that accepts a single bytestring
++      parameter and returns the resulting object.
+ 
+-   .. literalinclude:: ../includes/sqlite3/text_factory.py
++      See the following example code for illustration:
+ 
++      .. literalinclude:: ../includes/sqlite3/text_factory.py
+ 
+-.. attribute:: Connection.total_changes
+ 
+-   Returns the total number of database rows that have been modified, inserted, or
+-   deleted since the database connection was opened.
++   .. attribute:: total_changes
+ 
++      Returns the total number of database rows that have been modified, inserted, or
++      deleted since the database connection was opened.
+ 
+-.. attribute:: Connection.iterdump
+ 
+-   Returns an iterator to dump the database in an SQL text format.  Useful when
+-   saving an in-memory database for later restoration.  This function provides
+-   the same capabilities as the :kbd:`.dump` command in the :program:`sqlite3`
+-   shell.
++   .. attribute:: iterdump
+ 
+-   Example::
++      Returns an iterator to dump the database in an SQL text format.  Useful when
++      saving an in-memory database for later restoration.  This function provides
++      the same capabilities as the :kbd:`.dump` command in the :program:`sqlite3`
++      shell.
+ 
+-      # Convert file existing_db.db to SQL dump file dump.sql
+-      import sqlite3, os
++      Example::
+ 
+-      con = sqlite3.connect('existing_db.db')
+-      with open('dump.sql', 'w') as f:
+-          for line in con.iterdump():
+-              f.write('%s\n' % line)
++         # Convert file existing_db.db to SQL dump file dump.sql
++         import sqlite3, os
++
++         con = sqlite3.connect('existing_db.db')
++         with open('dump.sql', 'w') as f:
++             for line in con.iterdump():
++                 f.write('%s\n' % line)
+ 
+ 
+ .. _sqlite3-cursor-objects:
+@@ -477,110 +503,110 @@
+ 
+    A :class:`Cursor` instance has the following attributes and methods.
+ 
+-.. method:: Cursor.execute(sql, [parameters])
++   .. method:: execute(sql, [parameters])
+ 
+-   Executes an SQL statement. The SQL statement may be parametrized (i. e.
+-   placeholders instead of SQL literals). The :mod:`sqlite3` module supports two
+-   kinds of placeholders: question marks (qmark style) and named placeholders
+-   (named style).
++      Executes an SQL statement. The SQL statement may be parametrized (i. e.
++      placeholders instead of SQL literals). The :mod:`sqlite3` module supports two
++      kinds of placeholders: question marks (qmark style) and named placeholders
++      (named style).
+ 
+-   Here's an example of both styles:
++      Here's an example of both styles:
+ 
+-   .. literalinclude:: ../includes/sqlite3/execute_1.py
++      .. literalinclude:: ../includes/sqlite3/execute_1.py
+ 
+-   :meth:`execute` will only execute a single SQL statement. If you try to execute
+-   more than one statement with it, it will raise a Warning. Use
+-   :meth:`executescript` if you want to execute multiple SQL statements with one
+-   call.
++      :meth:`execute` will only execute a single SQL statement. If you try to execute
++      more than one statement with it, it will raise a Warning. Use
++      :meth:`executescript` if you want to execute multiple SQL statements with one
++      call.
+ 
+ 
+-.. method:: Cursor.executemany(sql, seq_of_parameters)
++   .. method:: executemany(sql, seq_of_parameters)
+ 
+-   Executes an SQL command against all parameter sequences or mappings found in
+-   the sequence *sql*.  The :mod:`sqlite3` module also allows using an
+-   :term:`iterator` yielding parameters instead of a sequence.
++      Executes an SQL command against all parameter sequences or mappings found in
++      the sequence *sql*.  The :mod:`sqlite3` module also allows using an
++      :term:`iterator` yielding parameters instead of a sequence.
+ 
+-   .. literalinclude:: ../includes/sqlite3/executemany_1.py
++      .. literalinclude:: ../includes/sqlite3/executemany_1.py
+ 
+-   Here's a shorter example using a :term:`generator`:
++      Here's a shorter example using a :term:`generator`:
+ 
+-   .. literalinclude:: ../includes/sqlite3/executemany_2.py
++      .. literalinclude:: ../includes/sqlite3/executemany_2.py
+ 
+ 
+-.. method:: Cursor.executescript(sql_script)
++   .. method:: executescript(sql_script)
+ 
+-   This is a nonstandard convenience method for executing multiple SQL statements
+-   at once. It issues a ``COMMIT`` statement first, then executes the SQL script it
+-   gets as a parameter.
++      This is a nonstandard convenience method for executing multiple SQL statements
++      at once. It issues a ``COMMIT`` statement first, then executes the SQL script it
++      gets as a parameter.
+ 
+-   *sql_script* can be an instance of :class:`str` or :class:`bytes`.
++      *sql_script* can be an instance of :class:`str` or :class:`bytes`.
+ 
+-   Example:
++      Example:
+ 
+-   .. literalinclude:: ../includes/sqlite3/executescript.py
++      .. literalinclude:: ../includes/sqlite3/executescript.py
+ 
+ 
+-.. method:: Cursor.fetchone()
++   .. method:: fetchone()
+ 
+-   Fetches the next row of a query result set, returning a single sequence,
+-   or :const:`None` when no more data is available.
++      Fetches the next row of a query result set, returning a single sequence,
++      or :const:`None` when no more data is available.
+ 
+ 
+-.. method:: Cursor.fetchmany(size=cursor.arraysize)
++   .. method:: fetchmany(size=cursor.arraysize)
+ 
+-   Fetches the next set of rows of a query result, returning a list.  An empty
+-   list is returned when no more rows are available.
++      Fetches the next set of rows of a query result, returning a list.  An empty
++      list is returned when no more rows are available.
+ 
+-   The number of rows to fetch per call is specified by the *size* parameter.
+-   If it is not given, the cursor's arraysize determines the number of rows
+-   to be fetched. The method should try to fetch as many rows as indicated by
+-   the size parameter. If this is not possible due to the specified number of
+-   rows not being available, fewer rows may be returned.
++      The number of rows to fetch per call is specified by the *size* parameter.
++      If it is not given, the cursor's arraysize determines the number of rows
++      to be fetched. The method should try to fetch as many rows as indicated by
++      the size parameter. If this is not possible due to the specified number of
++      rows not being available, fewer rows may be returned.
+ 
+-   Note there are performance considerations involved with the *size* parameter.
+-   For optimal performance, it is usually best to use the arraysize attribute.
+-   If the *size* parameter is used, then it is best for it to retain the same
+-   value from one :meth:`fetchmany` call to the next.
++      Note there are performance considerations involved with the *size* parameter.
++      For optimal performance, it is usually best to use the arraysize attribute.
++      If the *size* parameter is used, then it is best for it to retain the same
++      value from one :meth:`fetchmany` call to the next.
+ 
+-.. method:: Cursor.fetchall()
++   .. method:: fetchall()
+ 
+-   Fetches all (remaining) rows of a query result, returning a list.  Note that
+-   the cursor's arraysize attribute can affect the performance of this operation.
+-   An empty list is returned when no rows are available.
++      Fetches all (remaining) rows of a query result, returning a list.  Note that
++      the cursor's arraysize attribute can affect the performance of this operation.
++      An empty list is returned when no rows are available.
+ 
+ 
+-.. attribute:: Cursor.rowcount
++   .. attribute:: rowcount
+ 
+-   Although the :class:`Cursor` class of the :mod:`sqlite3` module implements this
+-   attribute, the database engine's own support for the determination of "rows
+-   affected"/"rows selected" is quirky.
++      Although the :class:`Cursor` class of the :mod:`sqlite3` module implements this
++      attribute, the database engine's own support for the determination of "rows
++      affected"/"rows selected" is quirky.
+ 
+-   For :meth:`executemany` statements, the number of modifications are summed up
+-   into :attr:`rowcount`.
++      For :meth:`executemany` statements, the number of modifications are summed up
++      into :attr:`rowcount`.
+ 
+-   As required by the Python DB API Spec, the :attr:`rowcount` attribute "is -1 in
+-   case no ``executeXX()`` has been performed on the cursor or the rowcount of the
+-   last operation is not determinable by the interface". This includes ``SELECT``
+-   statements because we cannot determine the number of rows a query produced
+-   until all rows were fetched.
++      As required by the Python DB API Spec, the :attr:`rowcount` attribute "is -1 in
++      case no ``executeXX()`` has been performed on the cursor or the rowcount of the
++      last operation is not determinable by the interface". This includes ``SELECT``
++      statements because we cannot determine the number of rows a query produced
++      until all rows were fetched.
+ 
+-   With SQLite versions before 3.6.5, :attr:`rowcount` is set to 0 if
+-   you make a ``DELETE FROM table`` without any condition.
++      With SQLite versions before 3.6.5, :attr:`rowcount` is set to 0 if
++      you make a ``DELETE FROM table`` without any condition.
+ 
+-.. attribute:: Cursor.lastrowid
++   .. attribute:: lastrowid
+ 
+-   This read-only attribute provides the rowid of the last modified row. It is
+-   only set if you issued a ``INSERT`` statement using the :meth:`execute`
+-   method. For operations other than ``INSERT`` or when :meth:`executemany` is
+-   called, :attr:`lastrowid` is set to :const:`None`.
++      This read-only attribute provides the rowid of the last modified row. It is
++      only set if you issued a ``INSERT`` statement using the :meth:`execute`
++      method. For operations other than ``INSERT`` or when :meth:`executemany` is
++      called, :attr:`lastrowid` is set to :const:`None`.
+ 
+-.. attribute:: Cursor.description
++   .. attribute:: description
+ 
+-   This read-only attribute provides the column names of the last query. To
+-   remain compatible with the Python DB API, it returns a 7-tuple for each
+-   column where the last six items of each tuple are :const:`None`.
++      This read-only attribute provides the column names of the last query. To
++      remain compatible with the Python DB API, it returns a 7-tuple for each
++      column where the last six items of each tuple are :const:`None`.
+ 
+-   It is set for ``SELECT`` statements without any matching rows as well.
++      It is set for ``SELECT`` statements without any matching rows as well.
+ 
+ .. _sqlite3-row-objects:
+ 
+diff -r bd8afb90ebf2 Doc/library/stat.rst
+--- a/Doc/library/stat.rst
++++ b/Doc/library/stat.rst
+@@ -182,10 +182,6 @@
+ 
+ Use of the functions above is more portable than use of the first set of flags:
+ 
+-.. data:: S_IFMT
+-
+-   Bit mask for the file type bit fields.
+-
+ .. data:: S_IFSOCK
+ 
+    Socket.
+diff -r bd8afb90ebf2 Doc/library/stdtypes.rst
+--- a/Doc/library/stdtypes.rst
++++ b/Doc/library/stdtypes.rst
+@@ -779,9 +779,9 @@
+ specific types are not important beyond their implementation of the iterator
+ protocol.
+ 
+-Once an iterator's :meth:`__next__` method raises :exc:`StopIteration`, it must
+-continue to do so on subsequent calls.  Implementations that do not obey this
+-property are deemed broken.
++Once an iterator's :meth:`~iterator.__next__` method raises
++:exc:`StopIteration`, it must continue to do so on subsequent calls.
++Implementations that do not obey this property are deemed broken.
+ 
+ 
+ .. _generator-types:
+@@ -792,7 +792,8 @@
+ Python's :term:`generator`\s provide a convenient way to implement the iterator
+ protocol.  If a container object's :meth:`__iter__` method is implemented as a
+ generator, it will automatically return an iterator object (technically, a
+-generator object) supplying the :meth:`__iter__` and :meth:`__next__` methods.
++generator object) supplying the :meth:`__iter__` and :meth:`~generator.__next__`
++methods.
+ More information about generators can be found in :ref:`the documentation for
+ the yield expression <yieldexpr>`.
+ 
+@@ -1235,7 +1236,8 @@
+ commonly used for looping a specific number of times in :keyword:`for`
+ loops.
+ 
+-.. class:: range([start, ]stop[, step])
++.. class:: range(stop)
++           range(start, stop[, step])
+ 
+    The arguments to the range constructor must be integers (either built-in
+    :class:`int` or any object that implements the ``__index__`` special
+@@ -1251,7 +1253,7 @@
+    the formula ``r[i] = start + step*i``, but the constraints are ``i >= 0``
+    and ``r[i] > stop``.
+ 
+-   A range object will be empty if ``r[0]`` does not meant the value
++   A range object will be empty if ``r[0]`` does not meet the value
+    constraint. Ranges do support negative indices, but these are interpreted
+    as indexing from the end of the sequence determined by the positive
+    indices.
+@@ -1344,20 +1346,19 @@
+    The :attr:`start`, :attr:`stop` and :attr:`step` attributes.
+ 
+ 
++.. index::
++   single: string; text sequence type
++   single: str (built-in class); (see also string)
++   object: string
++
+ .. _textseq:
+ 
+ Text Sequence Type --- :class:`str`
+ ===================================
+ 
+-.. index::
+-   object: string
+-   object: bytes
+-   object: bytearray
+-   object: io.StringIO
+-
+-
+-Textual data in Python is handled with :class:`str` objects, which are
+-immutable sequences of Unicode code points.  String literals are
++Textual data in Python is handled with :class:`str` objects, or :dfn:`strings`.
++Strings are immutable
++:ref:`sequences <typesseq>` of Unicode code points.  String literals are
+ written in a variety of ways:
+ 
+ * Single quotes: ``'allows embedded "double" quotes'``
+@@ -1375,12 +1376,15 @@
+ including supported escape sequences, and the ``r`` ("raw") prefix that
+ disables most escape sequence processing.
+ 
+-Strings may also be created from other objects with the :ref:`str <func-str>`
+-built-in.
++Strings may also be created from other objects using the :class:`str`
++constructor.
+ 
+ Since there is no separate "character" type, indexing a string produces
+ strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``.
+ 
++.. index::
++   object: io.StringIO
++
+ There is also no mutable string type, but :meth:`str.join` or
+ :class:`io.StringIO` can be used to efficiently construct strings from
+ multiple fragments.
+@@ -1390,13 +1394,61 @@
+    once again permitted on string literals. It has no effect on the meaning
+    of string literals and cannot be combined with the ``r`` prefix.
+ 
++
++.. index::
++   single: string; str (built-in class)
++
++.. class:: str(object='')
++           str(object=b'', encoding='utf-8', errors='strict')
++
++   Return a :ref:`string <textseq>` version of *object*.  If *object* is not
++   provided, returns the empty string.  Otherwise, the behavior of ``str()``
++   depends on whether *encoding* or *errors* is given, as follows.
++
++   If neither *encoding* nor *errors* is given, ``str(object)`` returns
++   :meth:`object.__str__() <object.__str__>`, which is the "informal" or nicely
++   printable string representation of *object*.  For string objects, this is
++   the string itself.  If *object* does not have a :meth:`~object.__str__`
++   method, then :func:`str` falls back to returning
++   :meth:`repr(object) <repr>`.
++
++   .. index::
++      single: buffer protocol; str (built-in class)
++      single: bytes; str (built-in class)
++
++   If at least one of *encoding* or *errors* is given, *object* should be a
++   :class:`bytes` or :class:`bytearray` object, or more generally any object
++   that supports the :ref:`buffer protocol <bufferobjects>`.  In this case, if
++   *object* is a :class:`bytes` (or :class:`bytearray`) object, then
++   ``str(bytes, encoding, errors)`` is equivalent to
++   :meth:`bytes.decode(encoding, errors) <bytes.decode>`.  Otherwise, the bytes
++   object underlying the buffer object is obtained before calling
++   :meth:`bytes.decode`.  See :ref:`binaryseq` and
++   :ref:`bufferobjects` for information on buffer objects.
++
++   Passing a :class:`bytes` object to :func:`str` without the *encoding*
++   or *errors* arguments falls under the first case of returning the informal
++   string representation (see also the :option:`-b` command-line option to
++   Python).  For example::
++
++      >>> str(b'Zoot!')
++      "b'Zoot!'"
++
++   For more information on the ``str`` class and its methods, see
++   :ref:`textseq` and the :ref:`string-methods` section below.  To output
++   formatted strings, see the :ref:`string-formatting` section.  In addition,
++   see the :ref:`stringservices` section.
++
++
++.. index::
++   pair: string; methods
++
+ .. _string-methods:
+ 
+ String Methods
+ --------------
+ 
+ .. index::
+-   pair: string; methods
+    module: re
+ 
+ Strings implement all of the :ref:`common <typesseq-common>` sequence
+@@ -1830,11 +1882,11 @@
+ 
+         >>> import re
+         >>> def titlecase(s):
+-                return re.sub(r"[A-Za-z]+('[A-Za-z]+)?",
+-                              lambda mo: mo.group(0)[0].upper() +
+-                                         mo.group(0)[1:].lower(),
+-                              s)
+-
++        ...     return re.sub(r"[A-Za-z]+('[A-Za-z]+)?",
++        ...                   lambda mo: mo.group(0)[0].upper() +
++        ...                              mo.group(0)[1:].lower(),
++        ...                   s)
++        ...
+         >>> titlecase("they're bill's friends.")
+         "They're Bill's Friends."
+ 
+@@ -2062,6 +2114,9 @@
+    longer replaced by ``%g`` conversions.
+ 
+ 
++.. index::
++   single: buffer protocol; binary sequence types
++
+ .. _binaryseq:
+ 
+ Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:`memoryview`
+@@ -2075,8 +2130,8 @@
+ 
+ The core built-in types for manipulating binary data are :class:`bytes` and
+ :class:`bytearray`. They are supported by :class:`memoryview` which uses
+-the buffer protocol to access the memory of other binary objects without
+-needing to make a copy.
++the :ref:`buffer protocol <bufferobjects>` to access the memory of other
++binary objects without needing to make a copy.
+ 
+ The :mod:`array` module supports efficient storage of basic data types like
+ 32-bit integers and IEEE754 double-precision floating values.
+@@ -2162,7 +2217,7 @@
+ * Creating an empty instance: ``bytearray()``
+ * Creating a zero-filled instance with a given length: ``bytearray(10)``
+ * From an iterable of integers: ``bytearray(range(20))``
+-* Copying existing binary data via the buffer protocol:  ``bytearray(b'Hi!)``
++* Copying existing binary data via the buffer protocol:  ``bytearray(b'Hi!')``
+ 
+ As bytearray objects are mutable, they support the
+ :ref:`mutable <typesseq-mutable>` sequence operations in addition to the
+@@ -2391,12 +2446,6 @@
+    .. versionchanged:: 3.3
+       One-dimensional memoryviews with formats 'B', 'b' or 'c' are now hashable.
+ 
+-   .. note::
+-      Hashing of memoryviews with formats other than 'B', 'b' or 'c' as well
+-      as hashing of multi-dimensional memoryviews is possible in version 3.3.0,
+-      but will raise an error in 3.3.1 in order to be compatible with the new
+-      memoryview equality definition.
+-
+    :class:`memoryview` has several methods:
+ 
+    .. method:: __eq__(exporter)
+@@ -2687,13 +2736,19 @@
+    .. attribute:: shape
+ 
+       A tuple of integers the length of :attr:`ndim` giving the shape of the
+-      memory as a N-dimensional array.
++      memory as an N-dimensional array.
++
++      .. versionchanged:: 3.3
++         An empty tuple instead of None when ndim = 0.
+ 
+    .. attribute:: strides
+ 
+       A tuple of integers the length of :attr:`ndim` giving the size in bytes to
+       access each element for each dimension of the array.
+ 
++      .. versionchanged:: 3.3
++         An empty tuple instead of None when ndim = 0.
++
+    .. attribute:: suboffsets
+ 
+       Used internally for PIL-style arrays. The value is informational only.
+@@ -2785,7 +2840,7 @@
+ 
+    .. method:: set < other
+ 
+-      Test whether the set is a true subset of *other*, that is,
++      Test whether the set is a proper subset of *other*, that is,
+       ``set <= other and set != other``.
+ 
+    .. method:: issuperset(other)
+@@ -2795,7 +2850,7 @@
+ 
+    .. method:: set > other
+ 
+-      Test whether the set is a true superset of *other*, that is, ``set >=
++      Test whether the set is a proper superset of *other*, that is, ``set >=
+       other and set != other``.
+ 
+    .. method:: union(other, ...)
+@@ -2926,7 +2981,7 @@
+    statement: del
+    builtin: len
+ 
+-A :dfn:`mapping` object maps :term:`hashable` values to arbitrary objects.
++A :term:`mapping` object maps :term:`hashable` values to arbitrary objects.
+ Mappings are mutable objects.  There is currently only one standard mapping
+ type, the :dfn:`dictionary`.  (For other containers see the built-in
+ :class:`list`, :class:`set`, and :class:`tuple` classes, and the
+@@ -2945,33 +3000,41 @@
+ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
+ 'jack', 4127: 'sjoerd'}``, or by the :class:`dict` constructor.
+ 
+-.. class:: dict([arg])
+-
+-   Return a new dictionary initialized from an optional positional argument or
+-   from a set of keyword arguments.  If no arguments are given, return a new
+-   empty dictionary.  If the positional argument *arg* is a mapping object,
+-   return a dictionary mapping the same keys to the same values as does the
+-   mapping object.  Otherwise the positional argument must be a sequence, a
+-   container that supports iteration, or an iterator object.  The elements of
+-   the argument must each also be of one of those kinds, and each must in turn
+-   contain exactly two objects.  The first is used as a key in the new
+-   dictionary, and the second as the key's value.  If a given key is seen more
+-   than once, the last value associated with it is retained in the new
++.. class:: dict(**kwarg)
++           dict(mapping, **kwarg)
++           dict(iterable, **kwarg)
++
++   Return a new dictionary initialized from an optional positional argument
++   and a possibly empty set of keyword arguments.
++
++   If no positional argument is given, an empty dictionary is created.
++   If a positional argument is given and it is a mapping object, a dictionary
++   is created with the same key-value pairs as the mapping object.  Otherwise,
++   the positional argument must be an :term:`iterator` object.  Each item in
++   the iterable must itself be an iterator with exactly two objects.  The
++   first object of each item becomes a key in the new dictionary, and the
++   second object the corresponding value.  If a key occurs more than once, the
++   last value for that key becomes the corresponding value in the new
+    dictionary.
+ 
+-   If keyword arguments are given, the keywords themselves with their associated
+-   values are added as items to the dictionary.  If a key is specified both in
+-   the positional argument and as a keyword argument, the value associated with
+-   the keyword is retained in the dictionary.  For example, these all return a
+-   dictionary equal to ``{"one": 1, "two": 2}``:
+-
+-   * ``dict(one=1, two=2)``
+-   * ``dict({'one': 1, 'two': 2})``
+-   * ``dict(zip(('one', 'two'), (1, 2)))``
+-   * ``dict([['two', 2], ['one', 1]])``
+-
+-   The first example only works for keys that are valid Python identifiers; the
+-   others work with any valid keys.
++   If keyword arguments are given, the keyword arguments and their values are
++   added to the dictionary created from the positional argument.  If a key
++   being added is already present, the value from the keyword argument
++   replaces the value from the positional argument.
++
++   To illustrate, the following examples all return a dictionary equal to
++   ``{"one": 1, "two": 2, "three": 3}``::
++
++      >>> a = dict(one=1, two=2, three=3)
++      >>> b = {'one': 1, 'two': 2, 'three': 3}
++      >>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))
++      >>> d = dict([('two', 2), ('one', 1), ('three', 3)])
++      >>> e = dict({'three': 3, 'one': 1, 'two': 2})
++      >>> a == b == c == d == e
++      True
++
++   Providing keyword arguments as in the first example only works for keys that
++   are valid Python identifiers.  Otherwise, any valid keys can be used.
+ 
+ 
+    These are the operations that dictionaries support (and therefore, custom
+@@ -3333,16 +3396,22 @@
+ Like function objects, bound method objects support getting arbitrary
+ attributes.  However, since method attributes are actually stored on the
+ underlying function object (``meth.__func__``), setting method attributes on
+-bound methods is disallowed.  Attempting to set a method attribute results in a
+-:exc:`TypeError` being raised.  In order to set a method attribute, you need to
+-explicitly set it on the underlying function object::
+-
+-   class C:
+-       def method(self):
+-           pass
+-
+-   c = C()
+-   c.method.__func__.whoami = 'my name is c'
++bound methods is disallowed.  Attempting to set an attribute on a method
++results in an :exc:`AttributeError` being raised.  In order to set a method
++attribute, you need to explicitly set it on the underlying function object::
++
++   >>> class C:
++   ...     def method(self):
++   ...         pass
++   ...
++   >>> c = C()
++   >>> c.method.whoami = 'my name is method'  # can't set on the method
++   Traceback (most recent call last):
++     File "<stdin>", line 1, in <module>
++   AttributeError: 'method' object has no attribute 'whoami'
++   >>> c.method.__func__.whoami = 'my name is method'
++   >>> c.method.whoami
++   'my name is method'
+ 
+ See :ref:`types` for more information.
+ 
+diff -r bd8afb90ebf2 Doc/library/string.rst
+--- a/Doc/library/string.rst
++++ b/Doc/library/string.rst
+@@ -10,7 +10,7 @@
+ 
+ .. seealso::
+ 
+-   :ref:`typesseq`
++   :ref:`textseq`
+ 
+    :ref:`string-methods`
+ 
+@@ -100,7 +100,7 @@
+       This function does the actual work of formatting.  It is exposed as a
+       separate function for cases where you want to pass in a predefined
+       dictionary of arguments, rather than unpacking and repacking the
+-      dictionary as individual arguments using the ``*args`` and ``**kwds``
++      dictionary as individual arguments using the ``*args`` and ``**kwargs``
+       syntax.  :meth:`vformat` does the work of breaking up the format string
+       into character data and replacement fields.  It calls the various
+       methods described below.
+@@ -610,7 +610,7 @@
+    3232235521
+    >>>
+    >>> width = 5
+-   >>> for num in range(5,12):
++   >>> for num in range(5,12): #doctest: +NORMALIZE_WHITESPACE
+    ...     for base in 'dXob':
+    ...         print('{0:{width}{base}}'.format(num, base=base, width=width), end=' ')
+    ...     print()
+@@ -698,7 +698,7 @@
+    >>> Template('Give $who $100').substitute(d)
+    Traceback (most recent call last):
+    [...]
+-   ValueError: Invalid placeholder in string: line 1, col 10
++   ValueError: Invalid placeholder in string: line 1, col 11
+    >>> Template('$who likes $what').substitute(d)
+    Traceback (most recent call last):
+    [...]
+diff -r bd8afb90ebf2 Doc/library/subprocess.rst
+--- a/Doc/library/subprocess.rst
++++ b/Doc/library/subprocess.rst
+@@ -22,8 +22,8 @@
+    :pep:`324` -- PEP proposing the subprocess module
+ 
+ 
+-Using the subprocess Module
+----------------------------
++Using the :mod:`subprocess` Module
++----------------------------------
+ 
+ The recommended approach to invoking subprocesses is to use the following
+ convenience functions for all use cases they can handle. For more advanced
+@@ -307,10 +307,14 @@
+       :meth:`Popen.communicate` method.
+ 
+    If *shell* is ``True``, the specified command will be executed through
+-   the shell. This can be useful if you are using Python primarily for the
++   the shell.  This can be useful if you are using Python primarily for the
+    enhanced control flow it offers over most system shells and still want
+-   access to other shell features such as filename wildcards, shell pipes and
+-   environment variable expansion.
++   convenient access to other shell features such as shell pipes, filename
++   wildcards, environment variable expansion, and expansion of ``~`` to a
++   user's home directory.  However, note that Python itself offers
++   implementations of many shell-like features (in particular, :mod:`glob`,
++   :mod:`fnmatch`, :func:`os.walk`, :func:`os.path.expandvars`,
++   :func:`os.path.expanduser`, and :mod:`shutil`).
+ 
+    .. versionchanged:: 3.3
+       When *universal_newlines* is ``True``, the class uses the encoding
+@@ -324,8 +328,8 @@
+       untrusted source makes a program vulnerable to `shell injection
+       <http://en.wikipedia.org/wiki/Shell_injection#Shell_injection>`_,
+       a serious security flaw which can result in arbitrary command execution.
+-      For this reason, the use of *shell=True* is **strongly discouraged** in cases
+-      where the command string is constructed from external input::
++      For this reason, the use of ``shell=True`` is **strongly discouraged**
++      in cases where the command string is constructed from external input::
+ 
+          >>> from subprocess import call
+          >>> filename = input("What file would you like to display?\n")
+@@ -337,6 +341,10 @@
+       from this vulnerability; see the Note in the :class:`Popen` constructor
+       documentation for helpful hints in getting ``shell=False`` to work.
+ 
++      When using ``shell=True``, :func:`shlex.quote` can be used to properly
++      escape whitespace and shell metacharacters in strings that are going to
++      be used to construct shell commands.
++
+ These options, along with all of the other options, are described in more
+ detail in the :class:`Popen` constructor documentation.
+ 
+@@ -350,24 +358,27 @@
+ functions.
+ 
+ 
+-.. class:: Popen(args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=True, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0, restore_signals=True, start_new_session=False, pass_fds=())
++.. class:: Popen(args, bufsize=0, executable=None, stdin=None, stdout=None, \
++                 stderr=None, preexec_fn=None, close_fds=True, shell=False, \
++                 cwd=None, env=None, universal_newlines=False, \
++                 startupinfo=None, creationflags=0, restore_signals=True, \
++                 start_new_session=False, pass_fds=())
+ 
+-   Arguments are:
++   Execute a child program in a new process.  On Unix, the class uses
++   :meth:`os.execvp`-like behavior to execute the child program.  On Windows,
++   the class uses the Windows ``CreateProcess()`` function.  The arguments to
++   :class:`Popen` are as follows.
+ 
+-   *args* should be a string, or a sequence of program arguments.  The program
+-   to execute is normally the first item in the args sequence or the string if
+-   a string is given, but can be explicitly set by using the *executable*
+-   argument.  When *executable* is given, the first item in the args sequence
+-   is still treated by most programs as the command name, which can then be
+-   different from the actual executable name.  On Unix, it becomes the display
+-   name for the executing program in utilities such as :program:`ps`.
++   *args* should be a sequence of program arguments or else a single string.
++   By default, the program to execute is the first item in *args* if *args* is
++   a sequence.  If *args* is a string, the interpretation is
++   platform-dependent and described below.  See the *shell* and *executable*
++   arguments for additional differences from the default behavior.  Unless
++   otherwise stated, it is recommended to pass *args* as a sequence.
+ 
+-   On Unix, with *shell=False* (default): In this case, the Popen class uses
+-   :meth:`os.execvp` like behavior to execute the child program.
+-   *args* should normally be a
+-   sequence.  If a string is specified for *args*, it will be used as the name
+-   or path of the program to execute; this will only work if the program is
+-   being given no arguments.
++   On Unix, if *args* is a string, the string is interpreted as the name or
++   path of the program to execute.  However, this can only be done if not
++   passing arguments to the program.
+ 
+    .. note::
+ 
+@@ -388,27 +399,37 @@
+       used in the shell (such as filenames containing spaces or the *echo* command
+       shown above) are single list elements.
+ 
+-   On Unix, with *shell=True*: If args is a string, it specifies the command
+-   string to execute through the shell.  This means that the string must be
++   On Windows, if *args* is a sequence, it will be converted to a string in a
++   manner described in :ref:`converting-argument-sequence`.  This is because
++   the underlying ``CreateProcess()`` operates on strings.
++
++   The *shell* argument (which defaults to *False*) specifies whether to use
++   the shell as the program to execute.  If *shell* is *True*, it is
++   recommended to pass *args* as a string rather than as a sequence.
++
++   On Unix with ``shell=True``, the shell defaults to :file:`/bin/sh`.  If
++   *args* is a string, the string specifies the command
++   to execute through the shell.  This means that the string must be
+    formatted exactly as it would be when typed at the shell prompt.  This
+    includes, for example, quoting or backslash escaping filenames with spaces in
+    them.  If *args* is a sequence, the first item specifies the command string, and
+    any additional items will be treated as additional arguments to the shell
+-   itself.  That is to say, *Popen* does the equivalent of::
++   itself.  That is to say, :class:`Popen` does the equivalent of::
+ 
+       Popen(['/bin/sh', '-c', args[0], args[1], ...])
+ 
++   On Windows with ``shell=True``, the :envvar:`COMSPEC` environment variable
++   specifies the default shell.  The only time you need to specify
++   ``shell=True`` on Windows is when the command you wish to execute is built
++   into the shell (e.g. :command:`dir` or :command:`copy`).  You do not need
++   ``shell=True`` to run a batch file or console-based executable.
++
+    .. warning::
+ 
+-      Enabling this option can be a security hazard if combined with untrusted
+-      input. See the warning under :ref:`frequently-used-arguments`
++      Passing ``shell=True`` can be a security hazard if combined with
++      untrusted input.  See the warning under :ref:`frequently-used-arguments`
+       for details.
+ 
+-   On Windows: the :class:`Popen` class uses CreateProcess() to execute the
+-   child program, which operates on strings.  If *args* is a sequence, it will
+-   be converted to a string in a manner described in
+-   :ref:`converting-argument-sequence`.
+-
+    *bufsize*, if given, has the same meaning as the corresponding argument to the
+    built-in open() function: :const:`0` means unbuffered, :const:`1` means line
+    buffered, any other positive value means use a buffer of (approximately) that
+@@ -421,15 +442,15 @@
+       enable buffering by setting *bufsize* to either -1 or a large enough
+       positive value (such as 4096).
+ 
+-   The *executable* argument specifies the program to execute. It is very seldom
+-   needed: Usually, the program to execute is defined by the *args* argument. If
+-   ``shell=True``, the *executable* argument specifies which shell to use. On Unix,
+-   the default shell is :file:`/bin/sh`.  On Windows, the default shell is
+-   specified by the :envvar:`COMSPEC` environment variable. The only reason you
+-   would need to specify ``shell=True`` on Windows is where the command you
+-   wish to execute is actually built in to the shell, eg ``dir``, ``copy``.
+-   You don't need ``shell=True`` to run a batch file, nor to run a console-based
+-   executable.
++   The *executable* argument specifies a replacement program to execute.   It
++   is very seldom needed.  When ``shell=False``, *executable* replaces the
++   program to execute specified by *args*.  However, the original *args* is
++   still passed to the program.  Most programs treat the program specified
++   by *args* as the command name, which can then be different from the program
++   actually executed.  On Unix, the *args* name
++   becomes the display name for the executable in utilities such as
++   :program:`ps`.  If ``shell=True``, on Unix the *executable* argument
++   specifies a replacement shell for the default :file:`/bin/sh`.
+ 
+    *stdin*, *stdout* and *stderr* specify the executed program's standard input,
+    standard output and standard error file handles, respectively.  Valid values
+@@ -480,10 +501,10 @@
+    .. versionadded:: 3.2
+       The *pass_fds* parameter was added.
+ 
+-   If *cwd* is not ``None``, the child's current directory will be changed to *cwd*
+-   before it is executed.  Note that this directory is not considered when
+-   searching the executable, so you can't specify the program's path relative to
+-   *cwd*.
++   If *cwd* is not ``None``, the function changes the working directory to
++   *cwd* before executing the child.  In particular, the function looks for
++   *executable* (or for the first item in *args*) relative to *cwd* if the
++   executable path is a relative path.
+ 
+    If *restore_signals* is True (the default) all signals that Python has set to
+    SIG_IGN are restored to SIG_DFL in the child process before the exec.
+@@ -669,8 +690,8 @@
+ 
+ .. warning::
+ 
+-   Use :meth:`communicate` rather than :attr:`.stdin.write <stdin>`,
+-   :attr:`.stdout.read <stdout>` or :attr:`.stderr.read <stderr>` to avoid
++   Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write <Popen.stdin>`,
++   :attr:`.stdout.read <Popen.stdout>` or :attr:`.stderr.read <Popen.stderr>` to avoid
+    deadlocks due to any of the other OS pipe buffers filling up and blocking the
+    child process.
+ 
+@@ -818,8 +839,8 @@
+ 
+ .. _subprocess-replacements:
+ 
+-Replacing Older Functions with the subprocess Module
+-----------------------------------------------------
++Replacing Older Functions with the :mod:`subprocess` Module
++-----------------------------------------------------------
+ 
+ In this section, "a becomes b" means that b can be used as a replacement for a.
+ 
+@@ -835,7 +856,7 @@
+    the raised exception.
+ 
+ In the following examples, we assume that the relevant functions have already
+-been imported from the subprocess module.
++been imported from the :mod:`subprocess` module.
+ 
+ 
+ Replacing /bin/sh shell backquote
+diff -r bd8afb90ebf2 Doc/library/sys.rst
+--- a/Doc/library/sys.rst
++++ b/Doc/library/sys.rst
+@@ -215,21 +215,6 @@
+    a traceback object (see the Reference Manual) which encapsulates the call
+    stack at the point where the exception originally occurred.
+ 
+-   .. warning::
+-
+-      Assigning the *traceback* return value to a local variable in a function
+-      that is handling an exception will cause a circular reference.  Since most
+-      functions don't need access to the traceback, the best solution is to use
+-      something like ``exctype, value = sys.exc_info()[:2]`` to extract only the
+-      exception type and value.  If you do need the traceback, make sure to
+-      delete it after use (best done with a :keyword:`try`
+-      ... :keyword:`finally` statement) or to call :func:`exc_info` in a
+-      function that does not itself handle an exception.
+-
+-      Such cycles are normally automatically reclaimed when garbage collection
+-      is enabled and they become unreachable, but it remains more efficient to
+-      avoid creating cycles.
+-
+ 
+ .. data:: exec_prefix
+ 
+@@ -783,7 +768,9 @@
+    current directory first.  Notice that the script directory is inserted *before*
+    the entries inserted as a result of :envvar:`PYTHONPATH`.
+ 
+-   A program is free to modify this list for its own purposes.
++   A program is free to modify this list for its own purposes.  Only strings
++   and bytes should be added to :data:`sys.path`; all other data types are
++   ignored during import.
+ 
+ 
+    .. seealso::
+@@ -831,7 +818,7 @@
+    For other systems, the values are:
+ 
+    ================ ===========================
+-   System           :data:`platform` value
++   System           ``platform`` value
+    ================ ===========================
+    Linux            ``'linux'``
+    Windows          ``'win32'``
+diff -r bd8afb90ebf2 Doc/library/syslog.rst
+--- a/Doc/library/syslog.rst
++++ b/Doc/library/syslog.rst
+@@ -17,7 +17,8 @@
+ The module defines the following functions:
+ 
+ 
+-.. function:: syslog([priority,] message)
++.. function:: syslog(message)
++              syslog(priority, message)
+ 
+    Send the string *message* to the system logger.  A trailing newline is added
+    if necessary.  Each message is tagged with a priority composed of a
+diff -r bd8afb90ebf2 Doc/library/tarfile.rst
+--- a/Doc/library/tarfile.rst
++++ b/Doc/library/tarfile.rst
+@@ -669,11 +669,11 @@
+ 
+ * The POSIX.1-1988 ustar format (:const:`USTAR_FORMAT`). It supports filenames
+   up to a length of at best 256 characters and linknames up to 100 characters. The
+-  maximum file size is 8 gigabytes. This is an old and limited but widely
++  maximum file size is 8 GiB. This is an old and limited but widely
+   supported format.
+ 
+ * The GNU tar format (:const:`GNU_FORMAT`). It supports long filenames and
+-  linknames, files bigger than 8 gigabytes and sparse files. It is the de facto
++  linknames, files bigger than 8 GiB and sparse files. It is the de facto
+   standard on GNU/Linux systems. :mod:`tarfile` fully supports the GNU tar
+   extensions for long names, sparse file support is read-only.
+ 
+diff -r bd8afb90ebf2 Doc/library/tempfile.rst
+--- a/Doc/library/tempfile.rst
++++ b/Doc/library/tempfile.rst
+@@ -82,9 +82,14 @@
+    causes the file to roll over to an on-disk file regardless of its size.
+ 
+    The returned object is a file-like object whose :attr:`_file` attribute
+-   is either a :class:`StringIO` object or a true file object, depending on
+-   whether :func:`rollover` has been called. This file-like object can be
+-   used in a :keyword:`with` statement, just like a normal file.
++   is either a :class:`BytesIO` or :class:`StringIO` object (depending on
++   whether binary or text *mode* was specified) or a true file
++   object, depending on whether :func:`rollover` has been called.  This
++   file-like object can be used in a :keyword:`with` statement, just like
++   a normal file.
++
++   .. versionchanged:: 3.3
++      the truncate method now accepts a ``size`` argument.
+ 
+ 
+ .. function:: TemporaryDirectory(suffix='', prefix='tmp', dir=None)
+diff -r bd8afb90ebf2 Doc/library/test.rst
+--- a/Doc/library/test.rst
++++ b/Doc/library/test.rst
+@@ -364,9 +364,9 @@
+ 
+ .. function:: captured_stdout()
+ 
+-   A context manager that runs the :keyword:`with` statement body using
+-   a :class:`StringIO.StringIO` object as sys.stdout.  That object can be
+-   retrieved using the ``as`` clause of the :keyword:`with` statement.
++   A context manager that runs the :keyword:`with` statement body using a
++   :class:`io.StringIO` object as sys.stdout.  That object can be retrieved
++   using the ``as`` clause of the :keyword:`with` statement.
+ 
+    Example use::
+ 
+diff -r bd8afb90ebf2 Doc/library/textwrap.rst
+--- a/Doc/library/textwrap.rst
++++ b/Doc/library/textwrap.rst
+@@ -25,6 +25,9 @@
+    Optional keyword arguments correspond to the instance attributes of
+    :class:`TextWrapper`, documented below.  *width* defaults to ``70``.
+ 
++   See the :meth:`TextWrapper.wrap` method for additional details on how
++   :func:`wrap` behaves.
++
+ 
+ .. function:: fill(text, width=70, **kwargs)
+ 
+@@ -167,15 +170,18 @@
+ 
+    .. attribute:: drop_whitespace
+ 
+-      (default: ``True``) If true, whitespace that, after wrapping, happens to
+-      end up at the beginning or end of a line is dropped (leading whitespace in
+-      the first line is always preserved, though).
++      (default: ``True``) If true, whitespace at the beginning and ending of
++      every line (after wrapping but before indenting) is dropped.
++      Whitespace at the beginning of the paragraph, however, is not dropped
++      if non-whitespace follows it.  If whitespace being dropped takes up an
++      entire line, the whole line is dropped.
+ 
+ 
+    .. attribute:: initial_indent
+ 
+       (default: ``''``) String that will be prepended to the first line of
+-      wrapped output.  Counts towards the length of the first line.
++      wrapped output.  Counts towards the length of the first line.  The empty
++      string is not indented.
+ 
+ 
+    .. attribute:: subsequent_indent
+@@ -236,8 +242,9 @@
+ 
+       Wraps the single paragraph in *text* (a string) so every line is at most
+       :attr:`width` characters long.  All wrapping options are taken from
+-      instance attributes of the :class:`TextWrapper` instance. Returns a list
+-      of output lines, without final newlines.
++      instance attributes of the :class:`TextWrapper` instance.  Returns a list
++      of output lines, without final newlines.  If the wrapped output has no
++      content, the returned list is empty.
+ 
+ 
+    .. method:: fill(text)
+diff -r bd8afb90ebf2 Doc/library/threading.rst
+--- a/Doc/library/threading.rst
++++ b/Doc/library/threading.rst
+@@ -21,7 +21,7 @@
+    supported by this module.
+ 
+ 
+-This module defines the following functions and objects:
++This module defines the following functions:
+ 
+ 
+ .. function:: active_count()
+@@ -30,16 +30,6 @@
+    count is equal to the length of the list returned by :func:`.enumerate`.
+ 
+ 
+-.. function:: Condition()
+-   :noindex:
+-
+-   A factory function that returns a new condition variable object. A condition
+-   variable allows one or more threads to wait until they are notified by another
+-   thread.
+-
+-   See :ref:`condition-objects`.
+-
+-
+ .. function:: current_thread()
+ 
+    Return the current :class:`Thread` object, corresponding to the caller's thread
+@@ -67,88 +57,6 @@
+    and threads that have not yet been started.
+ 
+ 
+-.. function:: Event()
+-   :noindex:
+-
+-   A factory function that returns a new event object.  An event manages a flag
+-   that can be set to true with the :meth:`~Event.set` method and reset to false
+-   with the :meth:`clear` method.  The :meth:`wait` method blocks until the flag
+-   is true.
+-
+-   See :ref:`event-objects`.
+-
+-
+-.. class:: local
+-
+-   A class that represents thread-local data.  Thread-local data are data whose
+-   values are thread specific.  To manage thread-local data, just create an
+-   instance of :class:`local` (or a subclass) and store attributes on it::
+-
+-      mydata = threading.local()
+-      mydata.x = 1
+-
+-   The instance's values will be different for separate threads.
+-
+-   For more details and extensive examples, see the documentation string of the
+-   :mod:`_threading_local` module.
+-
+-
+-.. function:: Lock()
+-
+-   A factory function that returns a new primitive lock object.  Once a thread has
+-   acquired it, subsequent attempts to acquire it block, until it is released; any
+-   thread may release it.
+-
+-   See :ref:`lock-objects`.
+-
+-
+-.. function:: RLock()
+-
+-   A factory function that returns a new reentrant lock object. A reentrant lock
+-   must be released by the thread that acquired it. Once a thread has acquired a
+-   reentrant lock, the same thread may acquire it again without blocking; the
+-   thread must release it once for each time it has acquired it.
+-
+-   See :ref:`rlock-objects`.
+-
+-
+-.. function:: Semaphore(value=1)
+-   :noindex:
+-
+-   A factory function that returns a new semaphore object.  A semaphore manages a
+-   counter representing the number of :meth:`release` calls minus the number of
+-   :meth:`acquire` calls, plus an initial value. The :meth:`acquire` method blocks
+-   if necessary until it can return without making the counter negative.  If not
+-   given, *value* defaults to 1.
+-
+-   See :ref:`semaphore-objects`.
+-
+-
+-.. function:: BoundedSemaphore(value=1)
+-
+-   A factory function that returns a new bounded semaphore object.  A bounded
+-   semaphore checks to make sure its current value doesn't exceed its initial
+-   value.  If it does, :exc:`ValueError` is raised. In most situations semaphores
+-   are used to guard resources with limited capacity.  If the semaphore is released
+-   too many times it's a sign of a bug.  If not given, *value* defaults to 1.
+-
+-
+-.. class:: Thread
+-
+-   A class that represents a thread of control.  This class can be safely
+-   subclassed in a limited fashion.
+-
+-   See :ref:`thread-objects`.
+-
+-
+-.. class:: Timer
+-   :noindex:
+-
+-   A thread that executes a function after a specified interval has passed.
+-
+-   See :ref:`timer-objects`.
+-
+-
+ .. function:: settrace(func)
+ 
+    .. index:: single: trace function
+@@ -172,15 +80,15 @@
+    Return the thread stack size used when creating new threads.  The optional
+    *size* argument specifies the stack size to be used for subsequently created
+    threads, and must be 0 (use platform or configured default) or a positive
+-   integer value of at least 32,768 (32kB). If changing the thread stack size is
++   integer value of at least 32,768 (32 KiB). If changing the thread stack size is
+    unsupported, a :exc:`RuntimeError` is raised.  If the specified stack size is
+-   invalid, a :exc:`ValueError` is raised and the stack size is unmodified.  32kB
++   invalid, a :exc:`ValueError` is raised and the stack size is unmodified.  32 KiB
+    is currently the minimum supported stack size value to guarantee sufficient
+    stack space for the interpreter itself.  Note that some platforms may have
+    particular restrictions on values for the stack size, such as requiring a
+-   minimum stack size > 32kB or requiring allocation in multiples of the system
++   minimum stack size > 32 KiB or requiring allocation in multiples of the system
+    memory page size - platform documentation should be referred to for more
+-   information (4kB pages are common; using multiples of 4096 for the stack size is
++   information (4 KiB pages are common; using multiples of 4096 for the stack size is
+    the suggested approach in the absence of more specific information).
+    Availability: Windows, systems with POSIX threads.
+ 
+@@ -197,7 +105,8 @@
+    .. versionadded:: 3.2
+ 
+ 
+-Detailed interfaces for the objects are documented below.
++This module defines a number of classes, which are detailed in the sections
++below.
+ 
+ The design of this module is loosely based on Java's threading model. However,
+ where Java makes locks and condition variables basic behavior of every object,
+@@ -210,17 +119,38 @@
+ All of the methods described below are executed atomically.
+ 
+ 
++Thread-Local Data
++-----------------
++
++Thread-local data is data whose values are thread specific.  To manage
++thread-local data, just create an instance of :class:`local` (or a
++subclass) and store attributes on it::
++
++  mydata = threading.local()
++  mydata.x = 1
++
++The instance's values will be different for separate threads.
++
++
++.. class:: local()
++
++   A class that represents thread-local data.
++
++   For more details and extensive examples, see the documentation string of the
++   :mod:`_threading_local` module.
++
++
+ .. _thread-objects:
+ 
+ Thread Objects
+ --------------
+ 
+-This class represents an activity that is run in a separate thread of control.
+-There are two ways to specify the activity: by passing a callable object to the
+-constructor, or by overriding the :meth:`~Thread.run` method in a subclass.
+-No other methods (except for the constructor) should be overridden in a
+-subclass.  In other words,  *only*  override the :meth:`~Thread.__init__`
+-and :meth:`~Thread.run` methods of this class.
++The :class:`Thread` class represents an activity that is run in a separate
++thread of control.  There are two ways to specify the activity: by passing a
++callable object to the constructor, or by overriding the :meth:`~Thread.run`
++method in a subclass.  No other methods (except for the constructor) should be
++overridden in a subclass.  In other words, *only*  override the
++:meth:`~Thread.__init__` and :meth:`~Thread.run` methods of this class.
+ 
+ Once a thread object is created, its activity must be started by calling the
+ thread's :meth:`~Thread.start` method.  This invokes the :meth:`~Thread.run`
+@@ -244,6 +174,12 @@
+ through the :attr:`~Thread.daemon` property or the *daemon* constructor
+ argument.
+ 
++.. note::
++   Daemon threads are abruptly stopped at shutdown.  Their resources (such
++   as open files, database transactions, etc.) may not be released properly.
++   If you want your threads to stop gracefully, make them non-daemonic and
++   use a suitable signalling mechanism such as an :class:`Event`.
++
+ There is a "main thread" object; this corresponds to the initial thread of
+ control in the Python program.  It is not a daemon thread.
+ 
+@@ -255,8 +191,8 @@
+ since it is impossible to detect the termination of alien threads.
+ 
+ 
+-.. class:: Thread(group=None, target=None, name=None, args=(), kwargs={},
+-                  verbose=None, *, daemon=None)
++.. class:: Thread(group=None, target=None, name=None, args=(), kwargs={}, *, \
++                  daemon=None)
+ 
+    This constructor should always be called with keyword arguments.  Arguments
+    are:
+@@ -275,8 +211,6 @@
+    *kwargs* is a dictionary of keyword arguments for the target invocation.
+    Defaults to ``{}``.
+ 
+-   *verbose* is a flag used for debugging messages.
+-
+    If not ``None``, *daemon* explicitly sets whether the thread is daemonic.
+    If ``None`` (the default), the daemonic property is inherited from the
+    current thread.
+@@ -380,10 +314,10 @@
+ 
+ .. impl-detail::
+ 
+-   Due to the :term:`Global Interpreter Lock`, in CPython only one thread
++   In CPython, due to the :term:`Global Interpreter Lock`, only one thread
+    can execute Python code at once (even though certain performance-oriented
+    libraries might overcome this limitation).
+-   If you want your application to make better of use of the computational
++   If you want your application to make better use of the computational
+    resources of multi-core machines, you are advised to use
+    :mod:`multiprocessing` or :class:`concurrent.futures.ProcessPoolExecutor`.
+    However, threading is still an appropriate model if you want to run
+@@ -421,45 +355,55 @@
+ All methods are executed atomically.
+ 
+ 
+-.. method:: Lock.acquire(blocking=True, timeout=-1)
++.. class:: Lock()
+ 
+-   Acquire a lock, blocking or non-blocking.
++   The class implementing primitive lock objects.  Once a thread has acquired a
++   lock, subsequent attempts to acquire it block, until it is released; any
++   thread may release it.
+ 
+-   When invoked with the *blocking* argument set to ``True`` (the default),
+-   block until the lock is unlocked, then set it to locked and return ``True``.
++   .. versionchanged:: 3.3
++      Changed from a factory function to a class.
+ 
+-   When invoked with the *blocking* argument set to ``False``, do not block.
+-   If a call with *blocking* set to ``True`` would block, return ``False``
+-   immediately; otherwise, set the lock to locked and return ``True``.
+ 
+-   When invoked with the floating-point *timeout* argument set to a positive
+-   value, block for at most the number of seconds specified by *timeout*
+-   and as long as the lock cannot be acquired.  A negative *timeout* argument
+-   specifies an unbounded wait.  It is forbidden to specify a *timeout*
+-   when *blocking* is false.
++   .. method:: acquire(blocking=True, timeout=-1)
+ 
+-   The return value is ``True`` if the lock is acquired successfully,
+-   ``False`` if not (for example if the *timeout* expired).
++      Acquire a lock, blocking or non-blocking.
+ 
+-   .. versionchanged:: 3.2
+-      The *timeout* parameter is new.
++      When invoked with the *blocking* argument set to ``True`` (the default),
++      block until the lock is unlocked, then set it to locked and return ``True``.
+ 
+-   .. versionchanged:: 3.2
+-      Lock acquires can now be interrupted by signals on POSIX.
++      When invoked with the *blocking* argument set to ``False``, do not block.
++      If a call with *blocking* set to ``True`` would block, return ``False``
++      immediately; otherwise, set the lock to locked and return ``True``.
+ 
++      When invoked with the floating-point *timeout* argument set to a positive
++      value, block for at most the number of seconds specified by *timeout*
++      and as long as the lock cannot be acquired.  A negative *timeout* argument
++      specifies an unbounded wait.  It is forbidden to specify a *timeout*
++      when *blocking* is false.
+ 
+-.. method:: Lock.release()
++      The return value is ``True`` if the lock is acquired successfully,
++      ``False`` if not (for example if the *timeout* expired).
+ 
+-   Release a lock.  This can be called from any thread, not only the thread
+-   which has acquired the lock.
++      .. versionchanged:: 3.2
++         The *timeout* parameter is new.
+ 
+-   When the lock is locked, reset it to unlocked, and return.  If any other threads
+-   are blocked waiting for the lock to become unlocked, allow exactly one of them
+-   to proceed.
++      .. versionchanged:: 3.2
++         Lock acquires can now be interrupted by signals on POSIX.
+ 
+-   When invoked on an unlocked lock, a :exc:`RuntimeError` is raised.
+ 
+-   There is no return value.
++   .. method:: release()
++
++      Release a lock.  This can be called from any thread, not only the thread
++      which has acquired the lock.
++
++      When the lock is locked, reset it to unlocked, and return.  If any other threads
++      are blocked waiting for the lock to become unlocked, allow exactly one of them
++      to proceed.
++
++      When invoked on an unlocked lock, a :exc:`RuntimeError` is raised.
++
++      There is no return value.
+ 
+ 
+ .. _rlock-objects:
+@@ -483,47 +427,59 @@
+ Reentrant locks also support the :ref:`context manager protocol <with-locks>`.
+ 
+ 
+-.. method:: RLock.acquire(blocking=True, timeout=-1)
++.. class:: RLock()
+ 
+-   Acquire a lock, blocking or non-blocking.
++   This class implements reentrant lock objects.  A reentrant lock must be
++   released by the thread that acquired it.  Once a thread has acquired a
++   reentrant lock, the same thread may acquire it again without blocking; the
++   thread must release it once for each time it has acquired it.
+ 
+-   When invoked without arguments: if this thread already owns the lock, increment
+-   the recursion level by one, and return immediately.  Otherwise, if another
+-   thread owns the lock, block until the lock is unlocked.  Once the lock is
+-   unlocked (not owned by any thread), then grab ownership, set the recursion level
+-   to one, and return.  If more than one thread is blocked waiting until the lock
+-   is unlocked, only one at a time will be able to grab ownership of the lock.
+-   There is no return value in this case.
++   Note that ``RLock`` is actually a factory function which returns an instance
++   of the most efficient version of the concrete RLock class that is supported
++   by the platform.
+ 
+-   When invoked with the *blocking* argument set to true, do the same thing as when
+-   called without arguments, and return true.
+ 
+-   When invoked with the *blocking* argument set to false, do not block.  If a call
+-   without an argument would block, return false immediately; otherwise, do the
+-   same thing as when called without arguments, and return true.
++   .. method:: acquire(blocking=True, timeout=-1)
+ 
+-   When invoked with the floating-point *timeout* argument set to a positive
+-   value, block for at most the number of seconds specified by *timeout*
+-   and as long as the lock cannot be acquired.  Return true if the lock has
+-   been acquired, false if the timeout has elapsed.
++      Acquire a lock, blocking or non-blocking.
+ 
+-   .. versionchanged:: 3.2
+-      The *timeout* parameter is new.
++      When invoked without arguments: if this thread already owns the lock, increment
++      the recursion level by one, and return immediately.  Otherwise, if another
++      thread owns the lock, block until the lock is unlocked.  Once the lock is
++      unlocked (not owned by any thread), then grab ownership, set the recursion level
++      to one, and return.  If more than one thread is blocked waiting until the lock
++      is unlocked, only one at a time will be able to grab ownership of the lock.
++      There is no return value in this case.
+ 
++      When invoked with the *blocking* argument set to true, do the same thing as when
++      called without arguments, and return true.
+ 
+-.. method:: RLock.release()
++      When invoked with the *blocking* argument set to false, do not block.  If a call
++      without an argument would block, return false immediately; otherwise, do the
++      same thing as when called without arguments, and return true.
+ 
+-   Release a lock, decrementing the recursion level.  If after the decrement it is
+-   zero, reset the lock to unlocked (not owned by any thread), and if any other
+-   threads are blocked waiting for the lock to become unlocked, allow exactly one
+-   of them to proceed.  If after the decrement the recursion level is still
+-   nonzero, the lock remains locked and owned by the calling thread.
++      When invoked with the floating-point *timeout* argument set to a positive
++      value, block for at most the number of seconds specified by *timeout*
++      and as long as the lock cannot be acquired.  Return true if the lock has
++      been acquired, false if the timeout has elapsed.
+ 
+-   Only call this method when the calling thread owns the lock. A
+-   :exc:`RuntimeError` is raised if this method is called when the lock is
+-   unlocked.
++      .. versionchanged:: 3.2
++         The *timeout* parameter is new.
+ 
+-   There is no return value.
++
++   .. method:: release()
++
++      Release a lock, decrementing the recursion level.  If after the decrement it is
++      zero, reset the lock to unlocked (not owned by any thread), and if any other
++      threads are blocked waiting for the lock to become unlocked, allow exactly one
++      of them to proceed.  If after the decrement the recursion level is still
++      nonzero, the lock remains locked and owned by the calling thread.
++
++      Only call this method when the calling thread owns the lock. A
++      :exc:`RuntimeError` is raised if this method is called when the lock is
++      unlocked.
++
++      There is no return value.
+ 
+ 
+ .. _condition-objects:
+@@ -558,10 +514,6 @@
+ the thread that called :meth:`~Condition.notify` or :meth:`~Condition.notify_all`
+ finally relinquishes ownership of the lock.
+ 
+-
+-Usage
+-^^^^^
+-
+ The typical programming style using condition variables uses the lock to
+ synchronize access to some shared state; threads that are interested in a
+ particular change of state call :meth:`~Condition.wait` repeatedly until they
+@@ -600,15 +552,18 @@
+ item to the buffer only needs to wake up one consumer thread.
+ 
+ 
+-Interface
+-^^^^^^^^^
++.. class:: Condition(lock=None)
+ 
+-.. class:: Condition(lock=None)
++   This class implements condition variable objects.  A condition variable
++   allows one or more threads to wait until they are notified by another thread.
+ 
+    If the *lock* argument is given and not ``None``, it must be a :class:`Lock`
+    or :class:`RLock` object, and it is used as the underlying lock.  Otherwise,
+    a new :class:`RLock` object is created and used as the underlying lock.
+ 
++   .. versionchanged:: 3.3
++      changed from a factory function to a class.
++
+    .. method:: acquire(*args)
+ 
+       Acquire the underlying lock. This method calls the corresponding method on
+@@ -718,10 +673,19 @@
+ 
+ .. class:: Semaphore(value=1)
+ 
++   This class implements semaphore objects.  A semaphore manages a counter
++   representing the number of :meth:`release` calls minus the number of
++   :meth:`acquire` calls, plus an initial value.  The :meth:`acquire` method
++   blocks if necessary until it can return without making the counter negative.
++   If not given, *value* defaults to 1.
++
+    The optional argument gives the initial *value* for the internal counter; it
+    defaults to ``1``. If the *value* given is less than 0, :exc:`ValueError` is
+    raised.
+ 
++   .. versionchanged:: 3.3
++      changed from a factory function to a class.
++
+    .. method:: acquire(blocking=True, timeout=None)
+ 
+       Acquire a semaphore.
+@@ -754,6 +718,18 @@
+       than zero again, wake up that thread.
+ 
+ 
++.. class:: BoundedSemaphore(value=1)
++
++   Class implementing bounded semaphore objects.  A bounded semaphore checks to
++   make sure its current value doesn't exceed its initial value.  If it does,
++   :exc:`ValueError` is raised. In most situations semaphores are used to guard
++   resources with limited capacity.  If the semaphore is released too many times
++   it's a sign of a bug.  If not given, *value* defaults to 1.
++
++   .. versionchanged:: 3.3
++      changed from a factory function to a class.
++
++
+ .. _semaphore-examples:
+ 
+ :class:`Semaphore` Example
+@@ -765,7 +741,7 @@
+ main thread would initialize the semaphore::
+ 
+    maxconnections = 5
+-   ...
++   # ...
+    pool_sema = BoundedSemaphore(value=maxconnections)
+ 
+ Once spawned, worker threads call the semaphore's acquire and release methods
+@@ -774,7 +750,7 @@
+    with pool_sema:
+        conn = connectdb()
+        try:
+-           ... use connection ...
++           # ... use connection ...
+        finally:
+            conn.close()
+ 
+@@ -797,7 +773,13 @@
+ 
+ .. class:: Event()
+ 
+-   The internal flag is initially false.
++   Class implementing event objects.  An event manages a flag that can be set to
++   true with the :meth:`~Event.set` method and reset to false with the
++   :meth:`clear` method.  The :meth:`wait` method blocks until the flag is true.
++   The flag is initially false.
++
++   .. versionchanged:: 3.3
++      changed from a factory function to a class.
+ 
+    .. method:: is_set()
+ 
+@@ -862,6 +844,9 @@
+    Create a timer that will run *function* with arguments *args* and  keyword
+    arguments *kwargs*, after *interval* seconds have passed.
+ 
++   .. versionchanged:: 3.3
++      changed from a factory function to a class.
++
+    .. method:: cancel()
+ 
+       Stop the timer, and cancel the execution of the timer's action.  This will
+diff -r bd8afb90ebf2 Doc/library/time.rst
+--- a/Doc/library/time.rst
++++ b/Doc/library/time.rst
+@@ -309,7 +309,7 @@
+ 
+    On Windows versions older than Vista, :func:`monotonic` detects
+    :c:func:`GetTickCount` integer overflow (32 bits, roll-over after 49.7 days).
+-   It increases an internal epoch (reference time by) 2\ :sup:`32` each time
++   It increases an internal epoch (reference time) by 2\ :sup:`32` each time
+    that an overflow is detected.  The epoch is stored in the process-local state
+    and so the value of :func:`monotonic` may be different in two Python
+    processes running for more than 49 days. On more recent versions of Windows
+@@ -557,7 +557,7 @@
+    :exc:`TypeError` is raised.
+ 
+   .. versionchanged:: 3.3
+-     :attr:`tm_gmtoff` and :attr:`tm_zone` attributes are avaliable on platforms
++     :attr:`tm_gmtoff` and :attr:`tm_zone` attributes are available on platforms
+      with C library supporting the corresponding fields in ``struct tm``.
+ 
+ .. function:: time()
+diff -r bd8afb90ebf2 Doc/library/timeit.rst
+--- a/Doc/library/timeit.rst
++++ b/Doc/library/timeit.rst
+@@ -14,113 +14,154 @@
+ --------------
+ 
+ This module provides a simple way to time small bits of Python code. It has both
+-command line as well as callable interfaces.  It avoids a number of common traps
+-for measuring execution times.  See also Tim Peters' introduction to the
+-"Algorithms" chapter in the Python Cookbook, published by O'Reilly.
++a :ref:`command-line-interface` as well as a :ref:`callable <python-interface>`
++one.  It avoids a number of common traps for measuring execution times.
++See also Tim Peters' introduction to the "Algorithms" chapter in the *Python
++Cookbook*, published by O'Reilly.
+ 
+-The module defines the following public class:
++
++Basic Examples
++--------------
++
++The following example shows how the :ref:`command-line-interface`
++can be used to compare three different expressions:
++
++.. code-block:: sh
++
++   $ python -m timeit '"-".join(str(n) for n in range(100))'
++   10000 loops, best of 3: 40.3 usec per loop
++   $ python -m timeit '"-".join([str(n) for n in range(100)])'
++   10000 loops, best of 3: 33.4 usec per loop
++   $ python -m timeit '"-".join(map(str, range(100)))'
++   10000 loops, best of 3: 25.2 usec per loop
++
++This can be achieved from the :ref:`python-interface` with::
++
++   >>> import timeit
++   >>> timeit.timeit('"-".join(str(n) for n in range(100))', number=10000)
++   0.8187260627746582
++   >>> timeit.timeit('"-".join([str(n) for n in range(100)])', number=10000)
++   0.7288308143615723
++   >>> timeit.timeit('"-".join(map(str, range(100)))', number=10000)
++   0.5858950614929199
++
++Note however that :mod:`timeit` will automatically determine the number of
++repetitions only when the command-line interface is used.  In the
++:ref:`timeit-examples` section you can find more advanced examples.
++
++
++.. _python-interface:
++
++Python Interface
++----------------
++
++The module defines three convenience functions and a public class:
++
++
++.. function:: timeit(stmt='pass', setup='pass', timer=<default timer>, number=1000000)
++
++   Create a :class:`Timer` instance with the given statement, *setup* code and
++   *timer* function and run its :meth:`.timeit` method with *number* executions.
++
++
++.. function:: repeat(stmt='pass', setup='pass', timer=<default timer>, repeat=3, number=1000000)
++
++   Create a :class:`Timer` instance with the given statement, *setup* code and
++   *timer* function and run its :meth:`.repeat` method with the given *repeat*
++   count and *number* executions.
++
++
++.. function:: default_timer()
++
++   The default timer, which is always :func:`time.perf_counter`.
++
++   .. versionchanged:: 3.3
++      :func:`time.perf_counter` is now the default timer.
+ 
+ 
+ .. class:: Timer(stmt='pass', setup='pass', timer=<timer function>)
+ 
+    Class for timing execution speed of small code snippets.
+ 
+-   The constructor takes a statement to be timed, an additional statement used for
+-   setup, and a timer function.  Both statements default to ``'pass'``; the timer
+-   function is platform-dependent (see the module doc string).  *stmt* and *setup*
+-   may also contain multiple statements separated by ``;`` or newlines, as long as
+-   they don't contain multi-line string literals.
++   The constructor takes a statement to be timed, an additional statement used
++   for setup, and a timer function.  Both statements default to ``'pass'``;
++   the timer function is platform-dependent (see the module doc string).
++   *stmt* and *setup* may also contain multiple statements separated by ``;``
++   or newlines, as long as they don't contain multi-line string literals.
+ 
+-   To measure the execution time of the first statement, use the :meth:`timeit`
+-   method.  The :meth:`repeat` method is a convenience to call :meth:`timeit`
++   To measure the execution time of the first statement, use the :meth:`.timeit`
++   method.  The :meth:`.repeat` method is a convenience to call :meth:`.timeit`
+    multiple times and return a list of results.
+ 
+    The *stmt* and *setup* parameters can also take objects that are callable
+-   without arguments. This will embed calls to them in a timer function that
+-   will then be executed by :meth:`timeit`.  Note that the timing overhead is a
++   without arguments.  This will embed calls to them in a timer function that
++   will then be executed by :meth:`.timeit`.  Note that the timing overhead is a
+    little larger in this case because of the extra function calls.
+ 
+ 
+-.. method:: Timer.print_exc(file=None)
++   .. method:: Timer.timeit(number=1000000)
+ 
+-   Helper to print a traceback from the timed code.
++      Time *number* executions of the main statement.  This executes the setup
++      statement once, and then returns the time it takes to execute the main
++      statement a number of times, measured in seconds as a float.
++      The argument is the number of times through the loop, defaulting to one
++      million.  The main statement, the setup statement and the timer function
++      to be used are passed to the constructor.
+ 
+-   Typical use::
++      .. note::
+ 
+-      t = Timer(...)       # outside the try/except
+-      try:
+-          t.timeit(...)    # or t.repeat(...)
+-      except:
+-          t.print_exc()
++         By default, :meth:`.timeit` temporarily turns off :term:`garbage
++         collection` during the timing.  The advantage of this approach is that
++         it makes independent timings more comparable.  This disadvantage is
++         that GC may be an important component of the performance of the
++         function being measured.  If so, GC can be re-enabled as the first
++         statement in the *setup* string.  For example::
+ 
+-   The advantage over the standard traceback is that source lines in the compiled
+-   template will be displayed. The optional *file* argument directs where the
+-   traceback is sent; it defaults to ``sys.stderr``.
++            timeit.Timer('for i in range(10): oct(i)', 'gc.enable()').timeit()
+ 
+ 
+-.. method:: Timer.repeat(repeat=3, number=1000000)
++   .. method:: Timer.repeat(repeat=3, number=1000000)
+ 
+-   Call :meth:`timeit` a few times.
++      Call :meth:`.timeit` a few times.
+ 
+-   This is a convenience function that calls the :meth:`timeit` repeatedly,
+-   returning a list of results.  The first argument specifies how many times to
+-   call :meth:`timeit`.  The second argument specifies the *number* argument for
+-   :func:`timeit`.
++      This is a convenience function that calls the :meth:`.timeit` repeatedly,
++      returning a list of results.  The first argument specifies how many times
++      to call :meth:`.timeit`.  The second argument specifies the *number*
++      argument for :meth:`.timeit`.
+ 
+-   .. note::
++      .. note::
+ 
+-      It's tempting to calculate mean and standard deviation from the result vector
+-      and report these.  However, this is not very useful.  In a typical case, the
+-      lowest value gives a lower bound for how fast your machine can run the given
+-      code snippet; higher values in the result vector are typically not caused by
+-      variability in Python's speed, but by other processes interfering with your
+-      timing accuracy.  So the :func:`min` of the result is probably the only number
+-      you should be interested in.  After that, you should look at the entire vector
+-      and apply common sense rather than statistics.
++         It's tempting to calculate mean and standard deviation from the result
++         vector and report these.  However, this is not very useful.
++         In a typical case, the lowest value gives a lower bound for how fast
++         your machine can run the given code snippet; higher values in the
++         result vector are typically not caused by variability in Python's
++         speed, but by other processes interfering with your timing accuracy.
++         So the :func:`min` of the result is probably the only number you
++         should be interested in.  After that, you should look at the entire
++         vector and apply common sense rather than statistics.
+ 
+ 
+-.. method:: Timer.timeit(number=1000000)
++   .. method:: Timer.print_exc(file=None)
+ 
+-   Time *number* executions of the main statement. This executes the setup
+-   statement once, and then returns the time it takes to execute the main statement
+-   a number of times, measured in seconds as a float.  The argument is the number
+-   of times through the loop, defaulting to one million.  The main statement, the
+-   setup statement and the timer function to be used are passed to the constructor.
++      Helper to print a traceback from the timed code.
+ 
+-   .. note::
++      Typical use::
+ 
+-      By default, :meth:`timeit` temporarily turns off :term:`garbage collection`
+-      during the timing.  The advantage of this approach is that it makes
+-      independent timings more comparable.  This disadvantage is that GC may be
+-      an important component of the performance of the function being measured.
+-      If so, GC can be re-enabled as the first statement in the *setup* string.
+-      For example::
++         t = Timer(...)       # outside the try/except
++         try:
++             t.timeit(...)    # or t.repeat(...)
++         except:
++             t.print_exc()
+ 
+-         timeit.Timer('for i in range(10): oct(i)', 'gc.enable()').timeit()
++      The advantage over the standard traceback is that source lines in the
++      compiled template will be displayed.  The optional *file* argument directs
++      where the traceback is sent; it defaults to :data:`sys.stderr`.
+ 
+ 
+-The module also defines three convenience functions:
++.. _command-line-interface:
+ 
+-
+-.. function:: default_timer()
+-
+-   The default timer, which is always :func:`time.perf_counter`.
+-
+-
+-.. function:: repeat(stmt='pass', setup='pass', timer=<default timer>, repeat=3, number=1000000)
+-
+-   Create a :class:`Timer` instance with the given statement, setup code and timer
+-   function and run its :meth:`repeat` method with the given repeat count and
+-   *number* executions.
+-
+-
+-.. function:: timeit(stmt='pass', setup='pass', timer=<default timer>, number=1000000)
+-
+-   Create a :class:`Timer` instance with the given statement, setup code and timer
+-   function and run its :meth:`timeit` method with *number* executions.
+-
+-
+-Command Line Interface
++Command-Line Interface
+ ----------------------
+ 
+ When called as a program from the command line, the following form is used::
+@@ -184,25 +225,53 @@
+ 
+    There is a certain baseline overhead associated with executing a pass statement.
+    The code here doesn't try to hide it, but you should be aware of it.  The
+-   baseline overhead can be measured by invoking the program without arguments.
++   baseline overhead can be measured by invoking the program without arguments,
++   and it might differ between Python versions.
+ 
+-The baseline overhead differs between Python versions!  Also, to fairly compare
+-older Python versions to Python 2.3, you may want to use Python's :option:`-O`
+-option for the older versions to avoid timing ``SET_LINENO`` instructions.
+ 
++.. _timeit-examples:
+ 
+ Examples
+ --------
+ 
+-Here are two example sessions (one using the command line, one using the module
+-interface) that compare the cost of using :func:`hasattr` vs.
+-:keyword:`try`/:keyword:`except` to test for missing and present object
+-attributes. ::
++It is possible to provide a setup statement that is executed only once at the beginning:
++
++.. code-block:: sh
++
++   $ python -m timeit -s 'text = "sample string"; char = "g"'  'char in text'
++   10000000 loops, best of 3: 0.0877 usec per loop
++   $ python -m timeit -s 'text = "sample string"; char = "g"'  'text.find(char)'
++   1000000 loops, best of 3: 0.342 usec per loop
++
++::
++
++   >>> import timeit
++   >>> timeit.timeit('char in text', setup='text = "sample string"; char = "g"')
++   0.41440500499993504
++   >>> timeit.timeit('text.find(char)', setup='text = "sample string"; char = "g"')
++   1.7246671520006203
++
++The same can be done using the :class:`Timer` class and its methods::
++
++   >>> import timeit
++   >>> t = timeit.Timer('char in text', setup='text = "sample string"; char = "g"')
++   >>> t.timeit()
++   0.3955516149999312
++   >>> t.repeat()
++   [0.40193588800002544, 0.3960157959998014, 0.39594301399984033]
++
++
++The following examples show how to time expressions that contain multiple lines.
++Here we compare the cost of using :func:`hasattr` vs. :keyword:`try`/:keyword:`except`
++to test for missing and present object attributes:
++
++.. code-block:: sh
+ 
+    $ python -m timeit 'try:' '  str.__bool__' 'except AttributeError:' '  pass'
+    100000 loops, best of 3: 15.7 usec per loop
+    $ python -m timeit 'if hasattr(str, "__bool__"): pass'
+    100000 loops, best of 3: 4.26 usec per loop
++
+    $ python -m timeit 'try:' '  int.__bool__' 'except AttributeError:' '  pass'
+    1000000 loops, best of 3: 1.43 usec per loop
+    $ python -m timeit 'if hasattr(int, "__bool__"): pass'
+@@ -211,46 +280,40 @@
+ ::
+ 
+    >>> import timeit
++   >>> # attribute is missing
+    >>> s = """\
+    ... try:
+    ...     str.__bool__
+    ... except AttributeError:
+    ...     pass
+    ... """
+-   >>> t = timeit.Timer(stmt=s)
+-   >>> print("%.2f usec/pass" % (1000000 * t.timeit(number=100000)/100000))
+-   17.09 usec/pass
+-   >>> s = """\
+-   ... if hasattr(str, '__bool__'): pass
+-   ... """
+-   >>> t = timeit.Timer(stmt=s)
+-   >>> print("%.2f usec/pass" % (1000000 * t.timeit(number=100000)/100000))
+-   4.85 usec/pass
++   >>> timeit.timeit(stmt=s, number=100000)
++   0.9138244460009446
++   >>> s = "if hasattr(str, '__bool__'): pass"
++   >>> timeit.timeit(stmt=s, number=100000)
++   0.5829014980008651
++   >>>
++   >>> # attribute is present
+    >>> s = """\
+    ... try:
+    ...     int.__bool__
+    ... except AttributeError:
+    ...     pass
+    ... """
+-   >>> t = timeit.Timer(stmt=s)
+-   >>> print("%.2f usec/pass" % (1000000 * t.timeit(number=100000)/100000))
+-   1.97 usec/pass
+-   >>> s = """\
+-   ... if hasattr(int, '__bool__'): pass
+-   ... """
+-   >>> t = timeit.Timer(stmt=s)
+-   >>> print("%.2f usec/pass" % (1000000 * t.timeit(number=100000)/100000))
+-   3.15 usec/pass
++   >>> timeit.timeit(stmt=s, number=100000)
++   0.04215312199994514
++   >>> s = "if hasattr(int, '__bool__'): pass"
++   >>> timeit.timeit(stmt=s, number=100000)
++   0.08588060699912603
++
+ 
+ To give the :mod:`timeit` module access to functions you define, you can pass a
+-``setup`` parameter which contains an import statement::
++*setup* parameter which contains an import statement::
+ 
+    def test():
+        """Stupid test function"""
+        L = [i for i in range(100)]
+ 
+    if __name__ == '__main__':
+-       from timeit import Timer
+-       t = Timer("test()", "from __main__ import test")
+-       print(t.timeit())
+-
++       import timeit
++       print(timeit.timeit("test()", setup="from __main__ import test"))
+diff -r bd8afb90ebf2 Doc/library/tkinter.tix.rst
+--- a/Doc/library/tkinter.tix.rst
++++ b/Doc/library/tkinter.tix.rst
+@@ -504,7 +504,7 @@
+       print(root.tix_configure())
+ 
+ 
+-.. method:: tixCommand.tix_configure([cnf,] **kw)
++.. method:: tixCommand.tix_configure(cnf=None, **kw)
+ 
+    Query or modify the configuration options of the Tix application context. If no
+    option is specified, returns a dictionary all of the available options.  If
+diff -r bd8afb90ebf2 Doc/library/types.rst
+--- a/Doc/library/types.rst
++++ b/Doc/library/types.rst
+@@ -69,7 +69,7 @@
+ the types that arise only incidentally during processing such as the
+ ``listiterator`` type.
+ 
+-Typical use is of these names is for :func:`isinstance` or
++Typical use of these names is for :func:`isinstance` or
+ :func:`issubclass` checks.
+ 
+ Standard names are defined for the following types:
+diff -r bd8afb90ebf2 Doc/library/unicodedata.rst
+--- a/Doc/library/unicodedata.rst
++++ b/Doc/library/unicodedata.rst
+@@ -69,7 +69,7 @@
+ 
+ .. function:: bidirectional(chr)
+ 
+-   Returns the bidirectional category assigned to the character *chr* as
++   Returns the bidirectional class assigned to the character *chr* as
+    string. If no such value is defined, an empty string is returned.
+ 
+ 
+diff -r bd8afb90ebf2 Doc/library/unittest.mock-examples.rst
+--- a/Doc/library/unittest.mock-examples.rst
++++ b/Doc/library/unittest.mock-examples.rst
+@@ -372,8 +372,8 @@
+     ...     @patch('package.module.ClassName1')
+     ...     @patch('package.module.ClassName2')
+     ...     def test_something(self, MockClass2, MockClass1):
+-    ...         self.assertTrue(package.module.ClassName1 is MockClass1)
+-    ...         self.assertTrue(package.module.ClassName2 is MockClass2)
++    ...         self.assertIs(package.module.ClassName1, MockClass1)
++    ...         self.assertIs(package.module.ClassName2, MockClass2)
+     ...
+     >>> MyTest('test_something').test_something()
+ 
+@@ -418,14 +418,14 @@
+ .. _further-examples:
+ 
+ Further Examples
+-================
++----------------
+ 
+ 
+ Here are some more examples for some slightly more advanced scenarios.
+ 
+ 
+ Mocking chained calls
+----------------------
++~~~~~~~~~~~~~~~~~~~~~
+ 
+ Mocking chained calls is actually straightforward with mock once you
+ understand the :attr:`~Mock.return_value` attribute. When a mock is called for
+@@ -496,7 +496,7 @@
+ 
+ 
+ Partial mocking
+----------------
++~~~~~~~~~~~~~~~
+ 
+ In some tests I wanted to mock out a call to `datetime.date.today()
+ <http://docs.python.org/library/datetime.html#datetime.date.today>`_ to return
+@@ -540,7 +540,7 @@
+ 
+ 
+ Mocking a Generator Method
+---------------------------
++~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ A Python generator is a function or method that uses the `yield statement
+ <http://docs.python.org/reference/simple_stmts.html#the-yield-statement>`_ to
+@@ -582,7 +582,7 @@
+ 
+ 
+ Applying the same patch to every test method
+---------------------------------------------
++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ If you want several patches in place for multiple test methods the obvious way
+ is to apply the patch decorators to every method. This can feel like unnecessary
+@@ -595,10 +595,10 @@
+     ... class MyTest(TestCase):
+     ...
+     ...     def test_one(self, MockSomeClass):
+-    ...         self.assertTrue(mymodule.SomeClass is MockSomeClass)
++    ...         self.assertIs(mymodule.SomeClass, MockSomeClass)
+     ...
+     ...     def test_two(self, MockSomeClass):
+-    ...         self.assertTrue(mymodule.SomeClass is MockSomeClass)
++    ...         self.assertIs(mymodule.SomeClass, MockSomeClass)
+     ...
+     ...     def not_a_test(self):
+     ...         return 'something'
+@@ -617,7 +617,7 @@
+     ...         self.mock_foo = self.patcher.start()
+     ...
+     ...     def test_foo(self):
+-    ...         self.assertTrue(mymodule.foo is self.mock_foo)
++    ...         self.assertIs(mymodule.foo, self.mock_foo)
+     ...
+     ...     def tearDown(self):
+     ...         self.patcher.stop()
+@@ -636,13 +636,13 @@
+     ...         self.mock_foo = patcher.start()
+     ...
+     ...     def test_foo(self):
+-    ...         self.assertTrue(mymodule.foo is self.mock_foo)
++    ...         self.assertIs(mymodule.foo, self.mock_foo)
+     ...
+     >>> MyTest('test_foo').run()
+ 
+ 
+ Mocking Unbound Methods
+------------------------
++~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ Whilst writing tests today I needed to patch an *unbound method* (patching the
+ method on the class rather than on the instance). I needed self to be passed
+@@ -681,7 +681,7 @@
+ 
+ 
+ Checking multiple calls with mock
+----------------------------------
++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ mock has a nice API for making assertions about how your mock objects are used.
+ 
+@@ -723,7 +723,7 @@
+ 
+ 
+ Coping with mutable arguments
+------------------------------
++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ Another situation is rare, but can bite you, is when your mock is called with
+ mutable arguments. `call_args` and `call_args_list` store *references* to the
+@@ -839,7 +839,7 @@
+ 
+ 
+ Nesting Patches
+----------------
++~~~~~~~~~~~~~~~
+ 
+ Using patch as a context manager is nice, but if you do multiple patches you
+ can end up with nested with statements indenting further and further to the
+@@ -887,7 +887,7 @@
+ 
+ 
+ Mocking a dictionary with MagicMock
+------------------------------------
++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ You may want to mock a dictionary, or other container object, recording all
+ access to it whilst having it still behave like a dictionary.
+@@ -962,7 +962,7 @@
+ 
+ 
+ Mock subclasses and their attributes
+-------------------------------------
++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ There are various reasons why you might want to subclass `Mock`. One reason
+ might be to add helper methods. Here's a silly example:
+@@ -1025,7 +1025,7 @@
+ 
+ 
+ Mocking imports with patch.dict
+--------------------------------
++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ One situation where mocking can be hard is where you have a local import inside
+ a function. These are harder to mock because they aren't using an object from
+@@ -1088,7 +1088,7 @@
+ 
+ 
+ Tracking order of calls and less verbose call assertions
+---------------------------------------------------------
++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ The :class:`Mock` class allows you to track the *order* of method calls on
+ your mock objects through the :attr:`~Mock.method_calls` attribute. This
+@@ -1168,7 +1168,7 @@
+ 
+ 
+ More complex argument matching
+-------------------------------
++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ Using the same basic concept as :data:`ANY` we can implement matchers to do more
+ complex assertions on objects used as arguments to mocks.
+diff -r bd8afb90ebf2 Doc/library/unittest.mock.rst
+--- a/Doc/library/unittest.mock.rst
++++ b/Doc/library/unittest.mock.rst
+@@ -1,3 +1,4 @@
++
+ :mod:`unittest.mock` --- mock object library
+ ============================================
+ 
+@@ -276,7 +277,7 @@
+             >>> mock.assert_called_once_with('foo', bar='baz')
+             Traceback (most recent call last):
+               ...
+-            AssertionError: Expected to be called once. Called 2 times.
++            AssertionError: Expected 'mock' to be called once. Called 2 times.
+ 
+ 
+     .. method:: assert_any_call(*args, **kwargs)
+@@ -646,7 +647,7 @@
+     which have no meaning on a non-callable mock.
+ 
+ Mock objects that use a class or an instance as a `spec` or `spec_set` are able
+-to pass `isintance` tests:
++to pass `isinstance` tests:
+ 
+     >>> mock = Mock(spec=SomeClass)
+     >>> isinstance(mock, SomeClass)
+@@ -925,7 +926,7 @@
+ 
+ 
+ The patchers
+-============
++------------
+ 
+ The patch decorators are used for patching objects only within the scope of
+ the function they decorate. They automatically handle the unpatching for you,
+@@ -934,7 +935,7 @@
+ 
+ 
+ patch
+------
++~~~~~
+ 
+ .. note::
+ 
+@@ -1107,7 +1108,7 @@
+ 
+ 
+ patch.object
+-------------
++~~~~~~~~~~~~
+ 
+ .. function:: patch.object(target, attribute, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs)
+ 
+@@ -1143,7 +1144,7 @@
+ 
+ 
+ patch.dict
+-----------
++~~~~~~~~~~
+ 
+ .. function:: patch.dict(in_dict, values=(), clear=False, **kwargs)
+ 
+@@ -1226,7 +1227,7 @@
+ 
+ 
+ patch.multiple
+---------------
++~~~~~~~~~~~~~~
+ 
+ .. function:: patch.multiple(target, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs)
+ 
+@@ -1290,7 +1291,7 @@
+ .. _start-and-stop:
+ 
+ patch methods: start and stop
+------------------------------
++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ All the patchers have `start` and `stop` methods. These make it simpler to do
+ patching in `setUp` methods or where you want to do multiple patches without
+@@ -1363,7 +1364,7 @@
+ 
+ 
+ TEST_PREFIX
+------------
++~~~~~~~~~~~
+ 
+ All of the patchers can be used as class decorators. When used in this way
+ they wrap every test method on the class. The patchers recognise methods that
+@@ -1393,7 +1394,7 @@
+ 
+ 
+ Nesting Patch Decorators
+-------------------------
++~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ If you want to perform multiple patches then you can simply stack up the
+ decorators.
+@@ -1422,7 +1423,7 @@
+ .. _where-to-patch:
+ 
+ Where to patch
+---------------
++~~~~~~~~~~~~~~
+ 
+ `patch` works by (temporarily) changing the object that a *name* points to with
+ another one. There can be many names pointing to any individual object, so
+@@ -1464,7 +1465,7 @@
+ 
+ 
+ Patching Descriptors and Proxy Objects
+---------------------------------------
++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ Both patch_ and patch.object_ correctly patch and restore descriptors: class
+ methods, static methods and properties. You should patch these on the *class*
+@@ -1474,12 +1475,12 @@
+ 
+ 
+ MagicMock and magic method support
+-==================================
++----------------------------------
+ 
+ .. _magic-methods:
+ 
+ Mocking Magic Methods
+----------------------
++~~~~~~~~~~~~~~~~~~~~~
+ 
+ :class:`Mock` supports mocking the Python protocol methods, also known as
+ "magic methods". This allows mock objects to replace containers or other
+@@ -1565,7 +1566,7 @@
+ 
+ 
+ Magic Mock
+-----------
++~~~~~~~~~~
+ 
+ There are two `MagicMock` variants: `MagicMock` and `NonCallableMagicMock`.
+ 
+@@ -1694,10 +1695,10 @@
+ 
+ 
+ Helpers
+-=======
++-------
+ 
+ sentinel
+---------
++~~~~~~~~
+ 
+ .. data:: sentinel
+ 
+@@ -1725,7 +1726,7 @@
+ 
+ 
+ DEFAULT
+--------
++~~~~~~~
+ 
+ 
+ .. data:: DEFAULT
+@@ -1735,9 +1736,8 @@
+     functions to indicate that the normal return value should be used.
+ 
+ 
+-
+ call
+-----
++~~~~
+ 
+ .. function:: call(*args, **kwargs)
+ 
+@@ -1826,7 +1826,7 @@
+ 
+ 
+ create_autospec
+----------------
++~~~~~~~~~~~~~~~
+ 
+ .. function:: create_autospec(spec, spec_set=False, instance=False, **kwargs)
+ 
+@@ -1853,7 +1853,7 @@
+ 
+ 
+ ANY
+----
++~~~
+ 
+ .. data:: ANY
+ 
+@@ -1884,7 +1884,7 @@
+ 
+ 
+ FILTER_DIR
+-----------
++~~~~~~~~~~
+ 
+ .. data:: FILTER_DIR
+ 
+@@ -1939,7 +1939,7 @@
+ 
+ 
+ mock_open
+----------
++~~~~~~~~~
+ 
+ .. function:: mock_open(mock=None, read_data=None)
+ 
+@@ -1993,7 +1993,7 @@
+ .. _auto-speccing:
+ 
+ Autospeccing
+-------------
++~~~~~~~~~~~~
+ 
+ Autospeccing is based on the existing `spec` feature of mock. It limits the
+ api of mocks to the api of an original object (the spec), but it is recursive
+@@ -2020,7 +2020,7 @@
+     >>> mock.assert_called_once_with(1, 2, 3)
+     Traceback (most recent call last):
+      ...
+-    AssertionError: Expected to be called once. Called 2 times.
++    AssertionError: Expected 'mock' to be called once. Called 2 times.
+ 
+ Because mocks auto-create attributes on demand, and allow you to call them
+ with arbitrary arguments, if you misspell one of these assert methods then
+diff -r bd8afb90ebf2 Doc/library/unittest.rst
+--- a/Doc/library/unittest.rst
++++ b/Doc/library/unittest.rst
+@@ -11,17 +11,14 @@
+ (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
+-turn, a Java version of Kent's Smalltalk testing framework.  Each is the de
+-facto standard unit testing framework for its respective language.
+-
+-:mod:`unittest` supports test automation, sharing of setup and shutdown code for
+-tests, aggregation of tests into collections, and independence of the tests from
+-the reporting framework.  The :mod:`unittest` module provides classes that make
+-it easy to support these qualities for a set of tests.
+-
+-To achieve this, :mod:`unittest` supports some important concepts:
++The :mod:`unittest` unit testing framework was originally inspired by JUnit
++and has a similar flavor as major unit testing frameworks in other
++languages.  It supports test automation, sharing of setup and shutdown code
++for tests, aggregation of tests into collections, and independence of the
++tests from the reporting framework.
++
++To achieve this, :mod:`unittest` supports some important concepts in an
++object-oriented way:
+ 
+ test fixture
+    A :dfn:`test fixture` represents the preparation needed to perform one or more
+@@ -30,7 +27,7 @@
+    process.
+ 
+ test case
+-   A :dfn:`test case` is the smallest unit of testing.  It checks for a specific
++   A :dfn:`test case` is the individual unit of testing.  It checks for a specific
+    response to a particular set of inputs.  :mod:`unittest` provides a base class,
+    :class:`TestCase`, which may be used to create new test cases.
+ 
+@@ -44,43 +41,12 @@
+    a textual interface, or return a special value to indicate the results of
+    executing the tests.
+ 
+-The test case and test fixture concepts are supported through the
+-:class:`TestCase` and :class:`FunctionTestCase` classes; the former should be
+-used when creating new tests, and the latter can be used when integrating
+-existing test code with a :mod:`unittest`\ -driven framework. When building test
+-fixtures using :class:`TestCase`, the :meth:`~TestCase.setUp` and
+-:meth:`~TestCase.tearDown` methods can be overridden to provide initialization
+-and cleanup for the fixture.  With :class:`FunctionTestCase`, existing functions
+-can be passed to the constructor for these purposes.  When the test is run, the
+-fixture initialization is run first; if it succeeds, the cleanup method is run
+-after the test has been executed, regardless of the outcome of the test.  Each
+-instance of the :class:`TestCase` will only be used to run a single test method,
+-so a new fixture is created for each test.
+-
+-Test suites are implemented by the :class:`TestSuite` class.  This class allows
+-individual tests and test suites to be aggregated; when the suite is executed,
+-all tests added directly to the suite and in "child" test suites are run.
+-
+-A test runner is an object that provides a single method,
+-:meth:`~TestRunner.run`, which accepts a :class:`TestCase` or :class:`TestSuite`
+-object as a parameter, and returns a result object.  The class
+-:class:`TestResult` is provided for use as the result object. :mod:`unittest`
+-provides the :class:`TextTestRunner` as an example test runner which reports
+-test results on the standard error stream by default.  Alternate runners can be
+-implemented for other environments (such as graphical environments) without any
+-need to derive from a specific class.
+-
+ 
+ .. seealso::
+ 
+    Module :mod:`doctest`
+       Another test-support module with a very different flavor.
+ 
+-   `unittest2: A backport of new unittest features for Python 2.4-2.6 <http://pypi.python.org/pypi/unittest2>`_
+-      Many new features were added to unittest in Python 2.7, including test
+-      discovery. unittest2 allows you to use these features with earlier
+-      versions of Python.
+-
+    `Simple Smalltalk Testing: With Patterns <http://www.XProgramming.com/testfram.htm>`_
+       Kent Beck's original paper on testing frameworks using the pattern shared
+       by :mod:`unittest`.
+@@ -89,7 +55,7 @@
+       Third-party unittest frameworks with a lighter-weight syntax for writing
+       tests.  For example, ``assert func(10) == 42``.
+ 
+-   `The Python Testing Tools Taxonomy <http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy>`_
++   `The Python Testing Tools Taxonomy <http://wiki.python.org/moin/PythonTestingToolsTaxonomy>`_
+       An extensive list of Python testing tools including functional testing
+       frameworks and mock object libraries.
+ 
+@@ -99,9 +65,10 @@
+ 
+    The script :file:`Tools/unittestgui/unittestgui.py` in the Python source distribution is
+    a GUI tool for test discovery and execution.  This is intended largely for ease of use
+-   for those new to unit testing.  For production environments it is recommended that
+-   tests be driven by a continuous integration system such as `Hudson <http://hudson-ci.org/>`_
+-   or `Buildbot <http://buildbot.net/trac>`_.
++   for those new to unit testing.  For production environments it is
++   recommended that tests be driven by a continuous integration system such as
++   `Buildbot <http://buildbot.net/trac>`_, `Jenkins <http://jenkins-ci.org>`_
++   or  `Hudson <http://hudson-ci.org/>`_.
+ 
+ 
+ .. _unittest-minimal-example:
+@@ -172,15 +139,8 @@
+ 
+    OK
+ 
+-Instead of :func:`unittest.main`, there are other ways to run the tests with a
+-finer level of control, less terse output, and no requirement to be run from the
+-command line.  For example, the last two lines may be replaced with::
+-
+-   suite = unittest.TestLoader().loadTestsFromTestCase(TestSequenceFunctions)
+-   unittest.TextTestRunner(verbosity=2).run(suite)
+-
+-Running the revised script from the interpreter or another script produces the
+-following output::
++Passing the ``-v`` option to your test script will instruct :func:`unittest.main`
++to enable a higher level of verbosity, and produce the following output::
+ 
+    test_choice (__main__.TestSequenceFunctions) ... ok
+    test_sample (__main__.TestSequenceFunctions) ... ok
+@@ -358,45 +318,30 @@
+ To make your own test cases you must write subclasses of
+ :class:`TestCase` or use :class:`FunctionTestCase`.
+ 
+-An instance of a :class:`TestCase`\ -derived class is an object that can
+-completely run a single test method, together with optional set-up and tidy-up
+-code.
+-
+ The testing code of a :class:`TestCase` instance should be entirely self
+ contained, such that it can be run either in isolation or in arbitrary
+ combination with any number of other test cases.
+ 
+-The simplest :class:`TestCase` subclass will simply override the
+-:meth:`~TestCase.runTest` method in order to perform specific testing code::
++The simplest :class:`TestCase` subclass will simply implement a test method
++(i.e. a method whose name starts with ``test``) in order to perform specific
++testing code::
+ 
+    import unittest
+ 
+    class DefaultWidgetSizeTestCase(unittest.TestCase):
+-       def runTest(self):
++       def test_default_widget_size(self):
+            widget = Widget('The widget')
+-           self.assertEqual(widget.size(), (50, 50), 'incorrect default size')
++           self.assertEqual(widget.size(), (50, 50))
+ 
+ Note that in order to test something, we use one of the :meth:`assert\*`
+ methods provided by the :class:`TestCase` base class.  If the test fails, an
+ exception will be raised, and :mod:`unittest` will identify the test case as a
+-:dfn:`failure`.  Any other exceptions will be treated as :dfn:`errors`. This
+-helps you identify where the problem is: :dfn:`failures` are caused by incorrect
+-results - a 5 where you expected a 6. :dfn:`Errors` are caused by incorrect
+-code - e.g., a :exc:`TypeError` caused by an incorrect function call.
+-
+-The way to run a test case will be described later.  For now, note that to
+-construct an instance of such a test case, we call its constructor without
+-arguments::
+-
+-   testCase = DefaultWidgetSizeTestCase()
+-
+-Now, such test cases can be numerous, and their set-up can be repetitive.  In
+-the above case, constructing a :class:`Widget` in each of 100 Widget test case
+-subclasses would mean unsightly duplication.
+-
+-Luckily, we can factor out such set-up code by implementing a method called
+-:meth:`~TestCase.setUp`, which the testing framework will automatically call for
+-us when we run the test::
++:dfn:`failure`.  Any other exceptions will be treated as :dfn:`errors`.
++
++Tests can be numerous, and their set-up can be repetitive.  Luckily, we
++can factor out set-up code by implementing a method called
++:meth:`~TestCase.setUp`, which the testing framework will automatically
++call for every single test we run::
+ 
+    import unittest
+ 
+@@ -404,23 +349,26 @@
+        def setUp(self):
+            self.widget = Widget('The widget')
+ 
+-   class DefaultWidgetSizeTestCase(SimpleWidgetTestCase):
+-       def runTest(self):
++       def test_default_widget_size(self):
+            self.assertEqual(self.widget.size(), (50,50),
+                             'incorrect default size')
+ 
+-   class WidgetResizeTestCase(SimpleWidgetTestCase):
+-       def runTest(self):
++       def test_widget_resize(self):
+            self.widget.resize(100,150)
+            self.assertEqual(self.widget.size(), (100,150),
+                             'wrong size after resize')
+ 
++.. note::
++   The order in which the various tests will be run is determined
++   by sorting the test method names with respect to the built-in
++   ordering for strings.
++
+ If the :meth:`~TestCase.setUp` method raises an exception while the test is
+-running, the framework will consider the test to have suffered an error, and the
+-:meth:`~TestCase.runTest` method will not be executed.
++running, the framework will consider the test to have suffered an error, and
++the test method will not be executed.
+ 
+ Similarly, we can provide a :meth:`~TestCase.tearDown` method that tidies up
+-after the :meth:`~TestCase.runTest` method has been run::
++after the test method has been run::
+ 
+    import unittest
+ 
+@@ -430,59 +378,20 @@
+ 
+        def tearDown(self):
+            self.widget.dispose()
+-           self.widget = None
+-
+-If :meth:`~TestCase.setUp` succeeded, the :meth:`~TestCase.tearDown` method will
+-be run whether :meth:`~TestCase.runTest` succeeded or not.
++
++If :meth:`~TestCase.setUp` succeeded, :meth:`~TestCase.tearDown` will be
++run whether the test method succeeded or not.
+ 
+ Such a working environment for the testing code is called a :dfn:`fixture`.
+ 
+-Often, many small test cases will use the same fixture.  In this case, we would
+-end up subclassing :class:`SimpleWidgetTestCase` into many small one-method
+-classes such as :class:`DefaultWidgetSizeTestCase`.  This is time-consuming and
+-discouraging, so in the same vein as JUnit, :mod:`unittest` provides a simpler
+-mechanism::
+-
+-   import unittest
+-
+-   class WidgetTestCase(unittest.TestCase):
+-       def setUp(self):
+-           self.widget = Widget('The widget')
+-
+-       def tearDown(self):
+-           self.widget.dispose()
+-           self.widget = None
+-
+-       def test_default_size(self):
+-           self.assertEqual(self.widget.size(), (50,50),
+-                            'incorrect default size')
+-
+-       def test_resize(self):
+-           self.widget.resize(100,150)
+-           self.assertEqual(self.widget.size(), (100,150),
+-                            'wrong size after resize')
+-
+-Here we have not provided a :meth:`~TestCase.runTest` method, but have instead
+-provided two different test methods.  Class instances will now each run one of
+-the :meth:`test_\*` methods, with ``self.widget`` created and destroyed
+-separately for each instance.  When creating an instance we must specify the
+-test method it is to run.  We do this by passing the method name in the
+-constructor::
+-
+-   defaultSizeTestCase = WidgetTestCase('test_default_size')
+-   resizeTestCase = WidgetTestCase('test_resize')
+-
+ Test case instances are grouped together according to the features they test.
+ :mod:`unittest` provides a mechanism for this: the :dfn:`test suite`,
+-represented by :mod:`unittest`'s :class:`TestSuite` class::
+-
+-   widgetTestSuite = unittest.TestSuite()
+-   widgetTestSuite.addTest(WidgetTestCase('test_default_size'))
+-   widgetTestSuite.addTest(WidgetTestCase('test_resize'))
+-
+-For the ease of running tests, as we will see later, it is a good idea to
+-provide in each test module a callable object that returns a pre-built test
+-suite::
++represented by :mod:`unittest`'s :class:`TestSuite` class.  In most cases,
++calling :func:`unittest.main` will do the right thing and collect all the
++module's test cases for you, and then execute them.
++
++However, should you want to customize the building of your test suite,
++you can do it yourself::
+ 
+    def suite():
+        suite = unittest.TestSuite()
+@@ -490,37 +399,6 @@
+        suite.addTest(WidgetTestCase('test_resize'))
+        return suite
+ 
+-or even::
+-
+-   def suite():
+-       tests = ['test_default_size', 'test_resize']
+-
+-       return unittest.TestSuite(map(WidgetTestCase, tests))
+-
+-Since it is a common pattern to create a :class:`TestCase` subclass with many
+-similarly named test functions, :mod:`unittest` provides a :class:`TestLoader`
+-class that can be used to automate the process of creating a test suite and
+-populating it with individual tests. For example, ::
+-
+-   suite = unittest.TestLoader().loadTestsFromTestCase(WidgetTestCase)
+-
+-will create a test suite that will run ``WidgetTestCase.test_default_size()`` and
+-``WidgetTestCase.test_resize``. :class:`TestLoader` uses the ``'test'`` method
+-name prefix to identify test methods automatically.
+-
+-Note that the order in which the various test cases will be run is
+-determined by sorting the test function names with respect to the
+-built-in ordering for strings.
+-
+-Often it is desirable to group suites of test cases together, so as to run tests
+-for the whole system at once.  This is easy, since :class:`TestSuite` instances
+-can be added to a :class:`TestSuite` just as :class:`TestCase` instances can be
+-added to a :class:`TestSuite`::
+-
+-   suite1 = module1.TheTestSuite()
+-   suite2 = module2.TheTestSuite()
+-   alltests = unittest.TestSuite([suite1, suite2])
+-
+ You can place the definitions of test cases and test suites in the same modules
+ as the code they are to test (such as :file:`widget.py`), but there are several
+ advantages to placing the test code in a separate module, such as
+@@ -563,23 +441,13 @@
+        assert something.name is not None
+        # ...
+ 
+-one can create an equivalent test case instance as follows::
+-
+-   testcase = unittest.FunctionTestCase(testSomething)
+-
+-If there are additional set-up and tear-down methods that should be called as
+-part of the test case's operation, they can also be provided like so::
++one can create an equivalent test case instance as follows, with optional
++set-up and tear-down methods::
+ 
+    testcase = unittest.FunctionTestCase(testSomething,
+                                         setUp=makeSomethingDB,
+                                         tearDown=deleteSomethingDB)
+ 
+-To make migrating existing test suites easier, :mod:`unittest` supports tests
+-raising :exc:`AssertionError` to indicate test failure. However, it is
+-recommended that you use the explicit :meth:`TestCase.fail\*` and
+-:meth:`TestCase.assert\*` methods instead, as future versions of :mod:`unittest`
+-may treat :exc:`AssertionError` differently.
+-
+ .. note::
+ 
+    Even though :class:`FunctionTestCase` can be used to quickly convert an
+@@ -703,32 +571,24 @@
+ 
+ .. class:: TestCase(methodName='runTest')
+ 
+-   Instances of the :class:`TestCase` class represent the smallest testable units
++   Instances of the :class:`TestCase` class represent the logical test units
+    in the :mod:`unittest` universe.  This class is intended to be used as a base
+    class, with specific tests being implemented by concrete subclasses.  This class
+    implements the interface needed by the test runner to allow it to drive the
+-   test, and methods that the test code can use to check for and report various
++   tests, and methods that the test code can use to check for and report various
+    kinds of failure.
+ 
+-   Each instance of :class:`TestCase` will run a single test method: the method
+-   named *methodName*.  If you remember, we had an earlier example that went
+-   something like this::
+-
+-      def suite():
+-          suite = unittest.TestSuite()
+-          suite.addTest(WidgetTestCase('test_default_size'))
+-          suite.addTest(WidgetTestCase('test_resize'))
+-          return suite
+-
+-   Here, we create two instances of :class:`WidgetTestCase`, each of which runs a
+-   single test.
++   Each instance of :class:`TestCase` will run a single base method: the method
++   named *methodName*.  However, the standard implementation of the default
++   *methodName*, ``runTest()``, will run every method starting with ``test``
++   as an individual test, and count successes and failures accordingly.
++   Therefore, in most uses of :class:`TestCase`, you will neither change
++   the *methodName* nor reimplement the default ``runTest()`` method.
+ 
+    .. versionchanged:: 3.2
+-      :class:`TestCase` can be instantiated successfully without providing a method
+-      name. This makes it easier to experiment with :class:`TestCase` from the
+-      interactive interpreter.
+-
+-   *methodName* defaults to :meth:`runTest`.
++      :class:`TestCase` can be instantiated successfully without providing a
++      *methodName*. This makes it easier to experiment with :class:`TestCase`
++      from the interactive interpreter.
+ 
+    :class:`TestCase` instances provide three groups of methods: one group used
+    to run the test, another used by the test implementation to check conditions
+@@ -737,7 +597,6 @@
+ 
+    Methods in the first group (running the test) are:
+ 
+-
+    .. method:: setUp()
+ 
+       Method called to prepare the test fixture.  This is called immediately
+@@ -789,10 +648,11 @@
+ 
+    .. method:: run(result=None)
+ 
+-      Run the test, collecting the result into the test result object passed as
+-      *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 returned to :meth:`run`'s caller.
++      Run the test, collecting the result into the :class:`TestResult` object
++      passed as *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 returned to :meth:`run`'s
++      caller.
+ 
+       The same effect may be had by simply calling the :class:`TestCase`
+       instance.
+@@ -1265,7 +1125,7 @@
+    .. method:: assertListEqual(first, second, msg=None)
+                assertTupleEqual(first, second, msg=None)
+ 
+-      Tests that two lists or tuples are equal.  If not an error message is
++      Tests that two lists or tuples are equal.  If not, an error message is
+       constructed that shows only the differences between the two.  An error
+       is also raised if either of the parameters are of the wrong type.
+       These methods are used by default when comparing lists or tuples with
+diff -r bd8afb90ebf2 Doc/library/urllib.error.rst
+--- a/Doc/library/urllib.error.rst
++++ b/Doc/library/urllib.error.rst
+@@ -41,6 +41,10 @@
+       to a value found in the dictionary of codes as found in
+       :attr:`http.server.BaseHTTPRequestHandler.responses`.
+ 
++   .. attribute:: reason
++
++      This is usually a string explaining the reason for this error.
++
+ .. exception:: ContentTooShortError(msg, content)
+ 
+    This exception is raised when the :func:`urlretrieve` function detects that
+diff -r bd8afb90ebf2 Doc/library/urllib.parse.rst
+--- a/Doc/library/urllib.parse.rst
++++ b/Doc/library/urllib.parse.rst
+@@ -145,8 +145,9 @@
+    percent-encoded sequences into Unicode characters, as accepted by the
+    :meth:`bytes.decode` method.
+ 
+-   Use the :func:`urllib.parse.urlencode` function to convert such
+-   dictionaries into query strings.
++   Use the :func:`urllib.parse.urlencode` function (with the ``doseq``
++   parameter set to ``True``) to convert such dictionaries into query
++   strings.
+ 
+ 
+    .. versionchanged:: 3.2
+diff -r bd8afb90ebf2 Doc/library/urllib.request.rst
+--- a/Doc/library/urllib.request.rst
++++ b/Doc/library/urllib.request.rst
+@@ -63,16 +63,24 @@
+       an HTTPS request will not do any verification of the server's
+       certificate.
+ 
+-   This function returns a file-like object that works as a :term:`context manager`,
+-   with two additional methods from the :mod:`urllib.response` module
++   For http and https urls, this function returns a
++   :class:`http.client.HTTPResponse` object which has the following
++   :ref:`httpresponse-objects` methods.
+ 
+-   * :meth:`geturl` --- return the URL of the resource retrieved,
++   For ftp, file, and data urls and requests explicity handled by legacy
++   :class:`URLopener` and :class:`FancyURLopener` classes, this function
++   returns a :class:`urllib.response.addinfourl` object which can work as
++   :term:`context manager` and has methods such as
++
++   * :meth:`~urllib.response.addinfourl.geturl` --- return the URL of the resource retrieved,
+      commonly used to determine if a redirect was followed
+ 
+-   * :meth:`info` --- return the meta-information of the page, such as headers,
++   * :meth:`~urllib.response.addinfourl.info` --- return the meta-information of the page, such as headers,
+      in the form of an :func:`email.message_from_string` instance (see
+      `Quick Reference to HTTP Headers <http://www.cs.tut.fi/~jkorpela/http.html>`_)
+ 
++   * :meth:`~urllib.response.addinfourl.getcode` -- return the HTTP status code of the response.
++
+    Raises :exc:`URLError` on errors.
+ 
+    Note that ``None`` may be returned if no handler handles the request (though
+@@ -1305,7 +1313,8 @@
+        *filename* is not given, the filename is the output of :func:`tempfile.mktemp`
+        with a suffix that matches the suffix of the last path component of the input
+        URL.  If *reporthook* is given, it must be a function accepting three numeric
+-       parameters.  It will be called after each chunk of data is read from the
++       parameters: A chunk number, the maximum size chunks are read in and the total size of the download
++       (-1 if unknown).  It will be called once at the start and after each chunk of data is read from the
+        network.  *reporthook* is ignored for local URLs.
+ 
+        If the *url* uses the :file:`http:` scheme identifier, the optional *data*
+diff -r bd8afb90ebf2 Doc/library/urllib.rst
+--- /dev/null
++++ b/Doc/library/urllib.rst
+@@ -0,0 +1,9 @@
++:mod:`urllib` --- URL handling modules
++======================================
++
++``urllib`` is a package that collects several modules for working with URLs:
++
++* :mod:`urllib.request` for opening and reading URLs
++* :mod:`urllib.error` containing the exceptions raised by :mod:`urllib.request`
++* :mod:`urllib.parse` for parsing URLs
++* :mod:`urllib.robotparser` for parsing ``robots.txt`` files
+diff -r bd8afb90ebf2 Doc/library/venv.rst
+--- a/Doc/library/venv.rst
++++ b/Doc/library/venv.rst
+@@ -178,3 +178,216 @@
+ 
+     Create an :class:`EnvBuilder` with the given keyword arguments, and call its
+     :meth:`~EnvBuilder.create` method with the *env_dir* argument.
++
++An example of extending ``EnvBuilder``
++--------------------------------------
++
++The following script shows how to extend :class:`EnvBuilder` by implementing a
++subclass which installs Distribute and pip into a created venv::
++
++    import os
++    import os.path
++    from subprocess import Popen, PIPE
++    import sys
++    from threading import Thread
++    from urllib.parse import urlparse
++    from urllib.request import urlretrieve
++    import venv
++
++    class DistributeEnvBuilder(venv.EnvBuilder):
++        """
++        This builder installs Distribute and pip so that you can pip or
++        easy_install other packages into the created environment.
++
++        :param nodist: If True, Distribute is not installed into the created
++                       environment.
++        :param nopip: If True, pip is not installed into the created
++                      environment.
++        :param progress: If Distribute or pip are installed, the progress of the
++                         installation can be monitored by passing a progress
++                         callable. If specified, it is called with two
++                         arguments: a string indicating some progress, and a
++                         context indicating where the string is coming from.
++                         The context argument can have one of three values:
++                         'main', indicating that it is called from virtualize()
++                         itself, and 'stdout' and 'stderr', which are obtained
++                         by reading lines from the output streams of a subprocess
++                         which is used to install the app.
++
++                         If a callable is not specified, default progress
++                         information is output to sys.stderr.
++        """
++
++        def __init__(self, *args, **kwargs):
++            self.nodist = kwargs.pop('nodist', False)
++            self.nopip = kwargs.pop('nopip', False)
++            self.progress = kwargs.pop('progress', None)
++            self.verbose = kwargs.pop('verbose', False)
++            super().__init__(*args, **kwargs)
++
++        def post_setup(self, context):
++            """
++            Set up any packages which need to be pre-installed into the
++            environment being created.
++
++            :param context: The information for the environment creation request
++                            being processed.
++            """
++            if not self.nodist:
++                self.install_distribute(context)
++            if not self.nopip:
++                self.install_pip(context)
++
++        def reader(self, stream, context):
++            """
++            Read lines from a subprocess' output stream and either pass to a progress
++            callable (if specified) or write progress information to sys.stderr.
++            """
++            progress = self.progress
++            while True:
++                s = stream.readline()
++                if not s:
++                    break
++                if progress is not None:
++                    progress(s, context)
++                else:
++                    if not self.verbose:
++                        sys.stderr.write('.')
++                    else:
++                        sys.stderr.write(s.decode('utf-8'))
++                    sys.stderr.flush()
++
++        def install_script(self, context, name, url):
++            _, _, path, _, _, _ = urlparse(url)
++            fn = os.path.split(path)[-1]
++            binpath = context.bin_path
++            distpath = os.path.join(binpath, fn)
++            # Download script into the env's binaries folder
++            urlretrieve(url, distpath)
++            progress = self.progress
++            if progress is not None:
++                progress('Installing %s' %name, 'main')
++            else:
++                sys.stderr.write('Installing %s ' % name)
++                sys.stderr.flush()
++            # Install in the env
++            args = [context.env_exe, fn]
++            p = Popen(args, stdout=PIPE, stderr=PIPE, cwd=binpath)
++            t1 = Thread(target=self.reader, args=(p.stdout, 'stdout'))
++            t1.start()
++            t2 = Thread(target=self.reader, args=(p.stderr, 'stderr'))
++            t2.start()
++            p.wait()
++            t1.join()
++            t2.join()
++            if progress is not None:
++                progress('done.', 'main')
++            else:
++                sys.stderr.write('done.\n')
++            # Clean up - no longer needed
++            os.unlink(distpath)
++
++        def install_distribute(self, context):
++            """
++            Install Distribute in the environment.
++
++            :param context: The information for the environment creation request
++                            being processed.
++            """
++            url = 'http://python-distribute.org/distribute_setup.py'
++            self.install_script(context, 'distribute', url)
++            # clear up the distribute archive which gets downloaded
++            pred = lambda o: o.startswith('distribute-') and o.endswith('.tar.gz')
++            files = filter(pred, os.listdir(context.bin_path))
++            for f in files:
++                f = os.path.join(context.bin_path, f)
++                os.unlink(f)
++
++        def install_pip(self, context):
++            """
++            Install pip in the environment.
++
++            :param context: The information for the environment creation request
++                            being processed.
++            """
++            url = 'https://raw.github.com/pypa/pip/master/contrib/get-pip.py'
++            self.install_script(context, 'pip', url)
++
++    def main(args=None):
++        compatible = True
++        if sys.version_info < (3, 3):
++            compatible = False
++        elif not hasattr(sys, 'base_prefix'):
++            compatible = False
++        if not compatible:
++            raise ValueError('This script is only for use with '
++                             'Python 3.3 or later')
++        else:
++            import argparse
++
++            parser = argparse.ArgumentParser(prog=__name__,
++                                             description='Creates virtual Python '
++                                                         'environments in one or '
++                                                         'more target '
++                                                         'directories.')
++            parser.add_argument('dirs', metavar='ENV_DIR', nargs='+',
++                                help='A directory to create the environment in.')
++            parser.add_argument('--no-distribute', default=False,
++                                action='store_true', dest='nodist',
++                                help="Don't install Distribute in the virtual "
++                                     "environment.")
++            parser.add_argument('--no-pip', default=False,
++                                action='store_true', dest='nopip',
++                                help="Don't install pip in the virtual "
++                                     "environment.")
++            parser.add_argument('--system-site-packages', default=False,
++                                action='store_true', dest='system_site',
++                                help='Give the virtual environment access to the '
++                                     'system site-packages dir.')
++            if os.name == 'nt':
++                use_symlinks = False
++            else:
++                use_symlinks = True
++            parser.add_argument('--symlinks', default=use_symlinks,
++                                action='store_true', dest='symlinks',
++                                help='Try to use symlinks rather than copies, '
++                                     'when symlinks are not the default for '
++                                     'the platform.')
++            parser.add_argument('--clear', default=False, action='store_true',
++                                dest='clear', help='Delete the contents of the '
++                                                   'environment directory if it '
++                                                   'already exists, before '
++                                                   'environment creation.')
++            parser.add_argument('--upgrade', default=False, action='store_true',
++                                dest='upgrade', help='Upgrade the environment '
++                                                   'directory to use this version '
++                                                   'of Python, assuming Python '
++                                                   'has been upgraded in-place.')
++            parser.add_argument('--verbose', default=False, action='store_true',
++                                dest='verbose', help='Display the output '
++                                                   'from the scripts which '
++                                                   'install Distribute and pip.')
++            options = parser.parse_args(args)
++            if options.upgrade and options.clear:
++                raise ValueError('you cannot supply --upgrade and --clear together.')
++            builder = DistributeEnvBuilder(system_site_packages=options.system_site,
++                                           clear=options.clear,
++                                           symlinks=options.symlinks,
++                                           upgrade=options.upgrade,
++                                           nodist=options.nodist,
++                                           nopip=options.nopip,
++                                           verbose=options.verbose)
++            for d in options.dirs:
++                builder.create(d)
++
++    if __name__ == '__main__':
++        rc = 1
++        try:
++            main()
++            rc = 0
++        except Exception as e:
++            print('Error: %s' % e, file=sys.stderr)
++        sys.exit(rc)
++
++This script is also available for download `online
++<https://gist.github.com/4673395>`_.
+diff -r bd8afb90ebf2 Doc/library/winreg.rst
+--- a/Doc/library/winreg.rst
++++ b/Doc/library/winreg.rst
+@@ -12,6 +12,17 @@
+ to ensure that the handles are closed correctly, even if the programmer neglects
+ to explicitly close them.
+ 
++.. _exception-changed:
++
++.. versionchanged:: 3.3
++   Several functions in this module used to raise a
++   :exc:`WindowsError`, which is now an alias of :exc:`OSError`.
++
++.. _functions:
++
++Functions
++------------------
++
+ This module offers the following functions:
+ 
+ 
+@@ -37,12 +48,11 @@
+ 
+    *key* is the predefined handle to connect to.
+ 
+-   The return value is the handle of the opened key. If the function fails, a
++   The return value is the handle of the opened key. If the function fails, an
+    :exc:`OSError` exception is raised.
+ 
+    .. versionchanged:: 3.3
+-      This function used to raise a :exc:`WindowsError`, which is now an
+-      alias of :exc:`OSError`.
++      See :ref:`above <exception-changed>`.
+ 
+ 
+ .. function:: CreateKey(key, sub_key)
+@@ -60,15 +70,14 @@
+ 
+    If the key already exists, this function opens the existing key.
+ 
+-   The return value is the handle of the opened key. If the function fails, a
++   The return value is the handle of the opened key. If the function fails, an
+    :exc:`OSError` exception is raised.
+ 
+    .. versionchanged:: 3.3
+-      This function used to raise a :exc:`WindowsError`, which is now an
+-      alias of :exc:`OSError`.
++      See :ref:`above <exception-changed>`.
+ 
+ 
+-.. function:: CreateKeyEx(key, sub_key, reserved=0, access=KEY_ALL_ACCESS)
++.. function:: CreateKeyEx(key, sub_key, reserved=0, access=KEY_WRITE)
+ 
+    Creates or opens the specified key, returning a
+    :ref:`handle object <handle-object>`.
+@@ -78,10 +87,10 @@
+ 
+    *sub_key* is a string that names the key this method opens or creates.
+ 
+-   *res* is a reserved integer, and must be zero. The default is zero.
++   *reserved* is a reserved integer, and must be zero. The default is zero.
+ 
+-   *sam* is an integer that specifies an access mask that describes the desired
+-   security access for the key.  Default is :const:`KEY_ALL_ACCESS`.  See
++   *access* is an integer that specifies an access mask that describes the desired
++   security access for the key.  Default is :const:`KEY_WRITE`.  See
+    :ref:`Access Rights <access-rights>` for other allowed values.
+ 
+    If *key* is one of the predefined keys, *sub_key* may be ``None``. In that
+@@ -89,14 +98,13 @@
+ 
+    If the key already exists, this function opens the existing key.
+ 
+-   The return value is the handle of the opened key. If the function fails, a
++   The return value is the handle of the opened key. If the function fails, an
+    :exc:`OSError` exception is raised.
+ 
+    .. versionadded:: 3.2
+ 
+    .. versionchanged:: 3.3
+-      This function used to raise a :exc:`WindowsError`, which is now an
+-      alias of :exc:`OSError`.
++      See :ref:`above <exception-changed>`.
+ 
+ 
+ .. function:: DeleteKey(key, sub_key)
+@@ -112,14 +120,13 @@
+    *This method can not delete keys with subkeys.*
+ 
+    If the method succeeds, the entire key, including all of its values, is removed.
+-   If the method fails, a :exc:`OSError` exception is raised.
++   If the method fails, an :exc:`OSError` exception is raised.
+ 
+    .. versionchanged:: 3.3
+-      This function used to raise a :exc:`WindowsError`, which is now an
+-      alias of :exc:`OSError`.
++      See :ref:`above <exception-changed>`.
+ 
+ 
+-.. function:: DeleteKeyEx(key, sub_key, access=KEY_ALL_ACCESS, reserved=0)
++.. function:: DeleteKeyEx(key, sub_key, access=KEY_WOW64_64KEY, reserved=0)
+ 
+    Deletes the specified key.
+ 
+@@ -136,24 +143,23 @@
+    *key* parameter. This value must not be ``None``, and the key may not have
+    subkeys.
+ 
+-   *res* is a reserved integer, and must be zero. The default is zero.
++   *reserved* is a reserved integer, and must be zero. The default is zero.
+ 
+-   *sam* is an integer that specifies an access mask that describes the desired
++   *access* is an integer that specifies an access mask that describes the desired
+    security access for the key.  Default is :const:`KEY_ALL_ACCESS`.  See
+    :ref:`Access Rights <access-rights>` for other allowed values.
+ 
+    *This method can not delete keys with subkeys.*
+ 
+    If the method succeeds, the entire key, including all of its values, is
+-   removed. If the method fails, a :exc:`OSError` exception is raised.
++   removed. If the method fails, an :exc:`OSError` exception is raised.
+ 
+    On unsupported Windows versions, :exc:`NotImplementedError` is raised.
+ 
+    .. versionadded:: 3.2
+ 
+    .. versionchanged:: 3.3
+-      This function used to raise a :exc:`WindowsError`, which is now an
+-      alias of :exc:`OSError`.
++      See :ref:`above <exception-changed>`.
+ 
+ 
+ .. function:: DeleteValue(key, value)
+@@ -176,12 +182,11 @@
+    *index* is an integer that identifies the index of the key to retrieve.
+ 
+    The function retrieves the name of one subkey each time it is called.  It is
+-   typically called repeatedly until a :exc:`OSError` exception is
++   typically called repeatedly until an :exc:`OSError` exception is
+    raised, indicating, no more values are available.
+ 
+    .. versionchanged:: 3.3
+-      This function used to raise a :exc:`WindowsError`, which is now an
+-      alias of :exc:`OSError`.
++      See :ref:`above <exception-changed>`.
+ 
+ 
+ .. function:: EnumValue(key, index)
+@@ -194,7 +199,7 @@
+    *index* is an integer that identifies the index of the value to retrieve.
+ 
+    The function retrieves the name of one subkey each time it is called. It is
+-   typically called repeatedly, until a :exc:`OSError` exception is
++   typically called repeatedly, until an :exc:`OSError` exception is
+    raised, indicating no more values.
+ 
+    The result is a tuple of 3 items:
+@@ -214,8 +219,7 @@
+    +-------+--------------------------------------------+
+ 
+    .. versionchanged:: 3.3
+-      This function used to raise a :exc:`WindowsError`, which is now an
+-      alias of :exc:`OSError`.
++      See :ref:`above <exception-changed>`.
+ 
+ 
+ .. function:: ExpandEnvironmentStrings(str)
+@@ -272,6 +276,7 @@
+ 
+ 
+ .. function:: OpenKey(key, sub_key, reserved=0, access=KEY_READ)
++              OpenKeyEx(key, sub_key, reserved=0, access=KEY_READ)
+ 
+    Opens the specified key, returning a :ref:`handle object <handle-object>`.
+ 
+@@ -294,14 +299,7 @@
+       Allow the use of named arguments.
+ 
+    .. versionchanged:: 3.3
+-      This function used to raise a :exc:`WindowsError`, which is now an
+-      alias of :exc:`OSError`.
+-
+-
+-.. function:: OpenKeyEx()
+-
+-   The functionality of :func:`OpenKeyEx` is provided via :func:`OpenKey`,
+-   by the use of default arguments.
++      See :ref:`above <exception-changed>`.
+ 
+ 
+ .. function:: QueryInfoKey(key)
+@@ -427,11 +425,11 @@
+    *value_name* is a string that names the subkey with which the value is
+    associated.
+ 
++   *reserved* can be anything -- zero is always passed to the API.
++
+    *type* is an integer that specifies the type of the data. See
+    :ref:`Value Types <value-types>` for the available types.
+ 
+-   *reserved* can be anything -- zero is always passed to the API.
+-
+    *value* is a string that specifies the new value.
+ 
+    This method can also set additional value and type information for the specified
+diff -r bd8afb90ebf2 Doc/library/xml.dom.minidom.rst
+--- a/Doc/library/xml.dom.minidom.rst
++++ b/Doc/library/xml.dom.minidom.rst
+@@ -1,8 +1,8 @@
+-:mod:`xml.dom.minidom` --- Lightweight DOM implementation
+-=========================================================
++:mod:`xml.dom.minidom` --- Minimal DOM implementation
++=====================================================
+ 
+ .. module:: xml.dom.minidom
+-   :synopsis: Lightweight Document Object Model (DOM) implementation.
++   :synopsis: Minimal Document Object Model (DOM) implementation.
+ .. moduleauthor:: Paul Prescod <paul@prescod.net>
+ .. sectionauthor:: Paul Prescod <paul@prescod.net>
+ .. sectionauthor:: Martin v. Löwis <martin@v.loewis.de>
+@@ -11,17 +11,11 @@
+ 
+ --------------
+ 
+-:mod:`xml.dom.minidom` is a light-weight implementation of the Document Object
+-Model interface.  It is intended to be simpler than the full DOM and also
+-significantly smaller.
+-
+-.. note::
+-
+-   The :mod:`xml.dom.minidom` module provides an implementation of the W3C-DOM,
+-   with an API similar to that in other programming languages.  Users who are
+-   unfamiliar with the W3C-DOM interface or who would like to write less code
+-   for processing XML files should consider using the
+-   :mod:`xml.etree.ElementTree` module instead.
++:mod:`xml.dom.minidom` is a minimal implementation of the Document Object
++Model interface, with an API similar to that in other languages.  It is intended
++to be simpler than the full DOM and also significantly smaller.  Users who are
++not already proficient with the DOM should consider using the
++:mod:`xml.etree.ElementTree` module for their XML processing instead
+ 
+ DOM applications typically start by parsing some XML into a DOM.  With
+ :mod:`xml.dom.minidom`, this is done through the parse functions::
+diff -r bd8afb90ebf2 Doc/library/xml.etree.elementtree.rst
+--- a/Doc/library/xml.etree.elementtree.rst
++++ b/Doc/library/xml.etree.elementtree.rst
+@@ -291,7 +291,9 @@
+ |                       | current  element.  For example, ``.//egg`` selects   |
+ |                       | all ``egg`` elements in the entire tree.             |
+ +-----------------------+------------------------------------------------------+
+-| ``..``                | Selects the parent element.                          |
++| ``..``                | Selects the parent element.  Returns ``None`` if the |
++|                       | path attempts to reach the ancestors of the start    |
++|                       | element (the element ``find`` was called on).        |
+ +-----------------------+------------------------------------------------------+
+ | ``[@attrib]``         | Selects all elements that have the given attribute.  |
+ +-----------------------+------------------------------------------------------+
+@@ -431,9 +433,9 @@
+    Generates a string representation of an XML element, including all
+    subelements.  *element* is an :class:`Element` instance.  *encoding* [1]_ is
+    the output encoding (default is US-ASCII).  Use ``encoding="unicode"`` to
+-   generate a Unicode string.  *method* is either ``"xml"``,
+-   ``"html"`` or ``"text"`` (default is ``"xml"``).  Returns an (optionally)
+-   encoded string containing the XML data.
++   generate a Unicode string (otherwise, a bytestring is generated).  *method*
++   is either ``"xml"``, ``"html"`` or ``"text"`` (default is ``"xml"``).
++   Returns an (optionally) encoded string containing the XML data.
+ 
+ 
+ .. function:: tostringlist(element, encoding="us-ascii", method="xml")
+@@ -441,11 +443,11 @@
+    Generates a string representation of an XML element, including all
+    subelements.  *element* is an :class:`Element` instance.  *encoding* [1]_ is
+    the output encoding (default is US-ASCII).  Use ``encoding="unicode"`` to
+-   generate a Unicode string.  *method* is either ``"xml"``,
+-   ``"html"`` or ``"text"`` (default is ``"xml"``).  Returns a list of
+-   (optionally) encoded strings containing the XML data.  It does not guarantee
+-   any specific sequence, except that ``"".join(tostringlist(element)) ==
+-   tostring(element)``.
++   generate a Unicode string (otherwise, a bytestring is generated).  *method*
++   is either ``"xml"``, ``"html"`` or ``"text"`` (default is ``"xml"``).
++   Returns a list of (optionally) encoded strings containing the XML data.
++   It does not guarantee any specific sequence, except that
++   ``"".join(tostringlist(element)) == tostring(element)``.
+ 
+    .. versionadded:: 3.2
+ 
+@@ -521,7 +523,7 @@
+    .. method:: clear()
+ 
+       Resets an element.  This function removes all subelements, clears all
+-      attributes, and sets the text and tail attributes to None.
++      attributes, and sets the text and tail attributes to ``None``.
+ 
+ 
+    .. method:: get(key, default=None)
+@@ -740,7 +742,7 @@
+ 
+ 
+    .. method:: write(file, encoding="us-ascii", xml_declaration=None, \
+-                     method="xml")
++                     default_namespace=None, method="xml")
+ 
+       Writes the element tree to a file, as XML.  *file* is a file name, or a
+       :term:`file object` opened for writing.  *encoding* [1]_ is the output
+@@ -748,6 +750,7 @@
+       *xml_declaration* controls if an XML declaration should be added to the
+       file.  Use ``False`` for never, ``True`` for always, ``None``
+       for only if not US-ASCII or UTF-8 or Unicode (default is ``None``).
++      *default_namespace* sets the default XML namespace (for "xmlns").
+       *method* is either ``"xml"``, ``"html"`` or ``"text"`` (default is
+       ``"xml"``).
+ 
+diff -r bd8afb90ebf2 Doc/library/xml.rst
+--- /dev/null
++++ b/Doc/library/xml.rst
+@@ -0,0 +1,29 @@
++.. _xml:
++
++XML Processing Modules
++======================
++
++Python's interfaces for processing XML are grouped in the ``xml`` package.
++
++It is important to note that modules in the :mod:`xml` package require that
++there be at least one SAX-compliant XML parser available. The Expat parser is
++included with Python, so the :mod:`xml.parsers.expat` module will always be
++available.
++
++The documentation for the :mod:`xml.dom` and :mod:`xml.sax` packages are the
++definition of the Python bindings for the DOM and SAX interfaces.
++
++The XML handling submodules are:
++
++* :mod:`xml.etree.ElementTree`: the ElementTree API, a simple and lightweight
++
++..
++
++* :mod:`xml.dom`: the DOM API definition
++* :mod:`xml.dom.minidom`: a lightweight DOM implementation
++* :mod:`xml.dom.pulldom`: support for building partial DOM trees
++
++..
++
++* :mod:`xml.sax`: SAX2 base classes and convenience functions
++* :mod:`xml.parsers.expat`: the Expat parser binding
+diff -r bd8afb90ebf2 Doc/library/xmlrpc.rst
+--- /dev/null
++++ b/Doc/library/xmlrpc.rst
+@@ -0,0 +1,12 @@
++:mod:`xmlrpc` --- XMLRPC server and client modules
++==================================================
++
++XML-RPC is a Remote Procedure Call method that uses XML passed via HTTP as a
++transport.  With it, a client can call methods with parameters on a remote
++server (the server is named by a URI) and get back structured data.
++
++``xmlrpc`` is a package that collects server and client modules implementing
++XML-RPC.  The modules are:
++
++* :mod:`xmlrpc.client`
++* :mod:`xmlrpc.server`
+diff -r bd8afb90ebf2 Doc/library/zipfile.rst
+--- a/Doc/library/zipfile.rst
++++ b/Doc/library/zipfile.rst
+@@ -18,7 +18,7 @@
+ 
+ This module does not currently handle multi-disk ZIP files.
+ It can handle ZIP files that use the ZIP64 extensions
+-(that is ZIP files that are more than 4 GByte in size).  It supports
++(that is ZIP files that are more than 4 GiB in size).  It supports
+ decryption of encrypted files in ZIP archives, but it currently cannot
+ create an encrypted file.  Decryption is extremely slow as it is
+ implemented in native Python rather than C.
+@@ -61,7 +61,7 @@
+ .. class:: ZipInfo(filename='NoName', date_time=(1980,1,1,0,0,0))
+ 
+    Class used to represent information about a member of an archive. Instances
+-   of this class are returned by the :meth:`getinfo` and :meth:`infolist`
++   of this class are returned by the :meth:`.getinfo` and :meth:`.infolist`
+    methods of :class:`ZipFile` objects.  Most users of the :mod:`zipfile` module
+    will not need to create these, but only use those created by this
+    module. *filename* should be the full name of the archive member, and
+@@ -87,20 +87,20 @@
+ .. data:: ZIP_DEFLATED
+ 
+    The numeric constant for the usual ZIP compression method.  This requires the
+-   zlib module.
++   :mod:`zlib` module.
+ 
+ 
+ .. data:: ZIP_BZIP2
+ 
+    The numeric constant for the BZIP2 compression method.  This requires the
+-   bz2 module.
++   :mod:`bz2` module.
+ 
+    .. versionadded:: 3.3
+ 
+ .. data:: ZIP_LZMA
+ 
+    The numeric constant for the LZMA compression method.  This requires the
+-   lzma module.
++   :mod:`lzma` module.
+ 
+    .. versionadded:: 3.3
+ 
+@@ -148,14 +148,14 @@
+    (:mod:`zlib`, :mod:`bz2` or :mod:`lzma`) is not available, :exc:`RuntimeError`
+    is also raised. The default is :const:`ZIP_STORED`.  If *allowZip64* is
+    ``True`` zipfile will create ZIP files that use the ZIP64 extensions when
+-   the zipfile is larger than 2 GB. If it is  false (the default) :mod:`zipfile`
++   the zipfile is larger than 2 GiB. If it is  false (the default) :mod:`zipfile`
+    will raise an exception when the ZIP file would require ZIP64 extensions.
+    ZIP64 extensions are disabled by default because the default :program:`zip`
+    and :program:`unzip` commands on Unix (the InfoZIP utilities) don't support
+    these extensions.
+ 
+    If the file is created with mode ``'a'`` or ``'w'`` and then
+-   :meth:`close`\ d without adding any files to the archive, the appropriate
++   :meth:`closed <close>` without adding any files to the archive, the appropriate
+    ZIP structures for an empty archive will be written to the file.
+ 
+    ZipFile is also a context manager and therefore supports the
+@@ -169,7 +169,7 @@
+       Added the ability to use :class:`ZipFile` as a context manager.
+ 
+    .. versionchanged:: 3.3
+-      Added support for :mod:`bzip2` and :mod:`lzma` compression.
++      Added support for :mod:`bzip2 <bz2>` and :mod:`lzma` compression.
+ 
+ 
+ .. method:: ZipFile.close()
+@@ -207,7 +207,7 @@
+    *mode* parameter, if included, must be one of the following: ``'r'`` (the
+    default), ``'U'``, or ``'rU'``. Choosing ``'U'`` or  ``'rU'`` will enable
+    :term:`universal newlines` support in the read-only object.  *pwd* is the
+-   password used for encrypted files.  Calling  :meth:`open` on a closed
++   password used for encrypted files.  Calling  :meth:`.open` on a closed
+    ZipFile will raise a  :exc:`RuntimeError`.
+ 
+    .. note::
+@@ -229,7 +229,7 @@
+ 
+    .. note::
+ 
+-      The :meth:`open`, :meth:`read` and :meth:`extract` methods can take a filename
++      The :meth:`.open`, :meth:`read` and :meth:`extract` methods can take a filename
+       or a :class:`ZipInfo` object.  You will appreciate this when trying to read a
+       ZIP file that contains members with duplicate names.
+ 
+@@ -242,6 +242,16 @@
+    to extract to.  *member* can be a filename or a :class:`ZipInfo` object.
+    *pwd* is the password used for encrypted files.
+ 
++   .. note::
++
++      If a member filename is an absolute path, a drive/UNC sharepoint and
++      leading (back)slashes will be stripped, e.g.: ``///foo/bar`` becomes
++      ``foo/bar`` on Unix, and ``C:\foo\bar`` becomes ``foo\bar`` on Windows.
++      And all ``".."`` components in a member filename will be removed, e.g.:
++      ``../../foo../../ba..r`` becomes ``foo../ba..r``.  On Windows illegal
++      characters (``:``, ``<``, ``>``, ``|``, ``"``, ``?``, and ``*``)
++      replaced by underscore (``_``).
++
+ 
+ .. method:: ZipFile.extractall(path=None, members=None, pwd=None)
+ 
+@@ -257,6 +267,9 @@
+       that have absolute filenames starting with ``"/"`` or filenames with two
+       dots ``".."``.
+ 
++   .. versionchanged:: 3.3.1
++      The zipfile module attempts to prevent that.  See :meth:`extract` note.
++
+ 
+ .. method:: ZipFile.printdir()
+ 
+@@ -335,7 +348,7 @@
+       :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`.
+ 
+    .. versionchanged:: 3.2
+-      The *compression_type* argument.
++      The *compress_type* argument.
+ 
+ The following data attributes are also available:
+ 
+@@ -351,7 +364,7 @@
+    The comment text associated with the ZIP file.  If assigning a comment to a
+    :class:`ZipFile` instance created with mode 'a' or 'w', this should be a
+    string no longer than 65535 bytes.  Comments longer than this will be
+-   truncated in the written archive when :meth:`ZipFile.close` is called.
++   truncated in the written archive when :meth:`close` is called.
+ 
+ 
+ .. _pyzipfile-objects:
+@@ -407,8 +420,8 @@
+ ZipInfo Objects
+ ---------------
+ 
+-Instances of the :class:`ZipInfo` class are returned by the :meth:`getinfo` and
+-:meth:`infolist` methods of :class:`ZipFile` objects.  Each object stores
++Instances of the :class:`ZipInfo` class are returned by the :meth:`.getinfo` and
++:meth:`.infolist` methods of :class:`ZipFile` objects.  Each object stores
+ information about a single member of the ZIP archive.
+ 
+ Instances have the following attributes:
+diff -r bd8afb90ebf2 Doc/library/zlib.rst
+--- a/Doc/library/zlib.rst
++++ b/Doc/library/zlib.rst
+@@ -52,10 +52,10 @@
+ .. function:: compress(data[, level])
+ 
+    Compresses the bytes in *data*, returning a bytes object containing compressed data.
+-   *level* is an integer from ``1`` to ``9`` controlling the level of compression;
++   *level* is an integer from ``0`` to ``9`` controlling the level of compression;
+    ``1`` is fastest and produces the least compression, ``9`` is slowest and
+-   produces the most.  The default value is ``6``.  Raises the :exc:`error`
+-   exception if any error occurs.
++   produces the most.  ``0`` is no compression.  The default value is ``6``.
++   Raises the :exc:`error` exception if any error occurs.
+ 
+ 
+ .. function:: compressobj(level=-1, method=DEFLATED, wbits=15, memlevel=8, strategy=Z_DEFAULT_STRATEGY[, zdict])
+@@ -63,9 +63,10 @@
+    Returns a compression object, to be used for compressing data streams that won't
+    fit into memory at once.
+ 
+-   *level* is the compression level -- an integer from ``1`` to ``9``. A value
++   *level* is the compression level -- an integer from ``0`` to ``9``. A value
+    of ``1`` is fastest and produces the least compression, while a value of
+-   ``9`` is slowest and produces the most. The default value is ``6``.
++   ``9`` is slowest and produces the most. ``0`` is no compression. The default
++   value is ``6``.
+ 
+    *method* is the compression algorithm. Currently, the only supported value is
+    ``DEFLATED``.
+diff -r bd8afb90ebf2 Doc/license.rst
+--- a/Doc/license.rst
++++ b/Doc/license.rst
+@@ -150,7 +150,7 @@
+    analyze, test, perform and/or display publicly, prepare derivative works,
+    distribute, and otherwise use Python |release| alone or in any derivative
+    version, provided, however, that PSF's License Agreement and PSF's notice of
+-   copyright, i.e., "Copyright © 2001-2012 Python Software Foundation; All Rights
++   copyright, i.e., "Copyright © 2001-2013 Python Software Foundation; All Rights
+    Reserved" are retained in Python |release| alone or in any derivative version
+    prepared by Licensee.
+ 
+@@ -327,7 +327,7 @@
+ ----------------
+ 
+ The :mod:`_random` module includes code based on a download from
+-http://www.math.keio.ac.jp/ matumoto/MT2002/emt19937ar.html. The following are
++http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html. The following are
+ the verbatim comments from the original code::
+ 
+    A C-program for MT19937, with initialization improved 2002/1/26.
+@@ -368,8 +368,8 @@
+ 
+ 
+    Any feedback is very welcome.
+-   http://www.math.keio.ac.jp/matumoto/emt.html
+-   email: matumoto@math.keio.ac.jp
++   http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
++   email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
+ 
+ 
+ Sockets
+diff -r bd8afb90ebf2 Doc/make.bat
+--- a/Doc/make.bat
++++ b/Doc/make.bat
+@@ -37,7 +37,7 @@
+ svn co %SVNROOT%/external/Sphinx-1.0.7/sphinx tools/sphinx
+ svn co %SVNROOT%/external/docutils-0.6/docutils tools/docutils
+ svn co %SVNROOT%/external/Jinja-2.3.1/jinja2 tools/jinja2
+-svn co %SVNROOT%/external/Pygments-1.3.1/pygments tools/pygments
++svn co %SVNROOT%/external/Pygments-1.5dev-20120930/pygments tools/pygments
+ goto end
+ 
+ :update
+diff -r bd8afb90ebf2 Doc/reference/compound_stmts.rst
+--- a/Doc/reference/compound_stmts.rst
++++ b/Doc/reference/compound_stmts.rst
+@@ -307,11 +307,11 @@
+ :keyword:`try` clause is executed, including any :keyword:`except` and
+ :keyword:`else` clauses.  If an exception occurs in any of the clauses and is
+ not handled, the exception is temporarily saved. The :keyword:`finally` clause
+-is executed.  If there is a saved exception or :keyword:`break` statement,
+-it is re-raised at the end of the :keyword:`finally` clause. If the
+-:keyword:`finally` clause raises another exception the saved exception
+-is set as the context of the new exception; if the :keyword:`finally` clause
+-executes a :keyword:`return` statement, the saved exception is discarded::
++is executed.  If there is a saved exception it is re-raised at the end of the
++:keyword:`finally` clause.  If the :keyword:`finally` clause raises another
++exception, the saved exception is set as the context of the new exception.
++If the :keyword:`finally` clause executes a :keyword:`return` or :keyword:`break`
++statement, the saved exception is discarded::
+ 
+     def f():
+         try:
+@@ -417,6 +417,9 @@
+       statement.
+ 
+ 
++.. index::
++   single: parameter; function definition
++
+ .. _function:
+ .. _def:
+ 
+@@ -442,8 +445,7 @@
+    decorator: "@" `dotted_name` ["(" [`parameter_list` [","]] ")"] NEWLINE
+    dotted_name: `identifier` ("." `identifier`)*
+    parameter_list: (`defparameter` ",")*
+-                 : (  "*" [`parameter`] ("," `defparameter`)*
+-                 : [, "**" `parameter`]
++                 : ( "*" [`parameter`] ("," `defparameter`)* ["," "**" `parameter`]
+                  : | "**" `parameter`
+                  : | `defparameter` [","] )
+    parameter: `identifier` [":" `expression`]
+@@ -479,11 +481,14 @@
+    def func(): pass
+    func = f1(arg)(f2(func))
+ 
+-.. index:: triple: default; parameter; value
++.. index::
++   triple: default; parameter; value
++   single: argument; function definition
+ 
+-When one or more parameters have the form *parameter* ``=`` *expression*, the
+-function is said to have "default parameter values."  For a parameter with a
+-default value, the corresponding argument may be omitted from a call, in which
++When one or more :term:`parameters <parameter>` have the form *parameter* ``=``
++*expression*, the function is said to have "default parameter values."  For a
++parameter with a default value, the corresponding :term:`argument` may be
++omitted from a call, in which
+ case the parameter's default value is substituted.  If a parameter has a default
+ value, all following parameters up until the "``*``" must also have a default
+ value --- this is a syntactic restriction that is not expressed by the grammar.
+diff -r bd8afb90ebf2 Doc/reference/datamodel.rst
+--- a/Doc/reference/datamodel.rst
++++ b/Doc/reference/datamodel.rst
+@@ -274,11 +274,13 @@
+ 
+       The following types are immutable sequences:
+ 
++      .. index::
++         single: string; immutable sequences
++
+       Strings
+          .. index::
+             builtin: chr
+             builtin: ord
+-            builtin: str
+             single: character
+             single: integer
+             single: Unicode
+@@ -312,7 +314,7 @@
+ 
+          A bytes object is an immutable array.  The items are 8-bit bytes,
+          represented by integers in the range 0 <= x < 256.  Bytes literals
+-         (like ``b'abc'`` and the built-in function :func:`bytes` can be used to
++         (like ``b'abc'``) and the built-in function :func:`bytes` can be used to
+          construct bytes objects.  Also, bytes objects can be decoded to strings
+          via the :meth:`decode` method.
+ 
+@@ -600,9 +602,9 @@
+       A function or method which uses the :keyword:`yield` statement (see section
+       :ref:`yield`) is called a :dfn:`generator function`.  Such a function, when
+       called, always returns an iterator object which can be used to execute the
+-      body of the function:  calling the iterator's :meth:`__next__` method will
+-      cause the function to execute until it provides a value using the
+-      :keyword:`yield` statement.  When the function executes a
++      body of the function:  calling the iterator's :meth:`iterator__next__`
++      method will cause the function to execute until it provides a value
++      using the :keyword:`yield` statement.  When the function executes a
+       :keyword:`return` statement or falls off the end, a :exc:`StopIteration`
+       exception is raised and the iterator will have reached the end of the set of
+       values to be returned.
+@@ -1140,11 +1142,12 @@
+       modules are still available at the time when the :meth:`__del__` method is
+       called.
+ 
++      .. index::
++         single: repr() (built-in function); __repr__() (object method)
++
+ 
+ .. method:: object.__repr__(self)
+ 
+-   .. index:: builtin: repr
+-
+    Called by the :func:`repr` built-in function to compute the "official" string
+    representation of an object.  If at all possible, this should look like a
+    valid Python expression that could be used to recreate an object with the
+@@ -1157,18 +1160,25 @@
+    This is typically used for debugging, so it is important that the representation
+    is information-rich and unambiguous.
+ 
++   .. index::
++      single: string; __str__() (object method)
++      single: format() (built-in function); __str__() (object method)
++      single: print() (built-in function); __str__() (object method)
++
+ 
+ .. method:: object.__str__(self)
+ 
+-   .. index::
+-      builtin: str
+-      builtin: print
+-
+-   Called by the :func:`str` built-in function and by the :func:`print` function
+-   to compute the "informal" string representation of an object.  This differs
+-   from :meth:`__repr__` in that it does not have to be a valid Python
+-   expression: a more convenient or concise representation may be used instead.
+-   The return value must be a string object.
++   Called by :func:`str(object) <str>` and the built-in functions
++   :func:`format` and :func:`print` to compute the "informal" or nicely
++   printable string representation of an object.  The return value must be a
++   :ref:`string <textseq>` object.
++
++   This method differs from :meth:`object.__repr__` in that there is no
++   expectation that :meth:`__str__` return a valid Python expression: a more
++   convenient or concise representation can be used.
++
++   The default implementation defined by the built-in type :class:`object`
++   calls :meth:`object.__repr__`.
+ 
+    .. XXX what about subclasses of string?
+ 
+@@ -1180,16 +1190,16 @@
+    Called by :func:`bytes` to compute a byte-string representation of an
+    object. This should return a ``bytes`` object.
+ 
++   .. index::
++      single: string; __format__() (object method)
++      pair: string; conversion
++      builtin: print
++
+ 
+ .. method:: object.__format__(self, format_spec)
+ 
+-   .. index::
+-      pair: string; conversion
+-      builtin: str
+-      builtin: print
+-
+    Called by the :func:`format` built-in function (and by extension, the
+-   :meth:`format` method of class :class:`str`) to produce a "formatted"
++   :meth:`str.format` method of class :class:`str`) to produce a "formatted"
+    string representation of an object. The ``format_spec`` argument is
+    a string that contains a description of the formatting options desired.
+    The interpretation of the ``format_spec`` argument is up to the type
+@@ -1271,22 +1281,22 @@
+    and ``x.__hash__()`` returns an appropriate value such that ``x == y``
+    implies both that ``x is y`` and ``hash(x) == hash(y)``.
+ 
+-   Classes which inherit a :meth:`__hash__` method from a parent class but
+-   change the meaning of :meth:`__eq__` such that the hash value returned is no
+-   longer appropriate (e.g. by switching to a value-based concept of equality
+-   instead of the default identity based equality) can explicitly flag
+-   themselves as being unhashable by setting ``__hash__ = None`` in the class
+-   definition. Doing so means that not only will instances of the class raise an
+-   appropriate :exc:`TypeError` when a program attempts to retrieve their hash
+-   value, but they will also be correctly identified as unhashable when checking
+-   ``isinstance(obj, collections.Hashable)`` (unlike classes which define their
+-   own :meth:`__hash__` to explicitly raise :exc:`TypeError`).
++   A class that overrides :meth:`__eq__` and does not define :meth:`__hash__`
++   will have its :meth:`__hash__` implicitly set to ``None``.  When the
++   :meth:`__hash__` method of a class is ``None``, instances of the class will
++   raise an appropriate :exc:`TypeError` when a program attempts to retrieve
++   their hash value, and will also be correctly identified as unhashable when
++   checking ``isinstance(obj, collections.Hashable``).
+ 
+    If a class that overrides :meth:`__eq__` needs to retain the implementation
+    of :meth:`__hash__` from a parent class, the interpreter must be told this
+-   explicitly by setting ``__hash__ = <ParentClass>.__hash__``. Otherwise the
+-   inheritance of :meth:`__hash__` will be blocked, just as if :attr:`__hash__`
+-   had been explicitly set to :const:`None`.
++   explicitly by setting ``__hash__ = <ParentClass>.__hash__``.
++
++   If a class that does not override :meth:`__eq__` wishes to suppress hash
++   support, it should include ``__hash__ = None`` in the class definition.
++   A class which defines its own :meth:`__hash__` that explicitly raises
++   a :exc:`TypeError` would be incorrectly identified as hashable by
++   an ``isinstance(obj, collections.Hashable)`` call.
+ 
+ 
+    .. note::
+diff -r bd8afb90ebf2 Doc/reference/expressions.rst
+--- a/Doc/reference/expressions.rst
++++ b/Doc/reference/expressions.rst
+@@ -294,13 +294,13 @@
+ brackets or curly braces.
+ 
+ Variables used in the generator expression are evaluated lazily when the
+-:meth:`__next__` method is called for generator object (in the same fashion as
+-normal generators).  However, the leftmost :keyword:`for` clause is immediately
+-evaluated, so that an error produced by it can be seen before any other possible
+-error in the code that handles the generator expression.  Subsequent
+-:keyword:`for` clauses cannot be evaluated immediately since they may depend on
+-the previous :keyword:`for` loop. For example: ``(x*y for x in range(10) for y
+-in bar(x))``.
++:meth:`~generator.__next__` method is called for generator object (in the same
++fashion as normal generators).  However, the leftmost :keyword:`for` clause is
++immediately evaluated, so that an error produced by it can be seen before any
++other possible error in the code that handles the generator expression.
++Subsequent :keyword:`for` clauses cannot be evaluated immediately since they
++may depend on the previous :keyword:`for` loop. For example: ``(x*y for x in
++range(10) for y in bar(x))``.
+ 
+ The parentheses can be omitted on calls with only one argument.  See section
+ :ref:`calls` for the detail.
+@@ -320,7 +320,8 @@
+    yield_atom: "(" `yield_expression` ")"
+    yield_expression: "yield" [`expression_list` | "from" `expression`]
+ 
+-The :keyword:`yield` expression is only used when defining a generator function,
++The :keyword:`yield` expression is only used when defining a :term:`generator`
++function,
+ and can only be used in the body of a function definition.  Using a
+ :keyword:`yield` expression in a function definition is sufficient to cause that
+ definition to create a generator function instead of a normal function.
+@@ -394,10 +395,11 @@
+ 
+    Starts the execution of a generator function or resumes it at the last
+    executed :keyword:`yield` expression.  When a generator function is resumed
+-   with a :meth:`__next__` method, the current :keyword:`yield` expression
+-   always evaluates to :const:`None`.  The execution then continues to the next
+-   :keyword:`yield` expression, where the generator is suspended again, and the
+-   value of the :token:`expression_list` is returned to :meth:`next`'s caller.
++   with a :meth:`~generator.__next__` method, the current :keyword:`yield`
++   expression always evaluates to :const:`None`.  The execution then continues
++   to the next :keyword:`yield` expression, where the generator is suspended
++   again, and the value of the :token:`expression_list` is returned to
++   :meth:`next`'s caller.
+    If the generator exits without yielding another value, a :exc:`StopIteration`
+    exception is raised.
+ 
+@@ -437,6 +439,12 @@
+    other exception, it is propagated to the caller.  :meth:`close` does nothing
+    if the generator has already exited due to an exception or normal exit.
+ 
++
++.. index:: single: yield; examples
++
++Examples
++^^^^^^^^
++
+ Here is a simple example that demonstrates the behavior of generators and
+ generator functions::
+ 
+@@ -464,6 +472,9 @@
+    >>> generator.close()
+    Don't forget to clean up when 'close()' is called.
+ 
++For examples using ``yield from``, see :ref:`pep-380` in "What's New in
++Python."
++
+ 
+ .. seealso::
+ 
+@@ -626,17 +637,18 @@
+ expressions.
+ 
+ 
++.. index::
++   object: callable
++   single: call
++   single: argument; call semantics
++
+ .. _calls:
+ 
+ Calls
+ -----
+ 
+-.. index:: single: call
+-
+-.. index:: object: callable
+-
+-A call calls a callable object (e.g., a function) with a possibly empty series
+-of arguments:
++A call calls a callable object (e.g., a :term:`function`) with a possibly empty
++series of :term:`arguments <argument>`:
+ 
+ .. productionlist::
+    call: `primary` "(" [`argument_list` [","] | `comprehension`] ")"
+@@ -654,11 +666,14 @@
+ A trailing comma may be present after the positional and keyword arguments but
+ does not affect the semantics.
+ 
++.. index::
++   single: parameter; call semantics
++
+ The primary must evaluate to a callable object (user-defined functions, built-in
+ functions, methods of built-in objects, class objects, methods of class
+ instances, and all objects having a :meth:`__call__` method are callable).  All
+ argument expressions are evaluated before the call is attempted.  Please refer
+-to section :ref:`function` for the syntax of formal parameter lists.
++to section :ref:`function` for the syntax of formal :term:`parameter` lists.
+ 
+ .. XXX update with kwonly args PEP
+ 
+@@ -1094,16 +1109,10 @@
+   another one is made arbitrarily but consistently within one execution of a
+   program.
+ 
+-Comparison of objects of the differing types depends on whether either
+-of the types provide explicit support for the comparison.  Most numeric types
+-can be compared with one another, but comparisons of :class:`float` and
+-:class:`Decimal` are not supported to avoid the inevitable confusion arising
+-from representation issues such as ``float('1.1')`` being inexactly represented
+-and therefore not exactly equal to ``Decimal('1.1')`` which is.  When
+-cross-type comparison is not supported, the comparison method returns
+-``NotImplemented``.  This can create the illusion of non-transitivity between
+-supported cross-type comparisons and unsupported comparisons.  For example,
+-``Decimal(2) == 2`` and ``2 == float(2)`` but ``Decimal(2) != float(2)``.
++Comparison of objects of the differing types depends on whether either of the
++types provide explicit support for the comparison.  Most numeric types can be
++compared with one another.  When cross-type comparison is not supported, the
++comparison method returns ``NotImplemented``.
+ 
+ .. _membership-test-details:
+ 
+@@ -1298,8 +1307,8 @@
+ 
+ .. _operator-summary:
+ 
+-Summary
+-=======
++Operator precedence
++===================
+ 
+ .. index:: pair: operator; precedence
+ 
+@@ -1323,9 +1332,9 @@
+ +-----------------------------------------------+-------------------------------------+
+ | :keyword:`and`                                | Boolean AND                         |
+ +-----------------------------------------------+-------------------------------------+
+-| :keyword:`not` *x*                            | Boolean NOT                         |
++| :keyword:`not` ``x``                          | Boolean NOT                         |
+ +-----------------------------------------------+-------------------------------------+
+-| :keyword:`in`, :keyword:`not` :keyword:`in`,  | Comparisons, including membership   |
++| :keyword:`in`, :keyword:`not in`,             | Comparisons, including membership   |
+ | :keyword:`is`, :keyword:`is not`, ``<``,      | tests and identity tests,           |
+ | ``<=``, ``>``, ``>=``, ``!=``, ``==``         |                                     |
+ +-----------------------------------------------+-------------------------------------+
+@@ -1351,7 +1360,7 @@
+ +-----------------------------------------------+-------------------------------------+
+ | ``(expressions...)``,                         | Binding or tuple display,           |
+ | ``[expressions...]``,                         | list display,                       |
+-| ``{key:datum...}``,                           | dictionary display,                 |
++| ``{key: value...}``,                          | dictionary display,                 |
+ | ``{expressions...}``                          | set display                         |
+ +-----------------------------------------------+-------------------------------------+
+ 
+diff -r bd8afb90ebf2 Doc/reference/import.rst
+--- a/Doc/reference/import.rst
++++ b/Doc/reference/import.rst
+@@ -44,9 +44,9 @@
+ 
+ .. versionchanged:: 3.3
+    The import system has been updated to fully implement the second phase
+-   of PEP 302. There is no longer any implicit import machinery - the full
++   of :pep:`302`. There is no longer any implicit import machinery - the full
+    import system is exposed through :data:`sys.meta_path`. In addition,
+-   native namespace package support has been implemented (see PEP 420).
++   native namespace package support has been implemented (see :pep:`420`).
+ 
+ 
+ :mod:`importlib`
+@@ -219,9 +219,9 @@
+ interfaces are referred to as :term:`importers <importer>` - they return
+ themselves when they find that they can load the requested module.
+ 
+-Python includes a number of default finders and importers.  One
+-knows how to locate frozen modules, and another knows how to locate
+-built-in modules.  A third default finder searches an :term:`import path`
++Python includes a number of default finders and importers.  The first one
++knows how to locate built-in modules, and the second knows how to locate
++frozen modules.  A third default finder searches an :term:`import path`
+ for modules.  The :term:`import path` is a list of locations that may
+ name file system paths or zip files.  It can also be extended to search
+ for any locatable resource, such as those identified by URLs.
+@@ -540,7 +540,10 @@
+ implementation-specific defaults.  Entries in :data:`sys.path` can name
+ directories on the file system, zip files, and potentially other "locations"
+ (see the :mod:`site` module) that should be searched for modules, such as
+-URLs, or database queries.
++URLs, or database queries.  Only strings and bytes should be present on
++:data:`sys.path`; all other data types are ignored.  The encoding of bytes
++entries is determined by the individual :term:`path entry finders <path entry
++finder>`.
+ 
+ The :term:`path based finder` is a :term:`meta path finder`, so the import
+ machinery begins the :term:`import path` search by calling the path
+@@ -563,14 +566,17 @@
+ the path based finder to perform the path entry search again [#fnpic]_.
+ 
+ If the path entry is not present in the cache, the path based finder iterates
+-over every callable in :data:`sys.path_hooks`.  Each of the
+-:term:`path entry hooks <path entry hook>` in this list is called with a
+-single argument, the path entry to be searched.  This callable may either
+-return a :term:`path entry finder` that can handle the path entry, or it may
+-raise :exc:`ImportError`.
+-An :exc:`ImportError` is used by the path based finder to signal that the hook
+-cannot find a :term:`path entry finder` for that :term:`path entry`.  The
+-exception is ignored and :term:`import path` iteration continues.
++over every callable in :data:`sys.path_hooks`.  Each of the :term:`path entry
++hooks <path entry hook>` in this list is called with a single argument, the
++path entry to be searched.  This callable may either return a :term:`path
++entry finder` that can handle the path entry, or it may raise
++:exc:`ImportError`.  An :exc:`ImportError` is used by the path based finder to
++signal that the hook cannot find a :term:`path entry finder` for that
++:term:`path entry`.  The exception is ignored and :term:`import path`
++iteration continues.  The hook should expect either a string or bytes object;
++the encoding of bytes objects is up to the hook (e.g. it may be a file system
++encoding, UTF-8, or something else), and if the hook cannot decode the
++argument, it should raise :exc:`ImportError`.
+ 
+ If :data:`sys.path_hooks` iteration ends with no :term:`path entry finder`
+ being returned, then the path based finder's :meth:`find_module()` method
+diff -r bd8afb90ebf2 Doc/reference/index.rst
+--- a/Doc/reference/index.rst
++++ b/Doc/reference/index.rst
+@@ -4,9 +4,6 @@
+   The Python Language Reference
+ #################################
+ 
+-:Release: |version|
+-:Date: |today|
+-
+ This reference manual describes the syntax and "core semantics" of the
+ language. It is terse, but attempts to be exact and complete. The semantics of
+ non-essential built-in object types and of the built-in functions and modules
+diff -r bd8afb90ebf2 Doc/reference/lexical_analysis.rst
+--- a/Doc/reference/lexical_analysis.rst
++++ b/Doc/reference/lexical_analysis.rst
+@@ -538,9 +538,7 @@
+    this escape sequence.  Exactly four hex digits are required.
+ 
+ (6)
+-   Any Unicode character can be encoded this way, but characters outside the Basic
+-   Multilingual Plane (BMP) will be encoded using a surrogate pair if Python is
+-   compiled to use 16-bit code units (the default).  Exactly eight hex digits
++   Any Unicode character can be encoded this way.  Exactly eight hex digits
+    are required.
+ 
+ 
+diff -r bd8afb90ebf2 Doc/tools/sphinxext/indexsidebar.html
+--- a/Doc/tools/sphinxext/indexsidebar.html
++++ b/Doc/tools/sphinxext/indexsidebar.html
+@@ -3,7 +3,7 @@
+ 	    <h3>Docs for other versions</h3>
+ 	    <ul>
+ 	      <li><a href="http://docs.python.org/2.7/">Python 2.7 (stable)</a></li>
+-	      <li><a href="http://docs.python.org/3.2/">Python 3.2 (stable)</a></li>
++	      <li><a href="http://docs.python.org/3.4/">Python 3.4 (in development)</a></li>
+               <li><a href="http://www.python.org/doc/versions/">Old versions</a></li>
+             </ul>
+ 
+diff -r bd8afb90ebf2 Doc/tools/sphinxext/layout.html
+--- a/Doc/tools/sphinxext/layout.html
++++ b/Doc/tools/sphinxext/layout.html
+@@ -3,18 +3,83 @@
+         <li><img src="{{ pathto('_static/py.png', 1) }}" alt=""
+                  style="vertical-align: middle; margin-top: -1px"/></li>
+         <li><a href="http://www.python.org/">Python</a>{{ reldelim1 }}</li>
+-        <li><a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}</li>
++        <li>
++          {%- if versionswitcher is defined %}
++          <span class="version_switcher_placeholder">{{ release }}</span>
++          <a href="{{ pathto('index') }}">Documentation</a>{{ reldelim1 }}
++          {%- else %}
++          <a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}
++          {%- endif %}
++        </li>
+ {% endblock %}
+ {% block extrahead %}
+     <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/py.png', 1) }}" />
+     {% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %}
++    {% if versionswitcher is defined and not embedded %}<script type="text/javascript" src="{{ pathto('_static/version_switch.js', 1) }}"></script>{% endif %}
++    {% if pagename == 'whatsnew/changelog' %}
++    <script type="text/javascript">
++      $(document).ready(function() {
++          // add the search form and bind the events
++          $('h1').after([
++            '<p>Filter entries by content:',
++            '<input type="text" value="" id="searchbox" style="width: 50%">',
++            '<input type="submit" id="searchbox-submit" value="Filter"></p>'
++          ].join('\n'));
++
++          function dofilter() {
++              try {
++                  var query = new RegExp($('#searchbox').val(), 'i');
++              }
++              catch (e) {
++                  return; // not a valid regex (yet)
++              }
++              // find headers for the versions (What's new in Python X.Y.Z?)
++              $('#changelog h2').each(function(index1, h2) {
++                  var h2_parent = $(h2).parent();
++                  var sections_found = 0;
++                  // find headers for the sections (Core, Library, etc.)
++                  h2_parent.find('h3').each(function(index2, h3) {
++                      var h3_parent = $(h3).parent();
++                      var entries_found = 0;
++                      // find all the entries
++                      h3_parent.find('li').each(function(index3, li) {
++                          var li = $(li);
++                          // check if the query matches the entry
++                          if (query.test(li.text())) {
++                              li.show();
++                              entries_found++;
++                          }
++                          else {
++                              li.hide();
++                          }
++                      });
++                      // if there are entries, show the section, otherwise hide it
++                      if (entries_found > 0) {
++                          h3_parent.show();
++                          sections_found++;
++                      }
++                      else {
++                          h3_parent.hide();
++                      }
++                  });
++                  if (sections_found > 0)
++                      h2_parent.show();
++                  else
++                      h2_parent.hide();
++              });
++          }
++          $('#searchbox').keyup(dofilter);
++          $('#searchbox-submit').click(dofilter);
++      });
++    </script>
++    {% endif %}
+ {{ super() }}
+ {% endblock %}
+ {% block footer %}
+     <div class="footer">
+     &copy; <a href="{{ pathto('copyright') }}">Copyright</a> {{ copyright|e }}.
+     <br />
+-    The Python Software Foundation is a non-profit corporation.  
++    The Python Software Foundation is a non-profit corporation.
+     <a href="http://www.python.org/psf/donations/">Please donate.</a>
+     <br />
+     Last updated on {{ last_updated|e }}.
+diff -r bd8afb90ebf2 Doc/tools/sphinxext/pyspecific.py
+--- a/Doc/tools/sphinxext/pyspecific.py
++++ b/Doc/tools/sphinxext/pyspecific.py
+@@ -33,9 +33,38 @@
+     self.body.append('<span class="versionmodified">%s</span> ' % text)
+ 
+ from sphinx.writers.html import HTMLTranslator
++from sphinx.writers.latex import LaTeXTranslator
+ from sphinx.locale import versionlabels
+ HTMLTranslator.visit_versionmodified = new_visit_versionmodified
++HTMLTranslator.visit_versionmodified = new_visit_versionmodified
+ 
++# monkey-patch HTML and LaTeX translators to keep doctest blocks in the
++# doctest docs themselves
++orig_visit_literal_block = HTMLTranslator.visit_literal_block
++def new_visit_literal_block(self, node):
++    meta = self.builder.env.metadata[self.builder.current_docname]
++    old_trim_doctest_flags = self.highlighter.trim_doctest_flags
++    if 'keepdoctest' in meta:
++        self.highlighter.trim_doctest_flags = False
++    try:
++        orig_visit_literal_block(self, node)
++    finally:
++        self.highlighter.trim_doctest_flags = old_trim_doctest_flags
++
++HTMLTranslator.visit_literal_block = new_visit_literal_block
++
++orig_depart_literal_block = LaTeXTranslator.depart_literal_block
++def new_depart_literal_block(self, node):
++    meta = self.builder.env.metadata[self.curfilestack[-1]]
++    old_trim_doctest_flags = self.highlighter.trim_doctest_flags
++    if 'keepdoctest' in meta:
++        self.highlighter.trim_doctest_flags = False
++    try:
++        orig_depart_literal_block(self, node)
++    finally:
++        self.highlighter.trim_doctest_flags = old_trim_doctest_flags
++
++LaTeXTranslator.depart_literal_block = new_depart_literal_block
+ 
+ # Support for marking up and linking to bugs.python.org issues
+ 
+@@ -145,6 +174,47 @@
+         return ret
+ 
+ 
++# Support for including Misc/NEWS
++
++import re
++import codecs
++
++issue_re = re.compile('([Ii])ssue #([0-9]+)')
++whatsnew_re = re.compile(r"(?im)^what's new in (.*?)\??$")
++
++class MiscNews(Directive):
++    has_content = False
++    required_arguments = 1
++    optional_arguments = 0
++    final_argument_whitespace = False
++    option_spec = {}
++
++    def run(self):
++        fname = self.arguments[0]
++        source = self.state_machine.input_lines.source(
++            self.lineno - self.state_machine.input_offset - 1)
++        source_dir = path.dirname(path.abspath(source))
++        fpath = path.join(source_dir, fname)
++        self.state.document.settings.record_dependencies.add(fpath)
++        try:
++            fp = codecs.open(fpath, encoding='utf-8')
++            try:
++                content = fp.read()
++            finally:
++                fp.close()
++        except Exception:
++            text = 'The NEWS file is not available.'
++            node = nodes.strong(text, text)
++            return [node]
++        content = issue_re.sub(r'`\1ssue #\2 <http://bugs.python.org/\2>`__',
++                               content)
++        content = whatsnew_re.sub(r'\1', content)
++        # remove first 3 lines as they are the main heading
++        lines = ['.. default-role:: obj', ''] + content.splitlines()[3:]
++        self.state_machine.insert_input(lines, fname)
++        return []
++
++
+ # Support for building "topic help" for pydoc
+ 
+ pydoc_topic_labels = [
+@@ -276,3 +346,4 @@
+     app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)')
+     app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction)
+     app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod)
++    app.add_directive('miscnews', MiscNews)
+diff -r bd8afb90ebf2 Doc/tools/sphinxext/static/basic.css
+--- a/Doc/tools/sphinxext/static/basic.css
++++ b/Doc/tools/sphinxext/static/basic.css
+@@ -39,6 +39,7 @@
+ 
+ div.sphinxsidebarwrapper {
+     padding: 10px 5px 0 10px;
++    word-wrap: break-word;
+ }
+ 
+ div.sphinxsidebar {
+diff -r bd8afb90ebf2 Doc/tools/sphinxext/static/version_switch.js
+--- /dev/null
++++ b/Doc/tools/sphinxext/static/version_switch.js
+@@ -0,0 +1,66 @@
++(function() {
++  'use strict';
++
++  var all_versions = {
++    '3.4': 'dev (3.4)',
++    '3.3': '3.3',
++    '3.2': '3.2',
++    '2.7': '2.7',
++    '2.6': '2.6'
++  };
++
++  function build_select(current_version, current_release) {
++    var buf = ['<select>'];
++
++    $.each(all_versions, function(version, title) {
++      buf.push('<option value="' + version + '"');
++      if (version == current_version)
++        buf.push(' selected="selected">' + current_release + '</option>');
++      else
++        buf.push('>' + title + '</option>');
++    });
++
++    buf.push('</select>');
++    return buf.join('');
++  }
++
++  function patch_url(url, new_version) {
++    var url_re = /\.org\/(\d|py3k|dev|((release\/)?\d\.\d[\w\d\.]*))\//,
++        new_url = url.replace(url_re, '.org/' + new_version + '/');
++
++    if (new_url == url && !new_url.match(url_re)) {
++      // python 2 url without version?
++      new_url = url.replace(/\.org\//, '.org/' + new_version + '/');
++    }
++    return new_url;
++  }
++
++  function on_switch() {
++    var selected = $(this).children('option:selected').attr('value');
++
++    var url = window.location.href,
++        new_url = patch_url(url, selected);
++
++    if (new_url != url) {
++      // check beforehand if url exists, else redirect to version's start page
++      $.ajax({
++        url: new_url,
++        success: function() {
++           window.location.href = new_url;
++        },
++        error: function() {
++           window.location.href = 'http://docs.python.org/' + selected;
++        }
++      });
++    }
++  }
++
++  $(document).ready(function() {
++    var release = DOCUMENTATION_OPTIONS.VERSION;
++    var version = release.substr(0, 3);
++    var select = build_select(version, release);
++
++    $('.version_switcher_placeholder').html(select);
++    $('.version_switcher_placeholder select').bind('change', on_switch);
++  });
++})();
+diff -r bd8afb90ebf2 Doc/tools/sphinxext/susp-ignored.csv
+--- a/Doc/tools/sphinxext/susp-ignored.csv
++++ b/Doc/tools/sphinxext/susp-ignored.csv
+@@ -124,9 +124,8 @@
+ library/functions,,:stop,"a[start:stop, i]"
+ library/functions,,:stop,a[start:stop:step]
+ library/hotshot,,:lineno,"ncalls  tottime  percall  cumtime  percall filename:lineno(function)"
+-library/http.client,52,:port,host:port
++library/http.client,,:port,host:port
+ library/http.cookies,,`,!#$%&'*+-.^_`|~:
+-library/httplib,,:port,host:port
+ library/imaplib,,:MM,"""DD-Mmm-YYYY HH:MM:SS"
+ library/imaplib,,:SS,"""DD-Mmm-YYYY HH:MM:SS"
+ library/inspect,,:int,">>> def foo(a, *, b:int, **kwargs):"
+@@ -358,3 +357,15 @@
+ whatsnew/3.2,,:location,zope9-location = ${zope9:location}
+ whatsnew/3.2,,:prefix,... zope-conf = ${custom:prefix}/etc/zope.conf
+ whatsnew/3.2,,:prefix,zope-conf = ${custom:prefix}/etc/zope.conf
++whatsnew/news,,:platform,:platform:
++whatsnew/news,,:password,: Unquote before b64encoding user:password during Basic
++whatsnew/news,,:close,Connection:close header.
++whatsnew/news,,:PythonCmd,"With Tk < 8.5 _tkinter.c:PythonCmd() raised UnicodeDecodeError, caused"
++whatsnew/news,,:close,: Connection:close header is sent by requests using URLOpener
++whatsnew/news,,::,": Fix FTP tests for IPv6, bind to ""::1"" instead of ""localhost""."
++whatsnew/news,,:test,: test_subprocess:test_leaking_fds_on_error no longer gives a
++whatsnew/news,,:test,: Fix test_posix:test_getgroups failure under Solaris.  Patch
++whatsnew/news,,:Olimit,Drop -OPT:Olimit compiler option.
++whatsnew/news,,:MAXYEAR,timedelta from date or datetime falls outside of the MINYEAR:MAXYEAR range.
++whatsnew/news,,:bz2,with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or
++whatsnew/news,,:db2,: Add configure option --with-dbmliborder=db1:db2:... to specify
+diff -r bd8afb90ebf2 Doc/tutorial/classes.rst
+--- a/Doc/tutorial/classes.rst
++++ b/Doc/tutorial/classes.rst
+@@ -737,11 +737,11 @@
+ This style of access is clear, concise, and convenient.  The use of iterators
+ pervades and unifies Python.  Behind the scenes, the :keyword:`for` statement
+ calls :func:`iter` on the container object.  The function returns an iterator
+-object that defines the method :meth:`__next__` which accesses elements in the
+-container one at a time.  When there are no more elements, :meth:`__next__`
+-raises a :exc:`StopIteration` exception which tells the :keyword:`for` loop to
+-terminate.  You can call the :meth:`__next__` method using the :func:`next`
+-built-in function; this example shows how it all works::
++object that defines the method :meth:`~iterator.__next__` which accesses
++elements in the container one at a time.  When there are no more elements,
++:meth:`__next__` raises a :exc:`StopIteration` exception which tells the
++:keyword:`for` loop to terminate.  You can call the :meth:`__next__` method
++using the :func:`next` built-in function; this example shows how it all works::
+ 
+    >>> s = 'abc'
+    >>> it = iter(s)
+@@ -761,8 +761,8 @@
+ 
+ Having seen the mechanics behind the iterator protocol, it is easy to add
+ iterator behavior to your classes.  Define an :meth:`__iter__` method which
+-returns an object with a :meth:`__next__` method.  If the class defines
+-:meth:`__next__`, then :meth:`__iter__` can just return ``self``::
++returns an object with a :meth:`~iterator.__next__` method.  If the class
++defines :meth:`__next__`, then :meth:`__iter__` can just return ``self``::
+ 
+    class Reverse:
+        """Iterator for looping over a sequence backwards."""
+@@ -819,8 +819,8 @@
+ 
+ Anything that can be done with generators can also be done with class based
+ iterators as described in the previous section.  What makes generators so
+-compact is that the :meth:`__iter__` and :meth:`__next__` methods are created
+-automatically.
++compact is that the :meth:`__iter__` and :meth:`~generator.__next__` methods
++are created automatically.
+ 
+ Another key feature is that the local variables and execution state are
+ automatically saved between calls.  This made the function easier to write and
+diff -r bd8afb90ebf2 Doc/tutorial/controlflow.rst
+--- a/Doc/tutorial/controlflow.rst
++++ b/Doc/tutorial/controlflow.rst
+@@ -58,24 +58,24 @@
+ ::
+ 
+    >>> # Measure some strings:
+-   ... a = ['cat', 'window', 'defenestrate']
+-   >>> for x in a:
+-   ...     print(x, len(x))
++   ... words = ['cat', 'window', 'defenestrate']
++   >>> for w in words:
++   ...     print(w, len(w))
+    ...
+    cat 3
+    window 6
+    defenestrate 12
+ 
+-It is not safe to modify the sequence being iterated over in the loop (this can
+-only happen for mutable sequence types, such as lists).  If you need to modify
+-the list you are iterating over (for example, to duplicate selected items) you
+-must iterate over a copy.  The slice notation makes this particularly
+-convenient::
++If you need to modify the sequence you are iterating over while inside the loop
++(for example to duplicate selected items), it is recommended that you first
++make a copy.  Iterating over a sequence does not implicitly make a copy.  The
++slice notation makes this especially convenient::
+ 
+-   >>> for x in a[:]: # make a slice copy of the entire list
+-   ...    if len(x) > 6: a.insert(0, x)
++   >>> for w in words[:]:  # Loop over a slice copy of the entire list.
++   ...     if len(w) > 6:
++   ...         words.insert(0, w)
+    ...
+-   >>> a
++   >>> words
+    ['defenestrate', 'cat', 'window', 'defenestrate']
+ 
+ 
+@@ -656,6 +656,40 @@
+        No, really, it doesn't do anything.
+ 
+ 
++.. _tut-annotations:
++
++Function Annotations
++--------------------
++
++.. sectionauthor:: Zachary Ware <zachary.ware@gmail.com>
++.. index::
++   pair: function; annotations
++   single: -> (return annotation assignment)
++
++:ref:`Function annotations <function>` are completely optional,
++arbitrary metadata information about user-defined functions.  Neither Python
++itself nor the standard library use function annotations in any way; this
++section just shows the syntax. Third-party projects are free to use function
++annotations for documentation, type checking, and other uses.
++
++Annotations are stored in the :attr:`__annotations__` attribute of the function
++as a dictionary and have no effect on any other part of the function.  Parameter
++annotations are defined by a colon after the parameter name, followed by an
++expression evaluating to the value of the annotation.  Return annotations are
++defined by a literal ``->``, followed by an expression, between the parameter
++list and the colon denoting the end of the :keyword:`def` statement.  The
++following example has a positional argument, a keyword argument, and the return
++value annotated with nonsense::
++
++   >>> def f(ham: 42, eggs: int = 'spam') -> "Nothing to see here":
++   ...     print("Annotations:", f.__annotations__)
++   ...     print("Arguments:", ham, eggs)
++   ...
++   >>> f('wonderful')
++   Annotations: {'eggs': <class 'int'>, 'return': 'Nothing to see here', 'ham': 42}
++   Arguments: wonderful spam
++
++
+ .. _tut-codingstyle:
+ 
+ Intermezzo: Coding Style
+diff -r bd8afb90ebf2 Doc/tutorial/datastructures.rst
+--- a/Doc/tutorial/datastructures.rst
++++ b/Doc/tutorial/datastructures.rst
+@@ -186,7 +186,7 @@
+ 
+    squares = [x**2 for x in range(10)]
+ 
+-This is also equivalent to ``squares = map(lambda x: x**2, range(10))``,
++This is also equivalent to ``squares = list(map(lambda x: x**2, range(10)))``,
+ but it's more concise and readable.
+ 
+ A list comprehension consists of brackets containing an expression followed
+@@ -418,7 +418,7 @@
+ eliminating duplicate entries.  Set objects also support mathematical operations
+ like union, intersection, difference, and symmetric difference.
+ 
+-Curly braces or the :func:`set` function can be used to create sets.  Note: To
++Curly braces or the :func:`set` function can be used to create sets.  Note: to
+ create an empty set you have to use ``set()``, not ``{}``; the latter creates an
+ empty dictionary, a data structure that we discuss in the next section.
+ 
+@@ -447,14 +447,14 @@
+    >>> a ^ b                              # letters in a or b but not both
+    {'r', 'd', 'b', 'm', 'z', 'l'}
+ 
+-Like :ref:`for lists <tut-listcomps>`, there is a set comprehension syntax::
++Similarly to :ref:`list comprehensions <tut-listcomps>`, set comprehensions
++are also supported::
+ 
+    >>> a = {x for x in 'abracadabra' if x not in 'abc'}
+    >>> a
+    {'r', 'd'}
+ 
+ 
+-
+ .. _tut-dictionaries:
+ 
+ Dictionaries
+@@ -589,6 +589,19 @@
+    orange
+    pear
+ 
++To change a sequence you are iterating over while inside the loop (for
++example to duplicate certain items), it is recommended that you first make
++a copy.  Looping over a sequence does not implicitly make a copy.  The slice
++notation makes this especially convenient::
++
++   >>> words = ['cat', 'window', 'defenestrate']
++   >>> for w in words[:]:  # Loop over a slice copy of the entire list.
++   ...     if len(w) > 6:
++   ...         words.insert(0, w)
++   ...
++   >>> words
++   ['defenestrate', 'cat', 'window', 'defenestrate']
++
+ 
+ .. _tut-conditions:
+ 
+diff -r bd8afb90ebf2 Doc/tutorial/errors.rst
+--- a/Doc/tutorial/errors.rst
++++ b/Doc/tutorial/errors.rst
+@@ -387,7 +387,7 @@
+ and print its contents to the screen. ::
+ 
+    for line in open("myfile.txt"):
+-       print(line)
++       print(line, end="")
+ 
+ The problem with this code is that it leaves the file open for an indeterminate
+ amount of time after this part of the code has finished executing.
+@@ -397,7 +397,7 @@
+ 
+    with open("myfile.txt") as f:
+        for line in f:
+-           print(line)
++           print(line, end="")
+ 
+ After the statement is executed, the file *f* is always closed, even if a
+ problem was encountered while processing the lines. Objects which, like files,
+diff -r bd8afb90ebf2 Doc/tutorial/index.rst
+--- a/Doc/tutorial/index.rst
++++ b/Doc/tutorial/index.rst
+@@ -4,9 +4,6 @@
+   The Python Tutorial
+ ######################
+ 
+-:Release: |version|
+-:Date: |today|
+-
+ Python is an easy to learn, powerful programming language. It has efficient
+ high-level data structures and a simple but effective approach to
+ object-oriented programming. Python's elegant syntax and dynamic typing,
+diff -r bd8afb90ebf2 Doc/tutorial/inputoutput.rst
+--- a/Doc/tutorial/inputoutput.rst
++++ b/Doc/tutorial/inputoutput.rst
+@@ -184,7 +184,7 @@
+ 
+    >>> table = {'Sjoerd': 4127, 'Jack': 4098, 'Dcab': 8637678}
+    >>> print('Jack: {0[Jack]:d}; Sjoerd: {0[Sjoerd]:d}; '
+-             'Dcab: {0[Dcab]:d}'.format(table))
++   ...       'Dcab: {0[Dcab]:d}'.format(table))
+    Jack: 4098; Sjoerd: 4127; Dcab: 8637678
+ 
+ This could also be done by passing the table as keyword arguments with the '**'
+@@ -256,9 +256,10 @@
+ :dfn:`binary mode`: now the data is read and written in the form of bytes
+ objects.  This mode should be used for all files that don't contain text.
+ 
+-In text mode, the default is to convert platform-specific line endings (``\n``
+-on Unix, ``\r\n`` on Windows) to just ``\n`` on reading and ``\n`` back to
+-platform-specific line endings on writing.  This behind-the-scenes modification
++In text mode, the default when reading is to convert platform-specific line
++endings (``\n`` on Unix, ``\r\n`` on Windows) to just ``\n``.  When writing in
++text mode, the default is to convert occurrences of ``\n`` back to
++platform-specific line endings.  This behind-the-scenes modification
+ to file data is fine for text files, but will corrupt binary data like that in
+ :file:`JPEG` or :file:`EXE` files.  Be very careful to use binary mode when
+ reading and writing such files.
+diff -r bd8afb90ebf2 Doc/tutorial/interpreter.rst
+--- a/Doc/tutorial/interpreter.rst
++++ b/Doc/tutorial/interpreter.rst
+@@ -12,7 +12,9 @@
+ 
+ The Python interpreter is usually installed as :file:`/usr/local/bin/python3.3`
+ on those machines where it is available; putting :file:`/usr/local/bin` in your
+-Unix shell's search path makes it possible to start it by typing the command ::
++Unix shell's search path makes it possible to start it by typing the command:
++
++.. code-block:: text
+ 
+    python3.3
+ 
+@@ -94,8 +96,8 @@
+ before printing the first prompt::
+ 
+    $ python3.3
+-   Python 3.3 (py3k, Sep 12 2007, 12:21:02)
+-   [GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2
++   Python 3.3 (default, Sep 24 2012, 09:25:04)
++   [GCC 4.6.3] on linux2
+    Type "help", "copyright", "credits" or "license" for more information.
+    >>>
+ 
+diff -r bd8afb90ebf2 Doc/tutorial/introduction.rst
+--- a/Doc/tutorial/introduction.rst
++++ b/Doc/tutorial/introduction.rst
+@@ -94,8 +94,7 @@
+ Variables must be "defined" (assigned a value) before they can be used, or an
+ error will occur::
+ 
+-   >>> # try to access an undefined variable
+-   ... n
++   >>> n  # try to access an undefined variable
+    Traceback (most recent call last):
+      File "<stdin>", line 1, in <module>
+    NameError: name 'n' is not defined
+@@ -391,7 +390,7 @@
+ 
+ .. seealso::
+ 
+-   :ref:`typesseq`
++   :ref:`textseq`
+       Strings are examples of *sequence types*, and support the common
+       operations supported by such types.
+ 
+@@ -601,19 +600,19 @@
+   guess when you have typed the last line).  Note that each line within a basic
+   block must be indented by the same amount.
+ 
+-* The :func:`print` function writes the value of the expression(s) it is
+-  given.  It differs from just writing the expression you want to write (as we did
+-  earlier in the calculator examples) in the way it handles multiple
+-  expressions, floating point quantities,
+-  and strings.  Strings are printed without quotes, and a space is inserted
+-  between items, so you can format things nicely, like this::
++* The :func:`print` function writes the value of the argument(s) it is given.
++  It differs from just writing the expression you want to write (as we did
++  earlier in the calculator examples) in the way it handles multiple arguments,
++  floating point quantities, and strings.  Strings are printed without quotes,
++  and a space is inserted between items, so you can format things nicely, like
++  this::
+ 
+      >>> i = 256*256
+      >>> print('The value of i is', i)
+      The value of i is 65536
+ 
+-  The keyword *end* can be used to avoid the newline after the output, or end
+-  the output with a different string::
++  The keyword argument *end* can be used to avoid the newline after the output,
++  or end the output with a different string::
+ 
+      >>> a, b = 0, 1
+      >>> while b < 1000:
+diff -r bd8afb90ebf2 Doc/tutorial/modules.rst
+--- a/Doc/tutorial/modules.rst
++++ b/Doc/tutorial/modules.rst
+@@ -288,17 +288,25 @@
+    >>> import fibo, sys
+    >>> dir(fibo)
+    ['__name__', 'fib', 'fib2']
+-   >>> dir(sys)
+-   ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__stderr__',
+-    '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv',
+-    'builtin_module_names', 'byteorder', 'callstats', 'copyright',
+-    'displayhook', 'exc_info', 'excepthook',
+-    'exec_prefix', 'executable', 'exit', 'getdefaultencoding', 'getdlopenflags',
+-    'getrecursionlimit', 'getrefcount', 'hexversion', 'maxint', 'maxunicode',
++   >>> dir(sys)  # doctest: +NORMALIZE_WHITESPACE
++   ['__displayhook__', '__doc__', '__egginsert', '__excepthook__',
++    '__loader__', '__name__', '__package__', '__plen', '__stderr__',
++    '__stdin__', '__stdout__', '_clear_type_cache', '_current_frames',
++    '_debugmallocstats', '_getframe', '_home', '_mercurial', '_xoptions',
++    'abiflags', 'api_version', 'argv', 'base_exec_prefix', 'base_prefix',
++    'builtin_module_names', 'byteorder', 'call_tracing', 'callstats',
++    'copyright', 'displayhook', 'dont_write_bytecode', 'exc_info',
++    'excepthook', 'exec_prefix', 'executable', 'exit', 'flags', 'float_info',
++    'float_repr_style', 'getcheckinterval', 'getdefaultencoding',
++    'getdlopenflags', 'getfilesystemencoding', 'getobjects', 'getprofile',
++    'getrecursionlimit', 'getrefcount', 'getsizeof', 'getswitchinterval',
++    'gettotalrefcount', 'gettrace', 'hash_info', 'hexversion',
++    'implementation', 'int_info', 'intern', 'maxsize', 'maxunicode',
+     'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache',
+-    'platform', 'prefix', 'ps1', 'ps2', 'setcheckinterval', 'setdlopenflags',
+-    'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout',
+-    'version', 'version_info', 'warnoptions']
++    'platform', 'prefix', 'ps1', 'setcheckinterval', 'setdlopenflags',
++    'setprofile', 'setrecursionlimit', 'setswitchinterval', 'settrace',
++    'stderr', 'stdin', 'stdout', 'thread_info', 'version', 'version_info',
++    'warnoptions']
+ 
+ Without arguments, :func:`dir` lists the names you have defined currently::
+ 
+@@ -306,7 +314,7 @@
+    >>> import fibo
+    >>> fib = fibo.fib
+    >>> dir()
+-   ['__builtins__', '__doc__', '__file__', '__name__', 'a', 'fib', 'fibo', 'sys']
++   ['__builtins__', '__name__', 'a', 'fib', 'fibo', 'sys']
+ 
+ Note that it lists all types of names: variables, modules, functions, etc.
+ 
+@@ -317,28 +325,36 @@
+ :mod:`builtins`::
+ 
+    >>> import builtins
+-   >>> dir(builtins)
+-
+-   ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'Buffer
+-   Error', 'BytesWarning', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'Environme
+-   ntError', 'Exception', 'False', 'FloatingPointError', 'FutureWarning', 'Generato
+-   rExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexErr
+-   or', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError',
+-    'None', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'P
+-   endingDeprecationWarning', 'ReferenceError', 'RuntimeError', 'RuntimeWarning', '
+-   StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'Ta
+-   bError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'Unicod
+-   eEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserW
+-   arning', 'ValueError', 'Warning', 'ZeroDivisionError', '__build_class__', '__deb
+-   ug__', '__doc__', '__import__', '__name__', '__package__', 'abs', 'all', 'any',
+-   'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'chr', 'classmethod', 'compile', '
+-   complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate
+-   ', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr',
+-   'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance',
+-    'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memory
+-   view', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property'
+-   , 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sort
+-   ed', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip']
++   >>> dir(builtins)  # doctest: +NORMALIZE_WHITESPACE
++   ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException',
++    'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning',
++    'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError',
++    'ConnectionRefusedError', 'ConnectionResetError', 'DeprecationWarning',
++    'EOFError', 'Ellipsis', 'EnvironmentError', 'Exception', 'False',
++    'FileExistsError', 'FileNotFoundError', 'FloatingPointError',
++    'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError',
++    'ImportWarning', 'IndentationError', 'IndexError', 'InterruptedError',
++    'IsADirectoryError', 'KeyError', 'KeyboardInterrupt', 'LookupError',
++    'MemoryError', 'NameError', 'None', 'NotADirectoryError', 'NotImplemented',
++    'NotImplementedError', 'OSError', 'OverflowError',
++    'PendingDeprecationWarning', 'PermissionError', 'ProcessLookupError',
++    'ReferenceError', 'ResourceWarning', 'RuntimeError', 'RuntimeWarning',
++    'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError',
++    'SystemExit', 'TabError', 'TimeoutError', 'True', 'TypeError',
++    'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError',
++    'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning',
++    'ValueError', 'Warning', 'ZeroDivisionError', '_', '__build_class__',
++    '__debug__', '__doc__', '__import__', '__name__', '__package__', 'abs',
++    'all', 'any', 'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'callable',
++    'chr', 'classmethod', 'compile', 'complex', 'copyright', 'credits',
++    'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'exit',
++    'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr',
++    'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass',
++    'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memoryview',
++    'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property',
++    'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
++    'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars',
++    'zip']
+ 
+ .. _tut-packages:
+ 
+diff -r bd8afb90ebf2 Doc/tutorial/stdlib.rst
+--- a/Doc/tutorial/stdlib.rst
++++ b/Doc/tutorial/stdlib.rst
+@@ -148,7 +148,7 @@
+ 
+ There are a number of modules for accessing the internet and processing internet
+ protocols. Two of the simplest are :mod:`urllib.request` for retrieving data
+-from urls and :mod:`smtplib` for sending mail::
++from URLs and :mod:`smtplib` for sending mail::
+ 
+    >>> from urllib.request import urlopen
+    >>> for line in urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl'):
+@@ -203,7 +203,7 @@
+ ================
+ 
+ Common data archiving and compression formats are directly supported by modules
+-including: :mod:`zlib`, :mod:`gzip`, :mod:`bz2`, :mod:`zipfile` and
++including: :mod:`zlib`, :mod:`gzip`, :mod:`bz2`, :mod:`lzma`, :mod:`zipfile` and
+ :mod:`tarfile`. ::
+ 
+    >>> import zlib
+diff -r bd8afb90ebf2 Doc/tutorial/stdlib2.rst
+--- a/Doc/tutorial/stdlib2.rst
++++ b/Doc/tutorial/stdlib2.rst
+@@ -95,7 +95,7 @@
+    >>> d = dict(item='unladen swallow')
+    >>> t.substitute(d)
+    Traceback (most recent call last):
+-     . . .
++     ...
+    KeyError: 'owner'
+    >>> t.safe_substitute(d)
+    'Return the unladen swallow to $owner.'
+@@ -220,7 +220,9 @@
+    logging.error('Error occurred')
+    logging.critical('Critical error -- shutting down')
+ 
+-This produces the following output::
++This produces the following output:
++
++.. code-block:: none
+ 
+    WARNING:root:Warning:config file server.conf not found
+    ERROR:root:Error occurred
+@@ -257,9 +259,9 @@
+    >>> import weakref, gc
+    >>> class A:
+    ...     def __init__(self, value):
+-   ...             self.value = value
++   ...         self.value = value
+    ...     def __repr__(self):
+-   ...             return str(self.value)
++   ...         return str(self.value)
+    ...
+    >>> a = A(10)                   # create a reference
+    >>> d = weakref.WeakValueDictionary()
+@@ -311,6 +313,8 @@
+    >>> print("Handling", d.popleft())
+    Handling task1
+ 
++::
++
+    unsearched = deque([starting_node])
+    def breadth_first_search(unsearched):
+        node = unsearched.popleft()
+diff -r bd8afb90ebf2 Doc/tutorial/whatnow.rst
+--- a/Doc/tutorial/whatnow.rst
++++ b/Doc/tutorial/whatnow.rst
+@@ -59,15 +59,12 @@
+ messages posted to one will automatically be forwarded to the other.  There are
+ around 120 postings a day (with peaks up to several hundred), asking (and
+ answering) questions, suggesting new features, and announcing new modules.
+-Before posting, be sure to check the list of `Frequently Asked Questions
+-<http://www.python.org/doc/faq/>`_ (also called the FAQ), or look for it in the
+-:file:`Misc/` directory of the Python source distribution.  Mailing list
+-archives are available at http://mail.python.org/pipermail/. The FAQ answers
+-many of the questions that come up again and again, and may already contain the
+-solution for your problem.
++Before posting, be sure to check the list of :ref:`Frequently Asked Questions
++<faq-index>` (also called the FAQ).
++Mailing list archives are available at http://mail.python.org/pipermail/.
++The FAQ answers many of the questions that come up again and again,
++and may already contain the solution for your problem.
+ 
+ .. Postings figure based on average of last six months activity as
+    reported by www.egroups.com; Jan. 2000 - June 2000: 21272 msgs / 182
+    days = 116.9 msgs / day and steadily increasing. (XXX up to date figures?)
+-
+-
+diff -r bd8afb90ebf2 Doc/using/cmdline.rst
+--- a/Doc/using/cmdline.rst
++++ b/Doc/using/cmdline.rst
+@@ -358,7 +358,8 @@
+ .. cmdoption:: -X
+ 
+    Reserved for various implementation-specific options.  CPython currently
+-   defines none of them, but allows to pass arbitrary values and retrieve
++   defines just one, you can use ``-X faulthander`` to enable
++   :data:`faulthandler`. It also allows to pass arbitrary values and retrieve
+    them through the :data:`sys._xoptions` dictionary.
+ 
+    .. versionchanged:: 3.2
+@@ -380,7 +381,10 @@
+ Environment variables
+ ---------------------
+ 
+-These environment variables influence Python's behavior.
++These environment variables influence Python's behavior, they are processed
++before the command-line switches other than -E.  It is customary that
++command-line switches override environmental variables where there is a
++conflict.
+ 
+ .. envvar:: PYTHONHOME
+ 
+@@ -577,4 +581,3 @@
+ 
+    If set, Python will print memory allocation statistics every time a new
+    object arena is created, and on shutdown.
+-
+diff -r bd8afb90ebf2 Doc/using/mac.rst
+--- a/Doc/using/mac.rst
++++ b/Doc/using/mac.rst
+@@ -169,20 +169,6 @@
+ at http://undefined.org/python/#py2app.
+ 
+ 
+-Application Scripting
+-=====================
+-
+-Python can also be used to script other Mac applications via Apple's Open
+-Scripting Architecture (OSA); see http://appscript.sourceforge.net. Appscript is
+-a high-level, user-friendly Apple event bridge that allows you to control
+-scriptable Mac OS X applications using ordinary Python scripts. Appscript makes
+-Python a serious alternative to Apple's own *AppleScript* language for
+-automating your Mac. A related package, *PyOSA*, is an OSA language component
+-for the Python scripting language, allowing Python code to be executed by any
+-OSA-enabled application (Script Editor, Mail, iTunes, etc.). PyOSA makes Python
+-a full peer to AppleScript.
+-
+-
+ Other Resources
+ ===============
+ 
+diff -r bd8afb90ebf2 Doc/using/windows.rst
+--- a/Doc/using/windows.rst
++++ b/Doc/using/windows.rst
+@@ -132,6 +132,8 @@
+       Setting Environment variables, Louis J. Farrugia
+ 
+ 
++.. _windows-path-mod:
++
+ Finding the Python executable
+ -----------------------------
+ 
+@@ -454,7 +456,7 @@
+ In addition to environment variables, the same settings can be configured
+ in the .INI file used by the launcher.  The section in the INI file is
+ called ``[defaults]`` and the key name will be the same as the
+-environment variables without the leading ``PY\_`` prefix (and note that
++environment variables without the leading ``PY_`` prefix (and note that
+ the key names in the INI file are case insensitive.)  The contents of
+ an environment variable will override things specified in the INI file.
+ 
+diff -r bd8afb90ebf2 Doc/whatsnew/2.6.rst
+--- a/Doc/whatsnew/2.6.rst
++++ b/Doc/whatsnew/2.6.rst
+@@ -7,8 +7,6 @@
+ .. XXX add trademark info for Apple, Microsoft, SourceForge.
+ 
+ :Author: A.M. Kuchling (amk at amk.ca)
+-:Release: |release|
+-:Date: |today|
+ 
+ .. $Id$
+    Rules for maintenance:
+diff -r bd8afb90ebf2 Doc/whatsnew/2.7.rst
+--- a/Doc/whatsnew/2.7.rst
++++ b/Doc/whatsnew/2.7.rst
+@@ -3,8 +3,6 @@
+ ****************************
+ 
+ :Author: A.M. Kuchling (amk at amk.ca)
+-:Release: |release|
+-:Date: |today|
+ 
+ ..  hyperlink all the methods & functions.
+ 
+diff -r bd8afb90ebf2 Doc/whatsnew/3.0.rst
+--- a/Doc/whatsnew/3.0.rst
++++ b/Doc/whatsnew/3.0.rst
+@@ -5,8 +5,6 @@
+ .. XXX Add trademark info for Apple, Microsoft.
+ 
+ :Author: Guido van Rossum
+-:Release: |release|
+-:Date: |today|
+ 
+ .. $Id$
+    Rules for maintenance:
+@@ -771,7 +769,7 @@
+   respectively).
+ 
+ * :pep:`3114`: the standard :meth:`next` method has been renamed to
+-  :meth:`__next__`.
++  :meth:`~iterator.__next__`.
+ 
+ * The :meth:`__oct__` and :meth:`__hex__` special methods are removed
+   -- :func:`oct` and :func:`hex` use :meth:`__index__` now to convert
+@@ -807,7 +805,7 @@
+   To get the old behavior of :func:`input`, use ``eval(input())``.
+ 
+ * A new built-in function :func:`next` was added to call the
+-  :meth:`__next__` method on an object.
++  :meth:`~iterator.__next__` method on an object.
+ 
+ * The :func:`round` function rounding strategy and return type have
+   changed.  Exact halfway cases are now rounded to the nearest even
+diff -r bd8afb90ebf2 Doc/whatsnew/3.1.rst
+--- a/Doc/whatsnew/3.1.rst
++++ b/Doc/whatsnew/3.1.rst
+@@ -3,8 +3,6 @@
+ ****************************
+ 
+ :Author: Raymond Hettinger
+-:Release: |release|
+-:Date: |today|
+ 
+ .. $Id$
+    Rules for maintenance:
+diff -r bd8afb90ebf2 Doc/whatsnew/3.2.rst
+--- a/Doc/whatsnew/3.2.rst
++++ b/Doc/whatsnew/3.2.rst
+@@ -3,8 +3,6 @@
+ ****************************
+ 
+ :Author: Raymond Hettinger
+-:Release: |release|
+-:Date: |today|
+ 
+ .. $Id$
+    Rules for maintenance:
+@@ -52,7 +50,7 @@
+ 
+ This article explains the new features in Python 3.2 as compared to 3.1.  It
+ focuses on a few highlights and gives a few examples.  For full details, see the
+-:source:`Misc/NEWS <Misc/NEWS>` file.
++`Misc/NEWS <http://hg.python.org/cpython/file/3.2/Misc/NEWS>`_ file.
+ 
+ .. seealso::
+ 
+diff -r bd8afb90ebf2 Doc/whatsnew/3.3.rst
+--- a/Doc/whatsnew/3.3.rst
++++ b/Doc/whatsnew/3.3.rst
+@@ -2,10 +2,6 @@
+   What's New In Python 3.3
+ ****************************
+ 
+-:Author: Raymond Hettinger
+-:Release: |release|
+-:Date: |today|
+-
+ .. Rules for maintenance:
+ 
+    * Anyone can add text to this document.  Do not spend very much time
+@@ -47,7 +43,12 @@
+    when researching a change.
+ 
+ This article explains the new features in Python 3.3, compared to 3.2.
+-Python 3.3 was released on September 29, 2012.
++Python 3.3 was released on September 29, 2012.  For full details,
++see the `changelog <http://docs.python.org/3.3/whatsnew/changelog.html>`_.
++
++.. seealso::
++
++    :pep:`398` - Python 3.3 Release Schedule
+ 
+ 
+ Summary -- Release highlights
+@@ -66,6 +67,7 @@
+ * :mod:`faulthandler` (helps debugging low-level crashes)
+ * :mod:`ipaddress` (high-level objects representing IP addresses and masks)
+ * :mod:`lzma` (compress data using the XZ / LZMA algorithm)
++* :mod:`unittest.mock` (replace parts of your system under test with mock objects)
+ * :mod:`venv` (Python :ref:`virtual environments <pep-405>`, as in the
+   popular ``virtualenv`` package)
+ 
+@@ -79,6 +81,12 @@
+ * More compact :ref:`unicode strings <pep-393>`.
+ * More compact :ref:`attribute dictionaries <pep-412>`.
+ 
++Significantly Improved Library Modules:
++
++* C Accelerator for the :ref:`decimal <new-decimal>` module.
++* Better unicode handling in the :ref:`email <new-email>` module
++  (:term:`provisional <provisional package>`).
++
+ Security improvements:
+ 
+ * Hash randomization is switched on by default.
+@@ -91,9 +99,6 @@
+ PEP 405: Virtual Environments
+ =============================
+ 
+-:pep:`405` - Python Virtual Environments
+- PEP written by Carl Meyer, implemented by Carl Meyer and Vinay Sajip.
+-
+ Virtual environments help create separate Python setups while sharing a
+ system-wide base install, for ease of maintenance.  Virtual environments
+ have their own set of private site packages (i.e. locally-installed
+@@ -104,27 +109,37 @@
+ 
+ This PEP adds the :mod:`venv` module for programmatic access, and the
+ :ref:`pyvenv <scripts-pyvenv>` script for command-line access and
+-administration.  The Python interpreter becomes aware of a ``pvenv.cfg``
++administration.  The Python interpreter checks for a ``pyvenv.cfg``,
+ file whose existence signals the base of a virtual environment's directory
+ tree.
+ 
+-
+-PEP 420: Namespace Packages
+-===========================
++.. seealso::
++
++    :pep:`405` - Python Virtual Environments
++       PEP written by Carl Meyer; implementation by Carl Meyer and Vinay Sajip
++
++
++PEP 420: Implicit Namespace Packages
++====================================
+ 
+ Native support for package directories that don't require ``__init__.py``
+ marker files and can automatically span multiple path segments (inspired by
+ various third party approaches to namespace packages, as described in
+ :pep:`420`)
+ 
++.. seealso::
++
++   :pep:`420` - Implicit Namespace Packages
++      PEP written by Eric V. Smith; implementation by Eric V. Smith
++      and Barry Warsaw
++
+ 
+ .. _pep-3118-update:
+ 
+ PEP 3118: New memoryview implementation and buffer protocol documentation
+ =========================================================================
+ 
+-:issue:`10181` - memoryview bug fixes and features.
+-  Written by Stefan Krah.
++The implementation of :pep:`3118` has been significantly improved.
+ 
+ The new memoryview implementation comprehensively fixes all ownership and
+ lifetime issues of dynamically allocated fields in the Py_buffer struct
+@@ -181,6 +196,13 @@
+ 
+ * For further changes see `Build and C API Changes`_ and `Porting C code`_ .
+ 
++(Contributed by Stefan Krah in :issue:`10181`)
++
++.. seealso::
++
++   :pep:`3118` - Revising the Buffer Protocol
++
++
+ .. _pep-393:
+ 
+ PEP 393: Flexible String Representation
+@@ -255,15 +277,55 @@
+ bit better than Python 2.7, on a Django benchmark (see the PEP for
+ details).
+ 
++.. seealso::
++
++   :pep:`393` - Flexible String Representation
++      PEP written by Martin von Löwis; implementation by Torsten Becker
++      and Martin von Löwis.
++
++
++.. _pep-397:
++
++PEP 397: Python Launcher for Windows
++====================================
++
++The Python 3.3 Windows installer now includes a ``py`` launcher application
++that can be used to launch Python applications in a version independent
++fashion.
++
++This launcher is invoked implicitly when double-clicking ``*.py`` files.
++If only a single Python version is installed on the system, that version
++will be used to run the file. If multiple versions are installed, the most
++recent version is used by default, but this can be overridden by including
++a Unix-style "shebang line" in the Python script.
++
++The launcher can also be used explicitly from the command line as the ``py``
++application. Running ``py`` follows the same version selection rules as
++implicitly launching scripts, but a more specific version can be selected
++by passing appropriate arguments (such as ``-3`` to request Python 3 when
++Python 2 is also installed, or ``-2.6`` to specifclly request an earlier
++Python version when a more recent version is installed).
++
++In addition to the launcher, the Windows installer now includes an
++option to add the newly installed Python to the system PATH (contributed
++by Brian Curtin in :issue:`3561`).
++
++.. seealso::
++
++   :pep:`397` - Python Launcher for Windows
++      PEP written by Mark Hammond and Martin v. Löwis; implementation by
++      Vinay Sajip.
++
++   Launcher documentation: :ref:`launcher`
++
++   Installer PATH modification: :ref:`windows-path-mod`
++
+ 
+ .. _pep-3151:
+ 
+ PEP 3151: Reworking the OS and IO exception hierarchy
+ =====================================================
+ 
+-:pep:`3151` - Reworking the OS and IO exception hierarchy
+- PEP written and implemented by Antoine Pitrou.
+-
+ The hierarchy of exceptions raised by operating system errors is now both
+ simplified and finer-grained.
+ 
+@@ -325,18 +387,24 @@
+     except PermissionError:
+         print("You are not allowed to read document.txt")
+ 
++.. seealso::
++
++   :pep:`3151` - Reworking the OS and IO Exception Hierarchy
++      PEP written and implemented by Antoine Pitrou
++
++
++.. index::
++   single: yield; yield from (in What's New)
+ 
+ .. _pep-380:
+ 
+ PEP 380: Syntax for Delegating to a Subgenerator
+ ================================================
+ 
+-:pep:`380` - Syntax for Delegating to a Subgenerator
+- PEP written by Greg Ewing.
+-
+-PEP 380 adds the ``yield from`` expression, allowing a generator to delegate
++PEP 380 adds the ``yield from`` expression, allowing a :term:`generator` to
++delegate
+ part of its operations to another generator. This allows a section of code
+-containing 'yield' to be factored out and placed in another generator.
++containing :keyword:`yield` to be factored out and placed in another generator.
+ Additionally, the subgenerator is allowed to return with a value, and the
+ value is made available to the delegating generator.
+ 
+@@ -357,15 +425,15 @@
+ receive sent and thrown values directly from the calling scope, and
+ return a final value to the outer generator::
+ 
+-    >>> def accumulate(start=0):
+-    ...     tally = start
++    >>> def accumulate():
++    ...     tally = 0
+     ...     while 1:
+     ...         next = yield
+     ...         if next is None:
+     ...             return tally
+     ...         tally += next
+     ...
+-    >>> def gather_tallies(tallies, start=0):
++    >>> def gather_tallies(tallies):
+     ...     while 1:
+     ...         tally = yield from accumulate()
+     ...         tallies.append(tally)
+@@ -373,7 +441,7 @@
+     >>> tallies = []
+     >>> acc = gather_tallies(tallies)
+     >>> next(acc) # Ensure the accumulator is ready to accept values
+-    >>> for i in range(10):
++    >>> for i in range(4):
+     ...     acc.send(i)
+     ...
+     >>> acc.send(None) # Finish the first tally
+@@ -382,24 +450,24 @@
+     ...
+     >>> acc.send(None) # Finish the second tally
+     >>> tallies
+-    [45, 10]
++    [6, 10]
+ 
+ The main principle driving this change is to allow even generators that are
+ designed to be used with the ``send`` and ``throw`` methods to be split into
+ multiple subgenerators as easily as a single large function can be split into
+ multiple subfunctions.
+ 
+-(Implementation by Greg Ewing, integrated into 3.3 by Renaud Blanch, Ryan
+-Kelly and Nick Coghlan, documentation by Zbigniew Jędrzejewski-Szmek and
+-Nick Coghlan)
++.. seealso::
++
++   :pep:`380` - Syntax for Delegating to a Subgenerator
++      PEP written by Greg Ewing; implementation by Greg Ewing, integrated into
++      3.3 by Renaud Blanch, Ryan Kelly and Nick Coghlan; documentation by
++      Zbigniew Jędrzejewski-Szmek and Nick Coghlan
+ 
+ 
+ PEP 409: Suppressing exception context
+ ======================================
+ 
+-:pep:`409` - Suppressing exception context
+- PEP written by Ethan Furman, implemented by Ethan Furman and Nick Coghlan.
+-
+ PEP 409 introduces new syntax that allows the display of the chained
+ exception context to be disabled. This allows cleaner error messages in
+ applications that convert between exception types::
+@@ -454,13 +522,16 @@
+     ...
+     KeyError('x',)
+ 
++.. seealso::
++
++   :pep:`409` - Suppressing exception context
++      PEP written by Ethan Furman; implemented by Ethan Furman and Nick
++      Coghlan.
++
+ 
+ PEP 414: Explicit Unicode literals
+ ======================================
+ 
+-:pep:`414` - Explicit Unicode literals
+- PEP written by Armin Ronacher.
+-
+ To ease the transition from Python 2 for Unicode aware Python applications
+ that make heavy use of Unicode literals, Python 3.3 once again supports the
+ "``u``" prefix for string literals. This prefix has no semantic significance
+@@ -469,13 +540,15 @@
+ the more significant semantic changes (such as the stricter default
+ separation of binary and text data).
+ 
++.. seealso::
++
++   :pep:`414` - Explicit Unicode literals
++      PEP written by Armin Ronacher.
++
+ 
+ PEP 3155: Qualified name for classes and functions
+ ==================================================
+ 
+-:pep:`3155` - Qualified name for classes and functions
+- PEP written and implemented by Antoine Pitrou.
+-
+ Functions and class objects have a new ``__qualname__`` attribute representing
+ the "path" from the module top-level to their definition.  For global functions
+ and classes, this is the same as ``__name__``.  For other functions and classes,
+@@ -528,28 +601,31 @@
+    >>> str(C.D.meth)
+    '<function C.D.meth at 0x7f46b9fe31e0>'
+ 
++.. seealso::
++
++   :pep:`3155` - Qualified name for classes and functions
++      PEP written and implemented by Antoine Pitrou.
++
+ 
+ .. _pep-412:
+ 
+ PEP 412: Key-Sharing Dictionary
+ ===============================
+ 
+-:pep:`412` - Key-Sharing Dictionary
+- PEP written and implemented by Mark Shannon.
+-
+ Dictionaries used for the storage of objects' attributes are now able to
+ share part of their internal storage between each other (namely, the part
+ which stores the keys and their respective hashes).  This reduces the memory
+ consumption of programs creating many instances of non-builtin types.
+ 
++.. seealso::
++
++   :pep:`412` - Key-Sharing Dictionary
++      PEP written and implemented by Mark Shannon.
++
+ 
+ PEP 362: Function Signature Object
+ ==================================
+ 
+-:pep:`362`: -  Function Signature Object
+- PEP written by Brett Cannon, Yury Selivanov, Larry Hastings, Jiwon Seo.
+- Implemented by Yury Selivanov.
+-
+ A new function :func:`inspect.signature` makes introspection of python
+ callables easy and straightforward.  A broad range of callables is supported:
+ python functions, decorated or not, classes, and :func:`functools.partial`
+@@ -559,6 +635,49 @@
+ which considerably simplifies writing decorators and any code that validates
+ or amends calling signatures or arguments.
+ 
++.. seealso::
++
++   :pep:`362`: -  Function Signature Object
++      PEP written by Brett Cannon, Yury Selivanov, Larry Hastings, Jiwon Seo;
++      implemented by Yury Selivanov.
++
++
++PEP 421: Adding sys.implementation
++==================================
++
++A new attribute on the :mod:`sys` module exposes details specific to the
++implementation of the currently running interpreter.  The initial set of
++attributes on :attr:`sys.implementation` are ``name``, ``version``,
++``hexversion``, and ``cache_tag``.
++
++The intention of ``sys.implementation`` is to consolidate into one namespace
++the implementation-specific data used by the standard library.  This allows
++different Python implementations to share a single standard library code base
++much more easily.  In its initial state, ``sys.implementation`` holds only a
++small portion of the implementation-specific data.  Over time that ratio will
++shift in order to make the standard library more portable.
++
++One example of improved standard library portability is ``cache_tag``.  As of
++Python 3.3, ``sys.implementation.cache_tag`` is used by :mod:`importlib` to
++support :pep:`3147` compliance.  Any Python implementation that uses
++``importlib`` for its built-in import system may use ``cache_tag`` to control
++the caching behavior for modules.
++
++SimpleNamespace
++---------------
++
++The implementation of ``sys.implementation`` also introduces a new type to
++Python: :class:`types.SimpleNamespace`.  In contrast to a mapping-based
++namespace, like :class:`dict`, ``SimpleNamespace`` is attribute-based, like
++:class:`object`.  However, unlike ``object``, ``SimpleNamespace`` instances
++are writable.  This means that you can add, remove, and modify the namespace
++through normal attribute access.
++
++.. seealso::
++
++   :pep:`421` - Adding sys.implementation
++      PEP written and implemented by Eric Snow.
++
+ 
+ .. _importlib:
+ 
+@@ -569,8 +688,6 @@
+ :issue:`14605` - Make import machinery explicit
+ :issue:`14646` - Require loaders set __loader__ and __package__
+ 
+-(Written by Brett Cannon)
+-
+ The :func:`__import__` function is now powered by :func:`importlib.__import__`.
+ This work leads to the completion of "phase 2" of :pep:`302`. There are
+ multiple benefits to this change. First, it has allowed for more of the
+@@ -580,11 +697,10 @@
+ import semantics. And finally it eases the maintenance of import, allowing for
+ future growth to occur.
+ 
+-For the common user, this change should result in no visible change in
+-semantics. Any possible changes required in one's code to handle this change
+-should read the `Porting Python code`_ section of this document to see what
+-needs to be changed, but it will only affect those that currently manipulate
+-import or try calling it programmatically.
++For the common user, there should be no visible change in semantics.  For
++those whose code currently manipulates import or calls import
++programmatically, the code changes that might possibly be required are covered
++in the `Porting Python code`_ section of this document.
+ 
+ New APIs
+ --------
+@@ -623,8 +739,9 @@
+ 
+ Visible Changes
+ ---------------
+-[For potential required changes to code, see the `Porting Python code`_
+-section]
++
++For potential required changes to code, see the `Porting Python code`_
++section.
+ 
+ Beyond the expanse of what :mod:`importlib` now exposes, there are other
+ visible changes to import. The biggest is that :attr:`sys.meta_path` and
+@@ -652,12 +769,429 @@
+ consideration when updating code for Python 3.3, and thus should be read about
+ in the `Porting Python code`_ section of this document.
+ 
+-
+-New Email Package Features
+-==========================
++(Implementation by Brett Cannon)
++
++
++Other Language Changes
++======================
++
++Some smaller changes made to the core Python language are:
++
++* Added support for Unicode name aliases and named sequences.
++  Both :func:`unicodedata.lookup()` and ``'\N{...}'`` now resolve name aliases,
++  and :func:`unicodedata.lookup()` resolves named sequences too.
++
++  (Contributed by Ezio Melotti in :issue:`12753`)
++
++* Unicode database updated to UCD version 6.1.0
++
++* Equality comparisons on :func:`range` objects now return a result reflecting
++  the equality of the underlying sequences generated by those range objects.
++  (:issue:`13201`)
++
++* The ``count()``, ``find()``, ``rfind()``, ``index()`` and ``rindex()``
++  methods of :class:`bytes` and :class:`bytearray` objects now accept an
++  integer between 0 and 255 as their first argument.
++
++  (Contributed by Petri Lehtinen in :issue:`12170`)
++
++* The ``rjust()``, ``ljust()``, and ``center()`` methods of :class:`bytes`
++  and :class:`bytearray` now accept a :class:`bytearray` for the ``fill``
++  argument.  (Contributed by Petri Lehtinen in :issue:`12380`.)
++
++* New methods have been added to :class:`list` and :class:`bytearray`:
++  ``copy()`` and ``clear()`` (:issue:`10516`).  Consequently,
++  :class:`~collections.abc.MutableSequence` now also defines a
++  :meth:`~collections.abc.MutableSequence.clear` method (:issue:`11388`).
++
++* Raw bytes literals can now be written ``rb"..."`` as well as ``br"..."``.
++
++  (Contributed by Antoine Pitrou in :issue:`13748`.)
++
++* :meth:`dict.setdefault` now does only one lookup for the given key, making
++  it atomic when used with built-in types.
++
++  (Contributed by Filip Gruszczyński in :issue:`13521`.)
++
++* The error messages produced when a function call does not match the function
++  signature have been significantly improved.
++
++  (Contributed by Benjamin Peterson.)
++
++
++A Finer-Grained Import Lock
++===========================
++
++Previous versions of CPython have always relied on a global import lock.
++This led to unexpected annoyances, such as deadlocks when importing a module
++would trigger code execution in a different thread as a side-effect.
++Clumsy workarounds were sometimes employed, such as the
++:c:func:`PyImport_ImportModuleNoBlock` C API function.
++
++In Python 3.3, importing a module takes a per-module lock.  This correctly
++serializes importation of a given module from multiple threads (preventing
++the exposure of incompletely initialized modules), while eliminating the
++aforementioned annoyances.
++
++(Contributed by Antoine Pitrou in :issue:`9260`.)
++
++
++Builtin functions and types
++===========================
++
++* :func:`open` gets a new *opener* parameter: the underlying file descriptor
++  for the file object is then obtained by calling *opener* with (*file*,
++  *flags*). It can be used to use custom flags like :data:`os.O_CLOEXEC` for
++  example. The ``'x'`` mode was added: open for exclusive creation, failing if
++  the file already exists.
++* :func:`print`: added the *flush* keyword argument. If the *flush* keyword
++  argument is true, the stream is forcibly flushed.
++* :func:`hash`: hash randomization is enabled by default, see
++  :meth:`object.__hash__` and :envvar:`PYTHONHASHSEED`.
++* The :class:`str` type gets a new :meth:`~str.casefold` method: return a
++  casefolded copy of the string, casefolded strings may be used for caseless
++  matching. For example, ``'ß'.casefold()`` returns ``'ss'``.
++* The sequence documentation has been substantially rewritten to better
++  explain the binary/text sequence distinction and to provide specific
++  documentation sections for the individual builtin sequence types
++  (:issue:`4966`)
++
++
++New Modules
++===========
++
++faulthandler
++------------
++
++This new debug module :mod:`faulthandler` contains functions to dump Python tracebacks explicitly,
++on a fault (a crash like a segmentation fault), after a timeout, or on a user
++signal. Call :func:`faulthandler.enable` to install fault handlers for the
++:const:`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS`, and
++:const:`SIGILL` signals. You can also enable them at startup by setting the
++:envvar:`PYTHONFAULTHANDLER` environment variable or by using :option:`-X`
++``faulthandler`` command line option.
++
++Example of a segmentation fault on Linux: ::
++
++    $ python -q -X faulthandler
++    >>> import ctypes
++    >>> ctypes.string_at(0)
++    Fatal Python error: Segmentation fault
++
++    Current thread 0x00007fb899f39700:
++      File "/home/python/cpython/Lib/ctypes/__init__.py", line 486 in string_at
++      File "<stdin>", line 1 in <module>
++    Segmentation fault
++
++
++ipaddress
++---------
++
++The new :mod:`ipaddress` module provides tools for creating and manipulating
++objects representing IPv4 and IPv6 addresses, networks and interfaces (i.e.
++an IP address associated with a specific IP subnet).
++
++(Contributed by Google and Peter Moody in :pep:`3144`)
++
++lzma
++----
++
++The newly-added :mod:`lzma` module provides data compression and decompression
++using the LZMA algorithm, including support for the ``.xz`` and ``.lzma``
++file formats.
++
++(Contributed by Nadeem Vawda and Per Øyvind Karlsen in :issue:`6715`)
++
++
++Improved Modules
++================
++
++abc
++---
++
++Improved support for abstract base classes containing descriptors composed with
++abstract methods. The recommended approach to declaring abstract descriptors is
++now to provide :attr:`__isabstractmethod__` as a dynamically updated
++property. The built-in descriptors have been updated accordingly.
++
++  * :class:`abc.abstractproperty` has been deprecated, use :class:`property`
++    with :func:`abc.abstractmethod` instead.
++  * :class:`abc.abstractclassmethod` has been deprecated, use
++    :class:`classmethod` with :func:`abc.abstractmethod` instead.
++  * :class:`abc.abstractstaticmethod` has been deprecated, use
++    :class:`staticmethod` with :func:`abc.abstractmethod` instead.
++
++(Contributed by Darren Dale in :issue:`11610`)
++
++:meth:`abc.ABCMeta.register` now returns the registered subclass, which means
++it can now be used as a class decorator (:issue:`10868`).
++
++
++array
++-----
++
++The :mod:`array` module supports the :c:type:`long long` type using ``q`` and
++``Q`` type codes.
++
++(Contributed by Oren Tirosh and Hirokazu Yamamoto in :issue:`1172711`)
++
++
++base64
++------
++
++ASCII-only Unicode strings are now accepted by the decoding functions of the
++:mod:`base64` modern interface. For example, ``base64.b64decode('YWJj')``
++returns ``b'abc'``.  (Contributed by Catalin Iacob in :issue:`13641`.)
++
++
++binascii
++--------
++
++In addition to the binary objects they normally accept, the ``a2b_`` functions
++now all also accept ASCII-only strings as input.  (Contributed by Antoine
++Pitrou in :issue:`13637`.)
++
++
++bz2
++---
++
++The :mod:`bz2` module has been rewritten from scratch. In the process, several
++new features have been added:
++
++* New :func:`bz2.open` function: open a bzip2-compressed file in binary or
++  text mode.
++
++* :class:`bz2.BZ2File` can now read from and write to arbitrary file-like
++  objects, by means of its constructor's *fileobj* argument.
++
++  (Contributed by Nadeem Vawda in :issue:`5863`)
++
++* :class:`bz2.BZ2File` and :func:`bz2.decompress` can now decompress
++  multi-stream inputs (such as those produced by the :program:`pbzip2` tool).
++  :class:`bz2.BZ2File` can now also be used to create this type of file, using
++  the ``'a'`` (append) mode.
++
++  (Contributed by Nir Aides in :issue:`1625`)
++
++* :class:`bz2.BZ2File` now implements all of the :class:`io.BufferedIOBase` API,
++  except for the :meth:`detach` and :meth:`truncate` methods.
++
++
++codecs
++------
++
++The :mod:`~encodings.mbcs` codec has been rewritten to handle correctly
++``replace`` and ``ignore`` error handlers on all Windows versions.  The
++:mod:`~encodings.mbcs` codec now supports all error handlers, instead of only
++``replace`` to encode and ``ignore`` to decode.
++
++A new Windows-only codec has been added: ``cp65001`` (:issue:`13216`). It is the
++Windows code page 65001 (Windows UTF-8, ``CP_UTF8``).  For example, it is used
++by ``sys.stdout`` if the console output code page is set to cp65001 (e.g., using
++``chcp 65001`` command).
++
++Multibyte CJK decoders now resynchronize faster.  They only ignore the first
++byte of an invalid byte sequence. For example, ``b'\xff\n'.decode('gb2312',
++'replace')`` now returns a ``\n`` after the replacement character.
++
++(:issue:`12016`)
++
++Incremental CJK codec encoders are no longer reset at each call to their
++encode() methods. For example::
++
++    $ ./python -q
++    >>> import codecs
++    >>> encoder = codecs.getincrementalencoder('hz')('strict')
++    >>> b''.join(encoder.encode(x) for x in '\u52ff\u65bd\u65bc\u4eba\u3002 Bye.')
++    b'~{NpJ)l6HK!#~} Bye.'
++
++This example gives ``b'~{Np~}~{J)~}~{l6~}~{HK~}~{!#~} Bye.'`` with older Python
++versions.
++
++(:issue:`12100`)
++
++The ``unicode_internal`` codec has been deprecated.
++
++
++collections
++-----------
++
++Addition of a new :class:`~collections.ChainMap` class to allow treating a
++number of mappings as a single unit.  (Written by Raymond Hettinger for
++:issue:`11089`, made public in :issue:`11297`)
++
++The abstract base classes have been moved in a new :mod:`collections.abc`
++module, to better differentiate between the abstract and the concrete
++collections classes.  Aliases for ABCs are still present in the
++:mod:`collections` module to preserve existing imports.  (:issue:`11085`)
++
++.. XXX addition of __slots__ to ABCs not recorded here: internal detail
++
++The :class:`~collections.Counter` class now supports the unary ``+`` and ``-``
++operators, as well as the in-place operators ``+=``, ``-=``, ``|=``, and
++``&=``.  (Contributed by Raymond Hettinger in :issue:`13121`.)
++
++
++contextlib
++----------
++
++:class:`~contextlib.ExitStack` now provides a solid foundation for
++programmatic manipulation of context managers and similar cleanup
++functionality. Unlike the previous ``contextlib.nested`` API (which was
++deprecated and removed), the new API is designed to work correctly
++regardless of whether context managers acquire their resources in
++their ``__init__`` method (for example, file objects) or in their
++``__enter__`` method (for example, synchronisation objects from the
++:mod:`threading` module).
++
++(:issue:`13585`)
++
++
++crypt
++-----
++
++Addition of salt and modular crypt format (hashing method) and the :func:`~crypt.mksalt`
++function to the :mod:`crypt` module.
++
++(:issue:`10924`)
++
++curses
++------
++
++ * If the :mod:`curses` module is linked to the ncursesw library, use Unicode
++   functions when Unicode strings or characters are passed (e.g.
++   :c:func:`waddwstr`), and bytes functions otherwise (e.g. :c:func:`waddstr`).
++ * Use the locale encoding instead of ``utf-8`` to encode Unicode strings.
++ * :class:`curses.window` has a new :attr:`curses.window.encoding` attribute.
++ * The :class:`curses.window` class has a new :meth:`~curses.window.get_wch`
++   method to get a wide character
++ * The :mod:`curses` module has a new :meth:`~curses.unget_wch` function to
++   push a wide character so the next :meth:`~curses.window.get_wch` will return
++   it
++
++(Contributed by Iñigo Serna in :issue:`6755`)
++
++datetime
++--------
++
++ * Equality comparisons between naive and aware :class:`~datetime.datetime`
++   instances now return :const:`False` instead of raising :exc:`TypeError`
++   (:issue:`15006`).
++ * New :meth:`datetime.datetime.timestamp` method: Return POSIX timestamp
++   corresponding to the :class:`~datetime.datetime` instance.
++ * The :meth:`datetime.datetime.strftime` method supports formatting years
++   older than 1000.
++ * The :meth:`datetime.datetime.astimezone` method can now be
++   called without arguments to convert datetime instance to the system
++   timezone.
++
++
++.. _new-decimal:
++
++decimal
++-------
++
++:issue:`7652` - integrate fast native decimal arithmetic.
++   C-module and libmpdec written by Stefan Krah.
++
++The new C version of the decimal module integrates the high speed libmpdec
++library for arbitrary precision correctly-rounded decimal floating point
++arithmetic. libmpdec conforms to IBM's General Decimal Arithmetic Specification.
++
++Performance gains range from 10x for database applications to 100x for
++numerically intensive applications. These numbers are expected gains
++for standard precisions used in decimal floating point arithmetic. Since
++the precision is user configurable, the exact figures may vary. For example,
++in integer bignum arithmetic the differences can be significantly higher.
++
++The following table is meant as an illustration. Benchmarks are available
++at http://www.bytereef.org/mpdecimal/quickstart.html.
++
++   +---------+-------------+--------------+-------------+
++   |         |  decimal.py |   _decimal   |   speedup   |
++   +=========+=============+==============+=============+
++   |   pi    |    42.02s   |    0.345s    |    120x     |
++   +---------+-------------+--------------+-------------+
++   | telco   |   172.19s   |    5.68s     |     30x     |
++   +---------+-------------+--------------+-------------+
++   | psycopg |     3.57s   |    0.29s     |     12x     |
++   +---------+-------------+--------------+-------------+
++
++Features
++~~~~~~~~
++
++* The :exc:`~decimal.FloatOperation` signal optionally enables stricter
++  semantics for mixing floats and Decimals.
++
++* If Python is compiled without threads, the C version automatically
++  disables the expensive thread local context machinery. In this case,
++  the variable :data:`~decimal.HAVE_THREADS` is set to False.
++
++API changes
++~~~~~~~~~~~
++
++* The C module has the following context limits, depending on the machine
++  architecture:
++
++   +-------------------+---------------------+------------------------------+
++   |                   |       32-bit        |            64-bit            |
++   +===================+=====================+==============================+
++   | :const:`MAX_PREC` | :const:`425000000`  | :const:`999999999999999999`  |
++   +-------------------+---------------------+------------------------------+
++   | :const:`MAX_EMAX` | :const:`425000000`  | :const:`999999999999999999`  |
++   +-------------------+---------------------+------------------------------+
++   | :const:`MIN_EMIN` | :const:`-425000000` | :const:`-999999999999999999` |
++   +-------------------+---------------------+------------------------------+
++
++* In the context templates (:class:`~decimal.DefaultContext`,
++  :class:`~decimal.BasicContext` and :class:`~decimal.ExtendedContext`)
++  the magnitude of :attr:`~decimal.Context.Emax` and
++  :attr:`~decimal.Context.Emin` has changed to :const:`999999`.
++
++* The :class:`~decimal.Decimal` constructor in decimal.py does not observe
++  the context limits and converts values with arbitrary exponents or precision
++  exactly. Since the C version has internal limits, the following scheme is
++  used: If possible, values are converted exactly, otherwise
++  :exc:`~decimal.InvalidOperation` is raised and the result is NaN. In the
++  latter case it is always possible to use :meth:`~decimal.Context.create_decimal`
++  in order to obtain a rounded or inexact value.
++
++
++* The power function in decimal.py is always correctly-rounded. In the
++  C version, it is defined in terms of the correctly-rounded
++  :meth:`~decimal.Decimal.exp` and :meth:`~decimal.Decimal.ln` functions,
++  but the final result is only "almost always correctly rounded".
++
++
++* In the C version, the context dictionary containing the signals is a
++  :class:`~collections.abc.MutableMapping`.  For speed reasons,
++  :attr:`~decimal.Context.flags` and :attr:`~decimal.Context.traps` always
++  refer to the same :class:`~collections.abc.MutableMapping` that the context
++  was initialized with. If a new signal dictionary is assigned,
++  :attr:`~decimal.Context.flags` and :attr:`~decimal.Context.traps`
++  are updated with the new values, but they do not reference the RHS
++  dictionary.
++
++
++* Pickling a :class:`~decimal.Context` produces a different output in order
++  to have a common interchange format for the Python and C versions.
++
++
++* The order of arguments in the :class:`~decimal.Context` constructor has been
++  changed to match the order displayed by :func:`repr`.
++
++
++* The ``watchexp`` parameter in the :meth:`~decimal.Decimal.quantize` method
++  is deprecated.
++
++
++.. _new-email:
++
++email
++-----
+ 
+ Policy Framework
+-----------------
++~~~~~~~~~~~~~~~~
+ 
+ The email package now has a :mod:`~email.policy` framework.  A
+ :class:`~email.policy.Policy` is an object with several methods and properties
+@@ -712,7 +1246,7 @@
+ 
+ 
+ Provisional Policy with New Header API
+---------------------------------------
++~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 
+ While the policy framework is worthwhile all by itself, the main motivation for
+ introducing it is to allow the creation of new policies that implement new
+@@ -803,402 +1337,55 @@
+ package transparently encodes and decodes the unicode to and from the RFC
+ standard Content Transfer Encodings.
+ 
+-
+-Other Language Changes
+-======================
+-
+-Some smaller changes made to the core Python language are:
+-
+-* Added support for Unicode name aliases and named sequences.
+-  Both :func:`unicodedata.lookup()` and ``'\N{...}'`` now resolve name aliases,
+-  and :func:`unicodedata.lookup()` resolves named sequences too.
+-
+-  (Contributed by Ezio Melotti in :issue:`12753`)
+-
+-* Equality comparisons on :func:`range` objects now return a result reflecting
+-  the equality of the underlying sequences generated by those range objects.
+-
+-  (:issue:`13201`)
+-
+-* The ``count()``, ``find()``, ``rfind()``, ``index()`` and ``rindex()``
+-  methods of :class:`bytes` and :class:`bytearray` objects now accept an
+-  integer between 0 and 255 as their first argument.
+-
+-  (Contributed by Petri Lehtinen in :issue:`12170`)
+-
+-* New methods have been added to :class:`list` and :class:`bytearray`:
+-  ``copy()`` and ``clear()``.
+-
+-  (:issue:`10516`)
+-
+-* Raw bytes literals can now be written ``rb"..."`` as well as ``br"..."``.
+-  (Contributed by Antoine Pitrou in :issue:`13748`.)
+-
+-* :meth:`dict.setdefault` now does only one lookup for the given key, making
+-  it atomic when used with built-in types.
+-  (Contributed by Filip Gruszczyński in :issue:`13521`.)
+-
+-
+-.. XXX mention new error messages for passing wrong number of arguments to functions
+-
+-
+-A Finer-Grained Import Lock
+-===========================
+-
+-Previous versions of CPython have always relied on a global import lock.
+-This led to unexpected annoyances, such as deadlocks when importing a module
+-would trigger code execution in a different thread as a side-effect.
+-Clumsy workarounds were sometimes employed, such as the
+-:c:func:`PyImport_ImportModuleNoBlock` C API function.
+-
+-In Python 3.3, importing a module takes a per-module lock.  This correctly
+-serializes importation of a given module from multiple threads (preventing
+-the exposure of incompletely initialized modules), while eliminating the
+-aforementioned annoyances.
+-
+-(contributed by Antoine Pitrou in :issue:`9260`.)
+-
+-
+-Builtin functions and types
+-===========================
+-
+-* :func:`open` gets a new *opener* parameter: the underlying file descriptor
+-  for the file object is then obtained by calling *opener* with (*file*,
+-  *flags*). It can be used to use custom flags like :data:`os.O_CLOEXEC` for
+-  example. The ``'x'`` mode was added: open for exclusive creation, failing if
+-  the file already exists.
+-* :func:`print`: added the *flush* keyword argument. If the *flush* keyword
+-  argument is true, the stream is forcibly flushed.
+-* :func:`hash`: hash randomization is enabled by default, see
+-  :meth:`object.__hash__` and :envvar:`PYTHONHASHSEED`.
+-* The :class:`str` type gets a new :meth:`~str.casefold` method: return a
+-  casefolded copy of the string, casefolded strings may be used for caseless
+-  matching. For example, ``'ß'.casefold()`` returns ``'ss'``.
+-* The sequence documentation has been substantially rewritten to better
+-  explain the binary/text sequence distinction and to provide specific
+-  documentation sections for the individual builtin sequence types
+-  (:issue:`4966`)
+-
+-New Modules
+-===========
+-
+-faulthandler
+-------------
+-
+-This new debug module contains functions to dump Python tracebacks explicitly,
+-on a fault (a crash like a segmentation fault), after a timeout, or on a user
+-signal. Call :func:`faulthandler.enable` to install fault handlers for the
+-:const:`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS`, and
+-:const:`SIGILL` signals. You can also enable them at startup by setting the
+-:envvar:`PYTHONFAULTHANDLER` environment variable or by using :option:`-X`
+-``faulthandler`` command line option.
+-
+-Example of a segmentation fault on Linux: ::
+-
+-    $ python -q -X faulthandler
+-    >>> import ctypes
+-    >>> ctypes.string_at(0)
+-    Fatal Python error: Segmentation fault
+-
+-    Current thread 0x00007fb899f39700:
+-      File "/home/python/cpython/Lib/ctypes/__init__.py", line 486 in string_at
+-      File "<stdin>", line 1 in <module>
+-    Segmentation fault
+-
+-
+-ipaddress
+----------
+-
+-The new :mod:`ipaddress` module provides tools for creating and manipulating
+-objects representing IPv4 and IPv6 addresses, networks and interfaces (i.e.
+-an IP address associated with a specific IP subnet).
+-
+-(Contributed by Google and Peter Moody in :pep:`3144`)
+-
+-lzma
+-----
+-
+-The newly-added :mod:`lzma` module provides data compression and decompression
+-using the LZMA algorithm, including support for the ``.xz`` and ``.lzma``
+-file formats.
+-
+-(Contributed by Nadeem Vawda and Per Øyvind Karlsen in :issue:`6715`)
+-
+-
+-Improved Modules
+-================
+-
+-abc
+----
+-
+-Improved support for abstract base classes containing descriptors composed with
+-abstract methods. The recommended approach to declaring abstract descriptors is
+-now to provide :attr:`__isabstractmethod__` as a dynamically updated
+-property. The built-in descriptors have been updated accordingly.
+-
+-  * :class:`abc.abstractproperty` has been deprecated, use :class:`property`
+-    with :func:`abc.abstractmethod` instead.
+-  * :class:`abc.abstractclassmethod` has been deprecated, use
+-    :class:`classmethod` with :func:`abc.abstractmethod` instead.
+-  * :class:`abc.abstractstaticmethod` has been deprecated, use
+-    :class:`staticmethod` with :func:`abc.abstractmethod` instead.
+-
+-(Contributed by Darren Dale in :issue:`11610`)
+-
+-array
+------
+-
+-The :mod:`array` module supports the :c:type:`long long` type using ``q`` and
+-``Q`` type codes.
+-
+-(Contributed by Oren Tirosh and Hirokazu Yamamoto in :issue:`1172711`)
+-
+-
+-base64, binascii
+-----------------
+-
+-ASCII-only Unicode strings are now accepted by the decoding functions of the
+-modern interface. For example, ``base64.b64decode('YWJj')`` returns ``b'abc'``.
+-
+-
+-bz2
+----
+-
+-The :mod:`bz2` module has been rewritten from scratch. In the process, several
+-new features have been added:
+-
+-* New :func:`bz2.open` function: open a bzip2-compressed file in binary or
+-  text mode.
+-
+-* :class:`bz2.BZ2File` can now read from and write to arbitrary file-like
+-  objects, by means of its constructor's *fileobj* argument.
+-
+-  (Contributed by Nadeem Vawda in :issue:`5863`)
+-
+-* :class:`bz2.BZ2File` and :func:`bz2.decompress` can now decompress
+-  multi-stream inputs (such as those produced by the :program:`pbzip2` tool).
+-  :class:`bz2.BZ2File` can now also be used to create this type of file, using
+-  the ``'a'`` (append) mode.
+-
+-  (Contributed by Nir Aides in :issue:`1625`)
+-
+-* :class:`bz2.BZ2File` now implements all of the :class:`io.BufferedIOBase` API,
+-  except for the :meth:`detach` and :meth:`truncate` methods.
+-
+-
+-codecs
+-------
+-
+-The :mod:`~encodings.mbcs` codec has been rewritten to handle correctly
+-``replace`` and ``ignore`` error handlers on all Windows versions.  The
+-:mod:`~encodings.mbcs` codec now supports all error handlers, instead of only
+-``replace`` to encode and ``ignore`` to decode.
+-
+-A new Windows-only codec has been added: ``cp65001`` (:issue:`13216`). It is the
+-Windows code page 65001 (Windows UTF-8, ``CP_UTF8``).  For example, it is used
+-by ``sys.stdout`` if the console output code page is set to cp65001 (e.g., using
+-``chcp 65001`` command).
+-
+-Multibyte CJK decoders now resynchronize faster.  They only ignore the first
+-byte of an invalid byte sequence. For example, ``b'\xff\n'.decode('gb2312',
+-'replace')`` now returns a ``\n`` after the replacement character.
+-
+-(:issue:`12016`)
+-
+-Incremental CJK codec encoders are no longer reset at each call to their
+-encode() methods. For example::
+-
+-    $ ./python -q
+-    >>> import codecs
+-    >>> encoder = codecs.getincrementalencoder('hz')('strict')
+-    >>> b''.join(encoder.encode(x) for x in '\u52ff\u65bd\u65bc\u4eba\u3002 Bye.')
+-    b'~{NpJ)l6HK!#~} Bye.'
+-
+-This example gives ``b'~{Np~}~{J)~}~{l6~}~{HK~}~{!#~} Bye.'`` with older Python
+-versions.
+-
+-(:issue:`12100`)
+-
+-The ``unicode_internal`` codec has been deprecated.
+-
+-
+-collections
+------------
+-
+-Addition of a new :class:`~collections.ChainMap` class to allow treating a
+-number of mappings as a single unit.
+-
+-(Written by Raymond Hettinger for :issue:`11089`, made public in
+-:issue:`11297`)
+-
+-The abstract base classes have been moved in a new :mod:`collections.abc`
+-module, to better differentiate between the abstract and the concrete
+-collections classes.  Aliases for ABCs are still present in the
+-:mod:`collections` module to preserve existing imports.
+-
+-(:issue:`11085`)
+-
+-.. XXX addition of __slots__ to ABCs not recorded here: internal detail
+-
+-
+-contextlib
+-----------
+-
+-:class:`~collections.ExitStack` now provides a solid foundation for
+-programmatic manipulation of context managers and similar cleanup
+-functionality. Unlike the previous ``contextlib.nested`` API (which was
+-deprecated and removed), the new API is designed to work correctly
+-regardless of whether context managers acquire their resources in
+-their ``__init__`` method (for example, file objects) or in their
+-``__enter__`` method (for example, synchronisation objects from the
+-:mod:`threading` module).
+-
+-(:issue:`13585`)
+-
+-
+-crypt
+------
+-
+-Addition of salt and modular crypt format (hashing method) and the :func:`~crypt.mksalt`
+-function to the :mod:`crypt` module.
+-
+-(:issue:`10924`)
+-
+-curses
+-------
+-
+- * If the :mod:`curses` module is linked to the ncursesw library, use Unicode
+-   functions when Unicode strings or characters are passed (e.g.
+-   :c:func:`waddwstr`), and bytes functions otherwise (e.g. :c:func:`waddstr`).
+- * Use the locale encoding instead of ``utf-8`` to encode Unicode strings.
+- * :class:`curses.window` has a new :attr:`curses.window.encoding` attribute.
+- * The :class:`curses.window` class has a new :meth:`~curses.window.get_wch`
+-   method to get a wide character
+- * The :mod:`curses` module has a new :meth:`~curses.unget_wch` function to
+-   push a wide character so the next :meth:`~curses.window.get_wch` will return
+-   it
+-
+-(Contributed by Iñigo Serna in :issue:`6755`)
+-
+-datetime
+---------
+-
+- * Equality comparisons between naive and aware :class:`~datetime.datetime`
+-   instances don't raise :exc:`TypeError`.
+- * New :meth:`datetime.datetime.timestamp` method: Return POSIX timestamp
+-   corresponding to the :class:`~datetime.datetime` instance.
+- * The :meth:`datetime.datetime.strftime` method supports formatting years
+-   older than 1000.
+- * XXX The :meth:`datetime.datetime.astimezone` method can now be
+-   called without arguments to convert datetime instance to the system
+-   timezone.
+-
+-decimal
+--------
+-
+-:issue:`7652` - integrate fast native decimal arithmetic.
+-   C-module and libmpdec written by Stefan Krah.
+-
+-The new C version of the decimal module integrates the high speed libmpdec
+-library for arbitrary precision correctly-rounded decimal floating point
+-arithmetic. libmpdec conforms to IBM's General Decimal Arithmetic Specification.
+-
+-Performance gains range from 10x for database applications to 100x for
+-numerically intensive applications. These numbers are expected gains
+-for standard precisions used in decimal floating point arithmetic. Since
+-the precision is user configurable, the exact figures may vary. For example,
+-in integer bignum arithmetic the differences can be significantly higher.
+-
+-The following table is meant as an illustration. Benchmarks are available
+-at http://www.bytereef.org/mpdecimal/quickstart.html.
+-
+-   +---------+-------------+--------------+-------------+
+-   |         |  decimal.py |   _decimal   |   speedup   |
+-   +=========+=============+==============+=============+
+-   |   pi    |    42.02s   |    0.345s    |    120x     |
+-   +---------+-------------+--------------+-------------+
+-   | telco   |   172.19s   |    5.68s     |     30x     |
+-   +---------+-------------+--------------+-------------+
+-   | psycopg |     3.57s   |    0.29s     |     12x     |
+-   +---------+-------------+--------------+-------------+
+-
+-Features
+-~~~~~~~~
+-
+-* The :exc:`~decimal.FloatOperation` signal optionally enables stricter
+-  semantics for mixing floats and Decimals.
+-
+-* If Python is compiled without threads, the C version automatically
+-  disables the expensive thread local context machinery. In this case,
+-  the variable :data:`~decimal.HAVE_THREADS` is set to False.
+-
+-API changes
+-~~~~~~~~~~~
+-
+-* The C module has the following context limits, depending on the machine
+-  architecture:
+-
+-   +-------------------+---------------------+------------------------------+
+-   |                   |       32-bit        |            64-bit            |
+-   +===================+=====================+==============================+
+-   | :const:`MAX_PREC` | :const:`425000000`  | :const:`999999999999999999`  |
+-   +-------------------+---------------------+------------------------------+
+-   | :const:`MAX_EMAX` | :const:`425000000`  | :const:`999999999999999999`  |
+-   +-------------------+---------------------+------------------------------+
+-   | :const:`MIN_EMIN` | :const:`-425000000` | :const:`-999999999999999999` |
+-   +-------------------+---------------------+------------------------------+
+-
+-* In the context templates (:class:`~decimal.DefaultContext`,
+-  :class:`~decimal.BasicContext` and :class:`~decimal.ExtendedContext`)
+-  the magnitude of :attr:`~decimal.Context.Emax` and
+-  :attr:`~decimal.Context.Emin` has changed to :const:`999999`.
+-
+-* The :class:`~decimal.Decimal` constructor in decimal.py does not observe
+-  the context limits and converts values with arbitrary exponents or precision
+-  exactly. Since the C version has internal limits, the following scheme is
+-  used: If possible, values are converted exactly, otherwise
+-  :exc:`~decimal.InvalidOperation` is raised and the result is NaN. In the
+-  latter case it is always possible to use :meth:`~decimal.Context.create_decimal`
+-  in order to obtain a rounded or inexact value.
+-
+-
+-* The power function in decimal.py is always correctly-rounded. In the
+-  C version, it is defined in terms of the correctly-rounded
+-  :meth:`~decimal.Decimal.exp` and :meth:`~decimal.Decimal.ln` functions,
+-  but the final result is only "almost always correctly rounded".
+-
+-
+-* In the C version, the context dictionary containing the signals is a
+-  :class:`~collections.abc.MutableMapping`.  For speed reasons,
+-  :attr:`~decimal.Context.flags` and :attr:`~decimal.Context.traps` always
+-  refer to the same :class:`~collections.abc.MutableMapping` that the context
+-  was initialized with. If a new signal dictionary is assigned,
+-  :attr:`~decimal.Context.flags` and :attr:`~decimal.Context.traps`
+-  are updated with the new values, but they do not reference the RHS
+-  dictionary.
+-
+-
+-* Pickling a :class:`~decimal.Context` produces a different output in order
+-  to have a common interchange format for the Python and C versions.
+-
+-
+-* The order of arguments in the :class:`~decimal.Context` constructor has been
+-  changed to match the order displayed by :func:`repr`.
+-
+-
+-* The ``watchexp`` parameter in the :meth:`~decimal.Decimal.quantize` method
+-  is deprecated.
++Other API Changes
++~~~~~~~~~~~~~~~~~
++
++New :class:`~email.parser.BytesHeaderParser`, added to the :mod:`~email.parser`
++module to complement :class:`~email.parser.HeaderParser` and complete the Bytes
++API.
++
++New utility functions:
++
++   * :func:`~email.utils.format_datetime`: given a :class:`~datetime.datetime`,
++     produce a string formatted for use in an email header.
++
++   * :func:`~email.utils.parsedate_to_datetime`: given a date string from
++     an email header, convert it into an aware :class:`~datetime.datetime`,
++     or a naive :class:`~datetime.datetime` if the offset is ``-0000``.
++
++   * :func:`~email.utils.localtime`: With no argument, returns the
++     current local time as an aware :class:`~datetime.datetime` using the local
++     :class:`~datetime.timezone`.  Given an aware :class:`~datetime.datetime`,
++     converts it into an aware :class:`~datetime.datetime` using the
++     local :class:`~datetime.timezone`.
+ 
+ 
+ ftplib
+ ------
+ 
+-The :class:`~ftplib.FTP_TLS` class now provides a new
+-:func:`~ftplib.FTP_TLS.ccc` function to revert control channel back to
+-plaintext.  This can be useful to take advantage of firewalls that know how to
+-handle NAT with non-secure FTP without opening fixed ports.
+-
+-(Contributed by Giampaolo Rodolà in :issue:`12139`)
++* :class:`ftplib.FTP` now accepts a ``source_address`` keyword argument to
++  specify the ``(host, port)`` to use as the source address in the bind call
++  when creating the outgoing socket.  (Contributed by Giampaolo Rodolà
++  in :issue:`8594`.)
++
++* The :class:`~ftplib.FTP_TLS` class now provides a new
++  :func:`~ftplib.FTP_TLS.ccc` function to revert control channel back to
++  plaintext.  This can be useful to take advantage of firewalls that know how
++  to handle NAT with non-secure FTP without opening fixed ports.  (Contributed
++  by Giampaolo Rodolà in :issue:`12139`)
++
++* Added :meth:`ftplib.FTP.mlsd` method which provides a parsable directory
++  listing format and deprecates :meth:`ftplib.FTP.nlst` and
++  :meth:`ftplib.FTP.dir`.  (Contributed by Giampaolo Rodolà in :issue:`11072`)
++
++
++functools
++---------
++
++The :func:`functools.lru_cache` decorator now accepts a ``typed`` keyword
++argument (that defaults to ``False`` to ensure that it caches values of
++different types that compare equal in separate cache slots.  (Contributed
++by Raymond Hettinger in :issue:`13227`.)
+ 
+ 
+ gc
+@@ -1211,10 +1398,47 @@
+ hmac
+ ----
+ 
+-A new :func:`~hmac.compare_digest` function has been added to prevent
+-side channel attacks on digests through timing analysis.
+-
+-(Contributed by Nick Coghlan and Christian Heimes in issue:`15061`)
++A new :func:`~hmac.compare_digest` function has been added to prevent side
++channel attacks on digests through timing analysis.  (Contributed by Nick
++Coghlan and Christian Heimes in :issue:`15061`)
++
++
++http
++----
++
++:class:`http.server.BaseHTTPRequestHandler` now buffers the headers and writes
++them all at once when :meth:`~http.server.BaseHTTPRequestHandler.end_headers` is
++called.  A new method :meth:`~http.server.BaseHTTPRequestHandler.flush_headers`
++can be used to directly manage when the accumlated headers are sent.
++(Contributed by Andrew Schaaf in :issue:`3709`.)
++
++:class:`http.server` now produces valid ``HTML 4.01 strict`` output.
++(Contributed by Ezio Melotti in :issue:`13295`.)
++
++:class:`http.client.HTTPResponse` now has a
++:meth:`~http.client.HTTPResponse.readinto` method, which means it can be used
++as a :class:`io.RawIOBase` class.  (Contributed by John Kuhn in
++:issue:`13464`.)
++
++
++html
++----
++
++:class:`html.parser.HTMLParser` is now able to parse broken markup without
++raising errors, therefore the *strict* argument of the constructor and the
++:exc:`~html.parser.HTMLParseError` exception are now deprecated.
++The ability to parse broken markup is the result of a number of bug fixes that
++are also available on the latest bug fix releases of Python 2.7/3.2.
++(Contributed by Ezio Melotti in :issue:`15114`, and :issue:`14538`,
++:issue:`13993`, :issue:`13960`, :issue:`13358`, :issue:`1745761`,
++:issue:`755670`, :issue:`13357`, :issue:`12629`, :issue:`1200313`,
++:issue:`670664`, :issue:`13273`, :issue:`12888`, :issue:`7311`)
++
++A new :data:`~html.entities.html5` dictionary that maps HTML5 named character
++references to the equivalent Unicode character(s) (e.g. ``html5['gt;'] ==
++'>'``) has been added to the :mod:`html.entities` module.  The dictionary is
++now also used by :class:`~html.parser.HTMLParser`.  (Contributed by Ezio
++Melotti in :issue:`11113` and :issue:`15156`)
+ 
+ 
+ imaplib
+@@ -1259,13 +1483,42 @@
+ underlying binary buffer.
+ 
+ 
++itertools
++---------
++
++:func:`~itertools.accumulate` now takes an optional ``func`` argument for
++providing a user-supplied binary function.
++
++
++logging
++-------
++
++The :func:`~logging.basicConfig` function now supports an optional ``handlers``
++argument taking an iterable of handlers to be added to the root logger.
++
++A class level attribute :attr:`~logging.handlers.SysLogHandler.append_nul` has
++been added to :class:`~logging.handlers.SysLogHandler` to allow control of the
++appending of the ``NUL`` (``\000``) byte to syslog records, since for some
++deamons it is required while for others it is passed through to the log.
++
++
++
+ math
+ ----
+ 
+-The :mod:`math` module has a new function:
+-
+-  * :func:`~math.log2`: return the base-2 logarithm of *x*
+-    (Written by Mark Dickinson in :issue:`11888`).
++The :mod:`math` module has a new function, :func:`~math.log2`,  which returns
++the base-2 logarithm of *x*.
++
++(Written by Mark Dickinson in :issue:`11888`).
++
++
++mmap
++----
++
++The :meth:`~mmap.mmap.read` method is now more compatible with other file-like
++objects: if the argument is omitted or specified as ``None``, it returns the
++bytes from the current file position to the end of the mapping.  (Contributed
++by Petri Lehtinen in :issue:`12021`.)
+ 
+ 
+ multiprocessing
+@@ -1279,6 +1532,22 @@
+ multiprocessing connections.
+ (Contributed by Richard Oudkerk in :issue:`4892`.)
+ 
++:class:`multiprocessing.Process` now accepts a ``daemon`` keyword argument
++to override the default behavior of inheriting the ``daemon`` flag from
++the parent process (:issue:`6064`).
++
++New attribute attribute :data:`multiprocessing.Process.sentinel` allows a
++program to wait on multiple :class:`~multiprocessing.Process` objects at one
++time using the appropriate OS primitives (for example, :mod:`select` on
++posix systems).
++
++New methods :meth:`multiprocessing.pool.Pool.starmap` and
++:meth:`~multiprocessing.pool.Pool.starmap_async` provide
++:func:`itertools.starmap` equivalents to the existing
++:meth:`multiprocessing.pool.Pool.map` and
++:meth:`~multiprocessing.pool.Pool.map_async` functions.  (Contributed by Hynek
++Schlawack in :issue:`12708`.)
++
+ 
+ nntplib
+ -------
+@@ -1332,12 +1601,20 @@
+     :func:`~os.link`, :func:`~os.lstat`, :func:`~os.mkdir`, :func:`~os.mkfifo`,
+     :func:`~os.mknod`, :func:`~os.open`, :func:`~os.readlink`, :func:`~os.remove`,
+     :func:`~os.rename`, :func:`~os.replace`, :func:`~os.rmdir`, :func:`~os.stat`,
+-    :func:`~os.symlink`, :func:`~os.unlink`, :func:`~os.utime`.
++    :func:`~os.symlink`, :func:`~os.unlink`, :func:`~os.utime`.  Platform
++    support for using these parameters can be checked via the sets
++    :data:`os.supports_dir_fd` and :data:`os.supports_follows_symlinks`.
+ 
+   - The following functions now support a file descriptor for their path argument:
+     :func:`~os.chdir`, :func:`~os.chmod`, :func:`~os.chown`,
+     :func:`~os.execve`, :func:`~os.listdir`, :func:`~os.pathconf`, :func:`~os.path.exists`,
+-    :func:`~os.stat`, :func:`~os.statvfs`, :func:`~os.utime`.
++    :func:`~os.stat`, :func:`~os.statvfs`, :func:`~os.utime`.  Platform support
++    for this can be checked via the :data:`os.supports_fd` set.
++
++* :func:`~os.access` accepts an ``effective_ids`` keyword argument to turn on
++  using the effective uid/gid rather than the real uid/gid in the access check.
++  Platform support for this can be checked via the
++  :data:`~os.supports_effective_ids` set.
+ 
+ * The :mod:`os` module has two new functions: :func:`~os.getpriority` and
+   :func:`~os.setpriority`. They can be used to get or set process
+@@ -1386,7 +1663,7 @@
+     for a file.
+   * :func:`~os.sync`: Force write of everything to disk.
+ 
+-* Add some extra posix functions to the os module:
++* Additional new  posix functions:
+ 
+   * :func:`~os.lockf`: Apply, test or remove a POSIX lock on an open file descriptor.
+   * :func:`~os.pread`: Read from a file descriptor at an offset, the file
+@@ -1405,13 +1682,29 @@
+ * :func:`~os.times` and :func:`~os.uname`: Return type changed from a tuple to
+   a tuple-like object with named attributes.
+ 
++* Some platforms now support additional constants for the :func:`~os.lseek`
++  function, such as ``os.SEEK_HOLE`` and ``os.SEEK_DATA``.
++
++* New constants :data:`~os.RTLD_LAZY`, :data:`~os.RTLD_NOW`,
++  :data:`~os.RTLD_GLOBAL`, :data:`~os.RTLD_LOCAL`, :data:`~os.RTLD_NODELETE`,
++  :data:`~os.RTLD_NOLOAD`, and :data:`~os.RTLD_DEEPBIND` are available on
++  platforms that support them.   These are for use with the
++  :func:`sys.setdlopenflags` function, and supersede the similar constants
++  defined in :mod:`ctypes` and :mod:`DLFCN`.  (Contributed by Victor Stinner
++  in :issue:`13226`.)
++
++* :func:`os.symlink` now accepts (and ignores) the ``target_is_directory``
++  keyword argument on non-Windows platforms, to ease cross-platform support.
++
+ 
+ pdb
+ ---
+ 
+-* Tab-completion is now available not only for command names, but also their
+-  arguments.  For example, for the ``break`` command, function and file names
+-  are completed.  (Contributed by Georg Brandl in :issue:`14210`)
++Tab-completion is now available not only for command names, but also their
++arguments.  For example, for the ``break`` command, function and file names
++are completed.
++
++(Contributed by Georg Brandl in :issue:`14210`)
+ 
+ 
+ pickle
+@@ -1420,6 +1713,7 @@
+ :class:`pickle.Pickler` objects now have an optional
+ :attr:`~pickle.Pickler.dispatch_table` attribute allowing to set per-pickler
+ reduction functions.
++
+ (Contributed by Richard Oudkerk in :issue:`14166`.)
+ 
+ 
+@@ -1466,38 +1760,59 @@
+   :issue:`13245`)
+ 
+ 
++select
++------
++
++Solaris and derivatives platforms have a new class :class:`select.devpoll`
++for high performance asynchronous sockets via :file:`/dev/poll`.
++(Contributed by Jesús Cea Avión in :issue:`6397`.)
++
++
++shlex
++-----
++
++The previously undocumented helper function ``quote`` from the
++:mod:`pipes` modules has been moved to the :mod:`shlex` module and
++documented.  :func:`~shlex.quote` properly escapes all characters in a string
++that might be otherwise given special meaning by the shell.
++
++
+ shutil
+ ------
+ 
+-* The :mod:`shutil` module has these new fuctions:
++* New functions:
+ 
+   * :func:`~shutil.disk_usage`: provides total, used and free disk space
+     statistics. (Contributed by Giampaolo Rodolà in :issue:`12442`)
+   * :func:`~shutil.chown`: allows one to change user and/or group of the given
+     path also specifying the user/group names and not only their numeric
+     ids. (Contributed by Sandro Tosi in :issue:`12191`)
++  * :func:`shutil.get_terminal_size`: returns the size of the terminal window
++    to which the interpreter is attached.  (Contributed by Zbigniew
++    Jędrzejewski-Szmek in :issue:`13609`.)
+ 
+ * :func:`~shutil.copy2` and :func:`~shutil.copystat` now preserve file
+   timestamps with nanosecond precision on platforms that support it.
+   They also preserve file "extended attributes" on Linux.  (Contributed
+   by Larry Hastings in :issue:`14127` and  :issue:`15238`.)
+ 
+-* The new :func:`shutil.get_terminal_size` function returns the size of the
+-  terminal window the interpreter is attached to.
+-  (Contributed by Zbigniew Jędrzejewski-Szmek in :issue:`13609`.)
+-
+ * Several functions now take an optional ``symlinks`` argument: when that
+   parameter is true, symlinks aren't dereferenced and the operation instead
+   acts on the symlink itself (or creates one, if relevant).
+   (Contributed by Hynek Schlawack in :issue:`12715`.)
+ 
++* When copying files to a different file system, :func:`~shutil.move` now
++  handles symlinks the way the posix ``mv`` command does, recreating the
++  symlink rather than copying the target file contents.  (Contributed by
++  Jonathan Niehof in :issue:`9993`.)  :func:`~shutil.move` now also returns
++  the ``dst`` argument as its result.
++
+ * :func:`~shutil.rmtree` is now resistant to symlink attacks on platforms
+   which support the new ``dir_fd`` parameter in :func:`os.open` and
+   :func:`os.unlink`. (Contributed by Martin von Löwis and Hynek Schlawack
+   in :issue:`4489`.)
+ 
+ 
+-
+ signal
+ ------
+ 
+@@ -1520,14 +1835,35 @@
+ * :func:`signal.signal` and :func:`signal.siginterrupt` raise an OSError,
+   instead of a RuntimeError: OSError has an errno attribute.
+ 
++
++smtpd
++-----
++
++The :mod:`smtpd` module now supports :rfc:`5321` (extended SMTP) and :rfc:`1870`
++(size extension).  Per the standard, these extensions are enabled if and only
++if the client initiates the session with an ``EHLO`` command.
++
++(Initial ``ELHO`` support by Alberto Trevino.  Size extension by Juhana
++Jauhiainen.  Substantial additional work on the patch contributed by Michele
++Orrù and Dan Boswell.  :issue:`8739`)
++
++
+ smtplib
+ -------
+ 
++The :class:`~smtplib.SMTP`, :class:`~smtplib.SMTP_SSL`, and
++:class:`~smtplib.LMTP` classes now accept a ``source_address`` keyword argument
++to specify the ``(host, port)`` to use as the source address in the bind call
++when creating the outgoing socket.  (Contributed by Paulo Scardine in
++:issue:`11281`.)
++
++:class:`~smtplib.SMTP` now supports the context manager protocol, allowing an
++``SMTP`` instance to be used in a ``with`` statement.  (Contributed
++by Giampaolo Rodolà in :issue:`11289`.)
++
+ The :class:`~smtplib.SMTP_SSL` constructor and the :meth:`~smtplib.SMTP.starttls`
+ method now accept an SSLContext parameter to control parameters of the secure
+-channel.
+-
+-(Contributed by Kasun Herath in :issue:`8809`)
++channel.  (Contributed by Kasun Herath in :issue:`8809`)
+ 
+ 
+ socket
+@@ -1553,6 +1889,32 @@
+   (http://en.wikipedia.org/wiki/Reliable_Datagram_Sockets and
+   http://oss.oracle.com/projects/rds/).
+ 
++* The :class:`~socket.socket` class now supports the ``PF_SYSTEM`` protocol
++  family on OS X.  (Contributed by Michael Goderbauer in :issue:`13777`.)
++
++* New function :func:`~socket.sethostname` allows the hostname to be set
++  on unix systems if the calling process has sufficient privileges.
++  (Contributed by Ross Lagerwall in :issue:`10866`.)
++
++
++socketserver
++------------
++
++:class:`~socketserver.BaseServer` now has an overridable method
++:meth:`~socketserver.BaseServer.service_actions` that is called by the
++:meth:`~socketserver.BaseServer.serve_forever` method in the service loop.
++:class:`~socketserver.ForkingMixIn` now uses this to clean up zombie
++child proceses.  (Contributed by Justin Warkentin in :issue:`11109`.)
++
++
++sqlite3
++-------
++
++New :class:`sqlite3.Connection` method
++:meth:`~sqlite3.Connection.set_trace_callback` can be used to capture a trace of
++all sql commands processed by sqlite.  (Contributed by Torsten Landschoff
++in :issue:`11688`.)
++
+ 
+ ssl
+ ---
+@@ -1567,66 +1929,121 @@
+ 
+ * The :mod:`ssl` module now exposes a finer-grained exception hierarchy
+   in order to make it easier to inspect the various kinds of errors.
+-
+   (Contributed by Antoine Pitrou in :issue:`11183`)
+ 
+ * :meth:`~ssl.SSLContext.load_cert_chain` now accepts a *password* argument
+   to be used if the private key is encrypted.
+-
+   (Contributed by Adam Simpkins in :issue:`12803`)
+ 
+ * Diffie-Hellman key exchange, both regular and Elliptic Curve-based, is
+   now supported through the :meth:`~ssl.SSLContext.load_dh_params` and
+   :meth:`~ssl.SSLContext.set_ecdh_curve` methods.
+-
+   (Contributed by Antoine Pitrou in :issue:`13626` and :issue:`13627`)
+ 
+ * SSL sockets have a new :meth:`~ssl.SSLSocket.get_channel_binding` method
+   allowing the implementation of certain authentication mechanisms such as
+-  SCRAM-SHA-1-PLUS.
+-
+-  (Contributed by Jacek Konieczny in :issue:`12551`)
++  SCRAM-SHA-1-PLUS.  (Contributed by Jacek Konieczny in :issue:`12551`)
+ 
+ * You can query the SSL compression algorithm used by an SSL socket, thanks
+-  to its new :meth:`~ssl.SSLSocket.compression` method.
+-
++  to its new :meth:`~ssl.SSLSocket.compression` method.  The new attribute
++  :attr:`~ssl.OP_NO_COMPRESSION` can be used to disable compression.
+   (Contributed by Antoine Pitrou in :issue:`13634`)
+ 
+ * Support has been added for the Next Procotol Negotiation extension using
+   the :meth:`ssl.SSLContext.set_npn_protocols` method.
+-
+   (Contributed by Colin Marc in :issue:`14204`)
+ 
+ * SSL errors can now be introspected more easily thanks to
+   :attr:`~ssl.SSLError.library` and :attr:`~ssl.SSLError.reason` attributes.
+-
+   (Contributed by Antoine Pitrou in :issue:`14837`)
+ 
++* The :func:`~ssl.get_server_certificate` function now supports IPv6.
++  (Contributed by Charles-François Natali in :issue:`11811`.)
++
++* New attribute :attr:`~ssl.OP_CIPHER_SERVER_PREFERENCE` allows setting
++  SSLv3 server sockets to use the server's cipher ordering preference rather
++  than the client's (:issue:`13635`).
++
++
+ stat
+ ----
+ 
+-- The undocumented tarfile.filemode function has been moved to
+-  :func:`stat.filemode`. It can be used to convert a file's mode to a string of
+-  the form '-rwxrwxrwx'.
+-
+-  (Contributed by Giampaolo Rodolà in :issue:`14807`)
++The undocumented tarfile.filemode function has been moved to
++:func:`stat.filemode`. It can be used to convert a file's mode to a string of
++the form '-rwxrwxrwx'.
++
++(Contributed by Giampaolo Rodolà in :issue:`14807`)
++
++
++struct
++------
++
++The :mod:`struct` module now supports ``ssize_t`` and ``size_t`` via the
++new codes ``n`` and ``N``, respectively.  (Contributed by Antoine Pitrou
++in :issue:`3163`.)
++
++
++subprocess
++----------
++
++Command strings can now be bytes objects on posix platforms.  (Contributed by
++Victor Stinner in :issue:`8513`.)
++
++A new constant :data:`~subprocess.DEVNULL` allows suppressing output in a
++platform-independent fashion.  (Contributed by Ross Lagerwall in
++:issue:`5870`.)
++
+ 
+ sys
+ ---
+ 
+-* The :mod:`sys` module has a new :data:`~sys.thread_info` :term:`struct
+-  sequence` holding informations about the thread implementation.
+-
+-  (:issue:`11223`)
++The :mod:`sys` module has a new :data:`~sys.thread_info` :term:`struct
++sequence` holding informations about the thread implementation
++(:issue:`11223`).
++
++
++tarfile
++-------
++
++:mod:`tarfile` now supports ``lzma`` encoding via the :mod:`lzma` module.
++(Contributed by Lars Gustäbel in :issue:`5689`.)
++
++
++tempfile
++--------
++
++:class:`tempfile.SpooledTemporaryFile`\'s
++:meth:`~tempfile.SpooledTemporaryFile.trucate` method now accepts
++a ``size`` parameter.  (Contributed by Ryan Kelly in :issue:`9957`.)
++
+ 
+ textwrap
+ --------
+ 
+-* The :mod:`textwrap` module has a new :func:`~textwrap.indent` that makes
+-  it straightforward to add a common prefix to selected lines in a block
+-  of text.
+-
+-  (:issue:`13857`)
++The :mod:`textwrap` module has a new :func:`~textwrap.indent` that makes
++it straightforward to add a common prefix to selected lines in a block
++of text  (:issue:`13857`).
++
++
++threading
++---------
++
++:class:`threading.Condition`, :class:`threading.Semaphore`,
++:class:`threading.BoundedSemaphore`, :class:`threading.Event`, and
++:class:`threading.Timer`, all of which used to be factory functions returning a
++class instance, are now classes and may be subclassed. (Contributed by Éric
++Araujo in :issue:`10968`).
++
++The :class:`threading.Thread` constructor now accepts a ``daemon`` keyword
++argument to override the default behavior of inheriting the ``deamon`` flag
++value from the parent thread (:issue:`6064`).
++
++The formerly private function ``_thread.get_ident`` is now available as the
++public function :func:`threading.get_ident`.  This eliminates several cases of
++direct access to the ``_thread`` module in the stdlib.  Third party code that
++used ``_thread.get_ident`` should likewise be changed to use the new public
++interface.
++
+ 
+ time
+ ----
+@@ -1647,6 +2064,10 @@
+   :func:`~time.clock_settime` functions with ``CLOCK_xxx`` constants.
+   (Contributed by Victor Stinner in :issue:`10278`)
+ 
++To improve cross platform consistency, :func:`~time.sleep` now raises a
++:exc:`ValueError` when passed a negative sleep value.  Previously this was an
++error on posix, but produced an infinite sleep on Windows.
++
+ 
+ types
+ -----
+@@ -1659,6 +2080,18 @@
+ for PEP 3115 compliant dynamic type creation. (:issue:`14588`)
+ 
+ 
++unittest
++--------
++
++:meth:`.assertRaises`, :meth:`.assertRaisesRegex`, :meth:`.assertWarns`, and
++:meth:`.assertWarnsRegex` now accept a keyword argument *msg* when used as
++context managers.  (Contributed by Ezio Melotti and Winston Ewert in
++:issue:`10775`)
++
++:meth:`unittest.TestCase.run` now returns the :class:`~unittest.TestResult`
++object.
++
++
+ urllib
+ ------
+ 
+@@ -1674,13 +2107,13 @@
+ webbrowser
+ ----------
+ 
+-The :mod:`webbrowser` module supports more browsers: Google Chrome (named
++The :mod:`webbrowser` module supports more "browsers": Google Chrome (named
+ :program:`chrome`, :program:`chromium`, :program:`chrome-browser` or
+-:program:`chromium-browser` depending on the version and operating system) as
+-well as the the generic launchers :program:`xdg-open` from the FreeDesktop.org
+-project and :program:`gvfs-open` which is the default URI handler for GNOME 3.
+-
+-(:issue:`13620` and :issue:`14493`)
++:program:`chromium-browser` depending on the version and operating system),
++and the generic launchers :program:`xdg-open`, from the FreeDesktop.org
++project, and :program:`gvfs-open`, which is the default URI handler for GNOME
++3.  (The former contributed by Arnaud Calmettes in :issue:`13620`, the latter
++by Matthias Klose in :issue:`14493`)
+ 
+ 
+ xml.etree.ElementTree
+@@ -1695,6 +2128,18 @@
+ and a more detailed reference.
+ 
+ 
++zlib
++----
++
++New attribute :attr:`zlib.Decompress.eof` makes it possible to distinguish
++between a properly-formed compressed stream and an incomplete or truncated one.
++(Contributed by Nadeem Vawda in :issue:`12646`.)
++
++New attribute :attr:`zlib.ZLIB_RUNTIME_VERSION` reports the version string of
++the underlying ``zlib`` library that is loaded at runtime.  (Contributed by
++Torsten Landschoff in :issue:`12306`.)
++
++
+ Optimizations
+ =============
+ 
+@@ -1750,6 +2195,9 @@
+     * :c:macro:`PyUnicode_READ`, :c:macro:`PyUnicode_READ_CHAR`, :c:macro:`PyUnicode_WRITE`
+     * :c:macro:`PyUnicode_MAX_CHAR_VALUE`
+ 
++* :c:macro:`PyArg_ParseTuple` now accepts a :class:`bytearray` for the ``c``
++  format (:issue:`12380`).
++
+ 
+ 
+ Deprecated
+@@ -1763,17 +2211,21 @@
+ Windows 2000 and Windows platforms which set ``COMSPEC`` to ``command.com``
+ are no longer supported due to maintenance burden.
+ 
++OSF support, which was deprecated in 3.2, has been completely removed.
++
+ 
+ Deprecated Python modules, functions and methods
+ ------------------------------------------------
+ 
++* Passing a non-empty string to ``object.__format__()`` is deprecated, and
++  will produce a :exc:`TypeError` in Python 3.4 (:issue:`9856`).
+ * The ``unicode_internal`` codec has been deprecated because of the
+   :pep:`393`, use UTF-8, UTF-16 (``utf-16-le`` or ``utf-16-be``), or UTF-32
+   (``utf-32-le`` or ``utf-32-be``)
+ * :meth:`ftplib.FTP.nlst` and :meth:`ftplib.FTP.dir`: use
+   :meth:`ftplib.FTP.mlsd`
+ * :func:`platform.popen`: use the :mod:`subprocess` module. Check especially
+-  the :ref:`subprocess-replacements` section.
++  the :ref:`subprocess-replacements` section (:issue:`11377`).
+ * :issue:`13374`: The Windows bytes API has been deprecated in the :mod:`os`
+   module. Use Unicode filenames, instead of bytes filenames, to not depend on
+   the ANSI code page anymore and to support any filename.
+@@ -1792,6 +2244,15 @@
+   * :class:`abc.abstractstaticmethod` has been deprecated, use
+     :class:`staticmethod` with :func:`abc.abstractmethod` instead.
+ 
++* :mod:`importlib` package:
++
++  * :meth:`importlib.abc.SourceLoader.path_mtime` is now deprecated in favour of
++    :meth:`importlib.abc.SourceLoader.path_stats` as bytecode files now store
++    both the modification time and size of the source file the bytecode file was
++    compiled from.
++
++
++
+ 
+ 
+ Deprecated functions and types of the C API
+@@ -1803,58 +2264,58 @@
+ Unicode functions and methods using :c:type:`Py_UNICODE` and
+ :c:type:`Py_UNICODE*` types:
+ 
+- * :c:macro:`PyUnicode_FromUnicode`: use :c:func:`PyUnicode_FromWideChar` or
+-   :c:func:`PyUnicode_FromKindAndData`
+- * :c:macro:`PyUnicode_AS_UNICODE`, :c:func:`PyUnicode_AsUnicode`,
+-   :c:func:`PyUnicode_AsUnicodeAndSize`: use :c:func:`PyUnicode_AsWideCharString`
+- * :c:macro:`PyUnicode_AS_DATA`: use :c:macro:`PyUnicode_DATA` with
+-   :c:macro:`PyUnicode_READ` and :c:macro:`PyUnicode_WRITE`
+- * :c:macro:`PyUnicode_GET_SIZE`, :c:func:`PyUnicode_GetSize`: use
+-   :c:macro:`PyUnicode_GET_LENGTH` or :c:func:`PyUnicode_GetLength`
+- * :c:macro:`PyUnicode_GET_DATA_SIZE`: use
+-   ``PyUnicode_GET_LENGTH(str) * PyUnicode_KIND(str)`` (only work on ready
+-   strings)
+- * :c:func:`PyUnicode_AsUnicodeCopy`: use :c:func:`PyUnicode_AsUCS4Copy` or
+-   :c:func:`PyUnicode_AsWideCharString`
+- * :c:func:`PyUnicode_GetMax`
++* :c:macro:`PyUnicode_FromUnicode`: use :c:func:`PyUnicode_FromWideChar` or
++  :c:func:`PyUnicode_FromKindAndData`
++* :c:macro:`PyUnicode_AS_UNICODE`, :c:func:`PyUnicode_AsUnicode`,
++  :c:func:`PyUnicode_AsUnicodeAndSize`: use :c:func:`PyUnicode_AsWideCharString`
++* :c:macro:`PyUnicode_AS_DATA`: use :c:macro:`PyUnicode_DATA` with
++  :c:macro:`PyUnicode_READ` and :c:macro:`PyUnicode_WRITE`
++* :c:macro:`PyUnicode_GET_SIZE`, :c:func:`PyUnicode_GetSize`: use
++  :c:macro:`PyUnicode_GET_LENGTH` or :c:func:`PyUnicode_GetLength`
++* :c:macro:`PyUnicode_GET_DATA_SIZE`: use
++  ``PyUnicode_GET_LENGTH(str) * PyUnicode_KIND(str)`` (only work on ready
++  strings)
++* :c:func:`PyUnicode_AsUnicodeCopy`: use :c:func:`PyUnicode_AsUCS4Copy` or
++  :c:func:`PyUnicode_AsWideCharString`
++* :c:func:`PyUnicode_GetMax`
+ 
+ 
+ Functions and macros manipulating Py_UNICODE* strings:
+ 
+- * :c:macro:`Py_UNICODE_strlen`: use :c:func:`PyUnicode_GetLength` or
+-   :c:macro:`PyUnicode_GET_LENGTH`
+- * :c:macro:`Py_UNICODE_strcat`: use :c:func:`PyUnicode_CopyCharacters` or
+-   :c:func:`PyUnicode_FromFormat`
+- * :c:macro:`Py_UNICODE_strcpy`, :c:macro:`Py_UNICODE_strncpy`,
+-   :c:macro:`Py_UNICODE_COPY`: use :c:func:`PyUnicode_CopyCharacters` or
+-   :c:func:`PyUnicode_Substring`
+- * :c:macro:`Py_UNICODE_strcmp`: use :c:func:`PyUnicode_Compare`
+- * :c:macro:`Py_UNICODE_strncmp`: use :c:func:`PyUnicode_Tailmatch`
+- * :c:macro:`Py_UNICODE_strchr`, :c:macro:`Py_UNICODE_strrchr`: use
+-   :c:func:`PyUnicode_FindChar`
+- * :c:macro:`Py_UNICODE_FILL`: use :c:func:`PyUnicode_Fill`
+- * :c:macro:`Py_UNICODE_MATCH`
++* :c:macro:`Py_UNICODE_strlen`: use :c:func:`PyUnicode_GetLength` or
++  :c:macro:`PyUnicode_GET_LENGTH`
++* :c:macro:`Py_UNICODE_strcat`: use :c:func:`PyUnicode_CopyCharacters` or
++  :c:func:`PyUnicode_FromFormat`
++* :c:macro:`Py_UNICODE_strcpy`, :c:macro:`Py_UNICODE_strncpy`,
++  :c:macro:`Py_UNICODE_COPY`: use :c:func:`PyUnicode_CopyCharacters` or
++  :c:func:`PyUnicode_Substring`
++* :c:macro:`Py_UNICODE_strcmp`: use :c:func:`PyUnicode_Compare`
++* :c:macro:`Py_UNICODE_strncmp`: use :c:func:`PyUnicode_Tailmatch`
++* :c:macro:`Py_UNICODE_strchr`, :c:macro:`Py_UNICODE_strrchr`: use
++  :c:func:`PyUnicode_FindChar`
++* :c:macro:`Py_UNICODE_FILL`: use :c:func:`PyUnicode_Fill`
++* :c:macro:`Py_UNICODE_MATCH`
+ 
+ Encoders:
+ 
+- * :c:func:`PyUnicode_Encode`: use :c:func:`PyUnicode_AsEncodedObject`
+- * :c:func:`PyUnicode_EncodeUTF7`
+- * :c:func:`PyUnicode_EncodeUTF8`: use :c:func:`PyUnicode_AsUTF8` or
+-   :c:func:`PyUnicode_AsUTF8String`
+- * :c:func:`PyUnicode_EncodeUTF32`
+- * :c:func:`PyUnicode_EncodeUTF16`
+- * :c:func:`PyUnicode_EncodeUnicodeEscape:` use
+-   :c:func:`PyUnicode_AsUnicodeEscapeString`
+- * :c:func:`PyUnicode_EncodeRawUnicodeEscape:` use
+-   :c:func:`PyUnicode_AsRawUnicodeEscapeString`
+- * :c:func:`PyUnicode_EncodeLatin1`: use :c:func:`PyUnicode_AsLatin1String`
+- * :c:func:`PyUnicode_EncodeASCII`: use :c:func:`PyUnicode_AsASCIIString`
+- * :c:func:`PyUnicode_EncodeCharmap`
+- * :c:func:`PyUnicode_TranslateCharmap`
+- * :c:func:`PyUnicode_EncodeMBCS`: use :c:func:`PyUnicode_AsMBCSString` or
+-   :c:func:`PyUnicode_EncodeCodePage` (with ``CP_ACP`` code_page)
+- * :c:func:`PyUnicode_EncodeDecimal`,
+-   :c:func:`PyUnicode_TransformDecimalToASCII`
++* :c:func:`PyUnicode_Encode`: use :c:func:`PyUnicode_AsEncodedObject`
++* :c:func:`PyUnicode_EncodeUTF7`
++* :c:func:`PyUnicode_EncodeUTF8`: use :c:func:`PyUnicode_AsUTF8` or
++  :c:func:`PyUnicode_AsUTF8String`
++* :c:func:`PyUnicode_EncodeUTF32`
++* :c:func:`PyUnicode_EncodeUTF16`
++* :c:func:`PyUnicode_EncodeUnicodeEscape:` use
++  :c:func:`PyUnicode_AsUnicodeEscapeString`
++* :c:func:`PyUnicode_EncodeRawUnicodeEscape:` use
++  :c:func:`PyUnicode_AsRawUnicodeEscapeString`
++* :c:func:`PyUnicode_EncodeLatin1`: use :c:func:`PyUnicode_AsLatin1String`
++* :c:func:`PyUnicode_EncodeASCII`: use :c:func:`PyUnicode_AsASCIIString`
++* :c:func:`PyUnicode_EncodeCharmap`
++* :c:func:`PyUnicode_TranslateCharmap`
++* :c:func:`PyUnicode_EncodeMBCS`: use :c:func:`PyUnicode_AsMBCSString` or
++  :c:func:`PyUnicode_EncodeCodePage` (with ``CP_ACP`` code_page)
++* :c:func:`PyUnicode_EncodeDecimal`,
++  :c:func:`PyUnicode_TransformDecimalToASCII`
+ 
+ 
+ Deprecated features
+@@ -1900,7 +2361,7 @@
+   updated to use the full name of the module instead of just the tail of the
+   name.
+ 
+-* The **index** argument to :func:`__import__` now defaults to 0 instead of -1
++* The *index* argument to :func:`__import__` now defaults to 0 instead of -1
+   and no longer support negative values. It was an oversight when :pep:`328` was
+   implemented that the default value remained -1. If you need to continue to
+   perform a relative import followed by an absolute import, then perform the
+@@ -1923,11 +2384,6 @@
+   :attr:`sys.path_importer_cache` where it repesents the use of implicit
+   finders, but semantically it should not change anything.
+ 
+-* :meth:`importlib.abc.SourceLoader.path_mtime` is now deprecated in favour of
+-  :meth:`importlib.abc.SourceLoader.path_stats` as bytecode files now store
+-  both the modification time and size of the source file the bytecode file was
+-  compiled from.
+-
+ * :class:`importlib.abc.Finder` no longer specifies a `find_module()` abstract
+   method that must be implemented. If you were relying on subclasses to
+   implement that method, make sure to check for the method's existence first.
+@@ -1942,6 +2398,59 @@
+   special case the standard import hooks so they are still supported even
+   though they do not provide the non-standard ``iter_modules()`` method.
+ 
++* A longstanding RFC-compliance bug (:issue:`1079`) in the parsing done by
++  :func:`email.header.decode_header` has been fixed.  Code that uses the
++  standard idiom to convert encoded headers into unicode
++  (``str(make_header(decode_header(h))``) will see no change, but code that
++  looks at the individual tuples returned by decode_header will see that
++  whitespace that precedes or follows ``ASCII`` sections is now included in the
++  ``ASCII`` section.  Code that builds headers using ``make_header`` should
++  also continue to work without change, since ``make_header`` continues to add
++  whitespace between ``ASCII`` and non-``ASCII`` sections if it is not already
++  present in the input strings.
++
++* :func:`email.utils.formataddr` now does the correct content transfer
++  encoding when passed non-``ASCII`` display names.  Any code that depended on
++  the previous buggy behavior that preserved the non-``ASCII`` unicode in the
++  formatted output string will need to be changed (:issue:`1690608`).
++
++* :meth:`poplib.POP3.quit` may now raise protocol errors like all other
++  ``poplib`` methods.  Code that assumes ``quit`` does not raise
++  :exc:`poplib.error_proto` errors may need to be changed if errors on ``quit``
++  are encountered by a particular application (:issue:`11291`).
++
++* The ``strict`` argument to :class:`email.parser.Parser`, deprecated since
++  Python 2.4, has finally been removed.
++
++* The deprecated method ``unittest.TestCase.assertSameElements`` has been
++  removed.
++
++* The deprecated variable ``time.accept2dyear`` has been removed.
++
++* The deprecated ``Context._clamp`` attribute has been removed from the
++  :mod:`decimal` module.  It was previously replaced by the public attribute
++  :attr:`~decimal.Context.clamp`.  (See :issue:`8540`.)
++
++* The undocumented internal helper class ``SSLFakeFile`` has been removed
++  from :mod:`smtplib`, since its functionality has long been provided directly
++  by :meth:`socket.socket.makefile`.
++
++* Passing a negative value to :func:`time.sleep` on Windows now raises an
++  error instead of sleeping forever.  It has always raised an error on posix.
++
++* The ``ast.__version__`` constant has been removed.  If you need to
++  make decisions affected by the AST version, use :attr:`sys.version_info`
++  to make the decision.
++
++* Code that used to work around the fact that the :mod:`threading` module used
++  factory functions by subclassing the private classes will need to change to
++  subclass the now-public classes.
++
++* The undocumented debugging machinery in the threading module has been
++  removed, simplifying the code.  This should have no effect on production
++  code, but is mentioned here in case any application debug frameworks were
++  interacting with it (:issue:`13550`).
++
+ 
+ Porting C code
+ --------------
+@@ -1968,9 +2477,9 @@
+ 
+ * :c:func:`PyImport_GetMagicNumber` now returns -1 upon failure.
+ 
+-* As a negative value for the **level** argument to :func:`__import__` is no
++* As a negative value for the *level* argument to :func:`__import__` is no
+   longer valid, the same now holds for :c:func:`PyImport_ImportModuleLevel`.
+-  This also means that the value of **level** used by
++  This also means that the value of *level* used by
+   :c:func:`PyImport_ImportModuleEx` is now 0 instead of -1.
+ 
+ 
+@@ -1988,14 +2497,16 @@
+   (implemented in :issue:`14040`.)
+ 
+ 
+-Other issues
+-------------
+-
+-.. Issue #11591: When :program:`python` was started with :option:`-S`,
+-   ``import site`` will not add site-specific paths to the module search
+-   paths.  In previous versions, it did.  See changeset for doc changes in
+-   various files.  Contributed by Carl Meyer with editions by Éric Araujo.
+-
+-.. Issue #10998: the -Q command-line flag and related artifacts have been
+-   removed.  Code checking sys.flags.division_warning will need updating.
+-   Contributed by Éric Araujo.
++Command Line Switch Changes
++---------------------------
++
++* The -Q command-line flag and related artifacts have been removed.  Code
++  checking sys.flags.division_warning will need updating.
++
++  (:issue:`10998`, contributed by Éric Araujo.)
++
++* When :program:`python` is started with :option:`-S`, ``import site``
++  will no longer add site-specific paths to the module search paths.  In
++  previous versions, it did.
++
++  (:issue:`11591`, contributed by Carl Meyer with editions by Éric Araujo.)
+diff -r bd8afb90ebf2 Doc/whatsnew/changelog.rst
+--- /dev/null
++++ b/Doc/whatsnew/changelog.rst
+@@ -0,0 +1,6 @@
+++++++++++
++Changelog
+++++++++++
++
++.. miscnews:: ../../Misc/NEWS
++
+diff -r bd8afb90ebf2 Doc/whatsnew/index.rst
+--- a/Doc/whatsnew/index.rst
++++ b/Doc/whatsnew/index.rst
+@@ -23,3 +23,11 @@
+    2.2.rst
+    2.1.rst
+    2.0.rst
++
++The "Changelog" is a HTML version of the file :source:`Misc/NEWS` which
++contains *all* nontrivial changes to Python for the current version.
++
++.. toctree::
++   :maxdepth: 2
++
++   changelog.rst
+diff -r bd8afb90ebf2 Include/frameobject.h
+--- a/Include/frameobject.h
++++ b/Include/frameobject.h
+@@ -33,8 +33,8 @@
+            frame (which shouldn't be impacted when the generator "yields"
+            from an except handler).
+            These three fields exist exactly for that, and are unused for
+-           non-generator frames. See the SAVE_EXC_STATE and SWAP_EXC_STATE
+-           macros in ceval.c for details of their use. */
++           non-generator frames. See the save_exc_state and swap_exc_state
++           functions in ceval.c for details of their use. */
+     PyObject *f_exc_type, *f_exc_value, *f_exc_traceback;
+ 
+     PyThreadState *f_tstate;
+diff -r bd8afb90ebf2 Include/longobject.h
+--- a/Include/longobject.h
++++ b/Include/longobject.h
+@@ -26,6 +26,9 @@
+ PyAPI_FUNC(size_t) PyLong_AsSize_t(PyObject *);
+ PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
+ PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
++#ifndef Py_LIMITED_API
++PyAPI_FUNC(int) _PyLong_AsInt(PyObject *);
++#endif
+ PyAPI_FUNC(PyObject *) PyLong_GetInfo(void);
+ 
+ /* It may be useful in the future. I've added it in the PyInt -> PyLong
+diff -r bd8afb90ebf2 Include/object.h
+--- a/Include/object.h
++++ b/Include/object.h
+@@ -962,7 +962,7 @@
+ */
+ 
+ /* This is the old private API, invoked by the macros before 3.2.4.
+-   Kept for binary compatibility of extensions. */
++   Kept for binary compatibility of extensions using the stable ABI. */
+ PyAPI_FUNC(void) _PyTrash_deposit_object(PyObject*);
+ PyAPI_FUNC(void) _PyTrash_destroy_chain(void);
+ PyAPI_DATA(int) _PyTrash_delete_nesting;
+diff -r bd8afb90ebf2 Include/objimpl.h
+--- a/Include/objimpl.h
++++ b/Include/objimpl.h
+@@ -181,12 +181,9 @@
+ #endif
+ 
+ #define _PyObject_VAR_SIZE(typeobj, nitems)     \
+-    (size_t)                                    \
+-    ( ( (typeobj)->tp_basicsize +               \
+-        (nitems)*(typeobj)->tp_itemsize +       \
+-        (SIZEOF_VOID_P - 1)                     \
+-      ) & ~(SIZEOF_VOID_P - 1)                  \
+-    )
++    _Py_SIZE_ROUND_UP((typeobj)->tp_basicsize + \
++        (nitems)*(typeobj)->tp_itemsize,        \
++        SIZEOF_VOID_P)
+ 
+ #define PyObject_NEW(type, typeobj) \
+ ( (type *) PyObject_Init( \
+diff -r bd8afb90ebf2 Include/osdefs.h
+--- a/Include/osdefs.h
++++ b/Include/osdefs.h
+@@ -29,6 +29,14 @@
+ #endif
+ 
+ /* Max pathname length */
++#ifdef __hpux
++#include <sys/param.h>
++#include <limits.h>
++#ifndef PATH_MAX
++#define PATH_MAX MAXPATHLEN
++#endif
++#endif
++
+ #ifndef MAXPATHLEN
+ #if defined(PATH_MAX) && PATH_MAX > 1024
+ #define MAXPATHLEN PATH_MAX
+diff -r bd8afb90ebf2 Include/pyfpe.h
+--- a/Include/pyfpe.h
++++ b/Include/pyfpe.h
+@@ -4,8 +4,8 @@
+ extern "C" {
+ #endif
+ /*
+-     ---------------------------------------------------------------------  
+-    /                       Copyright (c) 1996.                           \ 
++     ---------------------------------------------------------------------
++    /                       Copyright (c) 1996.                           \
+    |          The Regents of the University of California.                 |
+    |                        All rights reserved.                           |
+    |                                                                       |
+@@ -37,8 +37,8 @@
+    |   opinions  of authors expressed herein do not necessarily state or   |
+    |   reflect those of the United States Government or  the  University   |
+    |   of  California,  and shall not be used for advertising or product   |
+-    \  endorsement purposes.                                              / 
+-     ---------------------------------------------------------------------  
++    \  endorsement purposes.                                              /
++     ---------------------------------------------------------------------
+ */
+ 
+ /*
+diff -r bd8afb90ebf2 Include/pymacro.h
+--- a/Include/pymacro.h
++++ b/Include/pymacro.h
+@@ -29,8 +29,11 @@
+    parameters. With correct compiler support, such usage will cause a build
+    error (see Py_BUILD_ASSERT_EXPR).
+ 
+-   Written by Rusty Russell, public domain, http://ccodearchive.net/ */
+-#if (defined(__GNUC__) && !defined(__STRICT_ANSI__))
++   Written by Rusty Russell, public domain, http://ccodearchive.net/
++
++   Requires at GCC 3.1+ */
++#if (defined(__GNUC__) && !defined(__STRICT_ANSI__) && \
++    ((__GNUC__ == 3) && (__GNU_MINOR__ >= 1)) || (__GNUC__ >= 4))
+ /* Two gcc extensions.
+    &a[0] degrades to a pointer: a different type from an array */
+ #define Py_ARRAY_LENGTH(array) \
+@@ -52,4 +55,18 @@
+ #define PyDoc_STR(str) ""
+ #endif
+ 
++/* Below "a" is a power of 2. */
++/* Round down size "n" to be a multiple of "a". */
++#define _Py_SIZE_ROUND_DOWN(n, a) ((size_t)(n) & ~(size_t)((a) - 1))
++/* Round up size "n" to be a multiple of "a". */
++#define _Py_SIZE_ROUND_UP(n, a) (((size_t)(n) + \
++        (size_t)((a) - 1)) & ~(size_t)((a) - 1))
++/* Round pointer "p" down to the closest "a"-aligned address <= "p". */
++#define _Py_ALIGN_DOWN(p, a) ((void *)((Py_uintptr_t)(p) & ~(Py_uintptr_t)((a) - 1)))
++/* Round pointer "p" up to the closest "a"-aligned address >= "p". */
++#define _Py_ALIGN_UP(p, a) ((void *)(((Py_uintptr_t)(p) + \
++        (Py_uintptr_t)((a) - 1)) & ~(Py_uintptr_t)((a) - 1)))
++/* Check if pointer "p" is aligned to "a"-bytes boundary. */
++#define _Py_IS_ALIGNED(p, a) (!((Py_uintptr_t)(p) & (Py_uintptr_t)((a) - 1)))
++
+ #endif /* Py_PYMACRO_H */
+diff -r bd8afb90ebf2 Include/pyport.h
+--- a/Include/pyport.h
++++ b/Include/pyport.h
+@@ -87,9 +87,12 @@
+  * uint32_t to be such a type unless stdint.h or inttypes.h defines uint32_t.
+  * However, it doesn't set HAVE_UINT32_T, so we do that here.
+  */
+-#if (defined UINT32_MAX || defined uint32_t)
++#ifdef uint32_t
++#define HAVE_UINT32_T 1
++#endif
++
++#ifdef HAVE_UINT32_T
+ #ifndef PY_UINT32_T
+-#define HAVE_UINT32_T 1
+ #define PY_UINT32_T uint32_t
+ #endif
+ #endif
+@@ -97,23 +100,33 @@
+ /* Macros for a 64-bit unsigned integer type; used for type 'twodigits' in the
+  * long integer implementation, when 30-bit digits are enabled.
+  */
+-#if (defined UINT64_MAX || defined uint64_t)
++#ifdef uint64_t
++#define HAVE_UINT64_T 1
++#endif
++
++#ifdef HAVE_UINT64_T
+ #ifndef PY_UINT64_T
+-#define HAVE_UINT64_T 1
+ #define PY_UINT64_T uint64_t
+ #endif
+ #endif
+ 
+ /* Signed variants of the above */
+-#if (defined INT32_MAX || defined int32_t)
++#ifdef int32_t
++#define HAVE_INT32_T 1
++#endif
++
++#ifdef HAVE_INT32_T
+ #ifndef PY_INT32_T
+-#define HAVE_INT32_T 1
+ #define PY_INT32_T int32_t
+ #endif
+ #endif
+-#if (defined INT64_MAX || defined int64_t)
++
++#ifdef int64_t
++#define HAVE_INT64_T 1
++#endif
++
++#ifdef HAVE_INT64_T
+ #ifndef PY_INT64_T
+-#define HAVE_INT64_T 1
+ #define PY_INT64_T int64_t
+ #endif
+ #endif
+@@ -132,7 +145,7 @@
+ #endif
+ 
+ /* Prime multiplier used in string and various other hashes. */
+-#define _PyHASH_MULTIPLIER 1000003  /* 0xf4243 */
++#define _PyHASH_MULTIPLIER 1000003UL  /* 0xf4243 */
+ 
+ /* Parameters used for the numeric hash implementation.  See notes for
+    _Py_HashDouble in Objects/object.c.  Numeric hashes are based on
+@@ -649,7 +662,7 @@
+ /* On QNX 6, struct termio must be declared by including sys/termio.h
+    if TCGETA, TCSETA, TCSETAW, or TCSETAF are used.  sys/termio.h must
+    be included before termios.h or it will generate an error. */
+-#ifdef HAVE_SYS_TERMIO_H
++#if defined(HAVE_SYS_TERMIO_H) && !defined(__hpux)
+ #include <sys/termio.h>
+ #endif
+ 
+diff -r bd8afb90ebf2 Include/symtable.h
+--- a/Include/symtable.h
++++ b/Include/symtable.h
+@@ -30,6 +30,8 @@
+     PyObject *st_private;           /* name of current class or NULL */
+     PyFutureFeatures *st_future;    /* module's future features that affect
+                                        the symbol table */
++    int recursion_depth;            /* current recursion depth */
++    int recursion_limit;            /* recursion limit */
+ };
+ 
+ typedef struct _symtable_entry {
+diff -r bd8afb90ebf2 Include/sysmodule.h
+--- a/Include/sysmodule.h
++++ b/Include/sysmodule.h
+@@ -20,10 +20,6 @@
+ PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...);
+ PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...);
+ 
+-#ifndef Py_LIMITED_API
+-PyAPI_DATA(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc;
+-#endif
+-
+ PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
+ PyAPI_FUNC(void) PySys_AddWarnOption(const wchar_t *);
+ PyAPI_FUNC(void) PySys_AddWarnOptionUnicode(PyObject *);
+diff -r bd8afb90ebf2 Include/unicodeobject.h
+--- a/Include/unicodeobject.h
++++ b/Include/unicodeobject.h
+@@ -1022,8 +1022,7 @@
+ 
+ /* Create a Unicode Object from the given Unicode code point ordinal.
+ 
+-   The ordinal must be in range(0x10000) on narrow Python builds
+-   (UCS2), and range(0x110000) on wide builds (UCS4). A ValueError is
++   The ordinal must be in range(0x110000). A ValueError is
+    raised in case it is not.
+ 
+ */
+diff -r bd8afb90ebf2 Include/weakrefobject.h
+--- a/Include/weakrefobject.h
++++ b/Include/weakrefobject.h
+@@ -70,7 +70,17 @@
+ PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self);
+ #endif
+ 
+-#define PyWeakref_GET_OBJECT(ref) (((PyWeakReference *)(ref))->wr_object)
++/* Explanation for the Py_REFCNT() check: when a weakref's target is part
++   of a long chain of deallocations which triggers the trashcan mechanism,
++   clearing the weakrefs can be delayed long after the target's refcount
++   has dropped to zero.  In the meantime, code accessing the weakref will
++   be able to "see" the target object even though it is supposed to be
++   unreachable.  See issue #16602. */
++
++#define PyWeakref_GET_OBJECT(ref)                           \
++    (Py_REFCNT(((PyWeakReference *)(ref))->wr_object) > 0   \
++     ? ((PyWeakReference *)(ref))->wr_object                \
++     : Py_None)
+ 
+ 
+ #ifdef __cplusplus
+diff -r bd8afb90ebf2 LICENSE
+--- a/LICENSE
++++ b/LICENSE
+@@ -110,8 +110,8 @@
+ distribute, and otherwise use Python alone or in any derivative version,
+ provided, however, that PSF's License Agreement and PSF's notice of copyright,
+ i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+-2011, 2012 Python Software Foundation; All Rights Reserved" are retained in Python
+-alone or in any derivative version prepared by Licensee.
++2011, 2012, 2013 Python Software Foundation; All Rights Reserved" are retained
++in Python alone or in any derivative version prepared by Licensee.
+ 
+ 3. In the event Licensee prepares a derivative work that is based on
+ or incorporates Python or any part thereof, and wants to make
+diff -r bd8afb90ebf2 Lib/_pyio.py
+--- a/Lib/_pyio.py
++++ b/Lib/_pyio.py
+@@ -346,8 +346,10 @@
+         This method has no effect if the file is already closed.
+         """
+         if not self.__closed:
+-            self.flush()
+-            self.__closed = True
++            try:
++                self.flush()
++            finally:
++                self.__closed = True
+ 
+     def __del__(self):
+         """Destructor.  Calls close()."""
+@@ -895,12 +897,18 @@
+         return pos
+ 
+     def readable(self):
++        if self.closed:
++            raise ValueError("I/O operation on closed file.")
+         return True
+ 
+     def writable(self):
++        if self.closed:
++            raise ValueError("I/O operation on closed file.")
+         return True
+ 
+     def seekable(self):
++        if self.closed:
++            raise ValueError("I/O operation on closed file.")
+         return True
+ 
+ 
+@@ -1562,6 +1570,8 @@
+         return self._buffer
+ 
+     def seekable(self):
++        if self.closed:
++            raise ValueError("I/O operation on closed file.")
+         return self._seekable
+ 
+     def readable(self):
+@@ -1576,8 +1586,10 @@
+ 
+     def close(self):
+         if self.buffer is not None and not self.closed:
+-            self.flush()
+-            self.buffer.close()
++            try:
++                self.flush()
++            finally:
++                self.buffer.close()
+ 
+     @property
+     def closed(self):
+diff -r bd8afb90ebf2 Lib/aifc.py
+--- a/Lib/aifc.py
++++ b/Lib/aifc.py
+@@ -692,7 +692,9 @@
+             self._patchheader()
+ 
+     def close(self):
+-        if self._file:
++        if self._file is None:
++            return
++        try:
+             self._ensure_header_written(0)
+             if self._datawritten & 1:
+                 # quick pad to even size
+@@ -703,10 +705,12 @@
+                   self._datalength != self._datawritten or \
+                   self._marklength:
+                 self._patchheader()
++        finally:
+             # Prevent ref cycles
+             self._convert = None
+-            self._file.close()
++            f = self._file
+             self._file = None
++            f.close()
+ 
+     #
+     # Internal methods.
+diff -r bd8afb90ebf2 Lib/argparse.py
+--- a/Lib/argparse.py
++++ b/Lib/argparse.py
+@@ -1725,10 +1725,7 @@
+             if action.dest is not SUPPRESS:
+                 if not hasattr(namespace, action.dest):
+                     if action.default is not SUPPRESS:
+-                        default = action.default
+-                        if isinstance(action.default, str):
+-                            default = self._get_value(action, default)
+-                        setattr(namespace, action.dest, default)
++                        setattr(namespace, action.dest, action.default)
+ 
+         # add any parser defaults that aren't present
+         for dest in self._defaults:
+@@ -1951,9 +1948,25 @@
+         # if we didn't consume all the argument strings, there were extras
+         extras.extend(arg_strings[stop_index:])
+ 
+-        # make sure all required actions were present
+-        required_actions = [_get_action_name(action) for action in self._actions
+-                            if action.required and action not in seen_actions]
++        # make sure all required actions were present and also convert
++        # action defaults which were not given as arguments
++        required_actions = []
++        for action in self._actions:
++            if action not in seen_actions:
++                if action.required:
++                    required_actions.append(_get_action_name(action))
++                else:
++                    # Convert action default now instead of doing it before
++                    # parsing arguments to avoid calling convert functions
++                    # twice (which may fail) if the argument was given, but
++                    # only if it was defined already in the namespace
++                    if (action.default is not None and
++                        isinstance(action.default, str) and
++                        hasattr(namespace, action.dest) and
++                        action.default is getattr(namespace, action.dest)):
++                        setattr(namespace, action.dest,
++                                self._get_value(action, action.default))
++
+         if required_actions:
+             self.error(_('the following arguments are required: %s') %
+                        ', '.join(required_actions))
+diff -r bd8afb90ebf2 Lib/asyncore.py
+--- a/Lib/asyncore.py
++++ b/Lib/asyncore.py
+@@ -385,7 +385,7 @@
+             else:
+                 return data
+         except socket.error as why:
+-            # winsock sometimes throws ENOTCONN
++            # winsock sometimes raises ENOTCONN
+             if why.args[0] in _DISCONNECTED:
+                 self.handle_close()
+                 return b''
+diff -r bd8afb90ebf2 Lib/bz2.py
+--- a/Lib/bz2.py
++++ b/Lib/bz2.py
+@@ -79,7 +79,8 @@
+             mode = "rb"
+             mode_code = _MODE_READ
+             self._decompressor = BZ2Decompressor()
+-            self._buffer = None
++            self._buffer = b""
++            self._buffer_offset = 0
+         elif mode in ("w", "wb"):
+             mode = "wb"
+             mode_code = _MODE_WRITE
+@@ -124,7 +125,8 @@
+                     self._fp = None
+                     self._closefp = False
+                     self._mode = _MODE_CLOSED
+-                    self._buffer = None
++                    self._buffer = b""
++                    self._buffer_offset = 0
+ 
+     @property
+     def closed(self):
+@@ -157,15 +159,18 @@
+             raise ValueError("I/O operation on closed file")
+ 
+     def _check_can_read(self):
+-        if not self.readable():
++        if self._mode not in (_MODE_READ, _MODE_READ_EOF):
++            self._check_not_closed()
+             raise io.UnsupportedOperation("File not open for reading")
+ 
+     def _check_can_write(self):
+-        if not self.writable():
++        if self._mode != _MODE_WRITE:
++            self._check_not_closed()
+             raise io.UnsupportedOperation("File not open for writing")
+ 
+     def _check_can_seek(self):
+-        if not self.readable():
++        if self._mode not in (_MODE_READ, _MODE_READ_EOF):
++            self._check_not_closed()
+             raise io.UnsupportedOperation("Seeking is only supported "
+                                           "on files open for reading")
+         if not self._fp.seekable():
+@@ -174,16 +179,13 @@
+ 
+     # Fill the readahead buffer if it is empty. Returns False on EOF.
+     def _fill_buffer(self):
++        if self._mode == _MODE_READ_EOF:
++            return False
+         # Depending on the input data, our call to the decompressor may not
+         # return any data. In this case, try again after reading another block.
+-        while True:
+-            if self._buffer:
+-                return True
+-
+-            if self._decompressor.unused_data:
+-                rawblock = self._decompressor.unused_data
+-            else:
+-                rawblock = self._fp.read(_BUFFER_SIZE)
++        while self._buffer_offset == len(self._buffer):
++            rawblock = (self._decompressor.unused_data or
++                        self._fp.read(_BUFFER_SIZE))
+ 
+             if not rawblock:
+                 if self._decompressor.eof:
+@@ -199,30 +201,48 @@
+                 self._decompressor = BZ2Decompressor()
+ 
+             self._buffer = self._decompressor.decompress(rawblock)
++            self._buffer_offset = 0
++        return True
+ 
+     # Read data until EOF.
+     # If return_data is false, consume the data without returning it.
+     def _read_all(self, return_data=True):
++        # The loop assumes that _buffer_offset is 0. Ensure that this is true.
++        self._buffer = self._buffer[self._buffer_offset:]
++        self._buffer_offset = 0
++
+         blocks = []
+         while self._fill_buffer():
+             if return_data:
+                 blocks.append(self._buffer)
+             self._pos += len(self._buffer)
+-            self._buffer = None
++            self._buffer = b""
+         if return_data:
+             return b"".join(blocks)
+ 
+     # Read a block of up to n bytes.
+     # If return_data is false, consume the data without returning it.
+     def _read_block(self, n, return_data=True):
++        # If we have enough data buffered, return immediately.
++        end = self._buffer_offset + n
++        if end <= len(self._buffer):
++            data = self._buffer[self._buffer_offset : end]
++            self._buffer_offset = end
++            self._pos += len(data)
++            return data if return_data else None
++
++        # The loop assumes that _buffer_offset is 0. Ensure that this is true.
++        self._buffer = self._buffer[self._buffer_offset:]
++        self._buffer_offset = 0
++
+         blocks = []
+         while n > 0 and self._fill_buffer():
+             if n < len(self._buffer):
+                 data = self._buffer[:n]
+-                self._buffer = self._buffer[n:]
++                self._buffer_offset = n
+             else:
+                 data = self._buffer
+-                self._buffer = None
++                self._buffer = b""
+             if return_data:
+                 blocks.append(data)
+             self._pos += len(data)
+@@ -238,9 +258,9 @@
+         """
+         with self._lock:
+             self._check_can_read()
+-            if self._mode == _MODE_READ_EOF or not self._fill_buffer():
++            if not self._fill_buffer():
+                 return b""
+-            return self._buffer
++            return self._buffer[self._buffer_offset:]
+ 
+     def read(self, size=-1):
+         """Read up to size uncompressed bytes from the file.
+@@ -250,7 +270,7 @@
+         """
+         with self._lock:
+             self._check_can_read()
+-            if self._mode == _MODE_READ_EOF or size == 0:
++            if size == 0:
+                 return b""
+             elif size < 0:
+                 return self._read_all()
+@@ -268,15 +288,19 @@
+         # In this case we make multiple reads, to avoid returning b"".
+         with self._lock:
+             self._check_can_read()
+-            if (size == 0 or self._mode == _MODE_READ_EOF or
+-                not self._fill_buffer()):
++            if (size == 0 or
++                # Only call _fill_buffer() if the buffer is actually empty.
++                # This gives a significant speedup if *size* is small.
++                (self._buffer_offset == len(self._buffer) and not self._fill_buffer())):
+                 return b""
+-            if 0 < size < len(self._buffer):
+-                data = self._buffer[:size]
+-                self._buffer = self._buffer[size:]
++            if size > 0:
++                data = self._buffer[self._buffer_offset :
++                                    self._buffer_offset + size]
++                self._buffer_offset += len(data)
+             else:
+-                data = self._buffer
+-                self._buffer = None
++                data = self._buffer[self._buffer_offset:]
++                self._buffer = b""
++                self._buffer_offset = 0
+             self._pos += len(data)
+             return data
+ 
+@@ -295,10 +319,20 @@
+         non-negative, no more than size bytes will be read (in which
+         case the line may be incomplete). Returns b'' if already at EOF.
+         """
+-        if not hasattr(size, "__index__"):
+-            raise TypeError("Integer argument expected")
+-        size = size.__index__()
++        if not isinstance(size, int):
++            if not hasattr(size, "__index__"):
++                raise TypeError("Integer argument expected")
++            size = size.__index__()
+         with self._lock:
++            self._check_can_read()
++            # Shortcut for the common case - the whole line is in the buffer.
++            if size < 0:
++                end = self._buffer.find(b"\n", self._buffer_offset) + 1
++                if end > 0:
++                    line = self._buffer[self._buffer_offset : end]
++                    self._buffer_offset = end
++                    self._pos += len(line)
++                    return line
+             return io.BufferedIOBase.readline(self, size)
+ 
+     def readlines(self, size=-1):
+@@ -308,9 +342,10 @@
+         further lines will be read once the total size of the lines read
+         so far equals or exceeds size.
+         """
+-        if not hasattr(size, "__index__"):
+-            raise TypeError("Integer argument expected")
+-        size = size.__index__()
++        if not isinstance(size, int):
++            if not hasattr(size, "__index__"):
++                raise TypeError("Integer argument expected")
++            size = size.__index__()
+         with self._lock:
+             return io.BufferedIOBase.readlines(self, size)
+ 
+@@ -345,7 +380,8 @@
+         self._mode = _MODE_READ
+         self._pos = 0
+         self._decompressor = BZ2Decompressor()
+-        self._buffer = None
++        self._buffer = b""
++        self._buffer_offset = 0
+ 
+     def seek(self, offset, whence=0):
+         """Change the file position.
+@@ -385,8 +421,7 @@
+                 offset -= self._pos
+ 
+             # Read and discard data until we reach the desired position.
+-            if self._mode != _MODE_READ_EOF:
+-                self._read_block(offset, return_data=False)
++            self._read_block(offset, return_data=False)
+ 
+             return self._pos
+ 
+diff -r bd8afb90ebf2 Lib/calendar.py
+--- a/Lib/calendar.py
++++ b/Lib/calendar.py
+@@ -161,7 +161,11 @@
+         oneday = datetime.timedelta(days=1)
+         while True:
+             yield date
+-            date += oneday
++            try:
++                date += oneday
++            except OverflowError:
++                # Adding one day could fail after datetime.MAXYEAR
++                break
+             if date.month != month and date.weekday() == self.firstweekday:
+                 break
+ 
+diff -r bd8afb90ebf2 Lib/cgi.py
+--- a/Lib/cgi.py
++++ b/Lib/cgi.py
+@@ -223,17 +223,17 @@
+     """
+     import http.client
+ 
+-    boundary = ""
++    boundary = b""
+     if 'boundary' in pdict:
+         boundary = pdict['boundary']
+     if not valid_boundary(boundary):
+         raise ValueError('Invalid boundary in multipart form: %r'
+                             % (boundary,))
+ 
+-    nextpart = "--" + boundary
+-    lastpart = "--" + boundary + "--"
++    nextpart = b"--" + boundary
++    lastpart = b"--" + boundary + b"--"
+     partdict = {}
+-    terminator = ""
++    terminator = b""
+ 
+     while terminator != lastpart:
+         bytes = -1
+@@ -252,7 +252,7 @@
+                     raise ValueError('Maximum content length exceeded')
+                 data = fp.read(bytes)
+             else:
+-                data = ""
++                data = b""
+         # Read lines until end of part.
+         lines = []
+         while 1:
+@@ -260,7 +260,7 @@
+             if not line:
+                 terminator = lastpart # End outer loop
+                 break
+-            if line.startswith("--"):
++            if line.startswith(b"--"):
+                 terminator = line.rstrip()
+                 if terminator in (nextpart, lastpart):
+                     break
+@@ -272,12 +272,12 @@
+             if lines:
+                 # Strip final line terminator
+                 line = lines[-1]
+-                if line[-2:] == "\r\n":
++                if line[-2:] == b"\r\n":
+                     line = line[:-2]
+-                elif line[-1:] == "\n":
++                elif line[-1:] == b"\n":
+                     line = line[:-1]
+                 lines[-1] = line
+-                data = "".join(lines)
++                data = b"".join(lines)
+         line = headers['content-disposition']
+         if not line:
+             continue
+diff -r bd8afb90ebf2 Lib/cgitb.py
+--- a/Lib/cgitb.py
++++ b/Lib/cgitb.py
+@@ -292,14 +292,19 @@
+         if self.logdir is not None:
+             suffix = ['.txt', '.html'][self.format=="html"]
+             (fd, path) = tempfile.mkstemp(suffix=suffix, dir=self.logdir)
++
+             try:
+                 file = os.fdopen(fd, 'w')
+                 file.write(doc)
+                 file.close()
+-                msg = '<p> %s contains the description of this error.' % path
++                msg = '%s contains the description of this error.' % path
+             except:
+-                msg = '<p> Tried to save traceback to %s, but failed.' % path
+-            self.file.write(msg + '\n')
++                msg = 'Tried to save traceback to %s, but failed.' % path
++
++            if self.format == 'html':
++                self.file.write('<p>%s</p>\n' % msg)
++            else:
++                self.file.write(msg + '\n')
+         try:
+             self.file.flush()
+         except: pass
+diff -r bd8afb90ebf2 Lib/codecs.py
+--- a/Lib/codecs.py
++++ b/Lib/codecs.py
+@@ -461,7 +461,7 @@
+ 
+         # read until we get the required number of characters (if available)
+         while True:
+-            # can the request can be satisfied from the character buffer?
++            # can the request be satisfied from the character buffer?
+             if chars < 0:
+                 if size < 0:
+                     if self.charbuffer:
+diff -r bd8afb90ebf2 Lib/collections/abc.py
+--- a/Lib/collections/abc.py
++++ b/Lib/collections/abc.py
+@@ -200,12 +200,12 @@
+     def __gt__(self, other):
+         if not isinstance(other, Set):
+             return NotImplemented
+-        return other < self
++        return other.__lt__(self)
+ 
+     def __ge__(self, other):
+         if not isinstance(other, Set):
+             return NotImplemented
+-        return other <= self
++        return other.__le__(self)
+ 
+     def __eq__(self, other):
+         if not isinstance(other, Set):
+diff -r bd8afb90ebf2 Lib/concurrent/futures/_base.py
+--- a/Lib/concurrent/futures/_base.py
++++ b/Lib/concurrent/futures/_base.py
+@@ -332,7 +332,7 @@
+         return True
+ 
+     def cancelled(self):
+-        """Return True if the future has cancelled."""
++        """Return True if the future was cancelled."""
+         with self._condition:
+             return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]
+ 
+diff -r bd8afb90ebf2 Lib/configparser.py
+--- a/Lib/configparser.py
++++ b/Lib/configparser.py
+@@ -99,10 +99,9 @@
+         yes, on for True).  Returns False or True.
+ 
+     items(section=_UNSET, raw=False, vars=None)
+-        If section is given, return a list of tuples with (section_name,
+-        section_proxy) for each section, including DEFAULTSECT. Otherwise,
+-        return a list of tuples with (name, value) for each option
+-        in the section.
++        If section is given, return a list of tuples with (name, value) for
++        each option in the section. Otherwise, return a list of tuples with
++        (section_name, section_proxy) for each section, including DEFAULTSECT.
+ 
+     remove_section(section)
+         Remove the given file section and all its options.
+@@ -853,6 +852,19 @@
+             value_getter = lambda option: d[option]
+         return [(option, value_getter(option)) for option in d.keys()]
+ 
++    def popitem(self):
++        """Remove a section from the parser and return it as
++        a (section_name, section_proxy) tuple. If no section is present, raise
++        KeyError.
++
++        The section DEFAULT is never returned because it cannot be removed.
++        """
++        for key in self.sections():
++            value = self[key]
++            del self[key]
++            return key, value
++        raise KeyError
++
+     def optionxform(self, optionstr):
+         return optionstr.lower()
+ 
+@@ -948,7 +960,10 @@
+ 
+         # XXX this is not atomic if read_dict fails at any point. Then again,
+         # no update method in configparser is atomic in this implementation.
+-        self.remove_section(key)
++        if key == self.default_section:
++            self._defaults.clear()
++        elif key in self._sections:
++            self._sections[key].clear()
+         self.read_dict({key: value})
+ 
+     def __delitem__(self, key):
+diff -r bd8afb90ebf2 Lib/contextlib.py
+--- a/Lib/contextlib.py
++++ b/Lib/contextlib.py
+@@ -151,7 +151,7 @@
+             files = [stack.enter_context(open(fname)) for fname in filenames]
+             # All opened files will automatically be closed at the end of
+             # the with statement, even if attempts to open files later
+-            # in the list throw an exception
++            # in the list raise an exception
+ 
+     """
+     def __init__(self):
+diff -r bd8afb90ebf2 Lib/ctypes/__init__.py
+--- a/Lib/ctypes/__init__.py
++++ b/Lib/ctypes/__init__.py
+@@ -456,7 +456,7 @@
+             code = GetLastError()
+         if descr is None:
+             descr = FormatError(code).strip()
+-        return WindowsError(code, descr)
++        return WindowsError(None, descr, None, code)
+ 
+ if sizeof(c_uint) == sizeof(c_void_p):
+     c_size_t = c_uint
+diff -r bd8afb90ebf2 Lib/ctypes/test/test_returnfuncptrs.py
+--- a/Lib/ctypes/test/test_returnfuncptrs.py
++++ b/Lib/ctypes/test/test_returnfuncptrs.py
+@@ -1,5 +1,6 @@
+ import unittest
+ from ctypes import *
++import os
+ 
+ import _ctypes_test
+ 
+@@ -33,5 +34,34 @@
+         self.assertRaises(ArgumentError, strchr, b"abcdef", 3.0)
+         self.assertRaises(TypeError, strchr, b"abcdef")
+ 
++    def test_from_dll(self):
++        dll = CDLL(_ctypes_test.__file__)
++        # _CFuncPtr instances are now callable with a tuple argument
++        # which denotes a function name and a dll:
++        strchr = CFUNCTYPE(c_char_p, c_char_p, c_char)(("my_strchr", dll))
++        self.assertTrue(strchr(b"abcdef", b"b"), "bcdef")
++        self.assertEqual(strchr(b"abcdef", b"x"), None)
++        self.assertRaises(ArgumentError, strchr, b"abcdef", 3.0)
++        self.assertRaises(TypeError, strchr, b"abcdef")
++
++    # Issue 6083: Reference counting bug
++    def test_from_dll_refcount(self):
++        class BadSequence(tuple):
++            def __getitem__(self, key):
++                if key == 0:
++                    return "my_strchr"
++                if key == 1:
++                    return CDLL(_ctypes_test.__file__)
++                raise IndexError
++
++        # _CFuncPtr instances are now callable with a tuple argument
++        # which denotes a function name and a dll:
++        strchr = CFUNCTYPE(c_char_p, c_char_p, c_char)(
++                BadSequence(("my_strchr", CDLL(_ctypes_test.__file__))))
++        self.assertTrue(strchr(b"abcdef", b"b"), "bcdef")
++        self.assertEqual(strchr(b"abcdef", b"x"), None)
++        self.assertRaises(ArgumentError, strchr, b"abcdef", 3.0)
++        self.assertRaises(TypeError, strchr, b"abcdef")
++
+ if __name__ == "__main__":
+     unittest.main()
+diff -r bd8afb90ebf2 Lib/ctypes/test/test_structures.py
+--- a/Lib/ctypes/test/test_structures.py
++++ b/Lib/ctypes/test/test_structures.py
+@@ -1,6 +1,7 @@
+ import unittest
+ from ctypes import *
+ from struct import calcsize
++import _testcapi
+ 
+ class SubclassesTest(unittest.TestCase):
+     def test_subclass(self):
+@@ -199,6 +200,14 @@
+              "_pack_": -1}
+         self.assertRaises(ValueError, type(Structure), "X", (Structure,), d)
+ 
++        # Issue 15989
++        d = {"_fields_": [("a", c_byte)],
++             "_pack_": _testcapi.INT_MAX + 1}
++        self.assertRaises(ValueError, type(Structure), "X", (Structure,), d)
++        d = {"_fields_": [("a", c_byte)],
++             "_pack_": _testcapi.UINT_MAX + 2}
++        self.assertRaises(ValueError, type(Structure), "X", (Structure,), d)
++
+     def test_initializers(self):
+         class Person(Structure):
+             _fields_ = [("name", c_char*6),
+diff -r bd8afb90ebf2 Lib/ctypes/test/test_win32.py
+--- a/Lib/ctypes/test/test_win32.py
++++ b/Lib/ctypes/test/test_win32.py
+@@ -3,6 +3,7 @@
+ from ctypes import *
+ from ctypes.test import is_resource_enabled
+ import unittest, sys
++from test import support
+ 
+ import _ctypes_test
+ 
+@@ -60,13 +61,37 @@
+ 
+         def test_COMError(self):
+             from _ctypes import COMError
+-            self.assertEqual(COMError.__doc__, "Raised when a COM method call failed.")
++            if support.HAVE_DOCSTRINGS:
++                self.assertEqual(COMError.__doc__,
++                                 "Raised when a COM method call failed.")
+ 
+             ex = COMError(-1, "text", ("details",))
+             self.assertEqual(ex.hresult, -1)
+             self.assertEqual(ex.text, "text")
+             self.assertEqual(ex.details, ("details",))
+ 
++    class TestWinError(unittest.TestCase):
++        def test_winerror(self):
++            # see Issue 16169
++            import errno
++            ERROR_INVALID_PARAMETER = 87
++            msg = FormatError(ERROR_INVALID_PARAMETER).strip()
++            args = (errno.EINVAL, msg, None, ERROR_INVALID_PARAMETER)
++
++            e = WinError(ERROR_INVALID_PARAMETER)
++            self.assertEqual(e.args, args)
++            self.assertEqual(e.errno, errno.EINVAL)
++            self.assertEqual(e.winerror, ERROR_INVALID_PARAMETER)
++
++            windll.kernel32.SetLastError(ERROR_INVALID_PARAMETER)
++            try:
++                raise WinError()
++            except OSError as exc:
++                e = exc
++            self.assertEqual(e.args, args)
++            self.assertEqual(e.errno, errno.EINVAL)
++            self.assertEqual(e.winerror, ERROR_INVALID_PARAMETER)
++
+ class Structures(unittest.TestCase):
+ 
+     def test_struct_by_value(self):
+diff -r bd8afb90ebf2 Lib/ctypes/util.py
+--- a/Lib/ctypes/util.py
++++ b/Lib/ctypes/util.py
+@@ -166,6 +166,35 @@
+             res.sort(key=_num_version)
+             return res[-1]
+ 
++    elif sys.platform == "sunos5":
++
++        def _findLib_crle(name, is64):
++            if not os.path.exists('/usr/bin/crle'):
++                return None
++
++            if is64:
++                cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null'
++            else:
++                cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null'
++
++            for line in os.popen(cmd).readlines():
++                line = line.strip()
++                if line.startswith('Default Library Path (ELF):'):
++                    paths = line.split()[4]
++
++            if not paths:
++                return None
++
++            for dir in paths.split(":"):
++                libfile = os.path.join(dir, "lib%s.so" % name)
++                if os.path.exists(libfile):
++                    return libfile
++
++            return None
++
++        def find_library(name, is64 = False):
++            return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
++
+     else:
+ 
+         def _findSoname_ldconfig(name):
+diff -r bd8afb90ebf2 Lib/curses/__init__.py
+--- a/Lib/curses/__init__.py
++++ b/Lib/curses/__init__.py
+@@ -5,7 +5,7 @@
+ 
+    import curses
+    from curses import textpad
+-   curses.initwin()
++   curses.initscr()
+    ...
+ 
+ """
+diff -r bd8afb90ebf2 Lib/decimal.py
+--- a/Lib/decimal.py
++++ b/Lib/decimal.py
+@@ -2596,7 +2596,7 @@
+         ans = ans._fix(context)
+         return ans
+ 
+-    def same_quantum(self, other):
++    def same_quantum(self, other, context=None):
+         """Return True if self and other have the same exponent; otherwise
+         return False.
+ 
+@@ -2914,7 +2914,7 @@
+         except TypeError:
+             return 0
+ 
+-    def canonical(self, context=None):
++    def canonical(self):
+         """Returns the same Decimal object.
+ 
+         As we do not have different encodings for the same number, the
+@@ -2934,7 +2934,7 @@
+             return ans
+         return self.compare(other, context=context)
+ 
+-    def compare_total(self, other):
++    def compare_total(self, other, context=None):
+         """Compares self to other using the abstract representations.
+ 
+         This is not like the standard compare, which use their numerical
+@@ -3007,7 +3007,7 @@
+         return _Zero
+ 
+ 
+-    def compare_total_mag(self, other):
++    def compare_total_mag(self, other, context=None):
+         """Compares self to other using abstract repr., ignoring sign.
+ 
+         Like compare_total, but with operand's sign ignored and assumed to be 0.
+@@ -3029,7 +3029,7 @@
+         else:
+             return _dec_from_triple(1, self._int, self._exp, self._is_special)
+ 
+-    def copy_sign(self, other):
++    def copy_sign(self, other, context=None):
+         """Returns self with the sign of other."""
+         other = _convert_other(other, raiseit=True)
+         return _dec_from_triple(other._sign, self._int,
+@@ -4182,7 +4182,7 @@
+         """
+         if not isinstance(a, Decimal):
+             raise TypeError("canonical requires a Decimal as an argument.")
+-        return a.canonical(context=self)
++        return a.canonical()
+ 
+     def compare(self, a, b):
+         """Compares values numerically.
+diff -r bd8afb90ebf2 Lib/distutils/command/build_ext.py
+--- a/Lib/distutils/command/build_ext.py
++++ b/Lib/distutils/command/build_ext.py
+@@ -160,6 +160,11 @@
+         if isinstance(self.include_dirs, str):
+             self.include_dirs = self.include_dirs.split(os.pathsep)
+ 
++        # If in a virtualenv, add its include directory
++        # Issue 16116
++        if sys.exec_prefix != sys.base_exec_prefix:
++            self.include_dirs.append(os.path.join(sys.exec_prefix, 'include'))
++
+         # Put the Python "system" include dir at the end, so that
+         # any local include dirs take precedence.
+         self.include_dirs.append(py_include)
+@@ -190,6 +195,8 @@
+             # must be the *native* platform.  But we don't really support
+             # cross-compiling via a binary install anyway, so we let it go.
+             self.library_dirs.append(os.path.join(sys.exec_prefix, 'libs'))
++            if sys.base_exec_prefix != sys.prefix:  # Issue 16116
++                self.library_dirs.append(os.path.join(sys.base_exec_prefix, 'libs'))
+             if self.debug:
+                 self.build_temp = os.path.join(self.build_temp, "Debug")
+             else:
+diff -r bd8afb90ebf2 Lib/distutils/command/check.py
+--- a/Lib/distutils/command/check.py
++++ b/Lib/distutils/command/check.py
+@@ -23,6 +23,9 @@
+ 
+         def system_message(self, level, message, *children, **kwargs):
+             self.messages.append((level, message, children, kwargs))
++            return nodes.system_message(message, level=level,
++                                        type=self.levels[level],
++                                        *children, **kwargs)
+ 
+     HAS_DOCUTILS = True
+ except Exception:
+diff -r bd8afb90ebf2 Lib/distutils/config.py
+--- a/Lib/distutils/config.py
++++ b/Lib/distutils/config.py
+@@ -4,7 +4,6 @@
+ that uses .pypirc in the distutils.command package.
+ """
+ import os
+-import sys
+ from configparser import ConfigParser
+ 
+ from distutils.cmd import Command
+@@ -43,16 +42,8 @@
+     def _store_pypirc(self, username, password):
+         """Creates a default .pypirc file."""
+         rc = self._get_rc_file()
+-        f = open(rc, 'w')
+-        try:
++        with os.fdopen(os.open(rc, os.O_CREAT | os.O_WRONLY, 0o600), 'w') as f:
+             f.write(DEFAULT_PYPIRC % (username, password))
+-        finally:
+-            f.close()
+-        try:
+-            os.chmod(rc, 0o600)
+-        except OSError:
+-            # should do something better here
+-            pass
+ 
+     def _read_pypirc(self):
+         """Reads the .pypirc file."""
+diff -r bd8afb90ebf2 Lib/distutils/dir_util.py
+--- a/Lib/distutils/dir_util.py
++++ b/Lib/distutils/dir_util.py
+@@ -141,6 +141,10 @@
+         src_name = os.path.join(src, n)
+         dst_name = os.path.join(dst, n)
+ 
++        if n.startswith('.nfs'):
++            # skip NFS rename files
++            continue
++
+         if preserve_symlinks and os.path.islink(src_name):
+             link_dest = os.readlink(src_name)
+             if verbose >= 1:
+diff -r bd8afb90ebf2 Lib/distutils/sysconfig.py
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -24,7 +24,11 @@
+ # Path to the base directory of the project. On Windows the binary may
+ # live in project/PCBuild9.  If we're dealing with an x64 Windows build,
+ # it'll live in project/PCbuild/amd64.
+-project_base = os.path.dirname(os.path.abspath(sys.executable))
++# set for cross builds
++if "_PYTHON_PROJECT_BASE" in os.environ:
++    project_base = os.path.abspath(os.environ["_PYTHON_PROJECT_BASE"])
++else:
++    project_base = os.path.dirname(os.path.abspath(sys.executable))
+ if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
+     project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
+ # PC/VS7.1
+@@ -98,7 +102,7 @@
+             # the build directory may not be the source directory, we
+             # must use "srcdir" from the makefile to find the "Include"
+             # directory.
+-            base = _sys_home or os.path.dirname(os.path.abspath(sys.executable))
++            base = _sys_home or project_base
+             if plat_specific:
+                 return base
+             if _sys_home:
+@@ -251,8 +255,7 @@
+ def get_makefile_filename():
+     """Return full pathname of installed Makefile from the Python build."""
+     if python_build:
+-        return os.path.join(_sys_home or os.path.dirname(sys.executable),
+-                                                         "Makefile")
++        return os.path.join(_sys_home or project_base, "Makefile")
+     lib_dir = get_python_lib(plat_specific=0, standard_lib=1)
+     config_file = 'config-{}{}'.format(get_python_version(), build_flags)
+     return os.path.join(lib_dir, config_file, 'Makefile')
+@@ -555,7 +558,7 @@
+         # testing, for example, we might be running a non-installed python
+         # from a different directory.
+         if python_build and os.name == "posix":
+-            base = os.path.dirname(os.path.abspath(sys.executable))
++            base = project_base
+             if (not os.path.isabs(_config_vars['srcdir']) and
+                 base != os.getcwd()):
+                 # srcdir is relative and we are not in the same directory
+diff -r bd8afb90ebf2 Lib/distutils/tests/test_build_ext.py
+--- a/Lib/distutils/tests/test_build_ext.py
++++ b/Lib/distutils/tests/test_build_ext.py
+@@ -73,8 +73,9 @@
+         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.assertEqual(xx.__doc__, doc)
++        if support.HAVE_DOCSTRINGS:
++            doc = 'This is a template module just for instruction.'
++            self.assertEqual(xx.__doc__, doc)
+         self.assertTrue(isinstance(xx.Null(), xx.Null))
+         self.assertTrue(isinstance(xx.Str(), xx.Str))
+ 
+diff -r bd8afb90ebf2 Lib/distutils/tests/test_dir_util.py
+--- a/Lib/distutils/tests/test_dir_util.py
++++ b/Lib/distutils/tests/test_dir_util.py
+@@ -76,7 +76,6 @@
+ 
+         remove_tree(self.root_target, verbose=0)
+ 
+-
+     def test_copy_tree_verbosity(self):
+ 
+         mkpath(self.target, verbose=0)
+@@ -88,11 +87,8 @@
+ 
+         mkpath(self.target, verbose=0)
+         a_file = os.path.join(self.target, 'ok.txt')
+-        f = open(a_file, 'w')
+-        try:
++        with open(a_file, 'w') as f:
+             f.write('some content')
+-        finally:
+-            f.close()
+ 
+         wanted = ['copying %s -> %s' % (a_file, self.target2)]
+         copy_tree(self.target, self.target2, verbose=1)
+@@ -101,6 +97,21 @@
+         remove_tree(self.root_target, verbose=0)
+         remove_tree(self.target2, verbose=0)
+ 
++    def test_copy_tree_skips_nfs_temp_files(self):
++        mkpath(self.target, verbose=0)
++
++        a_file = os.path.join(self.target, 'ok.txt')
++        nfs_file = os.path.join(self.target, '.nfs123abc')
++        for f in a_file, nfs_file:
++            with open(f, 'w') as fh:
++                fh.write('some content')
++
++        copy_tree(self.target, self.target2)
++        self.assertEqual(os.listdir(self.target2), ['ok.txt'])
++
++        remove_tree(self.root_target, verbose=0)
++        remove_tree(self.target2, verbose=0)
++
+     def test_ensure_relative(self):
+         if os.sep == '/':
+             self.assertEqual(ensure_relative('/home/foo'), 'home/foo')
+diff -r bd8afb90ebf2 Lib/distutils/tests/test_msvc9compiler.py
+--- a/Lib/distutils/tests/test_msvc9compiler.py
++++ b/Lib/distutils/tests/test_msvc9compiler.py
+@@ -104,7 +104,7 @@
+                             unittest.TestCase):
+ 
+     def test_no_compiler(self):
+-        # makes sure query_vcvarsall throws
++        # makes sure query_vcvarsall raises
+         # a DistutilsPlatformError if the compiler
+         # is not found
+         from distutils.msvc9compiler import query_vcvarsall
+diff -r bd8afb90ebf2 Lib/distutils/tests/test_register.py
+--- a/Lib/distutils/tests/test_register.py
++++ b/Lib/distutils/tests/test_register.py
+@@ -1,5 +1,4 @@
+ """Tests for distutils.command.register."""
+-import sys
+ import os
+ import unittest
+ import getpass
+@@ -10,11 +9,14 @@
+ 
+ from distutils.command import register as register_module
+ from distutils.command.register import register
+-from distutils.core import Distribution
+ from distutils.errors import DistutilsSetupError
+ 
+-from distutils.tests import support
+-from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase
++from distutils.tests.test_config import PyPIRCCommandTestCase
++
++try:
++    import docutils
++except ImportError:
++    docutils = None
+ 
+ PYPIRC_NOPASSWORD = """\
+ [distutils]
+@@ -193,6 +195,7 @@
+         self.assertEqual(headers['Content-length'], '290')
+         self.assertTrue((b'tarek') in req.data)
+ 
++    @unittest.skipUnless(docutils is not None, 'needs docutils')
+     def test_strict(self):
+         # testing the script option
+         # when on, the register command stops if
+@@ -205,13 +208,6 @@
+         cmd.strict = 1
+         self.assertRaises(DistutilsSetupError, cmd.run)
+ 
+-        # we don't test the reSt feature if docutils
+-        # is not installed
+-        try:
+-            import docutils
+-        except ImportError:
+-            return
+-
+         # metadata are OK but long_description is broken
+         metadata = {'url': 'xxx', 'author': 'xxx',
+                     'author_email': 'éxéxé',
+@@ -265,6 +261,22 @@
+         finally:
+             del register_module.input
+ 
++    @unittest.skipUnless(docutils is not None, 'needs docutils')
++    def test_register_invalid_long_description(self):
++        description = ':funkie:`str`'  # mimic Sphinx-specific markup
++        metadata = {'url': 'xxx', 'author': 'xxx',
++                    'author_email': 'xxx',
++                    'name': 'xxx', 'version': 'xxx',
++                    'long_description': description}
++        cmd = self._get_cmd(metadata)
++        cmd.ensure_finalized()
++        cmd.strict = True
++        inputs = Inputs('2', 'tarek', 'tarek@ziade.org')
++        register_module.input = inputs
++        self.addCleanup(delattr, register_module, 'input')
++
++        self.assertRaises(DistutilsSetupError, cmd.run)
++
+     def test_check_metadata_deprecated(self):
+         # makes sure make_metadata is deprecated
+         cmd = self._get_cmd()
+diff -r bd8afb90ebf2 Lib/distutils/tests/test_sdist.py
+--- a/Lib/distutils/tests/test_sdist.py
++++ b/Lib/distutils/tests/test_sdist.py
+@@ -83,9 +83,8 @@
+ 
+     @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
+     def test_prune_file_list(self):
+-        # this test creates a package with some vcs dirs in it
+-        # and launch sdist to make sure they get pruned
+-        # on all systems
++        # this test creates a project with some VCS dirs and an NFS rename
++        # file, then launches sdist to check they get pruned on all systems
+ 
+         # creating VCS directories with some files in them
+         os.mkdir(join(self.tmp_dir, 'somecode', '.svn'))
+@@ -99,6 +98,8 @@
+         self.write_file((self.tmp_dir, 'somecode', '.git',
+                          'ok'), 'xxx')
+ 
++        self.write_file((self.tmp_dir, 'somecode', '.nfs0001'), 'xxx')
++
+         # now building a sdist
+         dist, cmd = self.get_cmd()
+ 
+diff -r bd8afb90ebf2 Lib/doctest.py
+--- a/Lib/doctest.py
++++ b/Lib/doctest.py
+@@ -2334,7 +2334,12 @@
+     elif not tests:
+         # Why do we want to do this? Because it reveals a bug that might
+         # otherwise be hidden.
+-        raise ValueError(module, "has no tests")
++        # It is probably a bug that this exception is not also raised if the
++        # number of doctest examples in tests is zero (i.e. if no doctest
++        # examples were found).  However, we should probably not be raising
++        # an exception at all here, though it is too late to make this change
++        # for a maintenance release.  See also issue #14649.
++        raise ValueError(module, "has no docstrings")
+ 
+     tests.sort()
+     suite = unittest.TestSuite()
+diff -r bd8afb90ebf2 Lib/email/charset.py
+--- a/Lib/email/charset.py
++++ b/Lib/email/charset.py
+@@ -392,6 +392,19 @@
+                 string = string.encode(self.output_charset)
+             return email.base64mime.body_encode(string)
+         elif self.body_encoding is QP:
++            # quopromime.body_encode takes a string, but operates on it as if
++            # it were a list of byte codes.  For a (minimal) history on why
++            # this is so, see changeset 0cf700464177.  To correctly encode a
++            # character set, then, we must turn it into pseudo bytes via the
++            # latin1 charset, which will encode any byte as a single code point
++            # between 0 and 255, which is what body_encode is expecting.
++            #
++            # Note that this clause doesn't handle the case of a _payload that
++            # is already bytes.  It never did, and the semantics of _payload
++            # being bytes has never been nailed down, so fixing that is a
++            # longer term TODO.
++            if isinstance(string, str):
++                string = string.encode(self.output_charset).decode('latin1')
+             return email.quoprimime.body_encode(string)
+         else:
+             if isinstance(string, str):
+diff -r bd8afb90ebf2 Lib/email/encoders.py
+--- a/Lib/email/encoders.py
++++ b/Lib/email/encoders.py
+@@ -62,17 +62,25 @@
+         else:
+             orig.decode('ascii')
+     except UnicodeError:
+-        # iso-2022-* is non-ASCII but still 7-bit
+         charset = msg.get_charset()
+         output_cset = charset and charset.output_charset
++        # iso-2022-* is non-ASCII but encodes to a 7-bit representation
+         if output_cset and output_cset.lower().startswith('iso-2022-'):
+             msg['Content-Transfer-Encoding'] = '7bit'
+         else:
+             msg['Content-Transfer-Encoding'] = '8bit'
+     else:
+         msg['Content-Transfer-Encoding'] = '7bit'
++    if not isinstance(orig, str):
++        msg.set_payload(orig.decode('ascii', 'surrogateescape'))
+ 
+ 
+ 
+ def encode_noop(msg):
+     """Do nothing."""
++    # Well, not quite *nothing*: in Python3 we have to turn bytes into a string
++    # in our internal surrogateescaped form in order to keep the model
++    # consistent.
++    orig = msg.get_payload()
++    if not isinstance(orig, str):
++        msg.set_payload(orig.decode('ascii', 'surrogateescape'))
+diff -r bd8afb90ebf2 Lib/email/feedparser.py
+--- a/Lib/email/feedparser.py
++++ b/Lib/email/feedparser.py
+@@ -13,7 +13,7 @@
+ data.  When you have no more data to push into the parser, call .close().
+ This completes the parsing and returns the root message object.
+ 
+-The other advantage of this parser is that it will never throw a parsing
++The other advantage of this parser is that it will never raise a parsing
+ exception.  Instead, when it finds something unexpected, it adds a 'defect' to
+ the current message.  Defects are just instances that live on the message
+ object's .defects attribute.
+@@ -228,7 +228,7 @@
+         # supposed to see in the body of the message.
+         self._parse_headers(headers)
+         # Headers-only parsing is a backwards compatibility hack, which was
+-        # necessary in the older parser, which could throw errors.  All
++        # necessary in the older parser, which could raise errors.  All
+         # remaining lines in the input are thrown into the message body.
+         if self._headersonly:
+             lines = []
+diff -r bd8afb90ebf2 Lib/email/generator.py
+--- a/Lib/email/generator.py
++++ b/Lib/email/generator.py
+@@ -406,6 +406,9 @@
+         else:
+             super(BytesGenerator,self)._handle_text(msg)
+ 
++    # Default body handler
++    _writeBody = _handle_text
++
+     @classmethod
+     def _compile_re(cls, s, flags):
+         return re.compile(s.encode('ascii'), flags)
+diff -r bd8afb90ebf2 Lib/email/header.py
+--- a/Lib/email/header.py
++++ b/Lib/email/header.py
+@@ -298,7 +298,7 @@
+             else:
+                 s = s.decode(input_charset, errors)
+         # Ensure that the bytes we're storing can be decoded to the output
+-        # character set, otherwise an early error is thrown.
++        # character set, otherwise an early error is raised.
+         output_charset = charset.output_codec or 'us-ascii'
+         if output_charset != _charset.UNKNOWN8BIT:
+             try:
+diff -r bd8afb90ebf2 Lib/email/policy.py
+--- a/Lib/email/policy.py
++++ b/Lib/email/policy.py
+@@ -173,7 +173,7 @@
+         lines = value.splitlines()
+         refold = (self.refold_source == 'all' or
+                   self.refold_source == 'long' and
+-                    (len(lines[0])+len(name)+2 > maxlen or
++                    (lines and len(lines[0])+len(name)+2 > maxlen or
+                      any(len(x) > maxlen for x in lines[1:])))
+         if refold or refold_binary and _has_surrogates(value):
+             return self.header_factory(name, ''.join(lines)).fold(policy=self)
+diff -r bd8afb90ebf2 Lib/email/utils.py
+--- a/Lib/email/utils.py
++++ b/Lib/email/utils.py
+@@ -83,7 +83,7 @@
+     'utf-8'.
+     """
+     name, address = pair
+-    # The address MUST (per RFC) be ascii, so throw a UnicodeError if it isn't.
++    # The address MUST (per RFC) be ascii, so raise an UnicodeError if it isn't.
+     address.encode('ascii')
+     if name:
+         try:
+diff -r bd8afb90ebf2 Lib/fnmatch.py
+--- a/Lib/fnmatch.py
++++ b/Lib/fnmatch.py
+@@ -35,7 +35,7 @@
+     pat = os.path.normcase(pat)
+     return fnmatchcase(name, pat)
+ 
+-@functools.lru_cache(maxsize=250, typed=True)
++@functools.lru_cache(maxsize=256, typed=True)
+ def _compile_pattern(pat):
+     if isinstance(pat, bytes):
+         pat_str = str(pat, 'ISO-8859-1')
+diff -r bd8afb90ebf2 Lib/ftplib.py
+--- a/Lib/ftplib.py
++++ b/Lib/ftplib.py
+@@ -288,20 +288,25 @@
+ 
+     def makeport(self):
+         '''Create a new socket and send a PORT command for it.'''
+-        msg = "getaddrinfo returns an empty list"
++        err = None
+         sock = None
+         for res in socket.getaddrinfo(None, 0, self.af, socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
+             af, socktype, proto, canonname, sa = res
+             try:
+                 sock = socket.socket(af, socktype, proto)
+                 sock.bind(sa)
+-            except socket.error as msg:
++            except socket.error as _:
++                err = _
+                 if sock:
+                     sock.close()
+                 sock = None
+                 continue
+             break
+-        if not sock:
++        if sock is None:
++            if err is not None:
++                raise err
++            else:
++                raise socket.error("getaddrinfo returns an empty list")
+             raise socket.error(msg)
+         sock.listen(1)
+         port = sock.getsockname()[1] # Get proper port
+diff -r bd8afb90ebf2 Lib/glob.py
+--- a/Lib/glob.py
++++ b/Lib/glob.py
+@@ -29,7 +29,10 @@
+         for name in glob1(None, basename):
+             yield name
+         return
+-    if has_magic(dirname):
++    # `os.path.split()` returns the argument itself as a dirname if it is a
++    # drive or UNC path.  Prevent an infinite recursion if a drive or UNC path
++    # contains magic characters (i.e. r'\\?\C:').
++    if dirname != pathname and has_magic(dirname):
+         dirs = iglob(dirname)
+     else:
+         dirs = [dirname]
+@@ -55,12 +58,12 @@
+         names = os.listdir(dirname)
+     except os.error:
+         return []
+-    if pattern[0] != '.':
+-        names = [x for x in names if x[0] != '.']
++    if not _ishidden(pattern):
++        names = [x for x in names if not _ishidden(x)]
+     return fnmatch.filter(names, pattern)
+ 
+ def glob0(dirname, basename):
+-    if basename == '':
++    if not basename:
+         # `os.path.split()` returns an empty basename for paths ending with a
+         # directory separator.  'q*x/' should match only directories.
+         if os.path.isdir(dirname):
+@@ -80,3 +83,6 @@
+     else:
+         match = magic_check.search(s)
+     return match is not None
++
++def _ishidden(path):
++    return path[0] in ('.', b'.'[0])
+diff -r bd8afb90ebf2 Lib/gzip.py
+--- a/Lib/gzip.py
++++ b/Lib/gzip.py
+@@ -65,9 +65,6 @@
+     # or unsigned.
+     output.write(struct.pack("<L", value))
+ 
+-def read32(input):
+-    return struct.unpack("<I", input.read(4))[0]
+-
+ class _PaddedFile:
+     """Minimal read-only file object that prepends a string to the contents
+     of an actual file. Shouldn't be used outside of gzip.py, as it lacks
+@@ -160,9 +157,10 @@
+         A mode of 'r' is equivalent to one of 'rb', and similarly for 'w' and
+         'wb', and 'a' and 'ab'.
+ 
+-        The compresslevel argument is an integer from 1 to 9 controlling the
++        The compresslevel argument is an integer from 0 to 9 controlling the
+         level of compression; 1 is fastest and produces the least compression,
+-        and 9 is slowest and produces the most compression.  The default is 9.
++        and 9 is slowest and produces the most compression. 0 is no compression
++        at all. The default is 9.
+ 
+         The mtime argument is an optional numeric timestamp to be written
+         to the stream when compressing.  All gzip compressed streams
+@@ -280,27 +278,31 @@
+         self.crc = zlib.crc32(b"") & 0xffffffff
+         self.size = 0
+ 
++    def _read_exact(self, n):
++        data = self.fileobj.read(n)
++        while len(data) < n:
++            b = self.fileobj.read(n - len(data))
++            if not b:
++                raise EOFError("Compressed file ended before the "
++                               "end-of-stream marker was reached")
++            data += b
++        return data
++
+     def _read_gzip_header(self):
+         magic = self.fileobj.read(2)
+         if magic == b'':
+-            raise EOFError("Reached EOF")
++            return False
+ 
+         if magic != b'\037\213':
+             raise IOError('Not a gzipped file')
+-        method = ord( self.fileobj.read(1) )
++
++        method, flag, self.mtime = struct.unpack("<BBIxx", self._read_exact(8))
+         if method != 8:
+             raise IOError('Unknown compression method')
+-        flag = ord( self.fileobj.read(1) )
+-        self.mtime = read32(self.fileobj)
+-        # extraflag = self.fileobj.read(1)
+-        # os = self.fileobj.read(1)
+-        self.fileobj.read(2)
+ 
+         if flag & FEXTRA:
+             # Read & discard the extra field, if present
+-            xlen = ord(self.fileobj.read(1))
+-            xlen = xlen + 256*ord(self.fileobj.read(1))
+-            self.fileobj.read(xlen)
++            self._read_exact(struct.unpack("<H", self._read_exact(2)))
+         if flag & FNAME:
+             # Read and discard a null-terminated string containing the filename
+             while True:
+@@ -314,12 +316,13 @@
+                 if not s or s==b'\000':
+                     break
+         if flag & FHCRC:
+-            self.fileobj.read(2)     # Read & discard the 16-bit header CRC
++            self._read_exact(2)     # Read & discard the 16-bit header CRC
+ 
+         unused = self.fileobj.unused()
+         if unused:
+             uncompress = self.decompress.decompress(unused)
+             self._add_read_data(uncompress)
++        return True
+ 
+     def write(self,data):
+         self._check_closed()
+@@ -353,20 +356,16 @@
+ 
+         readsize = 1024
+         if size < 0:        # get the whole thing
+-            try:
+-                while True:
+-                    self._read(readsize)
+-                    readsize = min(self.max_read_chunk, readsize * 2)
+-            except EOFError:
+-                size = self.extrasize
++            while self._read(readsize):
++                readsize = min(self.max_read_chunk, readsize * 2)
++            size = self.extrasize
+         else:               # just get some more of it
+-            try:
+-                while size > self.extrasize:
+-                    self._read(readsize)
+-                    readsize = min(self.max_read_chunk, readsize * 2)
+-            except EOFError:
+-                if size > self.extrasize:
+-                    size = self.extrasize
++            while size > self.extrasize:
++                if not self._read(readsize):
++                    if size > self.extrasize:
++                        size = self.extrasize
++                    break
++                readsize = min(self.max_read_chunk, readsize * 2)
+ 
+         offset = self.offset - self.extrastart
+         chunk = self.extrabuf[offset: offset + size]
+@@ -384,12 +383,9 @@
+         if self.extrasize <= 0 and self.fileobj is None:
+             return b''
+ 
+-        try:
+-            # For certain input data, a single call to _read() may not return
+-            # any data. In this case, retry until we get some data or reach EOF.
+-            while self.extrasize <= 0:
+-                self._read()
+-        except EOFError:
++        # For certain input data, a single call to _read() may not return
++        # any data. In this case, retry until we get some data or reach EOF.
++        while self.extrasize <= 0 and self._read():
+             pass
+         if size < 0 or size > self.extrasize:
+             size = self.extrasize
+@@ -412,12 +408,9 @@
+         if self.extrasize == 0:
+             if self.fileobj is None:
+                 return b''
+-            try:
+-                # Ensure that we don't return b"" if we haven't reached EOF.
+-                while self.extrasize == 0:
+-                    # 1024 is the same buffering heuristic used in read()
+-                    self._read(max(n, 1024))
+-            except EOFError:
++            # Ensure that we don't return b"" if we haven't reached EOF.
++            # 1024 is the same buffering heuristic used in read()
++            while self.extrasize == 0 and self._read(max(n, 1024)):
+                 pass
+         offset = self.offset - self.extrastart
+         remaining = self.extrasize
+@@ -430,13 +423,14 @@
+ 
+     def _read(self, size=1024):
+         if self.fileobj is None:
+-            raise EOFError("Reached EOF")
++            return False
+ 
+         if self._new_member:
+             # If the _new_member flag is set, we have to
+             # jump to the next member, if there is one.
+             self._init_read()
+-            self._read_gzip_header()
++            if not self._read_gzip_header():
++                return False
+             self.decompress = zlib.decompressobj(-zlib.MAX_WBITS)
+             self._new_member = False
+ 
+@@ -453,7 +447,7 @@
+             self.fileobj.prepend(self.decompress.unused_data, True)
+             self._read_eof()
+             self._add_read_data( uncompress )
+-            raise EOFError('Reached EOF')
++            return False
+ 
+         uncompress = self.decompress.decompress(buf)
+         self._add_read_data( uncompress )
+@@ -469,6 +463,7 @@
+             # a new member on the next call
+             self._read_eof()
+             self._new_member = True
++        return True
+ 
+     def _add_read_data(self, data):
+         self.crc = zlib.crc32(data, self.crc) & 0xffffffff
+@@ -483,8 +478,7 @@
+         # We check the that the computed CRC and size of the
+         # uncompressed data matches the stored values.  Note that the size
+         # stored is the true file size mod 2**32.
+-        crc32 = read32(self.fileobj)
+-        isize = read32(self.fileobj)  # may exceed 2GB
++        crc32, isize = struct.unpack("<II", self._read_exact(8))
+         if crc32 != self.crc:
+             raise IOError("CRC check failed %s != %s" % (hex(crc32),
+                                                          hex(self.crc)))
+@@ -622,7 +616,7 @@
+ 
+ def compress(data, compresslevel=9):
+     """Compress data in one shot and return the compressed string.
+-    Optional argument is the compression level, in range of 1-9.
++    Optional argument is the compression level, in range of 0-9.
+     """
+     buf = io.BytesIO()
+     with GzipFile(fileobj=buf, mode='wb', compresslevel=compresslevel) as f:
+@@ -670,9 +664,9 @@
+             if not chunk:
+                 break
+             g.write(chunk)
+-        if g is not sys.stdout:
++        if g is not sys.stdout.buffer:
+             g.close()
+-        if f is not sys.stdin:
++        if f is not sys.stdin.buffer:
+             f.close()
+ 
+ if __name__ == '__main__':
+diff -r bd8afb90ebf2 Lib/html/entities.py
+--- a/Lib/html/entities.py
++++ b/Lib/html/entities.py
+@@ -259,34 +259,34 @@
+ 
+ # maps the HTML5 named character references to the equivalent Unicode character(s)
+ html5 = {
++    'Aacute': '\xc1',
++    'aacute': '\xe1',
+     'Aacute;': '\xc1',
+-    'Aacute': '\xc1',
+     'aacute;': '\xe1',
+-    'aacute': '\xe1',
+     'Abreve;': '\u0102',
+     'abreve;': '\u0103',
+     'ac;': '\u223e',
+     'acd;': '\u223f',
+     'acE;': '\u223e\u0333',
++    'Acirc': '\xc2',
++    'acirc': '\xe2',
+     'Acirc;': '\xc2',
+-    'Acirc': '\xc2',
+     'acirc;': '\xe2',
+-    'acirc': '\xe2',
++    'acute': '\xb4',
+     'acute;': '\xb4',
+-    'acute': '\xb4',
+     'Acy;': '\u0410',
+     'acy;': '\u0430',
++    'AElig': '\xc6',
++    'aelig': '\xe6',
+     'AElig;': '\xc6',
+-    'AElig': '\xc6',
+     'aelig;': '\xe6',
+-    'aelig': '\xe6',
+     'af;': '\u2061',
+     'Afr;': '\U0001d504',
+     'afr;': '\U0001d51e',
++    'Agrave': '\xc0',
++    'agrave': '\xe0',
+     'Agrave;': '\xc0',
+-    'Agrave': '\xc0',
+     'agrave;': '\xe0',
+-    'agrave': '\xe0',
+     'alefsym;': '\u2135',
+     'aleph;': '\u2135',
+     'Alpha;': '\u0391',
+@@ -294,10 +294,10 @@
+     'Amacr;': '\u0100',
+     'amacr;': '\u0101',
+     'amalg;': '\u2a3f',
++    'AMP': '&',
++    'amp': '&',
+     'AMP;': '&',
+-    'AMP': '&',
+     'amp;': '&',
+-    'amp': '&',
+     'And;': '\u2a53',
+     'and;': '\u2227',
+     'andand;': '\u2a55',
+@@ -335,24 +335,24 @@
+     'ApplyFunction;': '\u2061',
+     'approx;': '\u2248',
+     'approxeq;': '\u224a',
++    'Aring': '\xc5',
++    'aring': '\xe5',
+     'Aring;': '\xc5',
+-    'Aring': '\xc5',
+     'aring;': '\xe5',
+-    'aring': '\xe5',
+     'Ascr;': '\U0001d49c',
+     'ascr;': '\U0001d4b6',
+     'Assign;': '\u2254',
+     'ast;': '*',
+     'asymp;': '\u2248',
+     'asympeq;': '\u224d',
++    'Atilde': '\xc3',
++    'atilde': '\xe3',
+     'Atilde;': '\xc3',
+-    'Atilde': '\xc3',
+     'atilde;': '\xe3',
+-    'atilde': '\xe3',
++    'Auml': '\xc4',
++    'auml': '\xe4',
+     'Auml;': '\xc4',
+-    'Auml': '\xc4',
+     'auml;': '\xe4',
+-    'auml': '\xe4',
+     'awconint;': '\u2233',
+     'awint;': '\u2a11',
+     'backcong;': '\u224c',
+@@ -466,8 +466,8 @@
+     'bprime;': '\u2035',
+     'Breve;': '\u02d8',
+     'breve;': '\u02d8',
++    'brvbar': '\xa6',
+     'brvbar;': '\xa6',
+-    'brvbar': '\xa6',
+     'Bscr;': '\u212c',
+     'bscr;': '\U0001d4b7',
+     'bsemi;': '\u204f',
+@@ -500,10 +500,10 @@
+     'ccaps;': '\u2a4d',
+     'Ccaron;': '\u010c',
+     'ccaron;': '\u010d',
++    'Ccedil': '\xc7',
++    'ccedil': '\xe7',
+     'Ccedil;': '\xc7',
+-    'Ccedil': '\xc7',
+     'ccedil;': '\xe7',
+-    'ccedil': '\xe7',
+     'Ccirc;': '\u0108',
+     'ccirc;': '\u0109',
+     'Cconint;': '\u2230',
+@@ -511,12 +511,12 @@
+     'ccupssm;': '\u2a50',
+     'Cdot;': '\u010a',
+     'cdot;': '\u010b',
++    'cedil': '\xb8',
+     'cedil;': '\xb8',
+-    'cedil': '\xb8',
+     'Cedilla;': '\xb8',
+     'cemptyv;': '\u29b2',
++    'cent': '\xa2',
+     'cent;': '\xa2',
+-    'cent': '\xa2',
+     'CenterDot;': '\xb7',
+     'centerdot;': '\xb7',
+     'Cfr;': '\u212d',
+@@ -572,10 +572,10 @@
+     'copf;': '\U0001d554',
+     'coprod;': '\u2210',
+     'Coproduct;': '\u2210',
++    'COPY': '\xa9',
++    'copy': '\xa9',
+     'COPY;': '\xa9',
+-    'COPY': '\xa9',
+     'copy;': '\xa9',
+-    'copy': '\xa9',
+     'copysr;': '\u2117',
+     'CounterClockwiseContourIntegral;': '\u2233',
+     'crarr;': '\u21b5',
+@@ -609,8 +609,8 @@
+     'curlyeqsucc;': '\u22df',
+     'curlyvee;': '\u22ce',
+     'curlywedge;': '\u22cf',
++    'curren': '\xa4',
+     'curren;': '\xa4',
+-    'curren': '\xa4',
+     'curvearrowleft;': '\u21b6',
+     'curvearrowright;': '\u21b7',
+     'cuvee;': '\u22ce',
+@@ -639,8 +639,8 @@
+     'ddarr;': '\u21ca',
+     'DDotrahd;': '\u2911',
+     'ddotseq;': '\u2a77',
++    'deg': '\xb0',
+     'deg;': '\xb0',
+-    'deg': '\xb0',
+     'Del;': '\u2207',
+     'Delta;': '\u0394',
+     'delta;': '\u03b4',
+@@ -666,8 +666,8 @@
+     'digamma;': '\u03dd',
+     'disin;': '\u22f2',
+     'div;': '\xf7',
++    'divide': '\xf7',
+     'divide;': '\xf7',
+-    'divide': '\xf7',
+     'divideontimes;': '\u22c7',
+     'divonx;': '\u22c7',
+     'DJcy;': '\u0402',
+@@ -679,7 +679,7 @@
+     'dopf;': '\U0001d555',
+     'Dot;': '\xa8',
+     'dot;': '\u02d9',
+-    'DotDot;': '\u25cc\u20dc',
++    'DotDot;': '\u20dc',
+     'doteq;': '\u2250',
+     'doteqdot;': '\u2251',
+     'DotEqual;': '\u2250',
+@@ -706,7 +706,7 @@
+     'downarrow;': '\u2193',
+     'DownArrowBar;': '\u2913',
+     'DownArrowUpArrow;': '\u21f5',
+-    'DownBreve;': '\u25cc\u0311',
++    'DownBreve;': '\u0311',
+     'downdownarrows;': '\u21ca',
+     'downharpoonleft;': '\u21c3',
+     'downharpoonright;': '\u21c2',
+@@ -738,18 +738,18 @@
+     'DZcy;': '\u040f',
+     'dzcy;': '\u045f',
+     'dzigrarr;': '\u27ff',
++    'Eacute': '\xc9',
++    'eacute': '\xe9',
+     'Eacute;': '\xc9',
+-    'Eacute': '\xc9',
+     'eacute;': '\xe9',
+-    'eacute': '\xe9',
+     'easter;': '\u2a6e',
+     'Ecaron;': '\u011a',
+     'ecaron;': '\u011b',
+     'ecir;': '\u2256',
++    'Ecirc': '\xca',
++    'ecirc': '\xea',
+     'Ecirc;': '\xca',
+-    'Ecirc': '\xca',
+     'ecirc;': '\xea',
+-    'ecirc': '\xea',
+     'ecolon;': '\u2255',
+     'Ecy;': '\u042d',
+     'ecy;': '\u044d',
+@@ -762,10 +762,10 @@
+     'Efr;': '\U0001d508',
+     'efr;': '\U0001d522',
+     'eg;': '\u2a9a',
++    'Egrave': '\xc8',
++    'egrave': '\xe8',
+     'Egrave;': '\xc8',
+-    'Egrave': '\xc8',
+     'egrave;': '\xe8',
+-    'egrave': '\xe8',
+     'egs;': '\u2a96',
+     'egsdot;': '\u2a98',
+     'el;': '\u2a99',
+@@ -781,9 +781,9 @@
+     'EmptySmallSquare;': '\u25fb',
+     'emptyv;': '\u2205',
+     'EmptyVerySmallSquare;': '\u25ab',
+-    'emsp;': '\u2003',
+     'emsp13;': '\u2004',
+     'emsp14;': '\u2005',
++    'emsp;': '\u2003',
+     'ENG;': '\u014a',
+     'eng;': '\u014b',
+     'ensp;': '\u2002',
+@@ -820,14 +820,14 @@
+     'esim;': '\u2242',
+     'Eta;': '\u0397',
+     'eta;': '\u03b7',
++    'ETH': '\xd0',
++    'eth': '\xf0',
+     'ETH;': '\xd0',
+-    'ETH': '\xd0',
+     'eth;': '\xf0',
+-    'eth': '\xf0',
++    'Euml': '\xcb',
++    'euml': '\xeb',
+     'Euml;': '\xcb',
+-    'Euml': '\xcb',
+     'euml;': '\xeb',
+-    'euml': '\xeb',
+     'euro;': '\u20ac',
+     'excl;': '!',
+     'exist;': '\u2203',
+@@ -860,18 +860,18 @@
+     'forkv;': '\u2ad9',
+     'Fouriertrf;': '\u2131',
+     'fpartint;': '\u2a0d',
++    'frac12': '\xbd',
+     'frac12;': '\xbd',
+-    'frac12': '\xbd',
+     'frac13;': '\u2153',
++    'frac14': '\xbc',
+     'frac14;': '\xbc',
+-    'frac14': '\xbc',
+     'frac15;': '\u2155',
+     'frac16;': '\u2159',
+     'frac18;': '\u215b',
+     'frac23;': '\u2154',
+     'frac25;': '\u2156',
++    'frac34': '\xbe',
+     'frac34;': '\xbe',
+-    'frac34': '\xbe',
+     'frac35;': '\u2157',
+     'frac38;': '\u215c',
+     'frac45;': '\u2158',
+@@ -945,11 +945,11 @@
+     'gsim;': '\u2273',
+     'gsime;': '\u2a8e',
+     'gsiml;': '\u2a90',
++    'GT': '>',
++    'gt': '>',
+     'GT;': '>',
+-    'GT': '>',
+     'Gt;': '\u226b',
+     'gt;': '>',
+-    'gt': '>',
+     'gtcc;': '\u2aa7',
+     'gtcir;': '\u2a7a',
+     'gtdot;': '\u22d7',
+@@ -1004,29 +1004,29 @@
+     'HumpEqual;': '\u224f',
+     'hybull;': '\u2043',
+     'hyphen;': '\u2010',
++    'Iacute': '\xcd',
++    'iacute': '\xed',
+     'Iacute;': '\xcd',
+-    'Iacute': '\xcd',
+     'iacute;': '\xed',
+-    'iacute': '\xed',
+     'ic;': '\u2063',
++    'Icirc': '\xce',
++    'icirc': '\xee',
+     'Icirc;': '\xce',
+-    'Icirc': '\xce',
+     'icirc;': '\xee',
+-    'icirc': '\xee',
+     'Icy;': '\u0418',
+     'icy;': '\u0438',
+     'Idot;': '\u0130',
+     'IEcy;': '\u0415',
+     'iecy;': '\u0435',
++    'iexcl': '\xa1',
+     'iexcl;': '\xa1',
+-    'iexcl': '\xa1',
+     'iff;': '\u21d4',
+     'Ifr;': '\u2111',
+     'ifr;': '\U0001d526',
++    'Igrave': '\xcc',
++    'igrave': '\xec',
+     'Igrave;': '\xcc',
+-    'Igrave': '\xcc',
+     'igrave;': '\xec',
+-    'igrave': '\xec',
+     'ii;': '\u2148',
+     'iiiint;': '\u2a0c',
+     'iiint;': '\u222d',
+@@ -1070,8 +1070,8 @@
+     'Iota;': '\u0399',
+     'iota;': '\u03b9',
+     'iprod;': '\u2a3c',
++    'iquest': '\xbf',
+     'iquest;': '\xbf',
+-    'iquest': '\xbf',
+     'Iscr;': '\u2110',
+     'iscr;': '\U0001d4be',
+     'isin;': '\u2208',
+@@ -1085,10 +1085,10 @@
+     'itilde;': '\u0129',
+     'Iukcy;': '\u0406',
+     'iukcy;': '\u0456',
++    'Iuml': '\xcf',
++    'iuml': '\xef',
+     'Iuml;': '\xcf',
+-    'Iuml': '\xcf',
+     'iuml;': '\xef',
+-    'iuml': '\xef',
+     'Jcirc;': '\u0134',
+     'jcirc;': '\u0135',
+     'Jcy;': '\u0419',
+@@ -1130,13 +1130,13 @@
+     'Lambda;': '\u039b',
+     'lambda;': '\u03bb',
+     'Lang;': '\u27ea',
+-    'lang;': '\u2329',
++    'lang;': '\u27e8',
+     'langd;': '\u2991',
+-    'langle;': '\u2329',
++    'langle;': '\u27e8',
+     'lap;': '\u2a85',
+     'Laplacetrf;': '\u2112',
++    'laquo': '\xab',
+     'laquo;': '\xab',
+-    'laquo': '\xab',
+     'Larr;': '\u219e',
+     'lArr;': '\u21d0',
+     'larr;': '\u2190',
+@@ -1177,7 +1177,7 @@
+     'ldsh;': '\u21b2',
+     'lE;': '\u2266',
+     'le;': '\u2264',
+-    'LeftAngleBracket;': '\u2329',
++    'LeftAngleBracket;': '\u27e8',
+     'LeftArrow;': '\u2190',
+     'Leftarrow;': '\u21d0',
+     'leftarrow;': '\u2190',
+@@ -1316,11 +1316,11 @@
+     'lsquor;': '\u201a',
+     'Lstrok;': '\u0141',
+     'lstrok;': '\u0142',
++    'LT': '<',
++    'lt': '<',
+     'LT;': '<',
+-    'LT': '<',
+     'Lt;': '\u226a',
+     'lt;': '<',
+-    'lt': '<',
+     'ltcc;': '\u2aa6',
+     'ltcir;': '\u2a79',
+     'ltdot;': '\u22d6',
+@@ -1336,8 +1336,8 @@
+     'luruhar;': '\u2966',
+     'lvertneqq;': '\u2268\ufe00',
+     'lvnE;': '\u2268\ufe00',
++    'macr': '\xaf',
+     'macr;': '\xaf',
+-    'macr': '\xaf',
+     'male;': '\u2642',
+     'malt;': '\u2720',
+     'maltese;': '\u2720',
+@@ -1359,13 +1359,13 @@
+     'Mfr;': '\U0001d510',
+     'mfr;': '\U0001d52a',
+     'mho;': '\u2127',
++    'micro': '\xb5',
+     'micro;': '\xb5',
+-    'micro': '\xb5',
+     'mid;': '\u2223',
+     'midast;': '*',
+     'midcir;': '\u2af0',
++    'middot': '\xb7',
+     'middot;': '\xb7',
+-    'middot': '\xb7',
+     'minus;': '\u2212',
+     'minusb;': '\u229f',
+     'minusd;': '\u2238',
+@@ -1397,8 +1397,8 @@
+     'natur;': '\u266e',
+     'natural;': '\u266e',
+     'naturals;': '\u2115',
++    'nbsp': '\xa0',
+     'nbsp;': '\xa0',
+-    'nbsp': '\xa0',
+     'nbump;': '\u224e\u0338',
+     'nbumpe;': '\u224f\u0338',
+     'ncap;': '\u2a43',
+@@ -1427,7 +1427,7 @@
+     'nesim;': '\u2242\u0338',
+     'NestedGreaterGreater;': '\u226b',
+     'NestedLessLess;': '\u226a',
+-    'NewLine;': '\u240a',
++    'NewLine;': '\n',
+     'nexist;': '\u2204',
+     'nexists;': '\u2204',
+     'Nfr;': '\U0001d511',
+@@ -1479,9 +1479,9 @@
+     'NonBreakingSpace;': '\xa0',
+     'Nopf;': '\u2115',
+     'nopf;': '\U0001d55f',
++    'not': '\xac',
+     'Not;': '\u2aec',
+     'not;': '\xac',
+-    'not': '\xac',
+     'NotCongruent;': '\u2262',
+     'NotCupCap;': '\u226d',
+     'NotDoubleVerticalBar;': '\u2226',
+@@ -1590,10 +1590,10 @@
+     'nsupseteq;': '\u2289',
+     'nsupseteqq;': '\u2ac6\u0338',
+     'ntgl;': '\u2279',
++    'Ntilde': '\xd1',
++    'ntilde': '\xf1',
+     'Ntilde;': '\xd1',
+-    'Ntilde': '\xd1',
+     'ntilde;': '\xf1',
+-    'ntilde': '\xf1',
+     'ntlg;': '\u2278',
+     'ntriangleleft;': '\u22ea',
+     'ntrianglelefteq;': '\u22ec',
+@@ -1625,16 +1625,16 @@
+     'nwarr;': '\u2196',
+     'nwarrow;': '\u2196',
+     'nwnear;': '\u2927',
++    'Oacute': '\xd3',
++    'oacute': '\xf3',
+     'Oacute;': '\xd3',
+-    'Oacute': '\xd3',
+     'oacute;': '\xf3',
+-    'oacute': '\xf3',
+     'oast;': '\u229b',
+     'ocir;': '\u229a',
++    'Ocirc': '\xd4',
++    'ocirc': '\xf4',
+     'Ocirc;': '\xd4',
+-    'Ocirc': '\xd4',
+     'ocirc;': '\xf4',
+-    'ocirc': '\xf4',
+     'Ocy;': '\u041e',
+     'ocy;': '\u043e',
+     'odash;': '\u229d',
+@@ -1649,10 +1649,10 @@
+     'Ofr;': '\U0001d512',
+     'ofr;': '\U0001d52c',
+     'ogon;': '\u02db',
++    'Ograve': '\xd2',
++    'ograve': '\xf2',
+     'Ograve;': '\xd2',
+-    'Ograve': '\xd2',
+     'ograve;': '\xf2',
+-    'ograve': '\xf2',
+     'ogt;': '\u29c1',
+     'ohbar;': '\u29b5',
+     'ohm;': '\u03a9',
+@@ -1683,10 +1683,10 @@
+     'ord;': '\u2a5d',
+     'order;': '\u2134',
+     'orderof;': '\u2134',
++    'ordf': '\xaa',
+     'ordf;': '\xaa',
+-    'ordf': '\xaa',
++    'ordm': '\xba',
+     'ordm;': '\xba',
+-    'ordm': '\xba',
+     'origof;': '\u22b6',
+     'oror;': '\u2a56',
+     'orslope;': '\u2a57',
+@@ -1694,30 +1694,30 @@
+     'oS;': '\u24c8',
+     'Oscr;': '\U0001d4aa',
+     'oscr;': '\u2134',
++    'Oslash': '\xd8',
++    'oslash': '\xf8',
+     'Oslash;': '\xd8',
+-    'Oslash': '\xd8',
+     'oslash;': '\xf8',
+-    'oslash': '\xf8',
+     'osol;': '\u2298',
++    'Otilde': '\xd5',
++    'otilde': '\xf5',
+     'Otilde;': '\xd5',
+-    'Otilde': '\xd5',
+     'otilde;': '\xf5',
+-    'otilde': '\xf5',
+     'Otimes;': '\u2a37',
+     'otimes;': '\u2297',
+     'otimesas;': '\u2a36',
++    'Ouml': '\xd6',
++    'ouml': '\xf6',
+     'Ouml;': '\xd6',
+-    'Ouml': '\xd6',
+     'ouml;': '\xf6',
+-    'ouml': '\xf6',
+     'ovbar;': '\u233d',
+     'OverBar;': '\u203e',
+     'OverBrace;': '\u23de',
+     'OverBracket;': '\u23b4',
+     'OverParenthesis;': '\u23dc',
+     'par;': '\u2225',
++    'para': '\xb6',
+     'para;': '\xb6',
+-    'para': '\xb6',
+     'parallel;': '\u2225',
+     'parsim;': '\u2af3',
+     'parsl;': '\u2afd',
+@@ -1752,8 +1752,8 @@
+     'plusdu;': '\u2a25',
+     'pluse;': '\u2a72',
+     'PlusMinus;': '\xb1',
++    'plusmn': '\xb1',
+     'plusmn;': '\xb1',
+-    'plusmn': '\xb1',
+     'plussim;': '\u2a26',
+     'plustwo;': '\u2a27',
+     'pm;': '\xb1',
+@@ -1761,8 +1761,8 @@
+     'pointint;': '\u2a15',
+     'Popf;': '\u2119',
+     'popf;': '\U0001d561',
++    'pound': '\xa3',
+     'pound;': '\xa3',
+-    'pound': '\xa3',
+     'Pr;': '\u2abb',
+     'pr;': '\u227a',
+     'prap;': '\u2ab7',
+@@ -1815,10 +1815,10 @@
+     'quatint;': '\u2a16',
+     'quest;': '?',
+     'questeq;': '\u225f',
++    'QUOT': '"',
++    'quot': '"',
+     'QUOT;': '"',
+-    'QUOT': '"',
+     'quot;': '"',
+-    'quot': '"',
+     'rAarr;': '\u21db',
+     'race;': '\u223d\u0331',
+     'Racute;': '\u0154',
+@@ -1826,12 +1826,12 @@
+     'radic;': '\u221a',
+     'raemptyv;': '\u29b3',
+     'Rang;': '\u27eb',
+-    'rang;': '\u232a',
++    'rang;': '\u27e9',
+     'rangd;': '\u2992',
+     'range;': '\u29a5',
+-    'rangle;': '\u232a',
++    'rangle;': '\u27e9',
++    'raquo': '\xbb',
+     'raquo;': '\xbb',
+-    'raquo': '\xbb',
+     'Rarr;': '\u21a0',
+     'rArr;': '\u21d2',
+     'rarr;': '\u2192',
+@@ -1879,10 +1879,10 @@
+     'realpart;': '\u211c',
+     'reals;': '\u211d',
+     'rect;': '\u25ad',
++    'REG': '\xae',
++    'reg': '\xae',
+     'REG;': '\xae',
+-    'REG': '\xae',
+     'reg;': '\xae',
+-    'reg': '\xae',
+     'ReverseElement;': '\u220b',
+     'ReverseEquilibrium;': '\u21cb',
+     'ReverseUpEquilibrium;': '\u296f',
+@@ -1897,7 +1897,7 @@
+     'Rho;': '\u03a1',
+     'rho;': '\u03c1',
+     'rhov;': '\u03f1',
+-    'RightAngleBracket;': '\u232a',
++    'RightAngleBracket;': '\u27e9',
+     'RightArrow;': '\u2192',
+     'Rightarrow;': '\u21d2',
+     'rightarrow;': '\u2192',
+@@ -1997,8 +1997,8 @@
+     'seArr;': '\u21d8',
+     'searr;': '\u2198',
+     'searrow;': '\u2198',
++    'sect': '\xa7',
+     'sect;': '\xa7',
+-    'sect': '\xa7',
+     'semi;': ';',
+     'seswar;': '\u2929',
+     'setminus;': '\u2216',
+@@ -2018,8 +2018,8 @@
+     'shortparallel;': '\u2225',
+     'ShortRightArrow;': '\u2192',
+     'ShortUpArrow;': '\u2191',
++    'shy': '\xad',
+     'shy;': '\xad',
+-    'shy': '\xad',
+     'Sigma;': '\u03a3',
+     'sigma;': '\u03c3',
+     'sigmaf;': '\u03c2',
+@@ -2128,14 +2128,14 @@
+     'Sum;': '\u2211',
+     'sum;': '\u2211',
+     'sung;': '\u266a',
++    'sup1': '\xb9',
++    'sup1;': '\xb9',
++    'sup2': '\xb2',
++    'sup2;': '\xb2',
++    'sup3': '\xb3',
++    'sup3;': '\xb3',
+     'Sup;': '\u22d1',
+     'sup;': '\u2283',
+-    'sup1;': '\xb9',
+-    'sup1': '\xb9',
+-    'sup2;': '\xb2',
+-    'sup2': '\xb2',
+-    'sup3;': '\xb3',
+-    'sup3': '\xb3',
+     'supdot;': '\u2abe',
+     'supdsub;': '\u2ad8',
+     'supE;': '\u2ac6',
+@@ -2164,9 +2164,9 @@
+     'swarr;': '\u2199',
+     'swarrow;': '\u2199',
+     'swnwar;': '\u292a',
++    'szlig': '\xdf',
+     'szlig;': '\xdf',
+-    'szlig': '\xdf',
+-    'Tab;': '\u2409',
++    'Tab;': '\t',
+     'target;': '\u2316',
+     'Tau;': '\u03a4',
+     'tau;': '\u03c4',
+@@ -2177,7 +2177,7 @@
+     'tcedil;': '\u0163',
+     'Tcy;': '\u0422',
+     'tcy;': '\u0442',
+-    'tdot;': '\u25cc\u20db',
++    'tdot;': '\u20db',
+     'telrec;': '\u2315',
+     'Tfr;': '\U0001d517',
+     'tfr;': '\U0001d531',
+@@ -2195,17 +2195,17 @@
+     'ThinSpace;': '\u2009',
+     'thkap;': '\u2248',
+     'thksim;': '\u223c',
++    'THORN': '\xde',
++    'thorn': '\xfe',
+     'THORN;': '\xde',
+-    'THORN': '\xde',
+     'thorn;': '\xfe',
+-    'thorn': '\xfe',
+     'Tilde;': '\u223c',
+     'tilde;': '\u02dc',
+     'TildeEqual;': '\u2243',
+     'TildeFullEqual;': '\u2245',
+     'TildeTilde;': '\u2248',
++    'times': '\xd7',
+     'times;': '\xd7',
+-    'times': '\xd7',
+     'timesb;': '\u22a0',
+     'timesbar;': '\u2a31',
+     'timesd;': '\u2a30',
+@@ -2231,7 +2231,7 @@
+     'tridot;': '\u25ec',
+     'trie;': '\u225c',
+     'triminus;': '\u2a3a',
+-    'TripleDot;': '\u25cc\u20db',
++    'TripleDot;': '\u20db',
+     'triplus;': '\u2a39',
+     'trisb;': '\u29cd',
+     'tritime;': '\u2a3b',
+@@ -2247,10 +2247,10 @@
+     'twixt;': '\u226c',
+     'twoheadleftarrow;': '\u219e',
+     'twoheadrightarrow;': '\u21a0',
++    'Uacute': '\xda',
++    'uacute': '\xfa',
+     'Uacute;': '\xda',
+-    'Uacute': '\xda',
+     'uacute;': '\xfa',
+-    'uacute': '\xfa',
+     'Uarr;': '\u219f',
+     'uArr;': '\u21d1',
+     'uarr;': '\u2191',
+@@ -2259,10 +2259,10 @@
+     'ubrcy;': '\u045e',
+     'Ubreve;': '\u016c',
+     'ubreve;': '\u016d',
++    'Ucirc': '\xdb',
++    'ucirc': '\xfb',
+     'Ucirc;': '\xdb',
+-    'Ucirc': '\xdb',
+     'ucirc;': '\xfb',
+-    'ucirc': '\xfb',
+     'Ucy;': '\u0423',
+     'ucy;': '\u0443',
+     'udarr;': '\u21c5',
+@@ -2272,10 +2272,10 @@
+     'ufisht;': '\u297e',
+     'Ufr;': '\U0001d518',
+     'ufr;': '\U0001d532',
++    'Ugrave': '\xd9',
++    'ugrave': '\xf9',
+     'Ugrave;': '\xd9',
+-    'Ugrave': '\xd9',
+     'ugrave;': '\xf9',
+-    'ugrave': '\xf9',
+     'uHar;': '\u2963',
+     'uharl;': '\u21bf',
+     'uharr;': '\u21be',
+@@ -2286,8 +2286,8 @@
+     'ultri;': '\u25f8',
+     'Umacr;': '\u016a',
+     'umacr;': '\u016b',
++    'uml': '\xa8',
+     'uml;': '\xa8',
+-    'uml': '\xa8',
+     'UnderBar;': '_',
+     'UnderBrace;': '\u23df',
+     'UnderBracket;': '\u23b5',
+@@ -2334,10 +2334,10 @@
+     'utri;': '\u25b5',
+     'utrif;': '\u25b4',
+     'uuarr;': '\u21c8',
++    'Uuml': '\xdc',
++    'uuml': '\xfc',
+     'Uuml;': '\xdc',
+-    'Uuml': '\xdc',
+     'uuml;': '\xfc',
+-    'uuml': '\xfc',
+     'uwangle;': '\u29a7',
+     'vangrt;': '\u299c',
+     'varepsilon;': '\u03f5',
+@@ -2442,18 +2442,18 @@
+     'xutri;': '\u25b3',
+     'xvee;': '\u22c1',
+     'xwedge;': '\u22c0',
++    'Yacute': '\xdd',
++    'yacute': '\xfd',
+     'Yacute;': '\xdd',
+-    'Yacute': '\xdd',
+     'yacute;': '\xfd',
+-    'yacute': '\xfd',
+     'YAcy;': '\u042f',
+     'yacy;': '\u044f',
+     'Ycirc;': '\u0176',
+     'ycirc;': '\u0177',
+     'Ycy;': '\u042b',
+     'ycy;': '\u044b',
++    'yen': '\xa5',
+     'yen;': '\xa5',
+-    'yen': '\xa5',
+     'Yfr;': '\U0001d51c',
+     'yfr;': '\U0001d536',
+     'YIcy;': '\u0407',
+@@ -2464,9 +2464,9 @@
+     'yscr;': '\U0001d4ce',
+     'YUcy;': '\u042e',
+     'yucy;': '\u044e',
++    'yuml': '\xff',
+     'Yuml;': '\u0178',
+     'yuml;': '\xff',
+-    'yuml': '\xff',
+     'Zacute;': '\u0179',
+     'zacute;': '\u017a',
+     'Zcaron;': '\u017d',
+diff -r bd8afb90ebf2 Lib/http/client.py
+--- a/Lib/http/client.py
++++ b/Lib/http/client.py
+@@ -332,7 +332,7 @@
+                 # empty version will cause next test to fail.
+                 version = ""
+         if not version.startswith("HTTP/"):
+-            self.close()
++            self._close_conn()
+             raise BadStatusLine(line)
+ 
+         # The status code is a three-digit number
+@@ -454,22 +454,25 @@
+         # otherwise, assume it will close
+         return True
+ 
++    def _close_conn(self):
++        fp = self.fp
++        self.fp = None
++        fp.close()
++
+     def close(self):
++        super().close() # set "closed" flag
+         if self.fp:
+-            self.fp.close()
+-            self.fp = None
++            self._close_conn()
+ 
+     # These implementations are for the benefit of io.BufferedReader.
+ 
+     # XXX This class should probably be revised to act more like
+     # the "raw stream" that BufferedReader expects.
+ 
+-    @property
+-    def closed(self):
+-        return self.isclosed()
+-
+     def flush(self):
+-        self.fp.flush()
++        super().flush()
++        if self.fp:
++            self.fp.flush()
+ 
+     def readable(self):
+         return True
+@@ -477,6 +480,7 @@
+     # End of "raw stream" methods
+ 
+     def isclosed(self):
++        """True if the connection is closed."""
+         # NOTE: it is possible that we will not ever call self.close(). This
+         #       case occurs when will_close is TRUE, length is None, and we
+         #       read up to the last byte, but NOT past it.
+@@ -490,7 +494,7 @@
+             return b""
+ 
+         if self._method == "HEAD":
+-            self.close()
++            self._close_conn()
+             return b""
+ 
+         if amt is not None:
+@@ -507,9 +511,13 @@
+             if self.length is None:
+                 s = self.fp.read()
+             else:
+-                s = self._safe_read(self.length)
++                try:
++                    s = self._safe_read(self.length)
++                except IncompleteRead:
++                    self._close_conn()
++                    raise
+                 self.length = 0
+-            self.close()        # we read everything
++            self._close_conn()        # we read everything
+             return s
+ 
+     def readinto(self, b):
+@@ -517,7 +525,7 @@
+             return 0
+ 
+         if self._method == "HEAD":
+-            self.close()
++            self._close_conn()
+             return 0
+ 
+         if self.chunked:
+@@ -532,10 +540,14 @@
+         # connection, and the user is reading more bytes than will be provided
+         # (for example, reading in 1k chunks)
+         n = self.fp.readinto(b)
+-        if self.length is not None:
++        if not n:
++            # Ideally, we would raise IncompleteRead if the content-length
++            # wasn't satisfied, but it might break compatibility.
++            self._close_conn()
++        elif self.length is not None:
+             self.length -= n
+             if not self.length:
+-                self.close()
++                self._close_conn()
+         return n
+ 
+     def _read_next_chunk_size(self):
+@@ -551,7 +563,7 @@
+         except ValueError:
+             # close the connection as protocol synchronisation is
+             # probably lost
+-            self.close()
++            self._close_conn()
+             raise
+ 
+     def _read_and_discard_trailer(self):
+@@ -589,7 +601,7 @@
+         self._read_and_discard_trailer()
+ 
+         # we read everything; close the "file"
+-        self.close()
++        self._close_conn()
+ 
+         return b''.join(value)
+ 
+@@ -630,7 +642,7 @@
+         self._read_and_discard_trailer()
+ 
+         # we read everything; close the "file"
+-        self.close()
++        self._close_conn()
+ 
+         return total_bytes
+ 
+diff -r bd8afb90ebf2 Lib/http/cookiejar.py
+--- a/Lib/http/cookiejar.py
++++ b/Lib/http/cookiejar.py
+@@ -1825,7 +1825,7 @@
+ 
+ class LWPCookieJar(FileCookieJar):
+     """
+-    The LWPCookieJar saves a sequence of"Set-Cookie3" lines.
++    The LWPCookieJar saves a sequence of "Set-Cookie3" lines.
+     "Set-Cookie3" is the format used by the libwww-perl libary, not known
+     to be compatible with any browser, but which is easy to read and
+     doesn't lose information about RFC 2965 cookies.
+@@ -1837,7 +1837,7 @@
+     """
+ 
+     def as_lwp_str(self, ignore_discard=True, ignore_expires=True):
+-        """Return cookies as a string of "\n"-separated "Set-Cookie3" headers.
++        """Return cookies as a string of "\\n"-separated "Set-Cookie3" headers.
+ 
+         ignore_discard and ignore_expires: see docstring for FileCookieJar.save
+ 
+diff -r bd8afb90ebf2 Lib/idlelib/CallTips.py
+--- a/Lib/idlelib/CallTips.py
++++ b/Lib/idlelib/CallTips.py
+@@ -211,7 +211,7 @@
+     def test_builtins():
+         # if first line of a possibly multiline compiled docstring changes,
+         # must change corresponding test string
+-        test('int',  "int(x[, base]) -> integer")
++        test('int',  "int(x=0) -> integer")
+         test('Int',  Int.__doc__)
+         test('types.MethodType', "method(function, instance)")
+         test('list', "list() -> new empty list")
+diff -r bd8afb90ebf2 Lib/idlelib/EditorWindow.py
+--- a/Lib/idlelib/EditorWindow.py
++++ b/Lib/idlelib/EditorWindow.py
+@@ -170,13 +170,15 @@
+                 'recent-files.lst')
+         self.text_frame = text_frame = Frame(top)
+         self.vbar = vbar = Scrollbar(text_frame, name='vbar')
+-        self.width = idleConf.GetOption('main','EditorWindow','width')
++        self.width = idleConf.GetOption('main', 'EditorWindow',
++                                        'width', type='int')
+         text_options = {
+                 'name': 'text',
+                 'padx': 5,
+                 'wrap': 'none',
+                 'width': self.width,
+-                'height': idleConf.GetOption('main', 'EditorWindow', 'height')}
++                'height': idleConf.GetOption('main', 'EditorWindow',
++                                             'height', type='int')}
+         if TkVersion >= 8.5:
+             # Starting with tk 8.5 we have to set the new tabstyle option
+             # to 'wordprocessor' to achieve the same display of tabs as in
+@@ -253,7 +255,8 @@
+         if idleConf.GetOption('main', 'EditorWindow', 'font-bold', type='bool'):
+             fontWeight='bold'
+         text.config(font=(idleConf.GetOption('main', 'EditorWindow', 'font'),
+-                          idleConf.GetOption('main', 'EditorWindow', 'font-size'),
++                          idleConf.GetOption('main', 'EditorWindow',
++                                             'font-size', type='int'),
+                           fontWeight))
+         text_frame.pack(side=LEFT, fill=BOTH, expand=1)
+         text.pack(side=TOP, fill=BOTH, expand=1)
+@@ -268,7 +271,8 @@
+         # Although use-spaces=0 can be configured manually in config-main.def,
+         # configuration of tabs v. spaces is not supported in the configuration
+         # dialog.  IDLE promotes the preferred Python indentation: use spaces!
+-        usespaces = idleConf.GetOption('main', 'Indent', 'use-spaces', type='bool')
++        usespaces = idleConf.GetOption('main', 'Indent',
++                                       'use-spaces', type='bool')
+         self.usetabs = not usespaces
+ 
+         # tabwidth is the display width of a literal tab character.
+@@ -382,9 +386,11 @@
+             self.text.tag_remove("sel", "1.0", "end")
+         else:
+             if not self.text.index("sel.first"):
+-                self.text.mark_set("my_anchor", "insert")  # there was no previous selection
++                # there was no previous selection
++                self.text.mark_set("my_anchor", "insert")
+             else:
+-                if self.text.compare(self.text.index("sel.first"), "<", self.text.index("insert")):
++                if self.text.compare(self.text.index("sel.first"), "<",
++                                     self.text.index("insert")):
+                     self.text.mark_set("my_anchor", "sel.first") # extend back
+                 else:
+                     self.text.mark_set("my_anchor", "sel.last") # extend forward
+@@ -464,7 +470,6 @@
+     rmenu = None
+ 
+     def right_menu_event(self, event):
+-        self.text.tag_remove("sel", "1.0", "end")
+         self.text.mark_set("insert", "@%d,%d" % (event.x, event.y))
+         if not self.rmenu:
+             self.make_rmenu()
+@@ -473,23 +478,53 @@
+         iswin = sys.platform[:3] == 'win'
+         if iswin:
+             self.text.config(cursor="arrow")
++
++        for label, eventname, verify_state in self.rmenu_specs:
++            if verify_state is None:
++                continue
++            state = getattr(self, verify_state)()
++            rmenu.entryconfigure(label, state=state)
++
++
+         rmenu.tk_popup(event.x_root, event.y_root)
+         if iswin:
+             self.text.config(cursor="ibeam")
+ 
+     rmenu_specs = [
+-        # ("Label", "<<virtual-event>>"), ...
+-        ("Close", "<<close-window>>"), # Example
++        # ("Label", "<<virtual-event>>", "statefuncname"), ...
++        ("Close", "<<close-window>>", None), # Example
+     ]
+ 
+     def make_rmenu(self):
+         rmenu = Menu(self.text, tearoff=0)
+-        for label, eventname in self.rmenu_specs:
+-            def command(text=self.text, eventname=eventname):
+-                text.event_generate(eventname)
+-            rmenu.add_command(label=label, command=command)
++        for label, eventname, _ in self.rmenu_specs:
++            if label is not None:
++                def command(text=self.text, eventname=eventname):
++                    text.event_generate(eventname)
++                rmenu.add_command(label=label, command=command)
++            else:
++                rmenu.add_separator()
+         self.rmenu = rmenu
+ 
++    def rmenu_check_cut(self):
++        return self.rmenu_check_copy()
++
++    def rmenu_check_copy(self):
++        try:
++            indx = self.text.index('sel.first')
++        except TclError:
++            return 'disabled'
++        else:
++            return 'normal' if indx else 'disabled'
++
++    def rmenu_check_paste(self):
++        try:
++            self.text.tk.call('tk::GetSelection', self.text, 'CLIPBOARD')
++        except TclError:
++            return 'disabled'
++        else:
++            return 'normal'
++
+     def about_dialog(self, event=None):
+         aboutDialog.AboutDialog(self.top,'About IDLE')
+ 
+@@ -737,7 +772,8 @@
+         if idleConf.GetOption('main','EditorWindow','font-bold',type='bool'):
+             fontWeight='bold'
+         self.text.config(font=(idleConf.GetOption('main','EditorWindow','font'),
+-                idleConf.GetOption('main','EditorWindow','font-size'),
++                idleConf.GetOption('main','EditorWindow','font-size',
++                                   type='int'),
+                 fontWeight))
+ 
+     def RemoveKeybindings(self):
+@@ -1585,7 +1621,7 @@
+                 tokens = _tokenize.generate_tokens(self.readline)
+                 for token in tokens:
+                     self.tokeneater(*token)
+-            except _tokenize.TokenError:
++            except (_tokenize.TokenError, SyntaxError):
+                 # since we cut off the tokenizer early, we can trigger
+                 # spurious errors
+                 pass
+diff -r bd8afb90ebf2 Lib/idlelib/FormatParagraph.py
+--- a/Lib/idlelib/FormatParagraph.py
++++ b/Lib/idlelib/FormatParagraph.py
+@@ -32,7 +32,8 @@
+         self.editwin = None
+ 
+     def format_paragraph_event(self, event):
+-        maxformatwidth = int(idleConf.GetOption('main','FormatParagraph','paragraph'))
++        maxformatwidth = int(idleConf.GetOption('main', 'FormatParagraph',
++                                                'paragraph', type='int'))
+         text = self.editwin.text
+         first, last = self.editwin.get_selection_indices()
+         if first and last:
+@@ -46,7 +47,8 @@
+             lines = data.split("\n")
+             lines = map(lambda st, l=len(comment_header): st[l:], lines)
+             data = "\n".join(lines)
+-            # Reformat to maxformatwidth chars or a 20 char width, whichever is greater.
++            # Reformat to maxformatwidth chars or a 20 char width,
++            # whichever is greater.
+             format_width = max(maxformatwidth - len(comment_header), 20)
+             newdata = reformat_paragraph(data, format_width)
+             # re-split and re-insert the comment header.
+diff -r bd8afb90ebf2 Lib/idlelib/HyperParser.py
+--- a/Lib/idlelib/HyperParser.py
++++ b/Lib/idlelib/HyperParser.py
+@@ -232,6 +232,11 @@
+                     pass
+                 else:
+                     # We can't continue after other types of brackets
++                    if rawtext[pos] in "'\"":
++                        # Scan a string prefix
++                        while pos > 0 and rawtext[pos - 1] in "rRbBuU":
++                            pos -= 1
++                        last_identifier_pos = pos
+                     break
+ 
+             else:
+diff -r bd8afb90ebf2 Lib/idlelib/IOBinding.py
+--- a/Lib/idlelib/IOBinding.py
++++ b/Lib/idlelib/IOBinding.py
+@@ -1,5 +1,6 @@
+ import os
+ import types
++import shlex
+ import sys
+ import codecs
+ import tempfile
+@@ -458,7 +459,7 @@
+         else: #no printing for this platform
+             printPlatform = False
+         if printPlatform:  #we can try to print for this platform
+-            command = command % filename
++            command = command % shlex.quote(filename)
+             pipe = os.popen(command, "r")
+             # things can get ugly on NT if there is no printer available.
+             output = pipe.read().strip()
+diff -r bd8afb90ebf2 Lib/idlelib/NEWS.txt
+--- a/Lib/idlelib/NEWS.txt
++++ b/Lib/idlelib/NEWS.txt
+@@ -1,3 +1,13 @@
++What's New in IDLE 3.3.1?
++=========================
++
++- Issue #16226: Fix IDLE Path Browser crash.
++  (Patch by Roger Serwy)
++
++- Issue #15853: Prevent IDLE crash on OS X when opening Preferences menu
++  with certain versions of Tk 8.5.  Initial patch by Kevin Walzer.
++
++
+ What's New in IDLE 3.3.0?
+ =========================
+ 
+diff -r bd8afb90ebf2 Lib/idlelib/OutputWindow.py
+--- a/Lib/idlelib/OutputWindow.py
++++ b/Lib/idlelib/OutputWindow.py
+@@ -52,7 +52,11 @@
+     # Our own right-button menu
+ 
+     rmenu_specs = [
+-        ("Go to file/line", "<<goto-file-line>>"),
++        ("Cut", "<<cut>>", "rmenu_check_cut"),
++        ("Copy", "<<copy>>", "rmenu_check_copy"),
++        ("Paste", "<<paste>>", "rmenu_check_paste"),
++        (None, None, None),
++        ("Go to file/line", "<<goto-file-line>>", None),
+     ]
+ 
+     file_line_pats = [
+diff -r bd8afb90ebf2 Lib/idlelib/PathBrowser.py
+--- a/Lib/idlelib/PathBrowser.py
++++ b/Lib/idlelib/PathBrowser.py
+@@ -75,7 +75,7 @@
+         suffixes += importlib.machinery.SOURCE_SUFFIXES[:]
+         suffixes += importlib.machinery.BYTECODE_SUFFIXES[:]
+         sorted = []
+-        for suff, mode, flag in suffixes:
++        for suff in suffixes:
+             i = -len(suff)
+             for name in allnames[:]:
+                 normed_name = os.path.normcase(name)
+diff -r bd8afb90ebf2 Lib/idlelib/PyShell.py
+--- a/Lib/idlelib/PyShell.py
++++ b/Lib/idlelib/PyShell.py
+@@ -117,8 +117,14 @@
+             old_hook()
+         self.io.set_filename_change_hook(filename_changed_hook)
+ 
+-    rmenu_specs = [("Set Breakpoint", "<<set-breakpoint-here>>"),
+-                   ("Clear Breakpoint", "<<clear-breakpoint-here>>")]
++    rmenu_specs = [
++        ("Cut", "<<cut>>", "rmenu_check_cut"),
++        ("Copy", "<<copy>>", "rmenu_check_copy"),
++        ("Paste", "<<paste>>", "rmenu_check_paste"),
++        (None, None, None),
++        ("Set Breakpoint", "<<set-breakpoint-here>>", None),
++        ("Clear Breakpoint", "<<clear-breakpoint-here>>", None)
++    ]
+ 
+     def set_breakpoint(self, lineno):
+         text = self.text
+@@ -411,10 +417,8 @@
+         except socket.timeout as err:
+             self.display_no_subprocess_error()
+             return None
+-        # Can't regiter self.tkconsole.stdin, since run.py wants to
+-        # call non-TextIO methods on it (such as getvar)
+-        # XXX should be renamed to "console"
+-        self.rpcclt.register("stdin", self.tkconsole)
++        self.rpcclt.register("console", self.tkconsole)
++        self.rpcclt.register("stdin", self.tkconsole.stdin)
+         self.rpcclt.register("stdout", self.tkconsole.stdout)
+         self.rpcclt.register("stderr", self.tkconsole.stderr)
+         self.rpcclt.register("flist", self.tkconsole.flist)
+@@ -858,10 +862,10 @@
+         self.save_stderr = sys.stderr
+         self.save_stdin = sys.stdin
+         from idlelib import IOBinding
+-        self.stdin = PseudoInputFile(self)
+-        self.stdout = PseudoFile(self, "stdout", IOBinding.encoding)
+-        self.stderr = PseudoFile(self, "stderr", IOBinding.encoding)
+-        self.console = PseudoFile(self, "console", IOBinding.encoding)
++        self.stdin = PseudoInputFile(self, "stdin", IOBinding.encoding)
++        self.stdout = PseudoOutputFile(self, "stdout", IOBinding.encoding)
++        self.stderr = PseudoOutputFile(self, "stderr", IOBinding.encoding)
++        self.console = PseudoOutputFile(self, "console", IOBinding.encoding)
+         if not use_subprocess:
+             sys.stdout = self.stdout
+             sys.stderr = self.stderr
+@@ -1256,36 +1260,95 @@
+                 raise KeyboardInterrupt
+         return count
+ 
+-class PseudoFile(object):
++    def rmenu_check_cut(self):
++        try:
++            if self.text.compare('sel.first', '<', 'iomark'):
++                return 'disabled'
++        except TclError: # no selection, so the index 'sel.first' doesn't exist
++            return 'disabled'
++        return super().rmenu_check_cut()
++
++    def rmenu_check_paste(self):
++        if self.text.compare('insert','<','iomark'):
++            return 'disabled'
++        return super().rmenu_check_paste()
++
++class PseudoFile(io.TextIOBase):
+ 
+     def __init__(self, shell, tags, encoding=None):
+         self.shell = shell
+         self.tags = tags
+-        self.encoding = encoding
++        self._encoding = encoding
++
++    @property
++    def encoding(self):
++        return self._encoding
++
++    @property
++    def name(self):
++        return '<%s>' % self.tags
++
++    def isatty(self):
++        return True
++
++
++class PseudoOutputFile(PseudoFile):
++
++    def writable(self):
++        return True
+ 
+     def write(self, s):
++        if self.closed:
++            raise ValueError("write to closed file")
+         if not isinstance(s, str):
+             raise TypeError('must be str, not ' + type(s).__name__)
+         return self.shell.write(s, self.tags)
+ 
+-    def writelines(self, lines):
+-        for line in lines:
+-            self.write(line)
+ 
+-    def flush(self):
+-        pass
++class PseudoInputFile(PseudoFile):
+ 
+-    def isatty(self):
++    def __init__(self, shell, tags, encoding=None):
++        PseudoFile.__init__(self, shell, tags, encoding)
++        self._line_buffer = ''
++
++    def readable(self):
+         return True
+ 
+-class PseudoInputFile(object):
+-    def __init__(self, shell):
+-        self.readline = shell.readline
+-        self.isatty = shell.isatty
++    def read(self, size=-1):
++        if self.closed:
++            raise ValueError("read from closed file")
++        if size is None:
++            size = -1
++        elif not isinstance(size, int):
++            raise TypeError('must be int, not ' + type(size).__name__)
++        result = self._line_buffer
++        self._line_buffer = ''
++        if size < 0:
++            while True:
++                line = self.shell.readline()
++                if not line: break
++                result += line
++        else:
++            while len(result) < size:
++                line = self.shell.readline()
++                if not line: break
++                result += line
++            self._line_buffer = result[size:]
++            result = result[:size]
++        return result
+ 
+-    def write(self, s):
+-        raise io.UnsupportedOperation("not writable")
+-    writelines = write
++    def readline(self, size=-1):
++        if self.closed:
++            raise ValueError("read from closed file")
++        if size is None:
++            size = -1
++        elif not isinstance(size, int):
++            raise TypeError('must be int, not ' + type(size).__name__)
++        line = self._line_buffer or self.shell.readline()
++        if size < 0:
++            size = len(line)
++        self._line_buffer = line[size:]
++        return line[:size]
+ 
+ 
+ usage_msg = """\
+diff -r bd8afb90ebf2 Lib/idlelib/config-extensions.def
+--- a/Lib/idlelib/config-extensions.def
++++ b/Lib/idlelib/config-extensions.def
+@@ -46,6 +46,8 @@
+ 
+ [ScriptBinding]
+ enable=1
++enable_shell=0
++enable_editor=1
+ [ScriptBinding_cfgBindings]
+ run-module=<Key-F5>
+ check-module=<Alt-Key-x>
+diff -r bd8afb90ebf2 Lib/idlelib/configDialog.py
+--- a/Lib/idlelib/configDialog.py
++++ b/Lib/idlelib/configDialog.py
+@@ -821,10 +821,9 @@
+             fontWeight=tkFont.BOLD
+         else:
+             fontWeight=tkFont.NORMAL
+-        size=self.fontSize.get()
+-        self.editFont.config(size=size,
+-                weight=fontWeight,family=fontName)
+-        self.textHighlightSample.configure(font=(fontName, size, fontWeight))
++        newFont = (fontName, self.fontSize.get(), fontWeight)
++        self.labelFontSample.config(font=newFont)
++        self.textHighlightSample.configure(font=newFont)
+ 
+     def SetHighlightTarget(self):
+         if self.highlightTarget.get()=='Cursor': #bg not possible
+@@ -926,7 +925,7 @@
+         for font in fonts:
+             self.listFontName.insert(END,font)
+         configuredFont=idleConf.GetOption('main','EditorWindow','font',
+-                default='courier')
++                                          default='courier')
+         lc_configuredFont = configuredFont.lower()
+         self.fontName.set(lc_configuredFont)
+         lc_fonts = [s.lower() for s in fonts]
+@@ -936,13 +935,13 @@
+             self.listFontName.select_set(currentFontIndex)
+             self.listFontName.select_anchor(currentFontIndex)
+         ##font size dropdown
+-        fontSize=idleConf.GetOption('main','EditorWindow','font-size',
+-                default='10')
++        fontSize=idleConf.GetOption('main', 'EditorWindow', 'font-size',
++                                    type='int', default='10')
+         self.optMenuFontSize.SetMenu(('7','8','9','10','11','12','13','14',
+-                '16','18','20','22'),fontSize )
++                                      '16','18','20','22'), fontSize )
+         ##fontWeight
+         self.fontBold.set(idleConf.GetOption('main','EditorWindow',
+-                'font-bold',default=0,type='bool'))
++                                             'font-bold',default=0,type='bool'))
+         ##font sample
+         self.SetFontSample()
+ 
+@@ -1023,10 +1022,13 @@
+         self.autoSave.set(idleConf.GetOption('main', 'General', 'autosave',
+                                              default=0, type='bool'))
+         #initial window size
+-        self.winWidth.set(idleConf.GetOption('main','EditorWindow','width'))
+-        self.winHeight.set(idleConf.GetOption('main','EditorWindow','height'))
++        self.winWidth.set(idleConf.GetOption('main','EditorWindow','width',
++                                             type='int'))
++        self.winHeight.set(idleConf.GetOption('main','EditorWindow','height',
++                                              type='int'))
+         #initial paragraph reformat size
+-        self.paraWidth.set(idleConf.GetOption('main','FormatParagraph','paragraph'))
++        self.paraWidth.set(idleConf.GetOption('main','FormatParagraph','paragraph',
++                                              type='int'))
+         # default source encoding
+         self.encoding.set(idleConf.GetOption('main', 'EditorWindow',
+                                              'encoding', default='none'))
+diff -r bd8afb90ebf2 Lib/idlelib/configHandler.py
+--- a/Lib/idlelib/configHandler.py
++++ b/Lib/idlelib/configHandler.py
+@@ -37,7 +37,7 @@
+         cfgFile - string, fully specified configuration file name
+         """
+         self.file=cfgFile
+-        ConfigParser.__init__(self,defaults=cfgDefaults)
++        ConfigParser.__init__(self, defaults=cfgDefaults, strict=False)
+ 
+     def Get(self, section, option, type=None, default=None, raw=False):
+         """
+@@ -238,24 +238,39 @@
+         printed to stderr.
+ 
+         """
+-        if self.userCfg[configType].has_option(section,option):
+-            return self.userCfg[configType].Get(section, option,
+-                                                type=type, raw=raw)
+-        elif self.defaultCfg[configType].has_option(section,option):
+-            return self.defaultCfg[configType].Get(section, option,
+-                                                   type=type, raw=raw)
+-        else: #returning default, print warning
+-            if warn_on_default:
+-                warning = ('\n Warning: configHandler.py - IdleConf.GetOption -\n'
+-                           ' problem retrieving configuration option %r\n'
+-                           ' from section %r.\n'
+-                           ' returning default value: %r\n' %
+-                           (option, section, default))
+-                try:
+-                    sys.stderr.write(warning)
+-                except IOError:
+-                    pass
+-            return default
++        try:
++            if self.userCfg[configType].has_option(section,option):
++                return self.userCfg[configType].Get(section, option,
++                                                    type=type, raw=raw)
++        except ValueError:
++            warning = ('\n Warning: configHandler.py - IdleConf.GetOption -\n'
++                       ' invalid %r value for configuration option %r\n'
++                       ' from section %r: %r\n' %
++                       (type, option, section,
++                        self.userCfg[configType].Get(section, option,
++                                                     raw=raw)))
++            try:
++                sys.stderr.write(warning)
++            except IOError:
++                pass
++        try:
++            if self.defaultCfg[configType].has_option(section,option):
++                return self.defaultCfg[configType].Get(section, option,
++                                                       type=type, raw=raw)
++        except ValueError:
++            pass
++        #returning default, print warning
++        if warn_on_default:
++            warning = ('\n Warning: configHandler.py - IdleConf.GetOption -\n'
++                       ' problem retrieving configuration option %r\n'
++                       ' from section %r.\n'
++                       ' returning default value: %r\n' %
++                       (option, section, default))
++            try:
++                sys.stderr.write(warning)
++            except IOError:
++                pass
++        return default
+ 
+     def SetOption(self, configType, section, option, value):
+         """In user's config file, set section's option to value.
+diff -r bd8afb90ebf2 Lib/idlelib/help.txt
+--- a/Lib/idlelib/help.txt
++++ b/Lib/idlelib/help.txt
+@@ -80,7 +80,7 @@
+ Debug Menu (only in Shell window):
+ 
+ 	Go to File/Line   -- look around the insert point for a filename
+-		             and linenumber, open the file, and show the line
++		             and line number, open the file, and show the line
+ 	Debugger (toggle) -- Run commands in the shell under the debugger
+ 	Stack Viewer      -- Show the stack traceback of the last exception
+ 	Auto-open Stack Viewer (toggle) -- Open stack viewer on traceback
+@@ -92,7 +92,7 @@
+                           Startup Preferences may be set, and Additional Help
+                           Sources can be specified.
+ 			  
+-			  On MacOS X this menu is not present, use
++			  On OS X this menu is not present, use
+ 			  menu 'IDLE -> Preferences...' instead.
+ 	---
+ 	Code Context --	  Open a pane at the top of the edit window which
+@@ -120,6 +120,24 @@
+ 	---
+ 	(Additional Help Sources may be added here)
+ 
++Edit context menu (Right-click / Control-click on OS X in Edit window):
++
++	Cut              -- Copy a selection into system-wide clipboard,
++                            then delete the selection
++	Copy             -- Copy selection into system-wide clipboard
++	Paste            -- Insert system-wide clipboard into window
++	Set Breakpoint   -- Sets a breakpoint (when debugger open)
++	Clear Breakpoint -- Clears the breakpoint on that line
++
++Shell context menu (Right-click / Control-click on OS X in Shell window):
++
++	Cut              -- Copy a selection into system-wide clipboard,
++                            then delete the selection
++	Copy             -- Copy selection into system-wide clipboard
++	Paste            -- Insert system-wide clipboard into window
++	---
++	Go to file/line  -- Same as in Debug menu
++
+ 
+ ** TIPS **
+ ==========
+@@ -222,7 +240,7 @@
+ 
+ 	Alt-p retrieves previous command matching what you have typed.
+ 	Alt-n retrieves next.
+-	      (These are Control-p, Control-n on the Mac)
++	      (These are Control-p, Control-n on OS X)
+ 	Return while cursor is on a previous command retrieves that command.
+ 	Expand word is also useful to reduce typing.
+ 
+diff -r bd8afb90ebf2 Lib/idlelib/run.py
+--- a/Lib/idlelib/run.py
++++ b/Lib/idlelib/run.py
+@@ -16,6 +16,8 @@
+ from idlelib import RemoteObjectBrowser
+ from idlelib import StackViewer
+ from idlelib import rpc
++from idlelib import PyShell
++from idlelib import IOBinding
+ 
+ import __main__
+ 
+@@ -171,15 +173,34 @@
+     efile = sys.stderr
+     typ, val, tb = excinfo = sys.exc_info()
+     sys.last_type, sys.last_value, sys.last_traceback = excinfo
+-    tbe = traceback.extract_tb(tb)
+-    print('Traceback (most recent call last):', file=efile)
+-    exclude = ("run.py", "rpc.py", "threading.py", "queue.py",
+-               "RemoteDebugger.py", "bdb.py")
+-    cleanup_traceback(tbe, exclude)
+-    traceback.print_list(tbe, file=efile)
+-    lines = traceback.format_exception_only(typ, val)
+-    for line in lines:
+-        print(line, end='', file=efile)
++    seen = set()
++
++    def print_exc(typ, exc, tb):
++        seen.add(exc)
++        context = exc.__context__
++        cause = exc.__cause__
++        if cause is not None and cause not in seen:
++            print_exc(type(cause), cause, cause.__traceback__)
++            print("\nThe above exception was the direct cause "
++                  "of the following exception:\n", file=efile)
++        elif (context is not None and
++              not exc.__suppress_context__ and
++              context not in seen):
++            print_exc(type(context), context, context.__traceback__)
++            print("\nDuring handling of the above exception, "
++                  "another exception occurred:\n", file=efile)
++        if tb:
++            tbe = traceback.extract_tb(tb)
++            print('Traceback (most recent call last):', file=efile)
++            exclude = ("run.py", "rpc.py", "threading.py", "queue.py",
++                       "RemoteDebugger.py", "bdb.py")
++            cleanup_traceback(tbe, exclude)
++            traceback.print_list(tbe, file=efile)
++        lines = traceback.format_exception_only(typ, exc)
++        for line in lines:
++            print(line, end='', file=efile)
++
++    print_exc(typ, val, tb)
+ 
+ def cleanup_traceback(tb, exclude):
+     "Remove excluded traces from beginning/end of tb; get cached lines"
+@@ -258,63 +279,24 @@
+             quitting = True
+             thread.interrupt_main()
+ 
+-class _RPCFile(io.TextIOBase):
+-    """Wrapper class for the RPC proxy to typecheck arguments
+-    that may not support pickling. The base class is there only
+-    to support type tests; all implementations come from the remote
+-    object."""
+-
+-    def __init__(self, rpc):
+-        super.__setattr__(self, 'rpc', rpc)
+-
+-    def __getattribute__(self, name):
+-        # When accessing the 'rpc' attribute, or 'write', use ours
+-        if name in ('rpc', 'write', 'writelines'):
+-            return io.TextIOBase.__getattribute__(self, name)
+-        # Else only look into the remote object only
+-        return getattr(self.rpc, name)
+-
+-    def __setattr__(self, name, value):
+-        return setattr(self.rpc, name, value)
+-
+-    @staticmethod
+-    def _ensure_string(func):
+-        def f(self, s):
+-            if not isinstance(s, str):
+-                raise TypeError('must be str, not ' + type(s).__name__)
+-            return func(self, s)
+-        return f
+-
+-class _RPCOutputFile(_RPCFile):
+-    @_RPCFile._ensure_string
+-    def write(self, s):
+-        if not isinstance(s, str):
+-            raise TypeError('must be str, not ' + type(s).__name__)
+-        return self.rpc.write(s)
+-
+-class _RPCInputFile(_RPCFile):
+-    @_RPCFile._ensure_string
+-    def write(self, s):
+-        raise io.UnsupportedOperation("not writable")
+-    writelines = write
+-
+ class MyHandler(rpc.RPCHandler):
+ 
+     def handle(self):
+         """Override base method"""
+         executive = Executive(self)
+         self.register("exec", executive)
+-        self.console = self.get_remote_proxy("stdin")
+-        sys.stdin = _RPCInputFile(self.console)
+-        sys.stdout = _RPCOutputFile(self.get_remote_proxy("stdout"))
+-        sys.stderr = _RPCOutputFile(self.get_remote_proxy("stderr"))
++        self.console = self.get_remote_proxy("console")
++        sys.stdin = PyShell.PseudoInputFile(self.console, "stdin",
++                IOBinding.encoding)
++        sys.stdout = PyShell.PseudoOutputFile(self.console, "stdout",
++                IOBinding.encoding)
++        sys.stderr = PyShell.PseudoOutputFile(self.console, "stderr",
++                IOBinding.encoding)
++
+         sys.displayhook = rpc.displayhook
+         # page help() text to shell.
+         import pydoc # import must be done here to capture i/o binding
+         pydoc.pager = pydoc.plainpager
+-        from idlelib import IOBinding
+-        sys.stdin.encoding = sys.stdout.encoding = \
+-                             sys.stderr.encoding = IOBinding.encoding
+         self.interp = self.get_remote_proxy("interp")
+         rpc.RPCHandler.getresponse(self, myseq=None, wait=0.05)
+ 
+diff -r bd8afb90ebf2 Lib/imaplib.py
+--- a/Lib/imaplib.py
++++ b/Lib/imaplib.py
+@@ -352,10 +352,10 @@
+ 
+                 data = authobject(response)
+ 
+-        It will be called to process server continuation responses.
+-        It should return data that will be encoded and sent to server.
+-        It should return None if the client abort response '*' should
+-        be sent instead.
++        It will be called to process server continuation responses; the
++        response argument it is passed will be a bytes.  It should return bytes
++        data that will be base64 encoded and sent to the server.  It should
++        return None if the client abort response '*' should be sent instead.
+         """
+         mech = mechanism.upper()
+         # XXX: shouldn't this code be removed, not commented out?
+@@ -538,7 +538,9 @@
+     def _CRAM_MD5_AUTH(self, challenge):
+         """ Authobject to use with CRAM-MD5 authentication. """
+         import hmac
+-        return self.user + " " + hmac.HMAC(self.password, challenge).hexdigest()
++        pwd = (self.password.encode('ASCII') if isinstance(self.password, str)
++                                             else self.password)
++        return self.user + " " + hmac.HMAC(pwd, challenge).hexdigest()
+ 
+ 
+     def logout(self):
+@@ -1178,7 +1180,7 @@
+                 ssl_context - a SSLContext object that contains your certificate chain
+                               and private key (default: None)
+                 Note: if ssl_context is provided, then parameters keyfile or
+-                certfile should not be set otherwise ValueError is thrown.
++                certfile should not be set otherwise ValueError is raised.
+ 
+         for more documentation see the docstring of the parent class IMAP4.
+         """
+@@ -1295,14 +1297,16 @@
+         #  so when it gets to the end of the 8-bit input
+         #  there's no partial 6-bit output.
+         #
+-        oup = ''
++        oup = b''
++        if isinstance(inp, str):
++            inp = inp.encode('ASCII')
+         while inp:
+             if len(inp) > 48:
+                 t = inp[:48]
+                 inp = inp[48:]
+             else:
+                 t = inp
+-                inp = ''
++                inp = b''
+             e = binascii.b2a_base64(t)
+             if e:
+                 oup = oup + e[:-1]
+@@ -1310,7 +1314,7 @@
+ 
+     def decode(self, inp):
+         if not inp:
+-            return ''
++            return b''
+         return binascii.a2b_base64(inp)
+ 
+ Months = ' Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ')
+diff -r bd8afb90ebf2 Lib/importlib/__init__.py
+--- a/Lib/importlib/__init__.py
++++ b/Lib/importlib/__init__.py
+@@ -55,7 +55,9 @@
+     value of 'path' given to the finders. None is returned if no loader could
+     be found.
+ 
+-    Dotted names do not have their parent packages implicitly imported.
++    Dotted names do not have their parent packages implicitly imported. You will
++    most likely need to explicitly import all parent packages in the proper
++    order for a submodule to get the correct loader.
+ 
+     """
+     try:
+diff -r bd8afb90ebf2 Lib/importlib/_bootstrap.py
+--- a/Lib/importlib/_bootstrap.py
++++ b/Lib/importlib/_bootstrap.py
+@@ -419,8 +419,8 @@
+     .pyc/.pyo file calculated as if the .py file were imported.  The extension
+     will be .pyc unless sys.flags.optimize is non-zero, then it will be .pyo.
+ 
+-    If debug_override is not None, then it must be a boolean and is taken as
+-    the value of bool(sys.flags.optimize) instead.
++    If debug_override is not None, then it must be a boolean and is used in
++    place of sys.flags.optimize.
+ 
+     If sys.implementation.cache_tag is None then NotImplementedError is raised.
+ 
+@@ -1048,6 +1048,9 @@
+             mode = _os.stat(source_path).st_mode
+         except OSError:
+             mode = 0o666
++        # We always ensure write access so we can update cached files
++        # later even when the source files are read-only on Windows (#6074)
++        mode |= 0o200
+         return self.set_data(bytecode_path, data, _mode=mode)
+ 
+     def set_data(self, path, data, *, _mode=0o666):
+@@ -1066,17 +1069,17 @@
+             except FileExistsError:
+                 # Probably another Python process already created the dir.
+                 continue
+-            except PermissionError:
+-                # If can't get proper access, then just forget about writing
+-                # the data.
++            except OSError as exc:
++                # Could be a permission error, read-only filesystem: just forget
++                # about writing the data.
++                _verbose_message('could not create {!r}: {!r}', parent, exc)
+                 return
+         try:
+             _write_atomic(path, data, _mode)
+             _verbose_message('created {!r}', path)
+-        except (PermissionError, FileExistsError):
+-            # Don't worry if you can't write bytecode or someone is writing
+-            # it at the same time.
+-            pass
++        except OSError as exc:
++            # Same as above: just don't write the bytecode.
++            _verbose_message('could not create {!r}: {!r}', path, exc)
+ 
+ 
+ class SourcelessFileLoader(FileLoader, _LoaderBasics):
+@@ -1156,7 +1159,7 @@
+     """Represents a namespace package's path.  It uses the module name
+     to find its parent module, and from there it looks up the parent's
+     __path__.  When this changes, the module's own path is recomputed,
+-    using path_finder.  For top-leve modules, the parent module's path
++    using path_finder.  For top-level modules, the parent module's path
+     is sys.path."""
+ 
+     def __init__(self, name, path, path_finder):
+@@ -1278,6 +1281,8 @@
+         #  the list of paths that will become its __path__
+         namespace_path = []
+         for entry in path:
++            if not isinstance(entry, (str, bytes)):
++                continue
+             finder = cls._path_importer_cache(entry)
+             if finder is not None:
+                 if hasattr(finder, 'find_loader'):
+@@ -1325,8 +1330,8 @@
+ 
+     def __init__(self, path, *details):
+         """Initialize with the path to search on and a variable number of
+-        3-tuples containing the loader, file suffixes the loader recognizes,
+-        and a boolean of whether the loader handles packages."""
++        2-tuples containing the loader and the file suffixes the loader
++        recognizes."""
+         loaders = []
+         for loader, suffixes in details:
+             loaders.extend((suffix, loader) for suffix in suffixes)
+@@ -1390,8 +1395,9 @@
+         path = self.path
+         try:
+             contents = _os.listdir(path)
+-        except FileNotFoundError:
+-            # Directory has been removed since last import
++        except (FileNotFoundError, PermissionError, NotADirectoryError):
++            # Directory has either been removed, turned into a file, or made
++            # unreadable.
+             contents = []
+         # We store two cached versions, to handle runtime changes of the
+         # PYTHONCASEOK environment variable.
+@@ -1602,19 +1608,19 @@
+                 fromlist.extend(module.__all__)
+         for x in fromlist:
+             if not hasattr(module, x):
++                from_name = '{}.{}'.format(module.__name__, x)
+                 try:
+-                    _call_with_frames_removed(import_,
+-                                      '{}.{}'.format(module.__name__, x))
++                    _call_with_frames_removed(import_, from_name)
+                 except ImportError as exc:
+                     # Backwards-compatibility dictates we ignore failed
+                     # imports triggered by fromlist for modules that don't
+                     # exist.
+                     # TODO(brett): In Python 3.4, have import raise
+                     #   ModuleNotFound and catch that.
+-                    if hasattr(exc, '_not_found') and exc._not_found:
+-                        pass
+-                    else:
+-                        raise
++                    if getattr(exc, '_not_found', False):
++                        if exc.name == from_name:
++                            continue
++                    raise
+     return module
+ 
+ 
+@@ -1669,7 +1675,11 @@
+         elif not name:
+             return module
+         else:
++            # Figure out where to slice the module's name up to the first dot
++            # in 'name'.
+             cut_off = len(name) - len(name.partition('.')[0])
++            # Slice end needs to be positive to alleviate need to special-case
++            # when ``'.' not in name``.
+             return sys.modules[module.__name__[:len(module.__name__)-cut_off]]
+     else:
+         return _handle_fromlist(module, fromlist, _gcd_import)
+@@ -1693,9 +1703,14 @@
+     else:
+         BYTECODE_SUFFIXES = DEBUG_BYTECODE_SUFFIXES
+ 
+-    for module in (_imp, sys):
+-        if not hasattr(module, '__loader__'):
+-            module.__loader__ = BuiltinImporter
++    module_type = type(sys)
++    for name, module in sys.modules.items():
++        if isinstance(module, module_type):
++            if not hasattr(module, '__loader__'):
++                if name in sys.builtin_module_names:
++                    module.__loader__ = BuiltinImporter
++                elif _imp.is_frozen(name):
++                    module.__loader__ = FrozenImporter
+ 
+     self_module = sys.modules[__name__]
+     for builtin_name in ('_io', '_warnings', 'builtins', 'marshal'):
+diff -r bd8afb90ebf2 Lib/inspect.py
+--- a/Lib/inspect.py
++++ b/Lib/inspect.py
+@@ -2028,19 +2028,19 @@
+ 
+         return self._bound_arguments_cls(self, arguments)
+ 
+-    def bind(self, *args, **kwargs):
++    def bind(__bind_self, *args, **kwargs):
+         '''Get a BoundArguments object, that maps the passed `args`
+         and `kwargs` to the function's signature.  Raises `TypeError`
+         if the passed arguments can not be bound.
+         '''
+-        return self._bind(args, kwargs)
++        return __bind_self._bind(args, kwargs)
+ 
+-    def bind_partial(self, *args, **kwargs):
++    def bind_partial(__bind_self, *args, **kwargs):
+         '''Get a BoundArguments object, that partially maps the
+         passed `args` and `kwargs` to the function's signature.
+         Raises `TypeError` if the passed arguments can not be bound.
+         '''
+-        return self._bind(args, kwargs, partial=True)
++        return __bind_self._bind(args, kwargs, partial=True)
+ 
+     def __str__(self):
+         result = []
+diff -r bd8afb90ebf2 Lib/io.py
+--- a/Lib/io.py
++++ b/Lib/io.py
+@@ -4,7 +4,7 @@
+ At the top of the I/O hierarchy is the abstract base class IOBase. It
+ defines the basic interface to a stream. Note, however, that there is no
+ separation between reading and writing to streams; implementations are
+-allowed to throw an IOError if they do not support a given operation.
++allowed to raise an IOError if they do not support a given operation.
+ 
+ Extending IOBase is RawIOBase which deals simply with the reading and
+ writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
+diff -r bd8afb90ebf2 Lib/ipaddress.py
+--- a/Lib/ipaddress.py
++++ b/Lib/ipaddress.py
+@@ -206,10 +206,11 @@
+     """Summarize a network range given the first and last IP addresses.
+ 
+     Example:
+-        >>> summarize_address_range(IPv4Address('192.0.2.0'),
+-            IPv4Address('192.0.2.130'))
++        >>> list(summarize_address_range(IPv4Address('192.0.2.0'),
++        ...                              IPv4Address('192.0.2.130')))
++        ...                                #doctest: +NORMALIZE_WHITESPACE
+         [IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/31'),
+-        IPv4Network('192.0.2.130/32')]
++         IPv4Network('192.0.2.130/32')]
+ 
+     Args:
+         first: the first IPv4Address or IPv6Address in the range.
+@@ -722,7 +723,7 @@
+             other: An IPv4Network or IPv6Network object of the same type.
+ 
+         Returns:
+-            An iterator of the the IPv(4|6)Network objects which is self
++            An iterator of the IPv(4|6)Network objects which is self
+             minus other.
+ 
+         Raises:
+diff -r bd8afb90ebf2 Lib/json/__init__.py
+--- a/Lib/json/__init__.py
++++ b/Lib/json/__init__.py
+@@ -39,8 +39,8 @@
+ Pretty printing::
+ 
+     >>> import json
+-    >>> s = json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)
+-    >>> print('\n'.join([l.rstrip() for l in  s.splitlines()]))
++    >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True,
++    ...                  indent=4, separators=(',', ': ')))
+     {
+         "4": 5,
+         "6": 7
+@@ -122,7 +122,7 @@
+ 
+ def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True,
+         allow_nan=True, cls=None, indent=None, separators=None,
+-        default=None, **kw):
++        default=None, sort_keys=False, **kw):
+     """Serialize ``obj`` as a JSON formatted stream to ``fp`` (a
+     ``.write()``-supporting file-like object).
+ 
+@@ -146,7 +146,9 @@
+     If ``indent`` is a non-negative integer, then JSON array elements and
+     object members will be pretty-printed with that indent level. An indent
+     level of 0 will only insert newlines. ``None`` is the most compact
+-    representation.
++    representation.  Since the default item separator is ``', '``,  the
++    output might include trailing whitespace when ``indent`` is specified.
++    You can use ``separators=(',', ': ')`` to avoid this.
+ 
+     If ``separators`` is an ``(item_separator, dict_separator)`` tuple
+     then it will be used instead of the default ``(', ', ': ')`` separators.
+@@ -155,6 +157,9 @@
+     ``default(obj)`` is a function that should return a serializable version
+     of obj or raise TypeError. The default simply raises TypeError.
+ 
++    If *sort_keys* is ``True`` (default: ``False``), then the output of
++    dictionaries will be sorted by key.
++
+     To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
+     ``.default()`` method to serialize additional types), specify it with
+     the ``cls`` kwarg; otherwise ``JSONEncoder`` is used.
+@@ -164,7 +169,7 @@
+     if (not skipkeys and ensure_ascii and
+         check_circular and allow_nan and
+         cls is None and indent is None and separators is None and
+-        default is None and not kw):
++        default is None and not sort_keys and not kw):
+         iterable = _default_encoder.iterencode(obj)
+     else:
+         if cls is None:
+@@ -172,7 +177,7 @@
+         iterable = cls(skipkeys=skipkeys, ensure_ascii=ensure_ascii,
+             check_circular=check_circular, allow_nan=allow_nan, indent=indent,
+             separators=separators,
+-            default=default, **kw).iterencode(obj)
++            default=default, sort_keys=sort_keys, **kw).iterencode(obj)
+     # could accelerate with writelines in some versions of Python, at
+     # a debuggability cost
+     for chunk in iterable:
+@@ -181,7 +186,7 @@
+ 
+ def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True,
+         allow_nan=True, cls=None, indent=None, separators=None,
+-        default=None, **kw):
++        default=None, sort_keys=False, **kw):
+     """Serialize ``obj`` to a JSON formatted ``str``.
+ 
+     If ``skipkeys`` is false then ``dict`` keys that are not basic types
+@@ -204,7 +209,9 @@
+     If ``indent`` is a non-negative integer, then JSON array elements and
+     object members will be pretty-printed with that indent level. An indent
+     level of 0 will only insert newlines. ``None`` is the most compact
+-    representation.
++    representation.  Since the default item separator is ``', '``,  the
++    output might include trailing whitespace when ``indent`` is specified.
++    You can use ``separators=(',', ': ')`` to avoid this.
+ 
+     If ``separators`` is an ``(item_separator, dict_separator)`` tuple
+     then it will be used instead of the default ``(', ', ': ')`` separators.
+@@ -213,6 +220,9 @@
+     ``default(obj)`` is a function that should return a serializable version
+     of obj or raise TypeError. The default simply raises TypeError.
+ 
++    If *sort_keys* is ``True`` (default: ``False``), then the output of
++    dictionaries will be sorted by key.
++
+     To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
+     ``.default()`` method to serialize additional types), specify it with
+     the ``cls`` kwarg; otherwise ``JSONEncoder`` is used.
+@@ -222,14 +232,14 @@
+     if (not skipkeys and ensure_ascii and
+         check_circular and allow_nan and
+         cls is None and indent is None and separators is None and
+-        default is None and not kw):
++        default is None and not sort_keys and not kw):
+         return _default_encoder.encode(obj)
+     if cls is None:
+         cls = JSONEncoder
+     return cls(
+         skipkeys=skipkeys, ensure_ascii=ensure_ascii,
+         check_circular=check_circular, allow_nan=allow_nan, indent=indent,
+-        separators=separators, default=default,
++        separators=separators, default=default, sort_keys=sort_keys,
+         **kw).encode(obj)
+ 
+ 
+diff -r bd8afb90ebf2 Lib/json/encoder.py
+--- a/Lib/json/encoder.py
++++ b/Lib/json/encoder.py
+@@ -125,7 +125,10 @@
+         If indent is a non-negative integer, then JSON array
+         elements and object members will be pretty-printed with that
+         indent level.  An indent level of 0 will only insert newlines.
+-        None is the most compact representation.
++        None is the most compact representation.  Since the default
++        item separator is ', ',  the output might include trailing
++        whitespace when indent is specified.  You can use
++        separators=(',', ': ') to avoid this.
+ 
+         If specified, separators should be a (item_separator, key_separator)
+         tuple.  The default is (', ', ': ').  To get the most compact JSON
+diff -r bd8afb90ebf2 Lib/json/tool.py
+--- a/Lib/json/tool.py
++++ b/Lib/json/tool.py
+@@ -18,19 +18,22 @@
+         infile = sys.stdin
+         outfile = sys.stdout
+     elif len(sys.argv) == 2:
+-        infile = open(sys.argv[1], 'rb')
++        infile = open(sys.argv[1], 'r')
+         outfile = sys.stdout
+     elif len(sys.argv) == 3:
+-        infile = open(sys.argv[1], 'rb')
+-        outfile = open(sys.argv[2], 'wb')
++        infile = open(sys.argv[1], 'r')
++        outfile = open(sys.argv[2], 'w')
+     else:
+         raise SystemExit(sys.argv[0] + " [infile [outfile]]")
+-    try:
+-        obj = json.load(infile)
+-    except ValueError as e:
+-        raise SystemExit(e)
+-    json.dump(obj, outfile, sort_keys=True, indent=4)
+-    outfile.write('\n')
++    with infile:
++        try:
++            obj = json.load(infile)
++        except ValueError as e:
++            raise SystemExit(e)
++    with outfile:
++        json.dump(obj, outfile, sort_keys=True,
++                  indent=4, separators=(',', ': '))
++        outfile.write('\n')
+ 
+ 
+ if __name__ == '__main__':
+diff -r bd8afb90ebf2 Lib/lib2to3/fixer_util.py
+--- a/Lib/lib2to3/fixer_util.py
++++ b/Lib/lib2to3/fixer_util.py
+@@ -165,7 +165,7 @@
+ 
+ 
+ consuming_calls = set(["sorted", "list", "set", "any", "all", "tuple", "sum",
+-                       "min", "max"])
++                       "min", "max", "enumerate"])
+ 
+ def attr_chain(obj, attr):
+     """Follow an attribute chain.
+@@ -192,14 +192,14 @@
+ p1 = """
+ power<
+     ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' | 'sum' |
+-      'any' | 'all' | (any* trailer< '.' 'join' >) )
++      'any' | 'all' | 'enumerate' | (any* trailer< '.' 'join' >) )
+     trailer< '(' node=any ')' >
+     any*
+ >
+ """
+ p2 = """
+ power<
+-    'sorted'
++    ( 'sorted' | 'enumerate' )
+     trailer< '(' arglist<node=any any*> ')' >
+     any*
+ >
+@@ -207,14 +207,14 @@
+ pats_built = False
+ def in_special_context(node):
+     """ Returns true if node is in an environment where all that is required
+-        of it is being itterable (ie, it doesn't matter if it returns a list
+-        or an itterator).
++        of it is being iterable (ie, it doesn't matter if it returns a list
++        or an iterator).
+         See test_map_nochange in test_fixers.py for some examples and tests.
+         """
+     global p0, p1, p2, pats_built
+     if not pats_built:
++        p0 = patcomp.compile_pattern(p0)
+         p1 = patcomp.compile_pattern(p1)
+-        p0 = patcomp.compile_pattern(p0)
+         p2 = patcomp.compile_pattern(p2)
+         pats_built = True
+     patterns = [p0, p1, p2]
+@@ -274,9 +274,9 @@
+     """Find the top level namespace."""
+     # Scamper up to the top level namespace
+     while node.type != syms.file_input:
+-        assert node.parent, "Tree is insane! root found before "\
+-                           "file_input node was found."
+         node = node.parent
++        if not node:
++            raise ValueError("root found before file_input node was found.")
+     return node
+ 
+ def does_tree_import(package, name, node):
+diff -r bd8afb90ebf2 Lib/lib2to3/refactor.py
+--- a/Lib/lib2to3/refactor.py
++++ b/Lib/lib2to3/refactor.py
+@@ -445,7 +445,7 @@
+ 
+                         try:
+                             find_root(node)
+-                        except AssertionError:
++                        except ValueError:
+                             # this node has been cut off from a
+                             # previous transformation ; skip
+                             continue
+diff -r bd8afb90ebf2 Lib/lib2to3/tests/test_fixers.py
+--- a/Lib/lib2to3/tests/test_fixers.py
++++ b/Lib/lib2to3/tests/test_fixers.py
+@@ -2981,6 +2981,10 @@
+         self.unchanged(a)
+         a = """sorted(filter(f, 'abc'), key=blah)[0]"""
+         self.unchanged(a)
++        a = """enumerate(filter(f, 'abc'))"""
++        self.unchanged(a)
++        a = """enumerate(filter(f, 'abc'), start=1)"""
++        self.unchanged(a)
+         a = """for i in filter(f, 'abc'): pass"""
+         self.unchanged(a)
+         a = """[x for x in filter(f, 'abc')]"""
+@@ -3089,6 +3093,10 @@
+         self.unchanged(a)
+         a = """sorted(map(f, 'abc'), key=blah)[0]"""
+         self.unchanged(a)
++        a = """enumerate(map(f, 'abc'))"""
++        self.unchanged(a)
++        a = """enumerate(map(f, 'abc'), start=1)"""
++        self.unchanged(a)
+         a = """for i in map(f, 'abc'): pass"""
+         self.unchanged(a)
+         a = """[x for x in map(f, 'abc')]"""
+@@ -3152,6 +3160,10 @@
+         self.unchanged(a)
+         a = """sorted(zip(a, b), key=blah)[0]"""
+         self.unchanged(a)
++        a = """enumerate(zip(a, b))"""
++        self.unchanged(a)
++        a = """enumerate(zip(a, b), start=1)"""
++        self.unchanged(a)
+         a = """for i in zip(a, b): pass"""
+         self.unchanged(a)
+         a = """[x for x in zip(a, b)]"""
+diff -r bd8afb90ebf2 Lib/logging/__init__.py
+--- a/Lib/logging/__init__.py
++++ b/Lib/logging/__init__.py
+@@ -708,7 +708,8 @@
+     # This function can be called during module teardown, when globals are
+     # set to None. If _acquireLock is None, assume this is the case and do
+     # nothing.
+-    if _acquireLock is not None:
++    if (_acquireLock is not None and _handlerList is not None and
++        _releaseLock is not None):
+         _acquireLock()
+         try:
+             if wr in _handlerList:
+@@ -1349,7 +1350,7 @@
+         """
+         sinfo = None
+         if _srcfile:
+-            #IronPython doesn't track Python frames, so findCaller throws an
++            #IronPython doesn't track Python frames, so findCaller raises an
+             #exception on some versions of IronPython. We trap it here so that
+             #IronPython can use logging.
+             try:
+diff -r bd8afb90ebf2 Lib/logging/handlers.py
+--- a/Lib/logging/handlers.py
++++ b/Lib/logging/handlers.py
+@@ -172,7 +172,6 @@
+             if os.path.exists(dfn):
+                 os.remove(dfn)
+             self.rotate(self.baseFilename, dfn)
+-        self.mode = 'w'
+         self.stream = self._open()
+ 
+     def shouldRollover(self, record):
+@@ -381,7 +380,6 @@
+         if self.backupCount > 0:
+             for s in self.getFilesToDelete():
+                 os.remove(s)
+-        self.mode = 'w'
+         self.stream = self._open()
+         newRolloverAt = self.computeRollover(currentTime)
+         while newRolloverAt <= currentTime:
+@@ -794,18 +792,12 @@
+         self.formatter = None
+ 
+     def _connect_unixsocket(self, address):
+-        self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
+-        # syslog may require either DGRAM or STREAM sockets
++        self.socket = socket.socket(socket.AF_UNIX, self.socktype)
+         try:
+             self.socket.connect(address)
+         except socket.error:
+             self.socket.close()
+-            self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+-            try:
+-                self.socket.connect(address)
+-            except socket.error:
+-                self.socket.close()
+-                raise
++            raise
+ 
+     def encodePriority(self, facility, priority):
+         """
+diff -r bd8afb90ebf2 Lib/mailbox.py
+--- a/Lib/mailbox.py
++++ b/Lib/mailbox.py
+@@ -208,6 +208,9 @@
+             raise ValueError("String input must be ASCII-only; "
+                 "use bytes or a Message instead")
+ 
++    # Whether each message must end in a newline
++    _append_newline = False
++
+     def _dump_message(self, message, target, mangle_from_=False):
+         # This assumes the target file is open in binary mode.
+         """Dump message contents to target file."""
+@@ -219,6 +222,9 @@
+             data = buffer.read()
+             data = data.replace(b'\n', linesep)
+             target.write(data)
++            if self._append_newline and not data.endswith(linesep):
++                # Make sure the message ends with a newline
++                target.write(linesep)
+         elif isinstance(message, (str, bytes, io.StringIO)):
+             if isinstance(message, io.StringIO):
+                 warnings.warn("Use of StringIO input is deprecated, "
+@@ -230,11 +236,15 @@
+                 message = message.replace(b'\nFrom ', b'\n>From ')
+             message = message.replace(b'\n', linesep)
+             target.write(message)
++            if self._append_newline and not message.endswith(linesep):
++                # Make sure the message ends with a newline
++                target.write(linesep)
+         elif hasattr(message, 'read'):
+             if hasattr(message, 'buffer'):
+                 warnings.warn("Use of text mode files is deprecated, "
+                     "use a binary mode file instead", DeprecationWarning, 3)
+                 message = message.buffer
++            lastline = None
+             while True:
+                 line = message.readline()
+                 # Universal newline support.
+@@ -248,6 +258,10 @@
+                     line = b'>From ' + line[5:]
+                 line = line.replace(b'\n', linesep)
+                 target.write(line)
++                lastline = line
++            if self._append_newline and lastline and not lastline.endswith(linesep):
++                # Make sure the message ends with a newline
++                target.write(linesep)
+         else:
+             raise TypeError('Invalid message type: %s' % type(message))
+ 
+@@ -833,30 +847,48 @@
+ 
+     _mangle_from_ = True
+ 
++    # All messages must end in a newline character, and
++    # _post_message_hooks outputs an empty line between messages.
++    _append_newline = True
++
+     def __init__(self, path, factory=None, create=True):
+         """Initialize an mbox mailbox."""
+         self._message_factory = mboxMessage
+         _mboxMMDF.__init__(self, path, factory, create)
+ 
+-    def _pre_message_hook(self, f):
+-        """Called before writing each message to file f."""
+-        if f.tell() != 0:
+-            f.write(linesep)
++    def _post_message_hook(self, f):
++        """Called after writing each message to file f."""
++        f.write(linesep)
+ 
+     def _generate_toc(self):
+         """Generate key-to-(start, stop) table of contents."""
+         starts, stops = [], []
++        last_was_empty = False
+         self._file.seek(0)
+         while True:
+             line_pos = self._file.tell()
+             line = self._file.readline()
+             if line.startswith(b'From '):
+                 if len(stops) < len(starts):
++                    if last_was_empty:
++                        stops.append(line_pos - len(linesep))
++                    else:
++                        # The last line before the "From " line wasn't
++                        # blank, but we consider it a start of a
++                        # message anyway.
++                        stops.append(line_pos)
++                starts.append(line_pos)
++                last_was_empty = False
++            elif not line:
++                if last_was_empty:
+                     stops.append(line_pos - len(linesep))
+-                starts.append(line_pos)
+-            elif not line:
+-                stops.append(line_pos)
++                else:
++                    stops.append(line_pos)
+                 break
++            elif line == linesep:
++                last_was_empty = True
++            else:
++                last_was_empty = False
+         self._toc = dict(enumerate(zip(starts, stops)))
+         self._next_key = len(self._toc)
+         self._file_length = self._file.tell()
+diff -r bd8afb90ebf2 Lib/modulefinder.py
+--- a/Lib/modulefinder.py
++++ b/Lib/modulefinder.py
+@@ -2,6 +2,7 @@
+ 
+ import dis
+ import imp
++import importlib.machinery
+ import marshal
+ import os
+ import sys
+diff -r bd8afb90ebf2 Lib/multiprocessing/connection.py
+--- a/Lib/multiprocessing/connection.py
++++ b/Lib/multiprocessing/connection.py
+@@ -405,7 +405,7 @@
+         return self._recv(size)
+ 
+     def _poll(self, timeout):
+-        r = wait([self._handle], timeout)
++        r = wait([self], timeout)
+         return bool(r)
+ 
+ 
+@@ -862,6 +862,29 @@
+ 
+ else:
+ 
++    if hasattr(select, 'poll'):
++        def _poll(fds, timeout):
++            if timeout is not None:
++                timeout = int(timeout) * 1000  # timeout is in milliseconds
++            fd_map = {}
++            pollster = select.poll()
++            for fd in fds:
++                pollster.register(fd, select.POLLIN)
++                if hasattr(fd, 'fileno'):
++                    fd_map[fd.fileno()] = fd
++                else:
++                    fd_map[fd] = fd
++            ls = []
++            for fd, event in pollster.poll(timeout):
++                if event & select.POLLNVAL:
++                    raise ValueError('invalid file descriptor %i' % fd)
++                ls.append(fd_map[fd])
++            return ls
++    else:
++        def _poll(fds, timeout):
++            return select.select(fds, [], [], timeout)[0]
++
++
+     def wait(object_list, timeout=None):
+         '''
+         Wait till an object in object_list is ready/readable.
+@@ -870,12 +893,12 @@
+         '''
+         if timeout is not None:
+             if timeout <= 0:
+-                return select.select(object_list, [], [], 0)[0]
++                return _poll(object_list, 0)
+             else:
+                 deadline = time.time() + timeout
+         while True:
+             try:
+-                return select.select(object_list, [], [], timeout)[0]
++                return _poll(object_list, timeout)
+             except OSError as e:
+                 if e.errno != errno.EINTR:
+                     raise
+diff -r bd8afb90ebf2 Lib/multiprocessing/forking.py
+--- a/Lib/multiprocessing/forking.py
++++ b/Lib/multiprocessing/forking.py
+@@ -233,6 +233,7 @@
+                 self.returncode = None
+                 self._handle = hp
+                 self.sentinel = int(hp)
++                util.Finalize(self, _winapi.CloseHandle, (self.sentinel,))
+ 
+                 # send information to child
+                 Popen._tls.process_handle = int(hp)
+diff -r bd8afb90ebf2 Lib/multiprocessing/pool.py
+--- a/Lib/multiprocessing/pool.py
++++ b/Lib/multiprocessing/pool.py
+@@ -225,7 +225,6 @@
+         Apply `func` to each element in `iterable`, collecting the results
+         in a list that is returned.
+         '''
+-        assert self._state == RUN
+         return self._map_async(func, iterable, mapstar, chunksize).get()
+ 
+     def starmap(self, func, iterable, chunksize=None):
+@@ -234,7 +233,6 @@
+         be iterables as well and will be unpacked as arguments. Hence
+         `func` and (a, b) becomes func(a, b).
+         '''
+-        assert self._state == RUN
+         return self._map_async(func, iterable, starmapstar, chunksize).get()
+ 
+     def starmap_async(self, func, iterable, chunksize=None, callback=None,
+@@ -242,7 +240,6 @@
+         '''
+         Asynchronous version of `starmap()` method.
+         '''
+-        assert self._state == RUN
+         return self._map_async(func, iterable, starmapstar, chunksize,
+                                callback, error_callback)
+ 
+@@ -250,7 +247,8 @@
+         '''
+         Equivalent of `map()` -- can be MUCH slower than `Pool.map()`.
+         '''
+-        assert self._state == RUN
++        if self._state != RUN:
++            raise ValueError("Pool not running")
+         if chunksize == 1:
+             result = IMapIterator(self._cache)
+             self._taskqueue.put((((result._job, i, func, (x,), {})
+@@ -268,7 +266,8 @@
+         '''
+         Like `imap()` method but ordering of results is arbitrary.
+         '''
+-        assert self._state == RUN
++        if self._state != RUN:
++            raise ValueError("Pool not running")
+         if chunksize == 1:
+             result = IMapUnorderedIterator(self._cache)
+             self._taskqueue.put((((result._job, i, func, (x,), {})
+@@ -287,7 +286,8 @@
+         '''
+         Asynchronous version of `apply()` method.
+         '''
+-        assert self._state == RUN
++        if self._state != RUN:
++            raise ValueError("Pool not running")
+         result = ApplyResult(self._cache, callback, error_callback)
+         self._taskqueue.put(([(result._job, None, func, args, kwds)], None))
+         return result
+@@ -297,14 +297,16 @@
+         '''
+         Asynchronous version of `map()` method.
+         '''
+-        assert self._state == RUN
+-        return self._map_async(func, iterable, mapstar, chunksize)
++        return self._map_async(func, iterable, mapstar, chunksize, callback,
++            error_callback)
+ 
+     def _map_async(self, func, iterable, mapper, chunksize=None, callback=None,
+             error_callback=None):
+         '''
+         Helper function to implement map, starmap and their async counterparts.
+         '''
++        if self._state != RUN:
++            raise ValueError("Pool not running")
+         if not hasattr(iterable, '__len__'):
+             iterable = list(iterable)
+ 
+diff -r bd8afb90ebf2 Lib/multiprocessing/util.py
+--- a/Lib/multiprocessing/util.py
++++ b/Lib/multiprocessing/util.py
+@@ -235,6 +235,12 @@
+     Finalizers with highest priority are called first; finalizers with
+     the same priority will be called in reverse order of creation.
+     '''
++    if _finalizer_registry is None:
++        # This function may be called after this module's globals are
++        # destroyed.  See the _exit_function function in this module for more
++        # notes.
++        return
++
+     if minpriority is None:
+         f = lambda p : p[0][0] is not None
+     else:
+@@ -266,7 +272,13 @@
+ 
+ _exiting = False
+ 
+-def _exit_function():
++def _exit_function(info=info, debug=debug, _run_finalizers=_run_finalizers,
++                   active_children=active_children,
++                   current_process=current_process):
++    # We hold on to references to functions in the arglist due to the
++    # situation described below, where this function is called after this
++    # module's globals are destroyed.
++
+     global _exiting
+ 
+     if not _exiting:
+@@ -276,14 +288,28 @@
+         debug('running all "atexit" finalizers with priority >= 0')
+         _run_finalizers(0)
+ 
+-        for p in active_children():
+-            if p._daemonic:
+-                info('calling terminate() for daemon %s', p.name)
+-                p._popen.terminate()
++        if current_process() is not None:
++            # We check if the current process is None here because if
++            # it's None, any call to ``active_children()`` will raise
++            # an AttributeError (active_children winds up trying to
++            # get attributes from util._current_process).  One
++            # situation where this can happen is if someone has
++            # manipulated sys.modules, causing this module to be
++            # garbage collected.  The destructor for the module type
++            # then replaces all values in the module dict with None.
++            # For instance, after setuptools runs a test it replaces
++            # sys.modules with a copy created earlier.  See issues
++            # #9775 and #15881.  Also related: #4106, #9205, and
++            # #9207.
+ 
+-        for p in active_children():
+-            info('calling join() for process %s', p.name)
+-            p.join()
++            for p in active_children():
++                if p._daemonic:
++                    info('calling terminate() for daemon %s', p.name)
++                    p._popen.terminate()
++
++            for p in active_children():
++                info('calling join() for process %s', p.name)
++                p.join()
+ 
+         debug('running the remaining "atexit" finalizers')
+         _run_finalizers()
+diff -r bd8afb90ebf2 Lib/os.py
+--- a/Lib/os.py
++++ b/Lib/os.py
+@@ -260,7 +260,10 @@
+             # be happy if someone already created the path
+             if e.errno != errno.EEXIST:
+                 raise
+-        if tail == curdir:           # xxx/newdir/. exists if xxx/newdir exists
++        cdir = curdir
++        if isinstance(tail, bytes):
++            cdir = bytes(curdir, 'ASCII')
++        if tail == cdir:           # xxx/newdir/. exists if xxx/newdir exists
+             return
+     try:
+         mkdir(name, mode)
+@@ -985,7 +988,7 @@
+         raise TypeError("invalid cmd type (%s, expected string)" % type(cmd))
+     if mode not in ("r", "w"):
+         raise ValueError("invalid mode %r" % mode)
+-    if buffering == 0 or buffering == None:
++    if buffering == 0 or buffering is None:
+         raise ValueError("popen() does not support unbuffered streams")
+     import subprocess, io
+     if mode == "r":
+diff -r bd8afb90ebf2 Lib/pdb.py
+--- a/Lib/pdb.py
++++ b/Lib/pdb.py
+@@ -1031,8 +1031,15 @@
+         Continue execution, only stop when a breakpoint is encountered.
+         """
+         if not self.nosigint:
+-            self._previous_sigint_handler = \
+-                signal.signal(signal.SIGINT, self.sigint_handler)
++            try:
++                self._previous_sigint_handler = \
++                    signal.signal(signal.SIGINT, self.sigint_handler)
++            except ValueError:
++                # ValueError happens when do_continue() is invoked from
++                # a non-main thread in which case we just continue without
++                # SIGINT set. Would printing a message here (once) make
++                # sense?
++                pass
+         self.set_continue()
+         return 1
+     do_c = do_cont = do_continue
+diff -r bd8afb90ebf2 Lib/pickle.py
+--- a/Lib/pickle.py
++++ b/Lib/pickle.py
+@@ -263,7 +263,7 @@
+             if i < 256:
+                 return BINPUT + bytes([i])
+             else:
+-                return LONG_BINPUT + pack("<i", i)
++                return LONG_BINPUT + pack("<I", i)
+ 
+         return PUT + repr(i).encode("ascii") + b'\n'
+ 
+@@ -273,7 +273,7 @@
+             if i < 256:
+                 return BINGET + bytes([i])
+             else:
+-                return LONG_BINGET + pack("<i", i)
++                return LONG_BINGET + pack("<I", i)
+ 
+         return GET + repr(i).encode("ascii") + b'\n'
+ 
+@@ -503,7 +503,7 @@
+         if n < 256:
+             self.write(SHORT_BINBYTES + bytes([n]) + bytes(obj))
+         else:
+-            self.write(BINBYTES + pack("<i", n) + bytes(obj))
++            self.write(BINBYTES + pack("<I", n) + bytes(obj))
+         self.memoize(obj)
+     dispatch[bytes] = save_bytes
+ 
+@@ -511,7 +511,7 @@
+         if self.bin:
+             encoded = obj.encode('utf-8', 'surrogatepass')
+             n = len(encoded)
+-            self.write(BINUNICODE + pack("<i", n) + encoded)
++            self.write(BINUNICODE + pack("<I", n) + encoded)
+         else:
+             obj = obj.replace("\\", "\\u005c")
+             obj = obj.replace("\n", "\\u000a")
+@@ -931,6 +931,9 @@
+ 
+     def load_long4(self):
+         n = mloads(b'i' + self.read(4))
++        if n < 0:
++            # Corrupt or hostile pickle -- we never write one like this
++            raise UnpicklingError("LONG pickle has negative byte count");
+         data = self.read(n)
+         self.append(decode_long(data))
+     dispatch[LONG4[0]] = load_long4
+@@ -959,14 +962,19 @@
+     dispatch[STRING[0]] = load_string
+ 
+     def load_binstring(self):
++        # Deprecated BINSTRING uses signed 32-bit length
+         len = mloads(b'i' + self.read(4))
++        if len < 0:
++            raise UnpicklingError("BINSTRING pickle has negative byte count");
+         data = self.read(len)
+         value = str(data, self.encoding, self.errors)
+         self.append(value)
+     dispatch[BINSTRING[0]] = load_binstring
+ 
+-    def load_binbytes(self):
+-        len = mloads(b'i' + self.read(4))
++    def load_binbytes(self, unpack=struct.unpack, maxsize=sys.maxsize):
++        len, = unpack('<I', self.read(4))
++        if len > maxsize:
++            raise UnpicklingError("BINBYTES exceeds system's maximum size of %d bytes" % maxsize);
+         self.append(self.read(len))
+     dispatch[BINBYTES[0]] = load_binbytes
+ 
+@@ -974,8 +982,10 @@
+         self.append(str(self.readline()[:-1], 'raw-unicode-escape'))
+     dispatch[UNICODE[0]] = load_unicode
+ 
+-    def load_binunicode(self):
+-        len = mloads(b'i' + self.read(4))
++    def load_binunicode(self, unpack=struct.unpack, maxsize=sys.maxsize):
++        len, = unpack('<I', self.read(4))
++        if len > maxsize:
++            raise UnpicklingError("BINUNICODE exceeds system's maximum size of %d bytes" % maxsize);
+         self.append(str(self.read(len), 'utf-8', 'surrogatepass'))
+     dispatch[BINUNICODE[0]] = load_binunicode
+ 
+@@ -1106,6 +1116,9 @@
+             return
+         key = _inverted_registry.get(code)
+         if not key:
++            if code <= 0: # note that 0 is forbidden
++                # Corrupt or hostile pickle.
++                raise UnpicklingError("EXT specifies code <= 0");
+             raise ValueError("unregistered extension code %d" % code)
+         obj = self.find_class(*key)
+         _extension_cache[code] = obj
+@@ -1159,8 +1172,8 @@
+         self.append(self.memo[i])
+     dispatch[BINGET[0]] = load_binget
+ 
+-    def load_long_binget(self):
+-        i = mloads(b'i' + self.read(4))
++    def load_long_binget(self, unpack=struct.unpack):
++        i, = unpack('<I', self.read(4))
+         self.append(self.memo[i])
+     dispatch[LONG_BINGET[0]] = load_long_binget
+ 
+@@ -1178,9 +1191,9 @@
+         self.memo[i] = self.stack[-1]
+     dispatch[BINPUT[0]] = load_binput
+ 
+-    def load_long_binput(self):
+-        i = mloads(b'i' + self.read(4))
+-        if i < 0:
++    def load_long_binput(self, unpack=struct.unpack, maxsize=sys.maxsize):
++        i, = unpack('<I', self.read(4))
++        if i > maxsize:
+             raise ValueError("negative LONG_BINPUT argument")
+         self.memo[i] = self.stack[-1]
+     dispatch[LONG_BINPUT[0]] = load_long_binput
+diff -r bd8afb90ebf2 Lib/pkgutil.py
+--- a/Lib/pkgutil.py
++++ b/Lib/pkgutil.py
+@@ -504,8 +504,8 @@
+         return importlib.find_loader(fullname, path)
+     except (ImportError, AttributeError, TypeError, ValueError) as ex:
+         # This hack fixes an impedance mismatch between pkgutil and
+-        # importlib, where the latter throws other errors for cases where
+-        # pkgutil previously threw ImportError
++        # importlib, where the latter raises other errors for cases where
++        # pkgutil previously raised ImportError
+         msg = "Error while finding loader for {!r} ({}: {})"
+         raise ImportError(msg.format(fullname, type(ex), ex)) from ex
+ 
+diff -r bd8afb90ebf2 Lib/plat-generic/regen
+--- a/Lib/plat-generic/regen
++++ b/Lib/plat-generic/regen
+@@ -1,3 +1,3 @@
+ #! /bin/sh
+ set -v
+-python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h
++eval $PYTHON_FOR_BUILD ../../Tools/scripts/h2py.py -i "'(u_long)'" /usr/include/netinet/in.h
+diff -r bd8afb90ebf2 Lib/platform.py
+--- a/Lib/platform.py
++++ b/Lib/platform.py
+@@ -112,7 +112,7 @@
+ __version__ = '1.0.7'
+ 
+ import collections
+-import sys, os, re
++import sys, os, re, subprocess
+ 
+ ### Globals & Constants
+ 
+@@ -595,8 +595,13 @@
+                     release = '7'
+                 else:
+                     release = '2008ServerR2'
++            elif min == 2:
++                if product_type == VER_NT_WORKSTATION:
++                    release = '8'
++                else:
++                    release = '2012Server'
+             else:
+-                release = 'post2008Server'
++                release = 'post2012Server'
+ 
+     else:
+         if not release:
+@@ -922,13 +927,15 @@
+     if sys.platform in ('dos','win32','win16','os2'):
+         # XXX Others too ?
+         return default
+-    target = _follow_symlinks(target).replace('"', '\\"')
++    target = _follow_symlinks(target)
+     try:
+-        f = os.popen('file -b "%s" 2> %s' % (target, DEV_NULL))
++        proc = subprocess.Popen(['file', target],
++                stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
++
+     except (AttributeError,os.error):
+         return default
+-    output = f.read().strip()
+-    rc = f.close()
++    output = proc.communicate()[0].decode('latin-1')
++    rc = proc.wait()
+     if not output or rc:
+         return default
+     else:
+diff -r bd8afb90ebf2 Lib/posixpath.py
+--- a/Lib/posixpath.py
++++ b/Lib/posixpath.py
+@@ -391,52 +391,62 @@
+ def realpath(filename):
+     """Return the canonical path of the specified filename, eliminating any
+ symbolic links encountered in the path."""
+-    if isinstance(filename, bytes):
++    path, ok = _joinrealpath(filename[:0], filename, {})
++    return abspath(path)
++
++# Join two paths, normalizing ang eliminating any symbolic links
++# encountered in the second path.
++def _joinrealpath(path, rest, seen):
++    if isinstance(path, bytes):
+         sep = b'/'
+-        empty = b''
++        curdir = b'.'
++        pardir = b'..'
+     else:
+         sep = '/'
+-        empty = ''
+-    if isabs(filename):
+-        bits = [sep] + filename.split(sep)[1:]
+-    else:
+-        bits = [empty] + filename.split(sep)
++        curdir = '.'
++        pardir = '..'
+ 
+-    for i in range(2, len(bits)+1):
+-        component = join(*bits[0:i])
+-        # Resolve symbolic links.
+-        if islink(component):
+-            resolved = _resolve_link(component)
+-            if resolved is None:
+-                # Infinite loop -- return original component + rest of the path
+-                return abspath(join(*([component] + bits[i:])))
++    if isabs(rest):
++        rest = rest[1:]
++        path = sep
++
++    while rest:
++        name, _, rest = rest.partition(sep)
++        if not name or name == curdir:
++            # current dir
++            continue
++        if name == pardir:
++            # parent dir
++            if path:
++                path, name = split(path)
++                if name == pardir:
++                    path = join(path, pardir, pardir)
+             else:
+-                newpath = join(*([resolved] + bits[i:]))
+-                return realpath(newpath)
++                path = pardir
++            continue
++        newpath = join(path, name)
++        if not islink(newpath):
++            path = newpath
++            continue
++        # Resolve the symbolic link
++        if newpath in seen:
++            # Already seen this path
++            path = seen[newpath]
++            if path is not None:
++                # use cached value
++                continue
++            # The symlink is not resolved, so we must have a symlink loop.
++            # Return already resolved part + rest of the path unchanged.
++            return join(newpath, rest), False
++        seen[newpath] = None # not resolved symlink
++        path, ok = _joinrealpath(path, os.readlink(newpath), seen)
++        if not ok:
++            return join(path, rest), False
++        seen[newpath] = path # resolved symlink
+ 
+-    return abspath(filename)
++    return path, True
+ 
+ 
+-def _resolve_link(path):
+-    """Internal helper function.  Takes a path and follows symlinks
+-    until we either arrive at something that isn't a symlink, or
+-    encounter a path we've seen before (meaning that there's a loop).
+-    """
+-    paths_seen = set()
+-    while islink(path):
+-        if path in paths_seen:
+-            # Already seen this path, so we must have a symlink loop
+-            return None
+-        paths_seen.add(path)
+-        # Resolve where the link points to
+-        resolved = os.readlink(path)
+-        if not isabs(resolved):
+-            dir = dirname(path)
+-            path = normpath(join(dir, resolved))
+-        else:
+-            path = normpath(resolved)
+-    return path
+-
+ supports_unicode_filenames = (sys.platform == 'darwin')
+ 
+ def relpath(path, start=None):
+diff -r bd8afb90ebf2 Lib/pstats.py
+--- a/Lib/pstats.py
++++ b/Lib/pstats.py
+@@ -159,15 +159,19 @@
+     # along with some printable description
+     sort_arg_dict_default = {
+               "calls"     : (((1,-1),              ), "call count"),
++              "ncalls"    : (((1,-1),              ), "call count"),
++              "cumtime"   : (((3,-1),              ), "cumulative time"),
+               "cumulative": (((3,-1),              ), "cumulative time"),
+               "file"      : (((4, 1),              ), "file name"),
++              "filename"  : (((4, 1),              ), "file name"),
+               "line"      : (((5, 1),              ), "line number"),
+               "module"    : (((4, 1),              ), "file name"),
+               "name"      : (((6, 1),              ), "function name"),
+               "nfl"       : (((6, 1),(4, 1),(5, 1),), "name/file/line"),
+-              "pcalls"    : (((0,-1),              ), "call count"),
++              "pcalls"    : (((0,-1),              ), "primitive call count"),
+               "stdname"   : (((7, 1),              ), "standard name"),
+               "time"      : (((2,-1),              ), "internal time"),
++              "tottime"   : (((2,-1),              ), "internal time"),
+               }
+ 
+     def get_sort_arg_defs(self):
+diff -r bd8afb90ebf2 Lib/pydoc.py
+--- a/Lib/pydoc.py
++++ b/Lib/pydoc.py
+@@ -2551,8 +2551,8 @@
+             if opt == '-w':
+                 writing = True
+ 
+-        if start_server == True:
+-            if port == None:
++        if start_server:
++            if port is None:
+                 port = 0
+             browse(port, open_browser=open_browser)
+             return
+diff -r bd8afb90ebf2 Lib/random.py
+--- a/Lib/random.py
++++ b/Lib/random.py
+@@ -431,27 +431,25 @@
+         if kappa <= 1e-6:
+             return TWOPI * random()
+ 
+-        a = 1.0 + _sqrt(1.0 + 4.0 * kappa * kappa)
+-        b = (a - _sqrt(2.0 * a))/(2.0 * kappa)
+-        r = (1.0 + b * b)/(2.0 * b)
++        s = 0.5 / kappa
++        r = s + _sqrt(1.0 + s * s)
+ 
+         while 1:
+             u1 = random()
++            z = _cos(_pi * u1)
+ 
+-            z = _cos(_pi * u1)
+-            f = (1.0 + r * z)/(r + z)
+-            c = kappa * (r - f)
+-
++            d = z / (r + z)
+             u2 = random()
+-
+-            if u2 < c * (2.0 - c) or u2 <= c * _exp(1.0 - c):
++            if u2 < 1.0 - d * d or u2 <= (1.0 - d) * _exp(d):
+                 break
+ 
++        q = 1.0 / r
++        f = (q + z) / (1.0 + q * z)
+         u3 = random()
+         if u3 > 0.5:
+-            theta = (mu % TWOPI) + _acos(f)
++            theta = (mu + _acos(f)) % TWOPI
+         else:
+-            theta = (mu % TWOPI) - _acos(f)
++            theta = (mu - _acos(f)) % TWOPI
+ 
+         return theta
+ 
+diff -r bd8afb90ebf2 Lib/re.py
+--- a/Lib/re.py
++++ b/Lib/re.py
+@@ -261,7 +261,7 @@
+ 
+ _pattern_type = type(sre_compile.compile("", 0))
+ 
+-@functools.lru_cache(maxsize=500, typed=True)
++@functools.lru_cache(maxsize=512, typed=True)
+ def _compile(pattern, flags):
+     # internal: compile pattern
+     if isinstance(pattern, _pattern_type):
+@@ -273,7 +273,7 @@
+         raise TypeError("first argument must be string or compiled pattern")
+     return sre_compile.compile(pattern, flags)
+ 
+-@functools.lru_cache(maxsize=500)
++@functools.lru_cache(maxsize=512)
+ def _compile_repl(repl, pattern):
+     # internal: compile replacement pattern
+     return sre_parse.parse_template(repl, pattern)
+diff -r bd8afb90ebf2 Lib/sched.py
+--- a/Lib/sched.py
++++ b/Lib/sched.py
+@@ -13,12 +13,12 @@
+ function is allowed to modify the queue.  Time can be expressed as
+ integers or floating point numbers, as long as it is consistent.
+ 
+-Events are specified by tuples (time, priority, action, argument).
++Events are specified by tuples (time, priority, action, argument, kwargs).
+ As in UNIX, lower priority numbers mean higher priority; in this
+ way the queue can be maintained as a priority queue.  Execution of the
+ event means calling the action function, passing it the argument
+ sequence in "argument" (remember that in Python, multiple function
+-arguments are be packed in a sequence).
++arguments are be packed in a sequence) and keyword parameters in "kwargs".
+ The action function may be an instance method so it
+ has another way to reference private data (besides global variables).
+ """
+@@ -50,6 +50,8 @@
+     def __gt__(s, o): return (s.time, s.priority) >  (o.time, o.priority)
+     def __ge__(s, o): return (s.time, s.priority) >= (o.time, o.priority)
+ 
++_sentinel = object()
++
+ class scheduler:
+ 
+     def __init__(self, timefunc=_time, delayfunc=time.sleep):
+@@ -60,19 +62,21 @@
+         self.timefunc = timefunc
+         self.delayfunc = delayfunc
+ 
+-    def enterabs(self, time, priority, action, argument=[], kwargs={}):
++    def enterabs(self, time, priority, action, argument=(), kwargs=_sentinel):
+         """Enter a new event in the queue at an absolute time.
+ 
+         Returns an ID for the event which can be used to remove it,
+         if necessary.
+ 
+         """
++        if kwargs is _sentinel:
++            kwargs = {}
+         with self._lock:
+             event = Event(time, priority, action, argument, kwargs)
+             heapq.heappush(self._queue, event)
+             return event # The ID
+ 
+-    def enter(self, delay, priority, action, argument=[], kwargs={}):
++    def enter(self, delay, priority, action, argument=(), kwargs=_sentinel):
+         """A variant that specifies the time as a relative time.
+ 
+         This is actually the more commonly used interface.
+@@ -124,34 +128,36 @@
+         """
+         # localize variable access to minimize overhead
+         # and to improve thread safety
+-        with self._lock:
+-            q = self._queue
+-            delayfunc = self.delayfunc
+-            timefunc = self.timefunc
+-            pop = heapq.heappop
+-            while q:
+-                time, priority, action, argument, kwargs = checked_event = q[0]
++        lock = self._lock
++        q = self._queue
++        delayfunc = self.delayfunc
++        timefunc = self.timefunc
++        pop = heapq.heappop
++        while True:
++            with lock:
++                if not q:
++                    break
++                time, priority, action, argument, kwargs = q[0]
+                 now = timefunc()
+-                if now < time:
+-                    if not blocking:
+-                        return time - now
+-                    delayfunc(time - now)
++                if time > now:
++                    delay = True
+                 else:
+-                    event = pop(q)
+-                    # Verify that the event was not removed or altered
+-                    # by another thread after we last looked at q[0].
+-                    if event is checked_event:
+-                        action(*argument, **kwargs)
+-                        delayfunc(0)   # Let other threads run
+-                    else:
+-                        heapq.heappush(q, event)
++                    delay = False
++                    pop(q)
++            if delay:
++                if not blocking:
++                    return time - now
++                delayfunc(time - now)
++            else:
++                action(*argument, **kwargs)
++                delayfunc(0)   # Let other threads run
+ 
+     @property
+     def queue(self):
+         """An ordered list of upcoming events.
+ 
+         Events are named tuples with fields for:
+-            time, priority, action, arguments
++            time, priority, action, arguments, kwargs
+ 
+         """
+         # Use heapq to sort the queue rather than using 'sorted(self._queue)'.
+diff -r bd8afb90ebf2 Lib/shutil.py
+--- a/Lib/shutil.py
++++ b/Lib/shutil.py
+@@ -142,7 +142,13 @@
+ 
+         """
+ 
+-        for name in os.listxattr(src, follow_symlinks=follow_symlinks):
++        try:
++            names = os.listxattr(src, follow_symlinks=follow_symlinks)
++        except OSError as e:
++            if e.errno not in (errno.ENOTSUP, errno.ENODATA):
++                raise
++            return
++        for name in names:
+             try:
+                 value = os.getxattr(src, name, follow_symlinks=follow_symlinks)
+                 os.setxattr(dst, name, value, follow_symlinks=follow_symlinks)
+@@ -375,19 +381,20 @@
+     names = []
+     try:
+         names = os.listdir(topfd)
+-    except os.error:
++    except OSError as err:
++        err.filename = path
+         onerror(os.listdir, path, sys.exc_info())
+     for name in names:
+         fullname = os.path.join(path, name)
+         try:
+             orig_st = os.stat(name, dir_fd=topfd, follow_symlinks=False)
+             mode = orig_st.st_mode
+-        except os.error:
++        except OSError:
+             mode = 0
+         if stat.S_ISDIR(mode):
+             try:
+                 dirfd = os.open(name, os.O_RDONLY, dir_fd=topfd)
+-            except os.error:
++            except OSError:
+                 onerror(os.open, fullname, sys.exc_info())
+             else:
+                 try:
+@@ -395,14 +402,23 @@
+                         _rmtree_safe_fd(dirfd, fullname, onerror)
+                         try:
+                             os.rmdir(name, dir_fd=topfd)
+-                        except os.error:
++                        except OSError:
+                             onerror(os.rmdir, fullname, sys.exc_info())
++                    else:
++                        try:
++                            # This can only happen if someone replaces
++                            # a directory with a symlink after the call to
++                            # stat.S_ISDIR above.
++                            raise OSError("Cannot call rmtree on a symbolic "
++                                          "link")
++                        except OSError:
++                            onerror(os.path.islink, fullname, sys.exc_info())
+                 finally:
+                     os.close(dirfd)
+         else:
+             try:
+                 os.unlink(name, dir_fd=topfd)
+-            except os.error:
++            except OSError:
+                 onerror(os.unlink, fullname, sys.exc_info())
+ 
+ _use_fd_functions = ({os.open, os.stat, os.unlink, os.rmdir} <=
+@@ -444,16 +460,18 @@
+             onerror(os.lstat, path, sys.exc_info())
+             return
+         try:
+-            if (stat.S_ISDIR(orig_st.st_mode) and
+-                os.path.samestat(orig_st, os.fstat(fd))):
++            if os.path.samestat(orig_st, os.fstat(fd)):
+                 _rmtree_safe_fd(fd, path, onerror)
+                 try:
+                     os.rmdir(path)
+                 except os.error:
+                     onerror(os.rmdir, path, sys.exc_info())
+             else:
+-                raise NotADirectoryError(20,
+-                                         "Not a directory: '{}'".format(path))
++                try:
++                    # symlinks to directories are forbidden, see bug #1669
++                    raise OSError("Cannot call rmtree on a symbolic link")
++                except OSError:
++                    onerror(os.path.islink, path, sys.exc_info())
+         finally:
+             os.close(fd)
+     else:
+@@ -1065,10 +1083,13 @@
+         return (os.path.exists(fn) and os.access(fn, mode)
+                 and not os.path.isdir(fn))
+ 
+-    # Short circuit. If we're given a full path which matches the mode
+-    # and it exists, we're done here.
+-    if _access_check(cmd, mode):
+-        return cmd
++    # If we're given a path with a directory part, look it up directly rather
++    # than referring to PATH directories. This includes checking relative to the
++    # current directory, e.g. ./script
++    if os.path.dirname(cmd):
++        if _access_check(cmd, mode):
++            return cmd
++        return None
+ 
+     path = (path or os.environ.get("PATH", os.defpath)).split(os.pathsep)
+ 
+@@ -1081,10 +1102,12 @@
+         pathext = os.environ.get("PATHEXT", "").split(os.pathsep)
+         # See if the given file matches any of the expected path extensions.
+         # This will allow us to short circuit when given "python.exe".
+-        matches = [cmd for ext in pathext if cmd.lower().endswith(ext.lower())]
+         # If it does match, only test that one, otherwise we have to try
+         # others.
+-        files = [cmd] if matches else [cmd + ext.lower() for ext in pathext]
++        if any(cmd.lower().endswith(ext.lower()) for ext in pathext):
++            files = [cmd]
++        else:
++            files = [cmd + ext for ext in pathext]
+     else:
+         # On other platforms you don't have things like PATHEXT to tell you
+         # what file suffixes are executable, so just pass on cmd as-is.
+@@ -1092,9 +1115,9 @@
+ 
+     seen = set()
+     for dir in path:
+-        dir = os.path.normcase(dir)
+-        if not dir in seen:
+-            seen.add(dir)
++        normdir = os.path.normcase(dir)
++        if not normdir in seen:
++            seen.add(normdir)
+             for thefile in files:
+                 name = os.path.join(dir, thefile)
+                 if _access_check(name, mode):
+diff -r bd8afb90ebf2 Lib/site.py
+--- a/Lib/site.py
++++ b/Lib/site.py
+@@ -503,15 +503,13 @@
+         executable = os.environ['__PYVENV_LAUNCHER__']
+     else:
+         executable = sys.executable
+-    executable_dir, executable_name = os.path.split(executable)
+-    site_prefix = os.path.dirname(executable_dir)
++    exe_dir, _ = os.path.split(os.path.abspath(executable))
++    site_prefix = os.path.dirname(exe_dir)
+     sys._home = None
+-    if sys.platform == 'win32':
+-        executable_name = os.path.splitext(executable_name)[0]
+     conf_basename = 'pyvenv.cfg'
+     candidate_confs = [
+         conffile for conffile in (
+-            os.path.join(executable_dir, conf_basename),
++            os.path.join(exe_dir, conf_basename),
+             os.path.join(site_prefix, conf_basename)
+             )
+         if os.path.isfile(conffile)
+diff -r bd8afb90ebf2 Lib/smtplib.py
+--- a/Lib/smtplib.py
++++ b/Lib/smtplib.py
+@@ -920,13 +920,13 @@
+             self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+             self.file = None
+             self.sock.connect(host)
+-        except socket.error as msg:
++        except socket.error:
+             if self.debuglevel > 0:
+                 print('connect fail:', host, file=stderr)
+             if self.sock:
+                 self.sock.close()
+             self.sock = None
+-            raise socket.error(msg)
++            raise
+         (code, msg) = self.getreply()
+         if self.debuglevel > 0:
+             print('connect:', msg, file=stderr)
+diff -r bd8afb90ebf2 Lib/socket.py
+--- a/Lib/socket.py
++++ b/Lib/socket.py
+@@ -324,12 +324,23 @@
+     def readable(self):
+         """True if the SocketIO is open for reading.
+         """
+-        return self._reading and not self.closed
++        if self.closed:
++            raise ValueError("I/O operation on closed socket.")
++        return self._reading
+ 
+     def writable(self):
+         """True if the SocketIO is open for writing.
+         """
+-        return self._writing and not self.closed
++        if self.closed:
++            raise ValueError("I/O operation on closed socket.")
++        return self._writing
++
++    def seekable(self):
++        """True if the SocketIO is open for seeking.
++        """
++        if self.closed:
++            raise ValueError("I/O operation on closed socket.")
++        return super().seekable()
+ 
+     def fileno(self):
+         """Return the file descriptor of the underlying socket.
+diff -r bd8afb90ebf2 Lib/socketserver.py
+--- a/Lib/socketserver.py
++++ b/Lib/socketserver.py
+@@ -562,7 +562,7 @@
+         self.collect_children()
+ 
+     def service_actions(self):
+-        """Collect the zombie child processes regularly in the ForkingMixin.
++        """Collect the zombie child processes regularly in the ForkingMixIn.
+ 
+         service_actions is called in the BaseServer's serve_forver loop.
+         """
+@@ -718,7 +718,12 @@
+ 
+     def finish(self):
+         if not self.wfile.closed:
+-            self.wfile.flush()
++            try:
++                self.wfile.flush()
++            except socket.error:
++                # An final socket error may have occurred here, such as
++                # the local error ECONNABORTED.
++                pass
+         self.wfile.close()
+         self.rfile.close()
+ 
+diff -r bd8afb90ebf2 Lib/sqlite3/dump.py
+--- a/Lib/sqlite3/dump.py
++++ b/Lib/sqlite3/dump.py
+@@ -25,9 +25,10 @@
+         FROM "sqlite_master"
+             WHERE "sql" NOT NULL AND
+             "type" == 'table'
++            ORDER BY "name"
+         """
+     schema_res = cu.execute(q)
+-    for table_name, type, sql in sorted(schema_res.fetchall()):
++    for table_name, type, sql in schema_res.fetchall():
+         if table_name == 'sqlite_sequence':
+             yield('DELETE FROM "sqlite_sequence";')
+         elif table_name == 'sqlite_stat1':
+diff -r bd8afb90ebf2 Lib/sqlite3/test/dump.py
+--- a/Lib/sqlite3/test/dump.py
++++ b/Lib/sqlite3/test/dump.py
+@@ -49,6 +49,27 @@
+         [self.assertEqual(expected_sqls[i], actual_sqls[i])
+             for i in range(len(expected_sqls))]
+ 
++    def CheckUnorderableRow(self):
++        # iterdump() should be able to cope with unorderable row types (issue #15545)
++        class UnorderableRow:
++            def __init__(self, cursor, row):
++                self.row = row
++            def __getitem__(self, index):
++                return self.row[index]
++        self.cx.row_factory = UnorderableRow
++        CREATE_ALPHA = """CREATE TABLE "alpha" ("one");"""
++        CREATE_BETA = """CREATE TABLE "beta" ("two");"""
++        expected = [
++            "BEGIN TRANSACTION;",
++            CREATE_ALPHA,
++            CREATE_BETA,
++            "COMMIT;"
++            ]
++        self.cu.execute(CREATE_BETA)
++        self.cu.execute(CREATE_ALPHA)
++        got = list(self.cx.iterdump())
++        self.assertEqual(expected, got)
++
+ def suite():
+     return unittest.TestSuite(unittest.makeSuite(DumpTests, "Check"))
+ 
+diff -r bd8afb90ebf2 Lib/sqlite3/test/hooks.py
+--- a/Lib/sqlite3/test/hooks.py
++++ b/Lib/sqlite3/test/hooks.py
+@@ -47,9 +47,9 @@
+         except sqlite.ProgrammingError as e:
+             pass
+ 
++    @unittest.skipIf(sqlite.sqlite_version_info < (3, 2, 1),
++                     'old SQLite versions crash on this test')
+     def CheckCollationIsUsed(self):
+-        if sqlite.version_info < (3, 2, 1):  # old SQLite versions crash on this test
+-            return
+         def mycoll(x, y):
+             # reverse order
+             return -((x > y) - (x < y))
+@@ -76,6 +76,25 @@
+         except sqlite.OperationalError as e:
+             self.assertEqual(e.args[0].lower(), "no such collation sequence: mycoll")
+ 
++    def CheckCollationReturnsLargeInteger(self):
++        def mycoll(x, y):
++            # reverse order
++            return -((x > y) - (x < y)) * 2**32
++        con = sqlite.connect(":memory:")
++        con.create_collation("mycoll", mycoll)
++        sql = """
++            select x from (
++            select 'a' as x
++            union
++            select 'b' as x
++            union
++            select 'c' as x
++            ) order by x collate mycoll
++            """
++        result = con.execute(sql).fetchall()
++        self.assertEqual(result, [('c',), ('b',), ('a',)],
++                         msg="the expected order was not returned")
++
+     def CheckCollationRegisterTwice(self):
+         """
+         Register two different collation functions under the same name.
+diff -r bd8afb90ebf2 Lib/sqlite3/test/userfunctions.py
+--- a/Lib/sqlite3/test/userfunctions.py
++++ b/Lib/sqlite3/test/userfunctions.py
+@@ -375,14 +375,15 @@
+         val = cur.fetchone()[0]
+         self.assertEqual(val, 60)
+ 
+-def authorizer_cb(action, arg1, arg2, dbname, source):
+-    if action != sqlite.SQLITE_SELECT:
+-        return sqlite.SQLITE_DENY
+-    if arg2 == 'c2' or arg1 == 't2':
+-        return sqlite.SQLITE_DENY
+-    return sqlite.SQLITE_OK
++class AuthorizerTests(unittest.TestCase):
++    @staticmethod
++    def authorizer_cb(action, arg1, arg2, dbname, source):
++        if action != sqlite.SQLITE_SELECT:
++            return sqlite.SQLITE_DENY
++        if arg2 == 'c2' or arg1 == 't2':
++            return sqlite.SQLITE_DENY
++        return sqlite.SQLITE_OK
+ 
+-class AuthorizerTests(unittest.TestCase):
+     def setUp(self):
+         self.con = sqlite.connect(":memory:")
+         self.con.executescript("""
+@@ -395,12 +396,12 @@
+         # For our security test:
+         self.con.execute("select c2 from t2")
+ 
+-        self.con.set_authorizer(authorizer_cb)
++        self.con.set_authorizer(self.authorizer_cb)
+ 
+     def tearDown(self):
+         pass
+ 
+-    def CheckTableAccess(self):
++    def test_table_access(self):
+         try:
+             self.con.execute("select * from t2")
+         except sqlite.DatabaseError as e:
+@@ -409,7 +410,7 @@
+             return
+         self.fail("should have raised an exception due to missing privileges")
+ 
+-    def CheckColumnAccess(self):
++    def test_column_access(self):
+         try:
+             self.con.execute("select c2 from t1")
+         except sqlite.DatabaseError as e:
+@@ -418,11 +419,46 @@
+             return
+         self.fail("should have raised an exception due to missing privileges")
+ 
++class AuthorizerRaiseExceptionTests(AuthorizerTests):
++    @staticmethod
++    def authorizer_cb(action, arg1, arg2, dbname, source):
++        if action != sqlite.SQLITE_SELECT:
++            raise ValueError
++        if arg2 == 'c2' or arg1 == 't2':
++            raise ValueError
++        return sqlite.SQLITE_OK
++
++class AuthorizerIllegalTypeTests(AuthorizerTests):
++    @staticmethod
++    def authorizer_cb(action, arg1, arg2, dbname, source):
++        if action != sqlite.SQLITE_SELECT:
++            return 0.0
++        if arg2 == 'c2' or arg1 == 't2':
++            return 0.0
++        return sqlite.SQLITE_OK
++
++class AuthorizerLargeIntegerTests(AuthorizerTests):
++    @staticmethod
++    def authorizer_cb(action, arg1, arg2, dbname, source):
++        if action != sqlite.SQLITE_SELECT:
++            return 2**32
++        if arg2 == 'c2' or arg1 == 't2':
++            return 2**32
++        return sqlite.SQLITE_OK
++
++
+ def suite():
+     function_suite = unittest.makeSuite(FunctionTests, "Check")
+     aggregate_suite = unittest.makeSuite(AggregateTests, "Check")
+-    authorizer_suite = unittest.makeSuite(AuthorizerTests, "Check")
+-    return unittest.TestSuite((function_suite, aggregate_suite, authorizer_suite))
++    authorizer_suite = unittest.makeSuite(AuthorizerTests)
++    return unittest.TestSuite((
++            function_suite,
++            aggregate_suite,
++            authorizer_suite,
++            unittest.makeSuite(AuthorizerRaiseExceptionTests),
++            unittest.makeSuite(AuthorizerIllegalTypeTests),
++            unittest.makeSuite(AuthorizerLargeIntegerTests),
++        ))
+ 
+ def test():
+     runner = unittest.TextTestRunner()
+diff -r bd8afb90ebf2 Lib/sre_compile.py
+--- a/Lib/sre_compile.py
++++ b/Lib/sre_compile.py
+@@ -13,6 +13,7 @@
+ import _sre, sys
+ import sre_parse
+ from sre_constants import *
++from _sre import MAXREPEAT
+ 
+ assert _sre.MAGIC == MAGIC, "SRE module mismatch"
+ 
+diff -r bd8afb90ebf2 Lib/sre_constants.py
+--- a/Lib/sre_constants.py
++++ b/Lib/sre_constants.py
+@@ -15,9 +15,7 @@
+ 
+ MAGIC = 20031017
+ 
+-# max code word in this release
+-
+-MAXREPEAT = 65535
++from _sre import MAXREPEAT
+ 
+ # SRE standard exception (access as sre.error)
+ # should this really be here?
+@@ -219,8 +217,7 @@
+ 
+ if __name__ == "__main__":
+     def dump(f, d, prefix):
+-        items = d.items()
+-        items.sort(key=lambda a: a[1])
++        items = sorted(d.items(), key=lambda a: a[1])
+         for k, v in items:
+             f.write("#define %s_%s %s\n" % (prefix, k.upper(), v))
+     f = open("sre_constants.h", "w")
+diff -r bd8afb90ebf2 Lib/sre_parse.py
+--- a/Lib/sre_parse.py
++++ b/Lib/sre_parse.py
+@@ -15,6 +15,7 @@
+ import sys
+ 
+ from sre_constants import *
++from _sre import MAXREPEAT
+ 
+ SPECIAL_CHARS = ".\\[{()*+?^$|"
+ REPEAT_CHARS = "*+?{"
+@@ -245,7 +246,7 @@
+     if code:
+         return code
+     code = CATEGORIES.get(escape)
+-    if code:
++    if code and code[0] == IN:
+         return code
+     try:
+         c = escape[1:2]
+@@ -537,10 +538,14 @@
+                     continue
+                 if lo:
+                     min = int(lo)
++                    if min >= MAXREPEAT:
++                        raise OverflowError("the repetition number is too large")
+                 if hi:
+                     max = int(hi)
+-                if max < min:
+-                    raise error("bad repeat interval")
++                    if max >= MAXREPEAT:
++                        raise OverflowError("the repetition number is too large")
++                    if max < min:
++                        raise error("bad repeat interval")
+             else:
+                 raise error("not supported")
+             # figure out which item to repeat
+@@ -580,6 +585,8 @@
+                                 break
+                             name = name + char
+                         group = 1
++                        if not name:
++                            raise error("missing group name")
+                         if not isname(name):
+                             raise error("bad character in group name")
+                     elif sourcematch("="):
+@@ -592,6 +599,8 @@
+                             if char == ")":
+                                 break
+                             name = name + char
++                        if not name:
++                            raise error("missing group name")
+                         if not isname(name):
+                             raise error("bad character in group name")
+                         gid = state.groupdict.get(name)
+@@ -644,6 +653,8 @@
+                             break
+                         condname = condname + char
+                     group = 2
++                    if not condname:
++                        raise error("missing group name")
+                     if isname(condname):
+                         condgroup = state.groupdict.get(condname)
+                         if condgroup is None:
+@@ -775,7 +786,7 @@
+                             break
+                         name = name + char
+                 if not name:
+-                    raise error("bad group name")
++                    raise error("missing group name")
+                 try:
+                     index = int(name)
+                     if index < 0:
+diff -r bd8afb90ebf2 Lib/ssl.py
+--- a/Lib/ssl.py
++++ b/Lib/ssl.py
+@@ -553,16 +553,11 @@
+         SSL channel, and the address of the remote client."""
+ 
+         newsock, addr = socket.accept(self)
+-        return (SSLSocket(sock=newsock,
+-                          keyfile=self.keyfile, certfile=self.certfile,
+-                          server_side=True,
+-                          cert_reqs=self.cert_reqs,
+-                          ssl_version=self.ssl_version,
+-                          ca_certs=self.ca_certs,
+-                          ciphers=self.ciphers,
+-                          do_handshake_on_connect=
+-                              self.do_handshake_on_connect),
+-                addr)
++        newsock = self.context.wrap_socket(newsock,
++                    do_handshake_on_connect=self.do_handshake_on_connect,
++                    suppress_ragged_eofs=self.suppress_ragged_eofs,
++                    server_side=True)
++        return newsock, addr
+ 
+     def get_channel_binding(self, cb_type="tls-unique"):
+         """Get channel binding data for current connection.  Raise ValueError
+@@ -579,10 +574,6 @@
+             return None
+         return self._sslobj.tls_unique_cb()
+ 
+-    def __del__(self):
+-        # sys.stderr.write("__del__ on %s\n" % repr(self))
+-        self._real_close()
+-
+ 
+ def wrap_socket(sock, keyfile=None, certfile=None,
+                 server_side=False, cert_reqs=CERT_NONE,
+diff -r bd8afb90ebf2 Lib/subprocess.py
+--- a/Lib/subprocess.py
++++ b/Lib/subprocess.py
+@@ -817,13 +817,27 @@
+                                 errread, errwrite,
+                                 restore_signals, start_new_session)
+         except:
+-            # Cleanup if the child failed starting
+-            for f in filter(None, [self.stdin, self.stdout, self.stderr]):
++            # Cleanup if the child failed starting.
++            for f in filter(None, (self.stdin, self.stdout, self.stderr)):
+                 try:
+                     f.close()
+                 except EnvironmentError:
+-                    # Ignore EBADF or other errors
++                    pass  # Ignore EBADF or other errors.
++
++            # Make sure the child pipes are closed as well.
++            to_close = []
++            if stdin == PIPE:
++                to_close.append(p2cread)
++            if stdout == PIPE:
++                to_close.append(c2pwrite)
++            if stderr == PIPE:
++                to_close.append(errwrite)
++            for fd in to_close:
++                try:
++                    os.close(fd)
++                except EnvironmentError:
+                     pass
++
+             raise
+ 
+ 
+@@ -1327,6 +1341,7 @@
+ 
+             if executable is None:
+                 executable = args[0]
++            orig_executable = executable
+ 
+             # For transferring possible exec failure from child to parent.
+             # Data format: "exception name:hex errno:description"
+@@ -1377,42 +1392,47 @@
+ 
+                 # Wait for exec to fail or succeed; possibly raising an
+                 # exception (limited in size)
+-                data = bytearray()
++                errpipe_data = bytearray()
+                 while True:
+                     part = _eintr_retry_call(os.read, errpipe_read, 50000)
+-                    data += part
+-                    if not part or len(data) > 50000:
++                    errpipe_data += part
++                    if not part or len(errpipe_data) > 50000:
+                         break
+             finally:
+                 # be sure the FD is closed no matter what
+                 os.close(errpipe_read)
+ 
+-            if data:
++            if errpipe_data:
+                 try:
+                     _eintr_retry_call(os.waitpid, self.pid, 0)
+                 except OSError as e:
+                     if e.errno != errno.ECHILD:
+                         raise
+                 try:
+-                    exception_name, hex_errno, err_msg = data.split(b':', 2)
++                    exception_name, hex_errno, err_msg = (
++                            errpipe_data.split(b':', 2))
+                 except ValueError:
+-                    print('Bad exception data:', repr(data))
+                     exception_name = b'RuntimeError'
+                     hex_errno = b'0'
+-                    err_msg = b'Unknown'
++                    err_msg = (b'Bad exception data from child: ' +
++                               repr(errpipe_data))
+                 child_exception_type = getattr(
+                         builtins, exception_name.decode('ascii'),
+                         RuntimeError)
+-                for fd in (p2cwrite, c2pread, errread):
+-                    if fd != -1:
+-                        os.close(fd)
+                 err_msg = err_msg.decode(errors="surrogatepass")
+                 if issubclass(child_exception_type, OSError) and hex_errno:
+                     errno_num = int(hex_errno, 16)
++                    child_exec_never_called = (err_msg == "noexec")
++                    if child_exec_never_called:
++                        err_msg = ""
+                     if errno_num != 0:
+                         err_msg = os.strerror(errno_num)
+                         if errno_num == errno.ENOENT:
+-                            err_msg += ': ' + repr(args[0])
++                            if child_exec_never_called:
++                                # The error must be from chdir(cwd).
++                                err_msg += ': ' + repr(cwd)
++                            else:
++                                err_msg += ': ' + repr(orig_executable)
+                     raise child_exception_type(errno_num, err_msg)
+                 raise child_exception_type(err_msg)
+ 
+@@ -1432,7 +1452,7 @@
+ 
+ 
+         def _internal_poll(self, _deadstate=None, _waitpid=os.waitpid,
+-                _WNOHANG=os.WNOHANG, _os_error=os.error):
++                _WNOHANG=os.WNOHANG, _os_error=os.error, _ECHILD=errno.ECHILD):
+             """Check if child process has terminated.  Returns returncode
+             attribute.
+ 
+@@ -1445,9 +1465,16 @@
+                     pid, sts = _waitpid(self.pid, _WNOHANG)
+                     if pid == self.pid:
+                         self._handle_exitstatus(sts)
+-                except _os_error:
++                except _os_error as e:
+                     if _deadstate is not None:
+                         self.returncode = _deadstate
++                    elif e.errno == _ECHILD:
++                        # This happens if SIGCLD is set to be ignored or
++                        # waiting for child processes has otherwise been
++                        # disabled for our process.  This child is dead, we
++                        # can't get the status.
++                        # http://bugs.python.org/issue15756
++                        self.returncode = 0
+             return self.returncode
+ 
+ 
+@@ -1494,9 +1521,13 @@
+                         raise TimeoutExpired(self.args, timeout)
+                     delay = min(delay * 2, remaining, .05)
+                     time.sleep(delay)
+-            elif self.returncode is None:
+-                (pid, sts) = self._try_wait(0)
+-                self._handle_exitstatus(sts)
++            else:
++                while self.returncode is None:
++                    (pid, sts) = self._try_wait(0)
++                    # Check the pid and loop as waitpid has been known to return
++                    # 0 even without WNOHANG in odd situations.  issue14396.
++                    if pid == self.pid:
++                        self._handle_exitstatus(sts)
+             return self.returncode
+ 
+ 
+diff -r bd8afb90ebf2 Lib/symbol.py
+--- a/Lib/symbol.py
++++ b/Lib/symbol.py
+@@ -91,6 +91,7 @@
+ comp_if = 334
+ encoding_decl = 335
+ yield_expr = 336
++yield_arg = 337
+ #--end constants--
+ 
+ sym_name = {}
+@@ -104,7 +105,7 @@
+     import token
+     if len(sys.argv) == 1:
+         sys.argv = sys.argv + ["Include/graminit.h", "Lib/symbol.py"]
+-    token.main()
++    token._main()
+ 
+ if __name__ == "__main__":
+     main()
+diff -r bd8afb90ebf2 Lib/sysconfig.py
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -390,13 +390,40 @@
+     if _PYTHON_BUILD:
+         vars['LDSHARED'] = vars['BLDSHARED']
+ 
+-    destfile = os.path.join(os.path.dirname(__file__), '_sysconfigdata.py')
++    # There's a chicken-and-egg situation on OS X with regards to the
++    # _sysconfigdata module after the changes introduced by #15298:
++    # get_config_vars() is called by get_platform() as part of the
++    # `make pybuilddir.txt` target -- which is a precursor to the
++    # _sysconfigdata.py module being constructed.  Unfortunately,
++    # get_config_vars() eventually calls _init_posix(), which attempts
++    # to import _sysconfigdata, which we won't have built yet.  In order
++    # for _init_posix() to work, if we're on Darwin, just mock up the
++    # _sysconfigdata module manually and populate it with the build vars.
++    # This is more than sufficient for ensuring the subsequent call to
++    # get_platform() succeeds.
++    name = '_sysconfigdata'
++    if 'darwin' in sys.platform:
++        import imp
++        module = imp.new_module(name)
++        module.build_time_vars = vars
++        sys.modules[name] = module
++
++    pybuilddir = 'build/lib.%s-%s' % (get_platform(), sys.version[:3])
++    if hasattr(sys, "gettotalrefcount"):
++        pybuilddir += '-pydebug'
++    os.makedirs(pybuilddir, exist_ok=True)
++    destfile = os.path.join(pybuilddir, name + '.py')
++
+     with open(destfile, 'w', encoding='utf8') as f:
+         f.write('# system configuration generated and used by'
+                 ' the sysconfig module\n')
+         f.write('build_time_vars = ')
+         pprint.pprint(vars, stream=f)
+ 
++    # Create file used for sys.path fixup -- see Modules/getpath.c
++    with open('pybuilddir.txt', 'w', encoding='ascii') as f:
++        f.write(pybuilddir)
++
+ def _init_posix(vars):
+     """Initialize the module as appropriate for POSIX systems."""
+     # _sysconfigdata is generated at build time, see _generate_posix_vars()
+diff -r bd8afb90ebf2 Lib/tabnanny.py
+--- a/Lib/tabnanny.py
++++ b/Lib/tabnanny.py
+@@ -188,21 +188,21 @@
+         # count, il = self.norm
+         # for i in range(len(count)):
+         #    if count[i]:
+-        #        il = il + (i/tabsize + 1)*tabsize * count[i]
++        #        il = il + (i//tabsize + 1)*tabsize * count[i]
+         # return il
+ 
+         # quicker:
+-        # il = trailing + sum (i/ts + 1)*ts*count[i] =
+-        # trailing + ts * sum (i/ts + 1)*count[i] =
+-        # trailing + ts * sum i/ts*count[i] + count[i] =
+-        # trailing + ts * [(sum i/ts*count[i]) + (sum count[i])] =
+-        # trailing + ts * [(sum i/ts*count[i]) + num_tabs]
+-        # and note that i/ts*count[i] is 0 when i < ts
++        # il = trailing + sum (i//ts + 1)*ts*count[i] =
++        # trailing + ts * sum (i//ts + 1)*count[i] =
++        # trailing + ts * sum i//ts*count[i] + count[i] =
++        # trailing + ts * [(sum i//ts*count[i]) + (sum count[i])] =
++        # trailing + ts * [(sum i//ts*count[i]) + num_tabs]
++        # and note that i//ts*count[i] is 0 when i < ts
+ 
+         count, trailing = self.norm
+         il = 0
+         for i in range(tabsize, len(count)):
+-            il = il + i/tabsize * count[i]
++            il = il + i//tabsize * count[i]
+         return trailing + tabsize * (il + self.nt)
+ 
+     # return true iff self.indent_level(t) == other.indent_level(t)
+diff -r bd8afb90ebf2 Lib/tarfile.py
+--- a/Lib/tarfile.py
++++ b/Lib/tarfile.py
+@@ -1924,9 +1924,8 @@
+ 
+         # Append the tar header and data to the archive.
+         if tarinfo.isreg():
+-            f = bltn_open(name, "rb")
+-            self.addfile(tarinfo, f)
+-            f.close()
++            with bltn_open(name, "rb") as f:
++                self.addfile(tarinfo, f)
+ 
+         elif tarinfo.isdir():
+             self.addfile(tarinfo)
+@@ -2131,16 +2130,15 @@
+         """
+         source = self.fileobj
+         source.seek(tarinfo.offset_data)
+-        target = bltn_open(targetpath, "wb")
+-        if tarinfo.sparse is not None:
+-            for offset, size in tarinfo.sparse:
+-                target.seek(offset)
+-                copyfileobj(source, target, size)
+-        else:
+-            copyfileobj(source, target, tarinfo.size)
+-        target.seek(tarinfo.size)
+-        target.truncate()
+-        target.close()
++        with bltn_open(targetpath, "wb") as target:
++            if tarinfo.sparse is not None:
++                for offset, size in tarinfo.sparse:
++                    target.seek(offset)
++                    copyfileobj(source, target, size)
++            else:
++                copyfileobj(source, target, tarinfo.size)
++            target.seek(tarinfo.size)
++            target.truncate()
+ 
+     def makeunknown(self, tarinfo, targetpath):
+         """Make a file from a TarInfo object with an unknown type
+diff -r bd8afb90ebf2 Lib/tempfile.py
+--- a/Lib/tempfile.py
++++ b/Lib/tempfile.py
+@@ -31,6 +31,7 @@
+ import sys as _sys
+ import io as _io
+ import os as _os
++import errno as _errno
+ from random import Random as _Random
+ 
+ try:
+@@ -171,17 +172,22 @@
+             filename = _os.path.join(dir, name)
+             try:
+                 fd = _os.open(filename, _bin_openflags, 0o600)
+-                fp = _io.open(fd, 'wb')
+-                fp.write(b'blat')
+-                fp.close()
+-                _os.unlink(filename)
+-                del fp, fd
++                try:
++                    try:
++                        with _io.open(fd, 'wb', closefd=False) as fp:
++                            fp.write(b'blat')
++                    finally:
++                        _os.close(fd)
++                finally:
++                    _os.unlink(filename)
+                 return dir
+             except FileExistsError:
+                 pass
+             except OSError:
+                 break   # no point trying more names in this directory
+-    raise FileNotFoundError("No usable temporary directory found in %s" % dirlist)
++    raise FileNotFoundError(_errno.ENOENT,
++                            "No usable temporary directory found in %s" %
++                            dirlist)
+ 
+ _name_sequence = None
+ 
+@@ -214,7 +220,8 @@
+         except FileExistsError:
+             continue    # try again
+ 
+-    raise FileExistsError("No usable temporary file name found")
++    raise FileExistsError(_errno.EEXIST,
++                          "No usable temporary file name found")
+ 
+ 
+ # User visible interfaces.
+@@ -301,7 +308,8 @@
+         except FileExistsError:
+             continue    # try again
+ 
+-    raise FileExistsError("No usable temporary directory name found")
++    raise FileExistsError(_errno.EEXIST,
++                          "No usable temporary directory name found")
+ 
+ def mktemp(suffix="", prefix=template, dir=None):
+     """User-callable function to return a unique temporary file name.  The
+@@ -330,7 +338,8 @@
+         if not _exists(file):
+             return file
+ 
+-    raise FileExistsError("No usable temporary filename found")
++    raise FileExistsError(_errno.EEXIST,
++                          "No usable temporary filename found")
+ 
+ 
+ class _TemporaryFileWrapper:
+@@ -470,8 +479,8 @@
+             raise
+ 
+ class SpooledTemporaryFile:
+-    """Temporary file wrapper, specialized to switch from
+-    StringIO to a real file when it exceeds a certain size or
++    """Temporary file wrapper, specialized to switch from BytesIO
++    or StringIO to a real file when it exceeds a certain size or
+     when a fileno is needed.
+     """
+     _rolled = False
+@@ -537,7 +546,12 @@
+ 
+     @property
+     def encoding(self):
+-        return self._file.encoding
++        try:
++            return self._file.encoding
++        except AttributeError:
++            if 'b' in self._TemporaryFileArgs['mode']:
++                raise
++            return self._TemporaryFileArgs['encoding']
+ 
+     def fileno(self):
+         self.rollover()
+@@ -551,18 +565,26 @@
+ 
+     @property
+     def mode(self):
+-        return self._file.mode
++        try:
++            return self._file.mode
++        except AttributeError:
++            return self._TemporaryFileArgs['mode']
+ 
+     @property
+     def name(self):
+-        return self._file.name
++        try:
++            return self._file.name
++        except AttributeError:
++            return None
+ 
+     @property
+     def newlines(self):
+-        return self._file.newlines
+-
+-    def next(self):
+-        return self._file.next
++        try:
++            return self._file.newlines
++        except AttributeError:
++            if 'b' in self._TemporaryFileArgs['mode']:
++                raise
++            return self._TemporaryFileArgs['newline']
+ 
+     def read(self, *args):
+         return self._file.read(*args)
+@@ -603,9 +625,6 @@
+         self._check(file)
+         return rv
+ 
+-    def xreadlines(self, *args):
+-        return self._file.xreadlines(*args)
+-
+ 
+ class TemporaryDirectory(object):
+     """Create and return a temporary directory.  This has the same
+@@ -621,7 +640,7 @@
+ 
+     def __init__(self, suffix="", prefix=template, dir=None):
+         self._closed = False
+-        self.name = None # Handle mkdtemp throwing an exception
++        self.name = None # Handle mkdtemp raising an exception
+         self.name = mkdtemp(suffix, prefix, dir)
+ 
+     def __repr__(self):
+diff -r bd8afb90ebf2 Lib/test/crashers/compiler_recursion.py
+--- a/Lib/test/crashers/compiler_recursion.py
++++ /dev/null
+@@ -1,13 +0,0 @@
+-"""
+-The compiler (>= 2.5) recurses happily until it blows the stack.
+-
+-Recorded on the tracker as http://bugs.python.org/issue11383
+-"""
+-
+-# The variant below blows up in compiler_call, but there are assorted
+-# other variations that blow up in other functions
+-# e.g. '1*'*10**5+'1' will die in compiler_visit_expr
+-
+-# The exact limit to destroy the stack will vary by platform
+-# but 10M should do the trick even with huge stack allocations
+-compile('()'*10**7, '?', 'exec')
+diff -r bd8afb90ebf2 Lib/test/crashers/recursion_limit_too_high.py
+--- a/Lib/test/crashers/recursion_limit_too_high.py
++++ /dev/null
+@@ -1,16 +0,0 @@
+-# The following example may crash or not depending on the platform.
+-# E.g. on 32-bit Intel Linux in a "standard" configuration it seems to
+-# crash on Python 2.5 (but not 2.4 nor 2.3).  On Windows the import
+-# eventually fails to find the module, possibly because we run out of
+-# file handles.
+-
+-# The point of this example is to show that sys.setrecursionlimit() is a
+-# hack, and not a robust solution.  This example simply exercises a path
+-# where it takes many C-level recursions, consuming a lot of stack
+-# space, for each Python-level recursion.  So 1000 times this amount of
+-# stack space may be too much for standard platforms already.
+-
+-import sys
+-if 'recursion_limit_too_high' in sys.modules:
+-    del sys.modules['recursion_limit_too_high']
+-import recursion_limit_too_high
+diff -r bd8afb90ebf2 Lib/test/crashers/trace_at_recursion_limit.py
+--- /dev/null
++++ b/Lib/test/crashers/trace_at_recursion_limit.py
+@@ -0,0 +1,27 @@
++"""
++From http://bugs.python.org/issue6717
++
++A misbehaving trace hook can trigger a segfault by exceeding the recursion
++limit.
++"""
++import sys
++
++
++def x():
++    pass
++
++def g(*args):
++    if True: # change to True to crash interpreter
++        try:
++            x()
++        except:
++            pass
++    return g
++
++def f():
++    print(sys.getrecursionlimit())
++    f()
++
++sys.settrace(g)
++
++f()
+diff -r bd8afb90ebf2 Lib/test/json_tests/test_dump.py
+--- a/Lib/test/json_tests/test_dump.py
++++ b/Lib/test/json_tests/test_dump.py
+@@ -20,6 +20,14 @@
+                 {2: 3.0, 4.0: 5, False: 1, 6: True}, sort_keys=True),
+                 '{"false": 1, "2": 3.0, "4.0": 5, "6": true}')
+ 
++    # Issue 16228: Crash on encoding resized list
++    def test_encode_mutated(self):
++        a = [object()] * 10
++        def crasher(obj):
++            del a[-1]
++        self.assertEqual(self.dumps(a, default=crasher),
++                 '[null, null, null, null, null]')
++
+ 
+ class TestPyDump(TestDump, PyTest): pass
+ 
+diff -r bd8afb90ebf2 Lib/test/json_tests/test_fail.py
+--- a/Lib/test/json_tests/test_fail.py
++++ b/Lib/test/json_tests/test_fail.py
+@@ -1,13 +1,13 @@
+ from test.json_tests import PyTest, CTest
+ 
+-# Fri Dec 30 18:57:26 2005
++# 2007-10-05
+ JSONDOCS = [
+     # http://json.org/JSON_checker/test/fail1.json
+     '"A JSON payload should be an object or array, not a string."',
+     # http://json.org/JSON_checker/test/fail2.json
+     '["Unclosed array"',
+     # http://json.org/JSON_checker/test/fail3.json
+-    '{unquoted_key: "keys must be quoted}',
++    '{unquoted_key: "keys must be quoted"}',
+     # http://json.org/JSON_checker/test/fail4.json
+     '["extra comma",]',
+     # http://json.org/JSON_checker/test/fail5.json
+@@ -33,7 +33,7 @@
+     # http://json.org/JSON_checker/test/fail15.json
+     '["Illegal backslash escape: \\x15"]',
+     # http://json.org/JSON_checker/test/fail16.json
+-    '["Illegal backslash escape: \\\'"]',
++    '[\\naked]',
+     # http://json.org/JSON_checker/test/fail17.json
+     '["Illegal backslash escape: \\017"]',
+     # http://json.org/JSON_checker/test/fail18.json
+@@ -50,6 +50,24 @@
+     '["Bad value", truth]',
+     # http://json.org/JSON_checker/test/fail24.json
+     "['single quote']",
++    # http://json.org/JSON_checker/test/fail25.json
++    '["\ttab\tcharacter\tin\tstring\t"]',
++    # http://json.org/JSON_checker/test/fail26.json
++    '["tab\\   character\\   in\\  string\\  "]',
++    # http://json.org/JSON_checker/test/fail27.json
++    '["line\nbreak"]',
++    # http://json.org/JSON_checker/test/fail28.json
++    '["line\\\nbreak"]',
++    # http://json.org/JSON_checker/test/fail29.json
++    '[0e]',
++    # http://json.org/JSON_checker/test/fail30.json
++    '[0e+]',
++    # http://json.org/JSON_checker/test/fail31.json
++    '[0e+-1]',
++    # http://json.org/JSON_checker/test/fail32.json
++    '{"Comma instead if closing brace": true,',
++    # http://json.org/JSON_checker/test/fail33.json
++    '["mismatch"}',
+     # http://code.google.com/p/simplejson/issues/detail?id=3
+     '["A\u001FZ control characters in string"]',
+ ]
+diff -r bd8afb90ebf2 Lib/test/json_tests/test_float.py
+--- a/Lib/test/json_tests/test_float.py
++++ b/Lib/test/json_tests/test_float.py
+@@ -13,6 +13,21 @@
+             self.assertEqual(self.dumps(num), str(num))
+             self.assertEqual(int(self.dumps(num)), num)
+ 
++    def test_out_of_range(self):
++        self.assertEqual(self.loads('[23456789012E666]'), [float('inf')])
++        self.assertEqual(self.loads('[-23456789012E666]'), [float('-inf')])
++
++    def test_allow_nan(self):
++        for val in (float('inf'), float('-inf'), float('nan')):
++            out = self.dumps([val])
++            if val == val:  # inf
++                self.assertEqual(self.loads(out), [val])
++            else:  # nan
++                res = self.loads(out)
++                self.assertEqual(len(res), 1)
++                self.assertNotEqual(res[0], res[0])
++            self.assertRaises(ValueError, self.dumps, [val], allow_nan=False)
++
+ 
+ class TestPyFloat(TestFloat, PyTest): pass
+ class TestCFloat(TestFloat, CTest): pass
+diff -r bd8afb90ebf2 Lib/test/json_tests/test_pass1.py
+--- a/Lib/test/json_tests/test_pass1.py
++++ b/Lib/test/json_tests/test_pass1.py
+@@ -17,7 +17,7 @@
+         "real": -9876.543210,
+         "e": 0.123456789e-12,
+         "E": 1.234567890E+34,
+-        "":  23456789012E666,
++        "":  23456789012E66,
+         "zero": 0,
+         "one": 1,
+         "space": " ",
+@@ -28,6 +28,7 @@
+         "alpha": "abcdefghijklmnopqrstuvwyz",
+         "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
+         "digit": "0123456789",
++        "0123456789": "digit",
+         "special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
+         "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
+         "true": true,
+@@ -43,8 +44,7 @@
+ 
+ ,
+ 
+-4 , 5        ,          6           ,7        ],
+-        "compact": [1,2,3,4,5,6,7],
++4 , 5        ,          6           ,7        ],"compact":[1,2,3,4,5,6,7],
+         "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
+         "quotes": "&#34; \u0022 %22 0x22 034 &#x22;",
+         "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
+@@ -55,9 +55,11 @@
+ 99.44
+ ,
+ 
+-1066
+-
+-
++1066,
++1e1,
++0.1e1,
++1e-1,
++1e00,2e+00,2e-00
+ ,"rosebud"]
+ '''
+ 
+@@ -67,12 +69,6 @@
+         res = self.loads(JSON)
+         out = self.dumps(res)
+         self.assertEqual(res, self.loads(out))
+-        try:
+-            self.dumps(res, allow_nan=False)
+-        except ValueError:
+-            pass
+-        else:
+-            self.fail("23456789012E666 should be out of range")
+ 
+ 
+ class TestPyPass1(TestPass1, PyTest): pass
+diff -r bd8afb90ebf2 Lib/test/json_tests/test_tool.py
+--- /dev/null
++++ b/Lib/test/json_tests/test_tool.py
+@@ -0,0 +1,69 @@
++import os
++import sys
++import textwrap
++import unittest
++import subprocess
++from test import support
++from test.script_helper import assert_python_ok
++
++class TestTool(unittest.TestCase):
++    data = """
++
++        [["blorpie"],[ "whoops" ] , [
++                                 ],\t"d-shtaeou",\r"d-nthiouh",
++        "i-vhbjkhnth", {"nifty":87}, {"morefield" :\tfalse,"field"
++            :"yes"}  ]
++           """
++
++    expect = textwrap.dedent("""\
++    [
++        [
++            "blorpie"
++        ],
++        [
++            "whoops"
++        ],
++        [],
++        "d-shtaeou",
++        "d-nthiouh",
++        "i-vhbjkhnth",
++        {
++            "nifty": 87
++        },
++        {
++            "field": "yes",
++            "morefield": false
++        }
++    ]
++    """)
++
++    def test_stdin_stdout(self):
++        with subprocess.Popen(
++                (sys.executable, '-m', 'json.tool'),
++                stdin=subprocess.PIPE, stdout=subprocess.PIPE) as proc:
++            out, err = proc.communicate(self.data.encode())
++        self.assertEqual(out.splitlines(), self.expect.encode().splitlines())
++        self.assertEqual(err, None)
++
++    def _create_infile(self):
++        infile = support.TESTFN
++        with open(infile, "w") as fp:
++            self.addCleanup(os.remove, infile)
++            fp.write(self.data)
++        return infile
++
++    def test_infile_stdout(self):
++        infile = self._create_infile()
++        rc, out, err = assert_python_ok('-m', 'json.tool', infile)
++        self.assertEqual(out.splitlines(), self.expect.encode().splitlines())
++        self.assertEqual(err, b'')
++
++    def test_infile_outfile(self):
++        infile = self._create_infile()
++        outfile = support.TESTFN + '.out'
++        rc, out, err = assert_python_ok('-m', 'json.tool', infile, outfile)
++        self.addCleanup(os.remove, outfile)
++        with open(outfile, "r") as fp:
++            self.assertEqual(fp.read(), self.expect)
++        self.assertEqual(out, b'')
++        self.assertEqual(err, b'')
+diff -r bd8afb90ebf2 Lib/test/multibytecodec_support.py
+--- a/Lib/test/multibytecodec_support.py
++++ b/Lib/test/multibytecodec_support.py
+@@ -108,12 +108,19 @@
+         self.assertEqual(self.encode(sin,
+                                     "test.xmlcharnamereplace")[0], sout)
+ 
++    def test_callback_returns_bytes(self):
++        def myreplace(exc):
++            return (b"1234", exc.end)
++        codecs.register_error("test.cjktest", myreplace)
++        enc = self.encode("abc" + self.unmappedunicode + "def", "test.cjktest")[0]
++        self.assertEqual(enc, b"abc1234def")
++
+     def test_callback_wrong_objects(self):
+         def myreplace(exc):
+             return (ret, exc.end)
+         codecs.register_error("test.cjktest", myreplace)
+ 
+-        for ret in ([1, 2, 3], [], None, object(), b'string', b''):
++        for ret in ([1, 2, 3], [], None, object()):
+             self.assertRaises(TypeError, self.encode, self.unmappedunicode,
+                               'test.cjktest')
+ 
+diff -r bd8afb90ebf2 Lib/test/regrtest.py
+--- a/Lib/test/regrtest.py
++++ b/Lib/test/regrtest.py
+@@ -38,7 +38,7 @@
+ 
+ Selecting tests
+ 
+--r/--random     -- randomize test execution order (see below)
++-r/--randomize  -- randomize test execution order (see below)
+    --randseed   -- pass a random seed to reproduce a previous random run
+ -f/--fromfile   -- read names of tests to run from a file (see below)
+ -x/--exclude    -- arguments are tests to *exclude*
+@@ -301,12 +301,12 @@
+     try:
+         opts, args = getopt.getopt(sys.argv[1:], 'hvqxsoS:rf:lu:t:TD:NLR:FdwWM:nj:Gm:',
+             ['help', 'verbose', 'verbose2', 'verbose3', 'quiet',
+-             'exclude', 'single', 'slow', 'random', 'fromfile', 'findleaks',
++             'exclude', 'single', 'slow', 'randomize', 'fromfile=', 'findleaks',
+              'use=', 'threshold=', 'coverdir=', 'nocoverdir',
+              'runleaks', 'huntrleaks=', 'memlimit=', 'randseed=',
+              'multiprocess=', 'coverage', 'slaveargs=', 'forever', 'debug',
+              'start=', 'nowindows', 'header', 'testdir=', 'timeout=', 'wait',
+-             'failfast', 'match'])
++             'failfast', 'match='])
+     except getopt.error as msg:
+         usage(msg)
+ 
+@@ -556,10 +556,10 @@
+             next_single_test = alltests[alltests.index(selected[0])+1]
+         except IndexError:
+             next_single_test = None
+-    # Remove all the tests that precede start if it's set.
++    # Remove all the selected tests that precede start if it's set.
+     if start:
+         try:
+-            del tests[:tests.index(start)]
++            del selected[:selected.index(start)]
+         except ValueError:
+             print("Couldn't find starting test (%s), using all tests" % start)
+     if randomize:
+diff -r bd8afb90ebf2 Lib/test/sample_doctest_no_docstrings.py
+--- /dev/null
++++ b/Lib/test/sample_doctest_no_docstrings.py
+@@ -0,0 +1,12 @@
++# This is a sample module used for testing doctest.
++#
++# This module is for testing how doctest handles a module with no
++# docstrings.
++
++
++class Foo(object):
++
++    # A class with no docstring.
++
++    def __init__(self):
++        pass
+diff -r bd8afb90ebf2 Lib/test/sample_doctest_no_doctests.py
+--- /dev/null
++++ b/Lib/test/sample_doctest_no_doctests.py
+@@ -0,0 +1,15 @@
++"""This is a sample module used for testing doctest.
++
++This module is for testing how doctest handles a module with docstrings
++but no doctest examples.
++
++"""
++
++
++class Foo(object):
++    """A docstring with no doctest examples.
++
++    """
++
++    def __init__(self):
++        pass
+diff -r bd8afb90ebf2 Lib/test/string_tests.py
+--- a/Lib/test/string_tests.py
++++ b/Lib/test/string_tests.py
+@@ -5,6 +5,7 @@
+ import unittest, string, sys, struct
+ from test import support
+ from collections import UserList
++import _testcapi
+ 
+ class Sequence:
+     def __init__(self, seq='wxyz'): self.seq = seq
+@@ -19,7 +20,7 @@
+     def __init__(self): self.seq = ['a', 'b', 'c']
+     def __len__(self): return 8
+ 
+-class BaseTest(unittest.TestCase):
++class BaseTest:
+     # These tests are for buffers of values (bytes) and not
+     # specific to character interpretation, used for bytes objects
+     # and various string implementations
+@@ -1206,6 +1207,19 @@
+         self.checkraises(ValueError, '%%%df' % (2**64), '__mod__', (3.2))
+         self.checkraises(ValueError, '%%.%df' % (2**64), '__mod__', (3.2))
+ 
++        self.checkraises(OverflowError, '%*s', '__mod__',
++                         (_testcapi.PY_SSIZE_T_MAX + 1, ''))
++        self.checkraises(OverflowError, '%.*f', '__mod__',
++                         (_testcapi.INT_MAX + 1, 1. / 7))
++        # Issue 15989
++        self.checkraises(OverflowError, '%*s', '__mod__',
++                         (1 << (_testcapi.PY_SSIZE_T_MAX.bit_length() + 1), ''))
++        self.checkraises(OverflowError, '%.*f', '__mod__',
++                         (_testcapi.UINT_MAX + 1, 1. / 7))
++
++        class X(object): pass
++        self.checkraises(TypeError, 'abc', '__mod__', X())
++
+     def test_floatformatting(self):
+         # float formatting
+         for prec in range(100):
+diff -r bd8afb90ebf2 Lib/test/subprocessdata/sigchild_ignore.py
+--- a/Lib/test/subprocessdata/sigchild_ignore.py
++++ b/Lib/test/subprocessdata/sigchild_ignore.py
+@@ -1,6 +1,15 @@
+-import signal, subprocess, sys
++import signal, subprocess, sys, time
+ # On Linux this causes os.waitpid to fail with OSError as the OS has already
+ # reaped our child process.  The wait() passing the OSError on to the caller
+ # and causing us to exit with an error is what we are testing against.
+ signal.signal(signal.SIGCHLD, signal.SIG_IGN)
+ subprocess.Popen([sys.executable, '-c', 'print("albatross")']).wait()
++# Also ensure poll() handles an errno.ECHILD appropriately.
++p = subprocess.Popen([sys.executable, '-c', 'print("albatross")'])
++num_polls = 0
++while p.poll() is None:
++    # Waiting for the process to finish.
++    time.sleep(0.01)  # Avoid being a CPU busy loop.
++    num_polls += 1
++    if num_polls > 3000:
++        raise RuntimeError('poll should have returned 0 within 30 seconds')
+diff -r bd8afb90ebf2 Lib/test/support.py
+--- a/Lib/test/support.py
++++ b/Lib/test/support.py
+@@ -603,6 +603,49 @@
+ # module name.
+ TESTFN = "{}_{}_tmp".format(TESTFN, os.getpid())
+ 
++# FS_NONASCII: non-ASCII character encodable by os.fsencode(),
++# or None if there is no such character.
++FS_NONASCII = None
++for character in (
++    # First try printable and common characters to have a readable filename.
++    # For each character, the encoding list are just example of encodings able
++    # to encode the character (the list is not exhaustive).
++
++    # U+00E6 (Latin Small Letter Ae): cp1252, iso-8859-1
++    '\u00E6',
++    # U+0130 (Latin Capital Letter I With Dot Above): cp1254, iso8859_3
++    '\u0130',
++    # U+0141 (Latin Capital Letter L With Stroke): cp1250, cp1257
++    '\u0141',
++    # U+03C6 (Greek Small Letter Phi): cp1253
++    '\u03C6',
++    # U+041A (Cyrillic Capital Letter Ka): cp1251
++    '\u041A',
++    # U+05D0 (Hebrew Letter Alef): Encodable to cp424
++    '\u05D0',
++    # U+060C (Arabic Comma): cp864, cp1006, iso8859_6, mac_arabic
++    '\u060C',
++    # U+062A (Arabic Letter Teh): cp720
++    '\u062A',
++    # U+0E01 (Thai Character Ko Kai): cp874
++    '\u0E01',
++
++    # Then try more "special" characters. "special" because they may be
++    # interpreted or displayed differently depending on the exact locale
++    # encoding and the font.
++
++    # U+00A0 (No-Break Space)
++    '\u00A0',
++    # U+20AC (Euro Sign)
++    '\u20AC',
++):
++    try:
++        os.fsdecode(os.fsencode(character))
++    except UnicodeError:
++        pass
++    else:
++        FS_NONASCII = character
++        break
+ 
+ # TESTFN_UNICODE is a non-ascii filename
+ TESTFN_UNICODE = TESTFN + "-\xe0\xf2\u0258\u0141\u011f"
+@@ -647,6 +690,41 @@
+         # the byte 0xff. Skip some unicode filename tests.
+         pass
+ 
++# TESTFN_UNDECODABLE is a filename (bytes type) that should *not* be able to be
++# decoded from the filesystem encoding (in strict mode). It can be None if we
++# cannot generate such filename (ex: the latin1 encoding can decode any byte
++# sequence). On UNIX, TESTFN_UNDECODABLE can be decoded by os.fsdecode() thanks
++# to the surrogateescape error handler (PEP 383), but not from the filesystem
++# encoding in strict mode.
++TESTFN_UNDECODABLE = None
++for name in (
++    # b'\xff' is not decodable by os.fsdecode() with code page 932. Windows
++    # accepts it to create a file or a directory, or don't accept to enter to
++    # such directory (when the bytes name is used). So test b'\xe7' first: it is
++    # not decodable from cp932.
++    b'\xe7w\xf0',
++    # undecodable from ASCII, UTF-8
++    b'\xff',
++    # undecodable from iso8859-3, iso8859-6, iso8859-7, cp424, iso8859-8, cp856
++    # and cp857
++    b'\xae\xd5'
++    # undecodable from UTF-8 (UNIX and Mac OS X)
++    b'\xed\xb2\x80', b'\xed\xb4\x80',
++    # undecodable from shift_jis, cp869, cp874, cp932, cp1250, cp1251, cp1252,
++    # cp1253, cp1254, cp1255, cp1257, cp1258
++    b'\x81\x98',
++):
++    try:
++        name.decode(TESTFN_ENCODING)
++    except UnicodeDecodeError:
++        TESTFN_UNDECODABLE = os.fsencode(TESTFN) + name
++        break
++
++if FS_NONASCII:
++    TESTFN_NONASCII = TESTFN + '-' + FS_NONASCII
++else:
++    TESTFN_NONASCII = None
++
+ # Save the initial cwd
+ SAVEDCWD = os.getcwd()
+ 
+@@ -680,7 +758,7 @@
+     except OSError:
+         if not quiet:
+             raise
+-        warnings.warn('tests may fail, unable to change the CWD to ' + name,
++        warnings.warn('tests may fail, unable to change the CWD to ' + path,
+                       RuntimeWarning, stacklevel=3)
+     try:
+         yield os.getcwd()
+@@ -1232,7 +1310,7 @@
+             try:
+                 return func(*args, **kwds)
+             finally:
+-                if orig_tz == None:
++                if orig_tz is None:
+                     del os.environ['TZ']
+                 else:
+                     os.environ['TZ'] = orig_tz
+@@ -1510,6 +1588,16 @@
+     _filter_suite(suite, case_pred)
+     _run_suite(suite)
+ 
++#=======================================================================
++# Check for the presence of docstrings.
++
++HAVE_DOCSTRINGS = (check_impl_detail(cpython=False) or
++                   sys.platform == 'win32' or
++                   sysconfig.get_config_var('WITH_DOC_STRINGS'))
++
++requires_docstrings = unittest.skipUnless(HAVE_DOCSTRINGS,
++                                          "test requires docstrings")
++
+ 
+ #=======================================================================
+ # doctest driver.
+diff -r bd8afb90ebf2 Lib/test/test_aifc.py
+--- a/Lib/test/test_aifc.py
++++ b/Lib/test/test_aifc.py
+@@ -112,6 +112,13 @@
+         self.assertEqual(testfile.closed, False)
+         f.close()
+         self.assertEqual(testfile.closed, True)
++        testfile = open(TESTFN, 'wb')
++        fout = aifc.open(testfile, 'wb')
++        self.assertFalse(testfile.closed)
++        with self.assertRaises(aifc.Error):
++            fout.close()
++        self.assertTrue(testfile.closed)
++        fout.close() # do nothing
+ 
+     def test_write_header_comptype_sampwidth(self):
+         for comptype in (b'ULAW', b'ulaw', b'ALAW', b'alaw', b'G722'):
+@@ -286,11 +293,13 @@
+     def test_write_header_raises(self):
+         fout = aifc.open(io.BytesIO(), 'wb')
+         self.assertRaises(aifc.Error, fout.close)
++        fout = aifc.open(io.BytesIO(), 'wb')
+         fout.setnchannels(1)
+         self.assertRaises(aifc.Error, fout.close)
++        fout = aifc.open(io.BytesIO(), 'wb')
++        fout.setnchannels(1)
+         fout.setsampwidth(1)
+         self.assertRaises(aifc.Error, fout.close)
+-        fout.initfp(None)
+ 
+     def test_write_header_comptype_raises(self):
+         for comptype in (b'ULAW', b'ulaw', b'ALAW', b'alaw', b'G722'):
+diff -r bd8afb90ebf2 Lib/test/test_argparse.py
+--- a/Lib/test/test_argparse.py
++++ b/Lib/test/test_argparse.py
+@@ -1463,6 +1463,22 @@
+         ('readonly', NS(x=None, spam=RFile('readonly'))),
+     ]
+ 
++class TestFileTypeDefaults(TempDirMixin, ParserTestCase):
++    """Test that a file is not created unless the default is needed"""
++    def setUp(self):
++        super(TestFileTypeDefaults, self).setUp()
++        file = open(os.path.join(self.temp_dir, 'good'), 'w')
++        file.write('good')
++        file.close()
++
++    argument_signatures = [
++        Sig('-c', type=argparse.FileType('r'), default='no-file.txt'),
++    ]
++    # should provoke no such file error
++    failures = ['']
++    # should not provoke error because default file is created
++    successes = [('-c good', NS(c=RFile('good')))]
++
+ 
+ class TestFileTypeRB(TempDirMixin, ParserTestCase):
+     """Test the FileType option/argument type for reading files"""
+@@ -4559,6 +4575,71 @@
+         self.assertNotIn(msg, 'optional_positional')
+ 
+ 
++# ================================================
++# Check that the type function is called only once
++# ================================================
++
++class TestTypeFunctionCallOnlyOnce(TestCase):
++
++    def test_type_function_call_only_once(self):
++        def spam(string_to_convert):
++            self.assertEqual(string_to_convert, 'spam!')
++            return 'foo_converted'
++
++        parser = argparse.ArgumentParser()
++        parser.add_argument('--foo', type=spam, default='bar')
++        args = parser.parse_args('--foo spam!'.split())
++        self.assertEqual(NS(foo='foo_converted'), args)
++
++# ==================================================================
++# Check semantics regarding the default argument and type conversion
++# ==================================================================
++
++class TestTypeFunctionCalledOnDefault(TestCase):
++
++    def test_type_function_call_with_non_string_default(self):
++        def spam(int_to_convert):
++            self.assertEqual(int_to_convert, 0)
++            return 'foo_converted'
++
++        parser = argparse.ArgumentParser()
++        parser.add_argument('--foo', type=spam, default=0)
++        args = parser.parse_args([])
++        # foo should *not* be converted because its default is not a string.
++        self.assertEqual(NS(foo=0), args)
++
++    def test_type_function_call_with_string_default(self):
++        def spam(int_to_convert):
++            return 'foo_converted'
++
++        parser = argparse.ArgumentParser()
++        parser.add_argument('--foo', type=spam, default='0')
++        args = parser.parse_args([])
++        # foo is converted because its default is a string.
++        self.assertEqual(NS(foo='foo_converted'), args)
++
++    def test_no_double_type_conversion_of_default(self):
++        def extend(str_to_convert):
++            return str_to_convert + '*'
++
++        parser = argparse.ArgumentParser()
++        parser.add_argument('--test', type=extend, default='*')
++        args = parser.parse_args([])
++        # The test argument will be two stars, one coming from the default
++        # value and one coming from the type conversion being called exactly
++        # once.
++        self.assertEqual(NS(test='**'), args)
++
++    def test_issue_15906(self):
++        # Issue #15906: When action='append', type=str, default=[] are
++        # providing, the dest value was the string representation "[]" when it
++        # should have been an empty list.
++        parser = argparse.ArgumentParser()
++        parser.add_argument('--test', dest='test', type=str,
++                            default=[], action='append')
++        args = parser.parse_args([])
++        self.assertEqual(args.test, [])
++
+ # ======================
+ # parse_known_args tests
+ # ======================
+diff -r bd8afb90ebf2 Lib/test/test_array.py
+--- a/Lib/test/test_array.py
++++ b/Lib/test/test_array.py
+@@ -31,7 +31,6 @@
+     def __init__(self, typecode, newarg=None):
+         array.array.__init__(self)
+ 
+-tests = [] # list to accumulate all tests
+ typecodes = "ubBhHiIlLfd"
+ if have_long_long:
+     typecodes += 'qQ'
+@@ -44,7 +43,6 @@
+         self.assertRaises(TypeError, array.array, 'xx')
+         self.assertRaises(ValueError, array.array, 'x')
+ 
+-tests.append(BadConstructorTest)
+ 
+ # Machine format codes.
+ #
+@@ -174,10 +172,7 @@
+                 msg="{0!r} != {1!r}; testcase={2!r}".format(a, b, testcase))
+ 
+ 
+-tests.append(ArrayReconstructorTest)
+-
+-
+-class BaseTest(unittest.TestCase):
++class BaseTest:
+     # Required class attributes (provided by subclasses
+     # typecode: the typecode to test
+     # example: an initializer usable in the constructor for this type
+@@ -1036,7 +1031,7 @@
+         a = array.array(self.typecode, self.example)
+         self.assertRaises(TypeError, a.__setitem__, 0, self.example[:2])
+ 
+-class UnicodeTest(StringTest):
++class UnicodeTest(StringTest, unittest.TestCase):
+     typecode = 'u'
+     example = '\x01\u263a\x00\ufeff'
+     smallerexample = '\x01\u263a\x00\ufefe'
+@@ -1074,8 +1069,6 @@
+ 
+         self.assertRaises(TypeError, a.fromunicode)
+ 
+-tests.append(UnicodeTest)
+-
+ class NumberTest(BaseTest):
+ 
+     def test_extslice(self):
+@@ -1216,57 +1209,47 @@
+         )
+ 
+ 
+-class ByteTest(SignedNumberTest):
++class ByteTest(SignedNumberTest, unittest.TestCase):
+     typecode = 'b'
+     minitemsize = 1
+-tests.append(ByteTest)
+ 
+-class UnsignedByteTest(UnsignedNumberTest):
++class UnsignedByteTest(UnsignedNumberTest, unittest.TestCase):
+     typecode = 'B'
+     minitemsize = 1
+-tests.append(UnsignedByteTest)
+ 
+-class ShortTest(SignedNumberTest):
++class ShortTest(SignedNumberTest, unittest.TestCase):
+     typecode = 'h'
+     minitemsize = 2
+-tests.append(ShortTest)
+ 
+-class UnsignedShortTest(UnsignedNumberTest):
++class UnsignedShortTest(UnsignedNumberTest, unittest.TestCase):
+     typecode = 'H'
+     minitemsize = 2
+-tests.append(UnsignedShortTest)
+ 
+-class IntTest(SignedNumberTest):
++class IntTest(SignedNumberTest, unittest.TestCase):
+     typecode = 'i'
+     minitemsize = 2
+-tests.append(IntTest)
+ 
+-class UnsignedIntTest(UnsignedNumberTest):
++class UnsignedIntTest(UnsignedNumberTest, unittest.TestCase):
+     typecode = 'I'
+     minitemsize = 2
+-tests.append(UnsignedIntTest)
+ 
+-class LongTest(SignedNumberTest):
++class LongTest(SignedNumberTest, unittest.TestCase):
+     typecode = 'l'
+     minitemsize = 4
+-tests.append(LongTest)
+ 
+-class UnsignedLongTest(UnsignedNumberTest):
++class UnsignedLongTest(UnsignedNumberTest, unittest.TestCase):
+     typecode = 'L'
+     minitemsize = 4
+-tests.append(UnsignedLongTest)
+ 
+ @unittest.skipIf(not have_long_long, 'need long long support')
+-class LongLongTest(SignedNumberTest):
++class LongLongTest(SignedNumberTest, unittest.TestCase):
+     typecode = 'q'
+     minitemsize = 8
+-tests.append(LongLongTest)
+ 
+ @unittest.skipIf(not have_long_long, 'need long long support')
+-class UnsignedLongLongTest(UnsignedNumberTest):
++class UnsignedLongLongTest(UnsignedNumberTest, unittest.TestCase):
+     typecode = 'Q'
+     minitemsize = 8
+-tests.append(UnsignedLongLongTest)
+ 
+ class FPTest(NumberTest):
+     example = [-42.0, 0, 42, 1e5, -1e10]
+@@ -1293,12 +1276,11 @@
+             b.byteswap()
+             self.assertEqual(a, b)
+ 
+-class FloatTest(FPTest):
++class FloatTest(FPTest, unittest.TestCase):
+     typecode = 'f'
+     minitemsize = 4
+-tests.append(FloatTest)
+ 
+-class DoubleTest(FPTest):
++class DoubleTest(FPTest, unittest.TestCase):
+     typecode = 'd'
+     minitemsize = 8
+ 
+@@ -1319,22 +1301,6 @@
+         else:
+             self.fail("Array of size > maxsize created - MemoryError expected")
+ 
+-tests.append(DoubleTest)
+-
+-def test_main(verbose=None):
+-    import sys
+-
+-    support.run_unittest(*tests)
+-
+-    # verify reference counting
+-    if verbose and hasattr(sys, "gettotalrefcount"):
+-        import gc
+-        counts = [None] * 5
+-        for i in range(len(counts)):
+-            support.run_unittest(*tests)
+-            gc.collect()
+-            counts[i] = sys.gettotalrefcount()
+-        print(counts)
+ 
+ if __name__ == "__main__":
+-    test_main(verbose=True)
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_ast.py
+--- a/Lib/test/test_ast.py
++++ b/Lib/test/test_ast.py
+@@ -399,6 +399,14 @@
+             compile(m, "<test>", "exec")
+         self.assertIn("string must be of type str", str(cm.exception))
+ 
++    def test_empty_yield_from(self):
++        # Issue 16546: yield from value is not optional.
++        empty_yield_from = ast.parse("def f():\n yield from g()")
++        empty_yield_from.body[0].body[0].value.value = None
++        with self.assertRaises(ValueError) as cm:
++            compile(empty_yield_from, "<test>", "exec")
++        self.assertIn("field value is required", str(cm.exception))
++
+ 
+ class ASTHelpers_Test(unittest.TestCase):
+ 
+@@ -407,6 +415,14 @@
+         b = compile('foo(1 + 1)', '<unknown>', 'exec', ast.PyCF_ONLY_AST)
+         self.assertEqual(ast.dump(a), ast.dump(b))
+ 
++    def test_parse_in_error(self):
++        try:
++            1/0
++        except Exception:
++            with self.assertRaises(SyntaxError) as e:
++                ast.literal_eval(r"'\U'")
++            self.assertIsNotNone(e.exception.__context__)
++
+     def test_dump(self):
+         node = ast.parse('spam(eggs, "and cheese")')
+         self.assertEqual(ast.dump(node),
+diff -r bd8afb90ebf2 Lib/test/test_asyncore.py
+--- a/Lib/test/test_asyncore.py
++++ b/Lib/test/test_asyncore.py
+@@ -513,7 +513,7 @@
+         pass
+ 
+ 
+-class BaseTestAPI(unittest.TestCase):
++class BaseTestAPI:
+ 
+     def tearDown(self):
+         asyncore.close_all()
+@@ -789,7 +789,7 @@
+             t = threading.Thread(target=lambda: asyncore.loop(timeout=0.1,
+                                                               count=500))
+             t.start()
+-
++            self.addCleanup(t.join)
+ 
+             s = socket.socket(self.family, socket.SOCK_STREAM)
+             s.settimeout(.2)
+@@ -821,34 +821,26 @@
+         unlink(self.addr)
+         BaseTestAPI.tearDown(self)
+ 
+-class TestAPI_UseIPv4Select(TestAPI_UseIPv4Sockets):
++class TestAPI_UseIPv4Select(TestAPI_UseIPv4Sockets, unittest.TestCase):
+     use_poll = False
+ 
+ @unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
+-class TestAPI_UseIPv4Poll(TestAPI_UseIPv4Sockets):
++class TestAPI_UseIPv4Poll(TestAPI_UseIPv4Sockets, unittest.TestCase):
+     use_poll = True
+ 
+-class TestAPI_UseIPv6Select(TestAPI_UseIPv6Sockets):
++class TestAPI_UseIPv6Select(TestAPI_UseIPv6Sockets, unittest.TestCase):
+     use_poll = False
+ 
+ @unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
+-class TestAPI_UseIPv6Poll(TestAPI_UseIPv6Sockets):
++class TestAPI_UseIPv6Poll(TestAPI_UseIPv6Sockets, unittest.TestCase):
+     use_poll = True
+ 
+-class TestAPI_UseUnixSocketsSelect(TestAPI_UseUnixSockets):
++class TestAPI_UseUnixSocketsSelect(TestAPI_UseUnixSockets, unittest.TestCase):
+     use_poll = False
+ 
+ @unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
+-class TestAPI_UseUnixSocketsPoll(TestAPI_UseUnixSockets):
++class TestAPI_UseUnixSocketsPoll(TestAPI_UseUnixSockets, unittest.TestCase):
+     use_poll = True
+ 
+-def test_main():
+-    tests = [HelperFunctionTests, DispatcherTests, DispatcherWithSendTests,
+-            DispatcherWithSendTests_UsePoll, FileWrapperTest,
+-            TestAPI_UseIPv4Select, TestAPI_UseIPv4Poll, TestAPI_UseIPv6Select,
+-            TestAPI_UseIPv6Poll, TestAPI_UseUnixSocketsSelect,
+-            TestAPI_UseUnixSocketsPoll]
+-    run_unittest(*tests)
+-
+ if __name__ == "__main__":
+-    test_main()
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_audioop.py
+--- a/Lib/test/test_audioop.py
++++ b/Lib/test/test_audioop.py
+@@ -1,25 +1,21 @@
+ import audioop
++import sys
+ import unittest
+ from test.support import run_unittest
+ 
+-endian = 'big' if audioop.getsample(b'\0\1', 2, 0) == 1 else 'little'
++def pack(width, data):
++    return b''.join(v.to_bytes(width, sys.byteorder, signed=True) for v in data)
+ 
+-def gendata1():
+-    return b'\0\1\2'
++packs = {w: (lambda *data, width=w: pack(width, data)) for w in (1, 2, 4)}
++maxvalues = {w: (1 << (8 * w - 1)) - 1 for w in (1, 2, 4)}
++minvalues = {w: -1 << (8 * w - 1) for w in (1, 2, 4)}
+ 
+-def gendata2():
+-    if endian == 'big':
+-        return b'\0\0\0\1\0\2'
+-    else:
+-        return b'\0\0\1\0\2\0'
+-
+-def gendata4():
+-    if endian == 'big':
+-        return b'\0\0\0\0\0\0\0\1\0\0\0\2'
+-    else:
+-        return b'\0\0\0\0\1\0\0\0\2\0\0\0'
+-
+-data = [gendata1(), gendata2(), gendata4()]
++datas = {
++    1: b'\x00\x12\x45\xbb\x7f\x80\xff',
++    2: packs[2](0, 0x1234, 0x4567, -0x4567, 0x7fff, -0x8000, -1),
++    4: packs[4](0, 0x12345678, 0x456789ab, -0x456789ab,
++                0x7fffffff, -0x80000000, -1),
++}
+ 
+ INVALID_DATA = [
+     (b'abc', 0),
+@@ -31,171 +27,320 @@
+ class TestAudioop(unittest.TestCase):
+ 
+     def test_max(self):
+-        self.assertEqual(audioop.max(data[0], 1), 2)
+-        self.assertEqual(audioop.max(data[1], 2), 2)
+-        self.assertEqual(audioop.max(data[2], 4), 2)
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.max(b'', w), 0)
++            p = packs[w]
++            self.assertEqual(audioop.max(p(5), w), 5)
++            self.assertEqual(audioop.max(p(5, -8, -1), w), 8)
++            self.assertEqual(audioop.max(p(maxvalues[w]), w), maxvalues[w])
++            self.assertEqual(audioop.max(p(minvalues[w]), w), -minvalues[w])
++            self.assertEqual(audioop.max(datas[w], w), -minvalues[w])
+ 
+     def test_minmax(self):
+-        self.assertEqual(audioop.minmax(data[0], 1), (0, 2))
+-        self.assertEqual(audioop.minmax(data[1], 2), (0, 2))
+-        self.assertEqual(audioop.minmax(data[2], 4), (0, 2))
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.minmax(b'', w),
++                             (0x7fffffff, -0x80000000))
++            p = packs[w]
++            self.assertEqual(audioop.minmax(p(5), w), (5, 5))
++            self.assertEqual(audioop.minmax(p(5, -8, -1), w), (-8, 5))
++            self.assertEqual(audioop.minmax(p(maxvalues[w]), w),
++                             (maxvalues[w], maxvalues[w]))
++            self.assertEqual(audioop.minmax(p(minvalues[w]), w),
++                             (minvalues[w], minvalues[w]))
++            self.assertEqual(audioop.minmax(datas[w], w),
++                             (minvalues[w], maxvalues[w]))
+ 
+     def test_maxpp(self):
+-        self.assertEqual(audioop.maxpp(data[0], 1), 0)
+-        self.assertEqual(audioop.maxpp(data[1], 2), 0)
+-        self.assertEqual(audioop.maxpp(data[2], 4), 0)
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.maxpp(b'', w), 0)
++            self.assertEqual(audioop.maxpp(packs[w](*range(100)), w), 0)
++            self.assertEqual(audioop.maxpp(packs[w](9, 10, 5, 5, 0, 1), w), 10)
++            self.assertEqual(audioop.maxpp(datas[w], w),
++                             maxvalues[w] - minvalues[w])
+ 
+     def test_avg(self):
+-        self.assertEqual(audioop.avg(data[0], 1), 1)
+-        self.assertEqual(audioop.avg(data[1], 2), 1)
+-        self.assertEqual(audioop.avg(data[2], 4), 1)
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.avg(b'', w), 0)
++            p = packs[w]
++            self.assertEqual(audioop.avg(p(5), w), 5)
++            self .assertEqual(audioop.avg(p(5, 8), w), 6)
++            self.assertEqual(audioop.avg(p(5, -8), w), -2)
++            self.assertEqual(audioop.avg(p(maxvalues[w], maxvalues[w]), w),
++                             maxvalues[w])
++            self.assertEqual(audioop.avg(p(minvalues[w], minvalues[w]), w),
++                             minvalues[w])
++        self.assertEqual(audioop.avg(packs[4](0x50000000, 0x70000000), 4),
++                         0x60000000)
++        self.assertEqual(audioop.avg(packs[4](-0x50000000, -0x70000000), 4),
++                         -0x60000000)
+ 
+     def test_avgpp(self):
+-        self.assertEqual(audioop.avgpp(data[0], 1), 0)
+-        self.assertEqual(audioop.avgpp(data[1], 2), 0)
+-        self.assertEqual(audioop.avgpp(data[2], 4), 0)
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.avgpp(b'', w), 0)
++            self.assertEqual(audioop.avgpp(packs[w](*range(100)), w), 0)
++            self.assertEqual(audioop.avgpp(packs[w](9, 10, 5, 5, 0, 1), w), 10)
++        self.assertEqual(audioop.avgpp(datas[1], 1), 196)
++        self.assertEqual(audioop.avgpp(datas[2], 2), 50534)
++        self.assertEqual(audioop.avgpp(datas[4], 4), 3311897002)
+ 
+     def test_rms(self):
+-        self.assertEqual(audioop.rms(data[0], 1), 1)
+-        self.assertEqual(audioop.rms(data[1], 2), 1)
+-        self.assertEqual(audioop.rms(data[2], 4), 1)
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.rms(b'', w), 0)
++            p = packs[w]
++            self.assertEqual(audioop.rms(p(*range(100)), w), 57)
++            self.assertAlmostEqual(audioop.rms(p(maxvalues[w]) * 5, w),
++                                   maxvalues[w], delta=1)
++            self.assertAlmostEqual(audioop.rms(p(minvalues[w]) * 5, w),
++                                   -minvalues[w], delta=1)
++        self.assertEqual(audioop.rms(datas[1], 1), 77)
++        self.assertEqual(audioop.rms(datas[2], 2), 20001)
++        self.assertEqual(audioop.rms(datas[4], 4), 1310854152)
+ 
+     def test_cross(self):
+-        self.assertEqual(audioop.cross(data[0], 1), 0)
+-        self.assertEqual(audioop.cross(data[1], 2), 0)
+-        self.assertEqual(audioop.cross(data[2], 4), 0)
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.cross(b'', w), -1)
++            p = packs[w]
++            self.assertEqual(audioop.cross(p(0, 1, 2), w), 0)
++            self.assertEqual(audioop.cross(p(1, 2, -3, -4), w), 1)
++            self.assertEqual(audioop.cross(p(-1, -2, 3, 4), w), 1)
++            self.assertEqual(audioop.cross(p(0, minvalues[w]), w), 1)
++            self.assertEqual(audioop.cross(p(minvalues[w], maxvalues[w]), w), 1)
+ 
+     def test_add(self):
+-        data2 = []
+-        for d in data:
+-            str = bytearray(len(d))
+-            for i,b in enumerate(d):
+-                str[i] = 2*b
+-            data2.append(str)
+-        self.assertEqual(audioop.add(data[0], data[0], 1), data2[0])
+-        self.assertEqual(audioop.add(data[1], data[1], 2), data2[1])
+-        self.assertEqual(audioop.add(data[2], data[2], 4), data2[2])
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.add(b'', b'', w), b'')
++            self.assertEqual(audioop.add(datas[w], b'\0' * len(datas[w]), w),
++                             datas[w])
++        self.assertEqual(audioop.add(datas[1], datas[1], 1),
++                         b'\x00\x24\x7f\x80\x7f\x80\xfe')
++        self.assertEqual(audioop.add(datas[2], datas[2], 2),
++                packs[2](0, 0x2468, 0x7fff, -0x8000, 0x7fff, -0x8000, -2))
++        self.assertEqual(audioop.add(datas[4], datas[4], 4),
++                packs[4](0, 0x2468acf0, 0x7fffffff, -0x80000000,
++                       0x7fffffff, -0x80000000, -2))
+ 
+     def test_bias(self):
+-        # Note: this test assumes that avg() works
+-        d1 = audioop.bias(data[0], 1, 100)
+-        d2 = audioop.bias(data[1], 2, 100)
+-        d4 = audioop.bias(data[2], 4, 100)
+-        self.assertEqual(audioop.avg(d1, 1), 101)
+-        self.assertEqual(audioop.avg(d2, 2), 101)
+-        self.assertEqual(audioop.avg(d4, 4), 101)
++        for w in 1, 2, 4:
++            for bias in 0, 1, -1, 127, -128, 0x7fffffff, -0x80000000:
++                self.assertEqual(audioop.bias(b'', w, bias), b'')
++        self.assertEqual(audioop.bias(datas[1], 1, 1),
++                         b'\x01\x13\x46\xbc\x80\x81\x00')
++        self.assertEqual(audioop.bias(datas[1], 1, -1),
++                         b'\xff\x11\x44\xba\x7e\x7f\xfe')
++        self.assertEqual(audioop.bias(datas[1], 1, 0x7fffffff),
++                         b'\xff\x11\x44\xba\x7e\x7f\xfe')
++        self.assertEqual(audioop.bias(datas[1], 1, -0x80000000),
++                         datas[1])
++        self.assertEqual(audioop.bias(datas[2], 2, 1),
++                packs[2](1, 0x1235, 0x4568, -0x4566, -0x8000, -0x7fff, 0))
++        self.assertEqual(audioop.bias(datas[2], 2, -1),
++                packs[2](-1, 0x1233, 0x4566, -0x4568, 0x7ffe, 0x7fff, -2))
++        self.assertEqual(audioop.bias(datas[2], 2, 0x7fffffff),
++                packs[2](-1, 0x1233, 0x4566, -0x4568, 0x7ffe, 0x7fff, -2))
++        self.assertEqual(audioop.bias(datas[2], 2, -0x80000000),
++                datas[2])
++        self.assertEqual(audioop.bias(datas[4], 4, 1),
++                packs[4](1, 0x12345679, 0x456789ac, -0x456789aa,
++                         -0x80000000, -0x7fffffff, 0))
++        self.assertEqual(audioop.bias(datas[4], 4, -1),
++                packs[4](-1, 0x12345677, 0x456789aa, -0x456789ac,
++                         0x7ffffffe, 0x7fffffff, -2))
++        self.assertEqual(audioop.bias(datas[4], 4, 0x7fffffff),
++                packs[4](0x7fffffff, -0x6dcba989, -0x3a987656, 0x3a987654,
++                         -2, -1, 0x7ffffffe))
++        self.assertEqual(audioop.bias(datas[4], 4, -0x80000000),
++                packs[4](-0x80000000, -0x6dcba988, -0x3a987655, 0x3a987655,
++                         -1, 0, 0x7fffffff))
+ 
+     def test_lin2lin(self):
+-        # too simple: we test only the size
+-        for d1 in data:
+-            for d2 in data:
+-                got = len(d1)//3
+-                wtd = len(d2)//3
+-                self.assertEqual(len(audioop.lin2lin(d1, got, wtd)), len(d2))
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.lin2lin(datas[w], w, w), datas[w])
++
++        self.assertEqual(audioop.lin2lin(datas[1], 1, 2),
++            packs[2](0, 0x1200, 0x4500, -0x4500, 0x7f00, -0x8000, -0x100))
++        self.assertEqual(audioop.lin2lin(datas[1], 1, 4),
++            packs[4](0, 0x12000000, 0x45000000, -0x45000000,
++                     0x7f000000, -0x80000000, -0x1000000))
++        self.assertEqual(audioop.lin2lin(datas[2], 2, 1),
++            b'\x00\x12\x45\xba\x7f\x80\xff')
++        self.assertEqual(audioop.lin2lin(datas[2], 2, 4),
++            packs[4](0, 0x12340000, 0x45670000, -0x45670000,
++                     0x7fff0000, -0x80000000, -0x10000))
++        self.assertEqual(audioop.lin2lin(datas[4], 4, 1),
++            b'\x00\x12\x45\xba\x7f\x80\xff')
++        self.assertEqual(audioop.lin2lin(datas[4], 4, 2),
++            packs[2](0, 0x1234, 0x4567, -0x4568, 0x7fff, -0x8000, -1))
+ 
+     def test_adpcm2lin(self):
++        self.assertEqual(audioop.adpcm2lin(b'\x07\x7f\x7f', 1, None),
++                         (b'\x00\x00\x00\xff\x00\xff', (-179, 40)))
++        self.assertEqual(audioop.adpcm2lin(b'\x07\x7f\x7f', 2, None),
++                         (packs[2](0, 0xb, 0x29, -0x16, 0x72, -0xb3), (-179, 40)))
++        self.assertEqual(audioop.adpcm2lin(b'\x07\x7f\x7f', 4, None),
++                         (packs[4](0, 0xb0000, 0x290000, -0x160000, 0x720000,
++                                   -0xb30000), (-179, 40)))
++
+         # Very cursory test
+-        self.assertEqual(audioop.adpcm2lin(b'\0\0', 1, None), (b'\0' * 4, (0,0)))
+-        self.assertEqual(audioop.adpcm2lin(b'\0\0', 2, None), (b'\0' * 8, (0,0)))
+-        self.assertEqual(audioop.adpcm2lin(b'\0\0', 4, None), (b'\0' * 16, (0,0)))
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.adpcm2lin(b'\0' * 5, w, None),
++                             (b'\0' * w * 10, (0, 0)))
+ 
+     def test_lin2adpcm(self):
++        self.assertEqual(audioop.lin2adpcm(datas[1], 1, None),
++                         (b'\x07\x7f\x7f', (-221, 39)))
++        self.assertEqual(audioop.lin2adpcm(datas[2], 2, None),
++                         (b'\x07\x7f\x7f', (31, 39)))
++        self.assertEqual(audioop.lin2adpcm(datas[4], 4, None),
++                         (b'\x07\x7f\x7f', (31, 39)))
++
+         # Very cursory test
+-        self.assertEqual(audioop.lin2adpcm(b'\0\0\0\0', 1, None), (b'\0\0', (0,0)))
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.lin2adpcm(b'\0' * w * 10, w, None),
++                             (b'\0' * 5, (0, 0)))
+ 
+     def test_lin2alaw(self):
+-        self.assertEqual(audioop.lin2alaw(data[0], 1), b'\xd5\xc5\xf5')
+-        self.assertEqual(audioop.lin2alaw(data[1], 2), b'\xd5\xd5\xd5')
+-        self.assertEqual(audioop.lin2alaw(data[2], 4), b'\xd5\xd5\xd5')
++        self.assertEqual(audioop.lin2alaw(datas[1], 1),
++                         b'\xd5\x87\xa4\x24\xaa\x2a\x5a')
++        self.assertEqual(audioop.lin2alaw(datas[2], 2),
++                         b'\xd5\x87\xa4\x24\xaa\x2a\x55')
++        self.assertEqual(audioop.lin2alaw(datas[4], 4),
++                         b'\xd5\x87\xa4\x24\xaa\x2a\x55')
+ 
+     def test_alaw2lin(self):
+-        # Cursory
+-        d = audioop.lin2alaw(data[0], 1)
+-        self.assertEqual(audioop.alaw2lin(d, 1), data[0])
+-        if endian == 'big':
+-            self.assertEqual(audioop.alaw2lin(d, 2),
+-                             b'\x00\x08\x01\x08\x02\x10')
+-            self.assertEqual(audioop.alaw2lin(d, 4),
+-                             b'\x00\x08\x00\x00\x01\x08\x00\x00\x02\x10\x00\x00')
+-        else:
+-            self.assertEqual(audioop.alaw2lin(d, 2),
+-                             b'\x08\x00\x08\x01\x10\x02')
+-            self.assertEqual(audioop.alaw2lin(d, 4),
+-                             b'\x00\x00\x08\x00\x00\x00\x08\x01\x00\x00\x10\x02')
++        encoded = b'\x00\x03\x24\x2a\x51\x54\x55\x58\x6b\x71\x7f'\
++                  b'\x80\x83\xa4\xaa\xd1\xd4\xd5\xd8\xeb\xf1\xff'
++        src = [-688, -720, -2240, -4032, -9, -3, -1, -27, -244, -82, -106,
++               688, 720, 2240, 4032, 9, 3, 1, 27, 244, 82, 106]
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.alaw2lin(encoded, w),
++                             packs[w](*(x << (w * 8) >> 13 for x in src)))
++
++        encoded = bytes(range(256))
++        for w in 2, 4:
++            decoded = audioop.alaw2lin(encoded, w)
++            self.assertEqual(audioop.lin2alaw(decoded, w), encoded)
+ 
+     def test_lin2ulaw(self):
+-        self.assertEqual(audioop.lin2ulaw(data[0], 1), b'\xff\xe7\xdb')
+-        self.assertEqual(audioop.lin2ulaw(data[1], 2), b'\xff\xff\xff')
+-        self.assertEqual(audioop.lin2ulaw(data[2], 4), b'\xff\xff\xff')
++        self.assertEqual(audioop.lin2ulaw(datas[1], 1),
++                         b'\xff\xad\x8e\x0e\x80\x00\x67')
++        self.assertEqual(audioop.lin2ulaw(datas[2], 2),
++                         b'\xff\xad\x8e\x0e\x80\x00\x7e')
++        self.assertEqual(audioop.lin2ulaw(datas[4], 4),
++                         b'\xff\xad\x8e\x0e\x80\x00\x7e')
+ 
+     def test_ulaw2lin(self):
+-        # Cursory
+-        d = audioop.lin2ulaw(data[0], 1)
+-        self.assertEqual(audioop.ulaw2lin(d, 1), data[0])
+-        if endian == 'big':
+-            self.assertEqual(audioop.ulaw2lin(d, 2),
+-                             b'\x00\x00\x01\x04\x02\x0c')
+-            self.assertEqual(audioop.ulaw2lin(d, 4),
+-                             b'\x00\x00\x00\x00\x01\x04\x00\x00\x02\x0c\x00\x00')
+-        else:
+-            self.assertEqual(audioop.ulaw2lin(d, 2),
+-                             b'\x00\x00\x04\x01\x0c\x02')
+-            self.assertEqual(audioop.ulaw2lin(d, 4),
+-                             b'\x00\x00\x00\x00\x00\x00\x04\x01\x00\x00\x0c\x02')
++        encoded = b'\x00\x0e\x28\x3f\x57\x6a\x76\x7c\x7e\x7f'\
++                  b'\x80\x8e\xa8\xbf\xd7\xea\xf6\xfc\xfe\xff'
++        src = [-8031, -4447, -1471, -495, -163, -53, -18, -6, -2, 0,
++               8031, 4447, 1471, 495, 163, 53, 18, 6, 2, 0]
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.ulaw2lin(encoded, w),
++                             packs[w](*(x << (w * 8) >> 14 for x in src)))
++
++        # Current u-law implementation has two codes fo 0: 0x7f and 0xff.
++        encoded = bytes(range(127)) + bytes(range(128, 256))
++        for w in 2, 4:
++            decoded = audioop.ulaw2lin(encoded, w)
++            self.assertEqual(audioop.lin2ulaw(decoded, w), encoded)
+ 
+     def test_mul(self):
+-        data2 = []
+-        for d in data:
+-            str = bytearray(len(d))
+-            for i,b in enumerate(d):
+-                str[i] = 2*b
+-            data2.append(str)
+-        self.assertEqual(audioop.mul(data[0], 1, 2), data2[0])
+-        self.assertEqual(audioop.mul(data[1],2, 2), data2[1])
+-        self.assertEqual(audioop.mul(data[2], 4, 2), data2[2])
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.mul(b'', w, 2), b'')
++            self.assertEqual(audioop.mul(datas[w], w, 0),
++                             b'\0' * len(datas[w]))
++            self.assertEqual(audioop.mul(datas[w], w, 1),
++                             datas[w])
++        self.assertEqual(audioop.mul(datas[1], 1, 2),
++                         b'\x00\x24\x7f\x80\x7f\x80\xfe')
++        self.assertEqual(audioop.mul(datas[2], 2, 2),
++                packs[2](0, 0x2468, 0x7fff, -0x8000, 0x7fff, -0x8000, -2))
++        self.assertEqual(audioop.mul(datas[4], 4, 2),
++                packs[4](0, 0x2468acf0, 0x7fffffff, -0x80000000,
++                         0x7fffffff, -0x80000000, -2))
+ 
+     def test_ratecv(self):
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.ratecv(b'', w, 1, 8000, 8000, None),
++                             (b'', (-1, ((0, 0),))))
++            self.assertEqual(audioop.ratecv(b'', w, 5, 8000, 8000, None),
++                             (b'', (-1, ((0, 0),) * 5)))
++            self.assertEqual(audioop.ratecv(b'', w, 1, 8000, 16000, None),
++                             (b'', (-2, ((0, 0),))))
++            self.assertEqual(audioop.ratecv(datas[w], w, 1, 8000, 8000, None)[0],
++                             datas[w])
+         state = None
+-        d1, state = audioop.ratecv(data[0], 1, 1, 8000, 16000, state)
+-        d2, state = audioop.ratecv(data[0], 1, 1, 8000, 16000, state)
++        d1, state = audioop.ratecv(b'\x00\x01\x02', 1, 1, 8000, 16000, state)
++        d2, state = audioop.ratecv(b'\x00\x01\x02', 1, 1, 8000, 16000, state)
+         self.assertEqual(d1 + d2, b'\000\000\001\001\002\001\000\000\001\001\002')
+ 
++        for w in 1, 2, 4:
++            d0, state0 = audioop.ratecv(datas[w], w, 1, 8000, 16000, None)
++            d, state = b'', None
++            for i in range(0, len(datas[w]), w):
++                d1, state = audioop.ratecv(datas[w][i:i + w], w, 1,
++                                           8000, 16000, state)
++                d += d1
++            self.assertEqual(d, d0)
++            self.assertEqual(state, state0)
++
+     def test_reverse(self):
+-        self.assertEqual(audioop.reverse(data[0], 1), b'\2\1\0')
++        for w in 1, 2, 4:
++            self.assertEqual(audioop.reverse(b'', w), b'')
++            self.assertEqual(audioop.reverse(packs[w](0, 1, 2), w),
++                             packs[w](2, 1, 0))
+ 
+     def test_tomono(self):
+-        data2 = bytearray()
+-        for d in data[0]:
+-            data2.append(d)
+-            data2.append(d)
+-        self.assertEqual(audioop.tomono(data2, 1, 0.5, 0.5), data[0])
++        for w in 1, 2, 4:
++            data1 = datas[w]
++            data2 = bytearray(2 * len(data1))
++            for k in range(w):
++                data2[k::2*w] = data1[k::w]
++            self.assertEqual(audioop.tomono(data2, w, 1, 0), data1)
++            self.assertEqual(audioop.tomono(data2, w, 0, 1), b'\0' * len(data1))
++            for k in range(w):
++                data2[k+w::2*w] = data1[k::w]
++            self.assertEqual(audioop.tomono(data2, w, 0.5, 0.5), data1)
+ 
+     def test_tostereo(self):
+-        data2 = bytearray()
+-        for d in data[0]:
+-            data2.append(d)
+-            data2.append(d)
+-        self.assertEqual(audioop.tostereo(data[0], 1, 1, 1), data2)
++        for w in 1, 2, 4:
++            data1 = datas[w]
++            data2 = bytearray(2 * len(data1))
++            for k in range(w):
++                data2[k::2*w] = data1[k::w]
++            self.assertEqual(audioop.tostereo(data1, w, 1, 0), data2)
++            self.assertEqual(audioop.tostereo(data1, w, 0, 0), b'\0' * len(data2))
++            for k in range(w):
++                data2[k+w::2*w] = data1[k::w]
++            self.assertEqual(audioop.tostereo(data1, w, 1, 1), data2)
+ 
+     def test_findfactor(self):
+-        self.assertEqual(audioop.findfactor(data[1], data[1]), 1.0)
++        self.assertEqual(audioop.findfactor(datas[2], datas[2]), 1.0)
++        self.assertEqual(audioop.findfactor(b'\0' * len(datas[2]), datas[2]),
++                         0.0)
+ 
+     def test_findfit(self):
+-        self.assertEqual(audioop.findfit(data[1], data[1]), (0, 1.0))
++        self.assertEqual(audioop.findfit(datas[2], datas[2]), (0, 1.0))
++        self.assertEqual(audioop.findfit(datas[2], packs[2](1, 2, 0)),
++                         (1, 8038.8))
++        self.assertEqual(audioop.findfit(datas[2][:-2] * 5 + datas[2], datas[2]),
++                         (30, 1.0))
+ 
+     def test_findmax(self):
+-        self.assertEqual(audioop.findmax(data[1], 1), 2)
++        self.assertEqual(audioop.findmax(datas[2], 1), 5)
+ 
+     def test_getsample(self):
+-        for i in range(3):
+-            self.assertEqual(audioop.getsample(data[0], 1, i), i)
+-            self.assertEqual(audioop.getsample(data[1], 2, i), i)
+-            self.assertEqual(audioop.getsample(data[2], 4, i), i)
++        for w in 1, 2, 4:
++            data = packs[w](0, 1, -1, maxvalues[w], minvalues[w])
++            self.assertEqual(audioop.getsample(data, w, 0), 0)
++            self.assertEqual(audioop.getsample(data, w, 1), 1)
++            self.assertEqual(audioop.getsample(data, w, 2), -1)
++            self.assertEqual(audioop.getsample(data, w, 3), maxvalues[w])
++            self.assertEqual(audioop.getsample(data, w, 4), minvalues[w])
+ 
+     def test_negativelen(self):
+         # from issue 3306, previously it segfaulted
+         self.assertRaises(audioop.error,
+-            audioop.findmax, ''.join(chr(x) for x in range(256)), -2392392)
++            audioop.findmax, bytes(range(256)), -2392392)
+ 
+     def test_issue7673(self):
+         state = None
+@@ -222,9 +367,9 @@
+             self.assertRaises(audioop.error, audioop.lin2adpcm, data, size, state)
+ 
+     def test_wrongsize(self):
+-        data = b'abc'
++        data = b'abcdefgh'
+         state = None
+-        for size in (-1, 3, 5):
++        for size in (-1, 0, 3, 5, 1024):
+             self.assertRaises(audioop.error, audioop.ulaw2lin, data, size)
+             self.assertRaises(audioop.error, audioop.alaw2lin, data, size)
+             self.assertRaises(audioop.error, audioop.adpcm2lin, data, size, state)
+diff -r bd8afb90ebf2 Lib/test/test_bisect.py
+--- a/Lib/test/test_bisect.py
++++ b/Lib/test/test_bisect.py
+@@ -3,25 +3,8 @@
+ from test import support
+ from collections import UserList
+ 
+-# We do a bit of trickery here to be able to test both the C implementation
+-# and the Python implementation of the module.
+-
+-# Make it impossible to import the C implementation anymore.
+-sys.modules['_bisect'] = 0
+-# We must also handle the case that bisect was imported before.
+-if 'bisect' in sys.modules:
+-    del sys.modules['bisect']
+-
+-# Now we can import the module and get the pure Python implementation.
+-import bisect as py_bisect
+-
+-# Restore everything to normal.
+-del sys.modules['_bisect']
+-del sys.modules['bisect']
+-
+-# This is now the module with the C implementation.
+-import bisect as c_bisect
+-
++py_bisect = support.import_fresh_module('bisect', blocked=['_bisect'])
++c_bisect = support.import_fresh_module('bisect', fresh=['_bisect'])
+ 
+ class Range(object):
+     """A trivial range()-like object without any integer width limitations."""
+@@ -45,9 +28,7 @@
+         self.last_insert = idx, item
+ 
+ 
+-class TestBisect(unittest.TestCase):
+-    module = None
+-
++class TestBisect:
+     def setUp(self):
+         self.precomputedCases = [
+             (self.module.bisect_right, [], 1, 0),
+@@ -218,17 +199,15 @@
+         self.module.insort(a=data, x=25, lo=1, hi=3)
+         self.assertEqual(data, [10, 20, 25, 25, 25, 30, 40, 50])
+ 
+-class TestBisectPython(TestBisect):
++class TestBisectPython(TestBisect, unittest.TestCase):
+     module = py_bisect
+ 
+-class TestBisectC(TestBisect):
++class TestBisectC(TestBisect, unittest.TestCase):
+     module = c_bisect
+ 
+ #==============================================================================
+ 
+-class TestInsort(unittest.TestCase):
+-    module = None
+-
++class TestInsort:
+     def test_vsBuiltinSort(self, n=500):
+         from random import choice
+         for insorted in (list(), UserList()):
+@@ -239,7 +218,7 @@
+                 else:
+                     f = self.module.insort_right
+                 f(insorted, digit)
+-        self.assertEqual(sorted(insorted), insorted)
++            self.assertEqual(sorted(insorted), insorted)
+ 
+     def test_backcompatibility(self):
+         self.assertEqual(self.module.insort, self.module.insort_right)
+@@ -255,15 +234,14 @@
+         self.module.insort_right(lst, 5)
+         self.assertEqual([5, 10], lst.data)
+ 
+-class TestInsortPython(TestInsort):
++class TestInsortPython(TestInsort, unittest.TestCase):
+     module = py_bisect
+ 
+-class TestInsortC(TestInsort):
++class TestInsortC(TestInsort, unittest.TestCase):
+     module = c_bisect
+ 
+ #==============================================================================
+ 
+-
+ class LenOnly:
+     "Dummy sequence class defining __len__ but not __getitem__."
+     def __len__(self):
+@@ -284,9 +262,7 @@
+     __eq__ = __lt__
+     __ne__ = __lt__
+ 
+-class TestErrorHandling(unittest.TestCase):
+-    module = None
+-
++class TestErrorHandling:
+     def test_non_sequence(self):
+         for f in (self.module.bisect_left, self.module.bisect_right,
+                   self.module.insort_left, self.module.insort_right):
+@@ -313,58 +289,40 @@
+                   self.module.insort_left, self.module.insort_right):
+             self.assertRaises(TypeError, f, 10)
+ 
+-class TestErrorHandlingPython(TestErrorHandling):
++class TestErrorHandlingPython(TestErrorHandling, unittest.TestCase):
+     module = py_bisect
+ 
+-class TestErrorHandlingC(TestErrorHandling):
++class TestErrorHandlingC(TestErrorHandling, unittest.TestCase):
+     module = c_bisect
+ 
+ #==============================================================================
+ 
+-libreftest = """
+-Example from the Library Reference:  Doc/library/bisect.rst
++class TestDocExample:
++    def test_grades(self):
++        def grade(score, breakpoints=[60, 70, 80, 90], grades='FDCBA'):
++            i = self.module.bisect(breakpoints, score)
++            return grades[i]
+ 
+-The bisect() function is generally useful for categorizing numeric data.
+-This example uses bisect() to look up a letter grade for an exam total
+-(say) based on a set of ordered numeric breakpoints: 85 and up is an `A',
+-75..84 is a `B', etc.
++        result = [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]
++        self.assertEqual(result, ['F', 'A', 'C', 'C', 'B', 'A', 'A'])
+ 
+-    >>> grades = "FEDCBA"
+-    >>> breakpoints = [30, 44, 66, 75, 85]
+-    >>> from bisect import bisect
+-    >>> def grade(total):
+-    ...           return grades[bisect(breakpoints, total)]
+-    ...
+-    >>> grade(66)
+-    'C'
+-    >>> list(map(grade, [33, 99, 77, 44, 12, 88]))
+-    ['E', 'A', 'B', 'D', 'F', 'A']
++    def test_colors(self):
++        data = [('red', 5), ('blue', 1), ('yellow', 8), ('black', 0)]
++        data.sort(key=lambda r: r[1])
++        keys = [r[1] for r in data]
++        bisect_left = self.module.bisect_left
++        self.assertEqual(data[bisect_left(keys, 0)], ('black', 0))
++        self.assertEqual(data[bisect_left(keys, 1)], ('blue', 1))
++        self.assertEqual(data[bisect_left(keys, 5)], ('red', 5))
++        self.assertEqual(data[bisect_left(keys, 8)], ('yellow', 8))
+ 
+-"""
++class TestDocExamplePython(TestDocExample, unittest.TestCase):
++    module = py_bisect
++
++class TestDocExampleC(TestDocExample, unittest.TestCase):
++    module = c_bisect
+ 
+ #------------------------------------------------------------------------------
+ 
+-__test__ = {'libreftest' : libreftest}
+-
+-def test_main(verbose=None):
+-    from test import test_bisect
+-
+-    test_classes = [TestBisectPython, TestBisectC,
+-                    TestInsortPython, TestInsortC,
+-                    TestErrorHandlingPython, TestErrorHandlingC]
+-
+-    support.run_unittest(*test_classes)
+-    support.run_doctest(test_bisect, verbose)
+-
+-    # verify reference counting
+-    if verbose and hasattr(sys, "gettotalrefcount"):
+-        import gc
+-        counts = [None] * 5
+-        for i in range(len(counts)):
+-            support.run_unittest(*test_classes)
+-            gc.collect()
+-            counts[i] = sys.gettotalrefcount()
+-        print(counts)
+-
+ if __name__ == "__main__":
+-    test_main(verbose=True)
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_buffer.py
+--- a/Lib/test/test_buffer.py
++++ b/Lib/test/test_buffer.py
+@@ -3999,14 +3999,32 @@
+         m = memoryview(x)
+         self.assertEqual(hash(m), hash(x))
+ 
++        # equality-hash invariant
++        x = ndarray(list(range(12)), shape=[12], format='B')
++        a = memoryview(x)
++
++        y = ndarray(list(range(12)), shape=[12], format='b')
++        b = memoryview(y)
++
++        self.assertEqual(a, b)
++        self.assertEqual(hash(a), hash(b))
++
+         # non-byte formats
+         nd = ndarray(list(range(12)), shape=[2,2,3], format='L')
+         m = memoryview(nd)
+-        self.assertEqual(hash(m), hash(nd.tobytes()))
++        self.assertRaises(ValueError, m.__hash__)
+ 
+         nd = ndarray(list(range(-6, 6)), shape=[2,2,3], format='h')
+         m = memoryview(nd)
+-        self.assertEqual(hash(m), hash(nd.tobytes()))
++        self.assertRaises(ValueError, m.__hash__)
++
++        nd = ndarray(list(range(12)), shape=[2,2,3], format='= L')
++        m = memoryview(nd)
++        self.assertRaises(ValueError, m.__hash__)
++
++        nd = ndarray(list(range(-6, 6)), shape=[2,2,3], format='< h')
++        m = memoryview(nd)
++        self.assertRaises(ValueError, m.__hash__)
+ 
+     def test_memoryview_release(self):
+ 
+diff -r bd8afb90ebf2 Lib/test/test_bufio.py
+--- a/Lib/test/test_bufio.py
++++ b/Lib/test/test_bufio.py
+@@ -11,7 +11,7 @@
+ lengths = list(range(1, 257)) + [512, 1000, 1024, 2048, 4096, 8192, 10000,
+                                  16384, 32768, 65536, 1000000]
+ 
+-class BufferSizeTest(unittest.TestCase):
++class BufferSizeTest:
+     def try_one(self, s):
+         # Write s + "\n" + s to file, then open it and ensure that successive
+         # .readline()s deliver what we wrote.
+@@ -62,15 +62,12 @@
+         self.drive_one(bytes(1000))
+ 
+ 
+-class CBufferSizeTest(BufferSizeTest):
++class CBufferSizeTest(BufferSizeTest, unittest.TestCase):
+     open = io.open
+ 
+-class PyBufferSizeTest(BufferSizeTest):
++class PyBufferSizeTest(BufferSizeTest, unittest.TestCase):
+     open = staticmethod(pyio.open)
+ 
+ 
+-def test_main():
+-    support.run_unittest(CBufferSizeTest, PyBufferSizeTest)
+-
+ if __name__ == "__main__":
+-    test_main()
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_builtin.py
+--- a/Lib/test/test_builtin.py
++++ b/Lib/test/test_builtin.py
+@@ -189,7 +189,7 @@
+         self.assertEqual(any([None, None, None]), False)
+         self.assertEqual(any([None, 4, None]), True)
+         self.assertRaises(RuntimeError, any, [None, TestFailingBool(), 6])
+-        self.assertRaises(RuntimeError, all, TestFailingIter())
++        self.assertRaises(RuntimeError, any, TestFailingIter())
+         self.assertRaises(TypeError, any, 10)               # Non-iterable
+         self.assertRaises(TypeError, any)                   # No args
+         self.assertRaises(TypeError, any, [2, 4, 6], [])    # Too many args
+@@ -1172,6 +1172,8 @@
+         # Check stdin/stdout error handler is used when invoking GNU readline
+         self.check_input_tty("prompté", b"quux\xe9", "ascii")
+ 
++    # test_int(): see test_int.py for tests of built-in function int().
++
+     def test_repr(self):
+         self.assertEqual(repr(''), '\'\'')
+         self.assertEqual(repr(0), '0')
+@@ -1286,6 +1288,7 @@
+         self.assertRaises(TypeError, setattr, sys, 1, 'spam')
+         self.assertRaises(TypeError, setattr)
+ 
++    # test_str(): see test_unicode.py and test_bytes.py for str() tests.
+ 
+     def test_sum(self):
+         self.assertEqual(sum([]), 0)
+diff -r bd8afb90ebf2 Lib/test/test_bytes.py
+--- a/Lib/test/test_bytes.py
++++ b/Lib/test/test_bytes.py
+@@ -38,7 +38,7 @@
+         return self.value
+ 
+ 
+-class BaseBytesTest(unittest.TestCase):
++class BaseBytesTest:
+ 
+     def test_basics(self):
+         b = self.type2test()
+@@ -682,7 +682,7 @@
+                                 x, None, None, None)
+ 
+ 
+-class BytesTest(BaseBytesTest):
++class BytesTest(BaseBytesTest, unittest.TestCase):
+     type2test = bytes
+ 
+     def test_buffer_is_readonly(self):
+@@ -701,6 +701,12 @@
+             def __bytes__(self):
+                 return None
+         self.assertRaises(TypeError, bytes, A())
++        class A:
++            def __bytes__(self):
++                return b'a'
++            def __index__(self):
++                return 42
++        self.assertEqual(bytes(A()), b'a')
+ 
+     # Test PyBytes_FromFormat()
+     def test_from_format(self):
+@@ -724,7 +730,7 @@
+                          b's:cstr')
+ 
+ 
+-class ByteArrayTest(BaseBytesTest):
++class ByteArrayTest(BaseBytesTest, unittest.TestCase):
+     type2test = bytearray
+ 
+     def test_nohash(self):
+@@ -871,6 +877,24 @@
+         b[3:0] = [42, 42, 42]
+         self.assertEqual(b, bytearray([0, 1, 2, 42, 42, 42, 3, 4, 5, 6, 7, 8, 9]))
+ 
++        b[3:] = b'foo'
++        self.assertEqual(b, bytearray([0, 1, 2, 102, 111, 111]))
++
++        b[:3] = memoryview(b'foo')
++        self.assertEqual(b, bytearray([102, 111, 111, 102, 111, 111]))
++
++        b[3:4] = []
++        self.assertEqual(b, bytearray([102, 111, 111, 111, 111]))
++
++        for elem in [5, -5, 0, int(10e20), 'str', 2.3,
++                     ['a', 'b'], [b'a', b'b'], [[]]]:
++            with self.assertRaises(TypeError):
++                b[3:4] = elem
++
++        for elem in [[254, 255, 256], [-256, 9000]]:
++            with self.assertRaises(ValueError):
++                b[3:4] = elem
++
+     def test_extended_set_del_slice(self):
+         indices = (0, None, 1, 3, 19, 300, 1<<333, -1, -2, -31, -300)
+         for start in indices:
+@@ -1134,6 +1158,7 @@
+         self.assertEqual(bytes(b"abc") < b"ab", False)
+         self.assertEqual(bytes(b"abc") <= b"ab", False)
+ 
++    @test.support.requires_docstrings
+     def test_doc(self):
+         self.assertIsNotNone(bytearray.__doc__)
+         self.assertTrue(bytearray.__doc__.startswith("bytearray("), bytearray.__doc__)
+@@ -1269,16 +1294,16 @@
+     def test_lower(self):
+         pass
+ 
+-class ByteArrayAsStringTest(FixedStringTest):
++class ByteArrayAsStringTest(FixedStringTest, unittest.TestCase):
+     type2test = bytearray
+     contains_bytes = True
+ 
+-class BytesAsStringTest(FixedStringTest):
++class BytesAsStringTest(FixedStringTest, unittest.TestCase):
+     type2test = bytes
+     contains_bytes = True
+ 
+ 
+-class SubclassTest(unittest.TestCase):
++class SubclassTest:
+ 
+     def test_basic(self):
+         self.assertTrue(issubclass(self.subclass2test, self.type2test))
+@@ -1350,7 +1375,7 @@
+ class BytesSubclass(bytes):
+     pass
+ 
+-class ByteArraySubclassTest(SubclassTest):
++class ByteArraySubclassTest(SubclassTest, unittest.TestCase):
+     type2test = bytearray
+     subclass2test = ByteArraySubclass
+ 
+@@ -1365,16 +1390,10 @@
+         self.assertEqual(x, b"abcd")
+ 
+ 
+-class BytesSubclassTest(SubclassTest):
++class BytesSubclassTest(SubclassTest, unittest.TestCase):
+     type2test = bytes
+     subclass2test = BytesSubclass
+ 
+ 
+-def test_main():
+-    test.support.run_unittest(
+-        BytesTest, AssortedBytesTest, BytesAsStringTest,
+-        ByteArrayTest, ByteArrayAsStringTest, BytesSubclassTest,
+-        ByteArraySubclassTest, BytearrayPEP3137Test)
+-
+ if __name__ == "__main__":
+-    test_main()
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_bz2.py
+--- a/Lib/test/test_bz2.py
++++ b/Lib/test/test_bz2.py
+@@ -47,6 +47,7 @@
+         ]
+     TEXT = b''.join(TEXT_LINES)
+     DATA = b'BZh91AY&SY.\xc8N\x18\x00\x01>_\x80\x00\x10@\x02\xff\xf0\x01\x07n\x00?\xe7\xff\xe00\x01\x99\xaa\x00\xc0\x03F\x86\x8c#&\x83F\x9a\x03\x06\xa6\xd0\xa6\x93M\x0fQ\xa7\xa8\x06\x804hh\x12$\x11\xa4i4\xf14S\xd2<Q\xb5\x0fH\xd3\xd4\xdd\xd5\x87\xbb\xf8\x94\r\x8f\xafI\x12\xe1\xc9\xf8/E\x00pu\x89\x12]\xc9\xbbDL\nQ\x0e\t1\x12\xdf\xa0\xc0\x97\xac2O9\x89\x13\x94\x0e\x1c7\x0ed\x95I\x0c\xaaJ\xa4\x18L\x10\x05#\x9c\xaf\xba\xbc/\x97\x8a#C\xc8\xe1\x8cW\xf9\xe2\xd0\xd6M\xa7\x8bXa<e\x84t\xcbL\xb3\xa7\xd9\xcd\xd1\xcb\x84.\xaf\xb3\xab\xab\xad`n}\xa0lh\tE,\x8eZ\x15\x17VH>\x88\xe5\xcd9gd6\x0b\n\xe9\x9b\xd5\x8a\x99\xf7\x08.K\x8ev\xfb\xf7xw\xbb\xdf\xa1\x92\xf1\xdd|/";\xa2\xba\x9f\xd5\xb1#A\xb6\xf6\xb3o\xc9\xc5y\\\xebO\xe7\x85\x9a\xbc\xb6f8\x952\xd5\xd7"%\x89>V,\xf7\xa6z\xe2\x9f\xa3\xdf\x11\x11"\xd6E)I\xa9\x13^\xca\xf3r\xd0\x03U\x922\xf26\xec\xb6\xed\x8b\xc3U\x13\x9d\xc5\x170\xa4\xfa^\x92\xacDF\x8a\x97\xd6\x19\xfe\xdd\xb8\xbd\x1a\x9a\x19\xa3\x80ankR\x8b\xe5\xd83]\xa9\xc6\x08\x82f\xf6\xb9"6l$\xb8j@\xc0\x8a\xb0l1..\xbak\x83ls\x15\xbc\xf4\xc1\x13\xbe\xf8E\xb8\x9d\r\xa8\x9dk\x84\xd3n\xfa\xacQ\x07\xb1%y\xaav\xb4\x08\xe0z\x1b\x16\xf5\x04\xe9\xcc\xb9\x08z\x1en7.G\xfc]\xc9\x14\xe1B@\xbb!8`'
++    EMPTY_DATA = b'BZh9\x17rE8P\x90\x00\x00\x00\x00'
+ 
+     def setUp(self):
+         self.filename = TESTFN
+@@ -576,6 +577,20 @@
+                 bz2f.seek(-150, 1)
+                 self.assertEqual(bz2f.read(), self.TEXT[500-150:])
+ 
++    def test_read_truncated(self):
++        # Drop the eos_magic field (6 bytes) and CRC (4 bytes).
++        truncated = self.DATA[:-10]
++        with BZ2File(BytesIO(truncated)) as f:
++            self.assertRaises(EOFError, f.read)
++        with BZ2File(BytesIO(truncated)) as f:
++            self.assertEqual(f.read(len(self.TEXT)), self.TEXT)
++            self.assertRaises(EOFError, f.read, 1)
++        # Incomplete 4-byte file header, and block header of at least 146 bits.
++        for i in range(22):
++            with BZ2File(BytesIO(truncated[:i])) as f:
++                self.assertRaises(EOFError, f.read, 1)
++
++
+ class BZ2CompressorTest(BaseTest):
+     def testCompress(self):
+         bz2c = BZ2Compressor()
+@@ -584,6 +599,12 @@
+         data += bz2c.flush()
+         self.assertEqual(self.decompress(data), self.TEXT)
+ 
++    def testCompressEmptyString(self):
++        bz2c = BZ2Compressor()
++        data = bz2c.compress(b'')
++        data += bz2c.flush()
++        self.assertEqual(data, self.EMPTY_DATA)
++
+     def testCompressChunks10(self):
+         bz2c = BZ2Compressor()
+         n = 0
+@@ -647,6 +668,7 @@
+         bz2d = BZ2Decompressor()
+         text = bz2d.decompress(self.DATA)
+         self.assertRaises(EOFError, bz2d.decompress, b"anything")
++        self.assertRaises(EOFError, bz2d.decompress, b"")
+ 
+     @bigmemtest(size=_4G + 100, memuse=3)
+     def testDecompress4G(self, size):
+@@ -670,6 +692,10 @@
+         data = bz2.compress(self.TEXT)
+         self.assertEqual(self.decompress(data), self.TEXT)
+ 
++    def testCompressEmptyString(self):
++        text = bz2.compress(b'')
++        self.assertEqual(text, self.EMPTY_DATA)
++
+     def testDecompress(self):
+         text = bz2.decompress(self.DATA)
+         self.assertEqual(text, self.TEXT)
+@@ -678,6 +704,10 @@
+         text = bz2.decompress(b"")
+         self.assertEqual(text, b"")
+ 
++    def testDecompressToEmptyString(self):
++        text = bz2.decompress(self.EMPTY_DATA)
++        self.assertEqual(text, b'')
++
+     def testDecompressIncomplete(self):
+         self.assertRaises(ValueError, bz2.decompress, self.DATA[:-10])
+ 
+diff -r bd8afb90ebf2 Lib/test/test_calendar.py
+--- a/Lib/test/test_calendar.py
++++ b/Lib/test/test_calendar.py
+@@ -6,6 +6,7 @@
+ import time
+ import locale
+ import sys
++import datetime
+ 
+ result_2004_01_text = """
+     January 2004
+@@ -456,14 +457,29 @@
+         # (it is still not thread-safe though)
+         old_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
+         try:
+-            calendar.LocaleTextCalendar(locale='').formatmonthname(2010, 10, 10)
++            cal = calendar.LocaleTextCalendar(locale='')
++            local_weekday = cal.formatweekday(1, 10)
++            local_month = cal.formatmonthname(2010, 10, 10)
+         except locale.Error:
+             # cannot set the system default locale -- skip rest of test
+-            return
+-        calendar.LocaleHTMLCalendar(locale='').formatmonthname(2010, 10)
++            raise unittest.SkipTest('cannot set the system default locale')
++        self.assertIsInstance(local_weekday, str)
++        self.assertIsInstance(local_month, str)
++        self.assertEqual(len(local_weekday), 10)
++        self.assertGreaterEqual(len(local_month), 10)
++        cal = calendar.LocaleHTMLCalendar(locale='')
++        local_weekday = cal.formatweekday(1)
++        local_month = cal.formatmonthname(2010, 10)
++        self.assertIsInstance(local_weekday, str)
++        self.assertIsInstance(local_month, str)
+         new_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
+         self.assertEqual(old_october, new_october)
+ 
++    def test_itermonthdates(self):
++        # ensure itermonthdates doesn't overflow after datetime.MAXYEAR
++        # see #15421
++        list(calendar.Calendar().itermonthdates(datetime.MAXYEAR, 12))
++
+ 
+ class MonthCalendarTestCase(unittest.TestCase):
+     def setUp(self):
+diff -r bd8afb90ebf2 Lib/test/test_capi.py
+--- a/Lib/test/test_capi.py
++++ b/Lib/test/test_capi.py
+@@ -193,7 +193,6 @@
+         self.pendingcalls_wait(l, n)
+ 
+     def test_subinterps(self):
+-        # XXX this test leaks in refleak runs
+         import builtins
+         r, w = os.pipe()
+         code = """if 1:
+@@ -316,6 +315,17 @@
+                     c, i, when_skipped, when_not_skipped))
+             self.assertIs(when_skipped, when_not_skipped, message)
+ 
++    def test_parse_tuple_and_keywords(self):
++        # parse_tuple_and_keywords error handling tests
++        self.assertRaises(TypeError, _testcapi.parse_tuple_and_keywords,
++                          (), {}, 42, [])
++        self.assertRaises(ValueError, _testcapi.parse_tuple_and_keywords,
++                          (), {}, b'', 42)
++        self.assertRaises(ValueError, _testcapi.parse_tuple_and_keywords,
++                          (), {}, b'', [''] * 42)
++        self.assertRaises(ValueError, _testcapi.parse_tuple_and_keywords,
++                          (), {}, b'', [42])
++
+ def test_main():
+     support.run_unittest(CAPITest, TestPendingCalls,
+                          Test6012, EmbeddingTest, SkipitemTest)
+diff -r bd8afb90ebf2 Lib/test/test_cgi.py
+--- a/Lib/test/test_cgi.py
++++ b/Lib/test/test_cgi.py
+@@ -5,6 +5,7 @@
+ import tempfile
+ import unittest
+ import warnings
++from collections import namedtuple
+ from io import StringIO, BytesIO
+ 
+ class HackedSysModule:
+@@ -119,6 +120,23 @@
+ 
+ class CgiTests(unittest.TestCase):
+ 
++    def test_parse_multipart(self):
++        fp = BytesIO(POSTDATA.encode('latin1'))
++        env = {'boundary': BOUNDARY.encode('latin1'),
++               'CONTENT-LENGTH': '558'}
++        result = cgi.parse_multipart(fp, env)
++        expected = {'submit': [b' Add '], 'id': [b'1234'],
++                    'file': [b'Testing 123.\n'], 'title': [b'']}
++        self.assertEqual(result, expected)
++
++    def test_fieldstorage_properties(self):
++        fs = cgi.FieldStorage()
++        self.assertFalse(fs)
++        self.assertIn("FieldStorage", repr(fs))
++        self.assertEqual(list(fs), list(fs.keys()))
++        fs.list.append(namedtuple('MockFieldStorage', 'name')('fieldvalue'))
++        self.assertTrue(fs)
++
+     def test_escape(self):
+         # cgi.escape() is deprecated.
+         with warnings.catch_warnings():
+diff -r bd8afb90ebf2 Lib/test/test_cgitb.py
+--- a/Lib/test/test_cgitb.py
++++ b/Lib/test/test_cgitb.py
+@@ -1,7 +1,7 @@
+ from test.support import run_unittest
++from test.script_helper import assert_python_failure, temp_dir
+ import unittest
+ import sys
+-import subprocess
+ import cgitb
+ 
+ class TestCgitb(unittest.TestCase):
+@@ -36,16 +36,31 @@
+             self.assertIn("ValueError", text)
+             self.assertIn("Hello World", text)
+ 
+-    def test_hook(self):
+-        proc = subprocess.Popen([sys.executable, '-c',
+-                                 ('import cgitb;'
+-                                  'cgitb.enable();'
+-                                  'raise ValueError("Hello World")')],
+-                                stdout=subprocess.PIPE)
+-        out = proc.stdout.read().decode(sys.getfilesystemencoding())
+-        self.addCleanup(proc.stdout.close)
++    def test_syshook_no_logdir_default_format(self):
++        with temp_dir() as tracedir:
++            rc, out, err = assert_python_failure(
++                  '-c',
++                  ('import cgitb; cgitb.enable(logdir=%s); '
++                   'raise ValueError("Hello World")') % repr(tracedir))
++        out = out.decode(sys.getfilesystemencoding())
+         self.assertIn("ValueError", out)
+         self.assertIn("Hello World", out)
++        # By default we emit HTML markup.
++        self.assertIn('<p>', out)
++        self.assertIn('</p>', out)
++
++    def test_syshook_no_logdir_text_format(self):
++        # Issue 12890: we were emitting the <p> tag in text mode.
++        with temp_dir() as tracedir:
++            rc, out, err = assert_python_failure(
++                  '-c',
++                  ('import cgitb; cgitb.enable(format="text", logdir=%s); '
++                   'raise ValueError("Hello World")') % repr(tracedir))
++        out = out.decode(sys.getfilesystemencoding())
++        self.assertIn("ValueError", out)
++        self.assertIn("Hello World", out)
++        self.assertNotIn('<p>', out)
++        self.assertNotIn('</p>', out)
+ 
+ 
+ def test_main():
+diff -r bd8afb90ebf2 Lib/test/test_cmd_line.py
+--- a/Lib/test/test_cmd_line.py
++++ b/Lib/test/test_cmd_line.py
+@@ -7,7 +7,8 @@
+ import sys
+ import subprocess
+ import tempfile
+-from test.script_helper import spawn_python, kill_python, assert_python_ok, assert_python_failure
++from test.script_helper import (spawn_python, kill_python, assert_python_ok,
++    assert_python_failure)
+ 
+ 
+ # XXX (ncoghlan): Move to script_helper and make consistent with run_python
+@@ -93,15 +94,11 @@
+         # All good if execution is successful
+         assert_python_ok('-c', 'pass')
+ 
+-    @unittest.skipIf(sys.getfilesystemencoding() == 'ascii',
+-                     'need a filesystem encoding different than ASCII')
++    @unittest.skipUnless(test.support.FS_NONASCII, 'need support.FS_NONASCII')
+     def test_non_ascii(self):
+         # Test handling of non-ascii data
+-        if test.support.verbose:
+-            import locale
+-            print('locale encoding = %s, filesystem encoding = %s'
+-                  % (locale.getpreferredencoding(), sys.getfilesystemencoding()))
+-        command = "assert(ord('\xe9') == 0xe9)"
++        command = ("assert(ord(%r) == %s)"
++                   % (test.support.FS_NONASCII, ord(test.support.FS_NONASCII)))
+         assert_python_ok('-c', command)
+ 
+     # On Windows, pass bytes to subprocess doesn't test how Python decodes the
+@@ -358,6 +355,36 @@
+         self.assertEqual(rc, 0)
+         self.assertIn(b'random is 1', out)
+ 
++    def test_del___main__(self):
++        # Issue #15001: PyRun_SimpleFileExFlags() did crash because it kept a
++        # borrowed reference to the dict of __main__ module and later modify
++        # the dict whereas the module was destroyed
++        filename = test.support.TESTFN
++        self.addCleanup(test.support.unlink, filename)
++        with open(filename, "w") as script:
++            print("import sys", file=script)
++            print("del sys.modules['__main__']", file=script)
++        assert_python_ok(filename)
++
++    def test_unknown_options(self):
++        rc, out, err = assert_python_failure('-E', '-z')
++        self.assertIn(b'Unknown option: -z', err)
++        self.assertEqual(err.splitlines().count(b'Unknown option: -z'), 1)
++        self.assertEqual(b'', out)
++        # Add "without='-E'" to prevent _assert_python to append -E
++        # to env_vars and change the output of stderr
++        rc, out, err = assert_python_failure('-z', without='-E')
++        self.assertIn(b'Unknown option: -z', err)
++        self.assertEqual(err.splitlines().count(b'Unknown option: -z'), 1)
++        self.assertEqual(b'', out)
++        rc, out, err = assert_python_failure('-a', '-z', without='-E')
++        self.assertIn(b'Unknown option: -a', err)
++        # only the first unknown option is reported
++        self.assertNotIn(b'Unknown option: -z', err)
++        self.assertEqual(err.splitlines().count(b'Unknown option: -a'), 1)
++        self.assertEqual(b'', out)
++
++
+ def test_main():
+     test.support.run_unittest(CmdLineTest)
+     test.support.reap_children()
+diff -r bd8afb90ebf2 Lib/test/test_cmd_line_script.py
+--- a/Lib/test/test_cmd_line_script.py
++++ b/Lib/test/test_cmd_line_script.py
+@@ -363,6 +363,30 @@
+             self.assertTrue(text[1].startswith('  File '))
+             self.assertTrue(text[3].startswith('NameError'))
+ 
++    def test_non_ascii(self):
++        # Mac OS X denies the creation of a file with an invalid UTF-8 name.
++        # Windows allows to create a name with an arbitrary bytes name, but
++        # Python cannot a undecodable bytes argument to a subprocess.
++        if (support.TESTFN_UNDECODABLE
++        and sys.platform not in ('win32', 'darwin')):
++            name = os.fsdecode(support.TESTFN_UNDECODABLE)
++        elif support.TESTFN_NONASCII:
++            name = support.TESTFN_NONASCII
++        else:
++            self.skipTest("need support.TESTFN_NONASCII")
++
++        # Issue #16218
++        source = 'print(ascii(__file__))\n'
++        script_name = _make_test_script(os.curdir, name, source)
++        self.addCleanup(support.unlink, script_name)
++        rc, stdout, stderr = assert_python_ok(script_name)
++        self.assertEqual(
++            ascii(script_name),
++            stdout.rstrip().decode('ascii'),
++            'stdout=%r stderr=%r' % (stdout, stderr))
++        self.assertEqual(0, rc)
++
++
+ def test_main():
+     support.run_unittest(CmdLineTest)
+     support.reap_children()
+diff -r bd8afb90ebf2 Lib/test/test_codeccallbacks.py
+--- a/Lib/test/test_codeccallbacks.py
++++ b/Lib/test/test_codeccallbacks.py
+@@ -271,12 +271,12 @@
+ 
+         self.assertEqual(
+             b"\\u3042\u3xxx".decode("unicode-escape", "test.handler1"),
+-            "\u3042[<92><117><51><120>]xx"
++            "\u3042[<92><117><51>]xxx"
+         )
+ 
+         self.assertEqual(
+             b"\\u3042\u3xx".decode("unicode-escape", "test.handler1"),
+-            "\u3042[<92><117><51><120><120>]"
++            "\u3042[<92><117><51>]xx"
+         )
+ 
+         self.assertEqual(
+diff -r bd8afb90ebf2 Lib/test/test_codecs.py
+--- a/Lib/test/test_codecs.py
++++ b/Lib/test/test_codecs.py
+@@ -21,6 +21,11 @@
+ else:
+     SIZEOF_WCHAR_T = ctypes.sizeof(ctypes.c_wchar)
+ 
++def coding_checker(self, coder):
++    def check(input, expect):
++        self.assertEqual(coder(input), (expect, len(input)))
++    return check
++
+ class Queue(object):
+     """
+     queue: write bytes at one end, read bytes from the other end
+@@ -74,7 +79,7 @@
+             part2 = d.encode(u[i:], True)
+             self.assertEqual(s, part1+part2)
+ 
+-class ReadTest(unittest.TestCase, MixInCheckStateHandling):
++class ReadTest(MixInCheckStateHandling):
+     def check_partial(self, input, partialresults):
+         # get a StreamReader for the encoding and feed the bytestring version
+         # of input to the reader byte by byte. Read everything available from
+@@ -294,7 +299,7 @@
+         self.assertEqual(reader.readline(), s5)
+         self.assertEqual(reader.readline(), "")
+ 
+-class UTF32Test(ReadTest):
++class UTF32Test(ReadTest, unittest.TestCase):
+     encoding = "utf-32"
+ 
+     spamle = (b'\xff\xfe\x00\x00'
+@@ -330,7 +335,7 @@
+ 
+     def test_partial(self):
+         self.check_partial(
+-            "\x00\xff\u0100\uffff",
++            "\x00\xff\u0100\uffff\U00010000",
+             [
+                 "", # first byte of BOM read
+                 "", # second byte of BOM read
+@@ -352,6 +357,10 @@
+                 "\x00\xff\u0100",
+                 "\x00\xff\u0100",
+                 "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff\U00010000",
+             ]
+         )
+ 
+@@ -381,12 +390,12 @@
+         self.assertEqual('\U00010000' * 1024,
+                          codecs.utf_32_decode(encoded_be)[0])
+ 
+-class UTF32LETest(ReadTest):
++class UTF32LETest(ReadTest, unittest.TestCase):
+     encoding = "utf-32-le"
+ 
+     def test_partial(self):
+         self.check_partial(
+-            "\x00\xff\u0100\uffff",
++            "\x00\xff\u0100\uffff\U00010000",
+             [
+                 "",
+                 "",
+@@ -404,6 +413,10 @@
+                 "\x00\xff\u0100",
+                 "\x00\xff\u0100",
+                 "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff\U00010000",
+             ]
+         )
+ 
+@@ -421,12 +434,12 @@
+         self.assertEqual('\U00010000' * 1024,
+                          codecs.utf_32_le_decode(encoded)[0])
+ 
+-class UTF32BETest(ReadTest):
++class UTF32BETest(ReadTest, unittest.TestCase):
+     encoding = "utf-32-be"
+ 
+     def test_partial(self):
+         self.check_partial(
+-            "\x00\xff\u0100\uffff",
++            "\x00\xff\u0100\uffff\U00010000",
+             [
+                 "",
+                 "",
+@@ -444,6 +457,10 @@
+                 "\x00\xff\u0100",
+                 "\x00\xff\u0100",
+                 "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff\U00010000",
+             ]
+         )
+ 
+@@ -462,7 +479,7 @@
+                          codecs.utf_32_be_decode(encoded)[0])
+ 
+ 
+-class UTF16Test(ReadTest):
++class UTF16Test(ReadTest, unittest.TestCase):
+     encoding = "utf-16"
+ 
+     spamle = b'\xff\xfes\x00p\x00a\x00m\x00s\x00p\x00a\x00m\x00'
+@@ -494,7 +511,7 @@
+ 
+     def test_partial(self):
+         self.check_partial(
+-            "\x00\xff\u0100\uffff",
++            "\x00\xff\u0100\uffff\U00010000",
+             [
+                 "", # first byte of BOM read
+                 "", # second byte of BOM read => byteorder known
+@@ -506,6 +523,10 @@
+                 "\x00\xff\u0100",
+                 "\x00\xff\u0100",
+                 "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff\U00010000",
+             ]
+         )
+ 
+@@ -538,12 +559,12 @@
+         with codecs.open(support.TESTFN, 'U', encoding=self.encoding) as reader:
+             self.assertEqual(reader.read(), s1)
+ 
+-class UTF16LETest(ReadTest):
++class UTF16LETest(ReadTest, unittest.TestCase):
+     encoding = "utf-16-le"
+ 
+     def test_partial(self):
+         self.check_partial(
+-            "\x00\xff\u0100\uffff",
++            "\x00\xff\u0100\uffff\U00010000",
+             [
+                 "",
+                 "\x00",
+@@ -553,6 +574,10 @@
+                 "\x00\xff\u0100",
+                 "\x00\xff\u0100",
+                 "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff\U00010000",
+             ]
+         )
+ 
+@@ -577,12 +602,12 @@
+         self.assertEqual(b'\x00\xd8\x03\xde'.decode(self.encoding),
+                          "\U00010203")
+ 
+-class UTF16BETest(ReadTest):
++class UTF16BETest(ReadTest, unittest.TestCase):
+     encoding = "utf-16-be"
+ 
+     def test_partial(self):
+         self.check_partial(
+-            "\x00\xff\u0100\uffff",
++            "\x00\xff\u0100\uffff\U00010000",
+             [
+                 "",
+                 "\x00",
+@@ -592,6 +617,10 @@
+                 "\x00\xff\u0100",
+                 "\x00\xff\u0100",
+                 "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff",
++                "\x00\xff\u0100\uffff\U00010000",
+             ]
+         )
+ 
+@@ -616,12 +645,12 @@
+         self.assertEqual(b'\xd8\x00\xde\x03'.decode(self.encoding),
+                          "\U00010203")
+ 
+-class UTF8Test(ReadTest):
++class UTF8Test(ReadTest, unittest.TestCase):
+     encoding = "utf-8"
+ 
+     def test_partial(self):
+         self.check_partial(
+-            "\x00\xff\u07ff\u0800\uffff",
++            "\x00\xff\u07ff\u0800\uffff\U00010000",
+             [
+                 "\x00",
+                 "\x00",
+@@ -634,6 +663,10 @@
+                 "\x00\xff\u07ff\u0800",
+                 "\x00\xff\u07ff\u0800",
+                 "\x00\xff\u07ff\u0800\uffff",
++                "\x00\xff\u07ff\u0800\uffff",
++                "\x00\xff\u07ff\u0800\uffff",
++                "\x00\xff\u07ff\u0800\uffff",
++                "\x00\xff\u07ff\u0800\uffff\U00010000",
+             ]
+         )
+ 
+@@ -666,10 +699,14 @@
+         self.assertEqual(b"\xf0\x90\xbf\xbf\xed\xa0\x80".decode("utf-8", "surrogatepass"),
+                          "\U00010fff\uD800")
+         self.assertTrue(codecs.lookup_error("surrogatepass"))
++        with self.assertRaises(UnicodeDecodeError):
++            b"abc\xed\xa0".decode("utf-8", "surrogatepass")
++        with self.assertRaises(UnicodeDecodeError):
++            b"abc\xed\xa0z".decode("utf-8", "surrogatepass")
+ 
+ @unittest.skipUnless(sys.platform == 'win32',
+                      'cp65001 is a Windows-only codec')
+-class CP65001Test(ReadTest):
++class CP65001Test(ReadTest, unittest.TestCase):
+     encoding = "cp65001"
+ 
+     def test_encode(self):
+@@ -768,7 +805,7 @@
+ 
+ 
+ 
+-class UTF7Test(ReadTest):
++class UTF7Test(ReadTest, unittest.TestCase):
+     encoding = "utf-7"
+ 
+     def test_partial(self):
+@@ -807,12 +844,12 @@
+         self.assertRaises(TypeError, codecs.readbuffer_encode)
+         self.assertRaises(TypeError, codecs.readbuffer_encode, 42)
+ 
+-class UTF8SigTest(ReadTest):
++class UTF8SigTest(ReadTest, unittest.TestCase):
+     encoding = "utf-8-sig"
+ 
+     def test_partial(self):
+         self.check_partial(
+-            "\ufeff\x00\xff\u07ff\u0800\uffff",
++            "\ufeff\x00\xff\u07ff\u0800\uffff\U00010000",
+             [
+                 "",
+                 "",
+@@ -831,6 +868,10 @@
+                 "\ufeff\x00\xff\u07ff\u0800",
+                 "\ufeff\x00\xff\u07ff\u0800",
+                 "\ufeff\x00\xff\u07ff\u0800\uffff",
++                "\ufeff\x00\xff\u07ff\u0800\uffff",
++                "\ufeff\x00\xff\u07ff\u0800\uffff",
++                "\ufeff\x00\xff\u07ff\u0800\uffff",
++                "\ufeff\x00\xff\u07ff\u0800\uffff\U00010000",
+             ]
+         )
+ 
+@@ -889,7 +930,55 @@
+ 
+ class EscapeDecodeTest(unittest.TestCase):
+     def test_empty(self):
+-        self.assertEqual(codecs.escape_decode(""), ("", 0))
++        self.assertEqual(codecs.escape_decode(b""), (b"", 0))
++
++    def test_raw(self):
++        decode = codecs.escape_decode
++        for b in range(256):
++            b = bytes([b])
++            if b != b'\\':
++                self.assertEqual(decode(b + b'0'), (b + b'0', 2))
++
++    def test_escape(self):
++        decode = codecs.escape_decode
++        check = coding_checker(self, decode)
++        check(b"[\\\n]", b"[]")
++        check(br'[\"]', b'["]')
++        check(br"[\']", b"[']")
++        check(br"[\\]", br"[\]")
++        check(br"[\a]", b"[\x07]")
++        check(br"[\b]", b"[\x08]")
++        check(br"[\t]", b"[\x09]")
++        check(br"[\n]", b"[\x0a]")
++        check(br"[\v]", b"[\x0b]")
++        check(br"[\f]", b"[\x0c]")
++        check(br"[\r]", b"[\x0d]")
++        check(br"[\7]", b"[\x07]")
++        check(br"[\8]", br"[\8]")
++        check(br"[\78]", b"[\x078]")
++        check(br"[\41]", b"[!]")
++        check(br"[\418]", b"[!8]")
++        check(br"[\101]", b"[A]")
++        check(br"[\1010]", b"[A0]")
++        check(br"[\501]", b"[A]")
++        check(br"[\x41]", b"[A]")
++        check(br"[\X41]", br"[\X41]")
++        check(br"[\x410]", b"[A0]")
++        for b in range(256):
++            if b not in b'\n"\'\\abtnvfr01234567x':
++                b = bytes([b])
++                check(b'\\' + b, b'\\' + b)
++
++    def test_errors(self):
++        decode = codecs.escape_decode
++        self.assertRaises(ValueError, decode, br"\x")
++        self.assertRaises(ValueError, decode, br"[\x]")
++        self.assertEqual(decode(br"[\x]\x", "ignore"), (b"[]", 6))
++        self.assertEqual(decode(br"[\x]\x", "replace"), (b"[?]?", 6))
++        self.assertRaises(ValueError, decode, br"\x0")
++        self.assertRaises(ValueError, decode, br"[\x0]")
++        self.assertEqual(decode(br"[\x0]\x0", "ignore"), (b"[]", 8))
++        self.assertEqual(decode(br"[\x0]\x0", "replace"), (b"[?]?", 8))
+ 
+ class RecodingTest(unittest.TestCase):
+     def test_recoding(self):
+@@ -1693,6 +1782,19 @@
+         )
+ 
+         self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "strict", "\U0010FFFFbc"),
++            ("\U0010FFFFbc", 3)
++        )
++
++        self.assertRaises(UnicodeDecodeError,
++            codecs.charmap_decode, b"\x00\x01\x02", "strict", "ab"
++        )
++
++        self.assertRaises(UnicodeDecodeError,
++            codecs.charmap_decode, b"\x00\x01\x02", "strict", "ab\ufffe"
++        )
++
++        self.assertEqual(
+             codecs.charmap_decode(b"\x00\x01\x02", "replace", "ab"),
+             ("ab\ufffd", 3)
+         )
+@@ -1718,6 +1820,155 @@
+             ("", len(allbytes))
+         )
+ 
++    def test_decode_with_int2str_map(self):
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "strict",
++                                  {0: 'a', 1: 'b', 2: 'c'}),
++            ("abc", 3)
++        )
++
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "strict",
++                                  {0: 'Aa', 1: 'Bb', 2: 'Cc'}),
++            ("AaBbCc", 3)
++        )
++
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "strict",
++                                  {0: '\U0010FFFF', 1: 'b', 2: 'c'}),
++            ("\U0010FFFFbc", 3)
++        )
++
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "strict",
++                                  {0: 'a', 1: 'b', 2: ''}),
++            ("ab", 3)
++        )
++
++        self.assertRaises(UnicodeDecodeError,
++            codecs.charmap_decode, b"\x00\x01\x02", "strict",
++                                   {0: 'a', 1: 'b'}
++        )
++
++        self.assertRaises(UnicodeDecodeError,
++            codecs.charmap_decode, b"\x00\x01\x02", "strict",
++                                   {0: 'a', 1: 'b', 2: None}
++        )
++
++        # Issue #14850
++        self.assertRaises(UnicodeDecodeError,
++            codecs.charmap_decode, b"\x00\x01\x02", "strict",
++                                   {0: 'a', 1: 'b', 2: '\ufffe'}
++        )
++
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "replace",
++                                  {0: 'a', 1: 'b'}),
++            ("ab\ufffd", 3)
++        )
++
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "replace",
++                                  {0: 'a', 1: 'b', 2: None}),
++            ("ab\ufffd", 3)
++        )
++
++        # Issue #14850
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "replace",
++                                  {0: 'a', 1: 'b', 2: '\ufffe'}),
++            ("ab\ufffd", 3)
++        )
++
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "ignore",
++                                  {0: 'a', 1: 'b'}),
++            ("ab", 3)
++        )
++
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "ignore",
++                                  {0: 'a', 1: 'b', 2: None}),
++            ("ab", 3)
++        )
++
++        # Issue #14850
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "ignore",
++                                  {0: 'a', 1: 'b', 2: '\ufffe'}),
++            ("ab", 3)
++        )
++
++        allbytes = bytes(range(256))
++        self.assertEqual(
++            codecs.charmap_decode(allbytes, "ignore", {}),
++            ("", len(allbytes))
++        )
++
++    def test_decode_with_int2int_map(self):
++        a = ord('a')
++        b = ord('b')
++        c = ord('c')
++
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "strict",
++                                  {0: a, 1: b, 2: c}),
++            ("abc", 3)
++        )
++
++        # Issue #15379
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "strict",
++                                  {0: 0x10FFFF, 1: b, 2: c}),
++            ("\U0010FFFFbc", 3)
++        )
++
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "strict",
++                                  {0: sys.maxunicode, 1: b, 2: c}),
++            (chr(sys.maxunicode) + "bc", 3)
++        )
++
++        self.assertRaises(TypeError,
++            codecs.charmap_decode, b"\x00\x01\x02", "strict",
++                                   {0: sys.maxunicode + 1, 1: b, 2: c}
++        )
++
++        self.assertRaises(UnicodeDecodeError,
++            codecs.charmap_decode, b"\x00\x01\x02", "strict",
++                                   {0: a, 1: b},
++        )
++
++        self.assertRaises(UnicodeDecodeError,
++            codecs.charmap_decode, b"\x00\x01\x02", "strict",
++                                   {0: a, 1: b, 2: 0xFFFE},
++        )
++
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "replace",
++                                  {0: a, 1: b}),
++            ("ab\ufffd", 3)
++        )
++
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "replace",
++                                  {0: a, 1: b, 2: 0xFFFE}),
++            ("ab\ufffd", 3)
++        )
++
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "ignore",
++                                  {0: a, 1: b}),
++            ("ab", 3)
++        )
++
++        self.assertEqual(
++            codecs.charmap_decode(b"\x00\x01\x02", "ignore",
++                                  {0: a, 1: b, 2: 0xFFFE}),
++            ("ab", 3)
++        )
++
++
+ class WithStmtTest(unittest.TestCase):
+     def test_encodedfile(self):
+         f = io.BytesIO(b"\xc3\xbc")
+@@ -1767,6 +2018,135 @@
+         self.assertRaises(UnicodeDecodeError, codecs.raw_unicode_escape_decode, br"\U00110000")
+         self.assertEqual(codecs.raw_unicode_escape_decode(r"\U00110000", "replace"), ("\ufffd", 10))
+ 
++
++class UnicodeEscapeTest(unittest.TestCase):
++    def test_empty(self):
++        self.assertEqual(codecs.unicode_escape_encode(""), (b"", 0))
++        self.assertEqual(codecs.unicode_escape_decode(b""), ("", 0))
++
++    def test_raw_encode(self):
++        encode = codecs.unicode_escape_encode
++        for b in range(32, 127):
++            if b != b'\\'[0]:
++                self.assertEqual(encode(chr(b)), (bytes([b]), 1))
++
++    def test_raw_decode(self):
++        decode = codecs.unicode_escape_decode
++        for b in range(256):
++            if b != b'\\'[0]:
++                self.assertEqual(decode(bytes([b]) + b'0'), (chr(b) + '0', 2))
++
++    def test_escape_encode(self):
++        encode = codecs.unicode_escape_encode
++        check = coding_checker(self, encode)
++        check('\t', br'\t')
++        check('\n', br'\n')
++        check('\r', br'\r')
++        check('\\', br'\\')
++        for b in range(32):
++            if chr(b) not in '\t\n\r':
++                check(chr(b), ('\\x%02x' % b).encode())
++        for b in range(127, 256):
++            check(chr(b), ('\\x%02x' % b).encode())
++        check('\u20ac', br'\u20ac')
++        check('\U0001d120', br'\U0001d120')
++
++    def test_escape_decode(self):
++        decode = codecs.unicode_escape_decode
++        check = coding_checker(self, decode)
++        check(b"[\\\n]", "[]")
++        check(br'[\"]', '["]')
++        check(br"[\']", "[']")
++        check(br"[\\]", r"[\]")
++        check(br"[\a]", "[\x07]")
++        check(br"[\b]", "[\x08]")
++        check(br"[\t]", "[\x09]")
++        check(br"[\n]", "[\x0a]")
++        check(br"[\v]", "[\x0b]")
++        check(br"[\f]", "[\x0c]")
++        check(br"[\r]", "[\x0d]")
++        check(br"[\7]", "[\x07]")
++        check(br"[\8]", r"[\8]")
++        check(br"[\78]", "[\x078]")
++        check(br"[\41]", "[!]")
++        check(br"[\418]", "[!8]")
++        check(br"[\101]", "[A]")
++        check(br"[\1010]", "[A0]")
++        check(br"[\x41]", "[A]")
++        check(br"[\x410]", "[A0]")
++        check(br"\u20ac", "\u20ac")
++        check(br"\U0001d120", "\U0001d120")
++        for b in range(256):
++            if b not in b'\n"\'\\abtnvfr01234567xuUN':
++                check(b'\\' + bytes([b]), '\\' + chr(b))
++
++    def test_decode_errors(self):
++        decode = codecs.unicode_escape_decode
++        for c, d in (b'x', 2), (b'u', 4), (b'U', 4):
++            for i in range(d):
++                self.assertRaises(UnicodeDecodeError, decode,
++                                  b"\\" + c + b"0"*i)
++                self.assertRaises(UnicodeDecodeError, decode,
++                                  b"[\\" + c + b"0"*i + b"]")
++                data = b"[\\" + c + b"0"*i + b"]\\" + c + b"0"*i
++                self.assertEqual(decode(data, "ignore"), ("[]", len(data)))
++                self.assertEqual(decode(data, "replace"),
++                                 ("[\ufffd]\ufffd", len(data)))
++        self.assertRaises(UnicodeDecodeError, decode, br"\U00110000")
++        self.assertEqual(decode(br"\U00110000", "ignore"), ("", 10))
++        self.assertEqual(decode(br"\U00110000", "replace"), ("\ufffd", 10))
++
++
++class RawUnicodeEscapeTest(unittest.TestCase):
++    def test_empty(self):
++        self.assertEqual(codecs.raw_unicode_escape_encode(""), (b"", 0))
++        self.assertEqual(codecs.raw_unicode_escape_decode(b""), ("", 0))
++
++    def test_raw_encode(self):
++        encode = codecs.raw_unicode_escape_encode
++        for b in range(256):
++            self.assertEqual(encode(chr(b)), (bytes([b]), 1))
++
++    def test_raw_decode(self):
++        decode = codecs.raw_unicode_escape_decode
++        for b in range(256):
++            self.assertEqual(decode(bytes([b]) + b'0'), (chr(b) + '0', 2))
++
++    def test_escape_encode(self):
++        encode = codecs.raw_unicode_escape_encode
++        check = coding_checker(self, encode)
++        for b in range(256):
++            if b not in b'uU':
++                check('\\' + chr(b), b'\\' + bytes([b]))
++        check('\u20ac', br'\u20ac')
++        check('\U0001d120', br'\U0001d120')
++
++    def test_escape_decode(self):
++        decode = codecs.raw_unicode_escape_decode
++        check = coding_checker(self, decode)
++        for b in range(256):
++            if b not in b'uU':
++                check(b'\\' + bytes([b]), '\\' + chr(b))
++        check(br"\u20ac", "\u20ac")
++        check(br"\U0001d120", "\U0001d120")
++
++    def test_decode_errors(self):
++        decode = codecs.raw_unicode_escape_decode
++        for c, d in (b'u', 4), (b'U', 4):
++            for i in range(d):
++                self.assertRaises(UnicodeDecodeError, decode,
++                                  b"\\" + c + b"0"*i)
++                self.assertRaises(UnicodeDecodeError, decode,
++                                  b"[\\" + c + b"0"*i + b"]")
++                data = b"[\\" + c + b"0"*i + b"]\\" + c + b"0"*i
++                self.assertEqual(decode(data, "ignore"), ("[]", len(data)))
++                self.assertEqual(decode(data, "replace"),
++                                 ("[\ufffd]\ufffd", len(data)))
++        self.assertRaises(UnicodeDecodeError, decode, br"\U00110000")
++        self.assertEqual(decode(br"\U00110000", "ignore"), ("", 10))
++        self.assertEqual(decode(br"\U00110000", "replace"), ("\ufffd", 10))
++
++
+ class SurrogateEscapeTest(unittest.TestCase):
+ 
+     def test_utf8(self):
+@@ -2055,38 +2435,5 @@
+         self.assertEqual(decoded, ('abc', 3))
+ 
+ 
+-def test_main():
+-    support.run_unittest(
+-        UTF32Test,
+-        UTF32LETest,
+-        UTF32BETest,
+-        UTF16Test,
+-        UTF16LETest,
+-        UTF16BETest,
+-        UTF8Test,
+-        UTF8SigTest,
+-        CP65001Test,
+-        UTF7Test,
+-        UTF16ExTest,
+-        ReadBufferTest,
+-        RecodingTest,
+-        PunycodeTest,
+-        UnicodeInternalTest,
+-        NameprepTest,
+-        IDNACodecTest,
+-        CodecsModuleTest,
+-        StreamReaderTest,
+-        EncodedFileTest,
+-        BasicUnicodeTest,
+-        CharmapTest,
+-        WithStmtTest,
+-        TypesTest,
+-        SurrogateEscapeTest,
+-        BomTest,
+-        TransformCodecTest,
+-        CodePageTest,
+-    )
+-
+-
+ if __name__ == "__main__":
+-    test_main()
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_codeop.py
+--- a/Lib/test/test_codeop.py
++++ b/Lib/test/test_codeop.py
+@@ -50,7 +50,7 @@
+         '''succeed iff str is the start of an invalid piece of code'''
+         try:
+             compile_command(str,symbol=symbol)
+-            self.fail("No exception thrown for invalid code")
++            self.fail("No exception raised for invalid code")
+         except SyntaxError:
+             self.assertTrue(is_syntax)
+         except OverflowError:
+diff -r bd8afb90ebf2 Lib/test/test_collections.py
+--- a/Lib/test/test_collections.py
++++ b/Lib/test/test_collections.py
+@@ -663,6 +663,39 @@
+         s |= s
+         self.assertEqual(s, full)
+ 
++    def test_issue16373(self):
++        # Recursion error comparing comparable and noncomparable
++        # Set instances
++        class MyComparableSet(Set):
++            def __contains__(self, x):
++                return False
++            def __len__(self):
++                return 0
++            def __iter__(self):
++                return iter([])
++        class MyNonComparableSet(Set):
++            def __contains__(self, x):
++                return False
++            def __len__(self):
++                return 0
++            def __iter__(self):
++                return iter([])
++            def __le__(self, x):
++                return NotImplemented
++            def __lt__(self, x):
++                return NotImplemented
++
++        cs = MyComparableSet()
++        ncs = MyNonComparableSet()
++        with self.assertRaises(TypeError):
++            ncs < cs
++        with self.assertRaises(TypeError):
++            ncs <= cs
++        with self.assertRaises(TypeError):
++            cs > ncs
++        with self.assertRaises(TypeError):
++            cs >= ncs
++
+     def test_Mapping(self):
+         for sample in [dict]:
+             self.assertIsInstance(sample(), Mapping)
+diff -r bd8afb90ebf2 Lib/test/test_compile.py
+--- a/Lib/test/test_compile.py
++++ b/Lib/test/test_compile.py
+@@ -474,6 +474,33 @@
+         self.assertInvalidSingle('f()\nxy # blah\nblah()')
+         self.assertInvalidSingle('x = 5 # comment\nx = 6\n')
+ 
++    @support.cpython_only
++    def test_compiler_recursion_limit(self):
++        # Expected limit is sys.getrecursionlimit() * the scaling factor
++        # in symtable.c (currently 3)
++        # We expect to fail *at* that limit, because we use up some of
++        # the stack depth limit in the test suite code
++        # So we check the expected limit and 75% of that
++        # XXX (ncoghlan): duplicating the scaling factor here is a little
++        # ugly. Perhaps it should be exposed somewhere...
++        fail_depth = sys.getrecursionlimit() * 3
++        success_depth = int(fail_depth * 0.75)
++
++        def check_limit(prefix, repeated):
++            expect_ok = prefix + repeated * success_depth
++            self.compile_single(expect_ok)
++            broken = prefix + repeated * fail_depth
++            details = "Compiling ({!r} + {!r} * {})".format(
++                         prefix, repeated, fail_depth)
++            with self.assertRaises(RuntimeError, msg=details):
++                self.compile_single(broken)
++
++        check_limit("a", "()")
++        check_limit("a", ".b")
++        check_limit("a", "[0]")
++        check_limit("a", "*a")
++
++
+ def test_main():
+     support.run_unittest(TestSpecifics)
+ 
+diff -r bd8afb90ebf2 Lib/test/test_compileall.py
+--- a/Lib/test/test_compileall.py
++++ b/Lib/test/test_compileall.py
+@@ -134,15 +134,21 @@
+ class CommandLineTests(unittest.TestCase):
+     """Test compileall's CLI."""
+ 
++    def _get_run_args(self, args):
++        interp_args = ['-S']
++        if sys.flags.optimize:
++            interp_args.append({1 : '-O', 2 : '-OO'}[sys.flags.optimize])
++        return interp_args + ['-m', 'compileall'] + list(args)
++
+     def assertRunOK(self, *args, **env_vars):
+         rc, out, err = script_helper.assert_python_ok(
+-                        '-S', '-m', 'compileall', *args, **env_vars)
++                         *self._get_run_args(args), **env_vars)
+         self.assertEqual(b'', err)
+         return out
+ 
+     def assertRunNotOK(self, *args, **env_vars):
+         rc, out, err = script_helper.assert_python_failure(
+-                        '-S', '-m', 'compileall', *args, **env_vars)
++                        *self._get_run_args(args), **env_vars)
+         return rc, out, err
+ 
+     def assertCompiled(self, fn):
+@@ -198,7 +204,9 @@
+         self.assertRunOK('-b', '-q', self.pkgdir)
+         # Verify the __pycache__ directory contents.
+         self.assertFalse(os.path.exists(self.pkgdir_cachedir))
+-        expected = sorted(['__init__.py', '__init__.pyc', 'bar.py', 'bar.pyc'])
++        opt = 'c' if __debug__ else 'o'
++        expected = sorted(['__init__.py', '__init__.py' + opt, 'bar.py',
++                           'bar.py' + opt])
+         self.assertEqual(sorted(os.listdir(self.pkgdir)), expected)
+ 
+     def test_multiple_runs(self):
+@@ -326,7 +334,7 @@
+         f2 = script_helper.make_script(self.pkgdir, 'f2', '')
+         f3 = script_helper.make_script(self.pkgdir, 'f3', '')
+         f4 = script_helper.make_script(self.pkgdir, 'f4', '')
+-        p = script_helper.spawn_python('-m', 'compileall', '-i', '-')
++        p = script_helper.spawn_python(*(self._get_run_args(()) + ['-i', '-']))
+         p.stdin.write((f3+os.linesep).encode('ascii'))
+         script_helper.kill_python(p)
+         self.assertNotCompiled(f1)
+diff -r bd8afb90ebf2 Lib/test/test_configparser.py
+--- a/Lib/test/test_configparser.py
++++ b/Lib/test/test_configparser.py
+@@ -32,7 +32,7 @@
+     __iter__ = iterkeys
+ 
+ 
+-class CfgParserTestCaseClass(unittest.TestCase):
++class CfgParserTestCaseClass:
+     allow_no_value = False
+     delimiters = ('=', ':')
+     comment_prefixes = (';', '#')
+@@ -770,13 +770,72 @@
+         with self.assertRaises(configparser.NoSectionError):
+             cf.items("no such section")
+ 
++    def test_popitem(self):
++        cf = self.fromstring("""
++            [section1]
++            name1 {0[0]} value1
++            [section2]
++            name2 {0[0]} value2
++            [section3]
++            name3 {0[0]} value3
++        """.format(self.delimiters), defaults={"default": "<default>"})
++        self.assertEqual(cf.popitem()[0], 'section1')
++        self.assertEqual(cf.popitem()[0], 'section2')
++        self.assertEqual(cf.popitem()[0], 'section3')
++        with self.assertRaises(KeyError):
++            cf.popitem()
+ 
+-class StrictTestCase(BasicTestCase):
++    def test_clear(self):
++        cf = self.newconfig({"foo": "Bar"})
++        self.assertEqual(
++            cf.get(self.default_section, "Foo"), "Bar",
++            "could not locate option, expecting case-insensitive option names")
++        cf['zing'] = {'option1': 'value1', 'option2': 'value2'}
++        self.assertEqual(cf.sections(), ['zing'])
++        self.assertEqual(set(cf['zing'].keys()), {'option1', 'option2', 'foo'})
++        cf.clear()
++        self.assertEqual(set(cf.sections()), set())
++        self.assertEqual(set(cf[self.default_section].keys()), {'foo'})
++
++    def test_setitem(self):
++        cf = self.fromstring("""
++            [section1]
++            name1 {0[0]} value1
++            [section2]
++            name2 {0[0]} value2
++            [section3]
++            name3 {0[0]} value3
++        """.format(self.delimiters), defaults={"nameD": "valueD"})
++        self.assertEqual(set(cf['section1'].keys()), {'name1', 'named'})
++        self.assertEqual(set(cf['section2'].keys()), {'name2', 'named'})
++        self.assertEqual(set(cf['section3'].keys()), {'name3', 'named'})
++        self.assertEqual(cf['section1']['name1'], 'value1')
++        self.assertEqual(cf['section2']['name2'], 'value2')
++        self.assertEqual(cf['section3']['name3'], 'value3')
++        self.assertEqual(cf.sections(), ['section1', 'section2', 'section3'])
++        cf['section2'] = {'name22': 'value22'}
++        self.assertEqual(set(cf['section2'].keys()), {'name22', 'named'})
++        self.assertEqual(cf['section2']['name22'], 'value22')
++        self.assertNotIn('name2', cf['section2'])
++        self.assertEqual(cf.sections(), ['section1', 'section2', 'section3'])
++        cf['section3'] = {}
++        self.assertEqual(set(cf['section3'].keys()), {'named'})
++        self.assertNotIn('name3', cf['section3'])
++        self.assertEqual(cf.sections(), ['section1', 'section2', 'section3'])
++        cf[self.default_section] = {}
++        self.assertEqual(set(cf[self.default_section].keys()), set())
++        self.assertEqual(set(cf['section1'].keys()), {'name1'})
++        self.assertEqual(set(cf['section2'].keys()), {'name22'})
++        self.assertEqual(set(cf['section3'].keys()), set())
++        self.assertEqual(cf.sections(), ['section1', 'section2', 'section3'])
++
++
++class StrictTestCase(BasicTestCase, unittest.TestCase):
+     config_class = configparser.RawConfigParser
+     strict = True
+ 
+ 
+-class ConfigParserTestCase(BasicTestCase):
++class ConfigParserTestCase(BasicTestCase, unittest.TestCase):
+     config_class = configparser.ConfigParser
+ 
+     def test_interpolation(self):
+@@ -865,7 +924,7 @@
+         self.assertRaises(ValueError, cf.add_section, self.default_section)
+ 
+ 
+-class ConfigParserTestCaseNoInterpolation(BasicTestCase):
++class ConfigParserTestCaseNoInterpolation(BasicTestCase, unittest.TestCase):
+     config_class = configparser.ConfigParser
+     interpolation = None
+     ini = textwrap.dedent("""
+@@ -930,7 +989,7 @@
+ class ConfigParserTestCaseNonStandardDefaultSection(ConfigParserTestCase):
+     default_section = 'general'
+ 
+-class MultilineValuesTestCase(BasicTestCase):
++class MultilineValuesTestCase(BasicTestCase, unittest.TestCase):
+     config_class = configparser.ConfigParser
+     wonderful_spam = ("I'm having spam spam spam spam "
+                       "spam spam spam beaked beans spam "
+@@ -958,7 +1017,7 @@
+         self.assertEqual(cf_from_file.get('section8', 'lovely_spam4'),
+                          self.wonderful_spam.replace('\t\n', '\n'))
+ 
+-class RawConfigParserTestCase(BasicTestCase):
++class RawConfigParserTestCase(BasicTestCase, unittest.TestCase):
+     config_class = configparser.RawConfigParser
+ 
+     def test_interpolation(self):
+@@ -1005,7 +1064,7 @@
+     comment_prefixes = ('//', '"')
+     inline_comment_prefixes = ('//', '"')
+ 
+-class RawConfigParserTestSambaConf(CfgParserTestCaseClass):
++class RawConfigParserTestSambaConf(CfgParserTestCaseClass, unittest.TestCase):
+     config_class = configparser.RawConfigParser
+     comment_prefixes = ('#', ';', '----')
+     inline_comment_prefixes = ('//',)
+@@ -1025,7 +1084,7 @@
+         self.assertEqual(cf.get("global", "hosts allow"), "127.")
+         self.assertEqual(cf.get("tmp", "echo command"), "cat %s; rm %s")
+ 
+-class ConfigParserTestCaseExtendedInterpolation(BasicTestCase):
++class ConfigParserTestCaseExtendedInterpolation(BasicTestCase, unittest.TestCase):
+     config_class = configparser.ConfigParser
+     interpolation = configparser.ExtendedInterpolation()
+     default_section = 'common'
+@@ -1199,7 +1258,7 @@
+ class ConfigParserTestCaseNoValue(ConfigParserTestCase):
+     allow_no_value = True
+ 
+-class ConfigParserTestCaseTrickyFile(CfgParserTestCaseClass):
++class ConfigParserTestCaseTrickyFile(CfgParserTestCaseClass, unittest.TestCase):
+     config_class = configparser.ConfigParser
+     delimiters = {'='}
+     comment_prefixes = {'#'}
+@@ -1296,7 +1355,7 @@
+                          "o4 = 1\n\n")
+ 
+ 
+-class CompatibleTestCase(CfgParserTestCaseClass):
++class CompatibleTestCase(CfgParserTestCaseClass, unittest.TestCase):
+     config_class = configparser.RawConfigParser
+     comment_prefixes = '#;'
+     inline_comment_prefixes = ';'
+@@ -1318,7 +1377,7 @@
+         self.assertEqual(cf.get('Commented Bar', 'quirk'),
+                          'this;is not a comment')
+ 
+-class CopyTestCase(BasicTestCase):
++class CopyTestCase(BasicTestCase, unittest.TestCase):
+     config_class = configparser.ConfigParser
+ 
+     def fromstring(self, string, defaults=None):
+@@ -1654,27 +1713,5 @@
+         self.assertEqual(s['k3'], 'v3;#//still v3# and still v3')
+ 
+ 
+-def test_main():
+-    support.run_unittest(
+-        ConfigParserTestCase,
+-        ConfigParserTestCaseNonStandardDelimiters,
+-        ConfigParserTestCaseNoValue,
+-        ConfigParserTestCaseExtendedInterpolation,
+-        ConfigParserTestCaseLegacyInterpolation,
+-        ConfigParserTestCaseNoInterpolation,
+-        ConfigParserTestCaseTrickyFile,
+-        MultilineValuesTestCase,
+-        RawConfigParserTestCase,
+-        RawConfigParserTestCaseNonStandardDelimiters,
+-        RawConfigParserTestSambaConf,
+-        SortedTestCase,
+-        Issue7005TestCase,
+-        StrictTestCase,
+-        CompatibleTestCase,
+-        CopyTestCase,
+-        ConfigParserTestCaseNonStandardDefaultSection,
+-        ReadFileTestCase,
+-        CoverageOneHundredTestCase,
+-        ExceptionPicklingTestCase,
+-        InlineCommentStrippingTestCase,
+-        )
++if __name__ == '__main__':
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_crypt.py
+--- a/Lib/test/test_crypt.py
++++ b/Lib/test/test_crypt.py
+@@ -1,7 +1,11 @@
+ from test import support
+ import unittest
+ 
+-crypt = support.import_module('crypt')
++def setUpModule():
++    # this import will raise unittest.SkipTest if _crypt doesn't exist,
++    # so it has to be done in setUpModule for test discovery to work
++    global crypt
++    crypt = support.import_module('crypt')
+ 
+ class CryptTestCase(unittest.TestCase):
+ 
+@@ -29,8 +33,5 @@
+         self.assertTrue(len(crypt.methods) >= 1)
+         self.assertEqual(crypt.METHOD_CRYPT, crypt.methods[-1])
+ 
+-def test_main():
+-    support.run_unittest(CryptTestCase)
+-
+ if __name__ == "__main__":
+-    test_main()
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_csv.py
+--- a/Lib/test/test_csv.py
++++ b/Lib/test/test_csv.py
+@@ -197,6 +197,17 @@
+             fileobj.seek(0)
+             self.assertEqual(fileobj.read(), "a,b\r\nc,d\r\n")
+ 
++    @support.cpython_only
++    def test_writerows_legacy_strings(self):
++        import _testcapi
++
++        c = _testcapi.unicode_legacy_string('a')
++        with TemporaryFile("w+", newline='') as fileobj:
++            writer = csv.writer(fileobj)
++            writer.writerows([[c]])
++            fileobj.seek(0)
++            self.assertEqual(fileobj.read(), "a\r\n")
++
+     def _read_test(self, input, expect, **kwargs):
+         reader = csv.reader(input, **kwargs)
+         result = list(reader)
+@@ -225,6 +236,15 @@
+         self.assertRaises(csv.Error, self._read_test, ['a,b\nc,d'], [])
+         self.assertRaises(csv.Error, self._read_test, ['a,b\r\nc,d'], [])
+ 
++    def test_read_eof(self):
++        self._read_test(['a,"'], [['a', '']])
++        self._read_test(['"a'], [['a']])
++        self._read_test(['^'], [['\n']], escapechar='^')
++        self.assertRaises(csv.Error, self._read_test, ['a,"'], [], strict=True)
++        self.assertRaises(csv.Error, self._read_test, ['"a'], [], strict=True)
++        self.assertRaises(csv.Error, self._read_test,
++                          ['^'], [], escapechar='^', strict=True)
++
+     def test_read_escape(self):
+         self._read_test(['a,\\b,c'], [['a', 'b', 'c']], escapechar='\\')
+         self._read_test(['a,b\\,c'], [['a', 'b,c']], escapechar='\\')
+diff -r bd8afb90ebf2 Lib/test/test_decimal.py
+--- a/Lib/test/test_decimal.py
++++ b/Lib/test/test_decimal.py
+@@ -34,7 +34,8 @@
+ import locale
+ from test.support import (run_unittest, run_doctest, is_resource_enabled,
+                           requires_IEEE_754)
+-from test.support import check_warnings, import_fresh_module, TestFailed
++from test.support import (check_warnings, import_fresh_module, TestFailed,
++                          run_with_locale, cpython_only)
+ import random
+ import time
+ import warnings
+@@ -77,14 +78,20 @@
+     d = getattr(context, attr)
+     cls.assertTrue(all(d[s] if s in expected else not d[s] for s in d))
+ 
+-RoundingModes = {
+-  C: (C.ROUND_UP, C.ROUND_DOWN, C.ROUND_CEILING, C.ROUND_FLOOR,
+-      C.ROUND_HALF_UP, C.ROUND_HALF_DOWN, C.ROUND_HALF_EVEN,
+-      C.ROUND_05UP) if C else None,
+-  P: (P.ROUND_UP, P.ROUND_DOWN, P.ROUND_CEILING, P.ROUND_FLOOR,
+-      P.ROUND_HALF_UP, P.ROUND_HALF_DOWN, P.ROUND_HALF_EVEN,
+-      P.ROUND_05UP)
+-}
++ROUND_UP = P.ROUND_UP
++ROUND_DOWN = P.ROUND_DOWN
++ROUND_CEILING = P.ROUND_CEILING
++ROUND_FLOOR = P.ROUND_FLOOR
++ROUND_HALF_UP = P.ROUND_HALF_UP
++ROUND_HALF_DOWN = P.ROUND_HALF_DOWN
++ROUND_HALF_EVEN = P.ROUND_HALF_EVEN
++ROUND_05UP = P.ROUND_05UP
++
++RoundingModes = [
++  ROUND_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR,
++  ROUND_HALF_UP, ROUND_HALF_DOWN, ROUND_HALF_EVEN,
++  ROUND_05UP
++]
+ 
+ # Tests are built around these assumed context defaults.
+ # test_main() restores the original context.
+@@ -95,7 +102,7 @@
+ def init(m):
+     if not m: return
+     DefaultTestContext = m.Context(
+-       prec=9, rounding=m.ROUND_HALF_EVEN, traps=dict.fromkeys(Signals[m], 0)
++       prec=9, rounding=ROUND_HALF_EVEN, traps=dict.fromkeys(Signals[m], 0)
+     )
+     m.setcontext(DefaultTestContext)
+ 
+@@ -228,14 +235,14 @@
+                             'xor':'logical_xor'}
+ 
+         # Map test-case names to roundings.
+-        self.RoundingDict = {'ceiling' : self.decimal.ROUND_CEILING,
+-                             'down' : self.decimal.ROUND_DOWN,
+-                             'floor' : self.decimal.ROUND_FLOOR,
+-                             'half_down' : self.decimal.ROUND_HALF_DOWN,
+-                             'half_even' : self.decimal.ROUND_HALF_EVEN,
+-                             'half_up' : self.decimal.ROUND_HALF_UP,
+-                             'up' : self.decimal.ROUND_UP,
+-                             '05up' : self.decimal.ROUND_05UP}
++        self.RoundingDict = {'ceiling' : ROUND_CEILING,
++                             'down' : ROUND_DOWN,
++                             'floor' : ROUND_FLOOR,
++                             'half_down' : ROUND_HALF_DOWN,
++                             'half_even' : ROUND_HALF_EVEN,
++                             'half_up' : ROUND_HALF_UP,
++                             'up' : ROUND_UP,
++                             '05up' : ROUND_05UP}
+ 
+         # Map the test cases' error names to the actual errors.
+         self.ErrorNames = {'clamped' : self.decimal.Clamped,
+@@ -573,6 +580,15 @@
+             # embedded NUL
+             self.assertRaises(InvalidOperation, Decimal, "12\u00003")
+ 
++    @cpython_only
++    def test_from_legacy_strings(self):
++        import _testcapi
++        Decimal = self.decimal.Decimal
++        context = self.decimal.Context()
++
++        s = _testcapi.unicode_legacy_string('9.999999')
++        self.assertEqual(str(Decimal(s)), '9.999999')
++        self.assertEqual(str(context.create_decimal(s)), '9.999999')
+ 
+     def test_explicit_from_tuples(self):
+         Decimal = self.decimal.Decimal
+@@ -1136,18 +1152,19 @@
+         self.assertEqual(get_fmt(Decimal('-1.5'), dotsep_wide, '020n'),
+                          '-0\u00b4000\u00b4000\u00b4000\u00b4001\u00bf5')
+ 
++    @run_with_locale('LC_ALL', 'ps_AF')
+     def test_wide_char_separator_decimal_point(self):
+         # locale with wide char separator and decimal point
++        import locale
+         Decimal = self.decimal.Decimal
+ 
+-        try:
+-            locale.setlocale(locale.LC_ALL, 'ps_AF')
+-        except locale.Error:
++        decimal_point = locale.localeconv()['decimal_point']
++        thousands_sep = locale.localeconv()['thousands_sep']
++        if decimal_point != '\u066b' or thousands_sep != '\u066c':
+             return
+ 
+         self.assertEqual(format(Decimal('100000000.123'), 'n'),
+                          '100\u066c000\u066c000\u066b123')
+-        locale.resetlocale()
+ 
+ class CFormatTest(FormatTest):
+     decimal = C
+@@ -2027,7 +2044,7 @@
+         Decimal = self.decimal.Decimal
+ 
+         class MyDecimal(Decimal):
+-            pass
++            y = None
+ 
+         d1 = MyDecimal(1)
+         d2 = MyDecimal(2)
+@@ -2045,6 +2062,30 @@
+         self.assertIs(type(d), MyDecimal)
+         self.assertEqual(d, d1)
+ 
++        # Decimal(Decimal)
++        d = Decimal('1.0')
++        x = Decimal(d)
++        self.assertIs(type(x), Decimal)
++        self.assertEqual(x, d)
++
++        # MyDecimal(Decimal)
++        m = MyDecimal(d)
++        self.assertIs(type(m), MyDecimal)
++        self.assertEqual(m, d)
++        self.assertIs(m.y, None)
++
++        # Decimal(MyDecimal)
++        x = Decimal(m)
++        self.assertIs(type(x), Decimal)
++        self.assertEqual(x, d)
++
++        # MyDecimal(MyDecimal)
++        m.y = 9
++        x = MyDecimal(m)
++        self.assertIs(type(x), MyDecimal)
++        self.assertEqual(x, d)
++        self.assertIs(x.y, None)
++
+     def test_implicit_context(self):
+         Decimal = self.decimal.Decimal
+         getcontext = self.decimal.getcontext
+@@ -2054,6 +2095,245 @@
+         self.assertEqual(str(Decimal(0).sqrt()),
+                          str(c.sqrt(Decimal(0))))
+ 
++    def test_none_args(self):
++        Decimal = self.decimal.Decimal
++        Context = self.decimal.Context
++        localcontext = self.decimal.localcontext
++        InvalidOperation = self.decimal.InvalidOperation
++        DivisionByZero = self.decimal.DivisionByZero
++        Overflow = self.decimal.Overflow
++        Underflow = self.decimal.Underflow
++        Subnormal = self.decimal.Subnormal
++        Inexact = self.decimal.Inexact
++        Rounded = self.decimal.Rounded
++        Clamped = self.decimal.Clamped
++
++        with localcontext(Context()) as c:
++            c.prec = 7
++            c.Emax = 999
++            c.Emin = -999
++
++            x = Decimal("111")
++            y = Decimal("1e9999")
++            z = Decimal("1e-9999")
++
++            ##### Unary functions
++            c.clear_flags()
++            self.assertEqual(str(x.exp(context=None)), '1.609487E+48')
++            self.assertTrue(c.flags[Inexact])
++            self.assertTrue(c.flags[Rounded])
++            c.clear_flags()
++            self.assertRaises(Overflow, y.exp, context=None)
++            self.assertTrue(c.flags[Overflow])
++
++            self.assertIs(z.is_normal(context=None), False)
++            self.assertIs(z.is_subnormal(context=None), True)
++
++            c.clear_flags()
++            self.assertEqual(str(x.ln(context=None)), '4.709530')
++            self.assertTrue(c.flags[Inexact])
++            self.assertTrue(c.flags[Rounded])
++            c.clear_flags()
++            self.assertRaises(InvalidOperation, Decimal(-1).ln, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            self.assertEqual(str(x.log10(context=None)), '2.045323')
++            self.assertTrue(c.flags[Inexact])
++            self.assertTrue(c.flags[Rounded])
++            c.clear_flags()
++            self.assertRaises(InvalidOperation, Decimal(-1).log10, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            self.assertEqual(str(x.logb(context=None)), '2')
++            self.assertRaises(DivisionByZero, Decimal(0).logb, context=None)
++            self.assertTrue(c.flags[DivisionByZero])
++
++            c.clear_flags()
++            self.assertEqual(str(x.logical_invert(context=None)), '1111000')
++            self.assertRaises(InvalidOperation, y.logical_invert, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            self.assertEqual(str(y.next_minus(context=None)), '9.999999E+999')
++            self.assertRaises(InvalidOperation, Decimal('sNaN').next_minus, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            self.assertEqual(str(y.next_plus(context=None)), 'Infinity')
++            self.assertRaises(InvalidOperation, Decimal('sNaN').next_plus, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            self.assertEqual(str(z.normalize(context=None)), '0')
++            self.assertRaises(Overflow, y.normalize, context=None)
++            self.assertTrue(c.flags[Overflow])
++
++            self.assertEqual(str(z.number_class(context=None)), '+Subnormal')
++
++            c.clear_flags()
++            self.assertEqual(str(z.sqrt(context=None)), '0E-1005')
++            self.assertTrue(c.flags[Clamped])
++            self.assertTrue(c.flags[Inexact])
++            self.assertTrue(c.flags[Rounded])
++            self.assertTrue(c.flags[Subnormal])
++            self.assertTrue(c.flags[Underflow])
++            c.clear_flags()
++            self.assertRaises(Overflow, y.sqrt, context=None)
++            self.assertTrue(c.flags[Overflow])
++
++            c.capitals = 0
++            self.assertEqual(str(z.to_eng_string(context=None)), '1e-9999')
++            c.capitals = 1
++
++
++            ##### Binary functions
++            c.clear_flags()
++            ans = str(x.compare(Decimal('Nan891287828'), context=None))
++            self.assertEqual(ans, 'NaN1287828')
++            self.assertRaises(InvalidOperation, x.compare, Decimal('sNaN'), context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            ans = str(x.compare_signal(8224, context=None))
++            self.assertEqual(ans, '-1')
++            self.assertRaises(InvalidOperation, x.compare_signal, Decimal('NaN'), context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            ans = str(x.logical_and(101, context=None))
++            self.assertEqual(ans, '101')
++            self.assertRaises(InvalidOperation, x.logical_and, 123, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            ans = str(x.logical_or(101, context=None))
++            self.assertEqual(ans, '111')
++            self.assertRaises(InvalidOperation, x.logical_or, 123, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            ans = str(x.logical_xor(101, context=None))
++            self.assertEqual(ans, '10')
++            self.assertRaises(InvalidOperation, x.logical_xor, 123, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            ans = str(x.max(101, context=None))
++            self.assertEqual(ans, '111')
++            self.assertRaises(InvalidOperation, x.max, Decimal('sNaN'), context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            ans = str(x.max_mag(101, context=None))
++            self.assertEqual(ans, '111')
++            self.assertRaises(InvalidOperation, x.max_mag, Decimal('sNaN'), context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            ans = str(x.min(101, context=None))
++            self.assertEqual(ans, '101')
++            self.assertRaises(InvalidOperation, x.min, Decimal('sNaN'), context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            ans = str(x.min_mag(101, context=None))
++            self.assertEqual(ans, '101')
++            self.assertRaises(InvalidOperation, x.min_mag, Decimal('sNaN'), context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            ans = str(x.remainder_near(101, context=None))
++            self.assertEqual(ans, '10')
++            self.assertRaises(InvalidOperation, y.remainder_near, 101, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            ans = str(x.rotate(2, context=None))
++            self.assertEqual(ans, '11100')
++            self.assertRaises(InvalidOperation, x.rotate, 101, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            ans = str(x.scaleb(7, context=None))
++            self.assertEqual(ans, '1.11E+9')
++            self.assertRaises(InvalidOperation, x.scaleb, 10000, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.clear_flags()
++            ans = str(x.shift(2, context=None))
++            self.assertEqual(ans, '11100')
++            self.assertRaises(InvalidOperation, x.shift, 10000, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++
++            ##### Ternary functions
++            c.clear_flags()
++            ans = str(x.fma(2, 3, context=None))
++            self.assertEqual(ans, '225')
++            self.assertRaises(Overflow, x.fma, Decimal('1e9999'), 3, context=None)
++            self.assertTrue(c.flags[Overflow])
++
++
++            ##### Special cases
++            c.rounding = ROUND_HALF_EVEN
++            ans = str(Decimal('1.5').to_integral(rounding=None, context=None))
++            self.assertEqual(ans, '2')
++            c.rounding = ROUND_DOWN
++            ans = str(Decimal('1.5').to_integral(rounding=None, context=None))
++            self.assertEqual(ans, '1')
++            ans = str(Decimal('1.5').to_integral(rounding=ROUND_UP, context=None))
++            self.assertEqual(ans, '2')
++            c.clear_flags()
++            self.assertRaises(InvalidOperation, Decimal('sNaN').to_integral, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.rounding = ROUND_HALF_EVEN
++            ans = str(Decimal('1.5').to_integral_value(rounding=None, context=None))
++            self.assertEqual(ans, '2')
++            c.rounding = ROUND_DOWN
++            ans = str(Decimal('1.5').to_integral_value(rounding=None, context=None))
++            self.assertEqual(ans, '1')
++            ans = str(Decimal('1.5').to_integral_value(rounding=ROUND_UP, context=None))
++            self.assertEqual(ans, '2')
++            c.clear_flags()
++            self.assertRaises(InvalidOperation, Decimal('sNaN').to_integral_value, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.rounding = ROUND_HALF_EVEN
++            ans = str(Decimal('1.5').to_integral_exact(rounding=None, context=None))
++            self.assertEqual(ans, '2')
++            c.rounding = ROUND_DOWN
++            ans = str(Decimal('1.5').to_integral_exact(rounding=None, context=None))
++            self.assertEqual(ans, '1')
++            ans = str(Decimal('1.5').to_integral_exact(rounding=ROUND_UP, context=None))
++            self.assertEqual(ans, '2')
++            c.clear_flags()
++            self.assertRaises(InvalidOperation, Decimal('sNaN').to_integral_exact, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++            c.rounding = ROUND_UP
++            ans = str(Decimal('1.50001').quantize(exp=Decimal('1e-3'), rounding=None, context=None))
++            self.assertEqual(ans, '1.501')
++            c.rounding = ROUND_DOWN
++            ans = str(Decimal('1.50001').quantize(exp=Decimal('1e-3'), rounding=None, context=None))
++            self.assertEqual(ans, '1.500')
++            ans = str(Decimal('1.50001').quantize(exp=Decimal('1e-3'), rounding=ROUND_UP, context=None))
++            self.assertEqual(ans, '1.501')
++            c.clear_flags()
++            self.assertRaises(InvalidOperation, y.quantize, Decimal('1e-10'), rounding=ROUND_UP, context=None)
++            self.assertTrue(c.flags[InvalidOperation])
++
++        with localcontext(Context()) as context:
++            context.prec = 7
++            context.Emax = 999
++            context.Emin = -999
++            with localcontext(ctx=None) as c:
++                self.assertEqual(c.prec, 7)
++                self.assertEqual(c.Emax, 999)
++                self.assertEqual(c.Emin, -999)
++
+     def test_conversions_from_int(self):
+         # Check that methods taking a second Decimal argument will
+         # always accept an integer in place of a Decimal.
+@@ -2153,7 +2433,6 @@
+ 
+     def test_int(self):
+         Decimal = self.decimal.Decimal
+-        ROUND_DOWN = self.decimal.ROUND_DOWN
+ 
+         for x in range(-250, 250):
+             s = '%0.2f' % (x / 100.0)
+@@ -2171,7 +2450,6 @@
+ 
+     def test_trunc(self):
+         Decimal = self.decimal.Decimal
+-        ROUND_DOWN = self.decimal.ROUND_DOWN
+ 
+         for x in range(-250, 250):
+             s = '%0.2f' % (x / 100.0)
+@@ -2214,8 +2492,6 @@
+     def test_create_decimal_from_float(self):
+         Decimal = self.decimal.Decimal
+         Context = self.decimal.Context
+-        ROUND_DOWN = self.decimal.ROUND_DOWN
+-        ROUND_UP = self.decimal.ROUND_UP
+         Inexact = self.decimal.Inexact
+ 
+         context = Context(prec=5, rounding=ROUND_DOWN)
+@@ -2245,7 +2521,6 @@
+         Decimal = self.decimal.Decimal
+         Context = self.decimal.Context
+         InvalidOperation = self.decimal.InvalidOperation
+-        ROUND_DOWN = self.decimal.ROUND_DOWN
+ 
+         c = Context(Emax=99999, Emin=-99999)
+         self.assertEqual(
+@@ -2388,14 +2663,11 @@
+             self.assertRaises(TypeError, D.from_float, 1.1, context=xc)
+             self.assertRaises(TypeError, D(0).as_tuple, context=xc)
+ 
+-            if (self.decimal == C):
+-                self.assertRaises(TypeError, D(1).canonical, context=xc)
+-                self.assertEqual(D("-1").copy_abs(context=xc), 1)
+-                self.assertEqual(D("1").copy_negate(context=xc), -1)
+-            else:
+-                self.assertEqual(D(1).canonical(context=xc), 1)
+-                self.assertRaises(TypeError, D("-1").copy_abs, context=xc)
+-                self.assertRaises(TypeError, D("-1").copy_negate, context=xc)
++            self.assertEqual(D(1).canonical(), 1)
++            self.assertRaises(TypeError, D("-1").copy_abs, context=xc)
++            self.assertRaises(TypeError, D("-1").copy_negate, context=xc)
++            self.assertRaises(TypeError, D(1).canonical, context="x")
++            self.assertRaises(TypeError, D(1).canonical, xyz="x")
+ 
+     def test_exception_hierarchy(self):
+ 
+@@ -2444,6 +2716,41 @@
+ 
+ class ContextAPItests(unittest.TestCase):
+ 
++    def test_none_args(self):
++        Context = self.decimal.Context
++        InvalidOperation = self.decimal.InvalidOperation
++        DivisionByZero = self.decimal.DivisionByZero
++        Overflow = self.decimal.Overflow
++
++        c1 = Context()
++        c2 = Context(prec=None, rounding=None, Emax=None, Emin=None,
++                     capitals=None, clamp=None, flags=None, traps=None)
++        for c in [c1, c2]:
++            self.assertEqual(c.prec, 28)
++            self.assertEqual(c.rounding, ROUND_HALF_EVEN)
++            self.assertEqual(c.Emax, 999999)
++            self.assertEqual(c.Emin, -999999)
++            self.assertEqual(c.capitals, 1)
++            self.assertEqual(c.clamp, 0)
++            assert_signals(self, c, 'flags', [])
++            assert_signals(self, c, 'traps', [InvalidOperation, DivisionByZero,
++                                              Overflow])
++
++    @cpython_only
++    def test_from_legacy_strings(self):
++        import _testcapi
++        c = self.decimal.Context()
++
++        for rnd in RoundingModes:
++            c.rounding = _testcapi.unicode_legacy_string(rnd)
++            self.assertEqual(c.rounding, rnd)
++
++        s = _testcapi.unicode_legacy_string('')
++        self.assertRaises(TypeError, setattr, c, 'rounding', s)
++
++        s = _testcapi.unicode_legacy_string('ROUND_\x00UP')
++        self.assertRaises(TypeError, setattr, c, 'rounding', s)
++
+     def test_pickle(self):
+ 
+         Context = self.decimal.Context
+@@ -2467,7 +2774,7 @@
+         # Test interchangeability
+         combinations = [(C, P), (P, C)] if C else [(P, P)]
+         for dumper, loader in combinations:
+-            for ri, _ in enumerate(RoundingModes[dumper]):
++            for ri, _ in enumerate(RoundingModes):
+                 for fi, _ in enumerate(OrderedSignals[dumper]):
+                     for ti, _ in enumerate(OrderedSignals[dumper]):
+ 
+@@ -2481,7 +2788,7 @@
+                         sys.modules['decimal'] = dumper
+                         c = dumper.Context(
+                               prec=prec, Emin=emin, Emax=emax,
+-                              rounding=RoundingModes[dumper][ri],
++                              rounding=RoundingModes[ri],
+                               capitals=caps, clamp=clamp,
+                               flags=OrderedSignals[dumper][:fi],
+                               traps=OrderedSignals[dumper][:ti]
+@@ -2496,7 +2803,7 @@
+                         self.assertEqual(d.prec, prec)
+                         self.assertEqual(d.Emin, emin)
+                         self.assertEqual(d.Emax, emax)
+-                        self.assertEqual(d.rounding, RoundingModes[loader][ri])
++                        self.assertEqual(d.rounding, RoundingModes[ri])
+                         self.assertEqual(d.capitals, caps)
+                         self.assertEqual(d.clamp, clamp)
+                         assert_signals(self, d, 'flags', OrderedSignals[loader][:fi])
+@@ -3298,7 +3605,6 @@
+         Underflow = self.decimal.Underflow
+         Clamped = self.decimal.Clamped
+         Subnormal = self.decimal.Subnormal
+-        ROUND_HALF_EVEN = self.decimal.ROUND_HALF_EVEN
+ 
+         def raise_error(context, flag):
+             if self.decimal == C:
+@@ -3665,17 +3971,6 @@
+         self.assertRaises(ValueError, setattr, c, 'Emin', 1)
+         self.assertRaises(TypeError, setattr, c, 'Emin', (1,2,3))
+ 
+-        # rounding: always raise TypeError in order to get consistent
+-        # exceptions across implementations. In decimal, rounding
+-        # modes are strings, in _decimal they are integers. The idea
+-        # is to view rounding as an abstract type and not mind the
+-        # implementation details.
+-        # Hence, a user should view the rounding modes as if they
+-        # had been defined in a language that supports abstract
+-        # data types, e.g. ocaml:
+-        #
+-        #   type rounding = ROUND_DOWN | ROUND_HALF_UP | ... ;;
+-        #
+         self.assertRaises(TypeError, setattr, c, 'rounding', -1)
+         self.assertRaises(TypeError, setattr, c, 'rounding', 9)
+         self.assertRaises(TypeError, setattr, c, 'rounding', 1.0)
+@@ -3728,8 +4023,6 @@
+         decimal = self.decimal
+         Decimal = decimal.Decimal
+         Context = decimal.Context
+-        ROUND_HALF_EVEN = decimal.ROUND_HALF_EVEN
+-        ROUND_DOWN = decimal.ROUND_DOWN
+         Clamped = decimal.Clamped
+         DivisionByZero = decimal.DivisionByZero
+         Inexact = decimal.Inexact
+@@ -3897,7 +4190,7 @@
+         c.prec = 425000000
+         c.Emax = 425000000
+         c.Emin = -425000000
+-        c.rounding = self.decimal.ROUND_HALF_DOWN
++        c.rounding = ROUND_HALF_DOWN
+         c.capitals = 0
+         c.clamp = 1
+         for sig in OrderedSignals[self.decimal]:
+@@ -4289,7 +4582,6 @@
+     def test_py_rescale(self):
+         # Coverage
+         Decimal = P.Decimal
+-        ROUND_UP = P.ROUND_UP
+         localcontext = P.localcontext
+ 
+         with localcontext() as c:
+@@ -4299,7 +4591,6 @@
+     def test_py__round(self):
+         # Coverage
+         Decimal = P.Decimal
+-        ROUND_UP = P.ROUND_UP
+ 
+         self.assertRaises(ValueError, Decimal("3.1234")._round, 0, ROUND_UP)
+ 
+@@ -4368,11 +4659,6 @@
+         self.assertEqual(C.DECIMAL128, 128)
+         self.assertEqual(C.IEEE_CONTEXT_MAX_BITS, 512)
+ 
+-        # Rounding modes
+-        for i, v in enumerate(RoundingModes[C]):
+-            self.assertEqual(v, i)
+-        self.assertEqual(C.ROUND_TRUNC, 8)
+-
+         # Conditions
+         for i, v in enumerate(cond):
+             self.assertEqual(v, 1<<i)
+@@ -4432,7 +4718,6 @@
+         # in the same order.
+         DefaultContext = C.DefaultContext
+         FloatOperation = C.FloatOperation
+-        ROUND_HALF_DOWN = C.ROUND_HALF_DOWN
+ 
+         c = DefaultContext.copy()
+ 
+@@ -4505,7 +4790,6 @@
+         self.assertRaises(OverflowError, Context, prec=int_max+1)
+         self.assertRaises(OverflowError, Context, Emax=int_max+1)
+         self.assertRaises(OverflowError, Context, Emin=-int_max-2)
+-        self.assertRaises(OverflowError, Context, rounding=int_max+1)
+         self.assertRaises(OverflowError, Context, clamp=int_max+1)
+         self.assertRaises(OverflowError, Context, capitals=int_max+1)
+ 
+@@ -4517,14 +4801,6 @@
+                 self.assertRaises(ValueError, setattr, c, attr, int_max)
+                 self.assertRaises(ValueError, setattr, c, attr, -int_max-1)
+ 
+-        # OverflowError, general TypeError
+-        for attr in ('rounding',):
+-            self.assertRaises(OverflowError, setattr, c, attr, int_max+1)
+-            self.assertRaises(OverflowError, setattr, c, attr, -int_max-2)
+-            if sys.platform != 'win32':
+-                self.assertRaises(TypeError, setattr, c, attr, int_max)
+-                self.assertRaises(TypeError, setattr, c, attr, -int_max-1)
+-
+         # OverflowError: _unsafe_setprec, _unsafe_setemin, _unsafe_setemax
+         if C.MAX_PREC == 425000000:
+             self.assertRaises(OverflowError, getattr(c, '_unsafe_setprec'),
+@@ -4558,12 +4834,26 @@
+         # Invalid local context
+         self.assertRaises(TypeError, exec, 'with localcontext("xyz"): pass',
+                           locals())
++        self.assertRaises(TypeError, exec,
++                          'with localcontext(context=getcontext()): pass',
++                          locals())
+ 
+         # setcontext
+         saved_context = getcontext()
+         self.assertRaises(TypeError, setcontext, "xyz")
+         setcontext(saved_context)
+ 
++    def test_rounding_strings_interned(self):
++
++        self.assertIs(C.ROUND_UP, P.ROUND_UP)
++        self.assertIs(C.ROUND_DOWN, P.ROUND_DOWN)
++        self.assertIs(C.ROUND_CEILING, P.ROUND_CEILING)
++        self.assertIs(C.ROUND_FLOOR, P.ROUND_FLOOR)
++        self.assertIs(C.ROUND_HALF_UP, P.ROUND_HALF_UP)
++        self.assertIs(C.ROUND_HALF_DOWN, P.ROUND_HALF_DOWN)
++        self.assertIs(C.ROUND_HALF_EVEN, P.ROUND_HALF_EVEN)
++        self.assertIs(C.ROUND_05UP, P.ROUND_05UP)
++
+     @requires_extra_functionality
+     def test_c_context_errors_extra(self):
+         Context = C.Context
+@@ -4610,7 +4900,6 @@
+     def test_c_valid_context(self):
+         # These tests are for code coverage in _decimal.
+         DefaultContext = C.DefaultContext
+-        ROUND_HALF_UP = C.ROUND_HALF_UP
+         Clamped = C.Clamped
+         Underflow = C.Underflow
+         Inexact = C.Inexact
+@@ -4682,27 +4971,20 @@
+     def test_c_format(self):
+         # Restricted input
+         Decimal = C.Decimal
+-        InvalidOperation = C.InvalidOperation
+-        Rounded = C.Rounded
+-        localcontext = C.localcontext
+         HAVE_CONFIG_64 = (C.MAX_PREC > 425000000)
+ 
+         self.assertRaises(TypeError, Decimal(1).__format__, "=10.10", [], 9)
+         self.assertRaises(TypeError, Decimal(1).__format__, "=10.10", 9)
+         self.assertRaises(TypeError, Decimal(1).__format__, [])
+ 
+-        with localcontext() as c:
+-            c.traps[InvalidOperation] = True
+-            c.traps[Rounded] = True
+-            self.assertRaises(ValueError, Decimal(1).__format__, "<>=10.10")
+-            maxsize = 2**63-1 if HAVE_CONFIG_64 else 2**31-1
+-            self.assertRaises(InvalidOperation, Decimal("1.23456789").__format__,
+-                              "=%d.1" % maxsize)
++        self.assertRaises(ValueError, Decimal(1).__format__, "<>=10.10")
++        maxsize = 2**63-1 if HAVE_CONFIG_64 else 2**31-1
++        self.assertRaises(ValueError, Decimal("1.23456789").__format__,
++                          "=%d.1" % maxsize)
+ 
+     def test_c_integral(self):
+         Decimal = C.Decimal
+         Inexact = C.Inexact
+-        ROUND_UP = C.ROUND_UP
+         localcontext = C.localcontext
+ 
+         x = Decimal(10)
+@@ -4736,7 +5018,6 @@
+         Decimal = C.Decimal
+         InvalidOperation = C.InvalidOperation
+         DivisionByZero = C.DivisionByZero
+-        ROUND_UP = C.ROUND_UP
+         getcontext = C.getcontext
+         localcontext = C.localcontext
+ 
+@@ -4791,6 +5072,50 @@
+             c.prec = 2
+             self.assertRaises(InvalidOperation, pow, Decimal(1000), 1, 501)
+ 
++    def test_va_args_exceptions(self):
++        Decimal = C.Decimal
++        Context = C.Context
++
++        x = Decimal("10001111111")
++
++        for attr in ['exp', 'is_normal', 'is_subnormal', 'ln', 'log10',
++                     'logb', 'logical_invert', 'next_minus', 'next_plus',
++                     'normalize', 'number_class', 'sqrt', 'to_eng_string']:
++            func = getattr(x, attr)
++            self.assertRaises(TypeError, func, context="x")
++            self.assertRaises(TypeError, func, "x", context=None)
++
++        for attr in ['compare', 'compare_signal', 'logical_and',
++                     'logical_or', 'max', 'max_mag', 'min', 'min_mag',
++                     'remainder_near', 'rotate', 'scaleb', 'shift']:
++            func = getattr(x, attr)
++            self.assertRaises(TypeError, func, context="x")
++            self.assertRaises(TypeError, func, "x", context=None)
++
++        self.assertRaises(TypeError, x.to_integral, rounding=None, context=[])
++        self.assertRaises(TypeError, x.to_integral, rounding={}, context=[])
++        self.assertRaises(TypeError, x.to_integral, [], [])
++
++        self.assertRaises(TypeError, x.to_integral_value, rounding=None, context=[])
++        self.assertRaises(TypeError, x.to_integral_value, rounding={}, context=[])
++        self.assertRaises(TypeError, x.to_integral_value, [], [])
++
++        self.assertRaises(TypeError, x.to_integral_exact, rounding=None, context=[])
++        self.assertRaises(TypeError, x.to_integral_exact, rounding={}, context=[])
++        self.assertRaises(TypeError, x.to_integral_exact, [], [])
++
++        self.assertRaises(TypeError, x.fma, 1, 2, context="x")
++        self.assertRaises(TypeError, x.fma, 1, 2, "x", context=None)
++
++        self.assertRaises(TypeError, x.quantize, 1, [], context=None)
++        self.assertRaises(TypeError, x.quantize, 1, [], rounding=None)
++        self.assertRaises(TypeError, x.quantize, 1, [], [])
++
++        c = Context()
++        self.assertRaises(TypeError, c.power, 1, 2, mod="x")
++        self.assertRaises(TypeError, c.power, 1, "x", mod=None)
++        self.assertRaises(TypeError, c.power, "x", 2, mod=None)
++
+     @requires_extra_functionality
+     def test_c_context_templates(self):
+         self.assertEqual(
+@@ -4895,7 +5220,7 @@
+         lim = len(OrderedSignals[C])
+         for r in range(lim):
+             for t in range(lim):
+-                for round in RoundingModes[C]:
++                for round in RoundingModes:
+                     flags = random.sample(OrderedSignals[C], r)
+                     traps = random.sample(OrderedSignals[C], t)
+                     prec = random.randrange(1, 10000)
+diff -r bd8afb90ebf2 Lib/test/test_descr.py
+--- a/Lib/test/test_descr.py
++++ b/Lib/test/test_descr.py
+@@ -4502,11 +4502,19 @@
+         self.assertEqual(float.real.__qualname__, 'float.real')
+         self.assertEqual(int.__add__.__qualname__, 'int.__add__')
+ 
++        class X:
++            pass
++        with self.assertRaises(TypeError):
++            del X.__qualname__
++
++        self.assertRaises(TypeError, type.__dict__['__qualname__'].__set__,
++                          str, 'Oink')
++
+     def test_qualname_dict(self):
+         ns = {'__qualname__': 'some.name'}
+         tp = type('Foo', (), ns)
+         self.assertEqual(tp.__qualname__, 'some.name')
+-        self.assertEqual(tp.__dict__['__qualname__'], 'some.name')
++        self.assertNotIn('__qualname__', tp.__dict__)
+         self.assertEqual(ns, {'__qualname__': 'some.name'})
+ 
+         ns = {'__qualname__': 1}
+@@ -4564,7 +4572,7 @@
+         keys = list(it)
+         keys.sort()
+         self.assertEqual(keys, ['__dict__', '__doc__', '__module__',
+-                                '__qualname__', '__weakref__', 'meth'])
++                                '__weakref__', 'meth'])
+ 
+     @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
+                         'trace function introduces __local__')
+@@ -4573,7 +4581,7 @@
+         it = self.C.__dict__.values()
+         self.assertNotIsInstance(it, list)
+         values = list(it)
+-        self.assertEqual(len(values), 6)
++        self.assertEqual(len(values), 5)
+ 
+     @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
+                         'trace function introduces __local__')
+@@ -4584,7 +4592,7 @@
+         keys = [item[0] for item in it]
+         keys.sort()
+         self.assertEqual(keys, ['__dict__', '__doc__', '__module__',
+-                                '__qualname__', '__weakref__', 'meth'])
++                                '__weakref__', 'meth'])
+ 
+     def test_dict_type_with_metaclass(self):
+         # Testing type of __dict__ when metaclass set...
+diff -r bd8afb90ebf2 Lib/test/test_dict.py
+--- a/Lib/test/test_dict.py
++++ b/Lib/test/test_dict.py
+@@ -256,6 +256,14 @@
+         d = dict(zip(range(6), range(6)))
+         self.assertEqual(dict.fromkeys(d, 0), dict(zip(range(6), [0]*6)))
+ 
++        class baddict3(dict):
++            def __new__(cls):
++                return d
++        d = {i : i for i in range(10)}
++        res = d.copy()
++        res.update(a=None, b=None, c=None)
++        self.assertEqual(baddict3.fromkeys({"a", "b", "c"}), res)
++
+     def test_copy(self):
+         d = {1:1, 2:2, 3:3}
+         self.assertEqual(d.copy(), {1:1, 2:2, 3:3})
+diff -r bd8afb90ebf2 Lib/test/test_dictcomps.py
+--- a/Lib/test/test_dictcomps.py
++++ b/Lib/test/test_dictcomps.py
+@@ -1,54 +1,88 @@
++import unittest
+ 
+-doctests = """
++from test import support
+ 
+-    >>> k = "old value"
+-    >>> { k: None for k in range(10) }
+-    {0: None, 1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None}
+-    >>> k
+-    'old value'
++# For scope testing.
++g = "Global variable"
+ 
+-    >>> { k: k+10 for k in range(10) }
+-    {0: 10, 1: 11, 2: 12, 3: 13, 4: 14, 5: 15, 6: 16, 7: 17, 8: 18, 9: 19}
+ 
+-    >>> g = "Global variable"
+-    >>> { k: g for k in range(10) }
+-    {0: 'Global variable', 1: 'Global variable', 2: 'Global variable', 3: 'Global variable', 4: 'Global variable', 5: 'Global variable', 6: 'Global variable', 7: 'Global variable', 8: 'Global variable', 9: 'Global variable'}
++class DictComprehensionTest(unittest.TestCase):
+ 
+-    >>> { k: v for k in range(10) for v in range(10) if k == v }
+-    {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9}
++    def test_basics(self):
++        expected = {0: 10, 1: 11, 2: 12, 3: 13, 4: 14, 5: 15, 6: 16, 7: 17,
++                    8: 18, 9: 19}
++        actual = {k: k + 10 for k in range(10)}
++        self.assertEqual(actual, expected)
+ 
+-    >>> { k: v for v in range(10) for k in range(v*9, v*10) }
+-    {9: 1, 18: 2, 19: 2, 27: 3, 28: 3, 29: 3, 36: 4, 37: 4, 38: 4, 39: 4, 45: 5, 46: 5, 47: 5, 48: 5, 49: 5, 54: 6, 55: 6, 56: 6, 57: 6, 58: 6, 59: 6, 63: 7, 64: 7, 65: 7, 66: 7, 67: 7, 68: 7, 69: 7, 72: 8, 73: 8, 74: 8, 75: 8, 76: 8, 77: 8, 78: 8, 79: 8, 81: 9, 82: 9, 83: 9, 84: 9, 85: 9, 86: 9, 87: 9, 88: 9, 89: 9}
++        expected = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9}
++        actual = {k: v for k in range(10) for v in range(10) if k == v}
++        self.assertEqual(actual, expected)
+ 
+-    >>> { x: y for y, x in ((1, 2), (3, 4)) } = 5 # doctest: +IGNORE_EXCEPTION_DETAIL
+-    Traceback (most recent call last):
+-       ...
+-    SyntaxError: ...
++    def test_scope_isolation(self):
++        k = "Local Variable"
+ 
+-    >>> { x: y for y, x in ((1, 2), (3, 4)) } += 5 # doctest: +IGNORE_EXCEPTION_DETAIL
+-    Traceback (most recent call last):
+-       ...
+-    SyntaxError: ...
++        expected = {0: None, 1: None, 2: None, 3: None, 4: None, 5: None,
++                    6: None, 7: None, 8: None, 9: None}
++        actual = {k: None for k in range(10)}
++        self.assertEqual(actual, expected)
++        self.assertEqual(k, "Local Variable")
+ 
+-"""
++        expected = {9: 1, 18: 2, 19: 2, 27: 3, 28: 3, 29: 3, 36: 4, 37: 4,
++                    38: 4, 39: 4, 45: 5, 46: 5, 47: 5, 48: 5, 49: 5, 54: 6,
++                    55: 6, 56: 6, 57: 6, 58: 6, 59: 6, 63: 7, 64: 7, 65: 7,
++                    66: 7, 67: 7, 68: 7, 69: 7, 72: 8, 73: 8, 74: 8, 75: 8,
++                    76: 8, 77: 8, 78: 8, 79: 8, 81: 9, 82: 9, 83: 9, 84: 9,
++                    85: 9, 86: 9, 87: 9, 88: 9, 89: 9}
++        actual = {k: v for v in range(10) for k in range(v * 9, v * 10)}
++        self.assertEqual(k, "Local Variable")
++        self.assertEqual(actual, expected)
+ 
+-__test__ = {'doctests' : doctests}
++    def test_scope_isolation_from_global(self):
++        expected = {0: None, 1: None, 2: None, 3: None, 4: None, 5: None,
++                    6: None, 7: None, 8: None, 9: None}
++        actual = {g: None for g in range(10)}
++        self.assertEqual(actual, expected)
++        self.assertEqual(g, "Global variable")
+ 
+-def test_main(verbose=None):
+-    import sys
+-    from test import support
+-    from test import test_dictcomps
+-    support.run_doctest(test_dictcomps, verbose)
++        expected = {9: 1, 18: 2, 19: 2, 27: 3, 28: 3, 29: 3, 36: 4, 37: 4,
++                    38: 4, 39: 4, 45: 5, 46: 5, 47: 5, 48: 5, 49: 5, 54: 6,
++                    55: 6, 56: 6, 57: 6, 58: 6, 59: 6, 63: 7, 64: 7, 65: 7,
++                    66: 7, 67: 7, 68: 7, 69: 7, 72: 8, 73: 8, 74: 8, 75: 8,
++                    76: 8, 77: 8, 78: 8, 79: 8, 81: 9, 82: 9, 83: 9, 84: 9,
++                    85: 9, 86: 9, 87: 9, 88: 9, 89: 9}
++        actual = {g: v for v in range(10) for g in range(v * 9, v * 10)}
++        self.assertEqual(g, "Global variable")
++        self.assertEqual(actual, expected)
+ 
+-    # verify reference counting
+-    if verbose and hasattr(sys, "gettotalrefcount"):
+-        import gc
+-        counts = [None] * 5
+-        for i in range(len(counts)):
+-            support.run_doctest(test_dictcomps, verbose)
+-            gc.collect()
+-            counts[i] = sys.gettotalrefcount()
+-        print(counts)
++    def test_global_visibility(self):
++        expected = {0: 'Global variable', 1: 'Global variable',
++                    2: 'Global variable', 3: 'Global variable',
++                    4: 'Global variable', 5: 'Global variable',
++                    6: 'Global variable', 7: 'Global variable',
++                    8: 'Global variable', 9: 'Global variable'}
++        actual = {k: g for k in range(10)}
++        self.assertEqual(actual, expected)
++
++    def test_local_visibility(self):
++        v = "Local variable"
++        expected = {0: 'Local variable', 1: 'Local variable',
++                    2: 'Local variable', 3: 'Local variable',
++                    4: 'Local variable', 5: 'Local variable',
++                    6: 'Local variable', 7: 'Local variable',
++                    8: 'Local variable', 9: 'Local variable'}
++        actual = {k: v for k in range(10)}
++        self.assertEqual(actual, expected)
++        self.assertEqual(v, "Local variable")
++
++    def test_illegal_assignment(self):
++        with self.assertRaisesRegex(SyntaxError, "can't assign"):
++            compile("{x: y for y, x in ((1, 2), (3, 4))} = 5", "<test>",
++                    "exec")
++
++        with self.assertRaisesRegex(SyntaxError, "can't assign"):
++            compile("{x: y for y, x in ((1, 2), (3, 4))} += 5", "<test>",
++                    "exec")
++
+ 
+ if __name__ == "__main__":
+-    test_main(verbose=True)
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_doctest.py
+--- a/Lib/test/test_doctest.py
++++ b/Lib/test/test_doctest.py
+@@ -1986,6 +1986,31 @@
+          >>> suite.run(unittest.TestResult())
+          <unittest.result.TestResult run=9 errors=0 failures=4>
+ 
++       The module need not contain any doctest examples:
++
++         >>> suite = doctest.DocTestSuite('test.sample_doctest_no_doctests')
++         >>> suite.run(unittest.TestResult())
++         <unittest.result.TestResult run=0 errors=0 failures=0>
++
++       However, if DocTestSuite finds no docstrings, it raises an error:
++
++         >>> try:
++         ...     doctest.DocTestSuite('test.sample_doctest_no_docstrings')
++         ... except ValueError as e:
++         ...     error = e
++
++         >>> print(error.args[1])
++         has no docstrings
++
++       You can prevent this error by passing a DocTestFinder instance with
++       the `exclude_empty` keyword argument set to False:
++
++         >>> finder = doctest.DocTestFinder(exclude_empty=False)
++         >>> suite = doctest.DocTestSuite('test.sample_doctest_no_docstrings',
++         ...                              test_finder=finder)
++         >>> suite.run(unittest.TestResult())
++         <unittest.result.TestResult run=0 errors=0 failures=0>
++
+        We can use the current module:
+ 
+          >>> suite = test.sample_doctest.test_suite()
+diff -r bd8afb90ebf2 Lib/test/test_docxmlrpc.py
+--- a/Lib/test/test_docxmlrpc.py
++++ b/Lib/test/test_docxmlrpc.py
+@@ -100,7 +100,7 @@
+         self.assertEqual(response.status, 200)
+         self.assertEqual(response.getheader("Content-type"), "text/html")
+ 
+-        # Server throws an exception if we don't start to read the data
++        # Server raises an exception if we don't start to read the data
+         response.read()
+ 
+     def test_invalid_get_response(self):
+diff -r bd8afb90ebf2 Lib/test/test_email/test_email.py
+--- a/Lib/test/test_email/test_email.py
++++ b/Lib/test/test_email/test_email.py
+@@ -677,6 +677,27 @@
+         msg = MIMEText('æ–‡', _charset='euc-jp')
+         eq(msg['content-transfer-encoding'], '7bit')
+ 
++    def test_qp_encode_latin1(self):
++        msg = MIMEText('\xe1\xf6\n', 'text', 'ISO-8859-1')
++        self.assertEqual(str(msg), textwrap.dedent("""\
++            MIME-Version: 1.0
++            Content-Type: text/text; charset="iso-8859-1"
++            Content-Transfer-Encoding: quoted-printable
++
++            =E1=F6
++            """))
++
++    def test_qp_encode_non_latin1(self):
++        # Issue 16948
++        msg = MIMEText('\u017c\n', 'text', 'ISO-8859-2')
++        self.assertEqual(str(msg), textwrap.dedent("""\
++            MIME-Version: 1.0
++            Content-Type: text/text; charset="iso-8859-2"
++            Content-Transfer-Encoding: quoted-printable
++
++            =BF
++            """))
++
+ 
+ # Test long header wrapping
+ class TestLongHeaders(TestEmailBase):
+@@ -1419,6 +1440,39 @@
+         eq(msg.get_payload().strip(), '+vv8/f7/')
+         eq(msg.get_payload(decode=True), bytesdata)
+ 
++    def test_binary_body_with_encode_7or8bit(self):
++        # Issue 17171.
++        bytesdata = b'\xfa\xfb\xfc\xfd\xfe\xff'
++        msg = MIMEApplication(bytesdata, _encoder=encoders.encode_7or8bit)
++        # Treated as a string, this will be invalid code points.
++        self.assertEqual(msg.get_payload(), '\uFFFD' * len(bytesdata))
++        self.assertEqual(msg.get_payload(decode=True), bytesdata)
++        self.assertEqual(msg['Content-Transfer-Encoding'], '8bit')
++        s = BytesIO()
++        g = BytesGenerator(s)
++        g.flatten(msg)
++        wireform = s.getvalue()
++        msg2 = email.message_from_bytes(wireform)
++        self.assertEqual(msg.get_payload(), '\uFFFD' * len(bytesdata))
++        self.assertEqual(msg2.get_payload(decode=True), bytesdata)
++        self.assertEqual(msg2['Content-Transfer-Encoding'], '8bit')
++
++    def test_binary_body_with_encode_noop(self):
++        # Issue 16564: This does not produce an RFC valid message, since to be
++        # valid it should have a CTE of binary.  But the below works in
++        # Python2, and is documented as working this way.
++        bytesdata = b'\xfa\xfb\xfc\xfd\xfe\xff'
++        msg = MIMEApplication(bytesdata, _encoder=encoders.encode_noop)
++        # Treated as a string, this will be invalid code points.
++        self.assertEqual(msg.get_payload(), '\uFFFD' * len(bytesdata))
++        self.assertEqual(msg.get_payload(decode=True), bytesdata)
++        s = BytesIO()
++        g = BytesGenerator(s)
++        g.flatten(msg)
++        wireform = s.getvalue()
++        msg2 = email.message_from_bytes(wireform)
++        self.assertEqual(msg.get_payload(), '\uFFFD' * len(bytesdata))
++        self.assertEqual(msg2.get_payload(decode=True), bytesdata)
+ 
+ 
+ # Test the basic MIMEText class
+diff -r bd8afb90ebf2 Lib/test/test_email/test_headerregistry.py
+--- a/Lib/test/test_email/test_headerregistry.py
++++ b/Lib/test/test_email/test_headerregistry.py
+@@ -670,7 +670,7 @@
+             ),
+ 
+         # XXX: I would say this one should default to ascii/en for the
+-        # "encoded" segment, since the the first segment is not encoded and is
++        # "encoded" segment, since the first segment is not encoded and is
+         # in double quotes, making the value a valid non-encoded string.  The
+         # old parser decodes this just like the previous case, which may be the
+         # better Postel rule, but could equally result in borking headers that
+diff -r bd8afb90ebf2 Lib/test/test_email/test_inversion.py
+--- /dev/null
++++ b/Lib/test/test_email/test_inversion.py
+@@ -0,0 +1,45 @@
++"""Test the parser and generator are inverses.
++
++Note that this is only strictly true if we are parsing RFC valid messages and
++producing RFC valid messages.
++"""
++
++import io
++import unittest
++from email import policy, message_from_bytes
++from email.generator import BytesGenerator
++from test.test_email import TestEmailBase, parameterize
++
++# This is like textwrap.dedent for bytes, except that it uses \r\n for the line
++# separators on the rebuilt string.
++def dedent(bstr):
++    lines = bstr.splitlines()
++    if not lines[0].strip():
++        raise ValueError("First line must contain text")
++    stripamt = len(lines[0]) - len(lines[0].lstrip())
++    return b'\r\n'.join(
++        [x[stripamt:] if len(x)>=stripamt else b''
++            for x in lines])
++
++
++@parameterize
++class TestInversion(TestEmailBase, unittest.TestCase):
++
++    def msg_as_input(self, msg):
++        m = message_from_bytes(msg, policy=policy.SMTP)
++        b = io.BytesIO()
++        g = BytesGenerator(b)
++        g.flatten(m)
++        self.assertEqual(b.getvalue(), msg)
++
++    # XXX: spaces are not preserved correctly here yet in the general case.
++    msg_params = {
++        'header_with_one_space_body': (dedent(b"""\
++            From: abc@xyz.com
++            X-Status:\x20
++            Subject: test
++
++            foo
++            """),),
++
++            }
+diff -r bd8afb90ebf2 Lib/test/test_email/test_utils.py
+--- a/Lib/test/test_email/test_utils.py
++++ b/Lib/test/test_email/test_utils.py
+@@ -91,7 +91,7 @@
+     @test.support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
+     def test_localtime_epoch_utc_daylight_true(self):
+         test.support.patch(self, time, 'daylight', True)
+-        t0 = datetime.datetime(1970, 1, 1, tzinfo = datetime.timezone.utc)
++        t0 = datetime.datetime(1990, 1, 1, tzinfo = datetime.timezone.utc)
+         t1 = utils.localtime(t0)
+         t2 = t0 - datetime.timedelta(hours=5)
+         t2 = t2.replace(tzinfo = datetime.timezone(datetime.timedelta(hours=-5)))
+@@ -100,7 +100,7 @@
+     @test.support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
+     def test_localtime_epoch_utc_daylight_false(self):
+         test.support.patch(self, time, 'daylight', False)
+-        t0 = datetime.datetime(1970, 1, 1, tzinfo = datetime.timezone.utc)
++        t0 = datetime.datetime(1990, 1, 1, tzinfo = datetime.timezone.utc)
+         t1 = utils.localtime(t0)
+         t2 = t0 - datetime.timedelta(hours=5)
+         t2 = t2.replace(tzinfo = datetime.timezone(datetime.timedelta(hours=-5)))
+@@ -108,14 +108,14 @@
+ 
+     def test_localtime_epoch_notz_daylight_true(self):
+         test.support.patch(self, time, 'daylight', True)
+-        t0 = datetime.datetime(1970, 1, 1)
++        t0 = datetime.datetime(1990, 1, 1)
+         t1 = utils.localtime(t0)
+         t2 = utils.localtime(t0.replace(tzinfo=None))
+         self.assertEqual(t1, t2)
+ 
+     def test_localtime_epoch_notz_daylight_false(self):
+         test.support.patch(self, time, 'daylight', False)
+-        t0 = datetime.datetime(1970, 1, 1)
++        t0 = datetime.datetime(1990, 1, 1)
+         t1 = utils.localtime(t0)
+         t2 = utils.localtime(t0.replace(tzinfo=None))
+         self.assertEqual(t1, t2)
+diff -r bd8afb90ebf2 Lib/test/test_exceptions.py
+--- a/Lib/test/test_exceptions.py
++++ b/Lib/test/test_exceptions.py
+@@ -7,8 +7,9 @@
+ import weakref
+ import errno
+ 
+-from test.support import (TESTFN, unlink, run_unittest, captured_output,
+-                          gc_collect, cpython_only, no_tracing)
++from test.support import (TESTFN, captured_output, check_impl_detail,
++                          cpython_only, gc_collect, run_unittest, no_tracing,
++                          unlink)
+ 
+ class NaiveException(Exception):
+     def __init__(self, x):
+@@ -551,6 +552,9 @@
+             e.__context__ = None
+             obj = None
+             obj = wr()
++            # guarantee no ref cycles on CPython (don't gc_collect)
++            if check_impl_detail(cpython=False):
++                gc_collect()
+             self.assertTrue(obj is None, "%s" % obj)
+ 
+         # Some complicated construct
+@@ -567,6 +571,8 @@
+             except MyException:
+                 pass
+         obj = None
++        if check_impl_detail(cpython=False):
++            gc_collect()
+         obj = wr()
+         self.assertTrue(obj is None, "%s" % obj)
+ 
+@@ -581,6 +587,8 @@
+         with Context():
+             inner_raising_func()
+         obj = None
++        if check_impl_detail(cpython=False):
++            gc_collect()
+         obj = wr()
+         self.assertTrue(obj is None, "%s" % obj)
+ 
+diff -r bd8afb90ebf2 Lib/test/test_fcntl.py
+--- a/Lib/test/test_fcntl.py
++++ b/Lib/test/test_fcntl.py
+@@ -6,6 +6,7 @@
+ import os
+ import struct
+ import sys
++import _testcapi
+ import unittest
+ from test.support import verbose, TESTFN, unlink, run_unittest, import_module
+ 
+@@ -76,6 +77,26 @@
+             rv = fcntl.fcntl(self.f, fcntl.F_SETLKW, lockdata)
+         self.f.close()
+ 
++    def test_fcntl_bad_file(self):
++        class F:
++            def __init__(self, fn):
++                self.fn = fn
++            def fileno(self):
++                return self.fn
++        self.assertRaises(ValueError, fcntl.fcntl, -1, fcntl.F_SETFL, os.O_NONBLOCK)
++        self.assertRaises(ValueError, fcntl.fcntl, F(-1), fcntl.F_SETFL, os.O_NONBLOCK)
++        self.assertRaises(TypeError, fcntl.fcntl, 'spam', fcntl.F_SETFL, os.O_NONBLOCK)
++        self.assertRaises(TypeError, fcntl.fcntl, F('spam'), fcntl.F_SETFL, os.O_NONBLOCK)
++        # Issue 15989
++        self.assertRaises(OverflowError, fcntl.fcntl, _testcapi.INT_MAX + 1,
++                                                      fcntl.F_SETFL, os.O_NONBLOCK)
++        self.assertRaises(OverflowError, fcntl.fcntl, F(_testcapi.INT_MAX + 1),
++                                                      fcntl.F_SETFL, os.O_NONBLOCK)
++        self.assertRaises(OverflowError, fcntl.fcntl, _testcapi.INT_MIN - 1,
++                                                      fcntl.F_SETFL, os.O_NONBLOCK)
++        self.assertRaises(OverflowError, fcntl.fcntl, F(_testcapi.INT_MIN - 1),
++                                                      fcntl.F_SETFL, os.O_NONBLOCK)
++
+     def test_fcntl_64_bit(self):
+         # Issue #1309352: fcntl shouldn't fail when the third arg fits in a
+         # C 'long' but not in a C 'int'.
+diff -r bd8afb90ebf2 Lib/test/test_file.py
+--- a/Lib/test/test_file.py
++++ b/Lib/test/test_file.py
+@@ -10,7 +10,7 @@
+ from test.support import TESTFN, run_unittest
+ from collections import UserList
+ 
+-class AutoFileTests(unittest.TestCase):
++class AutoFileTests:
+     # file tests for which a test file is automatically set up
+ 
+     def setUp(self):
+@@ -128,14 +128,14 @@
+     def testReadWhenWriting(self):
+         self.assertRaises(IOError, self.f.read)
+ 
+-class CAutoFileTests(AutoFileTests):
++class CAutoFileTests(AutoFileTests, unittest.TestCase):
+     open = io.open
+ 
+-class PyAutoFileTests(AutoFileTests):
++class PyAutoFileTests(AutoFileTests, unittest.TestCase):
+     open = staticmethod(pyio.open)
+ 
+ 
+-class OtherFileTests(unittest.TestCase):
++class OtherFileTests:
+ 
+     def testModeStrings(self):
+         # check invalid mode strings
+@@ -322,22 +322,18 @@
+         finally:
+             os.unlink(TESTFN)
+ 
+-class COtherFileTests(OtherFileTests):
++class COtherFileTests(OtherFileTests, unittest.TestCase):
+     open = io.open
+ 
+-class PyOtherFileTests(OtherFileTests):
++class PyOtherFileTests(OtherFileTests, unittest.TestCase):
+     open = staticmethod(pyio.open)
+ 
+ 
+-def test_main():
++def tearDownModule():
+     # Historically, these tests have been sloppy about removing TESTFN.
+     # So get rid of it no matter what.
+-    try:
+-        run_unittest(CAutoFileTests, PyAutoFileTests,
+-                     COtherFileTests, PyOtherFileTests)
+-    finally:
+-        if os.path.exists(TESTFN):
+-            os.unlink(TESTFN)
++    if os.path.exists(TESTFN):
++        os.unlink(TESTFN)
+ 
+ if __name__ == '__main__':
+-    test_main()
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_fileio.py
+--- a/Lib/test/test_fileio.py
++++ b/Lib/test/test_fileio.py
+@@ -8,8 +8,10 @@
+ from array import array
+ from weakref import proxy
+ from functools import wraps
++import _testcapi
+ 
+ from test.support import TESTFN, check_warnings, run_unittest, make_bad_fd
++from collections import UserList
+ 
+ from _io import FileIO as _FileIO
+ 
+@@ -68,6 +70,27 @@
+         n = self.f.readinto(a)
+         self.assertEqual(array('b', [1, 2]), a[:n])
+ 
++    def testWritelinesList(self):
++        l = [b'123', b'456']
++        self.f.writelines(l)
++        self.f.close()
++        self.f = _FileIO(TESTFN, 'rb')
++        buf = self.f.read()
++        self.assertEqual(buf, b'123456')
++
++    def testWritelinesUserList(self):
++        l = UserList([b'123', b'456'])
++        self.f.writelines(l)
++        self.f.close()
++        self.f = _FileIO(TESTFN, 'rb')
++        buf = self.f.read()
++        self.assertEqual(buf, b'123456')
++
++    def testWritelinesError(self):
++        self.assertRaises(TypeError, self.f.writelines, [1, 2, 3])
++        self.assertRaises(TypeError, self.f.writelines, None)
++        self.assertRaises(TypeError, self.f.writelines, "abc")
++
+     def test_none_args(self):
+         self.f.write(b"hi\nbye\nabc")
+         self.f.close()
+@@ -325,6 +348,9 @@
+         if sys.platform == 'win32':
+             import msvcrt
+             self.assertRaises(IOError, msvcrt.get_osfhandle, make_bad_fd())
++        # Issue 15989
++        self.assertRaises(TypeError, _FileIO, _testcapi.INT_MAX + 1)
++        self.assertRaises(TypeError, _FileIO, _testcapi.INT_MIN - 1)
+ 
+     def testBadModeArgument(self):
+         # verify that we get a sensible error message for bad mode argument
+diff -r bd8afb90ebf2 Lib/test/test_ftplib.py
+--- a/Lib/test/test_ftplib.py
++++ b/Lib/test/test_ftplib.py
+@@ -342,7 +342,7 @@
+                 # http://www.mail-archive.com/openssl-users@openssl.org/msg60710.html
+                 pass
+             self._ssl_closing = False
+-            if getattr(self, '_ccc', False) == False:
++            if getattr(self, '_ccc', False) is False:
+                 super(SSLConnection, self).close()
+             else:
+                 pass
+@@ -896,39 +896,40 @@
+     def setUp(self):
+         self.evt = threading.Event()
+         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+-        self.sock.settimeout(10)
++        self.sock.settimeout(20)
+         self.port = support.bind_port(self.sock)
+-        threading.Thread(target=self.server, args=(self.evt,self.sock)).start()
++        self.server_thread = threading.Thread(target=self.server)
++        self.server_thread.start()
+         # Wait for the server to be ready.
+         self.evt.wait()
+         self.evt.clear()
++        self.old_port = ftplib.FTP.port
+         ftplib.FTP.port = self.port
+ 
+     def tearDown(self):
+-        self.evt.wait()
+-        self.sock.close()
++        ftplib.FTP.port = self.old_port
++        self.server_thread.join()
+ 
+-    def server(self, evt, serv):
++    def server(self):
+         # This method sets the evt 3 times:
+         #  1) when the connection is ready to be accepted.
+         #  2) when it is safe for the caller to close the connection
+         #  3) when we have closed the socket
+-        serv.listen(5)
++        self.sock.listen(5)
+         # (1) Signal the caller that we are ready to accept the connection.
+-        evt.set()
++        self.evt.set()
+         try:
+-            conn, addr = serv.accept()
++            conn, addr = self.sock.accept()
+         except socket.timeout:
+             pass
+         else:
+-            conn.send(b"1 Hola mundo\n")
++            conn.sendall(b"1 Hola mundo\n")
++            conn.shutdown(socket.SHUT_WR)
+             # (2) Signal the caller that it is safe to close the socket.
+-            evt.set()
++            self.evt.set()
+             conn.close()
+         finally:
+-            serv.close()
+-            # (3) Signal the caller that we are done.
+-            evt.set()
++            self.sock.close()
+ 
+     def testTimeoutDefault(self):
+         # default -- use global socket timeout
+diff -r bd8afb90ebf2 Lib/test/test_functools.py
+--- a/Lib/test/test_functools.py
++++ b/Lib/test/test_functools.py
+@@ -179,6 +179,25 @@
+         f_copy = pickle.loads(pickle.dumps(f))
+         self.assertEqual(signature(f), signature(f_copy))
+ 
++    # Issue 6083: Reference counting bug
++    def test_setstate_refcount(self):
++        class BadSequence:
++            def __len__(self):
++                return 4
++            def __getitem__(self, key):
++                if key == 0:
++                    return max
++                elif key == 1:
++                    return tuple(range(1000000))
++                elif key in (2, 3):
++                    return {}
++                raise IndexError
++
++        f = self.thetype(object)
++        self.assertRaisesRegex(SystemError,
++                "new style getargs format but argument is not a tuple",
++                f.__setstate__, BadSequence())
++
+ class PartialSubclass(functools.partial):
+     pass
+ 
+@@ -195,6 +214,7 @@
+ 
+     # the python version isn't picklable
+     def test_pickle(self): pass
++    def test_setstate_refcount(self): pass
+ 
+ class TestUpdateWrapper(unittest.TestCase):
+ 
+@@ -290,6 +310,7 @@
+         with self.assertRaises(AttributeError):
+             functools.update_wrapper(wrapper, f, assign, update)
+ 
++    @support.requires_docstrings
+     @unittest.skipIf(sys.flags.optimize >= 2,
+                      "Docstrings are omitted with -O2 and above")
+     def test_builtin_update(self):
+@@ -320,7 +341,7 @@
+         self.assertEqual(wrapper.__qualname__, f.__qualname__)
+         self.assertEqual(wrapper.attr, 'This is also a test')
+ 
+-    @unittest.skipIf(not sys.flags.optimize <= 1,
++    @unittest.skipIf(sys.flags.optimize >= 2,
+                      "Docstrings are omitted with -O2 and above")
+     def test_default_update_doc(self):
+         wrapper, _ = self._default_update()
+diff -r bd8afb90ebf2 Lib/test/test_gdb.py
+--- a/Lib/test/test_gdb.py
++++ b/Lib/test/test_gdb.py
+@@ -26,42 +26,58 @@
+     # This is what "no gdb" looks like.  There may, however, be other
+     # errors that manifest this way too.
+     raise unittest.SkipTest("Couldn't find gdb on the path")
+-gdb_version_number = re.search(b"^GNU gdb [^\d]*(\d+)\.", gdb_version)
+-if int(gdb_version_number.group(1)) < 7:
++gdb_version_number = re.search(b"^GNU gdb [^\d]*(\d+)\.(\d)", gdb_version)
++gdb_major_version = int(gdb_version_number.group(1))
++gdb_minor_version = int(gdb_version_number.group(2))
++if gdb_major_version < 7:
+     raise unittest.SkipTest("gdb versions before 7.0 didn't support python embedding"
+                             " Saw:\n" + gdb_version.decode('ascii', 'replace'))
+ 
+ if not sysconfig.is_python_build():
+     raise unittest.SkipTest("test_gdb only works on source builds at the moment.")
+ 
++# Location of custom hooks file in a repository checkout.
++checkout_hook_path = os.path.join(os.path.dirname(sys.executable),
++                                  'python-gdb.py')
++
++def run_gdb(*args, **env_vars):
++    """Runs gdb in --batch mode with the additional arguments given by *args.
++
++    Returns its (stdout, stderr) decoded from utf-8 using the replace handler.
++    """
++    if env_vars:
++        env = os.environ.copy()
++        env.update(env_vars)
++    else:
++        env = None
++    base_cmd = ('gdb', '--batch')
++    if (gdb_major_version, gdb_minor_version) >= (7, 4):
++        base_cmd += ('-iex', 'add-auto-load-safe-path ' + checkout_hook_path)
++    out, err = subprocess.Popen(base_cmd + args,
++        stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env,
++        ).communicate()
++    return out.decode('utf-8', 'replace'), err.decode('utf-8', 'replace')
++
+ # Verify that "gdb" was built with the embedded python support enabled:
+-cmd = "--eval-command=python import sys; print sys.version_info"
+-p = subprocess.Popen(["gdb", "--batch", cmd],
+-                     stdout=subprocess.PIPE)
+-gdbpy_version, _ = p.communicate()
+-if gdbpy_version == b'':
++gdbpy_version, _ = run_gdb("--eval-command=python import sys; print sys.version_info")
++if not gdbpy_version:
+     raise unittest.SkipTest("gdb not built with embedded python support")
+ 
+-# Verify that "gdb" can load our custom hooks
+-p = subprocess.Popen(["gdb", "--batch", cmd,
+-                      "--args", sys.executable],
+-                     stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+-__, gdbpy_errors = p.communicate()
+-if b"auto-loading has been declined" in gdbpy_errors:
+-    msg = "gdb security settings prevent use of custom hooks: %s"
+-    raise unittest.SkipTest(msg % gdbpy_errors)
++# Verify that "gdb" can load our custom hooks. In theory this should never fail.
++cmd = ['--args', sys.executable]
++_, gdbpy_errors = run_gdb('--args', sys.executable)
++if "auto-loading has been declined" in gdbpy_errors:
++    msg = "gdb security settings prevent use of custom hooks: "
++    raise unittest.SkipTest(msg + gdbpy_errors.rstrip())
+ 
+ def gdb_has_frame_select():
+     # Does this build of gdb have gdb.Frame.select ?
+-    cmd = "--eval-command=python print(dir(gdb.Frame))"
+-    p = subprocess.Popen(["gdb", "--batch", cmd],
+-                         stdout=subprocess.PIPE)
+-    stdout, _ = p.communicate()
+-    m = re.match(br'.*\[(.*)\].*', stdout)
++    stdout, _ = run_gdb("--eval-command=python print(dir(gdb.Frame))")
++    m = re.match(r'.*\[(.*)\].*', stdout)
+     if not m:
+         raise unittest.SkipTest("Unable to parse output from gdb.Frame.select test")
+-    gdb_frame_dir = m.group(1).split(b', ')
+-    return b"'select'" in gdb_frame_dir
++    gdb_frame_dir = m.group(1).split(', ')
++    return "'select'" in gdb_frame_dir
+ 
+ HAS_PYUP_PYDOWN = gdb_has_frame_select()
+ 
+@@ -71,21 +87,6 @@
+ 
+     """Test that the debugger can debug Python."""
+ 
+-    def run_gdb(self, *args, **env_vars):
+-        """Runs gdb with the command line given by *args.
+-
+-        Returns its stdout, stderr
+-        """
+-        if env_vars:
+-            env = os.environ.copy()
+-            env.update(env_vars)
+-        else:
+-            env = None
+-        out, err = subprocess.Popen(
+-            args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env,
+-            ).communicate()
+-        return out.decode('utf-8', 'replace'), err.decode('utf-8', 'replace')
+-
+     def get_stack_trace(self, source=None, script=None,
+                         breakpoint=BREAKPOINT_FN,
+                         cmds_after_breakpoint=None,
+@@ -142,7 +143,7 @@
+         # print ' '.join(args)
+ 
+         # Use "args" to invoke gdb, capturing stdout, stderr:
+-        out, err = self.run_gdb(*args, PYTHONHASHSEED='0')
++        out, err = run_gdb(*args, PYTHONHASHSEED='0')
+ 
+         # Ignore some noise on stderr due to the pending breakpoint:
+         err = err.replace('Function "%s" not defined.\n' % breakpoint, '')
+@@ -154,6 +155,16 @@
+         err = err.replace("warning: Cannot initialize thread debugging"
+                           " library: Debugger service failed\n",
+                           '')
++        err = err.replace('warning: Could not load shared library symbols for '
++                          'linux-vdso.so.1.\n'
++                          'Do you need "set solib-search-path" or '
++                          '"set sysroot"?\n',
++                          '')
++        err = err.replace('warning: Could not load shared library symbols for '
++                          'linux-gate.so.1.\n'
++                          'Do you need "set solib-search-path" or '
++                          '"set sysroot"?\n',
++                          '')
+ 
+         # Ensure no unexpected error messages:
+         self.assertEqual(err, '')
+diff -r bd8afb90ebf2 Lib/test/test_generators.py
+--- a/Lib/test/test_generators.py
++++ b/Lib/test/test_generators.py
+@@ -383,7 +383,8 @@
+ <class 'generator'>
+ >>> [s for s in dir(i) if not s.startswith('_')]
+ ['close', 'gi_code', 'gi_frame', 'gi_running', 'send', 'throw']
+->>> print(i.__next__.__doc__)
++>>> from test.support import HAVE_DOCSTRINGS
++>>> print(i.__next__.__doc__ if HAVE_DOCSTRINGS else 'x.__next__() <==> next(x)')
+ x.__next__() <==> next(x)
+ >>> iter(i) is i
+ True
+diff -r bd8afb90ebf2 Lib/test/test_genericpath.py
+--- a/Lib/test/test_genericpath.py
++++ b/Lib/test/test_genericpath.py
+@@ -17,9 +17,7 @@
+         pass
+ 
+ 
+-class GenericTest(unittest.TestCase):
+-    # The path module to be tested
+-    pathmodule = genericpath
++class GenericTest:
+     common_attributes = ['commonprefix', 'getsize', 'getatime', 'getctime',
+                          'getmtime', 'exists', 'isdir', 'isfile']
+     attributes = []
+@@ -190,13 +188,16 @@
+             support.unlink(support.TESTFN)
+             safe_rmdir(support.TESTFN)
+ 
++class TestGenericTest(GenericTest, unittest.TestCase):
++    # Issue 16852: GenericTest can't inherit from unittest.TestCase
++    # for test discovery purposes; CommonTest inherits from GenericTest
++    # and is only meant to be inherited by others.
++    pathmodule = genericpath
+ 
+ # Following TestCase is not supposed to be run from test_genericpath.
+ # It is inherited by other test modules (macpath, ntpath, posixpath).
+ 
+ class CommonTest(GenericTest):
+-    # The path module to be tested
+-    pathmodule = None
+     common_attributes = GenericTest.common_attributes + [
+         # Properties
+         'curdir', 'pardir', 'extsep', 'sep',
+@@ -308,17 +309,18 @@
+                 for path in ('', 'fuu', 'f\xf9\xf9', '/fuu', 'U:\\'):
+                     self.assertIsInstance(abspath(path), str)
+ 
+-    @unittest.skipIf(sys.platform == 'darwin',
+-        "Mac OS X denies the creation of a directory with an invalid utf8 name")
+     def test_nonascii_abspath(self):
+-        name = b'\xe7w\xf0'
+-        if sys.platform == 'win32':
+-            try:
+-                os.fsdecode(name)
+-            except UnicodeDecodeError:
+-                self.skipTest("the filename %a is not decodable "
+-                              "from the ANSI code page %s"
+-                              % (name, sys.getfilesystemencoding()))
++        if (support.TESTFN_UNDECODABLE
++        # Mac OS X denies the creation of a directory with an invalid
++        # UTF-8 name. Windows allows to create a directory with an
++        # arbitrary bytes name, but fails to enter this directory
++        # (when the bytes name is used).
++        and sys.platform not in ('win32', 'darwin')):
++            name = support.TESTFN_UNDECODABLE
++        elif support.TESTFN_NONASCII:
++            name = support.TESTFN_NONASCII
++        else:
++            self.skipTest("need support.TESTFN_NONASCII")
+ 
+         # Test non-ASCII, non-UTF8 bytes in the path.
+         with warnings.catch_warnings():
+@@ -327,9 +329,5 @@
+                 self.test_abspath()
+ 
+ 
+-def test_main():
+-    support.run_unittest(GenericTest)
+-
+-
+ if __name__=="__main__":
+-    test_main()
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_genexps.py
+--- a/Lib/test/test_genexps.py
++++ b/Lib/test/test_genexps.py
+@@ -221,7 +221,8 @@
+     >>> set(attr for attr in dir(g) if not attr.startswith('__')) >= expected
+     True
+ 
+-    >>> print(g.__next__.__doc__)
++    >>> from test.support import HAVE_DOCSTRINGS
++    >>> print(g.__next__.__doc__ if HAVE_DOCSTRINGS else 'x.__next__() <==> next(x)')
+     x.__next__() <==> next(x)
+     >>> import types
+     >>> isinstance(g, types.GeneratorType)
+diff -r bd8afb90ebf2 Lib/test/test_glob.py
+--- a/Lib/test/test_glob.py
++++ b/Lib/test/test_glob.py
+@@ -1,9 +1,12 @@
+-import unittest
+-from test.support import (run_unittest, TESTFN, skip_unless_symlink,
+-    can_symlink, create_empty_file)
+ import glob
+ import os
+ import shutil
++import sys
++import unittest
++
++from test.support import (run_unittest, TESTFN, skip_unless_symlink,
++                          can_symlink, create_empty_file)
++
+ 
+ class GlobTests(unittest.TestCase):
+ 
+@@ -18,16 +21,19 @@
+         create_empty_file(filename)
+ 
+     def setUp(self):
+-        self.tempdir = TESTFN+"_dir"
++        self.tempdir = TESTFN + "_dir"
+         self.mktemp('a', 'D')
+         self.mktemp('aab', 'F')
++        self.mktemp('.aa', 'G')
++        self.mktemp('.bb', 'H')
+         self.mktemp('aaa', 'zzzF')
+         self.mktemp('ZZZ')
+         self.mktemp('a', 'bcd', 'EF')
+         self.mktemp('a', 'bcd', 'efg', 'ha')
+         if can_symlink():
+             os.symlink(self.norm('broken'), self.norm('sym1'))
+-            os.symlink(self.norm('broken'), self.norm('sym2'))
++            os.symlink('broken', self.norm('sym2'))
++            os.symlink(os.path.join('a', 'bcd'), self.norm('sym3'))
+ 
+     def tearDown(self):
+         shutil.rmtree(self.tempdir)
+@@ -40,10 +46,16 @@
+         p = os.path.join(self.tempdir, pattern)
+         res = glob.glob(p)
+         self.assertEqual(list(glob.iglob(p)), res)
++        bres = [os.fsencode(x) for x in res]
++        self.assertEqual(glob.glob(os.fsencode(p)), bres)
++        self.assertEqual(list(glob.iglob(os.fsencode(p))), bres)
+         return res
+ 
+     def assertSequencesEqual_noorder(self, l1, l2):
++        l1 = list(l1)
++        l2 = list(l2)
+         self.assertEqual(set(l1), set(l2))
++        self.assertEqual(sorted(l1), sorted(l2))
+ 
+     def test_glob_literal(self):
+         eq = self.assertSequencesEqual_noorder
+@@ -52,20 +64,22 @@
+         eq(self.glob('aab'), [self.norm('aab')])
+         eq(self.glob('zymurgy'), [])
+ 
+-        # test return types are unicode, but only if os.listdir
+-        # returns unicode filenames
+-        uniset = set([str])
+-        tmp = os.listdir('.')
+-        if set(type(x) for x in tmp) == uniset:
+-            u1 = glob.glob('*')
+-            u2 = glob.glob('./*')
+-            self.assertEqual(set(type(r) for r in u1), uniset)
+-            self.assertEqual(set(type(r) for r in u2), uniset)
++        res = glob.glob('*')
++        self.assertEqual({type(r) for r in res}, {str})
++        res = glob.glob(os.path.join(os.curdir, '*'))
++        self.assertEqual({type(r) for r in res}, {str})
++
++        res = glob.glob(b'*')
++        self.assertEqual({type(r) for r in res}, {bytes})
++        res = glob.glob(os.path.join(os.fsencode(os.curdir), b'*'))
++        self.assertEqual({type(r) for r in res}, {bytes})
+ 
+     def test_glob_one_directory(self):
+         eq = self.assertSequencesEqual_noorder
+         eq(self.glob('a*'), map(self.norm, ['a', 'aab', 'aaa']))
+         eq(self.glob('*a'), map(self.norm, ['a', 'aaa']))
++        eq(self.glob('.*'), map(self.norm, ['.aa', '.bb']))
++        eq(self.glob('?aa'), map(self.norm, ['aaa']))
+         eq(self.glob('aa?'), map(self.norm, ['aaa', 'aab']))
+         eq(self.glob('aa[ab]'), map(self.norm, ['aaa', 'aab']))
+         eq(self.glob('*q'), [])
+@@ -87,24 +101,74 @@
+         eq(self.glob('*', '*a'), [])
+         eq(self.glob('a', '*', '*', '*a'),
+            [self.norm('a', 'bcd', 'efg', 'ha')])
+-        eq(self.glob('?a?', '*F'), map(self.norm, [os.path.join('aaa', 'zzzF'),
+-                                                   os.path.join('aab', 'F')]))
++        eq(self.glob('?a?', '*F'), [self.norm('aaa', 'zzzF'),
++                                    self.norm('aab', 'F')])
+ 
+     def test_glob_directory_with_trailing_slash(self):
+-        # We are verifying that when there is wildcard pattern which
+-        # ends with os.sep doesn't blow up.
+-        res = glob.glob(self.tempdir + '*' + os.sep)
+-        self.assertEqual(len(res), 1)
+-        # either of these results are reasonable
+-        self.assertIn(res[0], [self.tempdir, self.tempdir + os.sep])
++        # Patterns ending with a slash shouldn't match non-dirs
++        res = glob.glob(self.norm('Z*Z') + os.sep)
++        self.assertEqual(res, [])
++        res = glob.glob(self.norm('ZZZ') + os.sep)
++        self.assertEqual(res, [])
++        # When there is a wildcard pattern which ends with os.sep, glob()
++        # doesn't blow up.
++        res = glob.glob(self.norm('aa*') + os.sep)
++        self.assertEqual(len(res), 2)
++        # either of these results is reasonable
++        self.assertIn(set(res), [
++                      {self.norm('aaa'), self.norm('aab')},
++                      {self.norm('aaa') + os.sep, self.norm('aab') + os.sep},
++                      ])
++
++    def test_glob_bytes_directory_with_trailing_slash(self):
++        # Same as test_glob_directory_with_trailing_slash, but with a
++        # bytes argument.
++        res = glob.glob(os.fsencode(self.norm('Z*Z') + os.sep))
++        self.assertEqual(res, [])
++        res = glob.glob(os.fsencode(self.norm('ZZZ') + os.sep))
++        self.assertEqual(res, [])
++        res = glob.glob(os.fsencode(self.norm('aa*') + os.sep))
++        self.assertEqual(len(res), 2)
++        # either of these results is reasonable
++        self.assertIn(set(res), [
++                      {os.fsencode(self.norm('aaa')),
++                       os.fsencode(self.norm('aab'))},
++                      {os.fsencode(self.norm('aaa') + os.sep),
++                       os.fsencode(self.norm('aab') + os.sep)},
++                      ])
++
++    @skip_unless_symlink
++    def test_glob_symlinks(self):
++        eq = self.assertSequencesEqual_noorder
++        eq(self.glob('sym3'), [self.norm('sym3')])
++        eq(self.glob('sym3', '*'), [self.norm('sym3', 'EF'),
++                                    self.norm('sym3', 'efg')])
++        self.assertIn(self.glob('sym3' + os.sep),
++                      [[self.norm('sym3')], [self.norm('sym3') + os.sep]])
++        eq(self.glob('*', '*F'),
++           [self.norm('aaa', 'zzzF'),
++            self.norm('aab', 'F'), self.norm('sym3', 'EF')])
+ 
+     @skip_unless_symlink
+     def test_glob_broken_symlinks(self):
+         eq = self.assertSequencesEqual_noorder
+-        eq(self.glob('sym*'), [self.norm('sym1'), self.norm('sym2')])
++        eq(self.glob('sym*'), [self.norm('sym1'), self.norm('sym2'),
++                               self.norm('sym3')])
+         eq(self.glob('sym1'), [self.norm('sym1')])
+         eq(self.glob('sym2'), [self.norm('sym2')])
+ 
++    @unittest.skipUnless(sys.platform == "win32", "Win32 specific test")
++    def test_glob_magic_in_drive(self):
++        eq = self.assertSequencesEqual_noorder
++        eq(glob.glob('*:'), [])
++        eq(glob.glob(b'*:'), [])
++        eq(glob.glob('?:'), [])
++        eq(glob.glob(b'?:'), [])
++        eq(glob.glob('\\\\?\\c:\\'), ['\\\\?\\c:\\'])
++        eq(glob.glob(b'\\\\?\\c:\\'), [b'\\\\?\\c:\\'])
++        eq(glob.glob('\\\\*\\*\\'), [])
++        eq(glob.glob(b'\\\\*\\*\\'), [])
++
+ 
+ def test_main():
+     run_unittest(GlobTests)
+diff -r bd8afb90ebf2 Lib/test/test_gzip.py
+--- a/Lib/test/test_gzip.py
++++ b/Lib/test/test_gzip.py
+@@ -389,6 +389,20 @@
+             datac = gzip.compress(data)
+             self.assertEqual(gzip.decompress(datac), data)
+ 
++    def test_read_truncated(self):
++        data = data1*50
++        # Drop the CRC (4 bytes) and file size (4 bytes).
++        truncated = gzip.compress(data)[:-8]
++        with gzip.GzipFile(fileobj=io.BytesIO(truncated)) as f:
++            self.assertRaises(EOFError, f.read)
++        with gzip.GzipFile(fileobj=io.BytesIO(truncated)) as f:
++            self.assertEqual(f.read(len(data)), data)
++            self.assertRaises(EOFError, f.read, 1)
++        # Incomplete 10-byte header.
++        for i in range(2, 10):
++            with gzip.GzipFile(fileobj=io.BytesIO(truncated[:i])) as f:
++                self.assertRaises(EOFError, f.read, 1)
++
+ 
+ class TestOpen(BaseTest):
+     def test_binary_modes(self):
+diff -r bd8afb90ebf2 Lib/test/test_hash.py
+--- a/Lib/test/test_hash.py
++++ b/Lib/test/test_hash.py
+@@ -45,6 +45,16 @@
+         self.same_hash(int(1.23e300), float(1.23e300))
+         self.same_hash(float(0.5), complex(0.5, 0.0))
+ 
++    def test_unaligned_buffers(self):
++        # The hash function for bytes-like objects shouldn't have
++        # alignment-dependent results (example in issue #16427).
++        b = b"123456789abcdefghijklmnopqrstuvwxyz" * 128
++        for i in range(16):
++            for j in range(16):
++                aligned = b[i:128+j]
++                unaligned = memoryview(b)[i:128+j]
++                self.assertEqual(hash(aligned), hash(unaligned))
++
+ 
+ _default_hash = object.__hash__
+ class DefaultHash(object): pass
+diff -r bd8afb90ebf2 Lib/test/test_heapq.py
+--- a/Lib/test/test_heapq.py
++++ b/Lib/test/test_heapq.py
+@@ -2,6 +2,7 @@
+ 
+ import sys
+ import random
++import unittest
+ 
+ from test import support
+ from unittest import TestCase, skipUnless
+@@ -25,8 +26,7 @@
+             self.assertEqual(getattr(c_heapq, fname).__module__, '_heapq')
+ 
+ 
+-class TestHeap(TestCase):
+-    module = None
++class TestHeap:
+ 
+     def test_push_pop(self):
+         # 1) Push 256 random numbers and pop them off, verifying all's OK.
+@@ -214,12 +214,12 @@
+         self.assertRaises(TypeError, data, LE)
+ 
+ 
+-class TestHeapPython(TestHeap):
++class TestHeapPython(TestHeap, TestCase):
+     module = py_heapq
+ 
+ 
+ @skipUnless(c_heapq, 'requires _heapq')
+-class TestHeapC(TestHeap):
++class TestHeapC(TestHeap, TestCase):
+     module = c_heapq
+ 
+ 
+@@ -319,8 +319,7 @@
+     return chain(map(lambda x:x, R(Ig(G(seqn)))))
+ 
+ 
+-class TestErrorHandling(TestCase):
+-    module = None
++class TestErrorHandling:
+ 
+     def test_non_sequence(self):
+         for f in (self.module.heapify, self.module.heappop):
+@@ -371,31 +370,13 @@
+                 self.assertRaises(ZeroDivisionError, f, 2, E(s))
+ 
+ 
+-class TestErrorHandlingPython(TestErrorHandling):
++class TestErrorHandlingPython(TestErrorHandling, TestCase):
+     module = py_heapq
+ 
+ @skipUnless(c_heapq, 'requires _heapq')
+-class TestErrorHandlingC(TestErrorHandling):
++class TestErrorHandlingC(TestErrorHandling, TestCase):
+     module = c_heapq
+ 
+ 
+-#==============================================================================
+-
+-
+-def test_main(verbose=None):
+-    test_classes = [TestModules, TestHeapPython, TestHeapC,
+-                    TestErrorHandlingPython, TestErrorHandlingC]
+-    support.run_unittest(*test_classes)
+-
+-    # verify reference counting
+-    if verbose and hasattr(sys, "gettotalrefcount"):
+-        import gc
+-        counts = [None] * 5
+-        for i in range(len(counts)):
+-            support.run_unittest(*test_classes)
+-            gc.collect()
+-            counts[i] = sys.gettotalrefcount()
+-        print(counts)
+-
+ if __name__ == "__main__":
+-    test_main(verbose=True)
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_httplib.py
+--- a/Lib/test/test_httplib.py
++++ b/Lib/test/test_httplib.py
+@@ -164,6 +164,9 @@
+         resp.begin()
+         self.assertEqual(resp.read(), b"Text")
+         self.assertTrue(resp.isclosed())
++        self.assertFalse(resp.closed)
++        resp.close()
++        self.assertTrue(resp.closed)
+ 
+         body = "HTTP/1.1 400.100 Not Ok\r\n\r\nText"
+         sock = FakeSocket(body)
+@@ -175,7 +178,7 @@
+         self.assertEqual(repr(exc), '''BadStatusLine("\'\'",)''')
+ 
+     def test_partial_reads(self):
+-        # if we have a lenght, the system knows when to close itself
++        # if we have a length, the system knows when to close itself
+         # same behaviour than when we read the whole thing with read()
+         body = "HTTP/1.1 200 Ok\r\nContent-Length: 4\r\n\r\nText"
+         sock = FakeSocket(body)
+@@ -185,9 +188,12 @@
+         self.assertFalse(resp.isclosed())
+         self.assertEqual(resp.read(2), b'xt')
+         self.assertTrue(resp.isclosed())
++        self.assertFalse(resp.closed)
++        resp.close()
++        self.assertTrue(resp.closed)
+ 
+     def test_partial_readintos(self):
+-        # if we have a lenght, the system knows when to close itself
++        # if we have a length, the system knows when to close itself
+         # same behaviour than when we read the whole thing with read()
+         body = "HTTP/1.1 200 Ok\r\nContent-Length: 4\r\n\r\nText"
+         sock = FakeSocket(body)
+@@ -202,6 +208,79 @@
+         self.assertEqual(n, 2)
+         self.assertEqual(bytes(b), b'xt')
+         self.assertTrue(resp.isclosed())
++        self.assertFalse(resp.closed)
++        resp.close()
++        self.assertTrue(resp.closed)
++
++    def test_partial_reads_no_content_length(self):
++        # when no length is present, the socket should be gracefully closed when
++        # all data was read
++        body = "HTTP/1.1 200 Ok\r\n\r\nText"
++        sock = FakeSocket(body)
++        resp = client.HTTPResponse(sock)
++        resp.begin()
++        self.assertEqual(resp.read(2), b'Te')
++        self.assertFalse(resp.isclosed())
++        self.assertEqual(resp.read(2), b'xt')
++        self.assertEqual(resp.read(1), b'')
++        self.assertTrue(resp.isclosed())
++        self.assertFalse(resp.closed)
++        resp.close()
++        self.assertTrue(resp.closed)
++
++    def test_partial_readintos_no_content_length(self):
++        # when no length is present, the socket should be gracefully closed when
++        # all data was read
++        body = "HTTP/1.1 200 Ok\r\n\r\nText"
++        sock = FakeSocket(body)
++        resp = client.HTTPResponse(sock)
++        resp.begin()
++        b = bytearray(2)
++        n = resp.readinto(b)
++        self.assertEqual(n, 2)
++        self.assertEqual(bytes(b), b'Te')
++        self.assertFalse(resp.isclosed())
++        n = resp.readinto(b)
++        self.assertEqual(n, 2)
++        self.assertEqual(bytes(b), b'xt')
++        n = resp.readinto(b)
++        self.assertEqual(n, 0)
++        self.assertTrue(resp.isclosed())
++
++    def test_partial_reads_incomplete_body(self):
++        # if the server shuts down the connection before the whole
++        # content-length is delivered, the socket is gracefully closed
++        body = "HTTP/1.1 200 Ok\r\nContent-Length: 10\r\n\r\nText"
++        sock = FakeSocket(body)
++        resp = client.HTTPResponse(sock)
++        resp.begin()
++        self.assertEqual(resp.read(2), b'Te')
++        self.assertFalse(resp.isclosed())
++        self.assertEqual(resp.read(2), b'xt')
++        self.assertEqual(resp.read(1), b'')
++        self.assertTrue(resp.isclosed())
++
++    def test_partial_readintos_incomplete_body(self):
++        # if the server shuts down the connection before the whole
++        # content-length is delivered, the socket is gracefully closed
++        body = "HTTP/1.1 200 Ok\r\nContent-Length: 10\r\n\r\nText"
++        sock = FakeSocket(body)
++        resp = client.HTTPResponse(sock)
++        resp.begin()
++        b = bytearray(2)
++        n = resp.readinto(b)
++        self.assertEqual(n, 2)
++        self.assertEqual(bytes(b), b'Te')
++        self.assertFalse(resp.isclosed())
++        n = resp.readinto(b)
++        self.assertEqual(n, 2)
++        self.assertEqual(bytes(b), b'xt')
++        n = resp.readinto(b)
++        self.assertEqual(n, 0)
++        self.assertTrue(resp.isclosed())
++        self.assertFalse(resp.closed)
++        resp.close()
++        self.assertTrue(resp.closed)
+ 
+     def test_host_port(self):
+         # Check invalid host_port
+@@ -429,6 +508,9 @@
+         self.assertEqual(resp.status, 200)
+         self.assertEqual(resp.reason, 'OK')
+         self.assertTrue(resp.isclosed())
++        self.assertFalse(resp.closed)
++        resp.close()
++        self.assertTrue(resp.closed)
+ 
+     def test_readinto_chunked_head(self):
+         chunked_start = (
+@@ -449,6 +531,9 @@
+         self.assertEqual(resp.status, 200)
+         self.assertEqual(resp.reason, 'OK')
+         self.assertTrue(resp.isclosed())
++        self.assertFalse(resp.closed)
++        resp.close()
++        self.assertTrue(resp.closed)
+ 
+     def test_negative_content_length(self):
+         sock = FakeSocket(
+@@ -456,7 +541,7 @@
+         resp = client.HTTPResponse(sock, method="GET")
+         resp.begin()
+         self.assertEqual(resp.read(), b'Hello\r\n')
+-        resp.close()
++        self.assertTrue(resp.isclosed())
+ 
+     def test_incomplete_read(self):
+         sock = FakeSocket('HTTP/1.1 200 OK\r\nContent-Length: 10\r\n\r\nHello\r\n')
+@@ -470,10 +555,9 @@
+                              "IncompleteRead(7 bytes read, 3 more expected)")
+             self.assertEqual(str(i),
+                              "IncompleteRead(7 bytes read, 3 more expected)")
++            self.assertTrue(resp.isclosed())
+         else:
+             self.fail('IncompleteRead expected')
+-        finally:
+-            resp.close()
+ 
+     def test_epipe(self):
+         sock = EPipeSocket(
+@@ -525,6 +609,9 @@
+         resp.begin()
+         self.assertEqual(resp.read(), b'')
+         self.assertTrue(resp.isclosed())
++        self.assertFalse(resp.closed)
++        resp.close()
++        self.assertTrue(resp.closed)
+ 
+ class OfflineTest(TestCase):
+     def test_responses(self):
+diff -r bd8afb90ebf2 Lib/test/test_httpservers.py
+--- a/Lib/test/test_httpservers.py
++++ b/Lib/test/test_httpservers.py
+@@ -62,6 +62,7 @@
+ 
+     def tearDown(self):
+         self.thread.stop()
++        self.thread = None
+         os.environ.__exit__()
+         support.threading_cleanup(*self._threads)
+ 
+@@ -339,8 +340,7 @@
+             self.pythonexe.encode('utf-8')
+         except UnicodeEncodeError:
+             self.tearDown()
+-            raise self.skipTest(
+-                "Python executable path is not encodable to utf-8")
++            self.skipTest("Python executable path is not encodable to utf-8")
+ 
+         self.file1_path = os.path.join(self.cgi_dir, 'file1.py')
+         with open(self.file1_path, 'w', encoding='utf-8') as file1:
+diff -r bd8afb90ebf2 Lib/test/test_imaplib.py
+--- a/Lib/test/test_imaplib.py
++++ b/Lib/test/test_imaplib.py
+@@ -94,14 +94,25 @@
+ class SimpleIMAPHandler(socketserver.StreamRequestHandler):
+ 
+     timeout = 1
++    continuation = None
++    capabilities = ''
+ 
+     def _send(self, message):
+         if verbose: print("SENT: %r" % message.strip())
+         self.wfile.write(message)
+ 
++    def _send_line(self, message):
++        self._send(message + b'\r\n')
++
++    def _send_textline(self, message):
++        self._send_line(message.encode('ASCII'))
++
++    def _send_tagged(self, tag, code, message):
++        self._send_textline(' '.join((tag, code, message)))
++
+     def handle(self):
+         # Send a welcome message.
+-        self._send(b'* OK IMAP4rev1\r\n')
++        self._send_textline('* OK IMAP4rev1')
+         while 1:
+             # Gather up input until we receive a line terminator or we timeout.
+             # Accumulate read(1) because it's simpler to handle the differences
+@@ -115,25 +126,39 @@
+                         return
+                     line += part
+                 except IOError:
+-                    # ..but SSLSockets throw exceptions.
++                    # ..but SSLSockets raise exceptions.
+                     return
+                 if line.endswith(b'\r\n'):
+                     break
+ 
+             if verbose: print('GOT: %r' % line.strip())
+-            splitline = line.split()
+-            tag = splitline[0].decode('ASCII')
+-            cmd = splitline[1].decode('ASCII')
++            if self.continuation:
++                try:
++                    self.continuation.send(line)
++                except StopIteration:
++                    self.continuation = None
++                continue
++            splitline = line.decode('ASCII').split()
++            tag = splitline[0]
++            cmd = splitline[1]
+             args = splitline[2:]
+ 
+             if hasattr(self, 'cmd_'+cmd):
+-                getattr(self, 'cmd_'+cmd)(tag, args)
++                continuation = getattr(self, 'cmd_'+cmd)(tag, args)
++                if continuation:
++                    self.continuation = continuation
++                    next(continuation)
+             else:
+-                self._send('{} BAD {} unknown\r\n'.format(tag, cmd).encode('ASCII'))
++                self._send_tagged(tag, 'BAD', cmd + ' unknown')
+ 
+     def cmd_CAPABILITY(self, tag, args):
+-        self._send(b'* CAPABILITY IMAP4rev1\r\n')
+-        self._send('{} OK CAPABILITY completed\r\n'.format(tag).encode('ASCII'))
++        caps = 'IMAP4rev1 ' + self.capabilities if self.capabilities else 'IMAP4rev1'
++        self._send_textline('* CAPABILITY ' + caps)
++        self._send_tagged(tag, 'OK', 'CAPABILITY completed')
++
++    def cmd_LOGOUT(self, tag, args):
++        self._send_textline('* BYE IMAP4ref1 Server logging out')
++        self._send_tagged(tag, 'OK', 'LOGOUT completed')
+ 
+ 
+ class BaseThreadedNetworkedTests(unittest.TestCase):
+@@ -183,6 +208,16 @@
+         finally:
+             self.reap_server(server, thread)
+ 
++    @contextmanager
++    def reaped_pair(self, hdlr):
++        server, thread = self.make_server((support.HOST, 0), hdlr)
++        client = self.imap_class(*server.server_address)
++        try:
++            yield server, client
++        finally:
++            client.logout()
++            self.reap_server(server, thread)
++
+     @reap_threads
+     def test_connect(self):
+         with self.reaped_server(SimpleIMAPHandler) as server:
+@@ -208,12 +243,86 @@
+ 
+             def cmd_CAPABILITY(self, tag, args):
+                 self._send(b'* CAPABILITY IMAP4rev1 AUTH\n')
+-                self._send('{} OK CAPABILITY completed\r\n'.format(tag).encode('ASCII'))
++                self._send_tagged(tag, 'OK', 'CAPABILITY completed')
+ 
+         with self.reaped_server(BadNewlineHandler) as server:
+             self.assertRaises(imaplib.IMAP4.abort,
+                               self.imap_class, *server.server_address)
+ 
++    @reap_threads
++    def test_bad_auth_name(self):
++
++        class MyServer(SimpleIMAPHandler):
++
++            def cmd_AUTHENTICATE(self, tag, args):
++                self._send_tagged(tag, 'NO', 'unrecognized authentication '
++                        'type {}'.format(args[0]))
++
++        with self.reaped_pair(MyServer) as (server, client):
++            with self.assertRaises(imaplib.IMAP4.error):
++                client.authenticate('METHOD', lambda: 1)
++
++    @reap_threads
++    def test_invalid_authentication(self):
++
++        class MyServer(SimpleIMAPHandler):
++
++            def cmd_AUTHENTICATE(self, tag, args):
++                self._send_textline('+')
++                self.response = yield
++                self._send_tagged(tag, 'NO', '[AUTHENTICATIONFAILED] invalid')
++
++        with self.reaped_pair(MyServer) as (server, client):
++            with self.assertRaises(imaplib.IMAP4.error):
++                code, data = client.authenticate('MYAUTH', lambda x: b'fake')
++
++    @reap_threads
++    def test_valid_authentication(self):
++
++        class MyServer(SimpleIMAPHandler):
++
++            def cmd_AUTHENTICATE(self, tag, args):
++                self._send_textline('+')
++                self.server.response = yield
++                self._send_tagged(tag, 'OK', 'FAKEAUTH successful')
++
++        with self.reaped_pair(MyServer) as (server, client):
++            code, data = client.authenticate('MYAUTH', lambda x: b'fake')
++            self.assertEqual(code, 'OK')
++            self.assertEqual(server.response,
++                             b'ZmFrZQ==\r\n') #b64 encoded 'fake'
++
++        with self.reaped_pair(MyServer) as (server, client):
++            code, data = client.authenticate('MYAUTH', lambda x: 'fake')
++            self.assertEqual(code, 'OK')
++            self.assertEqual(server.response,
++                             b'ZmFrZQ==\r\n') #b64 encoded 'fake'
++
++    @reap_threads
++    def test_login_cram_md5(self):
++
++        class AuthHandler(SimpleIMAPHandler):
++
++            capabilities = 'LOGINDISABLED AUTH=CRAM-MD5'
++
++            def cmd_AUTHENTICATE(self, tag, args):
++                self._send_textline('+ PDE4OTYuNjk3MTcwOTUyQHBvc3RvZmZpY2Uucm'
++                                       'VzdG9uLm1jaS5uZXQ=')
++                r = yield
++                if r ==  b'dGltIGYxY2E2YmU0NjRiOWVmYTFjY2E2ZmZkNmNmMmQ5ZjMy\r\n':
++                    self._send_tagged(tag, 'OK', 'CRAM-MD5 successful')
++                else:
++                    self._send_tagged(tag, 'NO', 'No access')
++
++        with self.reaped_pair(AuthHandler) as (server, client):
++            self.assertTrue('AUTH=CRAM-MD5' in client.capabilities)
++            ret, data = client.login_cram_md5("tim", "tanstaaftanstaaf")
++            self.assertEqual(ret, "OK")
++
++        with self.reaped_pair(AuthHandler) as (server, client):
++            self.assertTrue('AUTH=CRAM-MD5' in client.capabilities)
++            ret, data = client.login_cram_md5("tim", b"tanstaaftanstaaf")
++            self.assertEqual(ret, "OK")
+ 
+ 
+ class ThreadedNetworkedTests(BaseThreadedNetworkedTests):
+diff -r bd8afb90ebf2 Lib/test/test_import.py
+--- a/Lib/test/test_import.py
++++ b/Lib/test/test_import.py
+@@ -14,6 +14,7 @@
+ import textwrap
+ import errno
+ import shutil
++import contextlib
+ 
+ import test.support
+ from test.support import (
+@@ -33,6 +34,24 @@
+     rmtree('__pycache__')
+ 
+ 
++@contextlib.contextmanager
++def _ready_to_import(name=None, source=""):
++    # sets up a temporary directory and removes it
++    # creates the module file
++    # temporarily clears the module from sys.modules (if any)
++    name = name or "spam"
++    with script_helper.temp_dir() as tempdir:
++        path = script_helper.make_script(tempdir, name, source)
++        old_module = sys.modules.pop(name, None)
++        try:
++            sys.path.insert(0, tempdir)
++            yield name, path
++            sys.path.remove(tempdir)
++        finally:
++            if old_module is not None:
++                sys.modules[name] = old_module
++
++
+ class ImportTests(unittest.TestCase):
+ 
+     def setUp(self):
+@@ -101,54 +120,6 @@
+         finally:
+             del sys.path[0]
+ 
+-    @unittest.skipUnless(os.name == 'posix',
+-                         "test meaningful only on posix systems")
+-    def test_creation_mode(self):
+-        mask = 0o022
+-        with temp_umask(mask):
+-            sys.path.insert(0, os.curdir)
+-            try:
+-                fname = TESTFN + os.extsep + "py"
+-                create_empty_file(fname)
+-                fn = imp.cache_from_source(fname)
+-                unlink(fn)
+-                importlib.invalidate_caches()
+-                __import__(TESTFN)
+-                if not os.path.exists(fn):
+-                    self.fail("__import__ did not result in creation of "
+-                              "either a .pyc or .pyo file")
+-                s = os.stat(fn)
+-                # Check that the umask is respected, and the executable bits
+-                # aren't set.
+-                self.assertEqual(oct(stat.S_IMODE(s.st_mode)), oct(0o666 & ~mask))
+-            finally:
+-                del sys.path[0]
+-                remove_files(TESTFN)
+-                unload(TESTFN)
+-
+-    @unittest.skipUnless(os.name == 'posix',
+-                         "test meaningful only on posix systems")
+-    def test_cached_mode_issue_2051(self):
+-        mode = 0o600
+-        source = TESTFN + ".py"
+-        with script_helper.temp_dir() as tempdir:
+-            path = script_helper.make_script(tempdir, TESTFN,
+-                                             "key='top secret'")
+-            os.chmod(path, mode)
+-            compiled = imp.cache_from_source(path)
+-            sys.path.insert(0, tempdir)
+-            try:
+-                __import__(TESTFN)
+-            finally:
+-                sys.path.remove(tempdir)
+-
+-            if not os.path.exists(compiled):
+-                self.fail("__import__ did not result in creation of "
+-                          "either a .pyc or .pyo file")
+-            stat_info = os.stat(compiled)
+-
+-        self.assertEqual(oct(stat.S_IMODE(stat_info.st_mode)), oct(mode))
+-
+     def test_bug7732(self):
+         source = TESTFN + '.py'
+         os.mkdir(source)
+@@ -345,6 +316,92 @@
+             self.fail("fromlist must allow bogus names")
+ 
+ 
++class FilePermissionTests(unittest.TestCase):
++    # tests for file mode on cached .pyc/.pyo files
++
++    @unittest.skipUnless(os.name == 'posix',
++                         "test meaningful only on posix systems")
++    def test_creation_mode(self):
++        mask = 0o022
++        with temp_umask(mask), _ready_to_import() as (name, path):
++            cached_path = imp.cache_from_source(path)
++            module = __import__(name)
++            if not os.path.exists(cached_path):
++                self.fail("__import__ did not result in creation of "
++                          "either a .pyc or .pyo file")
++            stat_info = os.stat(cached_path)
++
++        # Check that the umask is respected, and the executable bits
++        # aren't set.
++        self.assertEqual(oct(stat.S_IMODE(stat_info.st_mode)),
++                         oct(0o666 & ~mask))
++
++    @unittest.skipUnless(os.name == 'posix',
++                         "test meaningful only on posix systems")
++    def test_cached_mode_issue_2051(self):
++        # permissions of .pyc should match those of .py, regardless of mask
++        mode = 0o600
++        with temp_umask(0o022), _ready_to_import() as (name, path):
++            cached_path = imp.cache_from_source(path)
++            os.chmod(path, mode)
++            __import__(name)
++            if not os.path.exists(cached_path):
++                self.fail("__import__ did not result in creation of "
++                          "either a .pyc or .pyo file")
++            stat_info = os.stat(cached_path)
++
++        self.assertEqual(oct(stat.S_IMODE(stat_info.st_mode)), oct(mode))
++
++    @unittest.skipUnless(os.name == 'posix',
++                         "test meaningful only on posix systems")
++    def test_cached_readonly(self):
++        mode = 0o400
++        with temp_umask(0o022), _ready_to_import() as (name, path):
++            cached_path = imp.cache_from_source(path)
++            os.chmod(path, mode)
++            __import__(name)
++            if not os.path.exists(cached_path):
++                self.fail("__import__ did not result in creation of "
++                          "either a .pyc or .pyo file")
++            stat_info = os.stat(cached_path)
++
++        expected = mode | 0o200 # Account for fix for issue #6074
++        self.assertEqual(oct(stat.S_IMODE(stat_info.st_mode)), oct(expected))
++
++    def test_pyc_always_writable(self):
++        # Initially read-only .pyc files on Windows used to cause problems
++        # with later updates, see issue #6074 for details
++        with _ready_to_import() as (name, path):
++            # Write a Python file, make it read-only and import it
++            with open(path, 'w') as f:
++                f.write("x = 'original'\n")
++            # Tweak the mtime of the source to ensure pyc gets updated later
++            s = os.stat(path)
++            os.utime(path, (s.st_atime, s.st_mtime-100000000))
++            os.chmod(path, 0o400)
++            m = __import__(name)
++            self.assertEqual(m.x, 'original')
++            # Change the file and then reimport it
++            os.chmod(path, 0o600)
++            with open(path, 'w') as f:
++                f.write("x = 'rewritten'\n")
++            unload(name)
++            importlib.invalidate_caches()
++            m = __import__(name)
++            self.assertEqual(m.x, 'rewritten')
++            # Now delete the source file and check the pyc was rewritten
++            unlink(path)
++            unload(name)
++            importlib.invalidate_caches()
++            if __debug__:
++                bytecode_only = path + "c"
++            else:
++                bytecode_only = path + "o"
++            os.rename(imp.cache_from_source(path), bytecode_only)
++            m = __import__(name)
++            self.assertEqual(m.x, 'rewritten')
++
++
+ class PycRewritingTests(unittest.TestCase):
+     # Test that the `co_filename` attribute on code objects always points
+     # to the right file, even when various things happen (e.g. both the .py
+@@ -591,7 +648,7 @@
+         self.assertTrue(os.path.exists('__pycache__'))
+         self.assertTrue(os.path.exists(os.path.join(
+             '__pycache__', '{}.{}.py{}'.format(
+-            TESTFN, self.tag, __debug__ and 'c' or 'o'))))
++            TESTFN, self.tag, 'c' if __debug__ else 'o'))))
+ 
+     @unittest.skipUnless(os.name == 'posix',
+                          "test meaningful only on posix systems")
+@@ -945,7 +1002,7 @@
+ 
+ 
+ def test_main(verbose=None):
+-    run_unittest(ImportTests, PycacheTests,
++    run_unittest(ImportTests, PycacheTests, FilePermissionTests,
+                  PycRewritingTests, PathsTests, RelativeImportTests,
+                  OverridingImportBuiltinTests,
+                  ImportlibBootstrapTests,
+diff -r bd8afb90ebf2 Lib/test/test_importlib/import_/test_fromlist.py
+--- a/Lib/test/test_importlib/import_/test_fromlist.py
++++ b/Lib/test/test_importlib/import_/test_fromlist.py
+@@ -52,7 +52,7 @@
+                 module = import_util.import_('module', fromlist=['attr'])
+                 self.assertEqual(module.__name__, 'module')
+ 
+-    def test_unexistent_object(self):
++    def test_nonexistent_object(self):
+         # [bad object]
+         with util.mock_modules('module') as importer:
+             with util.import_state(meta_path=[importer]):
+@@ -69,6 +69,19 @@
+                 self.assertTrue(hasattr(module, 'module'))
+                 self.assertEqual(module.module.__name__, 'pkg.module')
+ 
++    def test_module_from_package_triggers_ImportError(self):
++        # If a submodule causes an ImportError because it tries to import
++        # a module which doesn't exist, that should let the ImportError
++        # propagate.
++        def module_code():
++            import i_do_not_exist
++        with util.mock_modules('pkg.__init__', 'pkg.mod',
++                               module_code={'pkg.mod': module_code}) as importer:
++            with util.import_state(meta_path=[importer]):
++                with self.assertRaises(ImportError) as exc:
++                    import_util.import_('pkg', fromlist=['mod'])
++                self.assertEqual('i_do_not_exist', exc.exception.name)
++
+     def test_empty_string(self):
+         with util.mock_modules('pkg.__init__', 'pkg.mod') as importer:
+             with util.import_state(meta_path=[importer]):
+diff -r bd8afb90ebf2 Lib/test/test_importlib/import_/test_path.py
+--- a/Lib/test/test_importlib/import_/test_path.py
++++ b/Lib/test/test_importlib/import_/test_path.py
+@@ -1,15 +1,14 @@
+ from importlib import _bootstrap
+ from importlib import machinery
++from importlib import import_module
+ from .. import util
+ from . import util as import_util
+-import imp
+ import os
+ import sys
+-import tempfile
+-from test import support
+-from types import MethodType
++from types import ModuleType
+ import unittest
+ import warnings
++import zipimport
+ 
+ 
+ class FinderTests(unittest.TestCase):
+@@ -89,6 +88,29 @@
+             self.assertIs(loader, importer)
+             self.assertIn(os.curdir, sys.path_importer_cache)
+ 
++    def test_None_on_sys_path(self):
++        # Putting None in sys.path[0] caused an import regression from Python
++        # 3.2: http://bugs.python.org/issue16514
++        new_path = sys.path[:]
++        new_path.insert(0, None)
++        new_path_importer_cache = sys.path_importer_cache.copy()
++        new_path_importer_cache.pop(None, None)
++        new_path_hooks = [zipimport.zipimporter,
++                          _bootstrap.FileFinder.path_hook(
++                              *_bootstrap._get_supported_file_loaders())]
++        missing = object()
++        email = sys.modules.pop('email', missing)
++        try:
++            with util.import_state(meta_path=sys.meta_path[:],
++                                   path=new_path,
++                                   path_importer_cache=new_path_importer_cache,
++                                   path_hooks=new_path_hooks):
++                module = import_module('email')
++                self.assertIsInstance(module, ModuleType)
++        finally:
++            if email is not missing:
++                sys.modules['email'] = email
++
+ 
+ def test_main():
+     from test.support import run_unittest
+diff -r bd8afb90ebf2 Lib/test/test_importlib/source/test_finder.py
+--- a/Lib/test/test_importlib/source/test_finder.py
++++ b/Lib/test/test_importlib/source/test_finder.py
+@@ -6,6 +6,9 @@
+ import imp
+ import os
+ import py_compile
++import stat
++import sys
++import tempfile
+ from test.support import make_legacy_pyc
+ import unittest
+ import warnings
+@@ -147,6 +150,38 @@
+             self.assertIsNotNone(finder.find_module(mod))
+         self.assertIsNone(finder.find_module(mod))
+ 
++    @unittest.skipUnless(sys.platform != 'win32',
++            'os.chmod() does not support the needed arguments under Windows')
++    def test_no_read_directory(self):
++        # Issue #16730
++        tempdir = tempfile.TemporaryDirectory()
++        original_mode = os.stat(tempdir.name).st_mode
++        def cleanup(tempdir):
++            """Cleanup function for the temporary directory.
++
++            Since we muck with the permissions, we want to set them back to
++            their original values to make sure the directory can be properly
++            cleaned up.
++
++            """
++            os.chmod(tempdir.name, original_mode)
++            # If this is not explicitly called then the __del__ method is used,
++            # but since already mucking around might as well explicitly clean
++            # up.
++            tempdir.__exit__(None, None, None)
++        self.addCleanup(cleanup, tempdir)
++        os.chmod(tempdir.name, stat.S_IWUSR | stat.S_IXUSR)
++        finder = self.get_finder(tempdir.name)
++        self.assertEqual((None, []), finder.find_loader('doesnotexist'))
++
++    def test_ignore_file(self):
++        # If a directory got changed to a file from underneath us, then don't
++        # worry about looking for submodules.
++        with tempfile.NamedTemporaryFile() as file_obj:
++            finder = self.get_finder(file_obj.name)
++            self.assertEqual((None, []), finder.find_loader('doesnotexist'))
++
++
+ def test_main():
+     from test.support import run_unittest
+     run_unittest(FinderTests)
+diff -r bd8afb90ebf2 Lib/test/test_importlib/test_api.py
+--- a/Lib/test/test_importlib/test_api.py
++++ b/Lib/test/test_importlib/test_api.py
+@@ -4,6 +4,7 @@
+ from importlib import machinery
+ import sys
+ from test import support
++import types
+ import unittest
+ 
+ 
+@@ -175,12 +176,26 @@
+                                     machinery.FrozenImporter))
+ 
+ 
++class StartupTests(unittest.TestCase):
++
++    def test_everyone_has___loader__(self):
++        # Issue #17098: all modules should have __loader__ defined.
++        for name, module in sys.modules.items():
++            if isinstance(module, types.ModuleType):
++                if name in sys.builtin_module_names:
++                    self.assertEqual(importlib.machinery.BuiltinImporter,
++                                     module.__loader__)
++                elif imp.is_frozen(name):
++                    self.assertEqual(importlib.machinery.FrozenImporter,
++                                     module.__loader__)
++
+ def test_main():
+     from test.support import run_unittest
+     run_unittest(ImportModuleTests,
+                  FindLoaderTests,
+                  InvalidateCacheTests,
+-                 FrozenImportlibTests)
++                 FrozenImportlibTests,
++                 StartupTests)
+ 
+ 
+ if __name__ == '__main__':
+diff -r bd8afb90ebf2 Lib/test/test_importlib/test_locks.py
+--- a/Lib/test/test_importlib/test_locks.py
++++ b/Lib/test/test_importlib/test_locks.py
+@@ -1,4 +1,5 @@
+ from importlib import _bootstrap
++import sys
+ import time
+ import unittest
+ import weakref
+@@ -41,6 +42,17 @@
+ @unittest.skipUnless(threading, "threads needed for this test")
+ class DeadlockAvoidanceTests(unittest.TestCase):
+ 
++    def setUp(self):
++        try:
++            self.old_switchinterval = sys.getswitchinterval()
++            sys.setswitchinterval(0.000001)
++        except AttributeError:
++            self.old_switchinterval = None
++
++    def tearDown(self):
++        if self.old_switchinterval is not None:
++            sys.setswitchinterval(self.old_switchinterval)
++
+     def run_deadlock_avoidance_test(self, create_deadlock):
+         NLOCKS = 10
+         locks = [LockType(str(i)) for i in range(NLOCKS)]
+@@ -75,10 +87,12 @@
+ 
+     def test_deadlock(self):
+         results = self.run_deadlock_avoidance_test(True)
+-        # One of the threads detected a potential deadlock on its second
+-        # acquire() call.
+-        self.assertEqual(results.count((True, False)), 1)
+-        self.assertEqual(results.count((True, True)), len(results) - 1)
++        # At least one of the threads detected a potential deadlock on its
++        # second acquire() call.  It may be several of them, because the
++        # deadlock avoidance mechanism is conservative.
++        nb_deadlocks = results.count((True, False))
++        self.assertGreaterEqual(nb_deadlocks, 1)
++        self.assertEqual(results.count((True, True)), len(results) - nb_deadlocks)
+ 
+     def test_no_deadlock(self):
+         results = self.run_deadlock_avoidance_test(False)
+diff -r bd8afb90ebf2 Lib/test/test_inspect.py
+--- a/Lib/test/test_inspect.py
++++ b/Lib/test/test_inspect.py
+@@ -2241,6 +2241,16 @@
+         with self.assertRaisesRegex(TypeError, "parameter is positional only"):
+             self.call(test, a_po=1, b_po=2)
+ 
++    def test_signature_bind_with_self_arg(self):
++        # Issue #17071: one of the parameters is named "self
++        def test(a, self, b):
++            pass
++        sig = inspect.signature(test)
++        ba = sig.bind(1, 2, 3)
++        self.assertEqual(ba.args, (1, 2, 3))
++        ba = sig.bind(1, self=2, b=3)
++        self.assertEqual(ba.args, (1, 2, 3))
++
+ 
+ class TestBoundArguments(unittest.TestCase):
+     def test_signature_bound_arguments_unhashable(self):
+diff -r bd8afb90ebf2 Lib/test/test_int.py
+--- a/Lib/test/test_int.py
++++ b/Lib/test/test_int.py
+@@ -1,7 +1,7 @@
+ import sys
+ 
+ import unittest
+-from test.support import run_unittest
++from test import support
+ 
+ L = [
+         ('0', 0),
+@@ -100,10 +100,6 @@
+         self.assertRaises(ValueError, int, "0b", 2)
+         self.assertRaises(ValueError, int, "0b", 0)
+ 
+-        # Bug #3236: Return small longs from PyLong_FromString
+-        self.assertTrue(int("10") is 10)
+-        self.assertTrue(int("-1") is -1)
+-
+         # SF bug 1334662: int(string, base) wrong answers
+         # Various representations of 2**32 evaluated to 0
+         # rather than 2**32 in previous versions
+@@ -221,6 +217,46 @@
+         self.assertEqual(int('2br45qc', 35), 4294967297)
+         self.assertEqual(int('1z141z5', 36), 4294967297)
+ 
++    @support.cpython_only
++    def test_small_ints(self):
++        # Bug #3236: Return small longs from PyLong_FromString
++        self.assertIs(int('10'), 10)
++        self.assertIs(int('-1'), -1)
++        self.assertIs(int(b'10'), 10)
++        self.assertIs(int(b'-1'), -1)
++
++    def test_no_args(self):
++        self.assertEqual(int(), 0)
++
++    def test_keyword_args(self):
++        # Test invoking int() using keyword arguments.
++        self.assertEqual(int(x=1.2), 1)
++        self.assertEqual(int('100', base=2), 4)
++        self.assertEqual(int(x='100', base=2), 4)
++        self.assertRaises(TypeError, int, base=10)
++        self.assertRaises(TypeError, int, base=0)
++
++    def test_non_numeric_input_types(self):
++        # Test possible non-numeric types for the argument x, including
++        # subclasses of the explicitly documented accepted types.
++        class CustomStr(str): pass
++        class CustomBytes(bytes): pass
++        class CustomByteArray(bytearray): pass
++
++        values = [b'100',
++                  bytearray(b'100'),
++                  CustomStr('100'),
++                  CustomBytes(b'100'),
++                  CustomByteArray(b'100')]
++
++        for x in values:
++            msg = 'x has type %s' % type(x).__name__
++            self.assertEqual(int(x), 100, msg=msg)
++            self.assertEqual(int(x, 2), 4, msg=msg)
++
++    def test_string_float(self):
++        self.assertRaises(ValueError, int, '1.2')
++
+     def test_intconversion(self):
+         # Test __int__()
+         class ClassicMissingMethods:
+@@ -305,6 +341,18 @@
+                     self.fail("Failed to raise TypeError with %s" %
+                               ((base, trunc_result_base),))
+ 
++                # Regression test for bugs.python.org/issue16060.
++                class BadInt(trunc_result_base):
++                    def __int__(self):
++                        return 42.0
++
++                class TruncReturnsBadInt(base):
++                    def __trunc__(self):
++                        return BadInt()
++
++                with self.assertRaises(TypeError):
++                    int(TruncReturnsBadInt())
++
+     def test_error_message(self):
+         testlist = ('\xbd', '123\xbd', '  123 456  ')
+         for s in testlist:
+@@ -316,7 +364,7 @@
+                 self.fail("Expected int(%r) to raise a ValueError", s)
+ 
+ def test_main():
+-    run_unittest(IntTestCases)
++    support.run_unittest(IntTestCases)
+ 
+ if __name__ == "__main__":
+     test_main()
+diff -r bd8afb90ebf2 Lib/test/test_io.py
+--- a/Lib/test/test_io.py
++++ b/Lib/test/test_io.py
+@@ -32,7 +32,8 @@
+ import unittest
+ import warnings
+ import weakref
+-from collections import deque
++import _testcapi
++from collections import deque, UserList
+ from itertools import cycle, count
+ from test import support
+ 
+@@ -603,6 +604,7 @@
+             raise IOError()
+         f.flush = bad_flush
+         self.assertRaises(IOError, f.close) # exception not swallowed
++        self.assertTrue(f.closed)
+ 
+     def test_multi_close(self):
+         f = self.open(support.TESTFN, "wb", buffering=0)
+@@ -780,6 +782,22 @@
+         raw.flush = bad_flush
+         b = self.tp(raw)
+         self.assertRaises(IOError, b.close) # exception not swallowed
++        self.assertTrue(b.closed)
++
++    def test_close_error_on_close(self):
++        raw = self.MockRawIO()
++        def bad_flush():
++            raise IOError('flush')
++        def bad_close():
++            raise IOError('close')
++        raw.close = bad_close
++        b = self.tp(raw)
++        b.flush = bad_flush
++        with self.assertRaises(IOError) as err: # exception not swallowed
++            b.close()
++        self.assertEqual(err.exception.args, ('close',))
++        self.assertEqual(err.exception.__context__.args, ('flush',))
++        self.assertFalse(b.closed)
+ 
+     def test_multi_close(self):
+         raw = self.MockRawIO()
+@@ -1193,6 +1211,29 @@
+         bufio.flush()
+         self.assertEqual(b"abc", writer._write_stack[0])
+ 
++    def test_writelines(self):
++        l = [b'ab', b'cd', b'ef']
++        writer = self.MockRawIO()
++        bufio = self.tp(writer, 8)
++        bufio.writelines(l)
++        bufio.flush()
++        self.assertEqual(b''.join(writer._write_stack), b'abcdef')
++
++    def test_writelines_userlist(self):
++        l = UserList([b'ab', b'cd', b'ef'])
++        writer = self.MockRawIO()
++        bufio = self.tp(writer, 8)
++        bufio.writelines(l)
++        bufio.flush()
++        self.assertEqual(b''.join(writer._write_stack), b'abcdef')
++
++    def test_writelines_error(self):
++        writer = self.MockRawIO()
++        bufio = self.tp(writer, 8)
++        self.assertRaises(TypeError, bufio.writelines, [1, 2, 3])
++        self.assertRaises(TypeError, bufio.writelines, None)
++        self.assertRaises(TypeError, bufio.writelines, 'abc')
++
+     def test_destructor(self):
+         writer = self.MockRawIO()
+         bufio = self.tp(writer, 8)
+@@ -1273,6 +1314,16 @@
+         with self.assertRaises(TypeError):
+             self.tp(self.MockRawIO(), 8, 12)
+ 
++    def test_write_error_on_close(self):
++        raw = self.MockRawIO()
++        def bad_write(b):
++            raise IOError()
++        raw.write = bad_write
++        b = self.tp(raw)
++        b.write(b'spam')
++        self.assertRaises(IOError, b.close) # exception not swallowed
++        self.assertTrue(b.closed)
++
+ 
+ class CBufferedWriterTest(BufferedWriterTest, SizeofTest):
+     tp = io.BufferedWriter
+@@ -1912,6 +1963,14 @@
+             os.environ.clear()
+             os.environ.update(old_environ)
+ 
++    # Issue 15989
++    def test_device_encoding(self):
++        b = self.BytesIO()
++        b.fileno = lambda: _testcapi.INT_MAX + 1
++        self.assertRaises(OverflowError, self.TextIOWrapper, b)
++        b.fileno = lambda: _testcapi.UINT_MAX + 1
++        self.assertRaises(OverflowError, self.TextIOWrapper, b)
++
+     def test_encoding(self):
+         # Check the encoding attribute is always set, and valid
+         b = self.BytesIO()
+@@ -2296,6 +2355,28 @@
+             reads += c
+         self.assertEqual(reads, "A"*127+"\nB")
+ 
++    def test_writelines(self):
++        l = ['ab', 'cd', 'ef']
++        buf = self.BytesIO()
++        txt = self.TextIOWrapper(buf)
++        txt.writelines(l)
++        txt.flush()
++        self.assertEqual(buf.getvalue(), b'abcdef')
++
++    def test_writelines_userlist(self):
++        l = UserList(['ab', 'cd', 'ef'])
++        buf = self.BytesIO()
++        txt = self.TextIOWrapper(buf)
++        txt.writelines(l)
++        txt.flush()
++        self.assertEqual(buf.getvalue(), b'abcdef')
++
++    def test_writelines_error(self):
++        txt = self.TextIOWrapper(self.BytesIO())
++        self.assertRaises(TypeError, txt.writelines, [1, 2, 3])
++        self.assertRaises(TypeError, txt.writelines, None)
++        self.assertRaises(TypeError, txt.writelines, b'abc')
++
+     def test_issue1395_1(self):
+         txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
+ 
+@@ -2420,6 +2501,7 @@
+             raise IOError()
+         txt.flush = bad_flush
+         self.assertRaises(IOError, txt.close) # exception not swallowed
++        self.assertTrue(txt.closed)
+ 
+     def test_multi_close(self):
+         txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
+@@ -2460,6 +2542,30 @@
+         txt.write('5')
+         self.assertEqual(b''.join(raw._write_stack), b'123\n45')
+ 
++    def test_read_nonbytes(self):
++        # Issue #17106
++        # Crash when underlying read() returns non-bytes
++        t = self.TextIOWrapper(self.StringIO('a'))
++        self.assertRaises(TypeError, t.read, 1)
++        t = self.TextIOWrapper(self.StringIO('a'))
++        self.assertRaises(TypeError, t.readline)
++        t = self.TextIOWrapper(self.StringIO('a'))
++        self.assertRaises(TypeError, t.read)
++
++    def test_illegal_decoder(self):
++        # Issue #17106
++        # Crash when decoder returns non-string
++        t = self.TextIOWrapper(self.BytesIO(b'aaaaaa'), newline='\n',
++                               encoding='quopri_codec')
++        self.assertRaises(TypeError, t.read, 1)
++        t = self.TextIOWrapper(self.BytesIO(b'aaaaaa'), newline='\n',
++                               encoding='quopri_codec')
++        self.assertRaises(TypeError, t.readline)
++        t = self.TextIOWrapper(self.BytesIO(b'aaaaaa'), newline='\n',
++                               encoding='quopri_codec')
++        self.assertRaises(TypeError, t.read)
++
++
+ class CTextIOWrapperTest(TextIOWrapperTest):
+ 
+     def test_initialization(self):
+@@ -2887,6 +2993,11 @@
+         with self.open(support.TESTFN, 'rb') as f:
+             self.assertEqual(b"spam", f.read())
+ 
++    def test_open_allargs(self):
++        # there used to be a buffer overflow in the parser for rawmode
++        self.assertRaises(ValueError, self.open, support.TESTFN, 'rwax+')
++
++
+ class CMiscIOTest(MiscIOTest):
+     io = io
+ 
+diff -r bd8afb90ebf2 Lib/test/test_isinstance.py
+--- a/Lib/test/test_isinstance.py
++++ b/Lib/test/test_isinstance.py
+@@ -15,7 +15,7 @@
+     # (leading to an "undetected error" in the debug build).  Set up is,
+     # isinstance(inst, cls) where:
+     #
+-    # - cls isn't a a type, or a tuple
++    # - cls isn't a type, or a tuple
+     # - cls has a __bases__ attribute
+     # - inst has a __class__ attribute
+     # - inst.__class__ as no __bases__ attribute
+diff -r bd8afb90ebf2 Lib/test/test_iter.py
+--- a/Lib/test/test_iter.py
++++ b/Lib/test/test_iter.py
+@@ -903,6 +903,21 @@
+         except TypeError:
+             pass
+ 
++    def test_extending_list_with_iterator_does_not_segfault(self):
++        # The code to extend a list with an iterator has a fair
++        # amount of nontrivial logic in terms of guessing how
++        # much memory to allocate in advance, "stealing" refs,
++        # and then shrinking at the end.  This is a basic smoke
++        # test for that scenario.
++        def gen():
++            for i in range(500):
++                yield i
++        lst = [0] * 500
++        for i in range(240):
++            lst.pop(0)
++        lst.extend(gen())
++        self.assertEqual(len(lst), 760)
++
+ 
+ def test_main():
+     run_unittest(TestCase)
+diff -r bd8afb90ebf2 Lib/test/test_itertools.py
+--- a/Lib/test/test_itertools.py
++++ b/Lib/test/test_itertools.py
+@@ -1267,6 +1267,12 @@
+         self.pickletest(a, compare=ans)
+         self.pickletest(b, compare=ans)
+ 
++    # Issue 13454: Crash when deleting backward iterator from tee()
++    def test_tee_del_backward(self):
++        forward, backward = tee(repeat(None, 20000000))
++        any(forward)  # exhaust the iterator
++        del backward
++
+     def test_StopIteration(self):
+         self.assertRaises(StopIteration, next, zip())
+ 
+diff -r bd8afb90ebf2 Lib/test/test_lzma.py
+--- a/Lib/test/test_lzma.py
++++ b/Lib/test/test_lzma.py
+@@ -669,6 +669,20 @@
+         with LZMAFile(BytesIO(COMPRESSED_XZ[:128])) as f:
+             self.assertRaises(EOFError, f.read)
+ 
++    def test_read_truncated(self):
++        # Drop stream footer: CRC (4 bytes), index size (4 bytes),
++        # flags (2 bytes) and magic number (2 bytes).
++        truncated = COMPRESSED_XZ[:-12]
++        with LZMAFile(BytesIO(truncated)) as f:
++            self.assertRaises(EOFError, f.read)
++        with LZMAFile(BytesIO(truncated)) as f:
++            self.assertEqual(f.read(len(INPUT)), INPUT)
++            self.assertRaises(EOFError, f.read, 1)
++        # Incomplete 12-byte header.
++        for i in range(12):
++            with LZMAFile(BytesIO(truncated[:i])) as f:
++                self.assertRaises(EOFError, f.read, 1)
++
+     def test_read_bad_args(self):
+         f = LZMAFile(BytesIO(COMPRESSED_XZ))
+         f.close()
+diff -r bd8afb90ebf2 Lib/test/test_macpath.py
+--- a/Lib/test/test_macpath.py
++++ b/Lib/test/test_macpath.py
+@@ -115,13 +115,9 @@
+         self.assertEqual(normpath(b"a:b:"), b"a:b")
+ 
+ 
+-class MacCommonTest(test_genericpath.CommonTest):
++class MacCommonTest(test_genericpath.CommonTest, unittest.TestCase):
+     pathmodule = macpath
+ 
+ 
+-def test_main():
+-    support.run_unittest(MacPathTestCase, MacCommonTest)
+-
+-
+ if __name__ == "__main__":
+-    test_main()
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_mailbox.py
+--- a/Lib/test/test_mailbox.py
++++ b/Lib/test/test_mailbox.py
+@@ -43,9 +43,9 @@
+     def _delete_recursively(self, target):
+         # Delete a file or delete a directory recursively
+         if os.path.isdir(target):
+-            shutil.rmtree(target)
++            support.rmtree(target)
+         elif os.path.exists(target):
+-            os.remove(target)
++            support.unlink(target)
+ 
+ 
+ class TestMailbox(TestBase):
+@@ -53,7 +53,7 @@
+     maxDiff = None
+ 
+     _factory = None     # Overridden by subclasses to reuse tests
+-    _template = 'From: foo\n\n%s'
++    _template = 'From: foo\n\n%s\n'
+ 
+     def setUp(self):
+         self._path = support.TESTFN
+@@ -232,7 +232,7 @@
+         key0 = self._box.add(self._template % 0)
+         msg = self._box.get(key0)
+         self.assertEqual(msg['from'], 'foo')
+-        self.assertEqual(msg.get_payload(), '0')
++        self.assertEqual(msg.get_payload(), '0\n')
+         self.assertIs(self._box.get('foo'), None)
+         self.assertIs(self._box.get('foo', False), False)
+         self._box.close()
+@@ -240,14 +240,14 @@
+         key1 = self._box.add(self._template % 1)
+         msg = self._box.get(key1)
+         self.assertEqual(msg['from'], 'foo')
+-        self.assertEqual(msg.get_payload(), '1')
++        self.assertEqual(msg.get_payload(), '1\n')
+ 
+     def test_getitem(self):
+         # Retrieve message using __getitem__()
+         key0 = self._box.add(self._template % 0)
+         msg = self._box[key0]
+         self.assertEqual(msg['from'], 'foo')
+-        self.assertEqual(msg.get_payload(), '0')
++        self.assertEqual(msg.get_payload(), '0\n')
+         self.assertRaises(KeyError, lambda: self._box['foo'])
+         self._box.discard(key0)
+         self.assertRaises(KeyError, lambda: self._box[key0])
+@@ -259,7 +259,7 @@
+         msg0 = self._box.get_message(key0)
+         self.assertIsInstance(msg0, mailbox.Message)
+         self.assertEqual(msg0['from'], 'foo')
+-        self.assertEqual(msg0.get_payload(), '0')
++        self.assertEqual(msg0.get_payload(), '0\n')
+         self._check_sample(self._box.get_message(key1))
+ 
+     def test_get_bytes(self):
+@@ -432,15 +432,15 @@
+         self.assertIn(key0, self._box)
+         key1 = self._box.add(self._template % 1)
+         self.assertIn(key1, self._box)
+-        self.assertEqual(self._box.pop(key0).get_payload(), '0')
++        self.assertEqual(self._box.pop(key0).get_payload(), '0\n')
+         self.assertNotIn(key0, self._box)
+         self.assertIn(key1, self._box)
+         key2 = self._box.add(self._template % 2)
+         self.assertIn(key2, self._box)
+-        self.assertEqual(self._box.pop(key2).get_payload(), '2')
++        self.assertEqual(self._box.pop(key2).get_payload(), '2\n')
+         self.assertNotIn(key2, self._box)
+         self.assertIn(key1, self._box)
+-        self.assertEqual(self._box.pop(key1).get_payload(), '1')
++        self.assertEqual(self._box.pop(key1).get_payload(), '1\n')
+         self.assertNotIn(key1, self._box)
+         self.assertEqual(len(self._box), 0)
+ 
+@@ -635,7 +635,7 @@
+         msg_returned = self._box.get_message(key)
+         self.assertEqual(msg_returned.get_subdir(), 'new')
+         self.assertEqual(msg_returned.get_flags(), '')
+-        self.assertEqual(msg_returned.get_payload(), '1')
++        self.assertEqual(msg_returned.get_payload(), '1\n')
+         msg2 = mailbox.MaildirMessage(self._template % 2)
+         msg2.set_info('2,S')
+         self._box[key] = msg2
+@@ -643,7 +643,7 @@
+         msg_returned = self._box.get_message(key)
+         self.assertEqual(msg_returned.get_subdir(), 'new')
+         self.assertEqual(msg_returned.get_flags(), 'S')
+-        self.assertEqual(msg_returned.get_payload(), '3')
++        self.assertEqual(msg_returned.get_payload(), '3\n')
+ 
+     def test_consistent_factory(self):
+         # Add a message.
+@@ -763,13 +763,13 @@
+             self.assertIsNot(match, None, "Invalid file name: '%s'" % tail)
+             groups = match.groups()
+             if previous_groups is not None:
+-                self.assertTrue(int(groups[0] >= previous_groups[0]),
++                self.assertGreaterEqual(int(groups[0]), int(previous_groups[0]),
+                              "Non-monotonic seconds: '%s' before '%s'" %
+                              (previous_groups[0], groups[0]))
+-                self.assertTrue(int(groups[1] >= previous_groups[1]) or
+-                             groups[0] != groups[1],
+-                             "Non-monotonic milliseconds: '%s' before '%s'" %
+-                             (previous_groups[1], groups[1]))
++                if int(groups[0]) == int(previous_groups[0]):
++                    self.assertGreaterEqual(int(groups[1]), int(previous_groups[1]),
++                                "Non-monotonic milliseconds: '%s' before '%s'" %
++                                (previous_groups[1], groups[1]))
+                 self.assertEqual(int(groups[2]), pid,
+                              "Process ID mismatch: '%s' should be '%s'" %
+                              (groups[2], pid))
+@@ -996,20 +996,20 @@
+ 
+     def test_add_from_string(self):
+         # Add a string starting with 'From ' to the mailbox
+-        key = self._box.add('From foo@bar blah\nFrom: foo\n\n0')
++        key = self._box.add('From foo@bar blah\nFrom: foo\n\n0\n')
+         self.assertEqual(self._box[key].get_from(), 'foo@bar blah')
+-        self.assertEqual(self._box[key].get_payload(), '0')
++        self.assertEqual(self._box[key].get_payload(), '0\n')
+ 
+     def test_add_from_bytes(self):
+         # Add a byte string starting with 'From ' to the mailbox
+-        key = self._box.add(b'From foo@bar blah\nFrom: foo\n\n0')
++        key = self._box.add(b'From foo@bar blah\nFrom: foo\n\n0\n')
+         self.assertEqual(self._box[key].get_from(), 'foo@bar blah')
+-        self.assertEqual(self._box[key].get_payload(), '0')
++        self.assertEqual(self._box[key].get_payload(), '0\n')
+ 
+     def test_add_mbox_or_mmdf_message(self):
+         # Add an mboxMessage or MMDFMessage
+         for class_ in (mailbox.mboxMessage, mailbox.MMDFMessage):
+-            msg = class_('From foo@bar blah\nFrom: foo\n\n0')
++            msg = class_('From foo@bar blah\nFrom: foo\n\n0\n')
+             key = self._box.add(msg)
+ 
+     def test_open_close_open(self):
+@@ -1116,6 +1116,29 @@
+             perms = st.st_mode
+             self.assertFalse((perms & 0o111)) # Execute bits should all be off.
+ 
++    def test_terminating_newline(self):
++        message = email.message.Message()
++        message['From'] = 'john@example.com'
++        message.set_payload('No newline at the end')
++        i = self._box.add(message)
++
++        # A newline should have been appended to the payload
++        message = self._box.get(i)
++        self.assertEqual(message.get_payload(), 'No newline at the end\n')
++
++    def test_message_separator(self):
++        # Check there's always a single blank line after each message
++        self._box.add('From: foo\n\n0')  # No newline at the end
++        with open(self._path) as f:
++            data = f.read()
++            self.assertEqual(data[-3:], '0\n\n')
++
++        self._box.add('From: foo\n\n0\n')  # Newline at the end
++        with open(self._path) as f:
++            data = f.read()
++            self.assertEqual(data[-3:], '0\n\n')
++
++
+ class TestMMDF(_TestMboxMMDF, unittest.TestCase):
+ 
+     _factory = lambda self, path, factory=None: mailbox.MMDF(path, factory)
+@@ -2089,9 +2112,9 @@
+         # create a new maildir mailbox to work with:
+         self._dir = support.TESTFN
+         if os.path.isdir(self._dir):
+-            shutil.rmtree(self._dir)
++            support.rmtree(self._dir)
+         elif os.path.isfile(self._dir):
+-            os.unlink(self._dir)
++            support.unlink(self._dir)
+         os.mkdir(self._dir)
+         os.mkdir(os.path.join(self._dir, "cur"))
+         os.mkdir(os.path.join(self._dir, "tmp"))
+@@ -2101,10 +2124,10 @@
+ 
+     def tearDown(self):
+         list(map(os.unlink, self._msgfiles))
+-        os.rmdir(os.path.join(self._dir, "cur"))
+-        os.rmdir(os.path.join(self._dir, "tmp"))
+-        os.rmdir(os.path.join(self._dir, "new"))
+-        os.rmdir(self._dir)
++        support.rmdir(os.path.join(self._dir, "cur"))
++        support.rmdir(os.path.join(self._dir, "tmp"))
++        support.rmdir(os.path.join(self._dir, "new"))
++        support.rmdir(self._dir)
+ 
+     def createMessage(self, dir, mbox=False):
+         t = int(time.time() % 1000000)
+diff -r bd8afb90ebf2 Lib/test/test_marshal.py
+--- a/Lib/test/test_marshal.py
++++ b/Lib/test/test_marshal.py
+@@ -279,16 +279,62 @@
+         unicode_string = 'T'
+         self.assertRaises(TypeError, marshal.loads, unicode_string)
+ 
++LARGE_SIZE = 2**31
++pointer_size = 8 if sys.maxsize > 0xFFFFFFFF else 4
++
++class NullWriter:
++    def write(self, s):
++        pass
++
++@unittest.skipIf(LARGE_SIZE > sys.maxsize, "test cannot run on 32-bit systems")
++class LargeValuesTestCase(unittest.TestCase):
++    def check_unmarshallable(self, data):
++        self.assertRaises(ValueError, marshal.dump, data, NullWriter())
++
++    @support.bigmemtest(size=LARGE_SIZE, memuse=1, dry_run=False)
++    def test_bytes(self, size):
++        self.check_unmarshallable(b'x' * size)
++
++    @support.bigmemtest(size=LARGE_SIZE, memuse=1, dry_run=False)
++    def test_str(self, size):
++        self.check_unmarshallable('x' * size)
++
++    @support.bigmemtest(size=LARGE_SIZE, memuse=pointer_size, dry_run=False)
++    def test_tuple(self, size):
++        self.check_unmarshallable((None,) * size)
++
++    @support.bigmemtest(size=LARGE_SIZE, memuse=pointer_size, dry_run=False)
++    def test_list(self, size):
++        self.check_unmarshallable([None] * size)
++
++    @support.bigmemtest(size=LARGE_SIZE,
++            memuse=pointer_size*12 + sys.getsizeof(LARGE_SIZE-1),
++            dry_run=False)
++    def test_set(self, size):
++        self.check_unmarshallable(set(range(size)))
++
++    @support.bigmemtest(size=LARGE_SIZE,
++            memuse=pointer_size*12 + sys.getsizeof(LARGE_SIZE-1),
++            dry_run=False)
++    def test_frozenset(self, size):
++        self.check_unmarshallable(frozenset(range(size)))
++
++    @support.bigmemtest(size=LARGE_SIZE, memuse=1, dry_run=False)
++    def test_bytearray(self, size):
++        self.check_unmarshallable(bytearray(size))
++
+ 
+ def test_main():
+     support.run_unittest(IntTestCase,
+-                              FloatTestCase,
+-                              StringTestCase,
+-                              CodeTestCase,
+-                              ContainerTestCase,
+-                              ExceptionTestCase,
+-                              BufferTestCase,
+-                              BugsTestCase)
++                         FloatTestCase,
++                         StringTestCase,
++                         CodeTestCase,
++                         ContainerTestCase,
++                         ExceptionTestCase,
++                         BufferTestCase,
++                         BugsTestCase,
++                         LargeValuesTestCase,
++                        )
+ 
+ if __name__ == "__main__":
+     test_main()
+diff -r bd8afb90ebf2 Lib/test/test_memoryio.py
+--- a/Lib/test/test_memoryio.py
++++ b/Lib/test/test_memoryio.py
+@@ -318,9 +318,9 @@
+         self.assertEqual(memio.isatty(), False)
+         self.assertEqual(memio.closed, False)
+         memio.close()
+-        self.assertEqual(memio.writable(), True)
+-        self.assertEqual(memio.readable(), True)
+-        self.assertEqual(memio.seekable(), True)
++        self.assertRaises(ValueError, memio.writable)
++        self.assertRaises(ValueError, memio.readable)
++        self.assertRaises(ValueError, memio.seekable)
+         self.assertRaises(ValueError, memio.isatty)
+         self.assertEqual(memio.closed, True)
+ 
+@@ -665,7 +665,6 @@
+         check(io.BytesIO(b'a'), basesize + 1 + 1 )
+         check(io.BytesIO(b'a' * 1000), basesize + 1000 + 1 )
+ 
+-
+ class CStringIOTest(PyStringIOTest):
+     ioclass = io.StringIO
+     UnsupportedOperation = io.UnsupportedOperation
+diff -r bd8afb90ebf2 Lib/test/test_minidom.py
+--- a/Lib/test/test_minidom.py
++++ b/Lib/test/test_minidom.py
+@@ -1073,7 +1073,7 @@
+             '<?xml version="1.0" encoding="utf-16"?>'
+             '<foo>\u20ac</foo>'.encode('utf-16'))
+ 
+-        # Verify that character decoding errors throw exceptions instead
++        # Verify that character decoding errors raise exceptions instead
+         # of crashing
+         self.assertRaises(UnicodeDecodeError, parseString,
+                 b'<fran\xe7ais>Comment \xe7a va ? Tr\xe8s bien ?</fran\xe7ais>')
+diff -r bd8afb90ebf2 Lib/test/test_mmap.py
+--- a/Lib/test/test_mmap.py
++++ b/Lib/test/test_mmap.py
+@@ -488,6 +488,15 @@
+         f.flush ()
+         return mmap.mmap (f.fileno(), 0)
+ 
++    def test_empty_file (self):
++        f = open (TESTFN, 'w+b')
++        f.close()
++        with open(TESTFN, "rb") as f :
++            self.assertRaisesRegex(ValueError,
++                                   "cannot mmap an empty file",
++                                   mmap.mmap, f.fileno(), 0,
++                                   access=mmap.ACCESS_READ)
++
+     def test_offset (self):
+         f = open (TESTFN, 'w+b')
+ 
+@@ -712,6 +721,13 @@
+ 
+     def test_large_filesize(self):
+         with self._make_test_file(0x17FFFFFFF, b" ") as f:
++            if sys.maxsize < 0x180000000:
++                # On 32 bit platforms the file is larger than sys.maxsize so
++                # mapping the whole file should fail -- Issue #16743
++                with self.assertRaises(OverflowError):
++                    mmap.mmap(f.fileno(), 0x180000000, access=mmap.ACCESS_READ)
++                with self.assertRaises(ValueError):
++                    mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
+             with mmap.mmap(f.fileno(), 0x10000, access=mmap.ACCESS_READ) as m:
+                 self.assertEqual(m.size(), 0x180000000)
+ 
+diff -r bd8afb90ebf2 Lib/test/test_modulefinder.py
+--- a/Lib/test/test_modulefinder.py
++++ b/Lib/test/test_modulefinder.py
+@@ -196,6 +196,18 @@
+                                 from . import bar
+ """]
+ 
++relative_import_test_4 = [
++    "a.module",
++    ["a", "a.module"],
++    [],
++    [],
++    """\
++a/__init__.py
++                                def foo(): pass
++a/module.py
++                                from . import *
++"""]
++
+ 
+ def open_file(path):
+     dirname = os.path.dirname(path)
+@@ -273,6 +285,9 @@
+     def test_relative_imports_3(self):
+         self._do_test(relative_import_test_3)
+ 
++    def test_relative_imports_4(self):
++        self._do_test(relative_import_test_4)
++
+ 
+ def test_main():
+     support.run_unittest(ModuleFinderTest)
+diff -r bd8afb90ebf2 Lib/test/test_multiprocessing.py
+--- a/Lib/test/test_multiprocessing.py
++++ b/Lib/test/test_multiprocessing.py
+@@ -1642,6 +1642,23 @@
+         self.assertEqual(self.pool.starmap_async(mul, tuples).get(),
+                          list(itertools.starmap(mul, tuples)))
+ 
++    def test_map_async(self):
++        self.assertEqual(self.pool.map_async(sqr, list(range(10))).get(),
++                         list(map(sqr, list(range(10)))))
++
++    def test_map_async_callbacks(self):
++        call_args = self.manager.list() if self.TYPE == 'manager' else []
++        self.pool.map_async(int, ['1'],
++                            callback=call_args.append,
++                            error_callback=call_args.append).wait()
++        self.assertEqual(1, len(call_args))
++        self.assertEqual([1], call_args[0])
++        self.pool.map_async(int, ['a'],
++                            callback=call_args.append,
++                            error_callback=call_args.append).wait()
++        self.assertEqual(2, len(call_args))
++        self.assertIsInstance(call_args[1], ValueError)
++
+     def test_map_chunksize(self):
+         try:
+             self.pool.map_async(sqr, [], chunksize=1).get(timeout=TIMEOUT1)
+@@ -1727,7 +1744,8 @@
+             with multiprocessing.Pool(2) as p:
+                 r = p.map_async(sqr, L)
+                 self.assertEqual(r.get(), expected)
+-            self.assertRaises(AssertionError, p.map_async, sqr, L)
++            print(p._state)
++            self.assertRaises(ValueError, p.map_async, sqr, L)
+ 
+ def raising():
+     raise KeyError("key")
+@@ -2109,6 +2127,7 @@
+         self.assertTimingAlmostEqual(poll.elapsed, TIMEOUT1)
+ 
+         conn.send(None)
++        time.sleep(.1)
+ 
+         self.assertEqual(poll(TIMEOUT1), True)
+         self.assertTimingAlmostEqual(poll.elapsed, 0)
+@@ -2364,6 +2383,17 @@
+         p.join()
+         l.close()
+ 
++    def test_issue16955(self):
++        for fam in self.connection.families:
++            l = self.connection.Listener(family=fam)
++            c = self.connection.Client(l.address)
++            a = l.accept()
++            a.send_bytes(b"hello")
++            self.assertTrue(c.poll(1))
++            a.close()
++            c.close()
++            l.close()
++
+ class _TestPoll(unittest.TestCase):
+ 
+     ALLOWED_TYPES = ('processes', 'threads')
+@@ -3214,6 +3244,7 @@
+         from multiprocessing.connection import wait
+ 
+         expected = 3
++        sorted_ = lambda l: sorted(l, key=lambda x: id(x))
+         sem = multiprocessing.Semaphore(0)
+         a, b = multiprocessing.Pipe()
+         p = multiprocessing.Process(target=self.signal_and_sleep,
+@@ -3237,7 +3268,7 @@
+         res = wait([a, p.sentinel, b], 20)
+         delta = time.time() - start
+ 
+-        self.assertEqual(res, [p.sentinel, b])
++        self.assertEqual(sorted_(res), sorted_([p.sentinel, b]))
+         self.assertLess(delta, 0.4)
+ 
+         b.send(None)
+@@ -3246,7 +3277,7 @@
+         res = wait([a, p.sentinel, b], 20)
+         delta = time.time() - start
+ 
+-        self.assertEqual(res, [a, p.sentinel, b])
++        self.assertEqual(sorted_(res), sorted_([a, p.sentinel, b]))
+         self.assertLess(delta, 0.4)
+ 
+         p.terminate()
+diff -r bd8afb90ebf2 Lib/test/test_ntpath.py
+--- a/Lib/test/test_ntpath.py
++++ b/Lib/test/test_ntpath.py
+@@ -257,14 +257,10 @@
+                     ntpath.sameopenfile(-1, -1)
+ 
+ 
+-class NtCommonTest(test_genericpath.CommonTest):
++class NtCommonTest(test_genericpath.CommonTest, unittest.TestCase):
+     pathmodule = ntpath
+     attributes = ['relpath', 'splitunc']
+ 
+ 
+-def test_main():
+-    support.run_unittest(TestNtpath, NtCommonTest)
+-
+-
+ if __name__ == "__main__":
+     unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_os.py
+--- a/Lib/test/test_os.py
++++ b/Lib/test/test_os.py
+@@ -49,6 +49,9 @@
+ else:
+     USING_LINUXTHREADS = False
+ 
++# Issue #14110: Some tests fail on FreeBSD if the user is in the wheel group.
++HAVE_WHEEL_GROUP = sys.platform.startswith('freebsd') and os.getgid() == 0
++
+ # Tests creating TESTFN
+ class FileTests(unittest.TestCase):
+     def setUp(self):
+@@ -202,33 +205,33 @@
+ 
+         try:
+             result[200]
+-            self.fail("No exception thrown")
++            self.fail("No exception raised")
+         except IndexError:
+             pass
+ 
+         # Make sure that assignment fails
+         try:
+             result.st_mode = 1
+-            self.fail("No exception thrown")
++            self.fail("No exception raised")
+         except AttributeError:
+             pass
+ 
+         try:
+             result.st_rdev = 1
+-            self.fail("No exception thrown")
++            self.fail("No exception raised")
+         except (AttributeError, TypeError):
+             pass
+ 
+         try:
+             result.parrot = 1
+-            self.fail("No exception thrown")
++            self.fail("No exception raised")
+         except AttributeError:
+             pass
+ 
+         # Use the stat_result constructor with a too-short tuple.
+         try:
+             result2 = os.stat_result((10,))
+-            self.fail("No exception thrown")
++            self.fail("No exception raised")
+         except TypeError:
+             pass
+ 
+@@ -273,20 +276,20 @@
+         # Make sure that assignment really fails
+         try:
+             result.f_bfree = 1
+-            self.fail("No exception thrown")
++            self.fail("No exception raised")
+         except AttributeError:
+             pass
+ 
+         try:
+             result.parrot = 1
+-            self.fail("No exception thrown")
++            self.fail("No exception raised")
+         except AttributeError:
+             pass
+ 
+         # Use the constructor with a too-short tuple.
+         try:
+             result2 = os.statvfs_result((10,))
+-            self.fail("No exception thrown")
++            self.fail("No exception raised")
+         except TypeError:
+             pass
+ 
+@@ -514,23 +517,23 @@
+         return os.environ
+ 
+     # Bug 1110478
++    @unittest.skipUnless(os.path.exists('/bin/sh'), 'requires /bin/sh')
+     def test_update2(self):
+         os.environ.clear()
+-        if os.path.exists("/bin/sh"):
+-            os.environ.update(HELLO="World")
+-            with os.popen("/bin/sh -c 'echo $HELLO'") as popen:
+-                value = popen.read().strip()
+-                self.assertEqual(value, "World")
++        os.environ.update(HELLO="World")
++        with os.popen("/bin/sh -c 'echo $HELLO'") as popen:
++            value = popen.read().strip()
++            self.assertEqual(value, "World")
+ 
++    @unittest.skipUnless(os.path.exists('/bin/sh'), 'requires /bin/sh')
+     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.assertEqual(next(it), "line1\n")
+-                self.assertEqual(next(it), "line2\n")
+-                self.assertEqual(next(it), "line3\n")
+-                self.assertRaises(StopIteration, next, it)
++        with os.popen(
++            "/bin/sh -c 'echo \"line1\nline2\nline3\"'") as popen:
++            it = iter(popen)
++            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.
+@@ -905,6 +908,50 @@
+ 
+         os.removedirs(path)
+ 
++
++class RemoveDirsTests(unittest.TestCase):
++    def setUp(self):
++        os.makedirs(support.TESTFN)
++
++    def tearDown(self):
++        support.rmtree(support.TESTFN)
++
++    def test_remove_all(self):
++        dira = os.path.join(support.TESTFN, 'dira')
++        os.mkdir(dira)
++        dirb = os.path.join(dira, 'dirb')
++        os.mkdir(dirb)
++        os.removedirs(dirb)
++        self.assertFalse(os.path.exists(dirb))
++        self.assertFalse(os.path.exists(dira))
++        self.assertFalse(os.path.exists(support.TESTFN))
++
++    def test_remove_partial(self):
++        dira = os.path.join(support.TESTFN, 'dira')
++        os.mkdir(dira)
++        dirb = os.path.join(dira, 'dirb')
++        os.mkdir(dirb)
++        with open(os.path.join(dira, 'file.txt'), 'w') as f:
++            f.write('text')
++        os.removedirs(dirb)
++        self.assertFalse(os.path.exists(dirb))
++        self.assertTrue(os.path.exists(dira))
++        self.assertTrue(os.path.exists(support.TESTFN))
++
++    def test_remove_nothing(self):
++        dira = os.path.join(support.TESTFN, 'dira')
++        os.mkdir(dira)
++        dirb = os.path.join(dira, 'dirb')
++        os.mkdir(dirb)
++        with open(os.path.join(dirb, 'file.txt'), 'w') as f:
++            f.write('text')
++        with self.assertRaises(OSError):
++            os.removedirs(dirb)
++        self.assertTrue(os.path.exists(dirb))
++        self.assertTrue(os.path.exists(dira))
++        self.assertTrue(os.path.exists(support.TESTFN))
++
++
+ class DevNullTests(unittest.TestCase):
+     def test_devnull(self):
+         with open(os.devnull, 'wb') as f:
+@@ -913,6 +960,7 @@
+         with open(os.devnull, 'rb') as f:
+             self.assertEqual(f.read(), b'')
+ 
++
+ class URandomTests(unittest.TestCase):
+     def test_urandom_length(self):
+         self.assertEqual(len(os.urandom(0)), 0)
+@@ -1195,7 +1243,7 @@
+ 
+         if hasattr(os, 'setgid'):
+             def test_setgid(self):
+-                if os.getuid() != 0:
++                if os.getuid() != 0 and not HAVE_WHEEL_GROUP:
+                     self.assertRaises(os.error, os.setgid, 0)
+                 self.assertRaises(OverflowError, os.setgid, 1<<32)
+ 
+@@ -1207,7 +1255,7 @@
+ 
+         if hasattr(os, 'setegid'):
+             def test_setegid(self):
+-                if os.getuid() != 0:
++                if os.getuid() != 0 and not HAVE_WHEEL_GROUP:
+                     self.assertRaises(os.error, os.setegid, 0)
+                 self.assertRaises(OverflowError, os.setegid, 1<<32)
+ 
+@@ -1227,7 +1275,7 @@
+ 
+         if hasattr(os, 'setregid'):
+             def test_setregid(self):
+-                if os.getuid() != 0:
++                if os.getuid() != 0 and not HAVE_WHEEL_GROUP:
+                     self.assertRaises(os.error, os.setregid, 0, 0)
+                 self.assertRaises(OverflowError, os.setregid, 1<<32, 0)
+                 self.assertRaises(OverflowError, os.setregid, 0, 1<<32)
+@@ -1243,6 +1291,8 @@
+         def setUp(self):
+             if support.TESTFN_UNENCODABLE:
+                 self.dir = support.TESTFN_UNENCODABLE
++            elif support.TESTFN_NONASCII:
++                self.dir = support.TESTFN_NONASCII
+             else:
+                 self.dir = support.TESTFN
+             self.bdir = os.fsencode(self.dir)
+@@ -1257,6 +1307,8 @@
+             add_filename(support.TESTFN_UNICODE)
+             if support.TESTFN_UNENCODABLE:
+                 add_filename(support.TESTFN_UNENCODABLE)
++            if support.TESTFN_NONASCII:
++                add_filename(support.TESTFN_NONASCII)
+             if not bytesfn:
+                 self.skipTest("couldn't create any non-ascii filename")
+ 
+@@ -1293,6 +1345,15 @@
+                 f = open(os.path.join(self.dir, fn), 'rb')
+                 f.close()
+ 
++        @unittest.skipUnless(hasattr(os, 'statvfs'),
++                             "need os.statvfs()")
++        def test_statvfs(self):
++            # issue #9645
++            for fn in self.unicodefn:
++                # should not fail with file not found error
++                fullname = os.path.join(self.dir, fn)
++                os.statvfs(fullname)
++
+         def test_stat(self):
+             for fn in self.unicodefn:
+                 os.stat(os.path.join(self.dir, fn))
+@@ -2074,6 +2135,7 @@
+         ExtendedAttributeTests,
+         Win32DeprecatedBytesAPI,
+         TermsizeTests,
++        RemoveDirsTests,
+     )
+ 
+ if __name__ == "__main__":
+diff -r bd8afb90ebf2 Lib/test/test_pdb.py
+--- a/Lib/test/test_pdb.py
++++ b/Lib/test/test_pdb.py
+@@ -667,6 +667,36 @@
+             any('main.py(5)foo()->None' in l for l in stdout.splitlines()),
+             'Fail to step into the caller after a return')
+ 
++    def test_issue13210(self):
++        # invoking "continue" on a non-main thread triggered an exception
++        # inside signal.signal
++
++        # raises SkipTest if python was built without threads
++        support.import_module('threading')
++
++        with open(support.TESTFN, 'wb') as f:
++            f.write(textwrap.dedent("""
++                import threading
++                import pdb
++
++                def start_pdb():
++                    pdb.Pdb().set_trace()
++                    x = 1
++                    y = 1
++
++                t = threading.Thread(target=start_pdb)
++                t.start()""").encode('ascii'))
++        cmd = [sys.executable, '-u', support.TESTFN]
++        proc = subprocess.Popen(cmd,
++            stdout=subprocess.PIPE,
++            stdin=subprocess.PIPE,
++            stderr=subprocess.STDOUT,
++            )
++        self.addCleanup(proc.stdout.close)
++        stdout, stderr = proc.communicate(b'cont\n')
++        self.assertNotIn('Error', stdout.decode(),
++                         "Got an error running test script under PDB")
++
+     def tearDown(self):
+         support.unlink(support.TESTFN)
+ 
+diff -r bd8afb90ebf2 Lib/test/test_peepholer.py
+--- a/Lib/test/test_peepholer.py
++++ b/Lib/test/test_peepholer.py
+@@ -213,6 +213,9 @@
+         asm = dis_single('"\u0061\uffff"[1]')
+         self.assertIn("('\\uffff')", asm)
+         self.assertNotIn('BINARY_SUBSCR', asm)
++        asm = dis_single('"\U00012345abcdef"[3]')
++        self.assertIn("('c')", asm)
++        self.assertNotIn('BINARY_SUBSCR', asm)
+ 
+         # invalid code doesn't get optimized
+         # out of range
+diff -r bd8afb90ebf2 Lib/test/test_pep380.py
+--- a/Lib/test/test_pep380.py
++++ b/Lib/test/test_pep380.py
+@@ -519,7 +519,7 @@
+             next(gi)
+             for x in range(3):
+                 y = gi.send(42)
+-                trace.append("Should not have yielded:", y)
++                trace.append("Should not have yielded: %s" % (y,))
+         except AttributeError as e:
+             self.assertIn("send", e.args[0])
+         else:
+diff -r bd8afb90ebf2 Lib/test/test_poll.py
+--- a/Lib/test/test_poll.py
++++ b/Lib/test/test_poll.py
+@@ -1,6 +1,7 @@
+ # Test case for the os.poll() function
+ 
+ import os, select, random, unittest
++import _testcapi
+ from test.support import TESTFN, run_unittest
+ 
+ try:
+@@ -150,6 +151,15 @@
+         if x != 5:
+             self.fail('Overflow must have occurred')
+ 
++        pollster = select.poll()
++        # Issue 15989
++        self.assertRaises(OverflowError, pollster.register, 0,
++                          _testcapi.SHRT_MAX + 1)
++        self.assertRaises(OverflowError, pollster.register, 0,
++                          _testcapi.USHRT_MAX + 1)
++        self.assertRaises(OverflowError, pollster.poll, _testcapi.INT_MAX + 1)
++        self.assertRaises(OverflowError, pollster.poll, _testcapi.UINT_MAX + 1)
++
+ def test_main():
+     run_unittest(PollTests)
+ 
+diff -r bd8afb90ebf2 Lib/test/test_posix.py
+--- a/Lib/test/test_posix.py
++++ b/Lib/test/test_posix.py
+@@ -17,6 +17,7 @@
+ import tempfile
+ import unittest
+ import warnings
++import _testcapi
+ 
+ _DUMMY_SYMLINK = os.path.join(tempfile.gettempdir(),
+                               support.TESTFN + '-dummy-symlink')
+@@ -358,12 +359,28 @@
+             try:
+                 self.assertTrue(posix.fstat(fp.fileno()))
+                 self.assertTrue(posix.stat(fp.fileno()))
++
++                self.assertRaisesRegex(TypeError,
++                        'should be string, bytes or integer, not',
++                        posix.stat, float(fp.fileno()))
+             finally:
+                 fp.close()
+ 
+     def test_stat(self):
+         if hasattr(posix, 'stat'):
+             self.assertTrue(posix.stat(support.TESTFN))
++            self.assertTrue(posix.stat(os.fsencode(support.TESTFN)))
++            self.assertTrue(posix.stat(bytearray(os.fsencode(support.TESTFN))))
++
++            self.assertRaisesRegex(TypeError,
++                    'can\'t specify None for path argument',
++                    posix.stat, None)
++            self.assertRaisesRegex(TypeError,
++                    'should be string, bytes or integer, not',
++                    posix.stat, list(support.TESTFN))
++            self.assertRaisesRegex(TypeError,
++                    'should be string, bytes or integer, not',
++                    posix.stat, list(os.fsencode(support.TESTFN)))
+ 
+     @unittest.skipUnless(hasattr(posix, 'mkfifo'), "don't have mkfifo()")
+     def test_mkfifo(self):
+@@ -387,10 +404,20 @@
+         else:
+             self.assertTrue(stat.S_ISFIFO(posix.stat(support.TESTFN).st_mode))
+ 
+-    def _test_all_chown_common(self, chown_func, first_param):
++    def _test_all_chown_common(self, chown_func, first_param, stat_func):
+         """Common code for chown, fchown and lchown tests."""
++        def check_stat():
++            if stat_func is not None:
++                stat = stat_func(first_param)
++                self.assertEqual(stat.st_uid, os.getuid())
++                self.assertEqual(stat.st_gid, os.getgid())
+         # test a successful chown call
+         chown_func(first_param, os.getuid(), os.getgid())
++        check_stat()
++        chown_func(first_param, -1, os.getgid())
++        check_stat()
++        chown_func(first_param, os.getuid(), -1)
++        check_stat()
+ 
+         if os.getuid() == 0:
+             try:
+@@ -410,8 +437,12 @@
+                                     "behavior")
+         else:
+             # non-root cannot chown to root, raises OSError
+-            self.assertRaises(OSError, chown_func,
+-                              first_param, 0, 0)
++            self.assertRaises(OSError, chown_func, first_param, 0, 0)
++            check_stat()
++            self.assertRaises(OSError, chown_func, first_param, -1, 0)
++            check_stat()
++            self.assertRaises(OSError, chown_func, first_param, 0, -1)
++            check_stat()
+ 
+     @unittest.skipUnless(hasattr(posix, 'chown'), "test needs os.chown()")
+     def test_chown(self):
+@@ -421,7 +452,8 @@
+ 
+         # re-create the file
+         support.create_empty_file(support.TESTFN)
+-        self._test_all_chown_common(posix.chown, support.TESTFN)
++        self._test_all_chown_common(posix.chown, support.TESTFN,
++                                    getattr(posix, 'stat', None))
+ 
+     @unittest.skipUnless(hasattr(posix, 'fchown'), "test needs os.fchown()")
+     def test_fchown(self):
+@@ -431,7 +463,8 @@
+         test_file = open(support.TESTFN, 'w')
+         try:
+             fd = test_file.fileno()
+-            self._test_all_chown_common(posix.fchown, fd)
++            self._test_all_chown_common(posix.fchown, fd,
++                                        getattr(posix, 'fstat', None))
+         finally:
+             test_file.close()
+ 
+@@ -440,7 +473,8 @@
+         os.unlink(support.TESTFN)
+         # create a symlink
+         os.symlink(_DUMMY_SYMLINK, support.TESTFN)
+-        self._test_all_chown_common(posix.lchown, support.TESTFN)
++        self._test_all_chown_common(posix.lchown, support.TESTFN,
++                                    getattr(posix, 'lstat', None))
+ 
+     def test_chdir(self):
+         if hasattr(posix, 'chdir'):
+@@ -521,6 +555,10 @@
+         except OSError:
+             pass
+ 
++        # Issue 15989
++        self.assertRaises(OverflowError, os.pipe2, _testcapi.INT_MAX + 1)
++        self.assertRaises(OverflowError, os.pipe2, _testcapi.UINT_MAX + 1)
++
+     def test_utime(self):
+         if hasattr(posix, 'utime'):
+             now = time.time()
+@@ -647,17 +685,10 @@
+     @unittest.skipUnless(hasattr(pwd, 'getpwuid'), "test needs pwd.getpwuid()")
+     @unittest.skipUnless(hasattr(os, 'getuid'), "test needs os.getuid()")
+     def test_getgrouplist(self):
+-        with os.popen('id -G') as idg:
+-            groups = idg.read().strip()
+-            ret = idg.close()
++        user = pwd.getpwuid(os.getuid())[0]
++        group = pwd.getpwuid(os.getuid())[3]
++        self.assertIn(group, posix.getgrouplist(user, group))
+ 
+-        if ret != None or not groups:
+-            raise unittest.SkipTest("need working 'id -G'")
+-
+-        self.assertEqual(
+-            set([int(x) for x in groups.split()]),
+-            set(posix.getgrouplist(pwd.getpwuid(os.getuid())[0],
+-                pwd.getpwuid(os.getuid())[3])))
+ 
+     @unittest.skipUnless(hasattr(os, 'getegid'), "test needs os.getegid()")
+     def test_getgroups(self):
+@@ -665,9 +696,16 @@
+             groups = idg.read().strip()
+             ret = idg.close()
+ 
+-        if ret != None or not groups:
++        if ret is not None or not groups:
+             raise unittest.SkipTest("need working 'id -G'")
+ 
++        # Issues 16698: OS X ABIs prior to 10.6 have limits on getgroups()
++        if sys.platform == 'darwin':
++            import sysconfig
++            dt = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') or '10.0'
++            if float(dt) < 10.6:
++                raise unittest.SkipTest("getgroups(2) is broken prior to 10.6")
++
+         # 'id -G' and 'os.getgroups()' should return the same
+         # groups, ignoring order and duplicates.
+         # #10822 - it is implementation defined whether posix.getgroups()
+@@ -721,6 +759,14 @@
+             s1 = posix.stat(support.TESTFN)
+             s2 = posix.stat(support.TESTFN, dir_fd=f)
+             self.assertEqual(s1, s2)
++            s2 = posix.stat(support.TESTFN, dir_fd=None)
++            self.assertEqual(s1, s2)
++            self.assertRaisesRegex(TypeError, 'should be integer, not',
++                    posix.stat, support.TESTFN, dir_fd=posix.getcwd())
++            self.assertRaisesRegex(TypeError, 'should be integer, not',
++                    posix.stat, support.TESTFN, dir_fd=float(f))
++            self.assertRaises(OverflowError,
++                    posix.stat, support.TESTFN, dir_fd=10**20)
+         finally:
+             posix.close(f)
+ 
+@@ -831,7 +877,7 @@
+             posix.rename(support.TESTFN + 'ren', support.TESTFN)
+             raise
+         else:
+-            posix.stat(support.TESTFN) # should not throw exception
++            posix.stat(support.TESTFN) # should not raise exception
+         finally:
+             posix.close(f)
+ 
+@@ -849,7 +895,7 @@
+     def test_unlink_dir_fd(self):
+         f = posix.open(posix.getcwd(), posix.O_RDONLY)
+         support.create_empty_file(support.TESTFN + 'del')
+-        posix.stat(support.TESTFN + 'del') # should not throw exception
++        posix.stat(support.TESTFN + 'del') # should not raise exception
+         try:
+             posix.unlink(support.TESTFN + 'del', dir_fd=f)
+         except:
+@@ -913,17 +959,17 @@
+         self.assertRaises(OSError, posix.sched_getparam, -1)
+         param = posix.sched_getparam(0)
+         self.assertIsInstance(param.sched_priority, int)
+-        try:
+-            posix.sched_setscheduler(0, mine, param)
+-        except OSError as e:
+-            if e.errno != errno.EPERM:
+-                raise
+ 
+-        # POSIX states that calling sched_setparam() on a process with a
+-        # scheduling policy other than SCHED_FIFO or SCHED_RR is
+-        # implementation-defined: FreeBSD returns EINVAL.
+-        if not sys.platform.startswith('freebsd'):
+-            posix.sched_setparam(0, param)
++        # POSIX states that calling sched_setparam() or sched_setscheduler() on
++        # a process with a scheduling policy other than SCHED_FIFO or SCHED_RR
++        # is implementation-defined: NetBSD and FreeBSD can return EINVAL.
++        if not sys.platform.startswith(('freebsd', 'netbsd')):
++            try:
++                posix.sched_setscheduler(0, mine, param)
++                posix.sched_setparam(0, param)
++            except OSError as e:
++                if e.errno != errno.EPERM:
++                    raise
+             self.assertRaises(OSError, posix.sched_setparam, -1, param)
+ 
+         self.assertRaises(OSError, posix.sched_setscheduler, -1, mine, param)
+diff -r bd8afb90ebf2 Lib/test/test_posixpath.py
+--- a/Lib/test/test_posixpath.py
++++ b/Lib/test/test_posixpath.py
+@@ -340,6 +340,26 @@
+         self.assertEqual(posixpath.normpath(b"///..//./foo/.//bar"),
+                          b"/foo/bar")
+ 
++    @skip_if_ABSTFN_contains_backslash
++    def test_realpath_curdir(self):
++        self.assertEqual(realpath('.'), os.getcwd())
++        self.assertEqual(realpath('./.'), os.getcwd())
++        self.assertEqual(realpath('/'.join(['.'] * 100)), os.getcwd())
++
++        self.assertEqual(realpath(b'.'), os.getcwdb())
++        self.assertEqual(realpath(b'./.'), os.getcwdb())
++        self.assertEqual(realpath(b'/'.join([b'.'] * 100)), os.getcwdb())
++
++    @skip_if_ABSTFN_contains_backslash
++    def test_realpath_pardir(self):
++        self.assertEqual(realpath('..'), dirname(os.getcwd()))
++        self.assertEqual(realpath('../..'), dirname(dirname(os.getcwd())))
++        self.assertEqual(realpath('/'.join(['..'] * 100)), '/')
++
++        self.assertEqual(realpath(b'..'), dirname(os.getcwdb()))
++        self.assertEqual(realpath(b'../..'), dirname(dirname(os.getcwdb())))
++        self.assertEqual(realpath(b'/'.join([b'..'] * 100)), b'/')
++
+     @unittest.skipUnless(hasattr(os, "symlink"),
+                          "Missing symlink implementation")
+     @skip_if_ABSTFN_contains_backslash
+@@ -377,6 +397,22 @@
+             self.assertEqual(realpath(ABSTFN+"1"), ABSTFN+"1")
+             self.assertEqual(realpath(ABSTFN+"2"), ABSTFN+"2")
+ 
++            self.assertEqual(realpath(ABSTFN+"1/x"), ABSTFN+"1/x")
++            self.assertEqual(realpath(ABSTFN+"1/.."), dirname(ABSTFN))
++            self.assertEqual(realpath(ABSTFN+"1/../x"), dirname(ABSTFN) + "/x")
++            os.symlink(ABSTFN+"x", ABSTFN+"y")
++            self.assertEqual(realpath(ABSTFN+"1/../" + basename(ABSTFN) + "y"),
++                             ABSTFN + "y")
++            self.assertEqual(realpath(ABSTFN+"1/../" + basename(ABSTFN) + "1"),
++                             ABSTFN + "1")
++
++            os.symlink(basename(ABSTFN) + "a/b", ABSTFN+"a")
++            self.assertEqual(realpath(ABSTFN+"a"), ABSTFN+"a/b")
++
++            os.symlink("../" + basename(dirname(ABSTFN)) + "/" +
++                       basename(ABSTFN) + "c", ABSTFN+"c")
++            self.assertEqual(realpath(ABSTFN+"c"), ABSTFN+"c")
++
+             # Test using relative path as well.
+             os.chdir(dirname(ABSTFN))
+             self.assertEqual(realpath(basename(ABSTFN)), ABSTFN)
+@@ -385,6 +421,45 @@
+             support.unlink(ABSTFN)
+             support.unlink(ABSTFN+"1")
+             support.unlink(ABSTFN+"2")
++            support.unlink(ABSTFN+"y")
++            support.unlink(ABSTFN+"c")
++
++    @unittest.skipUnless(hasattr(os, "symlink"),
++                         "Missing symlink implementation")
++    @skip_if_ABSTFN_contains_backslash
++    def test_realpath_repeated_indirect_symlinks(self):
++        # Issue #6975.
++        try:
++            os.mkdir(ABSTFN)
++            os.symlink('../' + basename(ABSTFN), ABSTFN + '/self')
++            os.symlink('self/self/self', ABSTFN + '/link')
++            self.assertEqual(realpath(ABSTFN + '/link'), ABSTFN)
++        finally:
++            support.unlink(ABSTFN + '/self')
++            support.unlink(ABSTFN + '/link')
++            safe_rmdir(ABSTFN)
++
++    @unittest.skipUnless(hasattr(os, "symlink"),
++                         "Missing symlink implementation")
++    @skip_if_ABSTFN_contains_backslash
++    def test_realpath_deep_recursion(self):
++        depth = 10
++        old_path = abspath('.')
++        try:
++            os.mkdir(ABSTFN)
++            for i in range(depth):
++                os.symlink('/'.join(['%d' % i] * 10), ABSTFN + '/%d' % (i + 1))
++            os.symlink('.', ABSTFN + '/0')
++            self.assertEqual(realpath(ABSTFN + '/%d' % depth), ABSTFN)
++
++            # Test using relative path as well.
++            os.chdir(ABSTFN)
++            self.assertEqual(realpath('%d' % depth), ABSTFN)
++        finally:
++            os.chdir(old_path)
++            for i in range(depth + 1):
++                support.unlink(ABSTFN + '/%d' % i)
++            safe_rmdir(ABSTFN)
+ 
+     @unittest.skipUnless(hasattr(os, "symlink"),
+                          "Missing symlink implementation")
+@@ -524,14 +599,10 @@
+             self.assertTrue(posixpath.sameopenfile(a.fileno(), b.fileno()))
+ 
+ 
+-class PosixCommonTest(test_genericpath.CommonTest):
++class PosixCommonTest(test_genericpath.CommonTest, unittest.TestCase):
+     pathmodule = posixpath
+     attributes = ['relpath', 'samefile', 'sameopenfile', 'samestat']
+ 
+ 
+-def test_main():
+-    support.run_unittest(PosixPathTest, PosixCommonTest)
+-
+-
+ if __name__=="__main__":
+-    test_main()
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_property.py
+--- a/Lib/test/test_property.py
++++ b/Lib/test/test_property.py
+@@ -186,7 +186,7 @@
+             Foo.spam.__doc__,
+             "spam wrapped in property subclass")
+ 
+-    @unittest.skipIf(sys.flags.optimize <= 2,
++    @unittest.skipIf(sys.flags.optimize >= 2,
+                      "Docstrings are omitted with -O2 and above")
+     def test_property_setter_copies_getter_docstring(self):
+         class Foo(object):
+@@ -219,7 +219,7 @@
+             FooSub.spam.__doc__,
+             "spam wrapped in property subclass")
+ 
+-    @unittest.skipIf(sys.flags.optimize <= 2,
++    @unittest.skipIf(sys.flags.optimize >= 2,
+                      "Docstrings are omitted with -O2 and above")
+     def test_property_new_getter_new_docstring(self):
+ 
+diff -r bd8afb90ebf2 Lib/test/test_pty.py
+--- a/Lib/test/test_pty.py
++++ b/Lib/test/test_pty.py
+@@ -152,7 +152,7 @@
+             # platform-dependent amount of data is written to its fd.  On
+             # Linux 2.6, it's 4000 bytes and the child won't block, but on OS
+             # X even the small writes in the child above will block it.  Also
+-            # on Linux, the read() will throw an OSError (input/output error)
++            # on Linux, the read() will raise an OSError (input/output error)
+             # when it tries to read past the end of the buffer but the child's
+             # already exited, so catch and discard those exceptions.  It's not
+             # worth checking for EIO.
+diff -r bd8afb90ebf2 Lib/test/test_pwd.py
+--- a/Lib/test/test_pwd.py
++++ b/Lib/test/test_pwd.py
+@@ -49,7 +49,9 @@
+ 
+     def test_errors(self):
+         self.assertRaises(TypeError, pwd.getpwuid)
++        self.assertRaises(TypeError, pwd.getpwuid, 3.14)
+         self.assertRaises(TypeError, pwd.getpwnam)
++        self.assertRaises(TypeError, pwd.getpwnam, 42)
+         self.assertRaises(TypeError, pwd.getpwall, 42)
+ 
+         # try to get some errors
+@@ -93,6 +95,13 @@
+         self.assertNotIn(fakeuid, byuids)
+         self.assertRaises(KeyError, pwd.getpwuid, fakeuid)
+ 
++        # -1 shouldn't be a valid uid because it has a special meaning in many
++        # uid-related functions
++        self.assertRaises(KeyError, pwd.getpwuid, -1)
++        # should be out of uid_t range
++        self.assertRaises(KeyError, pwd.getpwuid, 2**128)
++        self.assertRaises(KeyError, pwd.getpwuid, -2**128)
++
+ def test_main():
+     support.run_unittest(PwdTest)
+ 
+diff -r bd8afb90ebf2 Lib/test/test_pydoc.py
+--- a/Lib/test/test_pydoc.py
++++ b/Lib/test/test_pydoc.py
+@@ -30,6 +30,14 @@
+ if hasattr(pydoc_mod, "__loader__"):
+     del pydoc_mod.__loader__
+ 
++if test.support.HAVE_DOCSTRINGS:
++    expected_data_docstrings = (
++        'dictionary for instance variables (if defined)',
++        'list of weak references to the object (if defined)',
++        ) * 2
++else:
++    expected_data_docstrings = ('', '', '', '')
++
+ expected_text_pattern = """
+ NAME
+     test.pydoc_mod - This is a test module for test_pydoc
+@@ -50,20 +58,16 @@
+      |  ----------------------------------------------------------------------
+      |  Data descriptors defined here:
+      |\x20\x20
+-     |  __dict__
+-     |      dictionary for instance variables (if defined)
++     |  __dict__%s
+      |\x20\x20
+-     |  __weakref__
+-     |      list of weak references to the object (if defined)
++     |  __weakref__%s
+ \x20\x20\x20\x20
+     class B(builtins.object)
+      |  Data descriptors defined here:
+      |\x20\x20
+-     |  __dict__
+-     |      dictionary for instance variables (if defined)
++     |  __dict__%s
+      |\x20\x20
+-     |  __weakref__
+-     |      list of weak references to the object (if defined)
++     |  __weakref__%s
+      |\x20\x20
+      |  ----------------------------------------------------------------------
+      |  Data and other attributes defined here:
+@@ -95,6 +99,9 @@
+     %s
+ """.strip()
+ 
++expected_text_data_docstrings = tuple('\n     |      ' + s if s else ''
++                                      for s in expected_data_docstrings)
++
+ expected_html_pattern = """
+ <table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
+ <tr bgcolor="#7799ee">
+@@ -134,10 +141,10 @@
+ <hr>
+ Data descriptors defined here:<br>
+ <dl><dt><strong>__dict__</strong></dt>
+-<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
++<dd><tt>%s</tt></dd>
+ </dl>
+ <dl><dt><strong>__weakref__</strong></dt>
+-<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
++<dd><tt>%s</tt></dd>
+ </dl>
+ </td></tr></table> <p>
+ <table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
+@@ -148,10 +155,10 @@
+ <tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
+ <td width="100%%">Data descriptors defined here:<br>
+ <dl><dt><strong>__dict__</strong></dt>
+-<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
++<dd><tt>%s</tt></dd>
+ </dl>
+ <dl><dt><strong>__weakref__</strong></dt>
+-<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
++<dd><tt>%s</tt></dd>
+ </dl>
+ <hr>
+ Data and other attributes defined here:<br>
+@@ -193,6 +200,8 @@
+ <td width="100%%">Nobody</td></tr></table>
+ """.strip() # ' <- emacs turd
+ 
++expected_html_data_docstrings = tuple(s.replace(' ', '&nbsp;')
++                                      for s in expected_data_docstrings)
+ 
+ # output pattern for missing module
+ missing_pattern = "no Python documentation found for '%s'"
+@@ -264,7 +273,9 @@
+             mod_url = nturl2path.pathname2url(mod_file)
+         else:
+             mod_url = mod_file
+-        expected_html = expected_html_pattern % (mod_url, mod_file, doc_loc)
++        expected_html = expected_html_pattern % (
++                        (mod_url, mod_file, doc_loc) +
++                        expected_html_data_docstrings)
+         if result != expected_html:
+             print_diffs(expected_html, result)
+             self.fail("outputs are not equal, see diff above")
+@@ -275,8 +286,10 @@
+                      'trace function introduces __locals__ unexpectedly')
+     def test_text_doc(self):
+         result, doc_loc = get_pydoc_text(pydoc_mod)
+-        expected_text = expected_text_pattern % \
+-                        (doc_loc, inspect.getabsfile(pydoc_mod))
++        expected_text = expected_text_pattern % (
++                        (doc_loc,) +
++                        expected_text_data_docstrings +
++                        (inspect.getabsfile(pydoc_mod),))
+         if result != expected_text:
+             print_diffs(expected_text, result)
+             self.fail("outputs are not equal, see diff above")
+@@ -352,8 +365,10 @@
+                  captured_output('stderr') as err:
+                 helper.help(module)
+                 result = buf.getvalue().strip()
+-                expected_text = expected_help_pattern % \
+-                                (doc_loc, inspect.getabsfile(pydoc_mod))
++                expected_text = expected_help_pattern % (
++                                (doc_loc,) +
++                                expected_text_data_docstrings +
++                                (inspect.getabsfile(pydoc_mod),))
+                 self.assertEqual('', output.getvalue())
+                 self.assertEqual('', err.getvalue())
+                 self.assertEqual(expected_text, result)
+diff -r bd8afb90ebf2 Lib/test/test_pyexpat.py
+--- a/Lib/test/test_pyexpat.py
++++ b/Lib/test/test_pyexpat.py
+@@ -52,6 +52,7 @@
+ <sub2><![CDATA[contents of CDATA section]]></sub2>
+ &external_entity;
+ &skipped_entity;
++\xb5
+ </root>
+ '''
+ 
+@@ -195,13 +196,13 @@
+             "End element: 'sub2'",
+             "External entity ref: (None, 'entity.file', None)",
+             ('Skipped entity', ('skipped_entity', 0)),
++            "Character data: '\xb5'",
+             "End element: 'root'",
+         ]
+         for operation, expected_operation in zip(operations, expected_operations):
+             self.assertEqual(operation, expected_operation)
+ 
+-    def test_unicode(self):
+-        # Try the parse again, this time producing Unicode output
++    def test_parse_bytes(self):
+         out = self.Outputter()
+         parser = expat.ParserCreate(namespace_separator='!')
+         self._hookup_callbacks(parser, out)
+@@ -213,6 +214,16 @@
+         # Issue #6697.
+         self.assertRaises(AttributeError, getattr, parser, '\uD800')
+ 
++    def test_parse_str(self):
++        out = self.Outputter()
++        parser = expat.ParserCreate(namespace_separator='!')
++        self._hookup_callbacks(parser, out)
++
++        parser.Parse(data.decode('iso-8859-1'), 1)
++
++        operations = out.out
++        self._verify_parse_output(operations)
++
+     def test_parse_file(self):
+         # Try parsing a file
+         out = self.Outputter()
+@@ -269,7 +280,7 @@
+             L.append(name)
+         p.StartElementHandler = collector
+         p.EndElementHandler = collector
+-        p.Parse("<e> <e/> <e></e> </e>", 1)
++        p.Parse(b"<e> <e/> <e></e> </e>", 1)
+         tag = L[0]
+         self.assertEqual(len(L), 6)
+         for entry in L:
+@@ -285,7 +296,7 @@
+ 
+             def ExternalEntityRefHandler(self, context, base, sysId, pubId):
+                 external_parser = self.parser.ExternalEntityParserCreate("")
+-                self.parser_result = external_parser.Parse("", 1)
++                self.parser_result = external_parser.Parse(b"", 1)
+                 return 1
+ 
+         parser = expat.ParserCreate(namespace_separator='!')
+@@ -336,7 +347,7 @@
+     def test_buffering_enabled(self):
+         # Make sure buffering is turned on
+         self.assertTrue(self.parser.buffer_text)
+-        self.parser.Parse("<a>1<b/>2<c/>3</a>", 1)
++        self.parser.Parse(b"<a>1<b/>2<c/>3</a>", 1)
+         self.assertEqual(self.stuff, ['123'],
+                          "buffered text not properly collapsed")
+ 
+@@ -344,39 +355,39 @@
+         # 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.parser.Parse(b"<a>1<b buffer-text='no'/>2\n3<c buffer-text='yes'/>4\n5</a>", 1)
+         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.parser.Parse(b"<a>1<b/>&lt;2&gt;<c/>&#32;\n&#x20;3</a>", 1)
+         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.parser.Parse(b"<a>1<b/>2<c/>3</a>", 1)
+         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.parser.Parse(b"<a>1<b/>2<c/>3</a>", 1)
+         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.parser.Parse(b"<a>1<b></b>2<c/>3</a>", 1)
+         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.parser.Parse(b"<a>1<b/>2<c></c>345</a> ", 1)
+         self.assertEqual(self.stuff,
+             ["<a>", "1", "<b>", "</b>", "2", "<c>", "</c>", "345", "</a>"],
+             "buffered text not properly split")
+@@ -384,7 +395,7 @@
+     def test7(self):
+         self.setHandlers(["CommentHandler", "EndElementHandler",
+                     "StartElementHandler"])
+-        self.parser.Parse("<a>1<b/>2<c></c>3<!--abc-->4<!--def-->5</a> ", 1)
++        self.parser.Parse(b"<a>1<b/>2<c></c>3<!--abc-->4<!--def-->5</a> ", 1)
+         self.assertEqual(self.stuff,
+                          ["<a>", "1", "<b>", "</b>", "2", "<c>", "</c>", "3",
+                           "<!--abc-->", "4", "<!--def-->", "5", "</a>"],
+@@ -400,7 +411,7 @@
+         parser = expat.ParserCreate()
+         parser.StartElementHandler = self.StartElementHandler
+         try:
+-            parser.Parse("<a><b><c/></b></a>", 1)
++            parser.Parse(b"<a><b><c/></b></a>", 1)
+             self.fail()
+         except RuntimeError as e:
+             self.assertEqual(e.args[0], 'a',
+@@ -436,7 +447,7 @@
+         self.expected_list = [('s', 0, 1, 0), ('s', 5, 2, 1), ('s', 11, 3, 2),
+                               ('e', 15, 3, 6), ('e', 17, 4, 1), ('e', 22, 5, 0)]
+ 
+-        xml = '<a>\n <b>\n  <c/>\n </b>\n</a>'
++        xml = b'<a>\n <b>\n  <c/>\n </b>\n</a>'
+         self.parser.Parse(xml, 1)
+ 
+ 
+@@ -457,7 +468,7 @@
+         parser = expat.ParserCreate()
+         parser.CharacterDataHandler = handler
+ 
+-        self.assertRaises(Exception, parser.Parse, xml)
++        self.assertRaises(Exception, parser.Parse, xml.encode('iso8859'))
+ 
+ class ChardataBufferTest(unittest.TestCase):
+     """
+@@ -480,8 +491,8 @@
+         self.assertRaises(ValueError, f, 0)
+ 
+     def test_unchanged_size(self):
+-        xml1 = ("<?xml version='1.0' encoding='iso8859'?><s>%s" % ('a' * 512))
+-        xml2 = 'a'*512 + '</s>'
++        xml1 = b"<?xml version='1.0' encoding='iso8859'?><s>" + b'a' * 512
++        xml2 = b'a'*512 + b'</s>'
+         parser = expat.ParserCreate()
+         parser.CharacterDataHandler = self.counting_handler
+         parser.buffer_size = 512
+@@ -503,9 +514,9 @@
+ 
+ 
+     def test_disabling_buffer(self):
+-        xml1 = "<?xml version='1.0' encoding='iso8859'?><a>%s" % ('a' * 512)
+-        xml2 = ('b' * 1024)
+-        xml3 = "%s</a>" % ('c' * 1024)
++        xml1 = b"<?xml version='1.0' encoding='iso8859'?><a>" + b'a' * 512
++        xml2 = b'b' * 1024
++        xml3 = b'c' * 1024 + b'</a>';
+         parser = expat.ParserCreate()
+         parser.CharacterDataHandler = self.counting_handler
+         parser.buffer_text = 1
+@@ -532,16 +543,11 @@
+         parser.Parse(xml3, 1)
+         self.assertEqual(self.n, 12)
+ 
+-
+-
+-    def make_document(self, bytes):
+-        return ("<?xml version='1.0'?><tag>" + bytes * 'a' + '</tag>')
+-
+     def counting_handler(self, text):
+         self.n += 1
+ 
+     def small_buffer_test(self, buffer_len):
+-        xml = "<?xml version='1.0' encoding='iso8859'?><s>%s</s>" % ('a' * buffer_len)
++        xml = b"<?xml version='1.0' encoding='iso8859'?><s>" + b'a' * buffer_len + b'</s>'
+         parser = expat.ParserCreate()
+         parser.CharacterDataHandler = self.counting_handler
+         parser.buffer_size = 1024
+@@ -552,8 +558,8 @@
+         return self.n
+ 
+     def test_change_size_1(self):
+-        xml1 = "<?xml version='1.0' encoding='iso8859'?><a><s>%s" % ('a' * 1024)
+-        xml2 = "aaa</s><s>%s</s></a>" % ('a' * 1025)
++        xml1 = b"<?xml version='1.0' encoding='iso8859'?><a><s>" + b'a' * 1024
++        xml2 = b'aaa</s><s>' + b'a' * 1025 + b'</s></a>'
+         parser = expat.ParserCreate()
+         parser.CharacterDataHandler = self.counting_handler
+         parser.buffer_text = 1
+@@ -568,8 +574,8 @@
+         self.assertEqual(self.n, 2)
+ 
+     def test_change_size_2(self):
+-        xml1 = "<?xml version='1.0' encoding='iso8859'?><a>a<s>%s" % ('a' * 1023)
+-        xml2 = "aaa</s><s>%s</s></a>" % ('a' * 1025)
++        xml1 = b"<?xml version='1.0' encoding='iso8859'?><a>a<s>" + b'a' * 1023
++        xml2 = b'aaa</s><s>' + b'a' * 1025 + b'</s></a>'
+         parser = expat.ParserCreate()
+         parser.CharacterDataHandler = self.counting_handler
+         parser.buffer_text = 1
+@@ -585,7 +591,7 @@
+ 
+ class MalformedInputTest(unittest.TestCase):
+     def test1(self):
+-        xml = "\0\r\n"
++        xml = b"\0\r\n"
+         parser = expat.ParserCreate()
+         try:
+             parser.Parse(xml, True)
+@@ -594,7 +600,8 @@
+             self.assertEqual(str(e), 'unclosed token: line 2, column 0')
+ 
+     def test2(self):
+-        xml = "<?xml version\xc2\x85='1.0'?>\r\n"
++        # \xc2\x85 is UTF-8 encoded U+0085 (NEXT LINE)
++        xml = b"<?xml version\xc2\x85='1.0'?>\r\n"
+         parser = expat.ParserCreate()
+         try:
+             parser.Parse(xml, True)
+@@ -609,7 +616,7 @@
+                          errors.messages[errors.codes[errors.XML_ERROR_SYNTAX]])
+ 
+     def test_expaterror(self):
+-        xml = '<'
++        xml = b'<'
+         parser = expat.ParserCreate()
+         try:
+             parser.Parse(xml, True)
+@@ -638,7 +645,17 @@
+         parser.UseForeignDTD(True)
+         parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS)
+         parser.ExternalEntityRefHandler = resolve_entity
+-        parser.Parse("<?xml version='1.0'?><element/>")
++        parser.Parse(b"<?xml version='1.0'?><element/>")
++        self.assertEqual(handler_call_args, [(None, None)])
++
++        # test UseForeignDTD() is equal to UseForeignDTD(True)
++        handler_call_args[:] = []
++
++        parser = expat.ParserCreate()
++        parser.UseForeignDTD()
++        parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS)
++        parser.ExternalEntityRefHandler = resolve_entity
++        parser.Parse(b"<?xml version='1.0'?><element/>")
+         self.assertEqual(handler_call_args, [(None, None)])
+ 
+     def test_ignore_use_foreign_dtd(self):
+@@ -657,7 +674,7 @@
+         parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS)
+         parser.ExternalEntityRefHandler = resolve_entity
+         parser.Parse(
+-            "<?xml version='1.0'?><!DOCTYPE foo PUBLIC 'bar' 'baz'><element/>")
++            b"<?xml version='1.0'?><!DOCTYPE foo PUBLIC 'bar' 'baz'><element/>")
+         self.assertEqual(handler_call_args, [("bar", "baz")])
+ 
+ 
+diff -r bd8afb90ebf2 Lib/test/test_random.py
+--- a/Lib/test/test_random.py
++++ b/Lib/test/test_random.py
+@@ -440,6 +440,7 @@
+         g.random = x[:].pop; g.paretovariate(1.0)
+         g.random = x[:].pop; g.expovariate(1.0)
+         g.random = x[:].pop; g.weibullvariate(1.0, 1.0)
++        g.random = x[:].pop; g.vonmisesvariate(1.0, 1.0)
+         g.random = x[:].pop; g.normalvariate(0.0, 1.0)
+         g.random = x[:].pop; g.gauss(0.0, 1.0)
+         g.random = x[:].pop; g.lognormvariate(0.0, 1.0)
+@@ -460,6 +461,7 @@
+                 (g.uniform, (1.0,10.0), (10.0+1.0)/2, (10.0-1.0)**2/12),
+                 (g.triangular, (0.0, 1.0, 1.0/3.0), 4.0/9.0, 7.0/9.0/18.0),
+                 (g.expovariate, (1.5,), 1/1.5, 1/1.5**2),
++                (g.vonmisesvariate, (1.23, 0), pi, pi**2/3),
+                 (g.paretovariate, (5.0,), 5.0/(5.0-1),
+                                   5.0/((5.0-1)**2*(5.0-2))),
+                 (g.weibullvariate, (1.0, 3.0), gamma(1+1/3.0),
+@@ -476,8 +478,50 @@
+                 s1 += e
+                 s2 += (e - mu) ** 2
+             N = len(y)
+-            self.assertAlmostEqual(s1/N, mu, places=2)
+-            self.assertAlmostEqual(s2/(N-1), sigmasqrd, places=2)
++            self.assertAlmostEqual(s1/N, mu, places=2,
++                                   msg='%s%r' % (variate.__name__, args))
++            self.assertAlmostEqual(s2/(N-1), sigmasqrd, places=2,
++                                   msg='%s%r' % (variate.__name__, args))
++
++    def test_constant(self):
++        g = random.Random()
++        N = 100
++        for variate, args, expected in [
++                (g.uniform, (10.0, 10.0), 10.0),
++                (g.triangular, (10.0, 10.0), 10.0),
++                #(g.triangular, (10.0, 10.0, 10.0), 10.0),
++                (g.expovariate, (float('inf'),), 0.0),
++                (g.vonmisesvariate, (3.0, float('inf')), 3.0),
++                (g.gauss, (10.0, 0.0), 10.0),
++                (g.lognormvariate, (0.0, 0.0), 1.0),
++                (g.lognormvariate, (-float('inf'), 0.0), 0.0),
++                (g.normalvariate, (10.0, 0.0), 10.0),
++                (g.paretovariate, (float('inf'),), 1.0),
++                (g.weibullvariate, (10.0, float('inf')), 10.0),
++                (g.weibullvariate, (0.0, 10.0), 0.0),
++            ]:
++            for i in range(N):
++                self.assertEqual(variate(*args), expected)
++
++    def test_von_mises_range(self):
++        # Issue 17149: von mises variates were not consistently in the
++        # range [0, 2*PI].
++        g = random.Random()
++        N = 100
++        for mu in 0.0, 0.1, 3.1, 6.2:
++            for kappa in 0.0, 2.3, 500.0:
++                for _ in range(N):
++                    sample = g.vonmisesvariate(mu, kappa)
++                    self.assertTrue(
++                        0 <= sample <= random.TWOPI,
++                        msg=("vonmisesvariate({}, {}) produced a result {} out"
++                             " of range [0, 2*pi]").format(mu, kappa, sample))
++
++    def test_von_mises_large_kappa(self):
++        # Issue #17141: vonmisesvariate() was hang for large kappas
++        random.vonmisesvariate(0, 1e15)
++        random.vonmisesvariate(0, 1e100)
++
+ 
+ class TestModule(unittest.TestCase):
+     def testMagicConstants(self):
+diff -r bd8afb90ebf2 Lib/test/test_range.py
+--- a/Lib/test/test_range.py
++++ b/Lib/test/test_range.py
+@@ -312,6 +312,15 @@
+ 
+         self.assertRaises(TypeError, range, IN())
+ 
++        # Test use of user-defined classes in slice indices.
++        self.assertEqual(list(range(10)[:I(5)]), list(range(5)))
++
++        with self.assertRaises(RuntimeError):
++            range(0, 10)[:IX()]
++
++        with self.assertRaises(TypeError):
++            range(0, 10)[:IN()]
++
+     def test_count(self):
+         self.assertEqual(range(3).count(-1), 0)
+         self.assertEqual(range(3).count(0), 1)
+diff -r bd8afb90ebf2 Lib/test/test_re.py
+--- a/Lib/test/test_re.py
++++ b/Lib/test/test_re.py
+@@ -1,4 +1,5 @@
+-from test.support import verbose, run_unittest, gc_collect
++from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
++        cpython_only
+ import io
+ import re
+ from re import Scanner
+@@ -161,11 +162,31 @@
+         self.assertEqual(re.sub('x*', '-', 'abxd'), '-a-b-d-')
+         self.assertEqual(re.sub('x+', '-', 'abxd'), 'ab-d')
+ 
++    def test_symbolic_groups(self):
++        re.compile('(?P<a>x)(?P=a)(?(a)y)')
++        re.compile('(?P<a1>x)(?P=a1)(?(a1)y)')
++        self.assertRaises(re.error, re.compile, '(?P<a>)(?P<a>)')
++        self.assertRaises(re.error, re.compile, '(?Px)')
++        self.assertRaises(re.error, re.compile, '(?P=)')
++        self.assertRaises(re.error, re.compile, '(?P=1)')
++        self.assertRaises(re.error, re.compile, '(?P=a)')
++        self.assertRaises(re.error, re.compile, '(?P=a1)')
++        self.assertRaises(re.error, re.compile, '(?P=a.)')
++        self.assertRaises(re.error, re.compile, '(?P<)')
++        self.assertRaises(re.error, re.compile, '(?P<>)')
++        self.assertRaises(re.error, re.compile, '(?P<1>)')
++        self.assertRaises(re.error, re.compile, '(?P<a.>)')
++        self.assertRaises(re.error, re.compile, '(?())')
++        self.assertRaises(re.error, re.compile, '(?(a))')
++        self.assertRaises(re.error, re.compile, '(?(1a))')
++        self.assertRaises(re.error, re.compile, '(?(a.))')
++
+     def test_symbolic_refs(self):
+         self.assertRaises(re.error, re.sub, '(?P<a>x)', '\g<a', 'xx')
+         self.assertRaises(re.error, re.sub, '(?P<a>x)', '\g<', 'xx')
+         self.assertRaises(re.error, re.sub, '(?P<a>x)', '\g', 'xx')
+         self.assertRaises(re.error, re.sub, '(?P<a>x)', '\g<a a>', 'xx')
++        self.assertRaises(re.error, re.sub, '(?P<a>x)', '\g<>', 'xx')
+         self.assertRaises(re.error, re.sub, '(?P<a>x)', '\g<1a1>', 'xx')
+         self.assertRaises(IndexError, re.sub, '(?P<a>x)', '\g<ab>', 'xx')
+         self.assertRaises(re.error, re.sub, '(?P<a>x)|(?P<b>y)', '\g<b>', 'xx')
+@@ -399,6 +420,12 @@
+         self.assertEqual(re.match("([\u2222\u2223])",
+                                   "\u2222", re.UNICODE).group(1), "\u2222")
+ 
++    def test_big_codesize(self):
++        # Issue #1160
++        r = re.compile('|'.join(('%d'%x for x in range(10000))))
++        self.assertIsNotNone(r.match('1000'))
++        self.assertIsNotNone(r.match('9999'))
++
+     def test_anyall(self):
+         self.assertEqual(re.match("a.b", "a\nb", re.DOTALL).group(0),
+                          "a\nb")
+@@ -654,6 +681,15 @@
+         self.assertEqual(re.match('(x)*y', 50000*'x'+'y').group(1), 'x')
+         self.assertEqual(re.match('(x)*?y', 50000*'x'+'y').group(1), 'x')
+ 
++    def test_unlimited_zero_width_repeat(self):
++        # Issue #9669
++        self.assertIsNone(re.match(r'(?:a?)*y', 'z'))
++        self.assertIsNone(re.match(r'(?:a?)+y', 'z'))
++        self.assertIsNone(re.match(r'(?:a?){2,}y', 'z'))
++        self.assertIsNone(re.match(r'(?:a?)*?y', 'z'))
++        self.assertIsNone(re.match(r'(?:a?)+?y', 'z'))
++        self.assertIsNone(re.match(r'(?:a?){2,}?y', 'z'))
++
+     def test_scanner(self):
+         def s_ident(scanner, token): return token
+         def s_operator(scanner, token): return "op%s" % token
+@@ -923,6 +959,68 @@
+         # Test behaviour when not given a string or pattern as parameter
+         self.assertRaises(TypeError, re.compile, 0)
+ 
++    def test_bug_13899(self):
++        # Issue #13899: re pattern r"[\A]" should work like "A" but matches
++        # nothing. Ditto B and Z.
++        self.assertEqual(re.findall(r'[\A\B\b\C\Z]', 'AB\bCZ'),
++                         ['A', 'B', '\b', 'C', 'Z'])
++
++    @bigmemtest(size=_2G, memuse=1)
++    def test_large_search(self, size):
++        # Issue #10182: indices were 32-bit-truncated.
++        s = 'a' * size
++        m = re.search('$', s)
++        self.assertIsNotNone(m)
++        self.assertEqual(m.start(), size)
++        self.assertEqual(m.end(), size)
++
++    # The huge memuse is because of re.sub() using a list and a join()
++    # to create the replacement result.
++    @bigmemtest(size=_2G, memuse=16 + 2)
++    def test_large_subn(self, size):
++        # Issue #10182: indices were 32-bit-truncated.
++        s = 'a' * size
++        r, n = re.subn('', '', s)
++        self.assertEqual(r, s)
++        self.assertEqual(n, size + 1)
++
++    def test_bug_16688(self):
++        # Issue 16688: Backreferences make case-insensitive regex fail on
++        # non-ASCII strings.
++        self.assertEqual(re.findall(r"(?i)(a)\1", "aa \u0100"), ['a'])
++        self.assertEqual(re.match(r"(?s).{1,3}", "\u0100\u0100").span(), (0, 2))
++
++    def test_repeat_minmax_overflow(self):
++        # Issue #13169
++        string = "x" * 100000
++        self.assertEqual(re.match(r".{65535}", string).span(), (0, 65535))
++        self.assertEqual(re.match(r".{,65535}", string).span(), (0, 65535))
++        self.assertEqual(re.match(r".{65535,}?", string).span(), (0, 65535))
++        self.assertEqual(re.match(r".{65536}", string).span(), (0, 65536))
++        self.assertEqual(re.match(r".{,65536}", string).span(), (0, 65536))
++        self.assertEqual(re.match(r".{65536,}?", string).span(), (0, 65536))
++        # 2**128 should be big enough to overflow both SRE_CODE and Py_ssize_t.
++        self.assertRaises(OverflowError, re.compile, r".{%d}" % 2**128)
++        self.assertRaises(OverflowError, re.compile, r".{,%d}" % 2**128)
++        self.assertRaises(OverflowError, re.compile, r".{%d,}?" % 2**128)
++        self.assertRaises(OverflowError, re.compile, r".{%d,%d}" % (2**129, 2**128))
++
++    @cpython_only
++    def test_repeat_minmax_overflow_maxrepeat(self):
++        try:
++            from _sre import MAXREPEAT
++        except ImportError:
++            self.skipTest('requires _sre.MAXREPEAT constant')
++        string = "x" * 100000
++        self.assertIsNone(re.match(r".{%d}" % (MAXREPEAT - 1), string))
++        self.assertEqual(re.match(r".{,%d}" % (MAXREPEAT - 1), string).span(),
++                         (0, 100000))
++        self.assertIsNone(re.match(r".{%d,}?" % (MAXREPEAT - 1), string))
++        self.assertRaises(OverflowError, re.compile, r".{%d}" % MAXREPEAT)
++        self.assertRaises(OverflowError, re.compile, r".{,%d}" % MAXREPEAT)
++        self.assertRaises(OverflowError, re.compile, r".{%d,}?" % MAXREPEAT)
++
++
+ def run_re_tests():
+     from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
+     if verbose:
+diff -r bd8afb90ebf2 Lib/test/test_resource.py
+--- a/Lib/test/test_resource.py
++++ b/Lib/test/test_resource.py
+@@ -107,6 +107,23 @@
+         except (ValueError, AttributeError):
+             pass
+ 
++    # Issue 6083: Reference counting bug
++    def test_setrusage_refcount(self):
++        try:
++            limits = resource.getrlimit(resource.RLIMIT_CPU)
++        except AttributeError:
++            pass
++        else:
++            class BadSequence:
++                def __len__(self):
++                    return 2
++                def __getitem__(self, key):
++                    if key in (0, 1):
++                        return len(tuple(range(1000000)))
++                    raise IndexError
++
++            resource.setrlimit(resource.RLIMIT_CPU, BadSequence())
++
+ def test_main(verbose=None):
+     support.run_unittest(ResourceTest)
+ 
+diff -r bd8afb90ebf2 Lib/test/test_runpy.py
+--- a/Lib/test/test_runpy.py
++++ b/Lib/test/test_runpy.py
+@@ -565,10 +565,10 @@
+             with open(filename, 'w', encoding='latin1') as f:
+                 f.write("""
+ #coding:latin1
+-"non-ASCII: h\xe9"
++s = "non-ASCII: h\xe9"
+ """)
+             result = run_path(filename)
+-            self.assertEqual(result['__doc__'], "non-ASCII: h\xe9")
++            self.assertEqual(result['s'], "non-ASCII: h\xe9")
+ 
+ 
+ def test_main():
+diff -r bd8afb90ebf2 Lib/test/test_sax.py
+--- a/Lib/test/test_sax.py
++++ b/Lib/test/test_sax.py
+@@ -13,7 +13,10 @@
+ from xml.sax.expatreader import create_parser
+ from xml.sax.handler import feature_namespaces
+ from xml.sax.xmlreader import InputSource, AttributesImpl, AttributesNSImpl
+-from io import StringIO
++from io import BytesIO, StringIO
++import os.path
++import shutil
++from test import support
+ from test.support import findfile, run_unittest
+ import unittest
+ 
+@@ -25,6 +28,18 @@
+ except UnicodeEncodeError:
+     raise unittest.SkipTest("filename is not encodable to utf8")
+ 
++supports_nonascii_filenames = True
++if not os.path.supports_unicode_filenames:
++    try:
++        support.TESTFN_UNICODE.encode(support.TESTFN_ENCODING)
++    except (UnicodeError, TypeError):
++        # Either the file system encoding is None, or the file name
++        # cannot be encoded in the file system encoding.
++        supports_nonascii_filenames = False
++requires_nonascii_filenames = unittest.skipUnless(
++        supports_nonascii_filenames,
++        'Requires non-ascii filenames support')
++
+ ns_uri = "http://www.python.org/xml-ns/saxtest/"
+ 
+ class XmlTestBase(unittest.TestCase):
+@@ -158,31 +173,29 @@
+ 
+ # ===== XMLGenerator
+ 
+-start = '<?xml version="1.0" encoding="iso-8859-1"?>\n'
+-
+-class XmlgenTest(unittest.TestCase):
++class XmlgenTest:
+     def test_xmlgen_basic(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result)
+         gen.startDocument()
+         gen.startElement("doc", {})
+         gen.endElement("doc")
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start + "<doc></doc>")
++        self.assertEqual(result.getvalue(), self.xml("<doc></doc>"))
+ 
+     def test_xmlgen_basic_empty(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result, short_empty_elements=True)
+         gen.startDocument()
+         gen.startElement("doc", {})
+         gen.endElement("doc")
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start + "<doc/>")
++        self.assertEqual(result.getvalue(), self.xml("<doc/>"))
+ 
+     def test_xmlgen_content(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result)
+ 
+         gen.startDocument()
+@@ -191,10 +204,10 @@
+         gen.endElement("doc")
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start + "<doc>huhei</doc>")
++        self.assertEqual(result.getvalue(), self.xml("<doc>huhei</doc>"))
+ 
+     def test_xmlgen_content_empty(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result, short_empty_elements=True)
+ 
+         gen.startDocument()
+@@ -203,10 +216,10 @@
+         gen.endElement("doc")
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start + "<doc>huhei</doc>")
++        self.assertEqual(result.getvalue(), self.xml("<doc>huhei</doc>"))
+ 
+     def test_xmlgen_pi(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result)
+ 
+         gen.startDocument()
+@@ -215,10 +228,11 @@
+         gen.endElement("doc")
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start + "<?test data?><doc></doc>")
++        self.assertEqual(result.getvalue(),
++            self.xml("<?test data?><doc></doc>"))
+ 
+     def test_xmlgen_content_escape(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result)
+ 
+         gen.startDocument()
+@@ -228,10 +242,10 @@
+         gen.endDocument()
+ 
+         self.assertEqual(result.getvalue(),
+-            start + "<doc>&lt;huhei&amp;</doc>")
++            self.xml("<doc>&lt;huhei&amp;</doc>"))
+ 
+     def test_xmlgen_attr_escape(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result)
+ 
+         gen.startDocument()
+@@ -245,13 +259,43 @@
+         gen.endElement("doc")
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start +
+-            ("<doc a='\"'><e a=\"'\"></e>"
+-             "<e a=\"'&quot;\"></e>"
+-             "<e a=\"&#10;&#13;&#9;\"></e></doc>"))
++        self.assertEqual(result.getvalue(), self.xml(
++            "<doc a='\"'><e a=\"'\"></e>"
++            "<e a=\"'&quot;\"></e>"
++            "<e a=\"&#10;&#13;&#9;\"></e></doc>"))
++
++    def test_xmlgen_encoding(self):
++        encodings = ('iso-8859-15', 'utf-8', 'utf-8-sig',
++                     'utf-16', 'utf-16be', 'utf-16le',
++                     'utf-32', 'utf-32be', 'utf-32le')
++        for encoding in encodings:
++            result = self.ioclass()
++            gen = XMLGenerator(result, encoding=encoding)
++
++            gen.startDocument()
++            gen.startElement("doc", {"a": '\u20ac'})
++            gen.characters("\u20ac")
++            gen.endElement("doc")
++            gen.endDocument()
++
++            self.assertEqual(result.getvalue(),
++                self.xml('<doc a="\u20ac">\u20ac</doc>', encoding=encoding))
++
++    def test_xmlgen_unencodable(self):
++        result = self.ioclass()
++        gen = XMLGenerator(result, encoding='ascii')
++
++        gen.startDocument()
++        gen.startElement("doc", {"a": '\u20ac'})
++        gen.characters("\u20ac")
++        gen.endElement("doc")
++        gen.endDocument()
++
++        self.assertEqual(result.getvalue(),
++            self.xml('<doc a="&#8364;">&#8364;</doc>', encoding='ascii'))
+ 
+     def test_xmlgen_ignorable(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result)
+ 
+         gen.startDocument()
+@@ -260,10 +304,10 @@
+         gen.endElement("doc")
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start + "<doc> </doc>")
++        self.assertEqual(result.getvalue(), self.xml("<doc> </doc>"))
+ 
+     def test_xmlgen_ignorable_empty(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result, short_empty_elements=True)
+ 
+         gen.startDocument()
+@@ -272,10 +316,10 @@
+         gen.endElement("doc")
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start + "<doc> </doc>")
++        self.assertEqual(result.getvalue(), self.xml("<doc> </doc>"))
+ 
+     def test_xmlgen_ns(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result)
+ 
+         gen.startDocument()
+@@ -288,12 +332,12 @@
+         gen.endPrefixMapping("ns1")
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start + \
+-           ('<ns1:doc xmlns:ns1="%s"><udoc></udoc></ns1:doc>' %
++        self.assertEqual(result.getvalue(), self.xml(
++           '<ns1:doc xmlns:ns1="%s"><udoc></udoc></ns1:doc>' %
+                                          ns_uri))
+ 
+     def test_xmlgen_ns_empty(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result, short_empty_elements=True)
+ 
+         gen.startDocument()
+@@ -306,12 +350,12 @@
+         gen.endPrefixMapping("ns1")
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start + \
+-           ('<ns1:doc xmlns:ns1="%s"><udoc/></ns1:doc>' %
++        self.assertEqual(result.getvalue(), self.xml(
++           '<ns1:doc xmlns:ns1="%s"><udoc/></ns1:doc>' %
+                                          ns_uri))
+ 
+     def test_1463026_1(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result)
+ 
+         gen.startDocument()
+@@ -319,10 +363,10 @@
+         gen.endElementNS((None, 'a'), 'a')
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start+'<a b="c"></a>')
++        self.assertEqual(result.getvalue(), self.xml('<a b="c"></a>'))
+ 
+     def test_1463026_1_empty(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result, short_empty_elements=True)
+ 
+         gen.startDocument()
+@@ -330,10 +374,10 @@
+         gen.endElementNS((None, 'a'), 'a')
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start+'<a b="c"/>')
++        self.assertEqual(result.getvalue(), self.xml('<a b="c"/>'))
+ 
+     def test_1463026_2(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result)
+ 
+         gen.startDocument()
+@@ -343,10 +387,10 @@
+         gen.endPrefixMapping(None)
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start+'<a xmlns="qux"></a>')
++        self.assertEqual(result.getvalue(), self.xml('<a xmlns="qux"></a>'))
+ 
+     def test_1463026_2_empty(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result, short_empty_elements=True)
+ 
+         gen.startDocument()
+@@ -356,10 +400,10 @@
+         gen.endPrefixMapping(None)
+         gen.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start+'<a xmlns="qux"/>')
++        self.assertEqual(result.getvalue(), self.xml('<a xmlns="qux"/>'))
+ 
+     def test_1463026_3(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result)
+ 
+         gen.startDocument()
+@@ -370,10 +414,10 @@
+         gen.endDocument()
+ 
+         self.assertEqual(result.getvalue(),
+-            start+'<my:a xmlns:my="qux" b="c"></my:a>')
++            self.xml('<my:a xmlns:my="qux" b="c"></my:a>'))
+ 
+     def test_1463026_3_empty(self):
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result, short_empty_elements=True)
+ 
+         gen.startDocument()
+@@ -384,12 +428,12 @@
+         gen.endDocument()
+ 
+         self.assertEqual(result.getvalue(),
+-            start+'<my:a xmlns:my="qux" b="c"/>')
++            self.xml('<my:a xmlns:my="qux" b="c"/>'))
+ 
+     def test_5027_1(self):
+         # The xml prefix (as in xml:lang below) is reserved and bound by
+         # definition to http://www.w3.org/XML/1998/namespace.  XMLGenerator had
+-        # a bug whereby a KeyError is thrown because this namespace is missing
++        # a bug whereby a KeyError is raised because this namespace is missing
+         # from a dictionary.
+         #
+         # This test demonstrates the bug by parsing a document.
+@@ -401,13 +445,13 @@
+ 
+         parser = make_parser()
+         parser.setFeature(feature_namespaces, True)
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result)
+         parser.setContentHandler(gen)
+         parser.parse(test_xml)
+ 
+         self.assertEqual(result.getvalue(),
+-                         start + (
++                         self.xml(
+                          '<a:g1 xmlns:a="http://example.com/ns">'
+                           '<a:g2 xml:lang="en">Hello</a:g2>'
+                          '</a:g1>'))
+@@ -415,12 +459,12 @@
+     def test_5027_2(self):
+         # The xml prefix (as in xml:lang below) is reserved and bound by
+         # definition to http://www.w3.org/XML/1998/namespace.  XMLGenerator had
+-        # a bug whereby a KeyError is thrown because this namespace is missing
++        # a bug whereby a KeyError is raised because this namespace is missing
+         # from a dictionary.
+         #
+         # This test demonstrates the bug by direct manipulation of the
+         # XMLGenerator.
+-        result = StringIO()
++        result = self.ioclass()
+         gen = XMLGenerator(result)
+ 
+         gen.startDocument()
+@@ -435,15 +479,57 @@
+         gen.endDocument()
+ 
+         self.assertEqual(result.getvalue(),
+-                         start + (
++                         self.xml(
+                          '<a:g1 xmlns:a="http://example.com/ns">'
+                           '<a:g2 xml:lang="en">Hello</a:g2>'
+                          '</a:g1>'))
+ 
++    def test_no_close_file(self):
++        result = self.ioclass()
++        def func(out):
++            gen = XMLGenerator(out)
++            gen.startDocument()
++            gen.startElement("doc", {})
++        func(result)
++        self.assertFalse(result.closed)
++
++class StringXmlgenTest(XmlgenTest, unittest.TestCase):
++    ioclass = StringIO
++
++    def xml(self, doc, encoding='iso-8859-1'):
++        return '<?xml version="1.0" encoding="%s"?>\n%s' % (encoding, doc)
++
++    test_xmlgen_unencodable = None
++
++class BytesXmlgenTest(XmlgenTest, unittest.TestCase):
++    ioclass = BytesIO
++
++    def xml(self, doc, encoding='iso-8859-1'):
++        return ('<?xml version="1.0" encoding="%s"?>\n%s' %
++                (encoding, doc)).encode(encoding, 'xmlcharrefreplace')
++
++class WriterXmlgenTest(BytesXmlgenTest):
++    class ioclass(list):
++        write = list.append
++        closed = False
++
++        def seekable(self):
++            return True
++
++        def tell(self):
++            # return 0 at start and not 0 after start
++            return len(self)
++
++        def getvalue(self):
++            return b''.join(self)
++
++
++start = b'<?xml version="1.0" encoding="iso-8859-1"?>\n'
++
+ 
+ class XMLFilterBaseTest(unittest.TestCase):
+     def test_filter_basic(self):
+-        result = StringIO()
++        result = BytesIO()
+         gen = XMLGenerator(result)
+         filter = XMLFilterBase()
+         filter.setContentHandler(gen)
+@@ -455,7 +541,7 @@
+         filter.endElement("doc")
+         filter.endDocument()
+ 
+-        self.assertEqual(result.getvalue(), start + "<doc>content </doc>")
++        self.assertEqual(result.getvalue(), start + b"<doc>content </doc>")
+ 
+ # ===========================================================================
+ #
+@@ -463,7 +549,7 @@
+ #
+ # ===========================================================================
+ 
+-with open(TEST_XMLFILE_OUT) as f:
++with open(TEST_XMLFILE_OUT, 'rb') as f:
+     xml_test_out = f.read()
+ 
+ class ExpatReaderTest(XmlTestBase):
+@@ -472,15 +558,30 @@
+ 
+     def test_expat_file(self):
+         parser = create_parser()
+-        result = StringIO()
++        result = BytesIO()
+         xmlgen = XMLGenerator(result)
+ 
+         parser.setContentHandler(xmlgen)
+-        with open(TEST_XMLFILE) as f:
++        with open(TEST_XMLFILE, 'rb') as f:
+             parser.parse(f)
+ 
+         self.assertEqual(result.getvalue(), xml_test_out)
+ 
++    @requires_nonascii_filenames
++    def test_expat_file_nonascii(self):
++        fname = support.TESTFN_UNICODE
++        shutil.copyfile(TEST_XMLFILE, fname)
++        self.addCleanup(support.unlink, fname)
++
++        parser = create_parser()
++        result = BytesIO()
++        xmlgen = XMLGenerator(result)
++
++        parser.setContentHandler(xmlgen)
++        parser.parse(open(fname))
++
++        self.assertEqual(result.getvalue(), xml_test_out)
++
+     # ===== DTDHandler support
+ 
+     class TestDTDHandler:
+@@ -517,13 +618,13 @@
+ 
+         def resolveEntity(self, publicId, systemId):
+             inpsrc = InputSource()
+-            inpsrc.setByteStream(StringIO("<entity/>"))
++            inpsrc.setByteStream(BytesIO(b"<entity/>"))
+             return inpsrc
+ 
+     def test_expat_entityresolver(self):
+         parser = create_parser()
+         parser.setEntityResolver(self.TestEntityResolver())
+-        result = StringIO()
++        result = BytesIO()
+         parser.setContentHandler(XMLGenerator(result))
+ 
+         parser.feed('<!DOCTYPE doc [\n')
+@@ -533,7 +634,7 @@
+         parser.close()
+ 
+         self.assertEqual(result.getvalue(), start +
+-                         "<doc><entity></entity></doc>")
++                         b"<doc><entity></entity></doc>")
+ 
+     # ===== Attributes support
+ 
+@@ -602,7 +703,7 @@
+ 
+     def test_expat_inpsource_filename(self):
+         parser = create_parser()
+-        result = StringIO()
++        result = BytesIO()
+         xmlgen = XMLGenerator(result)
+ 
+         parser.setContentHandler(xmlgen)
+@@ -612,7 +713,7 @@
+ 
+     def test_expat_inpsource_sysid(self):
+         parser = create_parser()
+-        result = StringIO()
++        result = BytesIO()
+         xmlgen = XMLGenerator(result)
+ 
+         parser.setContentHandler(xmlgen)
+@@ -620,14 +721,29 @@
+ 
+         self.assertEqual(result.getvalue(), xml_test_out)
+ 
++    @requires_nonascii_filenames
++    def test_expat_inpsource_sysid_nonascii(self):
++        fname = support.TESTFN_UNICODE
++        shutil.copyfile(TEST_XMLFILE, fname)
++        self.addCleanup(support.unlink, fname)
++
++        parser = create_parser()
++        result = BytesIO()
++        xmlgen = XMLGenerator(result)
++
++        parser.setContentHandler(xmlgen)
++        parser.parse(InputSource(fname))
++
++        self.assertEqual(result.getvalue(), xml_test_out)
++
+     def test_expat_inpsource_stream(self):
+         parser = create_parser()
+-        result = StringIO()
++        result = BytesIO()
+         xmlgen = XMLGenerator(result)
+ 
+         parser.setContentHandler(xmlgen)
+         inpsrc = InputSource()
+-        with open(TEST_XMLFILE) as f:
++        with open(TEST_XMLFILE, 'rb') as f:
+             inpsrc.setByteStream(f)
+             parser.parse(inpsrc)
+ 
+@@ -636,7 +752,7 @@
+     # ===== IncrementalParser support
+ 
+     def test_expat_incremental(self):
+-        result = StringIO()
++        result = BytesIO()
+         xmlgen = XMLGenerator(result)
+         parser = create_parser()
+         parser.setContentHandler(xmlgen)
+@@ -645,10 +761,10 @@
+         parser.feed("</doc>")
+         parser.close()
+ 
+-        self.assertEqual(result.getvalue(), start + "<doc></doc>")
++        self.assertEqual(result.getvalue(), start + b"<doc></doc>")
+ 
+     def test_expat_incremental_reset(self):
+-        result = StringIO()
++        result = BytesIO()
+         xmlgen = XMLGenerator(result)
+         parser = create_parser()
+         parser.setContentHandler(xmlgen)
+@@ -656,7 +772,7 @@
+         parser.feed("<doc>")
+         parser.feed("text")
+ 
+-        result = StringIO()
++        result = BytesIO()
+         xmlgen = XMLGenerator(result)
+         parser.setContentHandler(xmlgen)
+         parser.reset()
+@@ -666,12 +782,12 @@
+         parser.feed("</doc>")
+         parser.close()
+ 
+-        self.assertEqual(result.getvalue(), start + "<doc>text</doc>")
++        self.assertEqual(result.getvalue(), start + b"<doc>text</doc>")
+ 
+     # ===== Locator support
+ 
+     def test_expat_locator_noinfo(self):
+-        result = StringIO()
++        result = BytesIO()
+         xmlgen = XMLGenerator(result)
+         parser = create_parser()
+         parser.setContentHandler(xmlgen)
+@@ -685,7 +801,7 @@
+         self.assertEqual(parser.getLineNumber(), 1)
+ 
+     def test_expat_locator_withinfo(self):
+-        result = StringIO()
++        result = BytesIO()
+         xmlgen = XMLGenerator(result)
+         parser = create_parser()
+         parser.setContentHandler(xmlgen)
+@@ -694,6 +810,21 @@
+         self.assertEqual(parser.getSystemId(), TEST_XMLFILE)
+         self.assertEqual(parser.getPublicId(), None)
+ 
++    @requires_nonascii_filenames
++    def test_expat_locator_withinfo_nonascii(self):
++        fname = support.TESTFN_UNICODE
++        shutil.copyfile(TEST_XMLFILE, fname)
++        self.addCleanup(support.unlink, fname)
++
++        result = BytesIO()
++        xmlgen = XMLGenerator(result)
++        parser = create_parser()
++        parser.setContentHandler(xmlgen)
++        parser.parse(fname)
++
++        self.assertEqual(parser.getSystemId(), fname)
++        self.assertEqual(parser.getPublicId(), None)
++
+ 
+ # ===========================================================================
+ #
+@@ -706,7 +837,7 @@
+         parser = create_parser()
+         parser.setContentHandler(ContentHandler()) # do nothing
+         source = InputSource()
+-        source.setByteStream(StringIO("<foo bar foobar>"))   #ill-formed
++        source.setByteStream(BytesIO(b"<foo bar foobar>"))   #ill-formed
+         name = "a file name"
+         source.setSystemId(name)
+         try:
+@@ -797,7 +928,9 @@
+ def test_main():
+     run_unittest(MakeParserTest,
+                  SaxutilsTest,
+-                 XmlgenTest,
++                 StringXmlgenTest,
++                 BytesXmlgenTest,
++                 WriterXmlgenTest,
+                  ExpatReaderTest,
+                  ErrorReportingTest,
+                  XmlReaderTest)
+diff -r bd8afb90ebf2 Lib/test/test_sched.py
+--- a/Lib/test/test_sched.py
++++ b/Lib/test/test_sched.py
+@@ -1,9 +1,44 @@
+ #!/usr/bin/env python
+ 
++import queue
+ import sched
+ import time
+ import unittest
+ from test import support
++try:
++    import threading
++except ImportError:
++    threading = None
++
++TIMEOUT = 10
++
++
++class Timer:
++    def __init__(self):
++        self._cond = threading.Condition()
++        self._time = 0
++        self._stop = 0
++
++    def time(self):
++        with self._cond:
++            return self._time
++
++    # increase the time but not beyond the established limit
++    def sleep(self, t):
++        assert t >= 0
++        with self._cond:
++            t += self._time
++            while self._stop < t:
++                self._time = self._stop
++                self._cond.wait()
++            self._time = t
++
++    # advance time limit for user code
++    def advance(self, t):
++        assert t >= 0
++        with self._cond:
++            self._stop += t
++            self._cond.notify_all()
+ 
+ 
+ class TestCase(unittest.TestCase):
+@@ -26,6 +61,37 @@
+         scheduler.run()
+         self.assertEqual(l, [0.01, 0.02, 0.03, 0.04, 0.05])
+ 
++    @unittest.skipUnless(threading, 'Threading required for this test.')
++    def test_enter_concurrent(self):
++        q = queue.Queue()
++        fun = q.put
++        timer = Timer()
++        scheduler = sched.scheduler(timer.time, timer.sleep)
++        scheduler.enter(1, 1, fun, (1,))
++        scheduler.enter(3, 1, fun, (3,))
++        t = threading.Thread(target=scheduler.run)
++        t.start()
++        timer.advance(1)
++        self.assertEqual(q.get(timeout=TIMEOUT), 1)
++        self.assertTrue(q.empty())
++        for x in [4, 5, 2]:
++            z = scheduler.enter(x - 1, 1, fun, (x,))
++        timer.advance(2)
++        self.assertEqual(q.get(timeout=TIMEOUT), 2)
++        self.assertEqual(q.get(timeout=TIMEOUT), 3)
++        self.assertTrue(q.empty())
++        timer.advance(1)
++        self.assertEqual(q.get(timeout=TIMEOUT), 4)
++        self.assertTrue(q.empty())
++        timer.advance(1)
++        self.assertEqual(q.get(timeout=TIMEOUT), 5)
++        self.assertTrue(q.empty())
++        timer.advance(1000)
++        t.join(timeout=TIMEOUT)
++        self.assertFalse(t.is_alive())
++        self.assertTrue(q.empty())
++        self.assertEqual(timer.time(), 5)
++
+     def test_priority(self):
+         l = []
+         fun = lambda x: l.append(x)
+@@ -50,6 +116,39 @@
+         scheduler.run()
+         self.assertEqual(l, [0.02, 0.03, 0.04])
+ 
++    @unittest.skipUnless(threading, 'Threading required for this test.')
++    def test_cancel_concurrent(self):
++        q = queue.Queue()
++        fun = q.put
++        timer = Timer()
++        scheduler = sched.scheduler(timer.time, timer.sleep)
++        now = timer.time()
++        event1 = scheduler.enterabs(now + 1, 1, fun, (1,))
++        event2 = scheduler.enterabs(now + 2, 1, fun, (2,))
++        event4 = scheduler.enterabs(now + 4, 1, fun, (4,))
++        event5 = scheduler.enterabs(now + 5, 1, fun, (5,))
++        event3 = scheduler.enterabs(now + 3, 1, fun, (3,))
++        t = threading.Thread(target=scheduler.run)
++        t.start()
++        timer.advance(1)
++        self.assertEqual(q.get(timeout=TIMEOUT), 1)
++        self.assertTrue(q.empty())
++        scheduler.cancel(event2)
++        scheduler.cancel(event5)
++        timer.advance(1)
++        self.assertTrue(q.empty())
++        timer.advance(1)
++        self.assertEqual(q.get(timeout=TIMEOUT), 3)
++        self.assertTrue(q.empty())
++        timer.advance(1)
++        self.assertEqual(q.get(timeout=TIMEOUT), 4)
++        self.assertTrue(q.empty())
++        timer.advance(1000)
++        t.join(timeout=TIMEOUT)
++        self.assertFalse(t.is_alive())
++        self.assertTrue(q.empty())
++        self.assertEqual(timer.time(), 4)
++
+     def test_empty(self):
+         l = []
+         fun = lambda x: l.append(x)
+diff -r bd8afb90ebf2 Lib/test/test_select.py
+--- a/Lib/test/test_select.py
++++ b/Lib/test/test_select.py
+@@ -65,6 +65,16 @@
+             self.fail('Unexpected return values from select():', rfd, wfd, xfd)
+         p.close()
+ 
++    # Issue 16230: Crash on select resized list
++    def test_select_mutated(self):
++        a = []
++        class F:
++            def fileno(self):
++                del a[-1]
++                return sys.__stdout__.fileno()
++        a[:] = [F()] * 10
++        self.assertEqual(select.select([], a, []), ([], a[:5], []))
++
+ def test_main():
+     support.run_unittest(SelectTestCase)
+     support.reap_children()
+diff -r bd8afb90ebf2 Lib/test/test_shutil.py
+--- a/Lib/test/test_shutil.py
++++ b/Lib/test/test_shutil.py
+@@ -126,6 +126,15 @@
+         os.symlink(dir_, link)
+         self.assertRaises(OSError, shutil.rmtree, link)
+         self.assertTrue(os.path.exists(dir_))
++        self.assertTrue(os.path.lexists(link))
++        errors = []
++        def onerror(*args):
++            errors.append(args)
++        shutil.rmtree(link, onerror=onerror)
++        self.assertEqual(len(errors), 1)
++        self.assertIs(errors[0][0], os.path.islink)
++        self.assertEqual(errors[0][1], link)
++        self.assertIsInstance(errors[0][2][1], OSError)
+ 
+     @support.skip_unless_symlink
+     def test_rmtree_works_on_symlinks(self):
+@@ -152,7 +161,38 @@
+     def test_rmtree_errors(self):
+         # filename is guaranteed not to exist
+         filename = tempfile.mktemp()
+-        self.assertRaises(OSError, shutil.rmtree, filename)
++        self.assertRaises(FileNotFoundError, shutil.rmtree, filename)
++        # test that ignore_errors option is honored
++        shutil.rmtree(filename, ignore_errors=True)
++
++        # existing file
++        tmpdir = self.mkdtemp()
++        write_file((tmpdir, "tstfile"), "")
++        filename = os.path.join(tmpdir, "tstfile")
++        with self.assertRaises(NotADirectoryError) as cm:
++            shutil.rmtree(filename)
++        # The reason for this rather odd construct is that Windows sprinkles
++        # a \*.* at the end of file names. But only sometimes on some buildbots
++        possible_args = [filename, os.path.join(filename, '*.*')]
++        self.assertIn(cm.exception.filename, possible_args)
++        self.assertTrue(os.path.exists(filename))
++        # test that ignore_errors option is honored
++        shutil.rmtree(filename, ignore_errors=True)
++        self.assertTrue(os.path.exists(filename))
++        errors = []
++        def onerror(*args):
++            errors.append(args)
++        shutil.rmtree(filename, onerror=onerror)
++        self.assertEqual(len(errors), 2)
++        self.assertIs(errors[0][0], os.listdir)
++        self.assertEqual(errors[0][1], filename)
++        self.assertIsInstance(errors[0][2][1], NotADirectoryError)
++        self.assertIn(errors[0][2][1].filename, possible_args)
++        self.assertIs(errors[1][0], os.rmdir)
++        self.assertEqual(errors[1][1], filename)
++        self.assertIsInstance(errors[1][2][1], NotADirectoryError)
++        self.assertIn(errors[1][2][1].filename, possible_args)
++
+ 
+     # See bug #1071513 for why we don't run this on cygwin
+     # and bug #1076467 for why we don't run this as root.
+@@ -409,6 +449,17 @@
+             self.assertIn('user.bar', os.listxattr(dst))
+         finally:
+             os.setxattr = orig_setxattr
++        # the source filesystem not supporting xattrs should be ok, too.
++        def _raise_on_src(fname, *, follow_symlinks=True):
++            if fname == src:
++                raise OSError(errno.ENOTSUP, 'Operation not supported')
++            return orig_listxattr(fname, follow_symlinks=follow_symlinks)
++        try:
++            orig_listxattr = os.listxattr
++            os.listxattr = _raise_on_src
++            shutil._copyxattr(src, dst)
++        finally:
++            os.listxattr = orig_listxattr
+ 
+         # test that shutil.copystat copies xattrs
+         src = os.path.join(tmp_dir, 'the_original')
+@@ -1229,12 +1280,13 @@
+ class TestWhich(unittest.TestCase):
+ 
+     def setUp(self):
+-        self.temp_dir = tempfile.mkdtemp()
++        self.temp_dir = tempfile.mkdtemp(prefix="Tmp")
+         self.addCleanup(shutil.rmtree, self.temp_dir, True)
+         # Give the temp_file an ".exe" suffix for all.
+         # It's needed on Windows and not harmful on other platforms.
+         self.temp_file = tempfile.NamedTemporaryFile(dir=self.temp_dir,
+-                                                     suffix=".exe")
++                                                     prefix="Tmp",
++                                                     suffix=".Exe")
+         os.chmod(self.temp_file.name, stat.S_IXUSR)
+         self.addCleanup(self.temp_file.close)
+         self.dir, self.file = os.path.split(self.temp_file.name)
+@@ -1244,11 +1296,36 @@
+         rv = shutil.which(self.file, path=self.dir)
+         self.assertEqual(rv, self.temp_file.name)
+ 
+-    def test_full_path_short_circuit(self):
++    def test_absolute_cmd(self):
+         # When given the fully qualified path to an executable that exists,
+         # it should be returned.
+         rv = shutil.which(self.temp_file.name, path=self.temp_dir)
+-        self.assertEqual(self.temp_file.name, rv)
++        self.assertEqual(rv, self.temp_file.name)
++
++    def test_relative_cmd(self):
++        # When given the relative path with a directory part to an executable
++        # that exists, it should be returned.
++        base_dir, tail_dir = os.path.split(self.dir)
++        relpath = os.path.join(tail_dir, self.file)
++        with support.temp_cwd(path=base_dir):
++            rv = shutil.which(relpath, path=self.temp_dir)
++            self.assertEqual(rv, relpath)
++        # But it shouldn't be searched in PATH directories (issue #16957).
++        with support.temp_cwd(path=self.dir):
++            rv = shutil.which(relpath, path=base_dir)
++            self.assertIsNone(rv)
++
++    def test_cwd(self):
++        # Issue #16957
++        base_dir = os.path.dirname(self.dir)
++        with support.temp_cwd(path=self.dir):
++            rv = shutil.which(self.file, path=base_dir)
++            if sys.platform == "win32":
++                # Windows: current directory implicitly on PATH
++                self.assertEqual(rv, os.path.join(os.curdir, self.file))
++            else:
++                # Other platforms: shouldn't match in the current directory.
++                self.assertIsNone(rv)
+ 
+     def test_non_matching_mode(self):
+         # Set the file read-only and ask for writeable files.
+@@ -1256,15 +1333,11 @@
+         rv = shutil.which(self.file, path=self.dir, mode=os.W_OK)
+         self.assertIsNone(rv)
+ 
+-    def test_relative(self):
+-        old_cwd = os.getcwd()
++    def test_relative_path(self):
+         base_dir, tail_dir = os.path.split(self.dir)
+-        os.chdir(base_dir)
+-        try:
++        with support.temp_cwd(path=base_dir):
+             rv = shutil.which(self.file, path=tail_dir)
+             self.assertEqual(rv, os.path.join(tail_dir, self.file))
+-        finally:
+-            os.chdir(old_cwd)
+ 
+     def test_nonexistent_file(self):
+         # Return None when no matching executable file is found on the path.
+@@ -1276,8 +1349,8 @@
+     def test_pathext_checking(self):
+         # Ask for the file without the ".exe" extension, then ensure that
+         # it gets found properly with the extension.
+-        rv = shutil.which(self.temp_file.name[:-4], path=self.dir)
+-        self.assertEqual(self.temp_file.name, rv)
++        rv = shutil.which(self.file[:-4], path=self.dir)
++        self.assertEqual(rv, self.temp_file.name[:-4] + ".EXE")
+ 
+ 
+ class TestMove(unittest.TestCase):
+diff -r bd8afb90ebf2 Lib/test/test_signal.py
+--- a/Lib/test/test_signal.py
++++ b/Lib/test/test_signal.py
+@@ -107,7 +107,7 @@
+             # This wait should be interrupted by the signal's exception.
+             self.wait(child)
+             time.sleep(1)  # Give the signal time to be delivered.
+-            self.fail('HandlerBCalled exception not thrown')
++            self.fail('HandlerBCalled exception not raised')
+         except HandlerBCalled:
+             self.assertTrue(self.b_called)
+             self.assertFalse(self.a_called)
+@@ -143,7 +143,7 @@
+         # test-running process from all the signals. It then
+         # communicates with that child process over a pipe and
+         # re-raises information about any exceptions the child
+-        # throws. The real work happens in self.run_test().
++        # raises. The real work happens in self.run_test().
+         os_done_r, os_done_w = os.pipe()
+         with closing(os.fdopen(os_done_r, 'rb')) as done_r, \
+              closing(os.fdopen(os_done_w, 'wb')) as done_w:
+@@ -222,6 +222,13 @@
+             signal.signal(7, handler)
+ 
+ 
++class WakeupFDTests(unittest.TestCase):
++
++    def test_invalid_fd(self):
++        fd = support.make_bad_fd()
++        self.assertRaises(ValueError, signal.set_wakeup_fd, fd)
++
++
+ @unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
+ class WakeupSignalTests(unittest.TestCase):
+     def check_wakeup(self, test_body, *signals, ordered=True):
+@@ -864,8 +871,8 @@
+ def test_main():
+     try:
+         support.run_unittest(PosixTests, InterProcessSignalTests,
+-                             WakeupSignalTests, SiginterruptTest,
+-                             ItimerTest, WindowsSignalTests,
++                             WakeupFDTests, WakeupSignalTests,
++                             SiginterruptTest, ItimerTest, WindowsSignalTests,
+                              PendingSignalsTests)
+     finally:
+         support.reap_children()
+diff -r bd8afb90ebf2 Lib/test/test_socket.py
+--- a/Lib/test/test_socket.py
++++ b/Lib/test/test_socket.py
+@@ -1245,17 +1245,34 @@
+             fp.close()
+             self.assertEqual(repr(fp), "<_io.BufferedReader name=-1>")
+ 
++    def test_unusable_closed_socketio(self):
++        with socket.socket() as sock:
++            fp = sock.makefile("rb", buffering=0)
++            self.assertTrue(fp.readable())
++            self.assertFalse(fp.writable())
++            self.assertFalse(fp.seekable())
++            fp.close()
++            self.assertRaises(ValueError, fp.readable)
++            self.assertRaises(ValueError, fp.writable)
++            self.assertRaises(ValueError, fp.seekable)
++
+     def test_pickle(self):
+         sock = socket.socket()
+         with sock:
+             for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
+                 self.assertRaises(TypeError, pickle.dumps, sock, protocol)
+ 
+-    def test_listen_backlog0(self):
++    def test_listen_backlog(self):
++        for backlog in 0, -1:
++            srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
++            srv.bind((HOST, 0))
++            srv.listen(backlog)
++            srv.close()
++
++        # Issue 15989
+         srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+         srv.bind((HOST, 0))
+-        # backlog = 0
+-        srv.listen(0)
++        self.assertRaises(OverflowError, srv.listen, _testcapi.INT_MAX + 1)
+         srv.close()
+ 
+     @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.')
+@@ -1571,6 +1588,11 @@
+ 
+     def _testShutdown(self):
+         self.serv_conn.send(MSG)
++        # Issue 15989
++        self.assertRaises(OverflowError, self.serv_conn.shutdown,
++                          _testcapi.INT_MAX + 1)
++        self.assertRaises(OverflowError, self.serv_conn.shutdown,
++                          2 + (_testcapi.UINT_MAX + 1))
+         self.serv_conn.shutdown(2)
+ 
+     def testDetach(self):
+@@ -3280,14 +3302,28 @@
+ @unittest.skipUnless(thread, 'Threading required for this test.')
+ class RecvmsgSCTPStreamTest(RecvmsgTests, RecvmsgGenericStreamTests,
+                             SendrecvmsgSCTPStreamTestBase):
+-    pass
++
++    def testRecvmsgEOF(self):
++        try:
++            super(RecvmsgSCTPStreamTest, self).testRecvmsgEOF()
++        except OSError as e:
++            if e.errno != errno.ENOTCONN:
++                raise
++            self.skipTest("sporadic ENOTCONN (kernel issue?) - see issue #13876")
+ 
+ @requireAttrs(socket.socket, "recvmsg_into")
+ @requireSocket("AF_INET", "SOCK_STREAM", "IPPROTO_SCTP")
+ @unittest.skipUnless(thread, 'Threading required for this test.')
+ class RecvmsgIntoSCTPStreamTest(RecvmsgIntoTests, RecvmsgGenericStreamTests,
+                                 SendrecvmsgSCTPStreamTestBase):
+-    pass
++
++    def testRecvmsgEOF(self):
++        try:
++            super(RecvmsgIntoSCTPStreamTest, self).testRecvmsgEOF()
++        except OSError as e:
++            if e.errno != errno.ENOTCONN:
++                raise
++            self.skipTest("sporadic ENOTCONN (kernel issue?) - see issue #13876")
+ 
+ 
+ class SendrecvmsgUnixStreamTestBase(SendrecvmsgConnectedBase,
+@@ -3530,7 +3566,10 @@
+ 
+     def testSetBlocking(self):
+         # Testing whether set blocking works
+-        self.serv.setblocking(0)
++        self.serv.setblocking(True)
++        self.assertIsNone(self.serv.gettimeout())
++        self.serv.setblocking(False)
++        self.assertEqual(self.serv.gettimeout(), 0.0)
+         start = time.time()
+         try:
+             self.serv.accept()
+@@ -3538,6 +3577,10 @@
+             pass
+         end = time.time()
+         self.assertTrue((end - start) < 1.0, "Error setting non-blocking mode.")
++        # Issue 15989
++        if _testcapi.UINT_MAX < _testcapi.ULONG_MAX:
++            self.serv.setblocking(_testcapi.UINT_MAX + 1)
++            self.assertIsNone(self.serv.gettimeout())
+ 
+     def _testSetBlocking(self):
+         pass
+@@ -4098,7 +4141,26 @@
+         port = support.find_unused_port()
+         with self.assertRaises(socket.error) as cm:
+             socket.create_connection((HOST, port))
+-        self.assertEqual(cm.exception.errno, errno.ECONNREFUSED)
++
++        # Issue #16257: create_connection() calls getaddrinfo() against
++        # 'localhost'.  This may result in an IPV6 addr being returned
++        # as well as an IPV4 one:
++        #   >>> socket.getaddrinfo('localhost', port, 0, SOCK_STREAM)
++        #   >>> [(2,  2, 0, '', ('127.0.0.1', 41230)),
++        #        (26, 2, 0, '', ('::1', 41230, 0, 0))]
++        #
++        # create_connection() enumerates through all the addresses returned
++        # and if it doesn't successfully bind to any of them, it propagates
++        # the last exception it encountered.
++        #
++        # On Solaris, ENETUNREACH is returned in this circumstance instead
++        # of ECONNREFUSED.  So, if that errno exists, add it to our list of
++        # expected errnos.
++        expected_errnos = [ errno.ECONNREFUSED, ]
++        if hasattr(errno, 'ENETUNREACH'):
++            expected_errnos.append(errno.ENETUNREACH)
++
++        self.assertIn(cm.exception.errno, expected_errnos)
+ 
+     def test_create_connection_timeout(self):
+         # Issue #9792: create_connection() should not recast timeout errors
+diff -r bd8afb90ebf2 Lib/test/test_socketserver.py
+--- a/Lib/test/test_socketserver.py
++++ b/Lib/test/test_socketserver.py
+@@ -58,7 +58,7 @@
+ def simple_subprocess(testcase):
+     pid = os.fork()
+     if pid == 0:
+-        # Don't throw an exception; it would be caught by the test harness.
++        # Don't raise an exception; it would be caught by the test harness.
+         os._exit(72)
+     yield None
+     pid2, status = os.waitpid(pid, 0)
+diff -r bd8afb90ebf2 Lib/test/test_ssl.py
+--- a/Lib/test/test_ssl.py
++++ b/Lib/test/test_ssl.py
+@@ -125,12 +125,8 @@
+         else:
+             self.assertRaises(ssl.SSLError, ssl.RAND_bytes, 16)
+ 
+-        try:
+-            ssl.RAND_egd(1)
+-        except TypeError:
+-            pass
+-        else:
+-            print("didn't raise TypeError")
++        self.assertRaises(TypeError, ssl.RAND_egd, 1)
++        self.assertRaises(TypeError, ssl.RAND_egd, 'foo', 1)
+         ssl.RAND_add("this is a random string", 75.0)
+ 
+     def test_parse_cert(self):
+@@ -212,20 +208,21 @@
+         s = socket.socket(socket.AF_INET)
+         ss = ssl.wrap_socket(s)
+         wr = weakref.ref(ss)
+-        del ss
+-        self.assertEqual(wr(), None)
++        with support.check_warnings(("", ResourceWarning)):
++            del ss
++            self.assertEqual(wr(), None)
+ 
+     def test_wrapped_unconnected(self):
+         # Methods on an unconnected SSLSocket propagate the original
+         # socket.error raise by the underlying socket object.
+         s = socket.socket(socket.AF_INET)
+-        ss = ssl.wrap_socket(s)
+-        self.assertRaises(socket.error, ss.recv, 1)
+-        self.assertRaises(socket.error, ss.recv_into, bytearray(b'x'))
+-        self.assertRaises(socket.error, ss.recvfrom, 1)
+-        self.assertRaises(socket.error, ss.recvfrom_into, bytearray(b'x'), 1)
+-        self.assertRaises(socket.error, ss.send, b'x')
+-        self.assertRaises(socket.error, ss.sendto, b'x', ('0.0.0.0', 0))
++        with ssl.wrap_socket(s) as ss:
++            self.assertRaises(socket.error, ss.recv, 1)
++            self.assertRaises(socket.error, ss.recv_into, bytearray(b'x'))
++            self.assertRaises(socket.error, ss.recvfrom, 1)
++            self.assertRaises(socket.error, ss.recvfrom_into, bytearray(b'x'), 1)
++            self.assertRaises(socket.error, ss.send, b'x')
++            self.assertRaises(socket.error, ss.sendto, b'x', ('0.0.0.0', 0))
+ 
+     def test_timeout(self):
+         # Issue #8524: when creating an SSL socket, the timeout of the
+@@ -233,8 +230,8 @@
+         for timeout in (None, 0.0, 5.0):
+             s = socket.socket(socket.AF_INET)
+             s.settimeout(timeout)
+-            ss = ssl.wrap_socket(s)
+-            self.assertEqual(timeout, ss.gettimeout())
++            with ssl.wrap_socket(s) as ss:
++                self.assertEqual(timeout, ss.gettimeout())
+ 
+     def test_errors(self):
+         sock = socket.socket()
+@@ -247,9 +244,9 @@
+         self.assertRaisesRegex(ValueError,
+                         "certfile must be specified for server-side operations",
+                         ssl.wrap_socket, sock, server_side=True, certfile="")
+-        s = ssl.wrap_socket(sock, server_side=True, certfile=CERTFILE)
+-        self.assertRaisesRegex(ValueError, "can't connect in server-side mode",
+-                                s.connect, (HOST, 8080))
++        with ssl.wrap_socket(sock, server_side=True, certfile=CERTFILE) as s:
++            self.assertRaisesRegex(ValueError, "can't connect in server-side mode",
++                                    s.connect, (HOST, 8080))
+         with self.assertRaises(IOError) as cm:
+             with socket.socket() as sock:
+                 ssl.wrap_socket(sock, certfile=WRONGCERT)
+@@ -362,21 +359,29 @@
+     def test_unknown_channel_binding(self):
+         # should raise ValueError for unknown type
+         s = socket.socket(socket.AF_INET)
+-        ss = ssl.wrap_socket(s)
+-        with self.assertRaises(ValueError):
+-            ss.get_channel_binding("unknown-type")
++        with ssl.wrap_socket(s) as ss:
++            with self.assertRaises(ValueError):
++                ss.get_channel_binding("unknown-type")
+ 
+     @unittest.skipUnless("tls-unique" in ssl.CHANNEL_BINDING_TYPES,
+                          "'tls-unique' channel binding not available")
+     def test_tls_unique_channel_binding(self):
+         # unconnected should return None for known type
+         s = socket.socket(socket.AF_INET)
+-        ss = ssl.wrap_socket(s)
+-        self.assertIsNone(ss.get_channel_binding("tls-unique"))
++        with ssl.wrap_socket(s) as ss:
++            self.assertIsNone(ss.get_channel_binding("tls-unique"))
+         # the same for server-side
+         s = socket.socket(socket.AF_INET)
+-        ss = ssl.wrap_socket(s, server_side=True, certfile=CERTFILE)
+-        self.assertIsNone(ss.get_channel_binding("tls-unique"))
++        with ssl.wrap_socket(s, server_side=True, certfile=CERTFILE) as ss:
++            self.assertIsNone(ss.get_channel_binding("tls-unique"))
++
++    def test_dealloc_warn(self):
++        ss = ssl.wrap_socket(socket.socket(socket.AF_INET))
++        r = repr(ss)
++        with self.assertWarns(ResourceWarning) as cm:
++            ss = None
++            support.gc_collect()
++        self.assertIn(r, str(cm.warning.args[0]))
+ 
+ class ContextTests(unittest.TestCase):
+ 
+@@ -619,10 +624,10 @@
+         with socket.socket() as s:
+             s.bind(("127.0.0.1", 0))
+             s.listen(5)
+-            with socket.socket() as c:
+-                c.connect(s.getsockname())
+-                c.setblocking(False)
+-                c = ctx.wrap_socket(c, False, do_handshake_on_connect=False)
++            c = socket.socket()
++            c.connect(s.getsockname())
++            c.setblocking(False)
++            with ctx.wrap_socket(c, False, do_handshake_on_connect=False) as c:
+                 with self.assertRaises(ssl.SSLWantReadError) as cm:
+                     c.do_handshake()
+                 s = str(cm.exception)
+@@ -718,6 +723,17 @@
+             finally:
+                 s.close()
+ 
++    def test_connect_ex_error(self):
++        with support.transient_internet("svn.python.org"):
++            s = ssl.wrap_socket(socket.socket(socket.AF_INET),
++                                cert_reqs=ssl.CERT_REQUIRED,
++                                ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
++            try:
++                self.assertEqual(errno.ECONNREFUSED,
++                                 s.connect_ex(("svn.python.org", 444)))
++            finally:
++                s.close()
++
+     def test_connect_with_context(self):
+         with support.transient_internet("svn.python.org"):
+             # Same as test_connect, but with a separately created context
+@@ -852,12 +868,12 @@
+     def test_ciphers(self):
+         remote = ("svn.python.org", 443)
+         with support.transient_internet(remote[0]):
+-            s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+-                                cert_reqs=ssl.CERT_NONE, ciphers="ALL")
+-            s.connect(remote)
+-            s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+-                                cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT")
+-            s.connect(remote)
++            with ssl.wrap_socket(socket.socket(socket.AF_INET),
++                                 cert_reqs=ssl.CERT_NONE, ciphers="ALL") as s:
++                s.connect(remote)
++            with ssl.wrap_socket(socket.socket(socket.AF_INET),
++                                 cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT") as s:
++                s.connect(remote)
+             # Error checking can happen at instantiation or when connecting
+             with self.assertRaisesRegex(ssl.SSLError, "No cipher can be selected"):
+                 with socket.socket(socket.AF_INET) as sock:
+@@ -1800,6 +1816,44 @@
+                 t.join()
+                 server.close()
+ 
++        def test_server_accept(self):
++            # Issue #16357: accept() on a SSLSocket created through
++            # SSLContext.wrap_socket().
++            context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++            context.verify_mode = ssl.CERT_REQUIRED
++            context.load_verify_locations(CERTFILE)
++            context.load_cert_chain(CERTFILE)
++            server = socket.socket(socket.AF_INET)
++            host = "127.0.0.1"
++            port = support.bind_port(server)
++            server = context.wrap_socket(server, server_side=True)
++
++            evt = threading.Event()
++            remote = None
++            peer = None
++            def serve():
++                nonlocal remote, peer
++                server.listen(5)
++                # Block on the accept and wait on the connection to close.
++                evt.set()
++                remote, peer = server.accept()
++                remote.recv(1)
++
++            t = threading.Thread(target=serve)
++            t.start()
++            # Client wait until server setup and perform a connect.
++            evt.wait()
++            client = context.wrap_socket(socket.socket())
++            client.connect((host, port))
++            client_addr = client.getsockname()
++            client.close()
++            t.join()
++            remote.close()
++            server.close()
++            # Sanity checks.
++            self.assertIsInstance(remote, ssl.SSLSocket)
++            self.assertEqual(peer, client_addr)
++
+         def test_default_ciphers(self):
+             context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+             try:
+@@ -1810,8 +1864,7 @@
+             with ThreadedEchoServer(CERTFILE,
+                                     ssl_version=ssl.PROTOCOL_SSLv23,
+                                     chatty=False) as server:
+-                with socket.socket() as sock:
+-                    s = context.wrap_socket(sock)
++                with context.wrap_socket(socket.socket()) as s:
+                     with self.assertRaises((OSError, ssl.SSLError)):
+                         s.connect((HOST, server.port))
+             self.assertIn("no shared cipher", str(server.conn_errors[0]))
+@@ -1979,7 +2032,7 @@
+ 
+     if _have_threads:
+         thread_info = support.threading_setup()
+-        if thread_info and support.is_resource_enabled('network'):
++        if thread_info:
+             tests.append(ThreadedTests)
+ 
+     try:
+diff -r bd8afb90ebf2 Lib/test/test_startfile.py
+--- a/Lib/test/test_startfile.py
++++ b/Lib/test/test_startfile.py
+@@ -5,13 +5,13 @@
+ #
+ # A possible improvement would be to have empty.vbs do something that
+ # we can detect here, to make sure that not only the os.startfile()
+-# call succeeded, but also the the script actually has run.
++# call succeeded, but also the script actually has run.
+ 
+ import unittest
+ from test import support
+ import os
++import sys
+ from os import path
+-from time import sleep
+ 
+ startfile = support.get_attribute(os, 'startfile')
+ 
+@@ -21,13 +21,12 @@
+         self.assertRaises(OSError, startfile, "nonexisting.vbs")
+ 
+     def test_empty(self):
+-        empty = path.join(path.dirname(__file__), "empty.vbs")
+-        startfile(empty)
+-        startfile(empty, "open")
+-        # Give the child process some time to exit before we finish.
+-        # Otherwise the cleanup code will not be able to delete the cwd,
+-        # because it is still in use.
+-        sleep(0.1)
++        # Switch to an existing, but safe, working directory to let the
++        # cleanup code do its thing without permission errors.
++        with support.temp_cwd(path=path.dirname(sys.executable)):
++            empty = path.join(path.dirname(__file__), "empty.vbs")
++            startfile(empty)
++            startfile(empty, "open")
+ 
+ def test_main():
+     support.run_unittest(TestCase)
+diff -r bd8afb90ebf2 Lib/test/test_strlit.py
+--- a/Lib/test/test_strlit.py
++++ b/Lib/test/test_strlit.py
+@@ -50,6 +50,10 @@
+ assert ord(f) == 0x1881
+ g = r'\u1881'
+ assert list(map(ord, g)) == [92, 117, 49, 56, 56, 49]
++h = '\U0001d120'
++assert ord(h) == 0x1d120
++i = r'\U0001d120'
++assert list(map(ord, i)) == [92, 85, 48, 48, 48, 49, 100, 49, 50, 48]
+ """
+ 
+ 
+@@ -82,6 +86,24 @@
+         self.assertEqual(eval(""" '\x81' """), chr(0x81))
+         self.assertEqual(eval(r""" '\u1881' """), chr(0x1881))
+         self.assertEqual(eval(""" '\u1881' """), chr(0x1881))
++        self.assertEqual(eval(r""" '\U0001d120' """), chr(0x1d120))
++        self.assertEqual(eval(""" '\U0001d120' """), chr(0x1d120))
++
++    def test_eval_str_incomplete(self):
++        self.assertRaises(SyntaxError, eval, r""" '\x' """)
++        self.assertRaises(SyntaxError, eval, r""" '\x0' """)
++        self.assertRaises(SyntaxError, eval, r""" '\u' """)
++        self.assertRaises(SyntaxError, eval, r""" '\u0' """)
++        self.assertRaises(SyntaxError, eval, r""" '\u00' """)
++        self.assertRaises(SyntaxError, eval, r""" '\u000' """)
++        self.assertRaises(SyntaxError, eval, r""" '\U' """)
++        self.assertRaises(SyntaxError, eval, r""" '\U0' """)
++        self.assertRaises(SyntaxError, eval, r""" '\U00' """)
++        self.assertRaises(SyntaxError, eval, r""" '\U000' """)
++        self.assertRaises(SyntaxError, eval, r""" '\U0000' """)
++        self.assertRaises(SyntaxError, eval, r""" '\U00000' """)
++        self.assertRaises(SyntaxError, eval, r""" '\U000000' """)
++        self.assertRaises(SyntaxError, eval, r""" '\U0000000' """)
+ 
+     def test_eval_str_raw(self):
+         self.assertEqual(eval(""" r'x' """), 'x')
+@@ -91,6 +113,8 @@
+         self.assertEqual(eval(""" r'\x81' """), chr(0x81))
+         self.assertEqual(eval(r""" r'\u1881' """), '\\' + 'u1881')
+         self.assertEqual(eval(""" r'\u1881' """), chr(0x1881))
++        self.assertEqual(eval(r""" r'\U0001d120' """), '\\' + 'U0001d120')
++        self.assertEqual(eval(""" r'\U0001d120' """), chr(0x1d120))
+ 
+     def test_eval_bytes_normal(self):
+         self.assertEqual(eval(""" b'x' """), b'x')
+@@ -100,6 +124,12 @@
+         self.assertRaises(SyntaxError, eval, """ b'\x81' """)
+         self.assertEqual(eval(r""" b'\u1881' """), b'\\' + b'u1881')
+         self.assertRaises(SyntaxError, eval, """ b'\u1881' """)
++        self.assertEqual(eval(r""" b'\U0001d120' """), b'\\' + b'U0001d120')
++        self.assertRaises(SyntaxError, eval, """ b'\U0001d120' """)
++
++    def test_eval_bytes_incomplete(self):
++        self.assertRaises(SyntaxError, eval, r""" b'\x' """)
++        self.assertRaises(SyntaxError, eval, r""" b'\x0' """)
+ 
+     def test_eval_bytes_raw(self):
+         self.assertEqual(eval(""" br'x' """), b'x')
+@@ -116,6 +146,10 @@
+         self.assertEqual(eval(r""" rb'\u1881' """), b"\\" + b"u1881")
+         self.assertRaises(SyntaxError, eval, """ br'\u1881' """)
+         self.assertRaises(SyntaxError, eval, """ rb'\u1881' """)
++        self.assertEqual(eval(r""" br'\U0001d120' """), b"\\" + b"U0001d120")
++        self.assertEqual(eval(r""" rb'\U0001d120' """), b"\\" + b"U0001d120")
++        self.assertRaises(SyntaxError, eval, """ br'\U0001d120' """)
++        self.assertRaises(SyntaxError, eval, """ rb'\U0001d120' """)
+         self.assertRaises(SyntaxError, eval, """ bb'' """)
+         self.assertRaises(SyntaxError, eval, """ rr'' """)
+         self.assertRaises(SyntaxError, eval, """ brr'' """)
+diff -r bd8afb90ebf2 Lib/test/test_subprocess.py
+--- a/Lib/test/test_subprocess.py
++++ b/Lib/test/test_subprocess.py
+@@ -1,4 +1,5 @@
+ import unittest
++from test import script_helper
+ from test import support
+ import subprocess
+ import sys
+@@ -67,6 +68,18 @@
+         self.assertEqual(actual, expected, msg)
+ 
+ 
++class PopenTestException(Exception):
++    pass
++
++
++class PopenExecuteChildRaises(subprocess.Popen):
++    """Popen subclass for testing cleanup of subprocess.PIPE filehandles when
++    _execute_child fails.
++    """
++    def _execute_child(self, *args, **kwargs):
++        raise PopenTestException("Forced Exception for Test")
++
++
+ class ProcessTestCase(BaseTestCase):
+ 
+     def test_call_seq(self):
+@@ -191,15 +204,137 @@
+         p.wait()
+         self.assertEqual(p.stderr, None)
+ 
++    def _assert_python(self, pre_args, **kwargs):
++        # We include sys.exit() to prevent the test runner from hanging
++        # whenever python is found.
++        args = pre_args + ["import sys; sys.exit(47)"]
++        p = subprocess.Popen(args, **kwargs)
++        p.wait()
++        self.assertEqual(47, p.returncode)
++
++    def test_executable(self):
++        # Check that the executable argument works.
++        #
++        # On Unix (non-Mac and non-Windows), Python looks at args[0] to
++        # determine where its standard library is, so we need the directory
++        # of args[0] to be valid for the Popen() call to Python to succeed.
++        # See also issue #16170 and issue #7774.
++        doesnotexist = os.path.join(os.path.dirname(sys.executable),
++                                    "doesnotexist")
++        self._assert_python([doesnotexist, "-c"], executable=sys.executable)
++
++    def test_executable_takes_precedence(self):
++        # Check that the executable argument takes precedence over args[0].
++        #
++        # Verify first that the call succeeds without the executable arg.
++        pre_args = [sys.executable, "-c"]
++        self._assert_python(pre_args)
++        self.assertRaises(FileNotFoundError, self._assert_python, pre_args,
++                          executable="doesnotexist")
++
++    @unittest.skipIf(mswindows, "executable argument replaces shell")
++    def test_executable_replaces_shell(self):
++        # Check that the executable argument replaces the default shell
++        # when shell=True.
++        self._assert_python([], executable=sys.executable, shell=True)
++
++    # For use in the test_cwd* tests below.
++    def _normalize_cwd(self, cwd):
++        # Normalize an expected cwd (for Tru64 support).
++        # We can't use os.path.realpath since it doesn't expand Tru64 {memb}
++        # strings.  See bug #1063571.
++        original_cwd = os.getcwd()
++        os.chdir(cwd)
++        cwd = os.getcwd()
++        os.chdir(original_cwd)
++        return cwd
++
++    # For use in the test_cwd* tests below.
++    def _split_python_path(self):
++        # Return normalized (python_dir, python_base).
++        python_path = os.path.realpath(sys.executable)
++        return os.path.split(python_path)
++
++    # For use in the test_cwd* tests below.
++    def _assert_cwd(self, expected_cwd, python_arg, **kwargs):
++        # Invoke Python via Popen, and assert that (1) the call succeeds,
++        # and that (2) the current working directory of the child process
++        # matches *expected_cwd*.
++        p = subprocess.Popen([python_arg, "-c",
++                              "import os, sys; "
++                              "sys.stdout.write(os.getcwd()); "
++                              "sys.exit(47)"],
++                              stdout=subprocess.PIPE,
++                              **kwargs)
++        self.addCleanup(p.stdout.close)
++        p.wait()
++        self.assertEqual(47, p.returncode)
++        normcase = os.path.normcase
++        self.assertEqual(normcase(expected_cwd),
++                         normcase(p.stdout.read().decode("utf-8")))
++
++    def test_cwd(self):
++        # Check that cwd changes the cwd for the child process.
++        temp_dir = tempfile.gettempdir()
++        temp_dir = self._normalize_cwd(temp_dir)
++        self._assert_cwd(temp_dir, sys.executable, cwd=temp_dir)
++
++    @unittest.skipIf(mswindows, "pending resolution of issue #15533")
++    def test_cwd_with_relative_arg(self):
++        # Check that Popen looks for args[0] relative to cwd if args[0]
++        # is relative.
++        python_dir, python_base = self._split_python_path()
++        rel_python = os.path.join(os.curdir, python_base)
++        with support.temp_cwd() as wrong_dir:
++            # Before calling with the correct cwd, confirm that the call fails
++            # without cwd and with the wrong cwd.
++            self.assertRaises(FileNotFoundError, subprocess.Popen,
++                              [rel_python])
++            self.assertRaises(FileNotFoundError, subprocess.Popen,
++                              [rel_python], cwd=wrong_dir)
++            python_dir = self._normalize_cwd(python_dir)
++            self._assert_cwd(python_dir, rel_python, cwd=python_dir)
++
++    @unittest.skipIf(mswindows, "pending resolution of issue #15533")
++    def test_cwd_with_relative_executable(self):
++        # Check that Popen looks for executable relative to cwd if executable
++        # is relative (and that executable takes precedence over args[0]).
++        python_dir, python_base = self._split_python_path()
++        rel_python = os.path.join(os.curdir, python_base)
++        doesntexist = "somethingyoudonthave"
++        with support.temp_cwd() as wrong_dir:
++            # Before calling with the correct cwd, confirm that the call fails
++            # without cwd and with the wrong cwd.
++            self.assertRaises(FileNotFoundError, subprocess.Popen,
++                              [doesntexist], executable=rel_python)
++            self.assertRaises(FileNotFoundError, subprocess.Popen,
++                              [doesntexist], executable=rel_python,
++                              cwd=wrong_dir)
++            python_dir = self._normalize_cwd(python_dir)
++            self._assert_cwd(python_dir, doesntexist, executable=rel_python,
++                             cwd=python_dir)
++
++    def test_cwd_with_absolute_arg(self):
++        # Check that Popen can find the executable when the cwd is wrong
++        # if args[0] is an absolute path.
++        python_dir, python_base = self._split_python_path()
++        abs_python = os.path.join(python_dir, python_base)
++        rel_python = os.path.join(os.curdir, python_base)
++        with script_helper.temp_dir() as wrong_dir:
++            # Before calling with an absolute path, confirm that using a
++            # relative path fails.
++            self.assertRaises(FileNotFoundError, subprocess.Popen,
++                              [rel_python], cwd=wrong_dir)
++            wrong_dir = self._normalize_cwd(wrong_dir)
++            self._assert_cwd(wrong_dir, abs_python, cwd=wrong_dir)
++
+     @unittest.skipIf(sys.base_prefix != sys.prefix,
+                      'Test is not venv-compatible')
+     def test_executable_with_cwd(self):
+-        python_dir = os.path.dirname(os.path.realpath(sys.executable))
+-        p = subprocess.Popen(["somethingyoudonthave", "-c",
+-                              "import sys; sys.exit(47)"],
+-                             executable=sys.executable, cwd=python_dir)
+-        p.wait()
+-        self.assertEqual(p.returncode, 47)
++        python_dir, python_base = self._split_python_path()
++        python_dir = self._normalize_cwd(python_dir)
++        self._assert_cwd(python_dir, "somethingyoudonthave",
++                         executable=sys.executable, cwd=python_dir)
+ 
+     @unittest.skipIf(sys.base_prefix != sys.prefix,
+                      'Test is not venv-compatible')
+@@ -208,11 +343,7 @@
+     def test_executable_without_cwd(self):
+         # For a normal installation, it should work without 'cwd'
+         # argument.  For test runs in the build directory, see #7774.
+-        p = subprocess.Popen(["somethingyoudonthave", "-c",
+-                              "import sys; sys.exit(47)"],
+-                             executable=sys.executable)
+-        p.wait()
+-        self.assertEqual(p.returncode, 47)
++        self._assert_cwd('', "somethingyoudonthave", executable=sys.executable)
+ 
+     def test_stdin_pipe(self):
+         # stdin redirection
+@@ -369,24 +500,6 @@
+         p.wait()
+         self.assertEqual(p.stdin, None)
+ 
+-    def test_cwd(self):
+-        tmpdir = tempfile.gettempdir()
+-        # We cannot use os.path.realpath to canonicalize the path,
+-        # since it doesn't expand Tru64 {memb} strings. See bug 1063571.
+-        cwd = os.getcwd()
+-        os.chdir(tmpdir)
+-        tmpdir = os.getcwd()
+-        os.chdir(cwd)
+-        p = subprocess.Popen([sys.executable, "-c",
+-                              'import sys,os;'
+-                              'sys.stdout.write(os.getcwd())'],
+-                             stdout=subprocess.PIPE,
+-                             cwd=tmpdir)
+-        self.addCleanup(p.stdout.close)
+-        normcase = os.path.normcase
+-        self.assertEqual(normcase(p.stdout.read().decode("utf-8")),
+-                         normcase(tmpdir))
+-
+     def test_env(self):
+         newenv = os.environ.copy()
+         newenv["FRUIT"] = "orange"
+@@ -894,6 +1007,27 @@
+                 process.communicate()
+ 
+ 
++    # This test is Linux-ish specific for simplicity to at least have
++    # some coverage.  It is not a platform specific bug.
++    @unittest.skipUnless(os.path.isdir('/proc/%d/fd' % os.getpid()),
++                         "Linux specific")
++    def test_failed_child_execute_fd_leak(self):
++        """Test for the fork() failure fd leak reported in issue16327."""
++        fd_directory = '/proc/%d/fd' % os.getpid()
++        fds_before_popen = os.listdir(fd_directory)
++        with self.assertRaises(PopenTestException):
++            PopenExecuteChildRaises(
++                    [sys.executable, '-c', 'pass'], stdin=subprocess.PIPE,
++                    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
++
++        # NOTE: This test doesn't verify that the real _execute_child
++        # does not close the file descriptors itself on the way out
++        # during an exception.  Code inspection has confirmed that.
++
++        fds_after_exception = os.listdir(fd_directory)
++        self.assertEqual(fds_before_popen, fds_after_exception)
++
++
+ # context manager
+ class _SuppressCoreFiles(object):
+     """Try to prevent core files from being created."""
+@@ -937,24 +1071,30 @@
+ @unittest.skipIf(mswindows, "POSIX specific tests")
+ class POSIXProcessTestCase(BaseTestCase):
+ 
+-    def test_exceptions(self):
+-        nonexistent_dir = "/_this/pa.th/does/not/exist"
++    def setUp(self):
++        super().setUp()
++        self._nonexistent_dir = "/_this/pa.th/does/not/exist"
++
++    def _get_chdir_exception(self):
+         try:
+-            os.chdir(nonexistent_dir)
++            os.chdir(self._nonexistent_dir)
+         except OSError as e:
+             # This avoids hard coding the errno value or the OS perror()
+             # string and instead capture the exception that we want to see
+             # below for comparison.
+             desired_exception = e
+-            desired_exception.strerror += ': ' + repr(sys.executable)
++            desired_exception.strerror += ': ' + repr(self._nonexistent_dir)
+         else:
+             self.fail("chdir to nonexistant directory %s succeeded." %
+-                      nonexistent_dir)
++                      self._nonexistent_dir)
++        return desired_exception
+ 
+-        # Error in the child re-raised in the parent.
++    def test_exception_cwd(self):
++        """Test error in the child raised in the parent for a bad cwd."""
++        desired_exception = self._get_chdir_exception()
+         try:
+             p = subprocess.Popen([sys.executable, "-c", ""],
+-                                 cwd=nonexistent_dir)
++                                 cwd=self._nonexistent_dir)
+         except OSError as e:
+             # Test that the child process chdir failure actually makes
+             # it up to the parent process as the correct exception.
+@@ -963,6 +1103,33 @@
+         else:
+             self.fail("Expected OSError: %s" % desired_exception)
+ 
++    def test_exception_bad_executable(self):
++        """Test error in the child raised in the parent for a bad executable."""
++        desired_exception = self._get_chdir_exception()
++        try:
++            p = subprocess.Popen([sys.executable, "-c", ""],
++                                 executable=self._nonexistent_dir)
++        except OSError as e:
++            # Test that the child process exec failure actually makes
++            # it up to the parent process as the correct exception.
++            self.assertEqual(desired_exception.errno, e.errno)
++            self.assertEqual(desired_exception.strerror, e.strerror)
++        else:
++            self.fail("Expected OSError: %s" % desired_exception)
++
++    def test_exception_bad_args_0(self):
++        """Test error in the child raised in the parent for a bad args[0]."""
++        desired_exception = self._get_chdir_exception()
++        try:
++            p = subprocess.Popen([self._nonexistent_dir, "-c", ""])
++        except OSError as e:
++            # Test that the child process exec failure actually makes
++            # it up to the parent process as the correct exception.
++            self.assertEqual(desired_exception.errno, e.errno)
++            self.assertEqual(desired_exception.strerror, e.strerror)
++        else:
++            self.fail("Expected OSError: %s" % desired_exception)
++
+     def test_restore_signals(self):
+         # Code coverage for both values of restore_signals to make sure it
+         # at least does not blow up.
+@@ -1022,6 +1189,43 @@
+             self.fail("Exception raised by preexec_fn did not make it "
+                       "to the parent process.")
+ 
++    class _TestExecuteChildPopen(subprocess.Popen):
++        """Used to test behavior at the end of _execute_child."""
++        def __init__(self, testcase, *args, **kwargs):
++            self._testcase = testcase
++            subprocess.Popen.__init__(self, *args, **kwargs)
++
++        def _execute_child(self, *args, **kwargs):
++            try:
++                subprocess.Popen._execute_child(self, *args, **kwargs)
++            finally:
++                # Open a bunch of file descriptors and verify that
++                # none of them are the same as the ones the Popen
++                # instance is using for stdin/stdout/stderr.
++                devzero_fds = [os.open("/dev/zero", os.O_RDONLY)
++                               for _ in range(8)]
++                try:
++                    for fd in devzero_fds:
++                        self._testcase.assertNotIn(
++                                fd, (self.stdin.fileno(), self.stdout.fileno(),
++                                     self.stderr.fileno()),
++                                msg="At least one fd was closed early.")
++                finally:
++                    map(os.close, devzero_fds)
++
++    @unittest.skipIf(not os.path.exists("/dev/zero"), "/dev/zero required.")
++    def test_preexec_errpipe_does_not_double_close_pipes(self):
++        """Issue16140: Don't double close pipes on preexec error."""
++
++        def raise_it():
++            raise RuntimeError("force the _execute_child() errpipe_data path.")
++
++        with self.assertRaises(RuntimeError):
++            self._TestExecuteChildPopen(
++                        self, [sys.executable, "-c", "pass"],
++                        stdin=subprocess.PIPE, stdout=subprocess.PIPE,
++                        stderr=subprocess.PIPE, preexec_fn=raise_it)
++
+     def test_preexec_gc_module_failure(self):
+         # This tests the code that disables garbage collection if the child
+         # process will execute any Python.
+@@ -1156,6 +1360,8 @@
+         getattr(p, method)(*args)
+         return p
+ 
++    @unittest.skipIf(sys.platform.startswith(('netbsd', 'openbsd')),
++                     "Due to known OS bug (issue #16762)")
+     def _kill_dead_process(self, method, *args):
+         # Do not inherit file handles from the parent.
+         # It should fix failures on some platforms.
+@@ -1950,15 +2156,12 @@
+             self.assertEqual(proc.returncode, 1)
+ 
+     def test_invalid_args(self):
+-        with self.assertRaises(EnvironmentError) as c:
++        with self.assertRaises(FileNotFoundError) as c:
+             with subprocess.Popen(['nonexisting_i_hope'],
+                                   stdout=subprocess.PIPE,
+                                   stderr=subprocess.PIPE) as proc:
+                 pass
+ 
+-            if c.exception.errno != errno.ENOENT:  # ignore "no such file"
+-                raise c.exception
+-
+ 
+ def test_main():
+     unit_tests = (ProcessTestCase,
+diff -r bd8afb90ebf2 Lib/test/test_super.py
+--- a/Lib/test/test_super.py
++++ b/Lib/test/test_super.py
+@@ -115,6 +115,21 @@
+                 return __class__
+         self.assertIs(X.f(), X)
+ 
++    def test_obscure_super_errors(self):
++        def f():
++            super()
++        self.assertRaises(RuntimeError, f)
++        def f(x):
++            del x
++            super()
++        self.assertRaises(RuntimeError, f, None)
++        class X:
++            def f(x):
++                nonlocal __class__
++                del __class__
++                super()
++        self.assertRaises(RuntimeError, X().f)
++
+ 
+ def test_main():
+     support.run_unittest(TestSuper)
+diff -r bd8afb90ebf2 Lib/test/test_support.py
+--- a/Lib/test/test_support.py
++++ b/Lib/test/test_support.py
+@@ -95,6 +95,15 @@
+         self.assertFalse(os.path.exists(TESTFN))
+         self.assertTrue(os.path.basename(os.getcwd()), here)
+ 
++    def test_temp_cwd__chdir_warning(self):
++        """Check the warning message when os.chdir() fails."""
++        path = TESTFN + '_does_not_exist'
++        with support.check_warnings() as recorder:
++            with support.temp_cwd(path=path, quiet=True):
++                pass
++            messages = [str(w.message) for w in recorder.warnings]
++        self.assertEqual(messages, ['tests may fail, unable to change the CWD to ' + path])
++
+     def test_sortdict(self):
+         self.assertEqual(support.sortdict({3:3, 2:2, 1:1}), "{1: 1, 2: 2, 3: 3}")
+ 
+diff -r bd8afb90ebf2 Lib/test/test_sys.py
+--- a/Lib/test/test_sys.py
++++ b/Lib/test/test_sys.py
+@@ -897,7 +897,7 @@
+         except TypeError:
+             tb = sys.exc_info()[2]
+             # traceback
+-            if tb != None:
++            if tb is not None:
+                 check(tb, size('2P2i'))
+         # symtable entry
+         # XXX
+diff -r bd8afb90ebf2 Lib/test/test_sys_settrace.py
+--- a/Lib/test/test_sys_settrace.py
++++ b/Lib/test/test_sys_settrace.py
+@@ -422,7 +422,7 @@
+                 except ValueError:
+                     pass
+                 else:
+-                    self.fail("exception not thrown!")
++                    self.fail("exception not raised!")
+         except RuntimeError:
+             self.fail("recursion counter not reset")
+ 
+diff -r bd8afb90ebf2 Lib/test/test_tarfile.py
+--- a/Lib/test/test_tarfile.py
++++ b/Lib/test/test_tarfile.py
+@@ -336,31 +336,21 @@
+     @support.skip_unless_symlink
+     def test_extract_hardlink(self):
+         # Test hardlink extraction (e.g. bug #857297).
+-        tar = tarfile.open(tarname, errorlevel=1, encoding="iso8859-1")
++        with tarfile.open(tarname, errorlevel=1, encoding="iso8859-1") as tar:
++            tar.extract("ustar/regtype", TEMPDIR)
++            self.addCleanup(os.remove, os.path.join(TEMPDIR, "ustar/regtype"))
+ 
+-        try:
+-            tar.extract("ustar/regtype", TEMPDIR)
+-            try:
+-                tar.extract("ustar/lnktype", TEMPDIR)
+-            except EnvironmentError as e:
+-                if e.errno == errno.ENOENT:
+-                    self.fail("hardlink not extracted properly")
+-
++            tar.extract("ustar/lnktype", TEMPDIR)
++            self.addCleanup(os.remove, os.path.join(TEMPDIR, "ustar/lnktype"))
+             with open(os.path.join(TEMPDIR, "ustar/lnktype"), "rb") as f:
+                 data = f.read()
+             self.assertEqual(md5sum(data), md5_regtype)
+ 
+-            try:
+-                tar.extract("ustar/symtype", TEMPDIR)
+-            except EnvironmentError as e:
+-                if e.errno == errno.ENOENT:
+-                    self.fail("symlink not extracted properly")
+-
++            tar.extract("ustar/symtype", TEMPDIR)
++            self.addCleanup(os.remove, os.path.join(TEMPDIR, "ustar/symtype"))
+             with open(os.path.join(TEMPDIR, "ustar/symtype"), "rb") as f:
+                 data = f.read()
+             self.assertEqual(md5sum(data), md5_regtype)
+-        finally:
+-            tar.close()
+ 
+     def test_extractall(self):
+         # Test if extractall() correctly restores directory permissions
+diff -r bd8afb90ebf2 Lib/test/test_tcl.py
+--- a/Lib/test/test_tcl.py
++++ b/Lib/test/test_tcl.py
+@@ -151,6 +151,26 @@
+         # exit code must be zero
+         self.assertEqual(f.close(), None)
+ 
++    def test_passing_values(self):
++        def passValue(value):
++            return self.interp.call('set', '_', value)
++
++        self.assertEqual(passValue(True), True)
++        self.assertEqual(passValue(False), False)
++        self.assertEqual(passValue('string'), 'string')
++        self.assertEqual(passValue('string\u20ac'), 'string\u20ac')
++        for i in (0, 1, -1, 2**31-1, -2**31):
++            self.assertEqual(passValue(i), i)
++        for f in (0.0, 1.0, -1.0, 1/3,
++                  sys.float_info.min, sys.float_info.max,
++                  -sys.float_info.min, -sys.float_info.max):
++            self.assertEqual(passValue(f), f)
++        for f in float('nan'), float('inf'), -float('inf'):
++            if f != f: # NaN
++                self.assertNotEqual(passValue(f), f)
++            else:
++                self.assertEqual(passValue(f), f)
++        self.assertEqual(passValue((1, '2', (3.4,))), (1, '2', (3.4,)))
+ 
+ 
+ def test_main():
+diff -r bd8afb90ebf2 Lib/test/test_tempfile.py
+--- a/Lib/test/test_tempfile.py
++++ b/Lib/test/test_tempfile.py
+@@ -1,5 +1,7 @@
+ # tempfile.py unit tests.
+ import tempfile
++import errno
++import io
+ import os
+ import signal
+ import sys
+@@ -197,7 +199,44 @@
+             # paths in this list.
+ 
+ 
+-# We test _get_default_tempdir by testing gettempdir.
++# We test _get_default_tempdir some more by testing gettempdir.
++
++class TestGetDefaultTempdir(BaseTestCase):
++    """Test _get_default_tempdir()."""
++
++    def test_no_files_left_behind(self):
++        # use a private empty directory
++        with tempfile.TemporaryDirectory() as our_temp_directory:
++            # force _get_default_tempdir() to consider our empty directory
++            def our_candidate_list():
++                return [our_temp_directory]
++
++            with support.swap_attr(tempfile, "_candidate_tempdir_list",
++                                   our_candidate_list):
++                # verify our directory is empty after _get_default_tempdir()
++                tempfile._get_default_tempdir()
++                self.assertEqual(os.listdir(our_temp_directory), [])
++
++                def raise_OSError(*args, **kwargs):
++                    raise OSError()
++
++                with support.swap_attr(io, "open", raise_OSError):
++                    # test again with failing io.open()
++                    with self.assertRaises(FileNotFoundError):
++                        tempfile._get_default_tempdir()
++                    self.assertEqual(os.listdir(our_temp_directory), [])
++
++                open = io.open
++                def bad_writer(*args, **kwargs):
++                    fp = open(*args, **kwargs)
++                    fp.write = raise_OSError
++                    return fp
++
++                with support.swap_attr(io, "open", bad_writer):
++                    # test again with failing write()
++                    with self.assertRaises(FileNotFoundError):
++                        tempfile._get_default_tempdir()
++                    self.assertEqual(os.listdir(our_temp_directory), [])
+ 
+ 
+ class TestGetCandidateNames(BaseTestCase):
+@@ -745,6 +784,26 @@
+         seek(0, 0)
+         self.assertEqual(read(70), b'a'*35 + b'b'*35)
+ 
++    def test_properties(self):
++        f = tempfile.SpooledTemporaryFile(max_size=10)
++        f.write(b'x' * 10)
++        self.assertFalse(f._rolled)
++        self.assertEqual(f.mode, 'w+b')
++        self.assertIsNone(f.name)
++        with self.assertRaises(AttributeError):
++            f.newlines
++        with self.assertRaises(AttributeError):
++            f.encoding
++
++        f.write(b'x')
++        self.assertTrue(f._rolled)
++        self.assertEqual(f.mode, 'rb+')
++        self.assertIsNotNone(f.name)
++        with self.assertRaises(AttributeError):
++            f.newlines
++        with self.assertRaises(AttributeError):
++            f.encoding
++
+     def test_text_mode(self):
+         # Creating a SpooledTemporaryFile with a text mode should produce
+         # a file object reading and writing (Unicode) text strings.
+@@ -755,6 +814,12 @@
+         f.write("def\n")
+         f.seek(0)
+         self.assertEqual(f.read(), "abc\ndef\n")
++        self.assertFalse(f._rolled)
++        self.assertEqual(f.mode, 'w+')
++        self.assertIsNone(f.name)
++        self.assertIsNone(f.newlines)
++        self.assertIsNone(f.encoding)
++
+         f.write("xyzzy\n")
+         f.seek(0)
+         self.assertEqual(f.read(), "abc\ndef\nxyzzy\n")
+@@ -762,6 +827,11 @@
+         f.write("foo\x1abar\n")
+         f.seek(0)
+         self.assertEqual(f.read(), "abc\ndef\nxyzzy\nfoo\x1abar\n")
++        self.assertTrue(f._rolled)
++        self.assertEqual(f.mode, 'w+')
++        self.assertIsNotNone(f.name)
++        self.assertEqual(f.newlines, os.linesep)
++        self.assertIsNotNone(f.encoding)
+ 
+     def test_text_newline_and_encoding(self):
+         f = tempfile.SpooledTemporaryFile(mode='w+', max_size=10,
+@@ -770,11 +840,19 @@
+         f.seek(0)
+         self.assertEqual(f.read(), "\u039B\r\n")
+         self.assertFalse(f._rolled)
++        self.assertEqual(f.mode, 'w+')
++        self.assertIsNone(f.name)
++        self.assertIsNone(f.newlines)
++        self.assertIsNone(f.encoding)
+ 
+         f.write("\u039B" * 20 + "\r\n")
+         f.seek(0)
+         self.assertEqual(f.read(), "\u039B\r\n" + ("\u039B" * 20) + "\r\n")
+         self.assertTrue(f._rolled)
++        self.assertEqual(f.mode, 'w+')
++        self.assertIsNotNone(f.name)
++        self.assertIsNotNone(f.newlines)
++        self.assertEqual(f.encoding, 'utf-8')
+ 
+     def test_context_manager_before_rollover(self):
+         # A SpooledTemporaryFile can be used as a context manager
+@@ -924,8 +1002,9 @@
+         # (noted as part of Issue #10188)
+         with tempfile.TemporaryDirectory() as nonexistent:
+             pass
+-        with self.assertRaises(os.error):
++        with self.assertRaises(FileNotFoundError) as cm:
+             tempfile.TemporaryDirectory(dir=nonexistent)
++        self.assertEqual(cm.exception.errno, errno.ENOENT)
+ 
+     def test_explicit_cleanup(self):
+         # A TemporaryDirectory is deleted when cleaned up
+diff -r bd8afb90ebf2 Lib/test/test_textwrap.py
+--- a/Lib/test/test_textwrap.py
++++ b/Lib/test/test_textwrap.py
+@@ -22,7 +22,7 @@
+             result = []
+             for i in range(len(textin)):
+                 result.append("  %d: %r" % (i, textin[i]))
+-            result = '\n'.join(result)
++            result = "\n".join(result) if result else "  no lines"
+         elif isinstance(textin, str):
+             result = "  %s\n" % repr(textin)
+         return result
+@@ -66,6 +66,15 @@
+                          "I'm glad to hear it!"])
+         self.check_wrap(text, 80, [text])
+ 
++    def test_empty_string(self):
++        # Check that wrapping the empty string returns an empty list.
++        self.check_wrap("", 6, [])
++        self.check_wrap("", 6, [], drop_whitespace=False)
++
++    def test_empty_string_with_initial_indent(self):
++        # Check that the empty string is not indented.
++        self.check_wrap("", 6, [], initial_indent="++")
++        self.check_wrap("", 6, [], initial_indent="++", drop_whitespace=False)
+ 
+     def test_whitespace(self):
+         # Whitespace munging and end-of-sentence detection
+@@ -331,7 +340,32 @@
+                          ["blah", " ", "(ding", " ", "dong),",
+                           " ", "wubba"])
+ 
+-    def test_initial_whitespace(self):
++    def test_drop_whitespace_false(self):
++        # Check that drop_whitespace=False preserves whitespace.
++        # SF patch #1581073
++        text = " This is a    sentence with     much whitespace."
++        self.check_wrap(text, 10,
++                        [" This is a", "    ", "sentence ",
++                         "with     ", "much white", "space."],
++                        drop_whitespace=False)
++
++    def test_drop_whitespace_false_whitespace_only(self):
++        # Check that drop_whitespace=False preserves a whitespace-only string.
++        self.check_wrap("   ", 6, ["   "], drop_whitespace=False)
++
++    def test_drop_whitespace_false_whitespace_only_with_indent(self):
++        # Check that a whitespace-only string gets indented (when
++        # drop_whitespace is False).
++        self.check_wrap("   ", 6, ["     "], drop_whitespace=False,
++                        initial_indent="  ")
++
++    def test_drop_whitespace_whitespace_only(self):
++        # Check drop_whitespace on a whitespace-only string.
++        self.check_wrap("  ", 6, [])
++
++    def test_drop_whitespace_leading_whitespace(self):
++        # Check that drop_whitespace does not drop leading whitespace (if
++        # followed by non-whitespace).
+         # SF bug #622849 reported inconsistent handling of leading
+         # whitespace; let's test that a bit, shall we?
+         text = " This is a sentence with leading whitespace."
+@@ -340,13 +374,27 @@
+         self.check_wrap(text, 30,
+                         [" This is a sentence with", "leading whitespace."])
+ 
+-    def test_no_drop_whitespace(self):
+-        # SF patch #1581073
+-        text = " This is a    sentence with     much whitespace."
+-        self.check_wrap(text, 10,
+-                        [" This is a", "    ", "sentence ",
+-                         "with     ", "much white", "space."],
++    def test_drop_whitespace_whitespace_line(self):
++        # Check that drop_whitespace skips the whole line if a non-leading
++        # line consists only of whitespace.
++        text = "abcd    efgh"
++        # Include the result for drop_whitespace=False for comparison.
++        self.check_wrap(text, 6, ["abcd", "    ", "efgh"],
+                         drop_whitespace=False)
++        self.check_wrap(text, 6, ["abcd", "efgh"])
++
++    def test_drop_whitespace_whitespace_only_with_indent(self):
++        # Check that initial_indent is not applied to a whitespace-only
++        # string.  This checks a special case of the fact that dropping
++        # whitespace occurs before indenting.
++        self.check_wrap("  ", 6, [], initial_indent="++")
++
++    def test_drop_whitespace_whitespace_indent(self):
++        # Check that drop_whitespace does not drop whitespace indents.
++        # This checks a special case of the fact that dropping whitespace
++        # occurs before indenting.
++        self.check_wrap("abcd efgh", 6, ["  abcd", "  efgh"],
++                        initial_indent="  ", subsequent_indent="  ")
+ 
+     def test_split(self):
+         # Ensure that the standard _split() method works as advertised
+diff -r bd8afb90ebf2 Lib/test/test_threaded_import.py
+--- a/Lib/test/test_threaded_import.py
++++ b/Lib/test/test_threaded_import.py
+@@ -7,6 +7,7 @@
+ 
+ import os
+ import imp
++import importlib
+ import sys
+ import time
+ import shutil
+@@ -68,10 +69,11 @@
+         # Simulate some thread-unsafe behaviour. If calls to find_module()
+         # are properly serialized, `x` will end up the same as `numcalls`.
+         # Otherwise not.
++        assert imp.lock_held()
+         with self.lock:
+             self.numcalls += 1
+         x = self.x
+-        time.sleep(0.1)
++        time.sleep(0.01)
+         self.x = x + 1
+ 
+ class FlushingFinder:
+@@ -116,7 +118,7 @@
+                 t = threading.Thread(target=task,
+                                      args=(N, done, done_tasks, errors,))
+                 t.start()
+-            done.wait(60)
++            self.assertTrue(done.wait(60))
+             self.assertFalse(errors)
+             if verbose:
+                 print("OK.")
+@@ -189,6 +191,7 @@
+                 f.write(contents.encode('utf-8'))
+             self.addCleanup(forget, name)
+ 
++        importlib.invalidate_caches()
+         results = []
+         def import_ab():
+             import A
+@@ -219,6 +222,7 @@
+             f.write(code.encode('utf-8'))
+         self.addCleanup(unlink, filename)
+         self.addCleanup(forget, TESTFN)
++        importlib.invalidate_caches()
+         __import__(TESTFN)
+ 
+ 
+@@ -227,7 +231,7 @@
+     old_switchinterval = None
+     try:
+         old_switchinterval = sys.getswitchinterval()
+-        sys.setswitchinterval(0.00000001)
++        sys.setswitchinterval(1e-5)
+     except AttributeError:
+         pass
+     try:
+diff -r bd8afb90ebf2 Lib/test/test_threading.py
+--- a/Lib/test/test_threading.py
++++ b/Lib/test/test_threading.py
+@@ -452,7 +452,7 @@
+     # problems with some operating systems (issue #3863): skip problematic tests
+     # on platforms known to behave badly.
+     platforms_to_skip = ('freebsd4', 'freebsd5', 'freebsd6', 'netbsd5',
+-                         'os2emx')
++                         'os2emx', 'hp-ux11')
+ 
+     def _run_and_join(self, script):
+         script = """if 1:
+diff -r bd8afb90ebf2 Lib/test/test_time.py
+--- a/Lib/test/test_time.py
++++ b/Lib/test/test_time.py
+@@ -175,7 +175,7 @@
+ 
+     def test_strptime(self):
+         # Should be able to go round-trip from strftime to strptime without
+-        # throwing an exception.
++        # raising an exception.
+         tt = time.gmtime(self.t)
+         for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I',
+                           'j', 'm', 'M', 'p', 'S',
+diff -r bd8afb90ebf2 Lib/test/test_timeit.py
+--- a/Lib/test/test_timeit.py
++++ b/Lib/test/test_timeit.py
+@@ -250,6 +250,7 @@
+         s = self.run_main(seconds_per_increment=60.0, switches=['-r-5'])
+         self.assertEqual(s, "10 loops, best of 1: 60 sec per loop\n")
+ 
++    @unittest.skipIf(sys.flags.optimize >= 2, "need __doc__")
+     def test_main_help(self):
+         s = self.run_main(switches=['-h'])
+         # Note: It's not clear that the trailing space was intended as part of
+diff -r bd8afb90ebf2 Lib/test/test_tokenize.py
+--- a/Lib/test/test_tokenize.py
++++ b/Lib/test/test_tokenize.py
+@@ -1109,6 +1109,10 @@
+                                   token.NAME, token.AMPER, token.NUMBER,
+                                   token.RPAR)
+ 
++    def test_pathological_trailing_whitespace(self):
++        # See http://bugs.python.org/issue16152
++        self.assertExactTypeEqual('@          ', token.AT)
++
+ __test__ = {"doctests" : doctests, 'decistmt': decistmt}
+ 
+ def test_main():
+diff -r bd8afb90ebf2 Lib/test/test_tools.py
+--- a/Lib/test/test_tools.py
++++ b/Lib/test/test_tools.py
+@@ -9,10 +9,13 @@
+ import importlib.machinery
+ import unittest
+ from unittest import mock
++import shutil
++import subprocess
+ import sysconfig
+ import tempfile
++import textwrap
+ from test import support
+-from test.script_helper import assert_python_ok
++from test.script_helper import assert_python_ok, temp_dir
+ 
+ if not sysconfig.is_python_build():
+     # XXX some installers do contain the tools, should we detect that
+@@ -36,6 +39,328 @@
+         self.assertGreater(err, b'')
+ 
+ 
++class PindentTests(unittest.TestCase):
++    script = os.path.join(scriptsdir, 'pindent.py')
++
++    def assertFileEqual(self, fn1, fn2):
++        with open(fn1) as f1, open(fn2) as f2:
++            self.assertEqual(f1.readlines(), f2.readlines())
++
++    def pindent(self, source, *args):
++        with subprocess.Popen(
++                (sys.executable, self.script) + args,
++                stdin=subprocess.PIPE, stdout=subprocess.PIPE,
++                universal_newlines=True) as proc:
++            out, err = proc.communicate(source)
++        self.assertIsNone(err)
++        return out
++
++    def lstriplines(self, data):
++        return '\n'.join(line.lstrip() for line in data.splitlines()) + '\n'
++
++    def test_selftest(self):
++        self.maxDiff = None
++        with temp_dir() as directory:
++            data_path = os.path.join(directory, '_test.py')
++            with open(self.script) as f:
++                closed = f.read()
++            with open(data_path, 'w') as f:
++                f.write(closed)
++
++            rc, out, err = assert_python_ok(self.script, '-d', data_path)
++            self.assertEqual(out, b'')
++            self.assertEqual(err, b'')
++            backup = data_path + '~'
++            self.assertTrue(os.path.exists(backup))
++            with open(backup) as f:
++                self.assertEqual(f.read(), closed)
++            with open(data_path) as f:
++                clean = f.read()
++            compile(clean, '_test.py', 'exec')
++            self.assertEqual(self.pindent(clean, '-c'), closed)
++            self.assertEqual(self.pindent(closed, '-d'), clean)
++
++            rc, out, err = assert_python_ok(self.script, '-c', data_path)
++            self.assertEqual(out, b'')
++            self.assertEqual(err, b'')
++            with open(backup) as f:
++                self.assertEqual(f.read(), clean)
++            with open(data_path) as f:
++                self.assertEqual(f.read(), closed)
++
++            broken = self.lstriplines(closed)
++            with open(data_path, 'w') as f:
++                f.write(broken)
++            rc, out, err = assert_python_ok(self.script, '-r', data_path)
++            self.assertEqual(out, b'')
++            self.assertEqual(err, b'')
++            with open(backup) as f:
++                self.assertEqual(f.read(), broken)
++            with open(data_path) as f:
++                indented = f.read()
++            compile(indented, '_test.py', 'exec')
++            self.assertEqual(self.pindent(broken, '-r'), indented)
++
++    def pindent_test(self, clean, closed):
++        self.assertEqual(self.pindent(clean, '-c'), closed)
++        self.assertEqual(self.pindent(closed, '-d'), clean)
++        broken = self.lstriplines(closed)
++        self.assertEqual(self.pindent(broken, '-r', '-e', '-s', '4'), closed)
++
++    def test_statements(self):
++        clean = textwrap.dedent("""\
++            if a:
++                pass
++
++            if a:
++                pass
++            else:
++                pass
++
++            if a:
++                pass
++            elif:
++                pass
++            else:
++                pass
++
++            while a:
++                break
++
++            while a:
++                break
++            else:
++                pass
++
++            for i in a:
++                break
++
++            for i in a:
++                break
++            else:
++                pass
++
++            try:
++                pass
++            finally:
++                pass
++
++            try:
++                pass
++            except TypeError:
++                pass
++            except ValueError:
++                pass
++            else:
++                pass
++
++            try:
++                pass
++            except TypeError:
++                pass
++            except ValueError:
++                pass
++            finally:
++                pass
++
++            with a:
++                pass
++
++            class A:
++                pass
++
++            def f():
++                pass
++            """)
++
++        closed = textwrap.dedent("""\
++            if a:
++                pass
++            # end if
++
++            if a:
++                pass
++            else:
++                pass
++            # end if
++
++            if a:
++                pass
++            elif:
++                pass
++            else:
++                pass
++            # end if
++
++            while a:
++                break
++            # end while
++
++            while a:
++                break
++            else:
++                pass
++            # end while
++
++            for i in a:
++                break
++            # end for
++
++            for i in a:
++                break
++            else:
++                pass
++            # end for
++
++            try:
++                pass
++            finally:
++                pass
++            # end try
++
++            try:
++                pass
++            except TypeError:
++                pass
++            except ValueError:
++                pass
++            else:
++                pass
++            # end try
++
++            try:
++                pass
++            except TypeError:
++                pass
++            except ValueError:
++                pass
++            finally:
++                pass
++            # end try
++
++            with a:
++                pass
++            # end with
++
++            class A:
++                pass
++            # end class A
++
++            def f():
++                pass
++            # end def f
++            """)
++        self.pindent_test(clean, closed)
++
++    def test_multilevel(self):
++        clean = textwrap.dedent("""\
++            def foobar(a, b):
++                if a == b:
++                    a = a+1
++                elif a < b:
++                    b = b-1
++                    if b > a: a = a-1
++                else:
++                    print 'oops!'
++            """)
++        closed = textwrap.dedent("""\
++            def foobar(a, b):
++                if a == b:
++                    a = a+1
++                elif a < b:
++                    b = b-1
++                    if b > a: a = a-1
++                    # end if
++                else:
++                    print 'oops!'
++                # end if
++            # end def foobar
++            """)
++        self.pindent_test(clean, closed)
++
++    def test_preserve_indents(self):
++        clean = textwrap.dedent("""\
++            if a:
++                     if b:
++                              pass
++            """)
++        closed = textwrap.dedent("""\
++            if a:
++                     if b:
++                              pass
++                     # end if
++            # end if
++            """)
++        self.assertEqual(self.pindent(clean, '-c'), closed)
++        self.assertEqual(self.pindent(closed, '-d'), clean)
++        broken = self.lstriplines(closed)
++        self.assertEqual(self.pindent(broken, '-r', '-e', '-s', '9'), closed)
++        clean = textwrap.dedent("""\
++            if a:
++            \tif b:
++            \t\tpass
++            """)
++        closed = textwrap.dedent("""\
++            if a:
++            \tif b:
++            \t\tpass
++            \t# end if
++            # end if
++            """)
++        self.assertEqual(self.pindent(clean, '-c'), closed)
++        self.assertEqual(self.pindent(closed, '-d'), clean)
++        broken = self.lstriplines(closed)
++        self.assertEqual(self.pindent(broken, '-r'), closed)
++
++    def test_escaped_newline(self):
++        clean = textwrap.dedent("""\
++            class\\
++            \\
++             A:
++               def\
++            \\
++            f:
++                  pass
++            """)
++        closed = textwrap.dedent("""\
++            class\\
++            \\
++             A:
++               def\
++            \\
++            f:
++                  pass
++               # end def f
++            # end class A
++            """)
++        self.assertEqual(self.pindent(clean, '-c'), closed)
++        self.assertEqual(self.pindent(closed, '-d'), clean)
++
++    def test_empty_line(self):
++        clean = textwrap.dedent("""\
++            if a:
++
++                pass
++            """)
++        closed = textwrap.dedent("""\
++            if a:
++
++                pass
++            # end if
++            """)
++        self.pindent_test(clean, closed)
++
++    def test_oneline(self):
++        clean = textwrap.dedent("""\
++            if a: pass
++            """)
++        closed = textwrap.dedent("""\
++            if a: pass
++            # end if
++            """)
++        self.pindent_test(clean, closed)
++
++
+ class TestSundryScripts(unittest.TestCase):
+     # At least make sure the rest don't have syntax errors.  When tests are
+     # added for a script it should be added to the whitelist below.
+diff -r bd8afb90ebf2 Lib/test/test_trace.py
+--- a/Lib/test/test_trace.py
++++ b/Lib/test/test_trace.py
+@@ -1,4 +1,5 @@
+ import os
++import io
+ import sys
+ from test.support import (run_unittest, TESTFN, rmtree, unlink,
+                                captured_stdout)
+@@ -361,6 +362,51 @@
+         self.assertTrue(ignore.names(jn('bar', 'baz.py'), 'baz'))
+ 
+ 
++class TestDeprecatedMethods(unittest.TestCase):
++
++    def test_deprecated_usage(self):
++        sio = io.StringIO()
++        with self.assertWarns(DeprecationWarning):
++            trace.usage(sio)
++        self.assertIn('Usage:', sio.getvalue())
++
++    def test_deprecated_Ignore(self):
++        with self.assertWarns(DeprecationWarning):
++            trace.Ignore()
++
++    def test_deprecated_modname(self):
++        with self.assertWarns(DeprecationWarning):
++            self.assertEqual("spam", trace.modname("spam"))
++
++    def test_deprecated_fullmodname(self):
++        with self.assertWarns(DeprecationWarning):
++            self.assertEqual("spam", trace.fullmodname("spam"))
++
++    def test_deprecated_find_lines_from_code(self):
++        with self.assertWarns(DeprecationWarning):
++            def foo():
++                pass
++            trace.find_lines_from_code(foo.__code__, ["eggs"])
++
++    def test_deprecated_find_lines(self):
++        with self.assertWarns(DeprecationWarning):
++            def foo():
++                pass
++            trace.find_lines(foo.__code__, ["eggs"])
++
++    def test_deprecated_find_strings(self):
++        with open(TESTFN, 'w') as fd:
++            self.addCleanup(unlink, TESTFN)
++        with self.assertWarns(DeprecationWarning):
++            trace.find_strings(fd.name)
++
++    def test_deprecated_find_executable_linenos(self):
++        with open(TESTFN, 'w') as fd:
++            self.addCleanup(unlink, TESTFN)
++        with self.assertWarns(DeprecationWarning):
++            trace.find_executable_linenos(fd.name)
++
++
+ def test_main():
+     run_unittest(__name__)
+ 
+diff -r bd8afb90ebf2 Lib/test/test_types.py
+--- a/Lib/test/test_types.py
++++ b/Lib/test/test_types.py
+@@ -791,7 +791,7 @@
+         self.assertEqual(C.y, 1)
+         self.assertEqual(C.z, 2)
+ 
+-    def test_new_class_exec_body(self):
++    def test_new_class_metaclass_keywords(self):
+         #Test that keywords are passed to the metaclass:
+         def meta_func(name, bases, ns, **kw):
+             return name, bases, ns, kw
+@@ -1135,6 +1135,15 @@
+         with self.assertRaises(TypeError):
+             ns['spam']
+ 
++    def test_subclass(self):
++        class Spam(types.SimpleNamespace):
++            pass
++
++        spam = Spam(ham=8, eggs=9)
++
++        self.assertIs(type(spam), Spam)
++        self.assertEqual(vars(spam), {'ham': 8, 'eggs': 9})
++
+ 
+ def test_main():
+     run_unittest(TypesTests, MappingProxyTests, ClassCreationTests,
+diff -r bd8afb90ebf2 Lib/test/test_ucn.py
+--- a/Lib/test/test_ucn.py
++++ b/Lib/test/test_ucn.py
+@@ -9,6 +9,7 @@
+ 
+ import unittest
+ import unicodedata
++import _testcapi
+ 
+ from test import support
+ from http.client import HTTPException
+@@ -215,6 +216,21 @@
+             str, b"\\NSPACE", 'unicode-escape', 'strict'
+         )
+ 
++    @unittest.skipUnless(_testcapi.INT_MAX < _testcapi.PY_SSIZE_T_MAX,
++                         "needs UINT_MAX < SIZE_MAX")
++    @support.bigmemtest(size=_testcapi.UINT_MAX + 1,
++                        memuse=2 + 1, dry_run=False)
++    def test_issue16335(self, size):
++        # very very long bogus character name
++        x = b'\\N{SPACE' + b'x' * (_testcapi.UINT_MAX + 1) + b'}'
++        self.assertEqual(len(x), len(b'\\N{SPACE}') +
++                                    (_testcapi.UINT_MAX + 1))
++        self.assertRaisesRegex(UnicodeError,
++            'unknown Unicode character name',
++            x.decode, 'unicode-escape'
++        )
++
++
+ def test_main():
+     support.run_unittest(UnicodeNamesTest)
+ 
+diff -r bd8afb90ebf2 Lib/test/test_unicode.py
+--- a/Lib/test/test_unicode.py
++++ b/Lib/test/test_unicode.py
+@@ -33,7 +33,8 @@
+ 
+ class UnicodeTest(string_tests.CommonTest,
+         string_tests.MixinStrUnicodeUserStringTest,
+-        string_tests.MixinStrUnicodeTest):
++        string_tests.MixinStrUnicodeTest,
++        unittest.TestCase):
+ 
+     type2test = str
+ 
+@@ -981,6 +982,21 @@
+         self.assertRaises(ValueError, '{}'.format_map, 'a')
+         self.assertRaises(ValueError, '{a} {}'.format_map, {"a" : 2, "b" : 1})
+ 
++    def test_format_huge_precision(self):
++        format_string = ".{}f".format(sys.maxsize + 1)
++        with self.assertRaises(ValueError):
++            result = format(2.34, format_string)
++
++    def test_format_huge_width(self):
++        format_string = "{}f".format(sys.maxsize + 1)
++        with self.assertRaises(ValueError):
++            result = format(2.34, format_string)
++
++    def test_format_huge_item_number(self):
++        format_string = "{{{}:.6f}}".format(sys.maxsize + 1)
++        with self.assertRaises(ValueError):
++            result = format_string.format(2.34)
++
+     def test_format_auto_numbering(self):
+         class C:
+             def __init__(self, x=100):
+@@ -1069,6 +1085,18 @@
+         self.assertEqual('%.1s' % "a\xe9\u20ac", 'a')
+         self.assertEqual('%.2s' % "a\xe9\u20ac", 'a\xe9')
+ 
++    @support.cpython_only
++    def test_formatting_huge_precision(self):
++        from _testcapi import INT_MAX
++        format_string = "%.{}f".format(INT_MAX + 1)
++        with self.assertRaises(ValueError):
++            result = format_string % 2.34
++
++    def test_formatting_huge_width(self):
++        format_string = "%{}f".format(sys.maxsize + 1)
++        with self.assertRaises(ValueError):
++            result = format_string % 2.34
++
+     def test_startswith_endswith_errors(self):
+         for meth in ('foo'.startswith, 'foo'.endswith):
+             with self.assertRaises(TypeError) as cm:
+@@ -1155,6 +1183,26 @@
+ 
+         self.assertRaises(TypeError, str, 42, 42, 42)
+ 
++    def test_constructor_keyword_args(self):
++        """Pass various keyword argument combinations to the constructor."""
++        # The object argument can be passed as a keyword.
++        self.assertEqual(str(object='foo'), 'foo')
++        self.assertEqual(str(object=b'foo', encoding='utf-8'), 'foo')
++        # The errors argument without encoding triggers "decode" mode.
++        self.assertEqual(str(b'foo', errors='strict'), 'foo')  # not "b'foo'"
++        self.assertEqual(str(object=b'foo', errors='strict'), 'foo')
++
++    def test_constructor_defaults(self):
++        """Check the constructor argument defaults."""
++        # The object argument defaults to '' or b''.
++        self.assertEqual(str(), '')
++        self.assertEqual(str(errors='strict'), '')
++        utf8_cent = '¢'.encode('utf-8')
++        # The encoding argument defaults to utf-8.
++        self.assertEqual(str(utf8_cent, errors='strict'), '¢')
++        # The errors argument defaults to strict.
++        self.assertRaises(UnicodeDecodeError, str, utf8_cent, encoding='ascii')
++
+     def test_codecs_utf7(self):
+         utfTests = [
+             ('A\u2262\u0391.', b'A+ImIDkQ.'),             # RFC2152 example
+@@ -1322,7 +1370,7 @@
+             # with start byte of a 2-byte sequence
+             (b'\xc2', FFFD), # only the start byte
+             (b'\xc2\xc2', FFFD*2), # 2 start bytes
+-            (b'\xc2\xc2\xc2', FFFD*3), # 2 start bytes
++            (b'\xc2\xc2\xc2', FFFD*3), # 3 start bytes
+             (b'\xc2\x41', FFFD+'A'), # invalid continuation byte
+             # with start byte of a 3-byte sequence
+             (b'\xe1', FFFD), # only the start byte
+@@ -1392,6 +1440,226 @@
+             self.assertEqual(seq.decode('utf-8', 'ignore'),
+                              res.replace('\uFFFD', ''))
+ 
++    def to_bytestring(self, seq):
++        return bytes(int(c, 16) for c in seq.split())
++
++    def assertCorrectUTF8Decoding(self, seq, res, err):
++        """
++        Check that an invalid UTF-8 sequence raises an UnicodeDecodeError when
++        'strict' is used, returns res when 'replace' is used, and that doesn't
++        return anything when 'ignore' is used.
++        """
++        with self.assertRaises(UnicodeDecodeError) as cm:
++            seq.decode('utf-8')
++        exc = cm.exception
++
++        self.assertIn(err, str(exc))
++        self.assertEqual(seq.decode('utf-8', 'replace'), res)
++        self.assertEqual((b'aaaa' + seq + b'bbbb').decode('utf-8', 'replace'),
++                         'aaaa' + res + 'bbbb')
++        res = res.replace('\ufffd', '')
++        self.assertEqual(seq.decode('utf-8', 'ignore'), res)
++        self.assertEqual((b'aaaa' + seq + b'bbbb').decode('utf-8', 'ignore'),
++                          'aaaa' + res + 'bbbb')
++
++    def test_invalid_start_byte(self):
++        """
++        Test that an 'invalid start byte' error is raised when the first byte
++        is not in the ASCII range or is not a valid start byte of a 2-, 3-, or
++        4-bytes sequence. The invalid start byte is replaced with a single
++        U+FFFD when errors='replace'.
++        E.g. <80> is a continuation byte and can appear only after a start byte.
++        """
++        FFFD = '\ufffd'
++        for byte in b'\x80\xA0\x9F\xBF\xC0\xC1\xF5\xFF':
++            self.assertCorrectUTF8Decoding(bytes([byte]), '\ufffd',
++                                           'invalid start byte')
++
++    def test_unexpected_end_of_data(self):
++        """
++        Test that an 'unexpected end of data' error is raised when the string
++        ends after a start byte of a 2-, 3-, or 4-bytes sequence without having
++        enough continuation bytes.  The incomplete sequence is replaced with a
++        single U+FFFD when errors='replace'.
++        E.g. in the sequence <F3 80 80>, F3 is the start byte of a 4-bytes
++        sequence, but it's followed by only 2 valid continuation bytes and the
++        last continuation bytes is missing.
++        Note: the continuation bytes must be all valid, if one of them is
++        invalid another error will be raised.
++        """
++        sequences = [
++            'C2', 'DF',
++            'E0 A0', 'E0 BF', 'E1 80', 'E1 BF', 'EC 80', 'EC BF',
++            'ED 80', 'ED 9F', 'EE 80', 'EE BF', 'EF 80', 'EF BF',
++            'F0 90', 'F0 BF', 'F0 90 80', 'F0 90 BF', 'F0 BF 80', 'F0 BF BF',
++            'F1 80', 'F1 BF', 'F1 80 80', 'F1 80 BF', 'F1 BF 80', 'F1 BF BF',
++            'F3 80', 'F3 BF', 'F3 80 80', 'F3 80 BF', 'F3 BF 80', 'F3 BF BF',
++            'F4 80', 'F4 8F', 'F4 80 80', 'F4 80 BF', 'F4 8F 80', 'F4 8F BF'
++        ]
++        FFFD = '\ufffd'
++        for seq in sequences:
++            self.assertCorrectUTF8Decoding(self.to_bytestring(seq), '\ufffd',
++                                           'unexpected end of data')
++
++    def test_invalid_cb_for_2bytes_seq(self):
++        """
++        Test that an 'invalid continuation byte' error is raised when the
++        continuation byte of a 2-bytes sequence is invalid.  The start byte
++        is replaced by a single U+FFFD and the second byte is handled
++        separately when errors='replace'.
++        E.g. in the sequence <C2 41>, C2 is the start byte of a 2-bytes
++        sequence, but 41 is not a valid continuation byte because it's the
++        ASCII letter 'A'.
++        """
++        FFFD = '\ufffd'
++        FFFDx2 = FFFD * 2
++        sequences = [
++            ('C2 00', FFFD+'\x00'), ('C2 7F', FFFD+'\x7f'),
++            ('C2 C0', FFFDx2), ('C2 FF', FFFDx2),
++            ('DF 00', FFFD+'\x00'), ('DF 7F', FFFD+'\x7f'),
++            ('DF C0', FFFDx2), ('DF FF', FFFDx2),
++        ]
++        for seq, res in sequences:
++            self.assertCorrectUTF8Decoding(self.to_bytestring(seq), res,
++                                           'invalid continuation byte')
++
++    def test_invalid_cb_for_3bytes_seq(self):
++        """
++        Test that an 'invalid continuation byte' error is raised when the
++        continuation byte(s) of a 3-bytes sequence are invalid.  When
++        errors='replace', if the first continuation byte is valid, the first
++        two bytes (start byte + 1st cb) are replaced by a single U+FFFD and the
++        third byte is handled separately, otherwise only the start byte is
++        replaced with a U+FFFD and the other continuation bytes are handled
++        separately.
++        E.g. in the sequence <E1 80 41>, E1 is the start byte of a 3-bytes
++        sequence, 80 is a valid continuation byte, but 41 is not a valid cb
++        because it's the ASCII letter 'A'.
++        Note: when the start byte is E0 or ED, the valid ranges for the first
++        continuation byte are limited to A0..BF and 80..9F respectively.
++        Python 2 used to consider all the bytes in range 80..BF valid when the
++        start byte was ED.  This is fixed in Python 3.
++        """
++        FFFD = '\ufffd'
++        FFFDx2 = FFFD * 2
++        sequences = [
++            ('E0 00', FFFD+'\x00'), ('E0 7F', FFFD+'\x7f'), ('E0 80', FFFDx2),
++            ('E0 9F', FFFDx2), ('E0 C0', FFFDx2), ('E0 FF', FFFDx2),
++            ('E0 A0 00', FFFD+'\x00'), ('E0 A0 7F', FFFD+'\x7f'),
++            ('E0 A0 C0', FFFDx2), ('E0 A0 FF', FFFDx2),
++            ('E0 BF 00', FFFD+'\x00'), ('E0 BF 7F', FFFD+'\x7f'),
++            ('E0 BF C0', FFFDx2), ('E0 BF FF', FFFDx2), ('E1 00', FFFD+'\x00'),
++            ('E1 7F', FFFD+'\x7f'), ('E1 C0', FFFDx2), ('E1 FF', FFFDx2),
++            ('E1 80 00', FFFD+'\x00'), ('E1 80 7F', FFFD+'\x7f'),
++            ('E1 80 C0', FFFDx2), ('E1 80 FF', FFFDx2),
++            ('E1 BF 00', FFFD+'\x00'), ('E1 BF 7F', FFFD+'\x7f'),
++            ('E1 BF C0', FFFDx2), ('E1 BF FF', FFFDx2), ('EC 00', FFFD+'\x00'),
++            ('EC 7F', FFFD+'\x7f'), ('EC C0', FFFDx2), ('EC FF', FFFDx2),
++            ('EC 80 00', FFFD+'\x00'), ('EC 80 7F', FFFD+'\x7f'),
++            ('EC 80 C0', FFFDx2), ('EC 80 FF', FFFDx2),
++            ('EC BF 00', FFFD+'\x00'), ('EC BF 7F', FFFD+'\x7f'),
++            ('EC BF C0', FFFDx2), ('EC BF FF', FFFDx2), ('ED 00', FFFD+'\x00'),
++            ('ED 7F', FFFD+'\x7f'),
++            ('ED A0', FFFDx2), ('ED BF', FFFDx2), # see note ^
++            ('ED C0', FFFDx2), ('ED FF', FFFDx2), ('ED 80 00', FFFD+'\x00'),
++            ('ED 80 7F', FFFD+'\x7f'), ('ED 80 C0', FFFDx2),
++            ('ED 80 FF', FFFDx2), ('ED 9F 00', FFFD+'\x00'),
++            ('ED 9F 7F', FFFD+'\x7f'), ('ED 9F C0', FFFDx2),
++            ('ED 9F FF', FFFDx2), ('EE 00', FFFD+'\x00'),
++            ('EE 7F', FFFD+'\x7f'), ('EE C0', FFFDx2), ('EE FF', FFFDx2),
++            ('EE 80 00', FFFD+'\x00'), ('EE 80 7F', FFFD+'\x7f'),
++            ('EE 80 C0', FFFDx2), ('EE 80 FF', FFFDx2),
++            ('EE BF 00', FFFD+'\x00'), ('EE BF 7F', FFFD+'\x7f'),
++            ('EE BF C0', FFFDx2), ('EE BF FF', FFFDx2), ('EF 00', FFFD+'\x00'),
++            ('EF 7F', FFFD+'\x7f'), ('EF C0', FFFDx2), ('EF FF', FFFDx2),
++            ('EF 80 00', FFFD+'\x00'), ('EF 80 7F', FFFD+'\x7f'),
++            ('EF 80 C0', FFFDx2), ('EF 80 FF', FFFDx2),
++            ('EF BF 00', FFFD+'\x00'), ('EF BF 7F', FFFD+'\x7f'),
++            ('EF BF C0', FFFDx2), ('EF BF FF', FFFDx2),
++        ]
++        for seq, res in sequences:
++            self.assertCorrectUTF8Decoding(self.to_bytestring(seq), res,
++                                           'invalid continuation byte')
++
++    def test_invalid_cb_for_4bytes_seq(self):
++        """
++        Test that an 'invalid continuation byte' error is raised when the
++        continuation byte(s) of a 4-bytes sequence are invalid.  When
++        errors='replace',the start byte and all the following valid
++        continuation bytes are replaced with a single U+FFFD, and all the bytes
++        starting from the first invalid continuation bytes (included) are
++        handled separately.
++        E.g. in the sequence <E1 80 41>, E1 is the start byte of a 3-bytes
++        sequence, 80 is a valid continuation byte, but 41 is not a valid cb
++        because it's the ASCII letter 'A'.
++        Note: when the start byte is E0 or ED, the valid ranges for the first
++        continuation byte are limited to A0..BF and 80..9F respectively.
++        However, when the start byte is ED, Python 2 considers all the bytes
++        in range 80..BF valid.  This is fixed in Python 3.
++        """
++        FFFD = '\ufffd'
++        FFFDx2 = FFFD * 2
++        sequences = [
++            ('F0 00', FFFD+'\x00'), ('F0 7F', FFFD+'\x7f'), ('F0 80', FFFDx2),
++            ('F0 8F', FFFDx2), ('F0 C0', FFFDx2), ('F0 FF', FFFDx2),
++            ('F0 90 00', FFFD+'\x00'), ('F0 90 7F', FFFD+'\x7f'),
++            ('F0 90 C0', FFFDx2), ('F0 90 FF', FFFDx2),
++            ('F0 BF 00', FFFD+'\x00'), ('F0 BF 7F', FFFD+'\x7f'),
++            ('F0 BF C0', FFFDx2), ('F0 BF FF', FFFDx2),
++            ('F0 90 80 00', FFFD+'\x00'), ('F0 90 80 7F', FFFD+'\x7f'),
++            ('F0 90 80 C0', FFFDx2), ('F0 90 80 FF', FFFDx2),
++            ('F0 90 BF 00', FFFD+'\x00'), ('F0 90 BF 7F', FFFD+'\x7f'),
++            ('F0 90 BF C0', FFFDx2), ('F0 90 BF FF', FFFDx2),
++            ('F0 BF 80 00', FFFD+'\x00'), ('F0 BF 80 7F', FFFD+'\x7f'),
++            ('F0 BF 80 C0', FFFDx2), ('F0 BF 80 FF', FFFDx2),
++            ('F0 BF BF 00', FFFD+'\x00'), ('F0 BF BF 7F', FFFD+'\x7f'),
++            ('F0 BF BF C0', FFFDx2), ('F0 BF BF FF', FFFDx2),
++            ('F1 00', FFFD+'\x00'), ('F1 7F', FFFD+'\x7f'), ('F1 C0', FFFDx2),
++            ('F1 FF', FFFDx2), ('F1 80 00', FFFD+'\x00'),
++            ('F1 80 7F', FFFD+'\x7f'), ('F1 80 C0', FFFDx2),
++            ('F1 80 FF', FFFDx2), ('F1 BF 00', FFFD+'\x00'),
++            ('F1 BF 7F', FFFD+'\x7f'), ('F1 BF C0', FFFDx2),
++            ('F1 BF FF', FFFDx2), ('F1 80 80 00', FFFD+'\x00'),
++            ('F1 80 80 7F', FFFD+'\x7f'), ('F1 80 80 C0', FFFDx2),
++            ('F1 80 80 FF', FFFDx2), ('F1 80 BF 00', FFFD+'\x00'),
++            ('F1 80 BF 7F', FFFD+'\x7f'), ('F1 80 BF C0', FFFDx2),
++            ('F1 80 BF FF', FFFDx2), ('F1 BF 80 00', FFFD+'\x00'),
++            ('F1 BF 80 7F', FFFD+'\x7f'), ('F1 BF 80 C0', FFFDx2),
++            ('F1 BF 80 FF', FFFDx2), ('F1 BF BF 00', FFFD+'\x00'),
++            ('F1 BF BF 7F', FFFD+'\x7f'), ('F1 BF BF C0', FFFDx2),
++            ('F1 BF BF FF', FFFDx2), ('F3 00', FFFD+'\x00'),
++            ('F3 7F', FFFD+'\x7f'), ('F3 C0', FFFDx2), ('F3 FF', FFFDx2),
++            ('F3 80 00', FFFD+'\x00'), ('F3 80 7F', FFFD+'\x7f'),
++            ('F3 80 C0', FFFDx2), ('F3 80 FF', FFFDx2),
++            ('F3 BF 00', FFFD+'\x00'), ('F3 BF 7F', FFFD+'\x7f'),
++            ('F3 BF C0', FFFDx2), ('F3 BF FF', FFFDx2),
++            ('F3 80 80 00', FFFD+'\x00'), ('F3 80 80 7F', FFFD+'\x7f'),
++            ('F3 80 80 C0', FFFDx2), ('F3 80 80 FF', FFFDx2),
++            ('F3 80 BF 00', FFFD+'\x00'), ('F3 80 BF 7F', FFFD+'\x7f'),
++            ('F3 80 BF C0', FFFDx2), ('F3 80 BF FF', FFFDx2),
++            ('F3 BF 80 00', FFFD+'\x00'), ('F3 BF 80 7F', FFFD+'\x7f'),
++            ('F3 BF 80 C0', FFFDx2), ('F3 BF 80 FF', FFFDx2),
++            ('F3 BF BF 00', FFFD+'\x00'), ('F3 BF BF 7F', FFFD+'\x7f'),
++            ('F3 BF BF C0', FFFDx2), ('F3 BF BF FF', FFFDx2),
++            ('F4 00', FFFD+'\x00'), ('F4 7F', FFFD+'\x7f'), ('F4 90', FFFDx2),
++            ('F4 BF', FFFDx2), ('F4 C0', FFFDx2), ('F4 FF', FFFDx2),
++            ('F4 80 00', FFFD+'\x00'), ('F4 80 7F', FFFD+'\x7f'),
++            ('F4 80 C0', FFFDx2), ('F4 80 FF', FFFDx2),
++            ('F4 8F 00', FFFD+'\x00'), ('F4 8F 7F', FFFD+'\x7f'),
++            ('F4 8F C0', FFFDx2), ('F4 8F FF', FFFDx2),
++            ('F4 80 80 00', FFFD+'\x00'), ('F4 80 80 7F', FFFD+'\x7f'),
++            ('F4 80 80 C0', FFFDx2), ('F4 80 80 FF', FFFDx2),
++            ('F4 80 BF 00', FFFD+'\x00'), ('F4 80 BF 7F', FFFD+'\x7f'),
++            ('F4 80 BF C0', FFFDx2), ('F4 80 BF FF', FFFDx2),
++            ('F4 8F 80 00', FFFD+'\x00'), ('F4 8F 80 7F', FFFD+'\x7f'),
++            ('F4 8F 80 C0', FFFDx2), ('F4 8F 80 FF', FFFDx2),
++            ('F4 8F BF 00', FFFD+'\x00'), ('F4 8F BF 7F', FFFD+'\x7f'),
++            ('F4 8F BF C0', FFFDx2), ('F4 8F BF FF', FFFDx2)
++        ]
++        for seq, res in sequences:
++            self.assertCorrectUTF8Decoding(self.to_bytestring(seq), res,
++                                           'invalid continuation byte')
++
+     def test_codecs_idna(self):
+         # Test whether trailing dot is preserved
+         self.assertEqual("www.python.org.".encode("idna"), b"www.python.org.")
+@@ -1899,6 +2167,21 @@
+         self.assertEqual(args[0], text)
+         self.assertEqual(len(args), 1)
+ 
++    def test_resize(self):
++        for length in range(1, 100, 7):
++            # generate a fresh string (refcount=1)
++            text = 'a' * length + 'b'
++
++            # fill wstr internal field
++            abc = text.encode('unicode_internal')
++            self.assertEqual(abc.decode('unicode_internal'), text)
++
++            # resize text: wstr field must be cleared and then recomputed
++            text += 'c'
++            abcdef = text.encode('unicode_internal')
++            self.assertNotEqual(abc, abcdef)
++            self.assertEqual(abcdef.decode('unicode_internal'), text)
++
+ 
+ class StringModuleTest(unittest.TestCase):
+     def test_formatter_parser(self):
+@@ -1951,8 +2234,5 @@
+         self.assertRaises(TypeError, _string.formatter_field_name_split, 1)
+ 
+ 
+-def test_main():
+-    support.run_unittest(__name__)
+-
+ if __name__ == "__main__":
+-    test_main()
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_urllib.py
+--- a/Lib/test/test_urllib.py
++++ b/Lib/test/test_urllib.py
+@@ -268,6 +268,39 @@
+         finally:
+             self.unfakehttp()
+ 
++    def test_missing_localfile(self):
++        # Test for #10836
++        # 3.3 - URLError is not captured, explicit IOError is raised.
++        with self.assertRaises(IOError):
++            urlopen('file://localhost/a/file/which/doesnot/exists.py')
++
++    def test_file_notexists(self):
++        fd, tmp_file = tempfile.mkstemp()
++        tmp_fileurl = 'file://localhost/' + tmp_file.replace(os.path.sep, '/')
++        try:
++            self.assertTrue(os.path.exists(tmp_file))
++            with urlopen(tmp_fileurl) as fobj:
++                self.assertTrue(fobj)
++        finally:
++            os.close(fd)
++            os.unlink(tmp_file)
++        self.assertFalse(os.path.exists(tmp_file))
++        # 3.3 - IOError instead of URLError
++        with self.assertRaises(IOError):
++            urlopen(tmp_fileurl)
++
++    def test_ftp_nohost(self):
++        test_ftp_url = 'ftp:///path'
++        # 3.3 - IOError instead of URLError
++        with self.assertRaises(IOError):
++            urlopen(test_ftp_url)
++
++    def test_ftp_nonexisting(self):
++        # 3.3 - IOError instead of URLError
++        with self.assertRaises(IOError):
++            urlopen('ftp://localhost/a/file/which/doesnot/exists.py')
++
++
+     def test_userpass_inurl(self):
+         self.fakehttp(b"HTTP/1.0 200 OK\r\n\r\nHello!")
+         try:
+@@ -300,7 +333,7 @@
+ 
+     def test_URLopener_deprecation(self):
+         with support.check_warnings(('',DeprecationWarning)):
+-            warn = urllib.request.URLopener()
++            urllib.request.URLopener()
+ 
+ class urlretrieve_FileTests(unittest.TestCase):
+     """Test urllib.urlretrieve() on local files"""
+@@ -422,8 +455,8 @@
+         urllib.request.urlretrieve(self.constructLocalFileUrl(srcFileName),
+             support.TESTFN, hooktester)
+         self.assertEqual(len(report), 2)
+-        self.assertEqual(report[0][1], 0)
+-        self.assertEqual(report[1][1], 5)
++        self.assertEqual(report[0][2], 5)
++        self.assertEqual(report[1][2], 5)
+ 
+     def test_reporthook_8193_bytes(self):
+         # Test on 8193 byte file. Should call reporthook only 3 times (once
+@@ -436,9 +469,10 @@
+         urllib.request.urlretrieve(self.constructLocalFileUrl(srcFileName),
+             support.TESTFN, hooktester)
+         self.assertEqual(len(report), 3)
+-        self.assertEqual(report[0][1], 0)
++        self.assertEqual(report[0][2], 8193)
++        self.assertEqual(report[0][1], 8192)
+         self.assertEqual(report[1][1], 8192)
+-        self.assertEqual(report[2][1], 1)
++        self.assertEqual(report[2][1], 8192)
+ 
+ 
+ class urlretrieve_HttpTests(unittest.TestCase, FakeHTTPMixin):
+diff -r bd8afb90ebf2 Lib/test/test_urllib2.py
+--- a/Lib/test/test_urllib2.py
++++ b/Lib/test/test_urllib2.py
+@@ -1288,7 +1288,7 @@
+                               )
+ 
+     def test_basic_and_digest_auth_handlers(self):
+-        # HTTPDigestAuthHandler threw an exception if it couldn't handle a 40*
++        # HTTPDigestAuthHandler raised an exception if it couldn't handle a 40*
+         # response (http://python.org/sf/1479302), where it should instead
+         # return None to allow another handler (especially
+         # HTTPBasicAuthHandler) to handle the response.
+@@ -1495,18 +1495,34 @@
+         req = Request(url)
+         self.assertEqual(req.get_full_url(), url)
+ 
+-def test_HTTPError_interface():
+-    """
+-    Issue 13211 reveals that HTTPError didn't implement the URLError
+-    interface even though HTTPError is a subclass of URLError.
++    def test_HTTPError_interface(self):
++        """
++        Issue 13211 reveals that HTTPError didn't implement the URLError
++        interface even though HTTPError is a subclass of URLError.
+ 
+-    >>> msg = 'something bad happened'
+-    >>> url = code = hdrs = fp = None
+-    >>> err = urllib.error.HTTPError(url, code, msg, hdrs, fp)
+-    >>> assert hasattr(err, 'reason')
+-    >>> err.reason
+-    'something bad happened'
+-    """
++        >>> msg = 'something bad happened'
++        >>> url = code = hdrs = fp = None
++        >>> err = urllib.error.HTTPError(url, code, msg, hdrs, fp)
++        >>> assert hasattr(err, 'reason')
++        >>> err.reason
++        'something bad happened'
++        """
++
++    def test_HTTPError_interface_call(self):
++        """
++        Issue 15701 - HTTPError interface has info method available from URLError
++        """
++        err = urllib.request.HTTPError(msg="something bad happened", url=None,
++                                code=None, hdrs='Content-Length:42', fp=None)
++        self.assertTrue(hasattr(err, 'reason'))
++        assert hasattr(err, 'reason')
++        assert hasattr(err, 'info')
++        assert callable(err.info)
++        try:
++            err.info()
++        except AttributeError:
++            self.fail('err.info call failed.')
++        self.assertEqual(err.info(), "Content-Length:42")
+ 
+ def test_main(verbose=None):
+     from test import test_urllib2
+diff -r bd8afb90ebf2 Lib/test/test_urllib2_localnet.py
+--- a/Lib/test/test_urllib2_localnet.py
++++ b/Lib/test/test_urllib2_localnet.py
+@@ -352,6 +352,8 @@
+ 
+     def setUp(self):
+         super(TestUrlopen, self).setUp()
++        # Ignore proxies for localhost tests.
++        os.environ['NO_PROXY'] = '*'
+         self.server = None
+ 
+     def tearDown(self):
+diff -r bd8afb90ebf2 Lib/test/test_urllib2net.py
+--- a/Lib/test/test_urllib2net.py
++++ b/Lib/test/test_urllib2net.py
+@@ -157,12 +157,12 @@
+ ##             self._test_urls(urls, self._extra_handlers()+[bauth, dauth])
+ 
+     def test_urlwithfrag(self):
+-        urlwith_frag = "http://docs.python.org/glossary.html#glossary"
++        urlwith_frag = "http://docs.python.org/2/glossary.html#glossary"
+         with support.transient_internet(urlwith_frag):
+             req = urllib.request.Request(urlwith_frag)
+             res = urllib.request.urlopen(req)
+             self.assertEqual(res.geturl(),
+-                    "http://docs.python.org/glossary.html#glossary")
++                    "http://docs.python.org/2/glossary.html#glossary")
+ 
+     def test_custom_headers(self):
+         url = "http://www.example.com"
+diff -r bd8afb90ebf2 Lib/test/test_urllibnet.py
+--- a/Lib/test/test_urllibnet.py
++++ b/Lib/test/test_urllibnet.py
+@@ -137,10 +137,10 @@
+     """Tests urllib.request.urlretrieve using the network."""
+ 
+     @contextlib.contextmanager
+-    def urlretrieve(self, *args):
++    def urlretrieve(self, *args, **kwargs):
+         resource = args[0]
+         with support.transient_internet(resource):
+-            file_location, info = urllib.request.urlretrieve(*args)
++            file_location, info = urllib.request.urlretrieve(*args, **kwargs)
+             try:
+                 yield file_location, info
+             finally:
+@@ -170,9 +170,10 @@
+             self.assertIsInstance(info, email.message.Message,
+                                   "info is not an instance of email.message.Message")
+ 
++    logo = "http://www.python.org/community/logos/python-logo-master-v3-TM.png"
++
+     def test_data_header(self):
+-        logo = "http://www.python.org/community/logos/python-logo-master-v3-TM.png"
+-        with self.urlretrieve(logo) as (file_location, fileheaders):
++        with self.urlretrieve(self.logo) as (file_location, fileheaders):
+             datevalue = fileheaders.get('Date')
+             dateformat = '%a, %d %b %Y %H:%M:%S GMT'
+             try:
+@@ -180,6 +181,31 @@
+             except ValueError:
+                 self.fail('Date value not in %r format', dateformat)
+ 
++    def test_reporthook(self):
++        records = []
++        def recording_reporthook(blocks, block_size, total_size):
++            records.append((blocks, block_size, total_size))
++
++        with self.urlretrieve(self.logo, reporthook=recording_reporthook) as (
++                file_location, fileheaders):
++            expected_size = int(fileheaders['Content-Length'])
++
++        records_repr = repr(records)  # For use in error messages.
++        self.assertGreater(len(records), 1, msg="There should always be two "
++                           "calls; the first one before the transfer starts.")
++        self.assertEqual(records[0][0], 0)
++        self.assertGreater(records[0][1], 0,
++                           msg="block size can't be 0 in %s" % records_repr)
++        self.assertEqual(records[0][2], expected_size)
++        self.assertEqual(records[-1][2], expected_size)
++
++        block_sizes = {block_size for _, block_size, _ in records}
++        self.assertEqual({records[0][1]}, block_sizes,
++                         msg="block sizes in %s must be equal" % records_repr)
++        self.assertGreaterEqual(records[-1][0]*records[0][1], expected_size,
++                                msg="number of blocks * block size must be"
++                                " >= total size in %s" % records_repr)
++
+ 
+ def test_main():
+     support.requires('network')
+diff -r bd8afb90ebf2 Lib/test/test_urlparse.py
+--- a/Lib/test/test_urlparse.py
++++ b/Lib/test/test_urlparse.py
+@@ -818,6 +818,35 @@
+         p2 = urllib.parse.urlsplit('tel:+31641044153')
+         self.assertEqual(p2.scheme, 'tel')
+         self.assertEqual(p2.path, '+31641044153')
++        # assert the behavior for urlparse
++        p1 = urllib.parse.urlparse('tel:+31-641044153')
++        self.assertEqual(p1.scheme, 'tel')
++        self.assertEqual(p1.path, '+31-641044153')
++        p2 = urllib.parse.urlparse('tel:+31641044153')
++        self.assertEqual(p2.scheme, 'tel')
++        self.assertEqual(p2.path, '+31641044153')
++
++    def test_telurl_params(self):
++        p1 = urllib.parse.urlparse('tel:123-4;phone-context=+1-650-516')
++        self.assertEqual(p1.scheme, 'tel')
++        self.assertEqual(p1.path, '123-4')
++        self.assertEqual(p1.params, 'phone-context=+1-650-516')
++
++        p1 = urllib.parse.urlparse('tel:+1-201-555-0123')
++        self.assertEqual(p1.scheme, 'tel')
++        self.assertEqual(p1.path, '+1-201-555-0123')
++        self.assertEqual(p1.params, '')
++
++        p1 = urllib.parse.urlparse('tel:7042;phone-context=example.com')
++        self.assertEqual(p1.scheme, 'tel')
++        self.assertEqual(p1.path, '7042')
++        self.assertEqual(p1.params, 'phone-context=example.com')
++
++        p1 = urllib.parse.urlparse('tel:863-1234;phone-context=+1-914-555')
++        self.assertEqual(p1.scheme, 'tel')
++        self.assertEqual(p1.path, '863-1234')
++        self.assertEqual(p1.params, 'phone-context=+1-914-555')
++
+ 
+ def test_main():
+     support.run_unittest(UrlParseTestCase)
+diff -r bd8afb90ebf2 Lib/test/test_userstring.py
+--- a/Lib/test/test_userstring.py
++++ b/Lib/test/test_userstring.py
+@@ -3,6 +3,7 @@
+ # UserString instances should behave similar to builtin string objects.
+ 
+ import string
++import unittest
+ from test import support, string_tests
+ 
+ from collections import UserString
+@@ -10,6 +11,7 @@
+ class UserStringTest(
+     string_tests.CommonTest,
+     string_tests.MixinStrUnicodeUserStringTest,
++    unittest.TestCase
+     ):
+ 
+     type2test = UserString
+@@ -42,8 +44,5 @@
+         getattr(object, methodname)(*args)
+ 
+ 
+-def test_main():
+-    support.run_unittest(UserStringTest)
+-
+ if __name__ == "__main__":
+-    test_main()
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_uu.py
+--- a/Lib/test/test_uu.py
++++ b/Lib/test/test_uu.py
+@@ -80,7 +80,7 @@
+         out = io.BytesIO()
+         try:
+             uu.decode(inp, out)
+-            self.fail("No exception thrown")
++            self.fail("No exception raised")
+         except uu.Error as e:
+             self.assertEqual(str(e), "Truncated input file")
+ 
+@@ -89,7 +89,7 @@
+         out = io.BytesIO()
+         try:
+             uu.decode(inp, out)
+-            self.fail("No exception thrown")
++            self.fail("No exception raised")
+         except uu.Error as e:
+             self.assertEqual(str(e), "No valid begin line found in input file")
+ 
+diff -r bd8afb90ebf2 Lib/test/test_warnings.py
+--- a/Lib/test/test_warnings.py
++++ b/Lib/test/test_warnings.py
+@@ -40,7 +40,7 @@
+         module.filters = original_filters
+ 
+ 
+-class BaseTest(unittest.TestCase):
++class BaseTest:
+ 
+     """Basic bookkeeping required for testing."""
+ 
+@@ -63,7 +63,7 @@
+         super(BaseTest, self).tearDown()
+ 
+ 
+-class FilterTests(object):
++class FilterTests(BaseTest):
+ 
+     """Testing the filtering functionality."""
+ 
+@@ -186,14 +186,14 @@
+             self.assertEqual(str(w[-1].message), text)
+             self.assertTrue(w[-1].category is UserWarning)
+ 
+-class CFilterTests(BaseTest, FilterTests):
++class CFilterTests(FilterTests, unittest.TestCase):
+     module = c_warnings
+ 
+-class PyFilterTests(BaseTest, FilterTests):
++class PyFilterTests(FilterTests, unittest.TestCase):
+     module = py_warnings
+ 
+ 
+-class WarnTests(unittest.TestCase):
++class WarnTests(BaseTest):
+ 
+     """Test warnings.warn() and warnings.warn_explicit()."""
+ 
+@@ -360,7 +360,7 @@
+             self.module.warn(BadStrWarning())
+ 
+ 
+-class CWarnTests(BaseTest, WarnTests):
++class CWarnTests(WarnTests, unittest.TestCase):
+     module = c_warnings
+ 
+     # As an early adopter, we sanity check the
+@@ -369,7 +369,7 @@
+         self.assertFalse(original_warnings is self.module)
+         self.assertFalse(hasattr(self.module.warn, '__code__'))
+ 
+-class PyWarnTests(BaseTest, WarnTests):
++class PyWarnTests(WarnTests, unittest.TestCase):
+     module = py_warnings
+ 
+     # As an early adopter, we sanity check the
+@@ -379,7 +379,7 @@
+         self.assertTrue(hasattr(self.module.warn, '__code__'))
+ 
+ 
+-class WCmdLineTests(unittest.TestCase):
++class WCmdLineTests(BaseTest):
+ 
+     def test_improper_input(self):
+         # Uses the private _setoption() function to test the parsing
+@@ -410,14 +410,14 @@
+         self.assertFalse(out.strip())
+         self.assertNotIn(b'RuntimeWarning', err)
+ 
+-class CWCmdLineTests(BaseTest, WCmdLineTests):
++class CWCmdLineTests(WCmdLineTests, unittest.TestCase):
+     module = c_warnings
+ 
+-class PyWCmdLineTests(BaseTest, WCmdLineTests):
++class PyWCmdLineTests(WCmdLineTests, unittest.TestCase):
+     module = py_warnings
+ 
+ 
+-class _WarningsTests(BaseTest):
++class _WarningsTests(BaseTest, unittest.TestCase):
+ 
+     """Tests specific to the _warnings module."""
+ 
+@@ -557,7 +557,7 @@
+             globals_dict['__file__'] = oldfile
+ 
+ 
+-class WarningsDisplayTests(unittest.TestCase):
++class WarningsDisplayTests(BaseTest):
+ 
+     """Test the displaying of warnings and the ability to overload functions
+     related to displaying warnings."""
+@@ -601,10 +601,10 @@
+                                 file_object, expected_file_line)
+         self.assertEqual(expect, file_object.getvalue())
+ 
+-class CWarningsDisplayTests(BaseTest, WarningsDisplayTests):
++class CWarningsDisplayTests(WarningsDisplayTests, unittest.TestCase):
+     module = c_warnings
+ 
+-class PyWarningsDisplayTests(BaseTest, WarningsDisplayTests):
++class PyWarningsDisplayTests(WarningsDisplayTests, unittest.TestCase):
+     module = py_warnings
+ 
+ 
+@@ -710,10 +710,10 @@
+             with support.check_warnings(('foo', RuntimeWarning)):
+                 wmod.warn("foo")
+ 
+-class CCatchWarningTests(CatchWarningTests):
++class CCatchWarningTests(CatchWarningTests, unittest.TestCase):
+     module = c_warnings
+ 
+-class PyCatchWarningTests(CatchWarningTests):
++class PyCatchWarningTests(CatchWarningTests, unittest.TestCase):
+     module = py_warnings
+ 
+ 
+@@ -762,10 +762,10 @@
+                 "['ignore:DeprecaciónWarning']".encode('utf-8'))
+         self.assertEqual(p.wait(), 0)
+ 
+-class CEnvironmentVariableTests(EnvironmentVariableTests):
++class CEnvironmentVariableTests(EnvironmentVariableTests, unittest.TestCase):
+     module = c_warnings
+ 
+-class PyEnvironmentVariableTests(EnvironmentVariableTests):
++class PyEnvironmentVariableTests(EnvironmentVariableTests, unittest.TestCase):
+     module = py_warnings
+ 
+ 
+@@ -788,20 +788,12 @@
+                 env=env)
+             self.assertEqual(retcode, 0)
+ 
+-def test_main():
++
++def setUpModule():
+     py_warnings.onceregistry.clear()
+     c_warnings.onceregistry.clear()
+-    support.run_unittest(
+-        CFilterTests, PyFilterTests,
+-        CWarnTests, PyWarnTests,
+-        CWCmdLineTests, PyWCmdLineTests,
+-        _WarningsTests,
+-        CWarningsDisplayTests, PyWarningsDisplayTests,
+-        CCatchWarningTests, PyCatchWarningTests,
+-        CEnvironmentVariableTests, PyEnvironmentVariableTests,
+-        BootstrapTest,
+-    )
+ 
++tearDownModule = setUpModule
+ 
+ if __name__ == "__main__":
+-    test_main()
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_weakref.py
+--- a/Lib/test/test_weakref.py
++++ b/Lib/test/test_weakref.py
+@@ -32,6 +32,27 @@
+     return C().method
+ 
+ 
++class Object:
++    def __init__(self, arg):
++        self.arg = arg
++    def __repr__(self):
++        return "<Object %r>" % self.arg
++    def __eq__(self, other):
++        if isinstance(other, Object):
++            return self.arg == other.arg
++        return NotImplemented
++    def __lt__(self, other):
++        if isinstance(other, Object):
++            return self.arg < other.arg
++        return NotImplemented
++    def __hash__(self):
++        return hash(self.arg)
++
++class RefCycle:
++    def __init__(self):
++        self.cycle = self
++
++
+ class TestBase(unittest.TestCase):
+ 
+     def setUp(self):
+@@ -692,6 +713,90 @@
+         self.assertEqual(a(), None)
+         self.assertEqual(l, [a])
+ 
++    def test_equality(self):
++        # Alive weakrefs defer equality testing to their underlying object.
++        x = Object(1)
++        y = Object(1)
++        z = Object(2)
++        a = weakref.ref(x)
++        b = weakref.ref(y)
++        c = weakref.ref(z)
++        d = weakref.ref(x)
++        # Note how we directly test the operators here, to stress both
++        # __eq__ and __ne__.
++        self.assertTrue(a == b)
++        self.assertFalse(a != b)
++        self.assertFalse(a == c)
++        self.assertTrue(a != c)
++        self.assertTrue(a == d)
++        self.assertFalse(a != d)
++        del x, y, z
++        gc.collect()
++        for r in a, b, c:
++            # Sanity check
++            self.assertIs(r(), None)
++        # Dead weakrefs compare by identity: whether `a` and `d` are the
++        # same weakref object is an implementation detail, since they pointed
++        # to the same original object and didn't have a callback.
++        # (see issue #16453).
++        self.assertFalse(a == b)
++        self.assertTrue(a != b)
++        self.assertFalse(a == c)
++        self.assertTrue(a != c)
++        self.assertEqual(a == d, a is d)
++        self.assertEqual(a != d, a is not d)
++
++    def test_ordering(self):
++        # weakrefs cannot be ordered, even if the underlying objects can.
++        ops = [operator.lt, operator.gt, operator.le, operator.ge]
++        x = Object(1)
++        y = Object(1)
++        a = weakref.ref(x)
++        b = weakref.ref(y)
++        for op in ops:
++            self.assertRaises(TypeError, op, a, b)
++        # Same when dead.
++        del x, y
++        gc.collect()
++        for op in ops:
++            self.assertRaises(TypeError, op, a, b)
++
++    def test_hashing(self):
++        # Alive weakrefs hash the same as the underlying object
++        x = Object(42)
++        y = Object(42)
++        a = weakref.ref(x)
++        b = weakref.ref(y)
++        self.assertEqual(hash(a), hash(42))
++        del x, y
++        gc.collect()
++        # Dead weakrefs:
++        # - retain their hash is they were hashed when alive;
++        # - otherwise, cannot be hashed.
++        self.assertEqual(hash(a), hash(42))
++        self.assertRaises(TypeError, hash, b)
++
++    def test_trashcan_16602(self):
++        # Issue #16602: when a weakref's target was part of a long
++        # deallocation chain, the trashcan mechanism could delay clearing
++        # of the weakref and make the target object visible from outside
++        # code even though its refcount had dropped to 0.  A crash ensued.
++        class C:
++            def __init__(self, parent):
++                if not parent:
++                    return
++                wself = weakref.ref(self)
++                def cb(wparent):
++                    o = wself()
++                self.wparent = weakref.ref(parent, cb)
++
++        d = weakref.WeakKeyDictionary()
++        root = c = C(None)
++        for n in range(100):
++            d[c] = c = C(c)
++        del root
++        gc.collect()
++
+ 
+ class SubclassableWeakrefTestCase(TestBase):
+ 
+@@ -796,27 +901,6 @@
+         self.assertEqual(self.cbcalled, 0)
+ 
+ 
+-class Object:
+-    def __init__(self, arg):
+-        self.arg = arg
+-    def __repr__(self):
+-        return "<Object %r>" % self.arg
+-    def __eq__(self, other):
+-        if isinstance(other, Object):
+-            return self.arg == other.arg
+-        return NotImplemented
+-    def __lt__(self, other):
+-        if isinstance(other, Object):
+-            return self.arg < other.arg
+-        return NotImplemented
+-    def __hash__(self):
+-        return hash(self.arg)
+-
+-class RefCycle:
+-    def __init__(self):
+-        self.cycle = self
+-
+-
+ class MappingTestCase(TestBase):
+ 
+     COUNT = 10
+diff -r bd8afb90ebf2 Lib/test/test_webbrowser.py
+--- /dev/null
++++ b/Lib/test/test_webbrowser.py
+@@ -0,0 +1,192 @@
++import webbrowser
++import unittest
++import subprocess
++from unittest import mock
++from test import support
++
++
++URL = 'http://www.example.com'
++CMD_NAME = 'test'
++
++
++class PopenMock(mock.MagicMock):
++
++    def poll(self):
++        return 0
++
++    def wait(self, seconds=None):
++        return 0
++
++
++class CommandTestMixin:
++
++    def _test(self, meth, *, args=[URL], kw={}, options, arguments):
++        """Given a web browser instance method name along with arguments and
++        keywords for same (which defaults to the single argument URL), creates
++        a browser instance from the class pointed to by self.browser, calls the
++        indicated instance method with the indicated arguments, and compares
++        the resulting options and arguments passed to Popen by the browser
++        instance against the 'options' and 'args' lists.  Options are compared
++        in a position independent fashion, and the arguments are compared in
++        sequence order to whatever is left over after removing the options.
++
++        """
++        popen = PopenMock()
++        support.patch(self, subprocess, 'Popen', popen)
++        browser = self.browser_class(name=CMD_NAME)
++        getattr(browser, meth)(*args, **kw)
++        popen_args = subprocess.Popen.call_args[0][0]
++        self.assertEqual(popen_args[0], CMD_NAME)
++        popen_args.pop(0)
++        for option in options:
++            self.assertIn(option, popen_args)
++            popen_args.pop(popen_args.index(option))
++        self.assertEqual(popen_args, arguments)
++
++
++class GenericBrowserCommandTest(CommandTestMixin, unittest.TestCase):
++
++    browser_class = webbrowser.GenericBrowser
++
++    def test_open(self):
++        self._test('open',
++                   options=[],
++                   arguments=[URL])
++
++
++class BackgroundBrowserCommandTest(CommandTestMixin, unittest.TestCase):
++
++    browser_class = webbrowser.BackgroundBrowser
++
++    def test_open(self):
++        self._test('open',
++                   options=[],
++                   arguments=[URL])
++
++
++class ChromeCommandTest(CommandTestMixin, unittest.TestCase):
++
++    browser_class = webbrowser.Chrome
++
++    def test_open(self):
++        self._test('open',
++                   options=[],
++                   arguments=[URL])
++
++    def test_open_with_autoraise_false(self):
++        self._test('open', kw=dict(autoraise=False),
++                   options=[],
++                   arguments=[URL])
++
++    def test_open_new(self):
++        self._test('open_new',
++                   options=['--new-window'],
++                   arguments=[URL])
++
++    def test_open_new_tab(self):
++        self._test('open_new_tab',
++                   options=[],
++                   arguments=[URL])
++
++
++class MozillaCommandTest(CommandTestMixin, unittest.TestCase):
++
++    browser_class = webbrowser.Mozilla
++
++    def test_open(self):
++        self._test('open',
++                   options=['-raise', '-remote'],
++                   arguments=['openURL({})'.format(URL)])
++
++    def test_open_with_autoraise_false(self):
++        self._test('open', kw=dict(autoraise=False),
++                   options=['-noraise', '-remote'],
++                   arguments=['openURL({})'.format(URL)])
++
++    def test_open_new(self):
++        self._test('open_new',
++                   options=['-raise', '-remote'],
++                   arguments=['openURL({},new-window)'.format(URL)])
++
++    def test_open_new_tab(self):
++        self._test('open_new_tab',
++                   options=['-raise', '-remote'],
++                   arguments=['openURL({},new-tab)'.format(URL)])
++
++
++class GaleonCommandTest(CommandTestMixin, unittest.TestCase):
++
++    browser_class = webbrowser.Galeon
++
++    def test_open(self):
++        self._test('open',
++                   options=['-n'],
++                   arguments=[URL])
++
++    def test_open_with_autoraise_false(self):
++        self._test('open', kw=dict(autoraise=False),
++                   options=['-noraise', '-n'],
++                   arguments=[URL])
++
++    def test_open_new(self):
++        self._test('open_new',
++                   options=['-w'],
++                   arguments=[URL])
++
++    def test_open_new_tab(self):
++        self._test('open_new_tab',
++                   options=['-w'],
++                   arguments=[URL])
++
++
++class OperaCommandTest(CommandTestMixin, unittest.TestCase):
++
++    browser_class = webbrowser.Opera
++
++    def test_open(self):
++        self._test('open',
++                   options=['-remote'],
++                   arguments=['openURL({})'.format(URL)])
++
++    def test_open_with_autoraise_false(self):
++        self._test('open', kw=dict(autoraise=False),
++                   options=['-remote', '-noraise'],
++                   arguments=['openURL({})'.format(URL)])
++
++    def test_open_new(self):
++        self._test('open_new',
++                   options=['-remote'],
++                   arguments=['openURL({},new-window)'.format(URL)])
++
++    def test_open_new(self):
++        self._test('open_new_tab',
++                   options=['-remote'],
++                   arguments=['openURL({},new-page)'.format(URL)])
++
++
++class ELinksCommandTest(CommandTestMixin, unittest.TestCase):
++
++    browser_class = webbrowser.Elinks
++
++    def test_open(self):
++        self._test('open', options=['-remote'],
++                           arguments=['openURL({})'.format(URL)])
++
++    def test_open_with_autoraise_false(self):
++        self._test('open',
++                   options=['-remote'],
++                   arguments=['openURL({})'.format(URL)])
++
++    def test_open_new(self):
++        self._test('open_new',
++                   options=['-remote'],
++                   arguments=['openURL({},new-window)'.format(URL)])
++
++    def test_open_new_tab(self):
++        self._test('open_new_tab',
++                   options=['-remote'],
++                   arguments=['openURL({},new-tab)'.format(URL)])
++
++
++if __name__=='__main__':
++    unittest.main()
+diff -r bd8afb90ebf2 Lib/test/test_winreg.py
+--- a/Lib/test/test_winreg.py
++++ b/Lib/test/test_winreg.py
+@@ -245,7 +245,7 @@
+ 
+     def test_changing_value(self):
+         # Issue2810: A race condition in 2.6 and 3.1 may cause
+-        # EnumValue or QueryValue to throw "WindowsError: More data is
++        # EnumValue or QueryValue to raise "WindowsError: More data is
+         # available"
+         done = False
+ 
+@@ -277,7 +277,7 @@
+ 
+     def test_long_key(self):
+         # Issue2810, in 2.6 and 3.1 when the key name was exactly 256
+-        # characters, EnumKey threw "WindowsError: More data is
++        # characters, EnumKey raised "WindowsError: More data is
+         # available"
+         name = 'x'*256
+         try:
+@@ -291,7 +291,7 @@
+ 
+     def test_dynamic_key(self):
+         # Issue2810, when the value is dynamically generated, these
+-        # throw "WindowsError: More data is available" in 2.6 and 3.1
++        # raise "WindowsError: More data is available" in 2.6 and 3.1
+         try:
+             EnumValue(HKEY_PERFORMANCE_DATA, 0)
+         except OSError as e:
+@@ -323,6 +323,35 @@
+         finally:
+             DeleteKey(HKEY_CURRENT_USER, test_key_name)
+ 
++    def test_setvalueex_value_range(self):
++        # Test for Issue #14420, accept proper ranges for SetValueEx.
++        # Py2Reg, which gets called by SetValueEx, was using PyLong_AsLong,
++        # thus raising OverflowError. The implementation now uses
++        # PyLong_AsUnsignedLong to match DWORD's size.
++        try:
++            with CreateKey(HKEY_CURRENT_USER, test_key_name) as ck:
++                self.assertNotEqual(ck.handle, 0)
++                SetValueEx(ck, "test_name", None, REG_DWORD, 0x80000000)
++        finally:
++            DeleteKey(HKEY_CURRENT_USER, test_key_name)
++
++    def test_queryvalueex_return_value(self):
++        # Test for Issue #16759, return unsigned int from QueryValueEx.
++        # Reg2Py, which gets called by QueryValueEx, was returning a value
++        # generated by PyLong_FromLong. The implmentation now uses
++        # PyLong_FromUnsignedLong to match DWORD's size.
++        try:
++            with CreateKey(HKEY_CURRENT_USER, test_key_name) as ck:
++                self.assertNotEqual(ck.handle, 0)
++                test_val = 0x80000000
++                SetValueEx(ck, "test_name", None, REG_DWORD, test_val)
++                ret_val, ret_type = QueryValueEx(ck, "test_name")
++                self.assertEqual(ret_type, REG_DWORD)
++                self.assertEqual(ret_val, test_val)
++        finally:
++            DeleteKey(HKEY_CURRENT_USER, test_key_name)
++
++
+ 
+ @unittest.skipUnless(REMOTE_NAME, "Skipping remote registry tests")
+ class RemoteWinregTests(BaseWinregTests):
+diff -r bd8afb90ebf2 Lib/test/test_winsound.py
+--- a/Lib/test/test_winsound.py
++++ b/Lib/test/test_winsound.py
+@@ -16,16 +16,12 @@
+     try:
+         # Ask the mixer API for the number of devices it knows about.
+         # When there are no devices, PlaySound will fail.
+-        if ctypes.windll.winmm.mixerGetNumDevs() is 0:
++        if ctypes.windll.winmm.mixerGetNumDevs() == 0:
+             return False
+ 
+         key = winreg.OpenKeyEx(winreg.HKEY_CURRENT_USER,
+                 "AppEvents\Schemes\Apps\.Default\{0}\.Default".format(sound))
+-        value = winreg.EnumValue(key, 0)[1]
+-        if value is not "":
+-            return True
+-        else:
+-            return False
++        return winreg.EnumValue(key, 0)[1] != ""
+     except WindowsError:
+         return False
+ 
+diff -r bd8afb90ebf2 Lib/test/test_wsgiref.py
+--- a/Lib/test/test_wsgiref.py
++++ b/Lib/test/test_wsgiref.py
+@@ -41,9 +41,6 @@
+         pass
+ 
+ 
+-
+-
+-
+ def hello_app(environ,start_response):
+     start_response("200 OK", [
+         ('Content-Type','text/plain'),
+@@ -65,28 +62,6 @@
+ 
+     return out.getvalue(), err.getvalue()
+ 
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+ def compare_generic_iter(make_it,match):
+     """Utility to compare a generic 2.1/2.2+ iterator with an iterable
+ 
+@@ -124,10 +99,6 @@
+             raise AssertionError("Too many items from .__next__()", it)
+ 
+ 
+-
+-
+-
+-
+ class IntegrationTests(TestCase):
+ 
+     def check_hello(self, out, has_length=True):
+@@ -201,8 +172,6 @@
+                 out)
+ 
+ 
+-
+-
+ class UtilityTests(TestCase):
+ 
+     def checkShift(self,sn_in,pi_in,part,sn_out,pi_out):
+@@ -241,11 +210,6 @@
+         util.setup_testing_defaults(kw)
+         self.assertEqual(util.request_uri(kw,query),uri)
+ 
+-
+-
+-
+-
+-
+     def checkFW(self,text,size,match):
+ 
+         def make_it(text=text,size=size):
+@@ -264,7 +228,6 @@
+         it.close()
+         self.assertTrue(it.filelike.closed)
+ 
+-
+     def testSimpleShifts(self):
+         self.checkShift('','/', '', '/', '')
+         self.checkShift('','/x', 'x', '/x', '')
+@@ -272,7 +235,6 @@
+         self.checkShift('/a','/x/y', 'x', '/a/x', '/y')
+         self.checkShift('/a','/x/',  'x', '/a/x', '/')
+ 
+-
+     def testNormalizedShifts(self):
+         self.checkShift('/a/b', '/../y', '..', '/a', '/y')
+         self.checkShift('', '/../y', '..', '', '/y')
+@@ -286,7 +248,6 @@
+         self.checkShift('/a/b', '/x//', 'x', '/a/b/x', '/')
+         self.checkShift('/a/b', '/.', None, '/a/b', '')
+ 
+-
+     def testDefaults(self):
+         for key, value in [
+             ('SERVER_NAME','127.0.0.1'),
+@@ -306,7 +267,6 @@
+         ]:
+             self.checkDefault(key,value)
+ 
+-
+     def testCrossDefaults(self):
+         self.checkCrossDefault('HTTP_HOST',"foo.bar",SERVER_NAME="foo.bar")
+         self.checkCrossDefault('wsgi.url_scheme',"https",HTTPS="on")
+@@ -316,7 +276,6 @@
+         self.checkCrossDefault('SERVER_PORT',"80",HTTPS="foo")
+         self.checkCrossDefault('SERVER_PORT',"443",HTTPS="on")
+ 
+-
+     def testGuessScheme(self):
+         self.assertEqual(util.guess_scheme({}), "http")
+         self.assertEqual(util.guess_scheme({'HTTPS':"foo"}), "http")
+@@ -324,10 +283,6 @@
+         self.assertEqual(util.guess_scheme({'HTTPS':"yes"}), "https")
+         self.assertEqual(util.guess_scheme({'HTTPS':"1"}), "https")
+ 
+-
+-
+-
+-
+     def testAppURIs(self):
+         self.checkAppURI("http://127.0.0.1/")
+         self.checkAppURI("http://127.0.0.1/spam", SCRIPT_NAME="/spam")
+@@ -452,15 +407,6 @@
+         raise   # for testing, we want to see what's happening
+ 
+ 
+-
+-
+-
+-
+-
+-
+-
+-
+-
+ class HandlerTests(TestCase):
+ 
+     def checkEnvironAttrs(self, handler):
+@@ -501,7 +447,6 @@
+         h=TestHandler(); h.setup_environ()
+         self.assertEqual(h.environ['wsgi.url_scheme'],'http')
+ 
+-
+     def testAbstractMethods(self):
+         h = BaseHandler()
+         for name in [
+@@ -510,7 +455,6 @@
+             self.assertRaises(NotImplementedError, getattr(h,name))
+         self.assertRaises(NotImplementedError, h._write, "test")
+ 
+-
+     def testContentLength(self):
+         # Demo one reason iteration is better than write()...  ;)
+ 
+@@ -602,7 +546,6 @@
+             "\r\n".encode("iso-8859-1")+MSG))
+         self.assertIn("AssertionError", h.stderr.getvalue())
+ 
+-
+     def testHeaderFormats(self):
+ 
+         def non_error_app(e,s):
+@@ -662,40 +605,27 @@
+             b"data",
+             h.stdout.getvalue())
+ 
+-# This epilogue is needed for compatibility with the Python 2.5 regrtest module
++    def testCloseOnError(self):
++        side_effects = {'close_called': False}
++        MSG = b"Some output has been sent"
++        def error_app(e,s):
++            s("200 OK",[])(MSG)
++            class CrashyIterable(object):
++                def __iter__(self):
++                    while True:
++                        yield b'blah'
++                        raise AssertionError("This should be caught by handler")
++                def close(self):
++                    side_effects['close_called'] = True
++            return CrashyIterable()
++
++        h = ErrorHandler()
++        h.run(error_app)
++        self.assertEqual(side_effects['close_called'], True)
++
+ 
+ def test_main():
+     support.run_unittest(__name__)
+ 
+ if __name__ == "__main__":
+     test_main()
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-# the above lines intentionally left blank
+diff -r bd8afb90ebf2 Lib/test/test_xml_etree.py
+--- a/Lib/test/test_xml_etree.py
++++ b/Lib/test/test_xml_etree.py
+@@ -16,13 +16,20 @@
+ 
+ import html
+ import io
++import operator
++import pickle
+ import sys
+ import unittest
+ import weakref
+ 
++from itertools import product
+ from test import support
+ from test.support import TESTFN, findfile, unlink, import_fresh_module, gc_collect
+ 
++# pyET is the pure-Python implementation.
++#
++# ET is pyET in test_xml_etree and is the C accelerated version in
++# test_xml_etree_c.
+ pyET = None
+ ET = None
+ 
+@@ -170,6 +177,38 @@
+     for elem in element:
+         check_element(elem)
+ 
++class ElementTestCase:
++    @classmethod
++    def setUpClass(cls):
++        cls.modules = {pyET, ET}
++
++    def pickleRoundTrip(self, obj, name, dumper, loader):
++        save_m = sys.modules[name]
++        try:
++            sys.modules[name] = dumper
++            temp = pickle.dumps(obj)
++            sys.modules[name] = loader
++            result = pickle.loads(temp)
++        except pickle.PicklingError as pe:
++            # pyET must be second, because pyET may be (equal to) ET.
++            human = dict([(ET, "cET"), (pyET, "pyET")])
++            raise support.TestFailed("Failed to round-trip %r from %r to %r"
++                                     % (obj,
++                                        human.get(dumper, dumper),
++                                        human.get(loader, loader))) from pe
++        finally:
++            sys.modules[name] = save_m
++        return result
++
++    def assertEqualElements(self, alice, bob):
++        self.assertIsInstance(alice, (ET.Element, pyET.Element))
++        self.assertIsInstance(bob, (ET.Element, pyET.Element))
++        self.assertEqual(len(list(alice)), len(list(bob)))
++        for x, y in zip(alice, bob):
++            self.assertEqualElements(x, y)
++        properties = operator.attrgetter('tag', 'tail', 'text', 'attrib')
++        self.assertEqual(properties(alice), properties(bob))
++
+ # --------------------------------------------------------------------
+ # element tree tests
+ 
+@@ -290,128 +329,6 @@
+     '<tag>hello</tag>'
+     """
+ 
+-def find():
+-    """
+-    Test find methods (including xpath syntax).
+-
+-    >>> elem = ET.XML(SAMPLE_XML)
+-    >>> elem.find("tag").tag
+-    'tag'
+-    >>> ET.ElementTree(elem).find("tag").tag
+-    'tag'
+-    >>> elem.find("section/tag").tag
+-    'tag'
+-    >>> elem.find("./tag").tag
+-    'tag'
+-    >>> ET.ElementTree(elem).find("./tag").tag
+-    'tag'
+-    >>> ET.ElementTree(elem).find("/tag").tag
+-    'tag'
+-    >>> elem[2] = ET.XML(SAMPLE_SECTION)
+-    >>> elem.find("section/nexttag").tag
+-    'nexttag'
+-    >>> ET.ElementTree(elem).find("section/tag").tag
+-    'tag'
+-    >>> ET.ElementTree(elem).find("tog")
+-    >>> ET.ElementTree(elem).find("tog/foo")
+-    >>> elem.findtext("tag")
+-    'text'
+-    >>> elem.findtext("section/nexttag")
+-    ''
+-    >>> elem.findtext("section/nexttag", "default")
+-    ''
+-    >>> elem.findtext("tog")
+-    >>> elem.findtext("tog", "default")
+-    'default'
+-    >>> ET.ElementTree(elem).findtext("tag")
+-    'text'
+-    >>> ET.ElementTree(elem).findtext("tog/foo")
+-    >>> ET.ElementTree(elem).findtext("tog/foo", "default")
+-    'default'
+-    >>> ET.ElementTree(elem).findtext("./tag")
+-    'text'
+-    >>> ET.ElementTree(elem).findtext("/tag")
+-    'text'
+-    >>> elem.findtext("section/tag")
+-    'subtext'
+-    >>> ET.ElementTree(elem).findtext("section/tag")
+-    'subtext'
+-    >>> summarize_list(elem.findall("."))
+-    ['body']
+-    >>> summarize_list(elem.findall("tag"))
+-    ['tag', 'tag']
+-    >>> summarize_list(elem.findall("tog"))
+-    []
+-    >>> summarize_list(elem.findall("tog/foo"))
+-    []
+-    >>> summarize_list(elem.findall("*"))
+-    ['tag', 'tag', 'section']
+-    >>> summarize_list(elem.findall(".//tag"))
+-    ['tag', 'tag', 'tag', 'tag']
+-    >>> summarize_list(elem.findall("section/tag"))
+-    ['tag']
+-    >>> summarize_list(elem.findall("section//tag"))
+-    ['tag', 'tag']
+-    >>> summarize_list(elem.findall("section/*"))
+-    ['tag', 'nexttag', 'nextsection']
+-    >>> summarize_list(elem.findall("section//*"))
+-    ['tag', 'nexttag', 'nextsection', 'tag']
+-    >>> summarize_list(elem.findall("section/.//*"))
+-    ['tag', 'nexttag', 'nextsection', 'tag']
+-    >>> summarize_list(elem.findall("*/*"))
+-    ['tag', 'nexttag', 'nextsection']
+-    >>> summarize_list(elem.findall("*//*"))
+-    ['tag', 'nexttag', 'nextsection', 'tag']
+-    >>> summarize_list(elem.findall("*/tag"))
+-    ['tag']
+-    >>> summarize_list(elem.findall("*/./tag"))
+-    ['tag']
+-    >>> summarize_list(elem.findall("./tag"))
+-    ['tag', 'tag']
+-    >>> summarize_list(elem.findall(".//tag"))
+-    ['tag', 'tag', 'tag', 'tag']
+-    >>> summarize_list(elem.findall("././tag"))
+-    ['tag', 'tag']
+-    >>> summarize_list(elem.findall(".//tag[@class]"))
+-    ['tag', 'tag', 'tag']
+-    >>> summarize_list(elem.findall(".//tag[@class='a']"))
+-    ['tag']
+-    >>> summarize_list(elem.findall(".//tag[@class='b']"))
+-    ['tag', 'tag']
+-    >>> summarize_list(elem.findall(".//tag[@id]"))
+-    ['tag']
+-    >>> summarize_list(elem.findall(".//section[tag]"))
+-    ['section']
+-    >>> summarize_list(elem.findall(".//section[element]"))
+-    []
+-    >>> summarize_list(elem.findall("../tag"))
+-    []
+-    >>> summarize_list(elem.findall("section/../tag"))
+-    ['tag', 'tag']
+-    >>> summarize_list(ET.ElementTree(elem).findall("./tag"))
+-    ['tag', 'tag']
+-
+-    Following example is invalid in 1.2.
+-    A leading '*' is assumed in 1.3.
+-
+-    >>> elem.findall("section//") == elem.findall("section//*")
+-    True
+-
+-    ET's Path module handles this case incorrectly; this gives
+-    a warning in 1.3, and the behaviour will be modified in 1.4.
+-
+-    >>> summarize_list(ET.ElementTree(elem).findall("/tag"))
+-    ['tag', 'tag']
+-
+-    >>> elem = ET.XML(SAMPLE_XML_NS)
+-    >>> summarize_list(elem.findall("tag"))
+-    []
+-    >>> summarize_list(elem.findall("{http://effbot.org/ns}tag"))
+-    ['{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag']
+-    >>> summarize_list(elem.findall(".//{http://effbot.org/ns}tag"))
+-    ['{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag']
+-    """
+-
+ def file_init():
+     """
+     >>> import io
+@@ -430,16 +347,6 @@
+     'empty-element'
+     """
+ 
+-def bad_find():
+-    """
+-    Check bad or unsupported path expressions.
+-
+-    >>> elem = ET.XML(SAMPLE_XML)
+-    >>> elem.findall("/tag")
+-    Traceback (most recent call last):
+-    SyntaxError: cannot use absolute path on element
+-    """
+-
+ def path_cache():
+     """
+     Check that the path cache behaves sanely.
+@@ -1714,7 +1621,7 @@
+ # --------------------------------------------------------------------
+ 
+ 
+-class BasicElementTest(unittest.TestCase):
++class BasicElementTest(ElementTestCase, unittest.TestCase):
+     def test_augmentation_type_errors(self):
+         e = ET.Element('joe')
+         self.assertRaises(TypeError, e.append, 'b')
+@@ -1768,6 +1675,28 @@
+         self.assertEqual(flag, True)
+         self.assertEqual(wref(), None)
+ 
++    def test_get_keyword_args(self):
++        e1 = ET.Element('foo' , x=1, y=2, z=3)
++        self.assertEqual(e1.get('x', default=7), 1)
++        self.assertEqual(e1.get('w', default=7), 7)
++
++    def test_pickle(self):
++        # issue #16076: the C implementation wasn't pickleable.
++        for dumper, loader in product(self.modules, repeat=2):
++            e = dumper.Element('foo', bar=42)
++            e.text = "text goes here"
++            e.tail = "opposite of head"
++            dumper.SubElement(e, 'child').append(dumper.Element('grandchild'))
++            e.append(dumper.Element('child'))
++            e.findall('.//grandchild')[0].set('attr', 'other value')
++
++            e2 = self.pickleRoundTrip(e, 'xml.etree.ElementTree',
++                                      dumper, loader)
++
++            self.assertEqual(e2.tag, 'foo')
++            self.assertEqual(e2.attrib['bar'], 42)
++            self.assertEqual(len(e2), 2)
++            self.assertEqualElements(e, e2)
+ 
+ class ElementTreeTest(unittest.TestCase):
+     def test_istype(self):
+@@ -1809,6 +1738,130 @@
+         mye = MyElement('joe')
+         self.assertEqual(mye.newmethod(), 'joe')
+ 
++    def test_html_empty_elems_serialization(self):
++        # issue 15970
++        # from http://www.w3.org/TR/html401/index/elements.html
++        for element in ['AREA', 'BASE', 'BASEFONT', 'BR', 'COL', 'FRAME', 'HR',
++                        'IMG', 'INPUT', 'ISINDEX', 'LINK', 'META', 'PARAM']:
++            for elem in [element, element.lower()]:
++                expected = '<%s>' % elem
++                serialized = serialize(ET.XML('<%s />' % elem), method='html')
++                self.assertEqual(serialized, expected)
++                serialized = serialize(ET.XML('<%s></%s>' % (elem,elem)),
++                                       method='html')
++                self.assertEqual(serialized, expected)
++
++
++class ElementFindTest(unittest.TestCase):
++    def test_find_simple(self):
++        e = ET.XML(SAMPLE_XML)
++        self.assertEqual(e.find('tag').tag, 'tag')
++        self.assertEqual(e.find('section/tag').tag, 'tag')
++        self.assertEqual(e.find('./tag').tag, 'tag')
++
++        e[2] = ET.XML(SAMPLE_SECTION)
++        self.assertEqual(e.find('section/nexttag').tag, 'nexttag')
++
++        self.assertEqual(e.findtext('./tag'), 'text')
++        self.assertEqual(e.findtext('section/tag'), 'subtext')
++
++        # section/nexttag is found but has no text
++        self.assertEqual(e.findtext('section/nexttag'), '')
++        self.assertEqual(e.findtext('section/nexttag', 'default'), '')
++
++        # tog doesn't exist and 'default' kicks in
++        self.assertIsNone(e.findtext('tog'))
++        self.assertEqual(e.findtext('tog', 'default'), 'default')
++
++        # Issue #16922
++        self.assertEqual(ET.XML('<tag><empty /></tag>').findtext('empty'), '')
++
++    def test_find_xpath(self):
++        LINEAR_XML = '''
++        <body>
++            <tag class='a'/>
++            <tag class='b'/>
++            <tag class='c'/>
++            <tag class='d'/>
++        </body>'''
++        e = ET.XML(LINEAR_XML)
++
++        # Test for numeric indexing and last()
++        self.assertEqual(e.find('./tag[1]').attrib['class'], 'a')
++        self.assertEqual(e.find('./tag[2]').attrib['class'], 'b')
++        self.assertEqual(e.find('./tag[last()]').attrib['class'], 'd')
++        self.assertEqual(e.find('./tag[last()-1]').attrib['class'], 'c')
++        self.assertEqual(e.find('./tag[last()-2]').attrib['class'], 'b')
++
++    def test_findall(self):
++        e = ET.XML(SAMPLE_XML)
++        e[2] = ET.XML(SAMPLE_SECTION)
++        self.assertEqual(summarize_list(e.findall('.')), ['body'])
++        self.assertEqual(summarize_list(e.findall('tag')), ['tag', 'tag'])
++        self.assertEqual(summarize_list(e.findall('tog')), [])
++        self.assertEqual(summarize_list(e.findall('tog/foo')), [])
++        self.assertEqual(summarize_list(e.findall('*')),
++            ['tag', 'tag', 'section'])
++        self.assertEqual(summarize_list(e.findall('.//tag')),
++            ['tag'] * 4)
++        self.assertEqual(summarize_list(e.findall('section/tag')), ['tag'])
++        self.assertEqual(summarize_list(e.findall('section//tag')), ['tag'] * 2)
++        self.assertEqual(summarize_list(e.findall('section/*')),
++            ['tag', 'nexttag', 'nextsection'])
++        self.assertEqual(summarize_list(e.findall('section//*')),
++            ['tag', 'nexttag', 'nextsection', 'tag'])
++        self.assertEqual(summarize_list(e.findall('section/.//*')),
++            ['tag', 'nexttag', 'nextsection', 'tag'])
++        self.assertEqual(summarize_list(e.findall('*/*')),
++            ['tag', 'nexttag', 'nextsection'])
++        self.assertEqual(summarize_list(e.findall('*//*')),
++            ['tag', 'nexttag', 'nextsection', 'tag'])
++        self.assertEqual(summarize_list(e.findall('*/tag')), ['tag'])
++        self.assertEqual(summarize_list(e.findall('*/./tag')), ['tag'])
++        self.assertEqual(summarize_list(e.findall('./tag')), ['tag'] * 2)
++        self.assertEqual(summarize_list(e.findall('././tag')), ['tag'] * 2)
++
++        self.assertEqual(summarize_list(e.findall('.//tag[@class]')),
++            ['tag'] * 3)
++        self.assertEqual(summarize_list(e.findall('.//tag[@class="a"]')),
++            ['tag'])
++        self.assertEqual(summarize_list(e.findall('.//tag[@class="b"]')),
++            ['tag'] * 2)
++        self.assertEqual(summarize_list(e.findall('.//tag[@id]')),
++            ['tag'])
++        self.assertEqual(summarize_list(e.findall('.//section[tag]')),
++            ['section'])
++        self.assertEqual(summarize_list(e.findall('.//section[element]')), [])
++        self.assertEqual(summarize_list(e.findall('../tag')), [])
++        self.assertEqual(summarize_list(e.findall('section/../tag')),
++            ['tag'] * 2)
++        self.assertEqual(e.findall('section//'), e.findall('section//*'))
++
++    def test_test_find_with_ns(self):
++        e = ET.XML(SAMPLE_XML_NS)
++        self.assertEqual(summarize_list(e.findall('tag')), [])
++        self.assertEqual(
++            summarize_list(e.findall("{http://effbot.org/ns}tag")),
++            ['{http://effbot.org/ns}tag'] * 2)
++        self.assertEqual(
++            summarize_list(e.findall(".//{http://effbot.org/ns}tag")),
++            ['{http://effbot.org/ns}tag'] * 3)
++
++    def test_bad_find(self):
++        e = ET.XML(SAMPLE_XML)
++        with self.assertRaisesRegex(SyntaxError, 'cannot use absolute path'):
++            e.findall('/tag')
++
++    def test_find_through_ElementTree(self):
++        e = ET.XML(SAMPLE_XML)
++        self.assertEqual(ET.ElementTree(e).find('tag').tag, 'tag')
++        self.assertEqual(ET.ElementTree(e).findtext('tag'), 'text')
++        self.assertEqual(summarize_list(ET.ElementTree(e).findall('tag')),
++            ['tag'] * 2)
++        # this produces a warning
++        self.assertEqual(summarize_list(ET.ElementTree(e).findall('//tag')),
++            ['tag'] * 3)
++
+ 
+ class ElementIterTest(unittest.TestCase):
+     def _ilist(self, elem, tag=None):
+@@ -1828,9 +1881,19 @@
+         sourcefile = serialize(doc, to_string=False)
+         self.assertEqual(next(ET.iterparse(sourcefile))[0], 'end')
+ 
++        # With an explitit parser too (issue #9708)
++        sourcefile = serialize(doc, to_string=False)
++        parser = ET.XMLParser(target=ET.TreeBuilder())
++        self.assertEqual(next(ET.iterparse(sourcefile, parser=parser))[0],
++                         'end')
++
+         tree = ET.ElementTree(None)
+         self.assertRaises(AttributeError, tree.iter)
+ 
++        # Issue #16913
++        doc = ET.XML("<root>a&amp;<sub>b&amp;</sub>c&amp;</root>")
++        self.assertEqual(''.join(doc.itertext()), 'a&b&c&')
++
+     def test_corners(self):
+         # single root, no subelements
+         a = ET.Element('a')
+@@ -1870,6 +1933,11 @@
+         self.assertEqual(self._ilist(doc, 'room'), ['room'] * 3)
+         self.assertEqual(self._ilist(doc, 'house'), ['house'] * 2)
+ 
++        # test that iter also accepts 'tag' as a keyword arg
++        self.assertEqual(
++            summarize_list(doc.iter(tag='room')),
++            ['room'] * 3)
++
+         # make sure both tag=None and tag='*' return all tags
+         all_tags = ['document', 'house', 'room', 'room',
+                     'shed', 'house', 'room']
+@@ -1881,10 +1949,23 @@
+     sample1 = ('<!DOCTYPE html PUBLIC'
+         ' "-//W3C//DTD XHTML 1.0 Transitional//EN"'
+         ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
+-        '<html>text</html>')
++        '<html>text<div>subtext</div>tail</html>')
+ 
+     sample2 = '''<toplevel>sometext</toplevel>'''
+ 
++    def _check_sample1_element(self, e):
++        self.assertEqual(e.tag, 'html')
++        self.assertEqual(e.text, 'text')
++        self.assertEqual(e.tail, None)
++        self.assertEqual(e.attrib, {})
++        children = list(e)
++        self.assertEqual(len(children), 1)
++        child = children[0]
++        self.assertEqual(child.tag, 'div')
++        self.assertEqual(child.text, 'subtext')
++        self.assertEqual(child.tail, 'tail')
++        self.assertEqual(child.attrib, {})
++
+     def test_dummy_builder(self):
+         class BaseDummyBuilder:
+             def close(self):
+@@ -1917,7 +1998,7 @@
+         parser.feed(self.sample1)
+ 
+         e = parser.close()
+-        self.assertEqual(e.tag, 'html')
++        self._check_sample1_element(e)
+ 
+     def test_element_factory(self):
+         lst = []
+@@ -1933,6 +2014,33 @@
+ 
+         self.assertEqual(lst, ['toplevel'])
+ 
++    def _check_element_factory_class(self, cls):
++        tb = ET.TreeBuilder(element_factory=cls)
++
++        parser = ET.XMLParser(target=tb)
++        parser.feed(self.sample1)
++        e = parser.close()
++        self.assertIsInstance(e, cls)
++        self._check_sample1_element(e)
++
++    def test_element_factory_subclass(self):
++        class MyElement(ET.Element):
++            pass
++        self._check_element_factory_class(MyElement)
++
++    def test_element_factory_pure_python_subclass(self):
++        # Mimick SimpleTAL's behaviour (issue #16089): both versions of
++        # TreeBuilder should be able to cope with a subclass of the
++        # pure Python Element class.
++        base = ET._Element
++        # Not from a C extension
++        self.assertEqual(base.__module__, 'xml.etree.ElementTree')
++        # Force some multiple inheritance with a C class to make things
++        # more interesting.
++        class MyElement(base, ValueError):
++            pass
++        self._check_element_factory_class(MyElement)
++
+     def test_doctype(self):
+         class DoctypeParser:
+             _doctype = None
+@@ -2353,8 +2461,11 @@
+ 
+ # --------------------------------------------------------------------
+ 
+-@unittest.skipUnless(pyET, 'only for the Python version')
+ class NoAcceleratorTest(unittest.TestCase):
++    def setUp(self):
++        if not pyET:
++            raise unittest.SkipTest('only for the Python version')
++
+     # Test that the C accelerator was not imported for pyET
+     def test_correct_import_pyET(self):
+         self.assertEqual(pyET.Element.__module__, 'xml.etree.ElementTree')
+@@ -2406,10 +2517,10 @@
+ def test_main(module=None):
+     # When invoked without a module, runs the Python ET tests by loading pyET.
+     # Otherwise, uses the given module as the ET.
++    global pyET
++    pyET = import_fresh_module('xml.etree.ElementTree',
++                               blocked=['_elementtree'])
+     if module is None:
+-        global pyET
+-        pyET = import_fresh_module('xml.etree.ElementTree',
+-                                   blocked=['_elementtree'])
+         module = pyET
+ 
+     global ET
+@@ -2422,6 +2533,7 @@
+         ParseErrorTest,
+         XincludeTest,
+         ElementTreeTest,
++        ElementFindTest,
+         ElementIterTest,
+         TreeBuilderTest,
+         ]
+@@ -2429,16 +2541,15 @@
+     # These tests will only run for the pure-Python version that doesn't import
+     # _elementtree. We can't use skipUnless here, because pyET is filled in only
+     # after the module is loaded.
+-    if pyET:
++    if pyET is not ET:
+         test_classes.extend([
+             NoAcceleratorTest,
+             ])
+ 
+     try:
+-        support.run_unittest(*test_classes)
+-
+         # XXX the C module should give the same warnings as the Python module
+-        with CleanContext(quiet=(module is not pyET)):
++        with CleanContext(quiet=(pyET is not ET)):
++            support.run_unittest(*test_classes)
+             support.run_doctest(sys.modules[__name__], verbosity=True)
+     finally:
+         # don't interfere with subsequent tests
+diff -r bd8afb90ebf2 Lib/test/test_zipfile.py
+--- a/Lib/test/test_zipfile.py
++++ b/Lib/test/test_zipfile.py
+@@ -13,7 +13,9 @@
+ from random import randint, random
+ from unittest import skipUnless
+ 
+-from test.support import TESTFN, run_unittest, findfile, unlink, requires_zlib, requires_bz2, requires_lzma
++from test.support import (TESTFN, run_unittest, findfile, unlink,
++                          requires_zlib, requires_bz2, requires_lzma,
++                          captured_stdout)
+ 
+ TESTFN2 = TESTFN + "2"
+ TESTFNDIR = TESTFN + "d"
+@@ -22,7 +24,7 @@
+ 
+ SMALL_TEST_DATA = [('_ziptest1', '1q2w3e4r5t'),
+                    ('ziptest2dir/_ziptest2', 'qawsedrftg'),
+-                   ('/ziptest2dir/ziptest3dir/_ziptest3', 'azsxdcfvgb'),
++                   ('ziptest2dir/ziptest3dir/_ziptest3', 'azsxdcfvgb'),
+                    ('ziptest2dir/ziptest3dir/ziptest4dir/_ziptest3', '6y7u8i9o0p')]
+ 
+ 
+@@ -499,10 +501,7 @@
+                 writtenfile = zipfp.extract(fpath)
+ 
+                 # make sure it was written to the right place
+-                if os.path.isabs(fpath):
+-                    correctfile = os.path.join(os.getcwd(), fpath[1:])
+-                else:
+-                    correctfile = os.path.join(os.getcwd(), fpath)
++                correctfile = os.path.join(os.getcwd(), fpath)
+                 correctfile = os.path.normpath(correctfile)
+ 
+                 self.assertEqual(writtenfile, correctfile)
+@@ -524,10 +523,7 @@
+         with zipfile.ZipFile(TESTFN2, "r") as zipfp:
+             zipfp.extractall()
+             for fpath, fdata in SMALL_TEST_DATA:
+-                if os.path.isabs(fpath):
+-                    outfile = os.path.join(os.getcwd(), fpath[1:])
+-                else:
+-                    outfile = os.path.join(os.getcwd(), fpath)
++                outfile = os.path.join(os.getcwd(), fpath)
+ 
+                 with open(outfile, "rb") as f:
+                     self.assertEqual(fdata.encode(), f.read())
+@@ -537,6 +533,109 @@
+         # remove the test file subdirectories
+         shutil.rmtree(os.path.join(os.getcwd(), 'ziptest2dir'))
+ 
++    def check_file(self, filename, content):
++        self.assertTrue(os.path.isfile(filename))
++        with open(filename, 'rb') as f:
++            self.assertEqual(f.read(), content)
++
++    def test_sanitize_windows_name(self):
++        san = zipfile.ZipFile._sanitize_windows_name
++        # Passing pathsep in allows this test to work regardless of platform.
++        self.assertEqual(san(r',,?,C:,foo,bar/z', ','), r'_,C_,foo,bar/z')
++        self.assertEqual(san(r'a\b,c<d>e|f"g?h*i', ','), r'a\b,c_d_e_f_g_h_i')
++        self.assertEqual(san('../../foo../../ba..r', '/'), r'foo/ba..r')
++
++    def test_extract_hackers_arcnames_common_cases(self):
++        common_hacknames = [
++            ('../foo/bar', 'foo/bar'),
++            ('foo/../bar', 'foo/bar'),
++            ('foo/../../bar', 'foo/bar'),
++            ('foo/bar/..', 'foo/bar'),
++            ('./../foo/bar', 'foo/bar'),
++            ('/foo/bar', 'foo/bar'),
++            ('/foo/../bar', 'foo/bar'),
++            ('/foo/../../bar', 'foo/bar'),
++        ]
++        self._test_extract_hackers_arcnames(common_hacknames)
++
++    @unittest.skipIf(os.path.sep != '\\', 'Requires \\ as path separator.')
++    def test_extract_hackers_arcnames_windows_only(self):
++        """Test combination of path fixing and windows name sanitization."""
++        windows_hacknames = [
++                (r'..\foo\bar', 'foo/bar'),
++                (r'..\/foo\/bar', 'foo/bar'),
++                (r'foo/\..\/bar', 'foo/bar'),
++                (r'foo\/../\bar', 'foo/bar'),
++                (r'C:foo/bar', 'foo/bar'),
++                (r'C:/foo/bar', 'foo/bar'),
++                (r'C://foo/bar', 'foo/bar'),
++                (r'C:\foo\bar', 'foo/bar'),
++                (r'//conky/mountpoint/foo/bar', 'foo/bar'),
++                (r'\\conky\mountpoint\foo\bar', 'foo/bar'),
++                (r'///conky/mountpoint/foo/bar', 'conky/mountpoint/foo/bar'),
++                (r'\\\conky\mountpoint\foo\bar', 'conky/mountpoint/foo/bar'),
++                (r'//conky//mountpoint/foo/bar', 'conky/mountpoint/foo/bar'),
++                (r'\\conky\\mountpoint\foo\bar', 'conky/mountpoint/foo/bar'),
++                (r'//?/C:/foo/bar', 'foo/bar'),
++                (r'\\?\C:\foo\bar', 'foo/bar'),
++                (r'C:/../C:/foo/bar', 'C_/foo/bar'),
++                (r'a:b\c<d>e|f"g?h*i', 'b/c_d_e_f_g_h_i'),
++                ('../../foo../../ba..r', 'foo/ba..r'),
++        ]
++        self._test_extract_hackers_arcnames(windows_hacknames)
++
++    @unittest.skipIf(os.path.sep != '/', r'Requires / as path separator.')
++    def test_extract_hackers_arcnames_posix_only(self):
++        posix_hacknames = [
++            ('//foo/bar', 'foo/bar'),
++            ('../../foo../../ba..r', 'foo../ba..r'),
++            (r'foo/..\bar', r'foo/..\bar'),
++        ]
++        self._test_extract_hackers_arcnames(posix_hacknames)
++
++    def _test_extract_hackers_arcnames(self, hacknames):
++        for arcname, fixedname in hacknames:
++            content = b'foobar' + arcname.encode()
++            with zipfile.ZipFile(TESTFN2, 'w', zipfile.ZIP_STORED) as zipfp:
++                zinfo = zipfile.ZipInfo()
++                # preserve backslashes
++                zinfo.filename = arcname
++                zinfo.external_attr = 0o600 << 16
++                zipfp.writestr(zinfo, content)
++
++            arcname = arcname.replace(os.sep, "/")
++            targetpath = os.path.join('target', 'subdir', 'subsub')
++            correctfile = os.path.join(targetpath, *fixedname.split('/'))
++
++            with zipfile.ZipFile(TESTFN2, 'r') as zipfp:
++                writtenfile = zipfp.extract(arcname, targetpath)
++                self.assertEqual(writtenfile, correctfile,
++                                 msg='extract %r: %r != %r' %
++                                 (arcname, writtenfile, correctfile))
++            self.check_file(correctfile, content)
++            shutil.rmtree('target')
++
++            with zipfile.ZipFile(TESTFN2, 'r') as zipfp:
++                zipfp.extractall(targetpath)
++            self.check_file(correctfile, content)
++            shutil.rmtree('target')
++
++            correctfile = os.path.join(os.getcwd(), *fixedname.split('/'))
++
++            with zipfile.ZipFile(TESTFN2, 'r') as zipfp:
++                writtenfile = zipfp.extract(arcname)
++                self.assertEqual(writtenfile, correctfile,
++                                 msg="extract %r" % arcname)
++            self.check_file(correctfile, content)
++            shutil.rmtree(fixedname.split('/')[0])
++
++            with zipfile.ZipFile(TESTFN2, 'r') as zipfp:
++                zipfp.extractall()
++            self.check_file(correctfile, content)
++            shutil.rmtree(fixedname.split('/')[0])
++
++            os.remove(TESTFN2)
++
+     def test_writestr_compression_stored(self):
+         zipfp = zipfile.ZipFile(TESTFN2, "w")
+         zipfp.writestr("a.txt", "hello world", compress_type=zipfile.ZIP_STORED)
+@@ -854,6 +953,28 @@
+             self.assertRaises(RuntimeError, zipfp.writepy, TESTFN)
+             os.remove(TESTFN)
+ 
++    def test_write_pyfile_bad_syntax(self):
++        os.mkdir(TESTFN2)
++        try:
++            with open(os.path.join(TESTFN2, "mod1.py"), "w") as fp:
++                fp.write("Bad syntax in python file\n")
++
++            with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
++                # syntax errors are printed to stdout
++                with captured_stdout() as s:
++                    zipfp.writepy(os.path.join(TESTFN2, "mod1.py"))
++
++                self.assertIn("SyntaxError", s.getvalue())
++
++                # as it will not have compiled the python file, it will
++                # include the .py file not .pyc or .pyo
++                names = zipfp.namelist()
++                self.assertIn('mod1.py', names)
++                self.assertNotIn('mod1.pyc', names)
++                self.assertNotIn('mod1.pyo', names)
++
++        finally:
++            shutil.rmtree(TESTFN2)
+ 
+ class OtherTests(unittest.TestCase):
+     zips_with_bad_crc = {
+@@ -972,6 +1093,20 @@
+         chk = zipfile.is_zipfile(fp)
+         self.assertTrue(not chk)
+ 
++    def test_damaged_zipfile(self):
++        """Check that zipfiles with missing bytes at the end raise BadZipFile."""
++        # - Create a valid zip file
++        fp = io.BytesIO()
++        with zipfile.ZipFile(fp, mode="w") as zipf:
++            zipf.writestr("foo.txt", b"O, for a Muse of Fire!")
++        zipfiledata = fp.getvalue()
++
++        # - Now create copies of it missing the last N bytes and make sure
++        #   a BadZipFile exception is raised when we try to open it
++        for N in range(len(zipfiledata)):
++            fp = io.BytesIO(zipfiledata[:N])
++            self.assertRaises(zipfile.BadZipFile, zipfile.ZipFile, fp)
++
+     def test_is_zip_valid_file(self):
+         """Check that is_zipfile() correctly identifies zip files."""
+         # - passing a filename
+@@ -1024,7 +1159,7 @@
+         with zipfile.ZipFile(data, mode="w") as zipf:
+             zipf.writestr("foo.txt", "O, for a Muse of Fire!")
+ 
+-        # This is correct; calling .read on a closed ZipFile should throw
++        # This is correct; calling .read on a closed ZipFile should raise
+         # a RuntimeError, and so should calling .testzip.  An earlier
+         # version of .testzip would swallow this exception (and any other)
+         # and report that the first file in the archive was corrupt.
+diff -r bd8afb90ebf2 Lib/test/test_zipimport_support.py
+--- a/Lib/test/test_zipimport_support.py
++++ b/Lib/test/test_zipimport_support.py
+@@ -29,7 +29,8 @@
+ #  test_cmd_line_script (covers the zipimport support in runpy)
+ 
+ # Retrieve some helpers from other test cases
+-from test import test_doctest, sample_doctest
++from test import (test_doctest, sample_doctest, sample_doctest_no_doctests,
++                  sample_doctest_no_docstrings)
+ 
+ 
+ def _run_object_doctest(obj, module):
+@@ -105,16 +106,26 @@
+                                     "test_zipped_doctest")
+         test_src = test_src.replace("test.sample_doctest",
+                                     "sample_zipped_doctest")
+-        sample_src = inspect.getsource(sample_doctest)
+-        sample_src = sample_src.replace("test.test_doctest",
+-                                        "test_zipped_doctest")
++        # The sample doctest files rewritten to include in the zipped version.
++        sample_sources = {}
++        for mod in [sample_doctest, sample_doctest_no_doctests,
++                    sample_doctest_no_docstrings]:
++            src = inspect.getsource(mod)
++            src = src.replace("test.test_doctest", "test_zipped_doctest")
++            # Rewrite the module name so that, for example,
++            # "test.sample_doctest" becomes "sample_zipped_doctest".
++            mod_name = mod.__name__.split(".")[-1]
++            mod_name = mod_name.replace("sample_", "sample_zipped_")
++            sample_sources[mod_name] = src
++
+         with temp_dir() as d:
+             script_name = make_script(d, 'test_zipped_doctest',
+                                             test_src)
+             zip_name, run_name = make_zip_script(d, 'test_zip',
+                                                 script_name)
+             z = zipfile.ZipFile(zip_name, 'a')
+-            z.writestr("sample_zipped_doctest.py", sample_src)
++            for mod_name, src in sample_sources.items():
++                z.writestr(mod_name + ".py", src)
+             z.close()
+             if verbose:
+                 zip_file = zipfile.ZipFile(zip_name, 'r')
+diff -r bd8afb90ebf2 Lib/test/test_zlib.py
+--- a/Lib/test/test_zlib.py
++++ b/Lib/test/test_zlib.py
+@@ -487,6 +487,44 @@
+         dco.flush()
+         self.assertFalse(dco.eof)
+ 
++    def test_decompress_unused_data(self):
++        # Repeated calls to decompress() after EOF should accumulate data in
++        # dco.unused_data, instead of just storing the arg to the last call.
++        source = b'abcdefghijklmnopqrstuvwxyz'
++        remainder = b'0123456789'
++        y = zlib.compress(source)
++        x = y + remainder
++        for maxlen in 0, 1000:
++            for step in 1, 2, len(y), len(x):
++                dco = zlib.decompressobj()
++                data = b''
++                for i in range(0, len(x), step):
++                    if i < len(y):
++                        self.assertEqual(dco.unused_data, b'')
++                    if maxlen == 0:
++                        data += dco.decompress(x[i : i + step])
++                        self.assertEqual(dco.unconsumed_tail, b'')
++                    else:
++                        data += dco.decompress(
++                                dco.unconsumed_tail + x[i : i + step], maxlen)
++                data += dco.flush()
++                self.assertTrue(dco.eof)
++                self.assertEqual(data, source)
++                self.assertEqual(dco.unconsumed_tail, b'')
++                self.assertEqual(dco.unused_data, remainder)
++
++    def test_flush_with_freed_input(self):
++        # Issue #16411: decompressor accesses input to last decompress() call
++        # in flush(), even if this object has been freed in the meanwhile.
++        input1 = b'abcdefghijklmnopqrstuvwxyz'
++        input2 = b'QWERTYUIOPASDFGHJKLZXCVBNM'
++        data = zlib.compress(input1)
++        dco = zlib.decompressobj()
++        dco.decompress(data, 1)
++        del data
++        data = zlib.compress(input2)
++        self.assertEqual(dco.flush(), input1[1:])
++
+     if hasattr(zlib.compressobj(), "copy"):
+         def test_compresscopy(self):
+             # Test copying a compression object
+diff -r bd8afb90ebf2 Lib/tkinter/__init__.py
+--- a/Lib/tkinter/__init__.py
++++ b/Lib/tkinter/__init__.py
+@@ -40,6 +40,7 @@
+ import _tkinter # If this fails your Python may not be configured for Tk
+ TclError = _tkinter.TclError
+ from tkinter.constants import *
++import re
+ 
+ 
+ wantobjects = 1
+@@ -52,6 +53,34 @@
+ EXCEPTION = _tkinter.EXCEPTION
+ 
+ 
++_magic_re = re.compile(r'([\\{}])')
++_space_re = re.compile(r'([\s])', re.ASCII)
++
++def _join(value):
++    """Internal function."""
++    return ' '.join(map(_stringify, value))
++
++def _stringify(value):
++    """Internal function."""
++    if isinstance(value, (list, tuple)):
++        if len(value) == 1:
++            value = _stringify(value[0])
++            if value[0] == '{':
++                value = '{%s}' % value
++        else:
++            value = '{%s}' % _join(value)
++    else:
++        value = str(value)
++        if not value:
++            value = '{}'
++        elif _magic_re.search(value):
++            # add '\' before special characters and spaces
++            value = _magic_re.sub(r'\\\1', value)
++            value = _space_re.sub(r'\\\1', value)
++        elif value[0] == '"' or _space_re.search(value):
++            value = '{%s}' % value
++    return value
++
+ def _flatten(seq):
+     """Internal function."""
+     res = ()
+@@ -148,8 +177,12 @@
+     """Internal function."""
+     pass
+ 
+-def _exit(code='0'):
+-    """Internal function. Calling it will throw the exception SystemExit."""
++def _exit(code=0):
++    """Internal function. Calling it will raise the exception SystemExit."""
++    try:
++        code = int(code)
++    except ValueError:
++        pass
+     raise SystemExit(code)
+ 
+ _varnum = 0
+@@ -387,7 +420,7 @@
+         background, highlightColor, selectForeground,
+         disabledForeground, insertBackground, troughColor."""
+         self.tk.call(('tk_setPalette',)
+-              + _flatten(args) + _flatten(kw.items()))
++              + _flatten(args) + _flatten(list(kw.items())))
+     def tk_menuBar(self, *args):
+         """Do not use. Needed in Tk 3.6 and earlier."""
+         pass # obsolete since Tk 4.0
+@@ -1085,7 +1118,7 @@
+                         if isinstance(item, int):
+                             nv.append(str(item))
+                         elif isinstance(item, str):
+-                            nv.append(('{%s}' if ' ' in item else '%s') % item)
++                            nv.append(_stringify(item))
+                         else:
+                             break
+                     else:
+@@ -1440,8 +1473,8 @@
+             if self.subst:
+                 args = self.subst(*args)
+             return self.func(*args)
+-        except SystemExit as msg:
+-            raise SystemExit(msg)
++        except SystemExit:
++            raise
+         except:
+             self.widget._report_exception()
+ 
+@@ -1756,7 +1789,9 @@
+         self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
+         if useTk:
+             self._loadtk()
+-        self.readprofile(baseName, className)
++        if not sys.flags.ignore_environment:
++            # Issue #16248: Honor the -E flag to avoid code injection.
++            self.readprofile(baseName, className)
+     def loadtk(self):
+         if not self._tkloaded:
+             self.tk.loadtk()
+diff -r bd8afb90ebf2 Lib/tkinter/test/test_tkinter/test_misc.py
+--- /dev/null
++++ b/Lib/tkinter/test/test_tkinter/test_misc.py
+@@ -0,0 +1,45 @@
++import unittest
++import tkinter
++from tkinter import ttk
++from test import support
++
++support.requires('gui')
++
++class MiscTest(unittest.TestCase):
++
++    def setUp(self):
++        self.root = ttk.setup_master()
++
++    def test_tk_setPalette(self):
++        root = self.root
++        root.tk_setPalette('black')
++        self.assertEqual(root['background'], 'black')
++        root.tk_setPalette('white')
++        self.assertEqual(root['background'], 'white')
++        self.assertRaisesRegex(tkinter.TclError,
++                '^unknown color name "spam"$',
++                root.tk_setPalette, 'spam')
++
++        root.tk_setPalette(background='black')
++        self.assertEqual(root['background'], 'black')
++        root.tk_setPalette(background='blue', highlightColor='yellow')
++        self.assertEqual(root['background'], 'blue')
++        self.assertEqual(root['highlightcolor'], 'yellow')
++        root.tk_setPalette(background='yellow', highlightColor='blue')
++        self.assertEqual(root['background'], 'yellow')
++        self.assertEqual(root['highlightcolor'], 'blue')
++        self.assertRaisesRegex(tkinter.TclError,
++                '^unknown color name "spam"$',
++                root.tk_setPalette, background='spam')
++        self.assertRaisesRegex(tkinter.TclError,
++                '^must specify a background color$',
++                root.tk_setPalette, spam='white')
++        self.assertRaisesRegex(tkinter.TclError,
++                '^must specify a background color$',
++                root.tk_setPalette, highlightColor='blue')
++
++
++tests_gui = (MiscTest, )
++
++if __name__ == "__main__":
++    support.run_unittest(*tests_gui)
+diff -r bd8afb90ebf2 Lib/tkinter/test/test_ttk/test_functions.py
+--- a/Lib/tkinter/test/test_ttk/test_functions.py
++++ b/Lib/tkinter/test/test_ttk/test_functions.py
+@@ -49,13 +49,17 @@
+             ttk._format_optdict({'test': {'left': 'as is'}}),
+             {'-test': {'left': 'as is'}})
+ 
+-        # check script formatting and untouched value(s)
++        # check script formatting
+         check_against(
+             ttk._format_optdict(
+-                {'test': [1, -1, '', '2m', 0], 'nochange1': 3,
+-                 'nochange2': 'abc def'}, script=True),
+-            {'-test': '{1 -1 {} 2m 0}', '-nochange1': 3,
+-             '-nochange2': 'abc def' })
++                {'test': [1, -1, '', '2m', 0], 'test2': 3,
++                 'test3': '', 'test4': 'abc def',
++                 'test5': '"abc"', 'test6': '{}',
++                 'test7': '} -spam {'}, script=True),
++            {'-test': '{1 -1 {} 2m 0}', '-test2': '3',
++             '-test3': '{}', '-test4': '{abc def}',
++             '-test5': '{"abc"}', '-test6': r'\{\}',
++             '-test7': r'\}\ -spam\ \{'})
+ 
+         opts = {'αβγ': True, 'á': False}
+         orig_opts = opts.copy()
+@@ -69,6 +73,32 @@
+             ttk._format_optdict(
+                 {'option': ('one two', 'three')}),
+             {'-option': '{one two} three'})
++        check_against(
++            ttk._format_optdict(
++                {'option': ('one\ttwo', 'three')}),
++            {'-option': '{one\ttwo} three'})
++
++        # passing empty strings inside a tuple/list
++        check_against(
++            ttk._format_optdict(
++                {'option': ('', 'one')}),
++            {'-option': '{} one'})
++
++        # passing values with braces inside a tuple/list
++        check_against(
++            ttk._format_optdict(
++                {'option': ('one} {two', 'three')}),
++            {'-option': r'one\}\ \{two three'})
++
++        # passing quoted strings inside a tuple/list
++        check_against(
++            ttk._format_optdict(
++                {'option': ('"one"', 'two')}),
++            {'-option': '{"one"} two'})
++        check_against(
++            ttk._format_optdict(
++                {'option': ('{one}', 'two')}),
++            {'-option': r'\{one\} two'})
+ 
+         # ignore an option
+         amount_opts = len(ttk._format_optdict(opts, ignore=('á'))) / 2
+diff -r bd8afb90ebf2 Lib/tkinter/test/test_ttk/test_widgets.py
+--- a/Lib/tkinter/test/test_ttk/test_widgets.py
++++ b/Lib/tkinter/test/test_ttk/test_widgets.py
+@@ -189,6 +189,14 @@
+         self.combo.configure(values=[1, '', 2])
+         self.assertEqual(self.combo['values'], ('1', '', '2'))
+ 
++        # testing values with spaces
++        self.combo['values'] = ['a b', 'a\tb', 'a\nb']
++        self.assertEqual(self.combo['values'], ('a b', 'a\tb', 'a\nb'))
++
++        # testing values with special characters
++        self.combo['values'] = [r'a\tb', '"a"', '} {']
++        self.assertEqual(self.combo['values'], (r'a\tb', '"a"', '} {'))
++
+         # out of range
+         self.assertRaises(tkinter.TclError, self.combo.current,
+             len(self.combo['values']))
+diff -r bd8afb90ebf2 Lib/tkinter/ttk.py
+--- a/Lib/tkinter/ttk.py
++++ b/Lib/tkinter/ttk.py
+@@ -26,8 +26,7 @@
+            "tclobjs_to_py", "setup_master"]
+ 
+ import tkinter
+-
+-_flatten = tkinter._flatten
++from tkinter import _flatten, _join, _stringify
+ 
+ # Verify if Tk is new enough to not need the Tile package
+ _REQUIRE_TILE = True if tkinter.TkVersion < 8.5 else False
+@@ -47,39 +46,54 @@
+         master.tk.eval('package require tile') # TclError may be raised here
+         master._tile_loaded = True
+ 
++def _format_optvalue(value, script=False):
++    """Internal function."""
++    if script:
++        # if caller passes a Tcl script to tk.call, all the values need to
++        # be grouped into words (arguments to a command in Tcl dialect)
++        value = _stringify(value)
++    elif isinstance(value, (list, tuple)):
++        value = _join(value)
++    return value
++
+ def _format_optdict(optdict, script=False, ignore=None):
+     """Formats optdict to a tuple to pass it to tk.call.
+ 
+     E.g. (script=False):
+       {'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns:
+       ('-foreground', 'blue', '-padding', '1 2 3 4')"""
+-    format = "%s" if not script else "{%s}"
+ 
+     opts = []
+     for opt, value in optdict.items():
+-        if ignore and opt in ignore:
+-            continue
++        if not ignore or opt not in ignore:
++            opts.append("-%s" % opt)
++            if value is not None:
++                opts.append(_format_optvalue(value, script))
+ 
+-        if isinstance(value, (list, tuple)):
+-            v = []
+-            for val in value:
+-                if isinstance(val, str):
+-                    v.append(str(val) if val else '{}')
+-                else:
+-                    v.append(str(val))
++    return _flatten(opts)
+ 
+-            # format v according to the script option, but also check for
+-            # space in any value in v in order to group them correctly
+-            value = format % ' '.join(
+-                ('{%s}' if ' ' in val else '%s') % val for val in v)
+-
+-        if script and value == '':
+-            value = '{}' # empty string in Python is equivalent to {} in Tcl
+-
+-        opts.append(("-%s" % opt, value))
+-
+-    # Remember: _flatten skips over None
+-    return _flatten(opts)
++def _mapdict_values(items):
++    # each value in mapdict is expected to be a sequence, where each item
++    # is another sequence containing a state (or several) and a value
++    # E.g. (script=False):
++    #   [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]
++    #   returns:
++    #   ['active selected', 'grey', 'focus', [1, 2, 3, 4]]
++    opt_val = []
++    for *state, val in items:
++        # hacks for bakward compatibility
++        state[0] # raise IndexError if empty
++        if len(state) == 1:
++            # if it is empty (something that evaluates to False), then
++            # format it to Tcl code to denote the "normal" state
++            state = state[0] or ''
++        else:
++            # group multiple states
++            state = ' '.join(state) # raise TypeError if not str
++        opt_val.append(state)
++        if val is not None:
++            opt_val.append(val)
++    return opt_val
+ 
+ def _format_mapdict(mapdict, script=False):
+     """Formats mapdict to pass it to tk.call.
+@@ -90,32 +104,11 @@
+       returns:
+ 
+       ('-expand', '{active selected} grey focus {1, 2, 3, 4}')"""
+-    # if caller passes a Tcl script to tk.call, all the values need to
+-    # be grouped into words (arguments to a command in Tcl dialect)
+-    format = "%s" if not script else "{%s}"
+ 
+     opts = []
+     for opt, value in mapdict.items():
+-
+-        opt_val = []
+-        # each value in mapdict is expected to be a sequence, where each item
+-        # is another sequence containing a state (or several) and a value
+-        for statespec in value:
+-            state, val = statespec[:-1], statespec[-1]
+-
+-            if len(state) > 1: # group multiple states
+-                state = "{%s}" % ' '.join(state)
+-            else: # single state
+-                # if it is empty (something that evaluates to False), then
+-                # format it to Tcl code to denote the "normal" state
+-                state = state[0] or '{}'
+-
+-            if isinstance(val, (list, tuple)): # val needs to be grouped
+-                val = "{%s}" % ' '.join(map(str, val))
+-
+-            opt_val.append("%s %s" % (state, val))
+-
+-        opts.append(("-%s" % opt, format % ' '.join(opt_val)))
++        opts.extend(("-%s" % opt,
++                     _format_optvalue(_mapdict_values(value), script)))
+ 
+     return _flatten(opts)
+ 
+@@ -129,7 +122,7 @@
+             iname = args[0]
+             # next args, if any, are statespec/value pairs which is almost
+             # a mapdict, but we just need the value
+-            imagespec = _format_mapdict({None: args[1:]})[1]
++            imagespec = _join(_mapdict_values(args[1:]))
+             spec = "%s %s" % (iname, imagespec)
+ 
+         else:
+@@ -138,7 +131,7 @@
+             # themed styles on Windows XP and Vista.
+             # Availability: Tk 8.6, Windows XP and Vista.
+             class_name, part_id = args[:2]
+-            statemap = _format_mapdict({None: args[2:]})[1]
++            statemap = _join(_mapdict_values(args[2:]))
+             spec = "%s %s %s" % (class_name, part_id, statemap)
+ 
+         opts = _format_optdict(kw, script)
+@@ -148,11 +141,11 @@
+         # otherwise it will clone {} (empty element)
+         spec = args[0] # theme name
+         if len(args) > 1: # elementfrom specified
+-            opts = (args[1], )
++            opts = (_format_optvalue(args[1], script),)
+ 
+     if script:
+         spec = '{%s}' % spec
+-        opts = ' '.join(map(str, opts))
++        opts = ' '.join(opts)
+ 
+     return spec, opts
+ 
+@@ -189,7 +182,7 @@
+     for layout_elem in layout:
+         elem, opts = layout_elem
+         opts = opts or {}
+-        fopts = ' '.join(map(str, _format_optdict(opts, True, "children")))
++        fopts = ' '.join(_format_optdict(opts, True, ("children",)))
+         head = "%s%s%s" % (' ' * indent, elem, (" %s" % fopts) if fopts else '')
+ 
+         if "children" in opts:
+@@ -215,11 +208,11 @@
+     for name, opts in settings.items():
+         # will format specific keys according to Tcl code
+         if opts.get('configure'): # format 'configure'
+-            s = ' '.join(map(str, _format_optdict(opts['configure'], True)))
++            s = ' '.join(_format_optdict(opts['configure'], True))
+             script.append("ttk::style configure %s %s;" % (name, s))
+ 
+         if opts.get('map'): # format 'map'
+-            s = ' '.join(map(str, _format_mapdict(opts['map'], True)))
++            s = ' '.join(_format_mapdict(opts['map'], True))
+             script.append("ttk::style map %s %s;" % (name, s))
+ 
+         if 'layout' in opts: # format 'layout' which may be empty
+@@ -706,30 +699,9 @@
+             exportselection, justify, height, postcommand, state,
+             textvariable, values, width
+         """
+-        # The "values" option may need special formatting, so leave to
+-        # _format_optdict the responsibility to format it
+-        if "values" in kw:
+-            kw["values"] = _format_optdict({'v': kw["values"]})[1]
+-
+         Entry.__init__(self, master, "ttk::combobox", **kw)
+ 
+ 
+-    def __setitem__(self, item, value):
+-        if item == "values":
+-            value = _format_optdict({item: value})[1]
+-
+-        Entry.__setitem__(self, item, value)
+-
+-
+-    def configure(self, cnf=None, **kw):
+-        """Custom Combobox configure, created to properly format the values
+-        option."""
+-        if "values" in kw:
+-            kw["values"] = _format_optdict({'v': kw["values"]})[1]
+-
+-        return Entry.configure(self, cnf, **kw)
+-
+-
+     def current(self, newindex=None):
+         """If newindex is supplied, sets the combobox value to the
+         element at position newindex in the list of values. Otherwise,
+diff -r bd8afb90ebf2 Lib/tokenize.py
+--- a/Lib/tokenize.py
++++ b/Lib/tokenize.py
+@@ -162,7 +162,7 @@
+                 group("'", r'\\\r?\n'),
+                 StringPrefix + r'"[^\n"\\]*(?:\\.[^\n"\\]*)*' +
+                 group('"', r'\\\r?\n'))
+-PseudoExtras = group(r'\\\r?\n', Comment, Triple)
++PseudoExtras = group(r'\\\r?\n|\Z', Comment, Triple)
+ PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)
+ 
+ def _compile(expr):
+@@ -555,6 +555,8 @@
+             if pseudomatch:                                # scan for tokens
+                 start, end = pseudomatch.span(1)
+                 spos, epos, pos = (lnum, start), (lnum, end), end
++                if start == end:
++                    continue
+                 token, initial = line[start:end], line[start]
+ 
+                 if (initial in numchars or                  # ordinary number
+diff -r bd8afb90ebf2 Lib/trace.py
+--- a/Lib/trace.py
++++ b/Lib/trace.py
+@@ -58,6 +58,7 @@
+ import gc
+ import dis
+ import pickle
++from warnings import warn as _warn
+ try:
+     from time import monotonic as _time
+ except ImportError:
+diff -r bd8afb90ebf2 Lib/unittest/__main__.py
+--- a/Lib/unittest/__main__.py
++++ b/Lib/unittest/__main__.py
+@@ -2,7 +2,14 @@
+ 
+ import sys
+ if sys.argv[0].endswith("__main__.py"):
+-    sys.argv[0] = "python -m unittest"
++    import os.path
++    # We change sys.argv[0] to make help message more useful
++    # use executable without path, unquoted
++    # (it's just a hint anyway)
++    # (if you have spaces in your executable you get what you deserve!)
++    executable = os.path.basename(sys.executable)
++    sys.argv[0] = executable + " -m unittest"
++    del os
+ 
+ __unittest = True
+ 
+diff -r bd8afb90ebf2 Lib/unittest/case.py
+--- a/Lib/unittest/case.py
++++ b/Lib/unittest/case.py
+@@ -542,10 +542,10 @@
+             return  '%s : %s' % (safe_repr(standardMsg), safe_repr(msg))
+ 
+     def assertRaises(self, excClass, callableObj=None, *args, **kwargs):
+-        """Fail unless an exception of class excClass is thrown
++        """Fail unless an exception of class excClass is raised
+            by callableObj when invoked with arguments args and keyword
+            arguments kwargs. If a different type of exception is
+-           thrown, it will not be caught, and the test case will be
++           raised, it will not be caught, and the test case will be
+            deemed to have suffered an error, exactly as for an
+            unexpected exception.
+ 
+@@ -642,7 +642,7 @@
+         assertion_func(first, second, msg=msg)
+ 
+     def assertNotEqual(self, first, second, msg=None):
+-        """Fail if the two objects are equal as determined by the '=='
++        """Fail if the two objects are equal as determined by the '!='
+            operator.
+         """
+         if not first != second:
+@@ -736,7 +736,7 @@
+             msg: Optional message to use on failure instead of a list of
+                     differences.
+         """
+-        if seq_type != None:
++        if seq_type is not None:
+             seq_type_name = seq_type.__name__
+             if not isinstance(seq1, seq_type):
+                 raise self.failureException('First sequence is not a %s: %s'
+diff -r bd8afb90ebf2 Lib/unittest/main.py
+--- a/Lib/unittest/main.py
++++ b/Lib/unittest/main.py
+@@ -175,6 +175,7 @@
+                                                            self.module)
+ 
+     def _getOptParser(self):
++        import optparse
+         parser = optparse.OptionParser()
+         parser.prog = self.progName
+         parser.add_option('-v', '--verbose', dest='verbose', default=False,
+@@ -219,7 +220,10 @@
+         parser.add_option('-t', '--top-level-directory', dest='top', default=None,
+                           help='Top level directory of project (defaults to start directory)')
+ 
+-    def _do_discovery(self, argv, Loader=loader.TestLoader):
++    def _do_discovery(self, argv, Loader=None):
++        if Loader is None:
++            Loader = lambda: self.testLoader
++
+         # handle command line args for test discovery
+         self.progName = '%s discover' % self.progName
+         parser = self._getOptParser()
+diff -r bd8afb90ebf2 Lib/unittest/mock.py
+--- a/Lib/unittest/mock.py
++++ b/Lib/unittest/mock.py
+@@ -731,8 +731,8 @@
+         arguments."""
+         self = _mock_self
+         if not self.call_count == 1:
+-            msg = ("Expected to be called once. Called %s times." %
+-                   self.call_count)
++            msg = ("Expected '%s' to be called once. Called %s times." %
++                   (self._mock_name or 'mock', self.call_count))
+             raise AssertionError(msg)
+         return self.assert_called_with(*args, **kwargs)
+ 
+diff -r bd8afb90ebf2 Lib/unittest/runner.py
+--- a/Lib/unittest/runner.py
++++ b/Lib/unittest/runner.py
+@@ -35,7 +35,7 @@
+     separator2 = '-' * 70
+ 
+     def __init__(self, stream, descriptions, verbosity):
+-        super(TextTestResult, self).__init__()
++        super(TextTestResult, self).__init__(stream, descriptions, verbosity)
+         self.stream = stream
+         self.showAll = verbosity > 1
+         self.dots = verbosity == 1
+diff -r bd8afb90ebf2 Lib/unittest/signals.py
+--- a/Lib/unittest/signals.py
++++ b/Lib/unittest/signals.py
+@@ -9,6 +9,20 @@
+ class _InterruptHandler(object):
+     def __init__(self, default_handler):
+         self.called = False
++        self.original_handler = default_handler
++        if isinstance(default_handler, int):
++            if default_handler == signal.SIG_DFL:
++                # Pretend it's signal.default_int_handler instead.
++                default_handler = signal.default_int_handler
++            elif default_handler == signal.SIG_IGN:
++                # Not quite the same thing as SIG_IGN, but the closest we
++                # can make it: do nothing.
++                def default_handler(unused_signum, unused_frame):
++                    pass
++            else:
++                raise TypeError("expected SIGINT signal handler to be "
++                                "signal.SIG_IGN, signal.SIG_DFL, or a "
++                                "callable object")
+         self.default_handler = default_handler
+ 
+     def __call__(self, signum, frame):
+@@ -54,4 +68,4 @@
+ 
+     global _interrupt_handler
+     if _interrupt_handler is not None:
+-        signal.signal(signal.SIGINT, _interrupt_handler.default_handler)
++        signal.signal(signal.SIGINT, _interrupt_handler.original_handler)
+diff -r bd8afb90ebf2 Lib/unittest/test/test_break.py
+--- a/Lib/unittest/test/test_break.py
++++ b/Lib/unittest/test/test_break.py
+@@ -13,9 +13,12 @@
+ @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 "
+     "if threads have been used")
+ class TestBreak(unittest.TestCase):
++    int_handler = None
+ 
+     def setUp(self):
+         self._default_handler = signal.getsignal(signal.SIGINT)
++        if self.int_handler is not None:
++            signal.signal(signal.SIGINT, self.int_handler)
+ 
+     def tearDown(self):
+         signal.signal(signal.SIGINT, self._default_handler)
+@@ -72,6 +75,10 @@
+ 
+ 
+     def testSecondInterrupt(self):
++        # Can't use skipIf decorator because the signal handler may have
++        # been changed after defining this method.
++        if signal.getsignal(signal.SIGINT) == signal.SIG_IGN:
++            self.skipTest("test requires SIGINT to not be ignored")
+         result = unittest.TestResult()
+         unittest.installHandler()
+         unittest.registerResult(result)
+@@ -121,6 +128,10 @@
+ 
+ 
+     def testHandlerReplacedButCalled(self):
++        # Can't use skipIf decorator because the signal handler may have
++        # been changed after defining this method.
++        if signal.getsignal(signal.SIGINT) == signal.SIG_IGN:
++            self.skipTest("test requires SIGINT to not be ignored")
+         # If our handler has been replaced (is no longer installed) but is
+         # called by the *new* handler, then it isn't safe to delay the
+         # SIGINT and we should immediately delegate to the default handler
+@@ -250,3 +261,24 @@
+ 
+         test()
+         self.assertNotEqual(signal.getsignal(signal.SIGINT), default_handler)
++
++@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
++@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
++@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 "
++    "if threads have been used")
++class TestBreakDefaultIntHandler(TestBreak):
++    int_handler = signal.default_int_handler
++
++@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
++@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
++@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 "
++    "if threads have been used")
++class TestBreakSignalIgnored(TestBreak):
++    int_handler = signal.SIG_IGN
++
++@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
++@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
++@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 "
++    "if threads have been used")
++class TestBreakSignalDefault(TestBreak):
++    int_handler = signal.SIG_DFL
+diff -r bd8afb90ebf2 Lib/unittest/test/test_discovery.py
+--- a/Lib/unittest/test/test_discovery.py
++++ b/Lib/unittest/test/test_discovery.py
+@@ -253,12 +253,26 @@
+ 
+         program = TestableTestProgram()
+         program.usageExit = usageExit
++        program.testLoader = None
+ 
+         with self.assertRaises(Stop):
+             # too many args
+             program._do_discovery(['one', 'two', 'three', 'four'])
+ 
+ 
++    def test_command_line_handling_do_discovery_uses_default_loader(self):
++        program = object.__new__(unittest.TestProgram)
++
++        class Loader(object):
++            args = []
++            def discover(self, start_dir, pattern, top_level_dir):
++                self.args.append((start_dir, pattern, top_level_dir))
++                return 'tests'
++
++        program.testLoader = Loader()
++        program._do_discovery(['-v'])
++        self.assertEqual(Loader.args, [('.', 'test*.py', None)])
++
+     def test_command_line_handling_do_discovery_calls_loader(self):
+         program = TestableTestProgram()
+ 
+diff -r bd8afb90ebf2 Lib/unittest/test/test_runner.py
+--- a/Lib/unittest/test/test_runner.py
++++ b/Lib/unittest/test/test_runner.py
+@@ -149,6 +149,19 @@
+         self.assertEqual(runner.resultclass, unittest.TextTestResult)
+ 
+ 
++    def test_multiple_inheritance(self):
++        class AResult(unittest.TestResult):
++            def __init__(self, stream, descriptions, verbosity):
++                super(AResult, self).__init__(stream, descriptions, verbosity)
++
++        class ATextResult(unittest.TextTestResult, AResult):
++            pass
++
++        # This used to raise an exception due to TextTestResult not passing
++        # on arguments in its __init__ super call
++        ATextResult(None, None, 1)
++
++
+     def testBufferAndFailfast(self):
+         class Test(unittest.TestCase):
+             def testFoo(self):
+diff -r bd8afb90ebf2 Lib/unittest/test/testmock/testmock.py
+--- a/Lib/unittest/test/testmock/testmock.py
++++ b/Lib/unittest/test/testmock/testmock.py
+@@ -463,6 +463,13 @@
+                                 mock.assert_called_with)
+ 
+ 
++    def test_assert_called_once_with_message(self):
++        mock = Mock(name='geoffrey')
++        self.assertRaisesRegex(AssertionError,
++                     r"Expected 'geoffrey' to be called once\.",
++                     mock.assert_called_once_with)
++
++
+     def test__name__(self):
+         mock = Mock()
+         self.assertRaises(AttributeError, lambda: mock.__name__)
+diff -r bd8afb90ebf2 Lib/urllib/error.py
+--- a/Lib/urllib/error.py
++++ b/Lib/urllib/error.py
+@@ -61,6 +61,10 @@
+     def reason(self):
+         return self.msg
+ 
++    def info(self):
++        return self.hdrs
++
++
+ # exception raised when downloaded size does not match content-length
+ class ContentTooShortError(URLError):
+     def __init__(self, message, content):
+diff -r bd8afb90ebf2 Lib/urllib/parse.py
+--- a/Lib/urllib/parse.py
++++ b/Lib/urllib/parse.py
+@@ -46,7 +46,7 @@
+                'svn', 'svn+ssh', 'sftp', 'nfs', 'git', 'git+ssh']
+ uses_params = ['ftp', 'hdl', 'prospero', 'http', 'imap',
+                'https', 'shttp', 'rtsp', 'rtspu', 'sip', 'sips',
+-               'mms', '', 'sftp']
++               'mms', '', 'sftp', 'tel']
+ 
+ # These are not actually used anymore, but should stay for backwards
+ # compatibility.  (They are undocumented, but have a public-looking name.)
+diff -r bd8afb90ebf2 Lib/urllib/request.py
+--- a/Lib/urllib/request.py
++++ b/Lib/urllib/request.py
+@@ -208,7 +208,7 @@
+                 size = int(headers["Content-Length"])
+ 
+             if reporthook:
+-                reporthook(blocknum, 0, size)
++                reporthook(blocknum, bs, size)
+ 
+             while True:
+                 block = fp.read(bs)
+@@ -218,7 +218,7 @@
+                 tfp.write(block)
+                 blocknum += 1
+                 if reporthook:
+-                    reporthook(blocknum, len(block), size)
++                    reporthook(blocknum, bs, size)
+ 
+     if size >= 0 and read < size:
+         raise ContentTooShortError(
+@@ -1413,9 +1413,9 @@
+                 else:
+                     origurl = 'file://' + filename
+                 return addinfourl(open(localfile, 'rb'), headers, origurl)
+-        except OSError as msg:
++        except OSError as exp:
+             # users shouldn't expect OSErrors coming from urlopen()
+-            raise URLError(msg)
++            raise URLError(exp)
+         raise URLError('file not on local host')
+ 
+ def _safe_gethostbyname(host):
+@@ -1474,8 +1474,8 @@
+                 headers += "Content-length: %d\n" % retrlen
+             headers = email.message_from_string(headers)
+             return addinfourl(fp, headers, req.full_url)
+-        except ftplib.all_errors as msg:
+-            exc = URLError('ftp error: %s' % msg)
++        except ftplib.all_errors as exp:
++            exc = URLError('ftp error: %r' % exp)
+             raise exc.with_traceback(sys.exc_info()[2])
+ 
+     def connect_ftp(self, user, passwd, host, port, dirs, timeout):
+@@ -1870,7 +1870,7 @@
+     def open_file(self, url):
+         """Use local file or FTP depending on form of URL."""
+         if not isinstance(url, str):
+-            raise URLError('file error', 'proxy support for file protocol currently not implemented')
++            raise URLError('file error: proxy support for file protocol currently not implemented')
+         if url[:2] == '//' and url[2:3] != '/' and url[2:12].lower() != 'localhost/':
+             raise ValueError("file:// scheme is supported only on localhost")
+         else:
+@@ -1885,7 +1885,7 @@
+         try:
+             stats = os.stat(localname)
+         except OSError as e:
+-            raise URLError(e.errno, e.strerror, e.filename)
++            raise URLError(e.strerror, e.filename)
+         size = stats.st_size
+         modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
+         mtype = mimetypes.guess_type(url)[0]
+@@ -1899,22 +1899,22 @@
+             return addinfourl(open(localname, 'rb'), headers, urlfile)
+         host, port = splitport(host)
+         if (not port
+-           and socket.gethostbyname(host) in (localhost() + thishost())):
++           and socket.gethostbyname(host) in ((localhost(),) + thishost())):
+             urlfile = file
+             if file[:1] == '/':
+                 urlfile = 'file://' + file
+             elif file[:2] == './':
+                 raise ValueError("local file url may start with / or file:. Unknown url of type: %s" % url)
+             return addinfourl(open(localname, 'rb'), headers, urlfile)
+-        raise URLError('local file error', 'not on local host')
++        raise URLError('local file error: not on local host')
+ 
+     def open_ftp(self, url):
+         """Use FTP protocol."""
+         if not isinstance(url, str):
+-            raise URLError('ftp error', 'proxy support for ftp protocol currently not implemented')
++            raise URLError('ftp error: proxy support for ftp protocol currently not implemented')
+         import mimetypes
+         host, path = splithost(url)
+-        if not host: raise URLError('ftp error', 'no host given')
++        if not host: raise URLError('ftp error: no host given')
+         host, port = splitport(host)
+         user, host = splituser(host)
+         if user: user, passwd = splitpasswd(user)
+@@ -1963,13 +1963,13 @@
+                 headers += "Content-Length: %d\n" % retrlen
+             headers = email.message_from_string(headers)
+             return addinfourl(fp, headers, "ftp:" + url)
+-        except ftperrors() as msg:
+-            raise URLError('ftp error', msg).with_traceback(sys.exc_info()[2])
++        except ftperrors() as exp:
++            raise URLError('ftp error %r' % exp).with_traceback(sys.exc_info()[2])
+ 
+     def open_data(self, url, data=None):
+         """Use "data" URL."""
+         if not isinstance(url, str):
+-            raise URLError('data error', 'proxy support for data protocol currently not implemented')
++            raise URLError('data error: proxy support for data protocol currently not implemented')
+         # ignore POSTed data
+         #
+         # syntax of data URLs:
+@@ -2298,7 +2298,7 @@
+                 conn, retrlen = self.ftp.ntransfercmd(cmd)
+             except ftplib.error_perm as reason:
+                 if str(reason)[:3] != '550':
+-                    raise URLError('ftp error', reason).with_traceback(
++                    raise URLError('ftp error: %d' % reason).with_traceback(
+                         sys.exc_info()[2])
+         if not conn:
+             # Set transfer mode to ASCII!
+@@ -2310,7 +2310,7 @@
+                     try:
+                         self.ftp.cwd(file)
+                     except ftplib.error_perm as reason:
+-                        raise URLError('ftp error', reason) from reason
++                        raise URLError('ftp error: %d' % reason) from reason
+                 finally:
+                     self.ftp.cwd(pwd)
+                 cmd = 'LIST ' + file
+@@ -2326,13 +2326,7 @@
+         return (ftpobj, retrlen)
+ 
+     def endtransfer(self):
+-        if not self.busy:
+-            return
+         self.busy = 0
+-        try:
+-            self.ftp.voidresp()
+-        except ftperrors():
+-            pass
+ 
+     def close(self):
+         self.keepalive = False
+diff -r bd8afb90ebf2 Lib/venv/__init__.py
+--- a/Lib/venv/__init__.py
++++ b/Lib/venv/__init__.py
+@@ -54,9 +54,11 @@
+     behaviour when called upon to create a virtual environment.
+ 
+     By default, the builder makes the system (global) site-packages dir
+-    available to the created environment.
++    *un*available to the created environment.
+ 
+-    By default, the creation process uses symlinks wherever possible.
++    If invoked using the Python -m option, the default is to use copying
++    on Windows platforms but symlinks elsewhere. If instantiated some
++    other way, the default is to *not* use symlinks.
+ 
+     :param system_site_packages: If True, the system (global) site-packages
+                                  dir is available to created environments.
+@@ -305,19 +307,26 @@
+                     mode = 'wb'
+                 else:
+                     mode = 'w'
+-                    data = data.decode('utf-8')
+-                    data = self.replace_variables(data, context)
+-                with open(dstfile, mode) as f:
+-                    f.write(data)
+-                shutil.copymode(srcfile, dstfile)
++                    try:
++                        data = data.decode('utf-8')
++                        data = self.replace_variables(data, context)
++                    except UnicodeDecodeError as e:
++                        data = None
++                        logger.warning('unable to copy script %r, '
++                                       'may be binary: %s', srcfile, e)
++                if data is not None:
++                    with open(dstfile, mode) as f:
++                        f.write(data)
++                    shutil.copymode(srcfile, dstfile)
+ 
+ 
+ def create(env_dir, system_site_packages=False, clear=False, symlinks=False):
+     """
+     Create a virtual environment in a directory.
+ 
+-    By default, makes the system (global) site-packages dir available to
+-    the created environment.
++    By default, makes the system (global) site-packages dir *un*available to
++    the created environment, and uses copying rather than symlinking for files
++    obtained from the source Python installation.
+ 
+     :param env_dir: The target directory to create an environment in.
+     :param system_site_packages: If True, the system (global) site-packages
+diff -r bd8afb90ebf2 Lib/wave.py
+--- a/Lib/wave.py
++++ b/Lib/wave.py
+@@ -261,9 +261,9 @@
+     #
+ 
+     def _read_fmt_chunk(self, chunk):
+-        wFormatTag, self._nchannels, self._framerate, dwAvgBytesPerSec, wBlockAlign = struct.unpack_from('<hhllh', chunk.read(14))
++        wFormatTag, self._nchannels, self._framerate, dwAvgBytesPerSec, wBlockAlign = struct.unpack_from('<HHLLH', chunk.read(14))
+         if wFormatTag == WAVE_FORMAT_PCM:
+-            sampwidth = struct.unpack_from('<h', chunk.read(2))[0]
++            sampwidth = struct.unpack_from('<H', chunk.read(2))[0]
+             self._sampwidth = (sampwidth + 7) // 8
+         else:
+             raise Error('unknown format: %r' % (wFormatTag,))
+@@ -466,14 +466,14 @@
+             self._nframes = initlength // (self._nchannels * self._sampwidth)
+         self._datalength = self._nframes * self._nchannels * self._sampwidth
+         self._form_length_pos = self._file.tell()
+-        self._file.write(struct.pack('<l4s4slhhllhh4s',
++        self._file.write(struct.pack('<L4s4sLHHLLHH4s',
+             36 + self._datalength, b'WAVE', b'fmt ', 16,
+             WAVE_FORMAT_PCM, self._nchannels, self._framerate,
+             self._nchannels * self._framerate * self._sampwidth,
+             self._nchannels * self._sampwidth,
+             self._sampwidth * 8, b'data'))
+         self._data_length_pos = self._file.tell()
+-        self._file.write(struct.pack('<l', self._datalength))
++        self._file.write(struct.pack('<L', self._datalength))
+         self._headerwritten = True
+ 
+     def _patchheader(self):
+@@ -482,9 +482,9 @@
+             return
+         curpos = self._file.tell()
+         self._file.seek(self._form_length_pos, 0)
+-        self._file.write(struct.pack('<l', 36 + self._datawritten))
++        self._file.write(struct.pack('<L', 36 + self._datawritten))
+         self._file.seek(self._data_length_pos, 0)
+-        self._file.write(struct.pack('<l', self._datawritten))
++        self._file.write(struct.pack('<L', self._datawritten))
+         self._file.seek(curpos, 0)
+         self._datalength = self._datawritten
+ 
+diff -r bd8afb90ebf2 Lib/webbrowser.py
+--- a/Lib/webbrowser.py
++++ b/Lib/webbrowser.py
+@@ -206,12 +206,18 @@
+     """Parent class for all Unix browsers with remote functionality."""
+ 
+     raise_opts = None
++    background = False
++    redirect_stdout = True
++    # In remote_args, %s will be replaced with the requested URL.  %action will
++    # be replaced depending on the value of 'new' passed to open.
++    # remote_action is used for new=0 (open).  If newwin is not None, it is
++    # used for new=1 (open_new).  If newtab is not None, it is used for
++    # new=3 (open_new_tab).  After both substitutions are made, any empty
++    # strings in the transformed remote_args list will be removed.
+     remote_args = ['%action', '%s']
+     remote_action = None
+     remote_action_newwin = None
+     remote_action_newtab = None
+-    background = False
+-    redirect_stdout = True
+ 
+     def _invoke(self, args, remote, autoraise):
+         raise_opt = []
+@@ -224,7 +230,7 @@
+         cmdline = [self.name] + raise_opt + args
+ 
+         if remote or self.background:
+-            inout = io.open(os.devnull, "r+")
++            inout = subprocess.DEVNULL
+         else:
+             # for TTY browsers, we need stdin/out
+             inout = None
+@@ -264,6 +270,7 @@
+ 
+         args = [arg.replace("%s", url).replace("%action", action)
+                 for arg in self.remote_args]
++        args = [arg for arg in args if arg]
+         success = self._invoke(args, True, autoraise)
+         if not success:
+             # remote invocation failed, try straight way
+@@ -347,7 +354,7 @@
+         else:
+             action = "openURL"
+ 
+-        devnull = io.open(os.devnull, "r+")
++        devnull = subprocess.DEVNULL
+         # if possible, put browser in separate process group, so
+         # keyboard interrupts don't affect browser as well as Python
+         setsid = getattr(os, 'setsid', None)
+diff -r bd8afb90ebf2 Lib/wsgiref/handlers.py
+--- a/Lib/wsgiref/handlers.py
++++ b/Lib/wsgiref/handlers.py
+@@ -174,11 +174,13 @@
+         in the event loop to iterate over the data, and to call
+         'self.close()' once the response is finished.
+         """
+-        if not self.result_is_file() or not self.sendfile():
+-            for data in self.result:
+-                self.write(data)
+-            self.finish_content()
+-        self.close()
++        try:
++            if not self.result_is_file() or not self.sendfile():
++                for data in self.result:
++                    self.write(data)
++                self.finish_content()
++        finally:
++            self.close()
+ 
+ 
+     def get_scheme(self):
+diff -r bd8afb90ebf2 Lib/wsgiref/validate.py
+--- a/Lib/wsgiref/validate.py
++++ b/Lib/wsgiref/validate.py
+@@ -139,9 +139,9 @@
+     When applied between a WSGI server and a WSGI application, this
+     middleware will check for WSGI compliancy on a number of levels.
+     This middleware does not modify the request or response in any
+-    way, but will throw an AssertionError if anything seems off
++    way, but will raise an AssertionError if anything seems off
+     (except for a failure to close the application iterator, which
+-    will be printed to stderr -- there's no way to throw an exception
++    will be printed to stderr -- there's no way to raise an exception
+     at that point).
+     """
+ 
+diff -r bd8afb90ebf2 Lib/xdrlib.py
+--- a/Lib/xdrlib.py
++++ b/Lib/xdrlib.py
+@@ -13,7 +13,7 @@
+ class Error(Exception):
+     """Exception class for this module. Use:
+ 
+-    except xdrlib.Error, var:
++    except xdrlib.Error as var:
+         # var has the Error instance for the exception
+ 
+     Public ivars:
+diff -r bd8afb90ebf2 Lib/xml/dom/minidom.py
+--- a/Lib/xml/dom/minidom.py
++++ b/Lib/xml/dom/minidom.py
+@@ -1,5 +1,6 @@
+-"""\
+-minidom.py -- a lightweight DOM implementation.
++"""Simple implementation of the Level 1 DOM.
++
++Namespaces and other minor Level 2 features are also supported.
+ 
+ parse("foo.xml")
+ 
+diff -r bd8afb90ebf2 Lib/xml/etree/ElementTree.py
+--- a/Lib/xml/etree/ElementTree.py
++++ b/Lib/xml/etree/ElementTree.py
+@@ -303,7 +303,9 @@
+         self._children.insert(index, element)
+ 
+     def _assert_is_element(self, e):
+-        if not isinstance(e, Element):
++        # Need to refer to the actual Python implementation, not the
++        # shadowing C implementation.
++        if not isinstance(e, _Element):
+             raise TypeError('expected an Element, not %s' % type(e).__name__)
+ 
+     ##
+@@ -787,11 +789,12 @@
+     # @param **options Options, given as keyword arguments.
+     # @keyparam encoding Optional output encoding (default is US-ASCII).
+     #     Use "unicode" to return a Unicode string.
+-    # @keyparam method Optional output method ("xml", "html", "text" or
+-    #     "c14n"; default is "xml").
+     # @keyparam xml_declaration Controls if an XML declaration should
+     #     be added to the file.  Use False for never, True for always,
+     #     None for only if not US-ASCII or UTF-8 or Unicode.  None is default.
++    # @keyparam default_namespace Sets the default XML namespace (for "xmlns").
++    # @keyparam method Optional output method ("xml", "html", "text" or
++    #     "c14n"; default is "xml").
+ 
+     def write(self, file_or_filename,
+               encoding=None,
+@@ -995,7 +998,7 @@
+         write(_escape_cdata(elem.tail))
+ 
+ HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr",
+-              "img", "input", "isindex", "link", "meta" "param")
++              "img", "input", "isindex", "link", "meta", "param")
+ 
+ try:
+     HTML_EMPTY = set(HTML_EMPTY)
+@@ -1734,8 +1737,20 @@
+                     source.close()
+ 
+     class iterparse:
++        """Parses an XML section into an element tree incrementally.
++
++        Reports what’s going on to the user. 'source' is a filename or file
++        object containing XML data. 'events' is a list of events to report back.
++        The supported events are the strings "start", "end", "start-ns" and
++        "end-ns" (the "ns" events are used to get detailed namespace
++        information). If 'events' is omitted, only "end" events are reported.
++        'parser' is an optional parser instance. If not given, the standard
++        XMLParser parser is used. Returns an iterator providing
++        (event, elem) pairs.
++        """
++
+         root = None
+-        def __init__(self, file, events=None):
++        def __init__(self, file, events=None, parser=None):
+             self._close_file = False
+             if not hasattr(file, 'read'):
+                 file = open(file, 'rb')
+@@ -1745,8 +1760,9 @@
+             self._index = 0
+             self._error = None
+             self.root = self._root = None
+-            b = TreeBuilder()
+-            self._parser = XMLParser(b)
++            if parser is None:
++                parser = XMLParser(target=TreeBuilder())
++            self._parser = parser
+             self._parser._setevents(self._events, events)
+ 
+         def __next__(self):
+diff -r bd8afb90ebf2 Lib/xml/sax/_exceptions.py
+--- a/Lib/xml/sax/_exceptions.py
++++ b/Lib/xml/sax/_exceptions.py
+@@ -12,7 +12,7 @@
+     the application: you can subclass it to provide additional
+     functionality, or to add localization. Note that although you will
+     receive a SAXException as the argument to the handlers in the
+-    ErrorHandler interface, you are not actually required to throw
++    ErrorHandler interface, you are not actually required to raise
+     the exception; instead, you can simply read the information in
+     it."""
+ 
+@@ -50,7 +50,7 @@
+     the original XML document. Note that although the application will
+     receive a SAXParseException as the argument to the handlers in the
+     ErrorHandler interface, the application is not actually required
+-    to throw the exception; instead, it can simply read the
++    to raise the exception; instead, it can simply read the
+     information in it and take a different action.
+ 
+     Since this exception is a subclass of SAXException, it inherits
+@@ -62,7 +62,7 @@
+         self._locator = locator
+ 
+         # We need to cache this stuff at construction time.
+-        # If this exception is thrown, the objects through which we must
++        # If this exception is raised, the objects through which we must
+         # traverse to get this information may be deleted by the time
+         # it gets caught.
+         self._systemId = self._locator.getSystemId()
+diff -r bd8afb90ebf2 Lib/xml/sax/saxutils.py
+--- a/Lib/xml/sax/saxutils.py
++++ b/Lib/xml/sax/saxutils.py
+@@ -4,18 +4,10 @@
+ """
+ 
+ import os, urllib.parse, urllib.request
++import io
+ from . import handler
+ from . import xmlreader
+ 
+-# See whether the xmlcharrefreplace error handler is
+-# supported
+-try:
+-    from codecs import xmlcharrefreplace_errors
+-    _error_handling = "xmlcharrefreplace"
+-    del xmlcharrefreplace_errors
+-except ImportError:
+-    _error_handling = "strict"
+-
+ def __dict_replace(s, d):
+     """Replace substrings of a string using a dictionary."""
+     for key, value in d.items():
+@@ -76,14 +68,50 @@
+     return data
+ 
+ 
++def _gettextwriter(out, encoding):
++    if out is None:
++        import sys
++        return sys.stdout
++
++    if isinstance(out, io.TextIOBase):
++        # use a text writer as is
++        return out
++
++    # wrap a binary writer with TextIOWrapper
++    if isinstance(out, io.RawIOBase):
++        # Keep the original file open when the TextIOWrapper is
++        # destroyed
++        class _wrapper:
++            __class__ = out.__class__
++            def __getattr__(self, name):
++                return getattr(out, name)
++        buffer = _wrapper()
++        buffer.close = lambda: None
++    else:
++        # This is to handle passed objects that aren't in the
++        # IOBase hierarchy, but just have a write method
++        buffer = io.BufferedIOBase()
++        buffer.writable = lambda: True
++        buffer.write = out.write
++        try:
++            # TextIOWrapper uses this methods to determine
++            # if BOM (for UTF-16, etc) should be added
++            buffer.seekable = out.seekable
++            buffer.tell = out.tell
++        except AttributeError:
++            pass
++    return io.TextIOWrapper(buffer, encoding=encoding,
++                            errors='xmlcharrefreplace',
++                            newline='\n',
++                            write_through=True)
++
+ class XMLGenerator(handler.ContentHandler):
+ 
+     def __init__(self, out=None, encoding="iso-8859-1", short_empty_elements=False):
+-        if out is None:
+-            import sys
+-            out = sys.stdout
+         handler.ContentHandler.__init__(self)
+-        self._out = out
++        out = _gettextwriter(out, encoding)
++        self._write = out.write
++        self._flush = out.flush
+         self._ns_contexts = [{}] # contains uri -> prefix dicts
+         self._current_context = self._ns_contexts[-1]
+         self._undeclared_ns_maps = []
+@@ -91,12 +119,6 @@
+         self._short_empty_elements = short_empty_elements
+         self._pending_start_element = False
+ 
+-    def _write(self, text):
+-        if isinstance(text, str):
+-            self._out.write(text)
+-        else:
+-            self._out.write(text.encode(self._encoding, _error_handling))
+-
+     def _qname(self, name):
+         """Builds a qualified name from a (ns_url, localname) pair"""
+         if name[0]:
+@@ -125,6 +147,9 @@
+         self._write('<?xml version="1.0" encoding="%s"?>\n' %
+                         self._encoding)
+ 
++    def endDocument(self):
++        self._flush()
++
+     def startPrefixMapping(self, prefix, uri):
+         self._ns_contexts.append(self._current_context.copy())
+         self._current_context[uri] = prefix
+@@ -157,9 +182,9 @@
+ 
+         for prefix, uri in self._undeclared_ns_maps:
+             if prefix:
+-                self._out.write(' xmlns:%s="%s"' % (prefix, uri))
++                self._write(' xmlns:%s="%s"' % (prefix, uri))
+             else:
+-                self._out.write(' xmlns="%s"' % uri)
++                self._write(' xmlns="%s"' % uri)
+         self._undeclared_ns_maps = []
+ 
+         for (name, value) in attrs.items():
+diff -r bd8afb90ebf2 Lib/xml/sax/xmlreader.py
+--- a/Lib/xml/sax/xmlreader.py
++++ b/Lib/xml/sax/xmlreader.py
+@@ -68,7 +68,7 @@
+ 
+         SAX parsers are not required to provide localization for errors
+         and warnings; if they cannot support the requested locale,
+-        however, they must throw a SAX exception. Applications may
++        however, they must raise a SAX exception. Applications may
+         request a locale change in the middle of a parse."""
+         raise SAXNotSupportedException("Locale support not implemented")
+ 
+diff -r bd8afb90ebf2 Lib/xmlrpc/client.py
+--- a/Lib/xmlrpc/client.py
++++ b/Lib/xmlrpc/client.py
+@@ -811,7 +811,7 @@
+ 
+ class MultiCallIterator:
+     """Iterates over the results of a multicall. Exceptions are
+-    thrown in response to xmlrpc faults."""
++    raised in response to xmlrpc faults."""
+ 
+     def __init__(self, results):
+         self.results = results
+diff -r bd8afb90ebf2 Lib/zipfile.py
+--- a/Lib/zipfile.py
++++ b/Lib/zipfile.py
+@@ -196,6 +196,8 @@
+         return endrec
+ 
+     data = fpin.read(sizeEndCentDir64Locator)
++    if len(data) != sizeEndCentDir64Locator:
++        return endrec
+     sig, diskno, reloff, disks = struct.unpack(structEndArchive64Locator, data)
+     if sig != stringEndArchive64Locator:
+         return endrec
+@@ -206,6 +208,8 @@
+     # Assume no 'zip64 extensible data'
+     fpin.seek(offset - sizeEndCentDir64Locator - sizeEndCentDir64, 2)
+     data = fpin.read(sizeEndCentDir64)
++    if len(data) != sizeEndCentDir64:
++        return endrec
+     sig, sz, create_version, read_version, disk_num, disk_dir, \
+             dircount, dircount2, dirsize, diroffset = \
+             struct.unpack(structEndArchive64, data)
+@@ -241,7 +245,9 @@
+     except IOError:
+         return None
+     data = fpin.read()
+-    if data[0:4] == stringEndArchive and data[-2:] == b"\000\000":
++    if (len(data) == sizeEndCentDir and
++        data[0:4] == stringEndArchive and
++        data[-2:] == b"\000\000"):
+         # the signature is correct and there's no comment, unpack structure
+         endrec = struct.unpack(structEndArchive, data)
+         endrec=list(endrec)
+@@ -265,6 +271,9 @@
+     if start >= 0:
+         # found the magic number; attempt to unpack and interpret
+         recData = data[start:start+sizeEndCentDir]
++        if len(recData) != sizeEndCentDir:
++            # Zip file is corrupted.
++            return None
+         endrec = list(struct.unpack(structEndArchive, recData))
+         commentSize = endrec[_ECD_COMMENT_SIZE] #as claimed by the zip file
+         comment = data[start+sizeEndCentDir:start+sizeEndCentDir+commentSize]
+@@ -276,7 +285,7 @@
+                              endrec)
+ 
+     # Unable to find a valid end of central directory structure
+-    return
++    return None
+ 
+ 
+ class ZipInfo (object):
+@@ -346,7 +355,7 @@
+         # compress_size         Size of the compressed file
+         # file_size             Size of the uncompressed file
+ 
+-    def FileHeader(self):
++    def FileHeader(self, zip64=None):
+         """Return the per-file header as a string."""
+         dt = self.date_time
+         dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2]
+@@ -362,12 +371,17 @@
+         extra = self.extra
+ 
+         min_version = 0
+-        if file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT:
+-            # File is larger than what fits into a 4 byte integer,
+-            # fall back to the ZIP64 extension
++        if zip64 is None:
++            zip64 = file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT
++        if zip64:
+             fmt = '<HHQQ'
+             extra = extra + struct.pack(fmt,
+                     1, struct.calcsize(fmt)-4, file_size, compress_size)
++        if file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT:
++            if not zip64:
++                raise LargeZipFile("Filesize would require ZIP64 extensions")
++            # File is larger than what fits into a 4 byte integer,
++            # fall back to the ZIP64 extension
+             file_size = 0xffffffff
+             compress_size = 0xffffffff
+             min_version = ZIP64_VERSION
+@@ -869,6 +883,7 @@
+     """
+ 
+     fp = None                   # Set here since __del__ checks it
++    _windows_illegal_name_trans_table = None
+ 
+     def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=False):
+         """Open the ZIP file with mode read "r", write "w" or append "a"."""
+@@ -906,30 +921,34 @@
+             self.fp = file
+             self.filename = getattr(file, 'name', None)
+ 
+-        if key == 'r':
+-            self._GetContents()
+-        elif key == 'w':
+-            # set the modified flag so central directory gets written
+-            # even if no files are added to the archive
+-            self._didModify = True
+-        elif key == 'a':
+-            try:
+-                # See if file is a zip file
++        try:
++            if key == 'r':
+                 self._RealGetContents()
+-                # seek to start of directory and overwrite
+-                self.fp.seek(self.start_dir, 0)
+-            except BadZipFile:
+-                # file is not a zip file, just append
+-                self.fp.seek(0, 2)
+-
++            elif key == 'w':
+                 # set the modified flag so central directory gets written
+                 # even if no files are added to the archive
+                 self._didModify = True
+-        else:
++            elif key == 'a':
++                try:
++                    # See if file is a zip file
++                    self._RealGetContents()
++                    # seek to start of directory and overwrite
++                    self.fp.seek(self.start_dir, 0)
++                except BadZipFile:
++                    # file is not a zip file, just append
++                    self.fp.seek(0, 2)
++
++                    # set the modified flag so central directory gets written
++                    # even if no files are added to the archive
++                    self._didModify = True
++            else:
++                raise RuntimeError('Mode must be "r", "w" or "a"')
++        except:
++            fp = self.fp
++            self.fp = None
+             if not self._filePassed:
+-                self.fp.close()
+-                self.fp = None
+-            raise RuntimeError('Mode must be "r", "w" or "a"')
++                fp.close()
++            raise
+ 
+     def __enter__(self):
+         return self
+@@ -937,17 +956,6 @@
+     def __exit__(self, type, value, traceback):
+         self.close()
+ 
+-    def _GetContents(self):
+-        """Read the directory, making sure we close the file if the format
+-        is bad."""
+-        try:
+-            self._RealGetContents()
+-        except BadZipFile:
+-            if not self._filePassed:
+-                self.fp.close()
+-                self.fp = None
+-            raise
+-
+     def _RealGetContents(self):
+         """Read in the table of contents for the ZIP file."""
+         fp = self.fp
+@@ -980,9 +988,11 @@
+         total = 0
+         while total < size_cd:
+             centdir = fp.read(sizeCentralDir)
+-            if centdir[0:4] != stringCentralDir:
++            if len(centdir) != sizeCentralDir:
++                raise BadZipFile("Truncated central directory")
++            centdir = struct.unpack(structCentralDir, centdir)
++            if centdir[_CD_SIGNATURE] != stringCentralDir:
+                 raise BadZipFile("Bad magic number for central directory")
+-            centdir = struct.unpack(structCentralDir, centdir)
+             if self.debug > 2:
+                 print(centdir)
+             filename = fp.read(centdir[_CD_FILENAME_LENGTH])
+@@ -1049,9 +1059,9 @@
+             try:
+                 # Read by chunks, to avoid an OverflowError or a
+                 # MemoryError with very large embedded files.
+-                f = self.open(zinfo.filename, "r")
+-                while f.read(chunk_size):     # Check CRC-32
+-                    pass
++                with self.open(zinfo.filename, "r") as f:
++                    while f.read(chunk_size):     # Check CRC-32
++                        pass
+             except BadZipFile:
+                 return zinfo.filename
+ 
+@@ -1113,84 +1123,80 @@
+         else:
+             zef_file = io.open(self.filename, 'rb')
+ 
+-        # Make sure we have an info object
+-        if isinstance(name, ZipInfo):
+-            # 'name' is already an info object
+-            zinfo = name
+-        else:
+-            # Get info object for name
+-            try:
++        try:
++            # Make sure we have an info object
++            if isinstance(name, ZipInfo):
++                # 'name' is already an info object
++                zinfo = name
++            else:
++                # Get info object for name
+                 zinfo = self.getinfo(name)
+-            except KeyError:
+-                if not self._filePassed:
+-                    zef_file.close()
+-                raise
+-        zef_file.seek(zinfo.header_offset, 0)
++            zef_file.seek(zinfo.header_offset, 0)
+ 
+-        # Skip the file header:
+-        fheader = zef_file.read(sizeFileHeader)
+-        if fheader[0:4] != stringFileHeader:
+-            raise BadZipFile("Bad magic number for file header")
++            # Skip the file header:
++            fheader = zef_file.read(sizeFileHeader)
++            if len(fheader) != sizeFileHeader:
++                raise BadZipFile("Truncated file header")
++            fheader = struct.unpack(structFileHeader, fheader)
++            if fheader[_FH_SIGNATURE] != stringFileHeader:
++                raise BadZipFile("Bad magic number for file header")
+ 
+-        fheader = struct.unpack(structFileHeader, fheader)
+-        fname = zef_file.read(fheader[_FH_FILENAME_LENGTH])
+-        if fheader[_FH_EXTRA_FIELD_LENGTH]:
+-            zef_file.read(fheader[_FH_EXTRA_FIELD_LENGTH])
++            fname = zef_file.read(fheader[_FH_FILENAME_LENGTH])
++            if fheader[_FH_EXTRA_FIELD_LENGTH]:
++                zef_file.read(fheader[_FH_EXTRA_FIELD_LENGTH])
+ 
+-        if zinfo.flag_bits & 0x20:
+-            # Zip 2.7: compressed patched data
+-            raise NotImplementedError("compressed patched data (flag bit 5)")
++            if zinfo.flag_bits & 0x20:
++                # Zip 2.7: compressed patched data
++                raise NotImplementedError("compressed patched data (flag bit 5)")
+ 
+-        if zinfo.flag_bits & 0x40:
+-            # strong encryption
+-            raise NotImplementedError("strong encryption (flag bit 6)")
++            if zinfo.flag_bits & 0x40:
++                # strong encryption
++                raise NotImplementedError("strong encryption (flag bit 6)")
+ 
+-        if zinfo.flag_bits & 0x800:
+-            # UTF-8 filename
+-            fname_str = fname.decode("utf-8")
+-        else:
+-            fname_str = fname.decode("cp437")
++            if zinfo.flag_bits & 0x800:
++                # UTF-8 filename
++                fname_str = fname.decode("utf-8")
++            else:
++                fname_str = fname.decode("cp437")
+ 
+-        if fname_str != zinfo.orig_filename:
++            if fname_str != zinfo.orig_filename:
++                raise BadZipFile(
++                    'File name in directory %r and header %r differ.'
++                    % (zinfo.orig_filename, fname))
++
++            # check for encrypted flag & handle password
++            is_encrypted = zinfo.flag_bits & 0x1
++            zd = None
++            if is_encrypted:
++                if not pwd:
++                    pwd = self.pwd
++                if not pwd:
++                    raise RuntimeError("File %s is encrypted, password "
++                                       "required for extraction" % name)
++
++                zd = _ZipDecrypter(pwd)
++                # The first 12 bytes in the cypher stream is an encryption header
++                #  used to strengthen the algorithm. The first 11 bytes are
++                #  completely random, while the 12th contains the MSB of the CRC,
++                #  or the MSB of the file time depending on the header type
++                #  and is used to check the correctness of the password.
++                header = zef_file.read(12)
++                h = list(map(zd, header[0:12]))
++                if zinfo.flag_bits & 0x8:
++                    # compare against the file type from extended local headers
++                    check_byte = (zinfo._raw_time >> 8) & 0xff
++                else:
++                    # compare against the CRC otherwise
++                    check_byte = (zinfo.CRC >> 24) & 0xff
++                if h[11] != check_byte:
++                    raise RuntimeError("Bad password for file", name)
++
++            return ZipExtFile(zef_file, mode, zinfo, zd,
++                              close_fileobj=not self._filePassed)
++        except:
+             if not self._filePassed:
+                 zef_file.close()
+-            raise BadZipFile(
+-                  'File name in directory %r and header %r differ.'
+-                  % (zinfo.orig_filename, fname))
+-
+-        # check for encrypted flag & handle password
+-        is_encrypted = zinfo.flag_bits & 0x1
+-        zd = None
+-        if is_encrypted:
+-            if not pwd:
+-                pwd = self.pwd
+-            if not pwd:
+-                if not self._filePassed:
+-                    zef_file.close()
+-                raise RuntimeError("File %s is encrypted, "
+-                                   "password required for extraction" % name)
+-
+-            zd = _ZipDecrypter(pwd)
+-            # The first 12 bytes in the cypher stream is an encryption header
+-            #  used to strengthen the algorithm. The first 11 bytes are
+-            #  completely random, while the 12th contains the MSB of the CRC,
+-            #  or the MSB of the file time depending on the header type
+-            #  and is used to check the correctness of the password.
+-            header = zef_file.read(12)
+-            h = list(map(zd, header[0:12]))
+-            if zinfo.flag_bits & 0x8:
+-                # compare against the file type from extended local headers
+-                check_byte = (zinfo._raw_time >> 8) & 0xff
+-            else:
+-                # compare against the CRC otherwise
+-                check_byte = (zinfo.CRC >> 24) & 0xff
+-            if h[11] != check_byte:
+-                if not self._filePassed:
+-                    zef_file.close()
+-                raise RuntimeError("Bad password for file", name)
+-
+-        return ZipExtFile(zef_file, mode, zinfo, zd,
+-                          close_fileobj=not self._filePassed)
++            raise
+ 
+     def extract(self, member, path=None, pwd=None):
+         """Extract a member from the archive to the current working directory,
+@@ -1218,23 +1224,42 @@
+         for zipinfo in members:
+             self.extract(zipinfo, path, pwd)
+ 
++    @classmethod
++    def _sanitize_windows_name(cls, arcname, pathsep):
++        """Replace bad characters and remove trailing dots from parts."""
++        table = cls._windows_illegal_name_trans_table
++        if not table:
++            illegal = ':<>|"?*'
++            table = str.maketrans(illegal, '_' * len(illegal))
++            cls._windows_illegal_name_trans_table = table
++        arcname = arcname.translate(table)
++        # remove trailing dots
++        arcname = (x.rstrip('.') for x in arcname.split(pathsep))
++        # rejoin, removing empty parts.
++        arcname = pathsep.join(x for x in arcname if x)
++        return arcname
++
+     def _extract_member(self, member, targetpath, pwd):
+         """Extract the ZipInfo object 'member' to a physical
+            file on the path targetpath.
+         """
+         # build the destination pathname, replacing
+         # forward slashes to platform specific separators.
+-        # Strip trailing path separator, unless it represents the root.
+-        if (targetpath[-1:] in (os.path.sep, os.path.altsep)
+-            and len(os.path.splitdrive(targetpath)[1]) > 1):
+-            targetpath = targetpath[:-1]
++        arcname = member.filename.replace('/', os.path.sep)
+ 
+-        # don't include leading "/" from file name if present
+-        if member.filename[0] == '/':
+-            targetpath = os.path.join(targetpath, member.filename[1:])
+-        else:
+-            targetpath = os.path.join(targetpath, member.filename)
++        if os.path.altsep:
++            arcname = arcname.replace(os.path.altsep, os.path.sep)
++        # interpret absolute pathname as relative, remove drive letter or
++        # UNC path, redundant separators, "." and ".." components.
++        arcname = os.path.splitdrive(arcname)[1]
++        invalid_path_parts = ('', os.path.curdir, os.path.pardir)
++        arcname = os.path.sep.join(x for x in arcname.split(os.path.sep)
++                                   if x not in invalid_path_parts)
++        if os.path.sep == '\\':
++            # filter illegal characters on Windows
++            arcname = self._sanitize_windows_name(arcname, os.path.sep)
+ 
++        targetpath = os.path.join(targetpath, arcname)
+         targetpath = os.path.normpath(targetpath)
+ 
+         # Create all upper directories if necessary.
+@@ -1247,11 +1272,9 @@
+                 os.mkdir(targetpath)
+             return targetpath
+ 
+-        source = self.open(member, pwd=pwd)
+-        target = open(targetpath, "wb")
+-        shutil.copyfileobj(source, target)
+-        source.close()
+-        target.close()
++        with self.open(member, pwd=pwd) as source, \
++             open(targetpath, "wb") as target:
++            shutil.copyfileobj(source, target)
+ 
+         return targetpath
+ 
+@@ -1316,7 +1339,7 @@
+             zinfo.CRC = 0
+             self.filelist.append(zinfo)
+             self.NameToInfo[zinfo.filename] = zinfo
+-            self.fp.write(zinfo.FileHeader())
++            self.fp.write(zinfo.FileHeader(False))
+             return
+ 
+         cmpr = _get_compressor(zinfo.compress_type)
+@@ -1324,8 +1347,11 @@
+             # Must overwrite CRC and sizes with correct data later
+             zinfo.CRC = CRC = 0
+             zinfo.compress_size = compress_size = 0
+-            zinfo.file_size = file_size = 0
+-            self.fp.write(zinfo.FileHeader())
++            # Compressed size can be larger than uncompressed size
++            zip64 = self._allowZip64 and \
++                    zinfo.file_size * 1.05 > ZIP64_LIMIT
++            self.fp.write(zinfo.FileHeader(zip64))
++            file_size = 0
+             while 1:
+                 buf = fp.read(1024 * 8)
+                 if not buf:
+@@ -1345,11 +1371,16 @@
+             zinfo.compress_size = file_size
+         zinfo.CRC = CRC
+         zinfo.file_size = file_size
+-        # Seek backwards and write CRC and file sizes
++        if not zip64 and self._allowZip64:
++            if file_size > ZIP64_LIMIT:
++                raise RuntimeError('File size has increased during compressing')
++            if compress_size > ZIP64_LIMIT:
++                raise RuntimeError('Compressed size larger than uncompressed size')
++        # Seek backwards and write file header (which will now include
++        # correct CRC and file sizes)
+         position = self.fp.tell()       # Preserve current position in file
+-        self.fp.seek(zinfo.header_offset + 14, 0)
+-        self.fp.write(struct.pack("<LLL", zinfo.CRC, zinfo.compress_size,
+-              zinfo.file_size))
++        self.fp.seek(zinfo.header_offset, 0)
++        self.fp.write(zinfo.FileHeader(zip64))
+         self.fp.seek(position, 0)
+         self.filelist.append(zinfo)
+         self.NameToInfo[zinfo.filename] = zinfo
+@@ -1391,14 +1422,18 @@
+             zinfo.compress_size = len(data)    # Compressed size
+         else:
+             zinfo.compress_size = zinfo.file_size
+-        zinfo.header_offset = self.fp.tell()    # Start of header data
+-        self.fp.write(zinfo.FileHeader())
++        zip64 = zinfo.file_size > ZIP64_LIMIT or \
++                zinfo.compress_size > ZIP64_LIMIT
++        if zip64 and not self._allowZip64:
++            raise LargeZipFile("Filesize would require ZIP64 extensions")
++        self.fp.write(zinfo.FileHeader(zip64))
+         self.fp.write(data)
+-        self.fp.flush()
+         if zinfo.flag_bits & 0x08:
+             # Write CRC and file sizes after the file data
+-            self.fp.write(struct.pack("<LLL", zinfo.CRC, zinfo.compress_size,
++            fmt = '<LQQ' if zip64 else '<LLL'
++            self.fp.write(struct.pack(fmt, zinfo.CRC, zinfo.compress_size,
+                   zinfo.file_size))
++        self.fp.flush()
+         self.filelist.append(zinfo)
+         self.NameToInfo[zinfo.filename] = zinfo
+ 
+@@ -1412,105 +1447,107 @@
+         if self.fp is None:
+             return
+ 
+-        if self.mode in ("w", "a") and self._didModify: # write ending records
+-            count = 0
+-            pos1 = self.fp.tell()
+-            for zinfo in self.filelist:         # write central directory
+-                count = count + 1
+-                dt = zinfo.date_time
+-                dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2]
+-                dostime = dt[3] << 11 | dt[4] << 5 | (dt[5] // 2)
+-                extra = []
+-                if zinfo.file_size > ZIP64_LIMIT \
+-                        or zinfo.compress_size > ZIP64_LIMIT:
+-                    extra.append(zinfo.file_size)
+-                    extra.append(zinfo.compress_size)
+-                    file_size = 0xffffffff
+-                    compress_size = 0xffffffff
+-                else:
+-                    file_size = zinfo.file_size
+-                    compress_size = zinfo.compress_size
++        try:
++            if self.mode in ("w", "a") and self._didModify: # write ending records
++                count = 0
++                pos1 = self.fp.tell()
++                for zinfo in self.filelist:         # write central directory
++                    count = count + 1
++                    dt = zinfo.date_time
++                    dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2]
++                    dostime = dt[3] << 11 | dt[4] << 5 | (dt[5] // 2)
++                    extra = []
++                    if zinfo.file_size > ZIP64_LIMIT \
++                            or zinfo.compress_size > ZIP64_LIMIT:
++                        extra.append(zinfo.file_size)
++                        extra.append(zinfo.compress_size)
++                        file_size = 0xffffffff
++                        compress_size = 0xffffffff
++                    else:
++                        file_size = zinfo.file_size
++                        compress_size = zinfo.compress_size
+ 
+-                if zinfo.header_offset > ZIP64_LIMIT:
+-                    extra.append(zinfo.header_offset)
+-                    header_offset = 0xffffffff
+-                else:
+-                    header_offset = zinfo.header_offset
++                    if zinfo.header_offset > ZIP64_LIMIT:
++                        extra.append(zinfo.header_offset)
++                        header_offset = 0xffffffff
++                    else:
++                        header_offset = zinfo.header_offset
+ 
+-                extra_data = zinfo.extra
+-                min_version = 0
+-                if extra:
+-                    # Append a ZIP64 field to the extra's
+-                    extra_data = struct.pack(
+-                            '<HH' + 'Q'*len(extra),
+-                            1, 8*len(extra), *extra) + extra_data
++                    extra_data = zinfo.extra
++                    min_version = 0
++                    if extra:
++                        # Append a ZIP64 field to the extra's
++                        extra_data = struct.pack(
++                                '<HH' + 'Q'*len(extra),
++                                1, 8*len(extra), *extra) + extra_data
+ 
+-                    min_version = ZIP64_VERSION
++                        min_version = ZIP64_VERSION
+ 
+-                if zinfo.compress_type == ZIP_BZIP2:
+-                    min_version = max(BZIP2_VERSION, min_version)
+-                elif zinfo.compress_type == ZIP_LZMA:
+-                    min_version = max(LZMA_VERSION, min_version)
++                    if zinfo.compress_type == ZIP_BZIP2:
++                        min_version = max(BZIP2_VERSION, min_version)
++                    elif zinfo.compress_type == ZIP_LZMA:
++                        min_version = max(LZMA_VERSION, min_version)
+ 
+-                extract_version = max(min_version, zinfo.extract_version)
+-                create_version = max(min_version, zinfo.create_version)
+-                try:
+-                    filename, flag_bits = zinfo._encodeFilenameFlags()
+-                    centdir = struct.pack(structCentralDir,
+-                        stringCentralDir, create_version,
+-                        zinfo.create_system, extract_version, zinfo.reserved,
+-                        flag_bits, zinfo.compress_type, dostime, dosdate,
+-                        zinfo.CRC, compress_size, file_size,
+-                        len(filename), len(extra_data), len(zinfo.comment),
+-                        0, zinfo.internal_attr, zinfo.external_attr,
+-                        header_offset)
+-                except DeprecationWarning:
+-                    print((structCentralDir, stringCentralDir, create_version,
+-                        zinfo.create_system, extract_version, zinfo.reserved,
+-                        zinfo.flag_bits, zinfo.compress_type, dostime, dosdate,
+-                        zinfo.CRC, compress_size, file_size,
+-                        len(zinfo.filename), len(extra_data), len(zinfo.comment),
+-                        0, zinfo.internal_attr, zinfo.external_attr,
+-                        header_offset), file=sys.stderr)
+-                    raise
+-                self.fp.write(centdir)
+-                self.fp.write(filename)
+-                self.fp.write(extra_data)
+-                self.fp.write(zinfo.comment)
++                    extract_version = max(min_version, zinfo.extract_version)
++                    create_version = max(min_version, zinfo.create_version)
++                    try:
++                        filename, flag_bits = zinfo._encodeFilenameFlags()
++                        centdir = struct.pack(structCentralDir,
++                            stringCentralDir, create_version,
++                            zinfo.create_system, extract_version, zinfo.reserved,
++                            flag_bits, zinfo.compress_type, dostime, dosdate,
++                            zinfo.CRC, compress_size, file_size,
++                            len(filename), len(extra_data), len(zinfo.comment),
++                            0, zinfo.internal_attr, zinfo.external_attr,
++                            header_offset)
++                    except DeprecationWarning:
++                        print((structCentralDir, stringCentralDir, create_version,
++                            zinfo.create_system, extract_version, zinfo.reserved,
++                            zinfo.flag_bits, zinfo.compress_type, dostime, dosdate,
++                            zinfo.CRC, compress_size, file_size,
++                            len(zinfo.filename), len(extra_data), len(zinfo.comment),
++                            0, zinfo.internal_attr, zinfo.external_attr,
++                            header_offset), file=sys.stderr)
++                        raise
++                    self.fp.write(centdir)
++                    self.fp.write(filename)
++                    self.fp.write(extra_data)
++                    self.fp.write(zinfo.comment)
+ 
+-            pos2 = self.fp.tell()
+-            # Write end-of-zip-archive record
+-            centDirCount = count
+-            centDirSize = pos2 - pos1
+-            centDirOffset = pos1
+-            if (centDirCount >= ZIP_FILECOUNT_LIMIT or
+-                centDirOffset > ZIP64_LIMIT or
+-                centDirSize > ZIP64_LIMIT):
+-                # Need to write the ZIP64 end-of-archive records
+-                zip64endrec = struct.pack(
+-                        structEndArchive64, stringEndArchive64,
+-                        44, 45, 45, 0, 0, centDirCount, centDirCount,
+-                        centDirSize, centDirOffset)
+-                self.fp.write(zip64endrec)
++                pos2 = self.fp.tell()
++                # Write end-of-zip-archive record
++                centDirCount = count
++                centDirSize = pos2 - pos1
++                centDirOffset = pos1
++                if (centDirCount >= ZIP_FILECOUNT_LIMIT or
++                    centDirOffset > ZIP64_LIMIT or
++                    centDirSize > ZIP64_LIMIT):
++                    # Need to write the ZIP64 end-of-archive records
++                    zip64endrec = struct.pack(
++                            structEndArchive64, stringEndArchive64,
++                            44, 45, 45, 0, 0, centDirCount, centDirCount,
++                            centDirSize, centDirOffset)
++                    self.fp.write(zip64endrec)
+ 
+-                zip64locrec = struct.pack(
+-                        structEndArchive64Locator,
+-                        stringEndArchive64Locator, 0, pos2, 1)
+-                self.fp.write(zip64locrec)
+-                centDirCount = min(centDirCount, 0xFFFF)
+-                centDirSize = min(centDirSize, 0xFFFFFFFF)
+-                centDirOffset = min(centDirOffset, 0xFFFFFFFF)
++                    zip64locrec = struct.pack(
++                            structEndArchive64Locator,
++                            stringEndArchive64Locator, 0, pos2, 1)
++                    self.fp.write(zip64locrec)
++                    centDirCount = min(centDirCount, 0xFFFF)
++                    centDirSize = min(centDirSize, 0xFFFFFFFF)
++                    centDirOffset = min(centDirOffset, 0xFFFFFFFF)
+ 
+-            endrec = struct.pack(structEndArchive, stringEndArchive,
+-                                 0, 0, centDirCount, centDirCount,
+-                                 centDirSize, centDirOffset, len(self._comment))
+-            self.fp.write(endrec)
+-            self.fp.write(self._comment)
+-            self.fp.flush()
+-
+-        if not self._filePassed:
+-            self.fp.close()
+-        self.fp = None
++                endrec = struct.pack(structEndArchive, stringEndArchive,
++                                    0, 0, centDirCount, centDirCount,
++                                    centDirSize, centDirOffset, len(self._comment))
++                self.fp.write(endrec)
++                self.fp.write(self._comment)
++                self.fp.flush()
++        finally:
++            fp = self.fp
++            self.fp = None
++            if not self._filePassed:
++                fp.close()
+ 
+ 
+ class PyZipFile(ZipFile):
+@@ -1600,7 +1637,7 @@
+                 print("Compiling", file)
+             try:
+                 py_compile.compile(file, doraise=True, optimize=optimize)
+-            except py_compile.PyCompileError as error:
++            except py_compile.PyCompileError as err:
+                 print(err.msg)
+                 return False
+             return True
+@@ -1677,16 +1714,15 @@
+         if len(args) != 2:
+             print(USAGE)
+             sys.exit(1)
+-        zf = ZipFile(args[1], 'r')
+-        zf.printdir()
+-        zf.close()
++        with ZipFile(args[1], 'r') as zf:
++            zf.printdir()
+ 
+     elif args[0] == '-t':
+         if len(args) != 2:
+             print(USAGE)
+             sys.exit(1)
+-        zf = ZipFile(args[1], 'r')
+-        badfile = zf.testzip()
++        with ZipFile(args[1], 'r') as zf:
++            badfile = zf.testzip()
+         if badfile:
+             print("The following enclosed file is corrupted: {!r}".format(badfile))
+         print("Done testing")
+@@ -1696,20 +1732,19 @@
+             print(USAGE)
+             sys.exit(1)
+ 
+-        zf = ZipFile(args[1], 'r')
+-        out = args[2]
+-        for path in zf.namelist():
+-            if path.startswith('./'):
+-                tgt = os.path.join(out, path[2:])
+-            else:
+-                tgt = os.path.join(out, path)
++        with ZipFile(args[1], 'r') as zf:
++            out = args[2]
++            for path in zf.namelist():
++                if path.startswith('./'):
++                    tgt = os.path.join(out, path[2:])
++                else:
++                    tgt = os.path.join(out, path)
+ 
+-            tgtdir = os.path.dirname(tgt)
+-            if not os.path.exists(tgtdir):
+-                os.makedirs(tgtdir)
+-            with open(tgt, 'wb') as fp:
+-                fp.write(zf.read(path))
+-        zf.close()
++                tgtdir = os.path.dirname(tgt)
++                if not os.path.exists(tgtdir):
++                    os.makedirs(tgtdir)
++                with open(tgt, 'wb') as fp:
++                    fp.write(zf.read(path))
+ 
+     elif args[0] == '-c':
+         if len(args) < 3:
+@@ -1725,11 +1760,9 @@
+                             os.path.join(path, nm), os.path.join(zippath, nm))
+             # else: ignore
+ 
+-        zf = ZipFile(args[1], 'w', allowZip64=True)
+-        for src in args[2:]:
+-            addToZip(zf, src, os.path.basename(src))
+-
+-        zf.close()
++        with ZipFile(args[1], 'w', allowZip64=True) as zf:
++            for src in args[2:]:
++                addToZip(zf, src, os.path.basename(src))
+ 
+ if __name__ == "__main__":
+     main()
+diff -r bd8afb90ebf2 Mac/BuildScript/build-installer.py
+--- a/Mac/BuildScript/build-installer.py
++++ b/Mac/BuildScript/build-installer.py
+@@ -192,7 +192,8 @@
+ 
+     LT_10_5 = bool(DEPTARGET < '10.5')
+ 
+-    result.extend([
++    if getVersionTuple() >= (3, 3):
++        result.extend([
+           dict(
+               name="XZ 5.0.3",
+               url="http://tukaani.org/xz/xz-5.0.3.tar.gz",
+@@ -201,6 +202,9 @@
+                     '--disable-dependency-tracking',
+               ]
+               ),
++        ])
++
++    result.extend([
+           dict(
+               name="NCurses 5.9",
+               url="http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz",
+diff -r bd8afb90ebf2 Mac/BuildScript/scripts/postflight.documentation
+--- a/Mac/BuildScript/scripts/postflight.documentation
++++ b/Mac/BuildScript/scripts/postflight.documentation
+@@ -16,7 +16,7 @@
+ 
+ # make share/doc link in framework for command line users
+ if [ -d "${SHARE_DIR}" ]; then
+-    mkdir -p "${SHARE_DOCDIR}"
++    mkdir -m 775 -p "${SHARE_DOCDIR}"
+     # make relative link to html doc directory
+     ln -fhs "${SHARE_DOCDIR_TO_FWK}/${FWK_DOCDIR_SUBPATH}" "${SHARE_DOCDIR}/html"
+ fi
+diff -r bd8afb90ebf2 Mac/IDLE/IDLE.app/Contents/Info.plist
+--- a/Mac/IDLE/IDLE.app/Contents/Info.plist
++++ b/Mac/IDLE/IDLE.app/Contents/Info.plist
+@@ -36,7 +36,7 @@
+ 	<key>CFBundleExecutable</key>
+ 	<string>IDLE</string>
+ 	<key>CFBundleGetInfoString</key>
+-	<string>%version%, © 2001-2012 Python Software Foundation</string>
++	<string>%version%, © 2001-2013 Python Software Foundation</string>
+ 	<key>CFBundleIconFile</key>
+ 	<string>IDLE.icns</string>
+ 	<key>CFBundleIdentifier</key>
+@@ -53,5 +53,7 @@
+ 	<string>????</string>
+ 	<key>CFBundleVersion</key>
+ 	<string>%version%</string>
++	<key>NSHighResolutionCapable</key>
++	<true/>
+ </dict>
+ </plist>
+diff -r bd8afb90ebf2 Mac/PythonLauncher/Info.plist.in
+--- a/Mac/PythonLauncher/Info.plist.in
++++ b/Mac/PythonLauncher/Info.plist.in
+@@ -40,7 +40,7 @@
+ 	<key>CFBundleExecutable</key>
+ 	<string>PythonLauncher</string>
+ 	<key>CFBundleGetInfoString</key>
+-	<string>%VERSION%, © 2001-2012 Python Software Foundation</string>
++	<string>%VERSION%, © 2001-2013 Python Software Foundation</string>
+ 	<key>CFBundleIconFile</key>
+ 	<string>PythonLauncher.icns</string>
+ 	<key>CFBundleIdentifier</key>
+diff -r bd8afb90ebf2 Mac/Resources/app/Info.plist.in
+--- a/Mac/Resources/app/Info.plist.in
++++ b/Mac/Resources/app/Info.plist.in
+@@ -20,7 +20,7 @@
+ 	<key>CFBundleExecutable</key>
+ 	<string>Python</string>
+ 	<key>CFBundleGetInfoString</key>
+-	<string>%version%, (c) 2004-2012 Python Software Foundation.</string>
++	<string>%version%, (c) 2004-2013 Python Software Foundation.</string>
+ 	<key>CFBundleHelpBookFolder</key>
+ 	<array>
+ 		<string>Documentation</string>
+@@ -37,7 +37,7 @@
+ 	<key>CFBundleInfoDictionaryVersion</key>
+ 	<string>6.0</string>
+ 	<key>CFBundleLongVersionString</key>
+-	<string>%version%, (c) 2004-2012 Python Software Foundation.</string>
++	<string>%version%, (c) 2004-2013 Python Software Foundation.</string>
+ 	<key>CFBundleName</key>
+ 	<string>Python</string>
+ 	<key>CFBundlePackageType</key>
+@@ -55,6 +55,8 @@
+ 	<key>NSAppleScriptEnabled</key>
+ 	<true/>
+ 	<key>NSHumanReadableCopyright</key>
+-	<string>(c) 2012 Python Software Foundation.</string>
++	<string>(c) 2013 Python Software Foundation.</string>
++	<key>NSHighResolutionCapable</key>
++	<true/>
+ </dict>
+ </plist>
+diff -r bd8afb90ebf2 Mac/Resources/framework/Info.plist.in
+--- a/Mac/Resources/framework/Info.plist.in
++++ b/Mac/Resources/framework/Info.plist.in
+@@ -17,9 +17,9 @@
+ 	<key>CFBundlePackageType</key>
+ 	<string>FMWK</string>
+ 	<key>CFBundleShortVersionString</key>
+-	<string>%VERSION%, (c) 2004-2012 Python Software Foundation.</string>
++	<string>%VERSION%, (c) 2004-2013 Python Software Foundation.</string>
+ 	<key>CFBundleLongVersionString</key>
+-	<string>%VERSION%, (c) 2004-2012 Python Software Foundation.</string>
++	<string>%VERSION%, (c) 2004-2013 Python Software Foundation.</string>
+ 	<key>CFBundleSignature</key>
+ 	<string>????</string>
+ 	<key>CFBundleVersion</key>
+diff -r bd8afb90ebf2 Makefile.pre.in
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -27,6 +27,9 @@
+ VERSION=	@VERSION@
+ srcdir=		@srcdir@
+ VPATH=		@srcdir@
++abs_srcdir=	@abs_srcdir@
++abs_builddir=	@abs_builddir@
++
+ 
+ CC=		@CC@
+ CXX=		@CXX@
+@@ -66,6 +69,7 @@
+ # Compiler options
+ OPT=		@OPT@
+ BASECFLAGS=	@BASECFLAGS@
++BASECPPFLAGS=	@BASECPPFLAGS@
+ CONFIGURE_CFLAGS=	@CFLAGS@
+ CONFIGURE_CPPFLAGS=	@CPPFLAGS@
+ CONFIGURE_LDFLAGS=	@LDFLAGS@
+@@ -76,7 +80,7 @@
+ # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
+ # be able to build extension modules using the directories specified in the
+ # environment variables
+-PY_CPPFLAGS=	-I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS)
++PY_CPPFLAGS=	$(BASECPPFLAGS) -I. -IInclude -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS)
+ PY_LDFLAGS=	$(CONFIGURE_LDFLAGS) $(LDFLAGS)
+ NO_AS_NEEDED=	@NO_AS_NEEDED@
+ LDLAST=		@LDLAST@
+@@ -93,6 +97,9 @@
+ # Machine-dependent subdirectories
+ MACHDEP=	@MACHDEP@
+ 
++# Multiarch directory (may be empty)
++MULTIARCH=	@MULTIARCH@
++
+ # Install prefix for architecture-independent files
+ prefix=		@prefix@
+ 
+@@ -196,7 +203,8 @@
+ 
+ PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
+ _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
+-HOST_GNU_TYPE=  @host@
++BUILD_GNU_TYPE=	@build@
++HOST_GNU_TYPE=	@host@
+ 
+ # The task to run while instrument when building the profile-opt target
+ PROFILE_TASK=	$(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
+@@ -229,8 +237,8 @@
+ 
+ ##########################################################################
+ # Grammar
+-GRAMMAR_H=	$(srcdir)/Include/graminit.h
+-GRAMMAR_C=	$(srcdir)/Python/graminit.c
++GRAMMAR_H=	Include/graminit.h
++GRAMMAR_C=	Python/graminit.c
+ GRAMMAR_INPUT=	$(srcdir)/Grammar/Grammar
+ 
+ 
+@@ -296,21 +304,21 @@
+ 
+ ##########################################################################
+ # AST
+-AST_H_DIR=	$(srcdir)/Include
++AST_H_DIR=	Include
+ AST_H=		$(AST_H_DIR)/Python-ast.h
+-AST_C_DIR=	$(srcdir)/Python
++AST_C_DIR=	Python
+ AST_C=		$(AST_C_DIR)/Python-ast.c
+ AST_ASDL=	$(srcdir)/Parser/Python.asdl
+ 
+ ASDLGEN_FILES=	$(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
+ # XXX Note that a build now requires Python exist before the build starts
+-ASDLGEN=	@DISABLE_ASDLGEN@ $(srcdir)/Parser/asdl_c.py
++ASDLGEN=	@ASDLGEN@ $(srcdir)/Parser/asdl_c.py
+ 
+ ##########################################################################
+ # Python
+ 
+ OPCODETARGETS_H= \
+-		$(srcdir)/Python/opcode_targets.h
++		Python/opcode_targets.h
+ 
+ OPCODETARGETGEN= \
+ 		$(srcdir)/Python/makeopcodetargets.py
+@@ -410,8 +418,6 @@
+ 		Objects/unicodectype.o \
+ 		Objects/weakrefobject.o
+ 
+-SYSCONFIGDATA=$(srcdir)/Lib/_sysconfigdata.py
+-
+ ##########################################################################
+ # objects that get linked into the Python library
+ LIBRARY_OBJS_OMIT_FROZEN=	\
+@@ -432,7 +438,7 @@
+ 
+ # Default target
+ all:		build_all
+-build_all:	$(BUILDPYTHON) $(SYSCONFIGDATA) oldsharedmods sharedmods gdbhooks Modules/_testembed
++build_all:	$(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed
+ 
+ # Compile a binary with gcc profile guided optimization.
+ profile-opt:
+@@ -466,16 +472,24 @@
+ $(BUILDPYTHON):	Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
+ 	$(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+ 
+-platform: $(BUILDPYTHON) $(SYSCONFIGDATA)
++platform: $(BUILDPYTHON) pybuilddir.txt
+ 	$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
+ 
+-# Generate the sysconfig build-time data
+-$(SYSCONFIGDATA): $(BUILDPYTHON)
++# Create build directory and generate the sysconfig build-time data there.
++# pybuilddir.txt contains the name of the build dir and is used for
++# sys.path fixup -- see Modules/getpath.c.
++pybuilddir.txt: $(BUILDPYTHON)
+ 	$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars
+ 
+ # Build the shared modules
+-sharedmods: $(BUILDPYTHON) $(SYSCONFIGDATA)
+-	case $$MAKEFLAGS in *s*) quiet=-q; esac; \
++# Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
++# -s, --silent or --quiet is always the first char.
++# Under BSD make, MAKEFLAGS might be " -s -v x=y".
++sharedmods: $(BUILDPYTHON) pybuilddir.txt
++	@case "$$MAKEFLAGS" in \
++	    *\ -s*|s*) quiet="-q";; \
++	    *) quiet="";; \
++	esac; \
+ 	$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ 		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+ 
+@@ -625,6 +639,14 @@
+ Modules/_testembed.o: $(srcdir)/Modules/_testembed.c
+ 	$(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Modules/_testembed.c
+ 
++Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h
++
++Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c $(srcdir)/Modules/posixmodule.h
++
++Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
++
++Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c $(srcdir)/Modules/posixmodule.h
++
+ Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
+ 	$(CC) -c $(PY_CORE_CFLAGS) \
+ 		-DSOABI='"$(SOABI)"' \
+@@ -660,9 +682,11 @@
+ Parser/pgenmain.o:	$(srcdir)/Include/parsetok.h
+ 
+ $(AST_H): $(AST_ASDL) $(ASDLGEN_FILES)
++	$(MKDIR_P) $(AST_H_DIR)
+ 	$(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL)
+ 
+ $(AST_C): $(AST_H) $(AST_ASDL) $(ASDLGEN_FILES)
++	$(MKDIR_P) $(AST_C_DIR)
+ 	$(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL)
+ 
+ Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
+@@ -718,11 +742,11 @@
+ Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \
+ 				$(BYTESTR_DEPS)
+ 
+-Python/frozen.o: $(srcdir)/Python/importlib.h
++Python/frozen.o: Python/importlib.h
+ 
+-Objects/typeobject.o: $(srcdir)/Objects/typeslots.inc
+-$(srcdir)/Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py
+-	$(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > $(srcdir)/Objects/typeslots.inc
++Objects/typeobject.o: Objects/typeslots.inc
++Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py
++	$(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > Objects/typeslots.inc
+ 
+ ############################################################################
+ # Header files
+@@ -870,10 +894,10 @@
+ 		$(TESTRUNNER) $(QUICKTESTOPTS)
+ 
+ 
+-install: altinstall bininstall
++install: altinstall bininstall maninstall
+ 
+ altinstall:	@FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
+-                sharedinstall oldsharedinstall maninstall @FRAMEWORKALTINSTALLLAST@
++                sharedinstall oldsharedinstall altmaninstall @FRAMEWORKALTINSTALLLAST@
+ 
+ # Install shared libraries enabled by Setup
+ DESTDIRS=	$(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
+@@ -954,8 +978,8 @@
+ 	-rm -f $(DESTDIR)$(BINDIR)/pyvenv
+ 	(cd $(DESTDIR)$(BINDIR); $(LN) -s pyvenv-$(VERSION) pyvenv)
+ 
+-# Install the manual page
+-maninstall:
++# Install the versioned manual page
++altmaninstall:
+ 	@for i in $(MANDIR) $(MANDIR)/man1; \
+ 	do \
+ 		if test ! -d $(DESTDIR)$$i; then \
+@@ -967,6 +991,11 @@
+ 	$(INSTALL_DATA) $(srcdir)/Misc/python.man \
+ 		$(DESTDIR)$(MANDIR)/man1/python$(VERSION).1
+ 
++# Install the unversioned manual page
++maninstall:	altmaninstall
++	-rm -f $(DESTDIR)$(MANDIR)/man1/python3.1
++	(cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python3.1)
++
+ # Install the library
+ PLATDIR=	plat-$(MACHDEP)
+ EXTRAPLATDIR= @EXTRAPLATDIR@
+@@ -1036,7 +1065,7 @@
+ 		else	true; \
+ 		fi; \
+ 	done
+-	@for i in $(srcdir)/Lib/*.py ; \
++	@for i in $(srcdir)/Lib/*.py `cat pybuilddir.txt`/_sysconfigdata.py; \
+ 	do \
+ 		if test -x $$i; then \
+ 			$(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
+@@ -1107,6 +1136,13 @@
+ 	export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
+ 	export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
+ 	export EXE; EXE="$(BUILDEXE)"; \
++	if [ -n "$(MULTIARCH)" ]; then export MULTIARCH; MULTIARCH=$(MULTIARCH); fi; \
++	export PYTHON_FOR_BUILD; \
++	if [ "$(BUILD_GNU_TYPE)" = "$(HOST_GNU_TYPE)" ]; then \
++	  PYTHON_FOR_BUILD="$(BUILDPYTHON)"; \
++	else \
++	  PYTHON_FOR_BUILD="$(PYTHON_FOR_BUILD)"; \
++	fi; \
+ 	cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
+ 
+ python-config: $(srcdir)/Misc/python-config.in
+@@ -1196,6 +1232,8 @@
+ 		--install-scripts=$(BINDIR) \
+ 		--install-platlib=$(DESTSHARED) \
+ 		--root=$(DESTDIR)/
++	-rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata.py
++	-rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
+ 
+ # Here are a couple of targets for MacOSX again, to install a full
+ # framework-based Python. frameworkinstall installs everything, the
+@@ -1341,9 +1379,10 @@
+ 	find . -name '*.s[ol]' -exec rm -f {} ';'
+ 	find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
+ 	find build -name 'fficonfig.h' -exec rm -f {} ';' || true
+-	find build -name 'fficonfig.py' -exec rm -f {} ';' || true
++	find build -name '*.py' -exec rm -f {} ';' || true
++	find build -name '*.py[co]' -exec rm -f {} ';' || true
++	-rm -f pybuilddir.txt
+ 	-rm -f Lib/lib2to3/*Grammar*.pickle
+-	-rm -f $(SYSCONFIGDATA)
+ 	-rm -f Modules/_testembed Modules/_freeze_importlib
+ 
+ profile-removal:
+@@ -1367,7 +1406,6 @@
+ 		Modules/Setup Modules/Setup.local Modules/Setup.config \
+ 		Modules/ld_so_aix Modules/python.exp Misc/python.pc
+ 	-rm -f python*-gdb.py
+-	-rm -f pybuilddir.txt
+ 	find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
+ 			   -o -name '[@,#]*' -o -name '*.old' \
+ 			   -o -name '*.orig' -o -name '*.rej' \
+@@ -1427,7 +1465,7 @@
+ .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
+ .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
+ .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
+-.PHONY: smelly funny patchcheck touch
++.PHONY: smelly funny patchcheck touch altmaninstall
+ .PHONY: gdbhooks
+ 
+ # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+diff -r bd8afb90ebf2 Misc/ACKS
+--- a/Misc/ACKS
++++ b/Misc/ACKS
+@@ -11,6 +11,8 @@
+ PS: In the standard Python distribution, this file is encoded in UTF-8
+ and the list is in rough alphabetical order by last names.
+ 
++Aahz
++Michael Abbott
+ Rajiv Abraham
+ David Abrahams
+ Marc Abramowitz
+@@ -22,28 +24,36 @@
+ Nir Aides
+ Yaniv Aknin
+ Jyrki Alakuijala
++Steve Alexander
++Fred Allen
+ Ray Allen
+ Billy G. Allie
+ Kevin Altis
+ Joe Amenta
++A. Amoroso
+ Mark Anacker
+ Shashwat Anand
+ Anders Andersen
+ John Anderson
++Pehr Anderson
+ Erik Andersén
+ Oliver Andrich
+ Ross Andrus
+ Juancarlo Añez
+ Jérémy Anger
++Ankur Ankan
+ Jon Anglin
++Heidi Annexstad
+ Éric Araujo
+ Alicia Arlen
++Jeffrey Armstrong
+ Jason Asbahr
+ David Ascher
+ Chris AtLee
+ Aymeric Augustin
+ John Aycock
+ Donovan Baarda
++Arne Babenhauserheide
+ Attila Babo
+ Marcin Bachry
+ Alfonso Baciero
+@@ -52,20 +62,25 @@
+ Greg Ball
+ Luigi Ballabio
+ Jeff Balogh
++Manuel Balsera
+ Matt Bandy
+ Michael J. Barber
++Daniel Barclay
+ Nicolas Bareil
+ Chris Barker
+ Anton Barkovsky
+ Nick Barnes
+ Quentin Barnes
+ David Barnett
++Matthew Barnett
+ Richard Barran
+ Cesar Eduardo Barros
+ Des Barry
+ Ulf Bartelt
++Don Bashford
+ Pior Bastida
+ Nick Bastin
++Ned Batchelder
+ Jeff Bauer
+ Michael R Bax
+ Anthony Baxter
+@@ -83,12 +98,15 @@
+ Thomas Bellman
+ Alexander “Саша” Belopolsky
+ Eli Bendersky
++David Benjamin
+ Andrew Bennetts
+ Andy Bensky
++Bennett Benson
+ Ezra Berch
+ Michel Van den Bergh
+ Julian Berman
+ Brice Berna
++Olivier Bernard
+ Eric Beser
+ Steven Bethard
+ Stephen Bevan
+@@ -100,6 +118,7 @@
+ Philippe Biondi
+ Stuart Bishop
+ Roy Bixler
++Jonathan Black
+ Renaud Blanch
+ Mike Bland
+ Martin Bless
+@@ -109,6 +128,7 @@
+ Finn Bock
+ Paul Boddie
+ Matthew Boedicker
++Robin Boerdijk
+ David Bolen
+ Gawain Bolton
+ Forest Bond
+@@ -120,7 +140,9 @@
+ Eric Bouck
+ Thierry Bousch
+ Sebastian Boving
++Michal Bozon
+ Jeff Bradberry
++Aaron Brancotti
+ Monty Brandenberg
+ Georg Brandl
+ Christopher Brannon
+@@ -130,6 +152,7 @@
+ Dave Brennan
+ Tom Bridgman
+ Anthony Briggs
++Keith Briggs
+ Tobias Brink
+ Richard Brodie
+ Michael Broghton
+@@ -140,6 +163,7 @@
+ Oleg Broytmann
+ Dave Brueck
+ Francisco Martín Brugué
++Ian Bruntlett
+ Floris Bruynooghe
+ Stan Bubrouski
+ Erik de Bueger
+@@ -165,8 +189,10 @@
+ Lorenzo M. Catucci
+ Donn Cave
+ Charles Cazabon
++Jesús Cea Avión
+ Per Cederqvist
+ Matej Cepl
++Carl Cerecke
+ Octavian Cerna
+ Pascal Chambon
+ John Chandler
+@@ -186,8 +212,10 @@
+ Anders Chrigström
+ Tom Christiansen
+ Vadim Chugunov
++Mauro Cicognini
+ David Cinege
+ Craig Citro
++Gilles Civario
+ Chris Clark
+ Mike Clarkson
+ Andrew Clegg
+@@ -217,13 +245,16 @@
+ Scott Cotton
+ Greg Couch
+ David Cournapeau
++Julien Courteau
+ Steve Cousins
+ Alex Coventry
+ Matthew Dixon Cowles
+ Ryan Coyner
+ Christopher A. Craig
++Jeremy Craven
+ Laura Creighton
+ Simon Cross
++Felipe Cruz
+ Drew Csillag
+ Joaquin Cuenca Abela
+ John Cugini
+@@ -249,6 +280,7 @@
+ Konrad Delong
+ Erik Demaine
+ John Dennis
++L. Peter Deutsch
+ Roger Dev
+ Philippe Devalkeneer
+ Raghuram Devarakonda
+@@ -265,6 +297,7 @@
+ Josip Djolonga
+ Jaromir Dolecek
+ Ismail Donmez
++Robert Donohue
+ Marcos Donolo
+ Dima Dorfman
+ Yves Dorfsman
+@@ -274,6 +307,7 @@
+ Derk Drukker
+ John DuBois
+ Paul Dubois
++Jacques Ducasse
+ Graham Dumpleton
+ Quinn Dunkan
+ Robin Dunn
+@@ -282,6 +316,7 @@
+ Andy Dustman
+ Gary Duzan
+ Eugene Dvurechenski
++Josip Dzolonga
+ Maxim Dzumanenko
+ Walter Dörwald
+ Hans Eckardt
+@@ -327,19 +362,23 @@
+ Sebastian Fernandez
+ Florian Festi
+ John Feuerstein
++Carl Feynman
+ Vincent Fiack
+ Tomer Filiba
+ Jeffrey Finkelstein
+ Russell Finn
++Dan Finnie
+ Nils Fischbeck
+ Frederik Fix
+ Matt Fleming
+ Hernán Martínez Foffani
++Arnaud Fontaine
+ Michael Foord
+ Amaury Forgeot d'Arc
+ Doug Fort
+ John Fouhy
+ Andrew Francis
++Stefan Franke
+ Martin Franklin
+ Bruce Frederiksen
+ Robin Friedrich
+@@ -360,6 +399,7 @@
+ Lele Gaifax
+ Santiago Gala
+ Yitzchak Gale
++Matthew Gallagher
+ Quentin Gallet-Gilles
+ Riccardo Attilio Galli
+ Raymund Galvin
+@@ -376,25 +416,32 @@
+ Gabriel Genellina
+ Christos Georgiou
+ Ben Gertzfield
++Nadim Ghaznavi
+ Dinu Gherman
+ Jonathan Giddy
+ Johannes Gijsbers
+ Michael Gilfix
+ Yannick Gingras
++Matt Giuca
+ Michael Goderbauer
+ Christoph Gohlke
+ Tim Golden
+ Guilherme Gonçalves
+ Tiago Gonçalves
+ Chris Gonnerman
++Shelley Gooch
+ David Goodger
+ Hans de Graaff
++Nathaniel Gray
+ Eddy De Greef
++Grant Griffin
++Andrea Griffini
+ Duncan Grisby
+ Fabian Groffen
+ Eric Groo
+ Dag Gruneau
+ Filip Gruszczyński
++Thomas Guettler
+ Michael Guravage
+ Lars Gustäbel
+ Thomas Güttler
+@@ -410,7 +457,9 @@
+ Jesse Hallio
+ Jun Hamano
+ Alexandre Hamelin
++Anders Hammarquist
+ Mark Hammond
++Harald Hanche-Olsen
+ Manus Hand
+ Milton L. Hankins
+ Stephen Hansen
+@@ -420,8 +469,11 @@
+ Jason Harper
+ Brian Harring
+ Jonathan Hartley
++Travis B. Hartwell
+ Larry Hastings
++Tim Hatch
+ Shane Hathaway
++Janko Hauser
+ Rycharde Hawkes
+ Ben Hayden
+ Jochen Hayek
+@@ -451,10 +503,13 @@
+ Joerg-Cyril Hoehle
+ Gregor Hoffleit
+ Chris Hoffman
++Stefan Hoffmeister
+ Albert Hofkamp
+ Tomas Hoger
+ Jonathan Hogg
++Steve Holden
+ Akintayo Holder
++Thomas Holenstein
+ Gerrit Holl
+ Shane Holloway
+ Rune Holm
+@@ -494,6 +549,7 @@
+ Tony Ingraldi
+ John Interrante
+ Bob Ippolito
++Roger Irwin
+ Atsuo Ishimoto
+ Adam Jackson
+ Ben Jackson
+@@ -511,12 +567,16 @@
+ Julien Jehannet
+ Drew Jenkins
+ Flemming Kjær Jensen
++Philip H. Jensen
++Philip Jenvey
+ MunSic Jeong
+ Chris Jerdonek
+ Jim Jewett
++Pedro Diaz Jimenez
+ Orjan Johansen
+ Fredrik Johansson
+ Gregory K. Johnson
++Kent Johnson
+ Simon Johnston
+ Matt Joiner
+ Thomas Jollans
+@@ -541,7 +601,10 @@
+ Peter van Kampen
+ Rafe Kaplan
+ Jacob Kaplan-Moss
++Jan Kaliszewski
++Janne Karila
+ Per Øyvind Karlsen
++Anton Kasyanov
+ Lou Kates
+ Hiroaki Kawai
+ Sebastien Keim
+@@ -549,16 +612,19 @@
+ Dan Kenigsberg
+ Randall Kern
+ Robert Kern
++Jim Kerr
+ Magnus Kessler
+ Lawrence Kesteloot
+ Vivek Khera
+ Mads Kiilerich
+ Jason Killen
++Jan Kim
+ Taek Joo Kim
+ W. Trevor King
+ Paul Kippes
+ Steve Kirsch
+ Sebastian Kirsche
++Kamil Kisiel
+ Akira Kitada
+ Ron Klatchko
+ Reid Kleckner
+@@ -574,15 +640,19 @@
+ Greg Kochanski
+ Damon Kohler
+ Marko Kohtala
++Guido Kollerie
+ Jacek Konieczny
+ Марк Коренберг
+ Arkady Koplyarov
++Peter A. Koren
+ Vlad Korolev
+ Joseph Koshy
++Daniel Kozan
+ Jerzy Kozera
+ Maksim Kozyarchuk
+ Stefan Krah
+ Bob Kras
++Sebastian Kreft
+ Holger Krekel
+ Michael Kremer
+ Fabian Kreutz
+@@ -591,11 +661,15 @@
+ Hannu Krosing
+ Andrej Krpic
+ Ivan Krstić
++Steven Kryskalla
+ Andrew Kuchling
++Dave Kuhlman
+ Jon Kuhn
+ Vladimir Kushnir
++Erno Kuusela
+ Ross Lagerwall
+ Cameron Laird
++Thomas Lamb
+ Jean-Baptiste "Jiba" Lamy
+ Ronan Lamy
+ Torsten Landschoff
+@@ -619,6 +693,8 @@
+ Thomas Lee
+ Tennessee Leeuwenburg
+ Luc Lefebvre
++Pierre Paul Lefebvre
++Glyph Lefkowitz
+ Vincent Legoll
+ Kip Lehman
+ Joerg Lehmann
+@@ -626,7 +702,7 @@
+ Petri Lehtinen
+ Luke Kenneth Casson Leighton
+ Tshepang Lekhonkhobe
+-Marc-Andre Lemburg
++Marc-André Lemburg
+ John Lenton
+ Christopher Tur Lesniewski-Laas
+ Alain Leufroy
+@@ -638,12 +714,16 @@
+ Ross Light
+ Shawn Ligocki
+ Martin Ligr
++Gediminas Liktaras
+ Grant Limberg
+ Christopher Lindblad
++Ulf A. Lindgren
+ Björn Lindqvist
+ Per Lindqvist
+ Eric Lindvall
+ Gregor Lingl
++Everett Lipman
++Mirko Liss
+ Nick Lockwood
+ Stephanie Lockwood
+ Hugo Lopes Tavares
+@@ -661,6 +741,8 @@
+ Mikael Lyngvig
+ Martin von Löwis
+ Guillermo López-Anglada
++Jeff MacDonald
++John Machin
+ Andrew I MacIntyre
+ Tim MacKenzie
+ Nick Maclaren
+@@ -671,20 +753,25 @@
+ Ken Manheimer
+ Vladimir Marangozov
+ Colin Marc
++Vincent Marchetti
+ David Marek
+ Doug Marien
+ Sven Marnach
+ Alex Martelli
+ Anthony Martin
+ Owen Martin
++Westley Martínez
+ Sébastien Martini
+ Sidney San Martín
+ Roger Masse
+ Nick Mathewson
+ Simon Mathieu
++Laura Matson
+ Graham Matthews
+ Dieter Maurer
++Daniel May
+ Arnaud Mazin
++Rebecca McCreary
+ Kirk McDonald
+ Chris McDonough
+ Greg McFarlane
+@@ -694,11 +781,13 @@
+ Gordon McMillan
+ Andrew McNamara
+ Caolan McNamara
++Jeff McNeil
+ Craig McPheeters
+ Lambert Meertens
+ Bill van Melle
+ Lucas Prado Melo
+ Ezio Melotti
++Doug Mennella
+ Brian Merrell
+ Luke Mewburn
+ Carl Meyer
+@@ -707,10 +796,12 @@
+ Alexis Métaireau
+ Steven Miale
+ Trent Mick
++Franck Michea
+ Tom Middleton
+ Stan Mihai
+ Stefan Mihaila
+ Aristotelis Mikropoulos
++Paolo Milani
+ Chad Miller
+ Damien Miller
+ Jason V. Miller
+@@ -727,9 +818,12 @@
+ Skip Montanaro
+ Peter Moody
+ Paul Moore
++Ross Moore
++Ben Morgan
+ Derek Morr
+ James A Morrison
+ Derek McTavish Mounce
++Alessandro Moura
+ Pablo Mouzo
+ Mher Movsisyan
+ Ruslan Mstoi
+@@ -740,6 +834,8 @@
+ Neil Muller
+ Louis Munro
+ R. David Murray
++Matti Mäki
++Dale Nagata
+ John Nagle
+ Takahiro Nakayama
+ Travers Naran
+@@ -751,6 +847,7 @@
+ Chad Netzer
+ Max Neunhöffer
+ George Neville-Neil
++Hieu Nguyen
+ Johannes Nicolai
+ Samuel Nicolary
+ Jonathan Niehof
+@@ -771,13 +868,16 @@
+ John O'Connor
+ Kevin O'Connor
+ Tim O'Malley
++Zooko O'Whielacronx
+ James Oakley
+ Jon Oberheide
+ Pascal Oberndoerfer
+ Jeffrey Ollie
+ Adam Olsen
+ Grant Olson
++Koray Oner
+ Piet van Oostrum
++Tomas Oppelstrup
+ Jason Orendorff
+ Douglas Orr
+ Michele Orrù
+@@ -787,6 +887,9 @@
+ Michael Otteneder
+ R. M. Oudkerk
+ Russel Owen
++Joonas Paalasmaa
++Martin Packman
++Shriphani Palakodety
+ Ondrej Palkovsky
+ Mike Pall
+ Todd R. Palmer
+@@ -796,15 +899,16 @@
+ Peter Parente
+ Alexandre Parenteau
+ Dan Parisien
++William Park
+ Harri Pasanen
+ Gaël Pasgrimaud
+-Joe Peterson
+ Randy Pausch
+ Samuele Pedroni
+ Justin Peel
+ Marcel van der Peijl
+ Berker Peksag
+ Steven Pemberton
++Bo Peng
+ Santiago Peresón
+ George Peristerakis
+ Mathieu Perreault
+@@ -816,6 +920,7 @@
+ Joe Peterson
+ Chris Petrilli
+ Bjorn Pettersen
++Justin D. Pettit
+ Ronny Pfannschmidt
+ Geoff Philbrick
+ Gavrie Philipson
+@@ -838,6 +943,7 @@
+ Iustin Pop
+ Claudiu Popa
+ John Popplewell
++Guillaume Pratte
+ Amrit Prem
+ Paul Prescod
+ Donovan Preston
+@@ -856,12 +962,12 @@
+ Antti Rasinen
+ Sridhar Ratnakumar
+ Ysj Ray
+-Eric Raymond
++Eric S. Raymond
+ Edward K. Ream
+ Chris Rebert
+ Marc Recht
+ John Redford
+-Terry Reedy
++Terry J. Reedy
+ Gareth Rees
+ Steve Reeves
+ Lennart Regebro
+@@ -883,6 +989,7 @@
+ Nicholas Riley
+ Jean-Claude Rimbault
+ Vlad Riscutia
++Wes Rishel
+ Juan M. Bello Rivas
+ Davide Rizzo
+ Anthony Roach
+@@ -903,23 +1010,28 @@
+ Erik Rose
+ Jim Roskind
+ Brian Rosner
++Guido van Rossum
+ Just van Rossum
+ Hugo van Rossum
+ Saskia van Rossum
+ Donald Wallace Rouse II
+ Liam Routt
++Todd Rovito
+ Craig Rowland
+ Clinton Roy
+ Paul Rubin
+ Sam Ruby
+ Demur Rumed
+ Audun S. Runde
++Eran Rundstein
+ Rauli Ruohonen
+ Jeff Rush
+ Sam Rushing
+ Mark Russell
+ Rusty Russell
+ Nick Russo
++Chris Ryland
++Constantina S.
+ Patrick Sabin
+ Sébastien Sablé
+ Suman Saha
+@@ -932,6 +1044,8 @@
+ Ilya Sandler
+ Mark Sapiro
+ Ty Sarna
++Hugh Sasse
++Bob Savage
+ Ben Sayer
+ sbt
+ Marco Scataglini
+@@ -940,6 +1054,7 @@
+ Andreas Schawo
+ Neil Schemenauer
+ David Scherer
++Wolfgang Scherer
+ Hynek Schlawack
+ Bob Schmertz
+ Gregor Schmid
+@@ -947,6 +1062,7 @@
+ Michael Schneider
+ Peter Schneider-Kamp
+ Arvin Schnell
++Scott Schram
+ Robin Schreiber
+ Chad J. Schroeder
+ Sam Schulenburg
+@@ -961,13 +1077,18 @@
+ Fred Sells
+ Jiwon Seo
+ Iñigo Serna
++Joakim Sernbrant
+ Roger D. Serwy
+ Jerry Seutter
++Pete Sevander
+ Denis Severson
+ Ian Seyer
++Daniel Shahaf
+ Ha Shao
+ Mark Shannon
+ Richard Shapiro
++Justin Sheehy
++Charlie Shepherd
+ Bruce Sherwood
+ Alexander Shigin
+ Pete Shinners
+@@ -975,20 +1096,28 @@
+ John W. Shipman
+ Joel Shprentz
+ Itamar Shtull-Trauring
++Yue Shuaijie
+ Eric Siegerman
+ Paul Sijben
++SilentGhost
+ Tim Silk
++Michael Simcich
++Ionel Simionescu
+ Kirill Simonov
+ Nathan Paul Simons
+ Adam Simpkins
++Ravi Sinha
+ Janne Sinkkonen
++Ng Pheng Siong
+ George Sipe
+ J. Sipprell
+ Kragen Sitaker
++Michael Sloan
+ Christopher Smith
+ Eric V. Smith
+ Gregory P. Smith
+ Mark Smith
++Roy Smith
+ Rafal Smotrzyk
+ Eric Snow
+ Dirk Soede
+@@ -997,14 +1126,17 @@
+ Edoardo Spadolini
+ Clay Spence
+ Stefan Sperling
++Nicholas Spies
+ Per Spilling
+ Joshua Spoerri
+ Noah Spurrier
+ Nathan Srebro
+ RajGopal Srinivasan
++Tage Stabell-Kulo
+ Quentin Stafford-Fraser
+ Frank Stajano
+ Joel Stanley
++Anthony Starks
+ Oliver Steele
+ Greg Stein
+ Baruch Sterin
+@@ -1024,12 +1156,15 @@
+ Pal Subbiah
+ Nathan Sullivan
+ Mark Summerfield
++Reuben Sumner
++Marek Å uppa
+ Hisao Suzuki
+ Kalle Svensson
+ Andrew Svetlov
+ Paul Swartz
+ Thenault Sylvain
+ Péter Szabó
++Amir Szekely
+ Arfrever Frehtes Taifersar Arahesis
+ Neil Tallim
+ Geoff Talvola
+@@ -1054,22 +1189,28 @@
+ Oren Tirosh
+ Jason Tishler
+ Christian Tismer
++Jim Tittsler
+ Frank J. Tobin
+ Bennett Todd
+ R Lindsay Todd
+ Eugene Toder
+ Erik Tollerud
++Stephen Tonkin
+ Matias Torchinsky
+ Sandro Tosi
+ Richard Townsend
+ David Townshend
++Nathan Trapuzzano
+ Laurence Tratt
+ Alberto Trevino
+ Matthias Troffaes
++Tom Tromey
+ John Tromp
+ Jason Trowbridge
++Brent Tubbs
+ Anthony Tuininga
+ Erno Tukia
++David Turner
+ Stephen Turner
+ Theodore Turocy
+ Bill Tutt
+@@ -1080,6 +1221,7 @@
+ Daniel Urban
+ Michael Urman
+ Hector Urtubia
++Ville Vainio
+ Andi Vajda
+ Case Van Horsen
+ Kyle VanderBeek
+@@ -1101,6 +1243,7 @@
+ Pauli Virtanen
+ Frank Visser
+ Johannes Vogel
++Martijn Vries
+ Sjoerd de Vries
+ Niki W. Waibel
+ Wojtek Walczak
+@@ -1109,6 +1252,7 @@
+ Larry Wall
+ Kevin Walzer
+ Rodrigo Steinmuller Wanderley
++Ke Wang
+ Greg Ward
+ Zachary Ware
+ Barry Warsaw
+@@ -1118,8 +1262,10 @@
+ Aaron Watters
+ Henrik Weber
+ Corran Webster
++Glyn Webster
+ Stefan Wehr
+ Zack Weinberg
++Bob Weiner
+ Edward Welbourne
+ Cliff Wells
+ Rickard Westman
+@@ -1132,14 +1278,17 @@
+ Gerry Wiener
+ Frank Wierzbicki
+ Bryce "Zooko" Wilcox-O'Hearn
++Timothy Wild
+ Jakub Wilk
+ Gerald S. Williams
+ Jason Williams
+ John Williams
+ Sue Williams
++Steven Willis
+ Frank Willison
+ Greg V. Wilson
+ J Derek Wilson
++Paul Winkler
+ Jody Winston
+ Collin Winter
+ Dik Winter
+@@ -1155,6 +1304,7 @@
+ Dan Wolfe
+ Richard Wolff
+ Adam Woodbeck
++Steven Work
+ Gordon Worley
+ Darren Worrall
+ Thomas Wouters
+@@ -1168,6 +1318,7 @@
+ EungJun Yi
+ Bob Yodlowski
+ Danny Yoo
++Rory Yorke
+ George Yoshida
+ Masazumi Yoshikawa
+ Arnaud Ysmal
+@@ -1179,6 +1330,7 @@
+ Siebren van der Zee
+ Yuxiao Zeng
+ Uwe Zessin
++Cheng Zhang
+ Kai Zhu
+ Tarek Ziadé
+ Peter Ã…strand
+diff -r bd8afb90ebf2 Misc/HISTORY
+--- a/Misc/HISTORY
++++ b/Misc/HISTORY
+@@ -10,6 +10,5403 @@
+ ======================================================================
+ 
+ 
++What's New in Python 3.2?
++=========================
++
++*Release date: 20-Feb-2011*
++
++Core and Builtins
++-----------------
++
++- Issue #11249: Fix potential crashes when using the limited API.
++
++Build
++-----
++
++- Issue #11222: Fix non-framework shared library build on Mac OS X.
++
++- Issue #11184: Fix large-file support on AIX.
++
++- Issue #941346: Fix broken shared library build on AIX.
++
++Documentation
++-------------
++
++- Issue #10709: Add updated AIX notes in Misc/README.AIX.
++
++
++What's New in Python 3.2 Release Candidate 3?
++=============================================
++
++*Release date: 13-Feb-2011*
++
++Core and Builtins
++-----------------
++
++- Issue #11134: Add missing fields to typeslots.h.
++
++- Issue #11135: Remove redundant doc field from PyType_Spec.
++
++- Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check in the limited
++  ABI.
++
++- Issue #11118: Fix bogus export of None in python3.dll.
++
++Library
++-------
++
++- Issue #11116: any error during addition of a message to a mailbox now causes a
++  rollback, instead of leaving the mailbox partially modified.
++
++- Issue #11132: Fix passing of "optimize" parameter when recursing in
++  compileall.compile_dir().
++
++- Issue #11110: Fix a potential decref of a NULL in sqlite3.
++
++- Issue #8275: Fix passing of callback arguments with ctypes under Win64.  Patch
++  by Stan Mihai.
++
++Build
++-----
++
++- Issue #11079: The /Applications/Python x.x folder created by the Mac OS X
++  installers now includes a link to the installed documentation and no longer
++  includes an Extras directory.  The Tools directory is now installed in the
++  framework under share/doc.
++
++- Issue #11121: Fix building with --enable-shared.
++
++Tests
++-----
++
++- Issue #10971: test_zipimport_support is once again compatible with the refleak
++  hunter feature of test.regrtest.
++
++
++What's New in Python 3.2 Release Candidate 2?
++=============================================
++
++*Release date: 30-Jan-2011*
++
++Core and Builtins
++-----------------
++
++- Issue #10451: memoryview objects could allow to mutate a readable buffer.
++  Initial patch by Ross Lagerwall.
++
++Library
++-------
++
++- Issue #9124: mailbox now accepts binary input and reads and writes mailbox
++  files in binary mode, using the email package's binary support to parse
++  arbitrary email messages.  StringIO and text file input is deprecated,
++  and string input fails early if non-ASCII characters are used, where
++  previously it would fail when the email was processed in a later step.
++
++- Issue #10845: Mitigate the incompatibility between the multiprocessing
++  module on Windows and the use of package, zipfile or directory execution
++  by special casing main modules that actually *are* called __main__.py.
++
++- Issue #11045: Protect logging call against None argument.
++
++- Issue #11052: Correct IDLE menu accelerators on Mac OS X for Save
++  commands.
++
++- Issue #11053: Fix IDLE "Syntax Error" windows to behave as in 2.x,
++  preventing a confusing hung appearance on OS X with the windows
++  obscured.
++
++- Issue #10940: Workaround an IDLE hang on Mac OS X 10.6 when using the
++  menu accelerators for Open Module, Go to Line, and New Indent Width.
++  The accelerators still work but no longer appear in the menu items.
++
++- Issue #10989: Fix a crash on SSLContext.load_verify_locations(None, True).
++
++- Issue #11020: Command-line pyclbr was broken because of missing 2-to-3
++  conversion.
++
++- Issue #11019: Fixed BytesGenerator so that it correctly handles a Message
++  with a None body.
++
++- Issue #11014: Make 'filter' argument in tarfile.Tarfile.add() into a
++  keyword-only argument.  The preceding positional argument was deprecated,
++  so it made no sense to add filter as a positional argument.
++
++- Issue #11004: Repaired edge case in deque.count().
++
++- Issue #10974: IDLE no longer crashes if its recent files list includes files
++  with non-ASCII characters in their path names.
++
++- Have hashlib.algorithms_available and hashlib.algorithms_guaranteed both
++  return sets instead of one returning a tuple and the other a frozenset.
++
++- Issue #10987: Fix the recursion limit handling in the _pickle module.
++
++- Issue #10983: Fix several bugs making tunnel requests in http.client.
++
++- Issue #10955: zipimport uses ASCII encoding instead of cp437 to decode
++  filenames, at bootstrap, if the codec registry is not ready yet. It is still
++  possible to have non-ASCII filenames using the Unicode flag (UTF-8 encoding)
++  for all file entries in the ZIP file.
++
++- Issue #10949: Improved robustness of rotating file handlers.
++
++- Issue #10955: Fix a potential crash when trying to mmap() a file past its
++  length.  Initial patch by Ross Lagerwall.
++
++- Issue #10898: Allow compiling the posix module when the C library defines
++  a symbol named FSTAT.
++
++- Issue #10980: the HTTP server now encodes headers with iso-8859-1 (latin1)
++  encoding.  This is the preferred encoding of PEP 3333 and the base encoding
++  of HTTP 1.1.
++
++- To match the behaviour of HTTP server, the HTTP client library now also
++  encodes headers with iso-8859-1 (latin1) encoding.  It was already doing
++  that for incoming headers which makes this behaviour now consistent in
++  both incoming and outgoing direction.
++
++- Issue #9509: argparse now properly handles IOErrors raised by
++  argparse.FileType.
++
++- Issue #10961: The new pydoc server now better handles exceptions raised
++  during request handling.
++
++- Issue #10680: Fix mutually exclusive arguments for argument groups in
++  argparse.
++
++Build
++-----
++
++- Issue #11054: Allow Mac OS X installer builds to again work on 10.5 with
++  the system-provided Python.
++
++
++What's New in Python 3.2 Release Candidate 1
++============================================
++
++*Release date: 16-Jan-2011*
++
++Core and Builtins
++-----------------
++
++- Issue #10889: range indexing and slicing now works correctly on ranges with
++  a length that exceeds sys.maxsize.
++
++- Issue #10892: Don't segfault when trying to delete __abstractmethods__ from a
++  class.
++
++- Issue #8020: Avoid a crash where the small objects allocator would read
++  non-Python managed memory while it is being modified by another thread.  Patch
++  by Matt Bandy.
++
++- Issue #10841: On Windows, set the binary mode on stdin, stdout, stderr and all
++  io.FileIO objects (to not translate newlines, \r\n <=> \n).  The Python parser
++  translates newlines (\r\n => \n).
++
++- Remove buffer API from stable ABI for now, see #10181.
++
++- Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file
++  doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
++  (length bigger than 2^31-1 bytes).
++
++- Issue #9015, #9611: FileIO.readinto(), FileIO.write(), os.write() and
++  stdprinter.write() clamp the length to INT_MAX on Windows.
++
++- Issue #8278: On Windows and with a NTFS filesystem, os.stat() and os.utime()
++  can now handle dates after 2038.
++
++- Issue #10780: PyErr_SetFromWindowsErrWithFilename() and
++  PyErr_SetExcFromWindowsErrWithFilename() decode the filename from the
++  filesystem encoding instead of UTF-8.
++
++- Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystem
++  encoding instead of UTF-8.
++
++- Add sys.flags attribute for the new -q command-line option.
++
++- Issue #11506: Trying to assign to a bytes literal should result in a
++  SyntaxError.
++
++Library
++-------
++
++- Issue #10916: mmap should not segfault when a file is mapped using 0 as length
++  and a non-zero offset, and an attempt to read past the end of file is made
++  (IndexError is raised instead).  Patch by Ross Lagerwall.
++
++- Issue #10154, #10090: change the normalization of UTF-8 to "UTF-8" instead
++  of "UTF8" in the locale module as the latter is not supported MacOSX and OpenBSD.
++
++- Issue #10907: Warn OS X 10.6 IDLE users to use ActiveState Tcl/Tk 8.5, rather
++  than the currently problematic Apple-supplied one, when running with the
++  64-/32-bit installer variant.
++
++- Issue #4953: cgi.FieldStorage and cgi.parse() parse the request as bytes, not
++  as unicode, and accept binary files. Add encoding and errors attributes to
++  cgi.FieldStorage. Patch written by Pierre Quentel (with many inputs by Glenn
++  Linderman).
++
++- Add encoding and errors arguments to urllib.parse_qs() and urllib.parse_qsl().
++
++- Issue #10899: No function type annotations in the standard library.  Removed
++  function type annotations from _pyio.py.
++
++- Issue #10875: Update Regular Expression HOWTO; patch by 'SilentGhost'.
++
++- Issue #10872: The repr() of TextIOWrapper objects now includes the mode
++  if available.
++
++- Issue #10869: Fixed bug where ast.increment_lineno modified the root node
++  twice.
++
++- Issue #5871: email.header.Header.encode now raises an error if any
++  continuation line in the formatted value has no leading white space and looks
++  like a header.  Since Generator uses Header to format all headers, this check
++  is made for all headers in any serialized message at serialization time.  This
++  provides protection against header injection attacks.
++
++- Issue #10859: Make ``contextlib.GeneratorContextManager`` officially
++  private by renaming it to ``_GeneratorContextManager``.
++
++- Issue #10042: Fixed the total_ordering decorator to handle cross-type
++  comparisons that could lead to infinite recursion.
++
++- Issue #10686: the email package now :rfc:`2047`\ -encodes headers with
++  non-ASCII bytes (parsed by a BytesParser) when doing conversion to 7bit-clean
++  presentation, instead of replacing them with ?s.
++
++- email.header.Header was incorrectly encoding folding whitespace when
++  rfc2047-encoding header values with embedded newlines, leaving them without
++  folding whitespace.  It now uses the continuation_ws, as it does for
++  continuation lines that it creates itself.
++
++- Issue #1777412, #10827: Changed the rules for 2-digit years. The
++  time.asctime(), time.ctime() and time.strftime() functions will now format
++  any year when ``time.accept2dyear`` is False and will accept years >= 1000
++  otherwise. ``time.mktime`` and ``time.strftime`` now accept full range
++  supported by the OS. With Visual Studio or on Solaris, the year is limited to
++  the range [1; 9999]. Conversion of 2-digit years to 4-digit is deprecated.
++
++- Issue #7858: Raise an error properly when os.utime() fails under Windows
++  on an existing file.
++
++- Issue #3839: wsgiref should not override a Content-Length header set by
++  the application.  Initial patch by Clovis Fabricio.
++
++- Issue #10492: bdb.Bdb.run() only traces the execution of the code, not the
++  compilation (if the input is a string).
++
++- Issue #7995: When calling accept() on a socket with a timeout, the returned
++  socket is now always blocking, regardless of the operating system.
++
++- Issue #10756: atexit normalizes the exception before displaying it. Patch by
++  Andreas Stührk.
++
++- Issue #10790: email.header.Header.append's charset logic now works correctly
++  for charsets whose output codec is different from its input codec.
++
++- Issue #10819: SocketIO.name property returns -1 when its closed, instead of
++  raising a ValueError, to fix repr().
++
++- Issue #8650: zlib.compress() and zlib.decompress() raise an OverflowError if
++  the input buffer length doesn't fit into an unsigned int (length bigger than
++  2^32-1 bytes).
++
++- Issue #6643: Reinitialize locks held within the threading module after fork to
++  avoid a potential rare deadlock or crash on some platforms.
++
++- Issue #10806, issue #9905: Fix subprocess pipes when some of the standard file
++  descriptors (0, 1, 2) are closed in the parent process.  Initial patch by Ross
++  Lagerwall.
++
++- `unittest.TestCase` can be instantiated without a method name; for simpler
++  exploration from the interactive interpreter.
++
++- Issue #10798: Reject supporting concurrent.futures if the system has too
++  few POSIX semaphores.
++
++- Issue #10807: Remove base64, bz2, hex, quopri, rot13, uu and zlib codecs from
++  the codec aliases. They are still accessible via codecs.lookup().
++
++- Issue #10801: In zipfile, support different encodings for the header and the
++  filenames.
++
++- Issue #6285: IDLE no longer crashes on missing help file; patch by Scott
++  David Daniels.
++
++- Fix collections.OrderedDict.setdefault() so that it works in subclasses that
++  define __missing__().
++
++- Issue #10786: unittest.TextTestRunner default stream no longer bound at import
++  time. `sys.stderr` now looked up at instantiation time.  Fix contributed by
++  Mark Roddy.
++
++- Issue #10753: Characters ';', '=' and ',' in the PATH_INFO environment variable
++  won't be quoted when the URI is constructed by the wsgiref.util's request_uri
++  method. According to RFC 3986, these characters can be a part of params in
++  PATH component of URI and need not be quoted.
++
++- Issue #10738: Fix webbrowser.Opera.raise_opts.
++
++- Issue #9824: SimpleCookie now encodes , and ; in values to cater to how
++  browsers actually parse cookies.
++
++- Issue #9333: os.symlink now available regardless of user privileges.  The
++  function now raises OSError on Windows >=6.0 when the user is unable to create
++  symbolic links. XP and 2003 still raise NotImplementedError.
++
++- Issue #10783: struct.pack() no longer implicitly encodes unicode to UTF-8.
++
++- Issue #10730: Add SVG mime types to mimetypes module.
++
++- Issue #10768: Make the Tkinter ScrolledText widget work again.
++
++- Issue #10777: Fix "dictionary changed size during iteration" bug in
++  ElementTree register_namespace().
++
++- Issue #10626: test_logging now preserves logger disabled states.
++
++- Issue #10774: test_logging now removes temp files created during tests.
++
++- Issue #5258/#10642: if site.py encounters a .pth file that generates an error,
++  it now prints the filename, line number, and traceback to stderr and skips
++  the rest of that individual file, instead of stopping processing entirely.
++
++- Issue #10763: subprocess.communicate() closes stdout and stderr if both are
++  pipes (bug specific to Windows).
++
++- Issue #1693546: fix email.message RFC 2231 parameter encoding to be in better
++  compliance (no "s around encoded values).
++
++- Improved the diff message in the unittest module's assertCountEqual().
++
++- Issue #1155362: email.utils.parsedate_tz now handles a missing space before
++  the '-' of a timezone field as well as before a '+'.
++
++- Issue #4871: The zipfile module now gives a more useful error message if
++  an attempt is made to use a string to specify the archive password.
++
++- Issue #10750: The ``raw`` attribute of buffered IO objects is now read-only.
++
++- Deprecated assertDictContainsSubset() in the unittest module.
++
++C-API
++-----
++
++- PyObject_CallMethod now passes along any underlying AttributeError from
++  PyObject_GetAttr, instead of replacing it with something less informative
++
++- Issue #10913: Deprecate misleading functions PyEval_AcquireLock() and
++  PyEval_ReleaseLock().  The thread-state aware APIs should be used instead.
++
++- Issue #10333: Remove ancient GC API, which has been deprecated since Python
++  2.2.
++
++Build
++-----
++
++- Issue #10843: Update third-party library versions used in OS X 32-bit
++  installer builds: bzip2 1.0.6, readline 6.1.2, SQLite 3.7.4 (with FTS3/FTS4
++  and RTREE enabled), and ncursesw 5.5 (wide-char support enabled).
++
++- Issue #10820: Fix OS X framework installs to support version-specific
++  scripts (#10679).
++
++- Issue #7716: Under Solaris, don't assume existence of /usr/xpg4/bin/grep in
++  the configure script but use $GREP instead.  Patch by Fabian Groffen.
++
++- Issue #10475: Don't hardcode compilers for LDSHARED/LDCXXSHARED on NetBSD
++  and DragonFly BSD.  Patch by Nicolas Joly.
++
++- Issue #10679: The "idle", "pydoc" and "2to3" scripts are now installed with
++  a version-specific suffix on "make altinstall".
++
++- Issue #10655: Fix the build on PowerPC on Linux with GCC when building with
++  timestamp profiling (--with-tsc): the preprocessor test for the PowerPC
++  support now looks for "__powerpc__" as well as "__ppc__": the latter seems to
++  only be present on OS X; the former is the correct one for Linux with GCC.
++
++- Issue #1099: Fix the build on MacOSX when building a framework with pydebug
++  using GCC 4.0.
++
++Tools/Demos
++-----------
++
++- Issue #10843: Install the Tools directory on OS X in the applications Extras
++  (/Applications/Python 3.n/Extras/) where the Demo directory had previous been
++  installed.
++
++- Issue #7962: The Demo directory is gone.  Most of the old and unmaintained
++  demos have been removed, others integrated in documentation or a new
++  Tools/demo subdirectory.
++
++- Issue #10502: Addition of the unittestgui tool. Originally by Steve Purcell.
++  Updated for test discovery by Mark Roddy and Python 3 compatibility by Brian
++  Curtin.
++
++Tests
++-----
++
++- Issue #11910: Fix test_heapq to skip the C tests when _heapq is missing.
++
++- Fix test_startfile to wait for child process to terminate before finishing.
++
++- Issue #10822: Fix test_posix:test_getgroups failure under Solaris.  Patch
++  by Ross Lagerwall.
++
++- Make the --coverage flag work for test.regrtest.
++
++- Issue #1677694: Refactor and improve test_timeout.  Original patch by
++  Björn Lindqvist.
++
++- Issue #5485: Add tests for the UseForeignDTD method of expat parser objects.
++  Patch by Jean-Paul Calderone and Sandro Tosi.
++
++- Issue #6293: Have regrtest.py echo back sys.flags.  This is done by default in
++  whole runs and enabled selectively using ``--header`` when running an explicit
++  list of tests.  Original patch by Collin Winter.
++
++
++What's New in Python 3.2 Beta 2?
++================================
++
++*Release date: 19-Dec-2010*
++
++Core and Builtins
++-----------------
++
++- Issue #8844: Regular and recursive lock acquisitions can now be interrupted
++  by signals on platforms using pthreads.  Patch by Reid Kleckner.
++
++- Issue #4236: PyModule_Create2 now checks the import machinery directly
++  rather than the Py_IsInitialized flag, avoiding a Fatal Python
++  error in certain circumstances when an import is done in __del__.
++
++- Issue #5587: add a repr to dict_proxy objects.  Patch by David Stanek and
++  Daniel Urban.
++
++Library
++-------
++
++- Issue #3243:  Support iterable bodies in httplib. Patch Contributions by
++  Xuanji Li and Chris AtLee.
++
++- Issue #10611: SystemExit exception will no longer kill a unittest run.
++
++- Issue #9857: It is now possible to skip a test in a setUp, tearDown or clean
++  up function.
++
++- Issue #10573: use actual/expected consistently in unittest methods.
++  The order of the args of assertCountEqual is also changed.
++
++- Issue #9286: email.utils.parseaddr no longer concatenates blank-separated
++  words in the local part of email addresses, thereby preserving the input.
++
++- Issue #6791: Limit header line length (to 65535 bytes) in http.client
++  and http.server, to avoid denial of services from the other party.
++
++- Issue #10404: Use ctl-button-1 on OSX for the context menu in Idle.
++
++- Issue #9907: Fix tab handling on OSX when using editline by calling
++  rl_initialize first, then setting our custom defaults, then reading .editrc.
++
++- Issue #4188: Avoid creating dummy thread objects when logging operations
++  from the threading module (with the internal verbose flag activated).
++
++- Issue #10711: Remove HTTP 0.9 support from http.client.  The ``strict``
++  parameter to HTTPConnection and friends is deprecated.
++
++- Issue #9721: Fix the behavior of urljoin when the relative url starts with a
++  ';' character. Patch by Wes Chow.
++
++- Issue #10714: Limit length of incoming request in http.server to 65536 bytes
++  for security reasons.  Initial patch by Ross Lagerwall.
++
++- Issue #9558: Fix distutils.command.build_ext with VS 8.0.
++
++- Issue #10667: Fast path for collections.Counter().
++
++- Issue #10695: passing the port as a string value to telnetlib no longer
++  causes debug mode to fail.
++
++- Issue #1078919: add_header now automatically RFC2231 encodes parameters
++  that contain non-ascii values.
++
++- Issue #10188 (partial resolution): tempfile.TemporaryDirectory emits
++  a warning on sys.stderr rather than throwing a misleading exception
++  if cleanup fails due to nulling out of modules during shutdown.
++  Also avoids an AttributeError when mkdtemp call fails and issues
++  a ResourceWarning on implicit cleanup via __del__.
++
++- Issue #10107: Warn about unsaved files in IDLE on OSX.
++
++- Issue #7213: subprocess.Popen's default for close_fds has been changed.
++  It is now True in most cases other than on Windows when input, output or
++  error handles are provided.
++
++- Issue #6559: subprocess.Popen has a new pass_fds parameter (actually
++  added in 3.2beta1) to allow specifying a specific list of file descriptors
++  to keep open in the child process.
++
++- Issue #1731717: Fixed the problem where subprocess.wait() could cause an
++  OSError exception when The OS had been told to ignore SIGCLD in our process
++  or otherwise not wait for exiting child processes.
++
++Tests
++-----
++
++- Issue #775964: test_grp now skips YP/NIS entries instead of failing when
++  encountering them.
++
++Tools/Demos
++-----------
++
++- Issue #6075: IDLE on Mac OS X now works with both Carbon AquaTk and
++  Cocoa AquaTk.
++
++- Issue #10710: ``Misc/setuid-prog.c`` is removed from the source tree.
++
++- Issue #10706: Remove outdated script runtests.sh.  Either ``make test``
++  or ``python -m test`` should be used instead.
++
++Build
++-----
++
++- The Windows build now uses Tcl/Tk 8.5.9 and sqlite3 3.7.4.
++
++- Issue #9234: argparse supports alias names for subparsers.
++
++
++What's New in Python 3.2 Beta 1?
++================================
++
++*Release date: 05-Dec-2010*
++
++Core and Builtins
++-----------------
++
++- Issue #10630: Return dict views from the dict proxy keys()/values()/items()
++  methods.
++
++- Issue #10596: Fix float.__mod__ to have the same behaviour as float.__divmod__
++  with respect to signed zeros.  -4.0 % 4.0 should be 0.0, not -0.0.
++
++- Issue #1772833: Add the -q command-line option to suppress copyright and
++  version output in interactive mode.
++
++- Provide an *optimize* parameter in the built-in compile() function.
++
++- Fixed several corner case issues on Windows in os.stat/os.lstat related to
++  reparse points.
++
++- PEP 384 (Defining a Stable ABI) is implemented.
++
++- Issue #2690: Range objects support negative indices and slicing.
++
++- Issue #9915: Speed up sorting with a key.
++
++- Issue #8685: Speed up set difference ``a - b`` when source set ``a`` is much
++  larger than operand ``b``.  Patch by Andrew Bennetts.
++
++- Issue #10518: Bring back the callable() builtin.
++
++- Issue #7094: Added alternate formatting (specified by '#') to ``__format__``
++  method of float, complex, and Decimal. This allows more precise control over
++  when decimal points are displayed.
++
++- Issue #10474: range.count() should return integers.
++
++- Issue #1574217: isinstance now catches only AttributeError, rather than
++  masking all errors.
++
++Library
++-------
++
++- logging: added "handler of last resort". See http://bit.ly/last-resort-handler
++
++- test.support: Added TestHandler and Matcher classes for better support of
++  assertions about logging.
++
++- Issue #4391: Use proper plural forms in argparse.
++
++- Issue #10601: sys.displayhook uses 'backslashreplace' error handler on
++  UnicodeEncodeError.
++
++- Add the "display" and "undisplay" pdb commands.
++
++- Issue #7245: Add a SIGINT handler in pdb that allows to break a program again
++  after a "continue" command.
++
++- Add the "interact" pdb command.
++
++- Issue #7905: Actually respect the keyencoding parameter to shelve.Shelf.
++
++- Issue #1569291: Speed up array.repeat().
++
++- Provide an interface to set the optimization level of compilation in
++  py_compile, compileall and zipfile.PyZipFile.
++
++- Issue #7904: Changes to urllib.parse.urlsplit to handle schemes as defined by
++  RFC3986. Anything before :// is considered a scheme and is followed by an
++  authority (or netloc) and by '/' led path, which is optional.
++
++- Issue #6045: dbm.gnu databases now support get() and setdefault() methods.
++
++- Issue #10620: `python -m unittest` can accept file paths instead of module
++  names for running specific tests.
++
++- Issue #9424: Deprecate the `unittest.TestCase` methods `assertEquals`,
++  `assertNotEquals`, `assertAlmostEquals`, `assertNotAlmostEquals` and `assert_`
++  and replace them with the correct methods in the Python test suite.
++
++- Issue #10272: The ssl module now raises socket.timeout instead of a generic
++  SSLError on socket timeouts.
++
++- Issue #10528: Allow translators to reorder placeholders in localizable
++  messages from argparse.
++
++- Issue #10497: Fix incorrect use of gettext in argparse.
++
++- Issue #10478: Reentrant calls inside buffered IO objects (for example by
++  way of a signal handler) now raise a RuntimeError instead of freezing the
++  current process.
++
++- logging: Added getLogRecordFactory/setLogRecordFactory with docs and tests.
++
++- Issue #10549: Fix pydoc traceback when text-documenting certain classes.
++
++- Issue #2001: New HTML server with enhanced Web page features.  Patch by Ron
++  Adam.
++
++- Issue #10360: In WeakSet, do not raise TypeErrors when testing for membership
++  of non-weakrefable objects.
++
++- Issue #940286: pydoc.Helper.help() ignores input/output init parameters.
++
++- Issue #1745035: Add a command size and data size limit to smtpd.py, to prevent
++  DoS attacks.  Patch by Savio Sena.
++
++- Issue #4925: Add filename to error message when executable can't be found in
++  subprocess.
++
++- Issue #10391: Don't dereference invalid memory in error messages in the ast
++  module.
++
++- Issue #10027: st_nlink was not being set on Windows calls to os.stat or
++  os.lstat. Patch by Hirokazu Yamamoto.
++
++- Issue #9333: Expose os.symlink only when the SeCreateSymbolicLinkPrivilege is
++  held by the user's account, i.e., when the function can actually be used.
++
++- Issue #8879: Add os.link support for Windows.
++
++- Issue #7911: ``unittest.TestCase.longMessage`` defaults to True for improved
++  failure messages by default. Patch by Mark Roddy.
++
++- Issue #1486713: HTMLParser now has an optional tolerant mode where it tries to
++  guess at the correct parsing of invalid html.
++
++- Issue #10554: Add context manager support to subprocess.Popen objects.
++
++- Issue #8989: email.utils.make_msgid now has a domain parameter that can
++  override the domain name used in the generated msgid.
++
++- Issue #9299: Add exist_ok parameter to os.makedirs to suppress the 'File
++  exists' exception when a target directory already exists with the specified
++  mode. Patch by Ray Allen.
++
++- Issue #9573: os.fork() now works correctly when triggered as a side effect of
++  a module import.
++
++- Issue #10464: netrc now correctly handles lines with embedded '#' characters.
++
++- Added itertools.accumulate().
++
++- Issue #4113: Added custom ``__repr__`` method to ``functools.partial``.
++  Original patch by Daniel Urban.
++
++- Issue #10273: Rename `assertRegexpMatches` and `assertRaisesRegexp` to
++  `assertRegex` and `assertRaisesRegex`.
++
++- Issue #10535: Enable silenced warnings in unittest by default.
++
++- Issue #9873: The URL parsing functions in urllib.parse now accept ASCII byte
++  sequences as input in addition to character strings.
++
++- Issue #10586: The statistics API for the new functools.lru_cache has been
++  changed to a single cache_info() method returning a named tuple.
++
++- Issue #10323: itertools.islice() now consumes the minimum number of inputs
++  before stopping.  Formerly, the final state of the underlying iterator was
++  undefined.
++
++- Issue #10565: The collections.Iterator ABC now checks for both __iter__ and
++  __next__.
++
++- Issue #10242: Fixed implementation of unittest.ItemsEqual and gave it a new
++  more informative name, unittest.CountEqual.
++
++- Issue #10561: In pdb, clear the breakpoints by the breakpoint number.
++
++- Issue #2986: difflib.SequenceMatcher gets a new parameter, autojunk, which can
++  be set to False to turn off the previously undocumented 'popularity'
++  heuristic. Patch by Terry Reedy and Eli Bendersky.
++
++- Issue #10534: in difflib, expose bjunk and bpopular sets; deprecate
++  undocumented and now redundant isbjunk and isbpopular methods.
++
++- Issue #9846: zipfile is now correctly closing underlying file objects.
++
++- 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 Andrew Shaaf.
++
++- 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.
++
++- configparser: 100% test coverage.
++
++- Issue #10499: configparser supports pluggable interpolation handlers. The
++  default classic interpolation handler is called BasicInterpolation. Another
++  interpolation handler added (ExtendedInterpolation) which supports the syntax
++  used by zc.buildout (e.g. interpolation between sections).
++
++- configparser: the SafeConfigParser class has been renamed to ConfigParser.
++  The legacy ConfigParser class has been removed but its interpolation mechanism
++  is still available as LegacyInterpolation.
++
++- configparser: Usage of RawConfigParser is now discouraged for new projects
++  in favor of ConfigParser(interpolation=None).
++
++- 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
++  (thanks to the mapping protocol API, the latter can be used to copy data
++  between parsers).
++
++- 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.
++
++- Make the 'No module named' exception message from importlib consistent.
++
++- Issue #10443: Add the SSLContext.set_default_verify_paths() method.
++
++- Issue #10440: Support RUSAGE_THREAD as a constant in the resource module.
++  Patch by Robert Collins.
++
++- Issue #10429: IMAP.starttls() stored the capabilities as bytes objects, rather
++  than strings.
++
++C-API
++-----
++
++- Issue #10557: Added a new API function, PyUnicode_TransformDecimalToASCII(),
++  which transforms non-ASCII decimal digits in a Unicode string to their ASCII
++  equivalents.
++
++- 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 by
++  "-W").
++
++- Issue #10255: Fix reference leak in Py_InitializeEx().  Patch by Neil
++  Schemenauer.
++
++- structseq.h is now included in Python.h.
++
++- Loosen PyArg_ValidateKeywordArguments to allow dict subclasses.
++
++Tests
++-----
++
++- regrtest.py once again ensures the test directory is removed from sys.path
++  when it is invoked directly as the __main__ module.
++
++- `python -m test` can be used to run the test suite as well as `python -m
++  test.regrtest`.
++
++- 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.
++
++Documentation
++-------------
++
++- Issue #10299: List the built-in functions in a table in functions.rst.
++
++
++What's New in Python 3.2 Alpha 4?
++=================================
++
++*Release date: 13-Nov-2010*
++
++Core and Builtins
++-----------------
++
++- Issue #10372: Import the warnings module only after the IO library is
++  initialized, so as to avoid bootstrap issues with the '-W' option.
++
++- Issue #10293: Remove obsolete field in the PyMemoryView structure, unused
++  undocumented value PyBUF_SHADOW, and strangely-looking code in
++  PyMemoryView_GetContiguous.
++
++- Issue #6081: Add str.format_map(), similar to ``str.format(**mapping)``.
++
++- If FileIO.__init__ fails, close the file descriptor.
++
++- Issue #10221: dict.pop(k) now has a key error message that includes the
++  missing key (same message d[k] returns for missing keys).
++
++- Issue #5437: A preallocated MemoryError instance should not keep traceback
++  data (including local variables caught in the stack trace) alive infinitely.
++
++- Issue #10186: Fix the SyntaxError caret when the offset is equal to the length
++  of the offending line.
++
++- Issue #10089: Add support for arbitrary -X options on the command line.  They
++  can be retrieved through a new attribute ``sys._xoptions``.
++
++- Issue #4388: On Mac OS X, decode command line arguments from UTF-8, instead of
++  the locale encoding.  If the LANG (and LC_ALL and LC_CTYPE) environment
++  variable is not set, the locale encoding is ISO-8859-1, whereas most programs
++  (including Python) expect UTF-8.  Python already uses UTF-8 for the filesystem
++  encoding and to encode command line arguments on this OS.
++
++- Issue #9713, #10114: Parser functions (e.g. PyParser_ASTFromFile) expect
++  filenames encoded to the filesystem encoding with the surrogateescape error
++  handler (to support undecodable bytes), instead of UTF-8 in strict mode.
++
++- Issue #9997: Don't let the name "top" have special significance in scope
++  resolution.
++
++- Issue #9862: Compensate for broken PIPE_BUF in AIX by hard coding its value as
++  the default 512 when compiling on AIX.
++
++- Use locale encoding instead of UTF-8 to encode and decode filenames if
++  Py_FileSystemDefaultEncoding is not set.
++
++- Issue #10095: fp_setreadl() doesn't reopen the file, instead reuse the file
++  descriptor.
++
++- Issue #9418: Moved private string methods ``_formatter_parser`` and
++  ``_formatter_field_name_split`` into a new ``_string`` module.
++
++- Issue #9992: Remove PYTHONFSENCODING environment variable.
++
++Library
++-------
++
++- Issue #12943: python -m tokenize support has been added to tokenize.
++
++- Issue #10465: fix broken delegating of attributes by gzip._PaddedFile.
++
++- Issue #10356: Decimal.__hash__(-1) should return -2.
++
++- Issue #1553375: logging: Added stack_info kwarg to display stack information.
++
++- Issue #5111: IPv6 Host in the Header is wrapped inside [ ]. Patch by Chandru.
++
++- Fix Fraction.__hash__ so that Fraction.__hash__(-1) is -2.  (See also issue
++  #10356.)
++
++- Issue #4471: Add the IMAP.starttls() method to enable encryption on standard
++  IMAP4 connections.  Original patch by Lorenzo M. Catucci.
++
++- Issue #1466065: Add 'validate' option to base64.b64decode to raise an error if
++  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 *``.
++
++- Issue #4471: Properly shutdown socket in IMAP.shutdown().  Patch by Lorenzo
++  M. Catucci.
++
++- Fix IMAP.login() to work properly.
++
++- Issue #9244: multiprocessing pool worker processes could terminate
++  unexpectedly if the return value of a task could not be pickled.  Only the
++  ``repr`` of such errors are now sent back, wrapped in an
++  ``MaybeEncodingError`` exception.
++
++- Issue #9244: The ``apply_async()`` and ``map_async()`` methods of
++  ``multiprocessing.Pool`` now accepts a ``error_callback`` argument.  This can
++  be a callback with the signature ``callback(exc)``, which will be called if
++  the target raises an exception.
++
++- Issue #10022: The dictionary returned by the ``getpeercert()`` method of SSL
++  sockets now has additional items such as ``issuer`` and ``notBefore``.
++
++- ``usenetrc`` is now false by default for NNTP objects.
++
++- Issue #1926: Add support for NNTP over SSL on port 563, as well as STARTTLS.
++  Patch by Andrew Vant.
++
++- Issue #10335: Add tokenize.open(), detect the file encoding using
++  tokenize.detect_encoding() and open it in read only mode.
++
++- Issue #10321: Add support for binary data to smtplib.SMTP.sendmail, and a new
++  method send_message to send an email.message.Message object.
++
++- Issue #6011: sysconfig and distutils.sysconfig use the surrogateescape error
++  handler to parse the Makefile file.  Avoid a UnicodeDecodeError if the source
++  code directory name contains a non-ASCII character and the locale encoding is
++  ASCII.
++
++- Issue #10329: The trace module writes reports using the input Python script
++  encoding, instead of the locale encoding.  Patch written by Alexander
++  Belopolsky.
++
++- Issue #10126: Fix distutils' test_build when Python was built with
++  --enable-shared.
++
++- Issue #9281: Prevent race condition with mkdir in distutils.  Patch by
++  Arfrever.
++
++- Issue #10229: Fix caching error in gettext.
++
++- Issue #10252: Close file objects in a timely manner in distutils code and
++  tests.  Patch by Brian Brazil, completed by Éric Araujo.
++
++- Issue #10180: Pickling file objects is now explicitly forbidden, since
++  unpickling them produced nonsensical results.
++
++- Issue #10311: The signal module now restores errno before returning from its
++  low-level signal handler.  Patch by Hallvard B Furuseth.
++
++- Issue #10282: Add a ``nntp_implementation`` attribute to NNTP objects.
++
++- Issue #10283: Add a ``group_pattern`` argument to NNTP.list().
++
++- Issue #10155: Add IISCGIHandler to wsgiref.handlers to support IIS CGI
++  environment better, and to correct unicode environment values for WSGI 1.0.1.
++
++- Issue #10281: nntplib now returns None for absent fields in the OVER/XOVER
++  response, instead of raising an exception.
++
++- wsgiref now implements and validates PEP 3333, rather than an experimental
++  extension of PEP 333.  (Note: earlier versions of Python 3.x may have
++  incorrectly validated some non-compliant applications as WSGI compliant; if
++  your app validates with Python <3.2b1+, but not on this version, it is likely
++  the case that your app was not compliant.)
++
++- Issue #10280: NNTP.nntp_version should reflect the highest version advertised
++  by the server.
++
++- Issue #10184: Touch directories only once when extracting a tarfile.
++
++- Issue #10199: New package, ``turtledemo`` now contains selected demo scripts
++  that were formerly found under Demo/turtle.
++
++- Issue #10265: Close file objects explicitly in sunau.  Patch by Brian Brazil.
++
++- Issue #10266: uu.decode didn't close in_file explicitly when it was given as a
++  filename.  Patch by Brian Brazil.
++
++- Issue #10110: Queue objects didn't recognize full queues when the maxsize
++  parameter had been reduced.
++
++- Issue #10160: Speed up operator.attrgetter.  Patch by Christos Georgiou.
++
++- logging: Added style option to basicConfig() to allow %, {} or $-formatting.
++
++- Issue #5729: json.dumps() now supports using a string such as '\t' for
++  pretty-printing multilevel objects.
++
++- Issue #10253: FileIO leaks a file descriptor when trying to open a file for
++  append that isn't seekable.  Patch by Brian Brazil.
++
++- Support context manager protocol for file-like objects returned by mailbox
++  ``get_file()`` methods.
++
++- Issue #10246: uu.encode didn't close file objects explicitly when filenames
++  were given to it.  Patch by Brian Brazil.
++
++- Issue #10198: fix duplicate header written to wave files when writeframes() is
++  called without data.
++
++- Close file objects in modulefinder in a timely manner.
++
++- Close a io.TextIOWrapper object in email.parser in a timely manner.
++
++- Close a file object in distutils.sysconfig in a timely manner.
++
++- Close a file object in pkgutil in a timely manner.
++
++- Issue #10233: Close file objects in a timely manner in the tarfile module and
++  its test suite.
++
++- Issue #10093: ResourceWarnings are now issued when files and sockets are
++  deallocated without explicit closing.  These warnings are silenced by default,
++  except in pydebug mode.
++
++- tarfile.py: Add support for all missing variants of the GNU sparse extensions
++  and create files with holes when extracting sparse members.
++
++- Issue #10218: Return timeout status from ``Condition.wait`` in threading.
++
++- Issue #7351: Add ``zipfile.BadZipFile`` spelling of the exception name and
++  deprecate the old name ``zipfile.BadZipfile``.
++
++- Issue #5027: The standard ``xml`` namespace is now understood by
++  xml.sax.saxutils.XMLGenerator as being bound to
++  http://www.w3.org/XML/1998/namespace.  Patch by Troy J. Farrell.
++
++- Issue #5975: Add csv.unix_dialect class.
++
++- Issue #7761: telnetlib.interact failures on Windows fixed.
++
++- logging: Added style option to Formatter to allow %, {} or $-formatting.
++
++- Issue #5178: Added tempfile.TemporaryDirectory class that can be used as a
++  context manager.
++
++- Issue #1349106: Generator (and BytesGenerator) flatten method and Header
++  encode method now support a 'linesep' argument.
++
++- Issue #5639: Add a *server_hostname* argument to ``SSLContext.wrap_socket`` in
++  order to support the TLS SNI extension.  ``HTTPSConnection`` and ``urlopen()``
++  also use this argument, so that HTTPS virtual hosts are now supported.
++
++- Issue #10166: Avoid recursion in pstats Stats.add() for many stats items.
++
++- Issue #10163: Skip unreadable registry keys during mimetypes initialization.
++
++- logging: Made StreamHandler terminator configurable.
++
++- logging: Allowed filters to be just callables.
++
++- logging: Added tests for _logRecordClass changes.
++
++- Issue #10092: Properly reset locale in calendar.Locale*Calendar classes.
++
++- logging: Added _logRecordClass, getLogRecordClass, setLogRecordClass to
++  increase flexibility of LogRecord creation.
++
++- Issue #5117: Case normalization was needed on ntpath.relpath().  Also fixed
++  root directory issue on posixpath.relpath().  (Ported working fixes from
++  ntpath.)
++
++- Issue #1343: xml.sax.saxutils.XMLGenerator now has an option
++  short_empty_elements to direct it to use self-closing tags when appropriate.
++
++- Issue #9807 (part 1): Expose the ABI flags in sys.abiflags.  Add --abiflags
++  switch to python-config for command line access.
++
++- Issue #6098: Don't claim DOM level 3 conformance in minidom.
++
++- Issue #5762: Fix AttributeError raised by ``xml.dom.minidom`` when an empty
++  XML namespace attribute is encountered.
++
++- Issue #2830: Add the ``html.escape()`` function, which quotes all problematic
++  characters by default.  Deprecate ``cgi.escape()``.
++
++- Issue #9409: Fix the regex to match all kind of filenames, for interactive
++  debugging in doctests.
++
++- Issue #9183: ``datetime.timezone(datetime.timedelta(0))`` will now return the
++  same instance as ``datetime.timezone.utc``.
++
++- Issue #7523: Add SOCK_CLOEXEC and SOCK_NONBLOCK to the socket module, where
++  supported by the system.  Patch by Nikita Vetoshkin.
++
++- Issue #10063: file:// scheme will stop accessing remote hosts via ftp
++  protocol. file:// urls had fallback to access remote hosts via ftp. This was
++  not correct, change is made to raise a URLError when a remote host is tried to
++  access via file:// scheme.
++
++- Issue #1710703: Write structures for an empty ZIP archive when a ZipFile is
++  created in modes 'a' or 'w' and then closed without adding any files. Raise
++  BadZipfile (rather than IOError) when opening small non-ZIP files.
++
++- Issue #10041: The signature of optional arguments in socket.makefile() didn't
++  match that of io.open(), and they also didn't get forwarded properly to
++  TextIOWrapper in text mode.  Patch by Kai Zhu.
++
++- Issue #9003: http.client.HTTPSConnection, urllib.request.HTTPSHandler and
++  urllib.request.urlopen now take optional arguments to allow for server
++  certificate checking, as recommended in public uses of HTTPS.
++
++- Issue #6612: Fix site and sysconfig to catch os.getcwd() error, eg. if the
++  current directory was deleted. Patch written by W. Trevor King.
++
++- Issue #3873: Speed up unpickling from file objects that have a peek() method.
++
++- Issue #10075: Add a session_stats() method to SSLContext objects.
++
++- Issue #9948: Fixed problem of losing filename case information.
++
++Extension Modules
++-----------------
++
++- Issue #5109: array.array constructor will now use fast code when
++  initial data is provided in an array object with correct type.
++
++- Issue #6317: Now winsound.PlaySound only accepts unicode.
++
++- Issue #6317: Now winsound.PlaySound can accept non ascii filename.
++
++- Issue #9377: Use Unicode API for gethostname on Windows.
++
++- Issue #10143: Update "os.pathconf" values.
++
++- Issue #6518: Support context manager protcol for ossaudiodev types.
++
++- Issue #678250: Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.
++
++- Issue #9054: Fix a crash occurring when using the pyexpat module with expat
++  version 2.0.1.
++
++- Issue #5355: Provide mappings from Expat error numbers to string descriptions
++  and backwards, in order to actually make it possible to analyze error codes
++  provided by ExpatError.
++
++- The Unicode database was updated to 6.0.0.
++
++C-API
++-----
++
++- Issue #10288: The deprecated family of "char"-handling macros
++  (ISLOWER()/ISUPPER()/etc) have now been removed: use Py_ISLOWER() etc instead.
++
++- Issue #9778: Hash values are now always the size of pointers. A new Py_hash_t
++  type has been introduced.
++
++Tools/Demos
++-----------
++
++- Issue #10117: Tools/scripts/reindent.py now accepts source files that use
++  encoding other than ASCII or UTF-8.  Source encoding is preserved when
++  reindented code is written to a file.
++
++- Issue #7287: Demo/imputil/knee.py was removed.
++
++Tests
++-----
++
++- Issue #3699: Fix test_bigaddrspace and extend it to test bytestrings as well
++  as unicode strings.  Initial patch by Sandro Tosi.
++
++- Issue #10294: Remove dead code form test_unicode_file.
++
++- Issue #10123: Don't use non-ascii filenames in test_doctest tests. Add a new
++  test specific to unicode (non-ascii name and filename).
++
++Build
++-----
++
++- Issue #10268: Add a --enable-loadable-sqlite-extensions option to configure.
++
++- Issue #8852: Allow the socket module to build on OpenSolaris.
++
++- Drop -OPT:Olimit compiler option.
++
++- Issue #10094: Use versioned .so files on GNU/kfreeBSD and the GNU Hurd.
++
++- Accept Oracle Berkeley DB 5.0 and 5.1 as backend for the dbm extension.
++
++- Issue #7473: avoid link errors when building a framework with a different set
++  of architectures than the one that is currently installed.
++
++
++What's New in Python 3.2 Alpha 3?
++=================================
++
++*Release date: 09-Oct-2010*
++
++Core and Builtins
++-----------------
++
++- Issue #10068: Global objects which have reference cycles with their module's
++  dict are now cleared again. This causes issue #7140 to appear again.
++
++- Issue #9738: Document PyErr_SetString() and PyErr_SetFromErrnoWithFilename()
++  encodings.
++
++- ast.literal_eval() can now handle negative numbers.  It is also a little more
++  liberal in what it accepts without compromising the safety of the evaluation.
++  For example, 3j+4 and 3+4+5 are both accepted.
++
++- Issue #10006: type.__abstractmethods__ now raises an AttributeError.  As a
++  result metaclasses can now be ABCs (see #9533).
++
++- Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_t.
++
++- Issue #8670: PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replace
++  UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE and
++  32 bits wchar_t (eg. Linux in narrow build).
++
++- Issue #10003: Allow handling of SIGBREAK on Windows. Fixes a regression
++  introduced by issue #9324.
++
++- Issue #9979: Create function PyUnicode_AsWideCharString().
++
++- Issue #7397: Mention that importlib.import_module() is probably what someone
++  really wants to be using in __import__'s docstring.
++
++- Issue #8521: Allow CreateKeyEx, OpenKeyEx, and DeleteKeyEx functions of winreg
++  to use named arguments.
++
++- Issue #9930: Remove bogus subtype check that was causing (e.g.)
++  float.__rdiv__(2.0, 3) to return NotImplemented instead of the expected 1.5.
++
++- Issue #9808: Implement os.getlogin for Windows. Patch by Jon Anglin.
++
++- Issue #9901: Destroying the GIL in Py_Finalize() can fail if some other
++  threads are still running.  Instead, reinitialize the GIL on a second call to
++  Py_Initialize().
++
++- All SyntaxErrors now have a column offset and therefore a caret when the error
++  is printed.
++
++- Issue #9252: PyImport_Import no longer uses a fromlist hack to return the
++  module that was imported, but instead gets the module from sys.modules.
++
++- Issue #9213: The range type_items now provides index() and count() methods, to
++  conform to the Sequence ABC.  Patch by Daniel Urban and Daniel Stutzbach.
++
++- Issue #7994: Issue a PendingDeprecationWarning if object.__format__ is called
++  with a non-empty format string.  This is an effort to future-proof user
++  code. If a derived class does not currently implement __format__ but later
++  adds its own __format__, it would most likely break user code that had
++  supplied a format string.  This will be changed to a DeprecationWaring in
++  Python 3.3 and it will be an error in Python 3.4.
++
++- Issue #9828: Destroy the GIL in Py_Finalize(), so that it gets properly
++  re-created on a subsequent call to Py_Initialize().  The problem (a crash)
++  wouldn't appear in 3.1 or 2.7 where the GIL's structure is more trivial.
++
++- Issue #9210: Configure option --with-wctype-functions was removed.  Using the
++  functions from the libc caused the methods .upper() and lower() to become
++  locale aware and created subtly wrong results.
++
++- Issue #9738: PyUnicode_FromFormat() and PyErr_Format() raise an error on a
++  non-ASCII byte in the format string.
++
++- Issue #4617: Previously it was illegal to delete a name from the local
++  namespace if it occurs as a free variable in a nested block.  This limitation
++  of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).
++
++- Issue #9804: ascii() now always represents unicode surrogate pairs as a single
++  ``\UXXXXXXXX``, regardless of whether the character is printable or not.
++  Also, the "backslashreplace" error handler now joins surrogate pairs into a
++  single character on UCS-2 builds.
++
++- Issue #9757: memoryview objects get a release() method to release the
++  underlying buffer (previously this was only done when deallocating the
++  memoryview), and gain support for the context management protocol.
++
++- Issue #9797: pystate.c wrongly assumed that zero couldn't be a valid
++  thread-local storage key.
++
++Library
++-------
++
++- Issue #2236: distutils' mkpath ignored the mode parameter.
++
++- Fix typo in one sdist option (medata-check).
++
++- Issue #9199: Fix incorrect use of distutils.cmd.Command.announce.
++
++- Issue #1718574: Fix options that were supposed to accept arguments but did
++  not in build_clib.
++
++- Issue #9437: Fix building C extensions with non-default LDFLAGS.
++
++- Issue #4661: email can now parse bytes input and generate either converted
++  7bit output or bytes output.  Email version bumped to 5.1.0.
++
++- Issue #1589: Add ssl.match_hostname(), to help implement server identity
++  verification for higher-level protocols.
++
++- Issue #9759: GzipFile now raises ValueError when an operation is attempted
++  after the file is closed.  Patch by Jeffrey Finkelstein.
++
++- Issue #9042: Fix interaction of custom translation classes and caching in
++  gettext.
++
++- Issue #6706: asyncore.dispatcher now provides a handle_accepted() method
++  returning a (sock, addr) pair which is called when a connection has been
++  established with a new remote endpoint.  This is supposed to be used as a
++  replacement for old handle_accept() and avoids the user to call accept()
++  directly.
++
++- Issue #9065: tarfile no longer uses "root" as the default for the uname and
++  gname field.
++
++- Issue #8980: Fixed a failure in distutils.command check that was shadowed by
++  an environment that does not have docutils.  Patch by Arfrever.
++
++- Issue #1050268: parseaddr now correctly quotes double quote and backslash
++  characters that appear inside quoted strings in email addresses.
++
++- Issue #10004: quoprimime no longer generates a traceback when confronted with
++  invalid characters after '=' in a Q-encoded word.
++
++- Issue #1491: BaseHTTPServer nows send a ``100 Continue`` response before
++  sending a 200 OK for the Expect: 100-continue request header.
++
++- Issue #9360: Cleanup and improvements to the nntplib module.  The API now
++  conforms to the philosophy of bytes and unicode separation in Python 3.  A
++  test suite has also been added.
++
++- Issue #9962: GzipFile now has the peek() method.
++
++- Issue #9090: When a socket with a timeout fails with EWOULDBLOCK or EAGAIN,
++  retry the select() loop instead of bailing out.  This is because select() can
++  incorrectly report a socket as ready for reading (for example, if it received
++  some data with an invalid checksum).
++
++- Issue #3612: Added new types to ctypes.wintypes. (CHAR and pointers)
++
++- Issue #9950: Fix socket.sendall() crash or misbehaviour when a signal is
++  received.  Now sendall() properly calls signal handlers if necessary, and
++  retries sending if these returned successfully, including on sockets with a
++  timeout.
++
++- Issue #9947: logging: Fixed locking bug in stopListening.
++
++- Issue #9945: logging: Fixed locking bugs in addHandler/removeHandler.
++
++- Issue #9936: Fixed executable lines' search in the trace module.
++
++- Issue #9790: Rework imports necessary for samefile and sameopenfile
++  in ntpath.
++
++- Issue #9928: Properly initialize the types exported by the bz2 module.
++
++- Issue #1675951: Allow GzipFile to work with unseekable file objects.  Patch by
++  Florian Festi.
++
++- Logging: Added QueueListener class to facilitate logging usage for
++  performance-critical threads.
++
++- Issue #9916: Add some missing errno symbols.
++
++- Issue #9877: Expose sysconfig.get_makefile_filename()
++
++- logging: Added hasHandlers() method to Logger and LoggerAdapter.
++
++- Issue #9908: Fix os.stat() on bytes paths under Windows 7.
++
++- Issue #2643: msync() is not called anymore when deallocating an open mmap
++  object, only munmap().
++
++- logging: Changed LoggerAdapter implementation internally, to make it easier to
++  subclass in a useful way.
++
++- logging: hasHandlers method was added to Logger, and isEnabledFor,
++  getEffectiveLevel, hasHandlers and setLevel were added to LoggerAdapter.
++  LoggerAdapter was introduced into the unit tests for logging.
++
++- Issue #1686: Fix string.Template when overriding the pattern attribute.
++
++- Issue #9854: SocketIO objects now observe the RawIOBase interface in
++  non-blocking mode: they return None when an operation would block (instead of
++  raising an exception).
++
++- Issue #1730136: Fix the comparison between a tk.font.Font and an object of
++  another kind.
++
++- Issue #9441: logging has better coverage for rotating file handlers.
++
++- Issue #9865: collections.OrderedDict now has a __sizeof__ method.
++
++- Issue #9854: The default read() implementation in io.RawIOBase now handles
++  non-blocking readinto() returning None correctly.
++
++- Issue #1552: socket.socketpair() now returns regular socket.socket objects
++  supporting the whole socket API (rather than the "raw" _socket.socket
++  objects).
++
++- Issue #9853: Fix the signature of SSLSocket.recvfrom() and SSLSocket.sendto()
++  to match the corresponding socket methods.
++
++- Issue #9840: Added a decorator to reprlib for wrapping __repr__ methods to make
++  them handle recursive calls within the same thread.
++
++- logging: Enhanced HTTPHandler with secure and credentials initializers.
++
++- Issue #767645: Set os.path.supports_unicode_filenames to True on Mac OS X.
++
++- Issue #9837: The read() method of ZipExtFile objects (as returned by
++  ZipFile.open()) could return more bytes than requested.
++
++- Issue #9826: OrderedDict.__repr__ can now handle self-referential values:
++  d['x'] = d.
++
++- Issue #9825: Using __del__ in the definition of collections.OrderedDict made
++  it possible for the user to create self-referencing ordered dictionaries which
++  become permanently uncollectable GC garbage.  Reinstated the Python 3.1
++  approach of using weakref proxies so that reference cycles never get created
++  in the first place.
++
++- Issue #9579, #9580: Fix os.confstr() for value longer than 255 bytes and
++  encode the value with filesystem encoding and surrogateescape (instead of
++  utf-8 in strict mode) . Patch written by David Watson.
++
++- Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
++  environment variable to set the filesystem encoding at Python startup.
++  sys.setfilesystemencoding() creates inconsistencies because it is unable to
++  reencode all filenames in all objects.
++
++- Issue #9410: Various optimizations to the pickle module, leading to speedups
++  up to 4x (depending on the benchmark).  Mostly ported from Unladen Swallow;
++  initial patch by Alexandre Vassalotti.
++
++- The pprint module now supports printing OrderedDicts in their given order
++  (formerly, it would sort the keys).
++
++- Logging: Added QueueHandler class to facilitate logging usage with
++  multiprocessing.
++
++- Issue #9707: Rewritten reference implementation of threading.local which is
++  friendlier towards reference cycles.  This change is not normally visible
++  since an optimized C implementation (_thread._local) is used instead.
++
++- Issue #6394: os.getppid() is now supported on Windows.  Note that it will
++  still return the id of the parent process after it has exited.  This process
++  id may even have been reused by another unrelated process.
++
++- Issue #9792: In case of connection failure, socket.create_connection() would
++  swallow the exception and raise a new one, making it impossible to fetch the
++  original errno, or to filter timeout errors.  Now the original error is
++  re-raised.
++
++- Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True, and
++  the passed buffer was exactly 1024 bytes long, the buffer wouldn't be updated
++  back after the system call.  Original patch by Brian Brazil.
++
++- Updates to the random module:
++
++  * Document which parts of the module are guaranteed to stay the same across
++    versions and which parts are subject to change.
++
++  * Update the seed() method to use all of the bits in a string instead of just
++    the hash value.  This makes better use of the seed value and assures the
++    seeding is platform independent.  Issue #7889.
++
++  * Improved the random()-->integer algorithm used in choice(), shuffle(),
++    sample(), randrange(), and randint().  Formerly, it used int(n*random())
++    which has a slight bias whenever n is not a power of two.  Issue #9025.
++
++  * Improved documentation of arguments to randrange().  Issue #9379.
++
++- collections.OrderedDict now supports a new method for repositioning keys to
++  either end.
++
++- Issue #9754: Similarly to assertRaises and assertRaisesRegexp, unittest test
++  cases now also have assertWarns and assertWarnsRegexp methods to check that a
++  given warning type was triggered by the code under test.
++
++- Issue #5506: BytesIO objects now have a getbuffer() method exporting a view of
++  their contents without duplicating them.  The view is both readable and
++  writable.
++
++- Issue #7566: Implement os.path.sameopenfile for Windows.
++
++- Issue #9293: I/O streams now raise ``io.UnsupportedOperation`` when an
++  unsupported operation is attempted (for example, writing to a file open only
++  for reading).
++
++- hashlib has two new constant attributes: algorithms_guaranteed and
++  algorithms_avaiable that respectively list the names of hash algorithms
++  guaranteed to exist in all Python implementations and the names of hash
++  algorithms available in the current process.
++
++- A new package ``concurrent.futures`` as defined by PEP 3148.
++
++C-API
++-----
++
++- Add PyErr_SyntaxLocationEx, which supports passing a column offset.
++
++- Issue #9834: Don't segfault in PySequence_GetSlice, PySequence_SetSlice, or
++  PySequence_DelSlice when the object doesn't have any mapping operations
++  defined.
++
++Tools/Demos
++-----------
++
++- Issue #9188: The gdb extension now handles correctly narrow (UCS2) as well as
++  wide (UCS4) unicode builds for both the host interpreter (embedded inside gdb)
++  and the interpreter under test.
++
++Tests
++-----
++
++- Issue #9308: Added tests for importing encoded modules that do not
++  depend on specific stdlib modules being encoded in a certain way.
++
++- Issue #1051: Add a script (Lib/test/make_ssl_certs.py) to generate the custom
++  certificate and private key files used by SSL-related certs.
++
++- Issue #9978: Wait until subprocess completes initialization. (Win32KillTests
++  in test_os)
++
++- Issue #7110: regrtest now sends test failure reports and single-failure
++  tracebacks to stderr rather than stdout.
++
++- Issue #9628: fix runtests.sh -x option so more than one test can be excluded.
++
++- Issue #9899: Fix test_tkinter.test_font on various platforms.  Patch by Ned
++  Deily.
++
++- Issue #9894: Do not hardcode ENOENT in test_subprocess.
++
++- Issue #9315: Added tests for the trace module.  Patch by Eli Bendersky.
++
++- Issue #9323: Make test.regrtest.__file__ absolute, this was not always the
++  case when running profile or trace, for example.
++
++- Issue #9568: Fix test_urllib2_localnet on OS X 10.3.
++
++Build
++-----
++
++- Issue #10062: Allow building on platforms which do not have sem_timedwait.
++
++- Issue #10054: Some platforms provide uintptr_t in inttypes.h.  Patch by Akira
++  Kitada.
++
++- Issue #10055: Make json C89-compliant in UCS4 mode.
++
++- Issue #9552: Avoid unnecessary rebuild of OpenSSL. (Windows)
++
++- Issue #1633863: Don't ignore $CC under AIX.
++
++- Issue #9810: Compile bzip2 source files in Python's project file directly. It
++  used to be built with bzip2's makefile.
++
++- Issue #9848: Stopping trying to build _weakref in setup.py as it is a built-in
++  module.
++
++- Issue #9806: python-config now has an ``--extension-suffix`` option that
++  outputs the suffix for dynamic libraries including the ABI version name
++  defined by PEP 3149.
++
++- Issue #941346: Improve the build process under AIX and allow Python to be
++  built as a shared library.  Patch by Sébastien Sablé.
++
++- Issue #4026: Make the fcntl extension build under AIX.  Patch by Sébastien
++  Sablé.
++
++- Issue #9701: The MacOSX installer can patch the shell profile to ensure that
++  the "bin" directory inside the framework is on the shell's search path. This
++  feature now also supports the ZSH shell.
++
++
++What's New in Python 3.2 Alpha 2?
++=================================
++
++*Release date: 05-Sep-2010*
++
++Core and Builtins
++-----------------
++
++- Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced by
++  the new (and simpler) DUP_TOP_TWO.  Performance isn't changed, but our
++  bytecode is a bit simplified.  Patch by Demur Rumed.
++
++- Issue #9766: Rename poorly named variables exposed by _warnings to prevent
++  confusion with the proper variables names from 'warnings' itself.
++
++- Issue #9212: dict_keys and dict_items now provide the isdisjoint() method, to
++  conform to the Set ABC.  Patch by Daniel Urban.
++
++- Issue #9737: Fix a crash when trying to delete a slice or an item from a
++  memoryview object.
++
++- Issue #9549: sys.setdefaultencoding() and PyUnicode_SetDefaultEncoding() are
++  now removed, since their effect was inexistent in 3.x (the default encoding is
++  hardcoded to utf-8 and cannot be changed).
++
++- Issue #7415: PyUnicode_FromEncodedObject() now uses the new buffer API
++  properly.  Patch by Stefan Behnel.
++
++- Issue #5553: The Py_LOCAL_INLINE macro now results in inlining on most
++  platforms.  Previously, it inlined only when using Microsoft Visual C.
++
++- Issue #9712: Fix tokenize on identifiers that start with non-ascii names.
++
++- Issue #9688: __basicsize__ and __itemsize__ must be accessed as Py_ssize_t.
++
++- Issue #9684: Added a definition for SIZEOF_WCHAR_T to PC/pyconfig.h, to match
++  the pyconfig.h generated by configure on other systems.
++
++- Issue #9666: Only catch AttributeError in hasattr(). All other exceptions that
++  occur during attribute lookup are now propagated to the caller.
++
++- Issue #8622: Add PYTHONFSENCODING environment variable to override the
++  filesystem encoding.
++
++- Issue #5127: The C functions that access the Unicode Database now accept and
++  return characters from the full Unicode range, even on narrow unicode builds
++  (Py_UNICODE_TOLOWER, Py_UNICODE_ISDECIMAL, and others).  A visible difference
++  in Python is that unicodedata.numeric() now returns the correct value for
++  large code points, and repr() may consider more characters as printable.
++
++- Issue #9425: Create PyModule_GetFilenameObject() function to get the filename
++  as a unicode object, instead of a byte string. Function needed to support
++  unencodable filenames. Deprecate PyModule_GetFilename() in favor on the new
++  function.
++
++- Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
++
++- Issue #9612: The set object is now 64-bit clean under Windows.
++
++- Issue #8202: sys.argv[0] is now set to '-m' instead of '-c' when searching for
++  the module file to be executed with the -m command line option.
++
++- Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr() functions to
++  write a message formatted by PyUnicode_FromFormatV() to sys.stdout and
++  sys.stderr.
++
++- Issue #9542: Create PyUnicode_FSDecoder() function, a ParseTuple converter:
++  decode bytes objects to unicode using PyUnicode_DecodeFSDefaultAndSize(); str
++  objects are output as-is.
++
++- Issue #9203: Computed gotos are now enabled by default on supported compilers
++  (which are detected by the configure script).  They can still be disable
++  selectively by specifying --without-computed-gotos.
++
++- Issue #9425: Create PyErr_WarnFormat() function, similar to PyErr_WarnEx() but
++  use PyUnicode_FromFormatV() to format the warning message.
++
++- Issue #8530: Prevent stringlib fastsearch from reading beyond the front of an
++  array.
++
++- Issue #5319: Print an error if flushing stdout fails at interpreter shutdown.
++
++- Issue #9337: The str() of a float or complex number is now identical to its
++  repr().
++
++- Issue #9416: Fix some issues with complex formatting where the output with no
++  type specifier failed to match the str output:
++
++    - format(complex(-0.0, 2.0), '-') omitted the real part from the output,
++    - format(complex(0.0, 2.0), '-') included a sign and parentheses.
++
++Extension Modules
++-----------------
++
++- Issue #8013: time.asctime and time.ctime no longer call system
++  asctime and ctime functions.  The year range for time.asctime is now
++  1900 through maxint.  The range for time.ctime is the same as for
++  time.localtime.  The string produced by these functions is longer
++  than 24 characters when year is greater than 9999.
++
++- Issue #6608: time.asctime is now checking struct tm fields its input
++  before passing it to the system asctime.  Patch by MunSic Jeong.
++
++- Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
++  descriptor is provided.  Patch by Pascal Chambon.
++
++- Issue #7736: Release the GIL around calls to opendir() and closedir() in the
++  posix module.  Patch by Marcin Bachry.
++
++- Issue #4835: make PyLong_FromSocket_t() and PyLong_AsSocket_t() private to the
++  socket module, and fix the width of socket descriptors to be correctly
++  detected under 64-bit Windows.
++
++- Issue #1027206: Support IDNA in gethostbyname, gethostbyname_ex, getaddrinfo
++  and gethostbyaddr.  getnameinfo is now restricted to numeric addresses as
++  input.
++
++- Issue #9214: Set operations on a KeysView or ItemsView in collections now
++  correctly return a set.  Patch by Eli Bendersky.
++
++- Issue #5737: Add Solaris-specific mnemonics in the errno module.  Patch by
++  Matthew Ahrens.
++
++- Restore GIL in nis_cat in case of error. Decode NIS data to fs encoding, using
++  the surrogate error handler.
++
++- Issue #665761: ``functools.reduce()`` will no longer mask exceptions other
++  than ``TypeError`` raised by the iterator argument.
++
++- Issue #9570: Use PEP 383 decoding in os.mknod and os.mkfifo.
++
++- Issue #6915: Under Windows, os.listdir() didn't release the Global Interpreter
++  Lock around all system calls.  Original patch by Ryan Kelly.
++
++- Issue #8524: Add a detach() method to socket objects, so as to put the socket
++  into the closed state without closing the underlying file descriptor.
++
++- Issue #477863: Emit a ResourceWarning at shutdown if gc.garbage is not empty.
++
++- Issue #6869: Fix a refcount problem in the _ctypes extension.
++
++- Issue #5504: ctypes should now work with systems where mmap can't be
++  PROT_WRITE and PROT_EXEC.
++
++- Issue #9507: Named tuple repr will now automatically display the right name in
++  a tuple subclass.
++
++- Issue #9324: Add parameter validation to signal.signal on Windows in order to
++  prevent crashes.
++
++- Issue #9526: Remove some outdated (int) casts that were preventing the array
++  module from working correctly with arrays of more than 2**31 elements.
++
++- Fix memory leak in ssl._ssl._test_decode_cert.
++
++- Issue #8065: Fix memory leak in readline module (from failure to free the
++  result of history_get_history_state()).
++
++- Issue #9450: Fix memory leak in readline.replace_history_item and
++  readline.remove_history_item for readline version >= 5.0.
++
++- Issue #8105: Validate file descriptor passed to mmap.mmap on Windows.
++
++- Issue #8046: Add context manager protocol support and .closed property to mmap
++  objects.
++
++Library
++-------
++
++- Issue #7451: Improve decoding performance of JSON objects, and reduce the
++  memory consumption of said decoded objects when they use the same strings as
++  keys.
++
++- Issue #1100562: Fix deep-copying of objects derived from the list and dict
++  types.  Patch by Michele Orrù and Björn Lindqvist.
++
++- Issue #9753: Fixed socket.dup, which did not always work correctly on Windows.
++
++- Issue #9421: Made the get<type> methods consistently accept the vars and
++  default arguments on all parser classes.
++
++- Issue #7005: Fixed output of None values for RawConfigParser.write and
++  ConfigParser.write.
++
++- Issue #8990: array.fromstring() and array.tostring() get renamed to
++  frombytes() and tobytes(), respectively, to avoid confusion.  Furthermore,
++  array.frombytes(), array.extend() as well as the array.array() constructor now
++  accept bytearray objects.  Patch by Thomas Jollans.
++
++- Issue #808164: Fixed socket.close to avoid references to globals, to avoid
++  issues when socket.close is called from a __del__ method.
++
++- Issue #9706: ssl module provides a better error handling in various
++  circumstances.
++
++- Issue #1868: Eliminate subtle timing issues in thread-local objects by getting
++  rid of the cached copy of thread-local attribute dictionary.
++
++- Issue #1512791: In setframerate() in the wave module, non-integral frame rates
++  are rounded to the nearest integer.
++
++- Issue #8797: urllib2 does a retry for Basic Authentication failure instead of
++  falling into recursion.
++
++- Issue #1194222: email.utils.parsedate now returns RFC2822 compliant four
++  character years even if the message contains RFC822 two character years.
++
++- Issue #8750: Fixed MutableSet's methods to correctly handle reflexive
++  operations on its self, namely x -= x and x ^= x.
++
++- Issue #9129: smtpd.py is vulnerable to DoS attacks deriving from missing error
++  handling when accepting a new connection.
++
++- Issue #9601: ftplib now provides a workaround for non-compliant
++  implementations such as IIS shipped with Windows server 2003 returning invalid
++  response codes for MKD and PWD commands.
++
++- Issue #658749: asyncore's connect() method now correctly interprets winsock
++  errors.
++
++- Issue #9501: Fixed logging regressions in cleanup code.
++
++- Fix functools.total_ordering() to skip methods inherited from object.
++
++- Issue #9572: Importlib should not raise an exception if a directory it thought
++  it needed to create was done concurrently by another process.
++
++- Issue #9617: Signals received during a low-level write operation aren't
++  ignored by the buffered IO layer anymore.
++
++- Issue #843590: Make "macintosh" an alias to the "mac_roman" encoding.
++
++- Create os.fsdecode(): decode from the filesystem encoding with surrogateescape
++  error handler, or strict error handler on Windows.
++
++- Issue #3488: Provide convenient shorthand functions ``gzip.compress`` and
++  ``gzip.decompress``.  Original patch by Anand B. Pillai.
++
++- Issue #8807: poplib.POP3_SSL class now accepts a context parameter, which is a
++  ssl.SSLContext object allowing bundling SSL configuration options,
++  certificates and private keys into a single (potentially long-lived)
++  structure.
++
++- Issue #8866: parameters passed to socket.getaddrinfo can now be specified as
++  single keyword arguments.
++
++- Address XXX comment in dis.py by having inspect.py prefer to reuse the dis.py
++  compiler flag values over defining its own.
++
++- Issue #9147: Added dis.code_info() which is similar to show_code() but returns
++  formatted code information in a string rather than displaying on screen.
++
++- Issue #9567: functools.update_wrapper now adds a __wrapped__ attribute
++  pointing to the original callable.
++
++- Issue #3445: functools.update_wrapper now tolerates missing attributes on
++  wrapped callables.
++
++- Issue #5867: Add abc.abstractclassmethod and abc.abstractstaticmethod.
++
++- Issue #9605: posix.getlogin() decodes the username with file filesystem
++  encoding and surrogateescape error handler. Patch written by David Watson.
++
++- Issue #9604: posix.initgroups() encodes the username using the fileystem
++  encoding and surrogateescape error handler. Patch written by David Watson.
++
++- Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
++  using the filesystem encoding and surrogateescape error handler. Patch written
++  by David Watson.
++
++- Issue #7647: The posix module now has the ST_RDONLY and ST_NOSUID constants,
++  for use with the statvfs() function.  Patch by Adam Jackson.
++
++- Issue #8688: MANIFEST files created by distutils now include a magic comment
++  indicating they are generated.  Manually maintained MANIFESTs without this
++  marker will not be overwritten or removed.
++
++- Issue #7467: when reading a file from a ZIP archive, its CRC is checked and a
++  BadZipfile error is raised if it doesn't match (as used to be the case in
++  Python 2.5 and earlier).
++
++- Issue #9550: a BufferedReader could issue an additional read when the original
++  read request had been satisfied, which could block indefinitely when the
++  underlying raw IO channel was e.g. a socket.  Report and original patch by
++  Jason V. Miller.
++
++- Issue #3757: thread-local objects now support cyclic garbage collection.
++  Thread-local objects involved in reference cycles will be deallocated timely
++  by the cyclic GC, even if the underlying thread is still running.
++
++- Issue #9452: Add read_file, read_string, and read_dict to the configparser
++  API; new source attribute to exceptions.
++
++- Issue #6231: Fix xml.etree.ElementInclude to include the tail of the current
++  node.
++
++- Issue #8047: Fix the xml.etree serializer to return bytes by default.  Use
++  ``encoding="unicode"`` to generate a Unicode string.
++
++- Issue #8280: urllib2's Request method will remove fragments in the url.  This
++  is how it is supposed to work, wget and curl do the same.  Previous behavior
++  was wrong.
++
++- Issue #6683: For SMTP logins we now try all authentication methods advertised
++  by the server.  Many servers are buggy and advertise authentication methods
++  they do not support in reality.
++
++- Issue #8814: function annotations (the ``__annotations__`` attribute) are now
++  included in the set of attributes copied by default by functools.wraps and
++  functools.update_wrapper.  Patch by Terrence Cole.
++
++- Issue #2944: asyncore doesn't handle connection refused correctly.
++
++- Issue #4184: Private attributes on smtpd.SMTPChannel made public and deprecate
++  the private attributes. Add tests for smtpd module.
++
++- Issue #3196: email header decoding is now forgiving if an RFC2047 encoded word
++  encoded in base64 is lacking padding.
++
++- Issue #9444: Argparse now uses the first element of prefix_chars as the option
++  character for the added 'h/help' option if prefix_chars does not contain a
++  '-', instead of raising an error.
++
++- Issue #7372: Fix pstats regression when stripping paths from profile data
++  generated with the profile module.
++
++- Issue #9428: Fix running scripts with the profile/cProfile modules from the
++  command line.
++
++- Issue #7781: Fix restricting stats by entry counts in the pstats interactive
++  browser.
++
++- Issue #9209: Do not crash in the pstats interactive browser on invalid regular
++  expressions.
++
++- Update collections.OrderedDict to match the implementation in Py2.7 (based on
++  lists instead of weakly referenced Link objects).
++
++- Issue #8397: Raise an error when attempting to mix iteration and regular reads
++  on a BZ2File object, rather than returning incorrect results.
++
++- Issue #9448: Fix a leak of OS resources (mutexes or semaphores) when
++  re-initializing a buffered IO object by calling its ``__init__`` method.
++
++- Issue #1713: Fix os.path.ismount(), which returned true for symbolic links
++  across devices.
++
++- Issue #8826: Properly load old-style "expires" attribute in http.cookies.
++
++- Issue #1690103: Fix initial namespace for code run with trace.main().
++
++- Issue #7395: Fix tracebacks in pstats interactive browser.
++
++- Issue #8230: Fix Lib/test/sortperf.py.
++
++- Issue #8620: when a cmd.Cmd() is fed input that reaches EOF without a final
++  newline, it no longer truncates the last character of the last command line.
++
++- Issue #5146: Handle UID THREAD command correctly in imaplib.
++
++- Issue #5147: Fix the header generated for cookie files written by
++  http.cookiejar.MozillaCookieJar.
++
++- Issue #8198: In pydoc, output all help text to the correct stream when
++  sys.stdout is reassigned.
++
++- Issue #7909: Do not touch paths with the special prefixes ``\\.\`` or ``\\?\``
++  in ntpath.normpath().
++
++- Issue #1286: Allow using fileinput.FileInput as a context manager.
++
++- Add lru_cache() decorator to the functools module.
++
++Tools/Demos
++-----------
++
++- Fix ``Tools/scripts/checkpyc.py`` after PEP 3147.
++
++- Issue #8867: Fix ``Tools/scripts/serve.py`` to work with files containing
++  non-ASCII content.
++
++Tests
++-----
++
++- Issue #9601: Provide a test case for ftplib.parse257.
++
++- Issue #8857: Provide a test case for socket.getaddrinfo.
++
++- Issue #7564: Skip test_ioctl if another process is attached to /dev/tty.
++
++- Issue #8433: Fix test_curses failure with newer versions of ncurses.
++
++- Issue #9496: Provide a test suite for the rlcompleter module.  Patch by
++  Michele Orrù.
++
++- Issue #8687: provide a test suite for sched.py module.
++
++Build
++-----
++
++- Issue #1303434: Generate ZIP file containing all PDBs.
++
++- Issue #9193: PEP 3149 is accepted.
++
++- Issue #3101: Helper functions _add_one_to_index_C() and _add_one_to_index_F()
++  become _Py_add_one_to_index_C() and _Py_add_one_to_index_F(), respectively.
++
++- Issue #9700: define HAVE_BROKEN_POSIX_SEMAPHORES under AIX 6.x.  Patch by
++  Sébastien Sablé.
++
++- Don't run pgen twice when using make -j.
++
++
++What's New in Python 3.2 Alpha 1?
++=================================
++
++*Release date: 01-Aug-2010*
++
++Core and Builtins
++-----------------
++
++- Issue #8991: convertbuffer() rejects discontigious buffers.
++
++- Issue #7616: Fix copying of overlapping memoryview slices with the Intel
++  compiler.
++
++- Issue #8413: structsequence now subclasses tuple.
++
++- Issue #8271: during the decoding of an invalid UTF-8 byte sequence, only the
++  start byte and the continuation byte(s) are now considered invalid, instead of
++  the number of bytes specified by the start byte.  E.g.:
++  '\xf1\x80AB'.decode('utf-8', 'replace') now returns u'\ufffdAB' and replaces
++  with U+FFFD only the start byte ('\xf1') and the continuation byte ('\x80')
++  even if '\xf1' is the start byte of a 4-bytes sequence.  Previous versions
++  returned a single u'\ufffd'.
++
++- Issue #9011: A negated imaginary literal (e.g., "-7j") now has real part -0.0
++  rather than 0.0.  So "-7j" is now exactly equivalent to "-(7j)".
++
++- Be more specific in error messages about positional arguments.
++
++- Issue #8949: "z" format of PyArg_Parse*() functions doesn't accept bytes
++  objects, as described in the documentation.
++
++- Issue #6543: Write the traceback in the terminal encoding instead of utf-8.
++  Fix the encoding of the modules filename.  Patch written by Amaury Forgeot
++  d'Arc.
++
++- Issue #9011: Remove buggy and unnecessary (in 3.x) ST->AST compilation code
++  dealing with unary minus applied to a constant.  The removed code was mutating
++  the ST, causing a second compilation to fail.
++
++- Issue #850997: mbcs encoding (Windows only) handles errors argument: strict
++  mode raises unicode errors.  The encoder only supports "strict" and "replace"
++  error handlers, the decoder only supports "strict" and "ignore" error
++  handlers.  Patch written by Mark Hammond.
++
++- Issue #8850: Remove "w" and "w#" formats from PyArg_Parse*() functions, use
++  "w*" format instead. Add tests for "w*" format.
++
++- Issue #8592: PyArg_Parse*() functions raise a TypeError for "y", "u" and "Z"
++  formats if the string contains a null byte/character.  Write unit tests for
++  string formats.
++
++- Issue #7490: To facilitate sharing of doctests between 2.x and 3.x test
++  suites, the IGNORE_EXCEPTION_DETAIL directive now also ignores the module
++  location of the raised exception.
++
++- Issue #8969: On Windows, use mbcs codec in strict mode to encode and decode
++  filenames and enable os.fsencode().
++
++- Issue #9058: Remove assertions about INT_MAX in UnicodeDecodeError.
++
++- Issue #8941: Decoding big endian UTF-32 data in UCS-2 builds could crash the
++  interpreter with characters outside the Basic Multilingual Plane (higher than
++  0x10000).
++
++- Issue #8950: (See also issue #5080).  Py_ArgParse*() functions now raise
++  TypeError instead of giving a DeprecationWarning when a float is parsed using
++  the 'L' code (for long long).  (All other integer codes already raise
++  TypeError in this case.)
++
++- Issue #8922: Normalize the encoding name in PyUnicode_AsEncodedString() to
++  enable shortcuts for upper case encoding name. Add also a shortcut for
++  "iso-8859-1" in PyUnicode_AsEncodedString() and PyUnicode_Decode().
++
++- Issue #8838: Remove codecs.charbuffer_encode() function.  The buffer protocol
++  doesn't support "char buffer" anymore in Python 3.
++
++- Issue #8339: Remove "t#" format of PyArg_Parse*() functions, use "s#" or "s*"
++  instead.  codecs.charbuffer_encode() now accepts modifiable buffer objects
++  like bytearray.
++
++- Issue #8837: Remove "O?" format of PyArg_Parse*() functions.  The format is no
++  used anymore and it was never documented.
++
++- In str.format(), raise a ValueError when indexes to arguments are too large.
++
++- Issue #2844: Make int('42', n) consistently raise ValueError for invalid
++  integers n (including n = -909).
++
++- Issue #8188: Introduce a new scheme for computing hashes of numbers (instances
++  of int, float, complex, decimal.Decimal and fractions.Fraction) that makes it
++  easy to maintain the invariant that hash(x) == hash(y) whenever x and y have
++  equal value.
++
++- Issue #8748: Fix two issues with comparisons between complex and integer
++  objects.  (1) The comparison could incorrectly return True in some cases
++  (2**53+1 == complex(2**53) == 2**53), breaking transitivity of equality.
++  (2) The comparison raised an OverflowError for large integers, leading to
++  unpredictable exceptions when combining integers and complex objects in sets
++  or dicts.
++
++- Issue #8766: Initialize _warnings module before importing the first module.
++  Fix a crash if an empty directory called "encodings" exists in sys.path.
++
++- Issue #8589: Decode PYTHONWARNINGS environment variable with the file system
++  encoding and surrogateescape error handler instead of the locale encoding to
++  be consistent with os.environ.  Add PySys_AddWarnOptionUnicode() function.
++
++- PyObject_Dump() encodes unicode objects to utf8 with backslashreplace (instead
++  of strict) error handler to escape surrogates.
++
++- Issue #8715: Create PyUnicode_EncodeFSDefault() function: Encode a Unicode
++  object to Py_FileSystemDefaultEncoding with the "surrogateescape" error
++  handler, and return bytes.  If Py_FileSystemDefaultEncoding is not set, fall
++  back to UTF-8.
++
++- Enable shortcuts for common encodings in PyUnicode_AsEncodedString() for any
++  error handler, not only the default error handler (strict).
++
++- Issue #8610: Load file system codec at startup, and display a fatal error on
++  failure.  Set the file system encoding to utf-8 (instead of None) if getting
++  the locale encoding failed, or if nl_langinfo(CODESET) function is missing.
++
++- PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead of
++  PyUnicode_FromString() to support surrogates in the filename and use the right
++  encoding.
++
++- Issue #7507: Quote "!" in pipes.quote(); it is special to some shells.
++
++- PyUnicode_DecodeFSDefaultAndSize() uses surrogateescape error handler.
++
++- Issue #8419: Prevent the dict constructor from accepting non-string keyword
++  arguments.
++
++- Issue #8124: PySys_WriteStdout() and PySys_WriteStderr() don't execute
++  indirectly Python signal handlers anymore because mywrite() ignores exceptions
++  (KeyboardInterrupt).
++
++- Issue #8092: Fix PyUnicode_EncodeUTF8() to support error handler producing
++  unicode string (eg. backslashreplace).
++
++- Issue #8485: PyUnicode_FSConverter() doesn't accept byteearray objects
++  anymore, you have to convert your bytearray filenames to bytes.
++
++- Issue #7332: Remove the 16KB stack-based buffer in
++  PyMarshal_ReadLastObjectFromFile, which doesn't bring any noticeable benefit
++  compared to the dynamic memory allocation fallback.  Patch by Charles-François
++  Natali.
++
++- Issue #8417: Raise an OverflowError when an integer larger than sys.maxsize is
++  passed to bytes or bytearray.
++
++- Issue #7301: Add environment variable $PYTHONWARNINGS.
++
++- Issue #8329: Don't return the same lists from select.select when no fds are
++  changed.
++
++- Issue #8259: 1L << (2**31) no longer produces an 'outrageous shift error' on
++  64-bit machines.  The shift count for either left or right shift is permitted
++  to be up to sys.maxsize.
++
++- Ensure that tokenization of identifiers is not affected by locale.
++
++- Issue #1222585: Added LDCXXSHARED for C++ support. Patch by Arfrever.
++
++- Raise a TypeError when trying to delete a T_STRING_INPLACE struct member.
++
++- Issue #8211: Save/restore CFLAGS around AC_PROG_CC in configure.in, in case it
++  is set.
++
++- Issue #8226: sys.setfilesystemencoding() raises a LookupError if the encoding
++  is unknown.
++
++- Issue #1583863: A str subclass can now override the __str__ method.
++
++- Issue #8014: Setting a T_UINT or T_PYSSIZET attribute of an object with
++  PyMemberDefs could produce an internal error; raise TypeError instead.
++
++- Issue #7845: Rich comparison methods on the complex type now return
++  NotImplemented rather than raising a TypeError when comparing with an
++  incompatible type; this allows user-defined classes to implement their own
++  comparisons with complex.
++
++- Issue #3137: Don't ignore errors at startup, especially a keyboard interrupt
++  (SIGINT). If an error occurs while importing the site module, the error is
++  printed and Python exits. Initialize the GIL before importing the site module.
++
++- Issue #7173: Generator finalization could invalidate sys.exc_info().
++
++- Issue #7544: Preallocate thread memory before creating the thread to avoid a
++  fatal error in low memory condition.
++
++- Issue #7820: The parser tokenizer restores all bytes in the right if the BOM
++  check fails.
++
++- Handle errors from looking up __prepare__ correctly.
++
++- Issue #5939: Add additional runtime checking to ensure a valid capsule in
++  Modules/_ctypes/callproc.c.
++
++- Issue #7309: Fix unchecked attribute access when converting
++  UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings.
++
++- Issue #6902: Fix problem with built-in types format incorrectly with 0
++  padding.
++
++- Issue #7988: Fix default alignment to be right aligned for complex.__format__.
++  Now it matches other numeric types.
++
++- Issue #5988: Remove deprecated functions PyOS_ascii_formatd,
++  PyOS_ascii_strtod, and PyOS_ascii_atof.  Use PyOS_double_to_string and
++  PyOS_string_to_double instead.  See issue #5835 for the original deprecations.
++
++- Issue #7385: Fix a crash in `MemoryView_FromObject` when `PyObject_GetBuffer`
++  fails.  Patch by Florent Xicluna.
++
++- Issue #7788: Fix an interpreter crash produced by deleting a list slice with
++  very large step value.
++
++- Issue #7766: Change sys.getwindowsversion() return value to a named tuple and
++  add the additional members returned in an OSVERSIONINFOEX structure.  The new
++  members are service_pack_major, service_pack_minor, suite_mask, and
++  product_type.
++
++- Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`) could
++  crash in many places because of the PyByteArray_AS_STRING() macro returning
++  NULL.  The macro now returns a statically allocated empty string instead.
++
++- Issue #6690: Optimize the bytecode for expressions such as `x in {1, 2, 3}`,
++  where the right hand operand is a set of constants, by turning the set into a
++  frozenset and pre-building it as a constant.  The comparison operation is made
++  against the constant instead of building a new set each time it is executed (a
++  similar optimization already existed which turned a list of constants into a
++  pre-built tuple).  Patch and additional tests by Dave Malcolm.
++
++- Issue #7622: Improve the split(), rsplit(), splitlines() and replace() methods
++  of bytes, bytearray and unicode objects by using a common implementation based
++  on stringlib's fast search.  Patch by Florent Xicluna.
++
++- Issue #7632: Fix various str -> float conversion bugs present in 2.7 alpha 2,
++  including: (1) a serious 'wrong output' bug that could occur for long (> 40
++  digit) input strings, (2) a crash in dtoa.c that occurred in debug builds when
++  parsing certain long numeric strings corresponding to subnormal values, (3) a
++  memory leak for some values large enough to cause overflow, and (4) a number
++  of flaws that could lead to incorrectly rounded results.
++
++- The __complex__ method is now looked up on the class of instances to make it
++  consistent with other special methods.
++
++- Issue #7462: Implement the stringlib fast search algorithm for the `rfind`,
++  `rindex`, `rsplit` and `rpartition` methods.  Patch by Florent Xicluna.
++
++- Issue #7604: Deleting an unset slotted attribute did not raise an
++  AttributeError.
++
++- Issue #7534: Fix handling of IEEE specials (infinities, nans, negative zero)
++  in ** operator.  The behaviour now conforms to that described in C99 Annex F.
++
++- Issue #1811: improve accuracy and cross-platform consistency for true division
++  of integers: the result of a/b is now correctly rounded for ints a and b (at
++  least on IEEE 754 platforms), and in particular does not depend on the
++  internal representation of an int.
++
++- Issue #6834: replace the implementation for the 'python' and 'pythonw'
++  executables on OSX.
++
++  These executables now work properly with the arch(1) command: ``arch -ppc
++  python`` will start a universal binary version of python in PPC mode (unlike
++  previous releases).
++
++- Issue #7466: Segmentation fault when the garbage collector is called in the
++  middle of populating a tuple.  Patch by Florent Xicluna.
++
++- Issue #7419: setlocale() could crash the interpreter on Windows when called
++  with invalid values.
++
++- Issue #6077: On Windows, files opened with tempfile.TemporaryFile in "wt+"
++  mode would appear truncated on the first '0x1a' byte (aka. Ctrl+Z).
++
++- Issue #7085: Fix crash when importing some extensions in a thread on MacOSX
++  10.6.
++
++- Issue #1757126: Fix the cyrillic-asian alias for the ptcp154 encoding.
++
++- Issue #6970: Remove redundant calls when comparing objects that don't
++  implement the relevant rich comparison methods.
++
++- Issue #7298: Fixes for range and reversed(range(...)).  Iteration over
++  range(a, b, c) incorrectly gave an empty iterator when a, b and c fit in C
++  long but the length of the range did not.  Also fix several cases where
++  reversed(range(a, b, c)) gave wrong results, and fix a refleak for
++  reversed(range(a, b, c)) with large arguments.
++
++- Issue #7244: itertools.izip_longest() no longer ignores exceptions raised
++  during the formation of an output tuple.
++
++- Issue #3297: On wide unicode builds, do not split unicode characters into
++  surrogates.
++
++- Remove length limitation when constructing a complex number from a string.
++
++- Issue #1087418: Boost performance of bitwise operations for longs.
++
++- Support for AtheOS has been completely removed from the code base. It was
++  disabled since Python 3.0.
++
++- Support for several legacy threading libraries has been disabled. These
++  libraries are: Mach C threads, SunOS LWP, GNU pth, Irix threads. Support code
++  will be entirely removed in 3.3.
++
++- Support for OSF* has been disabled. If nobody stands up, support will be
++  removed in 3.3. See <http://bugs.python.org/issue8606>.
++
++- Peephole constant folding had missed UNARY_POSITIVE.
++
++- Issue #1722344: threading._shutdown() is now called in Py_Finalize(), which
++  fixes the problem of some exceptions being thrown at shutdown when the
++  interpreter is killed. Patch by Adam Olsen.
++
++- Issue #7147: Remove support for compiling Python without complex number
++  support.
++
++- Issue #7120: logging: Removed import of multiprocessing which is causing crash
++  in GAE.
++
++- Issue #1754094: Improve the stack depth calculation in the compiler.  There
++  should be no other effect than a small decrease in memory use.  Patch by
++  Christopher Tur Lesniewski-Laas.
++
++- Issue #7065: Fix a crash in bytes.maketrans and bytearray.maketrans when using
++  byte values greater than 127.  Patch by Derk Drukker.
++
++- Issue #1571184: The Unicode database contains properties for more characters.
++  The tables for code points representing numeric values, white spaces or line
++  breaks are now generated from the official Unicode Character Database files,
++  and include information from the Unihan.txt file.
++
++- Issue #7019: Raise ValueError when unmarshalling bad long data, instead of
++  producing internally inconsistent Python longs.
++
++- Issue #6990: Fix threading.local subclasses leaving old state around after a
++  reference cycle GC which could be recycled by new locals.
++
++- Issue #5460: Fix an ambiguity in the grammar.
++
++- Issue #1766304: Improve performance of membership tests on range objects.
++
++- Issue #6713: Improve performance of integer -> string conversions.
++
++- Issue #6846: Fix bug where bytearray.pop() returns negative integers.
++
++- Issue #6750: A text file opened with io.open() could duplicate its output when
++  writing from multiple threads at the same time.
++
++- Issue #6707: dir() on an uninitialized module caused a crash.
++
++- Issue #6540: Fixed crash for bytearray.translate() with invalid parameters.
++
++- Issue #6573: set.union() stopped processing inputs if an instance of self
++  occurred in the argument chain.
++
++- Issue #6070: On posix platforms import no longer copies the execute bit from
++  the .py file to the .pyc file if it is set.
++
++- Issue #1616979: Added the cp720 (Arabic DOS) encoding.
++
++- Issue #6428: Since Python 3.0, the __bool__ method must return a bool object,
++  and not an int.  Fix the corresponding error message, and the documentation.
++
++- The deprecated PyCObject has been removed.
++
++- Issue #6347: Include inttypes.h as well as stdint.h in pyport.h.  This fixes a
++  build failure on HP-UX: int32_t and uint32_t are defined in inttypes.h instead
++  of stdint.h on that platform.
++
++- Issue #6373: Fixed a SystemError when encoding with the latin-1 codec and the
++  'surrogateescape' error handler, a string which contains unpaired surrogates.
++
++- Issue #4856: Remove checks for win NT.
++
++- Issue #6687: PyBytes_FromObject() no longer accepts an integer as its argument
++  to construct a null-initialized bytes object.
++
++- Issue #1023290: Add from_bytes() and to_bytes() methods to integers.  These
++  methods allow the conversion of integers to bytes, and vice-versa.
++
++- Issue #7382: Fix bug in bytes.__getnewargs__ that prevented bytes instances
++  from being copied with copy.copy(), and bytes subclasses from being pickled
++  properly.
++
++- Code objects now support weak references.
++
++- Issue #7072: isspace(0xa0) is true on Mac OS X.
++
++- Issue #8084: PEP 370 now conforms to system conventions for framework builds
++  on MacOS X. That is, "python setup.py install --user" will install into
++  "~/Library/Python/2.7" instead of "~/.local".
++
++C-API
++-----
++
++- Issue #2443: A new macro, `Py_VA_COPY`, copies the state of the
++  variable argument list.  `Py_VA_COPY` is equivalent to C99
++  `va_copy`, but available on all python platforms.
++
++- PySlice_GetIndicesEx now clips the step to [-PY_SSIZE_T_MAX, PY_SSIZE_T_MAX]
++  instead of [-PY_SSIZE_T_MAX-1, PY_SSIZE_T_MAX].  This makes it safe to do
++  "step = -step" when reversing a slice.
++
++- Issue #5753: A new C API function, `PySys_SetArgvEx`, allows embedders of the
++  interpreter to set sys.argv without also modifying sys.path.  This helps fix
++  `CVE-2008-5983
++  <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
++
++- Add PyArg_ValidateKeywordArguments, which checks if all keyword arguments are
++  strings in an efficient manner.
++
++- Issue #8276: PyEval_CallObject() is now only available in macro form.  The
++  function declaration, which was kept for backwards compatibility reasons, is
++  now removed (the macro was introduced in 1997!).
++
++- Issue #7767: New function PyLong_AsLongLongAndOverflow added, analogous to
++  PyLong_AsLongAndOverflow.
++
++- Make PyUnicode_CompareWithASCIIString return not equal if the Python string
++  has '\0' at the end.
++
++- Issue #5080: The argument parsing functions PyArg_ParseTuple,
++  PyArg_ParseTupleAndKeywords, PyArg_VaParse, PyArg_VaParseTupleAndKeywords and
++  PyArg_Parse now raise a DeprecationWarning for float arguments passed with the
++  'L' format code.  This will become a TypeError in a future version of Python,
++  to match the behaviour of the other integer format codes.
++
++- Issue #7033: Function ``PyErr_NewExceptionWithDoc()`` added.
++
++- Issue #7414: 'C' code wasn't being skipped properly (for keyword arguments) in
++  PyArg_ParseTupleAndKeywords.
++
++- Issue #7228: Add '%lld' and '%llu' support to PyString_FromFormat(V) and
++  PyErr_Format, on machines with HAVE_LONG_LONG defined.
++
++- Issue #6151: Made PyDescr_COMMON conform to standard C (like PyObject_HEAD in
++  PEP 3123).  The PyDescr_TYPE and PyDescr_NAME macros should be should used for
++  accessing the d_type and d_name members of structures using PyDescr_COMMON.
++
++- Issue #6405: Remove duplicate type declarations in descrobject.h.
++
++- The code flags for old __future__ features are now available again.
++
++- Issue #5954: Add a PyFrame_GetLineNumber() function to replace most uses of
++  PyCode_Addr2Line().
++
++- Issue #5959: Add a PyCode_NewEmpty() function to create a new empty code
++  object at a specified file, function, and line number.
++
++- Issue #1419652: Change the first argument to PyImport_AppendInittab() to
++  ``const char *`` as the string is stored beyond the call.
++
++- Issue #2422: When compiled with the ``--with-valgrind`` option, the pymalloc
++  allocator will be automatically disabled when running under Valgrind.  This
++  gives improved memory leak detection when running under Valgrind, while taking
++  advantage of pymalloc at other times.
++
++Library
++-------
++
++- In pdb, when Ctrl-C is entered while defining commands for a breakpoint, the
++  old commands are restored.
++
++- For traceback debugging, the pdb listing now also shows the locations where
++  the exception was originally (re)raised, if it differs from the last line
++  executed (e.g. in case of finally clauses).
++
++- The pdb command "source" has been added.  It displays the source code for a
++  given object, if possible.
++
++- The pdb command "longlist" has been added.  It displays the whole source code
++  for the current function.
++
++- Issue #1503502: Make pdb.Pdb easier to subclass by putting message and error
++  output into methods.
++
++- Issue #809887: Make the output of pdb's breakpoint deletions more consistent;
++  emit a message when a breakpoint is enabled or disabled.
++
++- Issue #5294: Fix the behavior of pdb's "continue" command when called in the
++  top-level debugged frame.
++
++- Issue #5727: Restore the ability to use readline when calling into pdb in
++  doctests.
++
++- Issue #6719: In pdb, do not stop somewhere in the encodings machinery if the
++  source file to be debugged is in a non-builtin encoding.
++
++- Issue #8048: Prevent doctests from failing when sys.displayhook has been
++  reassigned.
++
++- Issue #8015: In pdb, do not crash when an empty line is entered as a
++  breakpoint command.
++
++- In pdb, allow giving a line number to the "until" command.
++
++- Issue #1437051: For pdb, allow "continue" and related commands in .pdbrc
++  files.  Also, add a command-line option "-c" that runs a command as if given
++  in .pdbrc.
++
++- Issue #4179: In pdb, allow "list ." as a command to return to the currently
++  debugged line.
++
++- Issue #4108: In urllib.robotparser, if there are multiple ``User-agent: *``
++  entries, consider the first one.
++
++- Issue #6630: Allow customizing regex flags when subclassing the
++  string.Template class.
++
++- Issue #9411: Allow specifying an encoding for config files in the configparser
++  module.
++
++- Issue #1682942: Improvements to configparser: support alternate delimiters,
++  alternate comment prefixes and empty lines in values.
++
++- Issue #9354: Provide getsockopt() in asyncore's file_wrapper.
++
++- Issue #8966: ctypes: Remove implicit bytes-unicode conversion.
++
++- Issue #9378: python -m pickle <pickle file> will now load and display the
++  first object in the pickle file.
++
++- Issue #4770: Restrict binascii module to accept only bytes (as specified).
++  And fix the email package to encode to ASCII instead of ``raw-unicode-escape``
++  before ASCII-to-binary decoding.
++
++- Issue #9384: ``python -m tkinter`` will now display a simple demo applet.
++
++- The default size of the re module's compiled regular expression cache has been
++  increased from 100 to 500 and the cache replacement policy has changed from
++  simply clearing the entire cache on overflow to forgetting the least recently
++  used cached compiled regular expressions.  This is a performance win for
++  applications that use a lot of regular expressions and limits the impact of
++  the performance hit anytime the cache is exceeded.
++
++- Issue #7113: Speed up loading in configparser. Patch by Łukasz Langa.
++
++- Issue #9032: XML-RPC client retries the request on EPIPE error.  The EPIPE
++  error occurs when the server closes the socket and the client sends a big
++  XML-RPC request.
++
++- Issue #4629: getopt raises an error if an argument ends with "=", whereas
++  getopt doesn't accept a value (eg. --help= is rejected if getopt uses
++  ['help='] long options).
++
++- Issue #7989: Added pure python implementation of the `datetime` module.  The C
++  module is renamed to `_datetime` and if available, overrides all classes
++  defined in datetime with fast C impementation.  Python implementation is based
++  on the original python prototype for the datetime module by Tim Peters with
++  minor modifications by the PyPy project.  The test suite now tests `datetime`
++  module with and without `_datetime` acceleration using the same test cases.
++
++- Issue #7895: platform.mac_ver() no longer crashes after calling os.fork().
++
++- Issue #9323: Fixed a bug in trace.py that resulted in loosing the name of the
++  script being traced.  Patch by Eli Bendersky.
++
++- Issue #9282: Fixed --listfuncs option of trace.py.  Thanks Eli Bendersky for
++  the patch.
++
++- Issue #3704: http.cookiejar was not properly handling URLs with a / in the
++  parameters.
++
++- Issue #9268: ``pickletools.dis()`` now has an optional *annotate* argument
++  which controls printing of opcode descriptions in ``dis()`` output.
++
++- Issue #1555570: email no longer inserts extra blank lines when a \r\n combo
++  crosses an 8192 byte boundary.
++
++- Issue #9243: Fix sndhdr module and add unit tests, contributed by James Lee.
++
++- ``ast.literal_eval()`` now allows byte literals.
++
++- Issue #9137: Fix issue in MutableMapping.update, which incorrectly treated
++  keyword arguments called 'self' or 'other' specially.
++
++- ``ast.literal_eval()`` now allows set literals.
++
++- Issue #9164: Ensure that sysconfig handles duplicate -arch flags in CFLAGS.
++
++- Issue #7646: The fnmatch pattern cache no longer grows without bound.
++
++- Issue #9136: Fix 'dictionary changed size during iteration' RuntimeError
++  produced when profiling the decimal module.  This was due to a dangerous
++  iteration over 'locals()' in Context.__init__.
++
++- Fix extreme speed issue in Decimal.pow when the base is an exact power of 10
++  and the exponent is tiny (for example, ``Decimal(10) **
++  Decimal('1e-999999999')``).
++
++- Issue #9186: Fix math.log1p(-1.0) to raise ValueError, not OverflowError.
++
++- Issue #9130: Fix validation of relative imports in parser module.
++
++- Issue #9128: Fix validation of class decorators in parser module.
++
++- Issue #9094: python -m pickletools will now disassemble pickle files listed in
++  the command line arguments.  See output of python -m pickletools -h for more
++  details.
++
++- Issue #5468: urlencode to handle bytes type and other encodings in its query
++  parameter. Patch by Dan Mahn.
++
++- Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop module,
++  ensure that the input string length is a multiple of the frame size.
++
++- Issue #6507: Accept source strings in dis.dis().  Original patch by Daniel
++  Urban.
++
++- Issue #7829: Clearly document that the dis module is exposing an
++  implementation detail that is not stable between Python VMs or releases.
++
++- Issue #6589: cleanup asyncore.socket_map in case smtpd.SMTPServer constructor
++  raises an exception.
++
++- Issue #9110: Addition of ContextDecorator to contextlib, for creating APIs
++  that act as both context managers and decorators. contextmanager changes to
++  use ContextDecorator.
++
++- Implement importlib.abc.SourceLoader and deprecate PyLoader and PyPycLoader
++  for removal in Python 3.4.
++
++- Issue #9064: pdb's "up" and "down" commands now accept an optional argument
++  giving the number of frames to go.
++
++- Issue #9018: os.path.normcase() now raises a TypeError if the argument is not
++  ``str`` or ``bytes``.
++
++- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag on an
++  OpenSSL structure.
++
++- Issue #8682: The ssl module now temporary increments the reference count of a
++  socket object got through ``PyWeakref_GetObject``, so as to avoid possible
++  deallocation while the object is still being used.
++
++- Issue #1368368: FancyURLOpener class changed to throw an Exception on wrong
++  password instead of presenting an interactive prompt.  Older behavior can be
++  obtained by passing retry=True to http_error_xxx methods of FancyURLOpener.
++
++- Issue #8720: Fix regression caused by fix for #4050 by making getsourcefile
++  smart enough to find source files in the linecache.
++
++- Issue #5610: feedparser no longer eats extra characters at the end of a body
++  part if the body part ends with a ``\r\n``.
++
++- Issue #8986: math.erfc was incorrectly raising OverflowError for values
++  between -27.3 and -30.0 on some platforms.
++
++- Issue #8784: Set tarfile default encoding to 'utf-8' on Windows.
++
++- Issue #8966: If a ctypes structure field is an array of c_char, convert its
++  value to bytes instead of str (as done for c_char and c_char_p).
++
++- Issue #8188: Comparisons between Decimal and Fraction objects are now
++  permitted, returning a result based on the exact numerical values of the
++  operands.  This builds on issue #2531, which allowed Decimal-to-float
++  comparisons; all comparisons involving numeric types (bool, int, float,
++  complex, Decimal, Fraction) should now act as expected.
++
++- Issue #8897: Fix sunau module, use bytes to write the header. Patch written by
++  Thomas Jollans.
++
++- Issue #8899: time.struct_time now has class and attribute docstrings.
++
++- Issue #6470: Drop UNC prefix in FixTk.
++
++- Issue #4768: base64 encoded email body parts were incorrectly stored as binary
++  strings.  They are now correctly converted to strings.
++
++- Issue #8833: tarfile created hard link entries with a size field != 0 by
++  mistake.
++
++- Charset.body_encode now correctly handles base64 encoding by encoding with the
++  output_charset before calling base64mime.encode.  Passes the tests from 2.x
++  issue #1368247.
++
++- Issue #8845: sqlite3 Connection objects now have a read-only in_transaction
++  attribute that is True iff there are uncommitted changes.
++
++- Issue #1289118: datetime.timedelta objects can now be multiplied by float and
++  divided by float and int objects.  Results are rounded to the nearest multiple
++  of timedelta.resolution with ties resolved using round-half-to-even method.
++
++- Issue #7150: Raise OverflowError if the result of adding or subtracting
++  timedelta from date or datetime falls outside of the MINYEAR:MAXYEAR range.
++
++- Issue #8806: add SSL contexts support to ftplib.
++
++- Issue #4769: Fix main() function of the base64 module, use sys.stdin.buffer
++  and sys.stdout.buffer (instead of sys.stdin and sys.stdout) to use the bytes
++  API.
++
++- Issue #8770: Now sysconfig displays information when it's called as a script.
++  Initial idea by Sridhar Ratnakumar.
++
++- Issue #6662: Fix parsing of malformatted charref (&#bad;), patch written by
++  Fredrik Håård.
++
++- Issue #8540: Decimal module: rename the Context._clamp attribute to
++  Context.clamp and make it public.  This is useful in creating contexts that
++  correspond to the decimal interchange formats specified in IEEE 754.
++
++- Issue #6268: Fix seek() method of codecs.open(), don't read or write the BOM
++  twice after seek(0). Fix also reset() method of codecs, UTF-16, UTF-32 and
++  StreamWriter classes.
++
++- Issue #3798: sys.exit(message) writes the message to sys.stderr file, instead
++  of the C file stderr, to use stderr encoding and error handler.
++
++- Issue #8782: Add a trailing newline in linecache.updatecache to the last line
++  of files without one.
++
++- Issue #8729: Return NotImplemented from collections.Mapping.__eq__ when
++  comparing to a non-mapping.
++
++- Issue #8774: tabnanny uses the encoding cookie (#coding:...) to use the
++  correct encoding.
++
++- Issue #4870: Add an `options` attribute to SSL contexts, as well as several
++  ``OP_*`` constants to the `ssl` module.  This allows to selectively disable
++  protocol versions, when used in combination with `PROTOCOL_SSLv23`.
++
++- Issue #8759: Fixed user paths in sysconfig for posix and os2 schemes.
++
++- Issue #8663: distutils.log emulates backslashreplace error handler. Fix
++  compilation in a non-ASCII directory if stdout encoding is ASCII (eg. if
++  stdout is not a TTY).
++
++- Issue #8513: os.get_exec_path() supports b'PATH' key and bytes value.
++  subprocess.Popen() and os._execvpe() support bytes program name. Add
++  os.supports_bytes_environ flag: True if the native OS type of the environment
++  is bytes (eg. False on Windows).
++
++- Issue #8633: tarfile is now able to read and write archives with "raw" binary
++  pax headers as described in POSIX.1-2008.
++
++- Issue #1285086: Speed up urllib.parse functions: quote, quote_from_bytes,
++  unquote, unquote_to_bytes.
++
++- Issue #8688: Distutils now recalculates MANIFEST everytime.
++
++- Issue #8477: ssl.RAND_egd() and ssl._test_decode_cert() support str with
++  surrogates and bytes for the filename.
++
++- Issue #8550: Add first class ``SSLContext`` objects to the ssl module.
++
++- Issue #8681: Make the zlib module's error messages more informative when the
++  zlib itself doesn't give any detailed explanation.
++
++- The audioop module now supports sound fragments of length greater than 2**31
++  bytes on 64-bit machines, and is PY_SSIZE_T_CLEAN.
++
++- Issue #4972: Add support for the context manager protocol to the ftplib.FTP
++  class.
++
++- Issue #8664: In py_compile, create __pycache__ when the compiled path is
++  given.
++
++- Issue #8514: Add os.fsencode() function (Unix only): encode a string to bytes
++  for use in the file system, environment variables or the command line.
++
++- Issue #8571: Fix an internal error when compressing or decompressing a chunk
++  larger than 1GB with the zlib module's compressor and decompressor objects.
++
++- Issue #8603: Support bytes environmental variables on Unix: Add os.environb
++  mapping and os.getenvb() function. os.unsetenv() encodes str argument to the
++  file system encoding with the surrogateescape error handler (instead of
++  utf8/strict) and accepts bytes. posix.environ keys and values are now bytes.
++
++- Issue #8573: asyncore _strerror() function might throw ValueError.
++
++- Issue #8483: asyncore.dispatcher's __getattr__ method produced confusing error
++  messages when accessing undefined class attributes because of the cheap
++  inheritance with the underlying socket object.  The cheap inheritance has been
++  deprecated.
++
++- Issue #4265: shutil.copyfile() was leaking file descriptors when disk fills.
++  Patch by Tres Seaver.
++
++- Issue #8390: tarfile uses surrogateescape as the default error handler
++  (instead of replace in read mode or strict in write mode).
++
++- Issue #7755: Use an unencumbered audio file for tests.
++
++- Issue #8621: uuid.uuid4() returned the same sequence of values in the parent
++  and any children created using ``os.fork`` on MacOS X 10.6.
++
++- Issue #8567: Fix precedence of signals in Decimal module: when a Decimal
++  operation raises multiple signals and more than one of those signals is
++  trapped, the specification determines the order in which the signals should be
++  handled.  In many cases this order wasn't being followed, leading to the wrong
++  Python exception being raised.
++
++- Issue #7865: The close() method of ``io`` objects should not swallow
++  exceptions raised by the implicit flush().  Also qensure that calling close()
++  several times is supported.  Patch by Pascal Chambon.
++
++- Issue #4687: Fix accuracy of garbage collection runtimes displayed with
++  gc.DEBUG_STATS.
++
++- Issue #8354: The siginterrupt setting is now preserved for all signals, not
++  just SIGCHLD.
++
++- Issue #7192: webbrowser.get("firefox") now works on Mac OS X, as does
++  webbrowser.get("safari").
++
++- Issue #8464: tarfile no longer creates files with execute permissions set when
++  mode="w|" is used.
++
++- Issue #7834: Fix connect() of Bluetooth L2CAP sockets with recent versions of
++  the Linux kernel.  Patch by Yaniv Aknin.
++
++- Issue #8295: Added shutil.unpack_archive.
++
++- Issue #6312: Fixed http HEAD request when the transfer encoding is chunked.
++  It should correctly return an empty response now.
++
++- Issue #8546: Reject None given as the buffering argument to _pyio.open.
++
++- Issue #8549: Fix compiling the _ssl extension under AIX.  Patch by
++  Sridhar Ratnakumar.
++
++- Issue #6656: fix locale.format_string to handle escaped percents
++  and mappings.
++
++- Issue #2302: Fix a race condition in SocketServer.BaseServer.shutdown, where
++  the method could block indefinitely if called just before the event loop
++  started running.  This also fixes the occasional freezes witnessed in
++  test_httpservers.
++
++- Issue #8524: When creating an SSL socket, the timeout value of the original
++  socket wasn't retained (instead, a socket with a positive timeout would be
++  turned into a non-blocking SSL socket).
++
++- Issue #5103: SSL handshake would ignore the socket timeout and block
++  indefinitely if the other end didn't respond.
++
++- The do_handshake() method of SSL objects now adjusts the blocking mode of the
++  SSL structure if necessary (as other methods already do).
++
++- Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates and
++  bytes strings for environment keys and values.
++
++- Issue #8467: Pure Python implementation of subprocess encodes the error
++  message using surrogatepass error handler to support surrogates in the
++  message.
++
++- Issue #8468: bz2.BZ2File() accepts str with surrogates and bytes filenames.
++
++- Issue #8451: Syslog module now uses basename(sys.argv[0]) instead of the
++  string "python" as the *ident*.  openlog() arguments are all optional and
++  keywords.
++
++- Issue #8108: Fix the unwrap() method of SSL objects when the socket has a
++  non-infinite timeout.  Also make that method friendlier with applications
++  wanting to continue using the socket in clear-text mode, by disabling
++  OpenSSL's internal readahead.  Thanks to Darryl Miles for guidance.
++
++- Issue #8496: make mailcap.lookup() always return a list, rather than an
++  iterator.  Patch by Gregory Nofi.
++
++- Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
++  collation name contains a surrogate character.
++
++- Issue #8484: Load all ciphers and digest algorithms when initializing the _ssl
++  extension, such that verification of some SSL certificates doesn't fail
++  because of an "unknown algorithm".
++
++- Issue #6547: Added the ignore_dangling_symlinks option to shutil.copytree.
++
++- Issue #1540112: Now allowing the choice of a copy function in shutil.copytree.
++
++- Issue #4814: timeout parameter is now applied also for connections resulting
++  from PORT/EPRT commands.
++
++- Issue #8463: added missing reference to bztar in shutil's documentation.
++
++- Issue #7154: urllib.request can now detect the proxy settings on OSX 10.6 (as
++  long as the user didn't specify 'automatic proxy configuration').
++
++- Issue #3817: ftplib.FTP.abort() method now considers 225 a valid response code
++  as stated in RFC-959 at chapter 5.4.
++
++- Issue #8394: _ctypes.dlopen() accepts bytes, bytearray and str with
++  surrogates.
++
++- Issue #850728: Add a *timeout* parameter to the `acquire()` method of
++  `threading.Semaphore` objects.  Original patch by Torsten Landschoff.
++
++- Issue #8322: Add a *ciphers* argument to SSL sockets, so as to change the
++  available cipher list.  Helps fix test_ssl with OpenSSL 1.0.0.
++
++- Issue #8393: subprocess accepts bytes, bytearray and str with surrogates for
++  the current working directory.
++
++- Issue #7606: XML-RPC traceback stored in X-traceback is now encoded to ASCII
++  using backslashreplace error handler.
++
++- Issue #8412: os.system() now accepts bytes, bytearray and str with surrogates.
++
++- Issue #2987: RFC2732 support for urlparse (IPv6 addresses). Patch by Tony
++  Locke and Hans Ulrich Niedermann.
++
++- Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters.
++
++- Issue #7316: The acquire() method of lock objects in the ``threading``
++  module now takes an optional timeout argument in seconds.  Timeout support
++  relies on the system threading library, so as to avoid a semi-busy wait loop.
++
++- Issue #8383: pickle and pickletools use surrogatepass error handler when
++  encoding unicode as utf8 to support lone surrogates and stay compatible with
++  Python 2.x and 3.x.
++
++- Issue #7585: difflib context and unified diffs now place a tab between
++  filename and date, conforming to the 'standards' they were originally designed
++  to follow.  This improves compatibility with patch tools.
++
++- Issue #7472: Fixed typo in email.encoders module; messages using ISO-2022
++  character sets will now consistently use a Content-Transfer-Encoding of 7bit
++  rather than sometimes being marked as 8bit.
++
++- Issue #8375: test_distutils now checks if the temporary directory are still
++  present before it cleans them.
++
++- Issue #8374: Update the internal alias table in the ``locale`` module to
++  cover recent locale changes and additions.
++
++- Issue #8321: Give access to OpenSSL version numbers from the `ssl` module,
++  using the new attributes `ssl.OPENSSL_VERSION`, `ssl.OPENSSL_VERSION_INFO` and
++  `ssl.OPENSSL_VERSION_NUMBER`.
++
++- Add functools.total_ordering() and functools.cmp_to_key().
++
++- Issue #8257: The Decimal construct now accepts a float instance directly,
++  converting that float to a Decimal of equal value:
++
++     >>> Decimal(1.1)
++     Decimal('1.100000000000000088817841970012523233890533447265625')
++
++- Issue #8294: The Fraction constructor now accepts Decimal and float instances
++  directly.
++
++- Issue #7279: Comparisons involving a Decimal signaling NaN now signal
++  InvalidOperation instead of returning False.  (Comparisons involving a quiet
++  NaN are unchanged.)  Also, Decimal quiet NaNs are now hashable; Decimal
++  signaling NaNs remain unhashable.
++
++- Issue #2531: Comparison operations between floats and Decimal instances now
++  return a result based on the numeric values of the operands; previously they
++  returned an arbitrary result based on the relative ordering of id(float) and
++  id(Decimal).  See also issue #8188, which adds Decimal-to-Fraction
++  comparisons.
++
++- Added a subtract() method to collections.Counter().
++
++- Issue #8233: When run as a script, py_compile.py optionally takes a single
++  argument `-` which tells it to read files to compile from stdin.  Each line is
++  read on demand and the named file is compiled immediately.  (Original patch by
++  Piotr Ożarowski).
++
++- Backwards incompatible change: Unicode codepoints line tabulation (0x0B) and
++  form feed (0x0C) are now considered linebreaks, as specified in Unicode
++  Standard Annex #14.  See issue #7643.  http://www.unicode.org/reports/tr14/
++
++- Comparisons using one of <, <=, >, >= between a complex instance and a
++  Fractions instance now raise TypeError instead of returning True/False.  This
++  makes Fraction <=> complex comparisons consistent with int <=> complex, float
++  <=> complex, and complex <=> complex comparisons.
++
++- Issue #8139: ossaudiodev didn't initialize its types properly, therefore some
++  methods (such as oss_mixer_device.fileno()) were not available.  Initial patch
++  by Bertrand Janin.
++
++- Issue #8205: Remove the "Modules" directory from sys.path when Python is
++  running from the build directory (POSIX only).
++
++- Issue #7512: shutil.copystat() could raise an OSError when the filesystem
++  didn't support chflags() (for example ZFS under FreeBSD).  The error is now
++  silenced.
++
++- Issue #7860: platform.uname now reports the correct 'machine' type when Python
++  is running in WOW64 mode on 64 bit Windows.
++
++- Issue #3890, #8222: Fix recv() and recv_into() on non-blocking SSL sockets.
++  Also, enable the SSL_MODE_AUTO_RETRY flag on SSL sockets, so that blocking
++  reads and writes are always retried by OpenSSL itself.
++
++- Issue #4282: Fix the main function of the profile module for a non-ASCII
++  script, open the file in binary mode and not in text mode with the default
++  (utf8) encoding.
++
++- Issue #8179: Fix macpath.realpath() on a non-existing path.
++
++- Issue #8024: Update the Unicode database to 5.2.
++
++- Issue #8168: py_compile now handles files with utf-8 BOMS.
++
++- ``tokenize.detect_encoding`` now returns ``'utf-8-sig'`` when a UTF-8 BOM is
++  detected.
++
++- Issue #6716/2: Backslash-replace error output in compilall.
++
++- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
++  with Tcl/Tk-8.5.
++
++- Issue #8140: extend compileall to compile single files.  Add -i option.
++
++- Issue #7356: ctypes.util: Make parsing of ldconfig output independent of the
++  locale.
++
++- The internals of the subprocess module on POSIX systems have been replaced by
++  an extension module (_posixsubprocess) so that the fork()+exec() can be done
++  safely without the possibility of deadlock in multithreaded applications.
++
++- subprocess.Popen now has restore_signals and start_new_session features.  The
++  default of restore_signals=True is a new behavior compared to earlier Python
++  versions.  This means that signals such as SIGPIPE are not ignored by default
++  in subprocesses launched by Python (Issue #1652).
++
++- Issue #6472: The xml.etree package is updated to ElementTree 1.3.  The
++  cElementTree module is updated too.
++
++- Issue #7774: Set sys.executable to an empty string if argv[0] has been set to
++  an non existent program name and Python is unable to retrieve the real program
++  name.
++
++- Issue #7880: Fix sysconfig when the python executable is a symbolic link.
++
++- Issue #6509: fix re.sub to work properly when the pattern, the string, and the
++  replacement were all bytes.  Patch by Antoine Pitrou.
++
++- The sqlite3 module was updated to pysqlite 2.6.0. This fixes several obscure
++  bugs and allows loading SQLite extensions from shared libraries.
++
++- Issue #1054943: Fix ``unicodedata.normalize('NFC', text)`` for the Public
++  Review Issue #29 (http://unicode.org/review/pr-29.html).
++
++- Issue #7494: fix a crash in _lsprof (cProfile) after clearing the profiler,
++  reset also the pointer to the current pointer context.
++
++- Issue #7232: Add support for the context manager protocol to the TarFile
++  class.
++
++- Issue #7250: Fix info leak of os.environ across multi-run uses of
++  wsgiref.handlers.CGIHandler.
++
++- Issue #1729305: Fix doctest to handle encode error with "backslashreplace".
++
++- Issue #691291: codecs.open() should not convert end of lines on reading and
++  writing.
++
++- Issue #7869: logging: improved diagnostic for format-time errors.
++
++- Issue #7868: logging: added loggerClass attribute to Manager.
++
++- logging: Implemented PEP 391.
++
++- Issue #1537721: Add a writeheader() method to csv.DictWriter.
++
++- Issue #7959: ctypes callback functions are now registered correctly with the
++  cycle garbage collector.
++
++- Issue #5801: removed spurious empty lines in wsgiref.
++
++- Issue #6666: fix bug in trace.py that applied the list of directories to be
++  ignored only to the first file.  Noted by Bogdan Opanchuk.
++
++- Issue #7597: curses.use_env() can now be called before initscr().  Noted by
++  Kan-Ru Chen.
++
++- Issue #7310: fix the __repr__ of os.environ to show the environment variables.
++
++- Issue #7970: email.Generator.flatten now correctly flattens message/rfc822
++  messages parsed by email.Parser.HeaderParser.
++
++- Issue #7361: Importlib was not properly checking the number of bytes in
++  bytecode file when it was less then 8 bytes.
++
++- Issue #7633: In the decimal module, Context class methods (with the exception
++  of canonical and is_canonical) now accept instances of int and long wherever a
++  Decimal instance is accepted, and implicitly convert that argument to Decimal.
++  Previously only some arguments were converted.
++
++- Issue #7835: shelve should no longer produce mysterious warnings during
++  interpreter shutdown.
++
++- Issue #2746: Don't escape ampersands and angle brackets ("&", "<", ">") in XML
++  processing instructions and comments.  These raw characters are allowed by the
++  XML specification, and are necessary when outputting e.g.  PHP code in a
++  processing instruction.  Patch by Neil Muller.
++
++- Issue #6233: ElementTree failed converting unicode characters to XML entities
++  when they could't be represented in the requested output encoding.  Patch by
++  Jerry Chen.
++
++- Issue #6003: add an argument to ``zipfile.Zipfile.writestr`` to specify the
++  compression type.
++
++- Issue #4772: Raise a ValueError when an unknown Bluetooth protocol is
++  specified, rather than fall through to AF_PACKET (in the `socket` module).
++  Also, raise ValueError rather than TypeError when an unknown TIPC address type
++  is specified.  Patch by Brian Curtin.
++
++- Issue #6939: Fix file I/O objects in the `io` module to keep the original file
++  position when calling `truncate()`.  It would previously change the file
++  position to the given argument, which goes against the tradition of
++  ftruncate() and other truncation APIs.  Patch by Pascal Chambon.
++
++- Issue #7610: Reworked implementation of the internal
++  ``zipfile.ZipExtFile`` class used to represent files stored inside an
++  archive.  The new implementation is significantly faster and can be wrapped in
++  a ``io.BufferedReader`` object for more speedups.  It also solves an
++  issue where interleaved calls to `read()` and `readline()` give wrong results.
++  Patch by Nir Aides.
++
++- Issue #6963: Added "maxtasksperchild" argument to multiprocessing.Pool,
++  allowing for a maximum number of tasks within the pool to be completed by the
++  worker before that worker is terminated, and a new one created to replace it.
++
++- Issue #7792: Registering non-classes to ABCs raised an obscure error.
++
++- Issue #7785: Don't accept bytes in FileIO.write().
++
++- Removed the functions 'verify' and 'vereq' from Lib/test/support.py.
++
++- Issue #7773: Fix an UnboundLocalError in platform.linux_distribution() when
++  the release file is empty.
++
++- Issue #7561: Fix crashes when using bytearray objects with the posix
++  module.
++
++- Issue #1670765: Prevent email.generator.Generator from re-wrapping headers in
++  multipart/signed MIME parts, which fixes one of the sources of invalid
++  modifications to such parts by Generator.
++
++- Issue #7703: Add support for the new buffer API to `binascii.a2bhqx`.  Patch
++  by Florent Xicluna, along with some additional tests.
++
++- Issue #7701: Fix crash in binascii.b2a_uu() in debug mode when given a 1-byte
++  argument.  Patch by Victor Stinner.
++
++- Issue #3299: Fix possible crash in the _sre module when given bad argument
++  values in debug mode.  Patch by Victor Stinner.
++
++- Issue #2846: Add support for gzip.GzipFile reading zero-padded files.  Patch
++  by Brian Curtin.
++
++- Issue #7681: Use floor division in appropiate places in the wave module.
++
++- Issue #5372: Drop the reuse of .o files in Distutils' ccompiler (since
++  Extension extra options may change the output without changing the .c
++  file). Initial patch by Collin Winter.
++
++- Issue #7617: Make sure distutils.unixccompiler.UnixCCompiler recognizes gcc
++  when it has a fully qualified configuration prefix. Initial patch by Arfrever.
++
++- Issue #7105: Make WeakKeyDictionary and WeakValueDictionary robust against the
++  destruction of weakref'ed objects while iterating.
++
++- Issue #7455: Fix possible crash in cPickle on invalid input.  Patch by Victor
++  Stinner.
++
++- Issue #1628205: Socket file objects returned by socket.socket.makefile() now
++  properly handles EINTR within the read, readline, write & flush methods.  The
++  socket.sendall() method now properly handles interrupted system calls.
++
++- Issue #7471: Improve the performance of GzipFile's buffering mechanism, and
++  make it implement the `io.BufferedIOBase` ABC to allow for further speedups by
++  wrapping it in an `io.BufferedReader`.  Patch by Nir Aides.
++
++- Issue #3972: http.client.HTTPConnection now accepts an optional source_address
++  parameter to allow specifying where your connections come from.
++
++- socket.create_connection now accepts an optional source_address parameter.
++
++- Issue #5511: now zipfile.ZipFile can be used as a context manager.  Initial
++  patch by Brian Curtin.
++
++- Issue #7556: Make sure Distutils' msvc9compile reads and writes the MSVC XML
++  Manifest file in text mode so string patterns can be used in regular
++  expressions.
++
++- Issue #7552: Removed line feed in the base64 Authorization header in the
++  Distutils upload command to avoid an error when PyPI reads it.  This occurs on
++  long passwords. Initial patch by JP St. Pierre.
++
++- Issue #7231: urllib2 cannot handle https with proxy requiring auth.  Patch by
++  Tatsuhiro Tsujikawa.
++
++- Issue #4757: `zlib.compress` and other methods in the zlib module now raise a
++  TypeError when given an `str` object (rather than a `bytes`-like object).
++  Patch by Victor Stinner and Florent Xicluna.
++
++- Issue #7349: Make methods of file objects in the io module accept None as an
++  argument where file-like objects (ie StringIO and BytesIO) accept them to mean
++  the same as passing no argument.
++
++- Issue #7357: tarfile no longer suppresses fatal extraction errors by default.
++
++- Issue #5949: added check for correct lineends in input from IMAP server in
++  imaplib.
++
++- Add count() and reverse() methods to collections.deque().
++
++- Fix variations of extending deques:  d.extend(d)  d.extendleft(d)  d+=d
++
++- Issue #6986: Fix crash in the JSON C accelerator when called with the wrong
++  parameter types.  Patch by Victor Stinner.
++
++- Issue #7457: added a read_pkg_file method to
++  distutils.dist.DistributionMetadata.
++
++- logging: Added optional `secure` parameter to SMTPHandler, to enable use of
++  TLS with authentication credentials.
++
++- Issue #1923: Fixed the removal of meaningful spaces when PKG-INFO is generated
++  in Distutils.  Patch by Stephen Emslie.
++
++- Issue #4120: Drop reference to CRT from manifest when building extensions with
++  msvc9compiler.
++
++- Issue #7333: The `posix` module gains an `initgroups()` function providing
++  access to the initgroups(3) C library call on Unix systems which implement it.
++  Patch by Jean-Paul Calderone.
++
++- Issue #7408: Fixed distutils.tests.sdist so it doesn't check for group
++  ownership when the group is not forced, because the group may be different
++  from the user's group and inherit from its container when the test is run.
++
++- Issue #4486: When an exception has an explicit cause, do not print its
++  implicit context too.  This affects the `traceback` module as well as built-in
++  exception printing.
++
++- Issue #1515: Enable use of deepcopy() with instance methods.  Patch by Robert
++  Collins.
++
++- Issue #7403: logging: Fixed possible race condition in lock creation.
++
++- Issue #6845: Add restart support for binary upload in ftplib.  The
++  `storbinary()` method of FTP and FTP_TLS objects gains an optional `rest`
++  argument.  Patch by Pablo Mouzo.
++
++- Issue #5788: `datetime.timedelta` objects get a new `total_seconds()` method
++  returning the total number of seconds in the duration.  Patch by Brian
++  Quinlan.
++
++- Issue #7133: SSL objects now support the new buffer API.
++
++- Issue #1488943: difflib.Differ() doesn't always add hints for tab characters.
++
++- Issue #6123: tarfile now opens empty archives correctly and consistently
++  raises ReadError on empty files.
++
++- Issue #7354: distutils.tests.test_msvc9compiler - dragfullwindows can be 2.
++
++- Issue #5037: Proxy the __bytes__ special method instead to __bytes__ instead
++  of __str__.
++
++- Issue #7341: Close the internal file object in the TarFile constructor in case
++  of an error.
++
++- Issue #7293: distutils.test_msvc9compiler is fixed to work on any fresh
++  Windows box. Help provided by David Bolen.
++
++- Issue #2054: ftplib now provides an FTP_TLS class to do secure FTP using TLS
++  or SSL.  Patch by Giampaolo Rodola'.
++
++- Issue #7328: pydoc no longer corrupts sys.path when run with the '-m' switch.
++
++- Issue #4969: The mimetypes module now reads the MIME database from the
++  registry under Windows.  Patch by Gabriel Genellina.
++
++- Issue #6816: runpy now provides a run_path function that allows Python code to
++  execute file paths that refer to source or compiled Python files as well as
++  zipfiles, directories and other valid sys.path entries that contain a
++  __main__.py file.  This allows applications that run other Python scripts to
++  support the same flexibility as the CPython command line itself.
++
++- Issue #7318: multiprocessing now uses a timeout when it fails to establish a
++  connection with another process, rather than looping endlessly.  The default
++  timeout is 20 seconds, which should be amply sufficient for local connections.
++
++- Issue #7197: Allow unittest.TextTestRunner objects to be pickled and
++  unpickled.  This fixes crashes under Windows when trying to run
++  test_multiprocessing in verbose mode.
++
++- Issue #7893: ``unittest.TextTestResult`` is made public and a ``resultclass``
++  argument added to the TextTestRunner constructor allowing a different result
++  class to be used without having to subclass.
++
++- Issue #7588: ``unittest.TextTestResult.getDescription`` now includes the test
++  name in failure reports even if the test has a docstring.
++
++- Issue #3001: Add a C implementation of recursive locks which is used by
++  default when instantiating a `threading.RLock` object. This makes recursive
++  locks as fast as regular non-recursive locks (previously, they were slower by
++  10x to 15x).
++
++- Issue #7282: Fix a memory leak when an RLock was used in a thread other than
++  those started through `threading.Thread` (for example, using
++  `_thread.start_new_thread()`).
++
++- Issue #7187: Importlib would not silence the IOError raised when trying to
++  write new bytecode when it was made read-only.
++
++- Issue #7264: Fix a possible deadlock when deallocating thread-local objects
++  which are part of a reference cycle.
++
++- Issue #7211: Allow 64-bit values for the `ident` and `data` fields of kevent
++  objects on 64-bit systems.  Patch by Michael Broghton.
++
++- Issue #6896: mailbox.Maildir now invalidates its internal cache each time a
++  modification is done through it.  This fixes inconsistencies and test failures
++  on systems with slightly bogus mtime behaviour.
++
++- Issue #7246 & Issue #7208: getpass now properly flushes input before reading
++  from stdin so that existing input does not confuse it and lead to incorrect
++  entry or an IOError.  It also properly flushes it afterwards to avoid the
++  terminal echoing the input afterwards on OSes such as Solaris.
++
++- Issue #7233: Fix a number of two-argument Decimal methods to make sure that
++  they accept an int or long as the second argument.  Also fix buggy handling of
++  large arguments (those with coefficient longer than the current precision) in
++  shift and rotate.
++
++- Issue #4750: Store the basename of the original filename in the gzip FNAME
++  header as required by RFC 1952.
++
++- Issue #1180: Added a new global option to ignore ~/.pydistutils.cfg in
++  Distutils.
++
++- Issue #7218: Fix test_site for win32, the directory comparison was done with
++  an uppercase.
++
++- Issue #7205: Fix a possible deadlock when using a BZ2File object from
++  several threads at once.
++
++- Issue #7077: logging: SysLogHandler now treats Unicode as per RFC 5424.
++
++- Issue #7099: Decimal.is_normal now returns True for numbers with exponent
++  larger than emax.
++
++- Issue #7080: locale.strxfrm() raises a MemoryError on 64-bit non-Windows
++  platforms, and assorted locale fixes by Derk Drukker.
++
++- Issue #5833: Fix extra space character in readline completion with the GNU
++  readline library version 6.0.
++
++- Issue #6894: Fixed the issue urllib2 doesn't respect "no_proxy" environment.
++
++- Issue #7086: Added TCP support to SysLogHandler, and tidied up some
++  anachronisms in the code which were a relic of 1.5.2 compatibility.
++
++- Issue #7082: When falling back to the MIME 'name' parameter, the correct place
++  to look for it is the Content-Type header.
++
++- Make tokenize.detect_coding() normalize utf-8 and iso-8859-1 variants like the
++  builtin tokenizer.
++
++- Issue #7048: Force Decimal.logb to round its result when that result is too
++  large to fit in the current precision.
++
++- Issue #6236, #6348: Fix various failures in the I/O library under AIX and
++  other platforms, when using a non-gcc compiler. Patch by Derk Drukker.
++
++- Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...)  does now
++  always result in NULL.
++
++- Issue #5042: Structure sub-subclass does now initialize correctly with base
++  class positional arguments.
++
++- Issue #6882: Import uuid creates zombies processes.
++
++- Issue #6635: Fix profiler printing usage message.
++
++- Issue #6856: Add a filter keyword argument to TarFile.add().
++
++- Issue #6888: pdb's alias command was broken when no arguments were given.
++
++- Issue #6857: Default format() alignment should be '>' for Decimal instances.
++
++- Issue #6795: int(Decimal('nan')) now raises ValueError instead of returning
++  NaN or raising InvalidContext.  Also, fix infinite recursion in
++  long(Decimal('nan')).
++
++- Issue #6850: Fix bug in Decimal._parse_format_specifier for formats with no
++  type specifier.
++
++- Issue #6239: ctypes.c_char_p return value must return bytes.
++
++- Issue #6838: Use a list to accumulate the value instead of repeatedly
++  concatenating strings in http.client's HTTPResponse._read_chunked providing a
++  significant speed increase when downloading large files servend with a
++  Transfer-Encoding of 'chunked'.
++
++- Trying to import a submodule from a module that is not a package, ImportError
++  should be raised, not AttributeError.
++
++- When the globals past to importlib.__import__() has __package__ set to None,
++  fall back to computing what __package__ should be instead of giving up.
++
++- Raise a TypeError when the name of a module to be imported for
++  importlib.__import__ is not a string (was raising an AttributeError before).
++
++- Allow the fromlist passed into importlib.__import__ to be any iterable.
++
++- Have importlib raise ImportError if None is found in sys.modules.
++
++- Issue #6054: Do not normalize stored pathnames in tarfile.
++
++- Issue #6794: Fix Decimal.compare_total and Decimal.compare_total_mag: NaN
++  payloads are now ordered by integer value rather than lexicographically.
++
++- Issue #1356969: Add missing info methods in tix.HList.
++
++- Issue #1522587: New constants and methods for the tix.Grid widget.
++
++- Issue #1250469: Fix the return value of tix.PanedWindow.panes.
++
++- Issue #1119673: Do not override tkinter.Text methods when creating a
++  ScrolledText.
++
++- Issue #6665: Fix fnmatch to properly match filenames with newlines in them.
++
++- Issue #1135: Add the XView and YView mix-ins to avoid duplicating the xview*
++  and yview* methods.
++
++- Issue #6629: Fix a data corruption issue in the new I/O library, which could
++  occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
++  "wb+" mode) after having buffered a certain amount of data for reading. This
++  bug was not present in the pure Python implementation.
++
++- Issue #6622: Fix "local variable 'secret' referenced before assignment" bug in
++  POP3.apop.
++
++- Issue #2715: Remove remnants of Carbon.File from binhex module.
++
++- Issue #6595: The Decimal constructor now allows arbitrary Unicode decimal
++  digits in input, as recommended by the standard.  Previously it was restricted
++  to accepting [0-9].
++
++- Issue #6106: telnetlib.Telnet.process_rawq doesn't handle default WILL/WONT
++  DO/DONT correctly.
++
++- Issue #1424152: Fix for http.client, urllib.request to support SSL while
++  working through proxy.  Original patch by Christopher Li, changes made by
++  Senthil Kumaran.
++
++- Add importlib.abc.ExecutionLoader to represent the PEP 302 protocol for
++  loaders that allow for modules to be executed. Both importlib.abc.PyLoader and
++  PyPycLoader inherit from this class and provide implementations in relation to
++  other methods required by the ABCs.
++
++- importlib.abc.PyLoader did not inherit from importlib.abc.ResourceLoader like
++  the documentation said it did even though the code in PyLoader relied on the
++  abstract method required by ResourceLoader.
++
++- Issue #6431: Make Fraction type return NotImplemented when it doesn't know how
++  to handle a comparison without loss of precision.  Also add correct handling
++  of infinities and nans for comparisons with float.
++
++- Issue #6415: Fixed warnings.warn segfault on bad formatted string.
++
++- Issue #6358: The exit status of a command started with os.popen() was reported
++  differently than it did with python 2.x.
++
++- Issue #6323: The pdb debugger did not exit when running a script with a syntax
++  error.
++
++- Issue #3392: The subprocess communicate() method no longer fails in select()
++  when file descriptors are large; communicate() now uses poll() when possible.
++
++- Issue #6369: Fix an RLE decompression bug in the binhex module.
++
++- Issue #6344: Fixed a crash of mmap.read() when passed a negative argument.
++
++- The deprecated function string.maketrans has been removed.
++
++- Issue #4005: Fixed a crash of pydoc when there was a zip file present in
++  sys.path.
++
++- Issue #6218: io.StringIO and io.BytesIO instances are now picklable.
++
++- The os.get_exec_path() function to return the list of directories that will be
++  searched for an executable when launching a subprocess was added.
++
++- Issue #7481: When a threading.Thread failed to start it would leave the
++  instance stuck in initial state and present in threading.enumerate().
++
++- Issue #1068268: The subprocess module now handles EINTR in internal os.waitpid
++  and os.read system calls where appropriate.
++
++- Issue #6729: Added ctypes.c_ssize_t to represent ssize_t.
++
++- Issue #6247: The argparse module has been added to the standard library.
++
++- Issue #8235: _socket: Add the constant ``SO_SETFIB``.  SO_SETFIB is a socket
++  option available on FreeBSD 7.1 and newer.
++
++- Issue #9315: Fix for the trace module to record correct class name
++  for tracing methods.
++
++Extension Modules
++-----------------
++
++- Issue #9959: Tweak formula used for computing math.log of an integer,
++  making it marginally more accurate for exact powers of 2.
++
++- Issue #9422: Fix memory leak when re-initializing a struct.Struct object.
++
++- Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly
++  compared to other unix systems. In particular, os.getgroups() does not reflect
++  any changes made using os.setgroups() but basicly always returns the same
++  information as the id command. os.getgroups() can now return more than 16
++  groups on MacOSX.
++
++- Issue #6095: Make directory argument to os.listdir optional.
++
++- Issue #9277: Fix bug in struct.pack for bools in standard mode (e.g.,
++  struct.pack('>?')): if conversion to bool raised an exception then that
++  exception wasn't properly propagated on machines where char is unsigned.
++
++- Issue #5180: Fixed a bug that prevented loading 2.x pickles in 3.x python when
++  they contain instances of old-style classes.
++
++- Issue #9165: Add new functions math.isfinite and cmath.isfinite, to accompany
++  existing isinf and isnan functions.
++
++- Issue #1578269: Implement os.symlink for Windows 6.0+.  Patch by Jason
++  R. Coombs.
++
++- In struct.pack, correctly propogate exceptions from computing the truth of an
++  object in the '?' format.
++
++- Issue #9000: datetime.timezone objects now have eval-friendly repr.
++
++- In the math module, correctly lookup __trunc__, __ceil__, and __floor__ as
++  special methods.
++
++- Issue #9005: Prevent utctimetuple() from producing year 0 or year 10,000.
++  Prior to this change, timezone adjustment in utctimetuple() could produce
++  tm_year value of 0 or 10,000.  Now an OverflowError is raised in these edge
++  cases.
++
++- Issue #6641: The ``datetime.strptime`` method now supports the ``%z``
++  directive.  When the ``%z`` directive is present in the format string, an
++  aware ``datetime`` object is returned with ``tzinfo`` bound to a
++  ``datetime.timezone`` instance constructed from the parsed offset.  If both
++  ``%z`` and ``%Z`` are present, the data in ``%Z`` field is used for timezone
++  name, but ``%Z`` data without ``%z`` is discarded.
++
++- Issue #5094: The ``datetime`` module now has a simple concrete class
++  implementing ``datetime.tzinfo`` interface.  Instances of the new class,
++  ``datetime.timezone``, return fixed name and UTC offset from their
++  ``tzname(dt)`` and ``utcoffset(dt)`` methods.  The ``dst(dt)`` method always
++  returns ``None``.  A class attribute, ``utc`` contains an instance
++  representing the UTC timezone.  Original patch by Rafe Kaplan.
++
++- Issue #8973: Add __all__ to struct module; this ensures that help(struct)
++  includes documentation for the struct.Struct class.
++
++- Issue #3129: Trailing digits in struct format string are no longer ignored.
++  For example, "1" or "ilib123" are now invalid formats and cause
++  ``struct.error`` to be raised.  Patch by Caleb Deveraux.
++
++- Issue #7384: If the system readline library is linked against ncurses, the
++  curses module must be linked against ncurses as well. Otherwise it is not safe
++  to load both the readline and curses modules in an application.
++
++- Issue #2810: Fix cases where the Windows registry API returns ERROR_MORE_DATA,
++  requiring a re-try in order to get the complete result.
++
++- Issue #8692: Optimize math.factorial: replace the previous naive algorithm
++  with an improved 'binary-split' algorithm that uses fewer multiplications and
++  allows many of the multiplications to be performed using plain C integer
++  arithmetic instead of PyLong arithmetic.  Also uses a lookup table for small
++  arguments.
++
++- Issue #8674: Fixed a number of incorrect or undefined-behaviour-inducing
++  overflow checks in the audioop module.
++
++- Issue #8644: The accuracy of td.total_seconds() has been improved (by
++  calculating with integer arithmetic instead of float arithmetic internally):
++  the result is now always correctly rounded, and is equivalent to ``td /
++  timedelta(seconds=1)``.
++
++- Issue #2706: Allow division of a timedelta by another timedelta: timedelta /
++  timedelta, timedelta % timedelta, timedelta // timedelta and divmod(timedelta,
++  timedelta) are all supported.
++
++- Issue #8314: Fix unsigned long long bug in libffi on Sparc v8.
++
++- Issue #8300: When passing a non-integer argument to struct.pack with any
++  integer format code, struct.pack first attempts to convert the non-integer
++  using its __index__ method.  If that method is non-existent or raises
++  TypeError it goes on to try the __int__ method, as described below.
++
++- Issue #8142: Update libffi to the 3.0.9 release.
++
++- Issue #6949: Allow the _dbm extension to be built with db 4.8.x.
++
++- Issue #6544: Fix a reference leak in the kqueue implementation's error
++  handling.
++
++- Stop providing crtassem.h symbols when compiling with Visual Studio 2010, as
++  msvcr100.dll is not a platform assembly anymore.
++
++- Issue #6508: Add posix.{getresuid,getresgid,setresuid,setresgid}.
++
++- Issue #7078: Set struct.__doc__ from _struct.__doc__.
++
++- Issue #3366: Add erf, erfc, expm1, gamma, lgamma functions to math module.
++
++- Issue #6877: It is now possible to link the readline extension to the libedit
++  readline emulation on OSX 10.5 or later.
++
++- Issue #6848: Fix curses module build failure on OS X 10.6.
++
++- Fix a segfault that could be triggered by expat with specially formed input.
++
++- Issue #6561: '\d' in a regex now matches only characters with Unicode category
++  'Nd' (Number, Decimal Digit).  Previously it also matched characters with
++  category 'No'.
++
++- Issue #4509: Array objects are no longer modified after an operation failing
++  due to the resize restriction in-place when the object has exported buffers.
++
++- Issue #2389: Array objects are now pickled in a portable manner.
++
++- Expat: Fix DoS via XML document with malformed UTF-8 sequences
++  (CVE_2009_3560).
++
++- Issue #7242: On Solaris 9 and earlier calling os.fork() from within a thread
++  could raise an incorrect RuntimeError about not holding the import lock.  The
++  import lock is now reinitialized after fork.
++
++- Issue #7999: os.setreuid() and os.setregid() would refuse to accept a -1
++  parameter on some platforms such as OS X.
++
++- Build the ossaudio extension on GNU/kFreeBSD.
++
++- Issue #7347: winreg: Add CreateKeyEx and DeleteKeyEx, as well as fix a bug in
++  the return value of QueryReflectionKey.
++
++- Issue #7567: PyCurses_setupterm: Don't call ``setupterm`` twice.
++
++Build
++-----
++
++- Use OpenSSL 1.0.0a on Windows.
++
++- Issue #9280: Make sharedinstall depend on sharedmods.
++
++- Issue #9189: Make a user-specified CFLAGS, CPPFLAGS, or LDFLAGS setting
++  override the configure and makefile defaults, without deleting options the
++  user didn't intend to override.  Developers should no longer need to specify
++  OPT or EXTRA_CFLAGS, although those variables are still present for
++  backward-compatibility.
++
++- Issue #8854: Fix finding Visual Studio 2008 on Windows x64.
++
++- Issue #1759169, #8864: Drop _XOPEN_SOURCE on Solaris, define it for
++  multiprocessing only.
++
++- Issue #8625: Turn off optimization in --with-pydebug builds with gcc.
++  (Optimization was unintentionally turned on in gcc --with-pydebug builds as a
++  result of the issue #1628484 fix, combined with autoconf's strange choice of
++  default CFLAGS produced by AC_PROG_CC for gcc.)
++
++- Issue #3646: It is now easily possible to install a Python framework into your
++  home directory on MacOSX, see Mac/README for more information.
++
++- Issue #3928: os.mknod() now available in Solaris, also.
++
++- Issue #3326: Build Python without -fno-strict-aliasing when the gcc does not
++  give false warnings.
++
++- Issue #1628484: The Makefile doesn't ignore the CFLAGS environment variable
++  anymore.  It also forwards the LDFLAGS settings to the linker when building a
++  shared library.
++
++- Issue #6716: Quote -x arguments of compileall in MSI installer.  Exclude 2to3
++  tests from compileall.
++
++- Issue #3920, #7903: Define _BSD_SOURCE on OpenBSD 4.4 through 4.9.
++
++- Issue #7632: When Py_USING_MEMORY_DEBUGGER is defined, disable the private
++  memory allocation scheme in dtoa.c and use PyMem_Malloc and PyMem_Free
++  instead.  Also disable caching of powers of 5.
++
++- Issue #6491: Allow --with-dbmliborder to specify that no dbms will be built.
++
++- Issue #6943: Use pkg-config to find the libffi headers when the
++  --with-system-ffi flag is used.
++
++- Issue #7609: Add a --with-system-expat option that causes the system's expat
++  library to be used for the pyexpat module instead of the one included with
++  Python.
++
++- Issue #7589: Only build the nis module when the correct header files are
++  found.
++
++- Switch to OpenSSL 0.9.8l and sqlite 3.6.21 on Windows.
++
++- Issue #5792: Extend the short float repr support to x86 systems using
++  icc or suncc.
++
++- Issue #6603: Change READ_TIMESTAMP macro in ceval.c so that it compiles
++  correctly under gcc on x86-64.  This fixes a reported problem with the
++  --with-tsc build on x86-64.
++
++- Issue #6802: Fix build issues on MacOSX 10.6.
++
++- Issue #6244: Allow detect_tkinter to look for Tcl/Tk 8.6.
++
++- Issue #4601: 'make install' did not set the appropriate permissions on
++  directories.
++
++- Issue #5390: Add uninstall icon independent of whether file extensions are
++  installed.
++
++- Issue #7541: When using ``python-config`` with a framework install the
++  compiler might use the wrong library.
++
++- python-config now supports multiple options on the same command line.
++
++- Issue #8509: Fix quoting in help strings and code snippets in configure.in.
++
++- Issue #8510: Update to autoconf2.65.
++
++Documentation
++-------------
++
++- Issue #9817: Add expat COPYING file; add expat, libffi and expat licenses
++  to Doc/license.rst.
++
++- Issue #9524: Document that two CTRL* signals are meant for use only
++  with os.kill.
++
++- Issue #9255: Document that the 'test' package is meant for internal Python use
++  only.
++
++- A small WSGI server was added as Tools/scripts/serve.py, and is used to
++  implement a local documentation server via 'make serve' in the doc directory.
++
++- Updating `Using Python` documentation to include description of CPython's -J
++  and -X options.
++
++- Document that importing a module that has None in sys.modules triggers an
++  ImportError.
++
++- Issue #6556: Fixed the Distutils configuration files location explanation for
++  Windows.
++
++- Update python manual page (options -B, -O0, -s, environment variables
++  PYTHONDONTWRITEBYTECODE, PYTHONNOUSERSITE).
++
++- Issue #8909: Added the size of the bitmap used in the installer created by
++  distutils' bdist_wininst. Patch by Anatoly Techtonik.
++
++Tests
++-----
++
++- Issue #9251: test_threaded_import didn't fail when run through regrtest if the
++  import lock was disabled.
++
++- Issue #8605: Skip test_gdb if Python is compiled with optimizations.
++
++- Issue #7449: Skip test_socketserver if threading support is disabled.
++
++- Issue #8672: Add a zlib test ensuring that an incomplete stream can be handled
++  by a decompressor object without errors (it returns incomplete uncompressed
++  data).
++
++- Issue #8533: regrtest uses backslashreplace error handler for stdout to avoid
++  UnicodeEncodeError (write non-ASCII character to stdout using ASCII encoding).
++
++- Issue #8576: Remove use of find_unused_port() in test_smtplib and
++  test_multiprocessing.  Patch by Paul Moore.
++
++- Issue #7449: Fix many tests to support Python compiled without thread
++  support. Patches written by Jerry Seutter.
++
++- Issue #8108: test_ftplib's non-blocking SSL server now has proper handling of
++  SSL shutdowns.
++
++- Issues #8279, #8330, #8437, #8480, #8495: Fix test_gdb failures, patch written
++  by Dave Malcolm.
++
++- Issue #3864: Skip three test_signal tests on freebsd6 because they fail if any
++  thread was previously started, most likely due to a platform bug.
++
++- Issue #8193: Fix test_zlib failure with zlib 1.2.4.
++
++- Issue #8248: Add some tests for the bool type.  Patch by Gregory Nofi.
++
++- Issue #8263: Now regrtest.py will report a failure if it receives a
++  KeyboardInterrupt (SIGINT).
++
++- Issue #8180 and #8207: Fix test_pep277 on OS X and add more tests for special
++  Unicode normalization cases.
++
++- Issue #7783: test.support.open_urlresource invalidates the outdated files from
++  the local cache.
++
++- Issue #7849: Now the utility ``check_warnings`` verifies if the warnings are
++  effectively raised.
++
++- The four path modules (genericpath, macpath, ntpath, posixpath) share a common
++  TestCase for some tests: test_genericpath.CommonTest.
++
++- Print platform information when running the whole test suite, or using the
++  --verbose flag.
++
++- Issue #767675: enable test_pep277 on POSIX platforms with Unicode-friendly
++  filesystem encoding.
++
++- Issue #6292: for the moment at least, the test suite runs cleanly if python is
++  run with the -OO flag.  Tests requiring docstrings are skipped.
++
++- Issue #7712: test.support gained a new `temp_cwd` context manager which is now
++  also used by regrtest to run all the tests in a temporary directory.  The
++  original CWD is saved in `support.SAVEDCWD`.  Thanks to Florent Xicluna who
++  helped with the patch.
++
++- Issue #7924: Fix an intermittent 'XXX undetected error' failure in test_capi
++  (only seen so far on platforms where the curses module wasn't built), due to
++  an uncleared exception.
++
++- Issue #7728: test_timeout was changed to use support.bind_port instead of a
++  hard coded port.
++
++- Issue #7376: Instead of running a self-test (which was failing) when called
++  with no arguments, doctest.py now gives a usage message.
++
++- Issue #7396: fix regrtest -s, which was broken by the -j enhancement.
++
++- Issue #7498: test_multiprocessing now uses test.support.find_unused_port
++  instead of a hardcoded port number in test_rapid_restart.
++
++- Issue #7431: Use TESTFN in test_linecache instead of trying to create a file
++  in the Lib/test directory, which might be read-only for the user running the
++  tests.
++
++- Issue #7324: Add a sanity check to regrtest argument parsing to catch the case
++  of an option with no handler.
++
++- Issue #7312: Add a -F flag to run the selected tests in a loop until a test
++  fails.  Can be combined with -j.
++
++- Issue #6551: test_zipimport could import and then destroy some modules of the
++  encodings package, which would make other tests fail further down the road
++  because the internally cached encoders and decoders would point to empty
++  global variables.
++
++- Issue #7295: Do not use a hardcoded file name in test_tarfile.
++
++- Issue #7270: Add some dedicated unit tests for multi-thread synchronization
++  primitives such as Lock, RLock, Condition, Event and Semaphore.
++
++- Issue #7248 (part 2): Use a unique temporary directory for importlib source
++  tests instead of tempfile.tempdir. This prevents the tests from sharing state
++  between concurrent executions on the same system.
++
++- Issue #7248: In importlib.test.source.util a try/finally block did not make
++  sure that some referenced objects actually were created in the block before
++  calling methods on the object.
++
++- Issue #7222: Make thread "reaping" more reliable so that reference
++  leak-chasing test runs give sensible results.  The previous method of reaping
++  threads could return successfully while some Thread objects were still
++  referenced.  This also introduces a new private function:
++  ``_thread._count()``.
++
++- Issue #7151: Fixed regrtest -j so that output to stderr from a test no longer
++  runs the risk of causing the worker thread to fail.
++
++- Issue #7055: test___all__ now greedily detects all modules which have an
++  __all__ attribute, rather than using a hardcoded and incomplete list.
++
++- Issue #7058: Added save/restore for things like sys.argv and cwd to
++  runtest_inner in regrtest, with warnings if the called test modifies them, and
++  a new section in the summary report at the end.
++
++- Issue #7042: Fix test_signal (test_itimer_virtual) failure on OS X 10.6.
++
++- Fixed tests in importlib.test.source.test_abc_loader that were masking the
++  proper exceptions that should be raised for missing or improper code object
++  bytecode.
++
++- Removed importlib's custom test discovery code and switched to
++  unittest.TestLoader.discover().
++
++Tools/Demos
++-----------
++
++- Issue #5464, #8974: Implement plural forms in msgfmt.py.
++
++- iobench (a file I/O benchmark) and ccbench (a concurrency benchmark) were
++  added to the `Tools/` directory.  They were previously living in the sandbox.
++
++
++What's New in Python 3.1?
++=========================
++
++*Release date: 27-June-2009*
++
++Core and Builtins
++-----------------
++
++- Issue #6334: Fix bug in range length calculation for ranges with
++  large arguments.
++
++- Issue #6329: Fixed iteration for memoryview objects (it was being blocked
++  because it wasn't recognized as a sequence).
++
++Library
++-------
++
++- Issue #6126: Fixed pdb command-line usage.
++
++- Issue #6314: logging: performs extra checks on the "level" argument.
++
++- Issue #6274: Fixed possible file descriptors leak in subprocess.py
++
++- Accessing io.StringIO.buffer now raises an AttributeError instead of
++  io.UnsupportedOperation.
++
++- Issue #6271: mmap tried to close invalid file handle (-1) when anonymous.
++  (On Unix)
++
++- Issue #1202: zipfile module would cause a struct.error when attempting to
++  store files with a CRC32 > 2**31-1.
++
++Extension Modules
++-----------------
++
++- Issue #5590: Remove unused global variable in pyexpat extension.
++
++
++What's New in Python 3.1 Release Candidate 2?
++=============================================
++
++*Release date: 13-June-2009*
++
++Core and Builtins
++-----------------
++
++- Fixed SystemError triggered by "range([], 1, -1)".
++
++- Issue #5924: On Windows, a large PYTHONPATH environment variable
++  (more than 255 characters) would be completely ignored.
++
++- Issue #4547: When debugging a very large function, it was not always
++  possible to update the lineno attribute of the current frame.
++
++- Issue #5330: C functions called with keyword arguments were not reported by
++  the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
++
++Library
++-------
++
++- Issue #6438: Fixed distutils.cygwinccompiler.get_versions : the regular
++  expression string pattern was trying to match against a bytes returned by
++  Popen. Tested under win32 to build the py-postgresql project.
++
++- Issue #6258: Support AMD64 in bdist_msi.
++
++- Issue #6195: fixed doctest to no longer try to read 'source' data from
++  binary files.
++
++- Issue #5262: Fixed bug in next rollover time computation in
++  TimedRotatingFileHandler.
++
++- Issue #6217: The C implementation of io.TextIOWrapper didn't include the
++  errors property.  Additionally, the errors and encoding properties of StringIO
++  are always None now.
++
++- Issue #6137: The pickle module now translates module names when loading
++  or dumping pickles with a 2.x-compatible protocol, in order to make data
++  sharing and migration easier. This behaviour can be disabled using the
++  new `fix_imports` optional argument.
++
++- Removed the ipaddr module.
++
++- Issue #3613: base64.{encode,decode}string are now called
++  base64.{encode,decode}bytes which reflects what type they accept and return.
++  The old names are still there as deprecated aliases.
++
++- Issue #5767: Remove sgmlop support from xmlrpc.client.
++
++- Issue #6150: Fix test_unicode on wide-unicode builds.
++
++- Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty
++  parameters.
++
++Windows
++-------
++
++- Issue #6221: Delete test registry key before running the test.
++
++- Issue #6158: Package Sine-1000Hz-300ms.aif in MSI file.
++
++C-API
++-----
++
++- Issue #5735: Python compiled with --with-pydebug should throw an
++  ImportError when trying to import modules compiled without
++  --with-pydebug, and vice-versa.
++
++
++Build
++-----
++
++- Issue #6154: Make sure the intl library is added to LIBS if needed. Also
++  added LIBS to OS X framework builds.
++
++- Issue #5809: Specifying both --enable-framework and --enable-shared is
++  an error. Configure now explicity tells you about this.
++
++
++
++What's New in Python 3.1 release candidate 1?
++=============================================
++
++*Release date: 2009-05-30*
++
++Core and Builtins
++-----------------
++
++- Issue #6097: Escape UTF-8 surrogates resulting from mbstocs conversion
++  of the command line.
++
++- Issue #6012: Add cleanup support to O& argument parsing.
++
++- Issue #6089: Fixed str.format with certain invalid field specifiers
++  that would raise SystemError.
++
++- Issue #5982: staticmethod and classmethod now expose the wrapped
++  function with __func__.
++
++- Added support for multiple context managers in the same with-statement.
++  Deprecated contextlib.nested() which is no longer needed.
++
++- Issue #5829: complex("1e500") no longer raises OverflowError.  This
++  makes it consistent with float("1e500") and interpretation of real
++  and imaginary literals.
++
++- Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more.
++
++- Issue #5994: the marshal module now has docstrings.
++
++- Issue #5981: Fix three minor inf/nan issues in float.fromhex:
++  (1) inf and nan strings with trailing whitespace were incorrectly
++  rejected;  (2) parsing of strings representing infinities and nans
++  was locale aware; and (3) the interpretation of fromhex('-nan')
++  didn't match that of float('-nan').
++
++Library
++-------
++
++- Issue #4859: Implement PEP 383 for pwd, spwd, and grp.
++
++- smtplib 'login' and 'cram-md5' login are also fixed (see Issue #5259).
++
++- Issue #6121: pydoc now ignores leading and trailing spaces in the
++  argument to the 'help' function.
++
++- Issue #6118: urllib.parse.quote_plus ignored the encoding and errors
++  arguments for strings with a space in them.
++
++- collections.namedtuple() was not working with the following field
++  names:  cls, self, tuple, itemgetter, and property.
++
++- In unittest, using a skipping decorator on a class is now equivalent to
++  skipping every test on the class.  The ClassTestSuite class has been removed.
++
++- Issue #6050: Don't fail extracting a directory from a zipfile if
++  the directory already exists.
++
++- Issue #1309352: fcntl now converts its third arguments to a C `long` rather
++  than an int, which makes some operations possible under 64-bit Linux (e.g.
++  DN_MULTISHOT with F_NOTIFY).
++
++- Issue #5761: Add the name of the underlying file to the repr() of various
++  IO objects.
++
++- Issue #5259: smtplib plain auth login no longer gives a traceback.  Fix
++  by Musashi Tamura, tests by Marcin Bachry.
++
++- Issue #1983: Fix functions taking or returning a process identifier to use
++  the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have
++  a process identifier type wider than the standard C integer type.
++
++- Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket.
++  Patch by Farhan Ahmad, test by Marcin Bachry.
++
++- Issue #2116: Weak references and weak dictionaries now support copy()ing and
++  deepcopy()ing.
++
++- Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr.
++
++- Issue #5918: Fix a crash in the parser module.
++
++- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr.
++
++- Issue #5006: Better handling of unicode byte-order marks (BOM) in the io
++  library. This means, for example, that opening an UTF-16 text file in
++  append mode doesn't add a BOM at the end of the file if the file isn't
++  empty.
++
++- Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source'
++  file is a binary.  Patch by Brodie Rao, tests by Daniel Diniz.  This fix
++  corrects a pydoc regression.
++
++- Issue #5955: aifc's close method did not close the file it wrapped,
++  now it does.  This also means getfp method now returns the real fp.
++
++Installation
++------------
++
++- Issue #6047: fullinstall has been removed because Python 3's executable will
++  now be known as python3.
++
++- Lib/smtpd.py is no longer installed as a script.
++
++Extension Modules
++-----------------
++
++- Issue #3061: Use wcsftime for time.strftime where available.
++
++- Issue #4873: Fix resource leaks in error cases of pwd and grp.
++
++- Issue #6093: Fix off-by-one error in locale.strxfrm.
++
++- The _functools and _locale modules are now built into the libpython shared
++  library instead of as extension modules.
++
++Build
++-----
++
++- Issue #3585: Add pkg-config support. It creates a python-2.7.pc file
++  and a python3.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by
++  Clinton Roy.
++
++Tests
++-----
++
++- Issue #5442: Tests for importlib were not properly skipping case-sensitivity
++  tests on darwin even when the OS was installed on a case-sensitive
++  filesystem. Also fixed tests that should not be run when
++  sys.dont_write_bytecode is true.
++
++
++What's New in Python 3.1 beta 1?
++================================
++
++*Release date: 2009-05-06*
++
++Core and Builtins
++-----------------
++
++- Issue #5914: Add new C API function PyOS_string_to_double, and
++  deprecate PyOS_ascii_strtod and PyOS_ascii_atof.
++
++- Issue #3382: float.__format__, complex.__format__, and %-formatting
++  no longer map 'F' to 'f'. Because of issue #5859 (below), this only
++  affects nan -> NAN and inf -> INF.
++
++- Issue #5799: ntpath (ie, os.path on Windows) fully supports UNC pathnames
++  in all operations, including splitdrive, split, etc.  splitunc() now issues
++  a PendingDeprecation warning.
++
++- Issue #5920: For float.__format__, change the behavior with the
++  empty presentation type (that is, not one of 'e', 'f', 'g', or 'n')
++  to be like 'g' but with at least one decimal point and with a
++  default precision of 12. Previously, the behavior the same but with
++  a default precision of 6.  This more closely matches str(), and
++  reduces surprises when adding alignment flags to the empty
++  presentation type. This also affects the new complex.__format__ in
++  the same way.
++
++- Implement PEP 383, Non-decodable Bytes in System Character Interfaces.
++
++- Issue #5890: in subclasses of 'property' the __doc__ attribute was
++  shadowed by classtype's, even if it was None.  property now
++  inserts the __doc__ into the subclass instance __dict__.
++
++- Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal
++  sequences. Patch by Nick Barnes and Victor Stinner.
++
++- Issue #3672: Reject surrogates in utf-8 codec; add surrogatepass error handler.
++
++- Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have
++  received a new method, detach().  detach() disconnects the underlying stream
++  from the buffer or text IO and returns it.
++
++- Issue #5859: Remove switch from '%f' to '%g'-style formatting for
++  floats with absolute value over 1e50.  Also remove length
++  restrictions for float formatting: '%.67f' % 12.34 and '%.120e' %
++  12.34 no longer raise an exception.
++
++- Issue #1588: Add complex.__format__. For example,
++  format(complex(1, 2./3), '.5') now produces a sensible result.
++
++- Issue #5864: Fix empty format code formatting for floats so that it
++  never gives more than the requested number of significant digits.
++
++- Issue #5793: Rationalize isdigit / isalpha / tolower, etc. Includes
++  new Py_ISDIGIT / Py_ISALPHA / Py_TOLOWER, etc. in pctypes.h.
++
++- Issue #5835: Deprecate PyOS_ascii_formatd.
++
++- Issue #4971: Fix titlecase for characters that are their own
++  titlecase, but not their own uppercase.
++
++- Issue #5283: Setting __class__ in __del__ caused a segfault.
++
++- Issue #5816: complex(repr(z)) now recovers z exactly, even when
++  z involves nans, infs or negative zeros.
++
++- Issue #3166: Make int -> float conversions correctly rounded.
++
++- Issue #1869 (and many duplicates): make round(x, n) correctly
++  rounded for a float x, by using the decimal <-> binary conversions
++  from Python/dtoa.c.  As a consequence, (e.g.) round(x, 2) now
++  consistently agrees with format(x, '.2f').
++
++- Issue #5787: object.__getattribute__(some_type, "__bases__") segfaulted on
++  some builtin types.
++
++- Issue #5772: format(1e100, '<') produces '1e+100', not '1.0e+100'.
++
++- Issue #5515: str.format() type 'n' combined with commas and leading
++  zeros no longer gives odd results with ints and floats.
++
++- Implement PEP 378, Format Specifier for Thousands Separator, for
++  floats.
++
++- The str function switches to exponential notation at
++  1e11, not 1e12.  This avoids printing 13 significant digits in
++  situations where only 12 of them are correct.  Example problem
++  value: str(1e11 + 0.5).  (This minor issue has existed in 2.x for a
++  long time.)
++
++- Issue #1580: On most platforms, use a 'short' float repr: for a
++  finite float x, repr(x) now outputs a string based on the shortest
++  sequence of decimal digits that rounds to x.  Previous behaviour was
++  to output 17 significant digits and then strip trailing zeros.
++  Another minor difference is that the new repr switches to
++  exponential notation at 1e16 instead of the previous 1e17; this
++  avoids misleading output in some cases.
++
++  There's a new sys attribute sys.float_repr_style, which takes
++  the value 'short' to indicate that we're using short float repr,
++  and 'legacy' if the short float repr isn't available for one
++  reason or another.
++
++  The float repr change involves incorporating David Gay's 'perfect
++  rounding' code into the Python core (it's in Python/dtoa.c).  As a
++  secondary consequence, all string-to-float and float-to-string
++  conversions (including all float formatting operations) will be
++  correctly rounded on these platforms.
++
++  See issue #1580 discussions for details of platforms for which
++  this change does not apply.
++
++- Issue #5759: float() didn't call __float__ on str subclasses.
++
++- The string.maketrans() function is deprecated; there is a new static method
++  maketrans() on the bytes and bytearray classes.  This removes confusion about
++  the types string.maketrans() is supposed to work with, and mirrors the
++  methods available on the str class.
++
++- Issue #2170: refactored xml.dom.minidom.normalize, increasing both
++  its clarity and its speed.
++
++- Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add ``do { ... } while (0)``
++  to avoid compiler warnings.
++
++- Issue #3739: The unicode-internal encoder now reports the number of characters
++  consumed like any other encoder (instead of the number of bytes).
++
++Installation
++------------
++
++- Issue #5756: Install idle and pydoc with a 3 suffix.
++
++Library
++-------
++
++- Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
++
++- Issue #5311: bdist_msi can now build packages that do not depend on a
++  specific Python version.
++
++- Issue #5150: IDLE's format menu now has an option to strip trailing
++  whitespace.
++
++- Issue #5940: distutils.command.build_clib.check_library_list was not doing
++  the right type checkings anymore.
++
++- Issue #4875: On win32, ctypes.util.find_library does no longer
++  return directories.
++
++- Issue #5142: Add the ability to skip modules while stepping to pdb.
++
++- Issue #1309567: Fix linecache behavior of stripping subdirectories when
++  looking for files given by a relative filename.
++
++- Issue #5923: Update the ``turtle`` module to version 1.1, add two new
++  turtle demos in Demo/turtle.
++
++- Issue #5692: In ``zipfile.Zipfile``, fix wrong path calculation when
++  extracting a file to the root directory.
++
++- Issue #5913: os.listdir() should fail for empty path on windows.
++
++- Issue #5084: unpickling now interns the attribute names of pickled objects,
++  saving memory and avoiding growth in size of subsequent pickles. Proposal
++  and original patch by Jake McGuire.
++
++- The json module now works exclusively with str and not bytes.
++
++- Issue #3959: The ipaddr module has been added to the standard library.
++  Contributed by Google.
++
++- Issue #3002: ``shutil.copyfile()`` and ``shutil.copytree()`` now raise an
++  error when a named pipe is encountered, rather than blocking infinitely.
++
++- Issue #5857: tokenize.tokenize() now returns named tuples.
++
++- Issue #4305: ctypes should now build again on mipsel-linux-gnu
++
++- Issue #1734234: Massively speedup ``unicodedata.normalize()`` when the
++  string is already in normalized form, by performing a quick check beforehand.
++  Original patch by Rauli Ruohonen.
++
++- Issue #5853: calling a function of the mimetypes module from several threads
++  at once could hit the recursion limit if the mimetypes database hadn't been
++  initialized before.
++
++- Issue #5854: Updated __all__ to include some missing names and remove some
++  names which should not be exported.
++
++- Issue #3102:  All global symbols that the _ctypes extension defines
++  are now prefixed with 'Py' or '_ctypes'.
++
++- Issue #5041: ctypes does now allow pickling wide character.
++
++- Issue #5812: For the two-argument form of the Fraction constructor,
++  Fraction(m, n), m and n are permitted to be arbitrary Rational
++  instances.
++
++- Issue #5812: Fraction('1e6') is valid: more generally, any string
++  that's valid for float() is now valid for Fraction(), with the
++  exception of strings representing NaNs and infinities.
++
++- Issue #5734: BufferedRWPair was poorly tested and had several glaring
++  bugs. Patch by Brian Quinlan.
++
++- Issue #1161031: fix readwrite select flag handling: POLLPRI now
++  results in a handle_expt_event call, not handle_read_event, and POLLERR
++  and POLLNVAL now call handle_close, not handle_expt_event.  Also,
++  dispatcher now has an 'ignore_log_types' attribute for suppressing
++  log messages, which is set to 'warning' by default.
++
++- Issue #2703: SimpleXMLRPCDispatcher.__init__: Provide default values for
++  new arguments introduced in 2.5.
++
++- Issue #5828 (Invalid behavior of unicode.lower): Fixed bogus logic in
++  makeunicodedata.py and regenerated the Unicode database (This fixes
++  u'\u1d79'.lower() == '\x00').
++
++Extension Modules
++-----------------
++
++- Issue #5881: Remove old undocumented compatibility interfaces in hashlib and
++  pwd.
++
++- Issue #5463: In struct module, remove deprecated float coercion
++  for integer type codes: struct.pack('L', 0.3) should now raise
++  an error.  The _PY_STRUCT_FLOAT_COERCE constant has been removed.
++  The version number has been bumped to 0.3.
++
++- Issue #5359: Readd the Berkeley DB detection code to allow _dbm be built
++  using Berkeley DB.
++
++Tests
++-----
++
++- Issue #5354: New test support function import_fresh_module() makes
++  it easy to import both normal and optimised versions of modules.
++  test_heapq and test_warnings have been adjusted to use it, tests for
++  other modules with both C and Python implementations in the stdlib
++  can be adjusted to use it over time.
++
++- Issue #5837: Certain sequences of calls to set() and unset() for
++  support.EnvironmentVarGuard objects restored the environment variables
++  incorrectly on __exit__.
++
++C-API
++-----
++
++- Issue #5630: A replacement PyCObject API, PyCapsule, has been added.
++
++
++What's New in Python 3.1 alpha 2?
++=================================
++
++*Release date: 2009-4-4*
++
++Core and Builtins
++-----------------
++
++- Implement PEP 378, Format Specifier for Thousands Separator, for
++  integers.
++
++- Issue #5666: Py_BuildValue's 'c' code should create byte strings.
++
++- Issue #5499: The 'c' code for argument parsing functions now only accepts a
++  byte, and the 'C' code only accepts a unicode character.
++
++- Fix a problem in PyErr_NormalizeException that leads to "undetected errors"
++  when hitting the recursion limit under certain circumstances.
++
++- Issue #1665206: Remove the last eager import in _warnings.c and make it lazy.
++
++- Fix a segfault when running test_exceptions with coverage, caused by
++  insufficient checks in accessors of Exception.__context__.
++
++- Issue #5604: non-ASCII characters in module name passed to
++  imp.find_module() were converted to UTF-8 while the path is
++  converted to the default filesystem encoding, causing nonsense.
++
++- Issue #5126: str.isprintable() returned False for space characters.
++
++- Issue #4865: On MacOSX /Library/Python/2.7/site-packages is added to
++  the end sys.path, for compatibility with the system install of Python.
++
++- Issue #4688: Add a heuristic so that tuples and dicts containing only
++  untrackable objects are not tracked by the garbage collector. This can
++  reduce the size of collections and therefore the garbage collection overhead
++  on long-running programs, depending on their particular use of datatypes.
++
++- Issue #5512: Rewrite PyLong long division algorithm (x_divrem) to
++  improve its performance.  Long divisions and remainder operations
++  are now between 50% and 150% faster.
++
++- Issue #4258: Make it possible to use base 2**30 instead of base
++  2**15 for the internal representation of integers, for performance
++  reasons.  Base 2**30 is enabled by default on 64-bit machines.  Add
++  --enable-big-digits option to configure, which overrides the
++  default.  Add sys.int_info structseq to provide information about
++  the internal format.
++
++- Issue #4474: PyUnicode_FromWideChar now converts characters outside
++  the BMP to surrogate pairs, on systems with sizeof(wchar_t) == 4
++  and sizeof(Py_UNICODE) == 2.
++
++- Issue #5237: Allow auto-numbered fields in str.format(). For
++  example: '{} {}'.format(1, 2) == '1 2'.
++
++- Issue #5392: when a very low recursion limit was set, the interpreter would
++  abort with a fatal error after the recursion limit was hit twice.
++
++- Issue #3845: In PyRun_SimpleFileExFlags avoid invalid memory access with
++  short file names.
++
++Library
++-------
++
++- Issue #2625: added missing items() call to the for loop in
++  mailbox.MH.get_message().
++
++- Issue #5640: Fix _multibytecodec so that CJK codecs don't repeat
++  error substitutions from non-strict codec error callbacks in
++  incrementalencoder and StreamWriter.
++
++- Issue #5656: Fix the coverage reporting when running the test suite with
++  the -T argument.
++
++- Issue #5647: MutableSet.__iand__() no longer mutates self during iteration.
++
++- Issue #5624: Fix the _winreg module name still used in several modules.
++
++- Issue #5628: Fix io.TextIOWrapper.read() with a unreadable buffer.
++
++- Issue #5619: Multiprocessing children disobey the debug flag and causes
++  popups on windows buildbots. Patch applied to work around this issue.
++
++- Issue #5400: Added patch for multiprocessing on netbsd compilation/support
++
++- Issue #5387: Fixed mmap.move crash by integer overflow.
++
++- Issue #5261: Patch multiprocessing's semaphore.c to support context
++  manager use: "with multiprocessing.Lock()" works now.
++
++- Issue #5236: Change time.strptime() to only take strings. Didn't work with
++  bytes already but the failure was non-obvious.
++
++- Issue #5177: Multiprocessing's SocketListener class now uses
++  socket.SO_REUSEADDR on all connections so that the user no longer needs
++  to wait 120 seconds for the socket to expire.
++
++- Issue #5595: Fix UnboundedLocalError in ntpath.ismount().
++
++- Issue #1174606: Calling read() without arguments of an unbounded file
++  (typically /dev/zero under Unix) could crash the interpreter.
++
++- The max_buffer_size arguments of io.BufferedWriter, io.BufferedRWPair, and
++  io.BufferedRandom have been deprecated for removal in Python 3.2.
++
++- Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loop
++  forever on incomplete input. That caused tarfile.open() to hang when used
++  with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or
++  partial bzip2 compressed data.
++
++- Issue #2110: Add support for thousands separator and 'n' type
++  specifier to Decimal.__format__
++
++- Fix Decimal.__format__ bug that swapped the meanings of the '<' and
++  '>' alignment characters.
++
++- The error detection code in FileIO.close() could fail to reflect the `errno`
++  value, and report it as -1 instead.
++
++- Issue #5016: FileIO.seekable() could return False if the file position
++  was negative when truncated to a C int. Patch by Victor Stinner.
++
++Extension Modules
++-----------------
++
++- Issue #5391: mmap now deals exclusively with bytes.
++
++- Issue #5463: In struct module, remove deprecated overflow wrapping
++  when packing an integer: struct.pack('=L', -1) now raises
++  struct.error instead of returning b'\xff\xff\xff\xff'.  The
++  _PY_STRUCT_RANGE_CHECKING and _PY_STRUCT_OVERFLOW_MASKING constants
++  have been removed from the struct module.
++
++
++What's New in Python 3.1 alpha 1
++================================
++
++*Release date: 2009-03-07*
++
++Core and Builtins
++-----------------
++
++- The io module has been reimplemented in C for speed.
++
++- Give dict views an informative __repr__.
++
++- Issue #5247: Improve error message when unknown format codes are
++  used when using str.format() with str, int, and float arguments.
++
++- Issue #5249: time.strftime returned malformed string when format string
++  contained non ascii character on windows.
++
++- Issue #4626: compile(), exec(), and eval() ignore the coding cookie if the
++  source has already been decoded into str.
++
++- Issue #5186: Reduce hash collisions for objects with no __hash__ method by
++  rotating the object pointer by 4 bits to the right.
++
++- Issue #4575: Fix Py_IS_INFINITY macro to work correctly on x87 FPUs:
++  it now forces its argument to double before testing for infinity.
++
++- Issue #5137: Make len() correctly raise a TypeError when a __len__ method
++  returns a non-number type.
++
++- Issue #5182: Removed memoryview.__str__.
++
++- Issue #1717: Removed builtin cmp() function, dropped tp_compare
++  slot, the C API functions PyObject_Compare and PyUnicode_Compare and
++  the type definition cmpfunc.  The tp_compare slot has been renamed
++  to tp_reserved, and is reserved for future usage.
++
++- Issue #1242657: the __len__() and __length_hint__() calls in several tools
++  were suppressing all exceptions.  These include list() and bytearray().
++
++- Issue #4707: round(x, n) now returns an integer if x is an integer.
++  Previously it returned a float.
++
++- Issue #4753: By enabling a configure option named '--with-computed-gotos'
++  on compilers that support it (notably: gcc, SunPro, icc), the bytecode
++  evaluation loop is compiled with a new dispatch mechanism which gives
++  speedups of up to 20%, depending on the system, on various benchmarks.
++
++- Issue #4874: Most builtin decoders now reject unicode input.
++
++- Issue #4842: Don't allow trailing 'L' when constructing an integer
++  from a string.
++
++- Issue #4991: os.fdopen now raises an OSError for invalid file descriptors.
++
++- Issue #4838: When a module is deallocated, free the memory backing the
++  optional module state data.
++
++- Issue #4910: Rename nb_long slot to nb_reserved, and change its
++  type to ``(void *)``.
++
++- Issue #4935: The overflow checking code in the expandtabs() method common
++  to str, bytes and bytearray could be optimized away by the compiler, letting
++  the interpreter segfault instead of raising an error.
++
++- Issue #3720: Fix a crash when an iterator modifies its class and removes its
++  __next__ method.
++
++- Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API
++  function no longer attempt to call the __long__ slot to convert an object
++  to an integer.  Only the __int__ and __trunc__ slots are examined.
++
++- Issue #4893: Use NT threading on CE.
++
++- Issue #4915: Port sysmodule to Windows CE.
++
++- Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The
++  common cases are optimized thanks to a dedicated fast path and a moderate
++  amount of loop unrolling.
++
++- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
++  collecting the oldest generation) so that allocating lots of objects without
++  destroying them does not show quadratic performance. Based on a proposal by
++  Martin von Löwis at
++  http://mail.python.org/pipermail/python-dev/2008-June/080579.html.
++
++- Issue #4604: Some objects of the I/O library could still be used after
++  having been closed (for instance, a read() call could return some
++  previously buffered data). Patch by Dmitry Vasiliev.
++
++- Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line
++  flag to work properly. Furthermore, when specifying -u, the text stdout
++  and stderr streams have line-by-line buffering enabled (the default being
++  to buffer arbitrary chunks of data).
++
++- The internal table, _PyLong_DigitValue, is now an array of unsigned chars
++  instead of ints (reducing its size from 4 to 8 times thereby reducing
++  Python's overall memory).
++
++- Issue #1180193: When importing a module from a .pyc (or .pyo) file with
++  an existing .py counterpart, override the co_filename attributes of all
++  code objects if the original filename is obsolete (which can happen if the
++  file has been renamed, moved, or if it is accessed through different paths).
++  Patch by Ziga Seilnacht and Jean-Paul Calderone.
++
++- Issue #4580: Fix slicing of memoryviews when the item size is greater than
++  one byte. Also fixes the meaning of len() so that it returns the number of
++  items, rather than the size in bytes.
++
++- Issue #4075: Use OutputDebugStringW in Py_FatalError.
++
++- Issue #4747: When the terminal does not use utf-8, executing a script with
++  non-ascii characters in its name could fail with a "SyntaxError: None" error.
++
++- Issue #4797: IOError.filename was not set when ``_fileio.FileIO`` failed
++  to open file with a bytes filename on Windows.
++
++- Issue #3680: Reference cycles created through a dict, set or deque iterator
++  did not get collected.
++
++- Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types
++  where the tp_hash and tp_dict slots are both NULL.
++
++- Issue #4759: None is now allowed as the first argument of
++  bytearray.translate().  It was always allowed for bytes.translate().
++
++- Added test case to ensure attempts to read from a file opened for writing
++  fail.
++
++- Issue #3106: Speedup some comparisons (str/str and int/int).
++
++- Issue #2183: Simplify and optimize bytecode for list, dict and set
++  comprehensions. Original patch for list comprehensions by Neal Norwitz.
++
++- Issue #2467: gc.DEBUG_STATS reported invalid elapsed times. Also, always
++  print elapsed times, not only when some objects are uncollectable /
++  unreachable. Original patch by Neil Schemenauer.
++
++- Issue #3439: Add a bit_length method to int.
++
++- Issue #2173: When getting device encoding, check that return value of
++  nl_langinfo is not the empty string.  This was causing silent build
++  failures on OS X.
++
++- Issue #4597: Fixed several opcodes that weren't always propagating
++  exceptions.
++
++- Issue #4589: Fixed exception handling when the __exit__ function of a
++  context manager returns a value that cannot be converted to a bool.
++
++- Issue #4445: Replace "sizeof(PyBytesObject)" with
++  "offsetof(PyBytesObject, ob_sval) + 1" when allocating memory for
++  bytes instances.  On a typical machine this saves 3 bytes of memory
++  (on average) per allocation of a bytes instance.
++
++- Issue #4533: File read operation was dreadfully slow due to a slowly
++  growing read buffer. Fixed by using the same growth rate algorithm as
++  Python 2.x.
++
++- Issue #4509: Various issues surrounding resize of bytearray objects to
++  which there are buffer exports (e.g. memoryview instances).
++
++- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
++  method on file objects with closefd=False. The file descriptor is still
++  kept open but the file object behaves like a closed file. The ``FileIO``
++  object also got a new readonly attribute ``closefd``.
++
++- Issue #4569: Interpreter crash when mutating a memoryview with an item size
++  larger than 1.
++
++- Issue #4748: Lambda generators no longer return a value.
++
++- The re.sub(), re.subn() and re.split() functions now accept a flags parameter.
++
++- Issue #5108: Handle %s like %S, %R and %A in PyUnicode_FromFormatV(): Call
++  PyUnicode_DecodeUTF8() once, remember the result and output it in a second
++  step. This avoids problems with counting UTF-8 bytes that ignores the effect
++  of using the replace error handler in PyUnicode_DecodeUTF8().
++
++Library
++-------
++
++- Issue #7071: byte-compilation in Distutils is now done with respect to
++  sys.dont_write_bytecode.
++
++- Issue #7066: archive_util.make_archive now restores the cwd if an error is
++  raised. Initial patch by Ezio Melotti.
++
++- Issue #6516: Added owner/group support when creating tar archives in
++  Distutils.
++
++- Issue #6954: Fixed crash when using DISTUTILS_DEBUG flag in Distutils.
++
++- Issue #6163: Fixed HP-UX runtime library dir options in
++  distutils.unixcompiler. Initial patch by Sridhar Ratnakumar and
++  Michael Haubenwallner.
++
++- Issue #6693: New functions in site.py to get user/global site packages paths.
++
++- Issue #6511: ZipFile now raises BadZipfile (instead of an IOError) when
++  opening an empty or very small file.
++
++- Issue #6545: Removed assert statements in distutils.Extension, so the
++  behavior is similar when used with -O.
++
++- unittest has been split up into a package.  All old names should still work.
++
++- Issue #6466: now distutils.cygwinccompiler and distutils.emxccompiler
++  uses the same refactored function to get gcc/ld/dllwrap versions numbers.
++  It's `distutils.util.get_compiler_versions`. Added deprecation warnings
++  for the obsolete get_versions() functions.
++
++- Issue #6433: fixed issues with multiprocessing.pool.map hanging on empty list
++
++- Issue #6314: logging: Extra checks on the "level" argument in more places.
++
++- Issue #2622: Fixed an ImportError when importing email.message from a
++  standalone application built with py2exe or py2app.
++
++- Issue #6455: Fixed test_build_ext under win32.
++
++- Issue #6377: Enabled the compiler option, and deprecate its usage as an
++  attribute.
++
++- Issue #6413: Fixed the log level in distutils.dist for announce.
++
++- Issue #6403: Fixed package path usage in build_ext.
++
++- Issues #5155, 5313, 5331: multiprocessing.Process._bootstrap was
++  unconditionally calling "os.close(sys.stdin.fileno())" resulting in file
++  descriptor errors
++
++- Issue #6365: Distutils build_ext inplace mode was copying the compiled
++  extension in a subdirectory if the extension name had dots.
++
++- Issue #6164: Added an AIX specific linker argument in Distutils
++  unixcompiler. Original patch by Sridhar Ratnakumar.
++
++- Issue #6286: Now Distutils upload command is based on urllib2 instead of
++  httplib, allowing the usage of http_proxy.
++
++- Issue #6287: Added the license field in Distutils documentation.
++
++- Issue #6263: Fixed syntax error in distutils.cygwincompiler.
++
++- Issue #5201: distutils.sysconfig.parse_makefile() now understands `$$`
++  in Makefiles. This prevents compile errors when using syntax like:
++  `LDFLAGS='-rpath=\$$LIB:/some/other/path'`. Patch by Floris Bruynooghe.
++
++- Issue #6131: test_modulefinder leaked when run after test_distutils.
++  Patch by Hirokazu Yamamoto.
++
++- Issue #6048: Now Distutils uses the tarfile module in archive_util.
++
++- Issue #6062: In distutils, fixed the package option of build_ext. Feedback
++  and tests on pywin32 by Tim Golden.
++
++- Issue #6053: Fixed distutils tests on win32. patch by Hirokazu Yamamoto.
++
++- Issue #6046: Fixed the library extension when distutils build_ext is used
++  inplace. Initial patch by Roumen Petrov.
++
++- Issue #6041: Now distutils `sdist` and `register` commands use `check` as a
++  subcommand.
++
++- Issue #6022: a test file was created in the current working directory by
++  test_get_outputs in Distutils.
++
++- Issue #5977: distutils build_ext.get_outputs was not taking into account the
++  inplace option. Initial patch by kxroberto.
++
++- Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken
++  for old-style extensions.
++
++- Issue #5976: Fixed Distutils test_check_environ.
++
++- Issue #5941: Distutils build_clib command was not working anymore because
++  of an incomplete costumization of the archiver command. Added ARFLAGS in the
++  Makefile besides AR and make Distutils use it. Original patch by David
++  Cournapeau.
++
++- Issue #2245: aifc now skips chunk types it doesn't recognize, per spec.
++
++- Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive
++  anymore.
++
++- Issue #5810: Fixed Distutils test_build_scripts so it uses
++  sysconfig.get_config_vars.
++
++- Issue #4951: Fixed failure in test_httpservers.
++
++- Issue #5795: Fixed test_distutils failure on Debian ppc.
++
++- Issue #5607: fixed Distutils test_get_platform for Mac OS X fat binaries.
++
++- Issue #5741: don't disallow "%%" (which is an escape for "%") when setting
++  a value in SafeConfigParser.
++
++- Issue #5732: added a new command in Distutils: check.
++
++- Issue #5731: Distutils bdist_wininst no longer worked on non-Windows
++  platforms. Initial patch by Paul Moore.
++
++- Issue #5095: Added bdist_msi to the list of bdist supported formats.
++  Initial fix by Steven Bethard.
++
++- Issue #1491431: Fixed distutils.filelist.glob_to_re for edge cases.
++  Initial fix by Wayne Davison.
++
++- Issue #5694: removed spurious test output in Distutils (test_clean).
++
++- Issue #1326077: fix the formatting of SyntaxErrors by the traceback module.
++
++- Issue #1665206 (partially): Move imports in cgitb to the top of the module
++  instead of performing them in functions. Helps prevent import deadlocking in
++  threads.
++
++- Issue #2522: locale.format now checks its first argument to ensure it has
++  been passed only one pattern, avoiding mysterious errors where it appeared
++  that it was failing to do localization.
++
++- Issue #5583: Added optional Extensions in Distutils. Initial patch by Georg
++  Brandl.
++
++- Issue #1222: locale.format() bug when the thousands separator is a space
++  character.
++
++- Issue #5472: Fixed distutils.test_util tear down. Original patch by
++  Tim Golden.
++
++- collections.deque() objects now have a read-only attribute called maxlen.
++
++- Issue #2638: Show a window constructed with tkSimpleDialog.Dialog only after
++  it is has been populated and properly configured in order to prevent
++  window flashing.
++
++- Issue #4792: Prevent a segfault in _tkinter by using the
++  guaranteed to be safe interp argument given to the PythonCmd in place of
++  the Tcl interpreter taken from a PythonCmd_ClientData.
++
++- Issue #5193: Guarantee that tkinter.Text.search returns a string.
++
++- Issue #5394: removed > 2.3 syntax from distutils.msvc9compiler.
++  Original patch by Akira Kitada.
++
++- Issue #5334: array.fromfile() failed to insert values when EOFError was raised.
++
++- Issue #5385: Fixed mmap crash after resize failure on windows.
++
++- Issue #5179: Fixed subprocess handle leak on failure on windows.
++
++- PEP 372:  Added collections.OrderedDict().
++
++- The _asdict() for method for namedtuples now returns an OrderedDict().
++
++- configparser now defaults to using an ordered dictionary.
++
++- Issue #5401: Fixed a performance problem in mimetypes when ``from mimetypes
++  import guess_extension`` was used.
++
++- Issue #1733986: Fixed mmap crash in accessing elements of second map object
++  with same tagname but larger size than first map. (Windows)
++
++- Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer
++  overrun.
++
++- Issue #1533164: Installed but not listed ``*.pyo`` was breaking Distutils
++  bdist_rpm command.
++
++- Issue #5378: added --quiet option to Distutils bdist_rpm command.
++
++- Issue #5052: make Distutils compatible with 2.3 again.
++
++- Issue #5316: Fixed buildbot failures introduced by multiple inheritance
++  in Distutils tests.
++
++- Issue #5287: Add exception handling around findCaller() call to help out
++  IronPython.
++
++- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0,
++  The file was resized to wrong size.
++
++- Issue #5292: Fixed mmap crash on its boundary access m[len(m)].
++
++- Issue #2279: distutils.sdist.add_defaults now add files
++  from the package_data and the data_files metadata.
++
++- Issue #5257: refactored all tests in distutils, so they use
++  support.TempdirManager, to avoid writing in the tests directory.
++
++- Issue #4524: distutils build_script command failed with --with-suffix=3.
++  Initial patch by Amaury Forgeot d'Arc.
++
++- Issue #2461: added tests for distutils.util
++
++- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions
++  which inherited from numbers.py which did not have __slots__ defined.  The
++  numbers hierarchy now has its own __slots__ declarations.
++
++- Issue #4631: Fix urlopen() result when an HTTP response uses chunked
++  encoding.
++
++- Issue #5203: Fixed ctypes segfaults when passing a unicode string to a
++  function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false).
++
++- Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored
++  under NT and OS2. Patch by Philip Jenvey.
++
++- Issue #5128: Make compileall properly inspect bytecode to determine if needs
++  to be recreated. This avoids a timing hole thanks to the old reliance on the
++  ctime of the files involved.
++
++- Issue #5122: Synchronize tk load failure check to prevent a potential
++  deadlock.
++
++- Issue #1818: collections.namedtuple() now supports a keyword argument
++  'rename' which lets invalid fieldnames be automatically converted to
++  positional names in the form, _1, _2, ...
++
++- Issue #4890: Handle empty text search pattern in Tkinter.Text.search.
++
++- Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a
++  public documented method ``ZipImporter.get_filename()``.
++
++- Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support
++  the execution of packages by looking for and executing a ``__main__``
++  submodule when a package name is supplied. Initial patch by Andi
++  Vajda.
++
++- Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will
++  not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in
++  Tkapp_Call when calling from a thread different than the one that created
++  the Tcl interpreter. Patch by Robert Hancock.
++
++- Issue #4285: Change sys.version_info to be a named tuple. Patch by
++  Ross Light.
++
++- Issue #1520877: Now distutils.sysconfig reads $AR from the
++  environment/Makefile. Patch by Douglas Greiman.
++
++- Issue #1276768: The verbose option was not used in the code of
++  distutils.file_util and distutils.dir_util.
++
++- Issue #5132: Fixed trouble building extensions under Solaris with
++  --enabled-shared activated. Initial patch by Dave Peterson.
++
++- Issue #1581476: Always use the Tcl global namespace when calling into Tcl.
++
++- The shelve module now defaults to pickle protocol 3.
++
++- Fix a bug in the trace module where a bytes object from co_lnotab had its
++  items being passed through ord().
++
++- Issue #2047: shutil.move() could believe that its destination path was
++  inside its source path if it began with the same letters (e.g. "src" vs.
++  "src.new").
++
++- Added the ttk module. See issue #2983: Ttk support for Tkinter.
++
++- Removed isSequenceType(), isMappingType, and isNumberType() from the
++  operator module; use the abstract base classes instead.  Also removed
++  the repeat() function; use mul() instead.
++
++- Issue #5021:  doctest.testfile() did not create __name__ and
++  collections.namedtuple() relied on __name__ being defined.
++
++- Backport importlib from Python 3.1. Only the import_module() function has
++  been backported to help facilitate transitions from 2.7 to 3.1.
++
++- Issue #1885: distutils. When running sdist with --formats=tar,gztar
++  the tar file was overriden by the gztar one.
++
++- Issue #4863: distutils.mwerkscompiler has been removed.
++
++- Added a new itertools functions:  combinations_with_replacement()
++  and compress().
++
++- Issue #5032:  added a step argument to itertools.count() and
++  allowed non-integer arguments.
++
++- Fix and properly document the multiprocessing module's logging
++  support, expose the internal levels and provide proper usage
++  examples.
++
++- Issue #1672332: fix unpickling of subnormal floats, which was
++  producing a ValueError on some platforms.
++
++- Issue #3881: Help Tcl to load even when started through the
++  unreadable local symlink to "Program Files" on Vista.
++
++- Issue #4710: Extract directories properly in the zipfile module;
++  allow adding directories to a zipfile.
++
++- Issue #3807: _multiprocessing build fails when configure is passed
++  --without-threads argument. When this occurs, _multiprocessing will
++  be disabled, and not compiled.
++
++- Issue #5008: When a file is opened in append mode with the new IO library,
++  do an explicit seek to the end of file (so that e.g. tell() returns the
++  file size rather than 0). This is consistent with the behaviour of the
++  traditional 2.x file object.
++
++- Issue #5013: Fixed a bug in FileHandler which occurred when the delay
++  parameter was set.
++
++- Issue #4842: Always append a trailing 'L' when pickling longs using
++  pickle protocol 0.  When reading, the 'L' is optional.
++
++- Add the importlib package.
++
++- Issue #4301: Patch the logging module to add processName support, remove
++  _check_logger_class from multiprocessing.
++
++- Issue #3325: Remove python2.x try: except: imports for old cPickle from
++  multiprocessing.
++
++- Issue #4959: inspect.formatargspec now works for keyword only arguments
++  without defaults.
++
++- Issue #3321: ``_multiprocessing.Connection()`` doesn't check handle; added checks
++  for Unix machines for negative handles and large int handles. Without this check
++  it is possible to segfault the interpreter.
++
++- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue
++  in sharedctypes.py.
++
++- Issue #1225107: inspect.isclass() returned True for instances with a custom
++  __getattr__.
++
++- Issue #3826 and #4791: The socket module now closes the underlying socket
++  appropriately when it is being used via socket.makefile() objects
++  rather than delaying the close by waiting for garbage collection to do it.
++
++- Issue #1696199:  Add collections.Counter() for rapid and convenient
++  counting.
++
++- Issue #3860: GzipFile and BZ2File now support the context manager protocol.
++
++- Issue #4867: Fixed a crash in ctypes when passing a string to a
++  function without defining argtypes.
++
++- Issue #4272: Add an optional argument to the GzipFile constructor to override
++  the timestamp in the gzip stream. The default value remains the current time.
++  The information can be used by e.g. gunzip when decompressing. Patch by
++  Jacques Frechet.
++
++- Restore Python 2.3 compatibility for decimal.py.
++
++- Issue #3638: Remove functions from _tkinter module level that depend on
++  TkappObject to work with multiple threads.
++
++- Issue #4718: Adapt the wsgiref package so that it actually works with
++  Python 3.x, in accordance with the `official amendments of the spec
++  <http://www.wsgi.org/wsgi/Amendments_1.0>`_.
++
++- Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float()
++  to the decimal module.
++
++- Fractions.from_float() no longer loses precision for integers too big to
++  cast as floats.
++
++- Issue #4812: add missing underscore prefix to some internal-use-only
++  constants in the decimal module.  (Dec_0 becomes _Dec_0, etc.)
++
++- Issue #4790: The nsmallest() and nlargest() functions in the heapq module
++  did unnecessary work in the common case where no key function was specified.
++
++- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when
++  the function is not a generator.
++
++- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case
++  no MSVC compiler is found under Windows. Original patch by Philip Jenvey.
++
++- Issue #4646: distutils was choking on empty options arg in the setup
++  function. Original patch by Thomas Heller.
++
++- Issue #3767: Convert Tk object to string in tkColorChooser.
++
++- Issue #3248: Allow placing ScrolledText in a PanedWindow.
++
++- Issue #4444: Allow assertRaises() to be used as a context handler, so that
++  the code under test can be written inline if more practical.
++
++- Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@')
++  works as expected in the interactive environment.
++
++- Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by
++  Gabriel Genellina.
++
++- Issue #4574: reading an UTF16-encoded text file crashes if \r on 64-char
++  boundary.
++
++- Issue #4223: inspect.getsource() will now correctly display source code
++  for packages loaded via zipimport (or any other conformant PEP 302
++  loader). Original patch by Alexander Belopolsky.
++
++- Issue #4201: pdb can now access and display source code loaded via
++  zipimport (or any other conformant PEP 302 loader). Original patch by
++  Alexander Belopolsky.
++
++- Issue #4197: doctests in modules loaded via zipimport (or any other PEP
++  302 conformant loader) will now work correctly in most cases (they
++  are still subject to the constraints that exist for all code running
++  from inside a module loaded via a PEP 302 loader and attempting to
++  perform IO operations based on __file__). Original patch by
++  Alexander Belopolsky.
++
++- Issues #4082 and #4512: Add runpy support to zipimport in a manner that
++  allows backporting to maintenance branches. Original patch by
++  Alexander Belopolsky.
++
++- Issue #4163: textwrap module: allow word splitting on a hyphen preceded by
++  a non-ASCII letter.
++
++- Issue #4616: TarFile.utime(): Restore directory times on Windows.
++
++- Issue #4021: tokenize.detect_encoding() now raises a SyntaxError when the
++  codec cannot be found.  This is for compatibility with the builtin behavior.
++
++- Issue #4084: Fix max, min, max_mag and min_mag Decimal methods to
++  give correct results in the case where one argument is a quiet NaN
++  and the other is a finite number that requires rounding.
++
++- Issue #4483: _dbm module now builds on systems with gdbm & gdbm_compat
++  libs.
++
++- Added the subprocess.check_call_output() convenience function to get output
++  from a subprocess on success or raise an exception on error.
++
++- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
++  support unusual filenames (such as those containing semi-colons) in
++  Content-Disposition headers.
++
++- Issue #4384: Added logging integration with warnings module using
++  captureWarnings(). This change includes a NullHandler which does nothing;
++  it will be of use to library developers who want to avoid the "No handlers
++  could be found for logger XXX" message which can appear if the library user
++  doesn't configure logging.
++
++- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
++  exception.
++
++- Issue #4529: fix the parser module's validation of try-except-finally
++  statements.
++
++- Issue #4458: getopt.gnu_getopt() now recognizes a single "-" as an argument,
++  not a malformed option.
++
++- Added the subprocess.check_output() convenience function to get output
++  from a subprocess on success or raise an exception on error.
++
++- Issue #4542: On Windows, binascii.crc32 still accepted str as binary input;
++  the corresponding tests now pass.
++
++- Issue #4537: webbrowser.UnixBrowser would fail to open the browser because
++  it was calling the wrong open() function.
++
++- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
++  support unusual filenames (such as those containing semi-colons) in
++  Content-Disposition headers.
++
++- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on
++  biarch systems. Try to rely on ldconfig only, without using objdump and gcc.
++
++- Issue #5104: The socket module now raises OverflowError when 16-bit port and
++  protocol numbers are supplied outside the allowed 0-65536 range on bind()
++  and getservbyport().
++
++- Windows locale mapping updated to Vista.
++
++Tools/Demos
++-----------
++
++- Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1,
++  and make it 2.6-compatible.
++
++- Ttk demos added in Demo/tkinter/ttk/
++
++- Issue #4677: add two list comprehension tests to pybench.
++
++
++Build
++-----
++
++- Issue #6094: Build correctly with Subversion 1.7.
++
++- Issue #5847: Remove -n switch on "Edit with IDLE" menu item.
++
++- Issue #5726: Make Modules/ld_so_aix return the actual exit code of the
++  linker, rather than always exit successfully. Patch by Floris Bruynooghe.
++
++- Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify
++  the order that backends for the dbm extension are checked.
++
++- Link the shared python library with $(MODLIBS).
++
++- Issue #5134: Silence compiler warnings when compiling sqlite with VC++.
++
++- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows.
++
++- Issue #4895: Use _strdup on Windows CE.
++
++- Issue #4472: "configure --enable-shared" now works on OSX
++
++- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds.
++
++- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
++
++- Issue #4289: Remove Cancel button from AdvancedDlg.
++
++- Issue #1656675: Register a drop handler for .py* files on Windows.
++
++- Issue #4120: Exclude manifest from extension modules in VS2008.
++
++- Issue #4091: Install pythonxy.dll in system32 again.
++
++- Issue #4018: Disable "for me" installations on Vista.
++
++- Issue #3758: Add ``patchcheck`` build target to .PHONY.
++
++- Issue #4204: Fixed module build errors on FreeBSD 4.
++
++
++C-API
++-----
++
++- Issue #6624: yArg_ParseTuple with "s" format when parsing argument with
++  NUL: Bogus TypeError detail string.
++
++- Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError
++  for negative arguments.  Previously, it raised TypeError.
++
++- Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'.
++
++- Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when
++  the GIL is released, or owned by another thread.
++
++- Issue #4122: On Windows, fix a compilation error when using the
++  Py_UNICODE_ISSPACE macro in an extension module.
++
++
++Extension Modules
++-----------------
++
++- Issue #3745: Fix hashlib to always reject unicode and non buffer-api
++  supporting objects as input no matter how it was compiled (built in
++  implementations or external openssl library).
++
++- Issue #4397: Fix occasional test_socket failure on OS X.
++
++- Issue #4279: Fix build of parsermodule under Cygwin.
++
++- Issue #4751: hashlib now releases the GIL when hashing large buffers
++  (with a hardwired threshold of 2048 bytes), allowing better parallelization
++  on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner.
++
++- Issue #4051: Prevent conflict of UNICODE macros in cPickle.
++
++- Issue #4738: Each zlib object now has a separate lock, allowing to compress
++  or decompress several streams at once on multi-CPU systems. Also, the GIL
++  is now released when computing the CRC of a large buffer. Patch by ebfe.
++
++- Issue #4228: Pack negative values the same way as 2.4 in struct's L format.
++
++- Issue #1040026: Fix os.times result on systems where HZ is incorrect.
++
++- Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris,
++  OpenBSD.
++
++- Issue #4583: array.array would not always prohibit resizing when a buffer
++  has been exported, resulting in an interpreter crash when accessing the
++  buffer.
++
++
++- Issue #5228: Make functools.partial objects can now be pickled.
++
++Tests
++-----
++
++- Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running
++  regression tests in parallel, shortening the total runtime.
++
++- Issue #5450: Moved tests involving loading tk from Lib/test/test_tcl to
++  Lib/tkinter/test/test_tkinter/test_loadtk. With this, these tests demonstrate
++  the same behaviour as test_ttkguionly (and now also test_tk) which is to
++  skip the tests if DISPLAY is defined but can't be used.
++
++- regrtest no longer treats ImportError as equivalent to SkipTest.  Imports
++  that should cause a test to be skipped are now done using import_module
++  from test support, which does the conversion.
++
++- Issue #5083: New 'gui' resource for regrtest.
++
++
++Docs
++----
++
++
+ What's New in Python 3.0 final
+ ==============================
+ 
+diff -r bd8afb90ebf2 Misc/NEWS
+--- a/Misc/NEWS
++++ b/Misc/NEWS
+@@ -2,6 +2,815 @@
+ Python News
+ +++++++++++
+ 
++What's New in Python 3.3.1?
++===========================
++
++*Not yet released, see sections below for changes released in 3.3.0*
++
++.. *Release date: XX-XXX-2012*
++
++Core and Builtins
++-----------------
++
++- Issue #7963: Fixed misleading error message that issued when object is
++  called without arguments.
++
++- Issue #5308: Raise ValueError when marshalling too large object (a sequence
++  with size >= 2**31), instead of producing illegal marshal data.
++
++- Issue #12983: Bytes literals with invalid \x escape now raise a SyntaxError
++  and a full traceback including line number.
++
++- Issue #17173: Remove uses of locale-dependent C functions (isalpha() etc.)
++  in the interpreter.
++
++- Issue #17137: When an Unicode string is resized, the internal wide character
++  string (wstr) format is now cleared.
++
++- Issue #17043: The unicode-internal decoder no longer read past the end of
++  input buffer.
++
++- Issue #17098: All modules now have __loader__ set even if they pre-exist the
++  bootstrapping of importlib.
++
++- Issue #16979: Fix error handling bugs in the unicode-escape-decode decoder.
++
++- Issue #10156: In the interpreter's initialization phase, unicode globals
++  are now initialized dynamically as needed.
++
++- Issue #16980: Fix processing of escaped non-ascii bytes in the
++  unicode-escape-decode decoder.
++
++- Issue #16975: Fix error handling bug in the escape-decode bytes decoder.
++
++- Issue #14850: Now a charmap decoder treats U+FFFE as "undefined mapping"
++  in any mapping, not only in a string.
++
++- Issue #16730: importlib.machinery.FileFinder now no longers raises an
++  exception when trying to populate its cache and it finds out the directory is
++  unreadable or has turned into a file. Reported and diagnosed by
++  David Pritchard.
++
++- Issue #16906: Fix a logic error that prevented most static strings from being
++  cleared.
++
++- Issue #11461: Fix the incremental UTF-16 decoder. Original patch by
++  Amaury Forgeot d'Arc.
++
++- Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1.
++
++- Issue #16856: Fix a segmentation fault from calling repr() on a dict with
++  a key whose repr raise an exception.
++
++- Issue #16367: Fix FileIO.readall() on Windows for files larger than 2 GB.
++
++- Issue #16455: On FreeBSD and Solaris, if the locale is C, the
++  ASCII/surrogateescape codec is now used, instead of the locale encoding, to
++  decode the command line arguments. This change fixes inconsistencies with
++  os.fsencode() and os.fsdecode() because these operating systems announces an
++  ASCII locale encoding, whereas the ISO-8859-1 encoding is used in practice.
++
++- Issue #16761: Calling int() with base argument only now raises TypeError.
++
++- Issue #16759: Support the full DWORD (unsigned long) range in Reg2Py
++  when retrieving a REG_DWORD value. This corrects functions like
++  winreg.QueryValueEx that may have been returning truncated values.
++
++- Issue #14420: Support the full DWORD (unsigned long) range in Py2Reg
++  when passed a REG_DWORD value. Fixes OverflowError in winreg.SetValueEx.
++
++- Issue #16597: In buffered and text IO, call close() on the underlying stream
++  if invoking flush() fails.
++
++- Issue #16722: In the bytes() constructor, try to call __bytes__ on the
++  argument before __index__.
++
++- Issue #16602: When a weakref's target was part of a long deallocation
++  chain, the object could remain reachable through its weakref even though
++  its refcount had dropped to zero.
++
++- Issue #16416: On Mac OS X, operating system data are now always
++  encoded/decoded to/from UTF-8/surrogateescape, instead of the locale encoding
++  (which may be ASCII if no locale environment variable is set), to avoid
++  inconsistencies with os.fsencode() and os.fsdecode() functions which are
++  already using UTF-8/surrogateescape.
++
++- Issue #16588: Silence unused-but-set warnings in Python/thread_pthread
++
++- Issue #16546: Fix: ast.YieldFrom argument is now mandatory.
++
++- Issue #16514: Fix regression causing a traceback when sys.path[0] is None
++  (actually, any non-string or non-bytes type).
++
++- Issue #16306: Fix multiple error messages when unknown command line
++  parameters where passed to the interpreter.  Patch by Hieu Nguyen.
++
++- Issue #16215: Fix potential double memory free in str.replace().  Patch
++  by Serhiy Storchaka.
++
++- Issue #16453: Fix equality testing of dead weakref objects.
++
++- Issue #9535: Fix pending signals that have been received but not yet
++  handled by Python to not persist after os.fork() in the child process.
++
++- Issue #15001: fix segfault on "del sys.modules['__main__']". Patch by Victor
++  Stinner.
++
++- Issue #8271: the utf-8 decoder now outputs the correct number of U+FFFD
++  characters when used with the 'replace' error handler on invalid utf-8
++  sequences.  Patch by Serhiy Storchaka, tests by Ezio Melotti.
++
++- Issue #5765: Apply a hard recursion limit in the compiler instead of
++  blowing the stack and segfaulting. Initial patch by Andrea Griffini.
++
++- Issue #16402: When slicing a range, fix shadowing of exceptions from
++  __index__.
++
++- Issue #16336: fix input checking in the surrogatepass error handler.
++  Patch by Serhiy Storchaka.
++
++- Issue #8401: assigning an int to a bytearray slice (e.g. b[3:4] = 5) now
++  raises an error.
++
++- Fix segfaults on setting __qualname__ on builtin types and attempting to
++  delete it on any type.
++
++- Issue #16345: Fix an infinite loop when ``fromkeys`` on a dict subclass
++  received a nonempty dict from the constructor.
++
++- Issue #16271: Fix strange bugs that resulted from __qualname__ appearing in a
++  class's __dict__ and on type.
++
++- Issue #16197: Update winreg docstrings and documentation to match code.
++  Patch by Zachary Ware.
++
++- Issue #16241: Document -X faulthandler command line option.
++  Patch by Marek Å uppa.
++
++- Issue #6074: Ensure cached bytecode files can always be updated by the
++  user that created them, even when the source file is read-only.
++
++- Issue #14783: Improve int() docstring and switch docstrings for str(),
++  range(), and slice() to use multi-line signatures.
++
++- Issue #16160: Subclass support now works for types.SimpleNamespace.
++
++- Issue #15379: Fix passing of non-BMP characters as integers for the charmap
++  decoder (already working as unicode strings).  Patch by Serhiy Storchaka.
++
++- Issue #15144: Fix possible integer overflow when handling pointers as integer
++  values, by using `Py_uintptr_t` instead of `size_t`.  Patch by Serhiy
++  Storchaka.
++
++- Issue #15965: Explicitly cast `AT_FDCWD` as (int).  Required on Solaris 10
++  (which defines `AT_FDCWD` as ``0xffd19553``), harmless on other platforms.
++
++- Issue #15839: Convert SystemErrors in `super()` to RuntimeErrors.
++
++- Issue #15846: Fix SystemError which happened when using `ast.parse()` in an
++  exception handler on code with syntax errors.
++
++- Issue #15801: Make sure mappings passed to '%' formatting are actually
++  subscriptable.
++
++- Issue #15111: __import__ should let ImportError propagate when a module that
++  is imported as a side-effect of using fromlist tries to import a module
++  that cannot be found.
++
++
++Library
++-------
++
++- Issue #13700: Fix byte/string handling in imaplib authentication when an
++  authobject is specified.
++
++- Issue #13153: Tkinter functions now raise TclError instead of ValueError when
++  a string argument contains non-BMP character.
++
++- Issue #9669: Protect re against infinite loops on zero-width matching in
++  non-greedy repeat.  Patch by Matthew Barnett.
++
++- Issue #13169: The maximal repetition number in a regular expression has been
++  increased from 65534 to 2147483647 (on 32-bit platform) or 4294967294 (on
++  64-bit).
++
++- Issue #17143: Fix a missing import in the trace module.  Initial patch by
++  Berker Peksag.
++
++- Issue #16743: Fix mmap overflow check on 32 bit Windows.
++
++- Issue #16800: tempfile.gettempdir() no longer left temporary files when
++  the disk is full.  Original patch by Amir Szekely.
++
++- Issue #16564: Fixed regression relative to Python2 in the operation of
++  email.encoders.encode_7or8bit when used with binary data.
++
++- Issue #17052: unittest discovery should use self.testLoader.
++
++- Issue #4591: Uid and gid values larger than 2**31 are supported now.
++
++- Issue #17141: random.vonmisesvariate() no more hangs for large kappas.
++
++- Issue #17149: Fix random.vonmisesvariate to always return results in
++  [0, 2*math.pi].
++
++- Issue #1470548: XMLGenerator now works with binary output streams.
++
++- Issue #6975: os.path.realpath() now correctly resolves multiple nested
++  symlinks on POSIX platforms.
++
++- Issue #17156: pygettext.py now uses an encoding of source file and correctly
++  writes and escapes non-ascii characters.
++
++- Issue #16564: Fixed regression relative to Python2 in the operation of
++  email.encoders.encode_noop when used with binary data.
++
++- Issue #10355: In SpooledTemporaryFile class mode, name, encoding and
++  newlines properties now work for unrolled files.  Obsoleted and never
++  working on Python 3 xreadline method now removed.
++
++- Issue #16686: Fixed a lot of bugs in audioop module.  Fixed crashes in
++  avgpp(), maxpp() and ratecv().  Fixed an integer overflow in add(), bias(),
++  and ratecv().  reverse(), lin2lin() and ratecv() no more lose precision for
++  32-bit samples.  max() and rms() no more returns a negative result and
++  various other functions now work correctly with 32-bit sample -0x80000000.
++
++- Issue #17073: Fix some integer overflows in sqlite3 module.
++
++- Issue #17114: IDLE now uses non-strict config parser.
++
++- Issue #16723: httplib.HTTPResponse no longer marked closed when the connection
++  is automatically closed.
++
++- Issue #16948: Fix quoted printable body encoding for non-latin1 character
++  sets in the email package.
++
++- Issue #16811: Fix folding of headers with no value in the provisional email
++  policies.
++
++- Issue #17132: Update symbol for "yield from" grammar changes.
++
++- Issue #17076: Make copying of xattrs more permissive of missing FS support.
++  Patch by Thomas Wouters.
++
++- Issue #17089: Expat parser now correctly works with string input not only when
++  an internal XML encoding is UTF-8 or US-ASCII.  It now accepts bytes and
++  strings larger than 2 GiB.
++
++- Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple
++  parses nested mutating sequence.
++
++- Issue #5289: Fix ctypes.util.find_library on Solaris.
++
++- Issue #17106: Fix a segmentation fault in io.TextIOWrapper when an underlying
++  stream or a decoder produces data of an unexpected type (i.e. when
++  io.TextIOWrapper initialized with text stream or use bytes-to-bytes codec).
++
++- Issue #15633: httplib.HTTPResponse is now mark closed when the server
++  sends less than the advertised Content-Length.
++
++- Issue #6972: The zipfile module no longer overwrites files outside of
++  its destination path when extracting malicious zip files.
++
++- Issue #4844: ZipFile now raises BadZipFile when opens a ZIP file with an
++  incomplete "End of Central Directory" record.  Original patch by Guilherme
++  Polo and Alan McIntyre.
++
++- Issue #17071: Signature.bind() now works when one of the keyword arguments
++  is named ``self``.
++
++- Issue #12004: Fix an internal error in PyZipFile when writing an invalid
++  Python file.  Patch by Ben Morgan.
++
++- Issue #1602133: on Mac OS X a shared library build (``--enable-shared``)
++  now fills the ``os.environ`` variable correctly.
++
++- Issue #15505: `unittest.installHandler` no longer assumes SIGINT handler is
++  set to a callable object.
++
++- Issue #9290: In IDLE the sys.std* streams now implement io.TextIOBase
++  interface and support all mandatory methods and properties.
++
++- Issue #13454: Fix a crash when deleting an iterator created by itertools.tee()
++  if all other iterators were very advanced before.
++
++- Issue #12411: Fix to cgi.parse_multipart to correctly use bytes boundaries
++  and bytes data. Patch by Jonas Wagner.
++
++- Issue #16957: shutil.which() no longer searches a bare file name in the
++  current directory on Unix and no longer searches a relative file path with
++  a directory part in PATH directories.  Patch by Thomas Kluyver.
++
++- Issue #1159051: GzipFile now raises EOFError when reading a corrupted file
++  with truncated header or footer.
++
++- Issue #16993: shutil.which() now preserves the case of the path and extension
++  on Windows.
++
++- Issue #16992: On Windows in signal.set_wakeup_fd, validate the file
++  descriptor argument.
++
++- Issue #16422: For compatibility with the Python version, the C version of
++  decimal now uses strings instead of integers for rounding mode constants.
++
++- Issue #15861: tkinter now correctly works with lists and tuples containing
++  strings with whitespaces, backslashes or unbalanced braces.
++
++- Issue #10527: Use poll() instead of select() for multiprocessing pipes.
++
++- Issue #9720: zipfile now writes correct local headers for files larger than
++  4 GiB.
++
++- Issue #16955: Fix the poll() method for multiprocessing's socket
++  connections on Windows.
++
++- SSLContext.load_dh_params() now properly closes the input file.
++
++- Issue #16829: IDLE printing no longer fails if there are spaces or other
++  special characters in the file path.
++
++- Issue #16900: Issue a ResourceWarning when an ssl socket is left unclosed.
++
++- Issue #13899: \A, \Z, and \B now correctly match the A, Z, and B literals
++  when used inside character classes (e.g. '[\A]').  Patch by Matthew Barnett.
++
++- Issue #15545: Fix regression in sqlite3's iterdump method where it was
++  failing if the connection used a row factory (such as sqlite3.Row) that
++  produced unsortable objects. (Regression was introduced by fix for 9750).
++
++- Issue #16491: IDLE now prints chained exception tracebacks.
++
++- Issue #15972: Fix error messages when os functions expecting a file name or
++  file descriptor receive the incorrect type.
++
++- Issue #16828: Fix error incorrectly raised by bz2.compress(b'') and
++  bz2.BZ2Compressor.compress(b''). Initial patch by Martin Packman.
++
++- Issue #16541: tk_setPalette() now works with keyword arguments.
++
++- Issue #16820: In configparser, `parser.popitem()` no longer raises ValueError.
++  This makes `parser.clean()` work correctly.
++
++- Issue #16820: In configparser, ``parser['section'] = {}`` now preserves
++  section order within the parser. This makes `parser.update()` preserve section
++  order as well.
++
++- Issue #16820: In configparser, ``parser['DEFAULT'] = {}`` now correctly
++  clears previous values stored in the default section. Same goes for
++  ``parser.update({'DEFAULT': {}})``.
++
++- Issue #16819: IDLE method completion now correctly works for bytes literals.
++
++- Issue #9586: Redefine SEM_FAILED on MacOSX to keep compiler happy.
++
++- Issue #10527: make multiprocessing use poll() instead of select() if available.
++
++- Issue #16688: Now regexes contained backreferences correctly work with
++  non-ASCII strings.  Patch by Matthew Barnett.
++
++- Issue #16485: Now file descriptors are closed if file header patching failed
++  on closing an aifc file.
++
++- Issue #16165: sched.scheduler.run() no longer blocks a scheduler for other
++  threads.
++
++- Issue #16641: Default values of sched.scheduler.enter() are no longer
++  modifiable.
++
++- Issue #16504: IDLE now catches SyntaxErrors raised by tokenizer. Patch by
++  Roger Serwy.
++
++- Issue #16618: Make glob.glob match consistently across strings and bytes
++  regarding leading dots.  Patch by Serhiy Storchaka.
++
++- Issue #16702: test_urllib2_localnet tests now correctly ignores proxies for
++  localhost tests.
++
++- Issue #16511: Use default IDLE width and height if config param is not valid.
++  Patch Serhiy Storchaka.
++
++- Issue #16713: Parsing of 'tel' urls using urlparse separates params from
++  path.
++
++- Issue #16443: Add docstrings to regular expression match objects.
++  Patch by Anton Kasyanov.
++
++- Issue #15701: Fix HTTPError info method call to return the headers information.
++
++- Issue #16752: Add a missing import to modulefinder. Patch by Berker Peksag.
++
++- Issue #16646: ftplib.FTP.makeport() might lose socket error details.
++  (patch by Serhiy Storchaka)
++
++- Issue #16626: Fix infinite recursion in glob.glob() on Windows when the
++  pattern contains a wildcard in the drive or UNC path.  Patch by Serhiy
++  Storchaka.
++
++- Issue #15783: Except for the number methods, the C version of decimal now
++  supports all None default values present in decimal.py. These values were
++  largely undocumented.
++
++- Issue #16298: In HTTPResponse.read(), close the socket when there is no
++  Content-Length and the incoming stream is finished.  Patch by Eran
++  Rundstein.
++
++- Issue #15872: Fix 3.3 regression introduced by the new fd-based shutil.rmtree
++  that caused it to not ignore certain errors when ignore_errors was set.
++  Patch by Alessandro Moura and Serhiy Storchaka.
++
++- Issue #16248: Disable code execution from the user's home directory by
++  tkinter when the -E flag is passed to Python.  Patch by Zachary Ware.
++
++- Issue #16628: Fix a memory leak in ctypes.resize().
++
++- Issue #13614: Fix setup.py register failure with invalid rst in description.
++  Patch by Julien Courteau and Pierre Paul Lefebvre.
++
++- Issue #13512: Create ~/.pypirc securely (CVE-2011-4944).  Initial patch by
++  Philip Jenvey, tested by Mageia and Debian.
++
++- Issue #7719: Make distutils ignore ``.nfs*`` files instead of choking later
++  on.  Initial patch by SilentGhost and Jeff Ramnani.
++
++- Issue #13120: Allow to call pdb.set_trace() from thread.
++  Patch by Ilya Sandler.
++
++- Issue #16585: Make CJK encoders support error handlers that return bytes per
++  PEP 383.
++
++- Issue #10182: The re module doesn't truncate indices to 32 bits anymore.
++  Patch by Serhiy Storchaka.
++
++- Issue #16573: In 2to3, treat enumerate() like a consuming call, so superfluous
++  list() calls aren't added to filter(), map(), and zip() which are directly
++  passed enumerate().
++
++- Issue #16476: Fix json.tool to avoid including trailing whitespace.
++
++- Issue #16549: Make json.tool work again on Python 3 and add tests.
++  Initial patch by Berker Peksag and Serhiy Storchaka.
++
++- Issue #12848: The pure Python pickle implementation now treats object
++  lengths as unsigned 32-bit integers, like the C implementation does.
++  Patch by Serhiy Storchaka.
++
++- Issue #16408: Fix file descriptors not being closed in error conditions
++  in the zipfile module.  Patch by Serhiy Storchaka.
++
++- Issue #16481: multiprocessing no longer leaks process handles on Windows.
++
++- Issue #16140: The subprocess module no longer double closes its child
++  subprocess.PIPE parent file descriptors on child error prior to exec().
++
++- Remove a bare print to stdout from the subprocess module that could have
++  happened if the child process wrote garbage to its pre-exec error pipe.
++
++- Issue #16327: The subprocess module no longer leaks file descriptors
++  used for stdin/stdout/stderr pipes to the child when fork() fails.
++
++- Issue #14396: Handle the odd rare case of waitpid returning 0 when not
++  expected in subprocess.Popen.wait().
++
++- Issue #16411: Fix a bug where zlib.decompressobj().flush() might try to access
++  previously-freed memory. Patch by Serhiy Storchaka.
++
++- Issue #16357: fix calling accept() on a SSLSocket created through
++  SSLContext.wrap_socket().  Original patch by Jeff McNeil.
++
++- Issue #16409: The reporthook callback made by the legacy
++  urllib.request.urlretrieve API now properly supplies a constant non-zero
++  block_size as it did in Python 3.2 and 2.7.  This matches the behavior of
++  urllib.request.URLopener.retrieve.
++
++- Issue #16431: Use the type information when constructing a Decimal subtype
++  from a Decimal argument.
++
++- Issue #16350: zlib.decompressobj().decompress() now accumulates data from
++  successive calls after EOF in unused_data, instead of only saving the argument
++  to the last call. decompressobj().flush() now correctly sets unused_data and
++  unconsumed_tail. A bug in the handling of MemoryError when setting the
++  unconsumed_tail attribute has also been fixed. Patch by Serhiy Storchaka.
++
++- Issue #12759: sre_parse now raises a proper error when the name of the group
++  is missing.  Initial patch by Serhiy Storchaka.
++
++- Issue #16152: fix tokenize to ignore whitespace at the end of the code when
++  no newline is found.  Patch by Ned Batchelder.
++
++- Issue #1207589: Add Cut/Copy/Paste items to IDLE right click Context Menu
++  Patch by Todd Rovito.
++
++- Issue #16230: Fix a crash in select.select() when one the lists changes
++  size while iterated on.  Patch by Serhiy Storchaka.
++
++- Issue #16228: Fix a crash in the json module where a list changes size
++  while it is being encoded.  Patch by Serhiy Storchaka.
++
++- Issue #14897: Enhance error messages of struct.pack and
++  struct.pack_into. Patch by Matti Mäki.
++
++- Issue #12890: cgitb no longer prints spurious <p> tags in text
++  mode when the logdir option is specified.
++
++- Issue #16307: Fix multiprocessing.Pool.map_async not calling its callbacks.
++  Patch by Janne Karila.
++
++- Issue #16250: Fix URLError invocation with proper args.
++
++- Issue #16116: Fix include and library paths to be correct when building C
++  extensions in venvs.
++
++- Issue #16245: Fix the value of a few entities in html.entities.html5.
++
++- Issue #14398: Fix size truncation and overflow bugs in the bz2 module.
++
++- Issue #16220: wsgiref now always calls close() on an iterable response.
++  Patch by Brent Tubbs.
++
++- Issue #16270: urllib may hang when used for retrieving files via FTP by using
++  a context manager.  Patch by Giampaolo Rodola'.
++
++- Issue #16461: Wave library should be able to deal with 4GB wav files,
++  and sample rate of 44100 Hz.
++
++- Issue #16176: Properly identify Windows 8 via platform.platform()
++
++- Issue #16114: The subprocess module no longer provides a misleading error
++  message stating that args[0] did not exist when either the cwd or executable
++  keyword arguments specified a path that did not exist.
++
++- Issue #16169: Fix ctypes.WinError()'s confusion between errno and winerror.
++
++- Issue #16076: Made _elementtree.Element pickleable in a way that is compatible
++  with the Python Element. Pickling/unpickling of xml.etree.ElementTree.Element
++  works again - this was a temporary regression from 3.2 where the by-default
++  imported _elementtree had no pickling capability.
++
++- Issue #16089: Allow ElementTree.TreeBuilder to work again with a non-Element
++  element_factory (fixes a regression in SimpleTAL).
++
++- Issue #16913: Fix Element.itertext()'s handling of text with XML entities.,
++
++- Issue #16034: Fix performance regressions in the new `bz2.BZ2File`
++  implementation.  Initial patch by Serhiy Storchaka.
++
++- Issue #16112: platform.architecture does not correctly escape argument to
++  /usr/bin/file.  Patch by David Benjamin.
++
++- Issue #15756: `subprocess.poll()` now properly handles `errno.ECHILD` to
++  return a returncode of 0 when the child has already exited or cannot be waited
++  on.
++
++- Issue #15323: Improve failure message of `Mock.assert_called_once_with()`.
++
++- Issue #16064: ``unittest -m`` claims executable is "python", not "python3".
++
++- Issue #12376: Pass on parameters in `TextTestResult.__init__()` super call.
++
++- Issue #15222: Insert blank line after each message in mbox mailboxes.
++
++- Issue #16013: Fix `csv.Reader` parsing issue with ending quote characters.
++  Patch by Serhiy Storchaka.
++
++- Issue #15421: Fix an OverflowError in `Calendar.itermonthdates()` after
++  `datetime.MAXYEAR`.  Patch by Cédric Krier.
++
++- Issue #15970: `xml.etree.ElementTree` now serializes correctly the empty HTML
++  elements 'meta' and 'param'.
++
++- Issue #15842: The `SocketIO.{readable,writable,seekable}` methods now raise
++  ValueError when the file-like object is closed.  Patch by Alessandro Moura.
++
++- Issue #15876: Fix a refleak in the `curses` module: window.encoding.
++
++- Issue #15881: Fix `atexit` hook in `multiprocessing`.  Original patch by Chris
++  McDonough.
++
++- Issue #15841: The readable(), writable() and seekable() methods of
++  `io.BytesIO` and `io.StringIO` objects now raise ValueError when the object
++  has been closed.  Patch by Alessandro Moura.
++
++- Issue #16126: PyErr_Format format mismatch in _testcapimodule.c.
++  Patch by Serhiy Storchaka.
++
++- Issue #15447: Use `subprocess.DEVNULL` in webbrowser, instead of opening
++  `os.devnull` explicitly and leaving it open.
++
++- Issue #15509: `webbrowser.UnixBrowser` no longer passes empty arguments to
++  Popen when ``%action`` substitutions produce empty strings.
++
++- Issue #12776, issue #11839: Call `argparse` type function (specified by
++  add_argument) only once.  Before, the type function was called twice in the
++  case where the default was specified and the argument was given as well.  This
++  was especially problematic for the FileType type, as a default file would
++  always be opened, even if a file argument was specified on the command line.
++
++- Issue #15906: Fix a regression in `argparse` caused by the preceding change,
++  when ``action='append'``, ``type='str'`` and ``default=[]``.
++
++Extension Modules
++-----------------
++
++- Issue #12268: The io module file object write methods no longer abort early
++  when one of its write system calls is interrupted (EINTR).
++
++Tests
++-----
++
++- Issue #17041: Fix testing when Python is configured with the
++  --without-doc-strings.
++
++- Issue #16923: Fix ResourceWarnings in test_ssl.
++
++- Issue #15539: Added regression tests for Tools/scripts/pindent.py.
++
++- Issue #17163: test_file now works with unittest test discovery.
++  Patch by Zachary Ware.
++
++- Issue #16925: test_configparser now works with unittest test discovery.
++  Patch by Zachary Ware.
++
++- Issue #16918: test_codecs now works with unittest test discovery.
++  Patch by Zachary Ware.
++
++- Issue #16919: test_crypt now works with unittest test discovery.
++  Patch by Zachary Ware.
++
++- Issue #16910: test_bytes, test_unicode, and test_userstring now work with
++  unittest test discovery.  Patch by Zachary Ware.
++
++- Issue #16905: test_warnings now works with unittest test discovery.
++  Initial patch by Berker Peksag.
++
++- Issue #16898: test_bufio now works with unittest test discovery.
++  Patch by Zachary Ware.
++
++- Issue #16888: test_array now works with unittest test discovery.
++  Patch by Zachary Ware.
++
++- Issue #16896: test_asyncore now works with unittest test discovery.
++  Patch by Zachary Ware.
++
++- Issue #16897: test_bisect now works with unittest test discovery.
++  Initial patch by Zachary Ware.
++
++- Issue #16852: test_genericpath, test_posixpath, test_ntpath, and test_macpath
++  now work with unittest test discovery.  Patch by Zachary Ware.
++
++- Issue #16748: test_heapq now works with unittest test discovery.
++
++- Issue #15324: Fix regrtest parsing of --fromfile, --match, and --randomize
++  options.
++
++- Issue #16664: Add regression tests for glob's behaviour concerning entries
++  starting with a ".".  Patch by Sebastian Kreft.
++
++- Issue #16559: Add more tests for the json module, including some from the
++  official test suite at json.org.  Patch by Serhiy Storchaka.
++
++- Issue #16661: Fix the `os.getgrouplist()` test by not assuming that it gives
++  the same output as :command:`id -G`.
++
++- Issue #16115: Add some tests for the executable argument to
++  subprocess.Popen().  Initial patch by Kushal Das.
++
++- Issue #15304: Fix warning message when `os.chdir()` fails inside
++  `test.support.temp_cwd()`.  Patch by Chris Jerdonek.
++
++- Issue #15802: Fix test logic in `TestMaildir.test_create_tmp()`. Patch by
++  Serhiy Storchaka.
++
++- Issue #15557: Add a test suite for the `webbrowser` module, thanks to Anton
++  Barkovsky.
++
++- Issue #16698: Skip posix test_getgroups when built with OS X
++  deployment target prior to 10.6.
++
++Build
++-----
++
++- Issue #3718: Use AC_ARG_VAR to set MACHDEP in configure.ac.
++
++- Issue #17031: Fix running regen in cross builds.
++
++- Issue #3754: fix typo in pthread AC_CACHE_VAL.
++
++- Issue #15484: Fix _PYTHON_PROJECT_BASE for srcdir != builddir builds;
++  use _PYTHON_PROJECT_BASE in distutils/sysconfig.py.
++
++- Issue #17029: Let h2py search the multiarch system include directory.
++
++- Issue #16953: Fix socket module compilation on platforms with
++  HAVE_BROKEN_POLL. Patch by Jeffrey Armstrong.
++
++- Issue #16836: Enable IPv6 support even if IPv6 is disabled on the build host.
++
++- Cross compiling needs host and build settings. configure no longer
++  creates a broken PYTHON_FOR_BUILD variable when --build is missing.
++
++- Fix cross compiling issue in setup.py, ensure that lib_dirs and inc_dirs are
++  defined in cross compiling mode, too.
++
++- Issue #16593: Have BSD 'make -s' do the right thing, thanks to Daniel Shahaf
++
++- Issue #16262: fix out-of-src-tree builds, if mercurial is not installed.
++
++- Issue #15298: ensure _sysconfigdata is generated in build directory, not
++  source directory.
++
++- Issue #15833: Fix a regression in 3.3 that resulted in exceptions being
++  raised if importlib failed to write byte-compiled files.  This affected
++  attempts to build Python out-of-tree from a read-only source directory.
++
++- Issue #15923: Fix a mistake in ``asdl_c.py`` that resulted in a TypeError
++  after 2801bf875a24 (see #15801).
++
++- Issue #15819: Make sure we can build Python out-of-tree from a read-only
++  source directory.  (Somewhat related to issue #9860.)
++
++- Issue #15587: Enable Tk high-resolution text rendering on Macs with
++  Retina displays.  Applies to Tkinter apps, such as IDLE, on OS X
++  framework builds linked with Cocoa Tk 8.5.
++
++- Issue #17161: make install now also installs a python3 man page.
++
++Tools/Demos
++-----------
++
++- Issue #13301: use ast.literal_eval() instead of eval() in Tools/i18n/msgfmt.py
++  Patch by Serhiy Storchaka.
++
++Documentation
++-------------
++
++- Issue #13094: add "Why do lambdas defined in a loop with different values
++  all return the same result?" programming FAQ.
++
++- Issue #14901: Update portions of the Windows FAQ.
++  Patch by Ashish Nitin Patil.
++
++- Issue #16267: Better document the 3.3+ approach to combining
++  @abstractmethod with @staticmethod, @classmethod and @property
++
++- Issue #15209: Clarify exception chaining description in exceptions module
++  documentation
++
++- Issue #15990: Improve argument/parameter documentation.
++
++- Issue #16209: Move the documentation for the str built-in function to a new
++  str class entry in the "Text Sequence Type" section.
++
++- Issue #13538: Improve str() and object.__str__() documentation.
++
++- Issue #16489: Make it clearer that importlib.find_loader() requires any and
++  all packages to be separately imported.
++
++- Issue #16400: Update the description of which versions of a given package
++  PyPI displays.
++
++- Issue #15677: Document that zlib and gzip accept a compression level of 0 to
++  mean 'no compression'. Patch by Brian Brazil.
++
++- Issue #8040: added a version switcher to the documentation.  Patch by
++  Yury Selivanov.
++
++- Additional comments and some style changes in the concurrent.futures URL
++  retrieval example
++
++- Issue #16115: Improve subprocess.Popen() documentation around args, shell,
++  and executable arguments.
++
++- Issue #15533: Clarify docs and add tests for `subprocess.Popen()`'s cwd
++  argument.
++
++- Issue #15979: Improve timeit documentation.
++
++- Issue #16036: Improve documentation of built-in `int()`'s signature and
++  arguments.
++
++- Issue #15935: Clarification of `argparse` docs, re: add_argument() type and
++  default arguments.  Patch contributed by Chris Jerdonek.
++
++- Issue #11964: Document a change in v3.2 to the behavior of the indent
++  parameter of json encoding operations.
++
++- Issue #15116: Remove references to appscript as it is no longer being
++  supported.
++
++- Issue #15116: Remove references to appscript as it is no longer being
++  supported.
++
++Tools/Demos
++-----------
++
++- Issue #15539: Fix a number of bugs in Tools/scripts/pindent.py.  Now
++  pindent.py works with a "with" statement.  pindent.py no longer produces
++  improper indentation.  pindent.py now works with continued lines broken after
++  "class" or "def" keywords and with continuations at the start of line.
++
++- Issue #15378: Fix Tools/unicode/comparecodecs.py.  Patch by Serhiy Storchaka.
++
++
+ What's New in Python 3.3.0?
+ ===========================
+ 
+@@ -12,13 +821,13 @@
+ 
+ - Issue #16046: Fix loading sourceless legacy .pyo files.
+ 
+-- Issue #16060: Fix refcounting bug when __trunc__ returns an object
+-  whose __int__ gives a non-integer.  Patch by Serhiy Storchaka.
++- Issue #16060: Fix refcounting bug when `__trunc__()` returns an object whose
++  `__int__()` gives a non-integer.  Patch by Serhiy Storchaka.
+ 
+ Extension Modules
+ -----------------
+ 
+-- Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD()
++- Issue #16012: Fix a regression in pyexpat. The parser's `UseForeignDTD()`
+   method doesn't require an argument again.
+ 
+ 
+@@ -30,26 +839,26 @@
+ Core and Builtins
+ -----------------
+ 
+-- Issue #15900: Fix reference leak in PyUnicode_TranslateCharmap().
++- Issue #15900: Fix reference leak in `PyUnicode_TranslateCharmap()`.
+ 
+ - Issue #15926: Fix crash after multiple reinitializations of the interpreter.
+ 
+ - Issue #15895: Fix FILE pointer leak in one error branch of
+-  PyRun_SimpleFileExFlags() when filename points to a pyc/pyo file, closeit
+-  is false an and set_main_loader() fails.
++  `PyRun_SimpleFileExFlags()` when filename points to a pyc/pyo file, closeit is
++  false an and set_main_loader() fails.
+ 
+ - Fixes for a few crash and memory leak regressions found by Coverity.
+ 
+ Library
+ -------
+ 
+-- Issue #15882: Change _decimal to accept any coefficient tuple when
+-  constructing infinities. This is done for backwards compatibility
+-  with decimal.py: Infinity coefficients are undefined in _decimal
+-  (in accordance with the specification).
+-
+-- Issue #15925: Fix a regression in email.util where the parsedate() and
+-  parsedate_tz() functions did not return None anymore when the argument could
++- Issue #15882: Change `_decimal` to accept any coefficient tuple when
++  constructing infinities. This is done for backwards compatibility with
++  decimal.py: Infinity coefficients are undefined in _decimal (in accordance
++  with the specification).
++
++- Issue #15925: Fix a regression in `email.util` where the `parsedate()` and
++  `parsedate_tz()` functions did not return None anymore when the argument could
+   not be parsed.
+ 
+ Extension Modules
+@@ -61,7 +870,7 @@
+ - Issue #15977: Fix memory leak in Modules/_ssl.c when the function
+   _set_npn_protocols() is called multiple times, thanks to Daniel Sommermann.
+ 
+-- Issue #15969: faulthandler module: rename dump_tracebacks_later() to
++- Issue #15969: `faulthandler` module: rename dump_tracebacks_later() to
+   dump_traceback_later() and cancel_dump_tracebacks_later() to
+   cancel_dump_traceback_later().
+ 
+@@ -77,35 +886,34 @@
+ -----------------
+ 
+ - Issue #13992: The trashcan mechanism is now thread-safe.  This eliminates
+-  sporadic crashes in multi-thread programs when several long deallocator
+-  chains ran concurrently and involved subclasses of built-in container
+-  types.
+-
+-- Issue #15784: Modify OSError.__str__() to better distinguish between
+-  errno error numbers and Windows error numbers.
++  sporadic crashes in multi-thread programs when several long deallocator chains
++  ran concurrently and involved subclasses of built-in container types.
++
++- Issue #15784: Modify `OSError`.__str__() to better distinguish between errno
++  error numbers and Windows error numbers.
+ 
+ - Issue #15781: Fix two small race conditions in import's module locking.
+ 
+ Library
+ -------
+ 
+-- Issue #15847: Fix a regression in argparse, which did not accept tuples
+-  as argument lists anymore.
+-
+-- Issue #15828: Restore support for C extensions in imp.load_module().
+-
+-- Issue #15340: Fix importing the random module when /dev/urandom cannot
+-  be opened.  This was a regression caused by the hash randomization patch.
+-
+-- Issue #10650: Deprecate the watchexp parameter of the Decimal.quantize()
++- Issue #15847: Fix a regression in argparse, which did not accept tuples as
++  argument lists anymore.
++
++- Issue #15828: Restore support for C extensions in `imp.load_module()`.
++
++- Issue #15340: Fix importing the random module when ``/dev/urandom`` cannot be
++  opened.  This was a regression caused by the hash randomization patch.
++
++- Issue #10650: Deprecate the watchexp parameter of the `Decimal.quantize()`
+   method.
+ 
+-- Issue #15785: Modify window.get_wch() API of the curses module: return
+-  a character for most keys, and an integer for special keys, instead of
+-  always returning an integer. So it is now possible to distinguish special
+-  keys like keypad keys.
+-
+-- Issue #14223: Fix window.addch() of the curses module for special characters
++- Issue #15785: Modify `window.get_wch()` API of the curses module: return a
++  character for most keys, and an integer for special keys, instead of always
++  returning an integer. So it is now possible to distinguish special keys like
++  keypad keys.
++
++- Issue #14223: Fix `window.addch()` of the curses module for special characters
+   like curses.ACS_HLINE: the Python function addch(int) and addch(bytes) is now
+   calling the C function waddch()/mvwaddch() (as it was done in Python 3.2),
+   instead of wadd_wch()/mvwadd_wch(). The Python function addch(str) is still
+@@ -121,10 +929,10 @@
+ Documentation
+ -------------
+ 
+-- Issue #15814: The memoryview enhancements in 3.3.0 accidentally permitted
+-  the hashing of multi-dimensional memorviews and memoryviews with multi-byte
+-  item formats. The intended restrictions have now been documented - they
+-  will be correctly enforced in 3.3.1
++- Issue #15814: The memoryview enhancements in 3.3.0 accidentally permitted the
++  hashing of multi-dimensional memorviews and memoryviews with multi-byte item
++  formats. The intended restrictions have now been documented - they will be
++  correctly enforced in 3.3.1.
+ 
+ 
+ What's New in Python 3.3.0 Release Candidate 1?
+@@ -138,79 +946,78 @@
+ - Issue #15573: memoryview comparisons are now performed by value with full
+   support for any valid struct module format definition.
+ 
+-- Issue #15316: When an item in the fromlist for __import__ doesn't exist,
++- Issue #15316: When an item in the fromlist for `__import__()` doesn't exist,
+   don't raise an error, but if an exception is raised as part of an import do
+   let that propagate.
+ 
+-- Issue #15778: ensure that str(ImportError(msg)) returns a str
+-  even when msg isn't a str.
+-
+-- Issue #2051: Source file permission bits are once again correctly
+-  copied to the cached bytecode file. (The migration to importlib
+-  reintroduced this problem because these was no regression test. A test
+-  has been added as part of this patch)
+-
+-- Issue #15761: Fix crash when PYTHONEXECUTABLE is set on Mac OS X.
+-
+-- Issue #15726: Fix incorrect bounds checking in PyState_FindModule.
+-  Patch by Robin Schreiber.
+-
+-- Issue #15604: Update uses of PyObject_IsTrue() to check for and handle
++- Issue #15778: Ensure that ``str(ImportError(msg))`` returns a str even when
++  msg isn't a str.
++
++- Issue #2051: Source file permission bits are once again correctly copied to
++  the cached bytecode file. (The migration to importlib reintroduced this
++  problem because these was no regression test. A test has been added as part of
++  this patch)
++
++- Issue #15761: Fix crash when ``PYTHONEXECUTABLE`` is set on Mac OS X.
++
++- Issue #15726: Fix incorrect bounds checking in PyState_FindModule.  Patch by
++  Robin Schreiber.
++
++- Issue #15604: Update uses of `PyObject_IsTrue()` to check for and handle
+   errors correctly.  Patch by Serhiy Storchaka.
+ 
+-- Issue #14846: importlib.FileFinder now handles the case where the
+-  directory being searched is removed after a previous import attempt
++- Issue #14846: `importlib.FileFinder` now handles the case where the directory
++  being searched is removed after a previous import attempt.
+ 
+ Library
+ -------
+ 
+-- Issue #13370: Ensure that ctypes works on Mac OS X when Python is
+-  compiled using the clang compiler
+-
+-- Issue #13072: The array module's 'u' format code is now deprecated and
+-  will be removed in Python 4.0.
++- Issue #13370: Ensure that ctypes works on Mac OS X when Python is compiled
++  using the clang compiler.
++
++- Issue #13072: The array module's 'u' format code is now deprecated and will be
++  removed in Python 4.0.
+ 
+ - Issue #15544: Fix Decimal.__float__ to work with payload-carrying NaNs.
+ 
+ - Issue #15776: Allow pyvenv to work in existing directory with --clean.
+ 
+-- Issue #15249: BytesGenerator now correctly mangles From lines (when
++- Issue #15249: email's BytesGenerator now correctly mangles From lines (when
+   requested) even if the body contains undecodable bytes.
+ 
+ - Issue #15777: Fix a refleak in _posixsubprocess.
+ 
+-- Issue ##665194: Update email.utils.localtime to use datetime.astimezone and
++- Issue ##665194: Update `email.utils.localtime` to use datetime.astimezone and
+   correctly handle historic changes in UTC offsets.
+ 
+ - Issue #15199: Fix JavaScript's default MIME type to application/javascript.
+   Patch by Bohuslav Kabrda.
+ 
+-- Issue #12643: code.InteractiveConsole now respects sys.excepthook when
+-  displaying exceptions (Patch by Aaron Iles)
+-
+-- Issue #13579: string.Formatter now understands the 'a' conversion specifier.
+-
+-- Issue #15595: Fix subprocess.Popen(universal_newlines=True)
+-  for certain locales (utf-16 and utf-32 family). Patch by Chris Jerdonek.
++- Issue #12643: `code.InteractiveConsole` now respects `sys.excepthook` when
++  displaying exceptions.  Patch by Aaron Iles.
++
++- Issue #13579: `string.Formatter` now understands the 'a' conversion specifier.
++
++- Issue #15595: Fix ``subprocess.Popen(universal_newlines=True)`` for certain
++  locales (utf-16 and utf-32 family). Patch by Chris Jerdonek.
+ 
+ - Issue #15477: In cmath and math modules, add workaround for platforms whose
+   system-supplied log1p function doesn't respect signs of zeros.
+ 
+-- Issue #15715: importlib.__import__() will silence an ImportError when the use
+-  of fromlist leads to a failed import.
+-
+-- Issue #14669: Fix pickling of connections and sockets on MacOSX
+-  by sending/receiving an acknowledgment after file descriptor transfer.
+-  TestPicklingConnection has been reenabled for MacOSX.
++- Issue #15715: `importlib.__import__()` will silence an ImportError when the
++  use of fromlist leads to a failed import.
++
++- Issue #14669: Fix pickling of connections and sockets on Mac OS X by
++  sending/receiving an acknowledgment after file descriptor transfer.
++  TestPicklingConnection has been reenabled for Mac OS X.
+ 
+ - Issue #11062: Fix adding a message from file to Babyl mailbox.
+ 
+-- Issue #15646: Prevent equivalent of a fork bomb when using
+-  multiprocessing on Windows without the "if __name__ == '__main__'"
+-  idiom.
+-
+-- Issue #15678: Fix IDLE menus when started from OS X command line
+-  (3.3.0b2 regression).
++- Issue #15646: Prevent equivalent of a fork bomb when using `multiprocessing`
++  on Windows without the ``if __name__ == '__main__'`` idiom.
++
++- Issue #15678: Fix IDLE menus when started from OS X command line (3.3.0b2
++  regression).
+ 
+ C API
+ -----
+@@ -224,44 +1031,42 @@
+ Documentation
+ -------------
+ 
+-- Issue #14674: Add a discussion of the json module's standard compliance.
++- Issue #14674: Add a discussion of the `json` module's standard compliance.
+   Patch by Chris Rebert.
+ 
+ - Create a 'Concurrent Execution' section in the docs, and split up the
+   'Optional Operating System Services' section to use a more user-centric
+-  classification scheme (splitting them across the new CE section, IPC and
+-  text processing). Operating system limitatons can be reflected with
+-  the Sphinx :platform: tag, it doesn't make sense as part of the Table of
+-  Contents.
+-
+-- Issue #4966: Bring the sequence docs up to date for the Py3k transition
+-  and the many language enhancements since they were original written
++  classification scheme (splitting them across the new CE section, IPC and text
++  processing). Operating system limitatons can be reflected with the Sphinx
++  ``:platform:`` tag, it doesn't make sense as part of the Table of Contents.
++
++- Issue #4966: Bring the sequence docs up to date for the Py3k transition and
++  the many language enhancements since they were original written.
+ 
+ - The "path importer" misnomer has been replaced with Eric Snow's
+-  more-awkward-but-at-least-not-wrong suggestion of "path based finder" in
+-  the import system reference docs
+-
+-- Issue #15640: Document importlib.abc.Finder as deprecated.
+-
+-- Issue #15630: Add an example for "continue" stmt in the tutorial. Patch by
++  more-awkward-but-at-least-not-wrong suggestion of "path based finder" in the
++  import system reference docs.
++
++- Issue #15640: Document `importlib.abc.Finder` as deprecated.
++
++- Issue #15630: Add an example for "continue" stmt in the tutorial.  Patch by
+   Daniel Ellis.
+ 
+ Tests
+ -----
+ 
+ - Issue #15747: ZFS always returns EOPNOTSUPP when attempting to set the
+-  UF_IMMUTABLE flag (via either chflags or lchflags); refactor affected
+-  tests in test_posix.py to account for this.
+-
+-- Issue #15285: Refactor the approach for testing connect timeouts using
+-  two external hosts that have been configured specifically for this type
+-  of test.
+-
+-- Issue #15743: Remove the deprecated method usage in urllib tests. Patch by
++  UF_IMMUTABLE flag (via either chflags or lchflags); refactor affected tests in
++  test_posix.py to account for this.
++
++- Issue #15285: Refactor the approach for testing connect timeouts using two
++  external hosts that have been configured specifically for this type of test.
++
++- Issue #15743: Remove the deprecated method usage in `urllib` tests. Patch by
+   Jeff Knupp.
+ 
+-- Issue #15615: Add some tests for the json module's handling of invalid
+-  input data.  Patch by Kushal Das.
++- Issue #15615: Add some tests for the `json` module's handling of invalid input
++  data.  Patch by Kushal Das.
+ 
+ Build
+ -----
+@@ -270,11 +1075,11 @@
+ 
+ - Pick up 32-bit launcher from PGO directory on 64-bit PGO build.
+ 
+-- Drop PC\python_nt.h as it's not used. Add input dependency on custom
++- Drop ``PC\python_nt.h`` as it's not used.  Add input dependency on custom
+   build step.
+ 
+-- Issue #15511: Drop explicit dependency on pythonxy.lib from _decimal
+-  amd64 configuration.
++- Issue #15511: Drop explicit dependency on pythonxy.lib from _decimal amd64
++  configuration.
+ 
+ - Add missing PGI/PGO configurations for pywlauncher.
+ 
+@@ -289,15 +1094,15 @@
+ Core and Builtins
+ -----------------
+ 
+-- Issue #15568: Fix the return value of "yield from" when StopIteration is
++- Issue #15568: Fix the return value of ``yield from`` when StopIteration is
+   raised by a custom iterator.
+ 
+-- Issue #13119: sys.stdout and sys.stderr are now using "\r\n" newline on
++- Issue #13119: `sys.stdout` and `sys.stderr` are now using "\r\n" newline on
+   Windows, as Python 2.
+ 
+ - Issue #15534: Fix the fast-search function for non-ASCII Unicode strings.
+ 
+-- Issue #15508: Fix the docstring for __import__ to have the proper default
++- Issue #15508: Fix the docstring for `__import__()` to have the proper default
+   value of 0 for 'level' and to not mention negative levels since they are not
+   supported.
+ 
+@@ -310,17 +1115,17 @@
+   byte code files) equal between 32-bit and 64-bit systems.
+ 
+ - Issue #1692335: Move initial exception args assignment to
+-  "BaseException.__new__" to help pickling of naive subclasses.
+-
+-- Issue #12834: Fix PyBuffer_ToContiguous() for non-contiguous arrays.
+-
+-- Issue #15456: Fix code __sizeof__ after #12399 change.  Patch by Serhiy
++  `BaseException.__new__()` to help pickling of naive subclasses.
++
++- Issue #12834: Fix `PyBuffer_ToContiguous()` for non-contiguous arrays.
++
++- Issue #15456: Fix code `__sizeof__()` after #12399 change.  Patch by Serhiy
+   Storchaka.
+ 
+ - Issue #15404: Refleak in PyMethodObject repr.
+ 
+-- Issue #15394: An issue in PyModule_Create that caused references to be leaked
+-  on some error paths has been fixed.  Patch by Julia Lawall.
++- Issue #15394: An issue in `PyModule_Create()` that caused references to be
++  leaked on some error paths has been fixed.  Patch by Julia Lawall.
+ 
+ - Issue #15368: An issue that caused bytecode generation to be non-deterministic
+   has been fixed.
+@@ -328,7 +1133,7 @@
+ - Issue #15202: Consistently use the name "follow_symlinks" for new parameters
+   in os and shutil functions.
+ 
+-- Issue #15314: __main__.__loader__ is now set correctly during interpreter
++- Issue #15314: ``__main__.__loader__`` is now set correctly during interpreter
+   startup.
+ 
+ - Issue #15111: When a module imported using 'from import' has an ImportError
+@@ -343,57 +1148,65 @@
+ - Issue #15110: Fix the tracebacks generated by "import xxx" to not show the
+   importlib stack frames.
+ 
++- Issue #16369: Global PyTypeObjects not initialized with PyType_Ready(...).
++
+ - Issue #15020: The program name used to search for Python's path is now
+   "python3" under Unix, not "python".
+ 
+-- Issue #15033: Fix the exit status bug when modules invoked using -m swith,
++- Issue #15897: zipimport.c doesn't check return value of fseek().
++  Patch by Felipe Cruz.
++
++- Issue #15033: Fix the exit status bug when modules invoked using -m switch,
+   return the proper failure return value (1). Patch contributed by Jeff Knupp.
+ 
+-- Issue #15229: An OSError subclass whose __init__ doesn't call back
++- Issue #15229: An `OSError` subclass whose __init__ doesn't call back
+   OSError.__init__ could produce incomplete instances, leading to crashes when
+   calling str() on them.
+ 
+-- Issue 15307: Virtual environments now use symlinks with framework builds on
++- Issue #15307: Virtual environments now use symlinks with framework builds on
+   Mac OS X, like other POSIX builds.
+ 
+ Library
+ -------
+ 
+-- Issue #15424: Add a __sizeof__ implementation for array objects.  Patch by
++- Issue #14590: configparser now correctly strips inline comments when delimiter
++  occurs earlier without preceding space.
++
++- Issue #15424: Add a `__sizeof__()` implementation for array objects.  Patch by
+   Ludwig Hähne.
+ 
+ - Issue #15576: Allow extension modules to act as a package's __init__ module.
+ 
+-- Issue #15502: Have importlib.invalidate_caches() work on sys.meta_path instead
+-  of sys.path_importer_cache.
++- Issue #15502: Have `importlib.invalidate_caches()` work on `sys.meta_path`
++  instead of `sys.path_importer_cache`.
+ 
+ - Issue #15163: Pydoc shouldn't list __loader__ as module data.
+ 
+ - Issue #15471: Do not use mutable objects as defaults for
+-  importlib.__import__().
++  `importlib.__import__()`.
+ 
+ - Issue #15559: To avoid a problematic failure mode when passed to the bytes
+-  constructor, objects in the ipaddress module no longer implement __index__
+-  (they still implement __int__ as appropriate)
++  constructor, objects in the ipaddress module no longer implement `__index__()`
++  (they still implement `__int__()` as appropriate).
+ 
+ - Issue #15546: Fix handling of pathological input data in the peek() and
+   read1() methods of the BZ2File, GzipFile and LZMAFile classes.
+ 
+ - Issue #13052: Fix IDLE crashing when replace string in Search/Replace dialog
+-  ended with '\'. Patch by Roger Serwy.
+-
+-- Issue #12655: Instead of requiring a custom type, os.sched_getaffinity and
+-  os.sched_setaffinity now use regular sets of integers to represent the CPUs a
+-  process is restricted to.
+-
+-- Issue #15538: Fix compilation of the getnameinfo() / getaddrinfo() emulation
+-  code.  Patch by Philipp Hagemeister.
++  ended with ``\``.  Patch by Roger Serwy.
++
++- Issue #12655: Instead of requiring a custom type, `os.sched_getaffinity()` and
++  `os.sched_setaffinity()` now use regular sets of integers to represent the
++  CPUs a process is restricted to.
++
++- Issue #15538: Fix compilation of the `socket.getnameinfo()` /
++  `socket.getaddrinfo()` emulation code.  Patch by Philipp Hagemeister.
+ 
+ - Issue #15519: Properly expose WindowsRegistryFinder in importlib (and use the
+-  correct term for it). Original patch by Eric Snow.
++  correct term for it).  Original patch by Eric Snow.
+ 
+ - Issue #15502: Bring the importlib ABCs into line with the current state of the
+-  import protocols given PEP 420. Original patch by Eric Snow.
++  import protocols given PEP 420.  Original patch by Eric Snow.
+ 
+ - Issue #15499: Launching a webbrowser in Unix used to sleep for a few seconds.
+   Original patch by Anton Barkovsky.
+@@ -401,37 +1214,38 @@
+ - Issue #15463: The faulthandler module truncates strings to 500 characters,
+   instead of 100, to be able to display long file paths.
+ 
+-- Issue #6056: Make multiprocessing use setblocking(True) on the sockets it
++- Issue #6056: Make `multiprocessing` use setblocking(True) on the sockets it
+   uses.  Original patch by J Derek Wilson.
+ 
+ - Issue #15364: Fix sysconfig.get_config_var('srcdir') to be an absolute path.
+ 
+ - Issue #15041: Update "see also" list in tkinter documentation.
+ 
+-- Issue #15413: os.times() had disappeared under Windows.
+-
+-- Issue #15402: An issue in the struct module that caused sys.getsizeof to
++- Issue #15413: `os.times()` had disappeared under Windows.
++
++- Issue #15402: An issue in the struct module that caused `sys.getsizeof()` to
+   return incorrect results for struct.Struct instances has been fixed.  Initial
+   patch by Serhiy Storchaka.
+ 
+-- Issue #15232: When mangle_from is True, email.Generator now correctly mangles
+-  lines that start with 'From ' that occur in a MIME preamble or epilogue.
++- Issue #15232: When mangle_from is True, `email.Generator` now correctly
++  mangles lines that start with 'From ' that occur in a MIME preamble or
++  epilogue.
+ 
+ - Issue #15094: Incorrectly placed #endif in _tkinter.c.  Patch by Serhiy
+   Storchaka.
+ 
+-- Issue #13922: argparse no longer incorrectly strips '--'s that appear after
++- Issue #13922: `argparse` no longer incorrectly strips '--'s that appear after
+   the first one.
+ 
+-- Issue #12353: argparse now correctly handles null argument values.
++- Issue #12353: `argparse` now correctly handles null argument values.
+ 
+ - Issue #10017, issue #14998: Fix TypeError using pprint on dictionaries with
+   user-defined types as keys or other unorderable keys.
+ 
+-- Issue #15397: inspect.getmodulename() is now based directly on importlib via a
+-  new importlib.machinery.all_suffixes() API.
+-
+-- Issue #14635: telnetlib will use poll() rather than select() when possible to
++- Issue #15397: `inspect.getmodulename()` is now based directly on importlib via
++  a new `importlib.machinery.all_suffixes()` API.
++
++- Issue #14635: `telnetlib` will use poll() rather than select() when possible to
+   avoid failing due to the select() file descriptor limit.
+ 
+ - Issue #15180: Clarify posixpath.join() error message when mixing str & bytes.
+@@ -448,7 +1262,7 @@
+ - Issue #15233: Python now guarantees that callables registered with the atexit
+   module will be called in a deterministic order.
+ 
+-- Issue #15238: shutil.copystat now copies Linux "extended attributes".
++- Issue #15238: `shutil.copystat()` now copies Linux "extended attributes".
+ 
+ - Issue #15230: runpy.run_path now correctly sets __package__ as described in
+   the documentation.
+@@ -458,42 +1272,42 @@
+ - Issue #15294: Fix a regression in pkgutil.extend_path()'s handling of nested
+   namespace packages.
+ 
+-- Issue #15056: imp.cache_from_source() and source_from_cache() raise
+-  NotImplementedError when sys.implementation.cache_tag is set to None.
+-
+-- Issue #15256: Grammatical mistake in exception raised by imp.find_module().
+-
+-- Issue #5931: wsgiref environ variable SERVER_SOFTWARE will specify an
++- Issue #15056: `imp.cache_from_source()` and `imp.source_from_cache()` raise
++  NotImplementedError when `sys.implementation.cache_tag` is set to None.
++
++- Issue #15256: Grammatical mistake in exception raised by `imp.find_module()`.
++
++- Issue #5931: `wsgiref` environ variable SERVER_SOFTWARE will specify an
+   implementation specific term like CPython, Jython instead of generic "Python".
+ 
+ - Issue #13248: Remove obsolete argument "max_buffer_size" of BufferedWriter and
+   BufferedRWPair, from the io module.
+ 
+-- Issue #13248: Remove obsolete argument "version" of argparse.ArgumentParser.
++- Issue #13248: Remove obsolete argument "version" of `argparse.ArgumentParser`.
+ 
+ - Issue #14814: Implement more consistent ordering and sorting behaviour for
+   ipaddress objects.
+ 
+-- Issue #14814: ipaddress network objects correctly return NotImplemented when
++- Issue #14814: `ipaddress` network objects correctly return NotImplemented when
+   compared to arbitrary objects instead of raising TypeError.
+ 
+ - Issue #14990: Correctly fail with SyntaxError on invalid encoding declaration.
+ 
+-- Issue #14814: ipaddress now provides more informative error messages when
++- Issue #14814: `ipaddress` now provides more informative error messages when
+   constructing instances directly (changes permitted during beta due to
+   provisional API status).
+ 
+-- Issue #15247: FileIO now raises an error when given a file descriptor pointing
+-  to a directory.
++- Issue #15247: `io.FileIO` now raises an error when given a file descriptor
++  pointing to a directory.
+ 
+ - Issue #15261: Stop os.stat(fd) crashing on Windows when fd not open.
+ 
+-- Issue #15166: Implement imp.get_tag() using sys.implementation.cache_tag.
+-
+-- Issue #15210: Catch KeyError when importlib.__init__ can't find
++- Issue #15166: Implement `imp.get_tag()` using `sys.implementation.cache_tag`.
++
++- Issue #15210: Catch KeyError when `importlib.__init__()` can't find
+   _frozen_importlib in sys.modules, not ImportError.
+ 
+-- Issue #15030: importlib.abc.PyPycLoader now supports the new source size
++- Issue #15030: `importlib.abc.PyPycLoader` now supports the new source size
+   header field in .pyc files.
+ 
+ - Issue #5346: Preserve permissions of mbox, MMDF and Babyl mailbox files on
+@@ -506,7 +1320,7 @@
+   renamed over the old file when flush() is called on an mbox, MMDF or Babyl
+   mailbox.
+ 
+-- Issue 10924: Fixed crypt.mksalt() to use a RNG that is suitable for
++- Issue #10924: Fixed `crypt.mksalt()` to use a RNG that is suitable for
+   cryptographic purpose.
+ 
+ - Issue #15184: Ensure consistent results of OS X configuration tailoring for
+@@ -517,10 +1331,10 @@
+ C API
+ -----
+ 
+-- Issue #15610: PyImport_ImportModuleEx() now uses a 'level' of 0 instead of -1.
+-
+-- Issues #15169, #14599: Strip out the C implementation of
+-  imp.source_from_cache() used by PyImport_ExecCodeModuleWithPathnames() and
++- Issue #15610: `PyImport_ImportModuleEx()` now uses a 'level' of 0 instead of -1.
++
++- Issue #15169, issue #14599: Strip out the C implementation of
++  `imp.source_from_cache()` used by PyImport_ExecCodeModuleWithPathnames() and
+   used the Python code instead. Leads to PyImport_ExecCodeModuleObject() to not
+   try to infer the source path from the bytecode path as
+   PyImport_ExecCodeModuleWithPathnames() does.
+@@ -528,8 +1342,8 @@
+ Extension Modules
+ -----------------
+ 
+-- Issue #6493: An issue in ctypes on Windows that caused structure bitfields
+-  of type ctypes.c_uint32 and width 32 to incorrectly be set has been fixed.
++- Issue #6493: An issue in ctypes on Windows that caused structure bitfields of
++  type `ctypes.c_uint32` and width 32 to incorrectly be set has been fixed.
+ 
+ - Issue #15194: Update libffi to the 3.0.11 release.
+ 
+@@ -544,15 +1358,16 @@
+ - Issue #12605: The gdb hooks for debugging CPython (within Tools/gdb) have been
+   enhanced to show information on more C frames relevant to CPython within the
+   "py-bt" and "py-bt-full" commands:
+-    * C frames that are waiting on the GIL
+-    * C frames that are garbage-collecting
+-    * C frames that are due to the invocation of a PyCFunction
++
++  * C frames that are waiting on the GIL
++  * C frames that are garbage-collecting
++  * C frames that are due to the invocation of a PyCFunction
+ 
+ Documentation
+ -------------
+ 
+-- Issue #15444: Use proper spelling for non-ASCII contributor names.  Patch
+-  by Serhiy Storchaka.
++- Issue #15444: Use proper spelling for non-ASCII contributor names.  Patch by
++  Serhiy Storchaka.
+ 
+ - Issue #15295: Reorganize and rewrite the documentation on the import system.
+ 
+@@ -567,25 +1382,25 @@
+   "changed" since they will no longer work with modules directly imported by
+   import itself.
+ 
+-- Issue #13557: Clarify effect of giving two different namespaces to exec or
+-  execfile().
+-
+-- Issue #15250: Document that filecmp.dircmp compares files shallowly. Patch
++- Issue #13557: Clarify effect of giving two different namespaces to `exec()` or
++  `execfile()`.
++
++- Issue #15250: Document that `filecmp.dircmp()` compares files shallowly. Patch
+   contributed by Chris Jerdonek.
+ 
+ Tests
+ -----
+ 
+-- Issue #15467: Move helpers for __sizeof__ tests into test_support.  Patch by
+-  Serhiy Storchaka.
++- Issue #15467: Move helpers for `__sizeof__()` tests into test_support.  Patch
++  by Serhiy Storchaka.
+ 
+ - Issue #15320: Make iterating the list of tests thread-safe when running tests
+   in multiprocess mode. Patch by Chris Jerdonek.
+ 
+-- Issue #15168: Move importlib.test to test.test_importlib.
++- Issue #15168: Move `importlib.test` to `test.test_importlib`.
+ 
+ - Issue #15091: Reactivate a test on UNIX which was failing thanks to a
+-  forgotten importlib.invalidate_caches() call.
++  forgotten `importlib.invalidate_caches()` call.
+ 
+ - Issue #15230: Adopted a more systematic approach in the runpy tests.
+ 
+@@ -618,6 +1433,8 @@
+ 
+ - Issue #14018: Fix OS X Tcl/Tk framework checking when using OS X SDKs.
+ 
++- Issue #16256: OS X installer now sets correct permissions for doc directory.
++
+ - Issue #15431: Add _freeze_importlib project to regenerate importlib.h on
+   Windows. Patch by Kristján Valur Jónsson.
+ 
+@@ -688,6 +1505,9 @@
+ Library
+ -------
+ 
++- Issue #16305: Fix a segmentation fault occurring when interrupting
++  math.factorial.
++
+ - Issue #9803: Don't close IDLE on saving if breakpoint is open.
+   Patch by Roger Serwy.
+ 
+@@ -767,7 +1587,7 @@
+ 
+ - Issue #14626: Large refactoring of functions / parameters in the os module.
+   Many functions now support "dir_fd" and "follow_symlinks" parameters;
+-  some also support accepting an open file descriptor in place of of a path
++  some also support accepting an open file descriptor in place of a path
+   string.  Added os.support_* collections as LBYL helpers.  Removed many
+   functions only previously seen in 3.3 alpha releases (often starting with
+   "f" or "l", or ending with "at").  Originally suggested by Serhiy Storchaka;
+@@ -1401,7 +2221,7 @@
+ 
+ - Issue #14399: zipfile now recognizes that the archive has been modified even
+   if only the comment is changed.  In addition, the TypeError that results from
+-  trying to set a non-binary value as a comment is now now raised at the time
++  trying to set a non-binary value as a comment is now raised at the time
+   the comment is set rather than at the time the zipfile is written.
+ 
+ - trace.CoverageResults.is_ignored_filename() now ignores any name that starts
+@@ -1931,6 +2751,10 @@
+ 
+ - PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy.
+ 
++- Issue #13560: Add PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize()
++  and PyUnicode_EncodeLocale() functions to the C API to decode/encode from/to
++  the current locale encoding.
++
+ - Add internal API for static strings (_Py_identifier et al.).
+ 
+ - Issue #13063: the Windows error ERROR_NO_DATA (numbered 232 and described
+@@ -2193,7 +3017,7 @@
+ - Issue #11272: On Windows, input() strips '\r' (and not only '\n'), and
+   sys.stdin uses universal newline (replace '\r\n' by '\n').
+ 
+-- issue #11828: startswith and endswith don't accept None as slice index.
++- Issue #11828: startswith and endswith now accept None as slice index.
+   Patch by Torsten Becker.
+ 
+ - Issue #10830: Fix PyUnicode_FromFormatV("%c") for non-BMP characters on
+@@ -2345,11 +3169,6 @@
+   make sure two listeners can't bind to the same socket/pipe (or any existing
+   socket/pipe).
+ 
+-- Issue #9021: Add an introduction to the copy module documentation.
+-
+-- Issue #6005: Examples in the socket library documentation use sendall, where
+-  relevant, instead send method.
+-
+ - Issue #10811: Fix recursive usage of cursors. Instead of crashing,
+   raise a ProgrammingError now.
+ 
+@@ -2458,8 +3277,6 @@
+ 
+ - Add a flags parameter to select.epoll.
+ 
+-- Issue #12798: Updated the mimetypes documentation.
+-
+ - Issue #13626: Add support for SSL Diffie-Hellman key exchange, through the
+   SSLContext.load_dh_params() method and the ssl.OP_SINGLE_DH_USE option.
+ 
+@@ -2504,10 +3321,6 @@
+ - Issue #13560: os.strerror() now uses the current locale encoding instead of
+   UTF-8.
+ 
+-- Issue #13560: Add PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize()
+-  and PyUnicode_EncodeLocale() functions to the C API to decode/encode from/to
+-  the current locale encoding.
+-
+ - Issue #8373: The filesystem path of AF_UNIX sockets now uses the filesystem
+   encoding and the surrogateescape error handler, rather than UTF-8.  Patch
+   by David Watson.
+@@ -2692,7 +3505,7 @@
+ 
+ - Issue #8540: Remove deprecated Context._clamp attribute in Decimal module.
+ 
+-- Issue #13235: Added PendingDeprecationWarning to warn() method and function.
++- Issue #13235: Added DeprecationWarning to logging.warn() method and function.
+ 
+ - Issue #9168: now smtpd is able to bind privileged port.
+ 
+@@ -2713,12 +3526,12 @@
+   in order to display the prompt correctly.
+ 
+ - Issue #12454: The mailbox module is now using ASCII, instead of the locale
+-  encoding, to read and write MH mailboxes (.mh_sequences files).
++  encoding, to read and write .mh_sequences files.
+ 
+ - Issue #13194: zlib.compressobj().copy() and zlib.decompressobj().copy() are
+   now available on Windows.
+ 
+-- issue #1673007: urllib2  to support HEAD request via new method argument.
++- Issue #1673007: urllib.request now supports HEAD request via new method argument.
+   Patch contributions by David Stanek, Patrick Westerhoff and Ezio Melotti.
+ 
+ - Issue #12386: packaging does not fail anymore when writing the RESOURCES
+@@ -2759,8 +3572,6 @@
+   metaclass is registered with copyreg.  Patch by Nicolas M. Thiéry and Craig
+   Citro.
+ 
+-- Issue #4147: minidom's toprettyxml no longer adds whitespace to text nodes.
+-
+ - Issue #13034: When decoding some SSL certificates, the subjectAltName
+   extension could be unreported.
+ 
+@@ -2870,8 +3681,9 @@
+ - Issue #12540: Prevent zombie IDLE processes on Windows due to changes
+   in os.kill().
+ 
+-- Add support for unary plus and unary minus to collections.Counter().
+-  Issue #13121: Also add support for inplace math operators.
++- Issue #13121: add support for inplace math operators to collections.Counter.
++
++- Add support for unary plus and unary minus to collections.Counter.
+ 
+ - Issue #12683: urlparse updated to include svn as schemes that uses relative
+   paths. (svn from 1.5 onwards support relative path).
+@@ -2896,11 +3708,11 @@
+ - Issue #8887: "pydoc somebuiltin.somemethod" (or help('somebuiltin.somemethod')
+   in Python code) now finds the doc of the method.
+ 
+-- Issue #10968: Remove indirection in threading.  The public names (Thread,
++- Issue #10968: Remove indirection in threading.  The public names (Event,
+   Condition, etc.) used to be factory functions returning instances of hidden
+-  classes (_Thread, _Condition, etc.), because (if Guido recalls correctly) this
+-  code pre-dates the ability to subclass extension types.  It is now possible to
+-  inherit from Thread and other classes, without having to import the private
++  classes (_Event, _Condition, etc.), because (if Guido recalls correctly) this
++  code pre-dates the ability to subclass extension types.  It is now possible
++  to inherit from these classes, without having to import the private
+   underscored names like multiprocessing did.
+ 
+ - Issue #9723: Add shlex.quote functions, to escape filenames and command
+@@ -3024,7 +3836,7 @@
+ - Issue #12352: Fix a deadlock in multiprocessing.Heap when a block is freed by
+   the garbage collector while the Heap lock is held.
+ 
+-- Issue #12462: time.sleep() now calls immediatly the (Python) signal handler
++- Issue #12462: time.sleep() now immediately calls the (Python) signal handler
+   if it is interrupted by a signal, instead of having to wait until the next
+   instruction.
+ 
+@@ -3049,7 +3861,7 @@
+   check or set the MACOSX_DEPLOYMENT_TARGET environment variable for the
+   interpreter process.  This could cause failures in non-Distutils subprocesses
+   and was unreliable since tests or user programs could modify the interpreter
+-  environment after Distutils set it.  Instead, have Distutils set the the
++  environment after Distutils set it.  Instead, have Distutils set the
+   deployment target only in the environment of each build subprocess.  It is
+   still possible to globally override the default by setting
+   MACOSX_DEPLOYMENT_TARGET before launching the interpreter; its value must be
+@@ -3177,7 +3989,7 @@
+   if the file is closed.
+ 
+ - Issue #11109: New service_action method for BaseServer, used by ForkingMixin
+-  class for cleanup. Initial Patch by Justin Wark.
++  class for cleanup. Initial Patch by Justin Warkentin.
+ 
+ - Issue #12045: Avoid duplicate execution of command in
+   ctypes.util._get_soname().  Patch by Sijin Joseph.
+@@ -3262,9 +4074,9 @@
+ - Issue #12011: signal.signal() and signal.siginterrupt() raise an OSError,
+   instead of a RuntimeError: OSError has an errno attribute.
+ 
+-- Issue #3709: a flush_headers method to BaseHTTPRequestHandler which manages
+-  the sending of headers to output stream and flushing the internal headers
+-  buffer. Patch contribution by Andrew Schaaf
++- Issue #3709: add a flush_headers method to BaseHTTPRequestHandler, which
++  manages the sending of headers to output stream and flushing the internal
++  headers buffer. Patch contribution by Andrew Schaaf
+ 
+ - Issue #11743: Rewrite multiprocessing connection classes in pure Python.
+ 
+@@ -3566,7 +4378,7 @@
+   not installed. Instead, the zipfile.ZIP_STORED compression is used to create
+   the ZipFile. Patch by Natalia B. Bidart.
+ 
+-- Issue #11289: `smtp.SMTP` class becomes a context manager so it can be used
++- Issue #11289: `smtp.SMTP` class is now a context manager so it can be used
+   in a `with` statement.  Contributed by Giampaolo Rodola.
+ 
+ - Issue #11554: Fixed support for Japanese codecs; previously the body output
+@@ -3578,7 +4390,7 @@
+ - Issue #11407: `TestCase.run` returns the result object used or created.
+   Contributed by Janathan Hartley.
+ 
+-- Issue #11500: Fixed a bug in the os x proxy bypass code for fully qualified
++- Issue #11500: Fixed a bug in the OS X proxy bypass code for fully qualified
+   IP addresses in the proxy exception list.
+ 
+ - Issue #11491: dbm.error is no longer raised when dbm.open is called with
+@@ -3735,7 +4547,7 @@
+   functions (BSD and OS X).  Also add new stat file flags for OS X
+   (UF_HIDDEN and UF_COMPRESSED).
+ 
+-- Issue #10645: Installing Python does no longer create a
++- Issue #10645: Installing Python no longer creates a
+   Python-X.Y.Z-pyX.Y.egg-info file in the lib-dynload directory.
+ 
+ - Do not accidentally include the directory containing sqlite.h twice when
+@@ -3787,6 +4599,10 @@
+ Extension Modules
+ -----------------
+ 
++- Issue #16847: Fixed improper use of _PyUnicode_CheckConsistency() in
++  non-pydebug builds. Several extension modules now compile cleanly when
++  assert()s are enabled in standard builds (-DDEBUG flag).
++
+ - Issue #13840: The error message produced by ctypes.create_string_buffer
+   when given a Unicode string has been fixed.
+ 
+@@ -4076,6 +4892,9 @@
+ Documentation
+ -------------
+ 
++- Issue #13498: Clarify docs of os.makedirs()'s exist_ok argument.  Done with
++  great native-speaker help from R. David Murray.
++
+ - Issues #13491 and #13995: Fix many errors in sqlite3 documentation.
+   Initial patch for #13491 by Johannes Vogel.
+ 
+@@ -4083,6 +4902,13 @@
+ 
+ - Issue #13883: PYTHONCASEOK also works on OS X.
+ 
++- Issue #9021: Add an introduction to the copy module documentation.
++
++- Issue #6005: Examples in the socket library documentation use sendall, where
++  relevant, instead send method.
++
++- Issue #12798: Updated the mimetypes documentation.
++
+ - Issue #12949: Document the kwonlyargcount argument for the PyCode_New
+   C API function.
+ 
+@@ -4097,5401 +4923,4 @@
+ - Issue #11818: Fix tempfile examples for Python 3.
+ 
+ 
+-What's New in Python 3.2?
+-=========================
+-
+-*Release date: 20-Feb-2011*
+-
+-Core and Builtins
+------------------
+-
+-- Issue #11249: Fix potential crashes when using the limited API.
+-
+-Build
+------
+-
+-- Issue #11222: Fix non-framework shared library build on Mac OS X.
+-
+-- Issue #11184: Fix large-file support on AIX.
+-
+-- Issue #941346: Fix broken shared library build on AIX.
+-
+-Documentation
+--------------
+-
+-- Issue #10709: Add updated AIX notes in Misc/README.AIX.
+-
+-
+-What's New in Python 3.2 Release Candidate 3?
+-=============================================
+-
+-*Release date: 13-Feb-2011*
+-
+-Core and Builtins
+------------------
+-
+-- Issue #11134: Add missing fields to typeslots.h.
+-
+-- Issue #11135: Remove redundant doc field from PyType_Spec.
+-
+-- Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check in the limited
+-  ABI.
+-
+-- Issue #11118: Fix bogus export of None in python3.dll.
+-
+-Library
+--------
+-
+-- Issue #11116: any error during addition of a message to a mailbox now causes a
+-  rollback, instead of leaving the mailbox partially modified.
+-
+-- Issue #11132: Fix passing of "optimize" parameter when recursing in
+-  compileall.compile_dir().
+-
+-- Issue #11110: Fix a potential decref of a NULL in sqlite3.
+-
+-- Issue #8275: Fix passing of callback arguments with ctypes under Win64.  Patch
+-  by Stan Mihai.
+-
+-Build
+------
+-
+-- Issue #11079: The /Applications/Python x.x folder created by the Mac OS X
+-  installers now includes a link to the installed documentation and no longer
+-  includes an Extras directory.  The Tools directory is now installed in the
+-  framework under share/doc.
+-
+-- Issue #11121: Fix building with --enable-shared.
+-
+-Tests
+------
+-
+-- Issue #10971: test_zipimport_support is once again compatible with the refleak
+-  hunter feature of test.regrtest.
+-
+-
+-What's New in Python 3.2 Release Candidate 2?
+-=============================================
+-
+-*Release date: 30-Jan-2011*
+-
+-Core and Builtins
+------------------
+-
+-- Issue #10451: memoryview objects could allow to mutate a readable buffer.
+-  Initial patch by Ross Lagerwall.
+-
+-Library
+--------
+-
+-- Issue #9124: mailbox now accepts binary input and reads and writes mailbox
+-  files in binary mode, using the email package's binary support to parse
+-  arbitrary email messages.  StringIO and text file input is deprecated,
+-  and string input fails early if non-ASCII characters are used, where
+-  previously it would fail when the email was processed in a later step.
+-
+-- Issue #10845: Mitigate the incompatibility between the multiprocessing
+-  module on Windows and the use of package, zipfile or directory execution
+-  by special casing main modules that actually *are* called __main__.py.
+-
+-- Issue #11045: Protect logging call against None argument.
+-
+-- Issue #11052: Correct IDLE menu accelerators on Mac OS X for Save
+-  commands.
+-
+-- Issue #11053: Fix IDLE "Syntax Error" windows to behave as in 2.x,
+-  preventing a confusing hung appearance on OS X with the windows
+-  obscured.
+-
+-- Issue #10940: Workaround an IDLE hang on Mac OS X 10.6 when using the
+-  menu accelerators for Open Module, Go to Line, and New Indent Width.
+-  The accelerators still work but no longer appear in the menu items.
+-
+-- Issue #10989: Fix a crash on SSLContext.load_verify_locations(None, True).
+-
+-- Issue #11020: Command-line pyclbr was broken because of missing 2-to-3
+-  conversion.
+-
+-- Issue #11019: Fixed BytesGenerator so that it correctly handles a Message
+-  with a None body.
+-
+-- Issue #11014: Make 'filter' argument in tarfile.Tarfile.add() into a
+-  keyword-only argument.  The preceding positional argument was deprecated,
+-  so it made no sense to add filter as a positional argument.
+-
+-- Issue #11004: Repaired edge case in deque.count().
+-
+-- Issue #10974: IDLE no longer crashes if its recent files list includes files
+-  with non-ASCII characters in their path names.
+-
+-- Have hashlib.algorithms_available and hashlib.algorithms_guaranteed both
+-  return sets instead of one returning a tuple and the other a frozenset.
+-
+-- Issue #10987: Fix the recursion limit handling in the _pickle module.
+-
+-- Issue #10983: Fix several bugs making tunnel requests in http.client.
+-
+-- Issue #10955: zipimport uses ASCII encoding instead of cp437 to decode
+-  filenames, at bootstrap, if the codec registry is not ready yet. It is still
+-  possible to have non-ASCII filenames using the Unicode flag (UTF-8 encoding)
+-  for all file entries in the ZIP file.
+-
+-- Issue #10949: Improved robustness of rotating file handlers.
+-
+-- Issue #10955: Fix a potential crash when trying to mmap() a file past its
+-  length.  Initial patch by Ross Lagerwall.
+-
+-- Issue #10898: Allow compiling the posix module when the C library defines
+-  a symbol named FSTAT.
+-
+-- Issue #10980: the HTTP server now encodes headers with iso-8859-1 (latin1)
+-  encoding.  This is the preferred encoding of PEP 3333 and the base encoding
+-  of HTTP 1.1.
+-
+-- To match the behaviour of HTTP server, the HTTP client library now also
+-  encodes headers with iso-8859-1 (latin1) encoding.  It was already doing
+-  that for incoming headers which makes this behaviour now consistent in
+-  both incoming and outgoing direction.
+-
+-- Issue #9509: argparse now properly handles IOErrors raised by
+-  argparse.FileType.
+-
+-- Issue #10961: The new pydoc server now better handles exceptions raised
+-  during request handling.
+-
+-- Issue #10680: Fix mutually exclusive arguments for argument groups in
+-  argparse.
+-
+-Build
+------
+-
+-- Issue #11054: Allow Mac OS X installer builds to again work on 10.5 with
+-  the system-provided Python.
+-
+-
+-What's New in Python 3.2 Release Candidate 1
+-============================================
+-
+-*Release date: 16-Jan-2011*
+-
+-Core and Builtins
+------------------
+-
+-- Issue #10889: range indexing and slicing now works correctly on ranges with
+-  a length that exceeds sys.maxsize.
+-
+-- Issue #10892: Don't segfault when trying to delete __abstractmethods__ from a
+-  class.
+-
+-- Issue #8020: Avoid a crash where the small objects allocator would read
+-  non-Python managed memory while it is being modified by another thread.  Patch
+-  by Matt Bandy.
+-
+-- Issue #10841: On Windows, set the binary mode on stdin, stdout, stderr and all
+-  io.FileIO objects (to not translate newlines, \r\n <=> \n).  The Python parser
+-  translates newlines (\r\n => \n).
+-
+-- Remove buffer API from stable ABI for now, see #10181.
+-
+-- Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file
+-  doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
+-  (length bigger than 2^31-1 bytes).
+-
+-- Issue #9015, #9611: FileIO.readinto(), FileIO.write(), os.write() and
+-  stdprinter.write() clamp the length to INT_MAX on Windows.
+-
+-- Issue #8278: On Windows and with a NTFS filesystem, os.stat() and os.utime()
+-  can now handle dates after 2038.
+-
+-- Issue #10780: PyErr_SetFromWindowsErrWithFilename() and
+-  PyErr_SetExcFromWindowsErrWithFilename() decode the filename from the
+-  filesystem encoding instead of UTF-8.
+-
+-- Issue #10779: PyErr_WarnExplicit() decodes the filename from the filesystem
+-  encoding instead of UTF-8.
+-
+-- Add sys.flags attribute for the new -q command-line option.
+-
+-- Issue #11506: Trying to assign to a bytes literal should result in a
+-  SyntaxError.
+-
+-Library
+--------
+-
+-- Issue #10916: mmap should not segfault when a file is mapped using 0 as length
+-  and a non-zero offset, and an attempt to read past the end of file is made
+-  (IndexError is raised instead).  Patch by Ross Lagerwall.
+-
+-- Issue #10154, #10090: change the normalization of UTF-8 to "UTF-8" instead
+-  of "UTF8" in the locale module as the latter is not supported MacOSX and OpenBSD.
+-
+-- Issue #10907: Warn OS X 10.6 IDLE users to use ActiveState Tcl/Tk 8.5, rather
+-  than the currently problematic Apple-supplied one, when running with the
+-  64-/32-bit installer variant.
+-
+-- Issue #4953: cgi.FieldStorage and cgi.parse() parse the request as bytes, not
+-  as unicode, and accept binary files. Add encoding and errors attributes to
+-  cgi.FieldStorage. Patch written by Pierre Quentel (with many inputs by Glenn
+-  Linderman).
+-
+-- Add encoding and errors arguments to urllib.parse_qs() and urllib.parse_qsl().
+-
+-- Issue #10899: No function type annotations in the standard library.  Removed
+-  function type annotations from _pyio.py.
+-
+-- Issue #10875: Update Regular Expression HOWTO; patch by 'SilentGhost'.
+-
+-- Issue #10872: The repr() of TextIOWrapper objects now includes the mode
+-  if available.
+-
+-- Issue #10869: Fixed bug where ast.increment_lineno modified the root node
+-  twice.
+-
+-- Issue #5871: email.header.Header.encode now raises an error if any
+-  continuation line in the formatted value has no leading white space and looks
+-  like a header.  Since Generator uses Header to format all headers, this check
+-  is made for all headers in any serialized message at serialization time.  This
+-  provides protection against header injection attacks.
+-
+-- Issue #10859: Make ``contextlib.GeneratorContextManager`` officially
+-  private by renaming it to ``_GeneratorContextManager``.
+-
+-- Issue #10042: Fixed the total_ordering decorator to handle cross-type
+-  comparisons that could lead to infinite recursion.
+-
+-- Issue #10686: the email package now :rfc:`2047`\ -encodes headers with
+-  non-ASCII bytes (parsed by a BytesParser) when doing conversion to 7bit-clean
+-  presentation, instead of replacing them with ?s.
+-
+-- email.header.Header was incorrectly encoding folding whitespace when
+-  rfc2047-encoding header values with embedded newlines, leaving them without
+-  folding whitespace.  It now uses the continuation_ws, as it does for
+-  continuation lines that it creates itself.
+-
+-- Issue #1777412, #10827: Changed the rules for 2-digit years. The
+-  time.asctime(), time.ctime() and time.strftime() functions will now format
+-  any year when ``time.accept2dyear`` is False and will accept years >= 1000
+-  otherwise. ``time.mktime`` and ``time.strftime`` now accept full range
+-  supported by the OS. With Visual Studio or on Solaris, the year is limited to
+-  the range [1; 9999]. Conversion of 2-digit years to 4-digit is deprecated.
+-
+-- Issue #7858: Raise an error properly when os.utime() fails under Windows
+-  on an existing file.
+-
+-- Issue #3839: wsgiref should not override a Content-Length header set by
+-  the application.  Initial patch by Clovis Fabricio.
+-
+-- Issue #10492: bdb.Bdb.run() only traces the execution of the code, not the
+-  compilation (if the input is a string).
+-
+-- Issue #7995: When calling accept() on a socket with a timeout, the returned
+-  socket is now always blocking, regardless of the operating system.
+-
+-- Issue #10756: atexit normalizes the exception before displaying it. Patch by
+-  Andreas Stührk.
+-
+-- Issue #10790: email.header.Header.append's charset logic now works correctly
+-  for charsets whose output codec is different from its input codec.
+-
+-- Issue #10819: SocketIO.name property returns -1 when its closed, instead of
+-  raising a ValueError, to fix repr().
+-
+-- Issue #8650: zlib.compress() and zlib.decompress() raise an OverflowError if
+-  the input buffer length doesn't fit into an unsigned int (length bigger than
+-  2^32-1 bytes).
+-
+-- Issue #6643: Reinitialize locks held within the threading module after fork to
+-  avoid a potential rare deadlock or crash on some platforms.
+-
+-- Issue #10806, issue #9905: Fix subprocess pipes when some of the standard file
+-  descriptors (0, 1, 2) are closed in the parent process.  Initial patch by Ross
+-  Lagerwall.
+-
+-- `unittest.TestCase` can be instantiated without a method name; for simpler
+-  exploration from the interactive interpreter.
+-
+-- Issue #10798: Reject supporting concurrent.futures if the system has too
+-  few POSIX semaphores.
+-
+-- Issue #10807: Remove base64, bz2, hex, quopri, rot13, uu and zlib codecs from
+-  the codec aliases. They are still accessible via codecs.lookup().
+-
+-- Issue #10801: In zipfile, support different encodings for the header and the
+-  filenames.
+-
+-- Issue #6285: IDLE no longer crashes on missing help file; patch by Scott
+-  David Daniels.
+-
+-- Fix collections.OrderedDict.setdefault() so that it works in subclasses that
+-  define __missing__().
+-
+-- Issue #10786: unittest.TextTestRunner default stream no longer bound at import
+-  time. `sys.stderr` now looked up at instantiation time.  Fix contributed by
+-  Mark Roddy.
+-
+-- Issue #10753: Characters ';', '=' and ',' in the PATH_INFO environment variable
+-  won't be quoted when the URI is constructed by the wsgiref.util's request_uri
+-  method. According to RFC 3986, these characters can be a part of params in
+-  PATH component of URI and need not be quoted.
+-
+-- Issue #10738: Fix webbrowser.Opera.raise_opts.
+-
+-- Issue #9824: SimpleCookie now encodes , and ; in values to cater to how
+-  browsers actually parse cookies.
+-
+-- Issue #9333: os.symlink now available regardless of user privileges.  The
+-  function now raises OSError on Windows >=6.0 when the user is unable to create
+-  symbolic links. XP and 2003 still raise NotImplementedError.
+-
+-- Issue #10783: struct.pack() no longer implicitly encodes unicode to UTF-8.
+-
+-- Issue #10730: Add SVG mime types to mimetypes module.
+-
+-- Issue #10768: Make the Tkinter ScrolledText widget work again.
+-
+-- Issue #10777: Fix "dictionary changed size during iteration" bug in
+-  ElementTree register_namespace().
+-
+-- Issue #10626: test_logging now preserves logger disabled states.
+-
+-- Issue #10774: test_logging now removes temp files created during tests.
+-
+-- Issue #5258/#10642: if site.py encounters a .pth file that generates an error,
+-  it now prints the filename, line number, and traceback to stderr and skips
+-  the rest of that individual file, instead of stopping processing entirely.
+-
+-- Issue #10763: subprocess.communicate() closes stdout and stderr if both are
+-  pipes (bug specific to Windows).
+-
+-- Issue #1693546: fix email.message RFC 2231 parameter encoding to be in better
+-  compliance (no "s around encoded values).
+-
+-- Improved the diff message in the unittest module's assertCountEqual().
+-
+-- Issue #1155362: email.utils.parsedate_tz now handles a missing space before
+-  the '-' of a timezone field as well as before a '+'.
+-
+-- Issue #4871: The zipfile module now gives a more useful error message if
+-  an attempt is made to use a string to specify the archive password.
+-
+-- Issue #10750: The ``raw`` attribute of buffered IO objects is now read-only.
+-
+-- Deprecated assertDictContainsSubset() in the unittest module.
+-
+-C-API
+------
+-
+-- PyObject_CallMethod now passes along any underlying AttributeError from
+-  PyObject_GetAttr, instead of replacing it with something less informative
+-
+-- Issue #10913: Deprecate misleading functions PyEval_AcquireLock() and
+-  PyEval_ReleaseLock().  The thread-state aware APIs should be used instead.
+-
+-- Issue #10333: Remove ancient GC API, which has been deprecated since Python
+-  2.2.
+-
+-Build
+------
+-
+-- Issue #10843: Update third-party library versions used in OS X 32-bit
+-  installer builds: bzip2 1.0.6, readline 6.1.2, SQLite 3.7.4 (with FTS3/FTS4
+-  and RTREE enabled), and ncursesw 5.5 (wide-char support enabled).
+-
+-- Issue #10820: Fix OS X framework installs to support version-specific
+-  scripts (#10679).
+-
+-- Issue #7716: Under Solaris, don't assume existence of /usr/xpg4/bin/grep in
+-  the configure script but use $GREP instead.  Patch by Fabian Groffen.
+-
+-- Issue #10475: Don't hardcode compilers for LDSHARED/LDCXXSHARED on NetBSD
+-  and DragonFly BSD.  Patch by Nicolas Joly.
+-
+-- Issue #10679: The "idle", "pydoc" and "2to3" scripts are now installed with
+-  a version-specific suffix on "make altinstall".
+-
+-- Issue #10655: Fix the build on PowerPC on Linux with GCC when building with
+-  timestamp profiling (--with-tsc): the preprocessor test for the PowerPC
+-  support now looks for "__powerpc__" as well as "__ppc__": the latter seems to
+-  only be present on OS X; the former is the correct one for Linux with GCC.
+-
+-- Issue #1099: Fix the build on MacOSX when building a framework with pydebug
+-  using GCC 4.0.
+-
+-Tools/Demos
+------------
+-
+-- Issue #10843: Install the Tools directory on OS X in the applications Extras
+-  (/Applications/Python 3.n/Extras/) where the Demo directory had previous been
+-  installed.
+-
+-- Issue #7962: The Demo directory is gone.  Most of the old and unmaintained
+-  demos have been removed, others integrated in documentation or a new
+-  Tools/demo subdirectory.
+-
+-- Issue #10502: Addition of the unittestgui tool. Originally by Steve Purcell.
+-  Updated for test discovery by Mark Roddy and Python 3 compatibility by Brian
+-  Curtin.
+-
+-Tests
+------
+-
+-- Issue #11910: Fix test_heapq to skip the C tests when _heapq is missing.
+-
+-- Fix test_startfile to wait for child process to terminate before finishing.
+-
+-- Issue #10822: Fix test_posix:test_getgroups failure under Solaris.  Patch
+-  by Ross Lagerwall.
+-
+-- Make the --coverage flag work for test.regrtest.
+-
+-- Issue #1677694: Refactor and improve test_timeout.  Original patch by
+-  Björn Lindqvist.
+-
+-- Issue #5485: Add tests for the UseForeignDTD method of expat parser objects.
+-  Patch by Jean-Paul Calderone and Sandro Tosi.
+-
+-- Issue #6293: Have regrtest.py echo back sys.flags.  This is done by default in
+-  whole runs and enabled selectively using ``--header`` when running an explicit
+-  list of tests.  Original patch by Collin Winter.
+-
+-
+-What's New in Python 3.2 Beta 2?
+-================================
+-
+-*Release date: 19-Dec-2010*
+-
+-Core and Builtins
+------------------
+-
+-- Issue #8844: Regular and recursive lock acquisitions can now be interrupted
+-  by signals on platforms using pthreads.  Patch by Reid Kleckner.
+-
+-- Issue #4236: PyModule_Create2 now checks the import machinery directly
+-  rather than the Py_IsInitialized flag, avoiding a Fatal Python
+-  error in certain circumstances when an import is done in __del__.
+-
+-- Issue #5587: add a repr to dict_proxy objects.  Patch by David Stanek and
+-  Daniel Urban.
+-
+-Library
+--------
+-
+-- Issue #3243:  Support iterable bodies in httplib. Patch Contributions by
+-  Xuanji Li and Chris AtLee.
+-
+-- Issue #10611: SystemExit exception will no longer kill a unittest run.
+-
+-- Issue #9857: It is now possible to skip a test in a setUp, tearDown or clean
+-  up function.
+-
+-- Issue #10573: use actual/expected consistently in unittest methods.
+-  The order of the args of assertCountEqual is also changed.
+-
+-- Issue #9286: email.utils.parseaddr no longer concatenates blank-separated
+-  words in the local part of email addresses, thereby preserving the input.
+-
+-- Issue #6791: Limit header line length (to 65535 bytes) in http.client
+-  and http.server, to avoid denial of services from the other party.
+-
+-- Issue #10404: Use ctl-button-1 on OSX for the context menu in Idle.
+-
+-- Issue #9907: Fix tab handling on OSX when using editline by calling
+-  rl_initialize first, then setting our custom defaults, then reading .editrc.
+-
+-- Issue #4188: Avoid creating dummy thread objects when logging operations
+-  from the threading module (with the internal verbose flag activated).
+-
+-- Issue #10711: Remove HTTP 0.9 support from http.client.  The ``strict``
+-  parameter to HTTPConnection and friends is deprecated.
+-
+-- Issue #9721: Fix the behavior of urljoin when the relative url starts with a
+-  ';' character. Patch by Wes Chow.
+-
+-- Issue #10714: Limit length of incoming request in http.server to 65536 bytes
+-  for security reasons.  Initial patch by Ross Lagerwall.
+-
+-- Issue #9558: Fix distutils.command.build_ext with VS 8.0.
+-
+-- Issue #10667: Fast path for collections.Counter().
+-
+-- Issue #10695: passing the port as a string value to telnetlib no longer
+-  causes debug mode to fail.
+-
+-- Issue #1078919: add_header now automatically RFC2231 encodes parameters
+-  that contain non-ascii values.
+-
+-- Issue #10188 (partial resolution): tempfile.TemporaryDirectory emits
+-  a warning on sys.stderr rather than throwing a misleading exception
+-  if cleanup fails due to nulling out of modules during shutdown.
+-  Also avoids an AttributeError when mkdtemp call fails and issues
+-  a ResourceWarning on implicit cleanup via __del__.
+-
+-- Issue #10107: Warn about unsaved files in IDLE on OSX.
+-
+-- Issue #7213: subprocess.Popen's default for close_fds has been changed.
+-  It is now True in most cases other than on Windows when input, output or
+-  error handles are provided.
+-
+-- Issue #6559: subprocess.Popen has a new pass_fds parameter (actually
+-  added in 3.2beta1) to allow specifying a specific list of file descriptors
+-  to keep open in the child process.
+-
+-- Issue #1731717: Fixed the problem where subprocess.wait() could cause an
+-  OSError exception when The OS had been told to ignore SIGCLD in our process
+-  or otherwise not wait for exiting child processes.
+-
+-Tests
+------
+-
+-- Issue #775964: test_grp now skips YP/NIS entries instead of failing when
+-  encountering them.
+-
+-Tools/Demos
+------------
+-
+-- Issue #6075: IDLE on Mac OS X now works with both Carbon AquaTk and
+-  Cocoa AquaTk.
+-
+-- Issue #10710: ``Misc/setuid-prog.c`` is removed from the source tree.
+-
+-- Issue #10706: Remove outdated script runtests.sh.  Either ``make test``
+-  or ``python -m test`` should be used instead.
+-
+-Build
+------
+-
+-- The Windows build now uses Tcl/Tk 8.5.9 and sqlite3 3.7.4.
+-
+-- Issue #9234: argparse supports alias names for subparsers.
+-
+-
+-What's New in Python 3.2 Beta 1?
+-================================
+-
+-*Release date: 05-Dec-2010*
+-
+-Core and Builtins
+------------------
+-
+-- Issue #10630: Return dict views from the dict proxy keys()/values()/items()
+-  methods.
+-
+-- Issue #10596: Fix float.__mod__ to have the same behaviour as float.__divmod__
+-  with respect to signed zeros.  -4.0 % 4.0 should be 0.0, not -0.0.
+-
+-- Issue #1772833: Add the -q command-line option to suppress copyright and
+-  version output in interactive mode.
+-
+-- Provide an *optimize* parameter in the built-in compile() function.
+-
+-- Fixed several corner case issues on Windows in os.stat/os.lstat related to
+-  reparse points.
+-
+-- PEP 384 (Defining a Stable ABI) is implemented.
+-
+-- Issue #2690: Range objects support negative indices and slicing.
+-
+-- Issue #9915: Speed up sorting with a key.
+-
+-- Issue #8685: Speed up set difference ``a - b`` when source set ``a`` is much
+-  larger than operand ``b``.  Patch by Andrew Bennetts.
+-
+-- Issue #10518: Bring back the callable() builtin.
+-
+-- Issue #7094: Added alternate formatting (specified by '#') to ``__format__``
+-  method of float, complex, and Decimal. This allows more precise control over
+-  when decimal points are displayed.
+-
+-- Issue #10474: range.count() should return integers.
+-
+-- Issue #1574217: isinstance now catches only AttributeError, rather than
+-  masking all errors.
+-
+-Library
+--------
+-
+-- logging: added "handler of last resort". See http://bit.ly/last-resort-handler
+-
+-- test.support: Added TestHandler and Matcher classes for better support of
+-  assertions about logging.
+-
+-- Issue #4391: Use proper plural forms in argparse.
+-
+-- Issue #10601: sys.displayhook uses 'backslashreplace' error handler on
+-  UnicodeEncodeError.
+-
+-- Add the "display" and "undisplay" pdb commands.
+-
+-- Issue #7245: Add a SIGINT handler in pdb that allows to break a program again
+-  after a "continue" command.
+-
+-- Add the "interact" pdb command.
+-
+-- Issue #7905: Actually respect the keyencoding parameter to shelve.Shelf.
+-
+-- Issue #1569291: Speed up array.repeat().
+-
+-- Provide an interface to set the optimization level of compilation in
+-  py_compile, compileall and zipfile.PyZipFile.
+-
+-- Issue #7904: Changes to urllib.parse.urlsplit to handle schemes as defined by
+-  RFC3986. Anything before :// is considered a scheme and is followed by an
+-  authority (or netloc) and by '/' led path, which is optional.
+-
+-- Issue #6045: dbm.gnu databases now support get() and setdefault() methods.
+-
+-- Issue #10620: `python -m unittest` can accept file paths instead of module
+-  names for running specific tests.
+-
+-- Issue #9424: Deprecate the `unittest.TestCase` methods `assertEquals`,
+-  `assertNotEquals`, `assertAlmostEquals`, `assertNotAlmostEquals` and `assert_`
+-  and replace them with the correct methods in the Python test suite.
+-
+-- Issue #10272: The ssl module now raises socket.timeout instead of a generic
+-  SSLError on socket timeouts.
+-
+-- Issue #10528: Allow translators to reorder placeholders in localizable
+-  messages from argparse.
+-
+-- Issue #10497: Fix incorrect use of gettext in argparse.
+-
+-- Issue #10478: Reentrant calls inside buffered IO objects (for example by
+-  way of a signal handler) now raise a RuntimeError instead of freezing the
+-  current process.
+-
+-- logging: Added getLogRecordFactory/setLogRecordFactory with docs and tests.
+-
+-- Issue #10549: Fix pydoc traceback when text-documenting certain classes.
+-
+-- Issue #2001: New HTML server with enhanced Web page features.  Patch by Ron
+-  Adam.
+-
+-- Issue #10360: In WeakSet, do not raise TypeErrors when testing for membership
+-  of non-weakrefable objects.
+-
+-- Issue #940286: pydoc.Helper.help() ignores input/output init parameters.
+-
+-- Issue #1745035: Add a command size and data size limit to smtpd.py, to prevent
+-  DoS attacks.  Patch by Savio Sena.
+-
+-- Issue #4925: Add filename to error message when executable can't be found in
+-  subprocess.
+-
+-- Issue #10391: Don't dereference invalid memory in error messages in the ast
+-  module.
+-
+-- Issue #10027: st_nlink was not being set on Windows calls to os.stat or
+-  os.lstat. Patch by Hirokazu Yamamoto.
+-
+-- Issue #9333: Expose os.symlink only when the SeCreateSymbolicLinkPrivilege is
+-  held by the user's account, i.e., when the function can actually be used.
+-
+-- Issue #8879: Add os.link support for Windows.
+-
+-- Issue #7911: ``unittest.TestCase.longMessage`` defaults to True for improved
+-  failure messages by default. Patch by Mark Roddy.
+-
+-- Issue #1486713: HTMLParser now has an optional tolerant mode where it tries to
+-  guess at the correct parsing of invalid html.
+-
+-- Issue #10554: Add context manager support to subprocess.Popen objects.
+-
+-- Issue #8989: email.utils.make_msgid now has a domain parameter that can
+-  override the domain name used in the generated msgid.
+-
+-- Issue #9299: Add exist_ok parameter to os.makedirs to suppress the 'File
+-  exists' exception when a target directory already exists with the specified
+-  mode. Patch by Ray Allen.
+-
+-- Issue #9573: os.fork() now works correctly when triggered as a side effect of
+-  a module import.
+-
+-- Issue #10464: netrc now correctly handles lines with embedded '#' characters.
+-
+-- Added itertools.accumulate().
+-
+-- Issue #4113: Added custom ``__repr__`` method to ``functools.partial``.
+-  Original patch by Daniel Urban.
+-
+-- Issue #10273: Rename `assertRegexpMatches` and `assertRaisesRegexp` to
+-  `assertRegex` and `assertRaisesRegex`.
+-
+-- Issue #10535: Enable silenced warnings in unittest by default.
+-
+-- Issue #9873: The URL parsing functions in urllib.parse now accept ASCII byte
+-  sequences as input in addition to character strings.
+-
+-- Issue #10586: The statistics API for the new functools.lru_cache has been
+-  changed to a single cache_info() method returning a named tuple.
+-
+-- Issue #10323: itertools.islice() now consumes the minimum number of inputs
+-  before stopping.  Formerly, the final state of the underlying iterator was
+-  undefined.
+-
+-- Issue #10565: The collections.Iterator ABC now checks for both __iter__ and
+-  __next__.
+-
+-- Issue #10242: Fixed implementation of unittest.ItemsEqual and gave it a new
+-  more informative name, unittest.CountEqual.
+-
+-- Issue #10561: In pdb, clear the breakpoints by the breakpoint number.
+-
+-- Issue #2986: difflib.SequenceMatcher gets a new parameter, autojunk, which can
+-  be set to False to turn off the previously undocumented 'popularity'
+-  heuristic. Patch by Terry Reedy and Eli Bendersky.
+-
+-- Issue #10534: in difflib, expose bjunk and bpopular sets; deprecate
+-  undocumented and now redundant isbjunk and isbpopular methods.
+-
+-- Issue #9846: zipfile is now correctly closing underlying file objects.
+-
+-- 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.
+-
+-- configparser: 100% test coverage.
+-
+-- Issue #10499: configparser supports pluggable interpolation handlers. The
+-  default classic interpolation handler is called BasicInterpolation. Another
+-  interpolation handler added (ExtendedInterpolation) which supports the syntax
+-  used by zc.buildout (e.g. interpolation between sections).
+-
+-- configparser: the SafeConfigParser class has been renamed to ConfigParser.
+-  The legacy ConfigParser class has been removed but its interpolation mechanism
+-  is still available as LegacyInterpolation.
+-
+-- configparser: Usage of RawConfigParser is now discouraged for new projects
+-  in favor of ConfigParser(interpolation=None).
+-
+-- 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
+-  (thanks to the mapping protocol API, the latter can be used to copy data
+-  between parsers).
+-
+-- 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.
+-
+-- Make the 'No module named' exception message from importlib consistent.
+-
+-- Issue #10443: Add the SSLContext.set_default_verify_paths() method.
+-
+-- Issue #10440: Support RUSAGE_THREAD as a constant in the resource module.
+-  Patch by Robert Collins.
+-
+-- Issue #10429: IMAP.starttls() stored the capabilities as bytes objects, rather
+-  than strings.
+-
+-C-API
+------
+-
+-- Issue #10557: Added a new API function, PyUnicode_TransformDecimalToASCII(),
+-  which transforms non-ASCII decimal digits in a Unicode string to their ASCII
+-  equivalents.
+-
+-- 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 by
+-  "-W").
+-
+-- Issue #10255: Fix reference leak in Py_InitializeEx().  Patch by Neil
+-  Schemenauer.
+-
+-- structseq.h is now included in Python.h.
+-
+-- Loosen PyArg_ValidateKeywordArguments to allow dict subclasses.
+-
+-Tests
+------
+-
+-- regrtest.py once again ensures the test directory is removed from sys.path
+-  when it is invoked directly as the __main__ module.
+-
+-- `python -m test` can be used to run the test suite as well as `python -m
+-  test.regrtest`.
+-
+-- 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.
+-
+-Documentation
+--------------
+-
+-- Issue #10299: List the built-in functions in a table in functions.rst.
+-
+-
+-What's New in Python 3.2 Alpha 4?
+-=================================
+-
+-*Release date: 13-Nov-2010*
+-
+-Core and Builtins
+------------------
+-
+-- Issue #10372: Import the warnings module only after the IO library is
+-  initialized, so as to avoid bootstrap issues with the '-W' option.
+-
+-- Issue #10293: Remove obsolete field in the PyMemoryView structure, unused
+-  undocumented value PyBUF_SHADOW, and strangely-looking code in
+-  PyMemoryView_GetContiguous.
+-
+-- Issue #6081: Add str.format_map(), similar to ``str.format(**mapping)``.
+-
+-- If FileIO.__init__ fails, close the file descriptor.
+-
+-- Issue #10221: dict.pop(k) now has a key error message that includes the
+-  missing key (same message d[k] returns for missing keys).
+-
+-- Issue #5437: A preallocated MemoryError instance should not keep traceback
+-  data (including local variables caught in the stack trace) alive infinitely.
+-
+-- Issue #10186: Fix the SyntaxError caret when the offset is equal to the length
+-  of the offending line.
+-
+-- Issue #10089: Add support for arbitrary -X options on the command line.  They
+-  can be retrieved through a new attribute ``sys._xoptions``.
+-
+-- Issue #4388: On Mac OS X, decode command line arguments from UTF-8, instead of
+-  the locale encoding.  If the LANG (and LC_ALL and LC_CTYPE) environment
+-  variable is not set, the locale encoding is ISO-8859-1, whereas most programs
+-  (including Python) expect UTF-8.  Python already uses UTF-8 for the filesystem
+-  encoding and to encode command line arguments on this OS.
+-
+-- Issue #9713, #10114: Parser functions (e.g. PyParser_ASTFromFile) expect
+-  filenames encoded to the filesystem encoding with the surrogateescape error
+-  handler (to support undecodable bytes), instead of UTF-8 in strict mode.
+-
+-- Issue #9997: Don't let the name "top" have special significance in scope
+-  resolution.
+-
+-- Issue #9862: Compensate for broken PIPE_BUF in AIX by hard coding its value as
+-  the default 512 when compiling on AIX.
+-
+-- Use locale encoding instead of UTF-8 to encode and decode filenames if
+-  Py_FileSystemDefaultEncoding is not set.
+-
+-- Issue #10095: fp_setreadl() doesn't reopen the file, instead reuse the file
+-  descriptor.
+-
+-- Issue #9418: Moved private string methods ``_formatter_parser`` and
+-  ``_formatter_field_name_split`` into a new ``_string`` module.
+-
+-- Issue #9992: Remove PYTHONFSENCODING environment variable.
+-
+-Library
+--------
+-
+-- Issue #12943: python -m tokenize support has been added to tokenize.
+-
+-- Issue #10465: fix broken delegating of attributes by gzip._PaddedFile.
+-
+-- Issue #10356: Decimal.__hash__(-1) should return -2.
+-
+-- Issue #1553375: logging: Added stack_info kwarg to display stack information.
+-
+-- Issue #5111: IPv6 Host in the Header is wrapped inside [ ]. Patch by Chandru.
+-
+-- Fix Fraction.__hash__ so that Fraction.__hash__(-1) is -2.  (See also issue
+-  #10356.)
+-
+-- Issue #4471: Add the IMAP.starttls() method to enable encryption on standard
+-  IMAP4 connections.  Original patch by Lorenzo M. Catucci.
+-
+-- Issue #1466065: Add 'validate' option to base64.b64decode to raise an error if
+-  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 *``.
+-
+-- Issue #4471: Properly shutdown socket in IMAP.shutdown().  Patch by Lorenzo
+-  M. Catucci.
+-
+-- Fix IMAP.login() to work properly.
+-
+-- Issue #9244: multiprocessing pool worker processes could terminate
+-  unexpectedly if the return value of a task could not be pickled.  Only the
+-  ``repr`` of such errors are now sent back, wrapped in an
+-  ``MaybeEncodingError`` exception.
+-
+-- Issue #9244: The ``apply_async()`` and ``map_async()`` methods of
+-  ``multiprocessing.Pool`` now accepts a ``error_callback`` argument.  This can
+-  be a callback with the signature ``callback(exc)``, which will be called if
+-  the target raises an exception.
+-
+-- Issue #10022: The dictionary returned by the ``getpeercert()`` method of SSL
+-  sockets now has additional items such as ``issuer`` and ``notBefore``.
+-
+-- ``usenetrc`` is now false by default for NNTP objects.
+-
+-- Issue #1926: Add support for NNTP over SSL on port 563, as well as STARTTLS.
+-  Patch by Andrew Vant.
+-
+-- Issue #10335: Add tokenize.open(), detect the file encoding using
+-  tokenize.detect_encoding() and open it in read only mode.
+-
+-- Issue #10321: Add support for binary data to smtplib.SMTP.sendmail, and a new
+-  method send_message to send an email.message.Message object.
+-
+-- Issue #6011: sysconfig and distutils.sysconfig use the surrogateescape error
+-  handler to parse the Makefile file.  Avoid a UnicodeDecodeError if the source
+-  code directory name contains a non-ASCII character and the locale encoding is
+-  ASCII.
+-
+-- Issue #10329: The trace module writes reports using the input Python script
+-  encoding, instead of the locale encoding.  Patch written by Alexander
+-  Belopolsky.
+-
+-- Issue #10126: Fix distutils' test_build when Python was built with
+-  --enable-shared.
+-
+-- Issue #9281: Prevent race condition with mkdir in distutils.  Patch by
+-  Arfrever.
+-
+-- Issue #10229: Fix caching error in gettext.
+-
+-- Issue #10252: Close file objects in a timely manner in distutils code and
+-  tests.  Patch by Brian Brazil, completed by Éric Araujo.
+-
+-- Issue #10180: Pickling file objects is now explicitly forbidden, since
+-  unpickling them produced nonsensical results.
+-
+-- Issue #10311: The signal module now restores errno before returning from its
+-  low-level signal handler.  Patch by Hallvard B Furuseth.
+-
+-- Issue #10282: Add a ``nntp_implementation`` attribute to NNTP objects.
+-
+-- Issue #10283: Add a ``group_pattern`` argument to NNTP.list().
+-
+-- Issue #10155: Add IISCGIHandler to wsgiref.handlers to support IIS CGI
+-  environment better, and to correct unicode environment values for WSGI 1.0.1.
+-
+-- Issue #10281: nntplib now returns None for absent fields in the OVER/XOVER
+-  response, instead of raising an exception.
+-
+-- wsgiref now implements and validates PEP 3333, rather than an experimental
+-  extension of PEP 333.  (Note: earlier versions of Python 3.x may have
+-  incorrectly validated some non-compliant applications as WSGI compliant; if
+-  your app validates with Python <3.2b1+, but not on this version, it is likely
+-  the case that your app was not compliant.)
+-
+-- Issue #10280: NNTP.nntp_version should reflect the highest version advertised
+-  by the server.
+-
+-- Issue #10184: Touch directories only once when extracting a tarfile.
+-
+-- Issue #10199: New package, ``turtledemo`` now contains selected demo scripts
+-  that were formerly found under Demo/turtle.
+-
+-- Issue #10265: Close file objects explicitly in sunau.  Patch by Brian Brazil.
+-
+-- Issue #10266: uu.decode didn't close in_file explicitly when it was given as a
+-  filename.  Patch by Brian Brazil.
+-
+-- Issue #10110: Queue objects didn't recognize full queues when the maxsize
+-  parameter had been reduced.
+-
+-- Issue #10160: Speed up operator.attrgetter.  Patch by Christos Georgiou.
+-
+-- logging: Added style option to basicConfig() to allow %, {} or $-formatting.
+-
+-- Issue #5729: json.dumps() now supports using a string such as '\t' for
+-  pretty-printing multilevel objects.
+-
+-- Issue #10253: FileIO leaks a file descriptor when trying to open a file for
+-  append that isn't seekable.  Patch by Brian Brazil.
+-
+-- Support context manager protocol for file-like objects returned by mailbox
+-  ``get_file()`` methods.
+-
+-- Issue #10246: uu.encode didn't close file objects explicitly when filenames
+-  were given to it.  Patch by Brian Brazil.
+-
+-- Issue #10198: fix duplicate header written to wave files when writeframes() is
+-  called without data.
+-
+-- Close file objects in modulefinder in a timely manner.
+-
+-- Close a io.TextIOWrapper object in email.parser in a timely manner.
+-
+-- Close a file object in distutils.sysconfig in a timely manner.
+-
+-- Close a file object in pkgutil in a timely manner.
+-
+-- Issue #10233: Close file objects in a timely manner in the tarfile module and
+-  its test suite.
+-
+-- Issue #10093: ResourceWarnings are now issued when files and sockets are
+-  deallocated without explicit closing.  These warnings are silenced by default,
+-  except in pydebug mode.
+-
+-- tarfile.py: Add support for all missing variants of the GNU sparse extensions
+-  and create files with holes when extracting sparse members.
+-
+-- Issue #10218: Return timeout status from ``Condition.wait`` in threading.
+-
+-- Issue #7351: Add ``zipfile.BadZipFile`` spelling of the exception name and
+-  deprecate the old name ``zipfile.BadZipfile``.
+-
+-- Issue #5027: The standard ``xml`` namespace is now understood by
+-  xml.sax.saxutils.XMLGenerator as being bound to
+-  http://www.w3.org/XML/1998/namespace.  Patch by Troy J. Farrell.
+-
+-- Issue #5975: Add csv.unix_dialect class.
+-
+-- Issue #7761: telnetlib.interact failures on Windows fixed.
+-
+-- logging: Added style option to Formatter to allow %, {} or $-formatting.
+-
+-- Issue #5178: Added tempfile.TemporaryDirectory class that can be used as a
+-  context manager.
+-
+-- Issue #1349106: Generator (and BytesGenerator) flatten method and Header
+-  encode method now support a 'linesep' argument.
+-
+-- Issue #5639: Add a *server_hostname* argument to ``SSLContext.wrap_socket`` in
+-  order to support the TLS SNI extension.  ``HTTPSConnection`` and ``urlopen()``
+-  also use this argument, so that HTTPS virtual hosts are now supported.
+-
+-- Issue #10166: Avoid recursion in pstats Stats.add() for many stats items.
+-
+-- Issue #10163: Skip unreadable registry keys during mimetypes initialization.
+-
+-- logging: Made StreamHandler terminator configurable.
+-
+-- logging: Allowed filters to be just callables.
+-
+-- logging: Added tests for _logRecordClass changes.
+-
+-- Issue #10092: Properly reset locale in calendar.Locale*Calendar classes.
+-
+-- logging: Added _logRecordClass, getLogRecordClass, setLogRecordClass to
+-  increase flexibility of LogRecord creation.
+-
+-- Issue #5117: Case normalization was needed on ntpath.relpath().  Also fixed
+-  root directory issue on posixpath.relpath().  (Ported working fixes from
+-  ntpath.)
+-
+-- Issue #1343: xml.sax.saxutils.XMLGenerator now has an option
+-  short_empty_elements to direct it to use self-closing tags when appropriate.
+-
+-- Issue #9807 (part 1): Expose the ABI flags in sys.abiflags.  Add --abiflags
+-  switch to python-config for command line access.
+-
+-- Issue #6098: Don't claim DOM level 3 conformance in minidom.
+-
+-- Issue #5762: Fix AttributeError raised by ``xml.dom.minidom`` when an empty
+-  XML namespace attribute is encountered.
+-
+-- Issue #2830: Add the ``html.escape()`` function, which quotes all problematic
+-  characters by default.  Deprecate ``cgi.escape()``.
+-
+-- Issue #9409: Fix the regex to match all kind of filenames, for interactive
+-  debugging in doctests.
+-
+-- Issue #9183: ``datetime.timezone(datetime.timedelta(0))`` will now return the
+-  same instance as ``datetime.timezone.utc``.
+-
+-- Issue #7523: Add SOCK_CLOEXEC and SOCK_NONBLOCK to the socket module, where
+-  supported by the system.  Patch by Nikita Vetoshkin.
+-
+-- Issue #10063: file:// scheme will stop accessing remote hosts via ftp
+-  protocol. file:// urls had fallback to access remote hosts via ftp. This was
+-  not correct, change is made to raise a URLError when a remote host is tried to
+-  access via file:// scheme.
+-
+-- Issue #1710703: Write structures for an empty ZIP archive when a ZipFile is
+-  created in modes 'a' or 'w' and then closed without adding any files. Raise
+-  BadZipfile (rather than IOError) when opening small non-ZIP files.
+-
+-- Issue #10041: The signature of optional arguments in socket.makefile() didn't
+-  match that of io.open(), and they also didn't get forwarded properly to
+-  TextIOWrapper in text mode.  Patch by Kai Zhu.
+-
+-- Issue #9003: http.client.HTTPSConnection, urllib.request.HTTPSHandler and
+-  urllib.request.urlopen now take optional arguments to allow for server
+-  certificate checking, as recommended in public uses of HTTPS.
+-
+-- Issue #6612: Fix site and sysconfig to catch os.getcwd() error, eg. if the
+-  current directory was deleted. Patch written by W. Trevor King.
+-
+-- Issue #3873: Speed up unpickling from file objects that have a peek() method.
+-
+-- Issue #10075: Add a session_stats() method to SSLContext objects.
+-
+-- Issue #9948: Fixed problem of losing filename case information.
+-
+-Extension Modules
+------------------
+-
+-- Issue #5109: array.array constructor will now use fast code when
+-  initial data is provided in an array object with correct type.
+-
+-- Issue #6317: Now winsound.PlaySound only accepts unicode.
+-
+-- Issue #6317: Now winsound.PlaySound can accept non ascii filename.
+-
+-- Issue #9377: Use Unicode API for gethostname on Windows.
+-
+-- Issue #10143: Update "os.pathconf" values.
+-
+-- Issue #6518: Support context manager protcol for ossaudiodev types.
+-
+-- Issue #678250: Make mmap flush a noop on ACCESS_READ and ACCESS_COPY.
+-
+-- Issue #9054: Fix a crash occurring when using the pyexpat module with expat
+-  version 2.0.1.
+-
+-- Issue #5355: Provide mappings from Expat error numbers to string descriptions
+-  and backwards, in order to actually make it possible to analyze error codes
+-  provided by ExpatError.
+-
+-- The Unicode database was updated to 6.0.0.
+-
+-C-API
+------
+-
+-- Issue #10288: The deprecated family of "char"-handling macros
+-  (ISLOWER()/ISUPPER()/etc) have now been removed: use Py_ISLOWER() etc instead.
+-
+-- Issue #9778: Hash values are now always the size of pointers. A new Py_hash_t
+-  type has been introduced.
+-
+-Tools/Demos
+------------
+-
+-- Issue #10117: Tools/scripts/reindent.py now accepts source files that use
+-  encoding other than ASCII or UTF-8.  Source encoding is preserved when
+-  reindented code is written to a file.
+-
+-- Issue #7287: Demo/imputil/knee.py was removed.
+-
+-Tests
+------
+-
+-- Issue #3699: Fix test_bigaddrspace and extend it to test bytestrings as well
+-  as unicode strings.  Initial patch by Sandro Tosi.
+-
+-- Issue #10294: Remove dead code form test_unicode_file.
+-
+-- Issue #10123: Don't use non-ascii filenames in test_doctest tests. Add a new
+-  test specific to unicode (non-ascii name and filename).
+-
+-Build
+------
+-
+-- Issue #10268: Add a --enable-loadable-sqlite-extensions option to configure.
+-
+-- Issue #8852: Allow the socket module to build on OpenSolaris.
+-
+-- Drop -OPT:Olimit compiler option.
+-
+-- Issue #10094: Use versioned .so files on GNU/kfreeBSD and the GNU Hurd.
+-
+-- Accept Oracle Berkeley DB 5.0 and 5.1 as backend for the dbm extension.
+-
+-- Issue #7473: avoid link errors when building a framework with a different set
+-  of architectures than the one that is currently installed.
+-
+-
+-What's New in Python 3.2 Alpha 3?
+-=================================
+-
+-*Release date: 09-Oct-2010*
+-
+-Core and Builtins
+------------------
+-
+-- Issue #10068: Global objects which have reference cycles with their module's
+-  dict are now cleared again. This causes issue #7140 to appear again.
+-
+-- Issue #9738: Document PyErr_SetString() and PyErr_SetFromErrnoWithFilename()
+-  encodings.
+-
+-- ast.literal_eval() can now handle negative numbers.  It is also a little more
+-  liberal in what it accepts without compromising the safety of the evaluation.
+-  For example, 3j+4 and 3+4+5 are both accepted.
+-
+-- Issue #10006: type.__abstractmethods__ now raises an AttributeError.  As a
+-  result metaclasses can now be ABCs (see #9533).
+-
+-- Issue #8670: ctypes.c_wchar supports non-BMP characters with 32 bits wchar_t.
+-
+-- Issue #8670: PyUnicode_AsWideChar() and PyUnicode_AsWideCharString() replace
+-  UTF-16 surrogate pairs by single non-BMP characters for 16 bits Py_UNICODE and
+-  32 bits wchar_t (eg. Linux in narrow build).
+-
+-- Issue #10003: Allow handling of SIGBREAK on Windows. Fixes a regression
+-  introduced by issue #9324.
+-
+-- Issue #9979: Create function PyUnicode_AsWideCharString().
+-
+-- Issue #7397: Mention that importlib.import_module() is probably what someone
+-  really wants to be using in __import__'s docstring.
+-
+-- Issue #8521: Allow CreateKeyEx, OpenKeyEx, and DeleteKeyEx functions of winreg
+-  to use named arguments.
+-
+-- Issue #9930: Remove bogus subtype check that was causing (e.g.)
+-  float.__rdiv__(2.0, 3) to return NotImplemented instead of the expected 1.5.
+-
+-- Issue #9808: Implement os.getlogin for Windows. Patch by Jon Anglin.
+-
+-- Issue #9901: Destroying the GIL in Py_Finalize() can fail if some other
+-  threads are still running.  Instead, reinitialize the GIL on a second call to
+-  Py_Initialize().
+-
+-- All SyntaxErrors now have a column offset and therefore a caret when the error
+-  is printed.
+-
+-- Issue #9252: PyImport_Import no longer uses a fromlist hack to return the
+-  module that was imported, but instead gets the module from sys.modules.
+-
+-- Issue #9213: The range type_items now provides index() and count() methods, to
+-  conform to the Sequence ABC.  Patch by Daniel Urban and Daniel Stutzbach.
+-
+-- Issue #7994: Issue a PendingDeprecationWarning if object.__format__ is called
+-  with a non-empty format string.  This is an effort to future-proof user
+-  code. If a derived class does not currently implement __format__ but later
+-  adds its own __format__, it would most likely break user code that had
+-  supplied a format string.  This will be changed to a DeprecationWaring in
+-  Python 3.3 and it will be an error in Python 3.4.
+-
+-- Issue #9828: Destroy the GIL in Py_Finalize(), so that it gets properly
+-  re-created on a subsequent call to Py_Initialize().  The problem (a crash)
+-  wouldn't appear in 3.1 or 2.7 where the GIL's structure is more trivial.
+-
+-- Issue #9210: Configure option --with-wctype-functions was removed.  Using the
+-  functions from the libc caused the methods .upper() and lower() to become
+-  locale aware and created subtly wrong results.
+-
+-- Issue #9738: PyUnicode_FromFormat() and PyErr_Format() raise an error on a
+-  non-ASCII byte in the format string.
+-
+-- Issue #4617: Previously it was illegal to delete a name from the local
+-  namespace if it occurs as a free variable in a nested block.  This limitation
+-  of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).
+-
+-- Issue #9804: ascii() now always represents unicode surrogate pairs as a single
+-  ``\UXXXXXXXX``, regardless of whether the character is printable or not.
+-  Also, the "backslashreplace" error handler now joins surrogate pairs into a
+-  single character on UCS-2 builds.
+-
+-- Issue #9757: memoryview objects get a release() method to release the
+-  underlying buffer (previously this was only done when deallocating the
+-  memoryview), and gain support for the context management protocol.
+-
+-- Issue #9797: pystate.c wrongly assumed that zero couldn't be a valid
+-  thread-local storage key.
+-
+-Library
+--------
+-
+-- Issue #2236: distutils' mkpath ignored the mode parameter.
+-
+-- Fix typo in one sdist option (medata-check).
+-
+-- Issue #9199: Fix incorrect use of distutils.cmd.Command.announce.
+-
+-- Issue #1718574: Fix options that were supposed to accept arguments but did
+-  not in build_clib.
+-
+-- Issue #9437: Fix building C extensions with non-default LDFLAGS.
+-
+-- Issue #4661: email can now parse bytes input and generate either converted
+-  7bit output or bytes output.  Email version bumped to 5.1.0.
+-
+-- Issue #1589: Add ssl.match_hostname(), to help implement server identity
+-  verification for higher-level protocols.
+-
+-- Issue #9759: GzipFile now raises ValueError when an operation is attempted
+-  after the file is closed.  Patch by Jeffrey Finkelstein.
+-
+-- Issue #9042: Fix interaction of custom translation classes and caching in
+-  gettext.
+-
+-- Issue #6706: asyncore.dispatcher now provides a handle_accepted() method
+-  returning a (sock, addr) pair which is called when a connection has been
+-  established with a new remote endpoint.  This is supposed to be used as a
+-  replacement for old handle_accept() and avoids the user to call accept()
+-  directly.
+-
+-- Issue #9065: tarfile no longer uses "root" as the default for the uname and
+-  gname field.
+-
+-- Issue #8980: Fixed a failure in distutils.command check that was shadowed by
+-  an environment that does not have docutils.  Patch by Arfrever.
+-
+-- Issue #1050268: parseaddr now correctly quotes double quote and backslash
+-  characters that appear inside quoted strings in email addresses.
+-
+-- Issue #10004: quoprimime no longer generates a traceback when confronted with
+-  invalid characters after '=' in a Q-encoded word.
+-
+-- Issue #1491: BaseHTTPServer nows send a ``100 Continue`` response before
+-  sending a 200 OK for the Expect: 100-continue request header.
+-
+-- Issue #9360: Cleanup and improvements to the nntplib module.  The API now
+-  conforms to the philosophy of bytes and unicode separation in Python 3.  A
+-  test suite has also been added.
+-
+-- Issue #9962: GzipFile now has the peek() method.
+-
+-- Issue #9090: When a socket with a timeout fails with EWOULDBLOCK or EAGAIN,
+-  retry the select() loop instead of bailing out.  This is because select() can
+-  incorrectly report a socket as ready for reading (for example, if it received
+-  some data with an invalid checksum).
+-
+-- Issue #3612: Added new types to ctypes.wintypes. (CHAR and pointers)
+-
+-- Issue #9950: Fix socket.sendall() crash or misbehaviour when a signal is
+-  received.  Now sendall() properly calls signal handlers if necessary, and
+-  retries sending if these returned successfully, including on sockets with a
+-  timeout.
+-
+-- Issue #9947: logging: Fixed locking bug in stopListening.
+-
+-- Issue #9945: logging: Fixed locking bugs in addHandler/removeHandler.
+-
+-- Issue #9936: Fixed executable lines' search in the trace module.
+-
+-- Issue #9790: Rework imports necessary for samefile and sameopenfile
+-  in ntpath.
+-
+-- Issue #9928: Properly initialize the types exported by the bz2 module.
+-
+-- Issue #1675951: Allow GzipFile to work with unseekable file objects.  Patch by
+-  Florian Festi.
+-
+-- Logging: Added QueueListener class to facilitate logging usage for
+-  performance-critical threads.
+-
+-- Issue #9916: Add some missing errno symbols.
+-
+-- Issue #9877: Expose sysconfig.get_makefile_filename()
+-
+-- logging: Added hasHandlers() method to Logger and LoggerAdapter.
+-
+-- Issue #9908: Fix os.stat() on bytes paths under Windows 7.
+-
+-- Issue #2643: msync() is not called anymore when deallocating an open mmap
+-  object, only munmap().
+-
+-- logging: Changed LoggerAdapter implementation internally, to make it easier to
+-  subclass in a useful way.
+-
+-- logging: hasHandlers method was added to Logger, and isEnabledFor,
+-  getEffectiveLevel, hasHandlers and setLevel were added to LoggerAdapter.
+-  LoggerAdapter was introduced into the unit tests for logging.
+-
+-- Issue #1686: Fix string.Template when overriding the pattern attribute.
+-
+-- Issue #9854: SocketIO objects now observe the RawIOBase interface in
+-  non-blocking mode: they return None when an operation would block (instead of
+-  raising an exception).
+-
+-- Issue #1730136: Fix the comparison between a tk.font.Font and an object of
+-  another kind.
+-
+-- Issue #9441: logging has better coverage for rotating file handlers.
+-
+-- Issue #9865: collections.OrderedDict now has a __sizeof__ method.
+-
+-- Issue #9854: The default read() implementation in io.RawIOBase now handles
+-  non-blocking readinto() returning None correctly.
+-
+-- Issue #1552: socket.socketpair() now returns regular socket.socket objects
+-  supporting the whole socket API (rather than the "raw" _socket.socket
+-  objects).
+-
+-- Issue #9853: Fix the signature of SSLSocket.recvfrom() and SSLSocket.sendto()
+-  to match the corresponding socket methods.
+-
+-- Issue #9840: Added a decorator to reprlib for wrapping __repr__ methods to make
+-  them handle recursive calls within the same thread.
+-
+-- logging: Enhanced HTTPHandler with secure and credentials initializers.
+-
+-- Issue #767645: Set os.path.supports_unicode_filenames to True on Mac OS X.
+-
+-- Issue #9837: The read() method of ZipExtFile objects (as returned by
+-  ZipFile.open()) could return more bytes than requested.
+-
+-- Issue #9826: OrderedDict.__repr__ can now handle self-referential values:
+-  d['x'] = d.
+-
+-- Issue #9825: Using __del__ in the definition of collections.OrderedDict made
+-  it possible for the user to create self-referencing ordered dictionaries which
+-  become permanently uncollectable GC garbage.  Reinstated the Python 3.1
+-  approach of using weakref proxies so that reference cycles never get created
+-  in the first place.
+-
+-- Issue #9579, #9580: Fix os.confstr() for value longer than 255 bytes and
+-  encode the value with filesystem encoding and surrogateescape (instead of
+-  utf-8 in strict mode) . Patch written by David Watson.
+-
+-- Issue #9632: Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
+-  environment variable to set the filesystem encoding at Python startup.
+-  sys.setfilesystemencoding() creates inconsistencies because it is unable to
+-  reencode all filenames in all objects.
+-
+-- Issue #9410: Various optimizations to the pickle module, leading to speedups
+-  up to 4x (depending on the benchmark).  Mostly ported from Unladen Swallow;
+-  initial patch by Alexandre Vassalotti.
+-
+-- The pprint module now supports printing OrderedDicts in their given order
+-  (formerly, it would sort the keys).
+-
+-- Logging: Added QueueHandler class to facilitate logging usage with
+-  multiprocessing.
+-
+-- Issue #9707: Rewritten reference implementation of threading.local which is
+-  friendlier towards reference cycles.  This change is not normally visible
+-  since an optimized C implementation (_thread._local) is used instead.
+-
+-- Issue #6394: os.getppid() is now supported on Windows.  Note that it will
+-  still return the id of the parent process after it has exited.  This process
+-  id may even have been reused by another unrelated process.
+-
+-- Issue #9792: In case of connection failure, socket.create_connection() would
+-  swallow the exception and raise a new one, making it impossible to fetch the
+-  original errno, or to filter timeout errors.  Now the original error is
+-  re-raised.
+-
+-- Issue #9758: When fcntl.ioctl() was called with mutable_flag set to True, and
+-  the passed buffer was exactly 1024 bytes long, the buffer wouldn't be updated
+-  back after the system call.  Original patch by Brian Brazil.
+-
+-- Updates to the random module:
+-
+-  * Document which parts of the module are guaranteed to stay the same across
+-    versions and which parts are subject to change.
+-
+-  * Update the seed() method to use all of the bits in a string instead of just
+-    the hash value.  This makes better use of the seed value and assures the
+-    seeding is platform independent.  Issue #7889.
+-
+-  * Improved the random()-->integer algorithm used in choice(), shuffle(),
+-    sample(), randrange(), and randint().  Formerly, it used int(n*random())
+-    which has a slight bias whenever n is not a power of two.  Issue #9025.
+-
+-  * Improved documentation of arguments to randrange().  Issue #9379.
+-
+-- collections.OrderedDict now supports a new method for repositioning keys to
+-  either end.
+-
+-- Issue #9754: Similarly to assertRaises and assertRaisesRegexp, unittest test
+-  cases now also have assertWarns and assertWarnsRegexp methods to check that a
+-  given warning type was triggered by the code under test.
+-
+-- Issue #5506: BytesIO objects now have a getbuffer() method exporting a view of
+-  their contents without duplicating them.  The view is both readable and
+-  writable.
+-
+-- Issue #7566: Implement os.path.sameopenfile for Windows.
+-
+-- Issue #9293: I/O streams now raise ``io.UnsupportedOperation`` when an
+-  unsupported operation is attempted (for example, writing to a file open only
+-  for reading).
+-
+-- hashlib has two new constant attributes: algorithms_guaranteed and
+-  algorithms_avaiable that respectively list the names of hash algorithms
+-  guaranteed to exist in all Python implementations and the names of hash
+-  algorithms available in the current process.
+-
+-- A new package ``concurrent.futures`` as defined by PEP 3148.
+-
+-C-API
+------
+-
+-- Add PyErr_SyntaxLocationEx, which supports passing a column offset.
+-
+-- Issue #9834: Don't segfault in PySequence_GetSlice, PySequence_SetSlice, or
+-  PySequence_DelSlice when the object doesn't have any mapping operations
+-  defined.
+-
+-Tools/Demos
+------------
+-
+-- Issue #9188: The gdb extension now handles correctly narrow (UCS2) as well as
+-  wide (UCS4) unicode builds for both the host interpreter (embedded inside gdb)
+-  and the interpreter under test.
+-
+-Tests
+------
+-
+-- Issue #9308: Added tests for importing encoded modules that do not
+-  depend on specific stdlib modules being encoded in a certain way.
+-
+-- Issue #1051: Add a script (Lib/test/make_ssl_certs.py) to generate the custom
+-  certificate and private key files used by SSL-related certs.
+-
+-- Issue #9978: Wait until subprocess completes initialization. (Win32KillTests
+-  in test_os)
+-
+-- Issue #7110: regrtest now sends test failure reports and single-failure
+-  tracebacks to stderr rather than stdout.
+-
+-- Issue #9628: fix runtests.sh -x option so more than one test can be excluded.
+-
+-- Issue #9899: Fix test_tkinter.test_font on various platforms.  Patch by Ned
+-  Deily.
+-
+-- Issue #9894: Do not hardcode ENOENT in test_subprocess.
+-
+-- Issue #9315: Added tests for the trace module.  Patch by Eli Bendersky.
+-
+-- Issue #9323: Make test.regrtest.__file__ absolute, this was not always the
+-  case when running profile or trace, for example.
+-
+-- Issue #9568: Fix test_urllib2_localnet on OS X 10.3.
+-
+-Build
+------
+-
+-- Issue #10062: Allow building on platforms which do not have sem_timedwait.
+-
+-- Issue #10054: Some platforms provide uintptr_t in inttypes.h.  Patch by Akira
+-  Kitada.
+-
+-- Issue #10055: Make json C89-compliant in UCS4 mode.
+-
+-- Issue #9552: Avoid unnecessary rebuild of OpenSSL. (Windows)
+-
+-- Issue #1633863: Don't ignore $CC under AIX.
+-
+-- Issue #9810: Compile bzip2 source files in Python's project file directly. It
+-  used to be built with bzip2's makefile.
+-
+-- Issue #9848: Stopping trying to build _weakref in setup.py as it is a built-in
+-  module.
+-
+-- Issue #9806: python-config now has an ``--extension-suffix`` option that
+-  outputs the suffix for dynamic libraries including the ABI version name
+-  defined by PEP 3149.
+-
+-- Issue #941346: Improve the build process under AIX and allow Python to be
+-  built as a shared library.  Patch by Sébastien Sablé.
+-
+-- Issue #4026: Make the fcntl extension build under AIX.  Patch by Sébastien
+-  Sablé.
+-
+-- Issue #9701: The MacOSX installer can patch the shell profile to ensure that
+-  the "bin" directory inside the framework is on the shell's search path. This
+-  feature now also supports the ZSH shell.
+-
+-
+-What's New in Python 3.2 Alpha 2?
+-=================================
+-
+-*Release date: 05-Sep-2010*
+-
+-Core and Builtins
+------------------
+-
+-- Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced by
+-  the new (and simpler) DUP_TOP_TWO.  Performance isn't changed, but our
+-  bytecode is a bit simplified.  Patch by Demur Rumed.
+-
+-- Issue #9766: Rename poorly named variables exposed by _warnings to prevent
+-  confusion with the proper variables names from 'warnings' itself.
+-
+-- Issue #9212: dict_keys and dict_items now provide the isdisjoint() method, to
+-  conform to the Set ABC.  Patch by Daniel Urban.
+-
+-- Issue #9737: Fix a crash when trying to delete a slice or an item from a
+-  memoryview object.
+-
+-- Issue #9549: sys.setdefaultencoding() and PyUnicode_SetDefaultEncoding() are
+-  now removed, since their effect was inexistent in 3.x (the default encoding is
+-  hardcoded to utf-8 and cannot be changed).
+-
+-- Issue #7415: PyUnicode_FromEncodedObject() now uses the new buffer API
+-  properly.  Patch by Stefan Behnel.
+-
+-- Issue #5553: The Py_LOCAL_INLINE macro now results in inlining on most
+-  platforms.  Previously, it inlined only when using Microsoft Visual C.
+-
+-- Issue #9712: Fix tokenize on identifiers that start with non-ascii names.
+-
+-- Issue #9688: __basicsize__ and __itemsize__ must be accessed as Py_ssize_t.
+-
+-- Issue #9684: Added a definition for SIZEOF_WCHAR_T to PC/pyconfig.h, to match
+-  the pyconfig.h generated by configure on other systems.
+-
+-- Issue #9666: Only catch AttributeError in hasattr(). All other exceptions that
+-  occur during attribute lookup are now propagated to the caller.
+-
+-- Issue #8622: Add PYTHONFSENCODING environment variable to override the
+-  filesystem encoding.
+-
+-- Issue #5127: The C functions that access the Unicode Database now accept and
+-  return characters from the full Unicode range, even on narrow unicode builds
+-  (Py_UNICODE_TOLOWER, Py_UNICODE_ISDECIMAL, and others).  A visible difference
+-  in Python is that unicodedata.numeric() now returns the correct value for
+-  large code points, and repr() may consider more characters as printable.
+-
+-- Issue #9425: Create PyModule_GetFilenameObject() function to get the filename
+-  as a unicode object, instead of a byte string. Function needed to support
+-  unencodable filenames. Deprecate PyModule_GetFilename() in favor on the new
+-  function.
+-
+-- Issue #8063: Call _PyGILState_Init() earlier in Py_InitializeEx().
+-
+-- Issue #9612: The set object is now 64-bit clean under Windows.
+-
+-- Issue #8202: sys.argv[0] is now set to '-m' instead of '-c' when searching for
+-  the module file to be executed with the -m command line option.
+-
+-- Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr() functions to
+-  write a message formatted by PyUnicode_FromFormatV() to sys.stdout and
+-  sys.stderr.
+-
+-- Issue #9542: Create PyUnicode_FSDecoder() function, a ParseTuple converter:
+-  decode bytes objects to unicode using PyUnicode_DecodeFSDefaultAndSize(); str
+-  objects are output as-is.
+-
+-- Issue #9203: Computed gotos are now enabled by default on supported compilers
+-  (which are detected by the configure script).  They can still be disable
+-  selectively by specifying --without-computed-gotos.
+-
+-- Issue #9425: Create PyErr_WarnFormat() function, similar to PyErr_WarnEx() but
+-  use PyUnicode_FromFormatV() to format the warning message.
+-
+-- Issue #8530: Prevent stringlib fastsearch from reading beyond the front of an
+-  array.
+-
+-- Issue #5319: Print an error if flushing stdout fails at interpreter shutdown.
+-
+-- Issue #9337: The str() of a float or complex number is now identical to its
+-  repr().
+-
+-- Issue #9416: Fix some issues with complex formatting where the output with no
+-  type specifier failed to match the str output:
+-
+-    - format(complex(-0.0, 2.0), '-') omitted the real part from the output,
+-    - format(complex(0.0, 2.0), '-') included a sign and parentheses.
+-
+-Extension Modules
+------------------
+-
+-- Issue #8013: time.asctime and time.ctime no longer call system
+-  asctime and ctime functions.  The year range for time.asctime is now
+-  1900 through maxint.  The range for time.ctime is the same as for
+-  time.localtime.  The string produced by these functions is longer
+-  than 24 characters when year is greater than 9999.
+-
+-- Issue #6608: time.asctime is now checking struct tm fields its input
+-  before passing it to the system asctime.  Patch by MunSic Jeong.
+-
+-- Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
+-  descriptor is provided.  Patch by Pascal Chambon.
+-
+-- Issue #7736: Release the GIL around calls to opendir() and closedir() in the
+-  posix module.  Patch by Marcin Bachry.
+-
+-- Issue #4835: make PyLong_FromSocket_t() and PyLong_AsSocket_t() private to the
+-  socket module, and fix the width of socket descriptors to be correctly
+-  detected under 64-bit Windows.
+-
+-- Issue #1027206: Support IDNA in gethostbyname, gethostbyname_ex, getaddrinfo
+-  and gethostbyaddr.  getnameinfo is now restricted to numeric addresses as
+-  input.
+-
+-- Issue #9214: Set operations on a KeysView or ItemsView in collections now
+-  correctly return a set.  Patch by Eli Bendersky.
+-
+-- Issue #5737: Add Solaris-specific mnemonics in the errno module.  Patch by
+-  Matthew Ahrens.
+-
+-- Restore GIL in nis_cat in case of error. Decode NIS data to fs encoding, using
+-  the surrogate error handler.
+-
+-- Issue #665761: ``functools.reduce()`` will no longer mask exceptions other
+-  than ``TypeError`` raised by the iterator argument.
+-
+-- Issue #9570: Use PEP 383 decoding in os.mknod and os.mkfifo.
+-
+-- Issue #6915: Under Windows, os.listdir() didn't release the Global Interpreter
+-  Lock around all system calls.  Original patch by Ryan Kelly.
+-
+-- Issue #8524: Add a detach() method to socket objects, so as to put the socket
+-  into the closed state without closing the underlying file descriptor.
+-
+-- Issue #477863: Emit a ResourceWarning at shutdown if gc.garbage is not empty.
+-
+-- Issue #6869: Fix a refcount problem in the _ctypes extension.
+-
+-- Issue #5504: ctypes should now work with systems where mmap can't be
+-  PROT_WRITE and PROT_EXEC.
+-
+-- Issue #9507: Named tuple repr will now automatically display the right name in
+-  a tuple subclass.
+-
+-- Issue #9324: Add parameter validation to signal.signal on Windows in order to
+-  prevent crashes.
+-
+-- Issue #9526: Remove some outdated (int) casts that were preventing the array
+-  module from working correctly with arrays of more than 2**31 elements.
+-
+-- Fix memory leak in ssl._ssl._test_decode_cert.
+-
+-- Issue #8065: Fix memory leak in readline module (from failure to free the
+-  result of history_get_history_state()).
+-
+-- Issue #9450: Fix memory leak in readline.replace_history_item and
+-  readline.remove_history_item for readline version >= 5.0.
+-
+-- Issue #8105: Validate file descriptor passed to mmap.mmap on Windows.
+-
+-- Issue #8046: Add context manager protocol support and .closed property to mmap
+-  objects.
+-
+-Library
+--------
+-
+-- Issue #7451: Improve decoding performance of JSON objects, and reduce the
+-  memory consumption of said decoded objects when they use the same strings as
+-  keys.
+-
+-- Issue #1100562: Fix deep-copying of objects derived from the list and dict
+-  types.  Patch by Michele Orrù and Björn Lindqvist.
+-
+-- Issue #9753: Fixed socket.dup, which did not always work correctly on Windows.
+-
+-- Issue #9421: Made the get<type> methods consistently accept the vars and
+-  default arguments on all parser classes.
+-
+-- Issue #7005: Fixed output of None values for RawConfigParser.write and
+-  ConfigParser.write.
+-
+-- Issue #8990: array.fromstring() and array.tostring() get renamed to
+-  frombytes() and tobytes(), respectively, to avoid confusion.  Furthermore,
+-  array.frombytes(), array.extend() as well as the array.array() constructor now
+-  accept bytearray objects.  Patch by Thomas Jollans.
+-
+-- Issue #808164: Fixed socket.close to avoid references to globals, to avoid
+-  issues when socket.close is called from a __del__ method.
+-
+-- Issue #9706: ssl module provides a better error handling in various
+-  circumstances.
+-
+-- Issue #1868: Eliminate subtle timing issues in thread-local objects by getting
+-  rid of the cached copy of thread-local attribute dictionary.
+-
+-- Issue #1512791: In setframerate() in the wave module, non-integral frame rates
+-  are rounded to the nearest integer.
+-
+-- Issue #8797: urllib2 does a retry for Basic Authentication failure instead of
+-  falling into recursion.
+-
+-- Issue #1194222: email.utils.parsedate now returns RFC2822 compliant four
+-  character years even if the message contains RFC822 two character years.
+-
+-- Issue #8750: Fixed MutableSet's methods to correctly handle reflexive
+-  operations on its self, namely x -= x and x ^= x.
+-
+-- Issue #9129: smtpd.py is vulnerable to DoS attacks deriving from missing error
+-  handling when accepting a new connection.
+-
+-- Issue #9601: ftplib now provides a workaround for non-compliant
+-  implementations such as IIS shipped with Windows server 2003 returning invalid
+-  response codes for MKD and PWD commands.
+-
+-- Issue #658749: asyncore's connect() method now correctly interprets winsock
+-  errors.
+-
+-- Issue #9501: Fixed logging regressions in cleanup code.
+-
+-- Fix functools.total_ordering() to skip methods inherited from object.
+-
+-- Issue #9572: Importlib should not raise an exception if a directory it thought
+-  it needed to create was done concurrently by another process.
+-
+-- Issue #9617: Signals received during a low-level write operation aren't
+-  ignored by the buffered IO layer anymore.
+-
+-- Issue #843590: Make "macintosh" an alias to the "mac_roman" encoding.
+-
+-- Create os.fsdecode(): decode from the filesystem encoding with surrogateescape
+-  error handler, or strict error handler on Windows.
+-
+-- Issue #3488: Provide convenient shorthand functions ``gzip.compress`` and
+-  ``gzip.decompress``.  Original patch by Anand B. Pillai.
+-
+-- Issue #8807: poplib.POP3_SSL class now accepts a context parameter, which is a
+-  ssl.SSLContext object allowing bundling SSL configuration options,
+-  certificates and private keys into a single (potentially long-lived)
+-  structure.
+-
+-- Issue #8866: parameters passed to socket.getaddrinfo can now be specified as
+-  single keyword arguments.
+-
+-- Address XXX comment in dis.py by having inspect.py prefer to reuse the dis.py
+-  compiler flag values over defining its own.
+-
+-- Issue #9147: Added dis.code_info() which is similar to show_code() but returns
+-  formatted code information in a string rather than displaying on screen.
+-
+-- Issue #9567: functools.update_wrapper now adds a __wrapped__ attribute
+-  pointing to the original callable.
+-
+-- Issue #3445: functools.update_wrapper now tolerates missing attributes on
+-  wrapped callables.
+-
+-- Issue #5867: Add abc.abstractclassmethod and abc.abstractstaticmethod.
+-
+-- Issue #9605: posix.getlogin() decodes the username with file filesystem
+-  encoding and surrogateescape error handler. Patch written by David Watson.
+-
+-- Issue #9604: posix.initgroups() encodes the username using the fileystem
+-  encoding and surrogateescape error handler. Patch written by David Watson.
+-
+-- Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name
+-  using the filesystem encoding and surrogateescape error handler. Patch written
+-  by David Watson.
+-
+-- Issue #7647: The posix module now has the ST_RDONLY and ST_NOSUID constants,
+-  for use with the statvfs() function.  Patch by Adam Jackson.
+-
+-- Issue #8688: MANIFEST files created by distutils now include a magic comment
+-  indicating they are generated.  Manually maintained MANIFESTs without this
+-  marker will not be overwritten or removed.
+-
+-- Issue #7467: when reading a file from a ZIP archive, its CRC is checked and a
+-  BadZipfile error is raised if it doesn't match (as used to be the case in
+-  Python 2.5 and earlier).
+-
+-- Issue #9550: a BufferedReader could issue an additional read when the original
+-  read request had been satisfied, which could block indefinitely when the
+-  underlying raw IO channel was e.g. a socket.  Report and original patch by
+-  Jason V. Miller.
+-
+-- Issue #3757: thread-local objects now support cyclic garbage collection.
+-  Thread-local objects involved in reference cycles will be deallocated timely
+-  by the cyclic GC, even if the underlying thread is still running.
+-
+-- Issue #9452: Add read_file, read_string, and read_dict to the configparser
+-  API; new source attribute to exceptions.
+-
+-- Issue #6231: Fix xml.etree.ElementInclude to include the tail of the current
+-  node.
+-
+-- Issue #8047: Fix the xml.etree serializer to return bytes by default.  Use
+-  ``encoding="unicode"`` to generate a Unicode string.
+-
+-- Issue #8280: urllib2's Request method will remove fragments in the url.  This
+-  is how it is supposed to work, wget and curl do the same.  Previous behavior
+-  was wrong.
+-
+-- Issue #6683: For SMTP logins we now try all authentication methods advertised
+-  by the server.  Many servers are buggy and advertise authentication methods
+-  they do not support in reality.
+-
+-- Issue #8814: function annotations (the ``__annotations__`` attribute) are now
+-  included in the set of attributes copied by default by functools.wraps and
+-  functools.update_wrapper.  Patch by Terrence Cole.
+-
+-- Issue #2944: asyncore doesn't handle connection refused correctly.
+-
+-- Issue #4184: Private attributes on smtpd.SMTPChannel made public and deprecate
+-  the private attributes. Add tests for smtpd module.
+-
+-- Issue #3196: email header decoding is now forgiving if an RFC2047 encoded word
+-  encoded in base64 is lacking padding.
+-
+-- Issue #9444: Argparse now uses the first element of prefix_chars as the option
+-  character for the added 'h/help' option if prefix_chars does not contain a
+-  '-', instead of raising an error.
+-
+-- Issue #7372: Fix pstats regression when stripping paths from profile data
+-  generated with the profile module.
+-
+-- Issue #9428: Fix running scripts with the profile/cProfile modules from the
+-  command line.
+-
+-- Issue #7781: Fix restricting stats by entry counts in the pstats interactive
+-  browser.
+-
+-- Issue #9209: Do not crash in the pstats interactive browser on invalid regular
+-  expressions.
+-
+-- Update collections.OrderedDict to match the implementation in Py2.7 (based on
+-  lists instead of weakly referenced Link objects).
+-
+-- Issue #8397: Raise an error when attempting to mix iteration and regular reads
+-  on a BZ2File object, rather than returning incorrect results.
+-
+-- Issue #9448: Fix a leak of OS resources (mutexes or semaphores) when
+-  re-initializing a buffered IO object by calling its ``__init__`` method.
+-
+-- Issue #1713: Fix os.path.ismount(), which returned true for symbolic links
+-  across devices.
+-
+-- Issue #8826: Properly load old-style "expires" attribute in http.cookies.
+-
+-- Issue #1690103: Fix initial namespace for code run with trace.main().
+-
+-- Issue #7395: Fix tracebacks in pstats interactive browser.
+-
+-- Issue #8230: Fix Lib/test/sortperf.py.
+-
+-- Issue #8620: when a cmd.Cmd() is fed input that reaches EOF without a final
+-  newline, it no longer truncates the last character of the last command line.
+-
+-- Issue #5146: Handle UID THREAD command correctly in imaplib.
+-
+-- Issue #5147: Fix the header generated for cookie files written by
+-  http.cookiejar.MozillaCookieJar.
+-
+-- Issue #8198: In pydoc, output all help text to the correct stream when
+-  sys.stdout is reassigned.
+-
+-- Issue #7909: Do not touch paths with the special prefixes ``\\.\`` or ``\\?\``
+-  in ntpath.normpath().
+-
+-- Issue #1286: Allow using fileinput.FileInput as a context manager.
+-
+-- Add lru_cache() decorator to the functools module.
+-
+-Tools/Demos
+------------
+-
+-- Fix ``Tools/scripts/checkpyc.py`` after PEP 3147.
+-
+-- Issue #8867: Fix ``Tools/scripts/serve.py`` to work with files containing
+-  non-ASCII content.
+-
+-Tests
+------
+-
+-- Issue #9601: Provide a test case for ftplib.parse257.
+-
+-- Issue #8857: Provide a test case for socket.getaddrinfo.
+-
+-- Issue #7564: Skip test_ioctl if another process is attached to /dev/tty.
+-
+-- Issue #8433: Fix test_curses failure with newer versions of ncurses.
+-
+-- Issue #9496: Provide a test suite for the rlcompleter module.  Patch by
+-  Michele Orrù.
+-
+-- Issue #8687: provide a test suite for sched.py module.
+-
+-Build
+------
+-
+-- Issue #1303434: Generate ZIP file containing all PDBs.
+-
+-- Issue #9193: PEP 3149 is accepted.
+-
+-- Issue #3101: Helper functions _add_one_to_index_C() and _add_one_to_index_F()
+-  become _Py_add_one_to_index_C() and _Py_add_one_to_index_F(), respectively.
+-
+-- Issue #9700: define HAVE_BROKEN_POSIX_SEMAPHORES under AIX 6.x.  Patch by
+-  Sébastien Sablé.
+-
+-- Don't run pgen twice when using make -j.
+-
+-
+-What's New in Python 3.2 Alpha 1?
+-=================================
+-
+-*Release date: 01-Aug-2010*
+-
+-Core and Builtins
+------------------
+-
+-- Issue #8991: convertbuffer() rejects discontigious buffers.
+-
+-- Issue #7616: Fix copying of overlapping memoryview slices with the Intel
+-  compiler.
+-
+-- Issue #8413: structsequence now subclasses tuple.
+-
+-- Issue #8271: during the decoding of an invalid UTF-8 byte sequence, only the
+-  start byte and the continuation byte(s) are now considered invalid, instead of
+-  the number of bytes specified by the start byte.  E.g.:
+-  '\xf1\x80AB'.decode('utf-8', 'replace') now returns u'\ufffdAB' and replaces
+-  with U+FFFD only the start byte ('\xf1') and the continuation byte ('\x80')
+-  even if '\xf1' is the start byte of a 4-bytes sequence.  Previous versions
+-  returned a single u'\ufffd'.
+-
+-- Issue #9011: A negated imaginary literal (e.g., "-7j") now has real part -0.0
+-  rather than 0.0.  So "-7j" is now exactly equivalent to "-(7j)".
+-
+-- Be more specific in error messages about positional arguments.
+-
+-- Issue #8949: "z" format of PyArg_Parse*() functions doesn't accept bytes
+-  objects, as described in the documentation.
+-
+-- Issue #6543: Write the traceback in the terminal encoding instead of utf-8.
+-  Fix the encoding of the modules filename.  Patch written by Amaury Forgeot
+-  d'Arc.
+-
+-- Issue #9011: Remove buggy and unnecessary (in 3.x) ST->AST compilation code
+-  dealing with unary minus applied to a constant.  The removed code was mutating
+-  the ST, causing a second compilation to fail.
+-
+-- Issue #850997: mbcs encoding (Windows only) handles errors argument: strict
+-  mode raises unicode errors.  The encoder only supports "strict" and "replace"
+-  error handlers, the decoder only supports "strict" and "ignore" error
+-  handlers.  Patch written by Mark Hammond.
+-
+-- Issue #8850: Remove "w" and "w#" formats from PyArg_Parse*() functions, use
+-  "w*" format instead. Add tests for "w*" format.
+-
+-- Issue #8592: PyArg_Parse*() functions raise a TypeError for "y", "u" and "Z"
+-  formats if the string contains a null byte/character.  Write unit tests for
+-  string formats.
+-
+-- Issue #7490: To facilitate sharing of doctests between 2.x and 3.x test
+-  suites, the IGNORE_EXCEPTION_DETAIL directive now also ignores the module
+-  location of the raised exception.
+-
+-- Issue #8969: On Windows, use mbcs codec in strict mode to encode and decode
+-  filenames and enable os.fsencode().
+-
+-- Issue #9058: Remove assertions about INT_MAX in UnicodeDecodeError.
+-
+-- Issue #8941: Decoding big endian UTF-32 data in UCS-2 builds could crash the
+-  interpreter with characters outside the Basic Multilingual Plane (higher than
+-  0x10000).
+-
+-- Issue #8950: (See also issue #5080).  Py_ArgParse*() functions now raise
+-  TypeError instead of giving a DeprecationWarning when a float is parsed using
+-  the 'L' code (for long long).  (All other integer codes already raise
+-  TypeError in this case.)
+-
+-- Issue #8922: Normalize the encoding name in PyUnicode_AsEncodedString() to
+-  enable shortcuts for upper case encoding name. Add also a shortcut for
+-  "iso-8859-1" in PyUnicode_AsEncodedString() and PyUnicode_Decode().
+-
+-- Issue #8838: Remove codecs.charbuffer_encode() function.  The buffer protocol
+-  doesn't support "char buffer" anymore in Python 3.
+-
+-- Issue #8339: Remove "t#" format of PyArg_Parse*() functions, use "s#" or "s*"
+-  instead.  codecs.charbuffer_encode() now accepts modifiable buffer objects
+-  like bytearray.
+-
+-- Issue #8837: Remove "O?" format of PyArg_Parse*() functions.  The format is no
+-  used anymore and it was never documented.
+-
+-- In str.format(), raise a ValueError when indexes to arguments are too large.
+-
+-- Issue #2844: Make int('42', n) consistently raise ValueError for invalid
+-  integers n (including n = -909).
+-
+-- Issue #8188: Introduce a new scheme for computing hashes of numbers (instances
+-  of int, float, complex, decimal.Decimal and fractions.Fraction) that makes it
+-  easy to maintain the invariant that hash(x) == hash(y) whenever x and y have
+-  equal value.
+-
+-- Issue #8748: Fix two issues with comparisons between complex and integer
+-  objects.  (1) The comparison could incorrectly return True in some cases
+-  (2**53+1 == complex(2**53) == 2**53), breaking transitivity of equality.
+-  (2) The comparison raised an OverflowError for large integers, leading to
+-  unpredictable exceptions when combining integers and complex objects in sets
+-  or dicts.
+-
+-- Issue #8766: Initialize _warnings module before importing the first module.
+-  Fix a crash if an empty directory called "encodings" exists in sys.path.
+-
+-- Issue #8589: Decode PYTHONWARNINGS environment variable with the file system
+-  encoding and surrogateescape error handler instead of the locale encoding to
+-  be consistent with os.environ.  Add PySys_AddWarnOptionUnicode() function.
+-
+-- PyObject_Dump() encodes unicode objects to utf8 with backslashreplace (instead
+-  of strict) error handler to escape surrogates.
+-
+-- Issue #8715: Create PyUnicode_EncodeFSDefault() function: Encode a Unicode
+-  object to Py_FileSystemDefaultEncoding with the "surrogateescape" error
+-  handler, and return bytes.  If Py_FileSystemDefaultEncoding is not set, fall
+-  back to UTF-8.
+-
+-- Enable shortcuts for common encodings in PyUnicode_AsEncodedString() for any
+-  error handler, not only the default error handler (strict).
+-
+-- Issue #8610: Load file system codec at startup, and display a fatal error on
+-  failure.  Set the file system encoding to utf-8 (instead of None) if getting
+-  the locale encoding failed, or if nl_langinfo(CODESET) function is missing.
+-
+-- PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead of
+-  PyUnicode_FromString() to support surrogates in the filename and use the right
+-  encoding.
+-
+-- Issue #7507: Quote "!" in pipes.quote(); it is special to some shells.
+-
+-- PyUnicode_DecodeFSDefaultAndSize() uses surrogateescape error handler.
+-
+-- Issue #8419: Prevent the dict constructor from accepting non-string keyword
+-  arguments.
+-
+-- Issue #8124: PySys_WriteStdout() and PySys_WriteStderr() don't execute
+-  indirectly Python signal handlers anymore because mywrite() ignores exceptions
+-  (KeyboardInterrupt).
+-
+-- Issue #8092: Fix PyUnicode_EncodeUTF8() to support error handler producing
+-  unicode string (eg. backslashreplace).
+-
+-- Issue #8485: PyUnicode_FSConverter() doesn't accept byteearray objects
+-  anymore, you have to convert your bytearray filenames to bytes.
+-
+-- Issue #7332: Remove the 16KB stack-based buffer in
+-  PyMarshal_ReadLastObjectFromFile, which doesn't bring any noticeable benefit
+-  compared to the dynamic memory allocation fallback.  Patch by Charles-François
+-  Natali.
+-
+-- Issue #8417: Raise an OverflowError when an integer larger than sys.maxsize is
+-  passed to bytes or bytearray.
+-
+-- Issue #7301: Add environment variable $PYTHONWARNINGS.
+-
+-- Issue #8329: Don't return the same lists from select.select when no fds are
+-  changed.
+-
+-- Issue #8259: 1L << (2**31) no longer produces an 'outrageous shift error' on
+-  64-bit machines.  The shift count for either left or right shift is permitted
+-  to be up to sys.maxsize.
+-
+-- Ensure that tokenization of identifiers is not affected by locale.
+-
+-- Issue #1222585: Added LDCXXSHARED for C++ support. Patch by Arfrever.
+-
+-- Raise a TypeError when trying to delete a T_STRING_INPLACE struct member.
+-
+-- Issue #8211: Save/restore CFLAGS around AC_PROG_CC in configure.in, in case it
+-  is set.
+-
+-- Issue #8226: sys.setfilesystemencoding() raises a LookupError if the encoding
+-  is unknown.
+-
+-- Issue #1583863: A str subclass can now override the __str__ method.
+-
+-- Issue #8014: Setting a T_UINT or T_PYSSIZET attribute of an object with
+-  PyMemberDefs could produce an internal error; raise TypeError instead.
+-
+-- Issue #7845: Rich comparison methods on the complex type now return
+-  NotImplemented rather than raising a TypeError when comparing with an
+-  incompatible type; this allows user-defined classes to implement their own
+-  comparisons with complex.
+-
+-- Issue #3137: Don't ignore errors at startup, especially a keyboard interrupt
+-  (SIGINT). If an error occurs while importing the site module, the error is
+-  printed and Python exits. Initialize the GIL before importing the site module.
+-
+-- Issue #7173: Generator finalization could invalidate sys.exc_info().
+-
+-- Issue #7544: Preallocate thread memory before creating the thread to avoid a
+-  fatal error in low memory condition.
+-
+-- Issue #7820: The parser tokenizer restores all bytes in the right if the BOM
+-  check fails.
+-
+-- Handle errors from looking up __prepare__ correctly.
+-
+-- Issue #5939: Add additional runtime checking to ensure a valid capsule in
+-  Modules/_ctypes/callproc.c.
+-
+-- Issue #7309: Fix unchecked attribute access when converting
+-  UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings.
+-
+-- Issue #6902: Fix problem with built-in types format incorrectly with 0
+-  padding.
+-
+-- Issue #7988: Fix default alignment to be right aligned for complex.__format__.
+-  Now it matches other numeric types.
+-
+-- Issue #5988: Remove deprecated functions PyOS_ascii_formatd,
+-  PyOS_ascii_strtod, and PyOS_ascii_atof.  Use PyOS_double_to_string and
+-  PyOS_string_to_double instead.  See issue #5835 for the original deprecations.
+-
+-- Issue #7385: Fix a crash in `MemoryView_FromObject` when `PyObject_GetBuffer`
+-  fails.  Patch by Florent Xicluna.
+-
+-- Issue #7788: Fix an interpreter crash produced by deleting a list slice with
+-  very large step value.
+-
+-- Issue #7766: Change sys.getwindowsversion() return value to a named tuple and
+-  add the additional members returned in an OSVERSIONINFOEX structure.  The new
+-  members are service_pack_major, service_pack_minor, suite_mask, and
+-  product_type.
+-
+-- Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`) could
+-  crash in many places because of the PyByteArray_AS_STRING() macro returning
+-  NULL.  The macro now returns a statically allocated empty string instead.
+-
+-- Issue #6690: Optimize the bytecode for expressions such as `x in {1, 2, 3}`,
+-  where the right hand operand is a set of constants, by turning the set into a
+-  frozenset and pre-building it as a constant.  The comparison operation is made
+-  against the constant instead of building a new set each time it is executed (a
+-  similar optimization already existed which turned a list of constants into a
+-  pre-built tuple).  Patch and additional tests by Dave Malcolm.
+-
+-- Issue #7622: Improve the split(), rsplit(), splitlines() and replace() methods
+-  of bytes, bytearray and unicode objects by using a common implementation based
+-  on stringlib's fast search.  Patch by Florent Xicluna.
+-
+-- Issue #7632: Fix various str -> float conversion bugs present in 2.7 alpha 2,
+-  including: (1) a serious 'wrong output' bug that could occur for long (> 40
+-  digit) input strings, (2) a crash in dtoa.c that occurred in debug builds when
+-  parsing certain long numeric strings corresponding to subnormal values, (3) a
+-  memory leak for some values large enough to cause overflow, and (4) a number
+-  of flaws that could lead to incorrectly rounded results.
+-
+-- The __complex__ method is now looked up on the class of instances to make it
+-  consistent with other special methods.
+-
+-- Issue #7462: Implement the stringlib fast search algorithm for the `rfind`,
+-  `rindex`, `rsplit` and `rpartition` methods.  Patch by Florent Xicluna.
+-
+-- Issue #7604: Deleting an unset slotted attribute did not raise an
+-  AttributeError.
+-
+-- Issue #7534: Fix handling of IEEE specials (infinities, nans, negative zero)
+-  in ** operator.  The behaviour now conforms to that described in C99 Annex F.
+-
+-- Issue #1811: improve accuracy and cross-platform consistency for true division
+-  of integers: the result of a/b is now correctly rounded for ints a and b (at
+-  least on IEEE 754 platforms), and in particular does not depend on the
+-  internal representation of an int.
+-
+-- Issue #6834: replace the implementation for the 'python' and 'pythonw'
+-  executables on OSX.
+-
+-  These executables now work properly with the arch(1) command: ``arch -ppc
+-  python`` will start a universal binary version of python in PPC mode (unlike
+-  previous releases).
+-
+-- Issue #7466: Segmentation fault when the garbage collector is called in the
+-  middle of populating a tuple.  Patch by Florent Xicluna.
+-
+-- Issue #7419: setlocale() could crash the interpreter on Windows when called
+-  with invalid values.
+-
+-- Issue #6077: On Windows, files opened with tempfile.TemporaryFile in "wt+"
+-  mode would appear truncated on the first '0x1a' byte (aka. Ctrl+Z).
+-
+-- Issue #7085: Fix crash when importing some extensions in a thread on MacOSX
+-  10.6.
+-
+-- Issue #1757126: Fix the cyrillic-asian alias for the ptcp154 encoding.
+-
+-- Issue #6970: Remove redundant calls when comparing objects that don't
+-  implement the relevant rich comparison methods.
+-
+-- Issue #7298: Fixes for range and reversed(range(...)).  Iteration over
+-  range(a, b, c) incorrectly gave an empty iterator when a, b and c fit in C
+-  long but the length of the range did not.  Also fix several cases where
+-  reversed(range(a, b, c)) gave wrong results, and fix a refleak for
+-  reversed(range(a, b, c)) with large arguments.
+-
+-- Issue #7244: itertools.izip_longest() no longer ignores exceptions raised
+-  during the formation of an output tuple.
+-
+-- Issue #3297: On wide unicode builds, do not split unicode characters into
+-  surrogates.
+-
+-- Remove length limitation when constructing a complex number from a string.
+-
+-- Issue #1087418: Boost performance of bitwise operations for longs.
+-
+-- Support for AtheOS has been completely removed from the code base. It was
+-  disabled since Python 3.0.
+-
+-- Support for several legacy threading libraries has been disabled. These
+-  libraries are: Mach C threads, SunOS LWP, GNU pth, Irix threads. Support code
+-  will be entirely removed in 3.3.
+-
+-- Support for OSF* has been disabled. If nobody stands up, support will be
+-  removed in 3.3. See <http://bugs.python.org/issue8606>.
+-
+-- Peephole constant folding had missed UNARY_POSITIVE.
+-
+-- Issue #1722344: threading._shutdown() is now called in Py_Finalize(), which
+-  fixes the problem of some exceptions being thrown at shutdown when the
+-  interpreter is killed. Patch by Adam Olsen.
+-
+-- Issue #7147: Remove support for compiling Python without complex number
+-  support.
+-
+-- Issue #7120: logging: Removed import of multiprocessing which is causing crash
+-  in GAE.
+-
+-- Issue #1754094: Improve the stack depth calculation in the compiler.  There
+-  should be no other effect than a small decrease in memory use.  Patch by
+-  Christopher Tur Lesniewski-Laas.
+-
+-- Issue #7065: Fix a crash in bytes.maketrans and bytearray.maketrans when using
+-  byte values greater than 127.  Patch by Derk Drukker.
+-
+-- Issue #1571184: The Unicode database contains properties for more characters.
+-  The tables for code points representing numeric values, white spaces or line
+-  breaks are now generated from the official Unicode Character Database files,
+-  and include information from the Unihan.txt file.
+-
+-- Issue #7019: Raise ValueError when unmarshalling bad long data, instead of
+-  producing internally inconsistent Python longs.
+-
+-- Issue #6990: Fix threading.local subclasses leaving old state around after a
+-  reference cycle GC which could be recycled by new locals.
+-
+-- Issue #5460: Fix an ambiguity in the grammar.
+-
+-- Issue #1766304: Improve performance of membership tests on range objects.
+-
+-- Issue #6713: Improve performance of integer -> string conversions.
+-
+-- Issue #6846: Fix bug where bytearray.pop() returns negative integers.
+-
+-- Issue #6750: A text file opened with io.open() could duplicate its output when
+-  writing from multiple threads at the same time.
+-
+-- Issue #6707: dir() on an uninitialized module caused a crash.
+-
+-- Issue #6540: Fixed crash for bytearray.translate() with invalid parameters.
+-
+-- Issue #6573: set.union() stopped processing inputs if an instance of self
+-  occurred in the argument chain.
+-
+-- Issue #6070: On posix platforms import no longer copies the execute bit from
+-  the .py file to the .pyc file if it is set.
+-
+-- Issue #1616979: Added the cp720 (Arabic DOS) encoding.
+-
+-- Issue #6428: Since Python 3.0, the __bool__ method must return a bool object,
+-  and not an int.  Fix the corresponding error message, and the documentation.
+-
+-- The deprecated PyCObject has been removed.
+-
+-- Issue #6347: Include inttypes.h as well as stdint.h in pyport.h.  This fixes a
+-  build failure on HP-UX: int32_t and uint32_t are defined in inttypes.h instead
+-  of stdint.h on that platform.
+-
+-- Issue #6373: Fixed a SystemError when encoding with the latin-1 codec and the
+-  'surrogateescape' error handler, a string which contains unpaired surrogates.
+-
+-- Issue #4856: Remove checks for win NT.
+-
+-- Issue #6687: PyBytes_FromObject() no longer accepts an integer as its argument
+-  to construct a null-initialized bytes object.
+-
+-- Issue #1023290: Add from_bytes() and to_bytes() methods to integers.  These
+-  methods allow the conversion of integers to bytes, and vice-versa.
+-
+-- Issue #7382: Fix bug in bytes.__getnewargs__ that prevented bytes instances
+-  from being copied with copy.copy(), and bytes subclasses from being pickled
+-  properly.
+-
+-- Code objects now support weak references.
+-
+-- Issue #7072: isspace(0xa0) is true on Mac OS X.
+-
+-- Issue #8084: PEP 370 now conforms to system conventions for framework builds
+-  on MacOS X. That is, "python setup.py install --user" will install into
+-  "~/Library/Python/2.7" instead of "~/.local".
+-
+-C-API
+------
+-
+-- Issue #2443: A new macro, `Py_VA_COPY`, copies the state of the
+-  variable argument list.  `Py_VA_COPY` is equivalent to C99
+-  `va_copy`, but available on all python platforms.
+-
+-- PySlice_GetIndicesEx now clips the step to [-PY_SSIZE_T_MAX, PY_SSIZE_T_MAX]
+-  instead of [-PY_SSIZE_T_MAX-1, PY_SSIZE_T_MAX].  This makes it safe to do
+-  "step = -step" when reversing a slice.
+-
+-- Issue #5753: A new C API function, `PySys_SetArgvEx`, allows embedders of the
+-  interpreter to set sys.argv without also modifying sys.path.  This helps fix
+-  `CVE-2008-5983
+-  <http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
+-
+-- Add PyArg_ValidateKeywordArguments, which checks if all keyword arguments are
+-  strings in an efficient manner.
+-
+-- Issue #8276: PyEval_CallObject() is now only available in macro form.  The
+-  function declaration, which was kept for backwards compatibility reasons, is
+-  now removed (the macro was introduced in 1997!).
+-
+-- Issue #7767: New function PyLong_AsLongLongAndOverflow added, analogous to
+-  PyLong_AsLongAndOverflow.
+-
+-- Make PyUnicode_CompareWithASCIIString return not equal if the Python string
+-  has '\0' at the end.
+-
+-- Issue #5080: The argument parsing functions PyArg_ParseTuple,
+-  PyArg_ParseTupleAndKeywords, PyArg_VaParse, PyArg_VaParseTupleAndKeywords and
+-  PyArg_Parse now raise a DeprecationWarning for float arguments passed with the
+-  'L' format code.  This will become a TypeError in a future version of Python,
+-  to match the behaviour of the other integer format codes.
+-
+-- Issue #7033: Function ``PyErr_NewExceptionWithDoc()`` added.
+-
+-- Issue #7414: 'C' code wasn't being skipped properly (for keyword arguments) in
+-  PyArg_ParseTupleAndKeywords.
+-
+-- Issue #7228: Add '%lld' and '%llu' support to PyString_FromFormat(V) and
+-  PyErr_Format, on machines with HAVE_LONG_LONG defined.
+-
+-- Issue #6151: Made PyDescr_COMMON conform to standard C (like PyObject_HEAD in
+-  PEP 3123).  The PyDescr_TYPE and PyDescr_NAME macros should be should used for
+-  accessing the d_type and d_name members of structures using PyDescr_COMMON.
+-
+-- Issue #6405: Remove duplicate type declarations in descrobject.h.
+-
+-- The code flags for old __future__ features are now available again.
+-
+-- Issue #5954: Add a PyFrame_GetLineNumber() function to replace most uses of
+-  PyCode_Addr2Line().
+-
+-- Issue #5959: Add a PyCode_NewEmpty() function to create a new empty code
+-  object at a specified file, function, and line number.
+-
+-- Issue #1419652: Change the first argument to PyImport_AppendInittab() to
+-  ``const char *`` as the string is stored beyond the call.
+-
+-- Issue #2422: When compiled with the ``--with-valgrind`` option, the pymalloc
+-  allocator will be automatically disabled when running under Valgrind.  This
+-  gives improved memory leak detection when running under Valgrind, while taking
+-  advantage of pymalloc at other times.
+-
+-Library
+--------
+-
+-- In pdb, when Ctrl-C is entered while defining commands for a breakpoint, the
+-  old commands are restored.
+-
+-- For traceback debugging, the pdb listing now also shows the locations where
+-  the exception was originally (re)raised, if it differs from the last line
+-  executed (e.g. in case of finally clauses).
+-
+-- The pdb command "source" has been added.  It displays the source code for a
+-  given object, if possible.
+-
+-- The pdb command "longlist" has been added.  It displays the whole source code
+-  for the current function.
+-
+-- Issue #1503502: Make pdb.Pdb easier to subclass by putting message and error
+-  output into methods.
+-
+-- Issue #809887: Make the output of pdb's breakpoint deletions more consistent;
+-  emit a message when a breakpoint is enabled or disabled.
+-
+-- Issue #5294: Fix the behavior of pdb's "continue" command when called in the
+-  top-level debugged frame.
+-
+-- Issue #5727: Restore the ability to use readline when calling into pdb in
+-  doctests.
+-
+-- Issue #6719: In pdb, do not stop somewhere in the encodings machinery if the
+-  source file to be debugged is in a non-builtin encoding.
+-
+-- Issue #8048: Prevent doctests from failing when sys.displayhook has been
+-  reassigned.
+-
+-- Issue #8015: In pdb, do not crash when an empty line is entered as a
+-  breakpoint command.
+-
+-- In pdb, allow giving a line number to the "until" command.
+-
+-- Issue #1437051: For pdb, allow "continue" and related commands in .pdbrc
+-  files.  Also, add a command-line option "-c" that runs a command as if given
+-  in .pdbrc.
+-
+-- Issue #4179: In pdb, allow "list ." as a command to return to the currently
+-  debugged line.
+-
+-- Issue #4108: In urllib.robotparser, if there are multiple ``User-agent: *``
+-  entries, consider the first one.
+-
+-- Issue #6630: Allow customizing regex flags when subclassing the
+-  string.Template class.
+-
+-- Issue #9411: Allow specifying an encoding for config files in the configparser
+-  module.
+-
+-- Issue #1682942: Improvements to configparser: support alternate delimiters,
+-  alternate comment prefixes and empty lines in values.
+-
+-- Issue #9354: Provide getsockopt() in asyncore's file_wrapper.
+-
+-- Issue #8966: ctypes: Remove implicit bytes-unicode conversion.
+-
+-- Issue #9378: python -m pickle <pickle file> will now load and display the
+-  first object in the pickle file.
+-
+-- Issue #4770: Restrict binascii module to accept only bytes (as specified).
+-  And fix the email package to encode to ASCII instead of ``raw-unicode-escape``
+-  before ASCII-to-binary decoding.
+-
+-- Issue #9384: ``python -m tkinter`` will now display a simple demo applet.
+-
+-- The default size of the re module's compiled regular expression cache has been
+-  increased from 100 to 500 and the cache replacement policy has changed from
+-  simply clearing the entire cache on overflow to forgetting the least recently
+-  used cached compiled regular expressions.  This is a performance win for
+-  applications that use a lot of regular expressions and limits the impact of
+-  the performance hit anytime the cache is exceeded.
+-
+-- Issue #7113: Speed up loading in configparser. Patch by Łukasz Langa.
+-
+-- Issue #9032: XML-RPC client retries the request on EPIPE error.  The EPIPE
+-  error occurs when the server closes the socket and the client sends a big
+-  XML-RPC request.
+-
+-- Issue #4629: getopt raises an error if an argument ends with "=", whereas
+-  getopt doesn't accept a value (eg. --help= is rejected if getopt uses
+-  ['help='] long options).
+-
+-- Issue #7989: Added pure python implementation of the `datetime` module.  The C
+-  module is renamed to `_datetime` and if available, overrides all classes
+-  defined in datetime with fast C impementation.  Python implementation is based
+-  on the original python prototype for the datetime module by Tim Peters with
+-  minor modifications by the PyPy project.  The test suite now tests `datetime`
+-  module with and without `_datetime` acceleration using the same test cases.
+-
+-- Issue #7895: platform.mac_ver() no longer crashes after calling os.fork().
+-
+-- Issue #9323: Fixed a bug in trace.py that resulted in loosing the name of the
+-  script being traced.  Patch by Eli Bendersky.
+-
+-- Issue #9282: Fixed --listfuncs option of trace.py.  Thanks Eli Bendersky for
+-  the patch.
+-
+-- Issue #3704: http.cookiejar was not properly handling URLs with a / in the
+-  parameters.
+-
+-- Issue #9268: ``pickletools.dis()`` now has an optional *annotate* argument
+-  which controls printing of opcode descriptions in ``dis()`` output.
+-
+-- Issue #1555570: email no longer inserts extra blank lines when a \r\n combo
+-  crosses an 8192 byte boundary.
+-
+-- Issue #9243: Fix sndhdr module and add unit tests, contributed by James Lee.
+-
+-- ``ast.literal_eval()`` now allows byte literals.
+-
+-- Issue #9137: Fix issue in MutableMapping.update, which incorrectly treated
+-  keyword arguments called 'self' or 'other' specially.
+-
+-- ``ast.literal_eval()`` now allows set literals.
+-
+-- Issue #9164: Ensure that sysconfig handles duplicate -arch flags in CFLAGS.
+-
+-- Issue #7646: The fnmatch pattern cache no longer grows without bound.
+-
+-- Issue #9136: Fix 'dictionary changed size during iteration' RuntimeError
+-  produced when profiling the decimal module.  This was due to a dangerous
+-  iteration over 'locals()' in Context.__init__.
+-
+-- Fix extreme speed issue in Decimal.pow when the base is an exact power of 10
+-  and the exponent is tiny (for example, ``Decimal(10) **
+-  Decimal('1e-999999999')``).
+-
+-- Issue #9186: Fix math.log1p(-1.0) to raise ValueError, not OverflowError.
+-
+-- Issue #9130: Fix validation of relative imports in parser module.
+-
+-- Issue #9128: Fix validation of class decorators in parser module.
+-
+-- Issue #9094: python -m pickletools will now disassemble pickle files listed in
+-  the command line arguments.  See output of python -m pickletools -h for more
+-  details.
+-
+-- Issue #5468: urlencode to handle bytes type and other encodings in its query
+-  parameter. Patch by Dan Mahn.
+-
+-- Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop module,
+-  ensure that the input string length is a multiple of the frame size.
+-
+-- Issue #6507: Accept source strings in dis.dis().  Original patch by Daniel
+-  Urban.
+-
+-- Issue #7829: Clearly document that the dis module is exposing an
+-  implementation detail that is not stable between Python VMs or releases.
+-
+-- Issue #6589: cleanup asyncore.socket_map in case smtpd.SMTPServer constructor
+-  raises an exception.
+-
+-- Issue #9110: Addition of ContextDecorator to contextlib, for creating APIs
+-  that act as both context managers and decorators. contextmanager changes to
+-  use ContextDecorator.
+-
+-- Implement importlib.abc.SourceLoader and deprecate PyLoader and PyPycLoader
+-  for removal in Python 3.4.
+-
+-- Issue #9064: pdb's "up" and "down" commands now accept an optional argument
+-  giving the number of frames to go.
+-
+-- Issue #9018: os.path.normcase() now raises a TypeError if the argument is not
+-  ``str`` or ``bytes``.
+-
+-- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag on an
+-  OpenSSL structure.
+-
+-- Issue #8682: The ssl module now temporary increments the reference count of a
+-  socket object got through ``PyWeakref_GetObject``, so as to avoid possible
+-  deallocation while the object is still being used.
+-
+-- Issue #1368368: FancyURLOpener class changed to throw an Exception on wrong
+-  password instead of presenting an interactive prompt.  Older behavior can be
+-  obtained by passing retry=True to http_error_xxx methods of FancyURLOpener.
+-
+-- Issue #8720: Fix regression caused by fix for #4050 by making getsourcefile
+-  smart enough to find source files in the linecache.
+-
+-- Issue #5610: feedparser no longer eats extra characters at the end of a body
+-  part if the body part ends with a ``\r\n``.
+-
+-- Issue #8986: math.erfc was incorrectly raising OverflowError for values
+-  between -27.3 and -30.0 on some platforms.
+-
+-- Issue #8784: Set tarfile default encoding to 'utf-8' on Windows.
+-
+-- Issue #8966: If a ctypes structure field is an array of c_char, convert its
+-  value to bytes instead of str (as done for c_char and c_char_p).
+-
+-- Issue #8188: Comparisons between Decimal and Fraction objects are now
+-  permitted, returning a result based on the exact numerical values of the
+-  operands.  This builds on issue #2531, which allowed Decimal-to-float
+-  comparisons; all comparisons involving numeric types (bool, int, float,
+-  complex, Decimal, Fraction) should now act as expected.
+-
+-- Issue #8897: Fix sunau module, use bytes to write the header. Patch written by
+-  Thomas Jollans.
+-
+-- Issue #8899: time.struct_time now has class and attribute docstrings.
+-
+-- Issue #6470: Drop UNC prefix in FixTk.
+-
+-- Issue #4768: base64 encoded email body parts were incorrectly stored as binary
+-  strings.  They are now correctly converted to strings.
+-
+-- Issue #8833: tarfile created hard link entries with a size field != 0 by
+-  mistake.
+-
+-- Charset.body_encode now correctly handles base64 encoding by encoding with the
+-  output_charset before calling base64mime.encode.  Passes the tests from 2.x
+-  issue #1368247.
+-
+-- Issue #8845: sqlite3 Connection objects now have a read-only in_transaction
+-  attribute that is True iff there are uncommitted changes.
+-
+-- Issue #1289118: datetime.timedelta objects can now be multiplied by float and
+-  divided by float and int objects.  Results are rounded to the nearest multiple
+-  of timedelta.resolution with ties resolved using round-half-to-even method.
+-
+-- Issue #7150: Raise OverflowError if the result of adding or subtracting
+-  timedelta from date or datetime falls outside of the MINYEAR:MAXYEAR range.
+-
+-- Issue #8806: add SSL contexts support to ftplib.
+-
+-- Issue #4769: Fix main() function of the base64 module, use sys.stdin.buffer
+-  and sys.stdout.buffer (instead of sys.stdin and sys.stdout) to use the bytes
+-  API.
+-
+-- Issue #8770: Now sysconfig displays information when it's called as a script.
+-  Initial idea by Sridhar Ratnakumar.
+-
+-- Issue #6662: Fix parsing of malformatted charref (&#bad;), patch written by
+-  Fredrik Håård.
+-
+-- Issue #8540: Decimal module: rename the Context._clamp attribute to
+-  Context.clamp and make it public.  This is useful in creating contexts that
+-  correspond to the decimal interchange formats specified in IEEE 754.
+-
+-- Issue #6268: Fix seek() method of codecs.open(), don't read or write the BOM
+-  twice after seek(0). Fix also reset() method of codecs, UTF-16, UTF-32 and
+-  StreamWriter classes.
+-
+-- Issue #3798: sys.exit(message) writes the message to sys.stderr file, instead
+-  of the C file stderr, to use stderr encoding and error handler.
+-
+-- Issue #8782: Add a trailing newline in linecache.updatecache to the last line
+-  of files without one.
+-
+-- Issue #8729: Return NotImplemented from collections.Mapping.__eq__ when
+-  comparing to a non-mapping.
+-
+-- Issue #8774: tabnanny uses the encoding cookie (#coding:...) to use the
+-  correct encoding.
+-
+-- Issue #4870: Add an `options` attribute to SSL contexts, as well as several
+-  ``OP_*`` constants to the `ssl` module.  This allows to selectively disable
+-  protocol versions, when used in combination with `PROTOCOL_SSLv23`.
+-
+-- Issue #8759: Fixed user paths in sysconfig for posix and os2 schemes.
+-
+-- Issue #8663: distutils.log emulates backslashreplace error handler. Fix
+-  compilation in a non-ASCII directory if stdout encoding is ASCII (eg. if
+-  stdout is not a TTY).
+-
+-- Issue #8513: os.get_exec_path() supports b'PATH' key and bytes value.
+-  subprocess.Popen() and os._execvpe() support bytes program name. Add
+-  os.supports_bytes_environ flag: True if the native OS type of the environment
+-  is bytes (eg. False on Windows).
+-
+-- Issue #8633: tarfile is now able to read and write archives with "raw" binary
+-  pax headers as described in POSIX.1-2008.
+-
+-- Issue #1285086: Speed up urllib.parse functions: quote, quote_from_bytes,
+-  unquote, unquote_to_bytes.
+-
+-- Issue #8688: Distutils now recalculates MANIFEST everytime.
+-
+-- Issue #8477: ssl.RAND_egd() and ssl._test_decode_cert() support str with
+-  surrogates and bytes for the filename.
+-
+-- Issue #8550: Add first class ``SSLContext`` objects to the ssl module.
+-
+-- Issue #8681: Make the zlib module's error messages more informative when the
+-  zlib itself doesn't give any detailed explanation.
+-
+-- The audioop module now supports sound fragments of length greater than 2**31
+-  bytes on 64-bit machines, and is PY_SSIZE_T_CLEAN.
+-
+-- Issue #4972: Add support for the context manager protocol to the ftplib.FTP
+-  class.
+-
+-- Issue #8664: In py_compile, create __pycache__ when the compiled path is
+-  given.
+-
+-- Issue #8514: Add os.fsencode() function (Unix only): encode a string to bytes
+-  for use in the file system, environment variables or the command line.
+-
+-- Issue #8571: Fix an internal error when compressing or decompressing a chunk
+-  larger than 1GB with the zlib module's compressor and decompressor objects.
+-
+-- Issue #8603: Support bytes environmental variables on Unix: Add os.environb
+-  mapping and os.getenvb() function. os.unsetenv() encodes str argument to the
+-  file system encoding with the surrogateescape error handler (instead of
+-  utf8/strict) and accepts bytes. posix.environ keys and values are now bytes.
+-
+-- Issue #8573: asyncore _strerror() function might throw ValueError.
+-
+-- Issue #8483: asyncore.dispatcher's __getattr__ method produced confusing error
+-  messages when accessing undefined class attributes because of the cheap
+-  inheritance with the underlying socket object.  The cheap inheritance has been
+-  deprecated.
+-
+-- Issue #4265: shutil.copyfile() was leaking file descriptors when disk fills.
+-  Patch by Tres Seaver.
+-
+-- Issue #8390: tarfile uses surrogateescape as the default error handler
+-  (instead of replace in read mode or strict in write mode).
+-
+-- Issue #7755: Use an unencumbered audio file for tests.
+-
+-- Issue #8621: uuid.uuid4() returned the same sequence of values in the parent
+-  and any children created using ``os.fork`` on MacOS X 10.6.
+-
+-- Issue #8567: Fix precedence of signals in Decimal module: when a Decimal
+-  operation raises multiple signals and more than one of those signals is
+-  trapped, the specification determines the order in which the signals should be
+-  handled.  In many cases this order wasn't being followed, leading to the wrong
+-  Python exception being raised.
+-
+-- Issue #7865: The close() method of ``io`` objects should not swallow
+-  exceptions raised by the implicit flush().  Also qensure that calling close()
+-  several times is supported.  Patch by Pascal Chambon.
+-
+-- Issue #4687: Fix accuracy of garbage collection runtimes displayed with
+-  gc.DEBUG_STATS.
+-
+-- Issue #8354: The siginterrupt setting is now preserved for all signals, not
+-  just SIGCHLD.
+-
+-- Issue #7192: webbrowser.get("firefox") now works on Mac OS X, as does
+-  webbrowser.get("safari").
+-
+-- Issue #8464: tarfile no longer creates files with execute permissions set when
+-  mode="w|" is used.
+-
+-- Issue #7834: Fix connect() of Bluetooth L2CAP sockets with recent versions of
+-  the Linux kernel.  Patch by Yaniv Aknin.
+-
+-- Issue #8295: Added shutil.unpack_archive.
+-
+-- Issue #6312: Fixed http HEAD request when the transfer encoding is chunked.
+-  It should correctly return an empty response now.
+-
+-- Issue #8546: Reject None given as the buffering argument to _pyio.open.
+-
+-- Issue #8549: Fix compiling the _ssl extension under AIX.  Patch by
+-  Sridhar Ratnakumar.
+-
+-- Issue #6656: fix locale.format_string to handle escaped percents
+-  and mappings.
+-
+-- Issue #2302: Fix a race condition in SocketServer.BaseServer.shutdown, where
+-  the method could block indefinitely if called just before the event loop
+-  started running.  This also fixes the occasional freezes witnessed in
+-  test_httpservers.
+-
+-- Issue #8524: When creating an SSL socket, the timeout value of the original
+-  socket wasn't retained (instead, a socket with a positive timeout would be
+-  turned into a non-blocking SSL socket).
+-
+-- Issue #5103: SSL handshake would ignore the socket timeout and block
+-  indefinitely if the other end didn't respond.
+-
+-- The do_handshake() method of SSL objects now adjusts the blocking mode of the
+-  SSL structure if necessary (as other methods already do).
+-
+-- Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates and
+-  bytes strings for environment keys and values.
+-
+-- Issue #8467: Pure Python implementation of subprocess encodes the error
+-  message using surrogatepass error handler to support surrogates in the
+-  message.
+-
+-- Issue #8468: bz2.BZ2File() accepts str with surrogates and bytes filenames.
+-
+-- Issue #8451: Syslog module now uses basename(sys.argv[0]) instead of the
+-  string "python" as the *ident*.  openlog() arguments are all optional and
+-  keywords.
+-
+-- Issue #8108: Fix the unwrap() method of SSL objects when the socket has a
+-  non-infinite timeout.  Also make that method friendlier with applications
+-  wanting to continue using the socket in clear-text mode, by disabling
+-  OpenSSL's internal readahead.  Thanks to Darryl Miles for guidance.
+-
+-- Issue #8496: make mailcap.lookup() always return a list, rather than an
+-  iterator.  Patch by Gregory Nofi.
+-
+-- Issue #8195: Fix a crash in sqlite Connection.create_collation() if the
+-  collation name contains a surrogate character.
+-
+-- Issue #8484: Load all ciphers and digest algorithms when initializing the _ssl
+-  extension, such that verification of some SSL certificates doesn't fail
+-  because of an "unknown algorithm".
+-
+-- Issue #6547: Added the ignore_dangling_symlinks option to shutil.copytree.
+-
+-- Issue #1540112: Now allowing the choice of a copy function in shutil.copytree.
+-
+-- Issue #4814: timeout parameter is now applied also for connections resulting
+-  from PORT/EPRT commands.
+-
+-- Issue #8463: added missing reference to bztar in shutil's documentation.
+-
+-- Issue #7154: urllib.request can now detect the proxy settings on OSX 10.6 (as
+-  long as the user didn't specify 'automatic proxy configuration').
+-
+-- Issue #3817: ftplib.FTP.abort() method now considers 225 a valid response code
+-  as stated in RFC-959 at chapter 5.4.
+-
+-- Issue #8394: _ctypes.dlopen() accepts bytes, bytearray and str with
+-  surrogates.
+-
+-- Issue #850728: Add a *timeout* parameter to the `acquire()` method of
+-  `threading.Semaphore` objects.  Original patch by Torsten Landschoff.
+-
+-- Issue #8322: Add a *ciphers* argument to SSL sockets, so as to change the
+-  available cipher list.  Helps fix test_ssl with OpenSSL 1.0.0.
+-
+-- Issue #8393: subprocess accepts bytes, bytearray and str with surrogates for
+-  the current working directory.
+-
+-- Issue #7606: XML-RPC traceback stored in X-traceback is now encoded to ASCII
+-  using backslashreplace error handler.
+-
+-- Issue #8412: os.system() now accepts bytes, bytearray and str with surrogates.
+-
+-- Issue #2987: RFC2732 support for urlparse (IPv6 addresses). Patch by Tony
+-  Locke and Hans Ulrich Niedermann.
+-
+-- Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters.
+-
+-- Issue #7316: The acquire() method of lock objects in the ``threading``
+-  module now takes an optional timeout argument in seconds.  Timeout support
+-  relies on the system threading library, so as to avoid a semi-busy wait loop.
+-
+-- Issue #8383: pickle and pickletools use surrogatepass error handler when
+-  encoding unicode as utf8 to support lone surrogates and stay compatible with
+-  Python 2.x and 3.x.
+-
+-- Issue #7585: difflib context and unified diffs now place a tab between
+-  filename and date, conforming to the 'standards' they were originally designed
+-  to follow.  This improves compatibility with patch tools.
+-
+-- Issue #7472: Fixed typo in email.encoders module; messages using ISO-2022
+-  character sets will now consistently use a Content-Transfer-Encoding of 7bit
+-  rather than sometimes being marked as 8bit.
+-
+-- Issue #8375: test_distutils now checks if the temporary directory are still
+-  present before it cleans them.
+-
+-- Issue #8374: Update the internal alias table in the ``locale`` module to
+-  cover recent locale changes and additions.
+-
+-- Issue #8321: Give access to OpenSSL version numbers from the `ssl` module,
+-  using the new attributes `ssl.OPENSSL_VERSION`, `ssl.OPENSSL_VERSION_INFO` and
+-  `ssl.OPENSSL_VERSION_NUMBER`.
+-
+-- Add functools.total_ordering() and functools.cmp_to_key().
+-
+-- Issue #8257: The Decimal construct now accepts a float instance directly,
+-  converting that float to a Decimal of equal value:
+-
+-     >>> Decimal(1.1)
+-     Decimal('1.100000000000000088817841970012523233890533447265625')
+-
+-- Issue #8294: The Fraction constructor now accepts Decimal and float instances
+-  directly.
+-
+-- Issue #7279: Comparisons involving a Decimal signaling NaN now signal
+-  InvalidOperation instead of returning False.  (Comparisons involving a quiet
+-  NaN are unchanged.)  Also, Decimal quiet NaNs are now hashable; Decimal
+-  signaling NaNs remain unhashable.
+-
+-- Issue #2531: Comparison operations between floats and Decimal instances now
+-  return a result based on the numeric values of the operands; previously they
+-  returned an arbitrary result based on the relative ordering of id(float) and
+-  id(Decimal).  See also issue #8188, which adds Decimal-to-Fraction
+-  comparisons.
+-
+-- Added a subtract() method to collections.Counter().
+-
+-- Issue #8233: When run as a script, py_compile.py optionally takes a single
+-  argument `-` which tells it to read files to compile from stdin.  Each line is
+-  read on demand and the named file is compiled immediately.  (Original patch by
+-  Piotr Ożarowski).
+-
+-- Backwards incompatible change: Unicode codepoints line tabulation (0x0B) and
+-  form feed (0x0C) are now considered linebreaks, as specified in Unicode
+-  Standard Annex #14.  See issue #7643.  http://www.unicode.org/reports/tr14/
+-
+-- Comparisons using one of <, <=, >, >= between a complex instance and a
+-  Fractions instance now raise TypeError instead of returning True/False.  This
+-  makes Fraction <=> complex comparisons consistent with int <=> complex, float
+-  <=> complex, and complex <=> complex comparisons.
+-
+-- Issue #8139: ossaudiodev didn't initialize its types properly, therefore some
+-  methods (such as oss_mixer_device.fileno()) were not available.  Initial patch
+-  by Bertrand Janin.
+-
+-- Issue #8205: Remove the "Modules" directory from sys.path when Python is
+-  running from the build directory (POSIX only).
+-
+-- Issue #7512: shutil.copystat() could raise an OSError when the filesystem
+-  didn't support chflags() (for example ZFS under FreeBSD).  The error is now
+-  silenced.
+-
+-- Issue #7860: platform.uname now reports the correct 'machine' type when Python
+-  is running in WOW64 mode on 64 bit Windows.
+-
+-- Issue #3890, #8222: Fix recv() and recv_into() on non-blocking SSL sockets.
+-  Also, enable the SSL_MODE_AUTO_RETRY flag on SSL sockets, so that blocking
+-  reads and writes are always retried by OpenSSL itself.
+-
+-- Issue #4282: Fix the main function of the profile module for a non-ASCII
+-  script, open the file in binary mode and not in text mode with the default
+-  (utf8) encoding.
+-
+-- Issue #8179: Fix macpath.realpath() on a non-existing path.
+-
+-- Issue #8024: Update the Unicode database to 5.2.
+-
+-- Issue #8168: py_compile now handles files with utf-8 BOMS.
+-
+-- ``tokenize.detect_encoding`` now returns ``'utf-8-sig'`` when a UTF-8 BOM is
+-  detected.
+-
+-- Issue #6716/2: Backslash-replace error output in compilall.
+-
+-- Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox
+-  with Tcl/Tk-8.5.
+-
+-- Issue #8140: extend compileall to compile single files.  Add -i option.
+-
+-- Issue #7356: ctypes.util: Make parsing of ldconfig output independent of the
+-  locale.
+-
+-- The internals of the subprocess module on POSIX systems have been replaced by
+-  an extension module (_posixsubprocess) so that the fork()+exec() can be done
+-  safely without the possibility of deadlock in multithreaded applications.
+-
+-- subprocess.Popen now has restore_signals and start_new_session features.  The
+-  default of restore_signals=True is a new behavior compared to earlier Python
+-  versions.  This means that signals such as SIGPIPE are not ignored by default
+-  in subprocesses launched by Python (Issue #1652).
+-
+-- Issue #6472: The xml.etree package is updated to ElementTree 1.3.  The
+-  cElementTree module is updated too.
+-
+-- Issue #7774: Set sys.executable to an empty string if argv[0] has been set to
+-  an non existent program name and Python is unable to retrieve the real program
+-  name.
+-
+-- Issue #7880: Fix sysconfig when the python executable is a symbolic link.
+-
+-- Issue #6509: fix re.sub to work properly when the pattern, the string, and the
+-  replacement were all bytes.  Patch by Antoine Pitrou.
+-
+-- The sqlite3 module was updated to pysqlite 2.6.0. This fixes several obscure
+-  bugs and allows loading SQLite extensions from shared libraries.
+-
+-- Issue #1054943: Fix ``unicodedata.normalize('NFC', text)`` for the Public
+-  Review Issue #29 (http://unicode.org/review/pr-29.html).
+-
+-- Issue #7494: fix a crash in _lsprof (cProfile) after clearing the profiler,
+-  reset also the pointer to the current pointer context.
+-
+-- Issue #7232: Add support for the context manager protocol to the TarFile
+-  class.
+-
+-- Issue #7250: Fix info leak of os.environ across multi-run uses of
+-  wsgiref.handlers.CGIHandler.
+-
+-- Issue #1729305: Fix doctest to handle encode error with "backslashreplace".
+-
+-- Issue #691291: codecs.open() should not convert end of lines on reading and
+-  writing.
+-
+-- Issue #7869: logging: improved diagnostic for format-time errors.
+-
+-- Issue #7868: logging: added loggerClass attribute to Manager.
+-
+-- logging: Implemented PEP 391.
+-
+-- Issue #1537721: Add a writeheader() method to csv.DictWriter.
+-
+-- Issue #7959: ctypes callback functions are now registered correctly with the
+-  cycle garbage collector.
+-
+-- Issue #5801: removed spurious empty lines in wsgiref.
+-
+-- Issue #6666: fix bug in trace.py that applied the list of directories to be
+-  ignored only to the first file.  Noted by Bogdan Opanchuk.
+-
+-- Issue #7597: curses.use_env() can now be called before initscr().  Noted by
+-  Kan-Ru Chen.
+-
+-- Issue #7310: fix the __repr__ of os.environ to show the environment variables.
+-
+-- Issue #7970: email.Generator.flatten now correctly flattens message/rfc822
+-  messages parsed by email.Parser.HeaderParser.
+-
+-- Issue #7361: Importlib was not properly checking the number of bytes in
+-  bytecode file when it was less then 8 bytes.
+-
+-- Issue #7633: In the decimal module, Context class methods (with the exception
+-  of canonical and is_canonical) now accept instances of int and long wherever a
+-  Decimal instance is accepted, and implicitly convert that argument to Decimal.
+-  Previously only some arguments were converted.
+-
+-- Issue #7835: shelve should no longer produce mysterious warnings during
+-  interpreter shutdown.
+-
+-- Issue #2746: Don't escape ampersands and angle brackets ("&", "<", ">") in XML
+-  processing instructions and comments.  These raw characters are allowed by the
+-  XML specification, and are necessary when outputting e.g.  PHP code in a
+-  processing instruction.  Patch by Neil Muller.
+-
+-- Issue #6233: ElementTree failed converting unicode characters to XML entities
+-  when they could't be represented in the requested output encoding.  Patch by
+-  Jerry Chen.
+-
+-- Issue #6003: add an argument to ``zipfile.Zipfile.writestr`` to specify the
+-  compression type.
+-
+-- Issue #4772: Raise a ValueError when an unknown Bluetooth protocol is
+-  specified, rather than fall through to AF_PACKET (in the `socket` module).
+-  Also, raise ValueError rather than TypeError when an unknown TIPC address type
+-  is specified.  Patch by Brian Curtin.
+-
+-- Issue #6939: Fix file I/O objects in the `io` module to keep the original file
+-  position when calling `truncate()`.  It would previously change the file
+-  position to the given argument, which goes against the tradition of
+-  ftruncate() and other truncation APIs.  Patch by Pascal Chambon.
+-
+-- Issue #7610: Reworked implementation of the internal
+-  ``zipfile.ZipExtFile`` class used to represent files stored inside an
+-  archive.  The new implementation is significantly faster and can be wrapped in
+-  a ``io.BufferedReader`` object for more speedups.  It also solves an
+-  issue where interleaved calls to `read()` and `readline()` give wrong results.
+-  Patch by Nir Aides.
+-
+-- Issue #6963: Added "maxtasksperchild" argument to multiprocessing.Pool,
+-  allowing for a maximum number of tasks within the pool to be completed by the
+-  worker before that worker is terminated, and a new one created to replace it.
+-
+-- Issue #7792: Registering non-classes to ABCs raised an obscure error.
+-
+-- Issue #7785: Don't accept bytes in FileIO.write().
+-
+-- Removed the functions 'verify' and 'vereq' from Lib/test/support.py.
+-
+-- Issue #7773: Fix an UnboundLocalError in platform.linux_distribution() when
+-  the release file is empty.
+-
+-- Issue #7561: Fix crashes when using bytearray objects with the posix
+-  module.
+-
+-- Issue #1670765: Prevent email.generator.Generator from re-wrapping headers in
+-  multipart/signed MIME parts, which fixes one of the sources of invalid
+-  modifications to such parts by Generator.
+-
+-- Issue #7703: Add support for the new buffer API to `binascii.a2bhqx`.  Patch
+-  by Florent Xicluna, along with some additional tests.
+-
+-- Issue #7701: Fix crash in binascii.b2a_uu() in debug mode when given a 1-byte
+-  argument.  Patch by Victor Stinner.
+-
+-- Issue #3299: Fix possible crash in the _sre module when given bad argument
+-  values in debug mode.  Patch by Victor Stinner.
+-
+-- Issue #2846: Add support for gzip.GzipFile reading zero-padded files.  Patch
+-  by Brian Curtin.
+-
+-- Issue #7681: Use floor division in appropiate places in the wave module.
+-
+-- Issue #5372: Drop the reuse of .o files in Distutils' ccompiler (since
+-  Extension extra options may change the output without changing the .c
+-  file). Initial patch by Collin Winter.
+-
+-- Issue #7617: Make sure distutils.unixccompiler.UnixCCompiler recognizes gcc
+-  when it has a fully qualified configuration prefix. Initial patch by Arfrever.
+-
+-- Issue #7105: Make WeakKeyDictionary and WeakValueDictionary robust against the
+-  destruction of weakref'ed objects while iterating.
+-
+-- Issue #7455: Fix possible crash in cPickle on invalid input.  Patch by Victor
+-  Stinner.
+-
+-- Issue #1628205: Socket file objects returned by socket.socket.makefile() now
+-  properly handles EINTR within the read, readline, write & flush methods.  The
+-  socket.sendall() method now properly handles interrupted system calls.
+-
+-- Issue #7471: Improve the performance of GzipFile's buffering mechanism, and
+-  make it implement the `io.BufferedIOBase` ABC to allow for further speedups by
+-  wrapping it in an `io.BufferedReader`.  Patch by Nir Aides.
+-
+-- Issue #3972: http.client.HTTPConnection now accepts an optional source_address
+-  parameter to allow specifying where your connections come from.
+-
+-- socket.create_connection now accepts an optional source_address parameter.
+-
+-- Issue #5511: now zipfile.ZipFile can be used as a context manager.  Initial
+-  patch by Brian Curtin.
+-
+-- Issue #7556: Make sure Distutils' msvc9compile reads and writes the MSVC XML
+-  Manifest file in text mode so string patterns can be used in regular
+-  expressions.
+-
+-- Issue #7552: Removed line feed in the base64 Authorization header in the
+-  Distutils upload command to avoid an error when PyPI reads it.  This occurs on
+-  long passwords. Initial patch by JP St. Pierre.
+-
+-- Issue #7231: urllib2 cannot handle https with proxy requiring auth.  Patch by
+-  Tatsuhiro Tsujikawa.
+-
+-- Issue #4757: `zlib.compress` and other methods in the zlib module now raise a
+-  TypeError when given an `str` object (rather than a `bytes`-like object).
+-  Patch by Victor Stinner and Florent Xicluna.
+-
+-- Issue #7349: Make methods of file objects in the io module accept None as an
+-  argument where file-like objects (ie StringIO and BytesIO) accept them to mean
+-  the same as passing no argument.
+-
+-- Issue #7357: tarfile no longer suppresses fatal extraction errors by default.
+-
+-- Issue #5949: added check for correct lineends in input from IMAP server in
+-  imaplib.
+-
+-- Add count() and reverse() methods to collections.deque().
+-
+-- Fix variations of extending deques:  d.extend(d)  d.extendleft(d)  d+=d
+-
+-- Issue #6986: Fix crash in the JSON C accelerator when called with the wrong
+-  parameter types.  Patch by Victor Stinner.
+-
+-- Issue #7457: added a read_pkg_file method to
+-  distutils.dist.DistributionMetadata.
+-
+-- logging: Added optional `secure` parameter to SMTPHandler, to enable use of
+-  TLS with authentication credentials.
+-
+-- Issue #1923: Fixed the removal of meaningful spaces when PKG-INFO is generated
+-  in Distutils.  Patch by Stephen Emslie.
+-
+-- Issue #4120: Drop reference to CRT from manifest when building extensions with
+-  msvc9compiler.
+-
+-- Issue #7333: The `posix` module gains an `initgroups()` function providing
+-  access to the initgroups(3) C library call on Unix systems which implement it.
+-  Patch by Jean-Paul Calderone.
+-
+-- Issue #7408: Fixed distutils.tests.sdist so it doesn't check for group
+-  ownership when the group is not forced, because the group may be different
+-  from the user's group and inherit from its container when the test is run.
+-
+-- Issue #4486: When an exception has an explicit cause, do not print its
+-  implicit context too.  This affects the `traceback` module as well as built-in
+-  exception printing.
+-
+-- Issue #1515: Enable use of deepcopy() with instance methods.  Patch by Robert
+-  Collins.
+-
+-- Issue #7403: logging: Fixed possible race condition in lock creation.
+-
+-- Issue #6845: Add restart support for binary upload in ftplib.  The
+-  `storbinary()` method of FTP and FTP_TLS objects gains an optional `rest`
+-  argument.  Patch by Pablo Mouzo.
+-
+-- Issue #5788: `datetime.timedelta` objects get a new `total_seconds()` method
+-  returning the total number of seconds in the duration.  Patch by Brian
+-  Quinlan.
+-
+-- Issue #7133: SSL objects now support the new buffer API.
+-
+-- Issue #1488943: difflib.Differ() doesn't always add hints for tab characters.
+-
+-- Issue #6123: tarfile now opens empty archives correctly and consistently
+-  raises ReadError on empty files.
+-
+-- Issue #7354: distutils.tests.test_msvc9compiler - dragfullwindows can be 2.
+-
+-- Issue #5037: Proxy the __bytes__ special method instead to __bytes__ instead
+-  of __str__.
+-
+-- Issue #7341: Close the internal file object in the TarFile constructor in case
+-  of an error.
+-
+-- Issue #7293: distutils.test_msvc9compiler is fixed to work on any fresh
+-  Windows box. Help provided by David Bolen.
+-
+-- Issue #2054: ftplib now provides an FTP_TLS class to do secure FTP using TLS
+-  or SSL.  Patch by Giampaolo Rodola'.
+-
+-- Issue #7328: pydoc no longer corrupts sys.path when run with the '-m' switch.
+-
+-- Issue #4969: The mimetypes module now reads the MIME database from the
+-  registry under Windows.  Patch by Gabriel Genellina.
+-
+-- Issue #6816: runpy now provides a run_path function that allows Python code to
+-  execute file paths that refer to source or compiled Python files as well as
+-  zipfiles, directories and other valid sys.path entries that contain a
+-  __main__.py file.  This allows applications that run other Python scripts to
+-  support the same flexibility as the CPython command line itself.
+-
+-- Issue #7318: multiprocessing now uses a timeout when it fails to establish a
+-  connection with another process, rather than looping endlessly.  The default
+-  timeout is 20 seconds, which should be amply sufficient for local connections.
+-
+-- Issue #7197: Allow unittest.TextTestRunner objects to be pickled and
+-  unpickled.  This fixes crashes under Windows when trying to run
+-  test_multiprocessing in verbose mode.
+-
+-- Issue #7893: ``unittest.TextTestResult`` is made public and a ``resultclass``
+-  argument added to the TextTestRunner constructor allowing a different result
+-  class to be used without having to subclass.
+-
+-- Issue #7588: ``unittest.TextTestResult.getDescription`` now includes the test
+-  name in failure reports even if the test has a docstring.
+-
+-- Issue #3001: Add a C implementation of recursive locks which is used by
+-  default when instantiating a `threading.RLock` object. This makes recursive
+-  locks as fast as regular non-recursive locks (previously, they were slower by
+-  10x to 15x).
+-
+-- Issue #7282: Fix a memory leak when an RLock was used in a thread other than
+-  those started through `threading.Thread` (for example, using
+-  `_thread.start_new_thread()`).
+-
+-- Issue #7187: Importlib would not silence the IOError raised when trying to
+-  write new bytecode when it was made read-only.
+-
+-- Issue #7264: Fix a possible deadlock when deallocating thread-local objects
+-  which are part of a reference cycle.
+-
+-- Issue #7211: Allow 64-bit values for the `ident` and `data` fields of kevent
+-  objects on 64-bit systems.  Patch by Michael Broghton.
+-
+-- Issue #6896: mailbox.Maildir now invalidates its internal cache each time a
+-  modification is done through it.  This fixes inconsistencies and test failures
+-  on systems with slightly bogus mtime behaviour.
+-
+-- Issue #7246 & Issue #7208: getpass now properly flushes input before reading
+-  from stdin so that existing input does not confuse it and lead to incorrect
+-  entry or an IOError.  It also properly flushes it afterwards to avoid the
+-  terminal echoing the input afterwards on OSes such as Solaris.
+-
+-- Issue #7233: Fix a number of two-argument Decimal methods to make sure that
+-  they accept an int or long as the second argument.  Also fix buggy handling of
+-  large arguments (those with coefficient longer than the current precision) in
+-  shift and rotate.
+-
+-- Issue #4750: Store the basename of the original filename in the gzip FNAME
+-  header as required by RFC 1952.
+-
+-- Issue #1180: Added a new global option to ignore ~/.pydistutils.cfg in
+-  Distutils.
+-
+-- Issue #7218: Fix test_site for win32, the directory comparison was done with
+-  an uppercase.
+-
+-- Issue #7205: Fix a possible deadlock when using a BZ2File object from
+-  several threads at once.
+-
+-- Issue #7077: logging: SysLogHandler now treats Unicode as per RFC 5424.
+-
+-- Issue #7099: Decimal.is_normal now returns True for numbers with exponent
+-  larger than emax.
+-
+-- Issue #7080: locale.strxfrm() raises a MemoryError on 64-bit non-Windows
+-  platforms, and assorted locale fixes by Derk Drukker.
+-
+-- Issue #5833: Fix extra space character in readline completion with the GNU
+-  readline library version 6.0.
+-
+-- Issue #6894: Fixed the issue urllib2 doesn't respect "no_proxy" environment.
+-
+-- Issue #7086: Added TCP support to SysLogHandler, and tidied up some
+-  anachronisms in the code which were a relic of 1.5.2 compatibility.
+-
+-- Issue #7082: When falling back to the MIME 'name' parameter, the correct place
+-  to look for it is the Content-Type header.
+-
+-- Make tokenize.detect_coding() normalize utf-8 and iso-8859-1 variants like the
+-  builtin tokenizer.
+-
+-- Issue #7048: Force Decimal.logb to round its result when that result is too
+-  large to fit in the current precision.
+-
+-- Issue #6236, #6348: Fix various failures in the I/O library under AIX and
+-  other platforms, when using a non-gcc compiler. Patch by Derk Drukker.
+-
+-- Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...)  does now
+-  always result in NULL.
+-
+-- Issue #5042: Structure sub-subclass does now initialize correctly with base
+-  class positional arguments.
+-
+-- Issue #6882: Import uuid creates zombies processes.
+-
+-- Issue #6635: Fix profiler printing usage message.
+-
+-- Issue #6856: Add a filter keyword argument to TarFile.add().
+-
+-- Issue #6888: pdb's alias command was broken when no arguments were given.
+-
+-- Issue #6857: Default format() alignment should be '>' for Decimal instances.
+-
+-- Issue #6795: int(Decimal('nan')) now raises ValueError instead of returning
+-  NaN or raising InvalidContext.  Also, fix infinite recursion in
+-  long(Decimal('nan')).
+-
+-- Issue #6850: Fix bug in Decimal._parse_format_specifier for formats with no
+-  type specifier.
+-
+-- Issue #6239: ctypes.c_char_p return value must return bytes.
+-
+-- Issue #6838: Use a list to accumulate the value instead of repeatedly
+-  concatenating strings in http.client's HTTPResponse._read_chunked providing a
+-  significant speed increase when downloading large files servend with a
+-  Transfer-Encoding of 'chunked'.
+-
+-- Trying to import a submodule from a module that is not a package, ImportError
+-  should be raised, not AttributeError.
+-
+-- When the globals past to importlib.__import__() has __package__ set to None,
+-  fall back to computing what __package__ should be instead of giving up.
+-
+-- Raise a TypeError when the name of a module to be imported for
+-  importlib.__import__ is not a string (was raising an AttributeError before).
+-
+-- Allow the fromlist passed into importlib.__import__ to be any iterable.
+-
+-- Have importlib raise ImportError if None is found in sys.modules.
+-
+-- Issue #6054: Do not normalize stored pathnames in tarfile.
+-
+-- Issue #6794: Fix Decimal.compare_total and Decimal.compare_total_mag: NaN
+-  payloads are now ordered by integer value rather than lexicographically.
+-
+-- Issue #1356969: Add missing info methods in tix.HList.
+-
+-- Issue #1522587: New constants and methods for the tix.Grid widget.
+-
+-- Issue #1250469: Fix the return value of tix.PanedWindow.panes.
+-
+-- Issue #1119673: Do not override tkinter.Text methods when creating a
+-  ScrolledText.
+-
+-- Issue #6665: Fix fnmatch to properly match filenames with newlines in them.
+-
+-- Issue #1135: Add the XView and YView mix-ins to avoid duplicating the xview*
+-  and yview* methods.
+-
+-- Issue #6629: Fix a data corruption issue in the new I/O library, which could
+-  occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
+-  "wb+" mode) after having buffered a certain amount of data for reading. This
+-  bug was not present in the pure Python implementation.
+-
+-- Issue #6622: Fix "local variable 'secret' referenced before assignment" bug in
+-  POP3.apop.
+-
+-- Issue #2715: Remove remnants of Carbon.File from binhex module.
+-
+-- Issue #6595: The Decimal constructor now allows arbitrary Unicode decimal
+-  digits in input, as recommended by the standard.  Previously it was restricted
+-  to accepting [0-9].
+-
+-- Issue #6106: telnetlib.Telnet.process_rawq doesn't handle default WILL/WONT
+-  DO/DONT correctly.
+-
+-- Issue #1424152: Fix for http.client, urllib.request to support SSL while
+-  working through proxy.  Original patch by Christopher Li, changes made by
+-  Senthil Kumaran.
+-
+-- Add importlib.abc.ExecutionLoader to represent the PEP 302 protocol for
+-  loaders that allow for modules to be executed. Both importlib.abc.PyLoader and
+-  PyPycLoader inherit from this class and provide implementations in relation to
+-  other methods required by the ABCs.
+-
+-- importlib.abc.PyLoader did not inherit from importlib.abc.ResourceLoader like
+-  the documentation said it did even though the code in PyLoader relied on the
+-  abstract method required by ResourceLoader.
+-
+-- Issue #6431: Make Fraction type return NotImplemented when it doesn't know how
+-  to handle a comparison without loss of precision.  Also add correct handling
+-  of infinities and nans for comparisons with float.
+-
+-- Issue #6415: Fixed warnings.warn segfault on bad formatted string.
+-
+-- Issue #6358: The exit status of a command started with os.popen() was reported
+-  differently than it did with python 2.x.
+-
+-- Issue #6323: The pdb debugger did not exit when running a script with a syntax
+-  error.
+-
+-- Issue #3392: The subprocess communicate() method no longer fails in select()
+-  when file descriptors are large; communicate() now uses poll() when possible.
+-
+-- Issue #6369: Fix an RLE decompression bug in the binhex module.
+-
+-- Issue #6344: Fixed a crash of mmap.read() when passed a negative argument.
+-
+-- The deprecated function string.maketrans has been removed.
+-
+-- Issue #4005: Fixed a crash of pydoc when there was a zip file present in
+-  sys.path.
+-
+-- Issue #6218: io.StringIO and io.BytesIO instances are now picklable.
+-
+-- The os.get_exec_path() function to return the list of directories that will be
+-  searched for an executable when launching a subprocess was added.
+-
+-- Issue #7481: When a threading.Thread failed to start it would leave the
+-  instance stuck in initial state and present in threading.enumerate().
+-
+-- Issue #1068268: The subprocess module now handles EINTR in internal os.waitpid
+-  and os.read system calls where appropriate.
+-
+-- Issue #6729: Added ctypes.c_ssize_t to represent ssize_t.
+-
+-- Issue #6247: The argparse module has been added to the standard library.
+-
+-- Issue #8235: _socket: Add the constant ``SO_SETFIB``.  SO_SETFIB is a socket
+-  option available on FreeBSD 7.1 and newer.
+-
+-- Issue #9315: Fix for the trace module to record correct class name
+-  for tracing methods.
+-
+-Extension Modules
+------------------
+-
+-- Issue #9959: Tweak formula used for computing math.log of an integer,
+-  making it marginally more accurate for exact powers of 2.
+-
+-- Issue #9422: Fix memory leak when re-initializing a struct.Struct object.
+-
+-- Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly
+-  compared to other unix systems. In particular, os.getgroups() does not reflect
+-  any changes made using os.setgroups() but basicly always returns the same
+-  information as the id command. os.getgroups() can now return more than 16
+-  groups on MacOSX.
+-
+-- Issue #6095: Make directory argument to os.listdir optional.
+-
+-- Issue #9277: Fix bug in struct.pack for bools in standard mode (e.g.,
+-  struct.pack('>?')): if conversion to bool raised an exception then that
+-  exception wasn't properly propagated on machines where char is unsigned.
+-
+-- Issue #5180: Fixed a bug that prevented loading 2.x pickles in 3.x python when
+-  they contain instances of old-style classes.
+-
+-- Issue #9165: Add new functions math.isfinite and cmath.isfinite, to accompany
+-  existing isinf and isnan functions.
+-
+-- Issue #1578269: Implement os.symlink for Windows 6.0+.  Patch by Jason
+-  R. Coombs.
+-
+-- In struct.pack, correctly propogate exceptions from computing the truth of an
+-  object in the '?' format.
+-
+-- Issue #9000: datetime.timezone objects now have eval-friendly repr.
+-
+-- In the math module, correctly lookup __trunc__, __ceil__, and __floor__ as
+-  special methods.
+-
+-- Issue #9005: Prevent utctimetuple() from producing year 0 or year 10,000.
+-  Prior to this change, timezone adjustment in utctimetuple() could produce
+-  tm_year value of 0 or 10,000.  Now an OverflowError is raised in these edge
+-  cases.
+-
+-- Issue #6641: The ``datetime.strptime`` method now supports the ``%z``
+-  directive.  When the ``%z`` directive is present in the format string, an
+-  aware ``datetime`` object is returned with ``tzinfo`` bound to a
+-  ``datetime.timezone`` instance constructed from the parsed offset.  If both
+-  ``%z`` and ``%Z`` are present, the data in ``%Z`` field is used for timezone
+-  name, but ``%Z`` data without ``%z`` is discarded.
+-
+-- Issue #5094: The ``datetime`` module now has a simple concrete class
+-  implementing ``datetime.tzinfo`` interface.  Instances of the new class,
+-  ``datetime.timezone``, return fixed name and UTC offset from their
+-  ``tzname(dt)`` and ``utcoffset(dt)`` methods.  The ``dst(dt)`` method always
+-  returns ``None``.  A class attribute, ``utc`` contains an instance
+-  representing the UTC timezone.  Original patch by Rafe Kaplan.
+-
+-- Issue #8973: Add __all__ to struct module; this ensures that help(struct)
+-  includes documentation for the struct.Struct class.
+-
+-- Issue #3129: Trailing digits in struct format string are no longer ignored.
+-  For example, "1" or "ilib123" are now invalid formats and cause
+-  ``struct.error`` to be raised.  Patch by Caleb Deveraux.
+-
+-- Issue #7384: If the system readline library is linked against ncurses, the
+-  curses module must be linked against ncurses as well. Otherwise it is not safe
+-  to load both the readline and curses modules in an application.
+-
+-- Issue #2810: Fix cases where the Windows registry API returns ERROR_MORE_DATA,
+-  requiring a re-try in order to get the complete result.
+-
+-- Issue #8692: Optimize math.factorial: replace the previous naive algorithm
+-  with an improved 'binary-split' algorithm that uses fewer multiplications and
+-  allows many of the multiplications to be performed using plain C integer
+-  arithmetic instead of PyLong arithmetic.  Also uses a lookup table for small
+-  arguments.
+-
+-- Issue #8674: Fixed a number of incorrect or undefined-behaviour-inducing
+-  overflow checks in the audioop module.
+-
+-- Issue #8644: The accuracy of td.total_seconds() has been improved (by
+-  calculating with integer arithmetic instead of float arithmetic internally):
+-  the result is now always correctly rounded, and is equivalent to ``td /
+-  timedelta(seconds=1)``.
+-
+-- Issue #2706: Allow division of a timedelta by another timedelta: timedelta /
+-  timedelta, timedelta % timedelta, timedelta // timedelta and divmod(timedelta,
+-  timedelta) are all supported.
+-
+-- Issue #8314: Fix unsigned long long bug in libffi on Sparc v8.
+-
+-- Issue #8300: When passing a non-integer argument to struct.pack with any
+-  integer format code, struct.pack first attempts to convert the non-integer
+-  using its __index__ method.  If that method is non-existent or raises
+-  TypeError it goes on to try the __int__ method, as described below.
+-
+-- Issue #8142: Update libffi to the 3.0.9 release.
+-
+-- Issue #6949: Allow the _dbm extension to be built with db 4.8.x.
+-
+-- Issue #6544: Fix a reference leak in the kqueue implementation's error
+-  handling.
+-
+-- Stop providing crtassem.h symbols when compiling with Visual Studio 2010, as
+-  msvcr100.dll is not a platform assembly anymore.
+-
+-- Issue #6508: Add posix.{getresuid,getresgid,setresuid,setresgid}.
+-
+-- Issue #7078: Set struct.__doc__ from _struct.__doc__.
+-
+-- Issue #3366: Add erf, erfc, expm1, gamma, lgamma functions to math module.
+-
+-- Issue #6877: It is now possible to link the readline extension to the libedit
+-  readline emulation on OSX 10.5 or later.
+-
+-- Issue #6848: Fix curses module build failure on OS X 10.6.
+-
+-- Fix a segfault that could be triggered by expat with specially formed input.
+-
+-- Issue #6561: '\d' in a regex now matches only characters with Unicode category
+-  'Nd' (Number, Decimal Digit).  Previously it also matched characters with
+-  category 'No'.
+-
+-- Issue #4509: Array objects are no longer modified after an operation failing
+-  due to the resize restriction in-place when the object has exported buffers.
+-
+-- Issue #2389: Array objects are now pickled in a portable manner.
+-
+-- Expat: Fix DoS via XML document with malformed UTF-8 sequences
+-  (CVE_2009_3560).
+-
+-- Issue #7242: On Solaris 9 and earlier calling os.fork() from within a thread
+-  could raise an incorrect RuntimeError about not holding the import lock.  The
+-  import lock is now reinitialized after fork.
+-
+-- Issue #7999: os.setreuid() and os.setregid() would refuse to accept a -1
+-  parameter on some platforms such as OS X.
+-
+-- Build the ossaudio extension on GNU/kFreeBSD.
+-
+-- Issue #7347: winreg: Add CreateKeyEx and DeleteKeyEx, as well as fix a bug in
+-  the return value of QueryReflectionKey.
+-
+-- Issue #7567: PyCurses_setupterm: Don't call ``setupterm`` twice.
+-
+-Build
+------
+-
+-- Use OpenSSL 1.0.0a on Windows.
+-
+-- Issue #9280: Make sharedinstall depend on sharedmods.
+-
+-- Issue #9189: Make a user-specified CFLAGS, CPPFLAGS, or LDFLAGS setting
+-  override the configure and makefile defaults, without deleting options the
+-  user didn't intend to override.  Developers should no longer need to specify
+-  OPT or EXTRA_CFLAGS, although those variables are still present for
+-  backward-compatibility.
+-
+-- Issue #8854: Fix finding Visual Studio 2008 on Windows x64.
+-
+-- Issue #1759169, #8864: Drop _XOPEN_SOURCE on Solaris, define it for
+-  multiprocessing only.
+-
+-- Issue #8625: Turn off optimization in --with-pydebug builds with gcc.
+-  (Optimization was unintentionally turned on in gcc --with-pydebug builds as a
+-  result of the issue #1628484 fix, combined with autoconf's strange choice of
+-  default CFLAGS produced by AC_PROG_CC for gcc.)
+-
+-- Issue #3646: It is now easily possible to install a Python framework into your
+-  home directory on MacOSX, see Mac/README for more information.
+-
+-- Issue #3928: os.mknod() now available in Solaris, also.
+-
+-- Issue #3326: Build Python without -fno-strict-aliasing when the gcc does not
+-  give false warnings.
+-
+-- Issue #1628484: The Makefile doesn't ignore the CFLAGS environment variable
+-  anymore.  It also forwards the LDFLAGS settings to the linker when building a
+-  shared library.
+-
+-- Issue #6716: Quote -x arguments of compileall in MSI installer.  Exclude 2to3
+-  tests from compileall.
+-
+-- Issue #3920, #7903: Define _BSD_SOURCE on OpenBSD 4.4 through 4.9.
+-
+-- Issue #7632: When Py_USING_MEMORY_DEBUGGER is defined, disable the private
+-  memory allocation scheme in dtoa.c and use PyMem_Malloc and PyMem_Free
+-  instead.  Also disable caching of powers of 5.
+-
+-- Issue #6491: Allow --with-dbmliborder to specify that no dbms will be built.
+-
+-- Issue #6943: Use pkg-config to find the libffi headers when the
+-  --with-system-ffi flag is used.
+-
+-- Issue #7609: Add a --with-system-expat option that causes the system's expat
+-  library to be used for the pyexpat module instead of the one included with
+-  Python.
+-
+-- Issue #7589: Only build the nis module when the correct header files are
+-  found.
+-
+-- Switch to OpenSSL 0.9.8l and sqlite 3.6.21 on Windows.
+-
+-- Issue #5792: Extend the short float repr support to x86 systems using
+-  icc or suncc.
+-
+-- Issue #6603: Change READ_TIMESTAMP macro in ceval.c so that it compiles
+-  correctly under gcc on x86-64.  This fixes a reported problem with the
+-  --with-tsc build on x86-64.
+-
+-- Issue #6802: Fix build issues on MacOSX 10.6.
+-
+-- Issue #6244: Allow detect_tkinter to look for Tcl/Tk 8.6.
+-
+-- Issue #4601: 'make install' did not set the appropriate permissions on
+-  directories.
+-
+-- Issue #5390: Add uninstall icon independent of whether file extensions are
+-  installed.
+-
+-- Issue #7541: When using ``python-config`` with a framework install the
+-  compiler might use the wrong library.
+-
+-- python-config now supports multiple options on the same command line.
+-
+-- Issue #8509: Fix quoting in help strings and code snippets in configure.in.
+-
+-- Issue #8510: Update to autoconf2.65.
+-
+-Documentation
+--------------
+-
+-- Issue #9817: Add expat COPYING file; add expat, libffi and expat licenses
+-  to Doc/license.rst.
+-
+-- Issue #9524: Document that two CTRL* signals are meant for use only
+-  with os.kill.
+-
+-- Issue #9255: Document that the 'test' package is meant for internal Python use
+-  only.
+-
+-- A small WSGI server was added as Tools/scripts/serve.py, and is used to
+-  implement a local documentation server via 'make serve' in the doc directory.
+-
+-- Updating `Using Python` documentation to include description of CPython's -J
+-  and -X options.
+-
+-- Document that importing a module that has None in sys.modules triggers an
+-  ImportError.
+-
+-- Issue #6556: Fixed the Distutils configuration files location explanation for
+-  Windows.
+-
+-- Update python manual page (options -B, -O0, -s, environment variables
+-  PYTHONDONTWRITEBYTECODE, PYTHONNOUSERSITE).
+-
+-- Issue #8909: Added the size of the bitmap used in the installer created by
+-  distutils' bdist_wininst. Patch by Anatoly Techtonik.
+-
+-Tests
+------
+-
+-- Issue #9251: test_threaded_import didn't fail when run through regrtest if the
+-  import lock was disabled.
+-
+-- Issue #8605: Skip test_gdb if Python is compiled with optimizations.
+-
+-- Issue #7449: Skip test_socketserver if threading support is disabled.
+-
+-- Issue #8672: Add a zlib test ensuring that an incomplete stream can be handled
+-  by a decompressor object without errors (it returns incomplete uncompressed
+-  data).
+-
+-- Issue #8533: regrtest uses backslashreplace error handler for stdout to avoid
+-  UnicodeEncodeError (write non-ASCII character to stdout using ASCII encoding).
+-
+-- Issue #8576: Remove use of find_unused_port() in test_smtplib and
+-  test_multiprocessing.  Patch by Paul Moore.
+-
+-- Issue #7449: Fix many tests to support Python compiled without thread
+-  support. Patches written by Jerry Seutter.
+-
+-- Issue #8108: test_ftplib's non-blocking SSL server now has proper handling of
+-  SSL shutdowns.
+-
+-- Issues #8279, #8330, #8437, #8480, #8495: Fix test_gdb failures, patch written
+-  by Dave Malcolm.
+-
+-- Issue #3864: Skip three test_signal tests on freebsd6 because they fail if any
+-  thread was previously started, most likely due to a platform bug.
+-
+-- Issue #8193: Fix test_zlib failure with zlib 1.2.4.
+-
+-- Issue #8248: Add some tests for the bool type.  Patch by Gregory Nofi.
+-
+-- Issue #8263: Now regrtest.py will report a failure if it receives a
+-  KeyboardInterrupt (SIGINT).
+-
+-- Issue #8180 and #8207: Fix test_pep277 on OS X and add more tests for special
+-  Unicode normalization cases.
+-
+-- Issue #7783: test.support.open_urlresource invalidates the outdated files from
+-  the local cache.
+-
+-- Issue #7849: Now the utility ``check_warnings`` verifies if the warnings are
+-  effectively raised.
+-
+-- The four path modules (genericpath, macpath, ntpath, posixpath) share a common
+-  TestCase for some tests: test_genericpath.CommonTest.
+-
+-- Print platform information when running the whole test suite, or using the
+-  --verbose flag.
+-
+-- Issue #767675: enable test_pep277 on POSIX platforms with Unicode-friendly
+-  filesystem encoding.
+-
+-- Issue #6292: for the moment at least, the test suite runs cleanly if python is
+-  run with the -OO flag.  Tests requiring docstrings are skipped.
+-
+-- Issue #7712: test.support gained a new `temp_cwd` context manager which is now
+-  also used by regrtest to run all the tests in a temporary directory.  The
+-  original CWD is saved in `support.SAVEDCWD`.  Thanks to Florent Xicluna who
+-  helped with the patch.
+-
+-- Issue #7924: Fix an intermittent 'XXX undetected error' failure in test_capi
+-  (only seen so far on platforms where the curses module wasn't built), due to
+-  an uncleared exception.
+-
+-- Issue #7728: test_timeout was changed to use support.bind_port instead of a
+-  hard coded port.
+-
+-- Issue #7376: Instead of running a self-test (which was failing) when called
+-  with no arguments, doctest.py now gives a usage message.
+-
+-- Issue #7396: fix regrtest -s, which was broken by the -j enhancement.
+-
+-- Issue #7498: test_multiprocessing now uses test.support.find_unused_port
+-  instead of a hardcoded port number in test_rapid_restart.
+-
+-- Issue #7431: Use TESTFN in test_linecache instead of trying to create a file
+-  in the Lib/test directory, which might be read-only for the user running the
+-  tests.
+-
+-- Issue #7324: Add a sanity check to regrtest argument parsing to catch the case
+-  of an option with no handler.
+-
+-- Issue #7312: Add a -F flag to run the selected tests in a loop until a test
+-  fails.  Can be combined with -j.
+-
+-- Issue #6551: test_zipimport could import and then destroy some modules of the
+-  encodings package, which would make other tests fail further down the road
+-  because the internally cached encoders and decoders would point to empty
+-  global variables.
+-
+-- Issue #7295: Do not use a hardcoded file name in test_tarfile.
+-
+-- Issue #7270: Add some dedicated unit tests for multi-thread synchronization
+-  primitives such as Lock, RLock, Condition, Event and Semaphore.
+-
+-- Issue #7248 (part 2): Use a unique temporary directory for importlib source
+-  tests instead of tempfile.tempdir. This prevents the tests from sharing state
+-  between concurrent executions on the same system.
+-
+-- Issue #7248: In importlib.test.source.util a try/finally block did not make
+-  sure that some referenced objects actually were created in the block before
+-  calling methods on the object.
+-
+-- Issue #7222: Make thread "reaping" more reliable so that reference
+-  leak-chasing test runs give sensible results.  The previous method of reaping
+-  threads could return successfully while some Thread objects were still
+-  referenced.  This also introduces a new private function:
+-  ``_thread._count()``.
+-
+-- Issue #7151: Fixed regrtest -j so that output to stderr from a test no longer
+-  runs the risk of causing the worker thread to fail.
+-
+-- Issue #7055: test___all__ now greedily detects all modules which have an
+-  __all__ attribute, rather than using a hardcoded and incomplete list.
+-
+-- Issue #7058: Added save/restore for things like sys.argv and cwd to
+-  runtest_inner in regrtest, with warnings if the called test modifies them, and
+-  a new section in the summary report at the end.
+-
+-- Issue #7042: Fix test_signal (test_itimer_virtual) failure on OS X 10.6.
+-
+-- Fixed tests in importlib.test.source.test_abc_loader that were masking the
+-  proper exceptions that should be raised for missing or improper code object
+-  bytecode.
+-
+-- Removed importlib's custom test discovery code and switched to
+-  unittest.TestLoader.discover().
+-
+-Tools/Demos
+------------
+-
+-- Issue #5464, #8974: Implement plural forms in msgfmt.py.
+-
+-- iobench (a file I/O benchmark) and ccbench (a concurrency benchmark) were
+-  added to the `Tools/` directory.  They were previously living in the sandbox.
+-
+-
+-What's New in Python 3.1?
+-=========================
+-
+-*Release date: 27-June-2009*
+-
+-Core and Builtins
+------------------
+-
+-- Issue #6334: Fix bug in range length calculation for ranges with
+-  large arguments.
+-
+-- Issue #6329: Fixed iteration for memoryview objects (it was being blocked
+-  because it wasn't recognized as a sequence).
+-
+-Library
+--------
+-
+-- Issue #6126: Fixed pdb command-line usage.
+-
+-- Issue #6314: logging: performs extra checks on the "level" argument.
+-
+-- Issue #6274: Fixed possible file descriptors leak in subprocess.py
+-
+-- Accessing io.StringIO.buffer now raises an AttributeError instead of
+-  io.UnsupportedOperation.
+-
+-- Issue #6271: mmap tried to close invalid file handle (-1) when anonymous.
+-  (On Unix)
+-
+-- Issue #1202: zipfile module would cause a struct.error when attempting to
+-  store files with a CRC32 > 2**31-1.
+-
+-Extension Modules
+------------------
+-
+-- Issue #5590: Remove unused global variable in pyexpat extension.
+-
+-
+-What's New in Python 3.1 Release Candidate 2?
+-=============================================
+-
+-*Release date: 13-June-2009*
+-
+-Core and Builtins
+------------------
+-
+-- Fixed SystemError triggered by "range([], 1, -1)".
+-
+-- Issue #5924: On Windows, a large PYTHONPATH environment variable
+-  (more than 255 characters) would be completely ignored.
+-
+-- Issue #4547: When debugging a very large function, it was not always
+-  possible to update the lineno attribute of the current frame.
+-
+-- Issue #5330: C functions called with keyword arguments were not reported by
+-  the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
+-
+-Library
+--------
+-
+-- Issue #6438: Fixed distutils.cygwinccompiler.get_versions : the regular
+-  expression string pattern was trying to match against a bytes returned by
+-  Popen. Tested under win32 to build the py-postgresql project.
+-
+-- Issue #6258: Support AMD64 in bdist_msi.
+-
+-- Issue #6195: fixed doctest to no longer try to read 'source' data from
+-  binary files.
+-
+-- Issue #5262: Fixed bug in next rollover time computation in
+-  TimedRotatingFileHandler.
+-
+-- Issue #6217: The C implementation of io.TextIOWrapper didn't include the
+-  errors property.  Additionally, the errors and encoding properties of StringIO
+-  are always None now.
+-
+-- Issue #6137: The pickle module now translates module names when loading
+-  or dumping pickles with a 2.x-compatible protocol, in order to make data
+-  sharing and migration easier. This behaviour can be disabled using the
+-  new `fix_imports` optional argument.
+-
+-- Removed the ipaddr module.
+-
+-- Issue #3613: base64.{encode,decode}string are now called
+-  base64.{encode,decode}bytes which reflects what type they accept and return.
+-  The old names are still there as deprecated aliases.
+-
+-- Issue #5767: Remove sgmlop support from xmlrpc.client.
+-
+-- Issue #6150: Fix test_unicode on wide-unicode builds.
+-
+-- Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty
+-  parameters.
+-
+-Windows
+--------
+-
+-- Issue #6221: Delete test registry key before running the test.
+-
+-- Issue #6158: Package Sine-1000Hz-300ms.aif in MSI file.
+-
+-C-API
+------
+-
+-- Issue #5735: Python compiled with --with-pydebug should throw an
+-  ImportError when trying to import modules compiled without
+-  --with-pydebug, and vice-versa.
+-
+-
+-Build
+------
+-
+-- Issue #6154: Make sure the intl library is added to LIBS if needed. Also
+-  added LIBS to OS X framework builds.
+-
+-- Issue #5809: Specifying both --enable-framework and --enable-shared is
+-  an error. Configure now explicity tells you about this.
+-
+-
+-
+-What's New in Python 3.1 release candidate 1?
+-=============================================
+-
+-*Release date: 2009-05-30*
+-
+-Core and Builtins
+------------------
+-
+-- Issue #6097: Escape UTF-8 surrogates resulting from mbstocs conversion
+-  of the command line.
+-
+-- Issue #6012: Add cleanup support to O& argument parsing.
+-
+-- Issue #6089: Fixed str.format with certain invalid field specifiers
+-  that would raise SystemError.
+-
+-- Issue #5982: staticmethod and classmethod now expose the wrapped
+-  function with __func__.
+-
+-- Added support for multiple context managers in the same with-statement.
+-  Deprecated contextlib.nested() which is no longer needed.
+-
+-- Issue #5829: complex("1e500") no longer raises OverflowError.  This
+-  makes it consistent with float("1e500") and interpretation of real
+-  and imaginary literals.
+-
+-- Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more.
+-
+-- Issue #5994: the marshal module now has docstrings.
+-
+-- Issue #5981: Fix three minor inf/nan issues in float.fromhex:
+-  (1) inf and nan strings with trailing whitespace were incorrectly
+-  rejected;  (2) parsing of strings representing infinities and nans
+-  was locale aware; and (3) the interpretation of fromhex('-nan')
+-  didn't match that of float('-nan').
+-
+-Library
+--------
+-
+-- Issue #4859: Implement PEP 383 for pwd, spwd, and grp.
+-
+-- smtplib 'login' and 'cram-md5' login are also fixed (see Issue #5259).
+-
+-- Issue #6121: pydoc now ignores leading and trailing spaces in the
+-  argument to the 'help' function.
+-
+-- Issue #6118: urllib.parse.quote_plus ignored the encoding and errors
+-  arguments for strings with a space in them.
+-
+-- collections.namedtuple() was not working with the following field
+-  names:  cls, self, tuple, itemgetter, and property.
+-
+-- In unittest, using a skipping decorator on a class is now equivalent to
+-  skipping every test on the class.  The ClassTestSuite class has been removed.
+-
+-- Issue #6050: Don't fail extracting a directory from a zipfile if
+-  the directory already exists.
+-
+-- Issue #1309352: fcntl now converts its third arguments to a C `long` rather
+-  than an int, which makes some operations possible under 64-bit Linux (e.g.
+-  DN_MULTISHOT with F_NOTIFY).
+-
+-- Issue #5761: Add the name of the underlying file to the repr() of various
+-  IO objects.
+-
+-- Issue #5259: smtplib plain auth login no longer gives a traceback.  Fix
+-  by Musashi Tamura, tests by Marcin Bachry.
+-
+-- Issue #1983: Fix functions taking or returning a process identifier to use
+-  the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have
+-  a process identifier type wider than the standard C integer type.
+-
+-- Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket.
+-  Patch by Farhan Ahmad, test by Marcin Bachry.
+-
+-- Issue #2116: Weak references and weak dictionaries now support copy()ing and
+-  deepcopy()ing.
+-
+-- Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr.
+-
+-- Issue #5918: Fix a crash in the parser module.
+-
+-- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr.
+-
+-- Issue #5006: Better handling of unicode byte-order marks (BOM) in the io
+-  library. This means, for example, that opening an UTF-16 text file in
+-  append mode doesn't add a BOM at the end of the file if the file isn't
+-  empty.
+-
+-- Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source'
+-  file is a binary.  Patch by Brodie Rao, tests by Daniel Diniz.  This fix
+-  corrects a pydoc regression.
+-
+-- Issue #5955: aifc's close method did not close the file it wrapped,
+-  now it does.  This also means getfp method now returns the real fp.
+-
+-Installation
+-------------
+-
+-- Issue #6047: fullinstall has been removed because Python 3's executable will
+-  now be known as python3.
+-
+-- Lib/smtpd.py is no longer installed as a script.
+-
+-Extension Modules
+------------------
+-
+-- Issue #3061: Use wcsftime for time.strftime where available.
+-
+-- Issue #4873: Fix resource leaks in error cases of pwd and grp.
+-
+-- Issue #6093: Fix off-by-one error in locale.strxfrm.
+-
+-- The _functools and _locale modules are now built into the libpython shared
+-  library instead of as extension modules.
+-
+-Build
+------
+-
+-- Issue #3585: Add pkg-config support. It creates a python-2.7.pc file
+-  and a python3.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by
+-  Clinton Roy.
+-
+-Tests
+------
+-
+-- Issue #5442: Tests for importlib were not properly skipping case-sensitivity
+-  tests on darwin even when the OS was installed on a case-sensitive
+-  filesystem. Also fixed tests that should not be run when
+-  sys.dont_write_bytecode is true.
+-
+-
+-What's New in Python 3.1 beta 1?
+-================================
+-
+-*Release date: 2009-05-06*
+-
+-Core and Builtins
+------------------
+-
+-- Issue #5914: Add new C API function PyOS_string_to_double, and
+-  deprecate PyOS_ascii_strtod and PyOS_ascii_atof.
+-
+-- Issue #3382: float.__format__, complex.__format__, and %-formatting
+-  no longer map 'F' to 'f'. Because of issue #5859 (below), this only
+-  affects nan -> NAN and inf -> INF.
+-
+-- Issue #5799: ntpath (ie, os.path on Windows) fully supports UNC pathnames
+-  in all operations, including splitdrive, split, etc.  splitunc() now issues
+-  a PendingDeprecation warning.
+-
+-- Issue #5920: For float.__format__, change the behavior with the
+-  empty presentation type (that is, not one of 'e', 'f', 'g', or 'n')
+-  to be like 'g' but with at least one decimal point and with a
+-  default precision of 12. Previously, the behavior the same but with
+-  a default precision of 6.  This more closely matches str(), and
+-  reduces surprises when adding alignment flags to the empty
+-  presentation type. This also affects the new complex.__format__ in
+-  the same way.
+-
+-- Implement PEP 383, Non-decodable Bytes in System Character Interfaces.
+-
+-- Issue #5890: in subclasses of 'property' the __doc__ attribute was
+-  shadowed by classtype's, even if it was None.  property now
+-  inserts the __doc__ into the subclass instance __dict__.
+-
+-- Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal
+-  sequences. Patch by Nick Barnes and Victor Stinner.
+-
+-- Issue #3672: Reject surrogates in utf-8 codec; add surrogatepass error handler.
+-
+-- Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have
+-  received a new method, detach().  detach() disconnects the underlying stream
+-  from the buffer or text IO and returns it.
+-
+-- Issue #5859: Remove switch from '%f' to '%g'-style formatting for
+-  floats with absolute value over 1e50.  Also remove length
+-  restrictions for float formatting: '%.67f' % 12.34 and '%.120e' %
+-  12.34 no longer raise an exception.
+-
+-- Issue #1588: Add complex.__format__. For example,
+-  format(complex(1, 2./3), '.5') now produces a sensible result.
+-
+-- Issue #5864: Fix empty format code formatting for floats so that it
+-  never gives more than the requested number of significant digits.
+-
+-- Issue #5793: Rationalize isdigit / isalpha / tolower, etc. Includes
+-  new Py_ISDIGIT / Py_ISALPHA / Py_TOLOWER, etc. in pctypes.h.
+-
+-- Issue #5835: Deprecate PyOS_ascii_formatd.
+-
+-- Issue #4971: Fix titlecase for characters that are their own
+-  titlecase, but not their own uppercase.
+-
+-- Issue #5283: Setting __class__ in __del__ caused a segfault.
+-
+-- Issue #5816: complex(repr(z)) now recovers z exactly, even when
+-  z involves nans, infs or negative zeros.
+-
+-- Issue #3166: Make int -> float conversions correctly rounded.
+-
+-- Issue #1869 (and many duplicates): make round(x, n) correctly
+-  rounded for a float x, by using the decimal <-> binary conversions
+-  from Python/dtoa.c.  As a consequence, (e.g.) round(x, 2) now
+-  consistently agrees with format(x, '.2f').
+-
+-- Issue #5787: object.__getattribute__(some_type, "__bases__") segfaulted on
+-  some builtin types.
+-
+-- Issue #5772: format(1e100, '<') produces '1e+100', not '1.0e+100'.
+-
+-- Issue #5515: str.format() type 'n' combined with commas and leading
+-  zeros no longer gives odd results with ints and floats.
+-
+-- Implement PEP 378, Format Specifier for Thousands Separator, for
+-  floats.
+-
+-- The str function switches to exponential notation at
+-  1e11, not 1e12.  This avoids printing 13 significant digits in
+-  situations where only 12 of them are correct.  Example problem
+-  value: str(1e11 + 0.5).  (This minor issue has existed in 2.x for a
+-  long time.)
+-
+-- Issue #1580: On most platforms, use a 'short' float repr: for a
+-  finite float x, repr(x) now outputs a string based on the shortest
+-  sequence of decimal digits that rounds to x.  Previous behaviour was
+-  to output 17 significant digits and then strip trailing zeros.
+-  Another minor difference is that the new repr switches to
+-  exponential notation at 1e16 instead of the previous 1e17; this
+-  avoids misleading output in some cases.
+-
+-  There's a new sys attribute sys.float_repr_style, which takes
+-  the value 'short' to indicate that we're using short float repr,
+-  and 'legacy' if the short float repr isn't available for one
+-  reason or another.
+-
+-  The float repr change involves incorporating David Gay's 'perfect
+-  rounding' code into the Python core (it's in Python/dtoa.c).  As a
+-  secondary consequence, all string-to-float and float-to-string
+-  conversions (including all float formatting operations) will be
+-  correctly rounded on these platforms.
+-
+-  See issue #1580 discussions for details of platforms for which
+-  this change does not apply.
+-
+-- Issue #5759: float() didn't call __float__ on str subclasses.
+-
+-- The string.maketrans() function is deprecated; there is a new static method
+-  maketrans() on the bytes and bytearray classes.  This removes confusion about
+-  the types string.maketrans() is supposed to work with, and mirrors the
+-  methods available on the str class.
+-
+-- Issue #2170: refactored xml.dom.minidom.normalize, increasing both
+-  its clarity and its speed.
+-
+-- Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add ``do { ... } while (0)``
+-  to avoid compiler warnings.
+-
+-- Issue #3739: The unicode-internal encoder now reports the number of characters
+-  consumed like any other encoder (instead of the number of bytes).
+-
+-Installation
+-------------
+-
+-- Issue #5756: Install idle and pydoc with a 3 suffix.
+-
+-Library
+--------
+-
+-- Issue #8203: Fix IDLE Credits dialog: view_file() uses its encoding argument.
+-
+-- Issue #5311: bdist_msi can now build packages that do not depend on a
+-  specific Python version.
+-
+-- Issue #5150: IDLE's format menu now has an option to strip trailing
+-  whitespace.
+-
+-- Issue #5940: distutils.command.build_clib.check_library_list was not doing
+-  the right type checkings anymore.
+-
+-- Issue #4875: On win32, ctypes.util.find_library does no longer
+-  return directories.
+-
+-- Issue #5142: Add the ability to skip modules while stepping to pdb.
+-
+-- Issue #1309567: Fix linecache behavior of stripping subdirectories when
+-  looking for files given by a relative filename.
+-
+-- Issue #5923: Update the ``turtle`` module to version 1.1, add two new
+-  turtle demos in Demo/turtle.
+-
+-- Issue #5692: In ``zipfile.Zipfile``, fix wrong path calculation when
+-  extracting a file to the root directory.
+-
+-- Issue #5913: os.listdir() should fail for empty path on windows.
+-
+-- Issue #5084: unpickling now interns the attribute names of pickled objects,
+-  saving memory and avoiding growth in size of subsequent pickles. Proposal
+-  and original patch by Jake McGuire.
+-
+-- The json module now works exclusively with str and not bytes.
+-
+-- Issue #3959: The ipaddr module has been added to the standard library.
+-  Contributed by Google.
+-
+-- Issue #3002: ``shutil.copyfile()`` and ``shutil.copytree()`` now raise an
+-  error when a named pipe is encountered, rather than blocking infinitely.
+-
+-- Issue #5857: tokenize.tokenize() now returns named tuples.
+-
+-- Issue #4305: ctypes should now build again on mipsel-linux-gnu
+-
+-- Issue #1734234: Massively speedup ``unicodedata.normalize()`` when the
+-  string is already in normalized form, by performing a quick check beforehand.
+-  Original patch by Rauli Ruohonen.
+-
+-- Issue #5853: calling a function of the mimetypes module from several threads
+-  at once could hit the recursion limit if the mimetypes database hadn't been
+-  initialized before.
+-
+-- Issue #5854: Updated __all__ to include some missing names and remove some
+-  names which should not be exported.
+-
+-- Issue #3102:  All global symbols that the _ctypes extension defines
+-  are now prefixed with 'Py' or '_ctypes'.
+-
+-- Issue #5041: ctypes does now allow pickling wide character.
+-
+-- Issue #5812: For the two-argument form of the Fraction constructor,
+-  Fraction(m, n), m and n are permitted to be arbitrary Rational
+-  instances.
+-
+-- Issue #5812: Fraction('1e6') is valid: more generally, any string
+-  that's valid for float() is now valid for Fraction(), with the
+-  exception of strings representing NaNs and infinities.
+-
+-- Issue #5734: BufferedRWPair was poorly tested and had several glaring
+-  bugs. Patch by Brian Quinlan.
+-
+-- Issue #1161031: fix readwrite select flag handling: POLLPRI now
+-  results in a handle_expt_event call, not handle_read_event, and POLLERR
+-  and POLLNVAL now call handle_close, not handle_expt_event.  Also,
+-  dispatcher now has an 'ignore_log_types' attribute for suppressing
+-  log messages, which is set to 'warning' by default.
+-
+-- Issue #2703: SimpleXMLRPCDispatcher.__init__: Provide default values for
+-  new arguments introduced in 2.5.
+-
+-- Issue #5828 (Invalid behavior of unicode.lower): Fixed bogus logic in
+-  makeunicodedata.py and regenerated the Unicode database (This fixes
+-  u'\u1d79'.lower() == '\x00').
+-
+-Extension Modules
+------------------
+-
+-- Issue #5881: Remove old undocumented compatibility interfaces in hashlib and
+-  pwd.
+-
+-- Issue #5463: In struct module, remove deprecated float coercion
+-  for integer type codes: struct.pack('L', 0.3) should now raise
+-  an error.  The _PY_STRUCT_FLOAT_COERCE constant has been removed.
+-  The version number has been bumped to 0.3.
+-
+-- Issue #5359: Readd the Berkeley DB detection code to allow _dbm be built
+-  using Berkeley DB.
+-
+-Tests
+------
+-
+-- Issue #5354: New test support function import_fresh_module() makes
+-  it easy to import both normal and optimised versions of modules.
+-  test_heapq and test_warnings have been adjusted to use it, tests for
+-  other modules with both C and Python implementations in the stdlib
+-  can be adjusted to use it over time.
+-
+-- Issue #5837: Certain sequences of calls to set() and unset() for
+-  support.EnvironmentVarGuard objects restored the environment variables
+-  incorrectly on __exit__.
+-
+-C-API
+------
+-
+-- Issue #5630: A replacement PyCObject API, PyCapsule, has been added.
+-
+-
+-What's New in Python 3.1 alpha 2?
+-=================================
+-
+-*Release date: 2009-4-4*
+-
+-Core and Builtins
+------------------
+-
+-- Implement PEP 378, Format Specifier for Thousands Separator, for
+-  integers.
+-
+-- Issue #5666: Py_BuildValue's 'c' code should create byte strings.
+-
+-- Issue #5499: The 'c' code for argument parsing functions now only accepts a
+-  byte, and the 'C' code only accepts a unicode character.
+-
+-- Fix a problem in PyErr_NormalizeException that leads to "undetected errors"
+-  when hitting the recursion limit under certain circumstances.
+-
+-- Issue #1665206: Remove the last eager import in _warnings.c and make it lazy.
+-
+-- Fix a segfault when running test_exceptions with coverage, caused by
+-  insufficient checks in accessors of Exception.__context__.
+-
+-- Issue #5604: non-ASCII characters in module name passed to
+-  imp.find_module() were converted to UTF-8 while the path is
+-  converted to the default filesystem encoding, causing nonsense.
+-
+-- Issue #5126: str.isprintable() returned False for space characters.
+-
+-- Issue #4865: On MacOSX /Library/Python/2.7/site-packages is added to
+-  the end sys.path, for compatibility with the system install of Python.
+-
+-- Issue #4688: Add a heuristic so that tuples and dicts containing only
+-  untrackable objects are not tracked by the garbage collector. This can
+-  reduce the size of collections and therefore the garbage collection overhead
+-  on long-running programs, depending on their particular use of datatypes.
+-
+-- Issue #5512: Rewrite PyLong long division algorithm (x_divrem) to
+-  improve its performance.  Long divisions and remainder operations
+-  are now between 50% and 150% faster.
+-
+-- Issue #4258: Make it possible to use base 2**30 instead of base
+-  2**15 for the internal representation of integers, for performance
+-  reasons.  Base 2**30 is enabled by default on 64-bit machines.  Add
+-  --enable-big-digits option to configure, which overrides the
+-  default.  Add sys.int_info structseq to provide information about
+-  the internal format.
+-
+-- Issue #4474: PyUnicode_FromWideChar now converts characters outside
+-  the BMP to surrogate pairs, on systems with sizeof(wchar_t) == 4
+-  and sizeof(Py_UNICODE) == 2.
+-
+-- Issue #5237: Allow auto-numbered fields in str.format(). For
+-  example: '{} {}'.format(1, 2) == '1 2'.
+-
+-- Issue #5392: when a very low recursion limit was set, the interpreter would
+-  abort with a fatal error after the recursion limit was hit twice.
+-
+-- Issue #3845: In PyRun_SimpleFileExFlags avoid invalid memory access with
+-  short file names.
+-
+-Library
+--------
+-
+-- Issue #2625: added missing items() call to the for loop in
+-  mailbox.MH.get_message().
+-
+-- Issue #5640: Fix _multibytecodec so that CJK codecs don't repeat
+-  error substitutions from non-strict codec error callbacks in
+-  incrementalencoder and StreamWriter.
+-
+-- Issue #5656: Fix the coverage reporting when running the test suite with
+-  the -T argument.
+-
+-- Issue #5647: MutableSet.__iand__() no longer mutates self during iteration.
+-
+-- Issue #5624: Fix the _winreg module name still used in several modules.
+-
+-- Issue #5628: Fix io.TextIOWrapper.read() with a unreadable buffer.
+-
+-- Issue #5619: Multiprocessing children disobey the debug flag and causes
+-  popups on windows buildbots. Patch applied to work around this issue.
+-
+-- Issue #5400: Added patch for multiprocessing on netbsd compilation/support
+-
+-- Issue #5387: Fixed mmap.move crash by integer overflow.
+-
+-- Issue #5261: Patch multiprocessing's semaphore.c to support context
+-  manager use: "with multiprocessing.Lock()" works now.
+-
+-- Issue #5236: Change time.strptime() to only take strings. Didn't work with
+-  bytes already but the failure was non-obvious.
+-
+-- Issue #5177: Multiprocessing's SocketListener class now uses
+-  socket.SO_REUSEADDR on all connections so that the user no longer needs
+-  to wait 120 seconds for the socket to expire.
+-
+-- Issue #5595: Fix UnboundedLocalError in ntpath.ismount().
+-
+-- Issue #1174606: Calling read() without arguments of an unbounded file
+-  (typically /dev/zero under Unix) could crash the interpreter.
+-
+-- The max_buffer_size arguments of io.BufferedWriter, io.BufferedRWPair, and
+-  io.BufferedRandom have been deprecated for removal in Python 3.2.
+-
+-- Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loop
+-  forever on incomplete input. That caused tarfile.open() to hang when used
+-  with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or
+-  partial bzip2 compressed data.
+-
+-- Issue #2110: Add support for thousands separator and 'n' type
+-  specifier to Decimal.__format__
+-
+-- Fix Decimal.__format__ bug that swapped the meanings of the '<' and
+-  '>' alignment characters.
+-
+-- The error detection code in FileIO.close() could fail to reflect the `errno`
+-  value, and report it as -1 instead.
+-
+-- Issue #5016: FileIO.seekable() could return False if the file position
+-  was negative when truncated to a C int. Patch by Victor Stinner.
+-
+-Extension Modules
+------------------
+-
+-- Issue #5391: mmap now deals exclusively with bytes.
+-
+-- Issue #5463: In struct module, remove deprecated overflow wrapping
+-  when packing an integer: struct.pack('=L', -1) now raises
+-  struct.error instead of returning b'\xff\xff\xff\xff'.  The
+-  _PY_STRUCT_RANGE_CHECKING and _PY_STRUCT_OVERFLOW_MASKING constants
+-  have been removed from the struct module.
+-
+-
+-What's New in Python 3.1 alpha 1
+-================================
+-
+-*Release date: 2009-03-07*
+-
+-Core and Builtins
+------------------
+-
+-- The io module has been reimplemented in C for speed.
+-
+-- Give dict views an informative __repr__.
+-
+-- Issue #5247: Improve error message when unknown format codes are
+-  used when using str.format() with str, int, and float arguments.
+-
+-- Issue #5249: time.strftime returned malformed string when format string
+-  contained non ascii character on windows.
+-
+-- Issue #4626: compile(), exec(), and eval() ignore the coding cookie if the
+-  source has already been decoded into str.
+-
+-- Issue #5186: Reduce hash collisions for objects with no __hash__ method by
+-  rotating the object pointer by 4 bits to the right.
+-
+-- Issue #4575: Fix Py_IS_INFINITY macro to work correctly on x87 FPUs:
+-  it now forces its argument to double before testing for infinity.
+-
+-- Issue #5137: Make len() correctly raise a TypeError when a __len__ method
+-  returns a non-number type.
+-
+-- Issue #5182: Removed memoryview.__str__.
+-
+-- Issue #1717: Removed builtin cmp() function, dropped tp_compare
+-  slot, the C API functions PyObject_Compare and PyUnicode_Compare and
+-  the type definition cmpfunc.  The tp_compare slot has been renamed
+-  to tp_reserved, and is reserved for future usage.
+-
+-- Issue #1242657: the __len__() and __length_hint__() calls in several tools
+-  were suppressing all exceptions.  These include list() and bytearray().
+-
+-- Issue #4707: round(x, n) now returns an integer if x is an integer.
+-  Previously it returned a float.
+-
+-- Issue #4753: By enabling a configure option named '--with-computed-gotos'
+-  on compilers that support it (notably: gcc, SunPro, icc), the bytecode
+-  evaluation loop is compiled with a new dispatch mechanism which gives
+-  speedups of up to 20%, depending on the system, on various benchmarks.
+-
+-- Issue #4874: Most builtin decoders now reject unicode input.
+-
+-- Issue #4842: Don't allow trailing 'L' when constructing an integer
+-  from a string.
+-
+-- Issue #4991: os.fdopen now raises an OSError for invalid file descriptors.
+-
+-- Issue #4838: When a module is deallocated, free the memory backing the
+-  optional module state data.
+-
+-- Issue #4910: Rename nb_long slot to nb_reserved, and change its
+-  type to ``(void *)``.
+-
+-- Issue #4935: The overflow checking code in the expandtabs() method common
+-  to str, bytes and bytearray could be optimized away by the compiler, letting
+-  the interpreter segfault instead of raising an error.
+-
+-- Issue #3720: Fix a crash when an iterator modifies its class and removes its
+-  __next__ method.
+-
+-- Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API
+-  function no longer attempt to call the __long__ slot to convert an object
+-  to an integer.  Only the __int__ and __trunc__ slots are examined.
+-
+-- Issue #4893: Use NT threading on CE.
+-
+-- Issue #4915: Port sysmodule to Windows CE.
+-
+-- Issue #4868: utf-8, utf-16 and latin1 decoding are now 2x to 4x faster. The
+-  common cases are optimized thanks to a dedicated fast path and a moderate
+-  amount of loop unrolling.
+-
+-- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
+-  collecting the oldest generation) so that allocating lots of objects without
+-  destroying them does not show quadratic performance. Based on a proposal by
+-  Martin von Löwis at
+-  http://mail.python.org/pipermail/python-dev/2008-June/080579.html.
+-
+-- Issue #4604: Some objects of the I/O library could still be used after
+-  having been closed (for instance, a read() call could return some
+-  previously buffered data). Patch by Dmitry Vasiliev.
+-
+-- Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line
+-  flag to work properly. Furthermore, when specifying -u, the text stdout
+-  and stderr streams have line-by-line buffering enabled (the default being
+-  to buffer arbitrary chunks of data).
+-
+-- The internal table, _PyLong_DigitValue, is now an array of unsigned chars
+-  instead of ints (reducing its size from 4 to 8 times thereby reducing
+-  Python's overall memory).
+-
+-- Issue #1180193: When importing a module from a .pyc (or .pyo) file with
+-  an existing .py counterpart, override the co_filename attributes of all
+-  code objects if the original filename is obsolete (which can happen if the
+-  file has been renamed, moved, or if it is accessed through different paths).
+-  Patch by Ziga Seilnacht and Jean-Paul Calderone.
+-
+-- Issue #4580: Fix slicing of memoryviews when the item size is greater than
+-  one byte. Also fixes the meaning of len() so that it returns the number of
+-  items, rather than the size in bytes.
+-
+-- Issue #4075: Use OutputDebugStringW in Py_FatalError.
+-
+-- Issue #4747: When the terminal does not use utf-8, executing a script with
+-  non-ascii characters in its name could fail with a "SyntaxError: None" error.
+-
+-- Issue #4797: IOError.filename was not set when ``_fileio.FileIO`` failed
+-  to open file with a bytes filename on Windows.
+-
+-- Issue #3680: Reference cycles created through a dict, set or deque iterator
+-  did not get collected.
+-
+-- Issue #4701: PyObject_Hash now implicitly calls PyType_Ready on types
+-  where the tp_hash and tp_dict slots are both NULL.
+-
+-- Issue #4759: None is now allowed as the first argument of
+-  bytearray.translate().  It was always allowed for bytes.translate().
+-
+-- Added test case to ensure attempts to read from a file opened for writing
+-  fail.
+-
+-- Issue #3106: Speedup some comparisons (str/str and int/int).
+-
+-- Issue #2183: Simplify and optimize bytecode for list, dict and set
+-  comprehensions. Original patch for list comprehensions by Neal Norwitz.
+-
+-- Issue #2467: gc.DEBUG_STATS reported invalid elapsed times. Also, always
+-  print elapsed times, not only when some objects are uncollectable /
+-  unreachable. Original patch by Neil Schemenauer.
+-
+-- Issue #3439: Add a bit_length method to int.
+-
+-- Issue #2173: When getting device encoding, check that return value of
+-  nl_langinfo is not the empty string.  This was causing silent build
+-  failures on OS X.
+-
+-- Issue #4597: Fixed several opcodes that weren't always propagating
+-  exceptions.
+-
+-- Issue #4589: Fixed exception handling when the __exit__ function of a
+-  context manager returns a value that cannot be converted to a bool.
+-
+-- Issue #4445: Replace "sizeof(PyBytesObject)" with
+-  "offsetof(PyBytesObject, ob_sval) + 1" when allocating memory for
+-  bytes instances.  On a typical machine this saves 3 bytes of memory
+-  (on average) per allocation of a bytes instance.
+-
+-- Issue #4533: File read operation was dreadfully slow due to a slowly
+-  growing read buffer. Fixed by using the same growth rate algorithm as
+-  Python 2.x.
+-
+-- Issue #4509: Various issues surrounding resize of bytearray objects to
+-  which there are buffer exports (e.g. memoryview instances).
+-
+-- Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
+-  method on file objects with closefd=False. The file descriptor is still
+-  kept open but the file object behaves like a closed file. The ``FileIO``
+-  object also got a new readonly attribute ``closefd``.
+-
+-- Issue #4569: Interpreter crash when mutating a memoryview with an item size
+-  larger than 1.
+-
+-- Issue #4748: Lambda generators no longer return a value.
+-
+-- The re.sub(), re.subn() and re.split() functions now accept a flags parameter.
+-
+-- Issue #5108: Handle %s like %S, %R and %A in PyUnicode_FromFormatV(): Call
+-  PyUnicode_DecodeUTF8() once, remember the result and output it in a second
+-  step. This avoids problems with counting UTF-8 bytes that ignores the effect
+-  of using the replace error handler in PyUnicode_DecodeUTF8().
+-
+-Library
+--------
+-
+-- Issue #7071: byte-compilation in Distutils is now done with respect to
+-  sys.dont_write_bytecode.
+-
+-- Issue #7066: archive_util.make_archive now restores the cwd if an error is
+-  raised. Initial patch by Ezio Melotti.
+-
+-- Issue #6516: Added owner/group support when creating tar archives in
+-  Distutils.
+-
+-- Issue #6954: Fixed crash when using DISTUTILS_DEBUG flag in Distutils.
+-
+-- Issue #6163: Fixed HP-UX runtime library dir options in
+-  distutils.unixcompiler. Initial patch by Sridhar Ratnakumar and
+-  Michael Haubenwallner.
+-
+-- Issue #6693: New functions in site.py to get user/global site packages paths.
+-
+-- Issue #6511: ZipFile now raises BadZipfile (instead of an IOError) when
+-  opening an empty or very small file.
+-
+-- Issue #6545: Removed assert statements in distutils.Extension, so the
+-  behavior is similar when used with -O.
+-
+-- unittest has been split up into a package.  All old names should still work.
+-
+-- Issue #6466: now distutils.cygwinccompiler and distutils.emxccompiler
+-  uses the same refactored function to get gcc/ld/dllwrap versions numbers.
+-  It's `distutils.util.get_compiler_versions`. Added deprecation warnings
+-  for the obsolete get_versions() functions.
+-
+-- Issue #6433: fixed issues with multiprocessing.pool.map hanging on empty list
+-
+-- Issue #6314: logging: Extra checks on the "level" argument in more places.
+-
+-- Issue #2622: Fixed an ImportError when importing email.message from a
+-  standalone application built with py2exe or py2app.
+-
+-- Issue #6455: Fixed test_build_ext under win32.
+-
+-- Issue #6377: Enabled the compiler option, and deprecate its usage as an
+-  attribute.
+-
+-- Issue #6413: Fixed the log level in distutils.dist for announce.
+-
+-- Issue #6403: Fixed package path usage in build_ext.
+-
+-- Issues #5155, 5313, 5331: multiprocessing.Process._bootstrap was
+-  unconditionally calling "os.close(sys.stdin.fileno())" resulting in file
+-  descriptor errors
+-
+-- Issue #6365: Distutils build_ext inplace mode was copying the compiled
+-  extension in a subdirectory if the extension name had dots.
+-
+-- Issue #6164: Added an AIX specific linker argument in Distutils
+-  unixcompiler. Original patch by Sridhar Ratnakumar.
+-
+-- Issue #6286: Now Distutils upload command is based on urllib2 instead of
+-  httplib, allowing the usage of http_proxy.
+-
+-- Issue #6287: Added the license field in Distutils documentation.
+-
+-- Issue #6263: Fixed syntax error in distutils.cygwincompiler.
+-
+-- Issue #5201: distutils.sysconfig.parse_makefile() now understands `$$`
+-  in Makefiles. This prevents compile errors when using syntax like:
+-  `LDFLAGS='-rpath=\$$LIB:/some/other/path'`. Patch by Floris Bruynooghe.
+-
+-- Issue #6131: test_modulefinder leaked when run after test_distutils.
+-  Patch by Hirokazu Yamamoto.
+-
+-- Issue #6048: Now Distutils uses the tarfile module in archive_util.
+-
+-- Issue #6062: In distutils, fixed the package option of build_ext. Feedback
+-  and tests on pywin32 by Tim Golden.
+-
+-- Issue #6053: Fixed distutils tests on win32. patch by Hirokazu Yamamoto.
+-
+-- Issue #6046: Fixed the library extension when distutils build_ext is used
+-  inplace. Initial patch by Roumen Petrov.
+-
+-- Issue #6041: Now distutils `sdist` and `register` commands use `check` as a
+-  subcommand.
+-
+-- Issue #6022: a test file was created in the current working directory by
+-  test_get_outputs in Distutils.
+-
+-- Issue #5977: distutils build_ext.get_outputs was not taking into account the
+-  inplace option. Initial patch by kxroberto.
+-
+-- Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken
+-  for old-style extensions.
+-
+-- Issue #5976: Fixed Distutils test_check_environ.
+-
+-- Issue #5941: Distutils build_clib command was not working anymore because
+-  of an incomplete costumization of the archiver command. Added ARFLAGS in the
+-  Makefile besides AR and make Distutils use it. Original patch by David
+-  Cournapeau.
+-
+-- Issue #2245: aifc now skips chunk types it doesn't recognize, per spec.
+-
+-- Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive
+-  anymore.
+-
+-- Issue #5810: Fixed Distutils test_build_scripts so it uses
+-  sysconfig.get_config_vars.
+-
+-- Issue #4951: Fixed failure in test_httpservers.
+-
+-- Issue #5795: Fixed test_distutils failure on Debian ppc.
+-
+-- Issue #5607: fixed Distutils test_get_platform for Mac OS X fat binaries.
+-
+-- Issue #5741: don't disallow "%%" (which is an escape for "%") when setting
+-  a value in SafeConfigParser.
+-
+-- Issue #5732: added a new command in Distutils: check.
+-
+-- Issue #5731: Distutils bdist_wininst no longer worked on non-Windows
+-  platforms. Initial patch by Paul Moore.
+-
+-- Issue #5095: Added bdist_msi to the list of bdist supported formats.
+-  Initial fix by Steven Bethard.
+-
+-- Issue #1491431: Fixed distutils.filelist.glob_to_re for edge cases.
+-  Initial fix by Wayne Davison.
+-
+-- Issue #5694: removed spurious test output in Distutils (test_clean).
+-
+-- Issue #1326077: fix the formatting of SyntaxErrors by the traceback module.
+-
+-- Issue #1665206 (partially): Move imports in cgitb to the top of the module
+-  instead of performing them in functions. Helps prevent import deadlocking in
+-  threads.
+-
+-- Issue #2522: locale.format now checks its first argument to ensure it has
+-  been passed only one pattern, avoiding mysterious errors where it appeared
+-  that it was failing to do localization.
+-
+-- Issue #5583: Added optional Extensions in Distutils. Initial patch by Georg
+-  Brandl.
+-
+-- Issue #1222: locale.format() bug when the thousands separator is a space
+-  character.
+-
+-- Issue #5472: Fixed distutils.test_util tear down. Original patch by
+-  Tim Golden.
+-
+-- collections.deque() objects now have a read-only attribute called maxlen.
+-
+-- Issue #2638: Show a window constructed with tkSimpleDialog.Dialog only after
+-  it is has been populated and properly configured in order to prevent
+-  window flashing.
+-
+-- Issue #4792: Prevent a segfault in _tkinter by using the
+-  guaranteed to be safe interp argument given to the PythonCmd in place of
+-  the Tcl interpreter taken from a PythonCmd_ClientData.
+-
+-- Issue #5193: Guarantee that tkinter.Text.search returns a string.
+-
+-- Issue #5394: removed > 2.3 syntax from distutils.msvc9compiler.
+-  Original patch by Akira Kitada.
+-
+-- Issue #5334: array.fromfile() failed to insert values when EOFError was raised.
+-
+-- Issue #5385: Fixed mmap crash after resize failure on windows.
+-
+-- Issue #5179: Fixed subprocess handle leak on failure on windows.
+-
+-- PEP 372:  Added collections.OrderedDict().
+-
+-- The _asdict() for method for namedtuples now returns an OrderedDict().
+-
+-- configparser now defaults to using an ordered dictionary.
+-
+-- Issue #5401: Fixed a performance problem in mimetypes when ``from mimetypes
+-  import guess_extension`` was used.
+-
+-- Issue #1733986: Fixed mmap crash in accessing elements of second map object
+-  with same tagname but larger size than first map. (Windows)
+-
+-- Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer
+-  overrun.
+-
+-- Issue #1533164: Installed but not listed ``*.pyo`` was breaking Distutils
+-  bdist_rpm command.
+-
+-- Issue #5378: added --quiet option to Distutils bdist_rpm command.
+-
+-- Issue #5052: make Distutils compatible with 2.3 again.
+-
+-- Issue #5316: Fixed buildbot failures introduced by multiple inheritance
+-  in Distutils tests.
+-
+-- Issue #5287: Add exception handling around findCaller() call to help out
+-  IronPython.
+-
+-- Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0,
+-  The file was resized to wrong size.
+-
+-- Issue #5292: Fixed mmap crash on its boundary access m[len(m)].
+-
+-- Issue #2279: distutils.sdist.add_defaults now add files
+-  from the package_data and the data_files metadata.
+-
+-- Issue #5257: refactored all tests in distutils, so they use
+-  support.TempdirManager, to avoid writing in the tests directory.
+-
+-- Issue #4524: distutils build_script command failed with --with-suffix=3.
+-  Initial patch by Amaury Forgeot d'Arc.
+-
+-- Issue #2461: added tests for distutils.util
+-
+-- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions
+-  which inherited from numbers.py which did not have __slots__ defined.  The
+-  numbers hierarchy now has its own __slots__ declarations.
+-
+-- Issue #4631: Fix urlopen() result when an HTTP response uses chunked
+-  encoding.
+-
+-- Issue #5203: Fixed ctypes segfaults when passing a unicode string to a
+-  function without argtypes (only occurs if HAVE_USABLE_WCHAR_T is false).
+-
+-- Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored
+-  under NT and OS2. Patch by Philip Jenvey.
+-
+-- Issue #5128: Make compileall properly inspect bytecode to determine if needs
+-  to be recreated. This avoids a timing hole thanks to the old reliance on the
+-  ctime of the files involved.
+-
+-- Issue #5122: Synchronize tk load failure check to prevent a potential
+-  deadlock.
+-
+-- Issue #1818: collections.namedtuple() now supports a keyword argument
+-  'rename' which lets invalid fieldnames be automatically converted to
+-  positional names in the form, _1, _2, ...
+-
+-- Issue #4890: Handle empty text search pattern in Tkinter.Text.search.
+-
+-- Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a
+-  public documented method ``ZipImporter.get_filename()``.
+-
+-- Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support
+-  the execution of packages by looking for and executing a ``__main__``
+-  submodule when a package name is supplied. Initial patch by Andi
+-  Vajda.
+-
+-- Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will
+-  not be used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in
+-  Tkapp_Call when calling from a thread different than the one that created
+-  the Tcl interpreter. Patch by Robert Hancock.
+-
+-- Issue #4285: Change sys.version_info to be a named tuple. Patch by
+-  Ross Light.
+-
+-- Issue #1520877: Now distutils.sysconfig reads $AR from the
+-  environment/Makefile. Patch by Douglas Greiman.
+-
+-- Issue #1276768: The verbose option was not used in the code of
+-  distutils.file_util and distutils.dir_util.
+-
+-- Issue #5132: Fixed trouble building extensions under Solaris with
+-  --enabled-shared activated. Initial patch by Dave Peterson.
+-
+-- Issue #1581476: Always use the Tcl global namespace when calling into Tcl.
+-
+-- The shelve module now defaults to pickle protocol 3.
+-
+-- Fix a bug in the trace module where a bytes object from co_lnotab had its
+-  items being passed through ord().
+-
+-- Issue #2047: shutil.move() could believe that its destination path was
+-  inside its source path if it began with the same letters (e.g. "src" vs.
+-  "src.new").
+-
+-- Added the ttk module. See issue #2983: Ttk support for Tkinter.
+-
+-- Removed isSequenceType(), isMappingType, and isNumberType() from the
+-  operator module; use the abstract base classes instead.  Also removed
+-  the repeat() function; use mul() instead.
+-
+-- Issue #5021:  doctest.testfile() did not create __name__ and
+-  collections.namedtuple() relied on __name__ being defined.
+-
+-- Backport importlib from Python 3.1. Only the import_module() function has
+-  been backported to help facilitate transitions from 2.7 to 3.1.
+-
+-- Issue #1885: distutils. When running sdist with --formats=tar,gztar
+-  the tar file was overriden by the gztar one.
+-
+-- Issue #4863: distutils.mwerkscompiler has been removed.
+-
+-- Added a new itertools functions:  combinations_with_replacement()
+-  and compress().
+-
+-- Issue #5032:  added a step argument to itertools.count() and
+-  allowed non-integer arguments.
+-
+-- Fix and properly document the multiprocessing module's logging
+-  support, expose the internal levels and provide proper usage
+-  examples.
+-
+-- Issue #1672332: fix unpickling of subnormal floats, which was
+-  producing a ValueError on some platforms.
+-
+-- Issue #3881: Help Tcl to load even when started through the
+-  unreadable local symlink to "Program Files" on Vista.
+-
+-- Issue #4710: Extract directories properly in the zipfile module;
+-  allow adding directories to a zipfile.
+-
+-- Issue #3807: _multiprocessing build fails when configure is passed
+-  --without-threads argument. When this occurs, _multiprocessing will
+-  be disabled, and not compiled.
+-
+-- Issue #5008: When a file is opened in append mode with the new IO library,
+-  do an explicit seek to the end of file (so that e.g. tell() returns the
+-  file size rather than 0). This is consistent with the behaviour of the
+-  traditional 2.x file object.
+-
+-- Issue #5013: Fixed a bug in FileHandler which occurred when the delay
+-  parameter was set.
+-
+-- Issue #4842: Always append a trailing 'L' when pickling longs using
+-  pickle protocol 0.  When reading, the 'L' is optional.
+-
+-- Add the importlib package.
+-
+-- Issue #4301: Patch the logging module to add processName support, remove
+-  _check_logger_class from multiprocessing.
+-
+-- Issue #3325: Remove python2.x try: except: imports for old cPickle from
+-  multiprocessing.
+-
+-- Issue #4959: inspect.formatargspec now works for keyword only arguments
+-  without defaults.
+-
+-- Issue #3321: ``_multiprocessing.Connection()`` doesn't check handle; added checks
+-  for Unix machines for negative handles and large int handles. Without this check
+-  it is possible to segfault the interpreter.
+-
+-- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue
+-  in sharedctypes.py.
+-
+-- Issue #1225107: inspect.isclass() returned True for instances with a custom
+-  __getattr__.
+-
+-- Issue #3826 and #4791: The socket module now closes the underlying socket
+-  appropriately when it is being used via socket.makefile() objects
+-  rather than delaying the close by waiting for garbage collection to do it.
+-
+-- Issue #1696199:  Add collections.Counter() for rapid and convenient
+-  counting.
+-
+-- Issue #3860: GzipFile and BZ2File now support the context manager protocol.
+-
+-- Issue #4867: Fixed a crash in ctypes when passing a string to a
+-  function without defining argtypes.
+-
+-- Issue #4272: Add an optional argument to the GzipFile constructor to override
+-  the timestamp in the gzip stream. The default value remains the current time.
+-  The information can be used by e.g. gunzip when decompressing. Patch by
+-  Jacques Frechet.
+-
+-- Restore Python 2.3 compatibility for decimal.py.
+-
+-- Issue #3638: Remove functions from _tkinter module level that depend on
+-  TkappObject to work with multiple threads.
+-
+-- Issue #4718: Adapt the wsgiref package so that it actually works with
+-  Python 3.x, in accordance with the `official amendments of the spec
+-  <http://www.wsgi.org/wsgi/Amendments_1.0>`_.
+-
+-- Issue #4796: Added Decimal.from_float() and Context.create_decimal_from_float()
+-  to the decimal module.
+-
+-- Fractions.from_float() no longer loses precision for integers too big to
+-  cast as floats.
+-
+-- Issue #4812: add missing underscore prefix to some internal-use-only
+-  constants in the decimal module.  (Dec_0 becomes _Dec_0, etc.)
+-
+-- Issue #4790: The nsmallest() and nlargest() functions in the heapq module
+-  did unnecessary work in the common case where no key function was specified.
+-
+-- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when
+-  the function is not a generator.
+-
+-- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case
+-  no MSVC compiler is found under Windows. Original patch by Philip Jenvey.
+-
+-- Issue #4646: distutils was choking on empty options arg in the setup
+-  function. Original patch by Thomas Heller.
+-
+-- Issue #3767: Convert Tk object to string in tkColorChooser.
+-
+-- Issue #3248: Allow placing ScrolledText in a PanedWindow.
+-
+-- Issue #4444: Allow assertRaises() to be used as a context handler, so that
+-  the code under test can be written inline if more practical.
+-
+-- Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@')
+-  works as expected in the interactive environment.
+-
+-- Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by
+-  Gabriel Genellina.
+-
+-- Issue #4574: reading an UTF16-encoded text file crashes if \r on 64-char
+-  boundary.
+-
+-- Issue #4223: inspect.getsource() will now correctly display source code
+-  for packages loaded via zipimport (or any other conformant PEP 302
+-  loader). Original patch by Alexander Belopolsky.
+-
+-- Issue #4201: pdb can now access and display source code loaded via
+-  zipimport (or any other conformant PEP 302 loader). Original patch by
+-  Alexander Belopolsky.
+-
+-- Issue #4197: doctests in modules loaded via zipimport (or any other PEP
+-  302 conformant loader) will now work correctly in most cases (they
+-  are still subject to the constraints that exist for all code running
+-  from inside a module loaded via a PEP 302 loader and attempting to
+-  perform IO operations based on __file__). Original patch by
+-  Alexander Belopolsky.
+-
+-- Issues #4082 and #4512: Add runpy support to zipimport in a manner that
+-  allows backporting to maintenance branches. Original patch by
+-  Alexander Belopolsky.
+-
+-- Issue #4163: textwrap module: allow word splitting on a hyphen preceded by
+-  a non-ASCII letter.
+-
+-- Issue #4616: TarFile.utime(): Restore directory times on Windows.
+-
+-- Issue #4021: tokenize.detect_encoding() now raises a SyntaxError when the
+-  codec cannot be found.  This is for compatibility with the builtin behavior.
+-
+-- Issue #4084: Fix max, min, max_mag and min_mag Decimal methods to
+-  give correct results in the case where one argument is a quiet NaN
+-  and the other is a finite number that requires rounding.
+-
+-- Issue #4483: _dbm module now builds on systems with gdbm & gdbm_compat
+-  libs.
+-
+-- Added the subprocess.check_call_output() convenience function to get output
+-  from a subprocess on success or raise an exception on error.
+-
+-- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
+-  support unusual filenames (such as those containing semi-colons) in
+-  Content-Disposition headers.
+-
+-- Issue #4384: Added logging integration with warnings module using
+-  captureWarnings(). This change includes a NullHandler which does nothing;
+-  it will be of use to library developers who want to avoid the "No handlers
+-  could be found for logger XXX" message which can appear if the library user
+-  doesn't configure logging.
+-
+-- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
+-  exception.
+-
+-- Issue #4529: fix the parser module's validation of try-except-finally
+-  statements.
+-
+-- Issue #4458: getopt.gnu_getopt() now recognizes a single "-" as an argument,
+-  not a malformed option.
+-
+-- Added the subprocess.check_output() convenience function to get output
+-  from a subprocess on success or raise an exception on error.
+-
+-- Issue #4542: On Windows, binascii.crc32 still accepted str as binary input;
+-  the corresponding tests now pass.
+-
+-- Issue #4537: webbrowser.UnixBrowser would fail to open the browser because
+-  it was calling the wrong open() function.
+-
+-- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
+-  support unusual filenames (such as those containing semi-colons) in
+-  Content-Disposition headers.
+-
+-- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on
+-  biarch systems. Try to rely on ldconfig only, without using objdump and gcc.
+-
+-- Issue #5104: The socket module now raises OverflowError when 16-bit port and
+-  protocol numbers are supplied outside the allowed 0-65536 range on bind()
+-  and getservbyport().
+-
+-- Windows locale mapping updated to Vista.
+-
+-Tools/Demos
+------------
+-
+-- Issue #4704: remove use of cmp() in pybench, bump its version number to 2.1,
+-  and make it 2.6-compatible.
+-
+-- Ttk demos added in Demo/tkinter/ttk/
+-
+-- Issue #4677: add two list comprehension tests to pybench.
+-
+-
+-Build
+------
+-
+-- Issue #6094: Build correctly with Subversion 1.7.
+-
+-- Issue #5847: Remove -n switch on "Edit with IDLE" menu item.
+-
+-- Issue #5726: Make Modules/ld_so_aix return the actual exit code of the
+-  linker, rather than always exit successfully. Patch by Floris Bruynooghe.
+-
+-- Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify
+-  the order that backends for the dbm extension are checked.
+-
+-- Link the shared python library with $(MODLIBS).
+-
+-- Issue #5134: Silence compiler warnings when compiling sqlite with VC++.
+-
+-- Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows.
+-
+-- Issue #4895: Use _strdup on Windows CE.
+-
+-- Issue #4472: "configure --enable-shared" now works on OSX
+-
+-- Issues #4728 and #4060: WORDS_BIGEDIAN is now correct in Universal builds.
+-
+-- Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
+-
+-- Issue #4289: Remove Cancel button from AdvancedDlg.
+-
+-- Issue #1656675: Register a drop handler for .py* files on Windows.
+-
+-- Issue #4120: Exclude manifest from extension modules in VS2008.
+-
+-- Issue #4091: Install pythonxy.dll in system32 again.
+-
+-- Issue #4018: Disable "for me" installations on Vista.
+-
+-- Issue #3758: Add ``patchcheck`` build target to .PHONY.
+-
+-- Issue #4204: Fixed module build errors on FreeBSD 4.
+-
+-
+-C-API
+------
+-
+-- Issue #6624: yArg_ParseTuple with "s" format when parsing argument with
+-  NUL: Bogus TypeError detail string.
+-
+-- Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError
+-  for negative arguments.  Previously, it raised TypeError.
+-
+-- Issue #4720: The format for PyArg_ParseTupleAndKeywords can begin with '|'.
+-
+-- Issue #3632: from the gdb debugger, the 'pyo' macro can now be called when
+-  the GIL is released, or owned by another thread.
+-
+-- Issue #4122: On Windows, fix a compilation error when using the
+-  Py_UNICODE_ISSPACE macro in an extension module.
+-
+-
+-Extension Modules
+------------------
+-
+-- Issue #3745: Fix hashlib to always reject unicode and non buffer-api
+-  supporting objects as input no matter how it was compiled (built in
+-  implementations or external openssl library).
+-
+-- Issue #4397: Fix occasional test_socket failure on OS X.
+-
+-- Issue #4279: Fix build of parsermodule under Cygwin.
+-
+-- Issue #4751: hashlib now releases the GIL when hashing large buffers
+-  (with a hardwired threshold of 2048 bytes), allowing better parallelization
+-  on multi-CPU systems. Contributed by Lukas Lueg (ebfe) and Victor Stinner.
+-
+-- Issue #4051: Prevent conflict of UNICODE macros in cPickle.
+-
+-- Issue #4738: Each zlib object now has a separate lock, allowing to compress
+-  or decompress several streams at once on multi-CPU systems. Also, the GIL
+-  is now released when computing the CRC of a large buffer. Patch by ebfe.
+-
+-- Issue #4228: Pack negative values the same way as 2.4 in struct's L format.
+-
+-- Issue #1040026: Fix os.times result on systems where HZ is incorrect.
+-
+-- Issues #3167, #3682: Fix test_math failures for log, log10 on Solaris,
+-  OpenBSD.
+-
+-- Issue #4583: array.array would not always prohibit resizing when a buffer
+-  has been exported, resulting in an interpreter crash when accessing the
+-  buffer.
+-
+-
+-- Issue #5228: Make functools.partial objects can now be pickled.
+-
+-Tests
+------
+-
+-- Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running
+-  regression tests in parallel, shortening the total runtime.
+-
+-- Issue #5450: Moved tests involving loading tk from Lib/test/test_tcl to
+-  Lib/tkinter/test/test_tkinter/test_loadtk. With this, these tests demonstrate
+-  the same behaviour as test_ttkguionly (and now also test_tk) which is to
+-  skip the tests if DISPLAY is defined but can't be used.
+-
+-- regrtest no longer treats ImportError as equivalent to SkipTest.  Imports
+-  that should cause a test to be skipped are now done using import_module
+-  from test support, which does the conversion.
+-
+-- Issue #5083: New 'gui' resource for regrtest.
+-
+-
+-Docs
+-----
+-
+-
+ **(For information about older versions, consult the HISTORY file.)**
+diff -r bd8afb90ebf2 Modules/_bz2module.c
+--- a/Modules/_bz2module.c
++++ b/Modules/_bz2module.c
+@@ -123,7 +123,14 @@
+        giving us amortized linear-time behavior. Use a less-than-double
+        growth factor to avoid excessive allocation. */
+     size_t size = PyBytes_GET_SIZE(*buf);
+-    return _PyBytes_Resize(buf, size + (size >> 3) + 6);
++    size_t new_size = size + (size >> 3) + 6;
++    if (new_size > size) {
++        return _PyBytes_Resize(buf, new_size);
++    } else {  /* overflow */
++        PyErr_SetString(PyExc_OverflowError,
++                        "Unable to allocate buffer - output too large");
++        return -1;
++    }
+ }
+ 
+ 
+@@ -138,17 +145,37 @@
+     result = PyBytes_FromStringAndSize(NULL, SMALLCHUNK);
+     if (result == NULL)
+         return NULL;
++
+     c->bzs.next_in = data;
+-    /* On a 64-bit system, len might not fit in avail_in (an unsigned int).
+-       Do compression in chunks of no more than UINT_MAX bytes each. */
+-    c->bzs.avail_in = MIN(len, UINT_MAX);
+-    len -= c->bzs.avail_in;
++    c->bzs.avail_in = 0;
+     c->bzs.next_out = PyBytes_AS_STRING(result);
+     c->bzs.avail_out = PyBytes_GET_SIZE(result);
+     for (;;) {
+         char *this_out;
+         int bzerror;
+ 
++        /* On a 64-bit system, len might not fit in avail_in (an unsigned int).
++           Do compression in chunks of no more than UINT_MAX bytes each. */
++        if (c->bzs.avail_in == 0 && len > 0) {
++            c->bzs.avail_in = MIN(len, UINT_MAX);
++            len -= c->bzs.avail_in;
++        }
++
++        /* In regular compression mode, stop when input data is exhausted. */
++        if (action == BZ_RUN && c->bzs.avail_in == 0)
++            break;
++
++        if (c->bzs.avail_out == 0) {
++            size_t buffer_left = PyBytes_GET_SIZE(result) - data_size;
++            if (buffer_left == 0) {
++                if (grow_buffer(&result) < 0)
++                    goto error;
++                c->bzs.next_out = PyBytes_AS_STRING(result) + data_size;
++                buffer_left = PyBytes_GET_SIZE(result) - data_size;
++            }
++            c->bzs.avail_out = MIN(buffer_left, UINT_MAX);
++        }
++
+         Py_BEGIN_ALLOW_THREADS
+         this_out = c->bzs.next_out;
+         bzerror = BZ2_bzCompress(&c->bzs, action);
+@@ -157,23 +184,9 @@
+         if (catch_bz2_error(bzerror))
+             goto error;
+ 
+-        if (c->bzs.avail_in == 0 && len > 0) {
+-            c->bzs.avail_in = MIN(len, UINT_MAX);
+-            len -= c->bzs.avail_in;
+-        }
+-
+-        /* In regular compression mode, stop when input data is exhausted.
+-           In flushing mode, stop when all buffered data has been flushed. */
+-        if ((action == BZ_RUN && c->bzs.avail_in == 0) ||
+-            (action == BZ_FINISH && bzerror == BZ_STREAM_END))
++        /* In flushing mode, stop when all buffered data has been flushed. */
++        if (action == BZ_FINISH && bzerror == BZ_STREAM_END)
+             break;
+-
+-        if (c->bzs.avail_out == 0) {
+-            if (grow_buffer(&result) < 0)
+-                goto error;
+-            c->bzs.next_out = PyBytes_AS_STRING(result) + data_size;
+-            c->bzs.avail_out = PyBytes_GET_SIZE(result) - data_size;
+-        }
+     }
+     if (data_size != PyBytes_GET_SIZE(result))
+         if (_PyBytes_Resize(&result, data_size) < 0)
+@@ -390,10 +403,14 @@
+             len -= d->bzs.avail_in;
+         }
+         if (d->bzs.avail_out == 0) {
+-            if (grow_buffer(&result) < 0)
+-                goto error;
+-            d->bzs.next_out = PyBytes_AS_STRING(result) + data_size;
+-            d->bzs.avail_out = PyBytes_GET_SIZE(result) - data_size;
++            size_t buffer_left = PyBytes_GET_SIZE(result) - data_size;
++            if (buffer_left == 0) {
++                if (grow_buffer(&result) < 0)
++                    goto error;
++                d->bzs.next_out = PyBytes_AS_STRING(result) + data_size;
++                buffer_left = PyBytes_GET_SIZE(result) - data_size;
++            }
++            d->bzs.avail_out = MIN(buffer_left, UINT_MAX);
+         }
+     }
+     if (data_size != PyBytes_GET_SIZE(result))
+diff -r bd8afb90ebf2 Modules/_codecsmodule.c
+--- a/Modules/_codecsmodule.c
++++ b/Modules/_codecsmodule.c
+@@ -177,12 +177,12 @@
+         return NULL;
+ 
+     size = PyBytes_GET_SIZE(str);
+-    newsize = 4*size;
+-    if (newsize > PY_SSIZE_T_MAX || newsize / 4 != size) {
++    if (size > PY_SSIZE_T_MAX / 4) {
+         PyErr_SetString(PyExc_OverflowError,
+             "string is too large to encode");
+             return NULL;
+     }
++    newsize = 4*size;
+     v = PyBytes_FromStringAndSize(NULL, newsize);
+ 
+     if (v == NULL) {
+diff -r bd8afb90ebf2 Modules/_collectionsmodule.c
+--- a/Modules/_collectionsmodule.c
++++ b/Modules/_collectionsmodule.c
+@@ -413,10 +413,9 @@
+ static int
+ _deque_rotate(dequeobject *deque, Py_ssize_t n)
+ {
+-    Py_ssize_t i, len=deque->len, halflen=(len+1)>>1;
+-    PyObject *item, *rv;
++    Py_ssize_t m, len=deque->len, halflen=len>>1;
+ 
+-    if (len == 0)
++    if (len <= 1)
+         return 0;
+     if (n > halflen || n < -halflen) {
+         n %= len;
+@@ -425,24 +424,79 @@
+         else if (n < -halflen)
+             n += len;
+     }
++    assert(len > 1);
++    assert(-halflen <= n && n <= halflen);
+ 
+-    for (i=0 ; i<n ; i++) {
+-        item = deque_pop(deque, NULL);
+-        assert (item != NULL);
+-        rv = deque_appendleft(deque, item);
+-        Py_DECREF(item);
+-        if (rv == NULL)
+-            return -1;
+-        Py_DECREF(rv);
++    deque->state++;
++    while (n > 0) {
++        if (deque->leftindex == 0) {
++            block *b = newblock(NULL, deque->leftblock, len);
++            if (b == NULL)
++                return -1;
++            assert(deque->leftblock->leftlink == NULL);
++            deque->leftblock->leftlink = b;
++            deque->leftblock = b;
++            deque->leftindex = BLOCKLEN;
++        }
++        assert(deque->leftindex > 0);
++
++        m = n;
++        if (m > deque->rightindex + 1)
++            m = deque->rightindex + 1;
++        if (m > deque->leftindex)
++            m = deque->leftindex;
++        assert (m > 0 && m <= len);
++        memcpy(&deque->leftblock->data[deque->leftindex - m],
++               &deque->rightblock->data[deque->rightindex + 1 - m],
++               m * sizeof(PyObject *));
++        deque->rightindex -= m;
++        deque->leftindex -= m;
++        n -= m;
++
++        if (deque->rightindex == -1) {
++            block *prevblock = deque->rightblock->leftlink;
++            assert(deque->rightblock != NULL);
++            assert(deque->leftblock != deque->rightblock);
++            freeblock(deque->rightblock);
++            prevblock->rightlink = NULL;
++            deque->rightblock = prevblock;
++            deque->rightindex = BLOCKLEN - 1;
++        }
+     }
+-    for (i=0 ; i>n ; i--) {
+-        item = deque_popleft(deque, NULL);
+-        assert (item != NULL);
+-        rv = deque_append(deque, item);
+-        Py_DECREF(item);
+-        if (rv == NULL)
+-            return -1;
+-        Py_DECREF(rv);
++    while (n < 0) {
++        if (deque->rightindex == BLOCKLEN - 1) {
++            block *b = newblock(deque->rightblock, NULL, len);
++            if (b == NULL)
++                return -1;
++            assert(deque->rightblock->rightlink == NULL);
++            deque->rightblock->rightlink = b;
++            deque->rightblock = b;
++            deque->rightindex = -1;
++        }
++        assert (deque->rightindex < BLOCKLEN - 1);
++
++        m = -n;
++        if (m > BLOCKLEN - deque->leftindex)
++            m = BLOCKLEN - deque->leftindex;
++        if (m > BLOCKLEN - 1 - deque->rightindex)
++            m = BLOCKLEN - 1 - deque->rightindex;
++        assert (m > 0 && m <= len);
++        memcpy(&deque->rightblock->data[deque->rightindex + 1],
++               &deque->leftblock->data[deque->leftindex],
++               m * sizeof(PyObject *));
++        deque->leftindex += m;
++        deque->rightindex += m;
++        n += m;
++
++        if (deque->leftindex == BLOCKLEN) {
++            block *nextblock = deque->leftblock->rightlink;
++            assert(deque->leftblock != deque->rightblock);
++            freeblock(deque->leftblock);
++            assert(nextblock != NULL);
++            nextblock->leftlink = NULL;
++            deque->leftblock = nextblock;
++            deque->leftindex = 0;
++        }
+     }
+     return 0;
+ }
+@@ -588,7 +642,7 @@
+ PyDoc_STRVAR(remove_doc,
+ "D.remove(value) -- remove first occurrence of value.");
+ 
+-static int
++static void
+ deque_clear(dequeobject *deque)
+ {
+     PyObject *item;
+@@ -601,7 +655,6 @@
+     assert(deque->leftblock == deque->rightblock &&
+            deque->leftindex - 1 == deque->rightindex &&
+            deque->len == 0);
+-    return 0;
+ }
+ 
+ static PyObject *
+@@ -704,10 +757,7 @@
+ static PyObject *
+ deque_clearmethod(dequeobject *deque)
+ {
+-    int rv;
+-
+-    rv = deque_clear(deque);
+-    assert (rv != -1);
++    deque_clear(deque);
+     Py_RETURN_NONE;
+ }
+ 
+@@ -1019,7 +1069,7 @@
+ };
+ 
+ PyDoc_STRVAR(deque_doc,
+-"deque(iterable[, maxlen]) --> deque object\n\
++"deque([iterable[, maxlen]]) --> deque object\n\
+ \n\
+ Build an ordered collection with optimized access from its endpoints.");
+ 
+diff -r bd8afb90ebf2 Modules/_csv.c
+--- a/Modules/_csv.c
++++ b/Modules/_csv.c
+@@ -13,8 +13,6 @@
+ #include "Python.h"
+ #include "structmember.h"
+ 
+-#define IS_BASESTRING(o) \
+-    PyUnicode_Check(o)
+ 
+ typedef struct {
+     PyObject *error_obj;   /* CSV exception */
+@@ -248,6 +246,7 @@
+                     name);
+                 return -1;
+             }
++            /* PyUnicode_READY() is called in PyUnicode_GetLength() */
+             if (len > 0)
+                 *target = PyUnicode_READ_CHAR(src, 0);
+         }
+@@ -263,12 +262,14 @@
+     else {
+         if (src == Py_None)
+             *target = NULL;
+-        else if (!IS_BASESTRING(src)) {
++        else if (!PyUnicode_Check(src)) {
+             PyErr_Format(PyExc_TypeError,
+                          "\"%s\" must be a string", name);
+             return -1;
+         }
+         else {
++            if (PyUnicode_READY(src) == -1)
++                return -1;
+             Py_XDECREF(*target);
+             Py_INCREF(src);
+             *target = src;
+@@ -357,7 +358,7 @@
+         return NULL;
+ 
+     if (dialect != NULL) {
+-        if (IS_BASESTRING(dialect)) {
++        if (PyUnicode_Check(dialect)) {
+             dialect = get_dialect_from_registry(dialect);
+             if (dialect == NULL)
+                 return NULL;
+@@ -788,9 +789,14 @@
+         lineobj = PyIter_Next(self->input_iter);
+         if (lineobj == NULL) {
+             /* End of input OR exception */
+-            if (!PyErr_Occurred() && self->field_len != 0)
+-                PyErr_Format(_csvstate_global->error_obj,
+-                             "newline inside string");
++            if (!PyErr_Occurred() && (self->field_len != 0 ||
++                                      self->state == IN_QUOTED_FIELD)) {
++                if (self->dialect->strict)
++                    PyErr_SetString(_csvstate_global->error_obj,
++                                    "unexpected end of data");
++                else if (parse_save_field(self) >= 0)
++                    break;
++            }
+             return NULL;
+         }
+         if (!PyUnicode_Check(lineobj)) {
+@@ -803,6 +809,10 @@
+             Py_DECREF(lineobj);
+             return NULL;
+         }
++        if (PyUnicode_READY(lineobj) == -1) {
++            Py_DECREF(lineobj);
++            return NULL;
++        }
+         ++self->line_num;
+         kind = PyUnicode_KIND(lineobj);
+         data = PyUnicode_DATA(lineobj);
+@@ -1103,6 +1113,8 @@
+     Py_ssize_t rec_len;
+ 
+     if (field != NULL) {
++        if (PyUnicode_READY(field) == -1)
++            return 0;
+         field_kind = PyUnicode_KIND(field);
+         field_data = PyUnicode_DATA(field);
+         field_len = PyUnicode_GET_LENGTH(field);
+@@ -1398,11 +1410,13 @@
+ 
+     if (!PyArg_UnpackTuple(args, "", 1, 2, &name_obj, &dialect_obj))
+         return NULL;
+-    if (!IS_BASESTRING(name_obj)) {
++    if (!PyUnicode_Check(name_obj)) {
+         PyErr_SetString(PyExc_TypeError,
+-                        "dialect name must be a string or unicode");
++                        "dialect name must be a string");
+         return NULL;
+     }
++    if (PyUnicode_READY(name_obj) == -1)
++        return NULL;
+     dialect = _call_dialect(dialect_obj, kwargs);
+     if (dialect == NULL)
+         return NULL;
+diff -r bd8afb90ebf2 Modules/_ctypes/_ctypes.c
+--- a/Modules/_ctypes/_ctypes.c
++++ b/Modules/_ctypes/_ctypes.c
+@@ -2442,11 +2442,9 @@
+ static int
+ PyCData_clear(CDataObject *self)
+ {
+-    StgDictObject *dict = PyObject_stgdict((PyObject *)self);
+-    assert(dict); /* Cannot be NULL for CDataObject instances */
+     Py_CLEAR(self->b_objects);
+     if ((self->b_needsfree)
+-        && ((size_t)dict->size > sizeof(self->b_value)))
++        && _CDataObject_HasExternalBuffer(self))
+         PyMem_Free(self->b_ptr);
+     self->b_ptr = NULL;
+     Py_CLEAR(self->b_base);
+@@ -3190,23 +3188,37 @@
+ {
+     char *name;
+     int (* address)(void);
++    PyObject *ftuple;
+     PyObject *dll;
+     PyObject *obj;
+     PyCFuncPtrObject *self;
+     void *handle;
+     PyObject *paramflags = NULL;
+ 
+-    if (!PyArg_ParseTuple(args, "(O&O)|O", _get_name, &name, &dll, &paramflags))
++    if (!PyArg_ParseTuple(args, "O|O", &ftuple, &paramflags))
+         return NULL;
+     if (paramflags == Py_None)
+         paramflags = NULL;
+ 
++    ftuple = PySequence_Tuple(ftuple);
++    if (!ftuple)
++        /* Here ftuple is a borrowed reference */
++        return NULL;
++
++    if (!PyArg_ParseTuple(ftuple, "O&O", _get_name, &name, &dll)) {
++        Py_DECREF(ftuple);
++        return NULL;
++    }
++
+     obj = PyObject_GetAttrString(dll, "_handle");
+-    if (!obj)
++    if (!obj) {
++        Py_DECREF(ftuple);
+         return NULL;
++    }
+     if (!PyLong_Check(obj)) {
+         PyErr_SetString(PyExc_TypeError,
+                         "the _handle attribute of the second argument must be an integer");
++        Py_DECREF(ftuple);
+         Py_DECREF(obj);
+         return NULL;
+     }
+@@ -3215,6 +3227,7 @@
+     if (PyErr_Occurred()) {
+         PyErr_SetString(PyExc_ValueError,
+                         "could not convert the _handle attribute to a pointer");
++        Py_DECREF(ftuple);
+         return NULL;
+     }
+ 
+@@ -3229,6 +3242,7 @@
+             PyErr_Format(PyExc_AttributeError,
+                          "function ordinal %d not found",
+                          (WORD)(size_t)name);
++        Py_DECREF(ftuple);
+         return NULL;
+     }
+ #else
+@@ -3242,9 +3256,12 @@
+ #else
+         PyErr_SetString(PyExc_AttributeError, ctypes_dlerror());
+ #endif
++        Py_DECREF(ftuple);
+         return NULL;
+     }
+ #endif
++    Py_INCREF(dll); /* for KeepRef */
++    Py_DECREF(ftuple);
+     if (!_validate_paramflags(type, paramflags))
+         return NULL;
+ 
+@@ -3257,7 +3274,6 @@
+ 
+     *(void **)self->b_ptr = address;
+ 
+-    Py_INCREF((PyObject *)dll); /* for KeepRef */
+     if (-1 == KeepRef((CDataObject *)self, 0, dll)) {
+         Py_DECREF((PyObject *)self);
+         return NULL;
+diff -r bd8afb90ebf2 Modules/_ctypes/callproc.c
+--- a/Modules/_ctypes/callproc.c
++++ b/Modules/_ctypes/callproc.c
+@@ -817,11 +817,11 @@
+         space[0] = errno;
+         errno = temp;
+     }
+-    Py_XDECREF(error_object);
+ #ifdef WITH_THREAD
+     if ((flags & FUNCFLAG_PYTHONAPI) == 0)
+         Py_BLOCK_THREADS
+ #endif
++    Py_XDECREF(error_object);
+ #ifdef MS_WIN32
+ #ifndef DONT_USE_SEH
+     if (dwExceptionCode) {
+@@ -1658,7 +1658,7 @@
+         obj->b_size = size;
+         goto done;
+     }
+-    if (obj->b_size <= sizeof(obj->b_value)) {
++    if (!_CDataObject_HasExternalBuffer(obj)) {
+         /* We are currently using the objects default buffer, but it
+            isn't large enough any more. */
+         void *ptr = PyMem_Malloc(size);
+diff -r bd8afb90ebf2 Modules/_ctypes/ctypes.h
+--- a/Modules/_ctypes/ctypes.h
++++ b/Modules/_ctypes/ctypes.h
+@@ -116,6 +116,7 @@
+ extern PyTypeObject PyCData_Type;
+ #define CDataObject_CheckExact(v)       ((v)->ob_type == &PyCData_Type)
+ #define CDataObject_Check(v)            PyObject_TypeCheck(v, &PyCData_Type)
++#define _CDataObject_HasExternalBuffer(v)  ((v)->b_ptr != (char *)&(v)->b_value)
+ 
+ extern PyTypeObject PyCSimpleType_Type;
+ #define PyCSimpleTypeObject_CheckExact(v)       ((v)->ob_type == &PyCSimpleType_Type)
+diff -r bd8afb90ebf2 Modules/_ctypes/libffi/configure
+--- a/Modules/_ctypes/libffi/configure
++++ b/Modules/_ctypes/libffi/configure
+@@ -14322,10 +14322,10 @@
+   $as_echo_n "(cached) " >&6
+ else
+ 
+-	libffi_cv_as_x86_pcrel=yes
++	libffi_cv_as_x86_pcrel=no
+ 	echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
+-	if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then
+-	    libffi_cv_as_x86_pcrel=no
++	if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
++	    libffi_cv_as_x86_pcrel=yes
+ 	fi
+ 
+ fi
+diff -r bd8afb90ebf2 Modules/_ctypes/libffi/configure.ac
+--- a/Modules/_ctypes/libffi/configure.ac
++++ b/Modules/_ctypes/libffi/configure.ac
+@@ -303,10 +303,10 @@
+ if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
+     AC_CACHE_CHECK([assembler supports pc related relocs],
+ 	libffi_cv_as_x86_pcrel, [
+-	libffi_cv_as_x86_pcrel=yes
++	libffi_cv_as_x86_pcrel=no
+ 	echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
+-	if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then
+-	    libffi_cv_as_x86_pcrel=no
++	if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
++	    libffi_cv_as_x86_pcrel=yes
+ 	fi
+ 	])
+     if test "x$libffi_cv_as_x86_pcrel" = xyes; then
+diff -r bd8afb90ebf2 Modules/_ctypes/stgdict.c
+--- a/Modules/_ctypes/stgdict.c
++++ b/Modules/_ctypes/stgdict.c
+@@ -335,7 +335,7 @@
+ 
+     isPacked = PyObject_GetAttrString(type, "_pack_");
+     if (isPacked) {
+-        pack = PyLong_AsLong(isPacked);
++        pack = _PyLong_AsInt(isPacked);
+         if (pack < 0 || PyErr_Occurred()) {
+             Py_XDECREF(isPacked);
+             PyErr_SetString(PyExc_ValueError,
+diff -r bd8afb90ebf2 Modules/_cursesmodule.c
+--- a/Modules/_cursesmodule.c
++++ b/Modules/_cursesmodule.c
+@@ -1938,6 +1938,7 @@
+     if (ascii == NULL)
+         return -1;
+     encoding = strdup(PyBytes_AS_STRING(ascii));
++    Py_DECREF(ascii);
+     if (encoding == NULL) {
+         PyErr_NoMemory();
+         return -1;
+diff -r bd8afb90ebf2 Modules/_datetimemodule.c
+--- a/Modules/_datetimemodule.c
++++ b/Modules/_datetimemodule.c
+@@ -1265,14 +1265,13 @@
+         assert(ptoappend != NULL);
+         assert(ntoappend > 0);
+         while (usednew + ntoappend > totalnew) {
+-            size_t bigger = totalnew << 1;
+-            if ((bigger >> 1) != totalnew) { /* overflow */
++            if (totalnew > (PY_SSIZE_T_MAX >> 1)) { /* overflow */
+                 PyErr_NoMemory();
+                 goto Done;
+             }
+-            if (_PyBytes_Resize(&newfmt, bigger) < 0)
++            totalnew <<= 1;
++            if (_PyBytes_Resize(&newfmt, totalnew) < 0)
+                 goto Done;
+-            totalnew = bigger;
+             pnew = PyBytes_AsString(newfmt) + usednew;
+         }
+         memcpy(pnew, ptoappend, ntoappend);
+@@ -3599,7 +3598,7 @@
+ {
+     char buf[100];
+     PyObject *result;
+-    int us = TIME_GET_MICROSECOND(self);;
++    int us = TIME_GET_MICROSECOND(self);
+ 
+     if (us)
+         result = PyUnicode_FromFormat("%02d:%02d:%02d.%06d",
+diff -r bd8afb90ebf2 Modules/_decimal/README.txt
+--- a/Modules/_decimal/README.txt
++++ b/Modules/_decimal/README.txt
+@@ -37,7 +37,7 @@
+ 
+ NOTE
+ ====
+- 
++
+ decimal.so is not built from a static libmpdec.a since doing so led to
+ failures on AIX (user report) and Windows (mixing static and dynamic CRTs
+ causes locale problems and more).
+diff -r bd8afb90ebf2 Modules/_decimal/_decimal.c
+--- a/Modules/_decimal/_decimal.c
++++ b/Modules/_decimal/_decimal.c
+@@ -202,6 +202,13 @@
+     "Underflow",
+ };
+ 
++#ifdef EXTRA_FUNCTIONALITY
++  #define _PY_DEC_ROUND_GUARD MPD_ROUND_GUARD
++#else
++  #define _PY_DEC_ROUND_GUARD (MPD_ROUND_GUARD-1)
++#endif
++static PyObject *round_map[_PY_DEC_ROUND_GUARD];
++
+ static const char *invalid_rounding_err =
+ "valid values for rounding are:\n\
+   [ROUND_CEILING, ROUND_FLOOR, ROUND_UP, ROUND_DOWN,\n\
+@@ -249,13 +256,6 @@
+     return -1;
+ }
+ 
+-static PyObject *
+-type_error_ptr(const char *mesg)
+-{
+-    PyErr_SetString(PyExc_TypeError, mesg);
+-    return NULL;
+-}
+-
+ static int
+ runtime_error_int(const char *mesg)
+ {
+@@ -502,6 +502,27 @@
+     return 0;
+ }
+ 
++static int
++getround(PyObject *v)
++{
++    int i;
++
++    if (PyUnicode_Check(v)) {
++        for (i = 0; i < _PY_DEC_ROUND_GUARD; i++) {
++            if (v == round_map[i]) {
++                return i;
++            }
++        }
++        for (i = 0; i < _PY_DEC_ROUND_GUARD; i++) {
++            if (PyUnicode_Compare(v, round_map[i]) == 0) {
++                return i;
++            }
++        }
++    }
++
++    return type_error_int(invalid_rounding_err);
++}
++
+ 
+ /******************************************************************************/
+ /*                            SignalDict Object                               */
+@@ -715,7 +736,6 @@
+ Dec_CONTEXT_GET_SSIZE(prec)
+ Dec_CONTEXT_GET_SSIZE(emax)
+ Dec_CONTEXT_GET_SSIZE(emin)
+-Dec_CONTEXT_GET_SSIZE(round)
+ Dec_CONTEXT_GET_SSIZE(clamp)
+ 
+ #ifdef EXTRA_FUNCTIONALITY
+@@ -724,6 +744,15 @@
+ #endif
+ 
+ static PyObject *
++context_getround(PyObject *self, void *closure UNUSED)
++{
++    int i = mpd_getround(CTX(self));
++
++    Py_INCREF(round_map[i]);
++    return round_map[i];
++}
++
++static PyObject *
+ context_getcapitals(PyObject *self, void *closure UNUSED)
+ {
+     return PyLong_FromLong(CtxCaps(self));
+@@ -875,17 +904,16 @@
+ context_setround(PyObject *self, PyObject *value, void *closure UNUSED)
+ {
+     mpd_context_t *ctx;
+-    mpd_ssize_t x;
+-
+-    x = PyLong_AsSsize_t(value);
+-    if (x == -1 && PyErr_Occurred()) {
++    int x;
++
++    x = getround(value);
++    if (x == -1) {
+         return -1;
+     }
+-    BOUNDS_CHECK(x, INT_MIN, INT_MAX);
+ 
+     ctx = CTX(self);
+-    if (!mpd_qsetround(ctx, (int)x)) {
+-        return type_error_int(invalid_rounding_err);
++    if (!mpd_qsetround(ctx, x)) {
++        INTERNAL_ERROR_INT("context_setround"); /* GCOV_NOT_REACHED */
+     }
+ 
+     return 0;
+@@ -1208,83 +1236,52 @@
+ }
+ 
+ static int
+-getround(PyObject *v)
+-{
+-    const char *s;
+-    long x;
+-    int i;
+-
+-    if (PyLong_Check(v)) {
+-        x = PyLong_AsLong(v);
+-        if (x == -1 && PyErr_Occurred()) {
+-            return -1;
+-        }
+-        BOUNDS_CHECK(x, 0, INT_MAX);
+-        return (int)x;
+-    }
+-    else if (PyUnicode_Check(v)) {
+-        for (i = 0; i < MPD_ROUND_GUARD; i++) {
+-            s = mpd_round_string[i];
+-            if (PyUnicode_CompareWithASCIIString(v, s) == 0) {
+-                return i;
+-            }
+-        }
+-    }
+-
+-    return type_error_int("invalid rounding mode");
+-}
+-
+-static int
+ context_init(PyObject *self, PyObject *args, PyObject *kwds)
+ {
+     static char *kwlist[] = {
+       "prec", "rounding", "Emin", "Emax", "capitals", "clamp",
+       "flags", "traps", NULL
+     };
+-    PyObject *rounding = NULL;
+-    PyObject *traps = NULL;
+-    PyObject *status = NULL;
+-    mpd_context_t *ctx, t;
+-    int capitals = 1;
++    PyObject *prec = Py_None;
++    PyObject *rounding = Py_None;
++    PyObject *emin = Py_None;
++    PyObject *emax = Py_None;
++    PyObject *capitals = Py_None;
++    PyObject *clamp = Py_None;
++    PyObject *status = Py_None;
++    PyObject *traps = Py_None;
+     int ret;
+ 
+     assert(PyTuple_Check(args));
+-    ctx = CTX(self);
+-
+-    t = *ctx;
++
+     if (!PyArg_ParseTupleAndKeywords(
+             args, kwds,
+-            "|nOnniiOO", kwlist,
+-            &t.prec, &rounding, &t.emin, &t.emax, &capitals, &t.clamp,
+-            &status, &traps
++            "|OOOOOOOO", kwlist,
++            &prec, &rounding, &emin, &emax, &capitals, &clamp, &status, &traps
+          )) {
+         return -1;
+     }
+-    if (rounding != NULL) {
+-        t.round = getround(rounding);
+-        if (t.round < 0) {
+-            return -1;
+-        }
+-    }
+-
+-    if (!mpd_qsetprec(ctx, t.prec) ||
+-        !mpd_qsetemin(ctx, t.emin) ||
+-        !mpd_qsetemax(ctx, t.emax) ||
+-        !mpd_qsetclamp(ctx, t.clamp)) {
+-        return value_error_int("invalid context");
+-    }
+-    if (!mpd_qsetround(ctx, t.round) ||
+-        !mpd_qsettraps(ctx, t.traps) ||
+-        !mpd_qsetstatus(ctx, t.status)) {
+-        return type_error_int("invalid context");
+-    }
+-
+-    if (capitals != 0 && capitals != 1) {
+-        return value_error_int("invalid context");
+-    }
+-    CtxCaps(self) = capitals;
+-
+-    if (traps != NULL) {
++
++    if (prec != Py_None && context_setprec(self, prec, NULL) < 0) {
++        return -1;
++    }
++    if (rounding != Py_None && context_setround(self, rounding, NULL) < 0) {
++        return -1;
++    }
++    if (emin != Py_None && context_setemin(self, emin, NULL) < 0) {
++        return -1;
++    }
++    if (emax != Py_None && context_setemax(self, emax, NULL) < 0) {
++        return -1;
++    }
++    if (capitals != Py_None && context_setcapitals(self, capitals, NULL) < 0) {
++        return -1;
++    }
++    if (clamp != Py_None && context_setclamp(self, clamp, NULL) < 0) {
++       return -1;
++    }
++
++    if (traps != Py_None) {
+         if (PyList_Check(traps)) {
+             ret = context_settraps_list(self, traps);
+         }
+@@ -1300,7 +1297,7 @@
+             return ret;
+         }
+     }
+-    if (status != NULL) {
++    if (status != Py_None) {
+         if (PyList_Check(status)) {
+             ret = context_setstatus_list(self, status);
+         }
+@@ -1486,7 +1483,10 @@
+     }
+ 
+ #define CONTEXT_CHECK_VA(obj) \
+-    if (!PyDecContext_Check(obj)) {                 \
++    if (obj == Py_None) {                           \
++        CURRENT_CONTEXT(obj);                       \
++    }                                               \
++    else if (!PyDecContext_Check(obj)) {            \
+         PyErr_SetString(PyExc_TypeError,            \
+             "optional argument must be a context"); \
+         return NULL;                                \
+@@ -1715,18 +1715,25 @@
+  * owns one reference to the global (outer) context and one
+  * to the local (inner) context. */
+ static PyObject *
+-ctxmanager_new(PyTypeObject *type UNUSED, PyObject *args)
++ctxmanager_new(PyTypeObject *type UNUSED, PyObject *args, PyObject *kwds)
+ {
++    static char *kwlist[] = {"ctx", NULL};
+     PyDecContextManagerObject *self;
+-    PyObject *local;
++    PyObject *local = Py_None;
+     PyObject *global;
+ 
+     CURRENT_CONTEXT(global);
+-    local = global;
+-    if (!PyArg_ParseTuple(args, "|O", &local)) {
++    if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist, &local)) {
+         return NULL;
+     }
+-    CONTEXT_CHECK_VA(local);
++    if (local == Py_None) {
++        local = global;
++    }
++    else if (!PyDecContext_Check(local)) {
++        PyErr_SetString(PyExc_TypeError,
++            "optional argument must be a context");
++        return NULL;
++    }
+ 
+     self = PyObject_New(PyDecContextManagerObject,
+                         &PyDecContextManager_Type);
+@@ -1892,7 +1899,9 @@
+     Py_ssize_t j, len;
+     int d;
+ 
+-    assert(PyUnicode_IS_READY(u));
++    if (PyUnicode_READY(u) == -1) {
++        return NULL;
++    }
+ 
+     kind = PyUnicode_KIND(u);
+     data = PyUnicode_DATA(u);
+@@ -2338,6 +2347,32 @@
+     return dec;
+ }
+ 
++/* Return a new PyDecObject or a subtype from a Decimal. */
++static PyObject *
++PyDecType_FromDecimalExact(PyTypeObject *type, PyObject *v, PyObject *context)
++{
++    PyObject *dec;
++    uint32_t status = 0;
++
++    if (type == &PyDec_Type && PyDec_CheckExact(v)) {
++        Py_INCREF(v);
++        return v;
++    }
++
++    dec = PyDecType_New(type);
++    if (dec == NULL) {
++        return NULL;
++    }
++
++    mpd_qcopy(MPD(dec), MPD(v), &status);
++    if (dec_addstatus(context, status)) {
++        Py_DECREF(dec);
++        return NULL;
++    }
++
++    return dec;
++}
++
+ static PyObject *
+ sequence_as_tuple(PyObject *v, PyObject *ex, const char *mesg)
+ {
+@@ -2642,8 +2677,7 @@
+         return PyDecType_FromSsizeExact(type, 0, context);
+     }
+     else if (PyDec_Check(v)) {
+-        Py_INCREF(v);
+-        return v;
++        return PyDecType_FromDecimalExact(type, v, context);
+     }
+     else if (PyUnicode_Check(v)) {
+         return PyDecType_FromUnicodeExactWS(type, v, context);
+@@ -2722,9 +2756,8 @@
+ {
+     static char *kwlist[] = {"value", "context", NULL};
+     PyObject *v = NULL;
+-    PyObject *context;
+-
+-    CURRENT_CONTEXT(context);
++    PyObject *context = Py_None;
++
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kwlist,
+                                      &v, &context)) {
+         return NULL;
+@@ -3189,7 +3222,13 @@
+ 
+     decstring = mpd_qformat_spec(MPD(dec), &spec, CTX(context), &status);
+     if (decstring == NULL) {
+-        dec_addstatus(context, status);
++        if (status & MPD_Malloc_error) {
++            PyErr_NoMemory();
++        }
++        else {
++            PyErr_SetString(PyExc_ValueError,
++                "format specification exceeds internal limits of _decimal");
++        }
+         goto finish;
+     }
+     result = PyUnicode_DecodeUTF8(decstring, strlen(decstring), NULL);
+@@ -3288,22 +3327,25 @@
+ {
+     static char *kwlist[] = {"rounding", "context", NULL};
+     PyObject *result;
+-    PyObject *context;
++    PyObject *rounding = Py_None;
++    PyObject *context = Py_None;
+     uint32_t status = 0;
+     mpd_context_t workctx;
+-    int round = -1;
+-
+-    CURRENT_CONTEXT(context);
+-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iO", kwlist,
+-                                     &round, &context)) {
++
++    if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kwlist,
++                                     &rounding, &context)) {
+         return NULL;
+     }
+     CONTEXT_CHECK_VA(context);
+ 
+     workctx = *CTX(context);
+-    if (round >= 0) {
++    if (rounding != Py_None) {
++        int round = getround(rounding);
++        if (round < 0) {
++            return NULL;
++        }
+         if (!mpd_qsetround(&workctx, round)) {
+-            return type_error_ptr(invalid_rounding_err);
++            INTERNAL_ERROR_PTR("PyDec_ToIntegralValue"); /* GCOV_NOT_REACHED */
+         }
+     }
+ 
+@@ -3326,22 +3368,25 @@
+ {
+     static char *kwlist[] = {"rounding", "context", NULL};
+     PyObject *result;
+-    PyObject *context;
++    PyObject *rounding = Py_None;
++    PyObject *context = Py_None;
+     uint32_t status = 0;
+     mpd_context_t workctx;
+-    int round = -1;
+-
+-    CURRENT_CONTEXT(context);
+-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iO", kwlist,
+-                                     &round, &context)) {
++
++    if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kwlist,
++                                     &rounding, &context)) {
+         return NULL;
+     }
+     CONTEXT_CHECK_VA(context);
+ 
+     workctx = *CTX(context);
+-    if (round >= 0) {
++    if (rounding != Py_None) {
++        int round = getround(rounding);
++        if (round < 0) {
++            return NULL;
++        }
+         if (!mpd_qsetround(&workctx, round)) {
+-            return type_error_ptr(invalid_rounding_err);
++            INTERNAL_ERROR_PTR("PyDec_ToIntegralExact"); /* GCOV_NOT_REACHED */
+         }
+     }
+ 
+@@ -3439,7 +3484,7 @@
+     }
+ }
+ 
+-PyObject *DecimalTuple = NULL;
++static PyObject *DecimalTuple = NULL;
+ /* Return the DecimalTuple representation of a PyDecObject. */
+ static PyObject *
+ PyDec_AsTuple(PyObject *dec, PyObject *dummy UNUSED)
+@@ -3606,9 +3651,8 @@
+ dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds)             \
+ {                                                                         \
+     static char *kwlist[] = {"context", NULL};                            \
+-    PyObject *context;                                                    \
++    PyObject *context = Py_None;                                          \
+                                                                           \
+-    CURRENT_CONTEXT(context);                                             \
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist,            \
+                                      &context)) {                         \
+         return NULL;                                                      \
+@@ -3625,10 +3669,9 @@
+ {                                                              \
+     static char *kwlist[] = {"context", NULL};                 \
+     PyObject *result;                                          \
+-    PyObject *context;                                         \
++    PyObject *context = Py_None;                               \
+     uint32_t status = 0;                                       \
+                                                                \
+-    CURRENT_CONTEXT(context);                                  \
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist, \
+                                      &context)) {              \
+         return NULL;                                           \
+@@ -3648,49 +3691,18 @@
+     return result;                                             \
+ }
+ 
+-/* Unary function with an optional context arg. The actual MPDFUNC
+-   only takes a status parameter. */
+-#define Dec_UnaryFuncVA_NO_CTX(MPDFUNC) \
+-static PyObject *                                              \
+-dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds)  \
+-{                                                              \
+-    static char *kwlist[] = {"context", NULL};                 \
+-    PyObject *result;                                          \
+-    PyObject *context;                                         \
+-    uint32_t status = 0;                                       \
+-                                                               \
+-    CURRENT_CONTEXT(context);                                  \
+-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist, \
+-                                     &context)) {              \
+-        return NULL;                                           \
+-    }                                                          \
+-    CONTEXT_CHECK_VA(context);                                 \
+-                                                               \
+-    if ((result = dec_alloc()) == NULL) {                      \
+-        return NULL;                                           \
+-    }                                                          \
+-                                                               \
+-    MPDFUNC(MPD(result), MPD(self), &status);                  \
+-    if (dec_addstatus(context, status)) {                      \
+-        Py_DECREF(result);                                     \
+-        return NULL;                                           \
+-    }                                                          \
+-                                                               \
+-    return result;                                             \
+-}
+-
+ /* Binary function with an optional context arg. */
+ #define Dec_BinaryFuncVA(MPDFUNC) \
+ static PyObject *                                                \
+ dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds)    \
+ {                                                                \
+     static char *kwlist[] = {"other", "context", NULL};          \
+-    PyObject *other, *context;                                   \
++    PyObject *other;                                             \
+     PyObject *a, *b;                                             \
+     PyObject *result;                                            \
++    PyObject *context = Py_None;                                 \
+     uint32_t status = 0;                                         \
+                                                                  \
+-    CURRENT_CONTEXT(context);                                    \
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O", kwlist,  \
+                                      &other, &context)) {        \
+         return NULL;                                             \
+@@ -3723,11 +3735,11 @@
+ dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds)   \
+ {                                                               \
+     static char *kwlist[] = {"other", "context", NULL};         \
+-    PyObject *other, *context;                                  \
++    PyObject *context = Py_None;                                \
++    PyObject *other;                                            \
+     PyObject *a, *b;                                            \
+     PyObject *result;                                           \
+                                                                 \
+-    CURRENT_CONTEXT(context);                                   \
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O", kwlist, \
+                                      &other, &context)) {       \
+         return NULL;                                            \
+@@ -3754,12 +3766,12 @@
+ dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds)            \
+ {                                                                        \
+     static char *kwlist[] = {"other", "third", "context", NULL};         \
+-    PyObject *other, *third, *context;                                   \
++    PyObject *other, *third;                                             \
+     PyObject *a, *b, *c;                                                 \
+     PyObject *result;                                                    \
++    PyObject *context = Py_None;                                         \
+     uint32_t status = 0;                                                 \
+                                                                          \
+-    CURRENT_CONTEXT(context);                                            \
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO|O", kwlist,         \
+                                      &other, &third, &context)) {        \
+         return NULL;                                                     \
+@@ -3992,9 +4004,45 @@
+     return result;
+ }
+ 
+-/* Unary functions, optional context arg for conversion errors */
+-Dec_UnaryFuncVA_NO_CTX(mpd_qcopy_abs)
+-Dec_UnaryFuncVA_NO_CTX(mpd_qcopy_negate)
++static PyObject *
++dec_mpd_qcopy_abs(PyObject *self, PyObject *dummy UNUSED)
++{
++    PyObject *result;
++    uint32_t status = 0;
++
++    if ((result = dec_alloc()) == NULL) {
++        return NULL;
++    }
++
++    mpd_qcopy_abs(MPD(result), MPD(self), &status);
++    if (status & MPD_Malloc_error) {
++        Py_DECREF(result);
++        PyErr_NoMemory();
++        return NULL;
++    }
++
++    return result;
++}
++
++static PyObject *
++dec_mpd_qcopy_negate(PyObject *self, PyObject *dummy UNUSED)
++{
++    PyObject *result;
++    uint32_t status = 0;
++
++    if ((result = dec_alloc()) == NULL) {
++        return NULL;
++    }
++
++    mpd_qcopy_negate(MPD(result), MPD(self), &status);
++    if (status & MPD_Malloc_error) {
++        Py_DECREF(result);
++        PyErr_NoMemory();
++        return NULL;
++    }
++
++    return result;
++}
+ 
+ /* Unary functions, optional context arg */
+ Dec_UnaryFuncVA(mpd_qinvert)
+@@ -4004,10 +4052,9 @@
+ dec_mpd_class(PyObject *self, PyObject *args, PyObject *kwds)
+ {
+     static char *kwlist[] = {"context", NULL};
+-    PyObject *context;
++    PyObject *context = Py_None;
+     const char *cp;
+ 
+-    CURRENT_CONTEXT(context);
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist,
+                                      &context)) {
+         return NULL;
+@@ -4023,11 +4070,10 @@
+ {
+     static char *kwlist[] = {"context", NULL};
+     PyObject *result;
+-    PyObject *context;
++    PyObject *context = Py_None;
+     mpd_ssize_t size;
+     char *s;
+ 
+-    CURRENT_CONTEXT(context);
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist,
+                                      &context)) {
+         return NULL;
+@@ -4054,12 +4100,12 @@
+ dec_mpd_qcopy_sign(PyObject *self, PyObject *args, PyObject *kwds)
+ {
+     static char *kwlist[] = {"other", "context", NULL};
+-    PyObject *other, *context;
++    PyObject *other;
+     PyObject *a, *b;
+     PyObject *result;
++    PyObject *context = Py_None;
+     uint32_t status = 0;
+ 
+-    CURRENT_CONTEXT(context);
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O", kwlist,
+                                      &other, &context)) {
+         return NULL;
+@@ -4089,11 +4135,11 @@
+ dec_mpd_same_quantum(PyObject *self, PyObject *args, PyObject *kwds)
+ {
+     static char *kwlist[] = {"other", "context", NULL};
+-    PyObject *other, *context;
++    PyObject *other;
+     PyObject *a, *b;
+     PyObject *result;
+-
+-    CURRENT_CONTEXT(context);
++    PyObject *context = Py_None;
++
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O", kwlist,
+                                      &other, &context)) {
+         return NULL;
+@@ -4121,24 +4167,27 @@
+ dec_mpd_qquantize(PyObject *v, PyObject *args, PyObject *kwds)
+ {
+     static char *kwlist[] = {"exp", "rounding", "context", NULL};
+-    PyObject *w, *context;
+-    PyObject *a, *b;
++    PyObject *rounding = Py_None;
++    PyObject *context = Py_None;
++    PyObject *w, *a, *b;
+     PyObject *result;
+     uint32_t status = 0;
+     mpd_context_t workctx;
+-    int round = -1;
+-
+-    CURRENT_CONTEXT(context);
+-    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|iO", kwlist,
+-                                     &w, &round, &context)) {
++
++    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OO", kwlist,
++                                     &w, &rounding, &context)) {
+         return NULL;
+     }
+     CONTEXT_CHECK_VA(context);
+ 
+     workctx = *CTX(context);
+-    if (round >= 0) {
++    if (rounding != Py_None) {
++        int round = getround(rounding);
++        if (round < 0) {
++            return NULL;
++        }
+         if (!mpd_qsetround(&workctx, round)) {
+-            return type_error_ptr(invalid_rounding_err);
++            INTERNAL_ERROR_PTR("dec_mpd_qquantize"); /* GCOV_NOT_REACHED */
+         }
+     }
+ 
+@@ -4558,8 +4607,8 @@
+   { "radix", dec_mpd_radix, METH_NOARGS, doc_radix },
+ 
+   /* Unary functions, optional context arg for conversion errors */
+-  { "copy_abs", (PyCFunction)dec_mpd_qcopy_abs, METH_VARARGS|METH_KEYWORDS, doc_copy_abs },
+-  { "copy_negate", (PyCFunction)dec_mpd_qcopy_negate, METH_VARARGS|METH_KEYWORDS, doc_copy_negate },
++  { "copy_abs", dec_mpd_qcopy_abs, METH_NOARGS, doc_copy_abs },
++  { "copy_negate", dec_mpd_qcopy_negate, METH_NOARGS, doc_copy_negate },
+ 
+   /* Unary functions, optional context arg */
+   { "logb", (PyCFunction)dec_mpd_qlogb, METH_VARARGS|METH_KEYWORDS, doc_logb },
+@@ -4889,7 +4938,7 @@
+ ctx_mpd_qpow(PyObject *context, PyObject *args, PyObject *kwds)
+ {
+     static char *kwlist[] = {"a", "b", "modulo", NULL};
+-    PyObject *base, *exp, *mod = NULL;
++    PyObject *base, *exp, *mod = Py_None;
+     PyObject *a, *b, *c = NULL;
+     PyObject *result;
+     uint32_t status = 0;
+@@ -4901,7 +4950,7 @@
+ 
+     CONVERT_BINOP_RAISE(&a, &b, base, exp, context);
+ 
+-    if (mod != NULL) {
++    if (mod != Py_None) {
+         if (!convert_op(TYPE_ERR, &c, mod, context)) {
+             Py_DECREF(a);
+             Py_DECREF(b);
+@@ -5334,7 +5383,7 @@
+ {
+   { "getcontext", (PyCFunction)PyDec_GetCurrentContext, METH_NOARGS, doc_getcontext},
+   { "setcontext", (PyCFunction)PyDec_SetCurrentContext, METH_O, doc_setcontext},
+-  { "localcontext", (PyCFunction)ctxmanager_new, METH_VARARGS, doc_localcontext},
++  { "localcontext", (PyCFunction)ctxmanager_new, METH_VARARGS|METH_KEYWORDS, doc_localcontext},
+ #ifdef EXTRA_FUNCTIONALITY
+   { "IEEEContext", (PyCFunction)ieee_context, METH_O, doc_ieee_context},
+ #endif
+@@ -5370,17 +5419,6 @@
+     {"DECIMAL64", MPD_DECIMAL64},
+     {"DECIMAL128", MPD_DECIMAL128},
+     {"IEEE_CONTEXT_MAX_BITS", MPD_IEEE_CONTEXT_MAX_BITS},
+-#endif
+-    {"ROUND_CEILING", MPD_ROUND_CEILING},
+-    {"ROUND_FLOOR", MPD_ROUND_FLOOR},
+-    {"ROUND_UP", MPD_ROUND_UP},
+-    {"ROUND_DOWN", MPD_ROUND_DOWN},
+-    {"ROUND_HALF_UP", MPD_ROUND_HALF_UP},
+-    {"ROUND_HALF_DOWN", MPD_ROUND_HALF_DOWN},
+-    {"ROUND_HALF_EVEN", MPD_ROUND_HALF_EVEN},
+-    {"ROUND_05UP", MPD_ROUND_05UP},
+-#ifdef EXTRA_FUNCTIONALITY
+-    {"ROUND_TRUNC", MPD_ROUND_TRUNC},
+     /* int condition flags */
+     {"DecClamped", MPD_Clamped},
+     {"DecConversionSyntax", MPD_Conversion_syntax},
+@@ -5631,6 +5669,13 @@
+                                           int_cm->val));
+     }
+ 
++    /* Init string constants */
++    for (i = 0; i < _PY_DEC_ROUND_GUARD; i++) {
++        ASSIGN_PTR(round_map[i], PyUnicode_InternFromString(mpd_round_string[i]));
++        Py_INCREF(round_map[i]);
++        CHECK_INT(PyModule_AddObject(m, mpd_round_string[i], round_map[i]));
++    }
++
+     /* Add specification version number */
+     CHECK_INT(PyModule_AddStringConstant(m, "__version__", " 1.70"));
+ 
+diff -r bd8afb90ebf2 Modules/_decimal/docstrings.h
+--- a/Modules/_decimal/docstrings.h
++++ b/Modules/_decimal/docstrings.h
+@@ -28,10 +28,10 @@
+ \n");
+ 
+ PyDoc_STRVAR(doc_localcontext,"\n\
+-localcontext(c) - Return a context manager that will set the default context\n\
+-to a copy of c on entry to the with-statement and restore the previous default\n\
+-context when exiting the with-statement. If no context is specified, a copy of\n\
+-the current default context is used.\n\
++localcontext(ctx=None) - Return a context manager that will set the default\n\
++context to a copy of ctx on entry to the with-statement and restore the\n\
++previous default context when exiting the with-statement. If no context is\n\
++specified, a copy of the current default context is used.\n\
+ \n");
+ 
+ #ifdef EXTRA_FUNCTIONALITY
+@@ -49,8 +49,7 @@
+ /******************************************************************************/
+ 
+ PyDoc_STRVAR(doc_decimal,"\n\
+-Decimal([value[, context]]): Construct a new Decimal object from value.\n\
+-\n\
++Decimal(value=\"0\", context=None): Construct a new Decimal object.\n\
+ value can be an integer, string, tuple, or another Decimal object.\n\
+ If no value is given, return Decimal('0'). The context does not affect\n\
+ the conversion and is only passed to determine if the InvalidOperation\n\
+@@ -74,7 +73,7 @@
+ \n");
+ 
+ PyDoc_STRVAR(doc_compare,"\n\
+-compare(other[, context]) - Compare self to other. Return a decimal value:\n\
++compare(other, context=None) - Compare self to other. Return a decimal value:\n\
+ \n\
+     a or b is a NaN ==> Decimal('NaN')\n\
+     a < b           ==> Decimal('-1')\n\
+@@ -83,16 +82,16 @@
+ \n");
+ 
+ PyDoc_STRVAR(doc_compare_signal,"\n\
+-compare_signal(other[, context]) - Identical to compare, except that\n\
++compare_signal(other, context=None) - Identical to compare, except that\n\
+ all NaNs signal.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_compare_total,"\n\
+-compare_total(other) - Compare two operands using their abstract representation\n\
+-rather than their numerical value. Similar to the compare() method, but the\n\
+-result gives a total ordering on Decimal instances. Two Decimal instances with\n\
+-the same numeric value but different representations compare unequal in this\n\
+-ordering:\n\
++compare_total(other, context=None) - Compare two operands using their\n\
++abstract representation rather than their numerical value. Similar to the\n\
++compare() method, but the result gives a total ordering on Decimal instances.\n\
++Two Decimal instances with the same numeric value but different representations\n\
++compare unequal in this ordering:\n\
+ \n\
+     >>> Decimal('12.0').compare_total(Decimal('12'))\n\
+     Decimal('-1')\n\
+@@ -102,13 +101,21 @@
+ Decimal('-1') if the first operand is lower in the total order than the second,\n\
+ and Decimal('1') if the first operand is higher in the total order than the\n\
+ second operand. See the specification for details of the total order.\n\
++\n\
++This operation is unaffected by context and is quiet: no flags are changed\n\
++and no rounding is performed. As an exception, the C version may raise\n\
++InvalidOperation if the second operand cannot be converted exactly.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_compare_total_mag,"\n\
+-compare_total_mag(other) - Compare two operands using their abstract\n\
+-representation rather than their value as in compare_total(), but\n\
+-ignoring the sign of each operand.  x.compare_total_mag(y) is\n\
+-equivalent to x.copy_abs().compare_total(y.copy_abs()).\n\
++compare_total_mag(other, context=None) - Compare two operands using their\n\
++abstract representation rather than their value as in compare_total(), but\n\
++ignoring the sign of each operand. x.compare_total_mag(y) is equivalent to\n\
++x.copy_abs().compare_total(y.copy_abs()).\n\
++\n\
++This operation is unaffected by context and is quiet: no flags are changed\n\
++and no rounding is performed. As an exception, the C version may raise\n\
++InvalidOperation if the second operand cannot be converted exactly.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_conjugate,"\n\
+@@ -117,31 +124,32 @@
+ 
+ PyDoc_STRVAR(doc_copy_abs,"\n\
+ copy_abs() - Return the absolute value of the argument. This operation\n\
+-is unaffected by the context and is quiet: no flags are changed and no\n\
+-rounding is performed.\n\
++is unaffected by context and is quiet: no flags are changed and no rounding\n\
++is performed.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_copy_negate,"\n\
+ copy_negate() - Return the negation of the argument. This operation is\n\
+-unaffected by the context and is quiet: no flags are changed and no\n\
+-rounding is performed.\n\
++unaffected by context and is quiet: no flags are changed and no rounding\n\
++is performed.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_copy_sign,"\n\
+-copy_sign(other) - Return a copy of the first operand with the sign set\n\
+-to be the same as the sign of the second operand. For example:\n\
++copy_sign(other, context=None) - Return a copy of the first operand with\n\
++the sign set to be the same as the sign of the second operand. For example:\n\
+ \n\
+     >>> Decimal('2.3').copy_sign(Decimal('-1.5'))\n\
+     Decimal('-2.3')\n\
+ \n\
+-This operation is unaffected by the context and is quiet: no flags are\n\
+-changed and no rounding is performed.\n\
++This operation is unaffected by context and is quiet: no flags are changed\n\
++and no rounding is performed. As an exception, the C version may raise\n\
++InvalidOperation if the second operand cannot be converted exactly.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_exp,"\n\
+-exp([context]) - Return the value of the (natural) exponential function e**x\n\
+-at the given number. The function always uses the ROUND_HALF_EVEN mode and\n\
+-the result is correctly rounded.\n\
++exp(context=None) - Return the value of the (natural) exponential function\n\
++e**x at the given number. The function always uses the ROUND_HALF_EVEN mode\n\
++and the result is correctly rounded.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_from_float,"\n\
+@@ -161,7 +169,7 @@
+ \n");
+ 
+ PyDoc_STRVAR(doc_fma,"\n\
+-fma(other, third[, context]) - Fused multiply-add. Return self*other+third\n\
++fma(other, third, context=None) - Fused multiply-add. Return self*other+third\n\
+ with no rounding of the intermediate product self*other.\n\
+ \n\
+     >>> Decimal(2).fma(3, 5)\n\
+@@ -191,9 +199,9 @@
+ \n");
+ 
+ PyDoc_STRVAR(doc_is_normal,"\n\
+-is_normal([context]) - Return True if the argument is a normal finite non-zero\n\
+-number with an adjusted exponent greater than or equal to Emin. Return False\n\
+-if the argument is zero, subnormal, infinite or a NaN.\n\
++is_normal(context=None) - Return True if the argument is a normal finite\n\
++non-zero number with an adjusted exponent greater than or equal to Emin.\n\
++Return False if the argument is zero, subnormal, infinite or a NaN.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_is_qnan,"\n\
+@@ -210,8 +218,8 @@
+ \n");
+ 
+ PyDoc_STRVAR(doc_is_subnormal,"\n\
+-is_subnormal([context]) - Return True if the argument is subnormal, and False\n\
+-otherwise. A number is subnormal if it is non-zero, finite, and has an\n\
++is_subnormal(context=None) - Return True if the argument is subnormal, and\n\
++False otherwise. A number is subnormal if it is non-zero, finite, and has an\n\
+ adjusted exponent less than Emin.\n\
+ \n");
+ 
+@@ -221,94 +229,94 @@
+ \n");
+ 
+ PyDoc_STRVAR(doc_ln,"\n\
+-ln([context]) - Return the natural (base e) logarithm of the operand.\n\
++ln(context=None) - Return the natural (base e) logarithm of the operand.\n\
+ The function always uses the ROUND_HALF_EVEN mode and the result is\n\
+ correctly rounded.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_log10,"\n\
+-log10([context]) - Return the base ten logarithm of the operand.\n\
++log10(context=None) - Return the base ten logarithm of the operand.\n\
+ The function always uses the ROUND_HALF_EVEN mode and the result is\n\
+ correctly rounded.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_logb,"\n\
+-logb([context]) - For a non-zero number, return the adjusted exponent\n\
++logb(context=None) - For a non-zero number, return the adjusted exponent\n\
+ of the operand as a Decimal instance. If the operand is a zero, then\n\
+ Decimal('-Infinity') is returned and the DivisionByZero condition is\n\
+ raised. If the operand is an infinity then Decimal('Infinity') is returned.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_logical_and,"\n\
+-logical_and(other[, context]) - Return the digit-wise and of the two\n\
++logical_and(other, context=None) - Return the digit-wise and of the two\n\
+ (logical) operands.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_logical_invert,"\n\
+-logical_invert([context]) - Return the digit-wise inversion of the\n\
++logical_invert(context=None) - Return the digit-wise inversion of the\n\
+ (logical) operand.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_logical_or,"\n\
+-logical_or(other[, context]) - Return the digit-wise or of the two\n\
++logical_or(other, context=None) - Return the digit-wise or of the two\n\
+ (logical) operands.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_logical_xor,"\n\
+-logical_xor(other[, context]) - Return the digit-wise exclusive or of the\n\
++logical_xor(other, context=None) - Return the digit-wise exclusive or of the\n\
+ two (logical) operands.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_max,"\n\
+-max(other[, context]) - Maximum of self and other. If one operand is a quiet\n\
+-NaN and the other is numeric, the numeric operand is returned.\n\
++max(other, context=None) - Maximum of self and other. If one operand is a\n\
++quiet NaN and the other is numeric, the numeric operand is returned.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_max_mag,"\n\
+-max_mag(other[, context]) - Similar to the max() method, but the comparison is\n\
+-done using the absolute values of the operands.\n\
++max_mag(other, context=None) - Similar to the max() method, but the\n\
++comparison is done using the absolute values of the operands.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_min,"\n\
+-min(other[, context]) - Minimum of self and other. If one operand is a quiet\n\
+-NaN and the other is numeric, the numeric operand is returned.\n\
++min(other, context=None) - Minimum of self and other. If one operand is a\n\
++quiet NaN and the other is numeric, the numeric operand is returned.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_min_mag,"\n\
+-min_mag(other[, context]) - Similar to the min() method, but the comparison is\n\
+-done using the absolute values of the operands.\n\
++min_mag(other, context=None) - Similar to the min() method, but the\n\
++comparison is done using the absolute values of the operands.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_next_minus,"\n\
+-next_minus([context]) - Return the largest number representable in the given\n\
+-context (or in the current default context if no context is given) that is\n\
+-smaller than the given operand.\n\
++next_minus(context=None) - Return the largest number representable in the\n\
++given context (or in the current default context if no context is given) that\n\
++is smaller than the given operand.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_next_plus,"\n\
+-next_plus([context]) - Return the smallest number representable in the given\n\
+-context (or in the current default context if no context is given) that is\n\
+-larger than the given operand.\n\
++next_plus(context=None) - Return the smallest number representable in the\n\
++given context (or in the current default context if no context is given) that\n\
++is larger than the given operand.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_next_toward,"\n\
+-next_toward(other[, context]) - If the two operands are unequal, return the\n\
+-number closest to the first operand in the direction of the second operand.\n\
++next_toward(other, context=None) - If the two operands are unequal, return\n\
++the number closest to the first operand in the direction of the second operand.\n\
+ If both operands are numerically equal, return a copy of the first operand\n\
+ with the sign set to be the same as the sign of the second operand.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_normalize,"\n\
+-normalize([context]) - Normalize the number by stripping the rightmost trailing\n\
+-zeros and converting any result equal to Decimal('0') to Decimal('0e0'). Used\n\
+-for producing canonical values for members of an equivalence class. For example,\n\
+-Decimal('32.100') and Decimal('0.321000e+2') both normalize to the equivalent\n\
+-value Decimal('32.1').\n\
++normalize(context=None) - Normalize the number by stripping the rightmost\n\
++trailing zeros and converting any result equal to Decimal('0') to Decimal('0e0').\n\
++Used for producing canonical values for members of an equivalence class. For\n\
++example, Decimal('32.100') and Decimal('0.321000e+2') both normalize to the\n\
++equivalent value Decimal('32.1').\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_number_class,"\n\
+-number_class([context]) - Return a string describing the class of the operand.\n\
+-The returned value is one of the following ten strings:\n\
++number_class(context=None) - Return a string describing the class of the\n\
++operand. The returned value is one of the following ten strings:\n\
+ \n\
+     * '-Infinity', indicating that the operand is negative infinity.\n\
+     * '-Normal', indicating that the operand is a negative normal number.\n\
+@@ -324,8 +332,8 @@
+ \n");
+ 
+ PyDoc_STRVAR(doc_quantize,"\n\
+-quantize(exp[, rounding[, context]]) - Return a value equal to the first\n\
+-operand after rounding and having the exponent of the second operand.\n\
++quantize(exp, rounding=None, context=None) - Return a value equal to the\n\
++first operand after rounding and having the exponent of the second operand.\n\
+ \n\
+     >>> Decimal('1.41421356').quantize(Decimal('1.000'))\n\
+     Decimal('1.414')\n\
+@@ -350,16 +358,18 @@
+ \n");
+ 
+ PyDoc_STRVAR(doc_remainder_near,"\n\
+-remainder_near(other[, context]) - Compute the modulo as either a positive\n\
+-or negative value depending on which is closest to zero. For instance,\n\
+-Decimal(10).remainder_near(6) returns Decimal('-2'), which is closer to zero\n\
+-than Decimal('4').\n\
++remainder_near(other, context=None) - Return the remainder from dividing\n\
++self by other. This differs from self % other in that the sign of the\n\
++remainder is chosen so as to minimize its absolute value. More precisely, the\n\
++return value is self - n * other where n is the integer nearest to the exact\n\
++value of self / other, and if two integers are equally near then the even one\n\
++is chosen.\n\
+ \n\
+-If both are equally close, the one chosen will have the same sign as self.\n\
++If the result is zero then its sign will be the sign of self.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_rotate,"\n\
+-rotate(other[, context]) - Return the result of rotating the digits of the\n\
++rotate(other, context=None) - Return the result of rotating the digits of the\n\
+ first operand by an amount specified by the second operand. The second operand\n\
+ must be an integer in the range -precision through precision. The absolute\n\
+ value of the second operand gives the number of places to rotate. If the second\n\
+@@ -370,18 +380,22 @@
+ \n");
+ 
+ PyDoc_STRVAR(doc_same_quantum,"\n\
+-same_quantum(other[, context]) - Test whether self and other have the\n\
++same_quantum(other, context=None) - Test whether self and other have the\n\
+ same exponent or whether both are NaN.\n\
++\n\
++This operation is unaffected by context and is quiet: no flags are changed\n\
++and no rounding is performed. As an exception, the C version may raise\n\
++InvalidOperation if the second operand cannot be converted exactly.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_scaleb,"\n\
+-scaleb(other[, context]) - Return the first operand with the exponent adjusted\n\
+-the second. Equivalently, return the first operand multiplied by 10**other.\n\
+-The second operand must be an integer.\n\
++scaleb(other, context=None) - Return the first operand with the exponent\n\
++adjusted the second. Equivalently, return the first operand multiplied by\n\
++10**other. The second operand must be an integer.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_shift,"\n\
+-shift(other[, context]) - Return the result of shifting the digits of\n\
++shift(other, context=None) - Return the result of shifting the digits of\n\
+ the first operand by an amount specified by the second operand. The second\n\
+ operand must be an integer in the range -precision through precision. The\n\
+ absolute value of the second operand gives the number of places to shift.\n\
+@@ -391,36 +405,40 @@
+ \n");
+ 
+ PyDoc_STRVAR(doc_sqrt,"\n\
+-sqrt([context]) - Return the square root of the argument to full precision.\n\
++sqrt(context=None) - Return the square root of the argument to full precision.\n\
+ The result is correctly rounded using the ROUND_HALF_EVEN rounding mode.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_to_eng_string,"\n\
+-to_eng_string([context]) - Convert to an engineering-type string.\n\
+-Engineering notation has an exponent which is a multiple of 3, so\n\
+-there are up to 3 digits left of the decimal place. For example,\n\
+-Decimal('123E+1') is converted to Decimal('1.23E+3')\n\
++to_eng_string(context=None) - Convert to an engineering-type string.\n\
++Engineering notation has an exponent which is a multiple of 3, so there\n\
++are up to 3 digits left of the decimal place. For example, Decimal('123E+1')\n\
++is converted to Decimal('1.23E+3').\n\
++\n\
++The value of context.capitals determines whether the exponent sign is lower\n\
++or upper case. Otherwise, the context does not affect the operation.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_to_integral,"\n\
+-to_integral([rounding[, context]]) - Identical to the to_integral_value()\n\
+-method. The to_integral name has been kept for compatibility with older\n\
+-versions.\n\
++to_integral(rounding=None, context=None) - Identical to the\n\
++to_integral_value() method. The to_integral() name has been kept\n\
++for compatibility with older versions.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_to_integral_exact,"\n\
+-to_integral_exact([rounding[, context]]) - Round to the nearest integer,\n\
+-signaling Inexact or Rounded as appropriate if rounding occurs. The rounding\n\
+-mode is determined by the rounding parameter if given, else by the given\n\
+-context. If neither parameter is given, then the rounding mode of the current\n\
+-default context is used.\n\
++to_integral_exact(rounding=None, context=None) - Round to the nearest\n\
++integer, signaling Inexact or Rounded as appropriate if rounding occurs.\n\
++The rounding mode is determined by the rounding parameter if given, else\n\
++by the given context. If neither parameter is given, then the rounding mode\n\
++of the current default context is used.\n\
+ \n");
+ 
+ PyDoc_STRVAR(doc_to_integral_value,"\n\
+-to_integral_value([rounding[, context]]) - Round to the nearest integer without\n\
+-signaling Inexact or Rounded. The rounding mode is determined by the rounding\n\
+-parameter if given, else by the given context. If neither parameter is given,\n\
+-then the rounding mode of the current default context is used.\n\
++to_integral_value(rounding=None, context=None) - Round to the nearest\n\
++integer without signaling Inexact or Rounded. The rounding mode is determined\n\
++by the rounding parameter if given, else by the given context. If neither\n\
++parameter is given, then the rounding mode of the current default context is\n\
++used.\n\
+ \n");
+ 
+ 
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/README.txt
+--- a/Modules/_decimal/libmpdec/README.txt
++++ b/Modules/_decimal/libmpdec/README.txt
+@@ -79,7 +79,7 @@
+     mulmod-ppro.txt      -> Proof for the x87 FPU modular multiplication
+                             from umodarith.h.
+     umodarith.lisp       -> ACL2 proofs for many functions from umodarith.h.
+-  
++
+ 
+ Library Author
+ ==============
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/basearith.h
+--- a/Modules/_decimal/libmpdec/basearith.h
++++ b/Modules/_decimal/libmpdec/basearith.h
+@@ -35,6 +35,10 @@
+ #include "typearith.h"
+ 
+ 
++/* Internal header file: all symbols have local scope in the DSO */
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
++
++
+ mpd_uint_t _mpd_baseadd(mpd_uint_t *w, const mpd_uint_t *u, const mpd_uint_t *v,
+                         mpd_size_t m, mpd_size_t n);
+ void _mpd_baseaddto(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n);
+@@ -209,6 +213,9 @@
+ }
+ 
+ 
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
++
++
+ #endif /* BASEARITH_H */
+ 
+ 
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/constants.h
+--- a/Modules/_decimal/libmpdec/constants.h
++++ b/Modules/_decimal/libmpdec/constants.h
+@@ -33,6 +33,10 @@
+ #include "mpdecimal.h"
+ 
+ 
++/* Internal header file: all symbols have local scope in the DSO */
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
++
++
+ /* choice of optimized functions */
+ #if defined(CONFIG_64)
+ /* x64 */
+@@ -77,6 +81,9 @@
+ extern const mpd_uint_t UH_P1P2;
+ 
+ 
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
++
++
+ #endif /* CONSTANTS_H */
+ 
+ 
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/convolute.h
+--- a/Modules/_decimal/libmpdec/convolute.h
++++ b/Modules/_decimal/libmpdec/convolute.h
+@@ -33,11 +33,18 @@
+ #include "mpdecimal.h"
+ #include <stdio.h>
+ 
++
++/* Internal header file: all symbols have local scope in the DSO */
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
++
++
+ #define SIX_STEP_THRESHOLD 4096
+ 
+-
+ int fnt_convolute(mpd_uint_t *c1, mpd_uint_t *c2, mpd_size_t n, int modnum);
+ int fnt_autoconvolute(mpd_uint_t *c1, mpd_size_t n, int modnum);
+ 
+ 
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
++
++
+ #endif
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/crt.h
+--- a/Modules/_decimal/libmpdec/crt.h
++++ b/Modules/_decimal/libmpdec/crt.h
+@@ -34,7 +34,14 @@
+ #include <stdio.h>
+ 
+ 
++/* Internal header file: all symbols have local scope in the DSO */
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
++
++
+ void crt3(mpd_uint_t *x1, mpd_uint_t *x2, mpd_uint_t *x3, mpd_size_t nmemb);
+ 
+ 
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
++
++
+ #endif
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/difradix2.h
+--- a/Modules/_decimal/libmpdec/difradix2.h
++++ b/Modules/_decimal/libmpdec/difradix2.h
+@@ -35,7 +35,14 @@
+ #include "numbertheory.h"
+ 
+ 
++/* Internal header file: all symbols have local scope in the DSO */
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
++
++
+ void fnt_dif2(mpd_uint_t a[], mpd_size_t n, struct fnt_params *tparams);
+ 
+ 
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
++
++
+ #endif
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/fnt.h
+--- a/Modules/_decimal/libmpdec/fnt.h
++++ b/Modules/_decimal/libmpdec/fnt.h
+@@ -34,9 +34,16 @@
+ #include <stdio.h>
+ 
+ 
++/* Internal header file: all symbols have local scope in the DSO */
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
++
++
+ int std_fnt(mpd_uint_t a[], mpd_size_t n, int modnum);
+ int std_inv_fnt(mpd_uint_t a[], mpd_size_t n, int modnum);
+ 
+ 
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
++
++
+ #endif
+ 
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/fourstep.h
+--- a/Modules/_decimal/libmpdec/fourstep.h
++++ b/Modules/_decimal/libmpdec/fourstep.h
+@@ -34,8 +34,15 @@
+ #include <stdio.h>
+ 
+ 
++/* Internal header file: all symbols have local scope in the DSO */
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
++
++
+ int four_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
+ int inv_four_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
+ 
+ 
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
++
++
+ #endif
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/io.c
+--- a/Modules/_decimal/libmpdec/io.c
++++ b/Modules/_decimal/libmpdec/io.c
+@@ -352,7 +352,7 @@
+     case 2:  EXTRACT_DIGIT(s, x, 10UL, dot);
+     default: if (s == dot) *s++ = '.'; *s++ = '0' + (char)x;
+     }
+- 
++
+     *s = '\0';
+     return s;
+ }
+@@ -1059,7 +1059,7 @@
+  * Not allowed, since _mpd_to_string() never returns this form:
+  *
+  *     3) [sign] '.' digits [exponent-part]
+- * 
++ *
+  * Input: result->data := original numeric string (ASCII)
+  *        result->bytes := strlen(result->data)
+  *        result->nchars := strlen(result->data)
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/literature/bignum.txt
+--- a/Modules/_decimal/libmpdec/literature/bignum.txt
++++ b/Modules/_decimal/libmpdec/literature/bignum.txt
+@@ -23,7 +23,7 @@
+     y = fnt(b)                          # forward transform of b
+     z = pairwise multiply x[i] and y[i]
+     result = inv_fnt(z)                 # backward transform of z.
+- 
++
+ 
+ Extending the maximum transform length (Chinese Remainder Theorem):
+ -------------------------------------------------------------------
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/literature/matrix-transform.txt
+--- a/Modules/_decimal/libmpdec/literature/matrix-transform.txt
++++ b/Modules/_decimal/libmpdec/literature/matrix-transform.txt
+@@ -245,7 +245,7 @@
+    which means that all A[k] = A[m * C + n] are in the correct order.
+ 
+ 
+--- 
++--
+ 
+   [1] Joerg Arndt: "Matters Computational"
+       http://www.jjj.de/fxt/
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/literature/mulmod-ppro.txt
+--- a/Modules/_decimal/libmpdec/literature/mulmod-ppro.txt
++++ b/Modules/_decimal/libmpdec/literature/mulmod-ppro.txt
+@@ -251,7 +251,7 @@
+ 
+   apply Qlt_le_trans with (y := 1).
+   qreduce ((2 # 1) ^ (-62) + (2 # 1) ^ (-126)).
+-  
++
+   rewrite Qlt_mult_by_z with (z := 85070591730234615865843651857942052864 # 18446744073709551617).
+   ring_simplify.
+ 
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/literature/six-step.txt
+--- a/Modules/_decimal/libmpdec/literature/six-step.txt
++++ b/Modules/_decimal/libmpdec/literature/six-step.txt
+@@ -55,7 +55,7 @@
+ 
+ 
+ 
+--- 
++--
+ 
+   [1] David H. Bailey: FFTs in External or Hierarchical Memory
+       http://crd.lbl.gov/~dhbailey/dhbpapers/
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/literature/umodarith.lisp
+--- a/Modules/_decimal/libmpdec/literature/umodarith.lisp
++++ b/Modules/_decimal/libmpdec/literature/umodarith.lisp
+@@ -321,7 +321,7 @@
+ 
+ (defthmd dw-submod-correct
+   (implies (and (< 0 m) (< m base)
+-                (natp a) (< a m) 
++                (natp a) (< a m)
+ 		(< hi base) (< lo base)
+                 (natp m) (natp base)
+                 (natp hi) (natp lo))
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/memory.h
+--- a/Modules/_decimal/libmpdec/memory.h
++++ b/Modules/_decimal/libmpdec/memory.h
+@@ -33,11 +33,18 @@
+ #include "mpdecimal.h"
+ 
+ 
++/* Internal header file: all symbols have local scope in the DSO */
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
++
++
+ int mpd_switch_to_dyn(mpd_t *result, mpd_ssize_t size, uint32_t *status);
+ int mpd_switch_to_dyn_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status);
+ int mpd_realloc_dyn(mpd_t *result, mpd_ssize_t size, uint32_t *status);
+ 
+ 
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
++
++
+ #endif
+ 
+ 
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/mpdecimal.c
+--- a/Modules/_decimal/libmpdec/mpdecimal.c
++++ b/Modules/_decimal/libmpdec/mpdecimal.c
+@@ -107,7 +107,7 @@
+                                   mpd_uint_t exp, uint8_t resultsign,
+                                   const mpd_context_t *ctx, uint32_t *status);
+ 
+-mpd_uint_t mpd_qsshiftr(mpd_t *result, const mpd_t *a, mpd_ssize_t n);
++static mpd_uint_t mpd_qsshiftr(mpd_t *result, const mpd_t *a, mpd_ssize_t n);
+ 
+ 
+ /******************************************************************************/
+@@ -2084,7 +2084,7 @@
+ }
+ 
+ /*
+- * Compare a and b, convert the the usual integer result to a decimal and
++ * Compare a and b, convert the usual integer result to a decimal and
+  * store it in 'result'. For convenience, the integer result of the comparison
+  * is returned. Comparisons involving NaNs return NaN/INT_MAX.
+  */
+@@ -2301,7 +2301,7 @@
+  * It is the caller's responsibility to ensure that the coefficient is big
+  * enough. The function cannot fail.
+  */
+-mpd_uint_t
++static mpd_uint_t
+ mpd_qsshiftr(mpd_t *result, const mpd_t *a, mpd_ssize_t n)
+ {
+     mpd_uint_t rnd;
+@@ -3119,7 +3119,7 @@
+                  *     ----------XX1234  ->  sdigits
+                  *     ----------X1      ->  tiny-digits
+                  *     |- prec -|
+-                 *     
++                 *
+                  *      OR
+                  *
+                  *   bdigits > prec AND
+@@ -5123,7 +5123,7 @@
+  * to the result or NULL in case of failure (malloc error).
+  * Conditions: ulen >= vlen, ulen >= 4
+  */
+-mpd_uint_t *
++static mpd_uint_t *
+ _mpd_kmul(const mpd_uint_t *u, const mpd_uint_t *v,
+           mpd_size_t ulen, mpd_size_t vlen,
+           mpd_size_t *rsize)
+@@ -5208,7 +5208,7 @@
+ }
+ #endif
+ 
+-unsigned int
++static unsigned int
+ mpd_set_fenv(void)
+ {
+     unsigned int cw;
+@@ -5228,7 +5228,7 @@
+     return cw;
+ }
+ 
+-void
++static void
+ mpd_restore_fenv(unsigned int cw)
+ {
+ #ifdef _MSC_VER
+@@ -5246,7 +5246,7 @@
+  * Multiply u and v, using the fast number theoretic transform. Returns
+  * a pointer to the result or NULL in case of failure (malloc error).
+  */
+-mpd_uint_t *
++static mpd_uint_t *
+ _mpd_fntmul(const mpd_uint_t *u, const mpd_uint_t *v,
+             mpd_size_t ulen, mpd_size_t vlen,
+             mpd_size_t *rsize)
+@@ -5432,7 +5432,7 @@
+  * base case. Returns a pointer to the result or NULL in case of failure
+  * (malloc error). Conditions: ulen >= vlen, ulen >= 4.
+  */
+-mpd_uint_t *
++static mpd_uint_t *
+ _mpd_kmul_fnt(const mpd_uint_t *u, const mpd_uint_t *v,
+               mpd_size_t ulen, mpd_size_t vlen,
+               mpd_size_t *rsize)
+@@ -5983,7 +5983,7 @@
+     mpd_qfinalize(result, ctx, status);
+ }
+ 
+-/* 
++/*
+  * If the exponent is infinite and base equals one, the result is one
+  * with a coefficient of length prec. Otherwise, result is undefined.
+  * Return the value of the comparison against one.
+@@ -7129,7 +7129,7 @@
+         goto nanresult;
+     }
+ 
+-    /* Let x := _mpd_qreciprocal(b, prec) 
++    /* Let x := _mpd_qreciprocal(b, prec)
+      * Then x is bounded by:
+      *    1) 1/b - 10**(-prec - bdigits) < x < 1/b + 10**(-prec - bdigits)
+      *    2) 1/b - 10**(-adigits - 4) < x < 1/b + 10**(-adigits - 4)
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/mpdecimal.h
+--- a/Modules/_decimal/libmpdec/mpdecimal.h
++++ b/Modules/_decimal/libmpdec/mpdecimal.h
+@@ -51,6 +51,9 @@
+   #ifndef UNUSED
+     #define UNUSED
+   #endif
++  #define MPD_PRAGMA(x)
++  #define MPD_HIDE_SYMBOLS_START
++  #define MPD_HIDE_SYMBOLS_END
+   #define EXTINLINE extern inline
+ #else
+   #ifdef HAVE_STDINT_H
+@@ -60,17 +63,32 @@
+     #include <inttypes.h>
+   #endif
+   #ifndef __GNUC_STDC_INLINE__
+-    #define __GNUC_STDC_INLINE__
++    #define __GNUC_STDC_INLINE__ 1
+   #endif
+   #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+     #define UNUSED __attribute__((unused))
+   #else
+     #define UNUSED
+   #endif
++  #if (defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)) && \
++      defined(__GNUC__) && __GNUC__ >= 4 && !defined(__INTEL_COMPILER)
++    #define MPD_PRAGMA(x) _Pragma(x)
++    #define MPD_HIDE_SYMBOLS_START "GCC visibility push(hidden)"
++    #define MPD_HIDE_SYMBOLS_END "GCC visibility pop"
++  #else
++    #define MPD_PRAGMA(x)
++    #define MPD_HIDE_SYMBOLS_START
++    #define MPD_HIDE_SYMBOLS_END
++  #endif
+   #define EXTINLINE
+ #endif
+ 
+ 
++/* This header file is internal for the purpose of building _decimal.so.
++ * All symbols should have local scope in the DSO. */
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
++
++
+ #if !defined(LEGACY_COMPILER)
+   #if !defined(UINT64_MAX)
+     /* The following #error is just a warning. If the compiler indeed does
+@@ -789,6 +807,9 @@
+ int mpd_resize_zero(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx);
+ 
+ 
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
++
++
+ #ifdef __cplusplus
+ } /* END extern "C" */
+ #endif
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/numbertheory.h
+--- a/Modules/_decimal/libmpdec/numbertheory.h
++++ b/Modules/_decimal/libmpdec/numbertheory.h
+@@ -34,6 +34,10 @@
+ #include "mpdecimal.h"
+ 
+ 
++/* Internal header file: all symbols have local scope in the DSO */
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
++
++
+ /* transform parameters */
+ struct fnt_params {
+     int modnum;
+@@ -66,6 +70,9 @@
+ #endif
+ 
+ 
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
++
++
+ #endif
+ 
+ 
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/sixstep.h
+--- a/Modules/_decimal/libmpdec/sixstep.h
++++ b/Modules/_decimal/libmpdec/sixstep.h
+@@ -34,8 +34,15 @@
+ #include <stdio.h>
+ 
+ 
++/* Internal header file: all symbols have local scope in the DSO */
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
++
++
+ int six_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
+ int inv_six_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
+ 
+ 
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
++
++
+ #endif
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/transpose.h
+--- a/Modules/_decimal/libmpdec/transpose.h
++++ b/Modules/_decimal/libmpdec/transpose.h
+@@ -34,6 +34,10 @@
+ #include <stdio.h>
+ 
+ 
++/* Internal header file: all symbols have local scope in the DSO */
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
++
++
+ enum {FORWARD_CYCLE, BACKWARD_CYCLE};
+ 
+ 
+@@ -52,4 +56,7 @@
+ }
+ 
+ 
++MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
++
++
+ #endif
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/typearith.h
+--- a/Modules/_decimal/libmpdec/typearith.h
++++ b/Modules/_decimal/libmpdec/typearith.h
+@@ -207,10 +207,10 @@
+ {
+     mpd_uint_t h, l;
+ 
+-    asm ( "mulq %3\n\t"
+-          : "=d" (h), "=a" (l)
+-          : "%a" (a), "rm" (b)
+-          : "cc"
++    __asm__ ( "mulq %3\n\t"
++              : "=d" (h), "=a" (l)
++              : "%a" (a), "rm" (b)
++              : "cc"
+     );
+ 
+     *hi = h;
+@@ -223,10 +223,10 @@
+ {
+     mpd_uint_t qq, rr;
+ 
+-    asm ( "divq %4\n\t"
+-          : "=a" (qq), "=d" (rr)
+-          : "a" (lo), "d" (hi), "rm" (d)
+-          : "cc"
++    __asm__ ( "divq %4\n\t"
++              : "=a" (qq), "=d" (rr)
++              : "a" (lo), "d" (hi), "rm" (d)
++              : "cc"
+     );
+ 
+     *q = qq;
+@@ -464,10 +464,10 @@
+ {
+     mpd_uint_t h, l;
+ 
+-    asm ( "mull %3\n\t"
+-          : "=d" (h), "=a" (l)
+-          : "%a" (a), "rm" (b)
+-          : "cc"
++    __asm__ ( "mull %3\n\t"
++              : "=d" (h), "=a" (l)
++              : "%a" (a), "rm" (b)
++              : "cc"
+     );
+ 
+     *hi = h;
+@@ -480,10 +480,10 @@
+ {
+     mpd_uint_t qq, rr;
+ 
+-    asm ( "divl %4\n\t"
+-          : "=a" (qq), "=d" (rr)
+-          : "a" (lo), "d" (hi), "rm" (d)
+-          : "cc"
++    __asm__ ( "divl %4\n\t"
++              : "=a" (qq), "=d" (rr)
++              : "a" (lo), "d" (hi), "rm" (d)
++              : "cc"
+     );
+ 
+     *q = qq;
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/umodarith.h
+--- a/Modules/_decimal/libmpdec/umodarith.h
++++ b/Modules/_decimal/libmpdec/umodarith.h
+@@ -93,7 +93,7 @@
+     return d;
+ }
+ 
+-/* 
++/*
+  * Reduce double word modulo m.
+  * Restrictions: m != 0
+  * ACL2 proof: umodarith.lisp: section dw-reduce
+@@ -402,22 +402,22 @@
+ {
+     mpd_uint_t retval;
+ 
+-    asm (
+-        "fildl  %2\n\t"
+-        "fildl  %1\n\t"
+-        "fmulp  %%st, %%st(1)\n\t"
+-        "fldt   (%4)\n\t"
+-        "fmul   %%st(1), %%st\n\t"
+-        "flds   %5\n\t"
+-        "fadd   %%st, %%st(1)\n\t"
+-        "fsubrp %%st, %%st(1)\n\t"
+-        "fldl   (%3)\n\t"
+-        "fmulp  %%st, %%st(1)\n\t"
+-        "fsubrp %%st, %%st(1)\n\t"
+-        "fistpl %0\n\t"
+-        : "=m" (retval)
+-        : "m" (a), "m" (b), "r" (dmod), "r" (dinvmod), "m" (MPD_TWO63)
+-        : "st", "memory"
++    __asm__ (
++            "fildl  %2\n\t"
++            "fildl  %1\n\t"
++            "fmulp  %%st, %%st(1)\n\t"
++            "fldt   (%4)\n\t"
++            "fmul   %%st(1), %%st\n\t"
++            "flds   %5\n\t"
++            "fadd   %%st, %%st(1)\n\t"
++            "fsubrp %%st, %%st(1)\n\t"
++            "fldl   (%3)\n\t"
++            "fmulp  %%st, %%st(1)\n\t"
++            "fsubrp %%st, %%st(1)\n\t"
++            "fistpl %0\n\t"
++            : "=m" (retval)
++            : "m" (a), "m" (b), "r" (dmod), "r" (dinvmod), "m" (MPD_TWO63)
++            : "st", "memory"
+     );
+ 
+     return retval;
+@@ -432,33 +432,33 @@
+ ppro_mulmod2c(mpd_uint_t *a0, mpd_uint_t *a1, mpd_uint_t w,
+               double *dmod, uint32_t *dinvmod)
+ {
+-    asm (
+-        "fildl  %2\n\t"
+-        "fildl  (%1)\n\t"
+-        "fmul   %%st(1), %%st\n\t"
+-        "fxch   %%st(1)\n\t"
+-        "fildl  (%0)\n\t"
+-        "fmulp  %%st, %%st(1) \n\t"
+-        "fldt   (%4)\n\t"
+-        "flds   %5\n\t"
+-        "fld    %%st(2)\n\t"
+-        "fmul   %%st(2)\n\t"
+-        "fadd   %%st(1)\n\t"
+-        "fsub   %%st(1)\n\t"
+-        "fmull  (%3)\n\t"
+-        "fsubrp %%st, %%st(3)\n\t"
+-        "fxch   %%st(2)\n\t"
+-        "fistpl (%0)\n\t"
+-        "fmul   %%st(2)\n\t"
+-        "fadd   %%st(1)\n\t"
+-        "fsubp  %%st, %%st(1)\n\t"
+-        "fmull  (%3)\n\t"
+-        "fsubrp %%st, %%st(1)\n\t"
+-        "fistpl (%1)\n\t"
+-        : : "r" (a0), "r" (a1), "m" (w),
+-            "r" (dmod), "r" (dinvmod),
+-            "m" (MPD_TWO63)
+-        : "st", "memory"
++    __asm__ (
++            "fildl  %2\n\t"
++            "fildl  (%1)\n\t"
++            "fmul   %%st(1), %%st\n\t"
++            "fxch   %%st(1)\n\t"
++            "fildl  (%0)\n\t"
++            "fmulp  %%st, %%st(1) \n\t"
++            "fldt   (%4)\n\t"
++            "flds   %5\n\t"
++            "fld    %%st(2)\n\t"
++            "fmul   %%st(2)\n\t"
++            "fadd   %%st(1)\n\t"
++            "fsub   %%st(1)\n\t"
++            "fmull  (%3)\n\t"
++            "fsubrp %%st, %%st(3)\n\t"
++            "fxch   %%st(2)\n\t"
++            "fistpl (%0)\n\t"
++            "fmul   %%st(2)\n\t"
++            "fadd   %%st(1)\n\t"
++            "fsubp  %%st, %%st(1)\n\t"
++            "fmull  (%3)\n\t"
++            "fsubrp %%st, %%st(1)\n\t"
++            "fistpl (%1)\n\t"
++            : : "r" (a0), "r" (a1), "m" (w),
++                "r" (dmod), "r" (dinvmod),
++                "m" (MPD_TWO63)
++            : "st", "memory"
+     );
+ }
+ 
+@@ -471,41 +471,41 @@
+ ppro_mulmod2(mpd_uint_t *a0, mpd_uint_t b0, mpd_uint_t *a1, mpd_uint_t b1,
+              double *dmod, uint32_t *dinvmod)
+ {
+-    asm (
+-        "fildl  %3\n\t"
+-        "fildl  (%2)\n\t"
+-        "fmulp  %%st, %%st(1)\n\t"
+-        "fildl  %1\n\t"
+-        "fildl  (%0)\n\t"
+-        "fmulp  %%st, %%st(1)\n\t"
+-        "fldt   (%5)\n\t"
+-        "fld    %%st(2)\n\t"
+-        "fmul   %%st(1), %%st\n\t"
+-        "fxch   %%st(1)\n\t"
+-        "fmul   %%st(2), %%st\n\t"
+-        "flds   %6\n\t"
+-        "fldl   (%4)\n\t"
+-        "fxch   %%st(3)\n\t"
+-        "fadd   %%st(1), %%st\n\t"
+-        "fxch   %%st(2)\n\t"
+-        "fadd   %%st(1), %%st\n\t"
+-        "fxch   %%st(2)\n\t"
+-        "fsub   %%st(1), %%st\n\t"
+-        "fxch   %%st(2)\n\t"
+-        "fsubp  %%st, %%st(1)\n\t"
+-        "fxch   %%st(1)\n\t"
+-        "fmul   %%st(2), %%st\n\t"
+-        "fxch   %%st(1)\n\t"
+-        "fmulp  %%st, %%st(2)\n\t"
+-        "fsubrp %%st, %%st(3)\n\t"
+-        "fsubrp %%st, %%st(1)\n\t"
+-        "fxch   %%st(1)\n\t"
+-        "fistpl (%2)\n\t"
+-        "fistpl (%0)\n\t"
+-        : : "r" (a0), "m" (b0), "r" (a1), "m" (b1),
+-            "r" (dmod), "r" (dinvmod),
+-            "m" (MPD_TWO63)
+-        : "st", "memory"
++    __asm__ (
++            "fildl  %3\n\t"
++            "fildl  (%2)\n\t"
++            "fmulp  %%st, %%st(1)\n\t"
++            "fildl  %1\n\t"
++            "fildl  (%0)\n\t"
++            "fmulp  %%st, %%st(1)\n\t"
++            "fldt   (%5)\n\t"
++            "fld    %%st(2)\n\t"
++            "fmul   %%st(1), %%st\n\t"
++            "fxch   %%st(1)\n\t"
++            "fmul   %%st(2), %%st\n\t"
++            "flds   %6\n\t"
++            "fldl   (%4)\n\t"
++            "fxch   %%st(3)\n\t"
++            "fadd   %%st(1), %%st\n\t"
++            "fxch   %%st(2)\n\t"
++            "fadd   %%st(1), %%st\n\t"
++            "fxch   %%st(2)\n\t"
++            "fsub   %%st(1), %%st\n\t"
++            "fxch   %%st(2)\n\t"
++            "fsubp  %%st, %%st(1)\n\t"
++            "fxch   %%st(1)\n\t"
++            "fmul   %%st(2), %%st\n\t"
++            "fxch   %%st(1)\n\t"
++            "fmulp  %%st, %%st(2)\n\t"
++            "fsubrp %%st, %%st(3)\n\t"
++            "fsubrp %%st, %%st(1)\n\t"
++            "fxch   %%st(1)\n\t"
++            "fistpl (%2)\n\t"
++            "fistpl (%0)\n\t"
++            : : "r" (a0), "m" (b0), "r" (a1), "m" (b1),
++                "r" (dmod), "r" (dinvmod),
++                "m" (MPD_TWO63)
++            : "st", "memory"
+     );
+ }
+ /* END PPRO GCC ASM */
+diff -r bd8afb90ebf2 Modules/_decimal/libmpdec/vcstdint.h
+--- a/Modules/_decimal/libmpdec/vcstdint.h
++++ b/Modules/_decimal/libmpdec/vcstdint.h
+@@ -1,32 +1,32 @@
+ // ISO C9x  compliant stdint.h for Microsoft Visual Studio
+-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 
+-// 
++// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
++//
+ //  Copyright (c) 2006-2008 Alexander Chemeris
+-// 
++//
+ // Redistribution and use in source and binary forms, with or without
+ // modification, are permitted provided that the following conditions are met:
+-// 
++//
+ //   1. Redistributions of source code must retain the above copyright notice,
+ //      this list of conditions and the following disclaimer.
+-// 
++//
+ //   2. Redistributions in binary form must reproduce the above copyright
+ //      notice, this list of conditions and the following disclaimer in the
+ //      documentation and/or other materials provided with the distribution.
+-// 
++//
+ //   3. The name of the author may be used to endorse or promote products
+ //      derived from this software without specific prior written permission.
+-// 
++//
+ // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
++// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-// 
++//
+ ///////////////////////////////////////////////////////////////////////////////
+ 
+ #ifndef _MSC_VER // [
+@@ -47,7 +47,7 @@
+ //   error C2733: second C linkage of overloaded function 'wmemchr' not allowed
+ #if (_MSC_VER < 1300) && defined(__cplusplus)
+    extern "C++" {
+-#endif 
++#endif
+ #     include <wchar.h>
+ #if (_MSC_VER < 1300) && defined(__cplusplus)
+    }
+diff -r bd8afb90ebf2 Modules/_decimal/tests/bench.py
+--- a/Modules/_decimal/tests/bench.py
++++ b/Modules/_decimal/tests/bench.py
+@@ -10,13 +10,21 @@
+ 
+ import time
+ from math import log, ceil
+-from test.support import import_fresh_module
++try:
++    from test.support import import_fresh_module
++except ImportError:
++    from test.test_support import import_fresh_module
+ 
+ C = import_fresh_module('decimal', fresh=['_decimal'])
+ P = import_fresh_module('decimal', blocked=['_decimal'])
+ 
+-
+-# Pi function from the decimal.py documentation
++#
++# NOTE: This is the pi function from the decimal documentation, modified
++# for benchmarking purposes. Since floats do not have a context, the higher
++# intermediate precision from the original is NOT used, so the modified
++# algorithm only gives an approximation to the correctly rounded result.
++# For serious use, refer to the documentation or the appropriate literature.
++#
+ def pi_float():
+     """native float"""
+     lasts, t, s, n, na, d, da = 0, 3.0, 3, 1, 0, 0, 24
+@@ -67,11 +75,16 @@
+ print("#                   Calculating pi, 10000 iterations")
+ print("# ======================================================================\n")
+ 
++to_benchmark = [pi_float, pi_decimal]
++if C is not None:
++    to_benchmark.insert(1, pi_cdecimal)
++
+ for prec in [9, 19]:
+     print("\nPrecision: %d decimal digits\n" % prec)
+-    for func in [pi_float, pi_cdecimal, pi_decimal]:
++    for func in to_benchmark:
+         start = time.time()
+-        C.getcontext().prec = prec
++        if C is not None:
++            C.getcontext().prec = prec
+         P.getcontext().prec = prec
+         for i in range(10000):
+             x = func()
+@@ -84,25 +97,27 @@
+ print("#                               Factorial")
+ print("# ======================================================================\n")
+ 
+-c = C.getcontext()
+-c.prec = C.MAX_PREC
+-c.Emax = C.MAX_EMAX
+-c.Emin = C.MIN_EMIN
++if C is not None:
++    c = C.getcontext()
++    c.prec = C.MAX_PREC
++    c.Emax = C.MAX_EMAX
++    c.Emin = C.MIN_EMIN
+ 
+ for n in [100000, 1000000]:
+ 
+     print("n = %d\n" % n)
+ 
+-    # C version of decimal
+-    start_calc = time.time()
+-    x = factorial(C.Decimal(n), 0)
+-    end_calc = time.time()
+-    start_conv = time.time()
+-    sx = str(x)
+-    end_conv = time.time()
+-    print("cdecimal:")
+-    print("calculation time: %fs" % (end_calc-start_calc))
+-    print("conversion time: %fs\n" % (end_conv-start_conv))
++    if C is not None:
++        # C version of decimal
++        start_calc = time.time()
++        x = factorial(C.Decimal(n), 0)
++        end_calc = time.time()
++        start_conv = time.time()
++        sx = str(x)
++        end_conv = time.time()
++        print("cdecimal:")
++        print("calculation time: %fs" % (end_calc-start_calc))
++        print("conversion time: %fs\n" % (end_conv-start_conv))
+ 
+     # Python integers
+     start_calc = time.time()
+@@ -116,4 +131,5 @@
+     print("calculation time: %fs" % (end_calc-start_calc))
+     print("conversion time: %fs\n\n" % (end_conv-start_conv))
+ 
+-    assert(sx == sy)
++    if C is not None:
++        assert(sx == sy)
+diff -r bd8afb90ebf2 Modules/_decimal/tests/deccheck.py
+--- a/Modules/_decimal/tests/deccheck.py
++++ b/Modules/_decimal/tests/deccheck.py
+@@ -36,6 +36,7 @@
+ from collections import defaultdict
+ from test.support import import_fresh_module
+ from randdec import randfloat, all_unary, all_binary, all_ternary
++from randdec import unary_optarg, binary_optarg, ternary_optarg
+ from formathelper import rand_format, rand_locale
+ 
+ C = import_fresh_module('decimal', fresh=['_decimal'])
+@@ -157,17 +158,9 @@
+         C.FloatOperation:      P.FloatOperation,
+ }
+ 
+-RoundMap = {
+-        C.ROUND_UP:           P.ROUND_UP,
+-        C.ROUND_DOWN:         P.ROUND_DOWN,
+-        C.ROUND_CEILING:      P.ROUND_CEILING,
+-        C.ROUND_FLOOR:        P.ROUND_FLOOR,
+-        C.ROUND_HALF_UP:      P.ROUND_HALF_UP,
+-        C.ROUND_HALF_DOWN:    P.ROUND_HALF_DOWN,
+-        C.ROUND_HALF_EVEN:    P.ROUND_HALF_EVEN,
+-        C.ROUND_05UP:         P.ROUND_05UP
+-}
+-RoundModes = RoundMap.items()
++RoundModes = [C.ROUND_UP, C.ROUND_DOWN, C.ROUND_CEILING, C.ROUND_FLOOR,
++              C.ROUND_HALF_UP, C.ROUND_HALF_DOWN, C.ROUND_HALF_EVEN,
++              C.ROUND_05UP]
+ 
+ 
+ class Context(object):
+@@ -182,7 +175,7 @@
+         self.p.prec = self.c.prec
+         self.p.Emin = self.c.Emin
+         self.p.Emax = self.c.Emax
+-        self.p.rounding = RoundMap[self.c.rounding]
++        self.p.rounding = self.c.rounding
+         self.p.capitals = self.c.capitals
+         self.settraps([sig for sig in self.c.traps if self.c.traps[sig]])
+         self.setstatus([sig for sig in self.c.flags if self.c.flags[sig]])
+@@ -216,12 +209,12 @@
+         self.p.Emax = val
+ 
+     def getround(self):
+-        assert(self.c.rounding == RoundMap[self.p.rounding])
++        assert(self.c.rounding == self.p.rounding)
+         return self.c.rounding
+ 
+     def setround(self, val):
+         self.c.rounding = val
+-        self.p.rounding = RoundMap[val]
++        self.p.rounding = val
+ 
+     def getcapitals(self):
+         assert(self.c.capitals == self.p.capitals)
+@@ -626,8 +619,12 @@
+ 
+         context.clear_status()
+ 
+-        if not t.contextfunc and i == 0 or \
+-           convstr and isinstance(op, str):
++        if op in RoundModes:
++            t.cop.append(op)
++            t.pop.append(op)
++
++        elif not t.contextfunc and i == 0 or \
++             convstr and isinstance(op, str):
+             try:
+                 c = C.Decimal(op)
+                 cex = None
+@@ -661,10 +658,6 @@
+             t.cop.append(op.c)
+             t.pop.append(op.p)
+ 
+-        elif op in RoundModes:
+-            t.cop.append(op[0])
+-            t.pop.append(op[1])
+-
+         else:
+             t.cop.append(op)
+             t.pop.append(op)
+@@ -808,7 +801,7 @@
+                 log("    prec: %d  emin: %d  emax: %d",
+                     (context.prec, context.Emin, context.Emax))
+                 restr_range = 9999 if context.Emax > 9999 else context.Emax+99
+-                for rounding in sorted(RoundMap):
++                for rounding in RoundModes:
+                     context.rounding = rounding
+                     context.capitals = random.randrange(2)
+                     if spec['clamp'] == 'rand':
+@@ -834,6 +827,17 @@
+         except VerifyError as err:
+             log(err)
+ 
++    if not method.startswith('__'):
++        for op in unary_optarg(prec, exp_range, itr):
++            t = TestSet(method, op)
++            try:
++                if not convert(t):
++                    continue
++                callfuncs(t)
++                verify(t, stat)
++            except VerifyError as err:
++                log(err)
++
+ def test_binary(method, prec, exp_range, restricted_range, itr, stat):
+     """Iterate a binary function through many test cases."""
+     if method in BinaryRestricted:
+@@ -848,6 +852,17 @@
+         except VerifyError as err:
+             log(err)
+ 
++    if not method.startswith('__'):
++        for op in binary_optarg(prec, exp_range, itr):
++            t = TestSet(method, op)
++            try:
++                if not convert(t):
++                    continue
++                callfuncs(t)
++                verify(t, stat)
++            except VerifyError as err:
++                log(err)
++
+ def test_ternary(method, prec, exp_range, restricted_range, itr, stat):
+     """Iterate a ternary function through many test cases."""
+     if method in TernaryRestricted:
+@@ -862,6 +877,17 @@
+         except VerifyError as err:
+             log(err)
+ 
++    if not method.startswith('__'):
++        for op in ternary_optarg(prec, exp_range, itr):
++            t = TestSet(method, op)
++            try:
++                if not convert(t):
++                    continue
++                callfuncs(t)
++                verify(t, stat)
++            except VerifyError as err:
++                log(err)
++
+ def test_format(method, prec, exp_range, restricted_range, itr, stat):
+     """Iterate the __format__ method through many test cases."""
+     for op in all_unary(prec, exp_range, itr):
+@@ -907,7 +933,7 @@
+ 
+ def test_from_float(method, prec, exprange, restricted_range, itr, stat):
+     """Iterate the __float__ method through many test cases."""
+-    for rounding in sorted(RoundMap):
++    for rounding in RoundModes:
+         context.rounding = rounding
+         for i in range(1000):
+             f = randfloat()
+diff -r bd8afb90ebf2 Modules/_decimal/tests/randdec.py
+--- a/Modules/_decimal/tests/randdec.py
++++ b/Modules/_decimal/tests/randdec.py
+@@ -527,6 +527,11 @@
+     for _ in range(100):
+         yield (randtuple(prec, exp_range),)
+ 
++def unary_optarg(prec, exp_range, itr):
++    for _ in range(100):
++        yield randdec(prec, exp_range), None
++        yield randdec(prec, exp_range), None, None
++
+ def all_binary(prec, exp_range, itr):
+     for a, b in bin_close_to_pow10(prec, exp_range, itr):
+         yield a, b
+@@ -543,6 +548,11 @@
+     for _ in range(100):
+         yield randdec(prec, exp_range), randdec(prec, exp_range)
+ 
++def binary_optarg(prec, exp_range, itr):
++    for _ in range(100):
++        yield randdec(prec, exp_range), randdec(prec, exp_range), None
++        yield randdec(prec, exp_range), randdec(prec, exp_range), None, None
++
+ def all_ternary(prec, exp_range, itr):
+     for a, b, c in tern_close_numbers(prec, exp_range, -exp_range, itr):
+         yield a, b, c
+@@ -557,3 +567,11 @@
+         b = randdec(prec, 2*exp_range)
+         c = randdec(prec, 2*exp_range)
+         yield a, b, c
++
++def ternary_optarg(prec, exp_range, itr):
++    for _ in range(100):
++        a = randdec(prec, 2*exp_range)
++        b = randdec(prec, 2*exp_range)
++        c = randdec(prec, 2*exp_range)
++        yield a, b, c, None
++        yield a, b, c, None, None
+diff -r bd8afb90ebf2 Modules/_elementtree.c
+--- a/Modules/_elementtree.c
++++ b/Modules/_elementtree.c
+@@ -98,7 +98,7 @@
+    info. */
+ #define JOIN_GET(p) ((Py_uintptr_t) (p) & 1)
+ #define JOIN_SET(p, flag) ((void*) ((Py_uintptr_t) (JOIN_OBJ(p)) | (flag)))
+-#define JOIN_OBJ(p) ((PyObject*) ((Py_uintptr_t) (p) & ~1))
++#define JOIN_OBJ(p) ((PyObject*) ((Py_uintptr_t) (p) & ~(Py_uintptr_t)1))
+ 
+ /* glue functions (see the init function for details) */
+ static PyObject* elementtree_parseerror_obj;
+@@ -123,17 +123,11 @@
+         return NULL;
+     }
+ 
+-    args = PyTuple_New(2);
++    args = PyTuple_Pack(2, object, memo);
+     if (!args)
+         return NULL;
+-
+-    Py_INCREF(object); PyTuple_SET_ITEM(args, 0, (PyObject*) object);
+-    Py_INCREF(memo);   PyTuple_SET_ITEM(args, 1, (PyObject*) memo);
+-
+     result = PyObject_CallObject(elementtree_deepcopy_obj, args);
+-
+     Py_DECREF(args);
+-
+     return result;
+ }
+ 
+@@ -141,48 +135,16 @@
+ list_join(PyObject* list)
+ {
+     /* join list elements (destroying the list in the process) */
+-
+     PyObject* joiner;
+-    PyObject* function;
+-    PyObject* args;
+     PyObject* result;
+ 
+-    switch (PyList_GET_SIZE(list)) {
+-    case 0:
+-        Py_DECREF(list);
+-        return PyBytes_FromString("");
+-    case 1:
+-        result = PyList_GET_ITEM(list, 0);
+-        Py_INCREF(result);
+-        Py_DECREF(list);
+-        return result;
+-    }
+-
+-    /* two or more elements: slice out a suitable separator from the
+-       first member, and use that to join the entire list */
+-
+-    joiner = PySequence_GetSlice(PyList_GET_ITEM(list, 0), 0, 0);
++    joiner = PyUnicode_FromStringAndSize("", 0);
+     if (!joiner)
+         return NULL;
+-
+-    function = PyObject_GetAttrString(joiner, "join");
+-    if (!function) {
+-        Py_DECREF(joiner);
+-        return NULL;
+-    }
+-
+-    args = PyTuple_New(1);
+-    if (!args)
+-        return NULL;
+-
+-    PyTuple_SET_ITEM(args, 0, list);
+-
+-    result = PyObject_CallObject(function, args);
+-
+-    Py_DECREF(args); /* also removes list */
+-    Py_DECREF(function);
++    result = PyUnicode_Join(joiner, list);
+     Py_DECREF(joiner);
+-
++    if (result)
++        Py_DECREF(list);
+     return result;
+ }
+ 
+@@ -348,7 +310,7 @@
+ 
+ /* Helper function for extracting the attrib dictionary from a keywords dict.
+  * This is required by some constructors/functions in this module that can
+- * either accept attrib as a keyword argument or all attributes splashed 
++ * either accept attrib as a keyword argument or all attributes splashed
+  * directly into *kwds.
+  * If there is no 'attrib' keyword, return an empty dict.
+  */
+@@ -399,6 +361,7 @@
+             return -1;
+         if (kwds) {
+             if (PyDict_Update(attrib, kwds) < 0) {
++                Py_DECREF(attrib);
+                 return -1;
+             }
+         }
+@@ -407,38 +370,34 @@
+         attrib = get_attrib_from_keywords(kwds);
+         if (!attrib)
+             return -1;
+-    } else {
+-        /* no attrib arg, no kwds, so no attributes */
+-        Py_INCREF(Py_None);
+-        attrib = Py_None;
+     }
+ 
+     self_elem = (ElementObject *)self;
+ 
+-    if (attrib != Py_None && !is_empty_dict(attrib)) {
++    if (attrib != NULL && !is_empty_dict(attrib)) {
+         if (create_extra(self_elem, attrib) < 0) {
+-            PyObject_Del(self_elem);
++            Py_DECREF(attrib);
+             return -1;
+         }
+     }
+ 
+     /* We own a reference to attrib here and it's no longer needed. */
+-    Py_DECREF(attrib);
++    Py_XDECREF(attrib);
+ 
+     /* Replace the objects already pointed to by tag, text and tail. */
+     tmp = self_elem->tag;
++    Py_INCREF(tag);
+     self_elem->tag = tag;
+-    Py_INCREF(tag);
+     Py_DECREF(tmp);
+ 
+     tmp = self_elem->text;
++    Py_INCREF(Py_None);
+     self_elem->text = Py_None;
++    Py_DECREF(JOIN_OBJ(tmp));
++
++    tmp = self_elem->tail;
+     Py_INCREF(Py_None);
+-    Py_DECREF(JOIN_OBJ(tmp));
+-
+-    tmp = self_elem->tail;
+     self_elem->tail = Py_None;
+-    Py_INCREF(Py_None);
+     Py_DECREF(JOIN_OBJ(tmp));
+ 
+     return 0;
+@@ -520,11 +479,11 @@
+     PyObject* res = self->extra->attrib;
+ 
+     if (res == Py_None) {
+-        Py_DECREF(res);
+         /* create missing dictionary */
+         res = PyDict_New();
+         if (!res)
+             return NULL;
++        Py_DECREF(Py_None);
+         self->extra->attrib = res;
+     }
+ 
+@@ -824,7 +783,7 @@
+     }
+ 
+     /* add object to memo dictionary (so deepcopy won't visit it again) */
+-    id = PyLong_FromLong((Py_uintptr_t) self);
++    id = PyLong_FromSsize_t((Py_uintptr_t) self);
+     if (!id)
+         goto error;
+ 
+@@ -855,6 +814,173 @@
+     return PyLong_FromSsize_t(result);
+ }
+ 
++/* dict keys for getstate/setstate. */
++#define PICKLED_TAG "tag"
++#define PICKLED_CHILDREN "_children"
++#define PICKLED_ATTRIB "attrib"
++#define PICKLED_TAIL "tail"
++#define PICKLED_TEXT "text"
++
++/* __getstate__ returns a fabricated instance dict as in the pure-Python
++ * Element implementation, for interoperability/interchangeability.  This
++ * makes the pure-Python implementation details an API, but (a) there aren't
++ * any unnecessary structures there; and (b) it buys compatibility with 3.2
++ * pickles.  See issue #16076.
++ */
++static PyObject *
++element_getstate(ElementObject *self)
++{
++    int i, noattrib;
++    PyObject *instancedict = NULL, *children;
++
++    /* Build a list of children. */
++    children = PyList_New(self->extra ? self->extra->length : 0);
++    if (!children)
++        return NULL;
++    for (i = 0; i < PyList_GET_SIZE(children); i++) {
++        PyObject *child = self->extra->children[i];
++        Py_INCREF(child);
++        PyList_SET_ITEM(children, i, child);
++    }
++
++    /* Construct the state object. */
++    noattrib = (self->extra == NULL || self->extra->attrib == Py_None);
++    if (noattrib)
++        instancedict = Py_BuildValue("{sOsOs{}sOsO}",
++                                     PICKLED_TAG, self->tag,
++                                     PICKLED_CHILDREN, children,
++                                     PICKLED_ATTRIB,
++                                     PICKLED_TEXT, self->text,
++                                     PICKLED_TAIL, self->tail);
++    else
++        instancedict = Py_BuildValue("{sOsOsOsOsO}",
++                                     PICKLED_TAG, self->tag,
++                                     PICKLED_CHILDREN, children,
++                                     PICKLED_ATTRIB, self->extra->attrib,
++                                     PICKLED_TEXT, self->text,
++                                     PICKLED_TAIL, self->tail);
++    if (instancedict) {
++        Py_DECREF(children);
++        return instancedict;
++    }
++    else {
++        for (i = 0; i < PyList_GET_SIZE(children); i++)
++            Py_DECREF(PyList_GET_ITEM(children, i));
++        Py_DECREF(children);
++
++        return NULL;
++    }
++}
++
++static PyObject *
++element_setstate_from_attributes(ElementObject *self,
++                                 PyObject *tag,
++                                 PyObject *attrib,
++                                 PyObject *text,
++                                 PyObject *tail,
++                                 PyObject *children)
++{
++    Py_ssize_t i, nchildren;
++
++    if (!tag) {
++        PyErr_SetString(PyExc_TypeError, "tag may not be NULL");
++        return NULL;
++    }
++
++    Py_CLEAR(self->tag);
++    self->tag = tag;
++    Py_INCREF(self->tag);
++
++    Py_CLEAR(self->text);
++    self->text = text ? text : Py_None;
++    Py_INCREF(self->text);
++
++    Py_CLEAR(self->tail);
++    self->tail = tail ? tail : Py_None;
++    Py_INCREF(self->tail);
++
++    /* Handle ATTRIB and CHILDREN. */
++    if (!children && !attrib)
++        Py_RETURN_NONE;
++
++    /* Compute 'nchildren'. */
++    if (children) {
++        if (!PyList_Check(children)) {
++            PyErr_SetString(PyExc_TypeError, "'_children' is not a list");
++            return NULL;
++        }
++        nchildren = PyList_Size(children);
++    }
++    else {
++        nchildren = 0;
++    }
++
++    /* Allocate 'extra'. */
++    if (element_resize(self, nchildren)) {
++        return NULL;
++    }
++    assert(self->extra && self->extra->allocated >= nchildren);
++
++    /* Copy children */
++    for (i = 0; i < nchildren; i++) {
++        self->extra->children[i] = PyList_GET_ITEM(children, i);
++        Py_INCREF(self->extra->children[i]);
++    }
++
++    self->extra->length = nchildren;
++    self->extra->allocated = nchildren;
++
++    /* Stash attrib. */
++    if (attrib) {
++        Py_CLEAR(self->extra->attrib);
++        self->extra->attrib = attrib;
++        Py_INCREF(attrib);
++    }
++
++    Py_RETURN_NONE;
++}
++
++/* __setstate__ for Element instance from the Python implementation.
++ * 'state' should be the instance dict.
++ */
++static PyObject *
++element_setstate_from_Python(ElementObject *self, PyObject *state)
++{
++    static char *kwlist[] = {PICKLED_TAG, PICKLED_ATTRIB, PICKLED_TEXT,
++                             PICKLED_TAIL, PICKLED_CHILDREN, 0};
++    PyObject *args;
++    PyObject *tag, *attrib, *text, *tail, *children;
++    PyObject *retval;
++
++    tag = attrib = text = tail = children = NULL;
++    args = PyTuple_New(0);
++    if (!args)
++        return NULL;
++
++    if (PyArg_ParseTupleAndKeywords(args, state, "|$OOOOO", kwlist, &tag,
++                                    &attrib, &text, &tail, &children))
++        retval = element_setstate_from_attributes(self, tag, attrib, text,
++                                                  tail, children);
++    else
++        retval = NULL;
++
++    Py_DECREF(args);
++    return retval;
++}
++
++static PyObject *
++element_setstate(ElementObject *self, PyObject *state)
++{
++    if (!PyDict_CheckExact(state)) {
++        PyErr_Format(PyExc_TypeError,
++                     "Don't know how to unpickle \"%.200R\" as an Element",
++                     state);
++        return NULL;
++    }
++    else
++        return element_setstate_from_Python(self, state);
++}
++
+ LOCAL(int)
+ checkpath(PyObject* tag)
+ {
+@@ -1003,7 +1129,7 @@
+ 
+             PyObject* text = element_get_text(item);
+             if (text == Py_None)
+-                return PyBytes_FromString("");
++                return PyUnicode_New(0, 0);
+             Py_XINCREF(text);
+             return text;
+         }
+@@ -1072,13 +1198,16 @@
+ }
+ 
+ static PyObject*
+-element_get(ElementObject* self, PyObject* args)
++element_get(ElementObject* self, PyObject* args, PyObject* kwds)
+ {
+     PyObject* value;
++    static char* kwlist[] = {"key", "default", 0};
+ 
+     PyObject* key;
+     PyObject* default_value = Py_None;
+-    if (!PyArg_ParseTuple(args, "O|O:get", &key, &default_value))
++
++    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:get", kwlist, &key,
++                                     &default_value))
+         return NULL;
+ 
+     if (!self->extra || self->extra->attrib == Py_None)
+@@ -1126,10 +1255,12 @@
+ 
+ 
+ static PyObject *
+-element_iter(ElementObject *self, PyObject *args)
++element_iter(ElementObject *self, PyObject *args, PyObject *kwds)
+ {
+     PyObject* tag = Py_None;
+-    if (!PyArg_ParseTuple(args, "|O:iter", &tag))
++    static char* kwlist[] = {"tag", 0};
++
++    if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:iter", kwlist, &tag))
+         return NULL;
+ 
+     return create_elementiter(self, tag, 0);
+@@ -1596,7 +1727,7 @@
+ 
+     {"clear", (PyCFunction) element_clearmethod, METH_VARARGS},
+ 
+-    {"get", (PyCFunction) element_get, METH_VARARGS},
++    {"get", (PyCFunction) element_get, METH_VARARGS | METH_KEYWORDS},
+     {"set", (PyCFunction) element_set, METH_VARARGS},
+ 
+     {"find", (PyCFunction) element_find, METH_VARARGS | METH_KEYWORDS},
+@@ -1608,11 +1739,11 @@
+     {"insert", (PyCFunction) element_insert, METH_VARARGS},
+     {"remove", (PyCFunction) element_remove, METH_VARARGS},
+ 
+-    {"iter", (PyCFunction) element_iter, METH_VARARGS},
++    {"iter", (PyCFunction) element_iter, METH_VARARGS | METH_KEYWORDS},
+     {"itertext", (PyCFunction) element_itertext, METH_VARARGS},
+     {"iterfind", (PyCFunction) element_iterfind, METH_VARARGS | METH_KEYWORDS},
+ 
+-    {"getiterator", (PyCFunction) element_iter, METH_VARARGS},
++    {"getiterator", (PyCFunction) element_iter, METH_VARARGS | METH_KEYWORDS},
+     {"getchildren", (PyCFunction) element_getchildren, METH_VARARGS},
+ 
+     {"items", (PyCFunction) element_items, METH_VARARGS},
+@@ -1623,6 +1754,8 @@
+     {"__copy__", (PyCFunction) element_copy, METH_VARARGS},
+     {"__deepcopy__", (PyCFunction) element_deepcopy, METH_VARARGS},
+     {"__sizeof__", element_sizeof, METH_NOARGS},
++    {"__getstate__", (PyCFunction)element_getstate, METH_NOARGS},
++    {"__setstate__", (PyCFunction)element_setstate, METH_O},
+ 
+     {NULL, NULL}
+ };
+@@ -1727,7 +1860,7 @@
+ 
+ static PyTypeObject Element_Type = {
+     PyVarObject_HEAD_INIT(NULL, 0)
+-    "Element", sizeof(ElementObject), 0,
++    "xml.etree.ElementTree.Element", sizeof(ElementObject), 0,
+     /* methods */
+     (destructor)element_dealloc,                    /* tp_dealloc */
+     0,                                              /* tp_print */
+@@ -1844,7 +1977,7 @@
+ elementiter_next(ElementIterObject *it)
+ {
+     /* Sub-element iterator.
+-     * 
++     *
+      * A short note on gettext: this function serves both the iter() and
+      * itertext() methods to avoid code duplication. However, there are a few
+      * small differences in the way these iterations work. Namely:
+@@ -1881,7 +2014,9 @@
+                     PyObject_RichCompareBool(it->root_element->tag,
+                                              it->sought_tag, Py_EQ) == 1) {
+                     if (it->gettext) {
+-                        PyObject *text = JOIN_OBJ(it->root_element->text);
++                        PyObject *text = element_get_text(it->root_element);
++                        if (!text)
++                            return NULL;
+                         if (PyObject_IsTrue(text)) {
+                             Py_INCREF(text);
+                             return text;
+@@ -1911,7 +2046,9 @@
+             }
+ 
+             if (it->gettext) {
+-                PyObject *text = JOIN_OBJ(child->text);
++                PyObject *text = element_get_text(child);
++                if (!text)
++                    return NULL;
+                 if (PyObject_IsTrue(text)) {
+                     Py_INCREF(text);
+                     return text;
+@@ -1926,8 +2063,15 @@
+                 continue;
+         }
+         else {
+-            PyObject *tail = it->gettext ? JOIN_OBJ(cur_parent->tail) : Py_None;            
++            PyObject *tail;
+             ParentLocator *next = it->parent_stack->next;
++            if (it->gettext) {
++                tail = element_get_tail(cur_parent);
++                if (!tail)
++                    return NULL;
++            }
++            else
++                tail = Py_None;
+             Py_XDECREF(it->parent_stack->parent);
+             PyObject_Free(it->parent_stack);
+             it->parent_stack = next;
+@@ -1949,6 +2093,8 @@
+ 
+ static PyTypeObject ElementIter_Type = {
+     PyVarObject_HEAD_INIT(NULL, 0)
++    /* Using the module's name since the pure-Python implementation does not
++       have such a type. */
+     "_elementtree._element_iterator",           /* tp_name */
+     sizeof(ElementIterObject),                  /* tp_basicsize */
+     0,                                          /* tp_itemsize */
+@@ -2038,8 +2184,8 @@
+ 
+     PyObject *root; /* root node (first created node) */
+ 
+-    ElementObject *this; /* current node */
+-    ElementObject *last; /* most recently created node */
++    PyObject *this; /* current node */
++    PyObject *last; /* most recently created node */
+ 
+     PyObject *data; /* data collector (string or list), or NULL */
+ 
+@@ -2071,9 +2217,9 @@
+         t->root = NULL;
+ 
+         Py_INCREF(Py_None);
+-        t->this = (ElementObject *)Py_None;
++        t->this = Py_None;
+         Py_INCREF(Py_None);
+-        t->last = (ElementObject *)Py_None;
++        t->last = Py_None;
+ 
+         t->data = NULL;
+         t->element_factory = NULL;
+@@ -2081,6 +2227,7 @@
+         if (!t->stack) {
+             Py_DECREF(t->this);
+             Py_DECREF(t->last);
++            Py_DECREF((PyObject *) t);
+             return NULL;
+         }
+         t->index = 0;
+@@ -2098,6 +2245,7 @@
+     static char *kwlist[] = {"element_factory", 0};
+     PyObject *element_factory = NULL;
+     TreeBuilderObject *self_tb = (TreeBuilderObject *)self;
++    PyObject *tmp;
+ 
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:TreeBuilder", kwlist,
+                                      &element_factory)) {
+@@ -2106,8 +2254,9 @@
+ 
+     if (element_factory) {
+         Py_INCREF(element_factory);
+-        Py_XDECREF(self_tb->element_factory);
++        tmp = self_tb->element_factory;
+         self_tb->element_factory = element_factory;
++        Py_XDECREF(tmp);
+     }
+ 
+     return 0;
+@@ -2128,17 +2277,17 @@
+ static int
+ treebuilder_gc_clear(TreeBuilderObject *self)
+ {
+-    Py_XDECREF(self->end_ns_event_obj);
+-    Py_XDECREF(self->start_ns_event_obj);
+-    Py_XDECREF(self->end_event_obj);
+-    Py_XDECREF(self->start_event_obj);
+-    Py_XDECREF(self->events);
+-    Py_DECREF(self->stack);
+-    Py_XDECREF(self->data);
+-    Py_DECREF(self->last);
+-    Py_DECREF(self->this);
++    Py_CLEAR(self->end_ns_event_obj);
++    Py_CLEAR(self->start_ns_event_obj);
++    Py_CLEAR(self->end_event_obj);
++    Py_CLEAR(self->start_event_obj);
++    Py_CLEAR(self->events);
++    Py_CLEAR(self->stack);
++    Py_CLEAR(self->data);
++    Py_CLEAR(self->last);
++    Py_CLEAR(self->this);
+     Py_CLEAR(self->element_factory);
+-    Py_XDECREF(self->root);
++    Py_CLEAR(self->root);
+     return 0;
+ }
+ 
+@@ -2151,6 +2300,64 @@
+ }
+ 
+ /* -------------------------------------------------------------------- */
++/* helpers for handling of arbitrary element-like objects */
++
++static int
++treebuilder_set_element_text_or_tail(PyObject *element, PyObject *data,
++                                     PyObject **dest, _Py_Identifier *name)
++{
++    if (Element_CheckExact(element)) {
++        Py_DECREF(JOIN_OBJ(*dest));
++        *dest = JOIN_SET(data, PyList_CheckExact(data));
++        return 0;
++    }
++    else {
++        PyObject *joined = list_join(data);
++        int r;
++        if (joined == NULL)
++            return -1;
++        r = _PyObject_SetAttrId(element, name, joined);
++        Py_DECREF(joined);
++        return r;
++    }
++}
++
++/* These two functions steal a reference to data */
++static int
++treebuilder_set_element_text(PyObject *element, PyObject *data)
++{
++    _Py_IDENTIFIER(text);
++    return treebuilder_set_element_text_or_tail(
++        element, data, &((ElementObject *) element)->text, &PyId_text);
++}
++
++static int
++treebuilder_set_element_tail(PyObject *element, PyObject *data)
++{
++    _Py_IDENTIFIER(tail);
++    return treebuilder_set_element_text_or_tail(
++        element, data, &((ElementObject *) element)->tail, &PyId_tail);
++}
++
++static int
++treebuilder_add_subelement(PyObject *element, PyObject *child)
++{
++    _Py_IDENTIFIER(append);
++    if (Element_CheckExact(element)) {
++        ElementObject *elem = (ElementObject *) element;
++        return element_add_subelement(elem, child);
++    }
++    else {
++        PyObject *res;
++        res = _PyObject_CallMethodId(element, &PyId_append, "O", child);
++        if (res == NULL)
++            return -1;
++        Py_DECREF(res);
++        return 0;
++    }
++}
++
++/* -------------------------------------------------------------------- */
+ /* handlers */
+ 
+ LOCAL(PyObject*)
+@@ -2162,15 +2369,12 @@
+ 
+     if (self->data) {
+         if (self->this == self->last) {
+-            Py_DECREF(JOIN_OBJ(self->last->text));
+-            self->last->text = JOIN_SET(
+-                self->data, PyList_CheckExact(self->data)
+-                );
+-        } else {
+-            Py_DECREF(JOIN_OBJ(self->last->tail));
+-            self->last->tail = JOIN_SET(
+-                self->data, PyList_CheckExact(self->data)
+-                );
++            if (treebuilder_set_element_text(self->last, self->data))
++                return NULL;
++        }
++        else {
++            if (treebuilder_set_element_tail(self->last, self->data))
++                return NULL;
+         }
+         self->data = NULL;
+     }
+@@ -2184,10 +2388,10 @@
+         return NULL;
+     }
+ 
+-    this = (PyObject*) self->this;
++    this = self->this;
+ 
+     if (this != Py_None) {
+-        if (element_add_subelement((ElementObject*) this, node) < 0)
++        if (treebuilder_add_subelement(this, node) < 0)
+             goto error;
+     } else {
+         if (self->root) {
+@@ -2213,19 +2417,17 @@
+ 
+     Py_DECREF(this);
+     Py_INCREF(node);
+-    self->this = (ElementObject*) node;
++    self->this = node;
+ 
+     Py_DECREF(self->last);
+     Py_INCREF(node);
+-    self->last = (ElementObject*) node;
++    self->last = node;
+ 
+     if (self->start_event_obj) {
+         PyObject* res;
+         PyObject* action = self->start_event_obj;
+-        res = PyTuple_New(2);
++        res = PyTuple_Pack(2, action, node);
+         if (res) {
+-            Py_INCREF(action); PyTuple_SET_ITEM(res, 0, (PyObject*) action);
+-            Py_INCREF(node);   PyTuple_SET_ITEM(res, 1, (PyObject*) node);
+             PyList_Append(self->events, res);
+             Py_DECREF(res);
+         } else
+@@ -2243,7 +2445,7 @@
+ treebuilder_handle_data(TreeBuilderObject* self, PyObject* data)
+ {
+     if (!self->data) {
+-        if (self->last == (ElementObject*) Py_None) {
++        if (self->last == Py_None) {
+             /* ignore calls to data before the first call to start */
+             Py_RETURN_NONE;
+         }
+@@ -2253,6 +2455,7 @@
+         /* more than one item; use a list to collect items */
+         if (PyBytes_CheckExact(self->data) && Py_REFCNT(self->data) == 1 &&
+             PyBytes_CheckExact(data) && PyBytes_GET_SIZE(data) == 1) {
++            /* XXX this code path unused in Python 3? */
+             /* expat often generates single character data sections; handle
+                the most common case by resizing the existing string... */
+             Py_ssize_t size = PyBytes_GET_SIZE(self->data);
+@@ -2282,15 +2485,11 @@
+ 
+     if (self->data) {
+         if (self->this == self->last) {
+-            Py_DECREF(JOIN_OBJ(self->last->text));
+-            self->last->text = JOIN_SET(
+-                self->data, PyList_CheckExact(self->data)
+-                );
++            if (treebuilder_set_element_text(self->last, self->data))
++                return NULL;
+         } else {
+-            Py_DECREF(JOIN_OBJ(self->last->tail));
+-            self->last->tail = JOIN_SET(
+-                self->data, PyList_CheckExact(self->data)
+-                );
++            if (treebuilder_set_element_tail(self->last, self->data))
++                return NULL;
+         }
+         self->data = NULL;
+     }
+@@ -2310,17 +2509,15 @@
+ 
+     Py_DECREF(self->last);
+ 
+-    self->last = (ElementObject*) self->this;
+-    self->this = (ElementObject*) item;
++    self->last = self->this;
++    self->this = item;
+ 
+     if (self->end_event_obj) {
+         PyObject* res;
+         PyObject* action = self->end_event_obj;
+         PyObject* node = (PyObject*) self->last;
+-        res = PyTuple_New(2);
++        res = PyTuple_Pack(2, action, node);
+         if (res) {
+-            Py_INCREF(action); PyTuple_SET_ITEM(res, 0, (PyObject*) action);
+-            Py_INCREF(node);   PyTuple_SET_ITEM(res, 1, (PyObject*) node);
+             PyList_Append(self->events, res);
+             Py_DECREF(res);
+         } else
+@@ -2366,8 +2563,12 @@
+         PyTuple_SET_ITEM(res, 1, parcel);
+         PyList_Append(self->events, res);
+         Py_DECREF(res);
+-    } else
++    }
++    else {
++        Py_DECREF(action);
++        Py_DECREF(parcel);
+         PyErr_Clear(); /* FIXME: propagate error */
++    }
+ }
+ 
+ /* -------------------------------------------------------------------- */
+@@ -2439,7 +2640,7 @@
+ 
+ static PyTypeObject TreeBuilder_Type = {
+     PyVarObject_HEAD_INIT(NULL, 0)
+-    "TreeBuilder", sizeof(TreeBuilderObject), 0,
++    "xml.etree.ElementTree.TreeBuilder", sizeof(TreeBuilderObject), 0,
+     /* methods */
+     (destructor)treebuilder_dealloc,                /* tp_dealloc */
+     0,                                              /* tp_print */
+@@ -2526,7 +2727,7 @@
+     /* convert a UTF-8 tag/attribute name from the expat parser
+        to a universal name string */
+ 
+-    int size = strlen(string);
++    Py_ssize_t size = (Py_ssize_t) strlen(string);
+     PyObject* key;
+     PyObject* value;
+ 
+@@ -2545,7 +2746,7 @@
+ 
+         PyObject* tag;
+         char* p;
+-        int i;
++        Py_ssize_t i;
+ 
+         /* look for namespace separator */
+         for (i = 0; i < size; i++)
+@@ -2717,13 +2918,7 @@
+             attrib_in += 2;
+         }
+     } else {
+-        Py_INCREF(Py_None);
+-        attrib = Py_None;
+-    }
+-
+-    /* If we get None, pass an empty dictionary on */
+-    if (attrib == Py_None) {
+-        Py_DECREF(attrib);
++        /* Pass an empty dictionary on */
+         attrib = PyDict_New();
+         if (!attrib)
+             return;
+@@ -2844,7 +3039,7 @@
+     }
+ }
+ 
+-static void 
++static void
+ expat_start_doctype_handler(XMLParserObject *self,
+                             const XML_Char *doctype_name,
+                             const XML_Char *sysid,
+@@ -3015,14 +3210,14 @@
+ 
+     self_xp->names = PyDict_New();
+     if (!self_xp->names) {
+-        Py_XDECREF(self_xp->entity);
++        Py_CLEAR(self_xp->entity);
+         return -1;
+     }
+ 
+     self_xp->parser = EXPAT(ParserCreate_MM)(encoding, &ExpatMemoryHandler, "}");
+     if (!self_xp->parser) {
+-        Py_XDECREF(self_xp->entity);
+-        Py_XDECREF(self_xp->names);
++        Py_CLEAR(self_xp->entity);
++        Py_CLEAR(self_xp->names);
+         PyErr_NoMemory();
+         return -1;
+     }
+@@ -3032,8 +3227,8 @@
+     } else {
+         target = treebuilder_new(&TreeBuilder_Type, NULL, NULL);
+         if (!target) {
+-            Py_XDECREF(self_xp->entity);
+-            Py_XDECREF(self_xp->names);
++            Py_CLEAR(self_xp->entity);
++            Py_CLEAR(self_xp->names);
+             EXPAT(ParserFree)(self_xp->parser);
+             return -1;
+         }
+@@ -3049,7 +3244,7 @@
+     self_xp->handle_doctype = PyObject_GetAttrString(target, "doctype");
+ 
+     PyErr_Clear();
+-    
++
+     /* configure parser */
+     EXPAT(SetUserData)(self_xp->parser, self_xp);
+     EXPAT(SetElementHandler)(
+@@ -3109,17 +3304,17 @@
+ {
+     EXPAT(ParserFree)(self->parser);
+ 
+-    Py_XDECREF(self->handle_close);
+-    Py_XDECREF(self->handle_pi);
+-    Py_XDECREF(self->handle_comment);
+-    Py_XDECREF(self->handle_end);
+-    Py_XDECREF(self->handle_data);
+-    Py_XDECREF(self->handle_start);
+-    Py_XDECREF(self->handle_doctype);
+-
+-    Py_XDECREF(self->target);
+-    Py_XDECREF(self->entity);
+-    Py_XDECREF(self->names);
++    Py_CLEAR(self->handle_close);
++    Py_CLEAR(self->handle_pi);
++    Py_CLEAR(self->handle_comment);
++    Py_CLEAR(self->handle_end);
++    Py_CLEAR(self->handle_data);
++    Py_CLEAR(self->handle_start);
++    Py_CLEAR(self->handle_doctype);
++
++    Py_CLEAR(self->target);
++    Py_CLEAR(self->entity);
++    Py_CLEAR(self->names);
+ 
+     return 0;
+ }
+@@ -3227,17 +3422,12 @@
+                 break;
+             }
+             temp = PyUnicode_AsEncodedString(buffer, "utf-8", "surrogatepass");
++            Py_DECREF(buffer);
+             if (!temp) {
+                 /* Propagate exception from PyUnicode_AsEncodedString */
+-                Py_DECREF(buffer);
+                 Py_DECREF(reader);
+                 return NULL;
+             }
+-
+-            /* Here we no longer need the original buffer since it contains
+-             * unicode. Make it point to the encoded bytes object.
+-            */
+-            Py_DECREF(buffer);
+             buffer = temp;
+         }
+         else if (!PyBytes_CheckExact(buffer) || PyBytes_GET_SIZE(buffer) == 0) {
+@@ -3307,10 +3497,10 @@
+     target->events = events;
+ 
+     /* clear out existing events */
+-    Py_XDECREF(target->start_event_obj); target->start_event_obj = NULL;
+-    Py_XDECREF(target->end_event_obj); target->end_event_obj = NULL;
+-    Py_XDECREF(target->start_ns_event_obj); target->start_ns_event_obj = NULL;
+-    Py_XDECREF(target->end_ns_event_obj); target->end_ns_event_obj = NULL;
++    Py_CLEAR(target->start_event_obj);
++    Py_CLEAR(target->end_event_obj);
++    Py_CLEAR(target->start_ns_event_obj);
++    Py_CLEAR(target->end_ns_event_obj);
+ 
+     if (event_set == Py_None) {
+         /* default is "end" only */
+@@ -3412,7 +3602,7 @@
+ 
+ static PyTypeObject XMLParser_Type = {
+     PyVarObject_HEAD_INIT(NULL, 0)
+-    "XMLParser", sizeof(XMLParserObject), 0,
++    "xml.etree.ElementTree.XMLParser", sizeof(XMLParserObject), 0,
+     /* methods */
+     (destructor)xmlparser_dealloc,                  /* tp_dealloc */
+     0,                                              /* tp_print */
+@@ -3458,7 +3648,7 @@
+ /* python module interface */
+ 
+ static PyMethodDef _functions[] = {
+-    {"SubElement", (PyCFunction) subelement, METH_VARARGS|METH_KEYWORDS},
++    {"SubElement", (PyCFunction) subelement, METH_VARARGS | METH_KEYWORDS},
+     {NULL, NULL}
+ };
+ 
+diff -r bd8afb90ebf2 Modules/_functoolsmodule.c
+--- a/Modules/_functoolsmodule.c
++++ b/Modules/_functoolsmodule.c
+@@ -218,10 +218,10 @@
+ }
+ 
+ static PyObject *
+-partial_setstate(partialobject *pto, PyObject *args)
++partial_setstate(partialobject *pto, PyObject *state)
+ {
+     PyObject *fn, *fnargs, *kw, *dict;
+-    if (!PyArg_ParseTuple(args, "(OOOO):__setstate__",
++    if (!PyArg_ParseTuple(state, "OOOO",
+                           &fn, &fnargs, &kw, &dict))
+         return NULL;
+     Py_XDECREF(pto->fn);
+@@ -245,7 +245,7 @@
+ 
+ static PyMethodDef partial_methods[] = {
+     {"__reduce__", (PyCFunction)partial_reduce, METH_NOARGS},
+-    {"__setstate__", (PyCFunction)partial_setstate, METH_VARARGS},
++    {"__setstate__", (PyCFunction)partial_setstate, METH_O},
+     {NULL,              NULL}           /* sentinel */
+ };
+ 
+diff -r bd8afb90ebf2 Modules/_hashopenssl.c
+--- a/Modules/_hashopenssl.c
++++ b/Modules/_hashopenssl.c
+@@ -70,7 +70,7 @@
+ 
+ 
+ #define DEFINE_CONSTS_FOR_NEW(Name)  \
+-    static PyObject *CONST_ ## Name ## _name_obj; \
++    static PyObject *CONST_ ## Name ## _name_obj = NULL; \
+     static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
+     static EVP_MD_CTX *CONST_new_ ## Name ## _ctx_p = NULL;
+ 
+@@ -585,12 +585,15 @@
+                   " hash object; optionally initialized with a string") \
+     }
+ 
+-/* used in the init function to setup a constructor */
++/* used in the init function to setup a constructor: initialize OpenSSL
++   constructor constants if they haven't been initialized already.  */
+ #define INIT_CONSTRUCTOR_CONSTANTS(NAME)  do { \
+-    CONST_ ## NAME ## _name_obj = PyUnicode_FromString(#NAME); \
+-    if (EVP_get_digestbyname(#NAME)) { \
+-        CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \
+-        EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME)); \
++    if (CONST_ ## NAME ## _name_obj == NULL) { \
++        CONST_ ## NAME ## _name_obj = PyUnicode_FromString(#NAME); \
++        if (EVP_get_digestbyname(#NAME)) { \
++            CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \
++            EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME)); \
++        } \
+     } \
+ } while (0);
+ 
+diff -r bd8afb90ebf2 Modules/_heapqmodule.c
+--- a/Modules/_heapqmodule.c
++++ b/Modules/_heapqmodule.c
+@@ -118,7 +118,7 @@
+ }
+ 
+ PyDoc_STRVAR(heappush_doc,
+-"Push item onto heap, maintaining the heap invariant.");
++"heappush(heap, item) -> None. Push item onto heap, maintaining the heap invariant.");
+ 
+ static PyObject *
+ heappop(PyObject *self, PyObject *heap)
+@@ -186,7 +186,7 @@
+ }
+ 
+ PyDoc_STRVAR(heapreplace_doc,
+-"Pop and return the current smallest value, and add the new item.\n\
++"heapreplace(heap, item) -> value. Pop and return the current smallest value, and add the new item.\n\
+ \n\
+ This is more efficient than heappop() followed by heappush(), and can be\n\
+ more appropriate when using a fixed-size heap.  Note that the value\n\
+@@ -233,7 +233,7 @@
+ }
+ 
+ PyDoc_STRVAR(heappushpop_doc,
+-"Push item on the heap, then pop and return the smallest item\n\
++"heappushpop(heap, item) -> value. Push item on the heap, then pop and return the smallest item\n\
+ from the heap. The combined action runs more efficiently than\n\
+ heappush() followed by a separate call to heappop().");
+ 
+diff -r bd8afb90ebf2 Modules/_io/_iomodule.c
+--- a/Modules/_io/_iomodule.c
++++ b/Modules/_io/_iomodule.c
+@@ -60,7 +60,7 @@
+ "At the top of the I/O hierarchy is the abstract base class IOBase. It\n"
+ "defines the basic interface to a stream. Note, however, that there is no\n"
+ "separation between reading and writing to streams; implementations are\n"
+-"allowed to throw an IOError if they do not support a given operation.\n"
++"allowed to raise an IOError if they do not support a given operation.\n"
+ "\n"
+ "Extending IOBase is RawIOBase which deals simply with the reading and\n"
+ "writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide\n"
+@@ -185,7 +185,7 @@
+ "\n"
+ "* On output, if newline is None, any '\\n' characters written are\n"
+ "  translated to the system default line separator, os.linesep. If\n"
+-"  newline is '' or '\n', no translation takes place. If newline is any\n"
++"  newline is '' or '\\n', no translation takes place. If newline is any\n"
+ "  of the other legal values, any '\\n' characters written are translated\n"
+ "  to the given string.\n"
+ "\n"
+diff -r bd8afb90ebf2 Modules/_io/bufferedio.c
+--- a/Modules/_io/bufferedio.c
++++ b/Modules/_io/bufferedio.c
+@@ -484,7 +484,7 @@
+ static PyObject *
+ buffered_close(buffered *self, PyObject *args)
+ {
+-    PyObject *res = NULL;
++    PyObject *res = NULL, *exc = NULL, *val, *tb;
+     int r;
+ 
+     CHECK_INITIALIZED(self)
+@@ -512,13 +512,29 @@
+     res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL);
+     if (!ENTER_BUFFERED(self))
+         return NULL;
+-    if (res == NULL) {
+-        goto end;
+-    }
+-    Py_XDECREF(res);
++    if (res == NULL)
++        PyErr_Fetch(&exc, &val, &tb);
++    else
++        Py_DECREF(res);
+ 
+     res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_close, NULL);
+ 
++    if (exc != NULL) {
++        if (res != NULL) {
++            Py_CLEAR(res);
++            PyErr_Restore(exc, val, tb);
++        }
++        else {
++            PyObject *val2;
++            Py_DECREF(exc);
++            Py_XDECREF(tb);
++            PyErr_Fetch(&exc, &val2, &tb);
++            PyErr_NormalizeException(&exc, &val2, &tb);
++            PyException_SetContext(val2, val);
++            PyErr_Restore(exc, val2, tb);
++        }
++    }
++
+ end:
+     LEAVE_BUFFERED(self)
+     return res;
+diff -r bd8afb90ebf2 Modules/_io/bytesio.c
+--- a/Modules/_io/bytesio.c
++++ b/Modules/_io/bytesio.c
+@@ -121,7 +121,7 @@
+ }
+ 
+ /* Internal routine for writing a string of bytes to the buffer of a BytesIO
+-   object. Returns the number of bytes wrote, or -1 on error. */
++   object. Returns the number of bytes written, or -1 on error. */
+ static Py_ssize_t
+ write_bytes(bytesio *self, const char *bytes, Py_ssize_t len)
+ {
+@@ -171,10 +171,20 @@
+     }
+ }
+ 
++PyDoc_STRVAR(readable_doc,
++"readable() -> bool. Returns True if the IO object can be read.");
++
++PyDoc_STRVAR(writable_doc,
++"writable() -> bool. Returns True if the IO object can be written.");
++
++PyDoc_STRVAR(seekable_doc,
++"seekable() -> bool. Returns True if the IO object can be seeked.");
++
+ /* Generic getter for the writable, readable and seekable properties */
+ static PyObject *
+-return_true(bytesio *self)
++return_not_closed(bytesio *self)
+ {
++    CHECK_CLOSED(self);
+     Py_RETURN_TRUE;
+ }
+ 
+@@ -682,8 +692,10 @@
+     }
+     else {
+         dict = PyDict_Copy(self->dict);
+-        if (dict == NULL)
++        if (dict == NULL) {
++            Py_DECREF(initvalue);
+             return NULL;
++        }
+     }
+ 
+     state = Py_BuildValue("(OnN)", initvalue, self->pos, dict);
+@@ -867,9 +879,9 @@
+ };
+ 
+ static struct PyMethodDef bytesio_methods[] = {
+-    {"readable",   (PyCFunction)return_true,        METH_NOARGS, NULL},
+-    {"seekable",   (PyCFunction)return_true,        METH_NOARGS, NULL},
+-    {"writable",   (PyCFunction)return_true,        METH_NOARGS, NULL},
++    {"readable",   (PyCFunction)return_not_closed,  METH_NOARGS, readable_doc},
++    {"seekable",   (PyCFunction)return_not_closed,  METH_NOARGS, seekable_doc},
++    {"writable",   (PyCFunction)return_not_closed,  METH_NOARGS, writable_doc},
+     {"close",      (PyCFunction)bytesio_close,      METH_NOARGS, close_doc},
+     {"flush",      (PyCFunction)bytesio_flush,      METH_NOARGS, flush_doc},
+     {"isatty",     (PyCFunction)bytesio_isatty,     METH_NOARGS, isatty_doc},
+diff -r bd8afb90ebf2 Modules/_io/fileio.c
+--- a/Modules/_io/fileio.c
++++ b/Modules/_io/fileio.c
+@@ -244,7 +244,7 @@
+         return -1;
+     }
+ 
+-    fd = PyLong_AsLong(nameobj);
++    fd = _PyLong_AsInt(nameobj);
+     if (fd < 0) {
+         if (!PyErr_Occurred()) {
+             PyErr_SetString(PyExc_ValueError,
+@@ -382,7 +382,7 @@
+                 goto error;
+             }
+ 
+-            self->fd = PyLong_AsLong(fdobj);
++            self->fd = _PyLong_AsInt(fdobj);
+             Py_DECREF(fdobj);
+             if (self->fd == -1) {
+                 goto error;
+@@ -607,7 +607,7 @@
+ #endif
+     PyObject *result;
+     Py_ssize_t total = 0;
+-    int n;
++    Py_ssize_t n;
+     size_t newsize;
+ 
+     if (self->fd < 0)
+@@ -656,9 +656,18 @@
+         }
+         Py_BEGIN_ALLOW_THREADS
+         errno = 0;
++        n = newsize - total;
++#if defined(MS_WIN64) || defined(MS_WINDOWS)
++        if (n > INT_MAX)
++            n = INT_MAX;
+         n = read(self->fd,
+                  PyBytes_AS_STRING(result) + total,
+-                 newsize - total);
++                 (int)n);
++#else
++        n = read(self->fd,
++                 PyBytes_AS_STRING(result) + total,
++                 n);
++#endif
+         Py_END_ALLOW_THREADS
+         if (n == 0)
+             break;
+diff -r bd8afb90ebf2 Modules/_io/iobase.c
+--- a/Modules/_io/iobase.c
++++ b/Modules/_io/iobase.c
+@@ -442,7 +442,7 @@
+     "\n"
+     "If limit is specified, at most limit bytes will be read.\n"
+     "\n"
+-    "The line terminator is always b'\n' for binary files; for text\n"
++    "The line terminator is always b'\\n' for binary files; for text\n"
+     "files, the newlines argument to open can be used to select the line\n"
+     "terminator(s) recognized.\n");
+ 
+@@ -669,7 +669,10 @@
+                 break; /* Stop Iteration */
+         }
+ 
+-        res = PyObject_CallMethodObjArgs(self, _PyIO_str_write, line, NULL);
++        res = NULL;
++        do {
++            res = PyObject_CallMethodObjArgs(self, _PyIO_str_write, line, NULL);
++        } while (res == NULL && _PyIO_trap_eintr());
+         Py_DECREF(line);
+         if (res == NULL) {
+             Py_DECREF(iter);
+diff -r bd8afb90ebf2 Modules/_io/stringio.c
+--- a/Modules/_io/stringio.c
++++ b/Modules/_io/stringio.c
+@@ -760,10 +760,21 @@
+ }
+ 
+ /* Properties and pseudo-properties */
++
++PyDoc_STRVAR(stringio_readable_doc,
++"readable() -> bool. Returns True if the IO object can be read.");
++
++PyDoc_STRVAR(stringio_writable_doc,
++"writable() -> bool. Returns True if the IO object can be written.");
++
++PyDoc_STRVAR(stringio_seekable_doc,
++"seekable() -> bool. Returns True if the IO object can be seeked.");
++
+ static PyObject *
+ stringio_seekable(stringio *self, PyObject *args)
+ {
+     CHECK_INITIALIZED(self);
++    CHECK_CLOSED(self);
+     Py_RETURN_TRUE;
+ }
+ 
+@@ -771,6 +782,7 @@
+ stringio_readable(stringio *self, PyObject *args)
+ {
+     CHECK_INITIALIZED(self);
++    CHECK_CLOSED(self);
+     Py_RETURN_TRUE;
+ }
+ 
+@@ -778,6 +790,7 @@
+ stringio_writable(stringio *self, PyObject *args)
+ {
+     CHECK_INITIALIZED(self);
++    CHECK_CLOSED(self);
+     Py_RETURN_TRUE;
+ }
+ 
+@@ -956,9 +969,9 @@
+     {"seek",     (PyCFunction)stringio_seek,     METH_VARARGS, stringio_seek_doc},
+     {"write",    (PyCFunction)stringio_write,    METH_O,       stringio_write_doc},
+ 
+-    {"seekable", (PyCFunction)stringio_seekable, METH_NOARGS},
+-    {"readable", (PyCFunction)stringio_readable, METH_NOARGS},
+-    {"writable", (PyCFunction)stringio_writable, METH_NOARGS},
++    {"seekable", (PyCFunction)stringio_seekable, METH_NOARGS, stringio_seekable_doc},
++    {"readable", (PyCFunction)stringio_readable, METH_NOARGS, stringio_readable_doc},
++    {"writable", (PyCFunction)stringio_writable, METH_NOARGS, stringio_writable_doc},
+ 
+     {"__getstate__", (PyCFunction)stringio_getstate, METH_NOARGS},
+     {"__setstate__", (PyCFunction)stringio_setstate, METH_O},
+diff -r bd8afb90ebf2 Modules/_io/textio.c
+--- a/Modules/_io/textio.c
++++ b/Modules/_io/textio.c
+@@ -257,6 +257,25 @@
+     Py_TYPE(self)->tp_free((PyObject *)self);
+ }
+ 
++static int
++check_decoded(PyObject *decoded)
++{
++    if (decoded == NULL)
++        return -1;
++    if (!PyUnicode_Check(decoded)) {
++        PyErr_Format(PyExc_TypeError,
++                     "decoder should return a string result, not '%.200s'",
++                     Py_TYPE(decoded)->tp_name);
++        Py_DECREF(decoded);
++        return -1;
++    }
++    if (PyUnicode_READY(decoded) < 0) {
++        Py_DECREF(decoded);
++        return -1;
++    }
++    return 0;
++}
++
+ #define SEEN_CR   1
+ #define SEEN_LF   2
+ #define SEEN_CRLF 4
+@@ -286,18 +305,9 @@
+         Py_INCREF(output);
+     }
+ 
+-    if (output == NULL)
++    if (check_decoded(output) < 0)
+         return NULL;
+ 
+-    if (!PyUnicode_Check(output)) {
+-        PyErr_SetString(PyExc_TypeError,
+-                        "decoder should return a string result");
+-        goto error;
+-    }
+-
+-    if (PyUnicode_READY(output) == -1)
+-        goto error;
+-
+     output_len = PyUnicode_GET_LENGTH(output);
+     if (self->pendingcr && (final || output_len > 0)) {
+         /* Prefix output with CR */
+@@ -648,7 +658,7 @@
+     "\n"
+     "* On output, if newline is None, any '\\n' characters written are\n"
+     "  translated to the system default line separator, os.linesep. If\n"
+-    "  newline is '' or '\n', no translation takes place. If newline is any\n"
++    "  newline is '' or '\\n', no translation takes place. If newline is any\n"
+     "  of the other legal values, any '\\n' characters written are translated\n"
+     "  to the given string.\n"
+     "\n"
+@@ -881,7 +891,7 @@
+             }
+         }
+         else {
+-            int fd = (int) PyLong_AsLong(fileno);
++            int fd = _PyLong_AsInt(fileno);
+             Py_DECREF(fileno);
+             if (fd == -1 && PyErr_Occurred()) {
+                 goto error;
+@@ -1247,8 +1257,11 @@
+     Py_DECREF(pending);
+     if (b == NULL)
+         return -1;
+-    ret = PyObject_CallMethodObjArgs(self->buffer,
+-                                     _PyIO_str_write, b, NULL);
++    ret = NULL;
++    do {
++        ret = PyObject_CallMethodObjArgs(self->buffer,
++                                         _PyIO_str_write, b, NULL);
++    } while (ret == NULL && _PyIO_trap_eintr());
+     Py_DECREF(b);
+     if (ret == NULL)
+         return -1;
+@@ -1455,7 +1468,13 @@
+     Py_DECREF(chunk_size);
+     if (input_chunk == NULL)
+         goto fail;
+-    assert(PyBytes_Check(input_chunk));
++    if (!PyBytes_Check(input_chunk)) {
++        PyErr_Format(PyExc_TypeError,
++                     "underlying %s() should have returned a bytes object, "
++                     "not '%.200s'", (self->has_read1 ? "read1": "read"),
++                     Py_TYPE(input_chunk)->tp_name);
++        goto fail;
++    }
+ 
+     nbytes = PyBytes_Size(input_chunk);
+     eof = (nbytes == 0);
+@@ -1469,10 +1488,7 @@
+             _PyIO_str_decode, input_chunk, eof ? Py_True : Py_False, NULL);
+     }
+ 
+-    /* TODO sanity check: isinstance(decoded_chars, unicode) */
+-    if (decoded_chars == NULL)
+-        goto fail;
+-    if (PyUnicode_READY(decoded_chars) == -1)
++    if (check_decoded(decoded_chars) < 0)
+         goto fail;
+     textiowrapper_set_decoded_chars(self, decoded_chars);
+     nchars = PyUnicode_GET_LENGTH(decoded_chars);
+@@ -1490,7 +1506,14 @@
+         PyObject *next_input = PyNumber_Add(dec_buffer, input_chunk);
+         if (next_input == NULL)
+             goto fail;
+-        assert (PyBytes_Check(next_input));
++        if (!PyBytes_Check(next_input)) {
++            PyErr_Format(PyExc_TypeError,
++                         "decoder getstate() should have returned a bytes "
++                         "object, not '%.200s'",
++                         Py_TYPE(next_input)->tp_name);
++            Py_DECREF(next_input);
++            goto fail;
++        }
+         Py_DECREF(dec_buffer);
+         Py_CLEAR(self->snapshot);
+         self->snapshot = Py_BuildValue("NN", dec_flags, next_input);
+@@ -1539,7 +1562,7 @@
+             decoded = PyObject_CallMethodObjArgs(
+                 self->decoder, _PyIO_str_decode, bytes, Py_True, NULL);
+         Py_DECREF(bytes);
+-        if (decoded == NULL)
++        if (check_decoded(decoded) < 0)
+             goto fail;
+ 
+         result = textiowrapper_get_decoded_chars(self, -1);
+@@ -2148,7 +2171,14 @@
+         if (input_chunk == NULL)
+             goto fail;
+ 
+-        assert (PyBytes_Check(input_chunk));
++        if (!PyBytes_Check(input_chunk)) {
++            PyErr_Format(PyExc_TypeError,
++                         "underlying read() should have returned a bytes "
++                         "object, not '%.200s'",
++                         Py_TYPE(input_chunk)->tp_name);
++            Py_DECREF(input_chunk);
++            goto fail;
++        }
+ 
+         self->snapshot = Py_BuildValue("iN", cookie.dec_flags, input_chunk);
+         if (self->snapshot == NULL) {
+@@ -2159,12 +2189,8 @@
+         decoded = _PyObject_CallMethodId(self->decoder, &PyId_decode,
+             "Oi", input_chunk, (int)cookie.need_eof);
+ 
+-        if (decoded == NULL)
++        if (check_decoded(decoded) < 0)
+             goto fail;
+-        if (PyUnicode_READY(decoded) == -1) {
+-            Py_DECREF(decoded);
+-            goto fail;
+-        }
+ 
+         textiowrapper_set_decoded_chars(self, decoded);
+ 
+@@ -2280,13 +2306,11 @@
+         Py_DECREF(_state); \
+     } while (0)
+ 
+-    /* TODO: replace assert with exception */
+ #define DECODER_DECODE(start, len, res) do { \
+         PyObject *_decoded = _PyObject_CallMethodId( \
+             self->decoder, &PyId_decode, "y#", start, len); \
+-        if (_decoded == NULL) \
++        if (check_decoded(_decoded) < 0) \
+             goto fail; \
+-        assert (PyUnicode_Check(_decoded)); \
+         res = PyUnicode_GET_LENGTH(_decoded); \
+         Py_DECREF(_decoded); \
+     } while (0)
+@@ -2367,9 +2391,8 @@
+         /* We didn't get enough decoded data; signal EOF to get more. */
+         PyObject *decoded = _PyObject_CallMethodId(
+             self->decoder, &PyId_decode, "yi", "", /* final = */ 1);
+-        if (decoded == NULL)
++        if (check_decoded(decoded) < 0)
+             goto fail;
+-        assert (PyUnicode_Check(decoded));
+         chars_decoded += PyUnicode_GET_LENGTH(decoded);
+         Py_DECREF(decoded);
+         cookie.need_eof = 1;
+@@ -2554,6 +2577,7 @@
+         Py_RETURN_NONE; /* stream already closed */
+     }
+     else {
++        PyObject *exc = NULL, *val, *tb;
+         if (self->deallocating) {
+             res = _PyObject_CallMethodId(self->buffer, &PyId__dealloc_warn, "O", self);
+             if (res)
+@@ -2562,13 +2586,28 @@
+                 PyErr_Clear();
+         }
+         res = _PyObject_CallMethodId((PyObject *)self, &PyId_flush, NULL);
+-        if (res == NULL) {
+-            return NULL;
+-        }
++        if (res == NULL)
++            PyErr_Fetch(&exc, &val, &tb);
+         else
+             Py_DECREF(res);
+ 
+-        return _PyObject_CallMethodId(self->buffer, &PyId_close, NULL);
++        res = _PyObject_CallMethodId(self->buffer, &PyId_close, NULL);
++        if (exc != NULL) {
++            if (res != NULL) {
++                Py_CLEAR(res);
++                PyErr_Restore(exc, val, tb);
++            }
++            else {
++                PyObject *val2;
++                Py_DECREF(exc);
++                Py_XDECREF(tb);
++                PyErr_Fetch(&exc, &val2, &tb);
++                PyErr_NormalizeException(&exc, &val2, &tb);
++                PyException_SetContext(val2, val);
++                PyErr_Restore(exc, val2, tb);
++            }
++        }
++        return res;
+     }
+ }
+ 
+diff -r bd8afb90ebf2 Modules/_json.c
+--- a/Modules/_json.c
++++ b/Modules/_json.c
+@@ -246,7 +246,9 @@
+         }
+     }
+     output[chars++] = '"';
++#ifdef Py_DEBUG
+     assert(_PyUnicode_CheckConsistency(rval, 1));
++#endif
+     return rval;
+ }
+ 
+@@ -1660,8 +1662,6 @@
+     static PyObject *empty_array = NULL;
+     PyObject *ident = NULL;
+     PyObject *s_fast = NULL;
+-    Py_ssize_t num_items;
+-    PyObject **seq_items;
+     Py_ssize_t i;
+ 
+     if (open_array == NULL || close_array == NULL || empty_array == NULL) {
+@@ -1675,8 +1675,7 @@
+     s_fast = PySequence_Fast(seq, "_iterencode_list needs a sequence");
+     if (s_fast == NULL)
+         return -1;
+-    num_items = PySequence_Fast_GET_SIZE(s_fast);
+-    if (num_items == 0) {
++    if (PySequence_Fast_GET_SIZE(s_fast) == 0) {
+         Py_DECREF(s_fast);
+         return _PyAccu_Accumulate(acc, empty_array);
+     }
+@@ -1697,7 +1696,6 @@
+         }
+     }
+ 
+-    seq_items = PySequence_Fast_ITEMS(s_fast);
+     if (_PyAccu_Accumulate(acc, open_array))
+         goto bail;
+     if (s->indent != Py_None) {
+@@ -1709,8 +1707,8 @@
+             buf += newline_indent
+         */
+     }
+-    for (i = 0; i < num_items; i++) {
+-        PyObject *obj = seq_items[i];
++    for (i = 0; i < PySequence_Fast_GET_SIZE(s_fast); i++) {
++        PyObject *obj = PySequence_Fast_GET_ITEM(s_fast, i);
+         if (i) {
+             if (_PyAccu_Accumulate(acc, s->item_separator))
+                 goto bail;
+diff -r bd8afb90ebf2 Modules/_multiprocessing/semaphore.c
+--- a/Modules/_multiprocessing/semaphore.c
++++ b/Modules/_multiprocessing/semaphore.c
+@@ -186,6 +186,13 @@
+ #define SEM_GETVALUE(sem, pval) sem_getvalue(sem, pval)
+ #define SEM_UNLINK(name) sem_unlink(name)
+ 
++/* OS X 10.4 defines SEM_FAILED as -1 instead of (sem_t *)-1;  this gives
++   compiler warnings, and (potentially) undefined behaviour. */
++#ifdef __APPLE__
++#  undef SEM_FAILED
++#  define SEM_FAILED ((sem_t *)-1)
++#endif
++
+ #ifndef HAVE_SEM_UNLINK
+ #  define sem_unlink(name) 0
+ #endif
+diff -r bd8afb90ebf2 Modules/_pickle.c
+--- a/Modules/_pickle.c
++++ b/Modules/_pickle.c
+@@ -1589,7 +1589,7 @@
+          * byte at the start, and cut it back later if possible.
+          */
+         nbytes = (nbits >> 3) + 1;
+-        if (nbytes > INT_MAX) {
++        if (nbytes > 0x7fffffffL) {
+             PyErr_SetString(PyExc_OverflowError,
+                             "long too large to pickle");
+             goto error;
+@@ -1788,7 +1788,7 @@
+         }
+         else {
+             PyErr_SetString(PyExc_OverflowError,
+-                            "cannot serialize a bytes object larger than 4GB");
++                            "cannot serialize a bytes object larger than 4 GiB");
+             return -1;          /* string too large */
+         }
+ 
+@@ -1888,7 +1888,7 @@
+         size = PyBytes_GET_SIZE(encoded);
+         if (size > 0xffffffffL) {
+             PyErr_SetString(PyExc_OverflowError,
+-                            "cannot serialize a string larger than 4GB");
++                            "cannot serialize a string larger than 4 GiB");
+             goto error;          /* string too large */
+         }
+ 
+diff -r bd8afb90ebf2 Modules/_posixsubprocess.c
+--- a/Modules/_posixsubprocess.c
++++ b/Modules/_posixsubprocess.c
+@@ -356,7 +356,7 @@
+            PyObject *preexec_fn,
+            PyObject *preexec_fn_args_tuple)
+ {
+-    int i, saved_errno, unused;
++    int i, saved_errno, unused, reached_preexec = 0;
+     PyObject *result;
+     const char* err_msg = "";
+     /* Buffer large enough to hold a hex integer.  We can't malloc. */
+@@ -440,6 +440,7 @@
+         POSIX_CALL(setsid());
+ #endif
+ 
++    reached_preexec = 1;
+     if (preexec_fn != Py_None && preexec_fn_args_tuple) {
+         /* This is where the user has asked us to deadlock their program. */
+         result = PyObject_Call(preexec_fn, preexec_fn_args_tuple, NULL);
+@@ -489,6 +490,10 @@
+         }
+         unused = write(errpipe_write, cur, hex_errno + sizeof(hex_errno) - cur);
+         unused = write(errpipe_write, ":", 1);
++        if (!reached_preexec) {
++            /* Indicate to the parent that the error happened before exec(). */
++            unused = write(errpipe_write, "noexec", 6);
++        }
+         /* We can't call strerror(saved_errno).  It is not async signal safe.
+          * The parent process will look the error message up. */
+     } else {
+diff -r bd8afb90ebf2 Modules/_randommodule.c
+--- a/Modules/_randommodule.c
++++ b/Modules/_randommodule.c
+@@ -284,7 +284,8 @@
+         n = newn;
+         if (keyused >= keymax) {
+             unsigned long bigger = keymax << 1;
+-            if ((bigger >> 1) != keymax) {
++            if ((bigger >> 1) != keymax ||
++                bigger > PY_SSIZE_T_MAX / sizeof(*key)) {
+                 PyErr_NoMemory();
+                 goto Done;
+             }
+diff -r bd8afb90ebf2 Modules/_sqlite/connection.c
+--- a/Modules/_sqlite/connection.c
++++ b/Modules/_sqlite/connection.c
+@@ -482,32 +482,35 @@
+     }
+ }
+ 
+-void _pysqlite_set_result(sqlite3_context* context, PyObject* py_val)
++static int
++_pysqlite_set_result(sqlite3_context* context, PyObject* py_val)
+ {
+-    const char* buffer;
+-    Py_ssize_t buflen;
+-
+-    if ((!py_val) || PyErr_Occurred()) {
+-        sqlite3_result_null(context);
+-    } else if (py_val == Py_None) {
++    if (py_val == Py_None) {
+         sqlite3_result_null(context);
+     } else if (PyLong_Check(py_val)) {
+-        sqlite3_result_int64(context, PyLong_AsLongLong(py_val));
++        sqlite_int64 value = _pysqlite_long_as_int64(py_val);
++        if (value == -1 && PyErr_Occurred())
++            return -1;
++        sqlite3_result_int64(context, value);
+     } else if (PyFloat_Check(py_val)) {
+         sqlite3_result_double(context, PyFloat_AsDouble(py_val));
+     } else if (PyUnicode_Check(py_val)) {
+-        char *str = _PyUnicode_AsString(py_val);
+-        if (str != NULL)
+-            sqlite3_result_text(context, str, -1, SQLITE_TRANSIENT);
++        const char *str = _PyUnicode_AsString(py_val);
++        if (str == NULL)
++            return -1;
++        sqlite3_result_text(context, str, -1, SQLITE_TRANSIENT);
+     } else if (PyObject_CheckBuffer(py_val)) {
++        const char* buffer;
++        Py_ssize_t buflen;
+         if (PyObject_AsCharBuffer(py_val, &buffer, &buflen) != 0) {
+             PyErr_SetString(PyExc_ValueError, "could not convert BLOB to buffer");
+-        } else {
+-            sqlite3_result_blob(context, buffer, buflen, SQLITE_TRANSIENT);
++            return -1;
+         }
++        sqlite3_result_blob(context, buffer, buflen, SQLITE_TRANSIENT);
+     } else {
+-        /* TODO: raise error */
++        return -1;
+     }
++    return 0;
+ }
+ 
+ PyObject* _pysqlite_build_py_params(sqlite3_context *context, int argc, sqlite3_value** argv)
+@@ -528,7 +531,7 @@
+         cur_value = argv[i];
+         switch (sqlite3_value_type(argv[i])) {
+             case SQLITE_INTEGER:
+-                cur_py_value = PyLong_FromLongLong(sqlite3_value_int64(cur_value));
++                cur_py_value = _pysqlite_long_from_int64(sqlite3_value_int64(cur_value));
+                 break;
+             case SQLITE_FLOAT:
+                 cur_py_value = PyFloat_FromDouble(sqlite3_value_double(cur_value));
+@@ -571,6 +574,7 @@
+     PyObject* args;
+     PyObject* py_func;
+     PyObject* py_retval = NULL;
++    int ok;
+ 
+ #ifdef WITH_THREAD
+     PyGILState_STATE threadstate;
+@@ -586,10 +590,12 @@
+         Py_DECREF(args);
+     }
+ 
++    ok = 0;
+     if (py_retval) {
+-        _pysqlite_set_result(context, py_retval);
++        ok = _pysqlite_set_result(context, py_retval) == 0;
+         Py_DECREF(py_retval);
+-    } else {
++    }
++    if (!ok) {
+         if (_enable_callback_tracebacks) {
+             PyErr_Print();
+         } else {
+@@ -669,9 +675,10 @@
+ 
+ void _pysqlite_final_callback(sqlite3_context* context)
+ {
+-    PyObject* function_result = NULL;
++    PyObject* function_result;
+     PyObject** aggregate_instance;
+     _Py_IDENTIFIER(finalize);
++    int ok;
+ 
+ #ifdef WITH_THREAD
+     PyGILState_STATE threadstate;
+@@ -688,21 +695,23 @@
+     }
+ 
+     function_result = _PyObject_CallMethodId(*aggregate_instance, &PyId_finalize, "");
+-    if (!function_result) {
++    Py_DECREF(*aggregate_instance);
++
++    ok = 0;
++    if (function_result) {
++        ok = _pysqlite_set_result(context, function_result) == 0;
++        Py_DECREF(function_result);
++    }
++    if (!ok) {
+         if (_enable_callback_tracebacks) {
+             PyErr_Print();
+         } else {
+             PyErr_Clear();
+         }
+         _sqlite3_result_error(context, "user-defined aggregate's 'finalize' method raised error", -1);
+-    } else {
+-        _pysqlite_set_result(context, function_result);
+     }
+ 
+ error:
+-    Py_XDECREF(*aggregate_instance);
+-    Py_XDECREF(function_result);
+-
+ #ifdef WITH_THREAD
+     PyGILState_Release(threadstate);
+ #endif
+@@ -859,7 +868,9 @@
+         rc = SQLITE_DENY;
+     } else {
+         if (PyLong_Check(ret)) {
+-            rc = (int)PyLong_AsLong(ret);
++            rc = _PyLong_AsInt(ret);
++            if (rc == -1 && PyErr_Occurred())
++                rc = SQLITE_DENY;
+         } else {
+             rc = SQLITE_DENY;
+         }
+@@ -1327,6 +1338,7 @@
+     PyGILState_STATE gilstate;
+ #endif
+     PyObject* retval = NULL;
++    long longval;
+     int result = 0;
+ #ifdef WITH_THREAD
+     gilstate = PyGILState_Ensure();
+@@ -1350,10 +1362,17 @@
+         goto finally;
+     }
+ 
+-    result = PyLong_AsLong(retval);
+-    if (PyErr_Occurred()) {
++    longval = PyLong_AsLongAndOverflow(retval, &result);
++    if (longval == -1 && PyErr_Occurred()) {
++        PyErr_Clear();
+         result = 0;
+     }
++    else if (!result) {
++        if (longval > 0)
++            result = 1;
++        else if (longval < 0)
++            result = -1;
++    }
+ 
+ finally:
+     Py_XDECREF(string1);
+diff -r bd8afb90ebf2 Modules/_sqlite/cursor.c
+--- a/Modules/_sqlite/cursor.c
++++ b/Modules/_sqlite/cursor.c
+@@ -26,14 +26,6 @@
+ #include "util.h"
+ #include "sqlitecompat.h"
+ 
+-/* used to decide wether to call PyLong_FromLong or PyLong_FromLongLong */
+-#ifndef INT32_MIN
+-#define INT32_MIN (-2147483647 - 1)
+-#endif
+-#ifndef INT32_MAX
+-#define INT32_MAX 2147483647
+-#endif
+-
+ PyObject* pysqlite_cursor_iternext(pysqlite_Cursor* self);
+ 
+ static char* errmsg_fetch_across_rollback = "Cursor needed to be reset because of commit/rollback and can no longer be fetched from.";
+@@ -279,7 +271,6 @@
+     PyObject* row;
+     PyObject* item = NULL;
+     int coltype;
+-    PY_LONG_LONG intval;
+     PyObject* converter;
+     PyObject* converted;
+     Py_ssize_t nbytes;
+@@ -339,12 +330,7 @@
+                 Py_INCREF(Py_None);
+                 converted = Py_None;
+             } else if (coltype == SQLITE_INTEGER) {
+-                intval = sqlite3_column_int64(self->statement->st, i);
+-                if (intval < INT32_MIN || intval > INT32_MAX) {
+-                    converted = PyLong_FromLongLong(intval);
+-                } else {
+-                    converted = PyLong_FromLong((long)intval);
+-                }
++                converted = _pysqlite_long_from_int64(sqlite3_column_int64(self->statement->st, i));
+             } else if (coltype == SQLITE_FLOAT) {
+                 converted = PyFloat_FromDouble(sqlite3_column_double(self->statement->st, i));
+             } else if (coltype == SQLITE_TEXT) {
+@@ -446,7 +432,6 @@
+     PyObject* func_args;
+     PyObject* result;
+     int numcols;
+-    PY_LONG_LONG lastrowid;
+     int statement_type;
+     PyObject* descriptor;
+     PyObject* second_argument = NULL;
+@@ -716,10 +701,11 @@
+ 
+         Py_DECREF(self->lastrowid);
+         if (!multiple && statement_type == STATEMENT_INSERT) {
++            sqlite3_int64 lastrowid;
+             Py_BEGIN_ALLOW_THREADS
+             lastrowid = sqlite3_last_insert_rowid(self->connection->db);
+             Py_END_ALLOW_THREADS
+-            self->lastrowid = PyLong_FromLong((long)lastrowid);
++            self->lastrowid = _pysqlite_long_from_int64(lastrowid);
+         } else {
+             Py_INCREF(Py_None);
+             self->lastrowid = Py_None;
+diff -r bd8afb90ebf2 Modules/_sqlite/statement.c
+--- a/Modules/_sqlite/statement.c
++++ b/Modules/_sqlite/statement.c
+@@ -26,6 +26,7 @@
+ #include "connection.h"
+ #include "microprotocols.h"
+ #include "prepare_protocol.h"
++#include "util.h"
+ #include "sqlitecompat.h"
+ 
+ /* prototypes */
+@@ -90,7 +91,6 @@
+ int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObject* parameter)
+ {
+     int rc = SQLITE_OK;
+-    PY_LONG_LONG longlongval;
+     const char* buffer;
+     char* string;
+     Py_ssize_t buflen;
+@@ -120,11 +120,14 @@
+     }
+ 
+     switch (paramtype) {
+-        case TYPE_LONG:
+-            /* in the overflow error case, longval/longlongval is -1, and an exception is set */
+-            longlongval = PyLong_AsLongLong(parameter);
+-            rc = sqlite3_bind_int64(self->st, pos, (sqlite_int64)longlongval);
++        case TYPE_LONG: {
++            sqlite_int64 value = _pysqlite_long_as_int64(parameter);
++            if (value == -1 && PyErr_Occurred())
++                rc = -1;
++            else
++                rc = sqlite3_bind_int64(self->st, pos, value);
+             break;
++        }
+         case TYPE_FLOAT:
+             rc = sqlite3_bind_double(self->st, pos, PyFloat_AsDouble(parameter));
+             break;
+diff -r bd8afb90ebf2 Modules/_sqlite/util.c
+--- a/Modules/_sqlite/util.c
++++ b/Modules/_sqlite/util.c
+@@ -104,3 +104,69 @@
+     return errorcode;
+ }
+ 
++#ifdef WORDS_BIGENDIAN
++# define IS_LITTLE_ENDIAN 0
++#else
++# define IS_LITTLE_ENDIAN 1
++#endif
++
++PyObject *
++_pysqlite_long_from_int64(sqlite3_int64 value)
++{
++#ifdef HAVE_LONG_LONG
++# if SIZEOF_LONG_LONG < 8
++    if (value > PY_LLONG_MAX || value < PY_LLONG_MIN) {
++        return _PyLong_FromByteArray(&value, sizeof(value),
++                                     IS_LITTLE_ENDIAN, 1 /* signed */);
++    }
++# endif
++# if SIZEOF_LONG < SIZEOF_LONG_LONG
++    if (value > LONG_MAX || value < LONG_MIN)
++        return PyLong_FromLongLong(value);
++# endif
++#else
++# if SIZEOF_LONG < 8
++    if (value > LONG_MAX || value < LONG_MIN) {
++        return _PyLong_FromByteArray(&value, sizeof(value),
++                                     IS_LITTLE_ENDIAN, 1 /* signed */);
++    }
++# endif
++#endif
++    return PyLong_FromLong(value);
++}
++
++sqlite3_int64
++_pysqlite_long_as_int64(PyObject * py_val)
++{
++    int overflow;
++#ifdef HAVE_LONG_LONG
++    PY_LONG_LONG value = PyLong_AsLongLongAndOverflow(py_val, &overflow);
++#else
++    long value = PyLong_AsLongAndOverflow(py_val, &overflow);
++#endif
++    if (value == -1 && PyErr_Occurred())
++        return -1;
++    if (!overflow) {
++#ifdef HAVE_LONG_LONG
++# if SIZEOF_LONG_LONG > 8
++        if (-0x8000000000000000LL <= value && value <= 0x7FFFFFFFFFFFFFFFLL)
++# endif
++#else
++# if SIZEOF_LONG > 8
++        if (-0x8000000000000000L <= value && value <= 0x7FFFFFFFFFFFFFFFL)
++# endif
++#endif
++            return value;
++    }
++    else if (sizeof(value) < sizeof(sqlite3_int64)) {
++        sqlite3_int64 int64val;
++        if (_PyLong_AsByteArray((PyLongObject *)py_val,
++                                (unsigned char *)&int64val, sizeof(int64val),
++                                IS_LITTLE_ENDIAN, 1 /* signed */) >= 0) {
++            return int64val;
++        }
++    }
++    PyErr_SetString(PyExc_OverflowError,
++                    "Python int too large to convert to SQLite INTEGER");
++    return -1;
++}
+diff -r bd8afb90ebf2 Modules/_sqlite/util.h
+--- a/Modules/_sqlite/util.h
++++ b/Modules/_sqlite/util.h
+@@ -35,4 +35,8 @@
+  * Returns the error code (0 means no error occurred).
+  */
+ int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st);
++
++PyObject * _pysqlite_long_from_int64(sqlite3_int64 value);
++sqlite3_int64 _pysqlite_long_as_int64(PyObject * value);
++
+ #endif
+diff -r bd8afb90ebf2 Modules/_sre.c
+--- a/Modules/_sre.c
++++ b/Modules/_sre.c
+@@ -427,7 +427,7 @@
+             }
+             else {
+                 /* <CHARSET> <bitmap> (32 bits per code word) */
+-                if (ch < 256 && (set[ch >> 5] & (1 << (ch & 31))))
++                if (ch < 256 && (set[ch >> 5] & (1u << (ch & 31))))
+                     return ok;
+                 set += 8;
+             }
+@@ -466,7 +466,7 @@
+                     block = -1;
+                 set += 64;
+                 if (block >=0 &&
+-                    (set[block*8 + ((ch & 255)>>5)] & (1 << (ch & 31))))
++                    (set[block*8 + ((ch & 255)>>5)] & (1u << (ch & 31))))
+                     return ok;
+                 set += count*8;
+             }
+@@ -492,7 +492,7 @@
+     Py_ssize_t i;
+ 
+     /* adjust end */
+-    if (maxcount < end - ptr && maxcount != 65535)
++    if (maxcount < (end - ptr) / state->charsize && maxcount != SRE_MAXREPEAT)
+         end = ptr + maxcount*state->charsize;
+ 
+     switch (pattern[0]) {
+@@ -583,7 +583,7 @@
+     Py_ssize_t i;
+ 
+     /* check minimal length */
+-    if (pattern[3] && (end - ptr) < pattern[3])
++    if (pattern[3] && (end - ptr)/state->charsize < pattern[3])
+         return 0;
+ 
+     /* check known prefix */
+@@ -801,7 +801,7 @@
+         /* <INFO> <1=skip> <2=flags> <3=min> ... */
+         if (ctx->pattern[3] && (end - ctx->ptr)/state->charsize < ctx->pattern[3]) {
+             TRACE(("reject (got %d chars, need %d)\n",
+-                   (end - ctx->ptr), ctx->pattern[3]));
++                   (end - ctx->ptr)/state->charsize, ctx->pattern[3]));
+             RETURN_FAILURE;
+         }
+         ctx->pattern += ctx->pattern[1] + 1;
+@@ -1109,7 +1109,7 @@
+             } else {
+                 /* general case */
+                 LASTMARK_SAVE();
+-                while ((Py_ssize_t)ctx->pattern[2] == 65535
++                while ((Py_ssize_t)ctx->pattern[2] == SRE_MAXREPEAT
+                        || ctx->count <= (Py_ssize_t)ctx->pattern[2]) {
+                     state->ptr = ctx->ptr;
+                     DO_JUMP(JUMP_MIN_REPEAT_ONE,jump_min_repeat_one,
+@@ -1195,7 +1195,7 @@
+             }
+ 
+             if ((ctx->count < ctx->u.rep->pattern[2] ||
+-                ctx->u.rep->pattern[2] == 65535) &&
++                ctx->u.rep->pattern[2] == SRE_MAXREPEAT) &&
+                 state->ptr != ctx->u.rep->last_ptr) {
+                 /* we may have enough matches, but if we can
+                    match another item, do so */
+@@ -1272,13 +1272,18 @@
+ 
+             LASTMARK_RESTORE();
+ 
+-            if (ctx->count >= ctx->u.rep->pattern[2]
+-                && ctx->u.rep->pattern[2] != 65535)
++            if ((ctx->count >= ctx->u.rep->pattern[2]
++                && ctx->u.rep->pattern[2] != SRE_MAXREPEAT) ||
++                state->ptr == ctx->u.rep->last_ptr)
+                 RETURN_FAILURE;
+ 
+             ctx->u.rep->count = ctx->count;
++            /* zero-width match protection */
++            DATA_PUSH(&ctx->u.rep->last_ptr);
++            ctx->u.rep->last_ptr = state->ptr;
+             DO_JUMP(JUMP_MIN_UNTIL_3,jump_min_until_3,
+                     ctx->u.rep->pattern+3);
++            DATA_POP(&ctx->u.rep->last_ptr);
+             if (ret) {
+                 RETURN_ON_ERROR(ret);
+                 RETURN_SUCCESS;
+@@ -1329,9 +1334,10 @@
+                         RETURN_FAILURE;
+                     while (p < e) {
+                         if (ctx->ptr >= end ||
+-                            state->lower(SRE_CHARGET(state, ctx->ptr, 0)) != state->lower(*p))
++                            state->lower(SRE_CHARGET(state, ctx->ptr, 0)) !=
++                            state->lower(SRE_CHARGET(state, p, 0)))
+                             RETURN_FAILURE;
+-                        p++;
++                        p += state->charsize;
+                         ctx->ptr += state->charsize;
+                     }
+                 }
+@@ -1618,7 +1624,7 @@
+ static PyObject *
+ sre_codesize(PyObject* self, PyObject *unused)
+ {
+-    return Py_BuildValue("l", sizeof(SRE_CODE));
++    return PyLong_FromSize_t(sizeof(SRE_CODE));
+ }
+ 
+ static PyObject *
+@@ -2435,7 +2441,7 @@
+         return NULL;
+ 
+     if (subn)
+-        return Py_BuildValue("Ni", item, n);
++        return Py_BuildValue("Nn", item, n);
+ 
+     return item;
+ 
+@@ -2527,35 +2533,35 @@
+ }
+ 
+ PyDoc_STRVAR(pattern_match_doc,
+-"match(string[, pos[, endpos]]) --> match object or None.\n\
++"match(string[, pos[, endpos]]) -> match object or None.\n\
+     Matches zero or more characters at the beginning of the string");
+ 
+ PyDoc_STRVAR(pattern_search_doc,
+-"search(string[, pos[, endpos]]) --> match object or None.\n\
++"search(string[, pos[, endpos]]) -> match object or None.\n\
+     Scan through string looking for a match, and return a corresponding\n\
+-    MatchObject instance. Return None if no position in the string matches.");
++    match object instance. Return None if no position in the string matches.");
+ 
+ PyDoc_STRVAR(pattern_split_doc,
+-"split(string[, maxsplit = 0])  --> list.\n\
++"split(string[, maxsplit = 0])  -> list.\n\
+     Split string by the occurrences of pattern.");
+ 
+ PyDoc_STRVAR(pattern_findall_doc,
+-"findall(string[, pos[, endpos]]) --> list.\n\
++"findall(string[, pos[, endpos]]) -> list.\n\
+    Return a list of all non-overlapping matches of pattern in string.");
+ 
+ PyDoc_STRVAR(pattern_finditer_doc,
+-"finditer(string[, pos[, endpos]]) --> iterator.\n\
++"finditer(string[, pos[, endpos]]) -> iterator.\n\
+     Return an iterator over all non-overlapping matches for the \n\
+     RE pattern in string. For each match, the iterator returns a\n\
+     match object.");
+ 
+ PyDoc_STRVAR(pattern_sub_doc,
+-"sub(repl, string[, count = 0]) --> newstring\n\
++"sub(repl, string[, count = 0]) -> newstring.\n\
+     Return the string obtained by replacing the leftmost non-overlapping\n\
+     occurrences of pattern in string by the replacement repl.");
+ 
+ PyDoc_STRVAR(pattern_subn_doc,
+-"subn(repl, string[, count = 0]) --> (newstring, number of subs)\n\
++"subn(repl, string[, count = 0]) -> (newstring, number of subs)\n\
+     Return the tuple (new_string, number_of_subs_made) found by replacing\n\
+     the leftmost non-overlapping occurrences of pattern with the\n\
+     replacement repl.");
+@@ -3036,7 +3042,7 @@
+                 GET_ARG; max = arg;
+                 if (min > max)
+                     FAIL;
+-                if (max > 65535)
++                if (max > SRE_MAXREPEAT)
+                     FAIL;
+                 if (!_validate_inner(code, code+skip-4, groups))
+                     FAIL;
+@@ -3055,7 +3061,7 @@
+                 GET_ARG; max = arg;
+                 if (min > max)
+                     FAIL;
+-                if (max > 65535)
++                if (max > SRE_MAXREPEAT)
+                     FAIL;
+                 if (!_validate_inner(code, code+skip-3, groups))
+                     FAIL;
+@@ -3387,7 +3393,7 @@
+     }
+ 
+     /* mark is -1 if group is undefined */
+-    return Py_BuildValue("i", self->mark[index*2]);
++    return PyLong_FromSsize_t(self->mark[index*2]);
+ }
+ 
+ static PyObject*
+@@ -3410,7 +3416,7 @@
+     }
+ 
+     /* mark is -1 if group is undefined */
+-    return Py_BuildValue("i", self->mark[index*2+1]);
++    return PyLong_FromSsize_t(self->mark[index*2+1]);
+ }
+ 
+ LOCAL(PyObject*)
+@@ -3543,14 +3549,54 @@
+ #endif
+ }
+ 
++PyDoc_STRVAR(match_doc,
++"The result of re.match() and re.search().\n\
++Match objects always have a boolean value of True.");
++
++PyDoc_STRVAR(match_group_doc,
++"group([group1, ...]) -> str or tuple.\n\
++    Return subgroup(s) of the match by indices or names.\n\
++    For 0 returns the entire match.");
++
++PyDoc_STRVAR(match_start_doc,
++"start([group=0]) -> int.\n\
++    Return index of the start of the substring matched by group.");
++
++PyDoc_STRVAR(match_end_doc,
++"end([group=0]) -> int.\n\
++    Return index of the end of the substring matched by group.");
++
++PyDoc_STRVAR(match_span_doc,
++"span([group]) -> tuple.\n\
++    For MatchObject m, return the 2-tuple (m.start(group), m.end(group)).");
++
++PyDoc_STRVAR(match_groups_doc,
++"groups([default=None]) -> tuple.\n\
++    Return a tuple containing all the subgroups of the match, from 1.\n\
++    The default argument is used for groups\n\
++    that did not participate in the match");
++
++PyDoc_STRVAR(match_groupdict_doc,
++"groupdict([default=None]) -> dict.\n\
++    Return a dictionary containing all the named subgroups of the match,\n\
++    keyed by the subgroup name. The default argument is used for groups\n\
++    that did not participate in the match");
++
++PyDoc_STRVAR(match_expand_doc,
++"expand(template) -> str.\n\
++    Return the string obtained by doing backslash substitution\n\
++    on the string template, as done by the sub() method.");
++
+ static PyMethodDef match_methods[] = {
+-    {"group", (PyCFunction) match_group, METH_VARARGS},
+-    {"start", (PyCFunction) match_start, METH_VARARGS},
+-    {"end", (PyCFunction) match_end, METH_VARARGS},
+-    {"span", (PyCFunction) match_span, METH_VARARGS},
+-    {"groups", (PyCFunction) match_groups, METH_VARARGS|METH_KEYWORDS},
+-    {"groupdict", (PyCFunction) match_groupdict, METH_VARARGS|METH_KEYWORDS},
+-    {"expand", (PyCFunction) match_expand, METH_O},
++    {"group", (PyCFunction) match_group, METH_VARARGS, match_group_doc},
++    {"start", (PyCFunction) match_start, METH_VARARGS, match_start_doc},
++    {"end", (PyCFunction) match_end, METH_VARARGS, match_end_doc},
++    {"span", (PyCFunction) match_span, METH_VARARGS, match_span_doc},
++    {"groups", (PyCFunction) match_groups, METH_VARARGS|METH_KEYWORDS,
++        match_groups_doc},
++    {"groupdict", (PyCFunction) match_groupdict, METH_VARARGS|METH_KEYWORDS,
++        match_groupdict_doc},
++    {"expand", (PyCFunction) match_expand, METH_O, match_expand_doc},
+     {"__copy__", (PyCFunction) match_copy, METH_NOARGS},
+     {"__deepcopy__", (PyCFunction) match_deepcopy, METH_O},
+     {NULL, NULL}
+@@ -3560,7 +3606,7 @@
+ match_lastindex_get(MatchObject *self)
+ {
+     if (self->lastindex >= 0)
+-        return Py_BuildValue("i", self->lastindex);
++        return PyLong_FromSsize_t(self->lastindex);
+     Py_INCREF(Py_None);
+     return Py_None;
+ }
+@@ -3629,7 +3675,7 @@
+     0,                          /* tp_setattro */
+     0,                          /* tp_as_buffer */
+     Py_TPFLAGS_DEFAULT,         /* tp_flags */
+-    0,                          /* tp_doc */
++    match_doc,                  /* tp_doc */
+     0,                          /* tp_traverse */
+     0,                          /* tp_clear */
+     0,                          /* tp_richcompare */
+@@ -3901,6 +3947,12 @@
+         Py_DECREF(x);
+     }
+ 
++    x = PyLong_FromUnsignedLong(SRE_MAXREPEAT);
++    if (x) {
++        PyDict_SetItemString(d, "MAXREPEAT", x);
++        Py_DECREF(x);
++    }
++
+     x = PyUnicode_FromString(copyright);
+     if (x) {
+         PyDict_SetItemString(d, "copyright", x);
+diff -r bd8afb90ebf2 Modules/_ssl.c
+--- a/Modules/_ssl.c
++++ b/Modules/_ssl.c
+@@ -2177,6 +2177,7 @@
+     errno = 0;
+     PySSL_BEGIN_ALLOW_THREADS
+     dh = PEM_read_DHparams(f, NULL, NULL, NULL);
++    fclose(f);
+     PySSL_END_ALLOW_THREADS
+     if (dh == NULL) {
+         if (errno != 0) {
+@@ -2488,7 +2489,7 @@
+     PyObject *path;
+     int bytes;
+ 
+-    if (!PyArg_ParseTuple(args, "O&|i:RAND_egd",
++    if (!PyArg_ParseTuple(args, "O&:RAND_egd",
+                           PyUnicode_FSConverter, &path))
+         return NULL;
+ 
+diff -r bd8afb90ebf2 Modules/_struct.c
+--- a/Modules/_struct.c
++++ b/Modules/_struct.c
+@@ -1271,7 +1271,7 @@
+     size = 0;
+     len = 0;
+     while ((c = *s++) != '\0') {
+-        if (isspace(Py_CHARMASK(c)))
++        if (Py_ISSPACE(Py_CHARMASK(c)))
+             continue;
+         if ('0' <= c && c <= '9') {
+             num = c - '0';
+@@ -1336,7 +1336,7 @@
+     s = fmt;
+     size = 0;
+     while ((c = *s++) != '\0') {
+-        if (isspace(Py_CHARMASK(c)))
++        if (Py_ISSPACE(Py_CHARMASK(c)))
+             continue;
+         if ('0' <= c && c <= '9') {
+             num = c - '0';
+@@ -1662,7 +1662,7 @@
+     if (PyTuple_GET_SIZE(args) != soself->s_len)
+     {
+         PyErr_Format(StructError,
+-            "pack requires exactly %zd arguments", soself->s_len);
++            "pack expected %zd items for packing (got %zd)", soself->s_len, PyTuple_GET_SIZE(args));
+         return NULL;
+     }
+ 
+@@ -1701,9 +1701,19 @@
+     assert(soself->s_codes != NULL);
+     if (PyTuple_GET_SIZE(args) != (soself->s_len + 2))
+     {
+-        PyErr_Format(StructError,
+-                     "pack_into requires exactly %zd arguments",
+-                     (soself->s_len + 2));
++        if (PyTuple_GET_SIZE(args) == 0) {
++            PyErr_Format(StructError,
++                        "pack_into expected buffer argument");
++        }
++        else if (PyTuple_GET_SIZE(args) == 1) {
++            PyErr_Format(StructError,
++                        "pack_into expected offset argument");
++        }
++        else {
++            PyErr_Format(StructError,
++                        "pack_into expected %zd items for packing (got %zd)",
++                        soself->s_len, (PyTuple_GET_SIZE(args) - 2));
++        }
+         return NULL;
+     }
+ 
+diff -r bd8afb90ebf2 Modules/_testbuffer.c
+--- a/Modules/_testbuffer.c
++++ b/Modules/_testbuffer.c
+@@ -16,6 +16,7 @@
+ static const char *simple_fmt = "B";
+ PyObject *simple_format = NULL;
+ #define SIMPLE_FORMAT(fmt) (fmt == NULL || strcmp(fmt, "B") == 0)
++#define FIX_FORMAT(fmt) (fmt == NULL ? "B" : fmt)
+ 
+ 
+ /**************************************************************************/
+@@ -513,10 +514,8 @@
+ cmp_structure(Py_buffer *dest, Py_buffer *src)
+ {
+     Py_ssize_t i;
+-    int same_fmt = ((dest->format == NULL && src->format == NULL) || \
+-                    (strcmp(dest->format, src->format) == 0));
+-
+-    if (!same_fmt ||
++
++    if (strcmp(FIX_FORMAT(dest->format), FIX_FORMAT(src->format)) != 0 ||
+         dest->itemsize != src->itemsize ||
+         dest->ndim != src->ndim)
+         return -1;
+diff -r bd8afb90ebf2 Modules/_testcapimodule.c
+--- a/Modules/_testcapimodule.c
++++ b/Modules/_testcapimodule.c
+@@ -1238,7 +1238,7 @@
+         o = PySequence_Fast_GET_ITEM(sub_keywords, i);
+         if (!PyUnicode_FSConverter(o, (void *)(converted + i))) {
+             PyErr_Format(PyExc_ValueError,
+-                "parse_tuple_and_keywords: could not convert keywords[%s] to narrow string", i);
++                "parse_tuple_and_keywords: could not convert keywords[%zd] to narrow string", i);
+             goto exit;
+         }
+         keywords[i] = PyBytes_AS_STRING(converted[i]);
+@@ -1521,6 +1521,29 @@
+ }
+ 
+ static PyObject *
++unicode_legacy_string(PyObject *self, PyObject *args)
++{
++    Py_UNICODE *data;
++    Py_ssize_t len;
++    PyObject *u;
++
++    if (!PyArg_ParseTuple(args, "u#", &data, &len))
++        return NULL;
++
++    u = PyUnicode_FromUnicode(NULL, len);
++    if (u == NULL)
++        return NULL;
++
++    memcpy(PyUnicode_AS_UNICODE(u), data, len * sizeof(Py_UNICODE));
++
++    if (len > 0) { /* The empty string is always ready. */
++        assert(!PyUnicode_IS_READY(u));
++    }
++
++    return u;
++}
++
++static PyObject *
+ getargs_w_star(PyObject *self, PyObject *args)
+ {
+     Py_buffer buffer;
+@@ -2506,6 +2529,7 @@
+     {"unicode_aswidecharstring",unicode_aswidecharstring,        METH_VARARGS},
+     {"unicode_encodedecimal",   unicode_encodedecimal,           METH_VARARGS},
+     {"unicode_transformdecimaltoascii", unicode_transformdecimaltoascii, METH_VARARGS},
++    {"unicode_legacy_string",   unicode_legacy_string,           METH_VARARGS},
+ #ifdef WITH_THREAD
+     {"_test_thread_state",      test_thread_state,               METH_VARARGS},
+     {"_pending_threadfunc",     pending_threadfunc,              METH_VARARGS},
+diff -r bd8afb90ebf2 Modules/_threadmodule.c
+--- a/Modules/_threadmodule.c
++++ b/Modules/_threadmodule.c
+@@ -145,12 +145,12 @@
+ }
+ 
+ PyDoc_STRVAR(acquire_doc,
+-"acquire([wait]) -> None or bool\n\
++"acquire([wait]) -> bool\n\
+ (acquire_lock() is an obsolete synonym)\n\
+ \n\
+ Lock the lock.  Without argument, this blocks if the lock is already\n\
+ locked (even by the same thread), waiting for another thread to release\n\
+-the lock, and return None once the lock is acquired.\n\
++the lock, and return True once the lock is acquired.\n\
+ With an argument, this will only block if the argument is true,\n\
+ and the return value reflects whether the lock is acquired.\n\
+ The blocking operation is interruptible.");
+diff -r bd8afb90ebf2 Modules/_tkinter.c
+--- a/Modules/_tkinter.c
++++ b/Modules/_tkinter.c
+@@ -990,7 +990,7 @@
+ #if TCL_UTF_MAX == 3
+             if (ch >= 0x10000) {
+                 /* Tcl doesn't do UTF-16, yet. */
+-                PyErr_Format(PyExc_ValueError,
++                PyErr_Format(Tkinter_TclError,
+                              "character U+%x is above the range "
+                              "(U+0000-U+FFFF) allowed by Tcl",
+                              ch);
+diff -r bd8afb90ebf2 Modules/arraymodule.c
+--- a/Modules/arraymodule.c
++++ b/Modules/arraymodule.c
+@@ -483,11 +483,11 @@
+         return NULL;
+     }
+ 
+-    nbytes = size * descr->itemsize;
+     /* Check for overflow */
+-    if (nbytes / descr->itemsize != (size_t)size) {
++    if (size > PY_SSIZE_T_MAX / descr->itemsize) {
+         return PyErr_NoMemory();
+     }
++    nbytes = size * descr->itemsize;
+     op = (arrayobject *) type->tp_alloc(type, 0);
+     if (op == NULL) {
+         return NULL;
+@@ -1251,11 +1251,15 @@
+     if (!PyArg_ParseTuple(args, "On:fromfile", &f, &n))
+         return NULL;
+ 
+-    nbytes = n * itemsize;
+-    if (nbytes < 0 || nbytes/itemsize != n) {
++    if (n < 0) {
++        PyErr_SetString(PyExc_ValueError, "negative count");
++        return NULL;
++    }
++    if (n > PY_SSIZE_T_MAX / itemsize) {
+         PyErr_NoMemory();
+         return NULL;
+     }
++    nbytes = n * itemsize;
+ 
+     b = _PyObject_CallMethodId(f, &PyId_read, "n", nbytes);
+     if (b == NULL)
+@@ -1518,7 +1522,7 @@
+     if (!PyArg_ParseTuple(args, "u#:fromunicode", &ustr, &n))
+         return NULL;
+     typecode = self->ob_descr->typecode;
+-    if ((typecode != 'u')) {
++    if (typecode != 'u') {
+         PyErr_SetString(PyExc_ValueError,
+             "fromunicode() may only be called on "
+             "unicode type arrays");
+@@ -1550,7 +1554,7 @@
+ {
+     char typecode;
+     typecode = self->ob_descr->typecode;
+-    if ((typecode != 'u')) {
++    if (typecode != 'u') {
+         PyErr_SetString(PyExc_ValueError,
+              "tounicode() may only be called on unicode type arrays");
+         return NULL;
+@@ -2110,7 +2114,7 @@
+ static PyMethodDef array_methods[] = {
+     {"append",          (PyCFunction)array_append,      METH_O,
+      append_doc},
+-    {"buffer_info", (PyCFunction)array_buffer_info, METH_NOARGS,
++    {"buffer_info",     (PyCFunction)array_buffer_info, METH_NOARGS,
+      buffer_info_doc},
+     {"byteswap",        (PyCFunction)array_byteswap,    METH_NOARGS,
+      byteswap_doc},
+@@ -2118,9 +2122,9 @@
+      copy_doc},
+     {"count",           (PyCFunction)array_count,       METH_O,
+      count_doc},
+-    {"__deepcopy__",(PyCFunction)array_copy,            METH_O,
++    {"__deepcopy__",    (PyCFunction)array_copy,        METH_O,
+      copy_doc},
+-    {"extend",      (PyCFunction)array_extend,          METH_O,
++    {"extend",          (PyCFunction)array_extend,      METH_O,
+      extend_doc},
+     {"fromfile",        (PyCFunction)array_fromfile,    METH_VARARGS,
+      fromfile_doc},
+@@ -2138,14 +2142,12 @@
+      insert_doc},
+     {"pop",             (PyCFunction)array_pop,         METH_VARARGS,
+      pop_doc},
+-    {"__reduce_ex__", (PyCFunction)array_reduce_ex,     METH_O,
++    {"__reduce_ex__",   (PyCFunction)array_reduce_ex,   METH_O,
+      reduce_doc},
+     {"remove",          (PyCFunction)array_remove,      METH_O,
+      remove_doc},
+     {"reverse",         (PyCFunction)array_reverse,     METH_NOARGS,
+      reverse_doc},
+-/*      {"sort",        (PyCFunction)array_sort,        METH_VARARGS,
+-    sort_doc},*/
+     {"tofile",          (PyCFunction)array_tofile,      METH_O,
+      tofile_doc},
+     {"tolist",          (PyCFunction)array_tolist,      METH_NOARGS,
+@@ -2154,7 +2156,7 @@
+      tostring_doc},
+     {"tobytes",         (PyCFunction)array_tobytes,     METH_NOARGS,
+      tobytes_doc},
+-    {"tounicode",   (PyCFunction)array_tounicode,       METH_NOARGS,
++    {"tounicode",       (PyCFunction)array_tounicode,   METH_NOARGS,
+      tounicode_doc},
+     {"__sizeof__",      (PyCFunction)array_sizeof,      METH_NOARGS,
+      sizeof_doc},
+@@ -2173,10 +2175,11 @@
+     if (len == 0) {
+         return PyUnicode_FromFormat("array('%c')", (int)typecode);
+     }
+-    if (typecode == 'u')
++    if (typecode == 'u') {
+         v = array_tounicode(a, NULL);
+-    else
++    } else {
+         v = array_tolist(a, NULL);
++    }
+ 
+     s = PyUnicode_FromFormat("array('%c', %R)", (int)typecode, v);
+     Py_DECREF(v);
+diff -r bd8afb90ebf2 Modules/audioop.c
+--- a/Modules/audioop.c
++++ b/Modules/audioop.c
+@@ -26,6 +26,21 @@
+ #endif
+ #endif
+ 
++static const int maxvals[] = {0, 0x7F, 0x7FFF, 0x7FFFFF, 0x7FFFFFFF};
++static const int minvals[] = {0, -0x80, -0x8000, -0x800000, -0x80000000};
++static const unsigned int masks[] = {0, 0xFF, 0xFFFF, 0xFFFFFF, 0xFFFFFFFF};
++
++static int
++fbound(double val, double minval, double maxval)
++{
++    if (val > maxval)
++        val = maxval;
++    else if (val < minval + 1)
++        val = minval;
++    return val;
++}
++
++
+ /* Code shamelessly stolen from sox, 12.17.7, g711.c
+ ** (c) Craig Reese, Joe Campbell and Jeff Poskanzer 1989 */
+ 
+@@ -347,7 +362,7 @@
+     signed char *cp;
+     Py_ssize_t len, i;
+     int size, val = 0;
+-    int max = 0;
++    unsigned int absval, max = 0;
+ 
+     if ( !PyArg_ParseTuple(args, "s#i:max", &cp, &len, &size) )
+         return 0;
+@@ -357,10 +372,11 @@
+         if ( size == 1 )      val = (int)*CHARP(cp, i);
+         else if ( size == 2 ) val = (int)*SHORTP(cp, i);
+         else if ( size == 4 ) val = (int)*LONGP(cp, i);
+-        if ( val < 0 ) val = (-val);
+-        if ( val > max ) max = val;
++        if (val < 0) absval = (-val);
++        else absval = val;
++        if (absval > max) max = absval;
+     }
+-    return PyLong_FromLong(max);
++    return PyLong_FromUnsignedLong(max);
+ }
+ 
+ static PyObject *
+@@ -369,7 +385,7 @@
+     signed char *cp;
+     Py_ssize_t len, i;
+     int size, val = 0;
+-    int min = 0x7fffffff, max = -0x7fffffff;
++    int min = 0x7fffffff, max = -0x80000000;
+ 
+     if (!PyArg_ParseTuple(args, "s#i:minmax", &cp, &len, &size))
+         return NULL;
+@@ -406,7 +422,7 @@
+     if ( len == 0 )
+         val = 0;
+     else
+-        val = (int)(avg / (double)(len/size));
++        val = (int)floor(avg / (double)(len/size));
+     return PyLong_FromLong(val);
+ }
+ 
+@@ -416,6 +432,7 @@
+     signed char *cp;
+     Py_ssize_t len, i;
+     int size, val = 0;
++    unsigned int res;
+     double sum_squares = 0.0;
+ 
+     if ( !PyArg_ParseTuple(args, "s#i:rms", &cp, &len, &size) )
+@@ -429,10 +446,10 @@
+         sum_squares += (double)val*(double)val;
+     }
+     if ( len == 0 )
+-        val = 0;
++        res = 0;
+     else
+-        val = (int)sqrt(sum_squares / (double)(len/size));
+-    return PyLong_FromLong(val);
++        res = (unsigned int)sqrt(sum_squares / (double)(len/size));
++    return PyLong_FromUnsignedLong(res);
+ }
+ 
+ static double _sum2(short *a, short *b, Py_ssize_t len)
+@@ -622,52 +639,46 @@
+     Py_ssize_t len, i;
+     int size, val = 0, prevval = 0, prevextremevalid = 0,
+         prevextreme = 0;
+-    double avg = 0.0;
+-    int diff, prevdiff, extremediff, nextreme = 0;
++    double sum = 0.0;
++    unsigned int avg;
++    int diff, prevdiff, nextreme = 0;
+ 
+     if ( !PyArg_ParseTuple(args, "s#i:avgpp", &cp, &len, &size) )
+         return 0;
+     if (!audioop_check_parameters(len, size))
+         return NULL;
+-    /* Compute first delta value ahead. Also automatically makes us
+-    ** skip the first extreme value
+-    */
++    if (len <= size)
++        return PyLong_FromLong(0);
+     if ( size == 1 )      prevval = (int)*CHARP(cp, 0);
+     else if ( size == 2 ) prevval = (int)*SHORTP(cp, 0);
+     else if ( size == 4 ) prevval = (int)*LONGP(cp, 0);
+-    if ( size == 1 )      val = (int)*CHARP(cp, size);
+-    else if ( size == 2 ) val = (int)*SHORTP(cp, size);
+-    else if ( size == 4 ) val = (int)*LONGP(cp, size);
+-    prevdiff = val - prevval;
+-
++    prevdiff = 17; /* Anything != 0, 1 */
+     for ( i=size; i<len; i+= size) {
+         if ( size == 1 )      val = (int)*CHARP(cp, i);
+         else if ( size == 2 ) val = (int)*SHORTP(cp, i);
+         else if ( size == 4 ) val = (int)*LONGP(cp, i);
+-        diff = val - prevval;
+-        if ( diff*prevdiff < 0 ) {
+-            /* Derivative changed sign. Compute difference to last
+-            ** extreme value and remember.
+-            */
+-            if ( prevextremevalid ) {
+-                extremediff = prevval - prevextreme;
+-                if ( extremediff < 0 )
+-                    extremediff = -extremediff;
+-                avg += extremediff;
+-                nextreme++;
++        if (val != prevval) {
++            diff = val < prevval;
++            if (prevdiff == !diff) {
++                /* Derivative changed sign. Compute difference to last
++                ** extreme value and remember.
++                */
++                if (prevextremevalid) {
++                    sum += fabs((double)prevval - (double)prevextreme);
++                    nextreme++;
++                }
++                prevextremevalid = 1;
++                prevextreme = prevval;
+             }
+-            prevextremevalid = 1;
+-            prevextreme = prevval;
++            prevval = val;
++            prevdiff = diff;
+         }
+-        prevval = val;
+-        if ( diff != 0 )
+-            prevdiff = diff;
+     }
+     if ( nextreme == 0 )
+-        val = 0;
++        avg = 0;
+     else
+-        val = (int)(avg / (double)nextreme);
+-    return PyLong_FromLong(val);
++        avg = (unsigned int)(sum / (double)nextreme);
++    return PyLong_FromUnsignedLong(avg);
+ }
+ 
+ static PyObject *
+@@ -677,48 +688,47 @@
+     Py_ssize_t len, i;
+     int size, val = 0, prevval = 0, prevextremevalid = 0,
+         prevextreme = 0;
+-    int max = 0;
+-    int diff, prevdiff, extremediff;
++    unsigned int max = 0, extremediff;
++    int diff, prevdiff;
+ 
+     if ( !PyArg_ParseTuple(args, "s#i:maxpp", &cp, &len, &size) )
+         return 0;
+     if (!audioop_check_parameters(len, size))
+         return NULL;
+-    /* Compute first delta value ahead. Also automatically makes us
+-    ** skip the first extreme value
+-    */
++    if (len <= size)
++        return PyLong_FromLong(0);
+     if ( size == 1 )      prevval = (int)*CHARP(cp, 0);
+     else if ( size == 2 ) prevval = (int)*SHORTP(cp, 0);
+     else if ( size == 4 ) prevval = (int)*LONGP(cp, 0);
+-    if ( size == 1 )      val = (int)*CHARP(cp, size);
+-    else if ( size == 2 ) val = (int)*SHORTP(cp, size);
+-    else if ( size == 4 ) val = (int)*LONGP(cp, size);
+-    prevdiff = val - prevval;
+-
++    prevdiff = 17; /* Anything != 0, 1 */
+     for ( i=size; i<len; i+= size) {
+         if ( size == 1 )      val = (int)*CHARP(cp, i);
+         else if ( size == 2 ) val = (int)*SHORTP(cp, i);
+         else if ( size == 4 ) val = (int)*LONGP(cp, i);
+-        diff = val - prevval;
+-        if ( diff*prevdiff < 0 ) {
+-            /* Derivative changed sign. Compute difference to
+-            ** last extreme value and remember.
+-            */
+-            if ( prevextremevalid ) {
+-                extremediff = prevval - prevextreme;
+-                if ( extremediff < 0 )
+-                    extremediff = -extremediff;
+-                if ( extremediff > max )
+-                    max = extremediff;
++        if (val != prevval) {
++            diff = val < prevval;
++            if (prevdiff == !diff) {
++                /* Derivative changed sign. Compute difference to
++                ** last extreme value and remember.
++                */
++                if (prevextremevalid) {
++                    if (prevval < prevextreme)
++                        extremediff = (unsigned int)prevextreme -
++                                      (unsigned int)prevval;
++                    else
++                        extremediff = (unsigned int)prevval -
++                                      (unsigned int)prevextreme;
++                    if ( extremediff > max )
++                        max = extremediff;
++                }
++                prevextremevalid = 1;
++                prevextreme = prevval;
+             }
+-            prevextremevalid = 1;
+-            prevextreme = prevval;
++            prevval = val;
++            prevdiff = diff;
+         }
+-        prevval = val;
+-        if ( diff != 0 )
+-            prevdiff = diff;
+     }
+-    return PyLong_FromLong(max);
++    return PyLong_FromUnsignedLong(max);
+ }
+ 
+ static PyObject *
+@@ -753,7 +763,7 @@
+     signed char *cp, *ncp;
+     Py_ssize_t len, i;
+     int size, val = 0;
+-    double factor, fval, maxval;
++    double factor, fval, maxval, minval;
+     PyObject *rv;
+ 
+     if ( !PyArg_ParseTuple(args, "s#id:mul", &cp, &len, &size, &factor ) )
+@@ -761,13 +771,8 @@
+     if (!audioop_check_parameters(len, size))
+         return NULL;
+ 
+-    if ( size == 1 ) maxval = (double) 0x7f;
+-    else if ( size == 2 ) maxval = (double) 0x7fff;
+-    else if ( size == 4 ) maxval = (double) 0x7fffffff;
+-    else {
+-        PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+-        return 0;
+-    }
++    maxval = (double) maxvals[size];
++    minval = (double) minvals[size];
+ 
+     rv = PyBytes_FromStringAndSize(NULL, len);
+     if ( rv == 0 )
+@@ -780,9 +785,7 @@
+         else if ( size == 2 ) val = (int)*SHORTP(cp, i);
+         else if ( size == 4 ) val = (int)*LONGP(cp, i);
+         fval = (double)val*factor;
+-        if ( fval > maxval ) fval = maxval;
+-        else if ( fval < -maxval ) fval = -maxval;
+-        val = (int)fval;
++        val = (int)floor(fbound(fval, minval, maxval));
+         if ( size == 1 )      *CHARP(ncp, i) = (signed char)val;
+         else if ( size == 2 ) *SHORTP(ncp, i) = (short)val;
+         else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)val;
+@@ -797,7 +800,7 @@
+     signed char *cp, *ncp;
+     Py_ssize_t len, i;
+     int size, val1 = 0, val2 = 0;
+-    double fac1, fac2, fval, maxval;
++    double fac1, fac2, fval, maxval, minval;
+     PyObject *rv;
+ 
+     if ( !PyArg_ParseTuple(args, "s*idd:tomono",
+@@ -815,14 +818,8 @@
+         return NULL;
+     }
+ 
+-    if ( size == 1 ) maxval = (double) 0x7f;
+-    else if ( size == 2 ) maxval = (double) 0x7fff;
+-    else if ( size == 4 ) maxval = (double) 0x7fffffff;
+-    else {
+-        PyBuffer_Release(&pcp);
+-        PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+-        return 0;
+-    }
++    maxval = (double) maxvals[size];
++    minval = (double) minvals[size];
+ 
+     rv = PyBytes_FromStringAndSize(NULL, len/2);
+     if ( rv == 0 ) {
+@@ -840,9 +837,7 @@
+         else if ( size == 2 ) val2 = (int)*SHORTP(cp, i+2);
+         else if ( size == 4 ) val2 = (int)*LONGP(cp, i+4);
+         fval = (double)val1*fac1 + (double)val2*fac2;
+-        if ( fval > maxval ) fval = maxval;
+-        else if ( fval < -maxval ) fval = -maxval;
+-        val1 = (int)fval;
++        val1 = (int)floor(fbound(fval, minval, maxval));
+         if ( size == 1 )      *CHARP(ncp, i/2) = (signed char)val1;
+         else if ( size == 2 ) *SHORTP(ncp, i/2) = (short)val1;
+         else if ( size == 4 ) *LONGP(ncp, i/2)= (Py_Int32)val1;
+@@ -857,7 +852,7 @@
+     signed char *cp, *ncp;
+     Py_ssize_t len, i;
+     int size, val1, val2, val = 0;
+-    double fac1, fac2, fval, maxval;
++    double fac1, fac2, fval, maxval, minval;
+     PyObject *rv;
+ 
+     if ( !PyArg_ParseTuple(args, "s#idd:tostereo",
+@@ -866,13 +861,8 @@
+     if (!audioop_check_parameters(len, size))
+         return NULL;
+ 
+-    if ( size == 1 ) maxval = (double) 0x7f;
+-    else if ( size == 2 ) maxval = (double) 0x7fff;
+-    else if ( size == 4 ) maxval = (double) 0x7fffffff;
+-    else {
+-        PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+-        return 0;
+-    }
++    maxval = (double) maxvals[size];
++    minval = (double) minvals[size];
+ 
+     if (len > PY_SSIZE_T_MAX/2) {
+         PyErr_SetString(PyExc_MemoryError,
+@@ -892,14 +882,10 @@
+         else if ( size == 4 ) val = (int)*LONGP(cp, i);
+ 
+         fval = (double)val*fac1;
+-        if ( fval > maxval ) fval = maxval;
+-        else if ( fval < -maxval ) fval = -maxval;
+-        val1 = (int)fval;
++        val1 = (int)floor(fbound(fval, minval, maxval));
+ 
+         fval = (double)val*fac2;
+-        if ( fval > maxval ) fval = maxval;
+-        else if ( fval < -maxval ) fval = -maxval;
+-        val2 = (int)fval;
++        val2 = (int)floor(fbound(fval, minval, maxval));
+ 
+         if ( size == 1 )      *CHARP(ncp, i*2) = (signed char)val1;
+         else if ( size == 2 ) *SHORTP(ncp, i*2) = (short)val1;
+@@ -917,7 +903,7 @@
+ {
+     signed char *cp1, *cp2, *ncp;
+     Py_ssize_t len1, len2, i;
+-    int size, val1 = 0, val2 = 0, maxval, newval;
++    int size, val1 = 0, val2 = 0, minval, maxval, newval;
+     PyObject *rv;
+ 
+     if ( !PyArg_ParseTuple(args, "s#s#i:add",
+@@ -930,13 +916,8 @@
+         return 0;
+     }
+ 
+-    if ( size == 1 ) maxval = 0x7f;
+-    else if ( size == 2 ) maxval = 0x7fff;
+-    else if ( size == 4 ) maxval = 0x7fffffff;
+-    else {
+-        PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+-        return 0;
+-    }
++    maxval = maxvals[size];
++    minval = minvals[size];
+ 
+     rv = PyBytes_FromStringAndSize(NULL, len1);
+     if ( rv == 0 )
+@@ -952,12 +933,19 @@
+         else if ( size == 2 ) val2 = (int)*SHORTP(cp2, i);
+         else if ( size == 4 ) val2 = (int)*LONGP(cp2, i);
+ 
+-        newval = val1 + val2;
+-        /* truncate in case of overflow */
+-        if (newval > maxval) newval = maxval;
+-        else if (newval < -maxval) newval = -maxval;
+-        else if (size == 4 && (newval^val1) < 0 && (newval^val2) < 0)
+-            newval = val1 > 0 ? maxval : - maxval;
++        if (size < 4) {
++            newval = val1 + val2;
++            /* truncate in case of overflow */
++            if (newval > maxval)
++                newval = maxval;
++            else if (newval < minval)
++                newval = minval;
++        }
++        else {
++            double fval = (double)val1 + (double)val2;
++            /* truncate in case of overflow */
++            newval = (int)floor(fbound(fval, minval, maxval));
++        }
+ 
+         if ( size == 1 )      *CHARP(ncp, i) = (signed char)newval;
+         else if ( size == 2 ) *SHORTP(ncp, i) = (short)newval;
+@@ -971,9 +959,9 @@
+ {
+     signed char *cp, *ncp;
+     Py_ssize_t len, i;
+-    int size, val = 0;
++    int size, bias;
++    unsigned int val = 0, mask;
+     PyObject *rv;
+-    int bias;
+ 
+     if ( !PyArg_ParseTuple(args, "s#ii:bias",
+                       &cp, &len, &size , &bias) )
+@@ -987,15 +975,20 @@
+         return 0;
+     ncp = (signed char *)PyBytes_AsString(rv);
+ 
++    mask = masks[size];
+ 
+     for ( i=0; i < len; i += size ) {
+-        if ( size == 1 )      val = (int)*CHARP(cp, i);
+-        else if ( size == 2 ) val = (int)*SHORTP(cp, i);
+-        else if ( size == 4 ) val = (int)*LONGP(cp, i);
++        if ( size == 1 )      val = (unsigned int)(unsigned char)*CHARP(cp, i);
++        else if ( size == 2 ) val = (unsigned int)(unsigned short)*SHORTP(cp, i);
++        else if ( size == 4 ) val = (unsigned int)(Py_UInt32)*LONGP(cp, i);
+ 
+-        if ( size == 1 )      *CHARP(ncp, i) = (signed char)(val+bias);
+-        else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val+bias);
+-        else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val+bias);
++        val += (unsigned int)bias;
++        /* wrap around in case of overflow */
++        val &= mask;
++
++        if ( size == 1 )      *CHARP(ncp, i) = (signed char)(unsigned char)val;
++        else if ( size == 2 ) *SHORTP(ncp, i) = (short)(unsigned short)val;
++        else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(Py_UInt32)val;
+     }
+     return rv;
+ }
+@@ -1022,15 +1015,15 @@
+     ncp = (unsigned char *)PyBytes_AsString(rv);
+ 
+     for ( i=0; i < len; i += size ) {
+-        if ( size == 1 )      val = ((int)*CHARP(cp, i)) << 8;
+-        else if ( size == 2 ) val = (int)*SHORTP(cp, i);
+-        else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16;
++        if ( size == 1 )      val = ((int)*CHARP(cp, i)) << 24;
++        else if ( size == 2 ) val = ((int)*SHORTP(cp, i)) << 16;
++        else if ( size == 4 ) val = (int)*LONGP(cp, i);
+ 
+         j = len - i - size;
+ 
+-        if ( size == 1 )      *CHARP(ncp, j) = (signed char)(val >> 8);
+-        else if ( size == 2 ) *SHORTP(ncp, j) = (short)(val);
+-        else if ( size == 4 ) *LONGP(ncp, j) = (Py_Int32)(val<<16);
++        if ( size == 1 )      *CHARP(ncp, j) = (signed char)(val >> 24);
++        else if ( size == 2 ) *SHORTP(ncp, j) = (short)(val >> 16);
++        else if ( size == 4 ) *LONGP(ncp, j) = (Py_Int32)val;
+     }
+     return rv;
+ }
+@@ -1064,13 +1057,13 @@
+     ncp = (unsigned char *)PyBytes_AsString(rv);
+ 
+     for ( i=0, j=0; i < len; i += size, j += size2 ) {
+-        if ( size == 1 )      val = ((int)*CHARP(cp, i)) << 8;
+-        else if ( size == 2 ) val = (int)*SHORTP(cp, i);
+-        else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16;
++        if ( size == 1 )      val = ((int)*CHARP(cp, i)) << 24;
++        else if ( size == 2 ) val = ((int)*SHORTP(cp, i)) << 16;
++        else if ( size == 4 ) val = (int)*LONGP(cp, i);
+ 
+-        if ( size2 == 1 )  *CHARP(ncp, j) = (signed char)(val >> 8);
+-        else if ( size2 == 2 ) *SHORTP(ncp, j) = (short)(val);
+-        else if ( size2 == 4 ) *LONGP(ncp, j) = (Py_Int32)(val<<16);
++        if ( size2 == 1 )  *CHARP(ncp, j) = (signed char)(val >> 24);
++        else if ( size2 == 2 ) *SHORTP(ncp, j) = (short)(val >> 16);
++        else if ( size2 == 4 ) *LONGP(ncp, j) = (Py_Int32)val;
+     }
+     return rv;
+ }
+@@ -1108,8 +1101,7 @@
+         PyErr_SetString(AudioopError, "# of channels should be >= 1");
+         return NULL;
+     }
+-    bytes_per_frame = size * nchannels;
+-    if (bytes_per_frame / nchannels != size) {
++    if (size > INT_MAX / nchannels) {
+         /* This overflow test is rigorously correct because
+            both multiplicands are >= 1.  Use the argument names
+            from the docs for the error msg. */
+@@ -1117,6 +1109,7 @@
+                         "width * nchannels too big for a C int");
+         return NULL;
+     }
++    bytes_per_frame = size * nchannels;
+     if (weightA < 1 || weightB < 0) {
+         PyErr_SetString(AudioopError,
+             "weightA should be >= 1, weightB should be >= 0");
+@@ -1134,6 +1127,10 @@
+     d = gcd(inrate, outrate);
+     inrate /= d;
+     outrate /= d;
++    /* divide weightA and weightB by their greatest common divisor */
++    d = gcd(weightA, weightB);
++    weightA /= d;
++    weightA /= d;
+ 
+     if ((size_t)nchannels > PY_SIZE_MAX/sizeof(int)) {
+         PyErr_SetString(PyExc_MemoryError,
+@@ -1173,7 +1170,9 @@
+     }
+ 
+     /* str <- Space for the output buffer. */
+-    {
++    if (len == 0)
++        str = PyBytes_FromStringAndSize(NULL, 0);
++    else {
+         /* There are len input frames, so we need (mathematically)
+            ceiling(len*outrate/inrate) output frames, and each frame
+            requires bytes_per_frame bytes.  Computing this
+@@ -1188,12 +1187,11 @@
+         else
+             str = PyBytes_FromStringAndSize(NULL,
+                                             q * outrate * bytes_per_frame);
+-
+-        if (str == NULL) {
+-            PyErr_SetString(PyExc_MemoryError,
+-                "not enough memory for output buffer");
+-            goto exit;
+-        }
++    }
++    if (str == NULL) {
++        PyErr_SetString(PyExc_MemoryError,
++            "not enough memory for output buffer");
++        goto exit;
+     }
+     ncp = PyBytes_AsString(str);
+ 
+@@ -1227,32 +1225,32 @@
+             for (chan = 0; chan < nchannels; chan++) {
+                 prev_i[chan] = cur_i[chan];
+                 if (size == 1)
+-                    cur_i[chan] = ((int)*CHARP(cp, 0)) << 8;
++                    cur_i[chan] = ((int)*CHARP(cp, 0)) << 24;
+                 else if (size == 2)
+-                    cur_i[chan] = (int)*SHORTP(cp, 0);
++                    cur_i[chan] = ((int)*SHORTP(cp, 0)) << 16;
+                 else if (size == 4)
+-                    cur_i[chan] = ((int)*LONGP(cp, 0)) >> 16;
++                    cur_i[chan] = (int)*LONGP(cp, 0);
+                 cp += size;
+                 /* implements a simple digital filter */
+-                cur_i[chan] =
+-                    (weightA * cur_i[chan] +
+-                     weightB * prev_i[chan]) /
+-                    (weightA + weightB);
++                cur_i[chan] = (int)(
++                    ((double)weightA * (double)cur_i[chan] +
++                     (double)weightB * (double)prev_i[chan]) /
++                    ((double)weightA + (double)weightB));
+             }
+             len--;
+             d += outrate;
+         }
+         while (d >= 0) {
+             for (chan = 0; chan < nchannels; chan++) {
+-                cur_o = (prev_i[chan] * d +
+-                         cur_i[chan] * (outrate - d)) /
+-                    outrate;
++                cur_o = (int)(((double)prev_i[chan] * (double)d +
++                         (double)cur_i[chan] * (double)(outrate - d)) /
++                    (double)outrate);
+                 if (size == 1)
+-                    *CHARP(ncp, 0) = (signed char)(cur_o >> 8);
++                    *CHARP(ncp, 0) = (signed char)(cur_o >> 24);
+                 else if (size == 2)
+-                    *SHORTP(ncp, 0) = (short)(cur_o);
++                    *SHORTP(ncp, 0) = (short)(cur_o >> 16);
+                 else if (size == 4)
+-                    *LONGP(ncp, 0) = (Py_Int32)(cur_o<<16);
++                    *LONGP(ncp, 0) = (Py_Int32)(cur_o);
+                 ncp += size;
+             }
+             d -= inrate;
+diff -r bd8afb90ebf2 Modules/binascii.c
+--- a/Modules/binascii.c
++++ b/Modules/binascii.c
+@@ -1135,7 +1135,7 @@
+ static int
+ to_int(int c)
+ {
+-    if (isdigit(c))
++    if (Py_ISDIGIT(c))
+         return c - '0';
+     else {
+         if (Py_ISUPPER(c))
+diff -r bd8afb90ebf2 Modules/cjkcodecs/multibytecodec.c
+--- a/Modules/cjkcodecs/multibytecodec.c
++++ b/Modules/cjkcodecs/multibytecodec.c
+@@ -316,15 +316,15 @@
+         goto errorexit;
+ 
+     if (!PyTuple_Check(retobj) || PyTuple_GET_SIZE(retobj) != 2 ||
+-        !PyUnicode_Check((tobj = PyTuple_GET_ITEM(retobj, 0))) ||
++        (!PyUnicode_Check((tobj = PyTuple_GET_ITEM(retobj, 0))) && !PyBytes_Check(tobj)) ||
+         !PyLong_Check(PyTuple_GET_ITEM(retobj, 1))) {
+         PyErr_SetString(PyExc_TypeError,
+                         "encoding error handler must return "
+-                        "(unicode, int) tuple");
++                        "(str, int) tuple");
+         goto errorexit;
+     }
+ 
+-    {
++    if (PyUnicode_Check(tobj)) {
+         const Py_UNICODE *uraw = PyUnicode_AS_UNICODE(tobj);
+ 
+         retstr = multibytecodec_encode(codec, state, &uraw,
+@@ -333,6 +333,10 @@
+         if (retstr == NULL)
+             goto errorexit;
+     }
++    else {
++        Py_INCREF(tobj);
++        retstr = tobj;
++    }
+ 
+     assert(PyBytes_Check(retstr));
+     retstrsize = PyBytes_GET_SIZE(retstr);
+@@ -439,7 +443,7 @@
+         !PyLong_Check(PyTuple_GET_ITEM(retobj, 1))) {
+         PyErr_SetString(PyExc_TypeError,
+                         "decoding error handler must return "
+-                        "(unicode, int) tuple");
++                        "(str, int) tuple");
+         goto errorexit;
+     }
+ 
+@@ -760,7 +764,7 @@
+             return NULL;
+         else if (!PyUnicode_Check(unistr)) {
+             PyErr_SetString(PyExc_TypeError,
+-                "couldn't convert the object to unicode.");
++                "couldn't convert the object to str.");
+             Py_DECREF(ucvt);
+             return NULL;
+         }
+diff -r bd8afb90ebf2 Modules/grpmodule.c
+--- a/Modules/grpmodule.c
++++ b/Modules/grpmodule.c
+@@ -2,8 +2,8 @@
+ /* UNIX group file access module */
+ 
+ #include "Python.h"
++#include "posixmodule.h"
+ 
+-#include <sys/types.h>
+ #include <grp.h>
+ 
+ static PyStructSequence_Field struct_group_type_fields[] = {
+@@ -69,7 +69,7 @@
+             Py_INCREF(Py_None);
+     }
+ #endif
+-    SET(setIndex++, PyLong_FromLong((long) p->gr_gid));
++    SET(setIndex++, _PyLong_FromGid(p->gr_gid));
+     SET(setIndex++, w);
+ #undef SET
+ 
+@@ -85,17 +85,24 @@
+ grp_getgrgid(PyObject *self, PyObject *pyo_id)
+ {
+     PyObject *py_int_id;
+-    unsigned int gid;
++    gid_t gid;
+     struct group *p;
+ 
+     py_int_id = PyNumber_Long(pyo_id);
+     if (!py_int_id)
+             return NULL;
+-    gid = PyLong_AS_LONG(py_int_id);
++    if (!_Py_Gid_Converter(py_int_id, &gid)) {
++        Py_DECREF(py_int_id);
++        return NULL;
++    }
+     Py_DECREF(py_int_id);
+ 
+     if ((p = getgrgid(gid)) == NULL) {
+-        PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %d", gid);
++        PyObject *gid_obj = _PyLong_FromGid(gid);
++        if (gid_obj == NULL)
++            return NULL;
++        PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %S", gid_obj);
++        Py_DECREF(gid_obj);
+         return NULL;
+     }
+     return mkgrent(p);
+diff -r bd8afb90ebf2 Modules/itertoolsmodule.c
+--- a/Modules/itertoolsmodule.c
++++ b/Modules/itertoolsmodule.c
+@@ -473,14 +473,31 @@
+     return 0;
+ }
+ 
++static void
++teedataobject_safe_decref(PyObject *obj)
++{
++    while (obj && Py_TYPE(obj) == &teedataobject_type &&
++           Py_REFCNT(obj) == 1) {
++        PyObject *nextlink = ((teedataobject *)obj)->nextlink;
++        ((teedataobject *)obj)->nextlink = NULL;
++        Py_DECREF(obj);
++        obj = nextlink;
++    }
++    Py_XDECREF(obj);
++}
++
+ static int
+ teedataobject_clear(teedataobject *tdo)
+ {
+     int i;
++    PyObject *tmp;
++
+     Py_CLEAR(tdo->it);
+     for (i=0 ; i<tdo->numread ; i++)
+         Py_CLEAR(tdo->values[i]);
+-    Py_CLEAR(tdo->nextlink);
++    tmp = tdo->nextlink;
++    tdo->nextlink = NULL;
++    teedataobject_safe_decref(tmp);
+     return 0;
+ }
+ 
+@@ -617,6 +634,8 @@
+ 
+     if (to->index >= LINKCELLS) {
+         link = teedataobject_jumplink(to->dataobj);
++        if (link == NULL)
++            return NULL;
+         Py_DECREF(to->dataobj);
+         to->dataobj = (teedataobject *)link;
+         to->index = 0;
+@@ -945,7 +964,7 @@
+     /* Create a new cycle with the iterator tuple, then set
+      * the saved state on it.
+      */
+-    return Py_BuildValue("O(O)(Oi)", Py_TYPE(lz), 
++    return Py_BuildValue("O(O)(Oi)", Py_TYPE(lz),
+         lz->it, lz->saved, lz->firstpass);
+     }
+ 
+@@ -3135,7 +3154,7 @@
+                 goto err;
+             PyTuple_SET_ITEM(indices, i, index);
+         }
+-            
++
+         cycles = PyTuple_New(po->r);
+         if (cycles == NULL)
+             goto err;
+@@ -3161,7 +3180,7 @@
+ {
+     PyObject *indices, *cycles, *result;
+     Py_ssize_t n, i;
+-    
++
+     if (!PyArg_ParseTuple(state, "O!O!",
+                           &PyTuple_Type, &indices,
+                           &PyTuple_Type, &cycles))
+@@ -3340,18 +3359,18 @@
+ accumulate_next(accumulateobject *lz)
+ {
+     PyObject *val, *oldtotal, *newtotal;
+-    
++
+     val = PyIter_Next(lz->it);
+     if (val == NULL)
+         return NULL;
+- 
++
+     if (lz->total == NULL) {
+         Py_INCREF(val);
+         lz->total = val;
+         return lz->total;
+     }
+ 
+-    if (lz->binop == NULL) 
++    if (lz->binop == NULL)
+         newtotal = PyNumber_Add(lz->total, val);
+     else
+         newtotal = PyObject_CallFunctionObjArgs(lz->binop, lz->total, val, NULL);
+@@ -3362,7 +3381,7 @@
+     oldtotal = lz->total;
+     lz->total = newtotal;
+     Py_DECREF(oldtotal);
+-    
++
+     Py_INCREF(newtotal);
+     return newtotal;
+ }
+@@ -4332,7 +4351,7 @@
+ static PyObject *
+ zip_longest_reduce(ziplongestobject *lz)
+ {
+-    
++
+     /* Create a new tuple with empty sequences where appropriate to pickle.
+      * Then use setstate to set the fillvalue
+      */
+diff -r bd8afb90ebf2 Modules/main.c
+--- a/Modules/main.c
++++ b/Modules/main.c
+@@ -338,6 +338,7 @@
+ 
+     /* Hash randomization needed early for all string operations
+        (including -W and -X options). */
++    _PyOS_opterr = 0;  /* prevent printing the error in 1st pass */
+     while ((c = _PyOS_GetOpt(argc, argv, PROGRAM_OPTS)) != EOF) {
+         if (c == 'm' || c == 'c') {
+             /* -c / -m is the last option: following arguments are
+diff -r bd8afb90ebf2 Modules/mathmodule.c
+--- a/Modules/mathmodule.c
++++ b/Modules/mathmodule.c
+@@ -1381,14 +1381,13 @@
+         Py_DECREF(outer);
+         outer = tmp;
+     }
+-
+-    goto done;
++    Py_DECREF(inner);
++    return outer;
+ 
+   error:
+     Py_DECREF(outer);
+-  done:
+     Py_DECREF(inner);
+-    return outer;
++    return NULL;
+ }
+ 
+ /* Lookup table for small factorial values */
+diff -r bd8afb90ebf2 Modules/md5module.c
+--- a/Modules/md5module.c
++++ b/Modules/md5module.c
+@@ -399,7 +399,9 @@
+         c = (digest[i] & 0xf);
+         hex_digest[j++] = Py_hexdigits[c];
+     }
++#ifdef Py_DEBUG
+     assert(_PyUnicode_CheckConsistency(retval, 1));
++#endif
+     return retval;
+ }
+ 
+diff -r bd8afb90ebf2 Modules/mmapmodule.c
+--- a/Modules/mmapmodule.c
++++ b/Modules/mmapmodule.c
+@@ -1162,19 +1162,22 @@
+ #  endif
+     if (fd != -1 && fstat(fd, &st) == 0 && S_ISREG(st.st_mode)) {
+         if (map_size == 0) {
+-            off_t calc_size;
++            if (st.st_size == 0) {
++                PyErr_SetString(PyExc_ValueError,
++                                "cannot mmap an empty file");
++                return NULL;
++            }
+             if (offset >= st.st_size) {
+                 PyErr_SetString(PyExc_ValueError,
+                                 "mmap offset is greater than file size");
+                 return NULL;
+             }
+-            calc_size = st.st_size - offset;
+-            map_size = calc_size;
+-            if (map_size != calc_size) {
++            if (st.st_size - offset > PY_SSIZE_T_MAX) {
+                 PyErr_SetString(PyExc_ValueError,
+                                  "mmap length is too large");
+-                 return NULL;
+-             }
++                return NULL;
++            }
++            map_size = (Py_ssize_t) (st.st_size - offset);
+         } else if (offset + (size_t)map_size > st.st_size) {
+             PyErr_SetString(PyExc_ValueError,
+                             "mmap length is greater than file size");
+@@ -1359,17 +1362,25 @@
+             }
+ 
+             size = (((PY_LONG_LONG) high) << 32) + low;
++            if (size == 0) {
++                PyErr_SetString(PyExc_ValueError,
++                                "cannot mmap an empty file");
++                Py_DECREF(m_obj);
++                return NULL;
++            }
+             if (offset >= size) {
+                 PyErr_SetString(PyExc_ValueError,
+                                 "mmap offset is greater than file size");
+                 Py_DECREF(m_obj);
+                 return NULL;
+             }
+-            if (offset - size > PY_SSIZE_T_MAX)
+-                /* Map area too large to fit in memory */
+-                m_obj->size = (Py_ssize_t) -1;
+-            else
+-                m_obj->size = (Py_ssize_t) (size - offset);
++            if (size - offset > PY_SSIZE_T_MAX) {
++                PyErr_SetString(PyExc_ValueError,
++                                "mmap length is too large");
++                Py_DECREF(m_obj);
++                return NULL;
++            }
++            m_obj->size = (Py_ssize_t) (size - offset);
+         } else {
+             m_obj->size = map_size;
+             size = offset + map_size;
+diff -r bd8afb90ebf2 Modules/parsermodule.c
+--- a/Modules/parsermodule.c
++++ b/Modules/parsermodule.c
+@@ -696,7 +696,7 @@
+             err_string("parse tree does not use a valid start symbol");
+         }
+     }
+-    /*  Make sure we throw an exception on all errors.  We should never
++    /*  Make sure we raise an exception on all errors.  We should never
+      *  get this, but we'd do well to be sure something is done.
+      */
+     if (st == NULL && !PyErr_Occurred())
+@@ -725,7 +725,7 @@
+         /* elem must always be a sequence, however simple */
+         PyObject* elem = PySequence_GetItem(tuple, i);
+         int ok = elem != NULL;
+-        long  type = 0;
++        int type = 0;
+         char *strn = 0;
+ 
+         if (ok)
+@@ -736,8 +736,14 @@
+                 ok = 0;
+             else {
+                 ok = PyLong_Check(temp);
+-                if (ok)
+-                    type = PyLong_AS_LONG(temp);
++                if (ok) {
++                    type = _PyLong_AsInt(temp);
++                    if (type == -1 && PyErr_Occurred()) {
++                        Py_DECREF(temp);
++                        Py_DECREF(elem);
++                        return 0;
++                    }
++                }
+                 Py_DECREF(temp);
+             }
+         }
+@@ -773,8 +779,16 @@
+             if (len == 3) {
+                 PyObject *o = PySequence_GetItem(elem, 2);
+                 if (o != NULL) {
+-                    if (PyLong_Check(o))
+-                        *line_num = PyLong_AS_LONG(o);
++                    if (PyLong_Check(o)) {
++                        int num = _PyLong_AsInt(o);
++                        if (num == -1 && PyErr_Occurred()) {
++                            Py_DECREF(o);
++                            Py_DECREF(temp);
++                            Py_DECREF(elem);
++                            return 0;
++                        }
++                        *line_num = num;
++                    }
+                     else {
+                         PyErr_Format(parser_error,
+                                      "third item in terminal node must be an"
+@@ -802,7 +816,7 @@
+         else if (!ISNONTERMINAL(type)) {
+             /*
+              *  It has to be one or the other; this is an error.
+-             *  Throw an exception.
++             *  Raise an exception.
+              */
+             PyObject *err = Py_BuildValue("os", elem, "unknown node type.");
+             PyErr_SetObject(parser_error, err);
+@@ -854,7 +868,7 @@
+     if (ISTERMINAL(num)) {
+         /*
+          *  The tuple is simple, but it doesn't start with a start symbol.
+-         *  Throw an exception now and be done with it.
++         *  Raise an exception now and be done with it.
+          */
+         tuple = Py_BuildValue("os", tuple,
+                     "Illegal syntax-tree; cannot start with terminal symbol.");
+diff -r bd8afb90ebf2 Modules/posixmodule.c
+--- a/Modules/posixmodule.c
++++ b/Modules/posixmodule.c
+@@ -26,6 +26,9 @@
+ #define PY_SSIZE_T_CLEAN
+ 
+ #include "Python.h"
++#ifndef MS_WINDOWS
++#include "posixmodule.h"
++#endif
+ 
+ #if defined(__VMS)
+ #    error "PEP 11: VMS is now unsupported, code will be removed in Python 3.4"
+@@ -413,33 +416,165 @@
+ #endif
+ 
+ 
++#ifndef MS_WINDOWS
++PyObject *
++_PyLong_FromUid(uid_t uid)
++{
++    if (uid == (uid_t)-1)
++        return PyLong_FromLong(-1);
++    return PyLong_FromUnsignedLong(uid);
++}
++
++PyObject *
++_PyLong_FromGid(gid_t gid)
++{
++    if (gid == (gid_t)-1)
++        return PyLong_FromLong(-1);
++    return PyLong_FromUnsignedLong(gid);
++}
++
++int
++_Py_Uid_Converter(PyObject *obj, void *p)
++{
++    int overflow;
++    long result;
++    if (PyFloat_Check(obj)) {
++        PyErr_SetString(PyExc_TypeError,
++                        "integer argument expected, got float");
++        return 0;
++    }
++    result = PyLong_AsLongAndOverflow(obj, &overflow);
++    if (overflow < 0)
++        goto OverflowDown;
++    if (!overflow && result == -1) {
++        /* error or -1 */
++        if (PyErr_Occurred())
++            return 0;
++        *(uid_t *)p = (uid_t)-1;
++    }
++    else {
++        /* unsigned uid_t */
++        unsigned long uresult;
++        if (overflow > 0) {
++            uresult = PyLong_AsUnsignedLong(obj);
++            if (PyErr_Occurred()) {
++                if (PyErr_ExceptionMatches(PyExc_OverflowError))
++                    goto OverflowUp;
++                return 0;
++            }
++            if ((uid_t)uresult == (uid_t)-1)
++                goto OverflowUp;
++        } else {
++            if (result < 0)
++                goto OverflowDown;
++            uresult = result;
++        }
++        if (sizeof(uid_t) < sizeof(long) &&
++            (unsigned long)(uid_t)uresult != uresult)
++            goto OverflowUp;
++        *(uid_t *)p = (uid_t)uresult;
++    }
++    return 1;
++
++OverflowDown:
++    PyErr_SetString(PyExc_OverflowError,
++                    "user id is less than minimum");
++    return 0;
++
++OverflowUp:
++    PyErr_SetString(PyExc_OverflowError,
++                    "user id is greater than maximum");
++    return 0;
++}
++
++int
++_Py_Gid_Converter(PyObject *obj, void *p)
++{
++    int overflow;
++    long result;
++    if (PyFloat_Check(obj)) {
++        PyErr_SetString(PyExc_TypeError,
++                        "integer argument expected, got float");
++        return 0;
++    }
++    result = PyLong_AsLongAndOverflow(obj, &overflow);
++    if (overflow < 0)
++        goto OverflowDown;
++    if (!overflow && result == -1) {
++        /* error or -1 */
++        if (PyErr_Occurred())
++            return 0;
++        *(gid_t *)p = (gid_t)-1;
++    }
++    else {
++        /* unsigned gid_t */
++        unsigned long uresult;
++        if (overflow > 0) {
++            uresult = PyLong_AsUnsignedLong(obj);
++            if (PyErr_Occurred()) {
++                if (PyErr_ExceptionMatches(PyExc_OverflowError))
++                    goto OverflowUp;
++                return 0;
++            }
++            if ((gid_t)uresult == (gid_t)-1)
++                goto OverflowUp;
++        } else {
++            if (result < 0)
++                goto OverflowDown;
++            uresult = result;
++        }
++        if (sizeof(gid_t) < sizeof(long) &&
++            (unsigned long)(gid_t)uresult != uresult)
++            goto OverflowUp;
++        *(gid_t *)p = (gid_t)uresult;
++    }
++    return 1;
++
++OverflowDown:
++    PyErr_SetString(PyExc_OverflowError,
++                    "group id is less than minimum");
++    return 0;
++
++OverflowUp:
++    PyErr_SetString(PyExc_OverflowError,
++                    "group id is greater than maximum");
++    return 0;
++}
++#endif /* MS_WINDOWS */
++
++
+ #ifdef AT_FDCWD
+-#define DEFAULT_DIR_FD AT_FDCWD
++/*
++ * Why the (int) cast?  Solaris 10 defines AT_FDCWD as 0xffd19553 (-3041965);
++ * without the int cast, the value gets interpreted as uint (4291925331),
++ * which doesn't play nicely with all the initializer lines in this file that
++ * look like this:
++ *      int dir_fd = DEFAULT_DIR_FD;
++ */
++#define DEFAULT_DIR_FD (int)AT_FDCWD
+ #else
+ #define DEFAULT_DIR_FD (-100)
+ #endif
+ 
+ static int
+-_fd_converter(PyObject *o, int *p, int default_value) {
+-    long long_value;
+-    if (o == Py_None) {
+-        *p = default_value;
+-        return 1;
+-    }
+-    if (PyFloat_Check(o)) {
+-        PyErr_SetString(PyExc_TypeError,
+-                        "integer argument expected, got float" );
++_fd_converter(PyObject *o, int *p, const char *allowed)
++{
++    int overflow;
++    long long_value = PyLong_AsLongAndOverflow(o, &overflow);
++    if (PyFloat_Check(o) ||
++        (long_value == -1 && !overflow && PyErr_Occurred())) {
++        PyErr_Clear();
++        PyErr_Format(PyExc_TypeError,
++                        "argument should be %s, not %.200s",
++                        allowed, Py_TYPE(o)->tp_name);
+         return 0;
+     }
+-    long_value = PyLong_AsLong(o);
+-    if (long_value == -1 && PyErr_Occurred())
+-        return 0;
+-    if (long_value > INT_MAX) {
++    if (overflow > 0 || long_value > INT_MAX) {
+         PyErr_SetString(PyExc_OverflowError,
+                         "signed integer is greater than maximum");
+         return 0;
+     }
+-    if (long_value < INT_MIN) {
++    if (overflow < 0 || long_value < INT_MIN) {
+         PyErr_SetString(PyExc_OverflowError,
+                         "signed integer is less than minimum");
+         return 0;
+@@ -449,8 +584,13 @@
+ }
+ 
+ static int
+-dir_fd_converter(PyObject *o, void *p) {
+-    return _fd_converter(o, (int *)p, DEFAULT_DIR_FD);
++dir_fd_converter(PyObject *o, void *p)
++{
++    if (o == Py_None) {
++        *(int *)p = DEFAULT_DIR_FD;
++        return 1;
++    }
++    return _fd_converter(o, (int *)p, "integer");
+ }
+ 
+ 
+@@ -627,17 +767,16 @@
+     }
+     else {
+         PyErr_Clear();
+-        bytes = PyBytes_FromObject(o);
++        if (PyObject_CheckBuffer(o))
++            bytes = PyBytes_FromObject(o);
++        else
++            bytes = NULL;
+         if (!bytes) {
+             PyErr_Clear();
+             if (path->allow_fd) {
+                 int fd;
+-                /*
+-                 * note: _fd_converter always permits None.
+-                 * but we've already done our None check.
+-                 * so o cannot be None at this point.
+-                 */
+-                int result = _fd_converter(o, &fd, -1);
++                int result = _fd_converter(o, &fd,
++                        "string, bytes or integer");
+                 if (result) {
+                     path->wide = NULL;
+                     path->narrow = NULL;
+@@ -698,15 +837,17 @@
+ }
+ 
+ static int
+-dir_fd_unavailable(PyObject *o, void *p) {
+-    int *dir_fd = (int *)p;
+-    int return_value = _fd_converter(o, dir_fd, DEFAULT_DIR_FD);
+-    if (!return_value)
++dir_fd_unavailable(PyObject *o, void *p)
++{
++    int dir_fd;
++    if (!dir_fd_converter(o, &dir_fd))
+         return 0;
+-    if (*dir_fd == DEFAULT_DIR_FD)
+-        return 1;
+-    argument_unavailable_error(NULL, "dir_fd");
+-    return 0;
++    if (dir_fd != DEFAULT_DIR_FD) {
++        argument_unavailable_error(NULL, "dir_fd");
++        return 0;
++    }
++    *(int *)p = dir_fd;
++    return 1;
+ }
+ 
+ static int
+@@ -791,7 +932,7 @@
+ 
+ #if defined _MSC_VER && _MSC_VER >= 1400
+ /* Microsoft CRT in VS2005 and higher will verify that a filehandle is
+- * valid and throw an assertion if it isn't.
++ * valid and raise an assertion if it isn't.
+  * Normally, an invalid fd is likely to be a C program error and therefore
+  * an assertion can be useful, but it does contradict the POSIX standard
+  * which for write(2) states:
+@@ -944,9 +1085,10 @@
+ #endif /* MS_WINDOWS */
+ 
+ /* Return a dictionary corresponding to the POSIX environment table */
+-#ifdef WITH_NEXT_FRAMEWORK
++#if defined(WITH_NEXT_FRAMEWORK) || (defined(__APPLE__) && defined(Py_ENABLE_SHARED))
+ /* On Darwin/MacOSX a shared library or framework has no access to
+-** environ directly, we must obtain it with _NSGetEnviron().
++** environ directly, we must obtain it with _NSGetEnviron(). See also
++** man environ(7).
+ */
+ #include <crt_externs.h>
+ static char **environ;
+@@ -971,7 +1113,7 @@
+     d = PyDict_New();
+     if (d == NULL)
+         return NULL;
+-#ifdef WITH_NEXT_FRAMEWORK
++#if defined(WITH_NEXT_FRAMEWORK) || (defined(__APPLE__) && defined(Py_ENABLE_SHARED))
+     if (environ == NULL)
+         environ = *_NSGetEnviron();
+ #endif
+@@ -1160,7 +1302,7 @@
+     if (strlen(msgbuf) > 0) { /* If Non-Empty Msg, Trim CRLF */
+         char *lastc = &msgbuf[ strlen(msgbuf)-1 ];
+ 
+-        while (lastc > msgbuf && isspace(Py_CHARMASK(*lastc)))
++        while (lastc > msgbuf && Py_ISSPACE(Py_CHARMASK(*lastc)))
+             *lastc-- = '\0'; /* Trim Trailing Whitespace (CRLF) */
+     }
+ 
+@@ -2154,8 +2296,13 @@
+     PyStructSequence_SET_ITEM(v, 2, PyLong_FromLong((long)st->st_dev));
+ #endif
+     PyStructSequence_SET_ITEM(v, 3, PyLong_FromLong((long)st->st_nlink));
+-    PyStructSequence_SET_ITEM(v, 4, PyLong_FromLong((long)st->st_uid));
+-    PyStructSequence_SET_ITEM(v, 5, PyLong_FromLong((long)st->st_gid));
++#if defined(MS_WINDOWS)
++    PyStructSequence_SET_ITEM(v, 4, PyLong_FromLong(0));
++    PyStructSequence_SET_ITEM(v, 5, PyLong_FromLong(0));
++#else
++    PyStructSequence_SET_ITEM(v, 4, _PyLong_FromUid(st->st_uid));
++    PyStructSequence_SET_ITEM(v, 5, _PyLong_FromGid(st->st_gid));
++#endif
+ #ifdef HAVE_LARGEFILE_SUPPORT
+     PyStructSequence_SET_ITEM(v, 6,
+                               PyLong_FromLongLong((PY_LONG_LONG)st->st_size));
+@@ -2561,7 +2708,7 @@
+         result = win32_wchdir(path.wide);
+     else
+         result = win32_chdir(path.narrow);
+-	result = !result; /* on unix, success = 0, on windows, success = !0 */
++    result = !result; /* on unix, success = 0, on windows, success = !0 */
+ #elif defined(PYOS_OS2) && defined(PYCC_GCC)
+     result = _chdir2(path.narrow);
+ #else
+@@ -2960,7 +3107,6 @@
+ posix_chown(PyObject *self, PyObject *args, PyObject *kwargs)
+ {
+     path_t path;
+-    long uid_l, gid_l;
+     uid_t uid;
+     gid_t gid;
+     int dir_fd = DEFAULT_DIR_FD;
+@@ -2974,9 +3120,10 @@
+ #ifdef HAVE_FCHOWN
+     path.allow_fd = 1;
+ #endif
+-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&ll|$O&p:chown", keywords,
++    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&O&O&|$O&p:chown", keywords,
+                                      path_converter, &path,
+-                                     &uid_l, &gid_l,
++                                     _Py_Uid_Converter, &uid,
++                                     _Py_Gid_Converter, &gid,
+ #ifdef HAVE_FCHOWNAT
+                                      dir_fd_converter, &dir_fd,
+ #else
+@@ -3007,8 +3154,6 @@
+ #endif
+ 
+     Py_BEGIN_ALLOW_THREADS
+-    uid = (uid_t)uid_l;
+-    gid = (uid_t)gid_l;
+ #ifdef HAVE_FCHOWN
+     if (path.fd != -1)
+         result = fchown(path.fd, uid, gid);
+@@ -3052,12 +3197,15 @@
+ posix_fchown(PyObject *self, PyObject *args)
+ {
+     int fd;
+-    long uid, gid;
++    uid_t uid;
++    gid_t gid;
+     int res;
+-    if (!PyArg_ParseTuple(args, "ill:fchown", &fd, &uid, &gid))
++    if (!PyArg_ParseTuple(args, "iO&O&:fchown", &fd,
++                          _Py_Uid_Converter, &uid,
++                          _Py_Gid_Converter, &gid))
+         return NULL;
+     Py_BEGIN_ALLOW_THREADS
+-    res = fchown(fd, (uid_t) uid, (gid_t) gid);
++    res = fchown(fd, uid, gid);
+     Py_END_ALLOW_THREADS
+     if (res < 0)
+         return posix_error();
+@@ -3077,15 +3225,17 @@
+ {
+     PyObject *opath;
+     char *path;
+-    long uid, gid;
++    uid_t uid;
++    gid_t gid;
+     int res;
+-    if (!PyArg_ParseTuple(args, "O&ll:lchown",
++    if (!PyArg_ParseTuple(args, "O&O&O&:lchown",
+                           PyUnicode_FSConverter, &opath,
+-                          &uid, &gid))
++                          _Py_Uid_Converter, &uid,
++                          _Py_Gid_Converter, &gid))
+         return NULL;
+     path = PyBytes_AsString(opath);
+     Py_BEGIN_ALLOW_THREADS
+-    res = lchown(path, (uid_t) uid, (gid_t) gid);
++    res = lchown(path, uid, gid);
+     Py_END_ALLOW_THREADS
+     if (res < 0)
+         return posix_error_with_allocated_filename(opath);
+@@ -6018,7 +6168,7 @@
+ static PyObject *
+ posix_getegid(PyObject *self, PyObject *noargs)
+ {
+-    return PyLong_FromLong((long)getegid());
++    return _PyLong_FromGid(getegid());
+ }
+ #endif
+ 
+@@ -6031,7 +6181,7 @@
+ static PyObject *
+ posix_geteuid(PyObject *self, PyObject *noargs)
+ {
+-    return PyLong_FromLong((long)geteuid());
++    return _PyLong_FromUid(geteuid());
+ }
+ #endif
+ 
+@@ -6044,7 +6194,7 @@
+ static PyObject *
+ posix_getgid(PyObject *self, PyObject *noargs)
+ {
+-    return PyLong_FromLong((long)getgid());
++    return _PyLong_FromGid(getgid());
+ }
+ #endif
+ 
+@@ -6086,8 +6236,14 @@
+ #endif
+     ngroups = MAX_GROUPS;
+ 
+-    if (!PyArg_ParseTuple(args, "si", &user, &basegid))
+-        return NULL;
++#ifdef __APPLE__
++    if (!PyArg_ParseTuple(args, "si:getgrouplist", &user, &basegid))
++        return NULL;
++#else
++    if (!PyArg_ParseTuple(args, "sO&:getgrouplist", &user,
++                          _Py_Gid_Converter, &basegid))
++        return NULL;
++#endif
+ 
+ #ifdef __APPLE__
+     groups = PyMem_Malloc(ngroups * sizeof(int));
+@@ -6109,7 +6265,11 @@
+     }
+ 
+     for (i = 0; i < ngroups; i++) {
++#ifdef __APPLE__
+         PyObject *o = PyLong_FromUnsignedLong((unsigned long)groups[i]);
++#else
++        PyObject *o = _PyLong_FromGid(groups[i]);
++#endif
+         if (o == NULL) {
+             Py_DECREF(list);
+             PyMem_Del(groups);
+@@ -6183,7 +6343,7 @@
+     if (result != NULL) {
+         int i;
+         for (i = 0; i < n; ++i) {
+-            PyObject *o = PyLong_FromLong((long)alt_grouplist[i]);
++            PyObject *o = _PyLong_FromGid(alt_grouplist[i]);
+             if (o == NULL) {
+                 Py_DECREF(result);
+                 result = NULL;
+@@ -6214,14 +6374,25 @@
+     PyObject *oname;
+     char *username;
+     int res;
+-    long gid;
+-
+-    if (!PyArg_ParseTuple(args, "O&l:initgroups",
+-                          PyUnicode_FSConverter, &oname, &gid))
++#ifdef __APPLE__
++    int gid;
++#else
++    gid_t gid;
++#endif
++
++#ifdef __APPLE__
++    if (!PyArg_ParseTuple(args, "O&i:initgroups",
++                          PyUnicode_FSConverter, &oname,
++                          &gid))
++#else
++    if (!PyArg_ParseTuple(args, "O&O&:initgroups",
++                          PyUnicode_FSConverter, &oname,
++                          _Py_Gid_Converter, &gid))
++#endif
+         return NULL;
+     username = PyBytes_AS_STRING(oname);
+ 
+-    res = initgroups(username, (gid_t) gid);
++    res = initgroups(username, gid);
+     Py_DECREF(oname);
+     if (res == -1)
+         return PyErr_SetFromErrno(PyExc_OSError);
+@@ -6396,7 +6567,7 @@
+ static PyObject *
+ posix_getuid(PyObject *self, PyObject *noargs)
+ {
+-    return PyLong_FromLong((long)getuid());
++    return _PyLong_FromUid(getuid());
+ }
+ #endif
+ 
+@@ -6536,15 +6707,9 @@
+ static PyObject *
+ posix_setuid(PyObject *self, PyObject *args)
+ {
+-    long uid_arg;
+     uid_t uid;
+-    if (!PyArg_ParseTuple(args, "l:setuid", &uid_arg))
+-        return NULL;
+-    uid = uid_arg;
+-    if (uid != uid_arg) {
+-        PyErr_SetString(PyExc_OverflowError, "user id too big");
+-        return NULL;
+-    }
++    if (!PyArg_ParseTuple(args, "O&:setuid", _Py_Uid_Converter, &uid))
++        return NULL;
+     if (setuid(uid) < 0)
+         return posix_error();
+     Py_INCREF(Py_None);
+@@ -6561,15 +6726,9 @@
+ static PyObject *
+ posix_seteuid (PyObject *self, PyObject *args)
+ {
+-    long euid_arg;
+     uid_t euid;
+-    if (!PyArg_ParseTuple(args, "l", &euid_arg))
+-        return NULL;
+-    euid = euid_arg;
+-    if (euid != euid_arg) {
+-        PyErr_SetString(PyExc_OverflowError, "user id too big");
+-        return NULL;
+-    }
++    if (!PyArg_ParseTuple(args, "O&:seteuid", _Py_Uid_Converter, &euid))
++        return NULL;
+     if (seteuid(euid) < 0) {
+         return posix_error();
+     } else {
+@@ -6587,15 +6746,9 @@
+ static PyObject *
+ posix_setegid (PyObject *self, PyObject *args)
+ {
+-    long egid_arg;
+     gid_t egid;
+-    if (!PyArg_ParseTuple(args, "l", &egid_arg))
+-        return NULL;
+-    egid = egid_arg;
+-    if (egid != egid_arg) {
+-        PyErr_SetString(PyExc_OverflowError, "group id too big");
+-        return NULL;
+-    }
++    if (!PyArg_ParseTuple(args, "O&:setegid", _Py_Gid_Converter, &egid))
++        return NULL;
+     if (setegid(egid) < 0) {
+         return posix_error();
+     } else {
+@@ -6613,23 +6766,11 @@
+ static PyObject *
+ posix_setreuid (PyObject *self, PyObject *args)
+ {
+-    long ruid_arg, euid_arg;
+     uid_t ruid, euid;
+-    if (!PyArg_ParseTuple(args, "ll", &ruid_arg, &euid_arg))
+-        return NULL;
+-    if (ruid_arg == -1)
+-        ruid = (uid_t)-1;  /* let the compiler choose how -1 fits */
+-    else
+-        ruid = ruid_arg;  /* otherwise, assign from our long */
+-    if (euid_arg == -1)
+-        euid = (uid_t)-1;
+-    else
+-        euid = euid_arg;
+-    if ((euid_arg != -1 && euid != euid_arg) ||
+-        (ruid_arg != -1 && ruid != ruid_arg)) {
+-        PyErr_SetString(PyExc_OverflowError, "user id too big");
+-        return NULL;
+-    }
++    if (!PyArg_ParseTuple(args, "O&O&:setreuid",
++                          _Py_Uid_Converter, &ruid,
++                          _Py_Uid_Converter, &euid))
++        return NULL;
+     if (setreuid(ruid, euid) < 0) {
+         return posix_error();
+     } else {
+@@ -6647,23 +6788,11 @@
+ static PyObject *
+ posix_setregid (PyObject *self, PyObject *args)
+ {
+-    long rgid_arg, egid_arg;
+     gid_t rgid, egid;
+-    if (!PyArg_ParseTuple(args, "ll", &rgid_arg, &egid_arg))
+-        return NULL;
+-    if (rgid_arg == -1)
+-        rgid = (gid_t)-1;  /* let the compiler choose how -1 fits */
+-    else
+-        rgid = rgid_arg;  /* otherwise, assign from our long */
+-    if (egid_arg == -1)
+-        egid = (gid_t)-1;
+-    else
+-        egid = egid_arg;
+-    if ((egid_arg != -1 && egid != egid_arg) ||
+-        (rgid_arg != -1 && rgid != rgid_arg)) {
+-        PyErr_SetString(PyExc_OverflowError, "group id too big");
+-        return NULL;
+-    }
++    if (!PyArg_ParseTuple(args, "O&O&:setregid",
++                          _Py_Gid_Converter, &rgid,
++                          _Py_Gid_Converter, &egid))
++        return NULL;
+     if (setregid(rgid, egid) < 0) {
+         return posix_error();
+     } else {
+@@ -6681,15 +6810,9 @@
+ static PyObject *
+ posix_setgid(PyObject *self, PyObject *args)
+ {
+-    long gid_arg;
+     gid_t gid;
+-    if (!PyArg_ParseTuple(args, "l:setgid", &gid_arg))
+-        return NULL;
+-    gid = gid_arg;
+-    if (gid != gid_arg) {
+-        PyErr_SetString(PyExc_OverflowError, "group id too big");
+-        return NULL;
+-    }
++    if (!PyArg_ParseTuple(args, "O&:setgid", _Py_Gid_Converter, &gid))
++        return NULL;
+     if (setgid(gid) < 0)
+         return posix_error();
+     Py_INCREF(Py_None);
+@@ -6728,18 +6851,7 @@
+             Py_DECREF(elem);
+             return NULL;
+         } else {
+-            unsigned long x = PyLong_AsUnsignedLong(elem);
+-            if (PyErr_Occurred()) {
+-                PyErr_SetString(PyExc_TypeError,
+-                                "group id too big");
+-                Py_DECREF(elem);
+-                return NULL;
+-            }
+-            grouplist[i] = x;
+-            /* read back the value to see if it fitted in gid_t */
+-            if (grouplist[i] != x) {
+-                PyErr_SetString(PyExc_TypeError,
+-                                "group id too big");
++            if (!_Py_Gid_Converter(elem, &grouplist[i])) {
+                 Py_DECREF(elem);
+                 return NULL;
+             }
+@@ -6901,7 +7013,7 @@
+         return NULL;
+ 
+     PyStructSequence_SET_ITEM(result, 0, PyLong_FromPid(si.si_pid));
+-    PyStructSequence_SET_ITEM(result, 1, PyLong_FromPid(si.si_uid));
++    PyStructSequence_SET_ITEM(result, 1, _PyLong_FromUid(si.si_uid));
+     PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong((long)(si.si_signo)));
+     PyStructSequence_SET_ITEM(result, 3, PyLong_FromLong((long)(si.si_status)));
+     PyStructSequence_SET_ITEM(result, 4, PyLong_FromLong((long)(si.si_code)));
+@@ -7109,12 +7221,12 @@
+     if (!check_CreateSymbolicLink()) {
+         PyErr_SetString(PyExc_NotImplementedError,
+             "CreateSymbolicLink functions not found");
+-		return NULL;
+-	}
++                return NULL;
++        }
+     if (!win32_can_symlink) {
+         PyErr_SetString(PyExc_OSError, "symbolic link privilege not held");
+-		return NULL;
+-	}
++                return NULL;
++        }
+ #endif
+ 
+     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&O&|i$O&:symlink",
+@@ -7190,7 +7302,7 @@
+     DWORD n_bytes_returned;
+     DWORD io_result;
+     PyObject *po, *result;
+-	int dir_fd;
++        int dir_fd;
+     HANDLE reparse_point_handle;
+ 
+     char target_buffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
+@@ -8163,7 +8275,7 @@
+     int fds[2];
+     int res;
+ 
+-    flags = PyLong_AsLong(arg);
++    flags = _PyLong_AsInt(arg);
+     if (flags == -1 && PyErr_Occurred())
+         return NULL;
+ 
+@@ -10185,8 +10297,11 @@
+ posix_setresuid (PyObject *self, PyObject *args)
+ {
+     /* We assume uid_t is no larger than a long. */
+-    long ruid, euid, suid;
+-    if (!PyArg_ParseTuple(args, "lll", &ruid, &euid, &suid))
++    uid_t ruid, euid, suid;
++    if (!PyArg_ParseTuple(args, "O&O&O&:setresuid",
++                          _Py_Uid_Converter, &ruid,
++                          _Py_Uid_Converter, &euid,
++                          _Py_Uid_Converter, &suid))
+         return NULL;
+     if (setresuid(ruid, euid, suid) < 0)
+         return posix_error();
+@@ -10202,9 +10317,11 @@
+ static PyObject*
+ posix_setresgid (PyObject *self, PyObject *args)
+ {
+-    /* We assume uid_t is no larger than a long. */
+-    long rgid, egid, sgid;
+-    if (!PyArg_ParseTuple(args, "lll", &rgid, &egid, &sgid))
++    gid_t rgid, egid, sgid;
++    if (!PyArg_ParseTuple(args, "O&O&O&:setresgid",
++                          _Py_Gid_Converter, &rgid,
++                          _Py_Gid_Converter, &egid,
++                          _Py_Gid_Converter, &sgid))
+         return NULL;
+     if (setresgid(rgid, egid, sgid) < 0)
+         return posix_error();
+@@ -10221,14 +10338,11 @@
+ posix_getresuid (PyObject *self, PyObject *noargs)
+ {
+     uid_t ruid, euid, suid;
+-    long l_ruid, l_euid, l_suid;
+     if (getresuid(&ruid, &euid, &suid) < 0)
+         return posix_error();
+-    /* Force the values into long's as we don't know the size of uid_t. */
+-    l_ruid = ruid;
+-    l_euid = euid;
+-    l_suid = suid;
+-    return Py_BuildValue("(lll)", l_ruid, l_euid, l_suid);
++    return Py_BuildValue("(NNN)", _PyLong_FromUid(ruid),
++                                  _PyLong_FromUid(euid),
++                                  _PyLong_FromUid(suid));
+ }
+ #endif
+ 
+@@ -10241,14 +10355,11 @@
+ posix_getresgid (PyObject *self, PyObject *noargs)
+ {
+     uid_t rgid, egid, sgid;
+-    long l_rgid, l_egid, l_sgid;
+     if (getresgid(&rgid, &egid, &sgid) < 0)
+         return posix_error();
+-    /* Force the values into long's as we don't know the size of uid_t. */
+-    l_rgid = rgid;
+-    l_egid = egid;
+-    l_sgid = sgid;
+-    return Py_BuildValue("(lll)", l_rgid, l_egid, l_sgid);
++    return Py_BuildValue("(NNN)", _PyLong_FromGid(rgid),
++                                  _PyLong_FromGid(egid),
++                                  _PyLong_FromGid(sgid));
+ }
+ #endif
+ 
+diff -r bd8afb90ebf2 Modules/posixmodule.h
+--- /dev/null
++++ b/Modules/posixmodule.h
+@@ -0,0 +1,25 @@
++/* Declarations shared between the different POSIX-related modules */
++
++#ifndef Py_POSIXMODULE_H
++#define Py_POSIXMODULE_H
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#ifdef HAVE_SYS_TYPES_H
++#include <sys/types.h>
++#endif
++
++#ifndef Py_LIMITED_API
++#ifndef MS_WINDOWS
++PyAPI_FUNC(PyObject *) _PyLong_FromUid(uid_t);
++PyAPI_FUNC(PyObject *) _PyLong_FromGid(gid_t);
++PyAPI_FUNC(int) _Py_Uid_Converter(PyObject *, void *);
++PyAPI_FUNC(int) _Py_Gid_Converter(PyObject *, void *);
++#endif /* MS_WINDOWS */
++#endif
++
++#ifdef __cplusplus
++}
++#endif
++#endif /* !Py_POSIXMODULE_H */
+diff -r bd8afb90ebf2 Modules/pwdmodule.c
+--- a/Modules/pwdmodule.c
++++ b/Modules/pwdmodule.c
+@@ -2,8 +2,8 @@
+ /* UNIX password file access module */
+ 
+ #include "Python.h"
++#include "posixmodule.h"
+ 
+-#include <sys/types.h>
+ #include <pwd.h>
+ 
+ static PyStructSequence_Field struct_pwd_type_fields[] = {
+@@ -74,8 +74,8 @@
+ #else
+     SETS(setIndex++, p->pw_passwd);
+ #endif
+-    SETI(setIndex++, p->pw_uid);
+-    SETI(setIndex++, p->pw_gid);
++    PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromUid(p->pw_uid));
++    PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromGid(p->pw_gid));
+ #ifdef __VMS
+     SETS(setIndex++, "");
+ #else
+@@ -104,13 +104,21 @@
+ static PyObject *
+ pwd_getpwuid(PyObject *self, PyObject *args)
+ {
+-    unsigned int uid;
++    uid_t uid;
+     struct passwd *p;
+-    if (!PyArg_ParseTuple(args, "I:getpwuid", &uid))
++    if (!PyArg_ParseTuple(args, "O&:getpwuid", _Py_Uid_Converter, &uid)) {
++        if (PyErr_ExceptionMatches(PyExc_OverflowError))
++            PyErr_Format(PyExc_KeyError,
++                         "getpwuid(): uid not found");
+         return NULL;
++    }
+     if ((p = getpwuid(uid)) == NULL) {
++        PyObject *uid_obj = _PyLong_FromUid(uid);
++        if (uid_obj == NULL)
++            return NULL;
+         PyErr_Format(PyExc_KeyError,
+-                     "getpwuid(): uid not found: %d", uid);
++                     "getpwuid(): uid not found: %S", uid_obj);
++        Py_DECREF(uid_obj);
+         return NULL;
+     }
+     return mkpwent(p);
+diff -r bd8afb90ebf2 Modules/pyexpat.c
+--- a/Modules/pyexpat.c
++++ b/Modules/pyexpat.c
+@@ -778,17 +778,49 @@
+ "Parse(data[, isfinal])\n\
+ Parse XML data.  `isfinal' should be true at end of input.");
+ 
++#define MAX_CHUNK_SIZE (1 << 20)
++
+ static PyObject *
+ xmlparse_Parse(xmlparseobject *self, PyObject *args)
+ {
+-    char *s;
+-    int slen;
++    PyObject *data;
+     int isFinal = 0;
++    const char *s;
++    Py_ssize_t slen;
++    Py_buffer view;
++    int rc;
+ 
+-    if (!PyArg_ParseTuple(args, "s#|i:Parse", &s, &slen, &isFinal))
++    if (!PyArg_ParseTuple(args, "O|i:Parse", &data, &isFinal))
+         return NULL;
+ 
+-    return get_parse_result(self, XML_Parse(self->itself, s, slen, isFinal));
++    if (PyUnicode_Check(data)) {
++        view.buf = NULL;
++        s = PyUnicode_AsUTF8AndSize(data, &slen);
++        if (s == NULL)
++            return NULL;
++        /* Explicitly set UTF-8 encoding. Return code ignored. */
++        (void)XML_SetEncoding(self->itself, "utf-8");
++    }
++    else {
++        if (PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) < 0)
++            return NULL;
++        s = view.buf;
++        slen = view.len;
++    }
++
++    while (slen > MAX_CHUNK_SIZE) {
++        rc = XML_Parse(self->itself, s, MAX_CHUNK_SIZE, 0);
++        if (!rc)
++            goto done;
++        s += MAX_CHUNK_SIZE;
++        slen -= MAX_CHUNK_SIZE;
++    }
++    rc = XML_Parse(self->itself, s, slen, isFinal);
++
++done:
++    if (view.buf != NULL)
++        PyBuffer_Release(&view);
++    return get_parse_result(self, rc);
+ }
+ 
+ /* File reading copied from cPickle */
+diff -r bd8afb90ebf2 Modules/python.c
+--- a/Modules/python.c
++++ b/Modules/python.c
+@@ -15,10 +15,6 @@
+ }
+ #else
+ 
+-#ifdef __APPLE__
+-extern wchar_t* _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size);
+-#endif
+-
+ int
+ main(int argc, char **argv)
+ {
+@@ -45,11 +41,7 @@
+     oldloc = strdup(setlocale(LC_ALL, NULL));
+     setlocale(LC_ALL, "");
+     for (i = 0; i < argc; i++) {
+-#ifdef __APPLE__
+-        argv_copy[i] = _Py_DecodeUTF8_surrogateescape(argv[i], strlen(argv[i]));
+-#else
+         argv_copy[i] = _Py_char2wchar(argv[i], NULL);
+-#endif
+         if (!argv_copy[i]) {
+             free(oldloc);
+             fprintf(stderr, "Fatal Python error: "
+diff -r bd8afb90ebf2 Modules/resource.c
+--- a/Modules/resource.c
++++ b/Modules/resource.c
+@@ -142,10 +142,9 @@
+ {
+     struct rlimit rl;
+     int resource;
+-    PyObject *curobj, *maxobj;
++    PyObject *limits, *curobj, *maxobj;
+ 
+-    if (!PyArg_ParseTuple(args, "i(OO):setrlimit",
+-                          &resource, &curobj, &maxobj))
++    if (!PyArg_ParseTuple(args, "iO:setrlimit", &resource, &limits))
+         return NULL;
+ 
+     if (resource < 0 || resource >= RLIM_NLIMITS) {
+@@ -154,21 +153,34 @@
+         return NULL;
+     }
+ 
++    limits = PySequence_Tuple(limits);
++    if (!limits)
++        /* Here limits is a borrowed reference */
++        return NULL;
++
++    if (PyTuple_GET_SIZE(limits) != 2) {
++        PyErr_SetString(PyExc_ValueError,
++                        "expected a tuple of 2 integers");
++        goto error;
++    }
++    curobj = PyTuple_GET_ITEM(limits, 0);
++    maxobj = PyTuple_GET_ITEM(limits, 1);
++
+ #if !defined(HAVE_LARGEFILE_SUPPORT)
+     rl.rlim_cur = PyLong_AsLong(curobj);
+     if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred())
+-        return NULL;
++        goto error;
+     rl.rlim_max = PyLong_AsLong(maxobj);
+     if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred())
+-        return NULL;
++        goto error;
+ #else
+     /* The limits are probably bigger than a long */
+     rl.rlim_cur = PyLong_AsLongLong(curobj);
+     if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred())
+-        return NULL;
++        goto error;
+     rl.rlim_max = PyLong_AsLongLong(maxobj);
+     if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred())
+-        return NULL;
++        goto error;
+ #endif
+ 
+     rl.rlim_cur = rl.rlim_cur & RLIM_INFINITY;
+@@ -182,10 +194,15 @@
+                             "not allowed to raise maximum limit");
+         else
+             PyErr_SetFromErrno(PyExc_OSError);
+-        return NULL;
++        goto error;
+     }
++    Py_DECREF(limits);
+     Py_INCREF(Py_None);
+     return Py_None;
++
++  error:
++    Py_DECREF(limits);
++    return NULL;
+ }
+ 
+ static PyObject *
+diff -r bd8afb90ebf2 Modules/selectmodule.c
+--- a/Modules/selectmodule.c
++++ b/Modules/selectmodule.c
+@@ -89,7 +89,7 @@
+ {
+     int max = -1;
+     int index = 0;
+-    Py_ssize_t i, len = -1;
++    Py_ssize_t i;
+     PyObject* fast_seq = NULL;
+     PyObject* o = NULL;
+ 
+@@ -100,9 +100,7 @@
+     if (!fast_seq)
+         return -1;
+ 
+-    len = PySequence_Fast_GET_SIZE(fast_seq);
+-
+-    for (i = 0; i < len; i++)  {
++    for (i = 0; i < PySequence_Fast_GET_SIZE(fast_seq); i++)  {
+         SOCKET v;
+ 
+         /* any intervening fileno() calls could decr this refcnt */
+@@ -239,7 +237,7 @@
+ #else
+         /* 64-bit OS X has struct timeval.tv_usec as an int (and thus still 4
+            bytes as required), but no longer defined by a long. */
+-        long tv_usec = tv.tv_usec;
++        long tv_usec;
+         if (_PyTime_ObjectToTimeval(tout, &tv.tv_sec, &tv_usec) == -1)
+             return NULL;
+         tv.tv_usec = tv_usec;
+@@ -359,10 +357,13 @@
+ 
+     i = pos = 0;
+     while (PyDict_Next(self->dict, &pos, &key, &value)) {
+-        self->ufds[i].fd = PyLong_AsLong(key);
++        assert(i < self->ufd_len);
++        /* Never overflow */
++        self->ufds[i].fd = (int)PyLong_AsLong(key);
+         self->ufds[i].events = (short)PyLong_AsLong(value);
+         i++;
+     }
++    assert(i == self->ufd_len);
+     self->ufd_uptodate = 1;
+     return 1;
+ }
+@@ -378,10 +379,11 @@
+ poll_register(pollObject *self, PyObject *args)
+ {
+     PyObject *o, *key, *value;
+-    int fd, events = POLLIN | POLLPRI | POLLOUT;
++    int fd;
++    short events = POLLIN | POLLPRI | POLLOUT;
+     int err;
+ 
+-    if (!PyArg_ParseTuple(args, "O|i:register", &o, &events)) {
++    if (!PyArg_ParseTuple(args, "O|h:register", &o, &events)) {
+         return NULL;
+     }
+ 
+@@ -520,7 +522,7 @@
+         tout = PyNumber_Long(tout);
+         if (!tout)
+             return NULL;
+-        timeout = PyLong_AsLong(tout);
++        timeout = _PyLong_AsInt(tout);
+         Py_DECREF(tout);
+         if (timeout == -1 && PyErr_Occurred())
+             return NULL;
+@@ -2096,7 +2098,7 @@
+ 
+ static PyMethodDef select_methods[] = {
+     {"select",          select_select,  METH_VARARGS,   select_doc},
+-#ifdef HAVE_POLL
++#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
+     {"poll",            select_poll,    METH_NOARGS,    poll_doc},
+ #endif /* HAVE_POLL */
+ #ifdef HAVE_SYS_DEVPOLL_H
+@@ -2146,7 +2148,7 @@
+     PyModule_AddIntConstant(m, "PIPE_BUF", PIPE_BUF);
+ #endif
+ 
+-#if defined(HAVE_POLL)
++#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
+ #ifdef __APPLE__
+     if (select_have_broken_poll()) {
+         if (PyObject_DelAttrString(m, "poll") == -1) {
+diff -r bd8afb90ebf2 Modules/sha1module.c
+--- a/Modules/sha1module.c
++++ b/Modules/sha1module.c
+@@ -376,7 +376,9 @@
+         c = (digest[i] & 0xf);
+         hex_digest[j++] = Py_hexdigits[c];
+     }
++#ifdef Py_DEBUG
+     assert(_PyUnicode_CheckConsistency(retval, 1));
++#endif
+     return retval;
+ }
+ 
+diff -r bd8afb90ebf2 Modules/sha256module.c
+--- a/Modules/sha256module.c
++++ b/Modules/sha256module.c
+@@ -466,7 +466,9 @@
+         c = (digest[i] & 0xf);
+         hex_digest[j++] = Py_hexdigits[c];
+     }
++#ifdef Py_DEBUG
+     assert(_PyUnicode_CheckConsistency(retval, 1));
++#endif
+     return retval;
+ }
+ 
+diff -r bd8afb90ebf2 Modules/sha512module.c
+--- a/Modules/sha512module.c
++++ b/Modules/sha512module.c
+@@ -532,7 +532,9 @@
+         c = (digest[i] & 0xf);
+         hex_digest[j++] = Py_hexdigits[c];
+     }
++#ifdef Py_DEBUG
+     assert(_PyUnicode_CheckConsistency(retval, 1));
++#endif
+     return retval;
+ }
+ 
+diff -r bd8afb90ebf2 Modules/signalmodule.c
+--- a/Modules/signalmodule.c
++++ b/Modules/signalmodule.c
+@@ -4,6 +4,9 @@
+ /* XXX Signals should be recorded per thread, now we have thread state. */
+ 
+ #include "Python.h"
++#ifndef MS_WINDOWS
++#include "posixmodule.h"
++#endif
+ 
+ #ifdef MS_WINDOWS
+ #include <Windows.h>
+@@ -427,7 +430,7 @@
+         return NULL;
+     }
+ #endif
+-    if (fd != -1 && fstat(fd, &buf) != 0) {
++    if (fd != -1 && (!_PyVerify_fd(fd) || fstat(fd, &buf) != 0)) {
+         PyErr_SetString(PyExc_ValueError, "invalid fd");
+         return NULL;
+     }
+@@ -728,7 +731,7 @@
+     PyStructSequence_SET_ITEM(result, 1, PyLong_FromLong((long)(si->si_code)));
+     PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong((long)(si->si_errno)));
+     PyStructSequence_SET_ITEM(result, 3, PyLong_FromPid(si->si_pid));
+-    PyStructSequence_SET_ITEM(result, 4, PyLong_FromLong((long)(si->si_uid)));
++    PyStructSequence_SET_ITEM(result, 4, _PyLong_FromUid(si->si_uid));
+     PyStructSequence_SET_ITEM(result, 5,
+                                 PyLong_FromLong((long)(si->si_status)));
+     PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
+@@ -1367,9 +1370,8 @@
+ void
+ PyOS_InitInterrupts(void)
+ {
+-    PyObject *m = PyInit_signal();
++    PyObject *m = PyImport_ImportModule("signal");
+     if (m) {
+-        _PyImport_FixupBuiltin(m, "signal");
+         Py_DECREF(m);
+     }
+ }
+@@ -1394,9 +1396,25 @@
+     return 0;
+ }
+ 
++static void
++_clear_pending_signals(void)
++{
++    int i;
++    if (!is_tripped)
++        return;
++    is_tripped = 0;
++    for (i = 1; i < NSIG; ++i) {
++        Handlers[i].tripped = 0;
++    }
++}
++
+ void
+ PyOS_AfterFork(void)
+ {
++    /* Clear the signal flags after forking so that they aren't handled
++     * in both processes if they came in just before the fork() but before
++     * the interpreter had an opportunity to call the handlers.  issue9535. */
++    _clear_pending_signals();
+ #ifdef WITH_THREAD
+     /* PyThread_ReInitTLS() must be called early, to make sure that the TLS API
+      * can be called safely. */
+diff -r bd8afb90ebf2 Modules/socketmodule.c
+--- a/Modules/socketmodule.c
++++ b/Modules/socketmodule.c
+@@ -555,7 +555,7 @@
+                 /* If non-empty msg, trim CRLF */
+                 char *lastc = &outbuf[ strlen(outbuf)-1 ];
+                 while (lastc > outbuf &&
+-                       isspace(Py_CHARMASK(*lastc))) {
++                       Py_ISSPACE(Py_CHARMASK(*lastc))) {
+                     /* Trim trailing whitespace (CRLF) */
+                     *lastc-- = '\0';
+                 }
+@@ -1674,7 +1674,8 @@
+             if (len == 0) {
+                 ifr.ifr_ifindex = 0;
+             } else if (len < sizeof(ifr.ifr_name)) {
+-                strcpy(ifr.ifr_name, PyBytes_AS_STRING(interfaceName));
++                strncpy(ifr.ifr_name, PyBytes_AS_STRING(interfaceName), sizeof(ifr.ifr_name));
++                ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0';
+                 if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) {
+                     s->errorhandler();
+                     Py_DECREF(interfaceName);
+@@ -2072,7 +2073,7 @@
+ static PyObject *
+ sock_setblocking(PySocketSockObject *s, PyObject *arg)
+ {
+-    int block;
++    long block;
+ 
+     block = PyLong_AsLong(arg);
+     if (block == -1 && PyErr_Occurred())
+@@ -2554,7 +2555,7 @@
+     int backlog;
+     int res;
+ 
+-    backlog = PyLong_AsLong(arg);
++    backlog = _PyLong_AsInt(arg);
+     if (backlog == -1 && PyErr_Occurred())
+         return NULL;
+     Py_BEGIN_ALLOW_THREADS
+@@ -3711,7 +3712,7 @@
+     int how;
+     int res;
+ 
+-    how = PyLong_AsLong(arg);
++    how = _PyLong_AsInt(arg);
+     if (how == -1 && PyErr_Occurred())
+         return NULL;
+     Py_BEGIN_ALLOW_THREADS
+diff -r bd8afb90ebf2 Modules/sre.h
+--- a/Modules/sre.h
++++ b/Modules/sre.h
+@@ -16,6 +16,11 @@
+ /* size of a code word (must be unsigned short or larger, and
+    large enough to hold a UCS4 character) */
+ #define SRE_CODE Py_UCS4
++#if SIZEOF_SIZE_T > 4
++# define SRE_MAXREPEAT (~(SRE_CODE)0)
++#else
++# define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX + 1u)
++#endif
+ 
+ typedef struct {
+     PyObject_VAR_HEAD
+diff -r bd8afb90ebf2 Modules/symtablemodule.c
+--- a/Modules/symtablemodule.c
++++ b/Modules/symtablemodule.c
+@@ -63,6 +63,9 @@
+ {
+     PyObject *m;
+ 
++    if (PyType_Ready(&PySTEntry_Type) < 0)
++        return NULL;
++
+     m = PyModule_Create(&symtablemodule);
+     if (m == NULL)
+         return NULL;
+diff -r bd8afb90ebf2 Modules/unicodedata.c
+--- a/Modules/unicodedata.c
++++ b/Modules/unicodedata.c
+@@ -273,7 +273,7 @@
+ PyDoc_STRVAR(unicodedata_bidirectional__doc__,
+ "bidirectional(unichr)\n\
+ \n\
+-Returns the bidirectional category assigned to the Unicode character\n\
++Returns the bidirectional class assigned to the Unicode character\n\
+ unichr as string. If no such value is defined, an empty string is\n\
+ returned.");
+ 
+diff -r bd8afb90ebf2 Modules/xxmodule.c
+--- a/Modules/xxmodule.c
++++ b/Modules/xxmodule.c
+@@ -102,42 +102,42 @@
+     sizeof(XxoObject),          /*tp_basicsize*/
+     0,                          /*tp_itemsize*/
+     /* methods */
+-    (destructor)Xxo_dealloc, /*tp_dealloc*/
++    (destructor)Xxo_dealloc,    /*tp_dealloc*/
+     0,                          /*tp_print*/
+-    (getattrfunc)0,         /*tp_getattr*/
+-    (setattrfunc)Xxo_setattr, /*tp_setattr*/
++    (getattrfunc)0,             /*tp_getattr*/
++    (setattrfunc)Xxo_setattr,   /*tp_setattr*/
+     0,                          /*tp_reserved*/
+     0,                          /*tp_repr*/
+     0,                          /*tp_as_number*/
+     0,                          /*tp_as_sequence*/
+     0,                          /*tp_as_mapping*/
+     0,                          /*tp_hash*/
+-    0,                      /*tp_call*/
+-    0,                      /*tp_str*/
++    0,                          /*tp_call*/
++    0,                          /*tp_str*/
+     (getattrofunc)Xxo_getattro, /*tp_getattro*/
+-    0,                      /*tp_setattro*/
+-    0,                      /*tp_as_buffer*/
+-    Py_TPFLAGS_DEFAULT,     /*tp_flags*/
+-    0,                      /*tp_doc*/
+-    0,                      /*tp_traverse*/
+-    0,                      /*tp_clear*/
+-    0,                      /*tp_richcompare*/
+-    0,                      /*tp_weaklistoffset*/
+-    0,                      /*tp_iter*/
+-    0,                      /*tp_iternext*/
+-    Xxo_methods,            /*tp_methods*/
+-    0,                      /*tp_members*/
+-    0,                      /*tp_getset*/
+-    0,                      /*tp_base*/
+-    0,                      /*tp_dict*/
+-    0,                      /*tp_descr_get*/
+-    0,                      /*tp_descr_set*/
+-    0,                      /*tp_dictoffset*/
+-    0,                      /*tp_init*/
+-    0,                      /*tp_alloc*/
+-    0,                      /*tp_new*/
+-    0,                      /*tp_free*/
+-    0,                      /*tp_is_gc*/
++    0,                          /*tp_setattro*/
++    0,                          /*tp_as_buffer*/
++    Py_TPFLAGS_DEFAULT,         /*tp_flags*/
++    0,                          /*tp_doc*/
++    0,                          /*tp_traverse*/
++    0,                          /*tp_clear*/
++    0,                          /*tp_richcompare*/
++    0,                          /*tp_weaklistoffset*/
++    0,                          /*tp_iter*/
++    0,                          /*tp_iternext*/
++    Xxo_methods,                /*tp_methods*/
++    0,                          /*tp_members*/
++    0,                          /*tp_getset*/
++    0,                          /*tp_base*/
++    0,                          /*tp_dict*/
++    0,                          /*tp_descr_get*/
++    0,                          /*tp_descr_set*/
++    0,                          /*tp_dictoffset*/
++    0,                          /*tp_init*/
++    0,                          /*tp_alloc*/
++    0,                          /*tp_new*/
++    0,                          /*tp_free*/
++    0,                          /*tp_is_gc*/
+ };
+ /* --------------------------------------------------------------------- */
+ 
+diff -r bd8afb90ebf2 Modules/zipimport.c
+--- a/Modules/zipimport.c
++++ b/Modules/zipimport.c
+@@ -236,12 +236,16 @@
+         return NULL;
+     }
+ 
+-    if (!PyUnicode_AsUCS4(prefix, p, len, 0))
++    if (!PyUnicode_AsUCS4(prefix, p, len, 0)) {
++        PyMem_Free(buf);
+         return NULL;
++    }
+     p += PyUnicode_GET_LENGTH(prefix);
+     len -= PyUnicode_GET_LENGTH(prefix);
+-    if (!PyUnicode_AsUCS4(name, p, len, 1))
++    if (!PyUnicode_AsUCS4(name, p, len, 1)) {
++        PyMem_Free(buf);
+         return NULL;
++    }
+     for (; *p; p++) {
+         if (*p == '.')
+             *p = SEP;
+@@ -871,7 +875,12 @@
+             PyErr_Format(ZipImportError, "can't open Zip file: %R", archive);
+         return NULL;
+     }
+-    fseek(fp, -22, SEEK_END);
++
++    if (fseek(fp, -22, SEEK_END) == -1) {
++        fclose(fp);
++        PyErr_Format(ZipImportError, "can't read Zip file: %R", archive);
++        return NULL;
++    }
+     header_position = ftell(fp);
+     if (fread(endof_central_dir, 1, 22, fp) != 22) {
+         fclose(fp);
+@@ -900,11 +909,13 @@
+         PyObject *t;
+         int err;
+ 
+-        fseek(fp, header_offset, 0);  /* Start of file header */
++        if (fseek(fp, header_offset, 0) == -1)  /* Start of file header */
++            goto fseek_error;
+         l = PyMarshal_ReadLongFromFile(fp);
+         if (l != 0x02014B50)
+             break;              /* Bad: Central Dir File Header */
+-        fseek(fp, header_offset + 8, 0);
++        if (fseek(fp, header_offset + 8, 0) == -1)
++            goto fseek_error;
+         flags = (unsigned short)PyMarshal_ReadShortFromFile(fp);
+         compress = PyMarshal_ReadShortFromFile(fp);
+         time = PyMarshal_ReadShortFromFile(fp);
+@@ -916,7 +927,8 @@
+         header_size = 46 + name_size +
+            PyMarshal_ReadShortFromFile(fp) +
+            PyMarshal_ReadShortFromFile(fp);
+-        fseek(fp, header_offset + 42, 0);
++        if (fseek(fp, header_offset + 42, 0) == -1)
++            goto fseek_error;
+         file_offset = PyMarshal_ReadLongFromFile(fp) + arc_offset;
+         if (name_size > MAXPATHLEN)
+             name_size = MAXPATHLEN;
+@@ -976,6 +988,12 @@
+         PySys_FormatStderr("# zipimport: found %ld names in %R\n",
+                            count, archive);
+     return files;
++fseek_error:
++    fclose(fp);
++    Py_XDECREF(files);
++    Py_XDECREF(nameobj);
++    PyErr_Format(ZipImportError, "can't read Zip file: %R", archive);
++    return NULL;
+ error:
+     fclose(fp);
+     Py_XDECREF(files);
+@@ -1046,7 +1064,12 @@
+     }
+ 
+     /* Check to make sure the local file header is correct */
+-    fseek(fp, file_offset, 0);
++    if (fseek(fp, file_offset, 0) == -1) {
++        fclose(fp);
++        PyErr_Format(ZipImportError, "can't read Zip file: %R", archive);
++        return NULL;
++    }
++
+     l = PyMarshal_ReadLongFromFile(fp);
+     if (l != 0x04034B50) {
+         /* Bad: Local File Header */
+@@ -1056,7 +1079,12 @@
+         fclose(fp);
+         return NULL;
+     }
+-    fseek(fp, file_offset + 26, 0);
++    if (fseek(fp, file_offset + 26, 0) == -1) {
++        fclose(fp);
++        PyErr_Format(ZipImportError, "can't read Zip file: %R", archive);
++        return NULL;
++    }
++
+     l = 30 + PyMarshal_ReadShortFromFile(fp) +
+         PyMarshal_ReadShortFromFile(fp);        /* local header size */
+     file_offset += l;           /* Start of file data */
+@@ -1073,8 +1101,13 @@
+     buf = PyBytes_AsString(raw_data);
+ 
+     err = fseek(fp, file_offset, 0);
+-    if (err == 0)
++    if (err == 0) {
+         bytes_read = fread(buf, 1, data_size, fp);
++    } else {
++        fclose(fp);
++        PyErr_Format(ZipImportError, "can't read Zip file: %R", archive);
++        return NULL;
++    }
+     fclose(fp);
+     if (err || bytes_read != data_size) {
+         PyErr_SetString(PyExc_IOError,
+diff -r bd8afb90ebf2 Modules/zlibmodule.c
+--- a/Modules/zlibmodule.c
++++ b/Modules/zlibmodule.c
+@@ -139,7 +139,7 @@
+ PyDoc_STRVAR(compress__doc__,
+ "compress(string[, level]) -- Returned compressed string.\n"
+ "\n"
+-"Optional arg level is the compression level, in 1-9.");
++"Optional arg level is the compression level, in 0-9.");
+ 
+ static PyObject *
+ PyZlib_compress(PyObject *self, PyObject *args)
+@@ -561,6 +561,49 @@
+     return RetVal;
+ }
+ 
++/* Helper for objdecompress() and unflush(). Saves any unconsumed input data in
++   self->unused_data or self->unconsumed_tail, as appropriate. */
++static int
++save_unconsumed_input(compobject *self, int err)
++{
++    if (err == Z_STREAM_END) {
++        /* The end of the compressed data has been reached. Store the leftover
++           input data in self->unused_data. */
++        if (self->zst.avail_in > 0) {
++            Py_ssize_t old_size = PyBytes_GET_SIZE(self->unused_data);
++            Py_ssize_t new_size;
++            PyObject *new_data;
++            if (self->zst.avail_in > PY_SSIZE_T_MAX - old_size) {
++                PyErr_NoMemory();
++                return -1;
++            }
++            new_size = old_size + self->zst.avail_in;
++            new_data = PyBytes_FromStringAndSize(NULL, new_size);
++            if (new_data == NULL)
++                return -1;
++            Py_MEMCPY(PyBytes_AS_STRING(new_data),
++                      PyBytes_AS_STRING(self->unused_data), old_size);
++            Py_MEMCPY(PyBytes_AS_STRING(new_data) + old_size,
++                      self->zst.next_in, self->zst.avail_in);
++            Py_DECREF(self->unused_data);
++            self->unused_data = new_data;
++            self->zst.avail_in = 0;
++        }
++    }
++    if (self->zst.avail_in > 0 || PyBytes_GET_SIZE(self->unconsumed_tail)) {
++        /* This code handles two distinct cases:
++           1. Output limit was reached. Save leftover input in unconsumed_tail.
++           2. All input data was consumed. Clear unconsumed_tail. */
++        PyObject *new_data = PyBytes_FromStringAndSize(
++                (char *)self->zst.next_in, self->zst.avail_in);
++        if (new_data == NULL)
++            return -1;
++        Py_DECREF(self->unconsumed_tail);
++        self->unconsumed_tail = new_data;
++    }
++    return 0;
++}
++
+ PyDoc_STRVAR(decomp_decompress__doc__,
+ "decompress(data, max_length) -- Return a string containing the decompressed\n"
+ "version of the data.\n"
+@@ -668,44 +711,21 @@
+         Py_END_ALLOW_THREADS
+     }
+ 
+-    if(max_length) {
+-        /* Not all of the compressed data could be accommodated in a buffer of
+-           the specified size. Return the unconsumed tail in an attribute. */
+-        Py_DECREF(self->unconsumed_tail);
+-        self->unconsumed_tail = PyBytes_FromStringAndSize((char *)self->zst.next_in,
+-                                                           self->zst.avail_in);
+-    }
+-    else if (PyBytes_GET_SIZE(self->unconsumed_tail) > 0) {
+-        /* All of the compressed data was consumed. Clear unconsumed_tail. */
+-        Py_DECREF(self->unconsumed_tail);
+-        self->unconsumed_tail = PyBytes_FromStringAndSize("", 0);
+-    }
+-    if (self->unconsumed_tail == NULL) {
++    if (save_unconsumed_input(self, err) < 0) {
+         Py_DECREF(RetVal);
+         RetVal = NULL;
+         goto error;
+     }
+ 
+-    /* The end of the compressed data has been reached, so set the
+-       unused_data attribute to a string containing the remainder of the
+-       data in the string.  Note that this is also a logical place to call
+-       inflateEnd, but the old behaviour of only calling it on flush() is
+-       preserved.
+-    */
+     if (err == Z_STREAM_END) {
+-        Py_XDECREF(self->unused_data);  /* Free original empty string */
+-        self->unused_data = PyBytes_FromStringAndSize(
+-            (char *)self->zst.next_in, self->zst.avail_in);
+-        if (self->unused_data == NULL) {
+-            Py_DECREF(RetVal);
+-            goto error;
+-        }
++        /* This is the logical place to call inflateEnd, but the old behaviour
++           of only calling it on flush() is preserved. */
+         self->eof = 1;
++    } else if (err != Z_OK && err != Z_BUF_ERROR) {
+         /* We will only get Z_BUF_ERROR if the output buffer was full
+            but there wasn't more output when we tried again, so it is
+            not an error condition.
+         */
+-    } else if (err != Z_OK && err != Z_BUF_ERROR) {
+         zlib_error(self->zst, err, "while decompressing data");
+         Py_DECREF(RetVal);
+         RetVal = NULL;
+@@ -955,6 +975,8 @@
+     ENTER_ZLIB(self);
+ 
+     start_total_out = self->zst.total_out;
++    self->zst.avail_in = PyBytes_GET_SIZE(self->unconsumed_tail);
++    self->zst.next_in = (Byte *)PyBytes_AS_STRING(self->unconsumed_tail);
+     self->zst.avail_out = length;
+     self->zst.next_out = (Byte *)PyBytes_AS_STRING(retval);
+ 
+@@ -979,6 +1001,12 @@
+         Py_END_ALLOW_THREADS
+     }
+ 
++    if (save_unconsumed_input(self, err) < 0) {
++        Py_DECREF(retval);
++        retval = NULL;
++        goto error;
++    }
++
+     /* If at end of stream, clean up any memory allocated by zlib. */
+     if (err == Z_STREAM_END) {
+         self->eof = 1;
+@@ -991,6 +1019,7 @@
+             goto error;
+         }
+     }
++
+     if (_PyBytes_Resize(&retval, self->zst.total_out - start_total_out) < 0) {
+         Py_DECREF(retval);
+         retval = NULL;
+@@ -1198,7 +1227,7 @@
+ "zlib library, which is based on GNU zip.\n"
+ "\n"
+ "adler32(string[, start]) -- Compute an Adler-32 checksum.\n"
+-"compress(string[, level]) -- Compress string, with compression level in 1-9.\n"
++"compress(string[, level]) -- Compress string, with compression level in 0-9.\n"
+ "compressobj([level[, ...]]) -- Return a compressor object.\n"
+ "crc32(string[, start]) -- Compute a CRC-32 checksum.\n"
+ "decompress(string,[wbits],[bufsize]) -- Decompresses a compressed string.\n"
+diff -r bd8afb90ebf2 Objects/bytearrayobject.c
+--- a/Objects/bytearrayobject.c
++++ b/Objects/bytearrayobject.c
+@@ -589,8 +589,14 @@
+         needed = 0;
+     }
+     else if (values == (PyObject *)self || !PyByteArray_Check(values)) {
++        int err;
++        if (PyNumber_Check(values) || PyUnicode_Check(values)) {
++            PyErr_SetString(PyExc_TypeError,
++                            "can assign only bytes, buffers, or iterables "
++                            "of ints in range(0, 256)");
++            return -1;
++        }
+         /* Make a copy and call this function recursively */
+-        int err;
+         values = PyByteArray_FromObject(values);
+         if (values == NULL)
+             return -1;
+diff -r bd8afb90ebf2 Objects/bytesobject.c
+--- a/Objects/bytesobject.c
++++ b/Objects/bytesobject.c
+@@ -465,8 +465,9 @@
+                 break;
+             }
+             if (!errors || strcmp(errors, "strict") == 0) {
+-                PyErr_SetString(PyExc_ValueError,
+-                                "invalid \\x escape");
++                PyErr_Format(PyExc_ValueError,
++                             "invalid \\x escape at position %d",
++                             s - 2 - (end - len));
+                 goto failed;
+             }
+             if (strcmp(errors, "replace") == 0) {
+@@ -480,6 +481,10 @@
+                              errors);
+                 goto failed;
+             }
++            /* skip \x */
++            if (s < end && Py_ISXDIGIT(s[0]))
++                s++; /* and a hexdigit */
++            break;
+         default:
+             *p++ = '\\';
+             s--;
+@@ -2505,8 +2510,10 @@
+     const char *encoding = NULL;
+     const char *errors = NULL;
+     PyObject *new = NULL;
++    PyObject *func;
+     Py_ssize_t size;
+     static char *kwlist[] = {"source", "encoding", "errors", 0};
++    _Py_IDENTIFIER(__bytes__);
+ 
+     if (type != &PyBytes_Type)
+         return str_subtype_new(type, args, kwds);
+@@ -2536,6 +2543,28 @@
+         assert(PyBytes_Check(new));
+         return new;
+     }
++
++    /* We'd like to call PyObject_Bytes here, but we need to check for an
++       integer argument before deferring to PyBytes_FromObject, something
++       PyObject_Bytes doesn't do. */
++    func = _PyObject_LookupSpecial(x, &PyId___bytes__);
++    if (func != NULL) {
++        new = PyObject_CallFunctionObjArgs(func, NULL);
++        Py_DECREF(func);
++        if (new == NULL)
++            return NULL;
++        if (!PyBytes_Check(new)) {
++            PyErr_Format(PyExc_TypeError,
++                         "__bytes__ returned non-bytes (type %.200s)",
++                         Py_TYPE(new)->tp_name);
++            Py_DECREF(new);
++            return NULL;
++        }
++        return new;
++    }
++    else if (PyErr_Occurred())
++        return NULL;
++
+     /* Is it an integer? */
+     size = PyNumber_AsSsize_t(x, PyExc_OverflowError);
+     if (size == -1 && PyErr_Occurred()) {
+@@ -2549,12 +2578,10 @@
+     }
+     else {
+         new = PyBytes_FromStringAndSize(NULL, size);
+-        if (new == NULL) {
++        if (new == NULL)
+             return NULL;
+-        }
+-        if (size > 0) {
++        if (size > 0)
+             memset(((PyBytesObject*)new)->ob_sval, 0, size);
+-        }
+         return new;
+     }
+ 
+@@ -2564,7 +2591,8 @@
+             "encoding or errors without a string argument");
+         return NULL;
+     }
+-    return PyObject_Bytes(x);
++
++    return PyBytes_FromObject(x);
+ }
+ 
+ PyObject *
+@@ -2804,8 +2832,7 @@
+     if (*pv == NULL)
+         return;
+     if (w == NULL) {
+-        Py_DECREF(*pv);
+-        *pv = NULL;
++        Py_CLEAR(*pv);
+         return;
+     }
+     v = bytes_concat(*pv, w);
+@@ -2869,12 +2896,9 @@
+ PyBytes_Fini(void)
+ {
+     int i;
+-    for (i = 0; i < UCHAR_MAX + 1; i++) {
+-        Py_XDECREF(characters[i]);
+-        characters[i] = NULL;
+-    }
+-    Py_XDECREF(nullstring);
+-    nullstring = NULL;
++    for (i = 0; i < UCHAR_MAX + 1; i++)
++        Py_CLEAR(characters[i]);
++    Py_CLEAR(nullstring);
+ }
+ 
+ /*********************** Bytes Iterator ****************************/
+diff -r bd8afb90ebf2 Objects/classobject.c
+--- a/Objects/classobject.c
++++ b/Objects/classobject.c
+@@ -219,7 +219,7 @@
+ {
+     PyObject *self = a->im_self;
+     PyObject *func = a->im_func;
+-    PyObject *klass = (PyObject*)Py_TYPE(self);
++    PyObject *klass;
+     PyObject *funcname = NULL ,*klassname = NULL, *result = NULL;
+     char *defname = "?";
+ 
+@@ -227,6 +227,7 @@
+         PyErr_BadInternalCall();
+         return NULL;
+     }
++    klass = (PyObject*)Py_TYPE(self);
+ 
+     funcname = _PyObject_GetAttrId(func, &PyId___name__);
+     if (funcname == NULL) {
+diff -r bd8afb90ebf2 Objects/dictobject.c
+--- a/Objects/dictobject.c
++++ b/Objects/dictobject.c
+@@ -1707,45 +1707,46 @@
+     if (d == NULL)
+         return NULL;
+ 
+-    if (PyDict_CheckExact(d) && PyDict_CheckExact(seq)) {
+-        PyDictObject *mp = (PyDictObject *)d;
+-        PyObject *oldvalue;
+-        Py_ssize_t pos = 0;
+-        PyObject *key;
+-        Py_hash_t hash;
+-
+-        if (dictresize(mp, Py_SIZE(seq))) {
+-            Py_DECREF(d);
+-            return NULL;
+-        }
+-
+-        while (_PyDict_Next(seq, &pos, &key, &oldvalue, &hash)) {
+-            if (insertdict(mp, key, hash, value)) {
++    if (PyDict_CheckExact(d) && ((PyDictObject *)d)->ma_used == 0) {
++        if (PyDict_CheckExact(seq)) {
++            PyDictObject *mp = (PyDictObject *)d;
++            PyObject *oldvalue;
++            Py_ssize_t pos = 0;
++            PyObject *key;
++            Py_hash_t hash;
++
++            if (dictresize(mp, Py_SIZE(seq))) {
+                 Py_DECREF(d);
+                 return NULL;
+             }
++
++            while (_PyDict_Next(seq, &pos, &key, &oldvalue, &hash)) {
++                if (insertdict(mp, key, hash, value)) {
++                    Py_DECREF(d);
++                    return NULL;
++                }
++            }
++            return d;
+         }
+-        return d;
+-    }
+-
+-    if (PyDict_CheckExact(d) && PyAnySet_CheckExact(seq)) {
+-        PyDictObject *mp = (PyDictObject *)d;
+-        Py_ssize_t pos = 0;
+-        PyObject *key;
+-        Py_hash_t hash;
+-
+-        if (dictresize(mp, PySet_GET_SIZE(seq))) {
+-            Py_DECREF(d);
+-            return NULL;
+-        }
+-
+-        while (_PySet_NextEntry(seq, &pos, &key, &hash)) {
+-            if (insertdict(mp, key, hash, value)) {
++        if (PyAnySet_CheckExact(seq)) {
++            PyDictObject *mp = (PyDictObject *)d;
++            Py_ssize_t pos = 0;
++            PyObject *key;
++            Py_hash_t hash;
++
++            if (dictresize(mp, PySet_GET_SIZE(seq))) {
+                 Py_DECREF(d);
+                 return NULL;
+             }
++
++            while (_PySet_NextEntry(seq, &pos, &key, &hash)) {
++                if (insertdict(mp, key, hash, value)) {
++                    Py_DECREF(d);
++                    return NULL;
++                }
++            }
++            return d;
+         }
+-        return d;
+     }
+ 
+     it = PyObject_GetIter(seq);
+diff -r bd8afb90ebf2 Objects/fileobject.c
+--- a/Objects/fileobject.c
++++ b/Objects/fileobject.c
+@@ -200,7 +200,7 @@
+     _Py_IDENTIFIER(fileno);
+ 
+     if (PyLong_Check(o)) {
+-        fd = PyLong_AsLong(o);
++        fd = _PyLong_AsInt(o);
+     }
+     else if ((meth = _PyObject_GetAttrId(o, &PyId_fileno)) != NULL)
+     {
+@@ -210,7 +210,7 @@
+             return -1;
+ 
+         if (PyLong_Check(fno)) {
+-            fd = PyLong_AsLong(fno);
++            fd = _PyLong_AsInt(fno);
+             Py_DECREF(fno);
+         }
+         else {
+diff -r bd8afb90ebf2 Objects/floatobject.c
+--- a/Objects/floatobject.c
++++ b/Objects/floatobject.c
+@@ -289,7 +289,7 @@
+  * may lose info from fractional bits.  Converting the integer to a double
+  * also has two failure modes:  (1) a long int may trigger overflow (too
+  * large to fit in the dynamic range of a C double); (2) even a C long may have
+- * more bits than fit in a C double (e.g., on a a 64-bit box long may have
++ * more bits than fit in a C double (e.g., on a 64-bit box long may have
+  * 63 bits of precision, but a C double probably has only 53), and then
+  * we can falsely claim equality when low-order integer bits are lost by
+  * coercion to double.  So this part is painful too.
+diff -r bd8afb90ebf2 Objects/longobject.c
+--- a/Objects/longobject.c
++++ b/Objects/longobject.c
+@@ -30,7 +30,7 @@
+ */
+ static PyLongObject small_ints[NSMALLNEGINTS + NSMALLPOSINTS];
+ #ifdef COUNT_ALLOCS
+-int quick_int_allocs, quick_neg_int_allocs;
++Py_ssize_t quick_int_allocs, quick_neg_int_allocs;
+ #endif
+ 
+ static PyObject *
+@@ -434,6 +434,24 @@
+     return result;
+ }
+ 
++/* Get a C int from a long int object or any object that has an __int__
++   method.  Return -1 and set an error if overflow occurs. */
++
++int
++_PyLong_AsInt(PyObject *obj)
++{
++    int overflow;
++    long result = PyLong_AsLongAndOverflow(obj, &overflow);
++    if (overflow || result > INT_MAX || result < INT_MIN) {
++        /* XXX: could be cute and give a different
++           message for overflow == -1 */
++        PyErr_SetString(PyExc_OverflowError,
++                        "Python int too large to convert to C int");
++        return -1;
++    }
++    return (int)result;
++}
++
+ /* Get a Py_ssize_t from a long int object.
+    Returns -1 and sets an error condition if overflow occurs. */
+ 
+@@ -668,10 +686,9 @@
+     assert(ndigits == 0 || v->ob_digit[ndigits - 1] != 0);
+     if (ndigits > 0) {
+         digit msd = v->ob_digit[ndigits - 1];
+-
+-        result = (ndigits - 1) * PyLong_SHIFT;
+-        if (result / PyLong_SHIFT != (size_t)(ndigits - 1))
++        if ((size_t)(ndigits - 1) > PY_SIZE_MAX / (size_t)PyLong_SHIFT)
+             goto Overflow;
++        result = (size_t)(ndigits - 1) * (size_t)PyLong_SHIFT;
+         do {
+             ++result;
+             if (result == 0)
+@@ -936,6 +953,13 @@
+ PyObject *
+ PyLong_FromVoidPtr(void *p)
+ {
++#if SIZEOF_VOID_P <= SIZEOF_LONG
++    /* special-case null pointer */
++    if (!p)
++        return PyLong_FromLong(0);
++    return PyLong_FromUnsignedLong((unsigned long)(Py_uintptr_t)p);
++#else
++
+ #ifndef HAVE_LONG_LONG
+ #   error "PyLong_FromVoidPtr: sizeof(void*) > sizeof(long), but no long long"
+ #endif
+@@ -946,6 +970,7 @@
+     if (!p)
+         return PyLong_FromLong(0);
+     return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)(Py_uintptr_t)p);
++#endif /* SIZEOF_VOID_P <= SIZEOF_LONG */
+ 
+ }
+ 
+@@ -1628,8 +1653,10 @@
+         strlen++;
+     }
+     if (writer) {
+-        if (_PyUnicodeWriter_Prepare(writer, strlen, '9') == -1)
++        if (_PyUnicodeWriter_Prepare(writer, strlen, '9') == -1) {
++            Py_DECREF(scratch);
+             return -1;
++        }
+         kind = writer->kind;
+         str = NULL;
+     }
+@@ -1992,7 +2019,7 @@
+                         "int() arg 2 must be >= 2 and <= 36");
+         return NULL;
+     }
+-    while (*str != '\0' && isspace(Py_CHARMASK(*str)))
++    while (*str != '\0' && Py_ISSPACE(Py_CHARMASK(*str)))
+         str++;
+     if (*str == '+')
+         ++str;
+@@ -2236,7 +2263,7 @@
+         goto onError;
+     if (sign < 0)
+         Py_SIZE(z) = -(Py_SIZE(z));
+-    while (*str && isspace(Py_CHARMASK(*str)))
++    while (*str && Py_ISSPACE(Py_CHARMASK(*str)))
+         str++;
+     if (*str != '\0')
+         goto onError;
+@@ -4258,8 +4285,14 @@
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OO:int", kwlist,
+                                      &x, &obase))
+         return NULL;
+-    if (x == NULL)
++    if (x == NULL) {
++        if (obase != NULL) {
++            PyErr_SetString(PyExc_TypeError,
++                            "int() missing string argument");
++            return NULL;
++        }
+         return PyLong_FromLong(0L);
++    }
+     if (obase == NULL)
+         return PyNumber_Long(x);
+ 
+@@ -4268,7 +4301,7 @@
+         return NULL;
+     if (overflow || (base != 0 && base < 2) || base > 36) {
+         PyErr_SetString(PyExc_ValueError,
+-                        "int() arg 2 must be >= 2 and <= 36");
++                        "int() base must be >= 2 and <= 36");
+         return NULL;
+     }
+ 
+@@ -4283,8 +4316,8 @@
+             string = PyByteArray_AS_STRING(x);
+         else
+             string = PyBytes_AS_STRING(x);
+-        if (strlen(string) != (size_t)size) {
+-            /* We only see this if there's a null byte in x,
++        if (strlen(string) != (size_t)size || !size) {
++            /* We only see this if there's a null byte in x or x is empty,
+                x is a bytes or buffer, *and* a base is given. */
+             PyErr_Format(PyExc_ValueError,
+                          "invalid literal for int() with base %d: %R",
+@@ -4847,13 +4880,20 @@
+ };
+ 
+ PyDoc_STRVAR(long_doc,
+-"int(x[, base]) -> integer\n\
++"int(x=0) -> integer\n\
++int(x, base=10) -> integer\n\
+ \n\
+-Convert a string or number to an integer, if possible.  A floating\n\
+-point argument will be truncated towards zero (this does not include a\n\
+-string representation of a floating point number!)  When converting a\n\
+-string, use the optional base.  It is an error to supply a base when\n\
+-converting a non-string.");
++Convert a number or string to an integer, or return 0 if no arguments\n\
++are given.  If x is a number, return x.__int__().  For floating point\n\
++numbers, this truncates towards zero.\n\
++\n\
++If x is not a number or if base is given, then x must be a string,\n\
++bytes, or bytearray instance representing an integer literal in the\n\
++given base.  The literal can be preceded by '+' or '-' and be surrounded\n\
++by whitespace.  The base defaults to 10.  Valid bases are 0 and 2-36.\n\
++Base 0 means to interpret the base from the string as an integer literal.\n\
++>>> int('0b100', base=0)\n\
++4");
+ 
+ static PyNumberMethods long_as_number = {
+     (binaryfunc)long_add,       /*nb_add*/
+diff -r bd8afb90ebf2 Objects/memoryobject.c
+--- a/Objects/memoryobject.c
++++ b/Objects/memoryobject.c
+@@ -307,7 +307,8 @@
+     if (!equiv_format(dest, src) ||
+         !equiv_shape(dest, src)) {
+         PyErr_SetString(PyExc_ValueError,
+-            "ndarray assignment: lvalue and rvalue have different structures");
++            "memoryview assignment: lvalue and rvalue have different "
++            "structures");
+         return 0;
+     }
+ 
+@@ -1433,7 +1434,7 @@
+             /* PyBUF_SIMPLE|PyBUF_FORMAT and PyBUF_WRITABLE|PyBUF_FORMAT do
+                not make sense. */
+             PyErr_Format(PyExc_BufferError,
+-                "ndarray: cannot cast to unsigned bytes if the format flag "
++                "memoryview: cannot cast to unsigned bytes if the format flag "
+                 "is present");
+             return -1;
+         }
+@@ -2707,6 +2708,8 @@
+     if (self->hash == -1) {
+         Py_buffer *view = &self->view;
+         char *mem = view->buf;
++        Py_ssize_t ret;
++        char fmt;
+ 
+         CHECK_RELEASED_INT(self);
+ 
+@@ -2715,6 +2718,12 @@
+                 "cannot hash writable memoryview object");
+             return -1;
+         }
++        ret = get_native_fmtchar(&fmt, view->format);
++        if (ret < 0 || !IS_BYTE_FORMAT(fmt)) {
++            PyErr_SetString(PyExc_ValueError,
++                "memoryview: hashing is restricted to formats 'B', 'b' or 'c'");
++            return -1;
++        }
+         if (view->obj != NULL && PyObject_Hash(view->obj) == -1) {
+             /* Keep the original error message */
+             return -1;
+@@ -2861,28 +2870,74 @@
+     return PyBool_FromLong(MV_ANY_CONTIGUOUS(self->flags));
+ }
+ 
++PyDoc_STRVAR(memory_obj_doc,
++             "The underlying object of the memoryview.");
++PyDoc_STRVAR(memory_nbytes_doc,
++             "The amount of space in bytes that the array would use in\n"
++             " a contiguous representation.");
++PyDoc_STRVAR(memory_readonly_doc,
++             "A bool indicating whether the memory is read only.");
++PyDoc_STRVAR(memory_itemsize_doc,
++             "The size in bytes of each element of the memoryview.");
++PyDoc_STRVAR(memory_format_doc,
++             "A string containing the format (in struct module style)\n"
++             " for each element in the view.");
++PyDoc_STRVAR(memory_ndim_doc,
++             "An integer indicating how many dimensions of a multi-dimensional\n"
++             " array the memory represents.");
++PyDoc_STRVAR(memory_shape_doc,
++             "A tuple of ndim integers giving the shape of the memory\n"
++             " as an N-dimensional array.");
++PyDoc_STRVAR(memory_strides_doc,
++             "A tuple of ndim integers giving the size in bytes to access\n"
++             " each element for each dimension of the array.");
++PyDoc_STRVAR(memory_suboffsets_doc,
++             "A tuple of integers used internally for PIL-style arrays.");
++PyDoc_STRVAR(memory_c_contiguous_doc,
++             "A bool indicating whether the memory is C contiguous.");
++PyDoc_STRVAR(memory_f_contiguous_doc,
++             "A bool indicating whether the memory is Fortran contiguous.");
++PyDoc_STRVAR(memory_contiguous_doc,
++             "A bool indicating whether the memory is contiguous.");
++
+ static PyGetSetDef memory_getsetlist[] = {
+-    {"obj",             (getter)memory_obj_get,        NULL, NULL},
+-    {"nbytes",          (getter)memory_nbytes_get,     NULL, NULL},
+-    {"readonly",        (getter)memory_readonly_get,   NULL, NULL},
+-    {"itemsize",        (getter)memory_itemsize_get,   NULL, NULL},
+-    {"format",          (getter)memory_format_get,     NULL, NULL},
+-    {"ndim",            (getter)memory_ndim_get,       NULL, NULL},
+-    {"shape",           (getter)memory_shape_get,      NULL, NULL},
+-    {"strides",         (getter)memory_strides_get,    NULL, NULL},
+-    {"suboffsets",      (getter)memory_suboffsets_get, NULL, NULL},
+-    {"c_contiguous",    (getter)memory_c_contiguous,   NULL, NULL},
+-    {"f_contiguous",    (getter)memory_f_contiguous,   NULL, NULL},
+-    {"contiguous",      (getter)memory_contiguous,     NULL, NULL},
++    {"obj",             (getter)memory_obj_get,        NULL, memory_obj_doc},
++    {"nbytes",          (getter)memory_nbytes_get,     NULL, memory_nbytes_doc},
++    {"readonly",        (getter)memory_readonly_get,   NULL, memory_readonly_doc},
++    {"itemsize",        (getter)memory_itemsize_get,   NULL, memory_itemsize_doc},
++    {"format",          (getter)memory_format_get,     NULL, memory_format_doc},
++    {"ndim",            (getter)memory_ndim_get,       NULL, memory_ndim_doc},
++    {"shape",           (getter)memory_shape_get,      NULL, memory_shape_doc},
++    {"strides",         (getter)memory_strides_get,    NULL, memory_strides_doc},
++    {"suboffsets",      (getter)memory_suboffsets_get, NULL, memory_suboffsets_doc},
++    {"c_contiguous",    (getter)memory_c_contiguous,   NULL, memory_c_contiguous_doc},
++    {"f_contiguous",    (getter)memory_f_contiguous,   NULL, memory_f_contiguous_doc},
++    {"contiguous",      (getter)memory_contiguous,     NULL, memory_contiguous_doc},
+     {NULL, NULL, NULL, NULL},
+ };
+ 
++PyDoc_STRVAR(memory_release_doc,
++"M.release() -> None\n\
++\n\
++Release the underlying buffer exposed by the memoryview object.");
++PyDoc_STRVAR(memory_tobytes_doc,
++"M.tobytes() -> bytes\n\
++\n\
++Return the data in the buffer as a byte string.");
++PyDoc_STRVAR(memory_tolist_doc,
++"M.tolist() -> list\n\
++\n\
++Return the data in the buffer as a list of elements.");
++PyDoc_STRVAR(memory_cast_doc,
++"M.cast(format[, shape]) -> memoryview\n\
++\n\
++Cast a memoryview to a new format or shape.");
+ 
+ static PyMethodDef memory_methods[] = {
+-    {"release",     (PyCFunction)memory_release, METH_NOARGS, NULL},
+-    {"tobytes",     (PyCFunction)memory_tobytes, METH_NOARGS, NULL},
+-    {"tolist",      (PyCFunction)memory_tolist, METH_NOARGS, NULL},
+-    {"cast",        (PyCFunction)memory_cast, METH_VARARGS|METH_KEYWORDS, NULL},
++    {"release",     (PyCFunction)memory_release, METH_NOARGS, memory_release_doc},
++    {"tobytes",     (PyCFunction)memory_tobytes, METH_NOARGS, memory_tobytes_doc},
++    {"tolist",      (PyCFunction)memory_tolist, METH_NOARGS, memory_tolist_doc},
++    {"cast",        (PyCFunction)memory_cast, METH_VARARGS|METH_KEYWORDS, memory_cast_doc},
+     {"__enter__",   memory_enter, METH_NOARGS, NULL},
+     {"__exit__",    memory_exit, METH_VARARGS, NULL},
+     {NULL,          NULL}
+diff -r bd8afb90ebf2 Objects/methodobject.c
+--- a/Objects/methodobject.c
++++ b/Objects/methodobject.c
+@@ -343,8 +343,8 @@
+ _PyCFunction_DebugMallocStats(FILE *out)
+ {
+     _PyDebugAllocatorStats(out,
+-                           "free PyCFunction",
+-                           numfree, sizeof(PyCFunction));
++                           "free PyCFunctionObjects",
++                           numfree, sizeof(PyCFunctionObject));
+ }
+ 
+ /* PyCFunction_New() is now just a macro that calls PyCFunction_NewEx(),
+diff -r bd8afb90ebf2 Objects/namespaceobject.c
+--- a/Objects/namespaceobject.c
++++ b/Objects/namespaceobject.c
+@@ -21,19 +21,19 @@
+ static PyObject *
+ namespace_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+ {
+-    _PyNamespaceObject *ns;
+-    ns = PyObject_GC_New(_PyNamespaceObject, &_PyNamespace_Type);
+-    if (ns == NULL)
+-        return NULL;
++    PyObject *self;
+ 
+-    ns->ns_dict = PyDict_New();
+-    if (ns->ns_dict == NULL) {
+-        Py_DECREF(ns);
+-        return NULL;
++    assert(type != NULL && type->tp_alloc != NULL);
++    self = type->tp_alloc(type, 0);
++    if (self != NULL) {
++        _PyNamespaceObject *ns = (_PyNamespaceObject *)self;
++        ns->ns_dict = PyDict_New();
++        if (ns->ns_dict == NULL) {
++            Py_DECREF(ns);
++            return NULL;
++        }
+     }
+-
+-    PyObject_GC_Track(ns);
+-    return (PyObject *)ns;
++    return self;
+ }
+ 
+ 
+diff -r bd8afb90ebf2 Objects/object.c
+--- a/Objects/object.c
++++ b/Objects/object.c
+@@ -1710,6 +1710,30 @@
+ 
+     if (PyType_Ready(&_PyNamespace_Type) < 0)
+         Py_FatalError("Can't initialize namespace type");
++
++    if (PyType_Ready(&PyCapsule_Type) < 0)
++        Py_FatalError("Can't initialize capsule type");
++
++    if (PyType_Ready(&PyLongRangeIter_Type) < 0)
++        Py_FatalError("Can't initialize long range iterator type");
++
++    if (PyType_Ready(&PyCell_Type) < 0)
++        Py_FatalError("Can't initialize cell type");
++
++    if (PyType_Ready(&PyInstanceMethod_Type) < 0)
++        Py_FatalError("Can't initialize instance method type");
++
++    if (PyType_Ready(&PyClassMethodDescr_Type) < 0)
++        Py_FatalError("Can't initialize class method descr type");
++
++    if (PyType_Ready(&PyMethodDescr_Type) < 0)
++        Py_FatalError("Can't initialize method descr type");
++
++    if (PyType_Ready(&PyCallIter_Type) < 0)
++        Py_FatalError("Can't initialize call iter type");
++
++    if (PyType_Ready(&PySeqIter_Type) < 0)
++        Py_FatalError("Can't initialize sequence iterator type");
+ }
+ 
+ 
+diff -r bd8afb90ebf2 Objects/obmalloc.c
+--- a/Objects/obmalloc.c
++++ b/Objects/obmalloc.c
+@@ -138,7 +138,6 @@
+  */
+ #define ALIGNMENT               8               /* must be 2^N */
+ #define ALIGNMENT_SHIFT         3
+-#define ALIGNMENT_MASK          (ALIGNMENT - 1)
+ 
+ /* Return the number of bytes in size class I, as a uint. */
+ #define INDEX2SIZE(I) (((uint)(I) + 1) << ALIGNMENT_SHIFT)
+@@ -314,14 +313,12 @@
+     struct arena_object* prevarena;
+ };
+ 
+-#undef  ROUNDUP
+-#define ROUNDUP(x)              (((x) + ALIGNMENT_MASK) & ~ALIGNMENT_MASK)
+-#define POOL_OVERHEAD           ROUNDUP(sizeof(struct pool_header))
++#define POOL_OVERHEAD   _Py_SIZE_ROUND_UP(sizeof(struct pool_header), ALIGNMENT)
+ 
+ #define DUMMY_SIZE_IDX          0xffff  /* size class of newly cached pools */
+ 
+ /* Round pointer P down to the closest pool-aligned address <= P, as a poolp */
+-#define POOL_ADDR(P) ((poolp)((uptr)(P) & ~(uptr)POOL_SIZE_MASK))
++#define POOL_ADDR(P) ((poolp)_Py_ALIGN_DOWN((P), POOL_SIZE))
+ 
+ /* Return total number of blocks in pool of size index I, as a uint. */
+ #define NUMBLOCKS(I) ((uint)(POOL_SIZE - POOL_OVERHEAD) / INDEX2SIZE(I))
+diff -r bd8afb90ebf2 Objects/rangeobject.c
+--- a/Objects/rangeobject.c
++++ b/Objects/rangeobject.c
+@@ -136,7 +136,8 @@
+ }
+ 
+ PyDoc_STRVAR(range_doc,
+-"range([start,] stop[, step]) -> range object\n\
++"range(stop) -> range object\n\
++range(start, stop[, step]) -> range object\n\
+ \n\
+ Returns a virtual sequence of numbers from start to stop by step.");
+ 
+@@ -330,11 +331,11 @@
+         if (PyIndex_Check(obj)) {
+             result = PyNumber_Index(obj);
+         }
+-    }
+-    if (result == NULL) {
+-        PyErr_SetString(PyExc_TypeError,
+-                        "slice indices must be integers or "
+-                        "None or have an __index__ method");
++        else {
++            PyErr_SetString(PyExc_TypeError,
++                            "slice indices must be integers or "
++                            "None or have an __index__ method");
++        }
+     }
+     return result;
+ }
+@@ -969,7 +970,7 @@
+ {
+     PyObject *start=NULL, *stop=NULL, *step=NULL;
+     PyObject *range;
+-    
++
+     /* create a range object for pickling */
+     start = PyLong_FromLong(r->start);
+     if (start == NULL)
+diff -r bd8afb90ebf2 Objects/setobject.c
+--- a/Objects/setobject.c
++++ b/Objects/setobject.c
+@@ -77,7 +77,7 @@
+ static setentry *
+ set_lookkey(PySetObject *so, PyObject *key, register Py_hash_t hash)
+ {
+-    register size_t i;
++    register size_t i;  /* Unsigned for defined overflow behavior. */
+     register size_t perturb;
+     register setentry *freeslot;
+     register size_t mask = so->mask;
+@@ -159,7 +159,7 @@
+ static setentry *
+ set_lookkey_unicode(PySetObject *so, PyObject *key, register Py_hash_t hash)
+ {
+-    register size_t i;
++    register size_t i;  /* Unsigned for defined overflow behavior. */
+     register size_t perturb;
+     register setentry *freeslot;
+     register size_t mask = so->mask;
+@@ -760,7 +760,7 @@
+ frozenset_hash(PyObject *self)
+ {
+     PySetObject *so = (PySetObject *)self;
+-    Py_uhash_t h, hash = 1927868237U;
++    Py_uhash_t h, hash = 1927868237UL;
+     setentry *entry;
+     Py_ssize_t pos = 0;
+ 
+@@ -775,11 +775,11 @@
+            hashes so that many distinct combinations collapse to only
+            a handful of distinct hash values. */
+         h = entry->hash;
+-        hash ^= (h ^ (h << 16) ^ 89869747U)  * 3644798167U;
++        hash ^= (h ^ (h << 16) ^ 89869747UL)  * 3644798167UL;
+     }
+-    hash = hash * 69069U + 907133923U;
++    hash = hash * 69069U + 907133923UL;
+     if (hash == -1)
+-        hash = 590923713U;
++        hash = 590923713UL;
+     so->hash = hash;
+     return hash;
+ }
+@@ -831,10 +831,10 @@
+     if (!list)
+         return NULL;
+ 
+-    /* copy the itertor state */
++    /* copy the iterator state */
+     tmp = *si;
+     Py_XINCREF(tmp.si_set);
+-    
++
+     /* iterate the temporary into a list */
+     for(;;) {
+         PyObject *element = setiter_iternext(&tmp);
+diff -r bd8afb90ebf2 Objects/sliceobject.c
+--- a/Objects/sliceobject.c
++++ b/Objects/sliceobject.c
+@@ -269,7 +269,8 @@
+ }
+ 
+ PyDoc_STRVAR(slice_doc,
+-"slice([start,] stop[, step])\n\
++"slice(stop)\n\
++slice(start, stop[, step])\n\
+ \n\
+ Create a slice object.  This is used for extended slicing (e.g. a[0:10:2]).");
+ 
+diff -r bd8afb90ebf2 Objects/stringlib/codecs.h
+--- a/Objects/stringlib/codecs.h
++++ b/Objects/stringlib/codecs.h
+@@ -2,9 +2,6 @@
+ 
+ #if STRINGLIB_IS_UNICODE
+ 
+-/* Mask to check or force alignment of a pointer to C 'long' boundaries */
+-#define LONG_PTR_MASK (size_t) (SIZEOF_LONG - 1)
+-
+ /* Mask to quickly check whether a C 'long' contains a
+    non-ASCII, UTF8-encoded char. */
+ #if (SIZEOF_LONG == 8)
+@@ -25,7 +22,7 @@
+ {
+     Py_UCS4 ch;
+     const char *s = *inptr;
+-    const char *aligned_end = (const char *) ((size_t) end & ~LONG_PTR_MASK);
++    const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_LONG);
+     STRINGLIB_CHAR *p = dest + *outpos;
+ 
+     while (s < end) {
+@@ -39,7 +36,7 @@
+                First, check if we can do an aligned read, as most CPUs have
+                a penalty for unaligned reads.
+             */
+-            if (!((size_t) s & LONG_PTR_MASK)) {
++            if (_Py_IS_ALIGNED(s, SIZEOF_LONG)) {
+                 /* Help register allocation */
+                 register const char *_s = s;
+                 register STRINGLIB_CHAR *_p = p;
+@@ -94,16 +91,15 @@
+             }
+         }
+ 
+-        if (ch < 0xC2) {
+-            /* invalid sequence
+-               \x80-\xBF -- continuation byte
+-               \xC0-\xC1 -- fake 0000-007F */
+-            goto InvalidStart;
+-        }
+-
+         if (ch < 0xE0) {
+             /* \xC2\x80-\xDF\xBF -- 0080-07FF */
+             Py_UCS4 ch2;
++            if (ch < 0xC2) {
++                /* invalid sequence
++                \x80-\xBF -- continuation byte
++                \xC0-\xC1 -- fake 0000-007F */
++                goto InvalidStart;
++            }
+             if (end - s < 2) {
+                 /* unexpected end of data: the caller will decide whether
+                    it's an error or not */
+@@ -112,14 +108,15 @@
+             ch2 = (unsigned char)s[1];
+             if (!IS_CONTINUATION_BYTE(ch2))
+                 /* invalid continuation byte */
+-                goto InvalidContinuation;
++                goto InvalidContinuation1;
+             ch = (ch << 6) + ch2 -
+                  ((0xC0 << 6) + 0x80);
+             assert ((ch > 0x007F) && (ch <= 0x07FF));
+             s += 2;
+             if (STRINGLIB_MAX_CHAR <= 0x007F ||
+                 (STRINGLIB_MAX_CHAR < 0x07FF && ch > STRINGLIB_MAX_CHAR))
+-                goto Overflow;
++                /* Out-of-range */
++                goto Return;
+             *p++ = ch;
+             continue;
+         }
+@@ -130,28 +127,37 @@
+             if (end - s < 3) {
+                 /* unexpected end of data: the caller will decide whether
+                    it's an error or not */
++                if (end - s < 2)
++                    break;
++                ch2 = (unsigned char)s[1];
++                if (!IS_CONTINUATION_BYTE(ch2) ||
++                    (ch2 < 0xA0 ? ch == 0xE0 : ch == 0xED))
++                    /* for clarification see comments below */
++                    goto InvalidContinuation1;
+                 break;
+             }
+             ch2 = (unsigned char)s[1];
+             ch3 = (unsigned char)s[2];
+-            if (!IS_CONTINUATION_BYTE(ch2) ||
+-                !IS_CONTINUATION_BYTE(ch3)) {
++            if (!IS_CONTINUATION_BYTE(ch2)) {
+                 /* invalid continuation byte */
+-                goto InvalidContinuation;
++                goto InvalidContinuation1;
+             }
+             if (ch == 0xE0) {
+                 if (ch2 < 0xA0)
+                     /* invalid sequence
+                        \xE0\x80\x80-\xE0\x9F\xBF -- fake 0000-0800 */
+-                    goto InvalidContinuation;
+-            }
+-            else if (ch == 0xED && ch2 > 0x9F) {
++                    goto InvalidContinuation1;
++            } else if (ch == 0xED && ch2 >= 0xA0) {
+                 /* Decoding UTF-8 sequences in range \xED\xA0\x80-\xED\xBF\xBF
+                    will result in surrogates in range D800-DFFF. Surrogates are
+                    not valid UTF-8 so they are rejected.
+                    See http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf
+                    (table 3-7) and http://www.rfc-editor.org/rfc/rfc3629.txt */
+-                goto InvalidContinuation;
++                goto InvalidContinuation1;
++            }
++            if (!IS_CONTINUATION_BYTE(ch3)) {
++                /* invalid continuation byte */
++                goto InvalidContinuation2;
+             }
+             ch = (ch << 12) + (ch2 << 6) + ch3 -
+                  ((0xE0 << 12) + (0x80 << 6) + 0x80);
+@@ -159,7 +165,8 @@
+             s += 3;
+             if (STRINGLIB_MAX_CHAR <= 0x07FF ||
+                 (STRINGLIB_MAX_CHAR < 0xFFFF && ch > STRINGLIB_MAX_CHAR))
+-                goto Overflow;
++                /* Out-of-range */
++                goto Return;
+             *p++ = ch;
+             continue;
+         }
+@@ -170,27 +177,44 @@
+             if (end - s < 4) {
+                 /* unexpected end of data: the caller will decide whether
+                    it's an error or not */
++                if (end - s < 2)
++                    break;
++                ch2 = (unsigned char)s[1];
++                if (!IS_CONTINUATION_BYTE(ch2) ||
++                    (ch2 < 0x90 ? ch == 0xF0 : ch == 0xF4))
++                    /* for clarification see comments below */
++                    goto InvalidContinuation1;
++                if (end - s < 3)
++                    break;
++                ch3 = (unsigned char)s[2];
++                if (!IS_CONTINUATION_BYTE(ch3))
++                    goto InvalidContinuation2;
+                 break;
+             }
+             ch2 = (unsigned char)s[1];
+             ch3 = (unsigned char)s[2];
+             ch4 = (unsigned char)s[3];
+-            if (!IS_CONTINUATION_BYTE(ch2) ||
+-                !IS_CONTINUATION_BYTE(ch3) ||
+-                !IS_CONTINUATION_BYTE(ch4)) {
++            if (!IS_CONTINUATION_BYTE(ch2)) {
+                 /* invalid continuation byte */
+-                goto InvalidContinuation;
++                goto InvalidContinuation1;
+             }
+             if (ch == 0xF0) {
+                 if (ch2 < 0x90)
+                     /* invalid sequence
+-                       \xF0\x80\x80\x80-\xF0\x80\xBF\xBF -- fake 0000-FFFF */
+-                    goto InvalidContinuation;
+-            }
+-            else if (ch == 0xF4 && ch2 > 0x8F) {
++                       \xF0\x80\x80\x80-\xF0\x8F\xBF\xBF -- fake 0000-FFFF */
++                    goto InvalidContinuation1;
++            } else if (ch == 0xF4 && ch2 >= 0x90) {
+                 /* invalid sequence
+                    \xF4\x90\x80\80- -- 110000- overflow */
+-                goto InvalidContinuation;
++                goto InvalidContinuation1;
++            }
++            if (!IS_CONTINUATION_BYTE(ch3)) {
++                /* invalid continuation byte */
++                goto InvalidContinuation2;
++            }
++            if (!IS_CONTINUATION_BYTE(ch4)) {
++                /* invalid continuation byte */
++                goto InvalidContinuation3;
+             }
+             ch = (ch << 18) + (ch2 << 12) + (ch3 << 6) + ch4 -
+                  ((0xF0 << 18) + (0x80 << 12) + (0x80 << 6) + 0x80);
+@@ -198,14 +222,14 @@
+             s += 4;
+             if (STRINGLIB_MAX_CHAR <= 0xFFFF ||
+                 (STRINGLIB_MAX_CHAR < 0x10FFFF && ch > STRINGLIB_MAX_CHAR))
+-                goto Overflow;
++                /* Out-of-range */
++                goto Return;
+             *p++ = ch;
+             continue;
+         }
+         goto InvalidStart;
+     }
+     ch = 0;
+-Overflow:
+ Return:
+     *inptr = s;
+     *outpos = p - dest;
+@@ -213,13 +237,18 @@
+ InvalidStart:
+     ch = 1;
+     goto Return;
+-InvalidContinuation:
++InvalidContinuation1:
+     ch = 2;
+     goto Return;
++InvalidContinuation2:
++    ch = 3;
++    goto Return;
++InvalidContinuation3:
++    ch = 4;
++    goto Return;
+ }
+ 
+ #undef ASCII_CHAR_MASK
+-#undef IS_CONTINUATION_BYTE
+ 
+ 
+ /* UTF-8 encoder specialized for a Unicode kind to avoid the slow
+@@ -453,7 +482,7 @@
+ {
+     Py_UCS4 ch;
+     const unsigned char *aligned_end =
+-            (const unsigned char *) ((size_t) e & ~LONG_PTR_MASK);
++            (const unsigned char *) _Py_ALIGN_DOWN(e, SIZEOF_LONG);
+     const unsigned char *q = *inptr;
+     STRINGLIB_CHAR *p = dest + *outpos;
+     /* Offsets from q for retrieving byte pairs in the right order. */
+@@ -468,7 +497,7 @@
+         Py_UCS4 ch2;
+         /* First check for possible aligned read of a C 'long'. Unaligned
+            reads are more expensive, better to defer to another iteration. */
+-        if (!((size_t) q & LONG_PTR_MASK)) {
++        if (_Py_IS_ALIGNED(q, SIZEOF_LONG)) {
+             /* Fast path for runs of in-range non-surrogate chars. */
+             register const unsigned char *_q = q;
+             while (_q < aligned_end) {
+@@ -565,7 +594,6 @@
+ #undef FAST_CHAR_MASK
+ #undef STRIPPED_MASK
+ #undef SWAB
+-#undef LONG_PTR_MASK
+ 
+ 
+ Py_LOCAL_INLINE(void)
+@@ -588,7 +616,7 @@
+         _PyUnicode_CONVERT_BYTES(STRINGLIB_CHAR, unsigned short, in, end, out);
+ # endif
+     } else {
+-        const STRINGLIB_CHAR *unrolled_end = in + (len & ~ (Py_ssize_t) 3);
++        const STRINGLIB_CHAR *unrolled_end = in + _Py_SIZE_ROUND_DOWN(len, 4);
+         while (in < unrolled_end) {
+             out[0] = SWAB2(in[0]);
+             out[1] = SWAB2(in[1]);
+diff -r bd8afb90ebf2 Objects/stringlib/fastsearch.h
+--- a/Objects/stringlib/fastsearch.h
++++ b/Objects/stringlib/fastsearch.h
+@@ -38,26 +38,18 @@
+                                    STRINGLIB_CHAR ch, unsigned char needle,
+                                    Py_ssize_t maxcount, int mode)
+ {
+-    void *candidate;
+-    const STRINGLIB_CHAR *found;
+-
+-#define DO_MEMCHR(memchr, s, needle, nchars) do { \
+-    candidate = memchr((const void *) (s), (needle), (nchars) * sizeof(STRINGLIB_CHAR)); \
+-    found = (const STRINGLIB_CHAR *) \
+-        ((Py_ssize_t) candidate & (~ ((Py_ssize_t) sizeof(STRINGLIB_CHAR) - 1))); \
+-    } while (0)
+-
+     if (mode == FAST_SEARCH) {
+         const STRINGLIB_CHAR *ptr = s;
+         const STRINGLIB_CHAR *e = s + n;
+         while (ptr < e) {
+-            DO_MEMCHR(memchr, ptr, needle, e - ptr);
+-            if (found == NULL)
++            void *candidate = memchr((const void *) ptr, needle, (e - ptr) * sizeof(STRINGLIB_CHAR));
++            if (candidate == NULL)
+                 return -1;
+-            if (sizeof(STRINGLIB_CHAR) == 1 || *found == ch)
+-                return (found - s);
++            ptr = (const STRINGLIB_CHAR *) _Py_ALIGN_DOWN(candidate, sizeof(STRINGLIB_CHAR));
++            if (sizeof(STRINGLIB_CHAR) == 1 || *ptr == ch)
++                return (ptr - s);
+             /* False positive */
+-            ptr = found + 1;
++            ptr++;
+         }
+         return -1;
+     }
+@@ -67,9 +59,11 @@
+        faster than our hand-written loop in FASTSEARCH below */
+     else if (mode == FAST_RSEARCH) {
+         while (n > 0) {
+-            DO_MEMCHR(memrchr, s, needle, n);
+-            if (found == NULL)
++            const STRINGLIB_CHAR *found;
++            void *candidate = memrchr((const void *) s, needle, n * sizeof(STRINGLIB_CHAR));
++            if (candidate == NULL)
+                 return -1;
++            found = (const STRINGLIB_CHAR *) _Py_ALIGN_DOWN(candidate, sizeof(STRINGLIB_CHAR));
+             n = found - s;
+             if (sizeof(STRINGLIB_CHAR) == 1 || *found == ch)
+                 return n;
+diff -r bd8afb90ebf2 Objects/stringlib/find_max_char.h
+--- a/Objects/stringlib/find_max_char.h
++++ b/Objects/stringlib/find_max_char.h
+@@ -2,9 +2,6 @@
+ 
+ #if STRINGLIB_IS_UNICODE
+ 
+-/* Mask to check or force alignment of a pointer to C 'long' boundaries */
+-#define LONG_PTR_MASK (size_t) (SIZEOF_LONG - 1)
+-
+ /* Mask to quickly check whether a C 'long' contains a
+    non-ASCII, UTF8-encoded char. */
+ #if (SIZEOF_LONG == 8)
+@@ -21,10 +18,11 @@
+ STRINGLIB(find_max_char)(const STRINGLIB_CHAR *begin, const STRINGLIB_CHAR *end)
+ {
+     const unsigned char *p = (const unsigned char *) begin;
+-    const unsigned char *aligned_end = (const unsigned char *) ((size_t) end & ~LONG_PTR_MASK);
++    const unsigned char *aligned_end =
++            (const unsigned char *) _Py_ALIGN_DOWN(end, SIZEOF_LONG);
+ 
+     while (p < end) {
+-        if (!((size_t) p & LONG_PTR_MASK)) {
++        if (_Py_IS_ALIGNED(p, SIZEOF_LONG)) {
+             /* Help register allocation */
+             register const unsigned char *_p = p;
+             while (_p < aligned_end) {
+@@ -43,7 +41,6 @@
+     return 127;
+ }
+ 
+-#undef LONG_PTR_MASK
+ #undef ASCII_CHAR_MASK
+ 
+ #else /* STRINGLIB_SIZEOF_CHAR == 1 */
+@@ -72,7 +69,7 @@
+     register Py_UCS4 mask;
+     Py_ssize_t n = end - begin;
+     const STRINGLIB_CHAR *p = begin;
+-    const STRINGLIB_CHAR *unrolled_end = begin + (n & ~ (Py_ssize_t) 3);
++    const STRINGLIB_CHAR *unrolled_end = begin + _Py_SIZE_ROUND_DOWN(n, 4);
+     Py_UCS4 max_char;
+ 
+     max_char = MAX_CHAR_ASCII;
+diff -r bd8afb90ebf2 Objects/tupleobject.c
+--- a/Objects/tupleobject.c
++++ b/Objects/tupleobject.c
+@@ -96,15 +96,11 @@
+     else
+ #endif
+     {
+-        Py_ssize_t nbytes = size * sizeof(PyObject *);
+         /* Check for overflow */
+-        if (nbytes / sizeof(PyObject *) != (size_t)size ||
+-            (nbytes > PY_SSIZE_T_MAX - sizeof(PyTupleObject) - sizeof(PyObject *)))
+-        {
++        if (size > (PY_SSIZE_T_MAX - sizeof(PyTupleObject) -
++                    sizeof(PyObject *)) / sizeof(PyObject *)) {
+             return PyErr_NoMemory();
+         }
+-        /* nbytes += sizeof(PyTupleObject) - sizeof(PyObject *); */
+-
+         op = PyObject_GC_NewVar(PyTupleObject, &PyTuple_Type, size);
+         if (op == NULL)
+             return NULL;
+@@ -210,8 +206,10 @@
+ 
+     va_start(vargs, n);
+     result = PyTuple_New(n);
+-    if (result == NULL)
++    if (result == NULL) {
++        va_end(vargs);
+         return NULL;
++    }
+     items = ((PyTupleObject *)result)->ob_item;
+     for (i = 0; i < n; i++) {
+         o = va_arg(vargs, PyObject *);
+@@ -329,12 +327,12 @@
+ static Py_hash_t
+ tuplehash(PyTupleObject *v)
+ {
+-    register Py_uhash_t x;
++    register Py_uhash_t x;  /* Unsigned for defined overflow behavior. */
+     register Py_hash_t y;
+     register Py_ssize_t len = Py_SIZE(v);
+     register PyObject **p;
+     Py_uhash_t mult = _PyHASH_MULTIPLIER;
+-    x = 0x345678;
++    x = 0x345678UL;
+     p = v->ob_item;
+     while (--len >= 0) {
+         y = PyObject_Hash(*p++);
+@@ -342,9 +340,9 @@
+             return -1;
+         x = (x ^ y) * mult;
+         /* the cast might truncate len; that doesn't change hash stability */
+-        mult += (Py_hash_t)(82520L + len + len);
++        mult += (Py_hash_t)(82520UL + len + len);
+     }
+-    x += 97531L;
++    x += 97531UL;
+     if (x == (Py_uhash_t)-1)
+         x = -2;
+     return x;
+@@ -479,9 +477,9 @@
+         if (Py_SIZE(a) == 0)
+             return PyTuple_New(0);
+     }
++    if (n > PY_SSIZE_T_MAX / Py_SIZE(a))
++        return PyErr_NoMemory();
+     size = Py_SIZE(a) * n;
+-    if (size/Py_SIZE(a) != n)
+-        return PyErr_NoMemory();
+     np = (PyTupleObject *) PyTuple_New(size);
+     if (np == NULL)
+         return NULL;
+diff -r bd8afb90ebf2 Objects/typeobject.c
+--- a/Objects/typeobject.c
++++ b/Objects/typeobject.c
+@@ -311,6 +311,8 @@
+ {
+     PyHeapTypeObject* et;
+ 
++    if (!check_set_special_type_attr(type, value, "__qualname__"))
++        return -1;
+     if (!PyUnicode_Check(value)) {
+         PyErr_Format(PyExc_TypeError,
+                      "can only assign string to %s.__qualname__, not '%s'",
+@@ -691,8 +693,10 @@
+         mod = NULL;
+     }
+     name = type_qualname(type, NULL);
+-    if (name == NULL)
++    if (name == NULL) {
++        Py_XDECREF(mod);
+         return NULL;
++    }
+ 
+     if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "builtins"))
+         rtn = PyUnicode_FromFormat("<class '%U.%U'>", mod, name);
+@@ -2248,11 +2252,10 @@
+             goto error;
+         }
+     }
+-    else {
+-        qualname = et->ht_name;
+-    }
+-    Py_INCREF(qualname);
+-    et->ht_qualname = qualname;
++    et->ht_qualname = qualname ? qualname : et->ht_name;
++    Py_INCREF(et->ht_qualname);
++    if (qualname != NULL && PyDict_DelItem(dict, PyId___qualname__.object) < 0)
++        goto error;
+ 
+     /* Set tp_doc to a copy of dict['__doc__'], if the latter is there
+        and is a string.  The __doc__ accessor will first look for tp_doc;
+@@ -3056,7 +3059,7 @@
+ {
+     if (excess_args(args, kwds) &&
+         (type->tp_init == object_init || type->tp_new != object_new)) {
+-        PyErr_SetString(PyExc_TypeError, "object.__new__() takes no parameters");
++        PyErr_SetString(PyExc_TypeError, "object() takes no parameters");
+         return NULL;
+     }
+ 
+@@ -3128,8 +3131,10 @@
+         mod = NULL;
+     }
+     name = type_qualname(type, NULL);
+-    if (name == NULL)
++    if (name == NULL) {
++        Py_XDECREF(mod);
+         return NULL;
++    }
+     if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "builtins"))
+         rtn = PyUnicode_FromFormat("<%U.%U object at %p>", mod, name, self);
+     else
+@@ -5988,7 +5993,7 @@
+         descr = _PyType_Lookup(type, p->name_strobj);
+         if (descr == NULL) {
+             if (ptr == (void**)&type->tp_iternext) {
+-                specific = _PyObject_NextNotImplemented;
++                specific = (void *)_PyObject_NextNotImplemented;
+             }
+             continue;
+         }
+@@ -6035,7 +6040,7 @@
+             /* We specifically allow __hash__ to be set to None
+                to prevent inheritance of the default
+                implementation from object.__hash__ */
+-            specific = PyObject_HashNotImplemented;
++            specific = (void *)PyObject_HashNotImplemented;
+         }
+         else {
+             use_generic = 1;
+@@ -6250,7 +6255,7 @@
+             continue;
+         if (PyDict_GetItem(dict, p->name_strobj))
+             continue;
+-        if (*ptr == PyObject_HashNotImplemented) {
++        if (*ptr == (void *)PyObject_HashNotImplemented) {
+             /* Classes may prevent the inheritance of the tp_hash
+                slot by storing PyObject_HashNotImplemented in it. Make it
+                visible as a None value for the __hash__ attribute. */
+@@ -6502,18 +6507,18 @@
+         PyCodeObject *co = f->f_code;
+         Py_ssize_t i, n;
+         if (co == NULL) {
+-            PyErr_SetString(PyExc_SystemError,
++            PyErr_SetString(PyExc_RuntimeError,
+                             "super(): no code object");
+             return -1;
+         }
+         if (co->co_argcount == 0) {
+-            PyErr_SetString(PyExc_SystemError,
++            PyErr_SetString(PyExc_RuntimeError,
+                             "super(): no arguments");
+             return -1;
+         }
+         obj = f->f_localsplus[0];
+         if (obj == NULL) {
+-            PyErr_SetString(PyExc_SystemError,
++            PyErr_SetString(PyExc_RuntimeError,
+                             "super(): arg[0] deleted");
+             return -1;
+         }
+@@ -6532,18 +6537,18 @@
+                     PyTuple_GET_SIZE(co->co_cellvars) + i;
+                 PyObject *cell = f->f_localsplus[index];
+                 if (cell == NULL || !PyCell_Check(cell)) {
+-                    PyErr_SetString(PyExc_SystemError,
++                    PyErr_SetString(PyExc_RuntimeError,
+                       "super(): bad __class__ cell");
+                     return -1;
+                 }
+                 type = (PyTypeObject *) PyCell_GET(cell);
+                 if (type == NULL) {
+-                    PyErr_SetString(PyExc_SystemError,
++                    PyErr_SetString(PyExc_RuntimeError,
+                       "super(): empty __class__ cell");
+                     return -1;
+                 }
+                 if (!PyType_Check(type)) {
+-                    PyErr_Format(PyExc_SystemError,
++                    PyErr_Format(PyExc_RuntimeError,
+                       "super(): __class__ is not a type (%s)",
+                       Py_TYPE(type)->tp_name);
+                     return -1;
+@@ -6552,7 +6557,7 @@
+             }
+         }
+         if (type == NULL) {
+-            PyErr_SetString(PyExc_SystemError,
++            PyErr_SetString(PyExc_RuntimeError,
+                             "super(): __class__ cell not found");
+             return -1;
+         }
+diff -r bd8afb90ebf2 Objects/unicodeobject.c
+--- a/Objects/unicodeobject.c
++++ b/Objects/unicodeobject.c
+@@ -57,8 +57,9 @@
+ 
+ /* --- Globals ------------------------------------------------------------
+ 
+-   The globals are initialized by the _PyUnicode_Init() API and should
+-   not be used before calling that API.
++NOTE: In the interpreter's initialization phase, some globals are currently
++      initialized dynamically as needed. In the process Unicode objects may
++      be created before the Unicode type is ready.
+ 
+ */
+ 
+@@ -159,7 +160,7 @@
+         const from_type *_end = (end);                  \
+         Py_ssize_t n = (_end) - (_iter);                \
+         const from_type *_unrolled_end =                \
+-            _iter + (n & ~ (Py_ssize_t) 3);             \
++            _iter + _Py_SIZE_ROUND_DOWN(n, 4);          \
+         while (_iter < (_unrolled_end)) {               \
+             _to[0] = (to_type) _iter[0];                \
+             _to[1] = (to_type) _iter[1];                \
+@@ -179,17 +180,36 @@
+    Another way to look at this is that to say that the actual reference
+    count of a string is:  s->ob_refcnt + (s->state ? 2 : 0)
+ */
+-static PyObject *interned;
++static PyObject *interned = NULL;
+ 
+ /* The empty Unicode object is shared to improve performance. */
+-static PyObject *unicode_empty;
++static PyObject *unicode_empty = NULL;
++
++#define _Py_INCREF_UNICODE_EMPTY()                      \
++    do {                                                \
++        if (unicode_empty != NULL)                      \
++            Py_INCREF(unicode_empty);                   \
++        else {                                          \
++            unicode_empty = PyUnicode_New(0, 0);        \
++            if (unicode_empty != NULL) {                \
++                Py_INCREF(unicode_empty);               \
++                assert(_PyUnicode_CheckConsistency(unicode_empty, 1)); \
++            }                                           \
++        }                                               \
++    } while (0)
++
++#define _Py_RETURN_UNICODE_EMPTY()                      \
++    do {                                                \
++        _Py_INCREF_UNICODE_EMPTY();                     \
++        return unicode_empty;                           \
++    } while (0)
+ 
+ /* List of static strings. */
+-static _Py_Identifier *static_strings;
++static _Py_Identifier *static_strings = NULL;
+ 
+ /* Single character Unicode strings in the Latin-1 range are being
+    shared as well. */
+-static PyObject *unicode_latin1[256];
++static PyObject *unicode_latin1[256] = {NULL};
+ 
+ /* Fast detection of the most frequent whitespace characters */
+ const unsigned char _Py_ascii_whitespace[] = {
+@@ -416,9 +436,8 @@
+ 
+     len = _PyUnicode_WSTR_LENGTH(unicode);
+     if (len == 0) {
+-        Py_INCREF(unicode_empty);
+         Py_DECREF(unicode);
+-        return unicode_empty;
++        _Py_RETURN_UNICODE_EMPTY();
+     }
+ 
+     if (len == 1) {
+@@ -450,8 +469,8 @@
+     length = PyUnicode_GET_LENGTH(unicode);
+     if (length == 0) {
+         if (unicode != unicode_empty) {
+-            Py_INCREF(unicode_empty);
+             Py_DECREF(unicode);
++            _Py_RETURN_UNICODE_EMPTY();
+         }
+         return unicode_empty;
+     }
+@@ -528,7 +547,7 @@
+ 
+ #define BLOOM_MASK unsigned long
+ 
+-static BLOOM_MASK bloom_linebreak;
++static BLOOM_MASK bloom_linebreak = ~(BLOOM_MASK)0;
+ 
+ #define BLOOM_ADD(mask, ch) ((mask |= (1UL << ((ch) & (BLOOM_WIDTH - 1)))))
+ #define BLOOM(mask, ch)     ((mask &  (1UL << ((ch) & (BLOOM_WIDTH - 1)))))
+@@ -683,6 +702,10 @@
+         if (!PyUnicode_IS_ASCII(unicode))
+             _PyUnicode_WSTR_LENGTH(unicode) = length;
+     }
++    else if (_PyUnicode_HAS_WSTR_MEMORY(unicode)) {
++        PyObject_DEL(_PyUnicode_WSTR(unicode));
++        _PyUnicode_WSTR(unicode) = NULL;
++    }
+     PyUnicode_WRITE(PyUnicode_KIND(unicode), PyUnicode_DATA(unicode),
+                     length, 0);
+     assert(_PyUnicode_CheckConsistency(unicode, 0));
+@@ -1582,9 +1605,11 @@
+         return 0;
+ 
+     if (length == 0) {
++        _Py_INCREF_UNICODE_EMPTY();
++        if (!unicode_empty)
++            return -1;
+         Py_DECREF(*p_unicode);
+         *p_unicode = unicode_empty;
+-        Py_INCREF(*p_unicode);
+         return 0;
+     }
+ 
+@@ -1731,10 +1756,8 @@
+        some optimizations which share commonly used objects. */
+ 
+     /* Optimization for empty strings */
+-    if (size == 0 && unicode_empty != NULL) {
+-        Py_INCREF(unicode_empty);
+-        return unicode_empty;
+-    }
++    if (size == 0)
++        _Py_RETURN_UNICODE_EMPTY();
+ 
+     /* Single character Unicode objects in the Latin-1 range are
+        shared when using this constructor */
+@@ -1826,12 +1849,15 @@
+ void
+ _PyUnicode_ClearStaticStrings()
+ {
+-    _Py_Identifier *i;
+-    for (i = static_strings; i; i = i->next) {
+-        Py_DECREF(i->object);
+-        i->object = NULL;
+-        i->next = NULL;
+-    }
++    _Py_Identifier *tmp, *s = static_strings;
++    while (s) {
++        Py_DECREF(s->object);
++        s->object = NULL;
++        tmp = s->next;
++        s->next = NULL;
++        s = tmp;
++    }
++    static_strings = NULL;
+ }
+ 
+ /* Internal function, doesn't check maximum character */
+@@ -1890,10 +1916,8 @@
+     PyObject *res;
+     unsigned char max_char;
+ 
+-    if (size == 0) {
+-        Py_INCREF(unicode_empty);
+-        return unicode_empty;
+-    }
++    if (size == 0)
++        _Py_RETURN_UNICODE_EMPTY();
+     assert(size > 0);
+     if (size == 1)
+         return get_latin1_char(u[0]);
+@@ -1913,10 +1937,8 @@
+     PyObject *res;
+     Py_UCS2 max_char;
+ 
+-    if (size == 0) {
+-        Py_INCREF(unicode_empty);
+-        return unicode_empty;
+-    }
++    if (size == 0)
++        _Py_RETURN_UNICODE_EMPTY();
+     assert(size > 0);
+     if (size == 1) {
+         Py_UCS4 ch = u[0];
+@@ -1951,10 +1973,8 @@
+     PyObject *res;
+     Py_UCS4 max_char;
+ 
+-    if (size == 0) {
+-        Py_INCREF(unicode_empty);
+-        return unicode_empty;
+-    }
++    if (size == 0)
++        _Py_RETURN_UNICODE_EMPTY();
+     assert(size > 0);
+     if (size == 1) {
+         Py_UCS4 ch = u[0];
+@@ -2246,10 +2266,8 @@
+ PyUnicode_FromWideChar(register const wchar_t *w, Py_ssize_t size)
+ {
+     if (w == NULL) {
+-        if (size == 0) {
+-            Py_INCREF(unicode_empty);
+-            return unicode_empty;
+-        }
++        if (size == 0)
++            _Py_RETURN_UNICODE_EMPTY();
+         PyErr_BadInternalCall();
+         return NULL;
+     }
+@@ -3004,15 +3022,11 @@
+ 
+     /* Decoding bytes objects is the most common case and should be fast */
+     if (PyBytes_Check(obj)) {
+-        if (PyBytes_GET_SIZE(obj) == 0) {
+-            Py_INCREF(unicode_empty);
+-            v = unicode_empty;
+-        }
+-        else {
+-            v = PyUnicode_Decode(
+-                    PyBytes_AS_STRING(obj), PyBytes_GET_SIZE(obj),
+-                    encoding, errors);
+-        }
++        if (PyBytes_GET_SIZE(obj) == 0)
++            _Py_RETURN_UNICODE_EMPTY();
++        v = PyUnicode_Decode(
++                PyBytes_AS_STRING(obj), PyBytes_GET_SIZE(obj),
++                encoding, errors);
+         return v;
+     }
+ 
+@@ -3032,12 +3046,11 @@
+     }
+ 
+     if (buffer.len == 0) {
+-        Py_INCREF(unicode_empty);
+-        v = unicode_empty;
+-    }
+-    else
+-        v = PyUnicode_Decode((char*) buffer.buf, buffer.len, encoding, errors);
+-
++        PyBuffer_Release(&buffer);
++        _Py_RETURN_UNICODE_EMPTY();
++    }
++
++    v = PyUnicode_Decode((char*) buffer.buf, buffer.len, encoding, errors);
+     PyBuffer_Release(&buffer);
+     return v;
+ }
+@@ -3045,8 +3058,8 @@
+ /* Convert encoding to lower case and replace '_' with '-' in order to
+    catch e.g. UTF_8. Return 0 on error (encoding is longer than lower_len-1),
+    1 on success. */
+-static int
+-normalize_encoding(const char *encoding,
++int
++_Py_normalize_encoding(const char *encoding,
+                    char *lower,
+                    size_t lower_len)
+ {
+@@ -3090,7 +3103,7 @@
+     char lower[11];  /* Enough for any encoding shortcut */
+ 
+     /* Shortcuts for common default encodings */
+-    if (normalize_encoding(encoding, lower, sizeof(lower))) {
++    if (_Py_normalize_encoding(encoding, lower, sizeof(lower))) {
+         if ((strcmp(lower, "utf-8") == 0) ||
+             (strcmp(lower, "utf8") == 0))
+             return PyUnicode_DecodeUTF8Stateful(s, size, errors, NULL);
+@@ -3455,7 +3468,7 @@
+     }
+ 
+     /* Shortcuts for common default encodings */
+-    if (normalize_encoding(encoding, lower, sizeof(lower))) {
++    if (_Py_normalize_encoding(encoding, lower, sizeof(lower))) {
+         if ((strcmp(lower, "utf-8") == 0) ||
+             (strcmp(lower, "utf8") == 0))
+         {
+@@ -4492,7 +4505,6 @@
+     void *data;
+     Py_ssize_t len;
+     PyObject *v;
+-    Py_ssize_t allocated;
+     int inShift = 0;
+     Py_ssize_t i;
+     unsigned int base64bits = 0;
+@@ -4510,11 +4522,9 @@
+         return PyBytes_FromStringAndSize(NULL, 0);
+ 
+     /* It might be possible to tighten this worst case */
+-    allocated = 8 * len;
+-    if (allocated / 8 != len)
++    if (len > PY_SSIZE_T_MAX / 8)
+         return PyErr_NoMemory();
+-
+-    v = PyBytes_FromStringAndSize(NULL, allocated);
++    v = PyBytes_FromStringAndSize(NULL, len * 8);
+     if (v == NULL)
+         return NULL;
+ 
+@@ -4635,9 +4645,6 @@
+ #include "stringlib/codecs.h"
+ #include "stringlib/undef.h"
+ 
+-/* Mask to check or force alignment of a pointer to C 'long' boundaries */
+-#define LONG_PTR_MASK (size_t) (SIZEOF_LONG - 1)
+-
+ /* Mask to quickly check whether a C 'long' contains a
+    non-ASCII, UTF8-encoded char. */
+ #if (SIZEOF_LONG == 8)
+@@ -4652,11 +4659,11 @@
+ ascii_decode(const char *start, const char *end, Py_UCS1 *dest)
+ {
+     const char *p = start;
+-    const char *aligned_end = (const char *) ((size_t) end & ~LONG_PTR_MASK);
++    const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_LONG);
+ 
+ #if SIZEOF_LONG <= SIZEOF_VOID_P
+-    assert(!((size_t) dest & LONG_PTR_MASK));
+-    if (!((size_t) p & LONG_PTR_MASK)) {
++    assert(_Py_IS_ALIGNED(dest, SIZEOF_LONG));
++    if (_Py_IS_ALIGNED(p, SIZEOF_LONG)) {
+         /* Fast path, see in STRINGLIB(utf8_decode) for
+            an explanation. */
+         /* Help register allocation */
+@@ -4682,7 +4689,7 @@
+     while (p < end) {
+         /* Fast path, see in STRINGLIB(utf8_decode) in stringlib/codecs.h
+            for an explanation. */
+-        if (!((size_t) p & LONG_PTR_MASK)) {
++        if (_Py_IS_ALIGNED(p, SIZEOF_LONG)) {
+             /* Help register allocation */
+             register const char *_p = p;
+             while (_p < aligned_end) {
+@@ -4723,8 +4730,7 @@
+     if (size == 0) {
+         if (consumed)
+             *consumed = 0;
+-        Py_INCREF(unicode_empty);
+-        return unicode_empty;
++        _Py_RETURN_UNICODE_EMPTY();
+     }
+ 
+     /* ASCII is equivalent to the first 128 ordinals in Unicode. */
+@@ -4765,9 +4771,7 @@
+                 goto End;
+             errmsg = "unexpected end of data";
+             startinpos = s - starts;
+-            endinpos = startinpos + 1;
+-            while (endinpos < size && (starts[endinpos] & 0xC0) == 0x80)
+-                endinpos++;
++            endinpos = end - starts;
+             break;
+         case 1:
+             errmsg = "invalid start byte";
+@@ -4775,11 +4779,11 @@
+             endinpos = startinpos + 1;
+             break;
+         case 2:
++        case 3:
++        case 4:
+             errmsg = "invalid continuation byte";
+             startinpos = s - starts;
+-            endinpos = startinpos + 1;
+-            while (endinpos < size && (starts[endinpos] & 0xC0) == 0x80)
+-                endinpos++;
++            endinpos = startinpos + ch - 1;
+             break;
+         default:
+             if (unicode_putchar(&unicode, &outpos, ch) < 0)
+@@ -4817,7 +4821,10 @@
+ #ifdef __APPLE__
+ 
+ /* Simplified UTF-8 decoder using surrogateescape error handler,
+-   used to decode the command line arguments on Mac OS X. */
++   used to decode the command line arguments on Mac OS X.
++
++   Return a pointer to a newly allocated wide character string (use
++   PyMem_Free() to free the memory), or NULL on memory allocation error. */
+ 
+ wchar_t*
+ _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size)
+@@ -4828,10 +4835,8 @@
+ 
+     /* Note: size will always be longer than the resulting Unicode
+        character count */
+-    if (PY_SSIZE_T_MAX / sizeof(wchar_t) < (size + 1)) {
+-        PyErr_NoMemory();
+-        return NULL;
+-    }
++    if (PY_SSIZE_T_MAX / sizeof(wchar_t) < (size + 1))
++        return NULL;
+     unicode = PyMem_Malloc((size + 1) * sizeof(wchar_t));
+     if (!unicode)
+         return NULL;
+@@ -5095,7 +5100,7 @@
+     Py_ssize_t len;
+     PyObject *v;
+     unsigned char *p;
+-    Py_ssize_t nsize, bytesize, i;
++    Py_ssize_t nsize, i;
+     /* Offsets from p for storing byte pairs in the right order. */
+ #ifdef BYTEORDER_IS_LITTLE_ENDIAN
+     int iorder[] = {0, 1, 2, 3};
+@@ -5123,10 +5128,9 @@
+     len = PyUnicode_GET_LENGTH(str);
+ 
+     nsize = len + (byteorder == 0);
+-    bytesize = nsize * 4;
+-    if (bytesize / 4 != nsize)
++    if (nsize > PY_SSIZE_T_MAX / 4)
+         return PyErr_NoMemory();
+-    v = PyBytes_FromStringAndSize(NULL, bytesize);
++    v = PyBytes_FromStringAndSize(NULL, nsize * 4);
+     if (v == NULL)
+         return NULL;
+ 
+@@ -5237,8 +5241,7 @@
+     if (q == e) {
+         if (consumed)
+             *consumed = size;
+-        Py_INCREF(unicode_empty);
+-        return unicode_empty;
++        _Py_RETURN_UNICODE_EMPTY();
+     }
+ 
+ #ifdef BYTEORDER_IS_LITTLE_ENDIAN
+@@ -5292,8 +5295,11 @@
+             /* The remaining input chars are ignored if the callback
+                chooses to skip the input */
+         case 1:
++            q -= 2;
++            if (consumed)
++                goto End;
+             errmsg = "unexpected end of data";
+-            startinpos = ((const char *)q) - 2 - starts;
++            startinpos = ((const char *)q) - starts;
+             endinpos = ((const char *)e) - starts;
+             break;
+         case 2:
+@@ -5390,7 +5396,7 @@
+         return NULL;
+ 
+     /* output buffer is 2-bytes aligned */
+-    assert(((Py_uintptr_t)PyBytes_AS_STRING(v) & 1) == 0);
++    assert(_Py_IS_ALIGNED(PyBytes_AS_STRING(v), 2));
+     out = (unsigned short *)PyBytes_AS_STRING(v);
+     if (byteorder == 0)
+         *out++ = 0xFEFF;
+@@ -5506,7 +5512,6 @@
+     const char *starts = s;
+     Py_ssize_t startinpos;
+     Py_ssize_t endinpos;
+-    int j;
+     PyObject *v;
+     const char *end;
+     char* message;
+@@ -5628,29 +5633,19 @@
+             message = "truncated \\UXXXXXXXX escape";
+         hexescape:
+             chr = 0;
+-            if (s+digits>end) {
+-                endinpos = size;
+-                if (unicode_decode_call_errorhandler(
+-                        errors, &errorHandler,
+-                        "unicodeescape", "end of string in escape sequence",
+-                        &starts, &end, &startinpos, &endinpos, &exc, &s,
+-                        &v, &i))
+-                    goto onError;
+-                goto nextByte;
+-            }
+-            for (j = 0; j < digits; ++j) {
+-                c = (unsigned char) s[j];
+-                if (!Py_ISXDIGIT(c)) {
+-                    endinpos = (s+j+1)-starts;
+-                    if (unicode_decode_call_errorhandler(
+-                            errors, &errorHandler,
+-                            "unicodeescape", message,
+-                            &starts, &end, &startinpos, &endinpos, &exc, &s,
+-                            &v, &i))
+-                        goto onError;
+-                    len = PyUnicode_GET_LENGTH(v);
+-                    goto nextByte;
+-                }
++            if (end - s < digits) {
++                /* count only hex digits */
++                for (; s < end; ++s) {
++                    c = (unsigned char)*s;
++                    if (!Py_ISXDIGIT(c))
++                        goto error;
++                }
++                goto error;
++            }
++            for (; digits--; ++s) {
++                c = (unsigned char)*s;
++                if (!Py_ISXDIGIT(c))
++                    goto error;
+                 chr = (chr<<4) & ~0xF;
+                 if (c >= '0' && c <= '9')
+                     chr += c - '0';
+@@ -5659,24 +5654,16 @@
+                 else
+                     chr += 10 + c - 'A';
+             }
+-            s += j;
+             if (chr == 0xffffffff && PyErr_Occurred())
+                 /* _decoding_error will have already written into the
+                    target buffer. */
+                 break;
+         store:
+             /* when we get here, chr is a 32-bit unicode character */
+-            if (chr <= MAX_UNICODE) {
+-                WRITECHAR(chr);
+-            } else {
+-                endinpos = s-starts;
+-                if (unicode_decode_call_errorhandler(
+-                        errors, &errorHandler,
+-                        "unicodeescape", "illegal Unicode character",
+-                        &starts, &end, &startinpos, &endinpos, &exc, &s,
+-                        &v, &i))
+-                    goto onError;
+-            }
++            message = "illegal Unicode character";
++            if (chr > MAX_UNICODE)
++                goto error;
++            WRITECHAR(chr);
+             break;
+ 
+             /* \N{name} */
+@@ -5698,40 +5685,38 @@
+                     /* found a name.  look it up in the unicode database */
+                     message = "unknown Unicode character name";
+                     s++;
+-                    if (ucnhash_CAPI->getcode(NULL, start, (int)(s-start-1),
++                    if (s - start - 1 <= INT_MAX &&
++                        ucnhash_CAPI->getcode(NULL, start, (int)(s-start-1),
+                                               &chr, 0))
+                         goto store;
+                 }
+             }
+-            endinpos = s-starts;
+-            if (unicode_decode_call_errorhandler(
+-                    errors, &errorHandler,
+-                    "unicodeescape", message,
+-                    &starts, &end, &startinpos, &endinpos, &exc, &s,
+-                    &v, &i))
+-                goto onError;
+-            break;
++            goto error;
+ 
+         default:
+             if (s > end) {
+                 message = "\\ at end of string";
+                 s--;
+-                endinpos = s-starts;
+-                if (unicode_decode_call_errorhandler(
+-                        errors, &errorHandler,
+-                        "unicodeescape", message,
+-                        &starts, &end, &startinpos, &endinpos, &exc, &s,
+-                        &v, &i))
+-                    goto onError;
++                goto error;
+             }
+             else {
+                 WRITECHAR('\\');
+-                WRITECHAR(s[-1]);
++                WRITECHAR((unsigned char)s[-1]);
+             }
+             break;
+         }
+-      nextByte:
+-        ;
++        continue;
++
++      error:
++        endinpos = s-starts;
++        if (unicode_decode_call_errorhandler(
++                errors, &errorHandler,
++                "unicodeescape", message,
++                &starts, &end, &startinpos, &endinpos, &exc, &s,
++                &v, &i))
++            goto onError;
++        len = PyUnicode_GET_LENGTH(v);
++        continue;
+     }
+ #undef WRITECHAR
+ 
+@@ -5775,18 +5760,12 @@
+     void *data;
+     Py_ssize_t expandsize = 0;
+ 
+-    /* Initial allocation is based on the longest-possible unichr
++    /* Initial allocation is based on the longest-possible character
+        escape.
+ 
+-       In wide (UTF-32) builds '\U00xxxxxx' is 10 chars per source
+-       unichr, so in this case it's the longest unichr escape. In
+-       narrow (UTF-16) builds this is five chars per source unichr
+-       since there are two unichrs in the surrogate pair, so in narrow
+-       (UTF-16) builds it's not the longest unichr escape.
+-
+-       In wide or narrow builds '\uxxxx' is 6 chars per source unichr,
+-       so in the narrow (UTF-16) build case it's the longest unichr
+-       escape.
++       For UCS1 strings it's '\xxx', 4 bytes per source character.
++       For UCS2 strings it's '\uxxxx', 6 bytes per source character.
++       For UCS4 strings it's '\U00xxxxxx', 10 bytes per source character.
+     */
+ 
+     if (!PyUnicode_Check(unicode)) {
+@@ -6128,6 +6107,11 @@
+     while (s < end) {
+         Py_UNICODE uch;
+         Py_UCS4 ch;
++        if (end - s < Py_UNICODE_SIZE) {
++            endinpos = end-starts;
++            reason = "truncated input";
++            goto error;
++        }
+         /* We copy the raw representation one byte at a time because the
+            pointer may be unaligned (see test_codeccallbacks). */
+         ((char *) &uch)[0] = s[0];
+@@ -6137,37 +6121,18 @@
+         ((char *) &uch)[3] = s[3];
+ #endif
+         ch = uch;
+-
++#ifdef Py_UNICODE_WIDE
+         /* We have to sanity check the raw data, otherwise doom looms for
+            some malformed UCS-4 data. */
+-        if (
+-#ifdef Py_UNICODE_WIDE
+-            ch > 0x10ffff ||
+-#endif
+-            end-s < Py_UNICODE_SIZE
+-            )
+-        {
+-            startinpos = s - starts;
+-            if (end-s < Py_UNICODE_SIZE) {
+-                endinpos = end-starts;
+-                reason = "truncated input";
+-            }
+-            else {
+-                endinpos = s - starts + Py_UNICODE_SIZE;
+-                reason = "illegal code point (> 0x10FFFF)";
+-            }
+-            if (unicode_decode_call_errorhandler(
+-                    errors, &errorHandler,
+-                    "unicode_internal", reason,
+-                    &starts, &end, &startinpos, &endinpos, &exc, &s,
+-                    &v, &outpos))
+-                goto onError;
+-            continue;
+-        }
+-
++        if (ch > 0x10ffff) {
++            endinpos = s - starts + Py_UNICODE_SIZE;
++            reason = "illegal code point (> 0x10FFFF)";
++            goto error;
++        }
++#endif
+         s += Py_UNICODE_SIZE;
+ #ifndef Py_UNICODE_WIDE
+-        if (Py_UNICODE_IS_HIGH_SURROGATE(ch) && s < end)
++        if (Py_UNICODE_IS_HIGH_SURROGATE(ch) && end - s >= Py_UNICODE_SIZE)
+         {
+             Py_UNICODE uch2;
+             ((char *) &uch2)[0] = s[0];
+@@ -6182,6 +6147,16 @@
+ 
+         if (unicode_putchar(&v, &outpos, ch) < 0)
+             goto onError;
++        continue;
++
++  error:
++        startinpos = s - starts;
++        if (unicode_decode_call_errorhandler(
++                errors, &errorHandler,
++                "unicode_internal", reason,
++                &starts, &end, &startinpos, &endinpos, &exc, &s,
++                &v, &outpos))
++            goto onError;
+     }
+ 
+     if (unicode_resize(&v, outpos) < 0)
+@@ -6565,10 +6540,8 @@
+     PyObject *errorHandler = NULL;
+     PyObject *exc = NULL;
+ 
+-    if (size == 0) {
+-        Py_INCREF(unicode_empty);
+-        return unicode_empty;
+-    }
++    if (size == 0)
++        _Py_RETURN_UNICODE_EMPTY();
+ 
+     /* ASCII is equivalent to the first 128 ordinals in Unicode. */
+     if (size == 1 && (unsigned char)s[0] < 128)
+@@ -6947,8 +6920,7 @@
+         if (chunk_size == 0 && done) {
+             if (v != NULL)
+                 break;
+-            Py_INCREF(unicode_empty);
+-            return unicode_empty;
++            _Py_RETURN_UNICODE_EMPTY();
+         }
+ 
+ 
+@@ -7519,51 +7491,48 @@
+                 if (PyErr_ExceptionMatches(PyExc_LookupError)) {
+                     /* No mapping found means: mapping is undefined. */
+                     PyErr_Clear();
+-                    x = Py_None;
+-                    Py_INCREF(x);
++                    goto Undefined;
+                 } else
+                     goto onError;
+             }
+ 
+             /* Apply mapping */
++            if (x == Py_None)
++                goto Undefined;
+             if (PyLong_Check(x)) {
+                 long value = PyLong_AS_LONG(x);
+-                if (value < 0 || value > 65535) {
+-                    PyErr_SetString(PyExc_TypeError,
+-                                    "character mapping must be in range(65536)");
++                if (value == 0xFFFE)
++                    goto Undefined;
++                if (value < 0 || value > MAX_UNICODE) {
++                    PyErr_Format(PyExc_TypeError,
++                                 "character mapping must be in range(0x%lx)",
++                                 (unsigned long)MAX_UNICODE + 1);
+                     Py_DECREF(x);
+                     goto onError;
+                 }
+-                if (unicode_putchar(&v, &outpos, value) < 0)
+-                    goto onError;
+-            }
+-            else if (x == Py_None) {
+-                /* undefined mapping */
+-                startinpos = s-starts;
+-                endinpos = startinpos+1;
+-                if (unicode_decode_call_errorhandler(
+-                        errors, &errorHandler,
+-                        "charmap", "character maps to <undefined>",
+-                        &starts, &e, &startinpos, &endinpos, &exc, &s,
+-                        &v, &outpos)) {
++                if (unicode_putchar(&v, &outpos, value) < 0) {
+                     Py_DECREF(x);
+                     goto onError;
+                 }
+-                Py_DECREF(x);
+-                continue;
+             }
+             else if (PyUnicode_Check(x)) {
+                 Py_ssize_t targetsize;
+ 
+-                if (PyUnicode_READY(x) == -1)
++                if (PyUnicode_READY(x) == -1) {
++                    Py_DECREF(x);
+                     goto onError;
++                }
+                 targetsize = PyUnicode_GET_LENGTH(x);
+ 
+                 if (targetsize == 1) {
+                     /* 1-1 mapping */
+-                    if (unicode_putchar(&v, &outpos,
+-                                        PyUnicode_READ_CHAR(x, 0)) < 0)
++                    Py_UCS4 value = PyUnicode_READ_CHAR(x, 0);
++                    if (value == 0xFFFE)
++                        goto Undefined;
++                    if (unicode_putchar(&v, &outpos, value) < 0) {
++                        Py_DECREF(x);
+                         goto onError;
++                    }
+                 }
+                 else if (targetsize > 1) {
+                     /* 1-n mapping */
+@@ -7580,8 +7549,11 @@
+                             goto onError;
+                         }
+                     }
+-                    if (unicode_widen(&v, outpos, PyUnicode_MAX_CHAR_VALUE(x)) < 0)
++                    if (unicode_widen(&v, outpos,
++                                      PyUnicode_MAX_CHAR_VALUE(x)) < 0) {
++                        Py_DECREF(x);
+                         goto onError;
++                    }
+                     PyUnicode_CopyCharacters(v, outpos, x, 0, targetsize);
+                     outpos += targetsize;
+                     extrachars -= targetsize;
+@@ -7597,6 +7569,19 @@
+             }
+             Py_DECREF(x);
+             ++s;
++            continue;
++Undefined:
++            /* undefined mapping */
++            Py_XDECREF(x);
++            startinpos = s-starts;
++            endinpos = startinpos+1;
++            if (unicode_decode_call_errorhandler(
++                    errors, &errorHandler,
++                    "charmap", "character maps to <undefined>",
++                    &starts, &e, &startinpos, &endinpos, &exc, &s,
++                    &v, &outpos)) {
++                goto onError;
++            }
+         }
+     }
+     if (unicode_resize(&v, outpos) < 0)
+@@ -9145,7 +9130,7 @@
+             /* We do not need to compare 0 and len(substring)-1 because
+                the if statement above ensured already that they are equal
+                when we end up here. */
+-            // TODO: honor direction and do a forward or backwards search
++            /* TODO: honor direction and do a forward or backwards search */
+             for (i = 1; i < end_sub; ++i) {
+                 if (PyUnicode_READ(kind_self, data_self, offset + i) !=
+                     PyUnicode_READ(kind_sub, data_sub, i))
+@@ -9506,9 +9491,7 @@
+     /* If empty sequence, return u"". */
+     if (seqlen == 0) {
+         Py_DECREF(fseq);
+-        Py_INCREF(unicode_empty);
+-        res = unicode_empty;
+-        return res;
++        _Py_RETURN_UNICODE_EMPTY();
+     }
+ 
+     /* If singleton sequence with an exact Unicode, return that. */
+@@ -10132,6 +10115,7 @@
+                 /* widen self and buf1 */
+                 rkind = kind2;
+                 if (release1) PyMem_Free(buf1);
++                release1 = 0;
+                 sbuf = _PyUnicode_AsKind(self, rkind);
+                 if (!sbuf) goto error;
+                 srelease = 1;
+@@ -10167,7 +10151,7 @@
+     }
+     else {
+         Py_ssize_t n, i, j, ires;
+-        Py_ssize_t product, new_size;
++        Py_ssize_t new_size;
+         int rkind = skind;
+         char *res;
+ 
+@@ -10193,25 +10177,27 @@
+             if (!sbuf) goto error;
+             srelease = 1;
+             if (release1) PyMem_Free(buf1);
++            release1 = 0;
+             buf1 = _PyUnicode_AsKind(str1, rkind);
+             if (!buf1) goto error;
+             release1 = 1;
+         }
+         /* new_size = PyUnicode_GET_LENGTH(self) + n * (PyUnicode_GET_LENGTH(str2) -
+            PyUnicode_GET_LENGTH(str1))); */
+-        product = n * (len2-len1);
+-        if ((product / (len2-len1)) != n) {
++        if (len2 > len1 && len2 - len1 > (PY_SSIZE_T_MAX - slen) / n) {
+                 PyErr_SetString(PyExc_OverflowError,
+                                 "replace string is too long");
+                 goto error;
+         }
+-        new_size = slen + product;
++        new_size = slen + n * (len2 - len1);
+         if (new_size == 0) {
+-            Py_INCREF(unicode_empty);
++            _Py_INCREF_UNICODE_EMPTY();
++            if (!unicode_empty)
++                goto error;
+             u = unicode_empty;
+             goto done;
+         }
+-        if (new_size < 0 || new_size > (PY_SSIZE_T_MAX >> (rkind-1))) {
++        if (new_size > (PY_SSIZE_T_MAX >> (rkind-1))) {
+             PyErr_SetString(PyExc_OverflowError,
+                             "replace string is too long");
+             goto error;
+@@ -10684,7 +10670,7 @@
+         return;
+     }
+     left = *p_left;
+-    if (right == NULL || !PyUnicode_Check(left)) {
++    if (right == NULL || left == NULL || !PyUnicode_Check(left)) {
+         if (!PyErr_Occurred())
+             PyErr_BadInternalCall();
+         goto error;
+@@ -11020,7 +11006,7 @@
+ unicode_hash(PyObject *self)
+ {
+     Py_ssize_t len;
+-    Py_uhash_t x;
++    Py_uhash_t x;  /* Unsigned for defined overflow behavior. */
+ 
+ #ifdef Py_DEBUG
+     assert(_Py_HashSecret_Initialized);
+@@ -11674,10 +11660,8 @@
+         PyErr_SetString(PyExc_IndexError, "string index out of range");
+         return NULL;
+     }
+-    if (start >= length || end < start) {
+-        Py_INCREF(unicode_empty);
+-        return unicode_empty;
+-    }
++    if (start >= length || end < start)
++        _Py_RETURN_UNICODE_EMPTY();
+ 
+     length = end - start;
+     if (PyUnicode_IS_ASCII(self)) {
+@@ -11804,10 +11788,8 @@
+     PyObject *u;
+     Py_ssize_t nchars, n;
+ 
+-    if (len < 1) {
+-        Py_INCREF(unicode_empty);
+-        return unicode_empty;
+-    }
++    if (len < 1)
++        _Py_RETURN_UNICODE_EMPTY();
+ 
+     /* no repeat, return original string */
+     if (len == 1)
+@@ -12926,8 +12908,7 @@
+ {
+     if (writer->pos == 0) {
+         Py_XDECREF(writer->buffer);
+-        Py_INCREF(unicode_empty);
+-        return unicode_empty;
++        _Py_RETURN_UNICODE_EMPTY();
+     }
+     if (writer->readonly) {
+         assert(PyUnicode_GET_LENGTH(writer->buffer) == writer->pos);
+@@ -13145,8 +13126,7 @@
+         }
+ 
+         if (slicelength <= 0) {
+-            Py_INCREF(unicode_empty);
+-            return unicode_empty;
++            _Py_RETURN_UNICODE_EMPTY();
+         } else if (start == 0 && step == 1 &&
+                    slicelength == PyUnicode_GET_LENGTH(self)) {
+             return unicode_result_unchanged(self);
+@@ -13444,8 +13424,10 @@
+     uformat = PyUnicode_FromObject(format);
+     if (uformat == NULL)
+         return NULL;
+-    if (PyUnicode_READY(uformat) == -1)
++    if (PyUnicode_READY(uformat) == -1) {
+         Py_DECREF(uformat);
++        return NULL;
++    }
+ 
+     fmt = PyUnicode_DATA(uformat);
+     fmtkind = PyUnicode_KIND(uformat);
+@@ -13462,8 +13444,7 @@
+         arglen = -1;
+         argidx = -2;
+     }
+-    if (Py_TYPE(args)->tp_as_mapping && !PyTuple_Check(args) &&
+-        !PyUnicode_Check(args))
++    if (PyMapping_Check(args) && !PyTuple_Check(args) && !PyUnicode_Check(args))
+         dict = args;
+ 
+     while (--fmtcnt >= 0) {
+@@ -13571,7 +13552,7 @@
+                                     "* wants int");
+                     goto onError;
+                 }
+-                width = PyLong_AsLong(v);
++                width = PyLong_AsSsize_t(v);
+                 if (width == -1 && PyErr_Occurred())
+                     goto onError;
+                 if (width < 0) {
+@@ -13611,7 +13592,7 @@
+                                         "* wants int");
+                         goto onError;
+                     }
+-                    prec = PyLong_AsLong(v);
++                    prec = _PyLong_AsInt(v);
+                     if (prec == -1 && PyErr_Occurred())
+                         goto onError;
+                     if (prec < 0)
+@@ -13975,10 +13956,8 @@
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oss:str",
+                                      kwlist, &x, &encoding, &errors))
+         return NULL;
+-    if (x == NULL) {
+-        Py_INCREF(unicode_empty);
+-        return unicode_empty;
+-    }
++    if (x == NULL)
++        _Py_RETURN_UNICODE_EMPTY();
+     if (encoding == NULL && errors == NULL)
+         return PyObject_Str(x);
+     else
+@@ -14086,7 +14065,8 @@
+ }
+ 
+ PyDoc_STRVAR(unicode_doc,
+-             "str(object[, encoding[, errors]]) -> str\n\
++"str(object='') -> str\n\
++str(bytes_or_buffer[, encoding[, errors]]) -> str\n\
+ \n\
+ Create a new string object from the given object. If encoding or\n\
+ errors is specified, then the object must expose a data buffer\n\
+@@ -14146,8 +14126,6 @@
+ 
+ int _PyUnicode_Init(void)
+ {
+-    int i;
+-
+     /* XXX - move this array to unicodectype.c ? */
+     Py_UCS2 linebreak[] = {
+         0x000A, /* LINE FEED */
+@@ -14161,13 +14139,11 @@
+     };
+ 
+     /* Init the implementation */
+-    unicode_empty = PyUnicode_New(0, 0);
++    _Py_INCREF_UNICODE_EMPTY();
+     if (!unicode_empty)
+         Py_FatalError("Can't create empty string");
+-    assert(_PyUnicode_CheckConsistency(unicode_empty, 1));
+-
+-    for (i = 0; i < 256; i++)
+-        unicode_latin1[i] = NULL;
++    Py_DECREF(unicode_empty);
++
+     if (PyType_Ready(&PyUnicode_Type) < 0)
+         Py_FatalError("Can't initialize 'unicode'");
+ 
+@@ -14178,6 +14154,12 @@
+ 
+     PyType_Ready(&EncodingMapType);
+ 
++    if (PyType_Ready(&PyFieldNameIter_Type) < 0)
++        Py_FatalError("Can't initialize field name iterator type");
++
++    if (PyType_Ready(&PyFormatterIter_Type) < 0)
++        Py_FatalError("Can't initialize formatter iter type");
++
+ #ifdef HAVE_MBCS
+     winver.dwOSVersionInfoSize = sizeof(winver);
+     if (!GetVersionEx((OSVERSIONINFO*)&winver)) {
+@@ -14201,15 +14183,10 @@
+ {
+     int i;
+ 
+-    Py_XDECREF(unicode_empty);
+-    unicode_empty = NULL;
+-
+-    for (i = 0; i < 256; i++) {
+-        if (unicode_latin1[i]) {
+-            Py_DECREF(unicode_latin1[i]);
+-            unicode_latin1[i] = NULL;
+-        }
+-    }
++    Py_CLEAR(unicode_empty);
++
++    for (i = 0; i < 256; i++)
++        Py_CLEAR(unicode_latin1[i]);
+     _PyUnicode_ClearStaticStrings();
+     (void)PyUnicode_ClearFreeList();
+ }
+@@ -14338,8 +14315,7 @@
+             "mortal/immortal\n", mortal_size, immortal_size);
+     Py_DECREF(keys);
+     PyDict_Clear(interned);
+-    Py_DECREF(interned);
+-    interned = NULL;
++    Py_CLEAR(interned);
+ }
+ 
+ 
+diff -r bd8afb90ebf2 Objects/weakrefobject.c
+--- a/Objects/weakrefobject.c
++++ b/Objects/weakrefobject.c
+@@ -52,9 +52,8 @@
+ {
+     PyObject *callback = self->wr_callback;
+ 
+-    if (PyWeakref_GET_OBJECT(self) != Py_None) {
+-        PyWeakReference **list = GET_WEAKREFS_LISTPTR(
+-            PyWeakref_GET_OBJECT(self));
++    if (self->wr_object != Py_None) {
++        PyWeakReference **list = GET_WEAKREFS_LISTPTR(self->wr_object);
+ 
+         if (*list == self)
+             /* If 'self' is the end of the list (and thus self->wr_next == NULL)
+@@ -198,9 +197,13 @@
+     }
+     if (PyWeakref_GET_OBJECT(self) == Py_None
+         || PyWeakref_GET_OBJECT(other) == Py_None) {
+-        PyObject *res = self==other ? Py_True : Py_False;
+-        Py_INCREF(res);
+-        return res;
++        int res = (self == other);
++        if (op == Py_NE)
++            res = !res;
++        if (res)
++            Py_RETURN_TRUE;
++        else
++            Py_RETURN_FALSE;
+     }
+     return PyObject_RichCompare(PyWeakref_GET_OBJECT(self),
+                                 PyWeakref_GET_OBJECT(other), op);
+diff -r bd8afb90ebf2 PC/winreg.c
+--- a/PC/winreg.c
++++ b/PC/winreg.c
+@@ -50,8 +50,8 @@
+ "FlushKey() - Writes all the attributes of the specified key to the registry.\n"
+ "LoadKey() - Creates a subkey under HKEY_USER or HKEY_LOCAL_MACHINE and stores\n"
+ "            registration information from a specified file into that subkey.\n"
+-"OpenKey() - Alias for <om win32api.RegOpenKeyEx>\n"
+-"OpenKeyEx() - Opens the specified key.\n"
++"OpenKey() - Opens the specified key.\n"
++"OpenKeyEx() - Alias of OpenKey().\n"
+ "QueryValue() - Retrieves the value associated with the unnamed value for a\n"
+ "               specified key in the registry.\n"
+ "QueryValueEx() - Retrieves the type and data for a specified value name\n"
+@@ -72,7 +72,8 @@
+ 
+ 
+ PyDoc_STRVAR(CloseKey_doc,
+-"CloseKey(hkey) - Closes a previously opened registry key.\n"
++"CloseKey(hkey)\n"
++"Closes a previously opened registry key.\n"
+ "\n"
+ "The hkey argument specifies a previously opened key.\n"
+ "\n"
+@@ -80,128 +81,145 @@
+ "closed when the hkey object is destroyed by Python.");
+ 
+ PyDoc_STRVAR(ConnectRegistry_doc,
+-"key = ConnectRegistry(computer_name, key) - "
++"ConnectRegistry(computer_name, key) -> key\n"
+ "Establishes a connection to a predefined registry handle on another computer.\n"
+ "\n"
+ "computer_name is the name of the remote computer, of the form \\\\computername.\n"
+-" If None, the local computer is used.\n"
++"              If None, the local computer is used.\n"
+ "key is the predefined handle to connect to.\n"
+ "\n"
+ "The return value is the handle of the opened key.\n"
+-"If the function fails, a WindowsError exception is raised.");
++"If the function fails, an OSError exception is raised.");
+ 
+ PyDoc_STRVAR(CreateKey_doc,
+-"key = CreateKey(key, sub_key) - Creates or opens the specified key.\n"
++"CreateKey(key, sub_key) -> key\n"
++"Creates or opens the specified key.\n"
++"\n"
++"key is an already open key, or one of the predefined HKEY_* constants.\n"
++"sub_key is a string that names the key this method opens or creates.\n"
++"\n"
++"If key is one of the predefined keys, sub_key may be None. In that case,\n"
++"the handle returned is the same key handle passed in to the function.\n"
++"\n"
++"If the key already exists, this function opens the existing key.\n"
++"\n"
++"The return value is the handle of the opened key.\n"
++"If the function fails, an OSError exception is raised.");
++
++PyDoc_STRVAR(CreateKeyEx_doc,
++"CreateKeyEx(key, sub_key, reserved=0, access=KEY_WRITE) -> key\n"
++"Creates or opens the specified key.\n"
+ "\n"
+ "key is an already open key, or one of the predefined HKEY_* constants\n"
+ "sub_key is a string that names the key this method opens or creates.\n"
+-" If key is one of the predefined keys, sub_key may be None. In that case,\n"
+-" the handle returned is the same key handle passed in to the function.\n"
++"reserved is a reserved integer, and must be zero.  Default is zero.\n"
++"access is an integer that specifies an access mask that describes the \n"
++"       desired security access for the key. Default is KEY_WRITE.\n"
++"\n"
++"If key is one of the predefined keys, sub_key may be None. In that case,\n"
++"the handle returned is the same key handle passed in to the function.\n"
+ "\n"
+ "If the key already exists, this function opens the existing key\n"
+ "\n"
+ "The return value is the handle of the opened key.\n"
+-"If the function fails, an exception is raised.");
+-
+-PyDoc_STRVAR(CreateKeyEx_doc,
+-"key = CreateKeyEx(key, sub_key, res, sam) - Creates or opens the specified key.\n"
+-"\n"
+-"key is an already open key, or one of the predefined HKEY_* constants\n"
+-"sub_key is a string that names the key this method opens or creates.\n"
+-"res is a reserved integer, and must be zero.  Default is zero.\n"
+-"sam is an integer that specifies an access mask that describes the desired\n"
+-" If key is one of the predefined keys, sub_key may be None. In that case,\n"
+-" the handle returned is the same key handle passed in to the function.\n"
+-"\n"
+-"If the key already exists, this function opens the existing key\n"
+-"\n"
+-"The return value is the handle of the opened key.\n"
+-"If the function fails, an exception is raised.");
++"If the function fails, an OSError exception is raised.");
+ 
+ PyDoc_STRVAR(DeleteKey_doc,
+-"DeleteKey(key, sub_key) - Deletes the specified key.\n"
++"DeleteKey(key, sub_key)\n"
++"Deletes the specified key.\n"
+ "\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+-"sub_key is a string that must be a subkey of the key identified by the key parameter.\n"
+-" This value must not be None, and the key may not have subkeys.\n"
++"sub_key is a string that must be a subkey of the key identified by the key\n"
++"        parameter. This value must not be None, and the key may not have\n"
++"        subkeys.\n"
+ "\n"
+ "This method can not delete keys with subkeys.\n"
+ "\n"
+-"If the method succeeds, the entire key, including all of its values,\n"
+-"is removed.  If the method fails, a WindowsError exception is raised.");
++"If the function succeeds, the entire key, including all of its values,\n"
++"is removed.  If the function fails, an OSError exception is raised.");
+ 
+ PyDoc_STRVAR(DeleteKeyEx_doc,
+-"DeleteKeyEx(key, sub_key, sam, res) - Deletes the specified key.\n"
++"DeleteKeyEx(key, sub_key, access=KEY_WOW64_64KEY, reserved=0)\n"
++"Deletes the specified key (64-bit OS only).\n"
+ "\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+-"sub_key is a string that must be a subkey of the key identified by the key parameter.\n"
+-"res is a reserved integer, and must be zero.  Default is zero.\n"
+-"sam is an integer that specifies an access mask that describes the desired\n"
+-" This value must not be None, and the key may not have subkeys.\n"
++"sub_key is a string that must be a subkey of the key identified by the key\n"
++"        parameter. This value must not be None, and the key may not have\n"
++"        subkeys.\n"
++"reserved is a reserved integer, and must be zero.  Default is zero.\n"
++"access is an integer that specifies an access mask that describes the \n"
++"       desired security access for the key. Default is KEY_WOW64_64KEY.\n"
+ "\n"
+ "This method can not delete keys with subkeys.\n"
+ "\n"
+-"If the method succeeds, the entire key, including all of its values,\n"
+-"is removed.  If the method fails, a WindowsError exception is raised.\n"
++"If the function succeeds, the entire key, including all of its values,\n"
++"is removed.  If the function fails, an OSError exception is raised.\n"
+ "On unsupported Windows versions, NotImplementedError is raised.");
+ 
+ PyDoc_STRVAR(DeleteValue_doc,
+-"DeleteValue(key, value) - Removes a named value from a registry key.\n"
++"DeleteValue(key, value)\n"
++"Removes a named value from a registry key.\n"
+ "\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+ "value is a string that identifies the value to remove.");
+ 
+ PyDoc_STRVAR(EnumKey_doc,
+-"string = EnumKey(key, index) - Enumerates subkeys of an open registry key.\n"
++"EnumKey(key, index) -> string\n"
++"Enumerates subkeys of an open registry key.\n"
+ "\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+ "index is an integer that identifies the index of the key to retrieve.\n"
+ "\n"
+ "The function retrieves the name of one subkey each time it is called.\n"
+-"It is typically called repeatedly until a WindowsError exception is\n"
++"It is typically called repeatedly until an OSError exception is\n"
+ "raised, indicating no more values are available.");
+ 
+ PyDoc_STRVAR(EnumValue_doc,
+-"tuple = EnumValue(key, index) - Enumerates values of an open registry key.\n"
++"EnumValue(key, index) -> tuple\n"
++"Enumerates values of an open registry key.\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+ "index is an integer that identifies the index of the value to retrieve.\n"
+ "\n"
+ "The function retrieves the name of one subkey each time it is called.\n"
+-"It is typically called repeatedly, until a WindowsError exception\n"
++"It is typically called repeatedly, until an OSError exception\n"
+ "is raised, indicating no more values.\n"
+ "\n"
+ "The result is a tuple of 3 items:\n"
+ "value_name is a string that identifies the value.\n"
+ "value_data is an object that holds the value data, and whose type depends\n"
+-" on the underlying registry type.\n"
++"           on the underlying registry type.\n"
+ "data_type is an integer that identifies the type of the value data.");
+ 
+ PyDoc_STRVAR(ExpandEnvironmentStrings_doc,
+-"string = ExpandEnvironmentStrings(string) - Expand environment vars.\n");
++"ExpandEnvironmentStrings(string) -> string\n"
++"Expand environment vars.\n");
+ 
+ PyDoc_STRVAR(FlushKey_doc,
+-"FlushKey(key) - Writes all the attributes of a key to the registry.\n"
++"FlushKey(key)\n"
++"Writes all the attributes of a key to the registry.\n"
+ "\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+ "\n"
+-"It is not necessary to call RegFlushKey to change a key.\n"
+-"Registry changes are flushed to disk by the registry using its lazy flusher.\n"
+-"Registry changes are also flushed to disk at system shutdown.\n"
+-"Unlike CloseKey(), the FlushKey() method returns only when all the data has\n"
+-"been written to the registry.\n"
+-"An application should only call FlushKey() if it requires absolute certainty that registry changes are on disk.\n"
+-"If you don't know whether a FlushKey() call is required, it probably isn't.");
++"It is not necessary to call FlushKey to change a key.  Registry changes are\n"
++"flushed to disk by the registry using its lazy flusher.  Registry changes are\n"
++"also flushed to disk at system shutdown.  Unlike CloseKey(), the FlushKey()\n"
++"method returns only when all the data has been written to the registry.\n"
++"\n"
++"An application should only call FlushKey() if it requires absolute certainty\n"
++"that registry changes are on disk.  If you don't know whether a FlushKey()\n"
++"call is required, it probably isn't.");
+ 
+ PyDoc_STRVAR(LoadKey_doc,
+-"LoadKey(key, sub_key, file_name) - Creates a subkey under the specified key\n"
+-"and stores registration information from a specified file into that subkey.\n"
++"LoadKey(key, sub_key, file_name)\n"
++"Creates a subkey under the specified key and stores registration information\n"
++"from a specified file into that subkey.\n"
+ "\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+-"sub_key is a string that identifies the sub_key to load\n"
+-"file_name is the name of the file to load registry data from.\n"
+-" This file must have been created with the SaveKey() function.\n"
+-" Under the file allocation table (FAT) file system, the filename may not\n"
+-"have an extension.\n"
++"sub_key is a string that identifies the sub_key to load.\n"
++"file_name is the name of the file to load registry data from.  This file must\n"
++"          have been created with the SaveKey() function.  Under the file\n"
++"          allocation table (FAT) file system, the filename may not have an\n"
++"          extension.\n"
+ "\n"
+ "A call to LoadKey() fails if the calling process does not have the\n"
+ "SE_RESTORE_PRIVILEGE privilege.\n"
+@@ -212,21 +230,23 @@
+ "The docs imply key must be in the HKEY_USER or HKEY_LOCAL_MACHINE tree");
+ 
+ PyDoc_STRVAR(OpenKey_doc,
+-"key = OpenKey(key, sub_key, res = 0, sam = KEY_READ) - Opens the specified key.\n"
++"OpenKey(key, sub_key, reserved=0, access=KEY_READ) -> key\n"
++"Opens the specified key.\n"
+ "\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+-"sub_key is a string that identifies the sub_key to open\n"
+-"res is a reserved integer, and must be zero.  Default is zero.\n"
+-"sam is an integer that specifies an access mask that describes the desired\n"
+-" security access for the key.  Default is KEY_READ\n"
++"sub_key is a string that identifies the sub_key to open.\n"
++"reserved is a reserved integer, and must be zero.  Default is zero.\n"
++"access is an integer that specifies an access mask that describes the desired\n"
++"       security access for the key.  Default is KEY_READ\n"
+ "\n"
+ "The result is a new handle to the specified key\n"
+-"If the function fails, a WindowsError exception is raised.");
++"If the function fails, an OSError exception is raised.");
+ 
+ PyDoc_STRVAR(OpenKeyEx_doc, "See OpenKey()");
+ 
+ PyDoc_STRVAR(QueryInfoKey_doc,
+-"tuple = QueryInfoKey(key) - Returns information about a key.\n"
++"QueryInfoKey(key) -> tuple\n"
++"Returns information about a key.\n"
+ "\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+ "\n"
+@@ -237,44 +257,51 @@
+ " as 100's of nanoseconds since Jan 1, 1600.");
+ 
+ PyDoc_STRVAR(QueryValue_doc,
+-"string = QueryValue(key, sub_key) - retrieves the unnamed value for a key.\n"
++"QueryValue(key, sub_key) -> string\n"
++"Retrieves the unnamed value for a key.\n"
+ "\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+ "sub_key is a string that holds the name of the subkey with which the value\n"
+-" is associated.  If this parameter is None or empty, the function retrieves\n"
+-" the value set by the SetValue() method for the key identified by key."
++"        is associated.  If this parameter is None or empty, the function\n"
++"        retrieves the value set by the SetValue() method for the key\n"
++"        identified by key."
+ "\n"
+ "Values in the registry have name, type, and data components. This method\n"
+ "retrieves the data for a key's first value that has a NULL name.\n"
+ "But the underlying API call doesn't return the type, Lame Lame Lame, DONT USE THIS!!!");
+ 
+ PyDoc_STRVAR(QueryValueEx_doc,
+-"value,type_id = QueryValueEx(key, value_name) - Retrieves the type and data for a specified value name associated with an open registry key.\n"
++"QueryValueEx(key, value_name) -> (value, type_id)\n"
++"Retrieves the type and data for a specified value name associated with an\n"
++"open registry key.\n"
+ "\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+ "value_name is a string indicating the value to query");
+ 
+ PyDoc_STRVAR(SaveKey_doc,
+-"SaveKey(key, file_name) - Saves the specified key, and all its subkeys to the specified file.\n"
++"SaveKey(key, file_name)\n"
++"Saves the specified key, and all its subkeys to the specified file.\n"
+ "\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+-"file_name is the name of the file to save registry data to.\n"
+-" This file cannot already exist. If this filename includes an extension,\n"
+-" it cannot be used on file allocation table (FAT) file systems by the\n"
+-" LoadKey(), ReplaceKey() or RestoreKey() methods.\n"
++"file_name is the name of the file to save registry data to.  This file cannot\n"
++"          already exist. If this filename includes an extension, it cannot be\n"
++"          used on file allocation table (FAT) file systems by the LoadKey(),\n"
++"          ReplaceKey() or RestoreKey() methods.\n"
+ "\n"
+-"If key represents a key on a remote computer, the path described by\n"
+-"file_name is relative to the remote computer.\n"
+-"The caller of this method must possess the SeBackupPrivilege security privilege.\n"
+-"This function passes NULL for security_attributes to the API.");
++"If key represents a key on a remote computer, the path described by file_name\n"
++"is relative to the remote computer.\n"
++"\n"
++"The caller of this method must possess the SeBackupPrivilege security\n"
++"privilege.  This function passes NULL for security_attributes to the API.");
+ 
+ PyDoc_STRVAR(SetValue_doc,
+-"SetValue(key, sub_key, type, value) - Associates a value with a specified key.\n"
++"SetValue(key, sub_key, type, value)\n"
++"Associates a value with a specified key.\n"
+ "\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+ "sub_key is a string that names the subkey with which the value is associated.\n"
+-"type is an integer that specifies the type of the data.  Currently this\n"
+-" must be REG_SZ, meaning only strings are supported.\n"
++"type is an integer that specifies the type of the data.  Currently this must\n"
++"     be REG_SZ, meaning only strings are supported.\n"
+ "value is a string that specifies the new value.\n"
+ "\n"
+ "If the key specified by the sub_key parameter does not exist, the SetValue\n"
+@@ -288,10 +315,12 @@
+ "KEY_SET_VALUE access.");
+ 
+ PyDoc_STRVAR(SetValueEx_doc,
+-"SetValueEx(key, value_name, reserved, type, value) - Stores data in the value field of an open registry key.\n"
++"SetValueEx(key, value_name, reserved, type, value)\n"
++"Stores data in the value field of an open registry key.\n"
+ "\n"
+ "key is an already open key, or any one of the predefined HKEY_* constants.\n"
+-"value_name is a string containing the name of the value to set, or None\n"
++"value_name is a string containing the name of the value to set, or None.\n"
++"reserved can be anything - zero is always passed to the API.\n"
+ "type is an integer that specifies the type of the data.  This should be one of:\n"
+ "  REG_BINARY -- Binary data in any form.\n"
+ "  REG_DWORD -- A 32-bit number.\n"
+@@ -306,7 +335,6 @@
+ "  REG_NONE -- No defined value type.\n"
+ "  REG_RESOURCE_LIST -- A device-driver resource list.\n"
+ "  REG_SZ -- A null-terminated string.\n"
+-"reserved can be anything - zero is always passed to the API.\n"
+ "value is a string that specifies the new value.\n"
+ "\n"
+ "This method can also set additional value and type information for the\n"
+@@ -323,6 +351,7 @@
+ "Disables registry reflection for 32-bit processes running on a 64-bit\n"
+ "Operating System.  Will generally raise NotImplemented if executed on\n"
+ "a 32-bit Operating System.\n"
++"\n"
+ "If the key is not on the reflection list, the function succeeds but has no effect.\n"
+ "Disabling reflection for a key does not affect reflection of any subkeys.");
+ 
+@@ -332,7 +361,8 @@
+ "Restoring reflection for a key does not affect reflection of any subkeys.");
+ 
+ PyDoc_STRVAR(QueryReflectionKey_doc,
+-"bool = QueryReflectionKey(hkey) - Determines the reflection state for the specified key.\n"
++"QueryReflectionKey(hkey) -> bool\n"
++"Determines the reflection state for the specified key.\n"
+ "Will generally raise NotImplemented if executed on a 32-bit Operating System.\n");
+ 
+ /* PyHKEY docstrings */
+@@ -360,12 +390,14 @@
+ 
+ 
+ PyDoc_STRVAR(PyHKEY_Close_doc,
+-"key.Close() - Closes the underlying Windows handle.\n"
++"key.Close()\n"
++"Closes the underlying Windows handle.\n"
+ "\n"
+ "If the handle is already closed, no error is raised.");
+ 
+ PyDoc_STRVAR(PyHKEY_Detach_doc,
+-"int = key.Detach() - Detaches the Windows handle from the handle object.\n"
++"key.Detach() -> int\n"
++"Detaches the Windows handle from the handle object.\n"
+ "\n"
+ "The result is the value of the handle before it is detached.  If the\n"
+ "handle is already detached, this will return zero.\n"
+@@ -753,7 +785,7 @@
+                 memcpy(*retDataBuf, &zero, sizeof(DWORD));
+             }
+             else {
+-                DWORD d = PyLong_AsLong(value);
++                DWORD d = PyLong_AsUnsignedLong(value);
+                 memcpy(*retDataBuf, &d, sizeof(DWORD));
+             }
+             break;
+@@ -880,9 +912,9 @@
+     switch (typ) {
+         case REG_DWORD:
+             if (retDataSize == 0)
+-                obData = PyLong_FromLong(0);
++                obData = PyLong_FromUnsignedLong(0);
+             else
+-                obData = PyLong_FromLong(*(int *)retDataBuf);
++                obData = PyLong_FromUnsignedLong(*(int *)retDataBuf);
+             break;
+         case REG_SZ:
+         case REG_EXPAND_SZ:
+diff -r bd8afb90ebf2 PCbuild/select.vcxproj
+--- a/PCbuild/select.vcxproj
++++ b/PCbuild/select.vcxproj
+@@ -151,7 +151,7 @@
+   </PropertyGroup>
+   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+     <Link>
+-      <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+       <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+       <BaseAddress>0x1D110000</BaseAddress>
+     </Link>
+@@ -161,14 +161,14 @@
+       <TargetEnvironment>X64</TargetEnvironment>
+     </Midl>
+     <Link>
+-      <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+       <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+       <BaseAddress>0x1D110000</BaseAddress>
+     </Link>
+   </ItemDefinitionGroup>
+   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+     <Link>
+-      <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+       <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+       <BaseAddress>0x1D110000</BaseAddress>
+     </Link>
+@@ -178,14 +178,14 @@
+       <TargetEnvironment>X64</TargetEnvironment>
+     </Midl>
+     <Link>
+-      <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+       <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+       <BaseAddress>0x1D110000</BaseAddress>
+     </Link>
+   </ItemDefinitionGroup>
+   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
+     <Link>
+-      <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+       <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+       <BaseAddress>0x1D110000</BaseAddress>
+     </Link>
+@@ -195,7 +195,7 @@
+       <TargetEnvironment>X64</TargetEnvironment>
+     </Midl>
+     <Link>
+-      <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+       <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+       <BaseAddress>0x1D110000</BaseAddress>
+       <TargetMachine>MachineX64</TargetMachine>
+@@ -203,7 +203,7 @@
+   </ItemDefinitionGroup>
+   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">
+     <Link>
+-      <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+       <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+       <BaseAddress>0x1D110000</BaseAddress>
+     </Link>
+@@ -213,7 +213,7 @@
+       <TargetEnvironment>X64</TargetEnvironment>
+     </Midl>
+     <Link>
+-      <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
++      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+       <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+       <BaseAddress>0x1D110000</BaseAddress>
+       <TargetMachine>MachineX64</TargetMachine>
+diff -r bd8afb90ebf2 Parser/Python.asdl
+--- a/Parser/Python.asdl
++++ b/Parser/Python.asdl
+@@ -60,7 +60,7 @@
+          | GeneratorExp(expr elt, comprehension* generators)
+          -- the grammar constrains where yield expressions can occur
+          | Yield(expr? value)
+-             | YieldFrom(expr? value)
++         | YieldFrom(expr value)
+          -- need sequences for compare to distinguish between
+          -- x < 4 < 3 and (x < 4) < 3
+          | Compare(expr left, cmpop* ops, expr* comparators)
+diff -r bd8afb90ebf2 Parser/asdl_c.py
+--- a/Parser/asdl_c.py
++++ b/Parser/asdl_c.py
+@@ -5,7 +5,6 @@
+ # handle fields that have a type but no name
+ 
+ import os, sys
+-import subprocess
+ 
+ import asdl
+ 
+@@ -1064,7 +1063,7 @@
+             self.emit("case %s:" % t.name, 2)
+             self.emit("Py_INCREF(%s_singleton);" % t.name, 3)
+             self.emit("return %s_singleton;" % t.name, 3)
+-        self.emit("default:" % name, 2)
++        self.emit("default:", 2)
+         self.emit('/* should never happen, but just in case ... */', 3)
+         code = "PyErr_Format(PyExc_SystemError, \"unknown %s found\");" % name
+         self.emit(code, 3, reflow=False)
+diff -r bd8afb90ebf2 Parser/node.c
+--- a/Parser/node.c
++++ b/Parser/node.c
+@@ -71,7 +71,7 @@
+  * capacity.  The code is tricky to avoid that.
+  */
+ #define XXXROUNDUP(n) ((n) <= 1 ? (n) :                 \
+-               (n) <= 128 ? (((n) + 3) & ~3) :          \
++               (n) <= 128 ? _Py_SIZE_ROUND_UP((n), 4) : \
+                fancy_roundup(n))
+ 
+ 
+diff -r bd8afb90ebf2 Python/Python-ast.c
+--- a/Python/Python-ast.c
++++ b/Python/Python-ast.c
+@@ -1802,6 +1802,11 @@
+ YieldFrom(expr_ty value, int lineno, int col_offset, PyArena *arena)
+ {
+         expr_ty p;
++        if (!value) {
++                PyErr_SetString(PyExc_ValueError,
++                                "field value is required for YieldFrom");
++                return NULL;
++        }
+         p = (expr_ty)PyArena_Malloc(arena, sizeof(*p));
+         if (!p)
+                 return NULL;
+@@ -5431,7 +5436,8 @@
+                         Py_XDECREF(tmp);
+                         tmp = NULL;
+                 } else {
+-                        value = NULL;
++                        PyErr_SetString(PyExc_TypeError, "required field \"value\" missing from YieldFrom");
++                        return 1;
+                 }
+                 *out = YieldFrom(value, lineno, col_offset, arena);
+                 if (*out == NULL) goto failed;
+diff -r bd8afb90ebf2 Python/ast.c
+--- a/Python/ast.c
++++ b/Python/ast.c
+@@ -224,8 +224,7 @@
+     case Yield_kind:
+         return !exp->v.Yield.value || validate_expr(exp->v.Yield.value, Load);
+     case YieldFrom_kind:
+-        return !exp->v.YieldFrom.value ||
+-            validate_expr(exp->v.YieldFrom.value, Load);
++        return validate_expr(exp->v.YieldFrom.value, Load);
+     case Compare_kind:
+         if (!asdl_seq_LEN(exp->v.Compare.comparators)) {
+             PyErr_SetString(PyExc_ValueError, "Compare with no comparators");
+@@ -545,9 +544,9 @@
+ }
+ 
+ static identifier
+-new_identifier(const char* n, struct compiling *c)
++new_identifier(const char *n, struct compiling *c)
+ {
+-    PyObject* id = PyUnicode_DecodeUTF8(n, strlen(n), NULL);
++    PyObject *id = PyUnicode_DecodeUTF8(n, strlen(n), NULL);
+     if (!id)
+         return NULL;
+     /* PyUnicode_DecodeUTF8 should always return a ready string. */
+@@ -574,79 +573,43 @@
+ 
+ #define NEW_IDENTIFIER(n) new_identifier(STR(n), c)
+ 
+-/* This routine provides an invalid object for the syntax error.
+-   The outermost routine must unpack this error and create the
+-   proper object.  We do this so that we don't have to pass
+-   the filename to everything function.
+-
+-   XXX Maybe we should just pass the filename...
+-*/
+-
+ static int
+-ast_error(const node *n, const char *errstr)
++ast_error(struct compiling *c, const node *n, const char *errmsg)
+ {
+-    PyObject *u = Py_BuildValue("zii", errstr, LINENO(n), n->n_col_offset);
+-    if (!u)
+-        return 0;
+-    PyErr_SetObject(PyExc_SyntaxError, u);
+-    Py_DECREF(u);
+-    return 0;
+-}
+-
+-static void
+-ast_error_finish(const char *filename)
+-{
+-    PyObject *type, *value, *tback, *errstr, *offset, *loc, *tmp;
++    PyObject *value, *errstr, *loc, *tmp;
+     PyObject *filename_obj;
+-    long lineno;
+-
+-    assert(PyErr_Occurred());
+-    if (!PyErr_ExceptionMatches(PyExc_SyntaxError))
+-        return;
+-
+-    PyErr_Fetch(&type, &value, &tback);
+-    errstr = PyTuple_GetItem(value, 0);
+-    if (!errstr)
+-        return;
+-    Py_INCREF(errstr);
+-    lineno = PyLong_AsLong(PyTuple_GetItem(value, 1));
+-    if (lineno == -1) {
+-        Py_DECREF(errstr);
+-        return;
+-    }
+-    offset = PyTuple_GetItem(value, 2);
+-    if (!offset) {
+-        Py_DECREF(errstr);
+-        return;
+-    }
+-    Py_DECREF(value);
+-
+-    loc = PyErr_ProgramText(filename, lineno);
++
++    loc = PyErr_ProgramText(c->c_filename, LINENO(n));
+     if (!loc) {
+         Py_INCREF(Py_None);
+         loc = Py_None;
+     }
+-    if (filename != NULL)
+-        filename_obj = PyUnicode_DecodeFSDefault(filename);
+-    else {
++    if (c->c_filename) {
++        filename_obj = PyUnicode_DecodeFSDefault(c->c_filename);
++        if (!filename_obj) {
++            Py_DECREF(loc);
++            return 0;
++        }
++    } else {
+         Py_INCREF(Py_None);
+         filename_obj = Py_None;
+     }
+-    if (filename_obj != NULL)
+-        tmp = Py_BuildValue("(NlOO)", filename_obj, lineno, offset, loc);
+-    else
+-        tmp = NULL;
+-    Py_DECREF(loc);
+-    if (!tmp) {
+-        Py_DECREF(errstr);
+-        return;
++    tmp = Py_BuildValue("(NiiN)", filename_obj, LINENO(n), n->n_col_offset, loc);
++    if (!tmp)
++        return 0;
++    errstr = PyUnicode_FromString(errmsg);
++    if (!errstr) {
++        Py_DECREF(tmp);
++        return 0;
+     }
+     value = PyTuple_Pack(2, errstr, tmp);
+     Py_DECREF(errstr);
+     Py_DECREF(tmp);
+-    if (!value)
+-        return;
+-    PyErr_Restore(type, value, tback);
++    if (value) {
++        PyErr_SetObject(PyExc_SyntaxError, value);
++        Py_DECREF(value);
++    }
++    return 0;
+ }
+ 
+ /* num_stmts() returns number of contained statements.
+@@ -724,11 +687,14 @@
+     struct compiling c;
+     mod_ty res = NULL;
+ 
++    c.c_arena = arena;
++    c.c_filename = filename;
++    c.c_normalize = c.c_normalize_args = NULL;
+     if (flags && flags->cf_flags & PyCF_SOURCE_IS_UTF8) {
+         c.c_encoding = "utf-8";
+         if (TYPE(n) == encoding_decl) {
+ #if 0
+-            ast_error(n, "encoding declaration in Unicode string");
++            ast_error(c, n, "encoding declaration in Unicode string");
+             goto out;
+ #endif
+             n = CHILD(n, 0);
+@@ -740,9 +706,6 @@
+         /* PEP 3120 */
+         c.c_encoding = "utf-8";
+     }
+-    c.c_arena = arena;
+-    c.c_filename = filename;
+-    c.c_normalize = c.c_normalize_args = NULL;
+ 
+     k = 0;
+     switch (TYPE(n)) {
+@@ -835,8 +798,6 @@
+         PyTuple_SET_ITEM(c.c_normalize_args, 1, NULL);
+         Py_DECREF(c.c_normalize_args);
+     }
+-    if (!res)
+-        ast_error_finish(filename);
+     return res;
+ }
+ 
+@@ -882,18 +843,18 @@
+ };
+ 
+ static int
+-forbidden_name(identifier name, const node *n, int full_checks)
++forbidden_name(struct compiling *c, identifier name, const node *n, int full_checks)
+ {
+     assert(PyUnicode_Check(name));
+     if (PyUnicode_CompareWithASCIIString(name, "__debug__") == 0) {
+-        ast_error(n, "assignment to keyword");
++        ast_error(c, n, "assignment to keyword");
+         return 1;
+     }
+     if (full_checks) {
+         const char **p;
+         for (p = FORBIDDEN; *p; p++) {
+             if (PyUnicode_CompareWithASCIIString(name, *p) == 0) {
+-                ast_error(n, "assignment to keyword");
++                ast_error(c, n, "assignment to keyword");
+                 return 1;
+             }
+         }
+@@ -929,7 +890,7 @@
+     switch (e->kind) {
+         case Attribute_kind:
+             e->v.Attribute.ctx = ctx;
+-            if (ctx == Store && forbidden_name(e->v.Attribute.attr, n, 1))
++            if (ctx == Store && forbidden_name(c, e->v.Attribute.attr, n, 1))
+                 return 0;
+             break;
+         case Subscript_kind:
+@@ -942,7 +903,7 @@
+             break;
+         case Name_kind:
+             if (ctx == Store) {
+-                if (forbidden_name(e->v.Name.id, n, 1))
++                if (forbidden_name(c, e->v.Name.id, n, 1))
+                     return 0; /* forbidden_name() calls ast_error() */
+             }
+             e->v.Name.ctx = ctx;
+@@ -1016,7 +977,7 @@
+                       "can't %s %s",
+                       ctx == Store ? "assign to" : "delete",
+                       expr_name);
+-        return ast_error(n, buf);
++        return ast_error(c, n, buf);
+     }
+ 
+     /* If the LHS is a list or tuple, we need to set the assignment
+@@ -1164,7 +1125,7 @@
+     name = NEW_IDENTIFIER(ch);
+     if (!name)
+         return NULL;
+-    if (forbidden_name(name, ch, 0))
++    if (forbidden_name(c, name, ch, 0))
+         return NULL;
+ 
+     if (NCH(n) == 3 && TYPE(CHILD(n, 1)) == COLON) {
+@@ -1194,7 +1155,7 @@
+     int j = 0; /* index for kwdefaults and kwonlyargs */
+ 
+     if (kwonlyargs == NULL) {
+-        ast_error(CHILD(n, start), "named arguments must follow bare *");
++        ast_error(c, CHILD(n, start), "named arguments must follow bare *");
+         return -1;
+     }
+     assert(kwdefaults != NULL);
+@@ -1226,7 +1187,7 @@
+                 argname = NEW_IDENTIFIER(ch);
+                 if (!argname)
+                     goto error;
+-                if (forbidden_name(argname, ch, 0))
++                if (forbidden_name(c, argname, ch, 0))
+                     goto error;
+                 arg = arg(argname, annotation, c->c_arena);
+                 if (!arg)
+@@ -1237,7 +1198,7 @@
+             case DOUBLESTAR:
+                 return i;
+             default:
+-                ast_error(ch, "unexpected node");
++                ast_error(c, ch, "unexpected node");
+                 goto error;
+         }
+     }
+@@ -1329,7 +1290,7 @@
+         return NULL;
+ 
+     if (nposargs + nkwonlyargs > 255) {
+-        ast_error(n, "more than 255 arguments");
++        ast_error(c, n, "more than 255 arguments");
+         return NULL;
+     }
+ 
+@@ -1357,7 +1318,7 @@
+                     found_default = 1;
+                 }
+                 else if (found_default) {
+-                    ast_error(n,
++                    ast_error(c, n,
+                              "non-default argument follows default argument");
+                     return NULL;
+                 }
+@@ -1369,7 +1330,7 @@
+                 break;
+             case STAR:
+                 if (i+1 >= NCH(n)) {
+-                    ast_error(CHILD(n, i),
++                    ast_error(c, CHILD(n, i),
+                         "named arguments must follow bare *");
+                     return NULL;
+                 }
+@@ -1386,7 +1347,7 @@
+                     vararg = NEW_IDENTIFIER(CHILD(ch, 0));
+                     if (!vararg)
+                         return NULL;
+-                    if (forbidden_name(vararg, CHILD(ch, 0), 0))
++                    if (forbidden_name(c, vararg, CHILD(ch, 0), 0))
+                         return NULL;
+                     if (NCH(ch) > 1) {
+                         /* there is an annotation on the vararg */
+@@ -1417,7 +1378,7 @@
+                     if (!kwargannotation)
+                         return NULL;
+                 }
+-                if (forbidden_name(kwarg, CHILD(ch, 0), 0))
++                if (forbidden_name(c, kwarg, CHILD(ch, 0), 0))
+                     return NULL;
+                 i += 3;
+                 break;
+@@ -1536,7 +1497,7 @@
+     name = NEW_IDENTIFIER(CHILD(n, name_i));
+     if (!name)
+         return NULL;
+-    if (forbidden_name(name, CHILD(n, name_i), 0))
++    if (forbidden_name(c, name, CHILD(n, name_i), 0))
+         return NULL;
+     args = ast_for_arguments(c, CHILD(n, name_i + 1));
+     if (!args)
+@@ -1868,20 +1829,24 @@
+     case STRING: {
+         PyObject *str = parsestrplus(c, n, &bytesmode);
+         if (!str) {
+-            if (PyErr_ExceptionMatches(PyExc_UnicodeError)) {
++            const char *errtype = NULL;
++            if (PyErr_ExceptionMatches(PyExc_UnicodeError))
++                errtype = "unicode error";
++            else if (PyErr_ExceptionMatches(PyExc_ValueError))
++                errtype = "value error";
++            if (errtype) {
++                char buf[128];
+                 PyObject *type, *value, *tback, *errstr;
+                 PyErr_Fetch(&type, &value, &tback);
+                 errstr = PyObject_Str(value);
+                 if (errstr) {
+-                    char *s = "";
+-                    char buf[128];
+-                    s = _PyUnicode_AsString(errstr);
+-                    PyOS_snprintf(buf, sizeof(buf), "(unicode error) %s", s);
+-                    ast_error(n, buf);
++                    char *s = _PyUnicode_AsString(errstr);
++                    PyOS_snprintf(buf, sizeof(buf), "(%s) %s", errtype, s);
+                     Py_DECREF(errstr);
+                 } else {
+-                    ast_error(n, "(unicode error) unknown error");
++                    PyOS_snprintf(buf, sizeof(buf), "(%s) unknown error", errtype);
+                 }
++                ast_error(c, n, buf);
+                 Py_DECREF(type);
+                 Py_DECREF(value);
+                 Py_XDECREF(tback);
+@@ -2465,14 +2430,14 @@
+         }
+     }
+     if (ngens > 1 || (ngens && (nargs || nkeywords))) {
+-        ast_error(n, "Generator expression must be parenthesized "
++        ast_error(c, n, "Generator expression must be parenthesized "
+                   "if not sole argument");
+         return NULL;
+     }
+ 
+     if (nargs + nkeywords + ngens > 255) {
+-      ast_error(n, "more than 255 arguments");
+-      return NULL;
++        ast_error(c, n, "more than 255 arguments");
++        return NULL;
+     }
+ 
+     args = asdl_seq_new(nargs + ngens, c->c_arena);
+@@ -2489,12 +2454,12 @@
+             expr_ty e;
+             if (NCH(ch) == 1) {
+                 if (nkeywords) {
+-                    ast_error(CHILD(ch, 0),
++                    ast_error(c, CHILD(ch, 0),
+                               "non-keyword arg after keyword arg");
+                     return NULL;
+                 }
+                 if (vararg) {
+-                    ast_error(CHILD(ch, 0),
++                    ast_error(c, CHILD(ch, 0),
+                               "only named arguments may follow *expression");
+                     return NULL;
+                 }
+@@ -2524,19 +2489,19 @@
+                  * then is very confusing.
+                  */
+                 if (e->kind == Lambda_kind) {
+-                    ast_error(CHILD(ch, 0), "lambda cannot contain assignment");
++                    ast_error(c, CHILD(ch, 0), "lambda cannot contain assignment");
+                     return NULL;
+                 } else if (e->kind != Name_kind) {
+-                    ast_error(CHILD(ch, 0), "keyword can't be an expression");
++                    ast_error(c, CHILD(ch, 0), "keyword can't be an expression");
+                     return NULL;
+-                } else if (forbidden_name(e->v.Name.id, ch, 1)) {
++                } else if (forbidden_name(c, e->v.Name.id, ch, 1)) {
+                     return NULL;
+                 }
+                 key = e->v.Name.id;
+                 for (k = 0; k < nkeywords; k++) {
+                     tmp = ((keyword_ty)asdl_seq_GET(keywords, k))->arg;
+                     if (!PyUnicode_Compare(tmp, key)) {
+-                        ast_error(CHILD(ch, 0), "keyword argument repeated");
++                        ast_error(c, CHILD(ch, 0), "keyword argument repeated");
+                         return NULL;
+                     }
+                 }
+@@ -2629,7 +2594,7 @@
+             case Subscript_kind:
+                 break;
+             default:
+-                ast_error(ch, "illegal expression for augmented assignment");
++                ast_error(c, ch, "illegal expression for augmented assignment");
+                 return NULL;
+         }
+ 
+@@ -2662,7 +2627,7 @@
+             expr_ty e;
+             node *ch = CHILD(n, i);
+             if (TYPE(ch) == yield_expr) {
+-                ast_error(ch, "assignment to yield expression not possible");
++                ast_error(c, ch, "assignment to yield expression not possible");
+                 return NULL;
+             }
+             e = ast_for_testlist(c, ch);
+@@ -2809,11 +2774,11 @@
+                 str = NEW_IDENTIFIER(str_node);
+                 if (!str)
+                     return NULL;
+-                if (store && forbidden_name(str, str_node, 0))
++                if (store && forbidden_name(c, str, str_node, 0))
+                     return NULL;
+             }
+             else {
+-                if (forbidden_name(name, name_node, 0))
++                if (forbidden_name(c, name, name_node, 0))
+                     return NULL;
+             }
+             return alias(name, str, c->c_arena);
+@@ -2832,7 +2797,7 @@
+                 a->asname = NEW_IDENTIFIER(asname_node);
+                 if (!a->asname)
+                     return NULL;
+-                if (forbidden_name(a->asname, asname_node, 0))
++                if (forbidden_name(c, a->asname, asname_node, 0))
+                     return NULL;
+                 return a;
+             }
+@@ -2843,7 +2808,7 @@
+                 name = NEW_IDENTIFIER(name_node);
+                 if (!name)
+                     return NULL;
+-                if (store && forbidden_name(name, name_node, 0))
++                if (store && forbidden_name(c, name, name_node, 0))
+                     return NULL;
+                 return alias(name, NULL, c->c_arena);
+             }
+@@ -2972,13 +2937,13 @@
+             n = CHILD(n, idx);
+             n_children = NCH(n);
+             if (n_children % 2 == 0) {
+-                ast_error(n, "trailing comma not allowed without"
++                ast_error(c, n, "trailing comma not allowed without"
+                              " surrounding parentheses");
+                 return NULL;
+             }
+             break;
+         default:
+-            ast_error(n, "Unexpected node-type in from-import");
++            ast_error(c, n, "Unexpected node-type in from-import");
+             return NULL;
+         }
+ 
+@@ -3384,7 +3349,7 @@
+         identifier e = NEW_IDENTIFIER(CHILD(exc, 3));
+         if (!e)
+             return NULL;
+-        if (forbidden_name(e, CHILD(exc, 3), 0))
++        if (forbidden_name(c, e, CHILD(exc, 3), 0))
+             return NULL;
+         expression = ast_for_expr(c, CHILD(exc, 1));
+         if (!expression)
+@@ -3443,7 +3408,7 @@
+         }
+     }
+     else if (TYPE(CHILD(n, nch - 3)) != except_clause) {
+-        ast_error(n, "malformed 'try' statement");
++        ast_error(c, n, "malformed 'try' statement");
+         return NULL;
+     }
+ 
+@@ -3535,7 +3500,7 @@
+         classname = NEW_IDENTIFIER(CHILD(n, 1));
+         if (!classname)
+             return NULL;
+-        if (forbidden_name(classname, CHILD(n, 3), 0))
++        if (forbidden_name(c, classname, CHILD(n, 3), 0))
+             return NULL;
+         return ClassDef(classname, NULL, NULL, NULL, NULL, s, decorator_seq,
+                         LINENO(n), n->n_col_offset, c->c_arena);
+@@ -3548,7 +3513,7 @@
+         classname = NEW_IDENTIFIER(CHILD(n, 1));
+         if (!classname)
+             return NULL;
+-        if (forbidden_name(classname, CHILD(n, 3), 0))
++        if (forbidden_name(c, classname, CHILD(n, 3), 0))
+             return NULL;
+         return ClassDef(classname, NULL, NULL, NULL, NULL, s, decorator_seq,
+                         LINENO(n), n->n_col_offset, c->c_arena);
+@@ -3573,7 +3538,7 @@
+     classname = NEW_IDENTIFIER(CHILD(n, 1));
+     if (!classname)
+         return NULL;
+-    if (forbidden_name(classname, CHILD(n, 1), 0))
++    if (forbidden_name(c, classname, CHILD(n, 1), 0))
+         return NULL;
+ 
+     return ClassDef(classname, call->v.Call.args, call->v.Call.keywords,
+@@ -3786,7 +3751,7 @@
+     int quote = Py_CHARMASK(*s);
+     int rawmode = 0;
+     int need_encoding;
+-    if (isalpha(quote)) {
++    if (Py_ISALPHA(quote)) {
+         while (!*bytesmode || !rawmode) {
+             if (quote == 'b' || quote == 'B') {
+                 quote = *++s;
+@@ -3832,10 +3797,10 @@
+     }
+     if (*bytesmode) {
+         /* Disallow non-ascii characters (but not escapes) */
+-        const char *c;
+-        for (c = s; *c; c++) {
+-            if (Py_CHARMASK(*c) >= 0x80) {
+-                ast_error(n, "bytes can only contain ASCII "
++        const char *ch;
++        for (ch = s; *ch; ch++) {
++            if (Py_CHARMASK(*ch) >= 0x80) {
++                ast_error(c, n, "bytes can only contain ASCII "
+                           "literal characters.");
+                 return NULL;
+             }
+@@ -3883,7 +3848,8 @@
+             if (s == NULL)
+                 goto onError;
+             if (*bytesmode != subbm) {
+-                ast_error(n, "cannot mix bytes and nonbytes literals");
++                ast_error(c, n, "cannot mix bytes and nonbytes literals");
++                Py_DECREF(s);
+                 goto onError;
+             }
+             if (PyBytes_Check(v) && PyBytes_Check(s)) {
+diff -r bd8afb90ebf2 Python/bltinmodule.c
+--- a/Python/bltinmodule.c
++++ b/Python/bltinmodule.c
+@@ -263,7 +263,8 @@
+ PyDoc_STRVAR(all_doc,
+ "all(iterable) -> bool\n\
+ \n\
+-Return True if bool(x) is True for all values x in the iterable.");
++Return True if bool(x) is True for all values x in the iterable.\n\
++If the iterable is empty, return True.");
+ 
+ static PyObject *
+ builtin_any(PyObject *self, PyObject *v)
+@@ -305,7 +306,8 @@
+ PyDoc_STRVAR(any_doc,
+ "any(iterable) -> bool\n\
+ \n\
+-Return True if bool(x) is True for any x in the iterable.");
++Return True if bool(x) is True for any x in the iterable.\n\
++If the iterable is empty, return False.");
+ 
+ static PyObject *
+ builtin_ascii(PyObject *self, PyObject *v)
+diff -r bd8afb90ebf2 Python/codecs.c
+--- a/Python/codecs.c
++++ b/Python/codecs.c
+@@ -791,8 +791,9 @@
+         /* Try decoding a single surrogate character. If
+            there are more, let the codec call us again. */
+         p += start;
+-        if ((p[0] & 0xf0) == 0xe0 ||
+-            (p[1] & 0xc0) == 0x80 ||
++        if (PyBytes_GET_SIZE(object) - start >= 3 &&
++            (p[0] & 0xf0) == 0xe0 &&
++            (p[1] & 0xc0) == 0x80 &&
+             (p[2] & 0xc0) == 0x80) {
+             /* it's a three-byte code */
+             ch = ((p[0] & 0x0f) << 12) + ((p[1] & 0x3f) << 6) + (p[2] & 0x3f);
+diff -r bd8afb90ebf2 Python/compile.c
+--- a/Python/compile.c
++++ b/Python/compile.c
+@@ -141,6 +141,11 @@
+ The u pointer points to the current compilation unit, while units
+ for enclosing blocks are stored in c_stack.     The u and c_stack are
+ managed by compiler_enter_scope() and compiler_exit_scope().
++
++Note that we don't track recursion levels during compilation - the
++task of detecting and rejecting excessive levels of nesting is
++handled by the symbol analysis pass.
++
+ */
+ 
+ struct compiler {
+@@ -3336,27 +3341,24 @@
+     case DictComp_kind:
+         return compiler_dictcomp(c, e);
+     case Yield_kind:
+-    case YieldFrom_kind: {
+-        expr_ty value;
+         if (c->u->u_ste->ste_type != FunctionBlock)
+             return compiler_error(c, "'yield' outside function");
+-        value = (e->kind == YieldFrom_kind) ? e->v.YieldFrom.value : e->v.Yield.value;
+-        if (value) {
+-            VISIT(c, expr, value);
++        if (e->v.Yield.value) {
++            VISIT(c, expr, e->v.Yield.value);
+         }
+         else {
+             ADDOP_O(c, LOAD_CONST, Py_None, consts);
+         }
+-        if (e->kind == YieldFrom_kind) {
+-            ADDOP(c, GET_ITER);
+-            ADDOP_O(c, LOAD_CONST, Py_None, consts);
+-            ADDOP(c, YIELD_FROM);
+-        }
+-        else {
+-            ADDOP(c, YIELD_VALUE);
+-        }
++        ADDOP(c, YIELD_VALUE);
+         break;
+-    }
++    case YieldFrom_kind:
++        if (c->u->u_ste->ste_type != FunctionBlock)
++            return compiler_error(c, "'yield' outside function");
++        VISIT(c, expr, e->v.YieldFrom.value);
++        ADDOP(c, GET_ITER);
++        ADDOP_O(c, LOAD_CONST, Py_None, consts);
++        ADDOP(c, YIELD_FROM);
++        break;
+     case Compare_kind:
+         return compiler_compare(c, e);
+     case Call_kind:
+diff -r bd8afb90ebf2 Python/dynload_aix.c
+--- a/Python/dynload_aix.c
++++ b/Python/dynload_aix.c
+@@ -4,7 +4,6 @@
+ #include "Python.h"
+ #include "importdl.h"
+ 
+-#include <ctype.h>      /*  for isdigit()         */
+ #include <errno.h>      /*  for global errno      */
+ #include <string.h>     /*  for strerror()        */
+ #include <stdlib.h>     /*  for malloc(), free()  */
+@@ -141,7 +140,7 @@
+             if (nerr == load_errtab[j].errNo && load_errtab[j].errstr)
+             ERRBUF_APPEND(load_errtab[j].errstr);
+         }
+-        while (isdigit(Py_CHARMASK(*message[i]))) message[i]++ ;
++        while (Py_ISDIGIT(Py_CHARMASK(*message[i]))) message[i]++ ;
+         ERRBUF_APPEND(message[i]);
+         ERRBUF_APPEND("\n");
+     }
+diff -r bd8afb90ebf2 Python/fileutils.c
+--- a/Python/fileutils.c
++++ b/Python/fileutils.c
+@@ -1,12 +1,18 @@
+ #include "Python.h"
++#include "osdefs.h"
+ #ifdef MS_WINDOWS
+ #  include <windows.h>
+ #endif
+ 
+ #ifdef HAVE_LANGINFO_H
++#include <locale.h>
+ #include <langinfo.h>
+ #endif
+ 
++#ifdef __APPLE__
++extern wchar_t* _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size);
++#endif
++
+ PyObject *
+ _Py_device_encoding(int fd)
+ {
+@@ -37,7 +43,182 @@
+     Py_RETURN_NONE;
+ }
+ 
+-#ifdef HAVE_STAT
++#if !defined(__APPLE__) && !defined(MS_WINDOWS)
++extern int _Py_normalize_encoding(const char *, char *, size_t);
++
++/* Workaround FreeBSD and OpenIndiana locale encoding issue with the C locale.
++   On these operating systems, nl_langinfo(CODESET) announces an alias of the
++   ASCII encoding, whereas mbstowcs() and wcstombs() functions use the
++   ISO-8859-1 encoding. The problem is that os.fsencode() and os.fsdecode() use
++   locale.getpreferredencoding() codec. For example, if command line arguments
++   are decoded by mbstowcs() and encoded back by os.fsencode(), we get a
++   UnicodeEncodeError instead of retrieving the original byte string.
++
++   The workaround is enabled if setlocale(LC_CTYPE, NULL) returns "C",
++   nl_langinfo(CODESET) announces "ascii" (or an alias to ASCII), and at least
++   one byte in range 0x80-0xff can be decoded from the locale encoding. The
++   workaround is also enabled on error, for example if getting the locale
++   failed.
++
++   Values of locale_is_ascii:
++
++       1: the workaround is used: _Py_wchar2char() uses
++          encode_ascii_surrogateescape() and _Py_char2wchar() uses
++          decode_ascii_surrogateescape()
++       0: the workaround is not used: _Py_wchar2char() uses wcstombs() and
++          _Py_char2wchar() uses mbstowcs()
++      -1: unknown, need to call check_force_ascii() to get the value
++*/
++static int force_ascii = -1;
++
++static int
++check_force_ascii(void)
++{
++    char *loc;
++#if defined(HAVE_LANGINFO_H) && defined(CODESET)
++    char *codeset, **alias;
++    char encoding[100];
++    int is_ascii;
++    unsigned int i;
++    char* ascii_aliases[] = {
++        "ascii",
++        "646",
++        "ansi-x3.4-1968",
++        "ansi-x3-4-1968",
++        "ansi-x3.4-1986",
++        "cp367",
++        "csascii",
++        "ibm367",
++        "iso646-us",
++        "iso-646.irv-1991",
++        "iso-ir-6",
++        "us",
++        "us-ascii",
++        NULL
++    };
++#endif
++
++    loc = setlocale(LC_CTYPE, NULL);
++    if (loc == NULL)
++        goto error;
++    if (strcmp(loc, "C") != 0) {
++        /* the LC_CTYPE locale is different than C */
++        return 0;
++    }
++
++#if defined(HAVE_LANGINFO_H) && defined(CODESET)
++    codeset = nl_langinfo(CODESET);
++    if (!codeset || codeset[0] == '\0') {
++        /* CODESET is not set or empty */
++        goto error;
++    }
++    if (!_Py_normalize_encoding(codeset, encoding, sizeof(encoding)))
++        goto error;
++
++    is_ascii = 0;
++    for (alias=ascii_aliases; *alias != NULL; alias++) {
++        if (strcmp(encoding, *alias) == 0) {
++            is_ascii = 1;
++            break;
++        }
++    }
++    if (!is_ascii) {
++        /* nl_langinfo(CODESET) is not "ascii" or an alias of ASCII */
++        return 0;
++    }
++
++    for (i=0x80; i<0xff; i++) {
++        unsigned char ch;
++        wchar_t wch;
++        size_t res;
++
++        ch = (unsigned char)i;
++        res = mbstowcs(&wch, (char*)&ch, 1);
++        if (res != (size_t)-1) {
++            /* decoding a non-ASCII character from the locale encoding succeed:
++               the locale encoding is not ASCII, force ASCII */
++            return 1;
++        }
++    }
++    /* None of the bytes in the range 0x80-0xff can be decoded from the locale
++       encoding: the locale encoding is really ASCII */
++    return 0;
++#else
++    /* nl_langinfo(CODESET) is not available: always force ASCII */
++    return 1;
++#endif
++
++error:
++    /* if an error occured, force the ASCII encoding */
++    return 1;
++}
++
++static char*
++encode_ascii_surrogateescape(const wchar_t *text, size_t *error_pos)
++{
++    char *result = NULL, *out;
++    size_t len, i;
++    wchar_t ch;
++
++    if (error_pos != NULL)
++        *error_pos = (size_t)-1;
++
++    len = wcslen(text);
++
++    result = PyMem_Malloc(len + 1);  /* +1 for NUL byte */
++    if (result == NULL)
++        return NULL;
++
++    out = result;
++    for (i=0; i<len; i++) {
++        ch = text[i];
++
++        if (ch <= 0x7f) {
++            /* ASCII character */
++            *out++ = (char)ch;
++        }
++        else if (0xdc80 <= ch && ch <= 0xdcff) {
++            /* UTF-8b surrogate */
++            *out++ = (char)(ch - 0xdc00);
++        }
++        else {
++            if (error_pos != NULL)
++                *error_pos = i;
++            PyMem_Free(result);
++            return NULL;
++        }
++    }
++    *out = '\0';
++    return result;
++}
++#endif   /* !defined(__APPLE__) && !defined(MS_WINDOWS) */
++
++#if !defined(__APPLE__) && (!defined(MS_WINDOWS) || !defined(HAVE_MBRTOWC))
++static wchar_t*
++decode_ascii_surrogateescape(const char *arg, size_t *size)
++{
++    wchar_t *res;
++    unsigned char *in;
++    wchar_t *out;
++
++    res = PyMem_Malloc((strlen(arg)+1)*sizeof(wchar_t));
++    if (!res)
++        return NULL;
++
++    in = (unsigned char*)arg;
++    out = res;
++    while(*in)
++        if(*in < 128)
++            *out++ = *in++;
++        else
++            *out++ = 0xdc00 + *in++;
++    *out = 0;
++    if (size != NULL)
++        *size = out - res;
++    return res;
++}
++#endif
++
+ 
+ /* Decode a byte string from the locale encoding with the
+    surrogateescape error handler (undecodable bytes are decoded as characters
+@@ -59,21 +240,47 @@
+ wchar_t*
+ _Py_char2wchar(const char* arg, size_t *size)
+ {
++#ifdef __APPLE__
++    wchar_t *wstr;
++    wstr = _Py_DecodeUTF8_surrogateescape(arg, strlen(arg));
++    if (size != NULL) {
++        if (wstr != NULL)
++            *size = wcslen(wstr);
++        else
++            *size = (size_t)-1;
++    }
++    return wstr;
++#else
+     wchar_t *res;
++    size_t argsize;
++    size_t count;
++    unsigned char *in;
++    wchar_t *out;
++#ifdef HAVE_MBRTOWC
++    mbstate_t mbs;
++#endif
++
++#ifndef MS_WINDOWS
++    if (force_ascii == -1)
++        force_ascii = check_force_ascii();
++
++    if (force_ascii) {
++        /* force ASCII encoding to workaround mbstowcs() issue */
++        res = decode_ascii_surrogateescape(arg, size);
++        if (res == NULL)
++            goto oom;
++        return res;
++    }
++#endif
++
+ #ifdef HAVE_BROKEN_MBSTOWCS
+     /* Some platforms have a broken implementation of
+      * mbstowcs which does not count the characters that
+      * would result from conversion.  Use an upper bound.
+      */
+-    size_t argsize = strlen(arg);
++    argsize = strlen(arg);
+ #else
+-    size_t argsize = mbstowcs(NULL, arg, 0);
+-#endif
+-    size_t count;
+-    unsigned char *in;
+-    wchar_t *out;
+-#ifdef HAVE_MBRTOWC
+-    mbstate_t mbs;
++    argsize = mbstowcs(NULL, arg, 0);
+ #endif
+     if (argsize != (size_t)-1) {
+         res = (wchar_t *)PyMem_Malloc((argsize+1)*sizeof(wchar_t));
+@@ -144,29 +351,22 @@
+         argsize -= converted;
+         out++;
+     }
+-#else
++    if (size != NULL)
++        *size = out - res;
++#else   /* HAVE_MBRTOWC */
+     /* Cannot use C locale for escaping; manually escape as if charset
+        is ASCII (i.e. escape all bytes > 128. This will still roundtrip
+        correctly in the locale's charset, which must be an ASCII superset. */
+-    res = PyMem_Malloc((strlen(arg)+1)*sizeof(wchar_t));
+-    if (!res)
++    res = decode_ascii_surrogateescape(arg, size);
++    if (res == NULL)
+         goto oom;
+-    in = (unsigned char*)arg;
+-    out = res;
+-    while(*in)
+-        if(*in < 128)
+-            *out++ = *in++;
+-        else
+-            *out++ = 0xdc00 + *in++;
+-    *out = 0;
+-#endif
+-    if (size != NULL)
+-        *size = out - res;
++#endif   /* HAVE_MBRTOWC */
+     return res;
+ oom:
+     if (size != NULL)
+         *size = (size_t)-1;
+     return NULL;
++#endif   /* __APPLE__ */
+ }
+ 
+ /* Encode a (wide) character string to the locale encoding with the
+@@ -183,13 +383,49 @@
+ char*
+ _Py_wchar2char(const wchar_t *text, size_t *error_pos)
+ {
++#ifdef __APPLE__
++    Py_ssize_t len;
++    PyObject *unicode, *bytes = NULL;
++    char *cpath;
++
++    unicode = PyUnicode_FromWideChar(text, wcslen(text));
++    if (unicode == NULL)
++        return NULL;
++
++    bytes = _PyUnicode_AsUTF8String(unicode, "surrogateescape");
++    Py_DECREF(unicode);
++    if (bytes == NULL) {
++        PyErr_Clear();
++        if (error_pos != NULL)
++            *error_pos = (size_t)-1;
++        return NULL;
++    }
++
++    len = PyBytes_GET_SIZE(bytes);
++    cpath = PyMem_Malloc(len+1);
++    if (cpath == NULL) {
++        PyErr_Clear();
++        Py_DECREF(bytes);
++        if (error_pos != NULL)
++            *error_pos = (size_t)-1;
++        return NULL;
++    }
++    memcpy(cpath, PyBytes_AsString(bytes), len + 1);
++    Py_DECREF(bytes);
++    return cpath;
++#else   /* __APPLE__ */
+     const size_t len = wcslen(text);
+     char *result = NULL, *bytes = NULL;
+     size_t i, size, converted;
+     wchar_t c, buf[2];
+ 
+-    if (error_pos != NULL)
+-        *error_pos = (size_t)-1;
++#ifndef MS_WINDOWS
++    if (force_ascii == -1)
++        force_ascii = check_force_ascii();
++
++    if (force_ascii)
++        return encode_ascii_surrogateescape(text, error_pos);
++#endif
+ 
+     /* The function works in two steps:
+        1. compute the length of the output buffer in bytes (size)
+@@ -231,17 +467,21 @@
+             }
+         }
+         if (result != NULL) {
+-            *bytes = 0;
++            *bytes = '\0';
+             break;
+         }
+ 
+         size += 1; /* nul byte at the end */
+         result = PyMem_Malloc(size);
+-        if (result == NULL)
++        if (result == NULL) {
++            if (error_pos != NULL)
++                *error_pos = (size_t)-1;
+             return NULL;
++        }
+         bytes = result;
+     }
+     return result;
++#endif   /* __APPLE__ */
+ }
+ 
+ /* In principle, this should use HAVE__WSTAT, and _wstat
+@@ -271,6 +511,8 @@
+ }
+ #endif
+ 
++#ifdef HAVE_STAT
++
+ /* Call _wstat() on Windows, or encode the path to the filesystem encoding and
+    call stat() otherwise. Only fill st_mode attribute on Windows.
+ 
+@@ -303,6 +545,8 @@
+ #endif
+ }
+ 
++#endif
++
+ /* Open a file. Use _wfopen() on Windows, encode the path to the locale
+    encoding and use fopen() otherwise. */
+ 
+@@ -484,4 +728,3 @@
+ #endif
+ }
+ 
+-#endif
+diff -r bd8afb90ebf2 Python/formatter_unicode.c
+--- a/Python/formatter_unicode.c
++++ b/Python/formatter_unicode.c
+@@ -401,7 +401,7 @@
+ {
+     Py_ssize_t remainder;
+ 
+-    while (pos<end && isdigit(PyUnicode_READ_CHAR(s, pos)))
++    while (pos<end && Py_ISDIGIT(PyUnicode_READ_CHAR(s, pos)))
+         ++pos;
+     remainder = pos;
+ 
+@@ -1099,7 +1099,7 @@
+                          &locale, 0);
+ 
+ done:
+-    Py_DECREF(unicode_tmp);
++    Py_XDECREF(unicode_tmp);
+     free_locale_info(&locale);
+     return result;
+ }
+diff -r bd8afb90ebf2 Python/getargs.c
+--- a/Python/getargs.c
++++ b/Python/getargs.c
+@@ -244,7 +244,7 @@
+             if (level == 0) {
+                 if (c == 'O')
+                     max++;
+-                else if (isalpha(Py_CHARMASK(c))) {
++                else if (Py_ISALPHA(Py_CHARMASK(c))) {
+                     if (c != 'e') /* skip encoded */
+                         max++;
+                 } else if (c == '|')
+@@ -336,7 +336,7 @@
+         }
+     }
+ 
+-    if (*format != '\0' && !isalpha(Py_CHARMASK(*format)) &&
++    if (*format != '\0' && !Py_ISALPHA(Py_CHARMASK(*format)) &&
+         *format != '(' &&
+         *format != '|' && *format != ':' && *format != ';') {
+         PyErr_Format(PyExc_SystemError,
+@@ -429,7 +429,7 @@
+         }
+         else if (c == ':' || c == ';' || c == '\0')
+             break;
+-        else if (level == 0 && isalpha(Py_CHARMASK(c)))
++        else if (level == 0 && Py_ISALPHA(Py_CHARMASK(c)))
+             n++;
+     }
+ 
+@@ -1742,6 +1742,7 @@
+     assert(min >= 0);
+     assert(min <= max);
+     if (!PyTuple_Check(args)) {
++        va_end(vargs);
+         PyErr_SetString(PyExc_SystemError,
+             "PyArg_UnpackTuple() argument list is not a tuple");
+         return 0;
+diff -r bd8afb90ebf2 Python/getcopyright.c
+--- a/Python/getcopyright.c
++++ b/Python/getcopyright.c
+@@ -4,7 +4,7 @@
+ 
+ static char cprt[] =
+ "\
+-Copyright (c) 2001-2012 Python Software Foundation.\n\
++Copyright (c) 2001-2013 Python Software Foundation.\n\
+ All Rights Reserved.\n\
+ \n\
+ Copyright (c) 2000 BeOpen.com.\n\
+diff -r bd8afb90ebf2 Python/getopt.c
+--- a/Python/getopt.c
++++ b/Python/getopt.c
+@@ -90,18 +90,18 @@
+         opt_ptr = &argv[_PyOS_optind++][1];
+     }
+ 
+-    if ( (option = *opt_ptr++) == L'\0')
++    if ((option = *opt_ptr++) == L'\0')
+         return -1;
+ 
+     if (option == 'J') {
+-        fprintf(stderr, "-J is reserved for Jython\n");
++        if (_PyOS_opterr)
++            fprintf(stderr, "-J is reserved for Jython\n");
+         return '_';
+     }
+ 
+     if ((ptr = wcschr(optstring, option)) == NULL) {
+         if (_PyOS_opterr)
+-          fprintf(stderr, "Unknown option: -%c\n", (char)option);
+-
++            fprintf(stderr, "Unknown option: -%c\n", (char)option);
+         return '_';
+     }
+ 
+diff -r bd8afb90ebf2 Python/import.c
+--- a/Python/import.c
++++ b/Python/import.c
+@@ -169,6 +169,7 @@
+         PyThread_acquire_lock(import_lock, 1);
+         PyEval_RestoreThread(tstate);
+     }
++    assert(import_lock_level == 0);
+     import_lock_thread = me;
+     import_lock_level = 1;
+ }
+@@ -182,6 +183,7 @@
+     if (import_lock_thread != me)
+         return -1;
+     import_lock_level--;
++    assert(import_lock_level >= 0);
+     if (import_lock_level == 0) {
+         import_lock_thread = -1;
+         PyThread_release_lock(import_lock);
+diff -r bd8afb90ebf2 Python/importlib.h
+--- a/Python/importlib.h
++++ b/Python/importlib.h
+@@ -787,7 +787,7 @@
+     0,0,100,3,0,106,11,0,124,6,0,124,7,0,124,9,
+     0,124,3,0,100,4,0,25,103,4,0,131,1,0,125,10,
+     0,116,12,0,124,4,0,116,13,0,124,10,0,131,3,0,
+-    83,40,6,0,0,0,117,7,2,0,0,71,105,118,101,110,
++    83,40,6,0,0,0,117,244,1,0,0,71,105,118,101,110,
+     32,116,104,101,32,112,97,116,104,32,116,111,32,97,32,46,
+     112,121,32,102,105,108,101,44,32,114,101,116,117,114,110,32,
+     116,104,101,32,112,97,116,104,32,116,111,32,105,116,115,32,
+@@ -811,1725 +811,1731 @@
+     101,32,105,115,32,110,111,116,32,78,111,110,101,44,32,116,
+     104,101,110,32,105,116,32,109,117,115,116,32,98,101,32,97,
+     32,98,111,111,108,101,97,110,32,97,110,100,32,105,115,32,
+-    116,97,107,101,110,32,97,115,10,32,32,32,32,116,104,101,
+-    32,118,97,108,117,101,32,111,102,32,98,111,111,108,40,115,
+-    121,115,46,102,108,97,103,115,46,111,112,116,105,109,105,122,
+-    101,41,32,105,110,115,116,101,97,100,46,10,10,32,32,32,
+-    32,73,102,32,115,121,115,46,105,109,112,108,101,109,101,110,
++    117,115,101,100,32,105,110,10,32,32,32,32,112,108,97,99,
++    101,32,111,102,32,115,121,115,46,102,108,97,103,115,46,111,
++    112,116,105,109,105,122,101,46,10,10,32,32,32,32,73,102,
++    32,115,121,115,46,105,109,112,108,101,109,101,110,116,97,116,
++    105,111,110,46,99,97,99,104,101,95,116,97,103,32,105,115,
++    32,78,111,110,101,32,116,104,101,110,32,78,111,116,73,109,
++    112,108,101,109,101,110,116,101,100,69,114,114,111,114,32,105,
++    115,32,114,97,105,115,101,100,46,10,10,32,32,32,32,117,
++    1,0,0,0,46,117,36,0,0,0,115,121,115,46,105,109,
++    112,108,101,109,101,110,116,97,116,105,111,110,46,99,97,99,
++    104,101,95,116,97,103,32,105,115,32,78,111,110,101,117,0,
++    0,0,0,105,0,0,0,0,78,40,14,0,0,0,117,4,
++    0,0,0,78,111,110,101,117,3,0,0,0,115,121,115,117,
++    5,0,0,0,102,108,97,103,115,117,8,0,0,0,111,112,
++    116,105,109,105,122,101,117,23,0,0,0,68,69,66,85,71,
++    95,66,89,84,69,67,79,68,69,95,83,85,70,70,73,88,
++    69,83,117,27,0,0,0,79,80,84,73,77,73,90,69,68,
++    95,66,89,84,69,67,79,68,69,95,83,85,70,70,73,88,
++    69,83,117,11,0,0,0,95,112,97,116,104,95,115,112,108,
++    105,116,117,9,0,0,0,112,97,114,116,105,116,105,111,110,
++    117,14,0,0,0,105,109,112,108,101,109,101,110,116,97,116,
++    105,111,110,117,9,0,0,0,99,97,99,104,101,95,116,97,
++    103,117,19,0,0,0,78,111,116,73,109,112,108,101,109,101,
++    110,116,101,100,69,114,114,111,114,117,4,0,0,0,106,111,
++    105,110,117,10,0,0,0,95,112,97,116,104,95,106,111,105,
++    110,117,8,0,0,0,95,80,89,67,65,67,72,69,40,11,
++    0,0,0,117,4,0,0,0,112,97,116,104,117,14,0,0,
++    0,100,101,98,117,103,95,111,118,101,114,114,105,100,101,117,
++    5,0,0,0,100,101,98,117,103,117,8,0,0,0,115,117,
++    102,102,105,120,101,115,117,4,0,0,0,104,101,97,100,117,
++    4,0,0,0,116,97,105,108,117,13,0,0,0,98,97,115,
++    101,95,102,105,108,101,110,97,109,101,117,3,0,0,0,115,
++    101,112,117,1,0,0,0,95,117,3,0,0,0,116,97,103,
++    117,8,0,0,0,102,105,108,101,110,97,109,101,40,0,0,
++    0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,
++    122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,
++    111,111,116,115,116,114,97,112,62,117,17,0,0,0,99,97,
++    99,104,101,95,102,114,111,109,95,115,111,117,114,99,101,159,
++    1,0,0,115,22,0,0,0,0,13,31,1,6,1,9,2,
++    6,1,18,1,24,1,12,1,12,1,15,1,31,1,117,17,
++    0,0,0,99,97,99,104,101,95,102,114,111,109,95,115,111,
++    117,114,99,101,99,1,0,0,0,0,0,0,0,5,0,0,
++    0,5,0,0,0,67,0,0,0,115,193,0,0,0,116,0,
++    0,106,1,0,106,2,0,100,7,0,107,8,0,114,33,0,
++    116,4,0,100,1,0,131,1,0,130,1,0,110,0,0,116,
++    5,0,124,0,0,131,1,0,92,2,0,125,1,0,125,2,
++    0,116,5,0,124,1,0,131,1,0,92,2,0,125,1,0,
++    125,3,0,124,3,0,116,6,0,107,3,0,114,108,0,116,
++    7,0,100,2,0,106,8,0,116,6,0,124,0,0,131,2,
++    0,131,1,0,130,1,0,110,0,0,124,2,0,106,9,0,
++    100,3,0,131,1,0,100,4,0,107,3,0,114,153,0,116,
++    7,0,100,5,0,106,8,0,124,2,0,131,1,0,131,1,
++    0,130,1,0,110,0,0,124,2,0,106,10,0,100,3,0,
++    131,1,0,100,6,0,25,125,4,0,116,11,0,124,1,0,
++    124,4,0,116,12,0,100,6,0,25,23,131,2,0,83,40,
++    8,0,0,0,117,121,1,0,0,71,105,118,101,110,32,116,
++    104,101,32,112,97,116,104,32,116,111,32,97,32,46,112,121,
++    99,46,47,46,112,121,111,32,102,105,108,101,44,32,114,101,
++    116,117,114,110,32,116,104,101,32,112,97,116,104,32,116,111,
++    32,105,116,115,32,46,112,121,32,102,105,108,101,46,10,10,
++    32,32,32,32,84,104,101,32,46,112,121,99,47,46,112,121,
++    111,32,102,105,108,101,32,100,111,101,115,32,110,111,116,32,
++    110,101,101,100,32,116,111,32,101,120,105,115,116,59,32,116,
++    104,105,115,32,115,105,109,112,108,121,32,114,101,116,117,114,
++    110,115,32,116,104,101,32,112,97,116,104,32,116,111,10,32,
++    32,32,32,116,104,101,32,46,112,121,32,102,105,108,101,32,
++    99,97,108,99,117,108,97,116,101,100,32,116,111,32,99,111,
++    114,114,101,115,112,111,110,100,32,116,111,32,116,104,101,32,
++    46,112,121,99,47,46,112,121,111,32,102,105,108,101,46,32,
++    32,73,102,32,112,97,116,104,32,100,111,101,115,10,32,32,
++    32,32,110,111,116,32,99,111,110,102,111,114,109,32,116,111,
++    32,80,69,80,32,51,49,52,55,32,102,111,114,109,97,116,
++    44,32,86,97,108,117,101,69,114,114,111,114,32,119,105,108,
++    108,32,98,101,32,114,97,105,115,101,100,46,32,73,102,10,
++    32,32,32,32,115,121,115,46,105,109,112,108,101,109,101,110,
+     116,97,116,105,111,110,46,99,97,99,104,101,95,116,97,103,
+     32,105,115,32,78,111,110,101,32,116,104,101,110,32,78,111,
+     116,73,109,112,108,101,109,101,110,116,101,100,69,114,114,111,
+     114,32,105,115,32,114,97,105,115,101,100,46,10,10,32,32,
+-    32,32,117,1,0,0,0,46,117,36,0,0,0,115,121,115,
+-    46,105,109,112,108,101,109,101,110,116,97,116,105,111,110,46,
+-    99,97,99,104,101,95,116,97,103,32,105,115,32,78,111,110,
+-    101,117,0,0,0,0,105,0,0,0,0,78,40,14,0,0,
+-    0,117,4,0,0,0,78,111,110,101,117,3,0,0,0,115,
+-    121,115,117,5,0,0,0,102,108,97,103,115,117,8,0,0,
+-    0,111,112,116,105,109,105,122,101,117,23,0,0,0,68,69,
+-    66,85,71,95,66,89,84,69,67,79,68,69,95,83,85,70,
+-    70,73,88,69,83,117,27,0,0,0,79,80,84,73,77,73,
+-    90,69,68,95,66,89,84,69,67,79,68,69,95,83,85,70,
+-    70,73,88,69,83,117,11,0,0,0,95,112,97,116,104,95,
+-    115,112,108,105,116,117,9,0,0,0,112,97,114,116,105,116,
+-    105,111,110,117,14,0,0,0,105,109,112,108,101,109,101,110,
+-    116,97,116,105,111,110,117,9,0,0,0,99,97,99,104,101,
+-    95,116,97,103,117,19,0,0,0,78,111,116,73,109,112,108,
+-    101,109,101,110,116,101,100,69,114,114,111,114,117,4,0,0,
+-    0,106,111,105,110,117,10,0,0,0,95,112,97,116,104,95,
+-    106,111,105,110,117,8,0,0,0,95,80,89,67,65,67,72,
+-    69,40,11,0,0,0,117,4,0,0,0,112,97,116,104,117,
+-    14,0,0,0,100,101,98,117,103,95,111,118,101,114,114,105,
+-    100,101,117,5,0,0,0,100,101,98,117,103,117,8,0,0,
+-    0,115,117,102,102,105,120,101,115,117,4,0,0,0,104,101,
+-    97,100,117,4,0,0,0,116,97,105,108,117,13,0,0,0,
+-    98,97,115,101,95,102,105,108,101,110,97,109,101,117,3,0,
+-    0,0,115,101,112,117,1,0,0,0,95,117,3,0,0,0,
+-    116,97,103,117,8,0,0,0,102,105,108,101,110,97,109,101,
+-    40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,
++    32,32,117,36,0,0,0,115,121,115,46,105,109,112,108,101,
++    109,101,110,116,97,116,105,111,110,46,99,97,99,104,101,95,
++    116,97,103,32,105,115,32,78,111,110,101,117,37,0,0,0,
++    123,125,32,110,111,116,32,98,111,116,116,111,109,45,108,101,
++    118,101,108,32,100,105,114,101,99,116,111,114,121,32,105,110,
++    32,123,33,114,125,117,1,0,0,0,46,105,2,0,0,0,
++    117,28,0,0,0,101,120,112,101,99,116,101,100,32,111,110,
++    108,121,32,50,32,100,111,116,115,32,105,110,32,123,33,114,
++    125,105,0,0,0,0,78,40,13,0,0,0,117,3,0,0,
++    0,115,121,115,117,14,0,0,0,105,109,112,108,101,109,101,
++    110,116,97,116,105,111,110,117,9,0,0,0,99,97,99,104,
++    101,95,116,97,103,117,4,0,0,0,78,111,110,101,117,19,
++    0,0,0,78,111,116,73,109,112,108,101,109,101,110,116,101,
++    100,69,114,114,111,114,117,11,0,0,0,95,112,97,116,104,
++    95,115,112,108,105,116,117,8,0,0,0,95,80,89,67,65,
++    67,72,69,117,10,0,0,0,86,97,108,117,101,69,114,114,
++    111,114,117,6,0,0,0,102,111,114,109,97,116,117,5,0,
++    0,0,99,111,117,110,116,117,9,0,0,0,112,97,114,116,
++    105,116,105,111,110,117,10,0,0,0,95,112,97,116,104,95,
++    106,111,105,110,117,15,0,0,0,83,79,85,82,67,69,95,
++    83,85,70,70,73,88,69,83,40,5,0,0,0,117,4,0,
++    0,0,112,97,116,104,117,4,0,0,0,104,101,97,100,117,
++    16,0,0,0,112,121,99,97,99,104,101,95,102,105,108,101,
++    110,97,109,101,117,7,0,0,0,112,121,99,97,99,104,101,
++    117,13,0,0,0,98,97,115,101,95,102,105,108,101,110,97,
++    109,101,40,0,0,0,0,40,0,0,0,0,117,29,0,0,
++    0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,
++    105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,17,
++    0,0,0,115,111,117,114,99,101,95,102,114,111,109,95,99,
++    97,99,104,101,186,1,0,0,115,24,0,0,0,0,9,18,
++    1,15,1,18,1,18,1,12,1,9,1,18,1,21,1,9,
++    1,15,1,19,1,117,17,0,0,0,115,111,117,114,99,101,
++    95,102,114,111,109,95,99,97,99,104,101,99,1,0,0,0,
++    0,0,0,0,5,0,0,0,13,0,0,0,67,0,0,0,
++    115,164,0,0,0,116,0,0,124,0,0,131,1,0,100,1,
++    0,107,2,0,114,22,0,100,6,0,83,124,0,0,106,2,
++    0,100,2,0,131,1,0,92,3,0,125,1,0,125,2,0,
++    125,3,0,124,1,0,12,115,81,0,124,3,0,106,3,0,
++    131,0,0,100,7,0,100,8,0,133,2,0,25,100,5,0,
++    107,3,0,114,85,0,124,0,0,83,121,16,0,116,4,0,
++    124,0,0,131,1,0,125,4,0,87,110,40,0,4,116,5,
++    0,116,6,0,102,2,0,107,10,0,114,143,0,1,1,1,
++    116,7,0,100,9,0,100,6,0,133,2,0,25,125,4,0,
++    89,110,1,0,88,116,8,0,116,9,0,131,1,0,114,160,
++    0,124,4,0,83,124,0,0,83,40,10,0,0,0,117,188,
++    0,0,0,67,111,110,118,101,114,116,32,97,32,98,121,116,
++    101,99,111,100,101,32,102,105,108,101,32,112,97,116,104,32,
++    116,111,32,97,32,115,111,117,114,99,101,32,112,97,116,104,
++    32,40,105,102,32,112,111,115,115,105,98,108,101,41,46,10,
++    10,32,32,32,32,84,104,105,115,32,102,117,110,99,116,105,
++    111,110,32,101,120,105,115,116,115,32,112,117,114,101,108,121,
++    32,102,111,114,32,98,97,99,107,119,97,114,100,115,45,99,
++    111,109,112,97,116,105,98,105,108,105,116,121,32,102,111,114,
++    10,32,32,32,32,80,121,73,109,112,111,114,116,95,69,120,
++    101,99,67,111,100,101,77,111,100,117,108,101,87,105,116,104,
++    70,105,108,101,110,97,109,101,115,40,41,32,105,110,32,116,
++    104,101,32,67,32,65,80,73,46,10,10,32,32,32,32,105,
++    0,0,0,0,117,1,0,0,0,46,105,3,0,0,0,105,
++    1,0,0,0,117,3,0,0,0,46,112,121,78,105,253,255,
++    255,255,105,255,255,255,255,105,255,255,255,255,40,10,0,0,
++    0,117,3,0,0,0,108,101,110,117,4,0,0,0,78,111,
++    110,101,117,9,0,0,0,114,112,97,114,105,116,105,111,110,
++    117,5,0,0,0,108,111,119,101,114,117,17,0,0,0,115,
++    111,117,114,99,101,95,102,114,111,109,95,99,97,99,104,101,
++    117,19,0,0,0,78,111,116,73,109,112,108,101,109,101,110,
++    116,101,100,69,114,114,111,114,117,10,0,0,0,86,97,108,
++    117,101,69,114,114,111,114,117,12,0,0,0,98,121,116,99,
++    111,100,101,95,112,97,116,104,117,12,0,0,0,95,112,97,
++    116,104,95,105,115,102,105,108,101,117,12,0,0,0,115,111,
++    117,114,99,101,95,115,116,97,116,115,40,5,0,0,0,117,
++    13,0,0,0,98,121,116,101,99,111,100,101,95,112,97,116,
++    104,117,4,0,0,0,114,101,115,116,117,1,0,0,0,95,
++    117,9,0,0,0,101,120,116,101,110,115,105,111,110,117,11,
++    0,0,0,115,111,117,114,99,101,95,112,97,116,104,40,0,
++    0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,
++    111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,
++    98,111,111,116,115,116,114,97,112,62,117,15,0,0,0,95,
++    103,101,116,95,115,111,117,114,99,101,102,105,108,101,209,1,
++    0,0,115,20,0,0,0,0,7,18,1,4,1,24,1,35,
++    1,4,2,3,1,16,1,19,1,21,2,117,15,0,0,0,
++    95,103,101,116,95,115,111,117,114,99,101,102,105,108,101,99,
++    1,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,
++    71,0,0,0,115,75,0,0,0,116,0,0,106,1,0,106,
++    2,0,114,71,0,124,0,0,106,3,0,100,6,0,131,1,
++    0,115,40,0,100,3,0,124,0,0,23,125,0,0,110,0,
++    0,116,4,0,124,0,0,106,5,0,124,1,0,140,0,0,
++    100,4,0,116,0,0,106,6,0,131,1,1,1,110,0,0,
++    100,5,0,83,40,7,0,0,0,117,61,0,0,0,80,114,
++    105,110,116,32,116,104,101,32,109,101,115,115,97,103,101,32,
++    116,111,32,115,116,100,101,114,114,32,105,102,32,45,118,47,
++    80,89,84,72,79,78,86,69,82,66,79,83,69,32,105,115,
++    32,116,117,114,110,101,100,32,111,110,46,117,1,0,0,0,
++    35,117,7,0,0,0,105,109,112,111,114,116,32,117,2,0,
++    0,0,35,32,117,4,0,0,0,102,105,108,101,78,40,2,
++    0,0,0,117,1,0,0,0,35,117,7,0,0,0,105,109,
++    112,111,114,116,32,40,7,0,0,0,117,3,0,0,0,115,
++    121,115,117,5,0,0,0,102,108,97,103,115,117,7,0,0,
++    0,118,101,114,98,111,115,101,117,10,0,0,0,115,116,97,
++    114,116,115,119,105,116,104,117,5,0,0,0,112,114,105,110,
++    116,117,6,0,0,0,102,111,114,109,97,116,117,6,0,0,
++    0,115,116,100,101,114,114,40,2,0,0,0,117,7,0,0,
++    0,109,101,115,115,97,103,101,117,4,0,0,0,97,114,103,
++    115,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
++    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
++    98,46,95,98,111,111,116,115,116,114,97,112,62,117,16,0,
++    0,0,95,118,101,114,98,111,115,101,95,109,101,115,115,97,
++    103,101,230,1,0,0,115,8,0,0,0,0,2,12,1,15,
++    1,13,1,117,16,0,0,0,95,118,101,114,98,111,115,101,
++    95,109,101,115,115,97,103,101,99,1,0,0,0,0,0,0,
++    0,2,0,0,0,3,0,0,0,3,0,0,0,115,35,0,
++    0,0,135,0,0,102,1,0,100,1,0,100,2,0,134,0,
++    0,125,1,0,116,0,0,124,1,0,136,0,0,131,2,0,
++    1,124,1,0,83,40,3,0,0,0,117,39,0,0,0,83,
++    101,116,32,95,95,112,97,99,107,97,103,101,95,95,32,111,
++    110,32,116,104,101,32,114,101,116,117,114,110,101,100,32,109,
++    111,100,117,108,101,46,99,0,0,0,0,0,0,0,0,3,
++    0,0,0,4,0,0,0,31,0,0,0,115,101,0,0,0,
++    136,0,0,124,0,0,124,1,0,142,0,0,125,2,0,116,
++    0,0,124,2,0,100,1,0,100,0,0,131,3,0,100,0,
++    0,107,8,0,114,97,0,124,2,0,106,2,0,124,2,0,
++    95,3,0,116,4,0,124,2,0,100,2,0,131,2,0,115,
++    97,0,124,2,0,106,3,0,106,5,0,100,3,0,131,1,
++    0,100,4,0,25,124,2,0,95,3,0,113,97,0,110,0,
++    0,124,2,0,83,40,5,0,0,0,78,117,11,0,0,0,
++    95,95,112,97,99,107,97,103,101,95,95,117,8,0,0,0,
++    95,95,112,97,116,104,95,95,117,1,0,0,0,46,105,0,
++    0,0,0,40,6,0,0,0,117,7,0,0,0,103,101,116,
++    97,116,116,114,117,4,0,0,0,78,111,110,101,117,8,0,
++    0,0,95,95,110,97,109,101,95,95,117,11,0,0,0,95,
++    95,112,97,99,107,97,103,101,95,95,117,7,0,0,0,104,
++    97,115,97,116,116,114,117,10,0,0,0,114,112,97,114,116,
++    105,116,105,111,110,40,3,0,0,0,117,4,0,0,0,97,
++    114,103,115,117,6,0,0,0,107,119,97,114,103,115,117,6,
++    0,0,0,109,111,100,117,108,101,40,1,0,0,0,117,3,
++    0,0,0,102,120,110,40,0,0,0,0,117,29,0,0,0,
++    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
++    98,46,95,98,111,111,116,115,116,114,97,112,62,117,19,0,
++    0,0,115,101,116,95,112,97,99,107,97,103,101,95,119,114,
++    97,112,112,101,114,240,1,0,0,115,12,0,0,0,0,1,
++    15,1,24,1,12,1,15,1,31,1,117,40,0,0,0,115,
++    101,116,95,112,97,99,107,97,103,101,46,60,108,111,99,97,
++    108,115,62,46,115,101,116,95,112,97,99,107,97,103,101,95,
++    119,114,97,112,112,101,114,40,1,0,0,0,117,5,0,0,
++    0,95,119,114,97,112,40,2,0,0,0,117,3,0,0,0,
++    102,120,110,117,19,0,0,0,115,101,116,95,112,97,99,107,
++    97,103,101,95,119,114,97,112,112,101,114,40,0,0,0,0,
++    40,1,0,0,0,117,3,0,0,0,102,120,110,117,29,0,
++    0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,
++    108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,
++    11,0,0,0,115,101,116,95,112,97,99,107,97,103,101,238,
++    1,0,0,115,6,0,0,0,0,2,18,7,13,1,117,11,
++    0,0,0,115,101,116,95,112,97,99,107,97,103,101,99,1,
++    0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,3,
++    0,0,0,115,35,0,0,0,135,0,0,102,1,0,100,1,
++    0,100,2,0,134,0,0,125,1,0,116,0,0,124,1,0,
++    136,0,0,131,2,0,1,124,1,0,83,40,3,0,0,0,
++    117,38,0,0,0,83,101,116,32,95,95,108,111,97,100,101,
++    114,95,95,32,111,110,32,116,104,101,32,114,101,116,117,114,
++    110,101,100,32,109,111,100,117,108,101,46,99,1,0,0,0,
++    0,0,0,0,4,0,0,0,4,0,0,0,31,0,0,0,
++    115,49,0,0,0,136,0,0,124,0,0,124,1,0,124,2,
++    0,142,1,0,125,3,0,116,0,0,124,3,0,100,1,0,
++    131,2,0,115,45,0,124,0,0,124,3,0,95,1,0,110,
++    0,0,124,3,0,83,40,2,0,0,0,78,117,10,0,0,
++    0,95,95,108,111,97,100,101,114,95,95,40,2,0,0,0,
++    117,7,0,0,0,104,97,115,97,116,116,114,117,10,0,0,
++    0,95,95,108,111,97,100,101,114,95,95,40,4,0,0,0,
++    117,4,0,0,0,115,101,108,102,117,4,0,0,0,97,114,
++    103,115,117,6,0,0,0,107,119,97,114,103,115,117,6,0,
++    0,0,109,111,100,117,108,101,40,1,0,0,0,117,3,0,
++    0,0,102,120,110,40,0,0,0,0,117,29,0,0,0,60,
+     102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,
+-    46,95,98,111,111,116,115,116,114,97,112,62,117,17,0,0,
+-    0,99,97,99,104,101,95,102,114,111,109,95,115,111,117,114,
+-    99,101,159,1,0,0,115,22,0,0,0,0,13,31,1,6,
+-    1,9,2,6,1,18,1,24,1,12,1,12,1,15,1,31,
+-    1,117,17,0,0,0,99,97,99,104,101,95,102,114,111,109,
+-    95,115,111,117,114,99,101,99,1,0,0,0,0,0,0,0,
+-    5,0,0,0,5,0,0,0,67,0,0,0,115,193,0,0,
+-    0,116,0,0,106,1,0,106,2,0,100,7,0,107,8,0,
+-    114,33,0,116,4,0,100,1,0,131,1,0,130,1,0,110,
+-    0,0,116,5,0,124,0,0,131,1,0,92,2,0,125,1,
+-    0,125,2,0,116,5,0,124,1,0,131,1,0,92,2,0,
+-    125,1,0,125,3,0,124,3,0,116,6,0,107,3,0,114,
+-    108,0,116,7,0,100,2,0,106,8,0,116,6,0,124,0,
+-    0,131,2,0,131,1,0,130,1,0,110,0,0,124,2,0,
+-    106,9,0,100,3,0,131,1,0,100,4,0,107,3,0,114,
+-    153,0,116,7,0,100,5,0,106,8,0,124,2,0,131,1,
+-    0,131,1,0,130,1,0,110,0,0,124,2,0,106,10,0,
+-    100,3,0,131,1,0,100,6,0,25,125,4,0,116,11,0,
+-    124,1,0,124,4,0,116,12,0,100,6,0,25,23,131,2,
+-    0,83,40,8,0,0,0,117,121,1,0,0,71,105,118,101,
+-    110,32,116,104,101,32,112,97,116,104,32,116,111,32,97,32,
+-    46,112,121,99,46,47,46,112,121,111,32,102,105,108,101,44,
+-    32,114,101,116,117,114,110,32,116,104,101,32,112,97,116,104,
+-    32,116,111,32,105,116,115,32,46,112,121,32,102,105,108,101,
+-    46,10,10,32,32,32,32,84,104,101,32,46,112,121,99,47,
+-    46,112,121,111,32,102,105,108,101,32,100,111,101,115,32,110,
+-    111,116,32,110,101,101,100,32,116,111,32,101,120,105,115,116,
+-    59,32,116,104,105,115,32,115,105,109,112,108,121,32,114,101,
+-    116,117,114,110,115,32,116,104,101,32,112,97,116,104,32,116,
+-    111,10,32,32,32,32,116,104,101,32,46,112,121,32,102,105,
+-    108,101,32,99,97,108,99,117,108,97,116,101,100,32,116,111,
+-    32,99,111,114,114,101,115,112,111,110,100,32,116,111,32,116,
+-    104,101,32,46,112,121,99,47,46,112,121,111,32,102,105,108,
+-    101,46,32,32,73,102,32,112,97,116,104,32,100,111,101,115,
+-    10,32,32,32,32,110,111,116,32,99,111,110,102,111,114,109,
+-    32,116,111,32,80,69,80,32,51,49,52,55,32,102,111,114,
+-    109,97,116,44,32,86,97,108,117,101,69,114,114,111,114,32,
+-    119,105,108,108,32,98,101,32,114,97,105,115,101,100,46,32,
+-    73,102,10,32,32,32,32,115,121,115,46,105,109,112,108,101,
+-    109,101,110,116,97,116,105,111,110,46,99,97,99,104,101,95,
+-    116,97,103,32,105,115,32,78,111,110,101,32,116,104,101,110,
+-    32,78,111,116,73,109,112,108,101,109,101,110,116,101,100,69,
+-    114,114,111,114,32,105,115,32,114,97,105,115,101,100,46,10,
+-    10,32,32,32,32,117,36,0,0,0,115,121,115,46,105,109,
+-    112,108,101,109,101,110,116,97,116,105,111,110,46,99,97,99,
+-    104,101,95,116,97,103,32,105,115,32,78,111,110,101,117,37,
+-    0,0,0,123,125,32,110,111,116,32,98,111,116,116,111,109,
+-    45,108,101,118,101,108,32,100,105,114,101,99,116,111,114,121,
+-    32,105,110,32,123,33,114,125,117,1,0,0,0,46,105,2,
+-    0,0,0,117,28,0,0,0,101,120,112,101,99,116,101,100,
+-    32,111,110,108,121,32,50,32,100,111,116,115,32,105,110,32,
+-    123,33,114,125,105,0,0,0,0,78,40,13,0,0,0,117,
+-    3,0,0,0,115,121,115,117,14,0,0,0,105,109,112,108,
+-    101,109,101,110,116,97,116,105,111,110,117,9,0,0,0,99,
+-    97,99,104,101,95,116,97,103,117,4,0,0,0,78,111,110,
+-    101,117,19,0,0,0,78,111,116,73,109,112,108,101,109,101,
+-    110,116,101,100,69,114,114,111,114,117,11,0,0,0,95,112,
+-    97,116,104,95,115,112,108,105,116,117,8,0,0,0,95,80,
+-    89,67,65,67,72,69,117,10,0,0,0,86,97,108,117,101,
+-    69,114,114,111,114,117,6,0,0,0,102,111,114,109,97,116,
+-    117,5,0,0,0,99,111,117,110,116,117,9,0,0,0,112,
+-    97,114,116,105,116,105,111,110,117,10,0,0,0,95,112,97,
+-    116,104,95,106,111,105,110,117,15,0,0,0,83,79,85,82,
+-    67,69,95,83,85,70,70,73,88,69,83,40,5,0,0,0,
+-    117,4,0,0,0,112,97,116,104,117,4,0,0,0,104,101,
+-    97,100,117,16,0,0,0,112,121,99,97,99,104,101,95,102,
+-    105,108,101,110,97,109,101,117,7,0,0,0,112,121,99,97,
+-    99,104,101,117,13,0,0,0,98,97,115,101,95,102,105,108,
+-    101,110,97,109,101,40,0,0,0,0,40,0,0,0,0,117,
++    46,95,98,111,111,116,115,116,114,97,112,62,117,18,0,0,
++    0,115,101,116,95,108,111,97,100,101,114,95,119,114,97,112,
++    112,101,114,253,1,0,0,115,8,0,0,0,0,1,18,1,
++    15,1,12,1,117,38,0,0,0,115,101,116,95,108,111,97,
++    100,101,114,46,60,108,111,99,97,108,115,62,46,115,101,116,
++    95,108,111,97,100,101,114,95,119,114,97,112,112,101,114,40,
++    1,0,0,0,117,5,0,0,0,95,119,114,97,112,40,2,
++    0,0,0,117,3,0,0,0,102,120,110,117,18,0,0,0,
++    115,101,116,95,108,111,97,100,101,114,95,119,114,97,112,112,
++    101,114,40,0,0,0,0,40,1,0,0,0,117,3,0,0,
++    0,102,120,110,117,29,0,0,0,60,102,114,111,122,101,110,
++    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
++    115,116,114,97,112,62,117,10,0,0,0,115,101,116,95,108,
++    111,97,100,101,114,251,1,0,0,115,6,0,0,0,0,2,
++    18,5,13,1,117,10,0,0,0,115,101,116,95,108,111,97,
++    100,101,114,99,1,0,0,0,0,0,0,0,2,0,0,0,
++    3,0,0,0,3,0,0,0,115,35,0,0,0,135,0,0,
++    102,1,0,100,1,0,100,2,0,134,0,0,125,1,0,116,
++    0,0,124,1,0,136,0,0,131,2,0,1,124,1,0,83,
++    40,3,0,0,0,117,42,3,0,0,68,101,99,111,114,97,
++    116,111,114,32,116,111,32,104,97,110,100,108,101,32,115,101,
++    108,101,99,116,105,110,103,32,116,104,101,32,112,114,111,112,
++    101,114,32,109,111,100,117,108,101,32,102,111,114,32,108,111,
++    97,100,101,114,115,46,10,10,32,32,32,32,84,104,101,32,
++    100,101,99,111,114,97,116,101,100,32,102,117,110,99,116,105,
++    111,110,32,105,115,32,112,97,115,115,101,100,32,116,104,101,
++    32,109,111,100,117,108,101,32,116,111,32,117,115,101,32,105,
++    110,115,116,101,97,100,32,111,102,32,116,104,101,32,109,111,
++    100,117,108,101,10,32,32,32,32,110,97,109,101,46,32,84,
++    104,101,32,109,111,100,117,108,101,32,112,97,115,115,101,100,
++    32,105,110,32,116,111,32,116,104,101,32,102,117,110,99,116,
++    105,111,110,32,105,115,32,101,105,116,104,101,114,32,102,114,
++    111,109,32,115,121,115,46,109,111,100,117,108,101,115,32,105,
++    102,10,32,32,32,32,105,116,32,97,108,114,101,97,100,121,
++    32,101,120,105,115,116,115,32,111,114,32,105,115,32,97,32,
++    110,101,119,32,109,111,100,117,108,101,46,32,73,102,32,116,
++    104,101,32,109,111,100,117,108,101,32,105,115,32,110,101,119,
++    44,32,116,104,101,110,32,95,95,110,97,109,101,95,95,10,
++    32,32,32,32,105,115,32,115,101,116,32,116,104,101,32,102,
++    105,114,115,116,32,97,114,103,117,109,101,110,116,32,116,111,
++    32,116,104,101,32,109,101,116,104,111,100,44,32,95,95,108,
++    111,97,100,101,114,95,95,32,105,115,32,115,101,116,32,116,
++    111,32,115,101,108,102,44,32,97,110,100,10,32,32,32,32,
++    95,95,112,97,99,107,97,103,101,95,95,32,105,115,32,115,
++    101,116,32,97,99,99,111,114,100,105,110,103,108,121,32,40,
++    105,102,32,115,101,108,102,46,105,115,95,112,97,99,107,97,
++    103,101,40,41,32,105,115,32,100,101,102,105,110,101,100,41,
++    32,119,105,108,108,32,98,101,32,115,101,116,10,32,32,32,
++    32,98,101,102,111,114,101,32,105,116,32,105,115,32,112,97,
++    115,115,101,100,32,116,111,32,116,104,101,32,100,101,99,111,
++    114,97,116,101,100,32,102,117,110,99,116,105,111,110,32,40,
++    105,102,32,115,101,108,102,46,105,115,95,112,97,99,107,97,
++    103,101,40,41,32,100,111,101,115,10,32,32,32,32,110,111,
++    116,32,119,111,114,107,32,102,111,114,32,116,104,101,32,109,
++    111,100,117,108,101,32,105,116,32,119,105,108,108,32,98,101,
++    32,115,101,116,32,112,111,115,116,45,108,111,97,100,41,46,
++    10,10,32,32,32,32,73,102,32,97,110,32,101,120,99,101,
++    112,116,105,111,110,32,105,115,32,114,97,105,115,101,100,32,
++    97,110,100,32,116,104,101,32,100,101,99,111,114,97,116,111,
++    114,32,99,114,101,97,116,101,100,32,116,104,101,32,109,111,
++    100,117,108,101,32,105,116,32,105,115,10,32,32,32,32,115,
++    117,98,115,101,113,117,101,110,116,108,121,32,114,101,109,111,
++    118,101,100,32,102,114,111,109,32,115,121,115,46,109,111,100,
++    117,108,101,115,46,10,10,32,32,32,32,84,104,101,32,100,
++    101,99,111,114,97,116,111,114,32,97,115,115,117,109,101,115,
++    32,116,104,97,116,32,116,104,101,32,100,101,99,111,114,97,
++    116,101,100,32,102,117,110,99,116,105,111,110,32,116,97,107,
++    101,115,32,116,104,101,32,109,111,100,117,108,101,32,110,97,
++    109,101,32,97,115,10,32,32,32,32,116,104,101,32,115,101,
++    99,111,110,100,32,97,114,103,117,109,101,110,116,46,10,10,
++    32,32,32,32,99,2,0,0,0,0,0,0,0,7,0,0,
++    0,25,0,0,0,31,0,0,0,115,254,0,0,0,116,0,
++    0,106,1,0,106,2,0,124,1,0,131,1,0,125,4,0,
++    124,4,0,100,0,0,107,9,0,125,5,0,124,5,0,115,
++    168,0,116,4,0,124,1,0,131,1,0,125,4,0,100,3,
++    0,124,4,0,95,6,0,124,4,0,116,0,0,106,1,0,
++    124,1,0,60,124,0,0,124,4,0,95,7,0,121,19,0,
++    124,0,0,106,8,0,124,1,0,131,1,0,125,6,0,87,
++    110,24,0,4,116,9,0,116,10,0,102,2,0,107,10,0,
++    114,124,0,1,1,1,89,113,177,0,88,124,6,0,114,143,
++    0,124,1,0,124,4,0,95,11,0,113,177,0,124,1,0,
++    106,12,0,100,1,0,131,1,0,100,2,0,25,124,4,0,
++    95,11,0,110,9,0,100,3,0,124,4,0,95,6,0,122,
++    60,0,121,23,0,136,0,0,124,0,0,124,4,0,124,2,
++    0,124,3,0,142,2,0,83,87,110,30,0,1,1,1,124,
++    5,0,115,228,0,116,0,0,106,1,0,124,1,0,61,110,
++    0,0,130,0,0,89,110,1,0,88,87,100,0,0,100,4,
++    0,124,4,0,95,6,0,88,100,0,0,83,40,5,0,0,
++    0,78,117,1,0,0,0,46,105,0,0,0,0,84,70,40,
++    14,0,0,0,117,3,0,0,0,115,121,115,117,7,0,0,
++    0,109,111,100,117,108,101,115,117,3,0,0,0,103,101,116,
++    117,4,0,0,0,78,111,110,101,117,10,0,0,0,110,101,
++    119,95,109,111,100,117,108,101,117,4,0,0,0,84,114,117,
++    101,117,16,0,0,0,95,95,105,110,105,116,105,97,108,105,
++    122,105,110,103,95,95,117,10,0,0,0,95,95,108,111,97,
++    100,101,114,95,95,117,10,0,0,0,105,115,95,112,97,99,
++    107,97,103,101,117,11,0,0,0,73,109,112,111,114,116,69,
++    114,114,111,114,117,14,0,0,0,65,116,116,114,105,98,117,
++    116,101,69,114,114,111,114,117,11,0,0,0,95,95,112,97,
++    99,107,97,103,101,95,95,117,10,0,0,0,114,112,97,114,
++    116,105,116,105,111,110,117,5,0,0,0,70,97,108,115,101,
++    40,7,0,0,0,117,4,0,0,0,115,101,108,102,117,8,
++    0,0,0,102,117,108,108,110,97,109,101,117,4,0,0,0,
++    97,114,103,115,117,6,0,0,0,107,119,97,114,103,115,117,
++    6,0,0,0,109,111,100,117,108,101,117,9,0,0,0,105,
++    115,95,114,101,108,111,97,100,117,10,0,0,0,105,115,95,
++    112,97,99,107,97,103,101,40,1,0,0,0,117,3,0,0,
++    0,102,120,110,40,0,0,0,0,117,29,0,0,0,60,102,
++    114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,
++    95,98,111,111,116,115,116,114,97,112,62,117,25,0,0,0,
++    109,111,100,117,108,101,95,102,111,114,95,108,111,97,100,101,
++    114,95,119,114,97,112,112,101,114,24,2,0,0,115,44,0,
++    0,0,0,1,18,1,12,1,6,4,12,3,9,1,13,1,
++    9,1,3,1,19,1,19,1,5,2,6,1,12,2,25,2,
++    9,1,6,2,23,1,3,1,6,1,13,1,12,2,117,52,
++    0,0,0,109,111,100,117,108,101,95,102,111,114,95,108,111,
++    97,100,101,114,46,60,108,111,99,97,108,115,62,46,109,111,
++    100,117,108,101,95,102,111,114,95,108,111,97,100,101,114,95,
++    119,114,97,112,112,101,114,40,1,0,0,0,117,5,0,0,
++    0,95,119,114,97,112,40,2,0,0,0,117,3,0,0,0,
++    102,120,110,117,25,0,0,0,109,111,100,117,108,101,95,102,
++    111,114,95,108,111,97,100,101,114,95,119,114,97,112,112,101,
++    114,40,0,0,0,0,40,1,0,0,0,117,3,0,0,0,
++    102,120,110,117,29,0,0,0,60,102,114,111,122,101,110,32,
++    105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,
++    116,114,97,112,62,117,17,0,0,0,109,111,100,117,108,101,
++    95,102,111,114,95,108,111,97,100,101,114,6,2,0,0,115,
++    6,0,0,0,0,18,18,33,13,1,117,17,0,0,0,109,
++    111,100,117,108,101,95,102,111,114,95,108,111,97,100,101,114,
++    99,1,0,0,0,0,0,0,0,2,0,0,0,4,0,0,
++    0,3,0,0,0,115,38,0,0,0,100,3,0,135,0,0,
++    102,1,0,100,1,0,100,2,0,134,1,0,125,1,0,116,
++    1,0,124,1,0,136,0,0,131,2,0,1,124,1,0,83,
++    40,4,0,0,0,117,252,0,0,0,68,101,99,111,114,97,
++    116,111,114,32,116,111,32,118,101,114,105,102,121,32,116,104,
++    97,116,32,116,104,101,32,109,111,100,117,108,101,32,98,101,
++    105,110,103,32,114,101,113,117,101,115,116,101,100,32,109,97,
++    116,99,104,101,115,32,116,104,101,32,111,110,101,32,116,104,
++    101,10,32,32,32,32,108,111,97,100,101,114,32,99,97,110,
++    32,104,97,110,100,108,101,46,10,10,32,32,32,32,84,104,
++    101,32,102,105,114,115,116,32,97,114,103,117,109,101,110,116,
++    32,40,115,101,108,102,41,32,109,117,115,116,32,100,101,102,
++    105,110,101,32,95,110,97,109,101,32,119,104,105,99,104,32,
++    116,104,101,32,115,101,99,111,110,100,32,97,114,103,117,109,
++    101,110,116,32,105,115,10,32,32,32,32,99,111,109,112,97,
++    114,101,100,32,97,103,97,105,110,115,116,46,32,73,102,32,
++    116,104,101,32,99,111,109,112,97,114,105,115,111,110,32,102,
++    97,105,108,115,32,116,104,101,110,32,73,109,112,111,114,116,
++    69,114,114,111,114,32,105,115,32,114,97,105,115,101,100,46,
++    10,10,32,32,32,32,99,2,0,0,0,0,0,0,0,4,
++    0,0,0,5,0,0,0,31,0,0,0,115,83,0,0,0,
++    124,1,0,100,0,0,107,8,0,114,24,0,124,0,0,106,
++    1,0,125,1,0,110,40,0,124,0,0,106,1,0,124,1,
++    0,107,3,0,114,64,0,116,2,0,100,1,0,124,1,0,
++    22,100,2,0,124,1,0,131,1,1,130,1,0,110,0,0,
++    136,0,0,124,0,0,124,1,0,124,2,0,124,3,0,142,
++    2,0,83,40,3,0,0,0,78,117,23,0,0,0,108,111,
++    97,100,101,114,32,99,97,110,110,111,116,32,104,97,110,100,
++    108,101,32,37,115,117,4,0,0,0,110,97,109,101,40,3,
++    0,0,0,117,4,0,0,0,78,111,110,101,117,4,0,0,
++    0,110,97,109,101,117,11,0,0,0,73,109,112,111,114,116,
++    69,114,114,111,114,40,4,0,0,0,117,4,0,0,0,115,
++    101,108,102,117,4,0,0,0,110,97,109,101,117,4,0,0,
++    0,97,114,103,115,117,6,0,0,0,107,119,97,114,103,115,
++    40,1,0,0,0,117,6,0,0,0,109,101,116,104,111,100,
++    40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,
++    110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,
++    116,115,116,114,97,112,62,117,19,0,0,0,95,99,104,101,
++    99,107,95,110,97,109,101,95,119,114,97,112,112,101,114,69,
++    2,0,0,115,10,0,0,0,0,1,12,1,12,1,15,1,
++    25,1,117,40,0,0,0,95,99,104,101,99,107,95,110,97,
++    109,101,46,60,108,111,99,97,108,115,62,46,95,99,104,101,
++    99,107,95,110,97,109,101,95,119,114,97,112,112,101,114,78,
++    40,2,0,0,0,117,4,0,0,0,78,111,110,101,117,5,
++    0,0,0,95,119,114,97,112,40,2,0,0,0,117,6,0,
++    0,0,109,101,116,104,111,100,117,19,0,0,0,95,99,104,
++    101,99,107,95,110,97,109,101,95,119,114,97,112,112,101,114,
++    40,0,0,0,0,40,1,0,0,0,117,6,0,0,0,109,
++    101,116,104,111,100,117,29,0,0,0,60,102,114,111,122,101,
++    110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,
++    116,115,116,114,97,112,62,117,11,0,0,0,95,99,104,101,
++    99,107,95,110,97,109,101,61,2,0,0,115,6,0,0,0,
++    0,8,21,6,13,1,117,11,0,0,0,95,99,104,101,99,
++    107,95,110,97,109,101,99,1,0,0,0,0,0,0,0,2,
++    0,0,0,3,0,0,0,3,0,0,0,115,35,0,0,0,
++    135,0,0,102,1,0,100,1,0,100,2,0,134,0,0,125,
++    1,0,116,0,0,124,1,0,136,0,0,131,2,0,1,124,
++    1,0,83,40,3,0,0,0,117,49,0,0,0,68,101,99,
++    111,114,97,116,111,114,32,116,111,32,118,101,114,105,102,121,
++    32,116,104,101,32,110,97,109,101,100,32,109,111,100,117,108,
++    101,32,105,115,32,98,117,105,108,116,45,105,110,46,99,2,
++    0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,19,
++    0,0,0,115,58,0,0,0,124,1,0,116,0,0,106,1,
++    0,107,7,0,114,45,0,116,2,0,100,1,0,106,3,0,
++    124,1,0,131,1,0,100,2,0,124,1,0,131,1,1,130,
++    1,0,110,0,0,136,0,0,124,0,0,124,1,0,131,2,
++    0,83,40,3,0,0,0,78,117,27,0,0,0,123,125,32,
++    105,115,32,110,111,116,32,97,32,98,117,105,108,116,45,105,
++    110,32,109,111,100,117,108,101,117,4,0,0,0,110,97,109,
++    101,40,4,0,0,0,117,3,0,0,0,115,121,115,117,20,
++    0,0,0,98,117,105,108,116,105,110,95,109,111,100,117,108,
++    101,95,110,97,109,101,115,117,11,0,0,0,73,109,112,111,
++    114,116,69,114,114,111,114,117,6,0,0,0,102,111,114,109,
++    97,116,40,2,0,0,0,117,4,0,0,0,115,101,108,102,
++    117,8,0,0,0,102,117,108,108,110,97,109,101,40,1,0,
++    0,0,117,3,0,0,0,102,120,110,40,0,0,0,0,117,
+     29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
+     114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
+-    62,117,17,0,0,0,115,111,117,114,99,101,95,102,114,111,
+-    109,95,99,97,99,104,101,186,1,0,0,115,24,0,0,0,
+-    0,9,18,1,15,1,18,1,18,1,12,1,9,1,18,1,
+-    21,1,9,1,15,1,19,1,117,17,0,0,0,115,111,117,
+-    114,99,101,95,102,114,111,109,95,99,97,99,104,101,99,1,
+-    0,0,0,0,0,0,0,5,0,0,0,13,0,0,0,67,
+-    0,0,0,115,164,0,0,0,116,0,0,124,0,0,131,1,
+-    0,100,1,0,107,2,0,114,22,0,100,6,0,83,124,0,
+-    0,106,2,0,100,2,0,131,1,0,92,3,0,125,1,0,
+-    125,2,0,125,3,0,124,1,0,12,115,81,0,124,3,0,
+-    106,3,0,131,0,0,100,7,0,100,8,0,133,2,0,25,
+-    100,5,0,107,3,0,114,85,0,124,0,0,83,121,16,0,
+-    116,4,0,124,0,0,131,1,0,125,4,0,87,110,40,0,
+-    4,116,5,0,116,6,0,102,2,0,107,10,0,114,143,0,
+-    1,1,1,116,7,0,100,9,0,100,6,0,133,2,0,25,
+-    125,4,0,89,110,1,0,88,116,8,0,116,9,0,131,1,
+-    0,114,160,0,124,4,0,83,124,0,0,83,40,10,0,0,
+-    0,117,188,0,0,0,67,111,110,118,101,114,116,32,97,32,
+-    98,121,116,101,99,111,100,101,32,102,105,108,101,32,112,97,
+-    116,104,32,116,111,32,97,32,115,111,117,114,99,101,32,112,
+-    97,116,104,32,40,105,102,32,112,111,115,115,105,98,108,101,
+-    41,46,10,10,32,32,32,32,84,104,105,115,32,102,117,110,
+-    99,116,105,111,110,32,101,120,105,115,116,115,32,112,117,114,
+-    101,108,121,32,102,111,114,32,98,97,99,107,119,97,114,100,
+-    115,45,99,111,109,112,97,116,105,98,105,108,105,116,121,32,
+-    102,111,114,10,32,32,32,32,80,121,73,109,112,111,114,116,
+-    95,69,120,101,99,67,111,100,101,77,111,100,117,108,101,87,
+-    105,116,104,70,105,108,101,110,97,109,101,115,40,41,32,105,
+-    110,32,116,104,101,32,67,32,65,80,73,46,10,10,32,32,
+-    32,32,105,0,0,0,0,117,1,0,0,0,46,105,3,0,
+-    0,0,105,1,0,0,0,117,3,0,0,0,46,112,121,78,
+-    105,253,255,255,255,105,255,255,255,255,105,255,255,255,255,40,
+-    10,0,0,0,117,3,0,0,0,108,101,110,117,4,0,0,
+-    0,78,111,110,101,117,9,0,0,0,114,112,97,114,105,116,
+-    105,111,110,117,5,0,0,0,108,111,119,101,114,117,17,0,
+-    0,0,115,111,117,114,99,101,95,102,114,111,109,95,99,97,
+-    99,104,101,117,19,0,0,0,78,111,116,73,109,112,108,101,
+-    109,101,110,116,101,100,69,114,114,111,114,117,10,0,0,0,
+-    86,97,108,117,101,69,114,114,111,114,117,12,0,0,0,98,
+-    121,116,99,111,100,101,95,112,97,116,104,117,12,0,0,0,
+-    95,112,97,116,104,95,105,115,102,105,108,101,117,12,0,0,
+-    0,115,111,117,114,99,101,95,115,116,97,116,115,40,5,0,
+-    0,0,117,13,0,0,0,98,121,116,101,99,111,100,101,95,
+-    112,97,116,104,117,4,0,0,0,114,101,115,116,117,1,0,
+-    0,0,95,117,9,0,0,0,101,120,116,101,110,115,105,111,
+-    110,117,11,0,0,0,115,111,117,114,99,101,95,112,97,116,
+-    104,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
+-    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
+-    98,46,95,98,111,111,116,115,116,114,97,112,62,117,15,0,
+-    0,0,95,103,101,116,95,115,111,117,114,99,101,102,105,108,
+-    101,209,1,0,0,115,20,0,0,0,0,7,18,1,4,1,
+-    24,1,35,1,4,2,3,1,16,1,19,1,21,2,117,15,
+-    0,0,0,95,103,101,116,95,115,111,117,114,99,101,102,105,
+-    108,101,99,1,0,0,0,0,0,0,0,2,0,0,0,4,
+-    0,0,0,71,0,0,0,115,75,0,0,0,116,0,0,106,
+-    1,0,106,2,0,114,71,0,124,0,0,106,3,0,100,6,
+-    0,131,1,0,115,40,0,100,3,0,124,0,0,23,125,0,
+-    0,110,0,0,116,4,0,124,0,0,106,5,0,124,1,0,
+-    140,0,0,100,4,0,116,0,0,106,6,0,131,1,1,1,
+-    110,0,0,100,5,0,83,40,7,0,0,0,117,61,0,0,
+-    0,80,114,105,110,116,32,116,104,101,32,109,101,115,115,97,
+-    103,101,32,116,111,32,115,116,100,101,114,114,32,105,102,32,
+-    45,118,47,80,89,84,72,79,78,86,69,82,66,79,83,69,
+-    32,105,115,32,116,117,114,110,101,100,32,111,110,46,117,1,
+-    0,0,0,35,117,7,0,0,0,105,109,112,111,114,116,32,
+-    117,2,0,0,0,35,32,117,4,0,0,0,102,105,108,101,
+-    78,40,2,0,0,0,117,1,0,0,0,35,117,7,0,0,
+-    0,105,109,112,111,114,116,32,40,7,0,0,0,117,3,0,
+-    0,0,115,121,115,117,5,0,0,0,102,108,97,103,115,117,
+-    7,0,0,0,118,101,114,98,111,115,101,117,10,0,0,0,
+-    115,116,97,114,116,115,119,105,116,104,117,5,0,0,0,112,
+-    114,105,110,116,117,6,0,0,0,102,111,114,109,97,116,117,
+-    6,0,0,0,115,116,100,101,114,114,40,2,0,0,0,117,
+-    7,0,0,0,109,101,115,115,97,103,101,117,4,0,0,0,
+-    97,114,103,115,40,0,0,0,0,40,0,0,0,0,117,29,
+-    0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,
+-    116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,
+-    117,16,0,0,0,95,118,101,114,98,111,115,101,95,109,101,
+-    115,115,97,103,101,230,1,0,0,115,8,0,0,0,0,2,
+-    12,1,15,1,13,1,117,16,0,0,0,95,118,101,114,98,
+-    111,115,101,95,109,101,115,115,97,103,101,99,1,0,0,0,
+-    0,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,
+-    115,35,0,0,0,135,0,0,102,1,0,100,1,0,100,2,
+-    0,134,0,0,125,1,0,116,0,0,124,1,0,136,0,0,
+-    131,2,0,1,124,1,0,83,40,3,0,0,0,117,39,0,
+-    0,0,83,101,116,32,95,95,112,97,99,107,97,103,101,95,
+-    95,32,111,110,32,116,104,101,32,114,101,116,117,114,110,101,
+-    100,32,109,111,100,117,108,101,46,99,0,0,0,0,0,0,
+-    0,0,3,0,0,0,4,0,0,0,31,0,0,0,115,101,
+-    0,0,0,136,0,0,124,0,0,124,1,0,142,0,0,125,
+-    2,0,116,0,0,124,2,0,100,1,0,100,0,0,131,3,
+-    0,100,0,0,107,8,0,114,97,0,124,2,0,106,2,0,
+-    124,2,0,95,3,0,116,4,0,124,2,0,100,2,0,131,
+-    2,0,115,97,0,124,2,0,106,3,0,106,5,0,100,3,
+-    0,131,1,0,100,4,0,25,124,2,0,95,3,0,113,97,
+-    0,110,0,0,124,2,0,83,40,5,0,0,0,78,117,11,
+-    0,0,0,95,95,112,97,99,107,97,103,101,95,95,117,8,
+-    0,0,0,95,95,112,97,116,104,95,95,117,1,0,0,0,
+-    46,105,0,0,0,0,40,6,0,0,0,117,7,0,0,0,
+-    103,101,116,97,116,116,114,117,4,0,0,0,78,111,110,101,
+-    117,8,0,0,0,95,95,110,97,109,101,95,95,117,11,0,
+-    0,0,95,95,112,97,99,107,97,103,101,95,95,117,7,0,
+-    0,0,104,97,115,97,116,116,114,117,10,0,0,0,114,112,
+-    97,114,116,105,116,105,111,110,40,3,0,0,0,117,4,0,
+-    0,0,97,114,103,115,117,6,0,0,0,107,119,97,114,103,
+-    115,117,6,0,0,0,109,111,100,117,108,101,40,1,0,0,
+-    0,117,3,0,0,0,102,120,110,40,0,0,0,0,117,29,
+-    0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,
+-    116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,
+-    117,19,0,0,0,115,101,116,95,112,97,99,107,97,103,101,
+-    95,119,114,97,112,112,101,114,240,1,0,0,115,12,0,0,
+-    0,0,1,15,1,24,1,12,1,15,1,31,1,117,40,0,
+-    0,0,115,101,116,95,112,97,99,107,97,103,101,46,60,108,
+-    111,99,97,108,115,62,46,115,101,116,95,112,97,99,107,97,
+-    103,101,95,119,114,97,112,112,101,114,40,1,0,0,0,117,
+-    5,0,0,0,95,119,114,97,112,40,2,0,0,0,117,3,
+-    0,0,0,102,120,110,117,19,0,0,0,115,101,116,95,112,
+-    97,99,107,97,103,101,95,119,114,97,112,112,101,114,40,0,
+-    0,0,0,40,1,0,0,0,117,3,0,0,0,102,120,110,
+-    117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,
+-    111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,
+-    112,62,117,11,0,0,0,115,101,116,95,112,97,99,107,97,
+-    103,101,238,1,0,0,115,6,0,0,0,0,2,18,7,13,
+-    1,117,11,0,0,0,115,101,116,95,112,97,99,107,97,103,
+-    101,99,1,0,0,0,0,0,0,0,2,0,0,0,3,0,
+-    0,0,3,0,0,0,115,35,0,0,0,135,0,0,102,1,
+-    0,100,1,0,100,2,0,134,0,0,125,1,0,116,0,0,
+-    124,1,0,136,0,0,131,2,0,1,124,1,0,83,40,3,
+-    0,0,0,117,38,0,0,0,83,101,116,32,95,95,108,111,
+-    97,100,101,114,95,95,32,111,110,32,116,104,101,32,114,101,
+-    116,117,114,110,101,100,32,109,111,100,117,108,101,46,99,1,
+-    0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,31,
+-    0,0,0,115,49,0,0,0,136,0,0,124,0,0,124,1,
+-    0,124,2,0,142,1,0,125,3,0,116,0,0,124,3,0,
+-    100,1,0,131,2,0,115,45,0,124,0,0,124,3,0,95,
+-    1,0,110,0,0,124,3,0,83,40,2,0,0,0,78,117,
+-    10,0,0,0,95,95,108,111,97,100,101,114,95,95,40,2,
+-    0,0,0,117,7,0,0,0,104,97,115,97,116,116,114,117,
+-    10,0,0,0,95,95,108,111,97,100,101,114,95,95,40,4,
+-    0,0,0,117,4,0,0,0,115,101,108,102,117,4,0,0,
+-    0,97,114,103,115,117,6,0,0,0,107,119,97,114,103,115,
+-    117,6,0,0,0,109,111,100,117,108,101,40,1,0,0,0,
++    62,117,25,0,0,0,95,114,101,113,117,105,114,101,115,95,
++    98,117,105,108,116,105,110,95,119,114,97,112,112,101,114,81,
++    2,0,0,115,8,0,0,0,0,1,15,1,18,1,12,1,
++    117,52,0,0,0,95,114,101,113,117,105,114,101,115,95,98,
++    117,105,108,116,105,110,46,60,108,111,99,97,108,115,62,46,
++    95,114,101,113,117,105,114,101,115,95,98,117,105,108,116,105,
++    110,95,119,114,97,112,112,101,114,40,1,0,0,0,117,5,
++    0,0,0,95,119,114,97,112,40,2,0,0,0,117,3,0,
++    0,0,102,120,110,117,25,0,0,0,95,114,101,113,117,105,
++    114,101,115,95,98,117,105,108,116,105,110,95,119,114,97,112,
++    112,101,114,40,0,0,0,0,40,1,0,0,0,117,3,0,
++    0,0,102,120,110,117,29,0,0,0,60,102,114,111,122,101,
++    110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,
++    116,115,116,114,97,112,62,117,17,0,0,0,95,114,101,113,
++    117,105,114,101,115,95,98,117,105,108,116,105,110,79,2,0,
++    0,115,6,0,0,0,0,2,18,5,13,1,117,17,0,0,
++    0,95,114,101,113,117,105,114,101,115,95,98,117,105,108,116,
++    105,110,99,1,0,0,0,0,0,0,0,2,0,0,0,3,
++    0,0,0,3,0,0,0,115,35,0,0,0,135,0,0,102,
++    1,0,100,1,0,100,2,0,134,0,0,125,1,0,116,0,
++    0,124,1,0,136,0,0,131,2,0,1,124,1,0,83,40,
++    3,0,0,0,117,47,0,0,0,68,101,99,111,114,97,116,
++    111,114,32,116,111,32,118,101,114,105,102,121,32,116,104,101,
++    32,110,97,109,101,100,32,109,111,100,117,108,101,32,105,115,
++    32,102,114,111,122,101,110,46,99,2,0,0,0,0,0,0,
++    0,2,0,0,0,4,0,0,0,19,0,0,0,115,58,0,
++    0,0,116,0,0,106,1,0,124,1,0,131,1,0,115,45,
++    0,116,2,0,100,1,0,106,3,0,124,1,0,131,1,0,
++    100,2,0,124,1,0,131,1,1,130,1,0,110,0,0,136,
++    0,0,124,0,0,124,1,0,131,2,0,83,40,3,0,0,
++    0,78,117,25,0,0,0,123,125,32,105,115,32,110,111,116,
++    32,97,32,102,114,111,122,101,110,32,109,111,100,117,108,101,
++    117,4,0,0,0,110,97,109,101,40,4,0,0,0,117,4,
++    0,0,0,95,105,109,112,117,9,0,0,0,105,115,95,102,
++    114,111,122,101,110,117,11,0,0,0,73,109,112,111,114,116,
++    69,114,114,111,114,117,6,0,0,0,102,111,114,109,97,116,
++    40,2,0,0,0,117,4,0,0,0,115,101,108,102,117,8,
++    0,0,0,102,117,108,108,110,97,109,101,40,1,0,0,0,
+     117,3,0,0,0,102,120,110,40,0,0,0,0,117,29,0,
+     0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,
+     108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,
+-    18,0,0,0,115,101,116,95,108,111,97,100,101,114,95,119,
+-    114,97,112,112,101,114,253,1,0,0,115,8,0,0,0,0,
+-    1,18,1,15,1,12,1,117,38,0,0,0,115,101,116,95,
+-    108,111,97,100,101,114,46,60,108,111,99,97,108,115,62,46,
+-    115,101,116,95,108,111,97,100,101,114,95,119,114,97,112,112,
+-    101,114,40,1,0,0,0,117,5,0,0,0,95,119,114,97,
+-    112,40,2,0,0,0,117,3,0,0,0,102,120,110,117,18,
+-    0,0,0,115,101,116,95,108,111,97,100,101,114,95,119,114,
+-    97,112,112,101,114,40,0,0,0,0,40,1,0,0,0,117,
+-    3,0,0,0,102,120,110,117,29,0,0,0,60,102,114,111,
+-    122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,
+-    111,111,116,115,116,114,97,112,62,117,10,0,0,0,115,101,
+-    116,95,108,111,97,100,101,114,251,1,0,0,115,6,0,0,
+-    0,0,2,18,5,13,1,117,10,0,0,0,115,101,116,95,
+-    108,111,97,100,101,114,99,1,0,0,0,0,0,0,0,2,
+-    0,0,0,3,0,0,0,3,0,0,0,115,35,0,0,0,
+-    135,0,0,102,1,0,100,1,0,100,2,0,134,0,0,125,
+-    1,0,116,0,0,124,1,0,136,0,0,131,2,0,1,124,
+-    1,0,83,40,3,0,0,0,117,42,3,0,0,68,101,99,
+-    111,114,97,116,111,114,32,116,111,32,104,97,110,100,108,101,
+-    32,115,101,108,101,99,116,105,110,103,32,116,104,101,32,112,
+-    114,111,112,101,114,32,109,111,100,117,108,101,32,102,111,114,
+-    32,108,111,97,100,101,114,115,46,10,10,32,32,32,32,84,
+-    104,101,32,100,101,99,111,114,97,116,101,100,32,102,117,110,
+-    99,116,105,111,110,32,105,115,32,112,97,115,115,101,100,32,
+-    116,104,101,32,109,111,100,117,108,101,32,116,111,32,117,115,
+-    101,32,105,110,115,116,101,97,100,32,111,102,32,116,104,101,
+-    32,109,111,100,117,108,101,10,32,32,32,32,110,97,109,101,
+-    46,32,84,104,101,32,109,111,100,117,108,101,32,112,97,115,
+-    115,101,100,32,105,110,32,116,111,32,116,104,101,32,102,117,
+-    110,99,116,105,111,110,32,105,115,32,101,105,116,104,101,114,
+-    32,102,114,111,109,32,115,121,115,46,109,111,100,117,108,101,
+-    115,32,105,102,10,32,32,32,32,105,116,32,97,108,114,101,
+-    97,100,121,32,101,120,105,115,116,115,32,111,114,32,105,115,
+-    32,97,32,110,101,119,32,109,111,100,117,108,101,46,32,73,
+-    102,32,116,104,101,32,109,111,100,117,108,101,32,105,115,32,
+-    110,101,119,44,32,116,104,101,110,32,95,95,110,97,109,101,
+-    95,95,10,32,32,32,32,105,115,32,115,101,116,32,116,104,
+-    101,32,102,105,114,115,116,32,97,114,103,117,109,101,110,116,
+-    32,116,111,32,116,104,101,32,109,101,116,104,111,100,44,32,
+-    95,95,108,111,97,100,101,114,95,95,32,105,115,32,115,101,
+-    116,32,116,111,32,115,101,108,102,44,32,97,110,100,10,32,
+-    32,32,32,95,95,112,97,99,107,97,103,101,95,95,32,105,
+-    115,32,115,101,116,32,97,99,99,111,114,100,105,110,103,108,
+-    121,32,40,105,102,32,115,101,108,102,46,105,115,95,112,97,
+-    99,107,97,103,101,40,41,32,105,115,32,100,101,102,105,110,
+-    101,100,41,32,119,105,108,108,32,98,101,32,115,101,116,10,
+-    32,32,32,32,98,101,102,111,114,101,32,105,116,32,105,115,
+-    32,112,97,115,115,101,100,32,116,111,32,116,104,101,32,100,
+-    101,99,111,114,97,116,101,100,32,102,117,110,99,116,105,111,
+-    110,32,40,105,102,32,115,101,108,102,46,105,115,95,112,97,
+-    99,107,97,103,101,40,41,32,100,111,101,115,10,32,32,32,
+-    32,110,111,116,32,119,111,114,107,32,102,111,114,32,116,104,
+-    101,32,109,111,100,117,108,101,32,105,116,32,119,105,108,108,
+-    32,98,101,32,115,101,116,32,112,111,115,116,45,108,111,97,
+-    100,41,46,10,10,32,32,32,32,73,102,32,97,110,32,101,
+-    120,99,101,112,116,105,111,110,32,105,115,32,114,97,105,115,
+-    101,100,32,97,110,100,32,116,104,101,32,100,101,99,111,114,
+-    97,116,111,114,32,99,114,101,97,116,101,100,32,116,104,101,
+-    32,109,111,100,117,108,101,32,105,116,32,105,115,10,32,32,
+-    32,32,115,117,98,115,101,113,117,101,110,116,108,121,32,114,
+-    101,109,111,118,101,100,32,102,114,111,109,32,115,121,115,46,
+-    109,111,100,117,108,101,115,46,10,10,32,32,32,32,84,104,
+-    101,32,100,101,99,111,114,97,116,111,114,32,97,115,115,117,
+-    109,101,115,32,116,104,97,116,32,116,104,101,32,100,101,99,
+-    111,114,97,116,101,100,32,102,117,110,99,116,105,111,110,32,
+-    116,97,107,101,115,32,116,104,101,32,109,111,100,117,108,101,
+-    32,110,97,109,101,32,97,115,10,32,32,32,32,116,104,101,
+-    32,115,101,99,111,110,100,32,97,114,103,117,109,101,110,116,
++    24,0,0,0,95,114,101,113,117,105,114,101,115,95,102,114,
++    111,122,101,110,95,119,114,97,112,112,101,114,92,2,0,0,
++    115,8,0,0,0,0,1,15,1,18,1,12,1,117,50,0,
++    0,0,95,114,101,113,117,105,114,101,115,95,102,114,111,122,
++    101,110,46,60,108,111,99,97,108,115,62,46,95,114,101,113,
++    117,105,114,101,115,95,102,114,111,122,101,110,95,119,114,97,
++    112,112,101,114,40,1,0,0,0,117,5,0,0,0,95,119,
++    114,97,112,40,2,0,0,0,117,3,0,0,0,102,120,110,
++    117,24,0,0,0,95,114,101,113,117,105,114,101,115,95,102,
++    114,111,122,101,110,95,119,114,97,112,112,101,114,40,0,0,
++    0,0,40,1,0,0,0,117,3,0,0,0,102,120,110,117,
++    29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
++    114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
++    62,117,16,0,0,0,95,114,101,113,117,105,114,101,115,95,
++    102,114,111,122,101,110,90,2,0,0,115,6,0,0,0,0,
++    2,18,5,13,1,117,16,0,0,0,95,114,101,113,117,105,
++    114,101,115,95,102,114,111,122,101,110,99,2,0,0,0,0,
++    0,0,0,5,0,0,0,5,0,0,0,67,0,0,0,115,
++    87,0,0,0,124,0,0,106,0,0,124,1,0,131,1,0,
++    92,2,0,125,2,0,125,3,0,124,2,0,100,3,0,107,
++    8,0,114,83,0,116,2,0,124,3,0,131,1,0,114,83,
++    0,100,1,0,125,4,0,116,3,0,106,4,0,124,4,0,
++    106,5,0,124,3,0,100,2,0,25,131,1,0,116,6,0,
++    131,2,0,1,110,0,0,124,2,0,83,40,4,0,0,0,
++    117,86,0,0,0,84,114,121,32,116,111,32,102,105,110,100,
++    32,97,32,108,111,97,100,101,114,32,102,111,114,32,116,104,
++    101,32,115,112,101,99,105,102,105,101,100,32,109,111,100,117,
++    108,101,32,98,121,32,100,101,108,101,103,97,116,105,110,103,
++    32,116,111,10,32,32,32,32,115,101,108,102,46,102,105,110,
++    100,95,108,111,97,100,101,114,40,41,46,117,44,0,0,0,
++    78,111,116,32,105,109,112,111,114,116,105,110,103,32,100,105,
++    114,101,99,116,111,114,121,32,123,125,58,32,109,105,115,115,
++    105,110,103,32,95,95,105,110,105,116,95,95,105,0,0,0,
++    0,78,40,7,0,0,0,117,11,0,0,0,102,105,110,100,
++    95,108,111,97,100,101,114,117,4,0,0,0,78,111,110,101,
++    117,3,0,0,0,108,101,110,117,9,0,0,0,95,119,97,
++    114,110,105,110,103,115,117,4,0,0,0,119,97,114,110,117,
++    6,0,0,0,102,111,114,109,97,116,117,13,0,0,0,73,
++    109,112,111,114,116,87,97,114,110,105,110,103,40,5,0,0,
++    0,117,4,0,0,0,115,101,108,102,117,8,0,0,0,102,
++    117,108,108,110,97,109,101,117,6,0,0,0,108,111,97,100,
++    101,114,117,8,0,0,0,112,111,114,116,105,111,110,115,117,
++    3,0,0,0,109,115,103,40,0,0,0,0,40,0,0,0,
++    0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,
++    112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,
++    97,112,62,117,17,0,0,0,95,102,105,110,100,95,109,111,
++    100,117,108,101,95,115,104,105,109,101,2,0,0,115,10,0,
++    0,0,0,6,21,1,24,1,6,1,32,1,117,17,0,0,
++    0,95,102,105,110,100,95,109,111,100,117,108,101,95,115,104,
++    105,109,99,1,0,0,0,0,0,0,0,1,0,0,0,6,
++    0,0,0,66,0,0,0,115,173,0,0,0,124,0,0,69,
++    101,0,0,90,1,0,100,0,0,90,2,0,100,1,0,90,
++    3,0,101,4,0,100,2,0,100,3,0,132,0,0,131,1,
++    0,90,5,0,101,4,0,100,14,0,100,4,0,100,5,0,
++    132,1,0,131,1,0,90,7,0,101,4,0,101,8,0,101,
++    9,0,101,10,0,100,6,0,100,7,0,132,0,0,131,1,
++    0,131,1,0,131,1,0,131,1,0,90,11,0,101,4,0,
++    101,10,0,100,8,0,100,9,0,132,0,0,131,1,0,131,
++    1,0,90,12,0,101,4,0,101,10,0,100,10,0,100,11,
++    0,132,0,0,131,1,0,131,1,0,90,13,0,101,4,0,
++    101,10,0,100,12,0,100,13,0,132,0,0,131,1,0,131,
++    1,0,90,14,0,100,14,0,83,40,15,0,0,0,117,15,
++    0,0,0,66,117,105,108,116,105,110,73,109,112,111,114,116,
++    101,114,117,144,0,0,0,77,101,116,97,32,112,97,116,104,
++    32,105,109,112,111,114,116,32,102,111,114,32,98,117,105,108,
++    116,45,105,110,32,109,111,100,117,108,101,115,46,10,10,32,
++    32,32,32,65,108,108,32,109,101,116,104,111,100,115,32,97,
++    114,101,32,101,105,116,104,101,114,32,99,108,97,115,115,32,
++    111,114,32,115,116,97,116,105,99,32,109,101,116,104,111,100,
++    115,32,116,111,32,97,118,111,105,100,32,116,104,101,32,110,
++    101,101,100,32,116,111,10,32,32,32,32,105,110,115,116,97,
++    110,116,105,97,116,101,32,116,104,101,32,99,108,97,115,115,
+     46,10,10,32,32,32,32,99,2,0,0,0,0,0,0,0,
+-    7,0,0,0,25,0,0,0,31,0,0,0,115,254,0,0,
+-    0,116,0,0,106,1,0,106,2,0,124,1,0,131,1,0,
+-    125,4,0,124,4,0,100,0,0,107,9,0,125,5,0,124,
+-    5,0,115,168,0,116,4,0,124,1,0,131,1,0,125,4,
+-    0,100,3,0,124,4,0,95,6,0,124,4,0,116,0,0,
+-    106,1,0,124,1,0,60,124,0,0,124,4,0,95,7,0,
+-    121,19,0,124,0,0,106,8,0,124,1,0,131,1,0,125,
+-    6,0,87,110,24,0,4,116,9,0,116,10,0,102,2,0,
+-    107,10,0,114,124,0,1,1,1,89,113,177,0,88,124,6,
+-    0,114,143,0,124,1,0,124,4,0,95,11,0,113,177,0,
+-    124,1,0,106,12,0,100,1,0,131,1,0,100,2,0,25,
+-    124,4,0,95,11,0,110,9,0,100,3,0,124,4,0,95,
+-    6,0,122,60,0,121,23,0,136,0,0,124,0,0,124,4,
+-    0,124,2,0,124,3,0,142,2,0,83,87,110,30,0,1,
+-    1,1,124,5,0,115,228,0,116,0,0,106,1,0,124,1,
+-    0,61,110,0,0,130,0,0,89,110,1,0,88,87,100,0,
+-    0,100,4,0,124,4,0,95,6,0,88,100,0,0,83,40,
+-    5,0,0,0,78,117,1,0,0,0,46,105,0,0,0,0,
+-    84,70,40,14,0,0,0,117,3,0,0,0,115,121,115,117,
+-    7,0,0,0,109,111,100,117,108,101,115,117,3,0,0,0,
+-    103,101,116,117,4,0,0,0,78,111,110,101,117,10,0,0,
+-    0,110,101,119,95,109,111,100,117,108,101,117,4,0,0,0,
+-    84,114,117,101,117,16,0,0,0,95,95,105,110,105,116,105,
+-    97,108,105,122,105,110,103,95,95,117,10,0,0,0,95,95,
+-    108,111,97,100,101,114,95,95,117,10,0,0,0,105,115,95,
+-    112,97,99,107,97,103,101,117,11,0,0,0,73,109,112,111,
+-    114,116,69,114,114,111,114,117,14,0,0,0,65,116,116,114,
+-    105,98,117,116,101,69,114,114,111,114,117,11,0,0,0,95,
+-    95,112,97,99,107,97,103,101,95,95,117,10,0,0,0,114,
+-    112,97,114,116,105,116,105,111,110,117,5,0,0,0,70,97,
+-    108,115,101,40,7,0,0,0,117,4,0,0,0,115,101,108,
+-    102,117,8,0,0,0,102,117,108,108,110,97,109,101,117,4,
+-    0,0,0,97,114,103,115,117,6,0,0,0,107,119,97,114,
+-    103,115,117,6,0,0,0,109,111,100,117,108,101,117,9,0,
+-    0,0,105,115,95,114,101,108,111,97,100,117,10,0,0,0,
+-    105,115,95,112,97,99,107,97,103,101,40,1,0,0,0,117,
+-    3,0,0,0,102,120,110,40,0,0,0,0,117,29,0,0,
+-    0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,
+-    105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,25,
+-    0,0,0,109,111,100,117,108,101,95,102,111,114,95,108,111,
+-    97,100,101,114,95,119,114,97,112,112,101,114,24,2,0,0,
+-    115,44,0,0,0,0,1,18,1,12,1,6,4,12,3,9,
+-    1,13,1,9,1,3,1,19,1,19,1,5,2,6,1,12,
+-    2,25,2,9,1,6,2,23,1,3,1,6,1,13,1,12,
+-    2,117,52,0,0,0,109,111,100,117,108,101,95,102,111,114,
+-    95,108,111,97,100,101,114,46,60,108,111,99,97,108,115,62,
+-    46,109,111,100,117,108,101,95,102,111,114,95,108,111,97,100,
+-    101,114,95,119,114,97,112,112,101,114,40,1,0,0,0,117,
+-    5,0,0,0,95,119,114,97,112,40,2,0,0,0,117,3,
+-    0,0,0,102,120,110,117,25,0,0,0,109,111,100,117,108,
+-    101,95,102,111,114,95,108,111,97,100,101,114,95,119,114,97,
+-    112,112,101,114,40,0,0,0,0,40,1,0,0,0,117,3,
+-    0,0,0,102,120,110,117,29,0,0,0,60,102,114,111,122,
+-    101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,
+-    111,116,115,116,114,97,112,62,117,17,0,0,0,109,111,100,
+-    117,108,101,95,102,111,114,95,108,111,97,100,101,114,6,2,
+-    0,0,115,6,0,0,0,0,18,18,33,13,1,117,17,0,
+-    0,0,109,111,100,117,108,101,95,102,111,114,95,108,111,97,
+-    100,101,114,99,1,0,0,0,0,0,0,0,2,0,0,0,
+-    4,0,0,0,3,0,0,0,115,38,0,0,0,100,3,0,
+-    135,0,0,102,1,0,100,1,0,100,2,0,134,1,0,125,
+-    1,0,116,1,0,124,1,0,136,0,0,131,2,0,1,124,
+-    1,0,83,40,4,0,0,0,117,252,0,0,0,68,101,99,
+-    111,114,97,116,111,114,32,116,111,32,118,101,114,105,102,121,
+-    32,116,104,97,116,32,116,104,101,32,109,111,100,117,108,101,
+-    32,98,101,105,110,103,32,114,101,113,117,101,115,116,101,100,
+-    32,109,97,116,99,104,101,115,32,116,104,101,32,111,110,101,
+-    32,116,104,101,10,32,32,32,32,108,111,97,100,101,114,32,
+-    99,97,110,32,104,97,110,100,108,101,46,10,10,32,32,32,
+-    32,84,104,101,32,102,105,114,115,116,32,97,114,103,117,109,
+-    101,110,116,32,40,115,101,108,102,41,32,109,117,115,116,32,
+-    100,101,102,105,110,101,32,95,110,97,109,101,32,119,104,105,
+-    99,104,32,116,104,101,32,115,101,99,111,110,100,32,97,114,
+-    103,117,109,101,110,116,32,105,115,10,32,32,32,32,99,111,
+-    109,112,97,114,101,100,32,97,103,97,105,110,115,116,46,32,
+-    73,102,32,116,104,101,32,99,111,109,112,97,114,105,115,111,
+-    110,32,102,97,105,108,115,32,116,104,101,110,32,73,109,112,
+-    111,114,116,69,114,114,111,114,32,105,115,32,114,97,105,115,
+-    101,100,46,10,10,32,32,32,32,99,2,0,0,0,0,0,
+-    0,0,4,0,0,0,5,0,0,0,31,0,0,0,115,83,
+-    0,0,0,124,1,0,100,0,0,107,8,0,114,24,0,124,
+-    0,0,106,1,0,125,1,0,110,40,0,124,0,0,106,1,
+-    0,124,1,0,107,3,0,114,64,0,116,2,0,100,1,0,
+-    124,1,0,22,100,2,0,124,1,0,131,1,1,130,1,0,
+-    110,0,0,136,0,0,124,0,0,124,1,0,124,2,0,124,
+-    3,0,142,2,0,83,40,3,0,0,0,78,117,23,0,0,
+-    0,108,111,97,100,101,114,32,99,97,110,110,111,116,32,104,
+-    97,110,100,108,101,32,37,115,117,4,0,0,0,110,97,109,
+-    101,40,3,0,0,0,117,4,0,0,0,78,111,110,101,117,
+-    4,0,0,0,110,97,109,101,117,11,0,0,0,73,109,112,
+-    111,114,116,69,114,114,111,114,40,4,0,0,0,117,4,0,
+-    0,0,115,101,108,102,117,4,0,0,0,110,97,109,101,117,
+-    4,0,0,0,97,114,103,115,117,6,0,0,0,107,119,97,
+-    114,103,115,40,1,0,0,0,117,6,0,0,0,109,101,116,
+-    104,111,100,40,0,0,0,0,117,29,0,0,0,60,102,114,
+-    111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,
+-    98,111,111,116,115,116,114,97,112,62,117,19,0,0,0,95,
+-    99,104,101,99,107,95,110,97,109,101,95,119,114,97,112,112,
+-    101,114,69,2,0,0,115,10,0,0,0,0,1,12,1,12,
+-    1,15,1,25,1,117,40,0,0,0,95,99,104,101,99,107,
+-    95,110,97,109,101,46,60,108,111,99,97,108,115,62,46,95,
+-    99,104,101,99,107,95,110,97,109,101,95,119,114,97,112,112,
+-    101,114,78,40,2,0,0,0,117,4,0,0,0,78,111,110,
+-    101,117,5,0,0,0,95,119,114,97,112,40,2,0,0,0,
+-    117,6,0,0,0,109,101,116,104,111,100,117,19,0,0,0,
+-    95,99,104,101,99,107,95,110,97,109,101,95,119,114,97,112,
+-    112,101,114,40,0,0,0,0,40,1,0,0,0,117,6,0,
+-    0,0,109,101,116,104,111,100,117,29,0,0,0,60,102,114,
+-    111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,
+-    98,111,111,116,115,116,114,97,112,62,117,11,0,0,0,95,
+-    99,104,101,99,107,95,110,97,109,101,61,2,0,0,115,6,
+-    0,0,0,0,8,21,6,13,1,117,11,0,0,0,95,99,
+-    104,101,99,107,95,110,97,109,101,99,1,0,0,0,0,0,
+-    0,0,2,0,0,0,3,0,0,0,3,0,0,0,115,35,
+-    0,0,0,135,0,0,102,1,0,100,1,0,100,2,0,134,
+-    0,0,125,1,0,116,0,0,124,1,0,136,0,0,131,2,
+-    0,1,124,1,0,83,40,3,0,0,0,117,49,0,0,0,
+-    68,101,99,111,114,97,116,111,114,32,116,111,32,118,101,114,
+-    105,102,121,32,116,104,101,32,110,97,109,101,100,32,109,111,
+-    100,117,108,101,32,105,115,32,98,117,105,108,116,45,105,110,
+-    46,99,2,0,0,0,0,0,0,0,2,0,0,0,4,0,
+-    0,0,19,0,0,0,115,58,0,0,0,124,1,0,116,0,
+-    0,106,1,0,107,7,0,114,45,0,116,2,0,100,1,0,
+-    106,3,0,124,1,0,131,1,0,100,2,0,124,1,0,131,
+-    1,1,130,1,0,110,0,0,136,0,0,124,0,0,124,1,
+-    0,131,2,0,83,40,3,0,0,0,78,117,27,0,0,0,
+-    123,125,32,105,115,32,110,111,116,32,97,32,98,117,105,108,
+-    116,45,105,110,32,109,111,100,117,108,101,117,4,0,0,0,
+-    110,97,109,101,40,4,0,0,0,117,3,0,0,0,115,121,
+-    115,117,20,0,0,0,98,117,105,108,116,105,110,95,109,111,
+-    100,117,108,101,95,110,97,109,101,115,117,11,0,0,0,73,
+-    109,112,111,114,116,69,114,114,111,114,117,6,0,0,0,102,
+-    111,114,109,97,116,40,2,0,0,0,117,4,0,0,0,115,
+-    101,108,102,117,8,0,0,0,102,117,108,108,110,97,109,101,
+-    40,1,0,0,0,117,3,0,0,0,102,120,110,40,0,0,
+-    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+-    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,25,0,0,0,95,114,101,113,117,105,114,
+-    101,115,95,98,117,105,108,116,105,110,95,119,114,97,112,112,
+-    101,114,81,2,0,0,115,8,0,0,0,0,1,15,1,18,
+-    1,12,1,117,52,0,0,0,95,114,101,113,117,105,114,101,
+-    115,95,98,117,105,108,116,105,110,46,60,108,111,99,97,108,
+-    115,62,46,95,114,101,113,117,105,114,101,115,95,98,117,105,
+-    108,116,105,110,95,119,114,97,112,112,101,114,40,1,0,0,
+-    0,117,5,0,0,0,95,119,114,97,112,40,2,0,0,0,
+-    117,3,0,0,0,102,120,110,117,25,0,0,0,95,114,101,
+-    113,117,105,114,101,115,95,98,117,105,108,116,105,110,95,119,
+-    114,97,112,112,101,114,40,0,0,0,0,40,1,0,0,0,
+-    117,3,0,0,0,102,120,110,117,29,0,0,0,60,102,114,
+-    111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,
+-    98,111,111,116,115,116,114,97,112,62,117,17,0,0,0,95,
+-    114,101,113,117,105,114,101,115,95,98,117,105,108,116,105,110,
+-    79,2,0,0,115,6,0,0,0,0,2,18,5,13,1,117,
+-    17,0,0,0,95,114,101,113,117,105,114,101,115,95,98,117,
+-    105,108,116,105,110,99,1,0,0,0,0,0,0,0,2,0,
+-    0,0,3,0,0,0,3,0,0,0,115,35,0,0,0,135,
+-    0,0,102,1,0,100,1,0,100,2,0,134,0,0,125,1,
+-    0,116,0,0,124,1,0,136,0,0,131,2,0,1,124,1,
+-    0,83,40,3,0,0,0,117,47,0,0,0,68,101,99,111,
+-    114,97,116,111,114,32,116,111,32,118,101,114,105,102,121,32,
+-    116,104,101,32,110,97,109,101,100,32,109,111,100,117,108,101,
+-    32,105,115,32,102,114,111,122,101,110,46,99,2,0,0,0,
+-    0,0,0,0,2,0,0,0,4,0,0,0,19,0,0,0,
+-    115,58,0,0,0,116,0,0,106,1,0,124,1,0,131,1,
+-    0,115,45,0,116,2,0,100,1,0,106,3,0,124,1,0,
+-    131,1,0,100,2,0,124,1,0,131,1,1,130,1,0,110,
+-    0,0,136,0,0,124,0,0,124,1,0,131,2,0,83,40,
+-    3,0,0,0,78,117,25,0,0,0,123,125,32,105,115,32,
+-    110,111,116,32,97,32,102,114,111,122,101,110,32,109,111,100,
+-    117,108,101,117,4,0,0,0,110,97,109,101,40,4,0,0,
+-    0,117,4,0,0,0,95,105,109,112,117,9,0,0,0,105,
+-    115,95,102,114,111,122,101,110,117,11,0,0,0,73,109,112,
+-    111,114,116,69,114,114,111,114,117,6,0,0,0,102,111,114,
+-    109,97,116,40,2,0,0,0,117,4,0,0,0,115,101,108,
+-    102,117,8,0,0,0,102,117,108,108,110,97,109,101,40,1,
+-    0,0,0,117,3,0,0,0,102,120,110,40,0,0,0,0,
++    2,0,0,0,2,0,0,0,67,0,0,0,115,16,0,0,
++    0,100,1,0,106,0,0,124,1,0,106,1,0,131,1,0,
++    83,40,2,0,0,0,78,117,24,0,0,0,60,109,111,100,
++    117,108,101,32,39,123,125,39,32,40,98,117,105,108,116,45,
++    105,110,41,62,40,2,0,0,0,117,6,0,0,0,102,111,
++    114,109,97,116,117,8,0,0,0,95,95,110,97,109,101,95,
++    95,40,2,0,0,0,117,3,0,0,0,99,108,115,117,6,
++    0,0,0,109,111,100,117,108,101,40,0,0,0,0,40,0,
++    0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,
++    105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,
++    116,114,97,112,62,117,11,0,0,0,109,111,100,117,108,101,
++    95,114,101,112,114,127,2,0,0,115,2,0,0,0,0,2,
++    117,27,0,0,0,66,117,105,108,116,105,110,73,109,112,111,
++    114,116,101,114,46,109,111,100,117,108,101,95,114,101,112,114,
++    99,3,0,0,0,0,0,0,0,3,0,0,0,2,0,0,
++    0,67,0,0,0,115,39,0,0,0,124,2,0,100,1,0,
++    107,9,0,114,16,0,100,1,0,83,116,1,0,106,2,0,
++    124,1,0,131,1,0,114,35,0,124,0,0,83,100,1,0,
++    83,40,2,0,0,0,117,113,0,0,0,70,105,110,100,32,
++    116,104,101,32,98,117,105,108,116,45,105,110,32,109,111,100,
++    117,108,101,46,10,10,32,32,32,32,32,32,32,32,73,102,
++    32,39,112,97,116,104,39,32,105,115,32,101,118,101,114,32,
++    115,112,101,99,105,102,105,101,100,32,116,104,101,110,32,116,
++    104,101,32,115,101,97,114,99,104,32,105,115,32,99,111,110,
++    115,105,100,101,114,101,100,32,97,32,102,97,105,108,117,114,
++    101,46,10,10,32,32,32,32,32,32,32,32,78,40,3,0,
++    0,0,117,4,0,0,0,78,111,110,101,117,4,0,0,0,
++    95,105,109,112,117,10,0,0,0,105,115,95,98,117,105,108,
++    116,105,110,40,3,0,0,0,117,3,0,0,0,99,108,115,
++    117,8,0,0,0,102,117,108,108,110,97,109,101,117,4,0,
++    0,0,112,97,116,104,40,0,0,0,0,40,0,0,0,0,
+     117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,
+     111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,
+-    112,62,117,24,0,0,0,95,114,101,113,117,105,114,101,115,
+-    95,102,114,111,122,101,110,95,119,114,97,112,112,101,114,92,
+-    2,0,0,115,8,0,0,0,0,1,15,1,18,1,12,1,
+-    117,50,0,0,0,95,114,101,113,117,105,114,101,115,95,102,
+-    114,111,122,101,110,46,60,108,111,99,97,108,115,62,46,95,
+-    114,101,113,117,105,114,101,115,95,102,114,111,122,101,110,95,
+-    119,114,97,112,112,101,114,40,1,0,0,0,117,5,0,0,
+-    0,95,119,114,97,112,40,2,0,0,0,117,3,0,0,0,
+-    102,120,110,117,24,0,0,0,95,114,101,113,117,105,114,101,
+-    115,95,102,114,111,122,101,110,95,119,114,97,112,112,101,114,
+-    40,0,0,0,0,40,1,0,0,0,117,3,0,0,0,102,
+-    120,110,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+-    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,16,0,0,0,95,114,101,113,117,105,114,
+-    101,115,95,102,114,111,122,101,110,90,2,0,0,115,6,0,
+-    0,0,0,2,18,5,13,1,117,16,0,0,0,95,114,101,
+-    113,117,105,114,101,115,95,102,114,111,122,101,110,99,2,0,
+-    0,0,0,0,0,0,5,0,0,0,5,0,0,0,67,0,
+-    0,0,115,87,0,0,0,124,0,0,106,0,0,124,1,0,
+-    131,1,0,92,2,0,125,2,0,125,3,0,124,2,0,100,
+-    3,0,107,8,0,114,83,0,116,2,0,124,3,0,131,1,
+-    0,114,83,0,100,1,0,125,4,0,116,3,0,106,4,0,
+-    124,4,0,106,5,0,124,3,0,100,2,0,25,131,1,0,
+-    116,6,0,131,2,0,1,110,0,0,124,2,0,83,40,4,
+-    0,0,0,117,86,0,0,0,84,114,121,32,116,111,32,102,
+-    105,110,100,32,97,32,108,111,97,100,101,114,32,102,111,114,
+-    32,116,104,101,32,115,112,101,99,105,102,105,101,100,32,109,
+-    111,100,117,108,101,32,98,121,32,100,101,108,101,103,97,116,
+-    105,110,103,32,116,111,10,32,32,32,32,115,101,108,102,46,
+-    102,105,110,100,95,108,111,97,100,101,114,40,41,46,117,44,
+-    0,0,0,78,111,116,32,105,109,112,111,114,116,105,110,103,
+-    32,100,105,114,101,99,116,111,114,121,32,123,125,58,32,109,
+-    105,115,115,105,110,103,32,95,95,105,110,105,116,95,95,105,
+-    0,0,0,0,78,40,7,0,0,0,117,11,0,0,0,102,
+-    105,110,100,95,108,111,97,100,101,114,117,4,0,0,0,78,
+-    111,110,101,117,3,0,0,0,108,101,110,117,9,0,0,0,
+-    95,119,97,114,110,105,110,103,115,117,4,0,0,0,119,97,
+-    114,110,117,6,0,0,0,102,111,114,109,97,116,117,13,0,
+-    0,0,73,109,112,111,114,116,87,97,114,110,105,110,103,40,
+-    5,0,0,0,117,4,0,0,0,115,101,108,102,117,8,0,
+-    0,0,102,117,108,108,110,97,109,101,117,6,0,0,0,108,
+-    111,97,100,101,114,117,8,0,0,0,112,111,114,116,105,111,
+-    110,115,117,3,0,0,0,109,115,103,40,0,0,0,0,40,
+-    0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
+-    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
+-    115,116,114,97,112,62,117,17,0,0,0,95,102,105,110,100,
+-    95,109,111,100,117,108,101,95,115,104,105,109,101,2,0,0,
+-    115,10,0,0,0,0,6,21,1,24,1,6,1,32,1,117,
+-    17,0,0,0,95,102,105,110,100,95,109,111,100,117,108,101,
+-    95,115,104,105,109,99,1,0,0,0,0,0,0,0,1,0,
+-    0,0,6,0,0,0,66,0,0,0,115,173,0,0,0,124,
+-    0,0,69,101,0,0,90,1,0,100,0,0,90,2,0,100,
+-    1,0,90,3,0,101,4,0,100,2,0,100,3,0,132,0,
+-    0,131,1,0,90,5,0,101,4,0,100,14,0,100,4,0,
+-    100,5,0,132,1,0,131,1,0,90,7,0,101,4,0,101,
+-    8,0,101,9,0,101,10,0,100,6,0,100,7,0,132,0,
+-    0,131,1,0,131,1,0,131,1,0,131,1,0,90,11,0,
+-    101,4,0,101,10,0,100,8,0,100,9,0,132,0,0,131,
+-    1,0,131,1,0,90,12,0,101,4,0,101,10,0,100,10,
+-    0,100,11,0,132,0,0,131,1,0,131,1,0,90,13,0,
+-    101,4,0,101,10,0,100,12,0,100,13,0,132,0,0,131,
+-    1,0,131,1,0,90,14,0,100,14,0,83,40,15,0,0,
+-    0,117,15,0,0,0,66,117,105,108,116,105,110,73,109,112,
+-    111,114,116,101,114,117,144,0,0,0,77,101,116,97,32,112,
+-    97,116,104,32,105,109,112,111,114,116,32,102,111,114,32,98,
+-    117,105,108,116,45,105,110,32,109,111,100,117,108,101,115,46,
+-    10,10,32,32,32,32,65,108,108,32,109,101,116,104,111,100,
+-    115,32,97,114,101,32,101,105,116,104,101,114,32,99,108,97,
+-    115,115,32,111,114,32,115,116,97,116,105,99,32,109,101,116,
+-    104,111,100,115,32,116,111,32,97,118,111,105,100,32,116,104,
+-    101,32,110,101,101,100,32,116,111,10,32,32,32,32,105,110,
+-    115,116,97,110,116,105,97,116,101,32,116,104,101,32,99,108,
+-    97,115,115,46,10,10,32,32,32,32,99,2,0,0,0,0,
+-    0,0,0,2,0,0,0,2,0,0,0,67,0,0,0,115,
+-    16,0,0,0,100,1,0,106,0,0,124,1,0,106,1,0,
+-    131,1,0,83,40,2,0,0,0,78,117,24,0,0,0,60,
+-    109,111,100,117,108,101,32,39,123,125,39,32,40,98,117,105,
+-    108,116,45,105,110,41,62,40,2,0,0,0,117,6,0,0,
+-    0,102,111,114,109,97,116,117,8,0,0,0,95,95,110,97,
+-    109,101,95,95,40,2,0,0,0,117,3,0,0,0,99,108,
+-    115,117,6,0,0,0,109,111,100,117,108,101,40,0,0,0,
+-    0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,
+-    101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,
+-    111,116,115,116,114,97,112,62,117,11,0,0,0,109,111,100,
+-    117,108,101,95,114,101,112,114,127,2,0,0,115,2,0,0,
+-    0,0,2,117,27,0,0,0,66,117,105,108,116,105,110,73,
+-    109,112,111,114,116,101,114,46,109,111,100,117,108,101,95,114,
+-    101,112,114,99,3,0,0,0,0,0,0,0,3,0,0,0,
+-    2,0,0,0,67,0,0,0,115,39,0,0,0,124,2,0,
+-    100,1,0,107,9,0,114,16,0,100,1,0,83,116,1,0,
+-    106,2,0,124,1,0,131,1,0,114,35,0,124,0,0,83,
+-    100,1,0,83,40,2,0,0,0,117,113,0,0,0,70,105,
+-    110,100,32,116,104,101,32,98,117,105,108,116,45,105,110,32,
+-    109,111,100,117,108,101,46,10,10,32,32,32,32,32,32,32,
+-    32,73,102,32,39,112,97,116,104,39,32,105,115,32,101,118,
+-    101,114,32,115,112,101,99,105,102,105,101,100,32,116,104,101,
+-    110,32,116,104,101,32,115,101,97,114,99,104,32,105,115,32,
+-    99,111,110,115,105,100,101,114,101,100,32,97,32,102,97,105,
+-    108,117,114,101,46,10,10,32,32,32,32,32,32,32,32,78,
+-    40,3,0,0,0,117,4,0,0,0,78,111,110,101,117,4,
+-    0,0,0,95,105,109,112,117,10,0,0,0,105,115,95,98,
++    112,62,117,11,0,0,0,102,105,110,100,95,109,111,100,117,
++    108,101,131,2,0,0,115,6,0,0,0,0,7,12,1,4,
++    1,117,27,0,0,0,66,117,105,108,116,105,110,73,109,112,
++    111,114,116,101,114,46,102,105,110,100,95,109,111,100,117,108,
++    101,99,2,0,0,0,0,0,0,0,3,0,0,0,9,0,
++    0,0,67,0,0,0,115,88,0,0,0,124,1,0,116,0,
++    0,106,1,0,107,6,0,125,2,0,121,20,0,116,2,0,
++    116,3,0,106,4,0,124,1,0,131,2,0,83,87,110,46,
++    0,1,1,1,124,2,0,12,114,76,0,124,1,0,116,0,
++    0,106,1,0,107,6,0,114,76,0,116,0,0,106,1,0,
++    124,1,0,61,110,0,0,130,0,0,89,110,1,0,88,100,
++    1,0,83,40,2,0,0,0,117,23,0,0,0,76,111,97,
++    100,32,97,32,98,117,105,108,116,45,105,110,32,109,111,100,
++    117,108,101,46,78,40,5,0,0,0,117,3,0,0,0,115,
++    121,115,117,7,0,0,0,109,111,100,117,108,101,115,117,25,
++    0,0,0,95,99,97,108,108,95,119,105,116,104,95,102,114,
++    97,109,101,115,95,114,101,109,111,118,101,100,117,4,0,0,
++    0,95,105,109,112,117,12,0,0,0,105,110,105,116,95,98,
+     117,105,108,116,105,110,40,3,0,0,0,117,3,0,0,0,
+     99,108,115,117,8,0,0,0,102,117,108,108,110,97,109,101,
+-    117,4,0,0,0,112,97,116,104,40,0,0,0,0,40,0,
+-    0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,
+-    105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,
+-    116,114,97,112,62,117,11,0,0,0,102,105,110,100,95,109,
+-    111,100,117,108,101,131,2,0,0,115,6,0,0,0,0,7,
+-    12,1,4,1,117,27,0,0,0,66,117,105,108,116,105,110,
+-    73,109,112,111,114,116,101,114,46,102,105,110,100,95,109,111,
+-    100,117,108,101,99,2,0,0,0,0,0,0,0,3,0,0,
+-    0,9,0,0,0,67,0,0,0,115,88,0,0,0,124,1,
+-    0,116,0,0,106,1,0,107,6,0,125,2,0,121,20,0,
+-    116,2,0,116,3,0,106,4,0,124,1,0,131,2,0,83,
+-    87,110,46,0,1,1,1,124,2,0,12,114,76,0,124,1,
+-    0,116,0,0,106,1,0,107,6,0,114,76,0,116,0,0,
+-    106,1,0,124,1,0,61,110,0,0,130,0,0,89,110,1,
+-    0,88,100,1,0,83,40,2,0,0,0,117,23,0,0,0,
+-    76,111,97,100,32,97,32,98,117,105,108,116,45,105,110,32,
+-    109,111,100,117,108,101,46,78,40,5,0,0,0,117,3,0,
+-    0,0,115,121,115,117,7,0,0,0,109,111,100,117,108,101,
+-    115,117,25,0,0,0,95,99,97,108,108,95,119,105,116,104,
+-    95,102,114,97,109,101,115,95,114,101,109,111,118,101,100,117,
+-    4,0,0,0,95,105,109,112,117,12,0,0,0,105,110,105,
+-    116,95,98,117,105,108,116,105,110,40,3,0,0,0,117,3,
+-    0,0,0,99,108,115,117,8,0,0,0,102,117,108,108,110,
+-    97,109,101,117,9,0,0,0,105,115,95,114,101,108,111,97,
+-    100,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
+-    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
+-    98,46,95,98,111,111,116,115,116,114,97,112,62,117,11,0,
+-    0,0,108,111,97,100,95,109,111,100,117,108,101,142,2,0,
+-    0,115,14,0,0,0,0,6,15,1,3,1,20,1,3,1,
+-    22,1,13,1,117,27,0,0,0,66,117,105,108,116,105,110,
+-    73,109,112,111,114,116,101,114,46,108,111,97,100,95,109,111,
+-    100,117,108,101,99,2,0,0,0,0,0,0,0,2,0,0,
+-    0,1,0,0,0,67,0,0,0,115,4,0,0,0,100,1,
+-    0,83,40,2,0,0,0,117,57,0,0,0,82,101,116,117,
+-    114,110,32,78,111,110,101,32,97,115,32,98,117,105,108,116,
+-    45,105,110,32,109,111,100,117,108,101,115,32,100,111,32,110,
+-    111,116,32,104,97,118,101,32,99,111,100,101,32,111,98,106,
+-    101,99,116,115,46,78,40,1,0,0,0,117,4,0,0,0,
+-    78,111,110,101,40,2,0,0,0,117,3,0,0,0,99,108,
+-    115,117,8,0,0,0,102,117,108,108,110,97,109,101,40,0,
++    117,9,0,0,0,105,115,95,114,101,108,111,97,100,40,0,
+     0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,
+     111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,
+-    98,111,111,116,115,116,114,97,112,62,117,8,0,0,0,103,
+-    101,116,95,99,111,100,101,156,2,0,0,115,2,0,0,0,
+-    0,4,117,24,0,0,0,66,117,105,108,116,105,110,73,109,
+-    112,111,114,116,101,114,46,103,101,116,95,99,111,100,101,99,
+-    2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,
+-    67,0,0,0,115,4,0,0,0,100,1,0,83,40,2,0,
+-    0,0,117,56,0,0,0,82,101,116,117,114,110,32,78,111,
+-    110,101,32,97,115,32,98,117,105,108,116,45,105,110,32,109,
+-    111,100,117,108,101,115,32,100,111,32,110,111,116,32,104,97,
+-    118,101,32,115,111,117,114,99,101,32,99,111,100,101,46,78,
+-    40,1,0,0,0,117,4,0,0,0,78,111,110,101,40,2,
+-    0,0,0,117,3,0,0,0,99,108,115,117,8,0,0,0,
+-    102,117,108,108,110,97,109,101,40,0,0,0,0,40,0,0,
+-    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+-    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,10,0,0,0,103,101,116,95,115,111,117,
+-    114,99,101,162,2,0,0,115,2,0,0,0,0,4,117,26,
+-    0,0,0,66,117,105,108,116,105,110,73,109,112,111,114,116,
+-    101,114,46,103,101,116,95,115,111,117,114,99,101,99,2,0,
+-    0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,
+-    0,0,115,4,0,0,0,100,1,0,83,40,2,0,0,0,
+-    117,52,0,0,0,82,101,116,117,114,110,32,70,97,108,115,
+-    101,32,97,115,32,98,117,105,108,116,45,105,110,32,109,111,
+-    100,117,108,101,115,32,97,114,101,32,110,101,118,101,114,32,
+-    112,97,99,107,97,103,101,115,46,70,40,1,0,0,0,117,
+-    5,0,0,0,70,97,108,115,101,40,2,0,0,0,117,3,
+-    0,0,0,99,108,115,117,8,0,0,0,102,117,108,108,110,
+-    97,109,101,40,0,0,0,0,40,0,0,0,0,117,29,0,
+-    0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,
+-    108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,
+-    10,0,0,0,105,115,95,112,97,99,107,97,103,101,168,2,
+-    0,0,115,2,0,0,0,0,4,117,26,0,0,0,66,117,
+-    105,108,116,105,110,73,109,112,111,114,116,101,114,46,105,115,
+-    95,112,97,99,107,97,103,101,78,40,15,0,0,0,117,8,
+-    0,0,0,95,95,110,97,109,101,95,95,117,10,0,0,0,
+-    95,95,109,111,100,117,108,101,95,95,117,12,0,0,0,95,
+-    95,113,117,97,108,110,97,109,101,95,95,117,7,0,0,0,
+-    95,95,100,111,99,95,95,117,11,0,0,0,99,108,97,115,
+-    115,109,101,116,104,111,100,117,11,0,0,0,109,111,100,117,
+-    108,101,95,114,101,112,114,117,4,0,0,0,78,111,110,101,
+-    117,11,0,0,0,102,105,110,100,95,109,111,100,117,108,101,
+-    117,11,0,0,0,115,101,116,95,112,97,99,107,97,103,101,
+-    117,10,0,0,0,115,101,116,95,108,111,97,100,101,114,117,
+-    17,0,0,0,95,114,101,113,117,105,114,101,115,95,98,117,
+-    105,108,116,105,110,117,11,0,0,0,108,111,97,100,95,109,
+-    111,100,117,108,101,117,8,0,0,0,103,101,116,95,99,111,
+-    100,101,117,10,0,0,0,103,101,116,95,115,111,117,114,99,
+-    101,117,10,0,0,0,105,115,95,112,97,99,107,97,103,101,
+-    40,1,0,0,0,117,10,0,0,0,95,95,108,111,99,97,
+-    108,115,95,95,40,0,0,0,0,40,0,0,0,0,117,29,
+-    0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,
+-    116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,
+-    117,15,0,0,0,66,117,105,108,116,105,110,73,109,112,111,
+-    114,116,101,114,118,2,0,0,115,28,0,0,0,16,7,6,
+-    2,18,4,3,1,18,10,3,1,3,1,3,1,27,11,3,
+-    1,21,5,3,1,21,5,3,1,117,15,0,0,0,66,117,
+-    105,108,116,105,110,73,109,112,111,114,116,101,114,99,1,0,
+-    0,0,0,0,0,0,1,0,0,0,6,0,0,0,66,0,
+-    0,0,115,173,0,0,0,124,0,0,69,101,0,0,90,1,
+-    0,100,0,0,90,2,0,100,1,0,90,3,0,101,4,0,
+-    100,2,0,100,3,0,132,0,0,131,1,0,90,5,0,101,
+-    4,0,100,14,0,100,4,0,100,5,0,132,1,0,131,1,
+-    0,90,7,0,101,4,0,101,8,0,101,9,0,101,10,0,
+-    100,6,0,100,7,0,132,0,0,131,1,0,131,1,0,131,
+-    1,0,131,1,0,90,11,0,101,4,0,101,10,0,100,8,
+-    0,100,9,0,132,0,0,131,1,0,131,1,0,90,12,0,
+-    101,4,0,101,10,0,100,10,0,100,11,0,132,0,0,131,
+-    1,0,131,1,0,90,13,0,101,4,0,101,10,0,100,12,
+-    0,100,13,0,132,0,0,131,1,0,131,1,0,90,14,0,
+-    100,14,0,83,40,15,0,0,0,117,14,0,0,0,70,114,
+-    111,122,101,110,73,109,112,111,114,116,101,114,117,142,0,0,
+-    0,77,101,116,97,32,112,97,116,104,32,105,109,112,111,114,
+-    116,32,102,111,114,32,102,114,111,122,101,110,32,109,111,100,
+-    117,108,101,115,46,10,10,32,32,32,32,65,108,108,32,109,
+-    101,116,104,111,100,115,32,97,114,101,32,101,105,116,104,101,
+-    114,32,99,108,97,115,115,32,111,114,32,115,116,97,116,105,
+-    99,32,109,101,116,104,111,100,115,32,116,111,32,97,118,111,
+-    105,100,32,116,104,101,32,110,101,101,100,32,116,111,10,32,
+-    32,32,32,105,110,115,116,97,110,116,105,97,116,101,32,116,
+-    104,101,32,99,108,97,115,115,46,10,10,32,32,32,32,99,
+-    2,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,
+-    67,0,0,0,115,16,0,0,0,100,1,0,106,0,0,124,
+-    1,0,106,1,0,131,1,0,83,40,2,0,0,0,78,117,
+-    22,0,0,0,60,109,111,100,117,108,101,32,39,123,125,39,
+-    32,40,102,114,111,122,101,110,41,62,40,2,0,0,0,117,
+-    6,0,0,0,102,111,114,109,97,116,117,8,0,0,0,95,
+-    95,110,97,109,101,95,95,40,2,0,0,0,117,3,0,0,
+-    0,99,108,115,117,1,0,0,0,109,40,0,0,0,0,40,
+-    0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
+-    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
+-    115,116,114,97,112,62,117,11,0,0,0,109,111,100,117,108,
+-    101,95,114,101,112,114,184,2,0,0,115,2,0,0,0,0,
+-    2,117,26,0,0,0,70,114,111,122,101,110,73,109,112,111,
+-    114,116,101,114,46,109,111,100,117,108,101,95,114,101,112,114,
+-    99,3,0,0,0,0,0,0,0,3,0,0,0,2,0,0,
+-    0,67,0,0,0,115,23,0,0,0,116,0,0,106,1,0,
+-    124,1,0,131,1,0,114,19,0,124,0,0,83,100,1,0,
+-    83,40,2,0,0,0,117,21,0,0,0,70,105,110,100,32,
+-    97,32,102,114,111,122,101,110,32,109,111,100,117,108,101,46,
+-    78,40,3,0,0,0,117,4,0,0,0,95,105,109,112,117,
+-    9,0,0,0,105,115,95,102,114,111,122,101,110,117,4,0,
+-    0,0,78,111,110,101,40,3,0,0,0,117,3,0,0,0,
++    98,111,111,116,115,116,114,97,112,62,117,11,0,0,0,108,
++    111,97,100,95,109,111,100,117,108,101,142,2,0,0,115,14,
++    0,0,0,0,6,15,1,3,1,20,1,3,1,22,1,13,
++    1,117,27,0,0,0,66,117,105,108,116,105,110,73,109,112,
++    111,114,116,101,114,46,108,111,97,100,95,109,111,100,117,108,
++    101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,
++    0,0,67,0,0,0,115,4,0,0,0,100,1,0,83,40,
++    2,0,0,0,117,57,0,0,0,82,101,116,117,114,110,32,
++    78,111,110,101,32,97,115,32,98,117,105,108,116,45,105,110,
++    32,109,111,100,117,108,101,115,32,100,111,32,110,111,116,32,
++    104,97,118,101,32,99,111,100,101,32,111,98,106,101,99,116,
++    115,46,78,40,1,0,0,0,117,4,0,0,0,78,111,110,
++    101,40,2,0,0,0,117,3,0,0,0,99,108,115,117,8,
++    0,0,0,102,117,108,108,110,97,109,101,40,0,0,0,0,
++    40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,
++    110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,
++    116,115,116,114,97,112,62,117,8,0,0,0,103,101,116,95,
++    99,111,100,101,156,2,0,0,115,2,0,0,0,0,4,117,
++    24,0,0,0,66,117,105,108,116,105,110,73,109,112,111,114,
++    116,101,114,46,103,101,116,95,99,111,100,101,99,2,0,0,
++    0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,0,
++    0,115,4,0,0,0,100,1,0,83,40,2,0,0,0,117,
++    56,0,0,0,82,101,116,117,114,110,32,78,111,110,101,32,
++    97,115,32,98,117,105,108,116,45,105,110,32,109,111,100,117,
++    108,101,115,32,100,111,32,110,111,116,32,104,97,118,101,32,
++    115,111,117,114,99,101,32,99,111,100,101,46,78,40,1,0,
++    0,0,117,4,0,0,0,78,111,110,101,40,2,0,0,0,
++    117,3,0,0,0,99,108,115,117,8,0,0,0,102,117,108,
++    108,110,97,109,101,40,0,0,0,0,40,0,0,0,0,117,
++    29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
++    114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
++    62,117,10,0,0,0,103,101,116,95,115,111,117,114,99,101,
++    162,2,0,0,115,2,0,0,0,0,4,117,26,0,0,0,
++    66,117,105,108,116,105,110,73,109,112,111,114,116,101,114,46,
++    103,101,116,95,115,111,117,114,99,101,99,2,0,0,0,0,
++    0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,
++    4,0,0,0,100,1,0,83,40,2,0,0,0,117,52,0,
++    0,0,82,101,116,117,114,110,32,70,97,108,115,101,32,97,
++    115,32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,
++    101,115,32,97,114,101,32,110,101,118,101,114,32,112,97,99,
++    107,97,103,101,115,46,70,40,1,0,0,0,117,5,0,0,
++    0,70,97,108,115,101,40,2,0,0,0,117,3,0,0,0,
+     99,108,115,117,8,0,0,0,102,117,108,108,110,97,109,101,
+-    117,4,0,0,0,112,97,116,104,40,0,0,0,0,40,0,
+-    0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,
+-    105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,
+-    116,114,97,112,62,117,11,0,0,0,102,105,110,100,95,109,
+-    111,100,117,108,101,188,2,0,0,115,2,0,0,0,0,3,
+-    117,26,0,0,0,70,114,111,122,101,110,73,109,112,111,114,
+-    116,101,114,46,102,105,110,100,95,109,111,100,117,108,101,99,
+-    2,0,0,0,0,0,0,0,4,0,0,0,9,0,0,0,
+-    67,0,0,0,115,100,0,0,0,124,1,0,116,0,0,106,
+-    1,0,107,6,0,125,2,0,121,32,0,116,2,0,116,3,
+-    0,106,4,0,124,1,0,131,2,0,125,3,0,124,3,0,
+-    96,5,0,124,3,0,83,87,110,46,0,1,1,1,124,2,
+-    0,12,114,88,0,124,1,0,116,0,0,106,1,0,107,6,
+-    0,114,88,0,116,0,0,106,1,0,124,1,0,61,110,0,
+-    0,130,0,0,89,110,1,0,88,100,1,0,83,40,2,0,
+-    0,0,117,21,0,0,0,76,111,97,100,32,97,32,102,114,
+-    111,122,101,110,32,109,111,100,117,108,101,46,78,40,6,0,
+-    0,0,117,3,0,0,0,115,121,115,117,7,0,0,0,109,
+-    111,100,117,108,101,115,117,25,0,0,0,95,99,97,108,108,
+-    95,119,105,116,104,95,102,114,97,109,101,115,95,114,101,109,
+-    111,118,101,100,117,4,0,0,0,95,105,109,112,117,11,0,
+-    0,0,105,110,105,116,95,102,114,111,122,101,110,117,8,0,
+-    0,0,95,95,102,105,108,101,95,95,40,4,0,0,0,117,
+-    3,0,0,0,99,108,115,117,8,0,0,0,102,117,108,108,
+-    110,97,109,101,117,9,0,0,0,105,115,95,114,101,108,111,
+-    97,100,117,1,0,0,0,109,40,0,0,0,0,40,0,0,
+-    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+-    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,11,0,0,0,108,111,97,100,95,109,111,
+-    100,117,108,101,193,2,0,0,115,18,0,0,0,0,6,15,
+-    1,3,1,18,2,6,1,8,1,3,1,22,1,13,1,117,
+-    26,0,0,0,70,114,111,122,101,110,73,109,112,111,114,116,
+-    101,114,46,108,111,97,100,95,109,111,100,117,108,101,99,2,
+-    0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,67,
+-    0,0,0,115,13,0,0,0,116,0,0,106,1,0,124,1,
+-    0,131,1,0,83,40,1,0,0,0,117,45,0,0,0,82,
+-    101,116,117,114,110,32,116,104,101,32,99,111,100,101,32,111,
+-    98,106,101,99,116,32,102,111,114,32,116,104,101,32,102,114,
+-    111,122,101,110,32,109,111,100,117,108,101,46,40,2,0,0,
+-    0,117,4,0,0,0,95,105,109,112,117,17,0,0,0,103,
+-    101,116,95,102,114,111,122,101,110,95,111,98,106,101,99,116,
+-    40,2,0,0,0,117,3,0,0,0,99,108,115,117,8,0,
+-    0,0,102,117,108,108,110,97,109,101,40,0,0,0,0,40,
+-    0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
+-    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
+-    115,116,114,97,112,62,117,8,0,0,0,103,101,116,95,99,
+-    111,100,101,210,2,0,0,115,2,0,0,0,0,4,117,23,
+-    0,0,0,70,114,111,122,101,110,73,109,112,111,114,116,101,
+-    114,46,103,101,116,95,99,111,100,101,99,2,0,0,0,0,
+-    0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,
+-    4,0,0,0,100,1,0,83,40,2,0,0,0,117,54,0,
+-    0,0,82,101,116,117,114,110,32,78,111,110,101,32,97,115,
+-    32,102,114,111,122,101,110,32,109,111,100,117,108,101,115,32,
+-    100,111,32,110,111,116,32,104,97,118,101,32,115,111,117,114,
+-    99,101,32,99,111,100,101,46,78,40,1,0,0,0,117,4,
+-    0,0,0,78,111,110,101,40,2,0,0,0,117,3,0,0,
+-    0,99,108,115,117,8,0,0,0,102,117,108,108,110,97,109,
+-    101,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
+-    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
+-    98,46,95,98,111,111,116,115,116,114,97,112,62,117,10,0,
+-    0,0,103,101,116,95,115,111,117,114,99,101,216,2,0,0,
+-    115,2,0,0,0,0,4,117,25,0,0,0,70,114,111,122,
+-    101,110,73,109,112,111,114,116,101,114,46,103,101,116,95,115,
+-    111,117,114,99,101,99,2,0,0,0,0,0,0,0,2,0,
+-    0,0,2,0,0,0,67,0,0,0,115,13,0,0,0,116,
+-    0,0,106,1,0,124,1,0,131,1,0,83,40,1,0,0,
+-    0,117,46,0,0,0,82,101,116,117,114,110,32,84,114,117,
+-    101,32,105,102,32,116,104,101,32,102,114,111,122,101,110,32,
+-    109,111,100,117,108,101,32,105,115,32,97,32,112,97,99,107,
+-    97,103,101,46,40,2,0,0,0,117,4,0,0,0,95,105,
+-    109,112,117,17,0,0,0,105,115,95,102,114,111,122,101,110,
+-    95,112,97,99,107,97,103,101,40,2,0,0,0,117,3,0,
+-    0,0,99,108,115,117,8,0,0,0,102,117,108,108,110,97,
+-    109,101,40,0,0,0,0,40,0,0,0,0,117,29,0,0,
+-    0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,
+-    105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,10,
+-    0,0,0,105,115,95,112,97,99,107,97,103,101,222,2,0,
+-    0,115,2,0,0,0,0,4,117,25,0,0,0,70,114,111,
+-    122,101,110,73,109,112,111,114,116,101,114,46,105,115,95,112,
+-    97,99,107,97,103,101,78,40,15,0,0,0,117,8,0,0,
+-    0,95,95,110,97,109,101,95,95,117,10,0,0,0,95,95,
+-    109,111,100,117,108,101,95,95,117,12,0,0,0,95,95,113,
+-    117,97,108,110,97,109,101,95,95,117,7,0,0,0,95,95,
+-    100,111,99,95,95,117,11,0,0,0,99,108,97,115,115,109,
+-    101,116,104,111,100,117,11,0,0,0,109,111,100,117,108,101,
+-    95,114,101,112,114,117,4,0,0,0,78,111,110,101,117,11,
+-    0,0,0,102,105,110,100,95,109,111,100,117,108,101,117,11,
+-    0,0,0,115,101,116,95,112,97,99,107,97,103,101,117,10,
+-    0,0,0,115,101,116,95,108,111,97,100,101,114,117,16,0,
+-    0,0,95,114,101,113,117,105,114,101,115,95,102,114,111,122,
+-    101,110,117,11,0,0,0,108,111,97,100,95,109,111,100,117,
++    40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,
++    102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,
++    46,95,98,111,111,116,115,116,114,97,112,62,117,10,0,0,
++    0,105,115,95,112,97,99,107,97,103,101,168,2,0,0,115,
++    2,0,0,0,0,4,117,26,0,0,0,66,117,105,108,116,
++    105,110,73,109,112,111,114,116,101,114,46,105,115,95,112,97,
++    99,107,97,103,101,78,40,15,0,0,0,117,8,0,0,0,
++    95,95,110,97,109,101,95,95,117,10,0,0,0,95,95,109,
++    111,100,117,108,101,95,95,117,12,0,0,0,95,95,113,117,
++    97,108,110,97,109,101,95,95,117,7,0,0,0,95,95,100,
++    111,99,95,95,117,11,0,0,0,99,108,97,115,115,109,101,
++    116,104,111,100,117,11,0,0,0,109,111,100,117,108,101,95,
++    114,101,112,114,117,4,0,0,0,78,111,110,101,117,11,0,
++    0,0,102,105,110,100,95,109,111,100,117,108,101,117,11,0,
++    0,0,115,101,116,95,112,97,99,107,97,103,101,117,10,0,
++    0,0,115,101,116,95,108,111,97,100,101,114,117,17,0,0,
++    0,95,114,101,113,117,105,114,101,115,95,98,117,105,108,116,
++    105,110,117,11,0,0,0,108,111,97,100,95,109,111,100,117,
+     108,101,117,8,0,0,0,103,101,116,95,99,111,100,101,117,
+     10,0,0,0,103,101,116,95,115,111,117,114,99,101,117,10,
+     0,0,0,105,115,95,112,97,99,107,97,103,101,40,1,0,
+     0,0,117,10,0,0,0,95,95,108,111,99,97,108,115,95,
+     95,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
+     60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
+-    98,46,95,98,111,111,116,115,116,114,97,112,62,117,14,0,
+-    0,0,70,114,111,122,101,110,73,109,112,111,114,116,101,114,
+-    175,2,0,0,115,28,0,0,0,16,7,6,2,18,4,3,
+-    1,18,4,3,1,3,1,3,1,27,14,3,1,21,5,3,
+-    1,21,5,3,1,117,14,0,0,0,70,114,111,122,101,110,
+-    73,109,112,111,114,116,101,114,99,1,0,0,0,0,0,0,
+-    0,1,0,0,0,4,0,0,0,66,0,0,0,115,101,0,
+-    0,0,124,0,0,69,101,0,0,90,1,0,100,0,0,90,
+-    2,0,100,1,0,90,3,0,100,2,0,90,4,0,100,3,
+-    0,90,5,0,100,11,0,90,7,0,101,8,0,100,4,0,
+-    100,5,0,132,0,0,131,1,0,90,9,0,101,8,0,100,
+-    6,0,100,7,0,132,0,0,131,1,0,90,10,0,101,8,
+-    0,100,10,0,100,8,0,100,9,0,132,1,0,131,1,0,
+-    90,12,0,100,10,0,83,40,12,0,0,0,117,21,0,0,
+-    0,87,105,110,100,111,119,115,82,101,103,105,115,116,114,121,
+-    70,105,110,100,101,114,117,67,0,0,0,77,101,116,97,32,
+-    112,97,116,104,32,102,105,110,100,101,114,32,102,111,114,32,
+-    109,111,100,117,108,101,115,32,100,101,99,108,97,114,101,100,
+-    32,105,110,32,116,104,101,32,87,105,110,100,111,119,115,32,
+-    114,101,103,105,115,116,114,121,46,10,32,32,32,32,117,59,
+-    0,0,0,83,111,102,116,119,97,114,101,92,80,121,116,104,
+-    111,110,92,80,121,116,104,111,110,67,111,114,101,92,123,115,
+-    121,115,95,118,101,114,115,105,111,110,125,92,77,111,100,117,
+-    108,101,115,92,123,102,117,108,108,110,97,109,101,125,117,65,
+-    0,0,0,83,111,102,116,119,97,114,101,92,80,121,116,104,
+-    111,110,92,80,121,116,104,111,110,67,111,114,101,92,123,115,
+-    121,115,95,118,101,114,115,105,111,110,125,92,77,111,100,117,
+-    108,101,115,92,123,102,117,108,108,110,97,109,101,125,92,68,
+-    101,98,117,103,99,2,0,0,0,0,0,0,0,2,0,0,
+-    0,11,0,0,0,67,0,0,0,115,67,0,0,0,121,23,
+-    0,116,0,0,106,1,0,116,0,0,106,2,0,124,1,0,
+-    131,2,0,83,87,110,37,0,4,116,3,0,107,10,0,114,
+-    62,0,1,1,1,116,0,0,106,1,0,116,0,0,106,4,
+-    0,124,1,0,131,2,0,83,89,110,1,0,88,100,0,0,
+-    83,40,1,0,0,0,78,40,5,0,0,0,117,7,0,0,
+-    0,95,119,105,110,114,101,103,117,7,0,0,0,79,112,101,
+-    110,75,101,121,117,17,0,0,0,72,75,69,89,95,67,85,
+-    82,82,69,78,84,95,85,83,69,82,117,12,0,0,0,87,
+-    105,110,100,111,119,115,69,114,114,111,114,117,18,0,0,0,
+-    72,75,69,89,95,76,79,67,65,76,95,77,65,67,72,73,
+-    78,69,40,2,0,0,0,117,3,0,0,0,99,108,115,117,
+-    3,0,0,0,107,101,121,40,0,0,0,0,40,0,0,0,
++    98,46,95,98,111,111,116,115,116,114,97,112,62,117,15,0,
++    0,0,66,117,105,108,116,105,110,73,109,112,111,114,116,101,
++    114,118,2,0,0,115,28,0,0,0,16,7,6,2,18,4,
++    3,1,18,10,3,1,3,1,3,1,27,11,3,1,21,5,
++    3,1,21,5,3,1,117,15,0,0,0,66,117,105,108,116,
++    105,110,73,109,112,111,114,116,101,114,99,1,0,0,0,0,
++    0,0,0,1,0,0,0,6,0,0,0,66,0,0,0,115,
++    173,0,0,0,124,0,0,69,101,0,0,90,1,0,100,0,
++    0,90,2,0,100,1,0,90,3,0,101,4,0,100,2,0,
++    100,3,0,132,0,0,131,1,0,90,5,0,101,4,0,100,
++    14,0,100,4,0,100,5,0,132,1,0,131,1,0,90,7,
++    0,101,4,0,101,8,0,101,9,0,101,10,0,100,6,0,
++    100,7,0,132,0,0,131,1,0,131,1,0,131,1,0,131,
++    1,0,90,11,0,101,4,0,101,10,0,100,8,0,100,9,
++    0,132,0,0,131,1,0,131,1,0,90,12,0,101,4,0,
++    101,10,0,100,10,0,100,11,0,132,0,0,131,1,0,131,
++    1,0,90,13,0,101,4,0,101,10,0,100,12,0,100,13,
++    0,132,0,0,131,1,0,131,1,0,90,14,0,100,14,0,
++    83,40,15,0,0,0,117,14,0,0,0,70,114,111,122,101,
++    110,73,109,112,111,114,116,101,114,117,142,0,0,0,77,101,
++    116,97,32,112,97,116,104,32,105,109,112,111,114,116,32,102,
++    111,114,32,102,114,111,122,101,110,32,109,111,100,117,108,101,
++    115,46,10,10,32,32,32,32,65,108,108,32,109,101,116,104,
++    111,100,115,32,97,114,101,32,101,105,116,104,101,114,32,99,
++    108,97,115,115,32,111,114,32,115,116,97,116,105,99,32,109,
++    101,116,104,111,100,115,32,116,111,32,97,118,111,105,100,32,
++    116,104,101,32,110,101,101,100,32,116,111,10,32,32,32,32,
++    105,110,115,116,97,110,116,105,97,116,101,32,116,104,101,32,
++    99,108,97,115,115,46,10,10,32,32,32,32,99,2,0,0,
++    0,0,0,0,0,2,0,0,0,2,0,0,0,67,0,0,
++    0,115,16,0,0,0,100,1,0,106,0,0,124,1,0,106,
++    1,0,131,1,0,83,40,2,0,0,0,78,117,22,0,0,
++    0,60,109,111,100,117,108,101,32,39,123,125,39,32,40,102,
++    114,111,122,101,110,41,62,40,2,0,0,0,117,6,0,0,
++    0,102,111,114,109,97,116,117,8,0,0,0,95,95,110,97,
++    109,101,95,95,40,2,0,0,0,117,3,0,0,0,99,108,
++    115,117,1,0,0,0,109,40,0,0,0,0,40,0,0,0,
+     0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,
+     112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,
+-    97,112,62,117,14,0,0,0,95,111,112,101,110,95,114,101,
+-    103,105,115,116,114,121,242,2,0,0,115,8,0,0,0,0,
+-    2,3,1,23,1,13,1,117,36,0,0,0,87,105,110,100,
+-    111,119,115,82,101,103,105,115,116,114,121,70,105,110,100,101,
+-    114,46,95,111,112,101,110,95,114,101,103,105,115,116,114,121,
+-    99,2,0,0,0,0,0,0,0,6,0,0,0,16,0,0,
+-    0,67,0,0,0,115,142,0,0,0,124,0,0,106,0,0,
+-    114,21,0,124,0,0,106,1,0,125,2,0,110,9,0,124,
+-    0,0,106,2,0,125,2,0,124,2,0,106,3,0,100,1,
+-    0,124,1,0,100,2,0,116,4,0,106,5,0,100,0,0,
+-    100,3,0,133,2,0,25,131,0,2,125,3,0,121,46,0,
+-    124,0,0,106,6,0,124,3,0,131,1,0,143,25,0,125,
+-    4,0,116,7,0,106,8,0,124,4,0,100,4,0,131,2,
+-    0,125,5,0,87,100,0,0,81,88,87,110,22,0,4,116,
+-    9,0,107,10,0,114,137,0,1,1,1,100,0,0,83,89,
+-    110,1,0,88,124,5,0,83,40,5,0,0,0,78,117,8,
+-    0,0,0,102,117,108,108,110,97,109,101,117,11,0,0,0,
+-    115,121,115,95,118,101,114,115,105,111,110,105,3,0,0,0,
+-    117,0,0,0,0,40,11,0,0,0,117,11,0,0,0,68,
+-    69,66,85,71,95,66,85,73,76,68,117,18,0,0,0,82,
+-    69,71,73,83,84,82,89,95,75,69,89,95,68,69,66,85,
+-    71,117,12,0,0,0,82,69,71,73,83,84,82,89,95,75,
+-    69,89,117,6,0,0,0,102,111,114,109,97,116,117,3,0,
+-    0,0,115,121,115,117,7,0,0,0,118,101,114,115,105,111,
+-    110,117,14,0,0,0,95,111,112,101,110,95,114,101,103,105,
+-    115,116,114,121,117,7,0,0,0,95,119,105,110,114,101,103,
+-    117,10,0,0,0,81,117,101,114,121,86,97,108,117,101,117,
+-    12,0,0,0,87,105,110,100,111,119,115,69,114,114,111,114,
+-    117,4,0,0,0,78,111,110,101,40,6,0,0,0,117,3,
+-    0,0,0,99,108,115,117,8,0,0,0,102,117,108,108,110,
+-    97,109,101,117,12,0,0,0,114,101,103,105,115,116,114,121,
+-    95,107,101,121,117,3,0,0,0,107,101,121,117,4,0,0,
+-    0,104,107,101,121,117,8,0,0,0,102,105,108,101,112,97,
+-    116,104,40,0,0,0,0,40,0,0,0,0,117,29,0,0,
+-    0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,
+-    105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,16,
+-    0,0,0,95,115,101,97,114,99,104,95,114,101,103,105,115,
+-    116,114,121,249,2,0,0,115,22,0,0,0,0,2,9,1,
+-    12,2,9,1,15,1,22,1,3,1,18,1,28,1,13,1,
+-    9,1,117,38,0,0,0,87,105,110,100,111,119,115,82,101,
+-    103,105,115,116,114,121,70,105,110,100,101,114,46,95,115,101,
+-    97,114,99,104,95,114,101,103,105,115,116,114,121,99,3,0,
+-    0,0,0,0,0,0,7,0,0,0,12,0,0,0,67,0,
+-    0,0,115,140,0,0,0,124,0,0,106,0,0,124,1,0,
+-    131,1,0,125,3,0,124,3,0,100,1,0,107,8,0,114,
+-    31,0,100,1,0,83,121,17,0,116,2,0,106,3,0,124,
+-    3,0,131,1,0,1,87,110,22,0,4,116,4,0,107,10,
+-    0,114,72,0,1,1,1,100,1,0,83,89,110,1,0,88,
+-    120,60,0,116,5,0,131,0,0,68,93,49,0,92,3,0,
+-    125,4,0,125,5,0,125,6,0,124,3,0,106,6,0,116,
+-    7,0,124,5,0,131,1,0,131,1,0,114,83,0,124,4,
+-    0,124,1,0,124,3,0,131,2,0,83,113,83,0,87,100,
+-    1,0,83,40,2,0,0,0,117,34,0,0,0,70,105,110,
+-    100,32,109,111,100,117,108,101,32,110,97,109,101,100,32,105,
+-    110,32,116,104,101,32,114,101,103,105,115,116,114,121,46,78,
+-    40,8,0,0,0,117,16,0,0,0,95,115,101,97,114,99,
+-    104,95,114,101,103,105,115,116,114,121,117,4,0,0,0,78,
+-    111,110,101,117,3,0,0,0,95,111,115,117,4,0,0,0,
+-    115,116,97,116,117,7,0,0,0,79,83,69,114,114,111,114,
+-    117,27,0,0,0,95,103,101,116,95,115,117,112,112,111,114,
+-    116,101,100,95,102,105,108,101,95,108,111,97,100,101,114,115,
+-    117,8,0,0,0,101,110,100,115,119,105,116,104,117,5,0,
+-    0,0,116,117,112,108,101,40,7,0,0,0,117,3,0,0,
++    97,112,62,117,11,0,0,0,109,111,100,117,108,101,95,114,
++    101,112,114,184,2,0,0,115,2,0,0,0,0,2,117,26,
++    0,0,0,70,114,111,122,101,110,73,109,112,111,114,116,101,
++    114,46,109,111,100,117,108,101,95,114,101,112,114,99,3,0,
++    0,0,0,0,0,0,3,0,0,0,2,0,0,0,67,0,
++    0,0,115,23,0,0,0,116,0,0,106,1,0,124,1,0,
++    131,1,0,114,19,0,124,0,0,83,100,1,0,83,40,2,
++    0,0,0,117,21,0,0,0,70,105,110,100,32,97,32,102,
++    114,111,122,101,110,32,109,111,100,117,108,101,46,78,40,3,
++    0,0,0,117,4,0,0,0,95,105,109,112,117,9,0,0,
++    0,105,115,95,102,114,111,122,101,110,117,4,0,0,0,78,
++    111,110,101,40,3,0,0,0,117,3,0,0,0,99,108,115,
++    117,8,0,0,0,102,117,108,108,110,97,109,101,117,4,0,
++    0,0,112,97,116,104,40,0,0,0,0,40,0,0,0,0,
++    117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,
++    111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,
++    112,62,117,11,0,0,0,102,105,110,100,95,109,111,100,117,
++    108,101,188,2,0,0,115,2,0,0,0,0,3,117,26,0,
++    0,0,70,114,111,122,101,110,73,109,112,111,114,116,101,114,
++    46,102,105,110,100,95,109,111,100,117,108,101,99,2,0,0,
++    0,0,0,0,0,4,0,0,0,9,0,0,0,67,0,0,
++    0,115,100,0,0,0,124,1,0,116,0,0,106,1,0,107,
++    6,0,125,2,0,121,32,0,116,2,0,116,3,0,106,4,
++    0,124,1,0,131,2,0,125,3,0,124,3,0,96,5,0,
++    124,3,0,83,87,110,46,0,1,1,1,124,2,0,12,114,
++    88,0,124,1,0,116,0,0,106,1,0,107,6,0,114,88,
++    0,116,0,0,106,1,0,124,1,0,61,110,0,0,130,0,
++    0,89,110,1,0,88,100,1,0,83,40,2,0,0,0,117,
++    21,0,0,0,76,111,97,100,32,97,32,102,114,111,122,101,
++    110,32,109,111,100,117,108,101,46,78,40,6,0,0,0,117,
++    3,0,0,0,115,121,115,117,7,0,0,0,109,111,100,117,
++    108,101,115,117,25,0,0,0,95,99,97,108,108,95,119,105,
++    116,104,95,102,114,97,109,101,115,95,114,101,109,111,118,101,
++    100,117,4,0,0,0,95,105,109,112,117,11,0,0,0,105,
++    110,105,116,95,102,114,111,122,101,110,117,8,0,0,0,95,
++    95,102,105,108,101,95,95,40,4,0,0,0,117,3,0,0,
+     0,99,108,115,117,8,0,0,0,102,117,108,108,110,97,109,
+-    101,117,4,0,0,0,112,97,116,104,117,8,0,0,0,102,
+-    105,108,101,112,97,116,104,117,6,0,0,0,108,111,97,100,
+-    101,114,117,8,0,0,0,115,117,102,102,105,120,101,115,117,
+-    1,0,0,0,95,40,0,0,0,0,40,0,0,0,0,117,
++    101,117,9,0,0,0,105,115,95,114,101,108,111,97,100,117,
++    1,0,0,0,109,40,0,0,0,0,40,0,0,0,0,117,
+     29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
+     114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
+-    62,117,11,0,0,0,102,105,110,100,95,109,111,100,117,108,
+-    101,8,3,0,0,115,20,0,0,0,0,3,15,1,12,1,
+-    4,1,3,1,17,1,13,1,9,1,25,1,21,1,117,33,
+-    0,0,0,87,105,110,100,111,119,115,82,101,103,105,115,116,
+-    114,121,70,105,110,100,101,114,46,102,105,110,100,95,109,111,
+-    100,117,108,101,78,70,40,13,0,0,0,117,8,0,0,0,
+-    95,95,110,97,109,101,95,95,117,10,0,0,0,95,95,109,
+-    111,100,117,108,101,95,95,117,12,0,0,0,95,95,113,117,
+-    97,108,110,97,109,101,95,95,117,7,0,0,0,95,95,100,
+-    111,99,95,95,117,12,0,0,0,82,69,71,73,83,84,82,
+-    89,95,75,69,89,117,18,0,0,0,82,69,71,73,83,84,
+-    82,89,95,75,69,89,95,68,69,66,85,71,117,5,0,0,
+-    0,70,97,108,115,101,117,11,0,0,0,68,69,66,85,71,
+-    95,66,85,73,76,68,117,11,0,0,0,99,108,97,115,115,
+-    109,101,116,104,111,100,117,14,0,0,0,95,111,112,101,110,
+-    95,114,101,103,105,115,116,114,121,117,16,0,0,0,95,115,
+-    101,97,114,99,104,95,114,101,103,105,115,116,114,121,117,4,
+-    0,0,0,78,111,110,101,117,11,0,0,0,102,105,110,100,
++    62,117,11,0,0,0,108,111,97,100,95,109,111,100,117,108,
++    101,193,2,0,0,115,18,0,0,0,0,6,15,1,3,1,
++    18,2,6,1,8,1,3,1,22,1,13,1,117,26,0,0,
++    0,70,114,111,122,101,110,73,109,112,111,114,116,101,114,46,
++    108,111,97,100,95,109,111,100,117,108,101,99,2,0,0,0,
++    0,0,0,0,2,0,0,0,2,0,0,0,67,0,0,0,
++    115,13,0,0,0,116,0,0,106,1,0,124,1,0,131,1,
++    0,83,40,1,0,0,0,117,45,0,0,0,82,101,116,117,
++    114,110,32,116,104,101,32,99,111,100,101,32,111,98,106,101,
++    99,116,32,102,111,114,32,116,104,101,32,102,114,111,122,101,
++    110,32,109,111,100,117,108,101,46,40,2,0,0,0,117,4,
++    0,0,0,95,105,109,112,117,17,0,0,0,103,101,116,95,
++    102,114,111,122,101,110,95,111,98,106,101,99,116,40,2,0,
++    0,0,117,3,0,0,0,99,108,115,117,8,0,0,0,102,
++    117,108,108,110,97,109,101,40,0,0,0,0,40,0,0,0,
++    0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,
++    112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,
++    97,112,62,117,8,0,0,0,103,101,116,95,99,111,100,101,
++    210,2,0,0,115,2,0,0,0,0,4,117,23,0,0,0,
++    70,114,111,122,101,110,73,109,112,111,114,116,101,114,46,103,
++    101,116,95,99,111,100,101,99,2,0,0,0,0,0,0,0,
++    2,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0,
++    0,100,1,0,83,40,2,0,0,0,117,54,0,0,0,82,
++    101,116,117,114,110,32,78,111,110,101,32,97,115,32,102,114,
++    111,122,101,110,32,109,111,100,117,108,101,115,32,100,111,32,
++    110,111,116,32,104,97,118,101,32,115,111,117,114,99,101,32,
++    99,111,100,101,46,78,40,1,0,0,0,117,4,0,0,0,
++    78,111,110,101,40,2,0,0,0,117,3,0,0,0,99,108,
++    115,117,8,0,0,0,102,117,108,108,110,97,109,101,40,0,
++    0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,
++    111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,
++    98,111,111,116,115,116,114,97,112,62,117,10,0,0,0,103,
++    101,116,95,115,111,117,114,99,101,216,2,0,0,115,2,0,
++    0,0,0,4,117,25,0,0,0,70,114,111,122,101,110,73,
++    109,112,111,114,116,101,114,46,103,101,116,95,115,111,117,114,
++    99,101,99,2,0,0,0,0,0,0,0,2,0,0,0,2,
++    0,0,0,67,0,0,0,115,13,0,0,0,116,0,0,106,
++    1,0,124,1,0,131,1,0,83,40,1,0,0,0,117,46,
++    0,0,0,82,101,116,117,114,110,32,84,114,117,101,32,105,
++    102,32,116,104,101,32,102,114,111,122,101,110,32,109,111,100,
++    117,108,101,32,105,115,32,97,32,112,97,99,107,97,103,101,
++    46,40,2,0,0,0,117,4,0,0,0,95,105,109,112,117,
++    17,0,0,0,105,115,95,102,114,111,122,101,110,95,112,97,
++    99,107,97,103,101,40,2,0,0,0,117,3,0,0,0,99,
++    108,115,117,8,0,0,0,102,117,108,108,110,97,109,101,40,
++    0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,
++    114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,
++    95,98,111,111,116,115,116,114,97,112,62,117,10,0,0,0,
++    105,115,95,112,97,99,107,97,103,101,222,2,0,0,115,2,
++    0,0,0,0,4,117,25,0,0,0,70,114,111,122,101,110,
++    73,109,112,111,114,116,101,114,46,105,115,95,112,97,99,107,
++    97,103,101,78,40,15,0,0,0,117,8,0,0,0,95,95,
++    110,97,109,101,95,95,117,10,0,0,0,95,95,109,111,100,
++    117,108,101,95,95,117,12,0,0,0,95,95,113,117,97,108,
++    110,97,109,101,95,95,117,7,0,0,0,95,95,100,111,99,
++    95,95,117,11,0,0,0,99,108,97,115,115,109,101,116,104,
++    111,100,117,11,0,0,0,109,111,100,117,108,101,95,114,101,
++    112,114,117,4,0,0,0,78,111,110,101,117,11,0,0,0,
++    102,105,110,100,95,109,111,100,117,108,101,117,11,0,0,0,
++    115,101,116,95,112,97,99,107,97,103,101,117,10,0,0,0,
++    115,101,116,95,108,111,97,100,101,114,117,16,0,0,0,95,
++    114,101,113,117,105,114,101,115,95,102,114,111,122,101,110,117,
++    11,0,0,0,108,111,97,100,95,109,111,100,117,108,101,117,
++    8,0,0,0,103,101,116,95,99,111,100,101,117,10,0,0,
++    0,103,101,116,95,115,111,117,114,99,101,117,10,0,0,0,
++    105,115,95,112,97,99,107,97,103,101,40,1,0,0,0,117,
++    10,0,0,0,95,95,108,111,99,97,108,115,95,95,40,0,
++    0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,
++    111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,
++    98,111,111,116,115,116,114,97,112,62,117,14,0,0,0,70,
++    114,111,122,101,110,73,109,112,111,114,116,101,114,175,2,0,
++    0,115,28,0,0,0,16,7,6,2,18,4,3,1,18,4,
++    3,1,3,1,3,1,27,14,3,1,21,5,3,1,21,5,
++    3,1,117,14,0,0,0,70,114,111,122,101,110,73,109,112,
++    111,114,116,101,114,99,1,0,0,0,0,0,0,0,1,0,
++    0,0,4,0,0,0,66,0,0,0,115,101,0,0,0,124,
++    0,0,69,101,0,0,90,1,0,100,0,0,90,2,0,100,
++    1,0,90,3,0,100,2,0,90,4,0,100,3,0,90,5,
++    0,100,11,0,90,7,0,101,8,0,100,4,0,100,5,0,
++    132,0,0,131,1,0,90,9,0,101,8,0,100,6,0,100,
++    7,0,132,0,0,131,1,0,90,10,0,101,8,0,100,10,
++    0,100,8,0,100,9,0,132,1,0,131,1,0,90,12,0,
++    100,10,0,83,40,12,0,0,0,117,21,0,0,0,87,105,
++    110,100,111,119,115,82,101,103,105,115,116,114,121,70,105,110,
++    100,101,114,117,67,0,0,0,77,101,116,97,32,112,97,116,
++    104,32,102,105,110,100,101,114,32,102,111,114,32,109,111,100,
++    117,108,101,115,32,100,101,99,108,97,114,101,100,32,105,110,
++    32,116,104,101,32,87,105,110,100,111,119,115,32,114,101,103,
++    105,115,116,114,121,46,10,32,32,32,32,117,59,0,0,0,
++    83,111,102,116,119,97,114,101,92,80,121,116,104,111,110,92,
++    80,121,116,104,111,110,67,111,114,101,92,123,115,121,115,95,
++    118,101,114,115,105,111,110,125,92,77,111,100,117,108,101,115,
++    92,123,102,117,108,108,110,97,109,101,125,117,65,0,0,0,
++    83,111,102,116,119,97,114,101,92,80,121,116,104,111,110,92,
++    80,121,116,104,111,110,67,111,114,101,92,123,115,121,115,95,
++    118,101,114,115,105,111,110,125,92,77,111,100,117,108,101,115,
++    92,123,102,117,108,108,110,97,109,101,125,92,68,101,98,117,
++    103,99,2,0,0,0,0,0,0,0,2,0,0,0,11,0,
++    0,0,67,0,0,0,115,67,0,0,0,121,23,0,116,0,
++    0,106,1,0,116,0,0,106,2,0,124,1,0,131,2,0,
++    83,87,110,37,0,4,116,3,0,107,10,0,114,62,0,1,
++    1,1,116,0,0,106,1,0,116,0,0,106,4,0,124,1,
++    0,131,2,0,83,89,110,1,0,88,100,0,0,83,40,1,
++    0,0,0,78,40,5,0,0,0,117,7,0,0,0,95,119,
++    105,110,114,101,103,117,7,0,0,0,79,112,101,110,75,101,
++    121,117,17,0,0,0,72,75,69,89,95,67,85,82,82,69,
++    78,84,95,85,83,69,82,117,12,0,0,0,87,105,110,100,
++    111,119,115,69,114,114,111,114,117,18,0,0,0,72,75,69,
++    89,95,76,79,67,65,76,95,77,65,67,72,73,78,69,40,
++    2,0,0,0,117,3,0,0,0,99,108,115,117,3,0,0,
++    0,107,101,121,40,0,0,0,0,40,0,0,0,0,117,29,
++    0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,
++    116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,
++    117,14,0,0,0,95,111,112,101,110,95,114,101,103,105,115,
++    116,114,121,242,2,0,0,115,8,0,0,0,0,2,3,1,
++    23,1,13,1,117,36,0,0,0,87,105,110,100,111,119,115,
++    82,101,103,105,115,116,114,121,70,105,110,100,101,114,46,95,
++    111,112,101,110,95,114,101,103,105,115,116,114,121,99,2,0,
++    0,0,0,0,0,0,6,0,0,0,16,0,0,0,67,0,
++    0,0,115,142,0,0,0,124,0,0,106,0,0,114,21,0,
++    124,0,0,106,1,0,125,2,0,110,9,0,124,0,0,106,
++    2,0,125,2,0,124,2,0,106,3,0,100,1,0,124,1,
++    0,100,2,0,116,4,0,106,5,0,100,0,0,100,3,0,
++    133,2,0,25,131,0,2,125,3,0,121,46,0,124,0,0,
++    106,6,0,124,3,0,131,1,0,143,25,0,125,4,0,116,
++    7,0,106,8,0,124,4,0,100,4,0,131,2,0,125,5,
++    0,87,100,0,0,81,88,87,110,22,0,4,116,9,0,107,
++    10,0,114,137,0,1,1,1,100,0,0,83,89,110,1,0,
++    88,124,5,0,83,40,5,0,0,0,78,117,8,0,0,0,
++    102,117,108,108,110,97,109,101,117,11,0,0,0,115,121,115,
++    95,118,101,114,115,105,111,110,105,3,0,0,0,117,0,0,
++    0,0,40,11,0,0,0,117,11,0,0,0,68,69,66,85,
++    71,95,66,85,73,76,68,117,18,0,0,0,82,69,71,73,
++    83,84,82,89,95,75,69,89,95,68,69,66,85,71,117,12,
++    0,0,0,82,69,71,73,83,84,82,89,95,75,69,89,117,
++    6,0,0,0,102,111,114,109,97,116,117,3,0,0,0,115,
++    121,115,117,7,0,0,0,118,101,114,115,105,111,110,117,14,
++    0,0,0,95,111,112,101,110,95,114,101,103,105,115,116,114,
++    121,117,7,0,0,0,95,119,105,110,114,101,103,117,10,0,
++    0,0,81,117,101,114,121,86,97,108,117,101,117,12,0,0,
++    0,87,105,110,100,111,119,115,69,114,114,111,114,117,4,0,
++    0,0,78,111,110,101,40,6,0,0,0,117,3,0,0,0,
++    99,108,115,117,8,0,0,0,102,117,108,108,110,97,109,101,
++    117,12,0,0,0,114,101,103,105,115,116,114,121,95,107,101,
++    121,117,3,0,0,0,107,101,121,117,4,0,0,0,104,107,
++    101,121,117,8,0,0,0,102,105,108,101,112,97,116,104,40,
++    0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,
++    114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,
++    95,98,111,111,116,115,116,114,97,112,62,117,16,0,0,0,
++    95,115,101,97,114,99,104,95,114,101,103,105,115,116,114,121,
++    249,2,0,0,115,22,0,0,0,0,2,9,1,12,2,9,
++    1,15,1,22,1,3,1,18,1,28,1,13,1,9,1,117,
++    38,0,0,0,87,105,110,100,111,119,115,82,101,103,105,115,
++    116,114,121,70,105,110,100,101,114,46,95,115,101,97,114,99,
++    104,95,114,101,103,105,115,116,114,121,99,3,0,0,0,0,
++    0,0,0,7,0,0,0,12,0,0,0,67,0,0,0,115,
++    140,0,0,0,124,0,0,106,0,0,124,1,0,131,1,0,
++    125,3,0,124,3,0,100,1,0,107,8,0,114,31,0,100,
++    1,0,83,121,17,0,116,2,0,106,3,0,124,3,0,131,
++    1,0,1,87,110,22,0,4,116,4,0,107,10,0,114,72,
++    0,1,1,1,100,1,0,83,89,110,1,0,88,120,60,0,
++    116,5,0,131,0,0,68,93,49,0,92,3,0,125,4,0,
++    125,5,0,125,6,0,124,3,0,106,6,0,116,7,0,124,
++    5,0,131,1,0,131,1,0,114,83,0,124,4,0,124,1,
++    0,124,3,0,131,2,0,83,113,83,0,87,100,1,0,83,
++    40,2,0,0,0,117,34,0,0,0,70,105,110,100,32,109,
++    111,100,117,108,101,32,110,97,109,101,100,32,105,110,32,116,
++    104,101,32,114,101,103,105,115,116,114,121,46,78,40,8,0,
++    0,0,117,16,0,0,0,95,115,101,97,114,99,104,95,114,
++    101,103,105,115,116,114,121,117,4,0,0,0,78,111,110,101,
++    117,3,0,0,0,95,111,115,117,4,0,0,0,115,116,97,
++    116,117,7,0,0,0,79,83,69,114,114,111,114,117,27,0,
++    0,0,95,103,101,116,95,115,117,112,112,111,114,116,101,100,
++    95,102,105,108,101,95,108,111,97,100,101,114,115,117,8,0,
++    0,0,101,110,100,115,119,105,116,104,117,5,0,0,0,116,
++    117,112,108,101,40,7,0,0,0,117,3,0,0,0,99,108,
++    115,117,8,0,0,0,102,117,108,108,110,97,109,101,117,4,
++    0,0,0,112,97,116,104,117,8,0,0,0,102,105,108,101,
++    112,97,116,104,117,6,0,0,0,108,111,97,100,101,114,117,
++    8,0,0,0,115,117,102,102,105,120,101,115,117,1,0,0,
++    0,95,40,0,0,0,0,40,0,0,0,0,117,29,0,0,
++    0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,
++    105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,11,
++    0,0,0,102,105,110,100,95,109,111,100,117,108,101,8,3,
++    0,0,115,20,0,0,0,0,3,15,1,12,1,4,1,3,
++    1,17,1,13,1,9,1,25,1,21,1,117,33,0,0,0,
++    87,105,110,100,111,119,115,82,101,103,105,115,116,114,121,70,
++    105,110,100,101,114,46,102,105,110,100,95,109,111,100,117,108,
++    101,78,70,40,13,0,0,0,117,8,0,0,0,95,95,110,
++    97,109,101,95,95,117,10,0,0,0,95,95,109,111,100,117,
++    108,101,95,95,117,12,0,0,0,95,95,113,117,97,108,110,
++    97,109,101,95,95,117,7,0,0,0,95,95,100,111,99,95,
++    95,117,12,0,0,0,82,69,71,73,83,84,82,89,95,75,
++    69,89,117,18,0,0,0,82,69,71,73,83,84,82,89,95,
++    75,69,89,95,68,69,66,85,71,117,5,0,0,0,70,97,
++    108,115,101,117,11,0,0,0,68,69,66,85,71,95,66,85,
++    73,76,68,117,11,0,0,0,99,108,97,115,115,109,101,116,
++    104,111,100,117,14,0,0,0,95,111,112,101,110,95,114,101,
++    103,105,115,116,114,121,117,16,0,0,0,95,115,101,97,114,
++    99,104,95,114,101,103,105,115,116,114,121,117,4,0,0,0,
++    78,111,110,101,117,11,0,0,0,102,105,110,100,95,109,111,
++    100,117,108,101,40,1,0,0,0,117,10,0,0,0,95,95,
++    108,111,99,97,108,115,95,95,40,0,0,0,0,40,0,0,
++    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
++    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
++    114,97,112,62,117,21,0,0,0,87,105,110,100,111,119,115,
++    82,101,103,105,115,116,114,121,70,105,110,100,101,114,229,2,
++    0,0,115,16,0,0,0,16,3,6,3,6,3,6,2,6,
++    2,18,7,18,15,3,1,117,21,0,0,0,87,105,110,100,
++    111,119,115,82,101,103,105,115,116,114,121,70,105,110,100,101,
++    114,99,1,0,0,0,0,0,0,0,1,0,0,0,5,0,
++    0,0,66,0,0,0,115,74,0,0,0,124,0,0,69,101,
++    0,0,90,1,0,100,0,0,90,2,0,100,1,0,90,3,
++    0,100,2,0,100,3,0,132,0,0,90,4,0,100,4,0,
++    100,5,0,132,0,0,90,5,0,101,6,0,100,6,0,100,
++    10,0,100,7,0,100,8,0,132,0,1,131,1,0,90,8,
++    0,100,9,0,83,40,11,0,0,0,117,13,0,0,0,95,
++    76,111,97,100,101,114,66,97,115,105,99,115,117,83,0,0,
++    0,66,97,115,101,32,99,108,97,115,115,32,111,102,32,99,
++    111,109,109,111,110,32,99,111,100,101,32,110,101,101,100,101,
++    100,32,98,121,32,98,111,116,104,32,83,111,117,114,99,101,
++    76,111,97,100,101,114,32,97,110,100,10,32,32,32,32,83,
++    111,117,114,99,101,108,101,115,115,70,105,108,101,76,111,97,
++    100,101,114,46,99,2,0,0,0,0,0,0,0,5,0,0,
++    0,3,0,0,0,67,0,0,0,115,88,0,0,0,116,0,
++    0,124,0,0,106,1,0,124,1,0,131,1,0,131,1,0,
++    100,1,0,25,125,2,0,124,2,0,106,2,0,100,2,0,
++    100,1,0,131,2,0,100,3,0,25,125,3,0,124,1,0,
++    106,3,0,100,2,0,131,1,0,100,4,0,25,125,4,0,
++    124,3,0,100,5,0,107,2,0,111,87,0,124,4,0,100,
++    5,0,107,3,0,83,40,6,0,0,0,117,141,0,0,0,
++    67,111,110,99,114,101,116,101,32,105,109,112,108,101,109,101,
++    110,116,97,116,105,111,110,32,111,102,32,73,110,115,112,101,
++    99,116,76,111,97,100,101,114,46,105,115,95,112,97,99,107,
++    97,103,101,32,98,121,32,99,104,101,99,107,105,110,103,32,
++    105,102,10,32,32,32,32,32,32,32,32,116,104,101,32,112,
++    97,116,104,32,114,101,116,117,114,110,101,100,32,98,121,32,
++    103,101,116,95,102,105,108,101,110,97,109,101,32,104,97,115,
++    32,97,32,102,105,108,101,110,97,109,101,32,111,102,32,39,
++    95,95,105,110,105,116,95,95,46,112,121,39,46,105,1,0,
++    0,0,117,1,0,0,0,46,105,0,0,0,0,105,2,0,
++    0,0,117,8,0,0,0,95,95,105,110,105,116,95,95,40,
++    4,0,0,0,117,11,0,0,0,95,112,97,116,104,95,115,
++    112,108,105,116,117,12,0,0,0,103,101,116,95,102,105,108,
++    101,110,97,109,101,117,6,0,0,0,114,115,112,108,105,116,
++    117,10,0,0,0,114,112,97,114,116,105,116,105,111,110,40,
++    5,0,0,0,117,4,0,0,0,115,101,108,102,117,8,0,
++    0,0,102,117,108,108,110,97,109,101,117,8,0,0,0,102,
++    105,108,101,110,97,109,101,117,13,0,0,0,102,105,108,101,
++    110,97,109,101,95,98,97,115,101,117,9,0,0,0,116,97,
++    105,108,95,110,97,109,101,40,0,0,0,0,40,0,0,0,
++    0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,
++    112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,
++    97,112,62,117,10,0,0,0,105,115,95,112,97,99,107,97,
++    103,101,28,3,0,0,115,8,0,0,0,0,3,25,1,22,
++    1,19,1,117,24,0,0,0,95,76,111,97,100,101,114,66,
++    97,115,105,99,115,46,105,115,95,112,97,99,107,97,103,101,
++    99,5,0,0,0,0,0,0,0,12,0,0,0,22,0,0,
++    0,67,0,0,0,115,198,1,0,0,124,2,0,100,1,0,
++    100,2,0,133,2,0,25,125,5,0,124,2,0,100,2,0,
++    100,3,0,133,2,0,25,125,6,0,124,2,0,100,3,0,
++    100,4,0,133,2,0,25,125,7,0,124,5,0,116,0,0,
++    107,3,0,114,105,0,100,5,0,106,1,0,124,1,0,124,
++    5,0,131,2,0,125,8,0,116,2,0,124,8,0,100,6,
++    0,124,1,0,100,7,0,124,3,0,131,1,2,130,1,0,
++    110,116,0,116,3,0,124,6,0,131,1,0,100,2,0,107,
++    3,0,114,163,0,100,8,0,106,1,0,124,1,0,131,1,
++    0,125,9,0,116,4,0,124,9,0,131,1,0,1,116,5,
++    0,124,9,0,131,1,0,130,1,0,110,58,0,116,3,0,
++    124,7,0,131,1,0,100,2,0,107,3,0,114,221,0,100,
++    9,0,106,1,0,124,1,0,131,1,0,125,9,0,116,4,
++    0,124,9,0,131,1,0,1,116,5,0,124,9,0,131,1,
++    0,130,1,0,110,0,0,124,4,0,100,1,0,107,9,0,
++    114,184,1,121,20,0,116,7,0,124,4,0,100,10,0,25,
++    131,1,0,125,10,0,87,110,18,0,4,116,8,0,107,10,
++    0,114,17,1,1,1,1,89,110,71,0,88,116,9,0,124,
++    6,0,131,1,0,124,10,0,107,3,0,114,88,1,100,11,
++    0,106,1,0,124,1,0,131,1,0,125,9,0,116,4,0,
++    124,9,0,131,1,0,1,116,2,0,124,9,0,100,6,0,
++    124,1,0,100,7,0,124,3,0,131,1,2,130,1,0,110,
++    0,0,121,18,0,124,4,0,100,12,0,25,100,13,0,64,
++    125,11,0,87,110,18,0,4,116,8,0,107,10,0,114,126,
++    1,1,1,1,89,113,184,1,88,116,9,0,124,7,0,131,
++    1,0,124,11,0,107,3,0,114,184,1,116,2,0,100,11,
++    0,106,1,0,124,1,0,131,1,0,100,6,0,124,1,0,
++    100,7,0,124,3,0,131,1,2,130,1,0,113,184,1,110,
++    0,0,124,2,0,100,4,0,100,1,0,133,2,0,25,83,
++    40,14,0,0,0,117,193,0,0,0,82,101,116,117,114,110,
++    32,116,104,101,32,109,97,114,115,104,97,108,108,101,100,32,
++    98,121,116,101,115,32,102,114,111,109,32,98,121,116,101,99,
++    111,100,101,44,32,118,101,114,105,102,121,105,110,103,32,116,
++    104,101,32,109,97,103,105,99,10,32,32,32,32,32,32,32,
++    32,110,117,109,98,101,114,44,32,116,105,109,101,115,116,97,
++    109,112,32,97,110,100,32,115,111,117,114,99,101,32,115,105,
++    122,101,32,97,108,111,110,103,32,116,104,101,32,119,97,121,
++    46,10,10,32,32,32,32,32,32,32,32,73,102,32,115,111,
++    117,114,99,101,95,115,116,97,116,115,32,105,115,32,78,111,
++    110,101,32,116,104,101,110,32,115,107,105,112,32,116,104,101,
++    32,116,105,109,101,115,116,97,109,112,32,99,104,101,99,107,
++    46,10,10,32,32,32,32,32,32,32,32,78,105,4,0,0,
++    0,105,8,0,0,0,105,12,0,0,0,117,30,0,0,0,
++    98,97,100,32,109,97,103,105,99,32,110,117,109,98,101,114,
++    32,105,110,32,123,33,114,125,58,32,123,33,114,125,117,4,
++    0,0,0,110,97,109,101,117,4,0,0,0,112,97,116,104,
++    117,19,0,0,0,98,97,100,32,116,105,109,101,115,116,97,
++    109,112,32,105,110,32,123,125,117,14,0,0,0,98,97,100,
++    32,115,105,122,101,32,105,110,32,123,125,117,5,0,0,0,
++    109,116,105,109,101,117,24,0,0,0,98,121,116,101,99,111,
++    100,101,32,105,115,32,115,116,97,108,101,32,102,111,114,32,
++    123,125,117,4,0,0,0,115,105,122,101,108,3,0,0,0,
++    255,127,255,127,3,0,40,10,0,0,0,117,12,0,0,0,
++    95,77,65,71,73,67,95,66,89,84,69,83,117,6,0,0,
++    0,102,111,114,109,97,116,117,11,0,0,0,73,109,112,111,
++    114,116,69,114,114,111,114,117,3,0,0,0,108,101,110,117,
++    16,0,0,0,95,118,101,114,98,111,115,101,95,109,101,115,
++    115,97,103,101,117,8,0,0,0,69,79,70,69,114,114,111,
++    114,117,4,0,0,0,78,111,110,101,117,3,0,0,0,105,
++    110,116,117,8,0,0,0,75,101,121,69,114,114,111,114,117,
++    7,0,0,0,95,114,95,108,111,110,103,40,12,0,0,0,
++    117,4,0,0,0,115,101,108,102,117,8,0,0,0,102,117,
++    108,108,110,97,109,101,117,4,0,0,0,100,97,116,97,117,
++    13,0,0,0,98,121,116,101,99,111,100,101,95,112,97,116,
++    104,117,12,0,0,0,115,111,117,114,99,101,95,115,116,97,
++    116,115,117,5,0,0,0,109,97,103,105,99,117,13,0,0,
++    0,114,97,119,95,116,105,109,101,115,116,97,109,112,117,8,
++    0,0,0,114,97,119,95,115,105,122,101,117,3,0,0,0,
++    109,115,103,117,7,0,0,0,109,101,115,115,97,103,101,117,
++    12,0,0,0,115,111,117,114,99,101,95,109,116,105,109,101,
++    117,11,0,0,0,115,111,117,114,99,101,95,115,105,122,101,
++    40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,
++    102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,
++    46,95,98,111,111,116,115,116,114,97,112,62,117,20,0,0,
++    0,95,98,121,116,101,115,95,102,114,111,109,95,98,121,116,
++    101,99,111,100,101,36,3,0,0,115,66,0,0,0,0,7,
++    16,1,16,1,16,1,12,1,18,1,27,1,18,1,15,1,
++    10,1,15,1,18,1,15,1,10,1,15,1,12,1,3,1,
++    20,1,13,1,5,2,18,1,15,1,10,1,15,1,12,1,
++    3,1,18,1,13,1,5,2,18,1,3,1,15,1,21,3,
++    117,34,0,0,0,95,76,111,97,100,101,114,66,97,115,105,
++    99,115,46,95,98,121,116,101,115,95,102,114,111,109,95,98,
++    121,116,101,99,111,100,101,117,10,0,0,0,115,111,117,114,
++    99,101,108,101,115,115,99,2,0,0,0,1,0,0,0,5,
++    0,0,0,12,0,0,0,67,0,0,0,115,227,0,0,0,
++    124,1,0,106,0,0,125,3,0,124,0,0,106,1,0,124,
++    3,0,131,1,0,125,4,0,124,0,0,106,2,0,124,3,
++    0,131,1,0,124,1,0,95,3,0,124,2,0,115,106,0,
++    121,22,0,116,4,0,124,1,0,106,3,0,131,1,0,124,
++    1,0,95,5,0,87,113,118,0,4,116,6,0,107,10,0,
++    114,102,0,1,1,1,124,1,0,106,3,0,124,1,0,95,
++    5,0,89,113,118,0,88,110,12,0,124,1,0,106,3,0,
++    124,1,0,95,5,0,124,3,0,124,1,0,95,7,0,124,
++    0,0,106,8,0,124,3,0,131,1,0,114,170,0,116,9,
++    0,124,1,0,106,3,0,131,1,0,100,1,0,25,103,1,
++    0,124,1,0,95,10,0,110,25,0,124,1,0,106,7,0,
++    106,11,0,100,2,0,131,1,0,100,1,0,25,124,1,0,
++    95,7,0,124,0,0,124,1,0,95,12,0,116,13,0,116,
++    14,0,124,4,0,124,1,0,106,15,0,131,3,0,1,124,
++    1,0,83,40,3,0,0,0,117,82,0,0,0,72,101,108,
++    112,101,114,32,102,111,114,32,108,111,97,100,95,109,111,100,
++    117,108,101,32,97,98,108,101,32,116,111,32,104,97,110,100,
++    108,101,32,101,105,116,104,101,114,32,115,111,117,114,99,101,
++    32,111,114,32,115,111,117,114,99,101,108,101,115,115,10,32,
++    32,32,32,32,32,32,32,108,111,97,100,105,110,103,46,105,
++    0,0,0,0,117,1,0,0,0,46,40,16,0,0,0,117,
++    8,0,0,0,95,95,110,97,109,101,95,95,117,8,0,0,
++    0,103,101,116,95,99,111,100,101,117,12,0,0,0,103,101,
++    116,95,102,105,108,101,110,97,109,101,117,8,0,0,0,95,
++    95,102,105,108,101,95,95,117,17,0,0,0,99,97,99,104,
++    101,95,102,114,111,109,95,115,111,117,114,99,101,117,10,0,
++    0,0,95,95,99,97,99,104,101,100,95,95,117,19,0,0,
++    0,78,111,116,73,109,112,108,101,109,101,110,116,101,100,69,
++    114,114,111,114,117,11,0,0,0,95,95,112,97,99,107,97,
++    103,101,95,95,117,10,0,0,0,105,115,95,112,97,99,107,
++    97,103,101,117,11,0,0,0,95,112,97,116,104,95,115,112,
++    108,105,116,117,8,0,0,0,95,95,112,97,116,104,95,95,
++    117,10,0,0,0,114,112,97,114,116,105,116,105,111,110,117,
++    10,0,0,0,95,95,108,111,97,100,101,114,95,95,117,25,
++    0,0,0,95,99,97,108,108,95,119,105,116,104,95,102,114,
++    97,109,101,115,95,114,101,109,111,118,101,100,117,4,0,0,
++    0,101,120,101,99,117,8,0,0,0,95,95,100,105,99,116,
++    95,95,40,5,0,0,0,117,4,0,0,0,115,101,108,102,
++    117,6,0,0,0,109,111,100,117,108,101,117,10,0,0,0,
++    115,111,117,114,99,101,108,101,115,115,117,4,0,0,0,110,
++    97,109,101,117,11,0,0,0,99,111,100,101,95,111,98,106,
++    101,99,116,40,0,0,0,0,40,0,0,0,0,117,29,0,
++    0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,
++    108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,
++    12,0,0,0,95,108,111,97,100,95,109,111,100,117,108,101,
++    81,3,0,0,115,32,0,0,0,0,4,9,1,15,1,18,
++    1,6,1,3,1,22,1,13,1,20,2,12,1,9,1,15,
++    1,28,2,25,1,9,1,19,1,117,26,0,0,0,95,76,
++    111,97,100,101,114,66,97,115,105,99,115,46,95,108,111,97,
++    100,95,109,111,100,117,108,101,78,70,40,9,0,0,0,117,
++    8,0,0,0,95,95,110,97,109,101,95,95,117,10,0,0,
++    0,95,95,109,111,100,117,108,101,95,95,117,12,0,0,0,
++    95,95,113,117,97,108,110,97,109,101,95,95,117,7,0,0,
++    0,95,95,100,111,99,95,95,117,10,0,0,0,105,115,95,
++    112,97,99,107,97,103,101,117,20,0,0,0,95,98,121,116,
++    101,115,95,102,114,111,109,95,98,121,116,101,99,111,100,101,
++    117,17,0,0,0,109,111,100,117,108,101,95,102,111,114,95,
++    108,111,97,100,101,114,117,5,0,0,0,70,97,108,115,101,
++    117,12,0,0,0,95,108,111,97,100,95,109,111,100,117,108,
++    101,40,1,0,0,0,117,10,0,0,0,95,95,108,111,99,
++    97,108,115,95,95,40,0,0,0,0,40,0,0,0,0,117,
++    29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
++    114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
++    62,117,13,0,0,0,95,76,111,97,100,101,114,66,97,115,
++    105,99,115,23,3,0,0,115,10,0,0,0,16,3,6,2,
++    12,8,12,45,6,1,117,13,0,0,0,95,76,111,97,100,
++    101,114,66,97,115,105,99,115,99,1,0,0,0,0,0,0,
++    0,1,0,0,0,2,0,0,0,66,0,0,0,115,104,0,
++    0,0,124,0,0,69,101,0,0,90,1,0,100,0,0,90,
++    2,0,100,1,0,100,2,0,132,0,0,90,3,0,100,3,
++    0,100,4,0,132,0,0,90,4,0,100,5,0,100,6,0,
++    132,0,0,90,5,0,100,7,0,100,8,0,132,0,0,90,
++    6,0,100,9,0,100,10,0,132,0,0,90,7,0,100,11,
++    0,100,12,0,132,0,0,90,8,0,100,13,0,100,14,0,
++    132,0,0,90,9,0,100,15,0,83,40,16,0,0,0,117,
++    12,0,0,0,83,111,117,114,99,101,76,111,97,100,101,114,
++    99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,
++    0,67,0,0,0,115,10,0,0,0,116,0,0,130,1,0,
++    100,1,0,83,40,2,0,0,0,117,121,0,0,0,79,112,
++    116,105,111,110,97,108,32,109,101,116,104,111,100,32,116,104,
++    97,116,32,114,101,116,117,114,110,115,32,116,104,101,32,109,
++    111,100,105,102,105,99,97,116,105,111,110,32,116,105,109,101,
++    32,40,97,110,32,105,110,116,41,32,102,111,114,32,116,104,
++    101,10,32,32,32,32,32,32,32,32,115,112,101,99,105,102,
++    105,101,100,32,112,97,116,104,44,32,119,104,101,114,101,32,
++    112,97,116,104,32,105,115,32,97,32,115,116,114,46,10,32,
++    32,32,32,32,32,32,32,78,40,1,0,0,0,117,19,0,
++    0,0,78,111,116,73,109,112,108,101,109,101,110,116,101,100,
++    69,114,114,111,114,40,2,0,0,0,117,4,0,0,0,115,
++    101,108,102,117,4,0,0,0,112,97,116,104,40,0,0,0,
++    0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,
++    101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,
++    111,116,115,116,114,97,112,62,117,10,0,0,0,112,97,116,
++    104,95,109,116,105,109,101,107,3,0,0,115,2,0,0,0,
++    0,4,117,23,0,0,0,83,111,117,114,99,101,76,111,97,
++    100,101,114,46,112,97,116,104,95,109,116,105,109,101,99,2,
++    0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,
++    0,0,0,115,20,0,0,0,105,1,0,124,0,0,106,0,
++    0,124,1,0,131,1,0,100,1,0,54,83,40,2,0,0,
++    0,117,114,1,0,0,79,112,116,105,111,110,97,108,32,109,
++    101,116,104,111,100,32,114,101,116,117,114,110,105,110,103,32,
++    97,32,109,101,116,97,100,97,116,97,32,100,105,99,116,32,
++    102,111,114,32,116,104,101,32,115,112,101,99,105,102,105,101,
++    100,32,112,97,116,104,10,32,32,32,32,32,32,32,32,116,
++    111,32,98,121,32,116,104,101,32,112,97,116,104,32,40,115,
++    116,114,41,46,10,32,32,32,32,32,32,32,32,80,111,115,
++    115,105,98,108,101,32,107,101,121,115,58,10,32,32,32,32,
++    32,32,32,32,45,32,39,109,116,105,109,101,39,32,40,109,
++    97,110,100,97,116,111,114,121,41,32,105,115,32,116,104,101,
++    32,110,117,109,101,114,105,99,32,116,105,109,101,115,116,97,
++    109,112,32,111,102,32,108,97,115,116,32,115,111,117,114,99,
++    101,10,32,32,32,32,32,32,32,32,32,32,99,111,100,101,
++    32,109,111,100,105,102,105,99,97,116,105,111,110,59,10,32,
++    32,32,32,32,32,32,32,45,32,39,115,105,122,101,39,32,
++    40,111,112,116,105,111,110,97,108,41,32,105,115,32,116,104,
++    101,32,115,105,122,101,32,105,110,32,98,121,116,101,115,32,
++    111,102,32,116,104,101,32,115,111,117,114,99,101,32,99,111,
++    100,101,46,10,10,32,32,32,32,32,32,32,32,73,109,112,
++    108,101,109,101,110,116,105,110,103,32,116,104,105,115,32,109,
++    101,116,104,111,100,32,97,108,108,111,119,115,32,116,104,101,
++    32,108,111,97,100,101,114,32,116,111,32,114,101,97,100,32,
++    98,121,116,101,99,111,100,101,32,102,105,108,101,115,46,10,
++    32,32,32,32,32,32,32,32,117,5,0,0,0,109,116,105,
++    109,101,40,1,0,0,0,117,10,0,0,0,112,97,116,104,
++    95,109,116,105,109,101,40,2,0,0,0,117,4,0,0,0,
++    115,101,108,102,117,4,0,0,0,112,97,116,104,40,0,0,
++    0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,
++    122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,
++    111,111,116,115,116,114,97,112,62,117,10,0,0,0,112,97,
++    116,104,95,115,116,97,116,115,113,3,0,0,115,2,0,0,
++    0,0,10,117,23,0,0,0,83,111,117,114,99,101,76,111,
++    97,100,101,114,46,112,97,116,104,95,115,116,97,116,115,99,
++    4,0,0,0,0,0,0,0,4,0,0,0,3,0,0,0,
++    67,0,0,0,115,16,0,0,0,124,0,0,106,0,0,124,
++    2,0,124,3,0,131,2,0,83,40,1,0,0,0,117,228,
++    0,0,0,79,112,116,105,111,110,97,108,32,109,101,116,104,
++    111,100,32,119,104,105,99,104,32,119,114,105,116,101,115,32,
++    100,97,116,97,32,40,98,121,116,101,115,41,32,116,111,32,
++    97,32,102,105,108,101,32,112,97,116,104,32,40,97,32,115,
++    116,114,41,46,10,10,32,32,32,32,32,32,32,32,73,109,
++    112,108,101,109,101,110,116,105,110,103,32,116,104,105,115,32,
++    109,101,116,104,111,100,32,97,108,108,111,119,115,32,102,111,
++    114,32,116,104,101,32,119,114,105,116,105,110,103,32,111,102,
++    32,98,121,116,101,99,111,100,101,32,102,105,108,101,115,46,
++    10,10,32,32,32,32,32,32,32,32,84,104,101,32,115,111,
++    117,114,99,101,32,112,97,116,104,32,105,115,32,110,101,101,
++    100,101,100,32,105,110,32,111,114,100,101,114,32,116,111,32,
++    99,111,114,114,101,99,116,108,121,32,116,114,97,110,115,102,
++    101,114,32,112,101,114,109,105,115,115,105,111,110,115,10,32,
++    32,32,32,32,32,32,32,40,1,0,0,0,117,8,0,0,
++    0,115,101,116,95,100,97,116,97,40,4,0,0,0,117,4,
++    0,0,0,115,101,108,102,117,11,0,0,0,115,111,117,114,
++    99,101,95,112,97,116,104,117,10,0,0,0,99,97,99,104,
++    101,95,112,97,116,104,117,4,0,0,0,100,97,116,97,40,
++    0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,
++    114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,
++    95,98,111,111,116,115,116,114,97,112,62,117,15,0,0,0,
++    95,99,97,99,104,101,95,98,121,116,101,99,111,100,101,125,
++    3,0,0,115,2,0,0,0,0,8,117,28,0,0,0,83,
++    111,117,114,99,101,76,111,97,100,101,114,46,95,99,97,99,
++    104,101,95,98,121,116,101,99,111,100,101,99,3,0,0,0,
++    0,0,0,0,3,0,0,0,1,0,0,0,67,0,0,0,
++    115,10,0,0,0,116,0,0,130,1,0,100,1,0,83,40,
++    2,0,0,0,117,151,0,0,0,79,112,116,105,111,110,97,
++    108,32,109,101,116,104,111,100,32,119,104,105,99,104,32,119,
++    114,105,116,101,115,32,100,97,116,97,32,40,98,121,116,101,
++    115,41,32,116,111,32,97,32,102,105,108,101,32,112,97,116,
++    104,32,40,97,32,115,116,114,41,46,10,10,32,32,32,32,
++    32,32,32,32,73,109,112,108,101,109,101,110,116,105,110,103,
++    32,116,104,105,115,32,109,101,116,104,111,100,32,97,108,108,
++    111,119,115,32,102,111,114,32,116,104,101,32,119,114,105,116,
++    105,110,103,32,111,102,32,98,121,116,101,99,111,100,101,32,
++    102,105,108,101,115,46,10,10,32,32,32,32,32,32,32,32,
++    78,40,1,0,0,0,117,19,0,0,0,78,111,116,73,109,
++    112,108,101,109,101,110,116,101,100,69,114,114,111,114,40,3,
++    0,0,0,117,4,0,0,0,115,101,108,102,117,4,0,0,
++    0,112,97,116,104,117,4,0,0,0,100,97,116,97,40,0,
++    0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,
++    111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,
++    98,111,111,116,115,116,114,97,112,62,117,8,0,0,0,115,
++    101,116,95,100,97,116,97,135,3,0,0,115,2,0,0,0,
++    0,6,117,21,0,0,0,83,111,117,114,99,101,76,111,97,
++    100,101,114,46,115,101,116,95,100,97,116,97,99,2,0,0,
++    0,0,0,0,0,9,0,0,0,44,0,0,0,67,0,0,
++    0,115,62,1,0,0,100,1,0,100,2,0,108,0,0,125,
++    2,0,124,0,0,106,1,0,124,1,0,131,1,0,125,3,
++    0,121,19,0,124,0,0,106,2,0,124,3,0,131,1,0,
++    125,4,0,87,110,58,0,4,116,3,0,107,10,0,114,106,
++    0,1,125,5,0,1,122,26,0,116,4,0,100,3,0,100,
++    4,0,124,1,0,131,1,1,124,5,0,130,2,0,87,89,
++    100,2,0,100,2,0,125,5,0,126,5,0,88,110,1,0,
++    88,116,5,0,106,6,0,124,4,0,131,1,0,106,7,0,
++    125,6,0,121,19,0,124,2,0,106,8,0,124,6,0,131,
++    1,0,125,7,0,87,110,58,0,4,116,9,0,107,10,0,
++    114,204,0,1,125,5,0,1,122,26,0,116,4,0,100,5,
++    0,100,4,0,124,1,0,131,1,1,124,5,0,130,2,0,
++    87,89,100,2,0,100,2,0,125,5,0,126,5,0,88,110,
++    1,0,88,116,5,0,106,10,0,100,2,0,100,7,0,131,
++    2,0,125,8,0,121,30,0,124,8,0,106,13,0,124,4,
++    0,106,13,0,124,7,0,100,1,0,25,131,1,0,131,1,
++    0,83,87,110,58,0,4,116,14,0,107,10,0,114,57,1,
++    1,125,5,0,1,122,26,0,116,4,0,100,6,0,100,4,
++    0,124,1,0,131,1,1,124,5,0,130,2,0,87,89,100,
++    2,0,100,2,0,125,5,0,126,5,0,88,110,1,0,88,
++    100,2,0,83,40,8,0,0,0,117,52,0,0,0,67,111,
++    110,99,114,101,116,101,32,105,109,112,108,101,109,101,110,116,
++    97,116,105,111,110,32,111,102,32,73,110,115,112,101,99,116,
++    76,111,97,100,101,114,46,103,101,116,95,115,111,117,114,99,
++    101,46,105,0,0,0,0,78,117,39,0,0,0,115,111,117,
++    114,99,101,32,110,111,116,32,97,118,97,105,108,97,98,108,
++    101,32,116,104,114,111,117,103,104,32,103,101,116,95,100,97,
++    116,97,40,41,117,4,0,0,0,110,97,109,101,117,25,0,
++    0,0,70,97,105,108,101,100,32,116,111,32,100,101,116,101,
++    99,116,32,101,110,99,111,100,105,110,103,117,28,0,0,0,
++    70,97,105,108,101,100,32,116,111,32,100,101,99,111,100,101,
++    32,115,111,117,114,99,101,32,102,105,108,101,84,40,15,0,
++    0,0,117,8,0,0,0,116,111,107,101,110,105,122,101,117,
++    12,0,0,0,103,101,116,95,102,105,108,101,110,97,109,101,
++    117,8,0,0,0,103,101,116,95,100,97,116,97,117,7,0,
++    0,0,73,79,69,114,114,111,114,117,11,0,0,0,73,109,
++    112,111,114,116,69,114,114,111,114,117,3,0,0,0,95,105,
++    111,117,7,0,0,0,66,121,116,101,115,73,79,117,8,0,
++    0,0,114,101,97,100,108,105,110,101,117,15,0,0,0,100,
++    101,116,101,99,116,95,101,110,99,111,100,105,110,103,117,11,
++    0,0,0,83,121,110,116,97,120,69,114,114,111,114,117,25,
++    0,0,0,73,110,99,114,101,109,101,110,116,97,108,78,101,
++    119,108,105,110,101,68,101,99,111,100,101,114,117,4,0,0,
++    0,78,111,110,101,117,4,0,0,0,84,114,117,101,117,6,
++    0,0,0,100,101,99,111,100,101,117,18,0,0,0,85,110,
++    105,99,111,100,101,68,101,99,111,100,101,69,114,114,111,114,
++    40,9,0,0,0,117,4,0,0,0,115,101,108,102,117,8,
++    0,0,0,102,117,108,108,110,97,109,101,117,8,0,0,0,
++    116,111,107,101,110,105,122,101,117,4,0,0,0,112,97,116,
++    104,117,12,0,0,0,115,111,117,114,99,101,95,98,121,116,
++    101,115,117,3,0,0,0,101,120,99,117,10,0,0,0,114,
++    101,97,100,115,111,117,114,99,101,117,8,0,0,0,101,110,
++    99,111,100,105,110,103,117,15,0,0,0,110,101,119,108,105,
++    110,101,95,100,101,99,111,100,101,114,40,0,0,0,0,40,
++    0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
++    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
++    115,116,114,97,112,62,117,10,0,0,0,103,101,116,95,115,
++    111,117,114,99,101,144,3,0,0,115,38,0,0,0,0,2,
++    12,1,15,1,3,1,19,1,18,1,9,1,31,1,18,1,
++    3,1,19,1,18,1,9,1,31,1,18,1,3,1,30,1,
++    18,1,9,1,117,23,0,0,0,83,111,117,114,99,101,76,
++    111,97,100,101,114,46,103,101,116,95,115,111,117,114,99,101,
++    99,2,0,0,0,0,0,0,0,12,0,0,0,45,0,0,
++    0,67,0,0,0,115,52,2,0,0,124,0,0,106,0,0,
++    124,1,0,131,1,0,125,2,0,100,10,0,125,3,0,121,
++    16,0,116,2,0,124,2,0,131,1,0,125,4,0,87,110,
++    24,0,4,116,3,0,107,10,0,114,63,0,1,1,1,100,
++    10,0,125,4,0,89,110,14,1,88,121,19,0,124,0,0,
++    106,4,0,124,2,0,131,1,0,125,5,0,87,110,18,0,
++    4,116,3,0,107,10,0,114,103,0,1,1,1,89,110,230,
++    0,88,116,5,0,124,5,0,100,1,0,25,131,1,0,125,
++    3,0,121,19,0,124,0,0,106,6,0,124,4,0,131,1,
++    0,125,6,0,87,110,18,0,4,116,7,0,107,10,0,114,
++    159,0,1,1,1,89,110,174,0,88,121,28,0,124,0,0,
++    106,8,0,124,1,0,124,6,0,124,4,0,124,5,0,131,
++    4,0,125,7,0,87,110,24,0,4,116,9,0,116,10,0,
++    102,2,0,107,10,0,114,214,0,1,1,1,89,110,119,0,
++    88,116,11,0,100,2,0,124,4,0,124,2,0,131,3,0,
++    1,116,12,0,106,13,0,124,7,0,131,1,0,125,8,0,
++    116,14,0,124,8,0,116,15,0,131,2,0,114,38,1,116,
++    16,0,106,17,0,124,8,0,124,2,0,131,2,0,1,116,
++    11,0,100,3,0,124,4,0,131,2,0,1,124,8,0,83,
++    100,4,0,125,9,0,116,9,0,124,9,0,106,18,0,124,
++    4,0,131,1,0,100,5,0,124,1,0,100,6,0,124,4,
++    0,131,1,2,130,1,0,124,0,0,106,6,0,124,2,0,
++    131,1,0,125,10,0,116,19,0,116,20,0,124,10,0,124,
++    2,0,100,7,0,100,8,0,100,11,0,131,4,1,125,11,
++    0,116,11,0,100,3,0,124,2,0,131,2,0,1,116,22,
++    0,106,23,0,12,114,48,2,124,4,0,100,10,0,107,9,
++    0,114,48,2,124,3,0,100,10,0,107,9,0,114,48,2,
++    116,24,0,116,25,0,131,1,0,125,6,0,124,6,0,106,
++    26,0,116,27,0,124,3,0,131,1,0,131,1,0,1,124,
++    6,0,106,26,0,116,27,0,116,28,0,124,10,0,131,1,
++    0,131,1,0,131,1,0,1,124,6,0,106,26,0,116,12,
++    0,106,29,0,124,11,0,131,1,0,131,1,0,1,121,36,
++    0,124,0,0,106,30,0,124,2,0,124,4,0,124,6,0,
++    131,3,0,1,116,11,0,100,9,0,124,4,0,131,2,0,
++    1,87,113,48,2,4,116,3,0,107,10,0,114,44,2,1,
++    1,1,89,113,48,2,88,110,0,0,124,11,0,83,40,12,
++    0,0,0,117,190,0,0,0,67,111,110,99,114,101,116,101,
++    32,105,109,112,108,101,109,101,110,116,97,116,105,111,110,32,
++    111,102,32,73,110,115,112,101,99,116,76,111,97,100,101,114,
++    46,103,101,116,95,99,111,100,101,46,10,10,32,32,32,32,
++    32,32,32,32,82,101,97,100,105,110,103,32,111,102,32,98,
++    121,116,101,99,111,100,101,32,114,101,113,117,105,114,101,115,
++    32,112,97,116,104,95,115,116,97,116,115,32,116,111,32,98,
++    101,32,105,109,112,108,101,109,101,110,116,101,100,46,32,84,
++    111,32,119,114,105,116,101,10,32,32,32,32,32,32,32,32,
++    98,121,116,101,99,111,100,101,44,32,115,101,116,95,100,97,
++    116,97,32,109,117,115,116,32,97,108,115,111,32,98,101,32,
++    105,109,112,108,101,109,101,110,116,101,100,46,10,10,32,32,
++    32,32,32,32,32,32,117,5,0,0,0,109,116,105,109,101,
++    117,13,0,0,0,123,125,32,109,97,116,99,104,101,115,32,
++    123,125,117,19,0,0,0,99,111,100,101,32,111,98,106,101,
++    99,116,32,102,114,111,109,32,123,125,117,21,0,0,0,78,
++    111,110,45,99,111,100,101,32,111,98,106,101,99,116,32,105,
++    110,32,123,125,117,4,0,0,0,110,97,109,101,117,4,0,
++    0,0,112,97,116,104,117,4,0,0,0,101,120,101,99,117,
++    12,0,0,0,100,111,110,116,95,105,110,104,101,114,105,116,
++    117,10,0,0,0,119,114,111,116,101,32,123,33,114,125,78,
++    84,40,31,0,0,0,117,12,0,0,0,103,101,116,95,102,
++    105,108,101,110,97,109,101,117,4,0,0,0,78,111,110,101,
++    117,17,0,0,0,99,97,99,104,101,95,102,114,111,109,95,
++    115,111,117,114,99,101,117,19,0,0,0,78,111,116,73,109,
++    112,108,101,109,101,110,116,101,100,69,114,114,111,114,117,10,
++    0,0,0,112,97,116,104,95,115,116,97,116,115,117,3,0,
++    0,0,105,110,116,117,8,0,0,0,103,101,116,95,100,97,
++    116,97,117,7,0,0,0,73,79,69,114,114,111,114,117,20,
++    0,0,0,95,98,121,116,101,115,95,102,114,111,109,95,98,
++    121,116,101,99,111,100,101,117,11,0,0,0,73,109,112,111,
++    114,116,69,114,114,111,114,117,8,0,0,0,69,79,70,69,
++    114,114,111,114,117,16,0,0,0,95,118,101,114,98,111,115,
++    101,95,109,101,115,115,97,103,101,117,7,0,0,0,109,97,
++    114,115,104,97,108,117,5,0,0,0,108,111,97,100,115,117,
++    10,0,0,0,105,115,105,110,115,116,97,110,99,101,117,10,
++    0,0,0,95,99,111,100,101,95,116,121,112,101,117,4,0,
++    0,0,95,105,109,112,117,16,0,0,0,95,102,105,120,95,
++    99,111,95,102,105,108,101,110,97,109,101,117,6,0,0,0,
++    102,111,114,109,97,116,117,25,0,0,0,95,99,97,108,108,
++    95,119,105,116,104,95,102,114,97,109,101,115,95,114,101,109,
++    111,118,101,100,117,7,0,0,0,99,111,109,112,105,108,101,
++    117,4,0,0,0,84,114,117,101,117,3,0,0,0,115,121,
++    115,117,19,0,0,0,100,111,110,116,95,119,114,105,116,101,
++    95,98,121,116,101,99,111,100,101,117,9,0,0,0,98,121,
++    116,101,97,114,114,97,121,117,12,0,0,0,95,77,65,71,
++    73,67,95,66,89,84,69,83,117,6,0,0,0,101,120,116,
++    101,110,100,117,7,0,0,0,95,119,95,108,111,110,103,117,
++    3,0,0,0,108,101,110,117,5,0,0,0,100,117,109,112,
++    115,117,15,0,0,0,95,99,97,99,104,101,95,98,121,116,
++    101,99,111,100,101,40,12,0,0,0,117,4,0,0,0,115,
++    101,108,102,117,8,0,0,0,102,117,108,108,110,97,109,101,
++    117,11,0,0,0,115,111,117,114,99,101,95,112,97,116,104,
++    117,12,0,0,0,115,111,117,114,99,101,95,109,116,105,109,
++    101,117,13,0,0,0,98,121,116,101,99,111,100,101,95,112,
++    97,116,104,117,2,0,0,0,115,116,117,4,0,0,0,100,
++    97,116,97,117,10,0,0,0,98,121,116,101,115,95,100,97,
++    116,97,117,5,0,0,0,102,111,117,110,100,117,3,0,0,
++    0,109,115,103,117,12,0,0,0,115,111,117,114,99,101,95,
++    98,121,116,101,115,117,11,0,0,0,99,111,100,101,95,111,
++    98,106,101,99,116,40,0,0,0,0,40,0,0,0,0,117,
++    29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
++    114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
++    62,117,8,0,0,0,103,101,116,95,99,111,100,101,166,3,
++    0,0,115,98,0,0,0,0,7,15,1,6,1,3,1,16,
++    1,13,1,11,2,3,1,19,1,13,1,5,2,16,1,3,
++    1,19,1,13,1,5,2,3,1,12,1,3,1,13,1,19,
++    1,5,2,9,1,7,1,15,1,15,1,16,1,6,1,7,
++    1,4,2,6,1,18,1,15,1,15,1,6,1,12,1,9,
++    1,13,1,22,1,12,1,12,1,19,1,25,1,22,1,3,
++    1,19,1,17,1,13,1,8,1,117,21,0,0,0,83,111,
++    117,114,99,101,76,111,97,100,101,114,46,103,101,116,95,99,
++    111,100,101,99,2,0,0,0,0,0,0,0,2,0,0,0,
++    2,0,0,0,67,0,0,0,115,13,0,0,0,124,0,0,
++    106,0,0,124,1,0,131,1,0,83,40,1,0,0,0,117,
++    0,1,0,0,67,111,110,99,114,101,116,101,32,105,109,112,
++    108,101,109,101,110,116,97,116,105,111,110,32,111,102,32,76,
++    111,97,100,101,114,46,108,111,97,100,95,109,111,100,117,108,
++    101,46,10,10,32,32,32,32,32,32,32,32,82,101,113,117,
++    105,114,101,115,32,69,120,101,99,117,116,105,111,110,76,111,
++    97,100,101,114,46,103,101,116,95,102,105,108,101,110,97,109,
++    101,32,97,110,100,32,82,101,115,111,117,114,99,101,76,111,
++    97,100,101,114,46,103,101,116,95,100,97,116,97,32,116,111,
++    32,98,101,10,32,32,32,32,32,32,32,32,105,109,112,108,
++    101,109,101,110,116,101,100,32,116,111,32,108,111,97,100,32,
++    115,111,117,114,99,101,32,99,111,100,101,46,32,85,115,101,
++    32,111,102,32,98,121,116,101,99,111,100,101,32,105,115,32,
++    100,105,99,116,97,116,101,100,32,98,121,32,119,104,101,116,
++    104,101,114,10,32,32,32,32,32,32,32,32,103,101,116,95,
++    99,111,100,101,32,117,115,101,115,47,119,114,105,116,101,115,
++    32,98,121,116,101,99,111,100,101,46,10,10,32,32,32,32,
++    32,32,32,32,40,1,0,0,0,117,12,0,0,0,95,108,
++    111,97,100,95,109,111,100,117,108,101,40,2,0,0,0,117,
++    4,0,0,0,115,101,108,102,117,8,0,0,0,102,117,108,
++    108,110,97,109,101,40,0,0,0,0,40,0,0,0,0,117,
++    29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
++    114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
++    62,117,11,0,0,0,108,111,97,100,95,109,111,100,117,108,
++    101,228,3,0,0,115,2,0,0,0,0,8,117,24,0,0,
++    0,83,111,117,114,99,101,76,111,97,100,101,114,46,108,111,
++    97,100,95,109,111,100,117,108,101,78,40,10,0,0,0,117,
++    8,0,0,0,95,95,110,97,109,101,95,95,117,10,0,0,
++    0,95,95,109,111,100,117,108,101,95,95,117,12,0,0,0,
++    95,95,113,117,97,108,110,97,109,101,95,95,117,10,0,0,
++    0,112,97,116,104,95,109,116,105,109,101,117,10,0,0,0,
++    112,97,116,104,95,115,116,97,116,115,117,15,0,0,0,95,
++    99,97,99,104,101,95,98,121,116,101,99,111,100,101,117,8,
++    0,0,0,115,101,116,95,100,97,116,97,117,10,0,0,0,
++    103,101,116,95,115,111,117,114,99,101,117,8,0,0,0,103,
++    101,116,95,99,111,100,101,117,11,0,0,0,108,111,97,100,
+     95,109,111,100,117,108,101,40,1,0,0,0,117,10,0,0,
+     0,95,95,108,111,99,97,108,115,95,95,40,0,0,0,0,
+     40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,
+     110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,
+-    116,115,116,114,97,112,62,117,21,0,0,0,87,105,110,100,
+-    111,119,115,82,101,103,105,115,116,114,121,70,105,110,100,101,
+-    114,229,2,0,0,115,16,0,0,0,16,3,6,3,6,3,
+-    6,2,6,2,18,7,18,15,3,1,117,21,0,0,0,87,
+-    105,110,100,111,119,115,82,101,103,105,115,116,114,121,70,105,
+-    110,100,101,114,99,1,0,0,0,0,0,0,0,1,0,0,
+-    0,5,0,0,0,66,0,0,0,115,74,0,0,0,124,0,
+-    0,69,101,0,0,90,1,0,100,0,0,90,2,0,100,1,
+-    0,90,3,0,100,2,0,100,3,0,132,0,0,90,4,0,
+-    100,4,0,100,5,0,132,0,0,90,5,0,101,6,0,100,
+-    6,0,100,10,0,100,7,0,100,8,0,132,0,1,131,1,
+-    0,90,8,0,100,9,0,83,40,11,0,0,0,117,13,0,
+-    0,0,95,76,111,97,100,101,114,66,97,115,105,99,115,117,
+-    83,0,0,0,66,97,115,101,32,99,108,97,115,115,32,111,
+-    102,32,99,111,109,109,111,110,32,99,111,100,101,32,110,101,
+-    101,100,101,100,32,98,121,32,98,111,116,104,32,83,111,117,
+-    114,99,101,76,111,97,100,101,114,32,97,110,100,10,32,32,
+-    32,32,83,111,117,114,99,101,108,101,115,115,70,105,108,101,
+-    76,111,97,100,101,114,46,99,2,0,0,0,0,0,0,0,
+-    5,0,0,0,3,0,0,0,67,0,0,0,115,88,0,0,
+-    0,116,0,0,124,0,0,106,1,0,124,1,0,131,1,0,
+-    131,1,0,100,1,0,25,125,2,0,124,2,0,106,2,0,
+-    100,2,0,100,1,0,131,2,0,100,3,0,25,125,3,0,
+-    124,1,0,106,3,0,100,2,0,131,1,0,100,4,0,25,
+-    125,4,0,124,3,0,100,5,0,107,2,0,111,87,0,124,
+-    4,0,100,5,0,107,3,0,83,40,6,0,0,0,117,141,
+-    0,0,0,67,111,110,99,114,101,116,101,32,105,109,112,108,
+-    101,109,101,110,116,97,116,105,111,110,32,111,102,32,73,110,
+-    115,112,101,99,116,76,111,97,100,101,114,46,105,115,95,112,
+-    97,99,107,97,103,101,32,98,121,32,99,104,101,99,107,105,
+-    110,103,32,105,102,10,32,32,32,32,32,32,32,32,116,104,
+-    101,32,112,97,116,104,32,114,101,116,117,114,110,101,100,32,
+-    98,121,32,103,101,116,95,102,105,108,101,110,97,109,101,32,
+-    104,97,115,32,97,32,102,105,108,101,110,97,109,101,32,111,
+-    102,32,39,95,95,105,110,105,116,95,95,46,112,121,39,46,
+-    105,1,0,0,0,117,1,0,0,0,46,105,0,0,0,0,
+-    105,2,0,0,0,117,8,0,0,0,95,95,105,110,105,116,
+-    95,95,40,4,0,0,0,117,11,0,0,0,95,112,97,116,
+-    104,95,115,112,108,105,116,117,12,0,0,0,103,101,116,95,
+-    102,105,108,101,110,97,109,101,117,6,0,0,0,114,115,112,
+-    108,105,116,117,10,0,0,0,114,112,97,114,116,105,116,105,
+-    111,110,40,5,0,0,0,117,4,0,0,0,115,101,108,102,
+-    117,8,0,0,0,102,117,108,108,110,97,109,101,117,8,0,
+-    0,0,102,105,108,101,110,97,109,101,117,13,0,0,0,102,
+-    105,108,101,110,97,109,101,95,98,97,115,101,117,9,0,0,
+-    0,116,97,105,108,95,110,97,109,101,40,0,0,0,0,40,
+-    0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
+-    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
+-    115,116,114,97,112,62,117,10,0,0,0,105,115,95,112,97,
+-    99,107,97,103,101,28,3,0,0,115,8,0,0,0,0,3,
+-    25,1,22,1,19,1,117,24,0,0,0,95,76,111,97,100,
+-    101,114,66,97,115,105,99,115,46,105,115,95,112,97,99,107,
+-    97,103,101,99,5,0,0,0,0,0,0,0,12,0,0,0,
+-    22,0,0,0,67,0,0,0,115,198,1,0,0,124,2,0,
+-    100,1,0,100,2,0,133,2,0,25,125,5,0,124,2,0,
+-    100,2,0,100,3,0,133,2,0,25,125,6,0,124,2,0,
+-    100,3,0,100,4,0,133,2,0,25,125,7,0,124,5,0,
+-    116,0,0,107,3,0,114,105,0,100,5,0,106,1,0,124,
+-    1,0,124,5,0,131,2,0,125,8,0,116,2,0,124,8,
+-    0,100,6,0,124,1,0,100,7,0,124,3,0,131,1,2,
+-    130,1,0,110,116,0,116,3,0,124,6,0,131,1,0,100,
+-    2,0,107,3,0,114,163,0,100,8,0,106,1,0,124,1,
+-    0,131,1,0,125,9,0,116,4,0,124,9,0,131,1,0,
+-    1,116,5,0,124,9,0,131,1,0,130,1,0,110,58,0,
+-    116,3,0,124,7,0,131,1,0,100,2,0,107,3,0,114,
+-    221,0,100,9,0,106,1,0,124,1,0,131,1,0,125,9,
+-    0,116,4,0,124,9,0,131,1,0,1,116,5,0,124,9,
+-    0,131,1,0,130,1,0,110,0,0,124,4,0,100,1,0,
+-    107,9,0,114,184,1,121,20,0,116,7,0,124,4,0,100,
+-    10,0,25,131,1,0,125,10,0,87,110,18,0,4,116,8,
+-    0,107,10,0,114,17,1,1,1,1,89,110,71,0,88,116,
+-    9,0,124,6,0,131,1,0,124,10,0,107,3,0,114,88,
+-    1,100,11,0,106,1,0,124,1,0,131,1,0,125,9,0,
+-    116,4,0,124,9,0,131,1,0,1,116,2,0,124,9,0,
+-    100,6,0,124,1,0,100,7,0,124,3,0,131,1,2,130,
+-    1,0,110,0,0,121,18,0,124,4,0,100,12,0,25,100,
+-    13,0,64,125,11,0,87,110,18,0,4,116,8,0,107,10,
+-    0,114,126,1,1,1,1,89,113,184,1,88,116,9,0,124,
+-    7,0,131,1,0,124,11,0,107,3,0,114,184,1,116,2,
+-    0,100,11,0,106,1,0,124,1,0,131,1,0,100,6,0,
+-    124,1,0,100,7,0,124,3,0,131,1,2,130,1,0,113,
+-    184,1,110,0,0,124,2,0,100,4,0,100,1,0,133,2,
+-    0,25,83,40,14,0,0,0,117,193,0,0,0,82,101,116,
+-    117,114,110,32,116,104,101,32,109,97,114,115,104,97,108,108,
+-    101,100,32,98,121,116,101,115,32,102,114,111,109,32,98,121,
+-    116,101,99,111,100,101,44,32,118,101,114,105,102,121,105,110,
+-    103,32,116,104,101,32,109,97,103,105,99,10,32,32,32,32,
+-    32,32,32,32,110,117,109,98,101,114,44,32,116,105,109,101,
+-    115,116,97,109,112,32,97,110,100,32,115,111,117,114,99,101,
+-    32,115,105,122,101,32,97,108,111,110,103,32,116,104,101,32,
+-    119,97,121,46,10,10,32,32,32,32,32,32,32,32,73,102,
+-    32,115,111,117,114,99,101,95,115,116,97,116,115,32,105,115,
+-    32,78,111,110,101,32,116,104,101,110,32,115,107,105,112,32,
+-    116,104,101,32,116,105,109,101,115,116,97,109,112,32,99,104,
+-    101,99,107,46,10,10,32,32,32,32,32,32,32,32,78,105,
+-    4,0,0,0,105,8,0,0,0,105,12,0,0,0,117,30,
+-    0,0,0,98,97,100,32,109,97,103,105,99,32,110,117,109,
+-    98,101,114,32,105,110,32,123,33,114,125,58,32,123,33,114,
+-    125,117,4,0,0,0,110,97,109,101,117,4,0,0,0,112,
+-    97,116,104,117,19,0,0,0,98,97,100,32,116,105,109,101,
+-    115,116,97,109,112,32,105,110,32,123,125,117,14,0,0,0,
+-    98,97,100,32,115,105,122,101,32,105,110,32,123,125,117,5,
+-    0,0,0,109,116,105,109,101,117,24,0,0,0,98,121,116,
+-    101,99,111,100,101,32,105,115,32,115,116,97,108,101,32,102,
+-    111,114,32,123,125,117,4,0,0,0,115,105,122,101,108,3,
+-    0,0,0,255,127,255,127,3,0,40,10,0,0,0,117,12,
+-    0,0,0,95,77,65,71,73,67,95,66,89,84,69,83,117,
+-    6,0,0,0,102,111,114,109,97,116,117,11,0,0,0,73,
+-    109,112,111,114,116,69,114,114,111,114,117,3,0,0,0,108,
+-    101,110,117,16,0,0,0,95,118,101,114,98,111,115,101,95,
+-    109,101,115,115,97,103,101,117,8,0,0,0,69,79,70,69,
+-    114,114,111,114,117,4,0,0,0,78,111,110,101,117,3,0,
+-    0,0,105,110,116,117,8,0,0,0,75,101,121,69,114,114,
+-    111,114,117,7,0,0,0,95,114,95,108,111,110,103,40,12,
+-    0,0,0,117,4,0,0,0,115,101,108,102,117,8,0,0,
+-    0,102,117,108,108,110,97,109,101,117,4,0,0,0,100,97,
+-    116,97,117,13,0,0,0,98,121,116,101,99,111,100,101,95,
+-    112,97,116,104,117,12,0,0,0,115,111,117,114,99,101,95,
+-    115,116,97,116,115,117,5,0,0,0,109,97,103,105,99,117,
+-    13,0,0,0,114,97,119,95,116,105,109,101,115,116,97,109,
+-    112,117,8,0,0,0,114,97,119,95,115,105,122,101,117,3,
+-    0,0,0,109,115,103,117,7,0,0,0,109,101,115,115,97,
+-    103,101,117,12,0,0,0,115,111,117,114,99,101,95,109,116,
+-    105,109,101,117,11,0,0,0,115,111,117,114,99,101,95,115,
+-    105,122,101,40,0,0,0,0,40,0,0,0,0,117,29,0,
+-    0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,
+-    108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,
+-    20,0,0,0,95,98,121,116,101,115,95,102,114,111,109,95,
+-    98,121,116,101,99,111,100,101,36,3,0,0,115,66,0,0,
+-    0,0,7,16,1,16,1,16,1,12,1,18,1,27,1,18,
+-    1,15,1,10,1,15,1,18,1,15,1,10,1,15,1,12,
+-    1,3,1,20,1,13,1,5,2,18,1,15,1,10,1,15,
+-    1,12,1,3,1,18,1,13,1,5,2,18,1,3,1,15,
+-    1,21,3,117,34,0,0,0,95,76,111,97,100,101,114,66,
+-    97,115,105,99,115,46,95,98,121,116,101,115,95,102,114,111,
+-    109,95,98,121,116,101,99,111,100,101,117,10,0,0,0,115,
+-    111,117,114,99,101,108,101,115,115,99,2,0,0,0,1,0,
+-    0,0,5,0,0,0,12,0,0,0,67,0,0,0,115,227,
+-    0,0,0,124,1,0,106,0,0,125,3,0,124,0,0,106,
+-    1,0,124,3,0,131,1,0,125,4,0,124,0,0,106,2,
+-    0,124,3,0,131,1,0,124,1,0,95,3,0,124,2,0,
+-    115,106,0,121,22,0,116,4,0,124,1,0,106,3,0,131,
+-    1,0,124,1,0,95,5,0,87,113,118,0,4,116,6,0,
+-    107,10,0,114,102,0,1,1,1,124,1,0,106,3,0,124,
+-    1,0,95,5,0,89,113,118,0,88,110,12,0,124,1,0,
+-    106,3,0,124,1,0,95,5,0,124,3,0,124,1,0,95,
+-    7,0,124,0,0,106,8,0,124,3,0,131,1,0,114,170,
+-    0,116,9,0,124,1,0,106,3,0,131,1,0,100,1,0,
+-    25,103,1,0,124,1,0,95,10,0,110,25,0,124,1,0,
+-    106,7,0,106,11,0,100,2,0,131,1,0,100,1,0,25,
+-    124,1,0,95,7,0,124,0,0,124,1,0,95,12,0,116,
+-    13,0,116,14,0,124,4,0,124,1,0,106,15,0,131,3,
+-    0,1,124,1,0,83,40,3,0,0,0,117,82,0,0,0,
+-    72,101,108,112,101,114,32,102,111,114,32,108,111,97,100,95,
+-    109,111,100,117,108,101,32,97,98,108,101,32,116,111,32,104,
+-    97,110,100,108,101,32,101,105,116,104,101,114,32,115,111,117,
+-    114,99,101,32,111,114,32,115,111,117,114,99,101,108,101,115,
+-    115,10,32,32,32,32,32,32,32,32,108,111,97,100,105,110,
+-    103,46,105,0,0,0,0,117,1,0,0,0,46,40,16,0,
+-    0,0,117,8,0,0,0,95,95,110,97,109,101,95,95,117,
+-    8,0,0,0,103,101,116,95,99,111,100,101,117,12,0,0,
+-    0,103,101,116,95,102,105,108,101,110,97,109,101,117,8,0,
+-    0,0,95,95,102,105,108,101,95,95,117,17,0,0,0,99,
+-    97,99,104,101,95,102,114,111,109,95,115,111,117,114,99,101,
+-    117,10,0,0,0,95,95,99,97,99,104,101,100,95,95,117,
+-    19,0,0,0,78,111,116,73,109,112,108,101,109,101,110,116,
+-    101,100,69,114,114,111,114,117,11,0,0,0,95,95,112,97,
+-    99,107,97,103,101,95,95,117,10,0,0,0,105,115,95,112,
+-    97,99,107,97,103,101,117,11,0,0,0,95,112,97,116,104,
+-    95,115,112,108,105,116,117,8,0,0,0,95,95,112,97,116,
+-    104,95,95,117,10,0,0,0,114,112,97,114,116,105,116,105,
+-    111,110,117,10,0,0,0,95,95,108,111,97,100,101,114,95,
+-    95,117,25,0,0,0,95,99,97,108,108,95,119,105,116,104,
+-    95,102,114,97,109,101,115,95,114,101,109,111,118,101,100,117,
+-    4,0,0,0,101,120,101,99,117,8,0,0,0,95,95,100,
+-    105,99,116,95,95,40,5,0,0,0,117,4,0,0,0,115,
+-    101,108,102,117,6,0,0,0,109,111,100,117,108,101,117,10,
+-    0,0,0,115,111,117,114,99,101,108,101,115,115,117,4,0,
+-    0,0,110,97,109,101,117,11,0,0,0,99,111,100,101,95,
+-    111,98,106,101,99,116,40,0,0,0,0,40,0,0,0,0,
+-    117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,
+-    111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,
+-    112,62,117,12,0,0,0,95,108,111,97,100,95,109,111,100,
+-    117,108,101,81,3,0,0,115,32,0,0,0,0,4,9,1,
+-    15,1,18,1,6,1,3,1,22,1,13,1,20,2,12,1,
+-    9,1,15,1,28,2,25,1,9,1,19,1,117,26,0,0,
+-    0,95,76,111,97,100,101,114,66,97,115,105,99,115,46,95,
+-    108,111,97,100,95,109,111,100,117,108,101,78,70,40,9,0,
+-    0,0,117,8,0,0,0,95,95,110,97,109,101,95,95,117,
+-    10,0,0,0,95,95,109,111,100,117,108,101,95,95,117,12,
+-    0,0,0,95,95,113,117,97,108,110,97,109,101,95,95,117,
+-    7,0,0,0,95,95,100,111,99,95,95,117,10,0,0,0,
+-    105,115,95,112,97,99,107,97,103,101,117,20,0,0,0,95,
+-    98,121,116,101,115,95,102,114,111,109,95,98,121,116,101,99,
+-    111,100,101,117,17,0,0,0,109,111,100,117,108,101,95,102,
+-    111,114,95,108,111,97,100,101,114,117,5,0,0,0,70,97,
+-    108,115,101,117,12,0,0,0,95,108,111,97,100,95,109,111,
+-    100,117,108,101,40,1,0,0,0,117,10,0,0,0,95,95,
+-    108,111,99,97,108,115,95,95,40,0,0,0,0,40,0,0,
+-    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+-    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,13,0,0,0,95,76,111,97,100,101,114,
+-    66,97,115,105,99,115,23,3,0,0,115,10,0,0,0,16,
+-    3,6,2,12,8,12,45,6,1,117,13,0,0,0,95,76,
+-    111,97,100,101,114,66,97,115,105,99,115,99,1,0,0,0,
+-    0,0,0,0,1,0,0,0,2,0,0,0,66,0,0,0,
+-    115,104,0,0,0,124,0,0,69,101,0,0,90,1,0,100,
+-    0,0,90,2,0,100,1,0,100,2,0,132,0,0,90,3,
+-    0,100,3,0,100,4,0,132,0,0,90,4,0,100,5,0,
+-    100,6,0,132,0,0,90,5,0,100,7,0,100,8,0,132,
+-    0,0,90,6,0,100,9,0,100,10,0,132,0,0,90,7,
+-    0,100,11,0,100,12,0,132,0,0,90,8,0,100,13,0,
+-    100,14,0,132,0,0,90,9,0,100,15,0,83,40,16,0,
+-    0,0,117,12,0,0,0,83,111,117,114,99,101,76,111,97,
+-    100,101,114,99,2,0,0,0,0,0,0,0,2,0,0,0,
+-    1,0,0,0,67,0,0,0,115,10,0,0,0,116,0,0,
+-    130,1,0,100,1,0,83,40,2,0,0,0,117,121,0,0,
+-    0,79,112,116,105,111,110,97,108,32,109,101,116,104,111,100,
+-    32,116,104,97,116,32,114,101,116,117,114,110,115,32,116,104,
+-    101,32,109,111,100,105,102,105,99,97,116,105,111,110,32,116,
+-    105,109,101,32,40,97,110,32,105,110,116,41,32,102,111,114,
+-    32,116,104,101,10,32,32,32,32,32,32,32,32,115,112,101,
+-    99,105,102,105,101,100,32,112,97,116,104,44,32,119,104,101,
+-    114,101,32,112,97,116,104,32,105,115,32,97,32,115,116,114,
+-    46,10,32,32,32,32,32,32,32,32,78,40,1,0,0,0,
+-    117,19,0,0,0,78,111,116,73,109,112,108,101,109,101,110,
+-    116,101,100,69,114,114,111,114,40,2,0,0,0,117,4,0,
+-    0,0,115,101,108,102,117,4,0,0,0,112,97,116,104,40,
+-    0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,
+-    114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,
+-    95,98,111,111,116,115,116,114,97,112,62,117,10,0,0,0,
+-    112,97,116,104,95,109,116,105,109,101,107,3,0,0,115,2,
+-    0,0,0,0,4,117,23,0,0,0,83,111,117,114,99,101,
+-    76,111,97,100,101,114,46,112,97,116,104,95,109,116,105,109,
+-    101,99,2,0,0,0,0,0,0,0,2,0,0,0,3,0,
+-    0,0,67,0,0,0,115,20,0,0,0,105,1,0,124,0,
+-    0,106,0,0,124,1,0,131,1,0,100,1,0,54,83,40,
+-    2,0,0,0,117,114,1,0,0,79,112,116,105,111,110,97,
+-    108,32,109,101,116,104,111,100,32,114,101,116,117,114,110,105,
+-    110,103,32,97,32,109,101,116,97,100,97,116,97,32,100,105,
+-    99,116,32,102,111,114,32,116,104,101,32,115,112,101,99,105,
+-    102,105,101,100,32,112,97,116,104,10,32,32,32,32,32,32,
+-    32,32,116,111,32,98,121,32,116,104,101,32,112,97,116,104,
+-    32,40,115,116,114,41,46,10,32,32,32,32,32,32,32,32,
+-    80,111,115,115,105,98,108,101,32,107,101,121,115,58,10,32,
+-    32,32,32,32,32,32,32,45,32,39,109,116,105,109,101,39,
+-    32,40,109,97,110,100,97,116,111,114,121,41,32,105,115,32,
+-    116,104,101,32,110,117,109,101,114,105,99,32,116,105,109,101,
+-    115,116,97,109,112,32,111,102,32,108,97,115,116,32,115,111,
+-    117,114,99,101,10,32,32,32,32,32,32,32,32,32,32,99,
+-    111,100,101,32,109,111,100,105,102,105,99,97,116,105,111,110,
+-    59,10,32,32,32,32,32,32,32,32,45,32,39,115,105,122,
+-    101,39,32,40,111,112,116,105,111,110,97,108,41,32,105,115,
+-    32,116,104,101,32,115,105,122,101,32,105,110,32,98,121,116,
+-    101,115,32,111,102,32,116,104,101,32,115,111,117,114,99,101,
+-    32,99,111,100,101,46,10,10,32,32,32,32,32,32,32,32,
+-    73,109,112,108,101,109,101,110,116,105,110,103,32,116,104,105,
+-    115,32,109,101,116,104,111,100,32,97,108,108,111,119,115,32,
+-    116,104,101,32,108,111,97,100,101,114,32,116,111,32,114,101,
+-    97,100,32,98,121,116,101,99,111,100,101,32,102,105,108,101,
+-    115,46,10,32,32,32,32,32,32,32,32,117,5,0,0,0,
+-    109,116,105,109,101,40,1,0,0,0,117,10,0,0,0,112,
+-    97,116,104,95,109,116,105,109,101,40,2,0,0,0,117,4,
+-    0,0,0,115,101,108,102,117,4,0,0,0,112,97,116,104,
++    116,115,116,114,97,112,62,117,12,0,0,0,83,111,117,114,
++    99,101,76,111,97,100,101,114,105,3,0,0,115,14,0,0,
++    0,16,2,12,6,12,12,12,10,12,9,12,22,12,62,117,
++    12,0,0,0,83,111,117,114,99,101,76,111,97,100,101,114,
++    99,1,0,0,0,0,0,0,0,1,0,0,0,4,0,0,
++    0,2,0,0,0,115,92,0,0,0,124,0,0,69,101,0,
++    0,90,1,0,100,0,0,90,2,0,100,1,0,90,3,0,
++    100,2,0,100,3,0,132,0,0,90,4,0,101,5,0,135,
++    0,0,102,1,0,100,4,0,100,5,0,134,0,0,131,1,
++    0,90,6,0,101,5,0,100,6,0,100,7,0,132,0,0,
++    131,1,0,90,7,0,100,8,0,100,9,0,132,0,0,90,
++    8,0,135,0,0,83,40,10,0,0,0,117,10,0,0,0,
++    70,105,108,101,76,111,97,100,101,114,117,103,0,0,0,66,
++    97,115,101,32,102,105,108,101,32,108,111,97,100,101,114,32,
++    99,108,97,115,115,32,119,104,105,99,104,32,105,109,112,108,
++    101,109,101,110,116,115,32,116,104,101,32,108,111,97,100,101,
++    114,32,112,114,111,116,111,99,111,108,32,109,101,116,104,111,
++    100,115,32,116,104,97,116,10,32,32,32,32,114,101,113,117,
++    105,114,101,32,102,105,108,101,32,115,121,115,116,101,109,32,
++    117,115,97,103,101,46,99,3,0,0,0,0,0,0,0,3,
++    0,0,0,2,0,0,0,67,0,0,0,115,22,0,0,0,
++    124,1,0,124,0,0,95,0,0,124,2,0,124,0,0,95,
++    1,0,100,1,0,83,40,2,0,0,0,117,75,0,0,0,
++    67,97,99,104,101,32,116,104,101,32,109,111,100,117,108,101,
++    32,110,97,109,101,32,97,110,100,32,116,104,101,32,112,97,
++    116,104,32,116,111,32,116,104,101,32,102,105,108,101,32,102,
++    111,117,110,100,32,98,121,32,116,104,101,10,32,32,32,32,
++    32,32,32,32,102,105,110,100,101,114,46,78,40,2,0,0,
++    0,117,4,0,0,0,110,97,109,101,117,4,0,0,0,112,
++    97,116,104,40,3,0,0,0,117,4,0,0,0,115,101,108,
++    102,117,8,0,0,0,102,117,108,108,110,97,109,101,117,4,
++    0,0,0,112,97,116,104,40,0,0,0,0,40,0,0,0,
++    0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,
++    112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,
++    97,112,62,117,8,0,0,0,95,95,105,110,105,116,95,95,
++    244,3,0,0,115,4,0,0,0,0,3,9,1,117,19,0,
++    0,0,70,105,108,101,76,111,97,100,101,114,46,95,95,105,
++    110,105,116,95,95,99,2,0,0,0,0,0,0,0,2,0,
++    0,0,3,0,0,0,3,0,0,0,115,22,0,0,0,116,
++    0,0,116,1,0,124,0,0,131,2,0,106,2,0,124,1,
++    0,131,1,0,83,40,1,0,0,0,117,26,0,0,0,76,
++    111,97,100,32,97,32,109,111,100,117,108,101,32,102,114,111,
++    109,32,97,32,102,105,108,101,46,40,3,0,0,0,117,5,
++    0,0,0,115,117,112,101,114,117,10,0,0,0,70,105,108,
++    101,76,111,97,100,101,114,117,11,0,0,0,108,111,97,100,
++    95,109,111,100,117,108,101,40,2,0,0,0,117,4,0,0,
++    0,115,101,108,102,117,8,0,0,0,102,117,108,108,110,97,
++    109,101,40,1,0,0,0,117,9,0,0,0,95,95,99,108,
++    97,115,115,95,95,40,0,0,0,0,117,29,0,0,0,60,
++    102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,
++    46,95,98,111,111,116,115,116,114,97,112,62,117,11,0,0,
++    0,108,111,97,100,95,109,111,100,117,108,101,250,3,0,0,
++    115,2,0,0,0,0,5,117,22,0,0,0,70,105,108,101,
++    76,111,97,100,101,114,46,108,111,97,100,95,109,111,100,117,
++    108,101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,
++    0,0,0,67,0,0,0,115,7,0,0,0,124,0,0,106,
++    0,0,83,40,1,0,0,0,117,58,0,0,0,82,101,116,
++    117,114,110,32,116,104,101,32,112,97,116,104,32,116,111,32,
++    116,104,101,32,115,111,117,114,99,101,32,102,105,108,101,32,
++    97,115,32,102,111,117,110,100,32,98,121,32,116,104,101,32,
++    102,105,110,100,101,114,46,40,1,0,0,0,117,4,0,0,
++    0,112,97,116,104,40,2,0,0,0,117,4,0,0,0,115,
++    101,108,102,117,8,0,0,0,102,117,108,108,110,97,109,101,
+     40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,
+     102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,
+-    46,95,98,111,111,116,115,116,114,97,112,62,117,10,0,0,
+-    0,112,97,116,104,95,115,116,97,116,115,113,3,0,0,115,
+-    2,0,0,0,0,10,117,23,0,0,0,83,111,117,114,99,
+-    101,76,111,97,100,101,114,46,112,97,116,104,95,115,116,97,
+-    116,115,99,4,0,0,0,0,0,0,0,4,0,0,0,3,
+-    0,0,0,67,0,0,0,115,16,0,0,0,124,0,0,106,
+-    0,0,124,2,0,124,3,0,131,2,0,83,40,1,0,0,
+-    0,117,228,0,0,0,79,112,116,105,111,110,97,108,32,109,
+-    101,116,104,111,100,32,119,104,105,99,104,32,119,114,105,116,
+-    101,115,32,100,97,116,97,32,40,98,121,116,101,115,41,32,
+-    116,111,32,97,32,102,105,108,101,32,112,97,116,104,32,40,
+-    97,32,115,116,114,41,46,10,10,32,32,32,32,32,32,32,
+-    32,73,109,112,108,101,109,101,110,116,105,110,103,32,116,104,
+-    105,115,32,109,101,116,104,111,100,32,97,108,108,111,119,115,
+-    32,102,111,114,32,116,104,101,32,119,114,105,116,105,110,103,
+-    32,111,102,32,98,121,116,101,99,111,100,101,32,102,105,108,
+-    101,115,46,10,10,32,32,32,32,32,32,32,32,84,104,101,
+-    32,115,111,117,114,99,101,32,112,97,116,104,32,105,115,32,
+-    110,101,101,100,101,100,32,105,110,32,111,114,100,101,114,32,
+-    116,111,32,99,111,114,114,101,99,116,108,121,32,116,114,97,
+-    110,115,102,101,114,32,112,101,114,109,105,115,115,105,111,110,
+-    115,10,32,32,32,32,32,32,32,32,40,1,0,0,0,117,
+-    8,0,0,0,115,101,116,95,100,97,116,97,40,4,0,0,
+-    0,117,4,0,0,0,115,101,108,102,117,11,0,0,0,115,
+-    111,117,114,99,101,95,112,97,116,104,117,10,0,0,0,99,
+-    97,99,104,101,95,112,97,116,104,117,4,0,0,0,100,97,
+-    116,97,40,0,0,0,0,40,0,0,0,0,117,29,0,0,
+-    0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,
+-    105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,15,
+-    0,0,0,95,99,97,99,104,101,95,98,121,116,101,99,111,
+-    100,101,125,3,0,0,115,2,0,0,0,0,8,117,28,0,
+-    0,0,83,111,117,114,99,101,76,111,97,100,101,114,46,95,
+-    99,97,99,104,101,95,98,121,116,101,99,111,100,101,99,3,
+-    0,0,0,0,0,0,0,3,0,0,0,1,0,0,0,67,
+-    0,0,0,115,10,0,0,0,116,0,0,130,1,0,100,1,
+-    0,83,40,2,0,0,0,117,151,0,0,0,79,112,116,105,
+-    111,110,97,108,32,109,101,116,104,111,100,32,119,104,105,99,
+-    104,32,119,114,105,116,101,115,32,100,97,116,97,32,40,98,
+-    121,116,101,115,41,32,116,111,32,97,32,102,105,108,101,32,
+-    112,97,116,104,32,40,97,32,115,116,114,41,46,10,10,32,
+-    32,32,32,32,32,32,32,73,109,112,108,101,109,101,110,116,
+-    105,110,103,32,116,104,105,115,32,109,101,116,104,111,100,32,
+-    97,108,108,111,119,115,32,102,111,114,32,116,104,101,32,119,
+-    114,105,116,105,110,103,32,111,102,32,98,121,116,101,99,111,
+-    100,101,32,102,105,108,101,115,46,10,10,32,32,32,32,32,
+-    32,32,32,78,40,1,0,0,0,117,19,0,0,0,78,111,
+-    116,73,109,112,108,101,109,101,110,116,101,100,69,114,114,111,
+-    114,40,3,0,0,0,117,4,0,0,0,115,101,108,102,117,
+-    4,0,0,0,112,97,116,104,117,4,0,0,0,100,97,116,
+-    97,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
+-    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
+-    98,46,95,98,111,111,116,115,116,114,97,112,62,117,8,0,
+-    0,0,115,101,116,95,100,97,116,97,135,3,0,0,115,2,
+-    0,0,0,0,6,117,21,0,0,0,83,111,117,114,99,101,
+-    76,111,97,100,101,114,46,115,101,116,95,100,97,116,97,99,
+-    2,0,0,0,0,0,0,0,9,0,0,0,44,0,0,0,
+-    67,0,0,0,115,62,1,0,0,100,1,0,100,2,0,108,
+-    0,0,125,2,0,124,0,0,106,1,0,124,1,0,131,1,
+-    0,125,3,0,121,19,0,124,0,0,106,2,0,124,3,0,
+-    131,1,0,125,4,0,87,110,58,0,4,116,3,0,107,10,
+-    0,114,106,0,1,125,5,0,1,122,26,0,116,4,0,100,
+-    3,0,100,4,0,124,1,0,131,1,1,124,5,0,130,2,
+-    0,87,89,100,2,0,100,2,0,125,5,0,126,5,0,88,
+-    110,1,0,88,116,5,0,106,6,0,124,4,0,131,1,0,
+-    106,7,0,125,6,0,121,19,0,124,2,0,106,8,0,124,
+-    6,0,131,1,0,125,7,0,87,110,58,0,4,116,9,0,
+-    107,10,0,114,204,0,1,125,5,0,1,122,26,0,116,4,
+-    0,100,5,0,100,4,0,124,1,0,131,1,1,124,5,0,
+-    130,2,0,87,89,100,2,0,100,2,0,125,5,0,126,5,
+-    0,88,110,1,0,88,116,5,0,106,10,0,100,2,0,100,
+-    7,0,131,2,0,125,8,0,121,30,0,124,8,0,106,13,
+-    0,124,4,0,106,13,0,124,7,0,100,1,0,25,131,1,
+-    0,131,1,0,83,87,110,58,0,4,116,14,0,107,10,0,
+-    114,57,1,1,125,5,0,1,122,26,0,116,4,0,100,6,
+-    0,100,4,0,124,1,0,131,1,1,124,5,0,130,2,0,
+-    87,89,100,2,0,100,2,0,125,5,0,126,5,0,88,110,
+-    1,0,88,100,2,0,83,40,8,0,0,0,117,52,0,0,
+-    0,67,111,110,99,114,101,116,101,32,105,109,112,108,101,109,
+-    101,110,116,97,116,105,111,110,32,111,102,32,73,110,115,112,
+-    101,99,116,76,111,97,100,101,114,46,103,101,116,95,115,111,
+-    117,114,99,101,46,105,0,0,0,0,78,117,39,0,0,0,
+-    115,111,117,114,99,101,32,110,111,116,32,97,118,97,105,108,
+-    97,98,108,101,32,116,104,114,111,117,103,104,32,103,101,116,
+-    95,100,97,116,97,40,41,117,4,0,0,0,110,97,109,101,
+-    117,25,0,0,0,70,97,105,108,101,100,32,116,111,32,100,
+-    101,116,101,99,116,32,101,110,99,111,100,105,110,103,117,28,
+-    0,0,0,70,97,105,108,101,100,32,116,111,32,100,101,99,
+-    111,100,101,32,115,111,117,114,99,101,32,102,105,108,101,84,
+-    40,15,0,0,0,117,8,0,0,0,116,111,107,101,110,105,
+-    122,101,117,12,0,0,0,103,101,116,95,102,105,108,101,110,
+-    97,109,101,117,8,0,0,0,103,101,116,95,100,97,116,97,
+-    117,7,0,0,0,73,79,69,114,114,111,114,117,11,0,0,
+-    0,73,109,112,111,114,116,69,114,114,111,114,117,3,0,0,
+-    0,95,105,111,117,7,0,0,0,66,121,116,101,115,73,79,
+-    117,8,0,0,0,114,101,97,100,108,105,110,101,117,15,0,
+-    0,0,100,101,116,101,99,116,95,101,110,99,111,100,105,110,
+-    103,117,11,0,0,0,83,121,110,116,97,120,69,114,114,111,
+-    114,117,25,0,0,0,73,110,99,114,101,109,101,110,116,97,
+-    108,78,101,119,108,105,110,101,68,101,99,111,100,101,114,117,
+-    4,0,0,0,78,111,110,101,117,4,0,0,0,84,114,117,
+-    101,117,6,0,0,0,100,101,99,111,100,101,117,18,0,0,
+-    0,85,110,105,99,111,100,101,68,101,99,111,100,101,69,114,
+-    114,111,114,40,9,0,0,0,117,4,0,0,0,115,101,108,
+-    102,117,8,0,0,0,102,117,108,108,110,97,109,101,117,8,
+-    0,0,0,116,111,107,101,110,105,122,101,117,4,0,0,0,
+-    112,97,116,104,117,12,0,0,0,115,111,117,114,99,101,95,
+-    98,121,116,101,115,117,3,0,0,0,101,120,99,117,10,0,
+-    0,0,114,101,97,100,115,111,117,114,99,101,117,8,0,0,
+-    0,101,110,99,111,100,105,110,103,117,15,0,0,0,110,101,
+-    119,108,105,110,101,95,100,101,99,111,100,101,114,40,0,0,
++    46,95,98,111,111,116,115,116,114,97,112,62,117,12,0,0,
++    0,103,101,116,95,102,105,108,101,110,97,109,101,1,4,0,
++    0,115,2,0,0,0,0,3,117,23,0,0,0,70,105,108,
++    101,76,111,97,100,101,114,46,103,101,116,95,102,105,108,101,
++    110,97,109,101,99,2,0,0,0,0,0,0,0,3,0,0,
++    0,8,0,0,0,67,0,0,0,115,41,0,0,0,116,0,
++    0,106,1,0,124,1,0,100,1,0,131,2,0,143,17,0,
++    125,2,0,124,2,0,106,2,0,131,0,0,83,87,100,2,
++    0,81,88,100,2,0,83,40,3,0,0,0,117,39,0,0,
++    0,82,101,116,117,114,110,32,116,104,101,32,100,97,116,97,
++    32,102,114,111,109,32,112,97,116,104,32,97,115,32,114,97,
++    119,32,98,121,116,101,115,46,117,1,0,0,0,114,78,40,
++    3,0,0,0,117,3,0,0,0,95,105,111,117,6,0,0,
++    0,70,105,108,101,73,79,117,4,0,0,0,114,101,97,100,
++    40,3,0,0,0,117,4,0,0,0,115,101,108,102,117,4,
++    0,0,0,112,97,116,104,117,4,0,0,0,102,105,108,101,
++    40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,
++    102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,
++    46,95,98,111,111,116,115,116,114,97,112,62,117,8,0,0,
++    0,103,101,116,95,100,97,116,97,6,4,0,0,115,4,0,
++    0,0,0,2,21,1,117,19,0,0,0,70,105,108,101,76,
++    111,97,100,101,114,46,103,101,116,95,100,97,116,97,40,9,
++    0,0,0,117,8,0,0,0,95,95,110,97,109,101,95,95,
++    117,10,0,0,0,95,95,109,111,100,117,108,101,95,95,117,
++    12,0,0,0,95,95,113,117,97,108,110,97,109,101,95,95,
++    117,7,0,0,0,95,95,100,111,99,95,95,117,8,0,0,
++    0,95,95,105,110,105,116,95,95,117,11,0,0,0,95,99,
++    104,101,99,107,95,110,97,109,101,117,11,0,0,0,108,111,
++    97,100,95,109,111,100,117,108,101,117,12,0,0,0,103,101,
++    116,95,102,105,108,101,110,97,109,101,117,8,0,0,0,103,
++    101,116,95,100,97,116,97,40,1,0,0,0,117,10,0,0,
++    0,95,95,108,111,99,97,108,115,95,95,40,0,0,0,0,
++    40,1,0,0,0,117,9,0,0,0,95,95,99,108,97,115,
++    115,95,95,117,29,0,0,0,60,102,114,111,122,101,110,32,
++    105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,
++    116,114,97,112,62,117,10,0,0,0,70,105,108,101,76,111,
++    97,100,101,114,239,3,0,0,115,10,0,0,0,16,3,6,
++    2,12,6,24,7,18,5,117,10,0,0,0,70,105,108,101,
++    76,111,97,100,101,114,99,1,0,0,0,0,0,0,0,1,
++    0,0,0,4,0,0,0,66,0,0,0,115,68,0,0,0,
++    124,0,0,69,101,0,0,90,1,0,100,0,0,90,2,0,
++    100,1,0,90,3,0,100,2,0,100,3,0,132,0,0,90,
++    4,0,100,4,0,100,5,0,132,0,0,90,5,0,100,6,
++    0,100,7,0,100,8,0,100,9,0,132,0,1,90,6,0,
++    100,10,0,83,40,11,0,0,0,117,16,0,0,0,83,111,
++    117,114,99,101,70,105,108,101,76,111,97,100,101,114,117,62,
++    0,0,0,67,111,110,99,114,101,116,101,32,105,109,112,108,
++    101,109,101,110,116,97,116,105,111,110,32,111,102,32,83,111,
++    117,114,99,101,76,111,97,100,101,114,32,117,115,105,110,103,
++    32,116,104,101,32,102,105,108,101,32,115,121,115,116,101,109,
++    46,99,2,0,0,0,0,0,0,0,3,0,0,0,3,0,
++    0,0,67,0,0,0,115,39,0,0,0,116,0,0,106,1,
++    0,124,1,0,131,1,0,125,2,0,105,2,0,124,2,0,
++    106,2,0,100,1,0,54,124,2,0,106,3,0,100,2,0,
++    54,83,40,3,0,0,0,117,33,0,0,0,82,101,116,117,
++    114,110,32,116,104,101,32,109,101,116,97,100,97,116,97,32,
++    102,111,114,32,116,104,101,32,112,97,116,104,46,117,5,0,
++    0,0,109,116,105,109,101,117,4,0,0,0,115,105,122,101,
++    40,4,0,0,0,117,3,0,0,0,95,111,115,117,4,0,
++    0,0,115,116,97,116,117,8,0,0,0,115,116,95,109,116,
++    105,109,101,117,7,0,0,0,115,116,95,115,105,122,101,40,
++    3,0,0,0,117,4,0,0,0,115,101,108,102,117,4,0,
++    0,0,112,97,116,104,117,2,0,0,0,115,116,40,0,0,
+     0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,
+     122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,
+-    111,111,116,115,116,114,97,112,62,117,10,0,0,0,103,101,
+-    116,95,115,111,117,114,99,101,144,3,0,0,115,38,0,0,
+-    0,0,2,12,1,15,1,3,1,19,1,18,1,9,1,31,
+-    1,18,1,3,1,19,1,18,1,9,1,31,1,18,1,3,
+-    1,30,1,18,1,9,1,117,23,0,0,0,83,111,117,114,
+-    99,101,76,111,97,100,101,114,46,103,101,116,95,115,111,117,
+-    114,99,101,99,2,0,0,0,0,0,0,0,12,0,0,0,
+-    45,0,0,0,67,0,0,0,115,52,2,0,0,124,0,0,
+-    106,0,0,124,1,0,131,1,0,125,2,0,100,10,0,125,
+-    3,0,121,16,0,116,2,0,124,2,0,131,1,0,125,4,
+-    0,87,110,24,0,4,116,3,0,107,10,0,114,63,0,1,
+-    1,1,100,10,0,125,4,0,89,110,14,1,88,121,19,0,
+-    124,0,0,106,4,0,124,2,0,131,1,0,125,5,0,87,
+-    110,18,0,4,116,3,0,107,10,0,114,103,0,1,1,1,
+-    89,110,230,0,88,116,5,0,124,5,0,100,1,0,25,131,
+-    1,0,125,3,0,121,19,0,124,0,0,106,6,0,124,4,
+-    0,131,1,0,125,6,0,87,110,18,0,4,116,7,0,107,
+-    10,0,114,159,0,1,1,1,89,110,174,0,88,121,28,0,
+-    124,0,0,106,8,0,124,1,0,124,6,0,124,4,0,124,
+-    5,0,131,4,0,125,7,0,87,110,24,0,4,116,9,0,
+-    116,10,0,102,2,0,107,10,0,114,214,0,1,1,1,89,
+-    110,119,0,88,116,11,0,100,2,0,124,4,0,124,2,0,
+-    131,3,0,1,116,12,0,106,13,0,124,7,0,131,1,0,
+-    125,8,0,116,14,0,124,8,0,116,15,0,131,2,0,114,
+-    38,1,116,16,0,106,17,0,124,8,0,124,2,0,131,2,
+-    0,1,116,11,0,100,3,0,124,4,0,131,2,0,1,124,
+-    8,0,83,100,4,0,125,9,0,116,9,0,124,9,0,106,
+-    18,0,124,4,0,131,1,0,100,5,0,124,1,0,100,6,
+-    0,124,4,0,131,1,2,130,1,0,124,0,0,106,6,0,
+-    124,2,0,131,1,0,125,10,0,116,19,0,116,20,0,124,
+-    10,0,124,2,0,100,7,0,100,8,0,100,11,0,131,4,
+-    1,125,11,0,116,11,0,100,3,0,124,2,0,131,2,0,
+-    1,116,22,0,106,23,0,12,114,48,2,124,4,0,100,10,
+-    0,107,9,0,114,48,2,124,3,0,100,10,0,107,9,0,
+-    114,48,2,116,24,0,116,25,0,131,1,0,125,6,0,124,
+-    6,0,106,26,0,116,27,0,124,3,0,131,1,0,131,1,
+-    0,1,124,6,0,106,26,0,116,27,0,116,28,0,124,10,
+-    0,131,1,0,131,1,0,131,1,0,1,124,6,0,106,26,
+-    0,116,12,0,106,29,0,124,11,0,131,1,0,131,1,0,
+-    1,121,36,0,124,0,0,106,30,0,124,2,0,124,4,0,
+-    124,6,0,131,3,0,1,116,11,0,100,9,0,124,4,0,
+-    131,2,0,1,87,113,48,2,4,116,3,0,107,10,0,114,
+-    44,2,1,1,1,89,113,48,2,88,110,0,0,124,11,0,
+-    83,40,12,0,0,0,117,190,0,0,0,67,111,110,99,114,
+-    101,116,101,32,105,109,112,108,101,109,101,110,116,97,116,105,
+-    111,110,32,111,102,32,73,110,115,112,101,99,116,76,111,97,
+-    100,101,114,46,103,101,116,95,99,111,100,101,46,10,10,32,
+-    32,32,32,32,32,32,32,82,101,97,100,105,110,103,32,111,
+-    102,32,98,121,116,101,99,111,100,101,32,114,101,113,117,105,
+-    114,101,115,32,112,97,116,104,95,115,116,97,116,115,32,116,
+-    111,32,98,101,32,105,109,112,108,101,109,101,110,116,101,100,
+-    46,32,84,111,32,119,114,105,116,101,10,32,32,32,32,32,
+-    32,32,32,98,121,116,101,99,111,100,101,44,32,115,101,116,
+-    95,100,97,116,97,32,109,117,115,116,32,97,108,115,111,32,
+-    98,101,32,105,109,112,108,101,109,101,110,116,101,100,46,10,
+-    10,32,32,32,32,32,32,32,32,117,5,0,0,0,109,116,
+-    105,109,101,117,13,0,0,0,123,125,32,109,97,116,99,104,
+-    101,115,32,123,125,117,19,0,0,0,99,111,100,101,32,111,
+-    98,106,101,99,116,32,102,114,111,109,32,123,125,117,21,0,
+-    0,0,78,111,110,45,99,111,100,101,32,111,98,106,101,99,
+-    116,32,105,110,32,123,125,117,4,0,0,0,110,97,109,101,
+-    117,4,0,0,0,112,97,116,104,117,4,0,0,0,101,120,
+-    101,99,117,12,0,0,0,100,111,110,116,95,105,110,104,101,
+-    114,105,116,117,10,0,0,0,119,114,111,116,101,32,123,33,
+-    114,125,78,84,40,31,0,0,0,117,12,0,0,0,103,101,
+-    116,95,102,105,108,101,110,97,109,101,117,4,0,0,0,78,
+-    111,110,101,117,17,0,0,0,99,97,99,104,101,95,102,114,
+-    111,109,95,115,111,117,114,99,101,117,19,0,0,0,78,111,
+-    116,73,109,112,108,101,109,101,110,116,101,100,69,114,114,111,
+-    114,117,10,0,0,0,112,97,116,104,95,115,116,97,116,115,
+-    117,3,0,0,0,105,110,116,117,8,0,0,0,103,101,116,
+-    95,100,97,116,97,117,7,0,0,0,73,79,69,114,114,111,
+-    114,117,20,0,0,0,95,98,121,116,101,115,95,102,114,111,
+-    109,95,98,121,116,101,99,111,100,101,117,11,0,0,0,73,
+-    109,112,111,114,116,69,114,114,111,114,117,8,0,0,0,69,
+-    79,70,69,114,114,111,114,117,16,0,0,0,95,118,101,114,
+-    98,111,115,101,95,109,101,115,115,97,103,101,117,7,0,0,
+-    0,109,97,114,115,104,97,108,117,5,0,0,0,108,111,97,
+-    100,115,117,10,0,0,0,105,115,105,110,115,116,97,110,99,
+-    101,117,10,0,0,0,95,99,111,100,101,95,116,121,112,101,
+-    117,4,0,0,0,95,105,109,112,117,16,0,0,0,95,102,
+-    105,120,95,99,111,95,102,105,108,101,110,97,109,101,117,6,
+-    0,0,0,102,111,114,109,97,116,117,25,0,0,0,95,99,
+-    97,108,108,95,119,105,116,104,95,102,114,97,109,101,115,95,
+-    114,101,109,111,118,101,100,117,7,0,0,0,99,111,109,112,
+-    105,108,101,117,4,0,0,0,84,114,117,101,117,3,0,0,
+-    0,115,121,115,117,19,0,0,0,100,111,110,116,95,119,114,
+-    105,116,101,95,98,121,116,101,99,111,100,101,117,9,0,0,
+-    0,98,121,116,101,97,114,114,97,121,117,12,0,0,0,95,
+-    77,65,71,73,67,95,66,89,84,69,83,117,6,0,0,0,
+-    101,120,116,101,110,100,117,7,0,0,0,95,119,95,108,111,
+-    110,103,117,3,0,0,0,108,101,110,117,5,0,0,0,100,
+-    117,109,112,115,117,15,0,0,0,95,99,97,99,104,101,95,
+-    98,121,116,101,99,111,100,101,40,12,0,0,0,117,4,0,
+-    0,0,115,101,108,102,117,8,0,0,0,102,117,108,108,110,
+-    97,109,101,117,11,0,0,0,115,111,117,114,99,101,95,112,
+-    97,116,104,117,12,0,0,0,115,111,117,114,99,101,95,109,
+-    116,105,109,101,117,13,0,0,0,98,121,116,101,99,111,100,
+-    101,95,112,97,116,104,117,2,0,0,0,115,116,117,4,0,
+-    0,0,100,97,116,97,117,10,0,0,0,98,121,116,101,115,
+-    95,100,97,116,97,117,5,0,0,0,102,111,117,110,100,117,
+-    3,0,0,0,109,115,103,117,12,0,0,0,115,111,117,114,
+-    99,101,95,98,121,116,101,115,117,11,0,0,0,99,111,100,
+-    101,95,111,98,106,101,99,116,40,0,0,0,0,40,0,0,
+-    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+-    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,8,0,0,0,103,101,116,95,99,111,100,
+-    101,166,3,0,0,115,98,0,0,0,0,7,15,1,6,1,
+-    3,1,16,1,13,1,11,2,3,1,19,1,13,1,5,2,
+-    16,1,3,1,19,1,13,1,5,2,3,1,12,1,3,1,
+-    13,1,19,1,5,2,9,1,7,1,15,1,15,1,16,1,
+-    6,1,7,1,4,2,6,1,18,1,15,1,15,1,6,1,
+-    12,1,9,1,13,1,22,1,12,1,12,1,19,1,25,1,
+-    22,1,3,1,19,1,17,1,13,1,8,1,117,21,0,0,
+-    0,83,111,117,114,99,101,76,111,97,100,101,114,46,103,101,
+-    116,95,99,111,100,101,99,2,0,0,0,0,0,0,0,2,
+-    0,0,0,2,0,0,0,67,0,0,0,115,13,0,0,0,
+-    124,0,0,106,0,0,124,1,0,131,1,0,83,40,1,0,
+-    0,0,117,0,1,0,0,67,111,110,99,114,101,116,101,32,
+-    105,109,112,108,101,109,101,110,116,97,116,105,111,110,32,111,
+-    102,32,76,111,97,100,101,114,46,108,111,97,100,95,109,111,
+-    100,117,108,101,46,10,10,32,32,32,32,32,32,32,32,82,
+-    101,113,117,105,114,101,115,32,69,120,101,99,117,116,105,111,
+-    110,76,111,97,100,101,114,46,103,101,116,95,102,105,108,101,
+-    110,97,109,101,32,97,110,100,32,82,101,115,111,117,114,99,
+-    101,76,111,97,100,101,114,46,103,101,116,95,100,97,116,97,
+-    32,116,111,32,98,101,10,32,32,32,32,32,32,32,32,105,
+-    109,112,108,101,109,101,110,116,101,100,32,116,111,32,108,111,
+-    97,100,32,115,111,117,114,99,101,32,99,111,100,101,46,32,
+-    85,115,101,32,111,102,32,98,121,116,101,99,111,100,101,32,
+-    105,115,32,100,105,99,116,97,116,101,100,32,98,121,32,119,
+-    104,101,116,104,101,114,10,32,32,32,32,32,32,32,32,103,
+-    101,116,95,99,111,100,101,32,117,115,101,115,47,119,114,105,
+-    116,101,115,32,98,121,116,101,99,111,100,101,46,10,10,32,
+-    32,32,32,32,32,32,32,40,1,0,0,0,117,12,0,0,
+-    0,95,108,111,97,100,95,109,111,100,117,108,101,40,2,0,
+-    0,0,117,4,0,0,0,115,101,108,102,117,8,0,0,0,
+-    102,117,108,108,110,97,109,101,40,0,0,0,0,40,0,0,
+-    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+-    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,11,0,0,0,108,111,97,100,95,109,111,
+-    100,117,108,101,228,3,0,0,115,2,0,0,0,0,8,117,
+-    24,0,0,0,83,111,117,114,99,101,76,111,97,100,101,114,
+-    46,108,111,97,100,95,109,111,100,117,108,101,78,40,10,0,
+-    0,0,117,8,0,0,0,95,95,110,97,109,101,95,95,117,
+-    10,0,0,0,95,95,109,111,100,117,108,101,95,95,117,12,
+-    0,0,0,95,95,113,117,97,108,110,97,109,101,95,95,117,
+-    10,0,0,0,112,97,116,104,95,109,116,105,109,101,117,10,
+-    0,0,0,112,97,116,104,95,115,116,97,116,115,117,15,0,
+-    0,0,95,99,97,99,104,101,95,98,121,116,101,99,111,100,
+-    101,117,8,0,0,0,115,101,116,95,100,97,116,97,117,10,
+-    0,0,0,103,101,116,95,115,111,117,114,99,101,117,8,0,
+-    0,0,103,101,116,95,99,111,100,101,117,11,0,0,0,108,
+-    111,97,100,95,109,111,100,117,108,101,40,1,0,0,0,117,
+-    10,0,0,0,95,95,108,111,99,97,108,115,95,95,40,0,
+-    0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,
+-    111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,
+-    98,111,111,116,115,116,114,97,112,62,117,12,0,0,0,83,
+-    111,117,114,99,101,76,111,97,100,101,114,105,3,0,0,115,
+-    14,0,0,0,16,2,12,6,12,12,12,10,12,9,12,22,
+-    12,62,117,12,0,0,0,83,111,117,114,99,101,76,111,97,
+-    100,101,114,99,1,0,0,0,0,0,0,0,1,0,0,0,
+-    4,0,0,0,2,0,0,0,115,92,0,0,0,124,0,0,
+-    69,101,0,0,90,1,0,100,0,0,90,2,0,100,1,0,
+-    90,3,0,100,2,0,100,3,0,132,0,0,90,4,0,101,
+-    5,0,135,0,0,102,1,0,100,4,0,100,5,0,134,0,
+-    0,131,1,0,90,6,0,101,5,0,100,6,0,100,7,0,
+-    132,0,0,131,1,0,90,7,0,100,8,0,100,9,0,132,
+-    0,0,90,8,0,135,0,0,83,40,10,0,0,0,117,10,
+-    0,0,0,70,105,108,101,76,111,97,100,101,114,117,103,0,
+-    0,0,66,97,115,101,32,102,105,108,101,32,108,111,97,100,
+-    101,114,32,99,108,97,115,115,32,119,104,105,99,104,32,105,
+-    109,112,108,101,109,101,110,116,115,32,116,104,101,32,108,111,
+-    97,100,101,114,32,112,114,111,116,111,99,111,108,32,109,101,
+-    116,104,111,100,115,32,116,104,97,116,10,32,32,32,32,114,
+-    101,113,117,105,114,101,32,102,105,108,101,32,115,121,115,116,
+-    101,109,32,117,115,97,103,101,46,99,3,0,0,0,0,0,
+-    0,0,3,0,0,0,2,0,0,0,67,0,0,0,115,22,
+-    0,0,0,124,1,0,124,0,0,95,0,0,124,2,0,124,
+-    0,0,95,1,0,100,1,0,83,40,2,0,0,0,117,75,
+-    0,0,0,67,97,99,104,101,32,116,104,101,32,109,111,100,
+-    117,108,101,32,110,97,109,101,32,97,110,100,32,116,104,101,
+-    32,112,97,116,104,32,116,111,32,116,104,101,32,102,105,108,
+-    101,32,102,111,117,110,100,32,98,121,32,116,104,101,10,32,
+-    32,32,32,32,32,32,32,102,105,110,100,101,114,46,78,40,
+-    2,0,0,0,117,4,0,0,0,110,97,109,101,117,4,0,
+-    0,0,112,97,116,104,40,3,0,0,0,117,4,0,0,0,
+-    115,101,108,102,117,8,0,0,0,102,117,108,108,110,97,109,
+-    101,117,4,0,0,0,112,97,116,104,40,0,0,0,0,40,
+-    0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
+-    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
+-    115,116,114,97,112,62,117,8,0,0,0,95,95,105,110,105,
+-    116,95,95,244,3,0,0,115,4,0,0,0,0,3,9,1,
+-    117,19,0,0,0,70,105,108,101,76,111,97,100,101,114,46,
+-    95,95,105,110,105,116,95,95,99,2,0,0,0,0,0,0,
+-    0,2,0,0,0,3,0,0,0,3,0,0,0,115,22,0,
+-    0,0,116,0,0,116,1,0,124,0,0,131,2,0,106,2,
+-    0,124,1,0,131,1,0,83,40,1,0,0,0,117,26,0,
+-    0,0,76,111,97,100,32,97,32,109,111,100,117,108,101,32,
+-    102,114,111,109,32,97,32,102,105,108,101,46,40,3,0,0,
+-    0,117,5,0,0,0,115,117,112,101,114,117,10,0,0,0,
+-    70,105,108,101,76,111,97,100,101,114,117,11,0,0,0,108,
+-    111,97,100,95,109,111,100,117,108,101,40,2,0,0,0,117,
+-    4,0,0,0,115,101,108,102,117,8,0,0,0,102,117,108,
+-    108,110,97,109,101,40,1,0,0,0,117,9,0,0,0,95,
+-    95,99,108,97,115,115,95,95,40,0,0,0,0,117,29,0,
+-    0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,
+-    108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,
+-    11,0,0,0,108,111,97,100,95,109,111,100,117,108,101,250,
+-    3,0,0,115,2,0,0,0,0,5,117,22,0,0,0,70,
+-    105,108,101,76,111,97,100,101,114,46,108,111,97,100,95,109,
+-    111,100,117,108,101,99,2,0,0,0,0,0,0,0,2,0,
+-    0,0,1,0,0,0,67,0,0,0,115,7,0,0,0,124,
+-    0,0,106,0,0,83,40,1,0,0,0,117,58,0,0,0,
+-    82,101,116,117,114,110,32,116,104,101,32,112,97,116,104,32,
+-    116,111,32,116,104,101,32,115,111,117,114,99,101,32,102,105,
+-    108,101,32,97,115,32,102,111,117,110,100,32,98,121,32,116,
+-    104,101,32,102,105,110,100,101,114,46,40,1,0,0,0,117,
+-    4,0,0,0,112,97,116,104,40,2,0,0,0,117,4,0,
+-    0,0,115,101,108,102,117,8,0,0,0,102,117,108,108,110,
+-    97,109,101,40,0,0,0,0,40,0,0,0,0,117,29,0,
+-    0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,
+-    108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,
+-    12,0,0,0,103,101,116,95,102,105,108,101,110,97,109,101,
+-    1,4,0,0,115,2,0,0,0,0,3,117,23,0,0,0,
+-    70,105,108,101,76,111,97,100,101,114,46,103,101,116,95,102,
+-    105,108,101,110,97,109,101,99,2,0,0,0,0,0,0,0,
+-    3,0,0,0,8,0,0,0,67,0,0,0,115,41,0,0,
+-    0,116,0,0,106,1,0,124,1,0,100,1,0,131,2,0,
+-    143,17,0,125,2,0,124,2,0,106,2,0,131,0,0,83,
+-    87,100,2,0,81,88,100,2,0,83,40,3,0,0,0,117,
+-    39,0,0,0,82,101,116,117,114,110,32,116,104,101,32,100,
+-    97,116,97,32,102,114,111,109,32,112,97,116,104,32,97,115,
+-    32,114,97,119,32,98,121,116,101,115,46,117,1,0,0,0,
+-    114,78,40,3,0,0,0,117,3,0,0,0,95,105,111,117,
+-    6,0,0,0,70,105,108,101,73,79,117,4,0,0,0,114,
+-    101,97,100,40,3,0,0,0,117,4,0,0,0,115,101,108,
+-    102,117,4,0,0,0,112,97,116,104,117,4,0,0,0,102,
+-    105,108,101,40,0,0,0,0,40,0,0,0,0,117,29,0,
+-    0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,
+-    108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,
+-    8,0,0,0,103,101,116,95,100,97,116,97,6,4,0,0,
+-    115,4,0,0,0,0,2,21,1,117,19,0,0,0,70,105,
+-    108,101,76,111,97,100,101,114,46,103,101,116,95,100,97,116,
+-    97,40,9,0,0,0,117,8,0,0,0,95,95,110,97,109,
+-    101,95,95,117,10,0,0,0,95,95,109,111,100,117,108,101,
+-    95,95,117,12,0,0,0,95,95,113,117,97,108,110,97,109,
+-    101,95,95,117,7,0,0,0,95,95,100,111,99,95,95,117,
+-    8,0,0,0,95,95,105,110,105,116,95,95,117,11,0,0,
+-    0,95,99,104,101,99,107,95,110,97,109,101,117,11,0,0,
+-    0,108,111,97,100,95,109,111,100,117,108,101,117,12,0,0,
+-    0,103,101,116,95,102,105,108,101,110,97,109,101,117,8,0,
+-    0,0,103,101,116,95,100,97,116,97,40,1,0,0,0,117,
+-    10,0,0,0,95,95,108,111,99,97,108,115,95,95,40,0,
+-    0,0,0,40,1,0,0,0,117,9,0,0,0,95,95,99,
+-    108,97,115,115,95,95,117,29,0,0,0,60,102,114,111,122,
+-    101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,
+-    111,116,115,116,114,97,112,62,117,10,0,0,0,70,105,108,
+-    101,76,111,97,100,101,114,239,3,0,0,115,10,0,0,0,
+-    16,3,6,2,12,6,24,7,18,5,117,10,0,0,0,70,
+-    105,108,101,76,111,97,100,101,114,99,1,0,0,0,0,0,
+-    0,0,1,0,0,0,4,0,0,0,66,0,0,0,115,68,
+-    0,0,0,124,0,0,69,101,0,0,90,1,0,100,0,0,
+-    90,2,0,100,1,0,90,3,0,100,2,0,100,3,0,132,
+-    0,0,90,4,0,100,4,0,100,5,0,132,0,0,90,5,
+-    0,100,6,0,100,7,0,100,8,0,100,9,0,132,0,1,
+-    90,6,0,100,10,0,83,40,11,0,0,0,117,16,0,0,
++    111,111,116,115,116,114,97,112,62,117,10,0,0,0,112,97,
++    116,104,95,115,116,97,116,115,16,4,0,0,115,4,0,0,
++    0,0,2,15,1,117,27,0,0,0,83,111,117,114,99,101,
++    70,105,108,101,76,111,97,100,101,114,46,112,97,116,104,95,
++    115,116,97,116,115,99,4,0,0,0,0,0,0,0,5,0,
++    0,0,13,0,0,0,67,0,0,0,115,81,0,0,0,121,
++    22,0,116,0,0,106,1,0,124,1,0,131,1,0,106,2,
++    0,125,4,0,87,110,24,0,4,116,3,0,107,10,0,114,
++    48,0,1,1,1,100,1,0,125,4,0,89,110,1,0,88,
++    124,4,0,100,2,0,79,125,4,0,124,0,0,106,4,0,
++    124,2,0,124,3,0,100,3,0,124,4,0,131,2,1,83,
++    40,4,0,0,0,78,105,182,1,0,0,105,128,0,0,0,
++    117,5,0,0,0,95,109,111,100,101,40,5,0,0,0,117,
++    3,0,0,0,95,111,115,117,4,0,0,0,115,116,97,116,
++    117,7,0,0,0,115,116,95,109,111,100,101,117,7,0,0,
++    0,79,83,69,114,114,111,114,117,8,0,0,0,115,101,116,
++    95,100,97,116,97,40,5,0,0,0,117,4,0,0,0,115,
++    101,108,102,117,11,0,0,0,115,111,117,114,99,101,95,112,
++    97,116,104,117,13,0,0,0,98,121,116,101,99,111,100,101,
++    95,112,97,116,104,117,4,0,0,0,100,97,116,97,117,4,
++    0,0,0,109,111,100,101,40,0,0,0,0,40,0,0,0,
++    0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,
++    112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,
++    97,112,62,117,15,0,0,0,95,99,97,99,104,101,95,98,
++    121,116,101,99,111,100,101,21,4,0,0,115,12,0,0,0,
++    0,2,3,1,22,1,13,1,11,3,10,1,117,32,0,0,
+     0,83,111,117,114,99,101,70,105,108,101,76,111,97,100,101,
+-    114,117,62,0,0,0,67,111,110,99,114,101,116,101,32,105,
+-    109,112,108,101,109,101,110,116,97,116,105,111,110,32,111,102,
+-    32,83,111,117,114,99,101,76,111,97,100,101,114,32,117,115,
+-    105,110,103,32,116,104,101,32,102,105,108,101,32,115,121,115,
+-    116,101,109,46,99,2,0,0,0,0,0,0,0,3,0,0,
+-    0,3,0,0,0,67,0,0,0,115,39,0,0,0,116,0,
+-    0,106,1,0,124,1,0,131,1,0,125,2,0,105,2,0,
+-    124,2,0,106,2,0,100,1,0,54,124,2,0,106,3,0,
+-    100,2,0,54,83,40,3,0,0,0,117,33,0,0,0,82,
+-    101,116,117,114,110,32,116,104,101,32,109,101,116,97,100,97,
+-    116,97,32,102,111,114,32,116,104,101,32,112,97,116,104,46,
+-    117,5,0,0,0,109,116,105,109,101,117,4,0,0,0,115,
+-    105,122,101,40,4,0,0,0,117,3,0,0,0,95,111,115,
+-    117,4,0,0,0,115,116,97,116,117,8,0,0,0,115,116,
+-    95,109,116,105,109,101,117,7,0,0,0,115,116,95,115,105,
+-    122,101,40,3,0,0,0,117,4,0,0,0,115,101,108,102,
+-    117,4,0,0,0,112,97,116,104,117,2,0,0,0,115,116,
+-    40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,
+-    102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,
+-    46,95,98,111,111,116,115,116,114,97,112,62,117,10,0,0,
+-    0,112,97,116,104,95,115,116,97,116,115,16,4,0,0,115,
+-    4,0,0,0,0,2,15,1,117,27,0,0,0,83,111,117,
+-    114,99,101,70,105,108,101,76,111,97,100,101,114,46,112,97,
+-    116,104,95,115,116,97,116,115,99,4,0,0,0,0,0,0,
+-    0,5,0,0,0,13,0,0,0,67,0,0,0,115,71,0,
+-    0,0,121,22,0,116,0,0,106,1,0,124,1,0,131,1,
+-    0,106,2,0,125,4,0,87,110,24,0,4,116,3,0,107,
+-    10,0,114,48,0,1,1,1,100,1,0,125,4,0,89,110,
+-    1,0,88,124,0,0,106,4,0,124,2,0,124,3,0,100,
+-    2,0,124,4,0,131,2,1,83,40,3,0,0,0,78,105,
+-    182,1,0,0,117,5,0,0,0,95,109,111,100,101,40,5,
+-    0,0,0,117,3,0,0,0,95,111,115,117,4,0,0,0,
+-    115,116,97,116,117,7,0,0,0,115,116,95,109,111,100,101,
+-    117,7,0,0,0,79,83,69,114,114,111,114,117,8,0,0,
+-    0,115,101,116,95,100,97,116,97,40,5,0,0,0,117,4,
+-    0,0,0,115,101,108,102,117,11,0,0,0,115,111,117,114,
+-    99,101,95,112,97,116,104,117,13,0,0,0,98,121,116,101,
+-    99,111,100,101,95,112,97,116,104,117,4,0,0,0,100,97,
+-    116,97,117,4,0,0,0,109,111,100,101,40,0,0,0,0,
+-    40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,
+-    110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,
+-    116,115,116,114,97,112,62,117,15,0,0,0,95,99,97,99,
+-    104,101,95,98,121,116,101,99,111,100,101,21,4,0,0,115,
+-    10,0,0,0,0,2,3,1,22,1,13,1,11,1,117,32,
+-    0,0,0,83,111,117,114,99,101,70,105,108,101,76,111,97,
+-    100,101,114,46,95,99,97,99,104,101,95,98,121,116,101,99,
+-    111,100,101,117,5,0,0,0,95,109,111,100,101,105,182,1,
+-    0,0,99,3,0,0,0,1,0,0,0,8,0,0,0,13,
+-    0,0,0,67,0,0,0,115,245,0,0,0,116,0,0,124,
+-    1,0,131,1,0,92,2,0,125,4,0,125,5,0,103,0,
+-    0,125,6,0,120,54,0,124,4,0,114,80,0,116,1,0,
+-    124,4,0,131,1,0,12,114,80,0,116,0,0,124,4,0,
+-    131,1,0,92,2,0,125,4,0,125,7,0,124,6,0,106,
+-    2,0,124,7,0,131,1,0,1,113,27,0,87,120,97,0,
+-    116,3,0,124,6,0,131,1,0,68,93,83,0,125,7,0,
+-    116,4,0,124,4,0,124,7,0,131,2,0,125,4,0,121,
+-    17,0,116,5,0,106,6,0,124,4,0,131,1,0,1,87,
+-    113,94,0,4,116,7,0,107,10,0,114,155,0,1,1,1,
+-    119,94,0,89,113,94,0,4,116,8,0,107,10,0,114,176,
+-    0,1,1,1,100,1,0,83,89,113,94,0,88,113,94,0,
+-    87,121,33,0,116,9,0,124,1,0,124,2,0,124,3,0,
+-    131,3,0,1,116,10,0,100,2,0,124,1,0,131,2,0,
+-    1,87,110,24,0,4,116,8,0,116,7,0,102,2,0,107,
+-    10,0,114,240,0,1,1,1,89,110,1,0,88,100,1,0,
+-    83,40,3,0,0,0,117,27,0,0,0,87,114,105,116,101,
+-    32,98,121,116,101,115,32,100,97,116,97,32,116,111,32,97,
+-    32,102,105,108,101,46,78,117,12,0,0,0,99,114,101,97,
+-    116,101,100,32,123,33,114,125,40,11,0,0,0,117,11,0,
+-    0,0,95,112,97,116,104,95,115,112,108,105,116,117,11,0,
+-    0,0,95,112,97,116,104,95,105,115,100,105,114,117,6,0,
+-    0,0,97,112,112,101,110,100,117,8,0,0,0,114,101,118,
+-    101,114,115,101,100,117,10,0,0,0,95,112,97,116,104,95,
+-    106,111,105,110,117,3,0,0,0,95,111,115,117,5,0,0,
+-    0,109,107,100,105,114,117,15,0,0,0,70,105,108,101,69,
+-    120,105,115,116,115,69,114,114,111,114,117,15,0,0,0,80,
+-    101,114,109,105,115,115,105,111,110,69,114,114,111,114,117,13,
+-    0,0,0,95,119,114,105,116,101,95,97,116,111,109,105,99,
+-    117,16,0,0,0,95,118,101,114,98,111,115,101,95,109,101,
+-    115,115,97,103,101,40,8,0,0,0,117,4,0,0,0,115,
+-    101,108,102,117,4,0,0,0,112,97,116,104,117,4,0,0,
+-    0,100,97,116,97,117,5,0,0,0,95,109,111,100,101,117,
+-    6,0,0,0,112,97,114,101,110,116,117,8,0,0,0,102,
+-    105,108,101,110,97,109,101,117,10,0,0,0,112,97,116,104,
+-    95,112,97,114,116,115,117,4,0,0,0,112,97,114,116,40,
+-    0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,
+-    114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,
+-    95,98,111,111,116,115,116,114,97,112,62,117,8,0,0,0,
+-    115,101,116,95,100,97,116,97,29,4,0,0,115,36,0,0,
+-    0,0,2,18,1,6,2,22,1,18,1,17,2,19,1,15,
+-    1,3,1,17,1,13,2,7,1,13,3,13,1,3,1,16,
+-    1,17,1,19,3,117,25,0,0,0,83,111,117,114,99,101,
++    114,46,95,99,97,99,104,101,95,98,121,116,101,99,111,100,
++    101,117,5,0,0,0,95,109,111,100,101,105,182,1,0,0,
++    99,3,0,0,0,1,0,0,0,9,0,0,0,18,0,0,
++    0,67,0,0,0,115,53,1,0,0,116,0,0,124,1,0,
++    131,1,0,92,2,0,125,4,0,125,5,0,103,0,0,125,
++    6,0,120,54,0,124,4,0,114,80,0,116,1,0,124,4,
++    0,131,1,0,12,114,80,0,116,0,0,124,4,0,131,1,
++    0,92,2,0,125,4,0,125,7,0,124,6,0,106,2,0,
++    124,7,0,131,1,0,1,113,27,0,87,120,132,0,116,3,
++    0,124,6,0,131,1,0,68,93,118,0,125,7,0,116,4,
++    0,124,4,0,124,7,0,131,2,0,125,4,0,121,17,0,
++    116,5,0,106,6,0,124,4,0,131,1,0,1,87,113,94,
++    0,4,116,7,0,107,10,0,114,155,0,1,1,1,119,94,
++    0,89,113,94,0,4,116,8,0,107,10,0,114,211,0,1,
++    125,8,0,1,122,25,0,116,9,0,100,1,0,124,4,0,
++    124,8,0,131,3,0,1,100,2,0,83,87,89,100,2,0,
++    100,2,0,125,8,0,126,8,0,88,113,94,0,88,113,94,
++    0,87,121,33,0,116,10,0,124,1,0,124,2,0,124,3,
++    0,131,3,0,1,116,9,0,100,3,0,124,1,0,131,2,
++    0,1,87,110,53,0,4,116,8,0,107,10,0,114,48,1,
++    1,125,8,0,1,122,21,0,116,9,0,100,1,0,124,1,
++    0,124,8,0,131,3,0,1,87,89,100,2,0,100,2,0,
++    125,8,0,126,8,0,88,110,1,0,88,100,2,0,83,40,
++    4,0,0,0,117,27,0,0,0,87,114,105,116,101,32,98,
++    121,116,101,115,32,100,97,116,97,32,116,111,32,97,32,102,
++    105,108,101,46,117,27,0,0,0,99,111,117,108,100,32,110,
++    111,116,32,99,114,101,97,116,101,32,123,33,114,125,58,32,
++    123,33,114,125,78,117,12,0,0,0,99,114,101,97,116,101,
++    100,32,123,33,114,125,40,11,0,0,0,117,11,0,0,0,
++    95,112,97,116,104,95,115,112,108,105,116,117,11,0,0,0,
++    95,112,97,116,104,95,105,115,100,105,114,117,6,0,0,0,
++    97,112,112,101,110,100,117,8,0,0,0,114,101,118,101,114,
++    115,101,100,117,10,0,0,0,95,112,97,116,104,95,106,111,
++    105,110,117,3,0,0,0,95,111,115,117,5,0,0,0,109,
++    107,100,105,114,117,15,0,0,0,70,105,108,101,69,120,105,
++    115,116,115,69,114,114,111,114,117,7,0,0,0,79,83,69,
++    114,114,111,114,117,16,0,0,0,95,118,101,114,98,111,115,
++    101,95,109,101,115,115,97,103,101,117,13,0,0,0,95,119,
++    114,105,116,101,95,97,116,111,109,105,99,40,9,0,0,0,
++    117,4,0,0,0,115,101,108,102,117,4,0,0,0,112,97,
++    116,104,117,4,0,0,0,100,97,116,97,117,5,0,0,0,
++    95,109,111,100,101,117,6,0,0,0,112,97,114,101,110,116,
++    117,8,0,0,0,102,105,108,101,110,97,109,101,117,10,0,
++    0,0,112,97,116,104,95,112,97,114,116,115,117,4,0,0,
++    0,112,97,114,116,117,3,0,0,0,101,120,99,40,0,0,
++    0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,
++    122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,
++    111,111,116,115,116,114,97,112,62,117,8,0,0,0,115,101,
++    116,95,100,97,116,97,32,4,0,0,115,38,0,0,0,0,
++    2,18,1,6,2,22,1,18,1,17,2,19,1,15,1,3,
++    1,17,1,13,2,7,1,18,3,16,1,27,1,3,1,16,
++    1,17,1,18,2,117,25,0,0,0,83,111,117,114,99,101,
+     70,105,108,101,76,111,97,100,101,114,46,115,101,116,95,100,
+     97,116,97,78,40,7,0,0,0,117,8,0,0,0,95,95,
+     110,97,109,101,95,95,117,10,0,0,0,95,95,109,111,100,
+@@ -2544,7 +2550,7 @@
+     111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,
+     112,62,117,16,0,0,0,83,111,117,114,99,101,70,105,108,
+     101,76,111,97,100,101,114,12,4,0,0,115,8,0,0,0,
+-    16,2,6,2,12,5,12,8,117,16,0,0,0,83,111,117,
++    16,2,6,2,12,5,12,11,117,16,0,0,0,83,111,117,
+     114,99,101,70,105,108,101,76,111,97,100,101,114,99,1,0,
+     0,0,0,0,0,0,1,0,0,0,2,0,0,0,66,0,
+     0,0,115,62,0,0,0,124,0,0,69,101,0,0,90,1,
+@@ -2567,7 +2573,7 @@
+     109,101,40,0,0,0,0,40,0,0,0,0,117,29,0,0,
+     0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,
+     105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,11,
+-    0,0,0,108,111,97,100,95,109,111,100,117,108,101,62,4,
++    0,0,0,108,111,97,100,95,109,111,100,117,108,101,65,4,
+     0,0,115,2,0,0,0,0,1,117,32,0,0,0,83,111,
+     117,114,99,101,108,101,115,115,70,105,108,101,76,111,97,100,
+     101,114,46,108,111,97,100,95,109,111,100,117,108,101,99,2,
+@@ -2604,7 +2610,7 @@
+     0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,
+     122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,
+     111,111,116,115,116,114,97,112,62,117,8,0,0,0,103,101,
+-    116,95,99,111,100,101,65,4,0,0,115,18,0,0,0,0,
++    116,95,99,111,100,101,68,4,0,0,115,18,0,0,0,0,
+     1,15,1,15,1,24,1,15,1,15,1,13,1,4,2,18,
+     1,117,29,0,0,0,83,111,117,114,99,101,108,101,115,115,
+     70,105,108,101,76,111,97,100,101,114,46,103,101,116,95,99,
+@@ -2619,7 +2625,7 @@
+     0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,
+     101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,
+     111,116,115,116,114,97,112,62,117,10,0,0,0,103,101,116,
+-    95,115,111,117,114,99,101,77,4,0,0,115,2,0,0,0,
++    95,115,111,117,114,99,101,80,4,0,0,115,2,0,0,0,
+     0,2,117,31,0,0,0,83,111,117,114,99,101,108,101,115,
+     115,70,105,108,101,76,111,97,100,101,114,46,103,101,116,95,
+     115,111,117,114,99,101,78,40,7,0,0,0,117,8,0,0,
+@@ -2634,7 +2640,7 @@
+     29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
+     114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
+     62,117,20,0,0,0,83,111,117,114,99,101,108,101,115,115,
+-    70,105,108,101,76,111,97,100,101,114,58,4,0,0,115,8,
++    70,105,108,101,76,111,97,100,101,114,61,4,0,0,115,8,
+     0,0,0,16,2,6,2,12,3,12,12,117,20,0,0,0,
+     83,111,117,114,99,101,108,101,115,115,70,105,108,101,76,111,
+     97,100,101,114,99,1,0,0,0,0,0,0,0,1,0,0,
+@@ -2663,7 +2669,7 @@
+     116,104,40,0,0,0,0,40,0,0,0,0,117,29,0,0,
+     0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,
+     105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,8,
+-    0,0,0,95,95,105,110,105,116,95,95,94,4,0,0,115,
++    0,0,0,95,95,105,110,105,116,95,95,97,4,0,0,115,
+     4,0,0,0,0,1,9,1,117,28,0,0,0,69,120,116,
+     101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114,
+     46,95,95,105,110,105,116,95,95,99,2,0,0,0,0,0,
+@@ -2702,7 +2708,7 @@
+     0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,
+     105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,
+     116,114,97,112,62,117,11,0,0,0,108,111,97,100,95,109,
+-    111,100,117,108,101,98,4,0,0,115,24,0,0,0,0,5,
++    111,100,117,108,101,101,4,0,0,115,24,0,0,0,0,5,
+     15,1,3,1,9,1,15,1,16,1,31,1,28,1,8,1,
+     3,1,22,1,13,1,117,31,0,0,0,69,120,116,101,110,
+     115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,108,
+@@ -2726,7 +2732,7 @@
+     0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
+     32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
+     115,116,114,97,112,62,117,9,0,0,0,60,103,101,110,101,
+-    120,112,114,62,119,4,0,0,115,2,0,0,0,6,1,117,
++    120,112,114,62,122,4,0,0,115,2,0,0,0,6,1,117,
+     49,0,0,0,69,120,116,101,110,115,105,111,110,70,105,108,
+     101,76,111,97,100,101,114,46,105,115,95,112,97,99,107,97,
+     103,101,46,60,108,111,99,97,108,115,62,46,60,103,101,110,
+@@ -2740,7 +2746,7 @@
+     95,110,97,109,101,117,29,0,0,0,60,102,114,111,122,101,
+     110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,
+     116,115,116,114,97,112,62,117,10,0,0,0,105,115,95,112,
+-    97,99,107,97,103,101,116,4,0,0,115,6,0,0,0,0,
++    97,99,107,97,103,101,119,4,0,0,115,6,0,0,0,0,
+     2,19,1,18,1,117,30,0,0,0,69,120,116,101,110,115,
+     105,111,110,70,105,108,101,76,111,97,100,101,114,46,105,115,
+     95,112,97,99,107,97,103,101,99,2,0,0,0,0,0,0,
+@@ -2756,7 +2762,7 @@
+     0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,
+     105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,
+     116,114,97,112,62,117,8,0,0,0,103,101,116,95,99,111,
+-    100,101,122,4,0,0,115,2,0,0,0,0,2,117,28,0,
++    100,101,125,4,0,0,115,2,0,0,0,0,2,117,28,0,
+     0,0,69,120,116,101,110,115,105,111,110,70,105,108,101,76,
+     111,97,100,101,114,46,103,101,116,95,99,111,100,101,99,2,
+     0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,
+@@ -2771,7 +2777,7 @@
+     29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
+     114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
+     62,117,10,0,0,0,103,101,116,95,115,111,117,114,99,101,
+-    126,4,0,0,115,2,0,0,0,0,2,117,30,0,0,0,
++    129,4,0,0,115,2,0,0,0,0,2,117,30,0,0,0,
+     69,120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,
+     100,101,114,46,103,101,116,95,115,111,117,114,99,101,78,40,
+     12,0,0,0,117,8,0,0,0,95,95,110,97,109,101,95,
+@@ -2790,7 +2796,7 @@
+     0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+     109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+     114,97,112,62,117,19,0,0,0,69,120,116,101,110,115,105,
+-    111,110,70,105,108,101,76,111,97,100,101,114,86,4,0,0,
++    111,110,70,105,108,101,76,111,97,100,101,114,89,4,0,0,
+     115,16,0,0,0,16,6,6,2,12,4,3,1,3,1,24,
+     16,12,6,12,4,117,19,0,0,0,69,120,116,101,110,115,
+     105,111,110,70,105,108,101,76,111,97,100,101,114,99,1,0,
+@@ -2805,7 +2811,7 @@
+     0,100,16,0,100,17,0,132,0,0,90,11,0,100,18,0,
+     100,19,0,132,0,0,90,12,0,100,20,0,83,40,21,0,
+     0,0,117,14,0,0,0,95,78,97,109,101,115,112,97,99,
+-    101,80,97,116,104,117,37,1,0,0,82,101,112,114,101,115,
++    101,80,97,116,104,117,38,1,0,0,82,101,112,114,101,115,
+     101,110,116,115,32,97,32,110,97,109,101,115,112,97,99,101,
+     32,112,97,99,107,97,103,101,39,115,32,112,97,116,104,46,
+     32,32,73,116,32,117,115,101,115,32,116,104,101,32,109,111,
+@@ -2820,1575 +2826,1599 @@
+     111,119,110,32,112,97,116,104,32,105,115,32,114,101,99,111,
+     109,112,117,116,101,100,44,10,32,32,32,32,117,115,105,110,
+     103,32,112,97,116,104,95,102,105,110,100,101,114,46,32,32,
+-    70,111,114,32,116,111,112,45,108,101,118,101,32,109,111,100,
+-    117,108,101,115,44,32,116,104,101,32,112,97,114,101,110,116,
+-    32,109,111,100,117,108,101,39,115,32,112,97,116,104,10,32,
+-    32,32,32,105,115,32,115,121,115,46,112,97,116,104,46,99,
+-    4,0,0,0,0,0,0,0,4,0,0,0,2,0,0,0,
+-    67,0,0,0,115,52,0,0,0,124,1,0,124,0,0,95,
+-    0,0,124,2,0,124,0,0,95,1,0,116,2,0,124,0,
+-    0,106,3,0,131,0,0,131,1,0,124,0,0,95,4,0,
+-    124,3,0,124,0,0,95,5,0,100,0,0,83,40,1,0,
+-    0,0,78,40,6,0,0,0,117,5,0,0,0,95,110,97,
+-    109,101,117,5,0,0,0,95,112,97,116,104,117,5,0,0,
+-    0,116,117,112,108,101,117,16,0,0,0,95,103,101,116,95,
+-    112,97,114,101,110,116,95,112,97,116,104,117,17,0,0,0,
+-    95,108,97,115,116,95,112,97,114,101,110,116,95,112,97,116,
+-    104,117,12,0,0,0,95,112,97,116,104,95,102,105,110,100,
+-    101,114,40,4,0,0,0,117,4,0,0,0,115,101,108,102,
+-    117,4,0,0,0,110,97,109,101,117,4,0,0,0,112,97,
+-    116,104,117,11,0,0,0,112,97,116,104,95,102,105,110,100,
+-    101,114,40,0,0,0,0,40,0,0,0,0,117,29,0,0,
+-    0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,
+-    105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,8,
+-    0,0,0,95,95,105,110,105,116,95,95,138,4,0,0,115,
+-    8,0,0,0,0,1,9,1,9,1,21,1,117,23,0,0,
+-    0,95,78,97,109,101,115,112,97,99,101,80,97,116,104,46,
+-    95,95,105,110,105,116,95,95,99,1,0,0,0,0,0,0,
+-    0,4,0,0,0,3,0,0,0,67,0,0,0,115,53,0,
+-    0,0,124,0,0,106,0,0,106,1,0,100,1,0,131,1,
+-    0,92,3,0,125,1,0,125,2,0,125,3,0,124,2,0,
+-    100,2,0,107,2,0,114,43,0,100,6,0,83,124,1,0,
+-    100,5,0,102,2,0,83,40,7,0,0,0,117,62,0,0,
+-    0,82,101,116,117,114,110,115,32,97,32,116,117,112,108,101,
+-    32,111,102,32,40,112,97,114,101,110,116,45,109,111,100,117,
+-    108,101,45,110,97,109,101,44,32,112,97,114,101,110,116,45,
+-    112,97,116,104,45,97,116,116,114,45,110,97,109,101,41,117,
+-    1,0,0,0,46,117,0,0,0,0,117,3,0,0,0,115,
+-    121,115,117,4,0,0,0,112,97,116,104,117,8,0,0,0,
+-    95,95,112,97,116,104,95,95,40,2,0,0,0,117,3,0,
+-    0,0,115,121,115,117,4,0,0,0,112,97,116,104,40,2,
+-    0,0,0,117,5,0,0,0,95,110,97,109,101,117,10,0,
+-    0,0,114,112,97,114,116,105,116,105,111,110,40,4,0,0,
+-    0,117,4,0,0,0,115,101,108,102,117,6,0,0,0,112,
+-    97,114,101,110,116,117,3,0,0,0,100,111,116,117,2,0,
+-    0,0,109,101,40,0,0,0,0,40,0,0,0,0,117,29,
+-    0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,
+-    116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,
+-    117,23,0,0,0,95,102,105,110,100,95,112,97,114,101,110,
+-    116,95,112,97,116,104,95,110,97,109,101,115,144,4,0,0,
+-    115,8,0,0,0,0,2,27,1,12,2,4,3,117,38,0,
++    70,111,114,32,116,111,112,45,108,101,118,101,108,32,109,111,
++    100,117,108,101,115,44,32,116,104,101,32,112,97,114,101,110,
++    116,32,109,111,100,117,108,101,39,115,32,112,97,116,104,10,
++    32,32,32,32,105,115,32,115,121,115,46,112,97,116,104,46,
++    99,4,0,0,0,0,0,0,0,4,0,0,0,2,0,0,
++    0,67,0,0,0,115,52,0,0,0,124,1,0,124,0,0,
++    95,0,0,124,2,0,124,0,0,95,1,0,116,2,0,124,
++    0,0,106,3,0,131,0,0,131,1,0,124,0,0,95,4,
++    0,124,3,0,124,0,0,95,5,0,100,0,0,83,40,1,
++    0,0,0,78,40,6,0,0,0,117,5,0,0,0,95,110,
++    97,109,101,117,5,0,0,0,95,112,97,116,104,117,5,0,
++    0,0,116,117,112,108,101,117,16,0,0,0,95,103,101,116,
++    95,112,97,114,101,110,116,95,112,97,116,104,117,17,0,0,
++    0,95,108,97,115,116,95,112,97,114,101,110,116,95,112,97,
++    116,104,117,12,0,0,0,95,112,97,116,104,95,102,105,110,
++    100,101,114,40,4,0,0,0,117,4,0,0,0,115,101,108,
++    102,117,4,0,0,0,110,97,109,101,117,4,0,0,0,112,
++    97,116,104,117,11,0,0,0,112,97,116,104,95,102,105,110,
++    100,101,114,40,0,0,0,0,40,0,0,0,0,117,29,0,
++    0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,
++    108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,
++    8,0,0,0,95,95,105,110,105,116,95,95,141,4,0,0,
++    115,8,0,0,0,0,1,9,1,9,1,21,1,117,23,0,
+     0,0,95,78,97,109,101,115,112,97,99,101,80,97,116,104,
+-    46,95,102,105,110,100,95,112,97,114,101,110,116,95,112,97,
+-    116,104,95,110,97,109,101,115,99,1,0,0,0,0,0,0,
+-    0,3,0,0,0,3,0,0,0,67,0,0,0,115,38,0,
+-    0,0,124,0,0,106,0,0,131,0,0,92,2,0,125,1,
+-    0,125,2,0,116,1,0,116,2,0,106,3,0,124,1,0,
+-    25,124,2,0,131,2,0,83,40,1,0,0,0,78,40,4,
+-    0,0,0,117,23,0,0,0,95,102,105,110,100,95,112,97,
+-    114,101,110,116,95,112,97,116,104,95,110,97,109,101,115,117,
+-    7,0,0,0,103,101,116,97,116,116,114,117,3,0,0,0,
+-    115,121,115,117,7,0,0,0,109,111,100,117,108,101,115,40,
+-    3,0,0,0,117,4,0,0,0,115,101,108,102,117,18,0,
+-    0,0,112,97,114,101,110,116,95,109,111,100,117,108,101,95,
+-    110,97,109,101,117,14,0,0,0,112,97,116,104,95,97,116,
+-    116,114,95,110,97,109,101,40,0,0,0,0,40,0,0,0,
+-    0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,
+-    112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,
+-    97,112,62,117,16,0,0,0,95,103,101,116,95,112,97,114,
+-    101,110,116,95,112,97,116,104,154,4,0,0,115,4,0,0,
+-    0,0,1,18,1,117,31,0,0,0,95,78,97,109,101,115,
+-    112,97,99,101,80,97,116,104,46,95,103,101,116,95,112,97,
+-    114,101,110,116,95,112,97,116,104,99,1,0,0,0,0,0,
+-    0,0,4,0,0,0,3,0,0,0,67,0,0,0,115,103,
+-    0,0,0,116,0,0,124,0,0,106,1,0,131,0,0,131,
+-    1,0,125,1,0,124,1,0,124,0,0,106,2,0,107,3,
+-    0,114,96,0,124,0,0,106,3,0,124,0,0,106,4,0,
+-    124,1,0,131,2,0,92,2,0,125,2,0,125,3,0,124,
+-    2,0,100,0,0,107,8,0,114,84,0,124,3,0,124,0,
+-    0,95,6,0,110,0,0,124,1,0,124,0,0,95,2,0,
+-    110,0,0,124,0,0,106,6,0,83,40,1,0,0,0,78,
+-    40,7,0,0,0,117,5,0,0,0,116,117,112,108,101,117,
+-    16,0,0,0,95,103,101,116,95,112,97,114,101,110,116,95,
+-    112,97,116,104,117,17,0,0,0,95,108,97,115,116,95,112,
+-    97,114,101,110,116,95,112,97,116,104,117,12,0,0,0,95,
+-    112,97,116,104,95,102,105,110,100,101,114,117,5,0,0,0,
+-    95,110,97,109,101,117,4,0,0,0,78,111,110,101,117,5,
+-    0,0,0,95,112,97,116,104,40,4,0,0,0,117,4,0,
+-    0,0,115,101,108,102,117,11,0,0,0,112,97,114,101,110,
+-    116,95,112,97,116,104,117,6,0,0,0,108,111,97,100,101,
+-    114,117,8,0,0,0,110,101,119,95,112,97,116,104,40,0,
+-    0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,
+-    111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,
+-    98,111,111,116,115,116,114,97,112,62,117,12,0,0,0,95,
+-    114,101,99,97,108,99,117,108,97,116,101,158,4,0,0,115,
+-    14,0,0,0,0,2,18,1,15,1,27,3,12,1,12,1,
+-    12,1,117,27,0,0,0,95,78,97,109,101,115,112,97,99,
+-    101,80,97,116,104,46,95,114,101,99,97,108,99,117,108,97,
+-    116,101,99,1,0,0,0,0,0,0,0,1,0,0,0,2,
+-    0,0,0,67,0,0,0,115,16,0,0,0,116,0,0,124,
+-    0,0,106,1,0,131,0,0,131,1,0,83,40,1,0,0,
+-    0,78,40,2,0,0,0,117,4,0,0,0,105,116,101,114,
+-    117,12,0,0,0,95,114,101,99,97,108,99,117,108,97,116,
+-    101,40,1,0,0,0,117,4,0,0,0,115,101,108,102,40,
++    46,95,95,105,110,105,116,95,95,99,1,0,0,0,0,0,
++    0,0,4,0,0,0,3,0,0,0,67,0,0,0,115,53,
++    0,0,0,124,0,0,106,0,0,106,1,0,100,1,0,131,
++    1,0,92,3,0,125,1,0,125,2,0,125,3,0,124,2,
++    0,100,2,0,107,2,0,114,43,0,100,6,0,83,124,1,
++    0,100,5,0,102,2,0,83,40,7,0,0,0,117,62,0,
++    0,0,82,101,116,117,114,110,115,32,97,32,116,117,112,108,
++    101,32,111,102,32,40,112,97,114,101,110,116,45,109,111,100,
++    117,108,101,45,110,97,109,101,44,32,112,97,114,101,110,116,
++    45,112,97,116,104,45,97,116,116,114,45,110,97,109,101,41,
++    117,1,0,0,0,46,117,0,0,0,0,117,3,0,0,0,
++    115,121,115,117,4,0,0,0,112,97,116,104,117,8,0,0,
++    0,95,95,112,97,116,104,95,95,40,2,0,0,0,117,3,
++    0,0,0,115,121,115,117,4,0,0,0,112,97,116,104,40,
++    2,0,0,0,117,5,0,0,0,95,110,97,109,101,117,10,
++    0,0,0,114,112,97,114,116,105,116,105,111,110,40,4,0,
++    0,0,117,4,0,0,0,115,101,108,102,117,6,0,0,0,
++    112,97,114,101,110,116,117,3,0,0,0,100,111,116,117,2,
++    0,0,0,109,101,40,0,0,0,0,40,0,0,0,0,117,
++    29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
++    114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
++    62,117,23,0,0,0,95,102,105,110,100,95,112,97,114,101,
++    110,116,95,112,97,116,104,95,110,97,109,101,115,147,4,0,
++    0,115,8,0,0,0,0,2,27,1,12,2,4,3,117,38,
++    0,0,0,95,78,97,109,101,115,112,97,99,101,80,97,116,
++    104,46,95,102,105,110,100,95,112,97,114,101,110,116,95,112,
++    97,116,104,95,110,97,109,101,115,99,1,0,0,0,0,0,
++    0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,38,
++    0,0,0,124,0,0,106,0,0,131,0,0,92,2,0,125,
++    1,0,125,2,0,116,1,0,116,2,0,106,3,0,124,1,
++    0,25,124,2,0,131,2,0,83,40,1,0,0,0,78,40,
++    4,0,0,0,117,23,0,0,0,95,102,105,110,100,95,112,
++    97,114,101,110,116,95,112,97,116,104,95,110,97,109,101,115,
++    117,7,0,0,0,103,101,116,97,116,116,114,117,3,0,0,
++    0,115,121,115,117,7,0,0,0,109,111,100,117,108,101,115,
++    40,3,0,0,0,117,4,0,0,0,115,101,108,102,117,18,
++    0,0,0,112,97,114,101,110,116,95,109,111,100,117,108,101,
++    95,110,97,109,101,117,14,0,0,0,112,97,116,104,95,97,
++    116,116,114,95,110,97,109,101,40,0,0,0,0,40,0,0,
++    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
++    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
++    114,97,112,62,117,16,0,0,0,95,103,101,116,95,112,97,
++    114,101,110,116,95,112,97,116,104,157,4,0,0,115,4,0,
++    0,0,0,1,18,1,117,31,0,0,0,95,78,97,109,101,
++    115,112,97,99,101,80,97,116,104,46,95,103,101,116,95,112,
++    97,114,101,110,116,95,112,97,116,104,99,1,0,0,0,0,
++    0,0,0,4,0,0,0,3,0,0,0,67,0,0,0,115,
++    103,0,0,0,116,0,0,124,0,0,106,1,0,131,0,0,
++    131,1,0,125,1,0,124,1,0,124,0,0,106,2,0,107,
++    3,0,114,96,0,124,0,0,106,3,0,124,0,0,106,4,
++    0,124,1,0,131,2,0,92,2,0,125,2,0,125,3,0,
++    124,2,0,100,0,0,107,8,0,114,84,0,124,3,0,124,
++    0,0,95,6,0,110,0,0,124,1,0,124,0,0,95,2,
++    0,110,0,0,124,0,0,106,6,0,83,40,1,0,0,0,
++    78,40,7,0,0,0,117,5,0,0,0,116,117,112,108,101,
++    117,16,0,0,0,95,103,101,116,95,112,97,114,101,110,116,
++    95,112,97,116,104,117,17,0,0,0,95,108,97,115,116,95,
++    112,97,114,101,110,116,95,112,97,116,104,117,12,0,0,0,
++    95,112,97,116,104,95,102,105,110,100,101,114,117,5,0,0,
++    0,95,110,97,109,101,117,4,0,0,0,78,111,110,101,117,
++    5,0,0,0,95,112,97,116,104,40,4,0,0,0,117,4,
++    0,0,0,115,101,108,102,117,11,0,0,0,112,97,114,101,
++    110,116,95,112,97,116,104,117,6,0,0,0,108,111,97,100,
++    101,114,117,8,0,0,0,110,101,119,95,112,97,116,104,40,
+     0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,
+     114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,
+-    95,98,111,111,116,115,116,114,97,112,62,117,8,0,0,0,
+-    95,95,105,116,101,114,95,95,170,4,0,0,115,2,0,0,
+-    0,0,1,117,23,0,0,0,95,78,97,109,101,115,112,97,
+-    99,101,80,97,116,104,46,95,95,105,116,101,114,95,95,99,
+-    1,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,
+-    67,0,0,0,115,16,0,0,0,116,0,0,124,0,0,106,
+-    1,0,131,0,0,131,1,0,83,40,1,0,0,0,78,40,
+-    2,0,0,0,117,3,0,0,0,108,101,110,117,12,0,0,
+-    0,95,114,101,99,97,108,99,117,108,97,116,101,40,1,0,
++    95,98,111,111,116,115,116,114,97,112,62,117,12,0,0,0,
++    95,114,101,99,97,108,99,117,108,97,116,101,161,4,0,0,
++    115,14,0,0,0,0,2,18,1,15,1,27,3,12,1,12,
++    1,12,1,117,27,0,0,0,95,78,97,109,101,115,112,97,
++    99,101,80,97,116,104,46,95,114,101,99,97,108,99,117,108,
++    97,116,101,99,1,0,0,0,0,0,0,0,1,0,0,0,
++    2,0,0,0,67,0,0,0,115,16,0,0,0,116,0,0,
++    124,0,0,106,1,0,131,0,0,131,1,0,83,40,1,0,
++    0,0,78,40,2,0,0,0,117,4,0,0,0,105,116,101,
++    114,117,12,0,0,0,95,114,101,99,97,108,99,117,108,97,
++    116,101,40,1,0,0,0,117,4,0,0,0,115,101,108,102,
++    40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,
++    102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,
++    46,95,98,111,111,116,115,116,114,97,112,62,117,8,0,0,
++    0,95,95,105,116,101,114,95,95,173,4,0,0,115,2,0,
++    0,0,0,1,117,23,0,0,0,95,78,97,109,101,115,112,
++    97,99,101,80,97,116,104,46,95,95,105,116,101,114,95,95,
++    99,1,0,0,0,0,0,0,0,1,0,0,0,2,0,0,
++    0,67,0,0,0,115,16,0,0,0,116,0,0,124,0,0,
++    106,1,0,131,0,0,131,1,0,83,40,1,0,0,0,78,
++    40,2,0,0,0,117,3,0,0,0,108,101,110,117,12,0,
++    0,0,95,114,101,99,97,108,99,117,108,97,116,101,40,1,
++    0,0,0,117,4,0,0,0,115,101,108,102,40,0,0,0,
++    0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,
++    101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,
++    111,116,115,116,114,97,112,62,117,7,0,0,0,95,95,108,
++    101,110,95,95,176,4,0,0,115,2,0,0,0,0,1,117,
++    22,0,0,0,95,78,97,109,101,115,112,97,99,101,80,97,
++    116,104,46,95,95,108,101,110,95,95,99,1,0,0,0,0,
++    0,0,0,1,0,0,0,2,0,0,0,67,0,0,0,115,
++    16,0,0,0,100,1,0,106,0,0,124,0,0,106,1,0,
++    131,1,0,83,40,2,0,0,0,78,117,20,0,0,0,95,
++    78,97,109,101,115,112,97,99,101,80,97,116,104,40,123,33,
++    114,125,41,40,2,0,0,0,117,6,0,0,0,102,111,114,
++    109,97,116,117,5,0,0,0,95,112,97,116,104,40,1,0,
+     0,0,117,4,0,0,0,115,101,108,102,40,0,0,0,0,
+     40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,
+     110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,
+-    116,115,116,114,97,112,62,117,7,0,0,0,95,95,108,101,
+-    110,95,95,173,4,0,0,115,2,0,0,0,0,1,117,22,
+-    0,0,0,95,78,97,109,101,115,112,97,99,101,80,97,116,
+-    104,46,95,95,108,101,110,95,95,99,1,0,0,0,0,0,
+-    0,0,1,0,0,0,2,0,0,0,67,0,0,0,115,16,
+-    0,0,0,100,1,0,106,0,0,124,0,0,106,1,0,131,
+-    1,0,83,40,2,0,0,0,78,117,20,0,0,0,95,78,
+-    97,109,101,115,112,97,99,101,80,97,116,104,40,123,33,114,
+-    125,41,40,2,0,0,0,117,6,0,0,0,102,111,114,109,
+-    97,116,117,5,0,0,0,95,112,97,116,104,40,1,0,0,
++    116,115,116,114,97,112,62,117,8,0,0,0,95,95,114,101,
++    112,114,95,95,179,4,0,0,115,2,0,0,0,0,1,117,
++    23,0,0,0,95,78,97,109,101,115,112,97,99,101,80,97,
++    116,104,46,95,95,114,101,112,114,95,95,99,2,0,0,0,
++    0,0,0,0,2,0,0,0,2,0,0,0,67,0,0,0,
++    115,16,0,0,0,124,1,0,124,0,0,106,0,0,131,0,
++    0,107,6,0,83,40,1,0,0,0,78,40,1,0,0,0,
++    117,12,0,0,0,95,114,101,99,97,108,99,117,108,97,116,
++    101,40,2,0,0,0,117,4,0,0,0,115,101,108,102,117,
++    4,0,0,0,105,116,101,109,40,0,0,0,0,40,0,0,
++    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
++    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
++    114,97,112,62,117,12,0,0,0,95,95,99,111,110,116,97,
++    105,110,115,95,95,182,4,0,0,115,2,0,0,0,0,1,
++    117,27,0,0,0,95,78,97,109,101,115,112,97,99,101,80,
++    97,116,104,46,95,95,99,111,110,116,97,105,110,115,95,95,
++    99,2,0,0,0,0,0,0,0,2,0,0,0,2,0,0,
++    0,67,0,0,0,115,20,0,0,0,124,0,0,106,0,0,
++    106,1,0,124,1,0,131,1,0,1,100,0,0,83,40,1,
++    0,0,0,78,40,2,0,0,0,117,5,0,0,0,95,112,
++    97,116,104,117,6,0,0,0,97,112,112,101,110,100,40,2,
++    0,0,0,117,4,0,0,0,115,101,108,102,117,4,0,0,
++    0,105,116,101,109,40,0,0,0,0,40,0,0,0,0,117,
++    29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
++    114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
++    62,117,6,0,0,0,97,112,112,101,110,100,185,4,0,0,
++    115,2,0,0,0,0,1,117,21,0,0,0,95,78,97,109,
++    101,115,112,97,99,101,80,97,116,104,46,97,112,112,101,110,
++    100,78,40,13,0,0,0,117,8,0,0,0,95,95,110,97,
++    109,101,95,95,117,10,0,0,0,95,95,109,111,100,117,108,
++    101,95,95,117,12,0,0,0,95,95,113,117,97,108,110,97,
++    109,101,95,95,117,7,0,0,0,95,95,100,111,99,95,95,
++    117,8,0,0,0,95,95,105,110,105,116,95,95,117,23,0,
++    0,0,95,102,105,110,100,95,112,97,114,101,110,116,95,112,
++    97,116,104,95,110,97,109,101,115,117,16,0,0,0,95,103,
++    101,116,95,112,97,114,101,110,116,95,112,97,116,104,117,12,
++    0,0,0,95,114,101,99,97,108,99,117,108,97,116,101,117,
++    8,0,0,0,95,95,105,116,101,114,95,95,117,7,0,0,
++    0,95,95,108,101,110,95,95,117,8,0,0,0,95,95,114,
++    101,112,114,95,95,117,12,0,0,0,95,95,99,111,110,116,
++    97,105,110,115,95,95,117,6,0,0,0,97,112,112,101,110,
++    100,40,1,0,0,0,117,10,0,0,0,95,95,108,111,99,
++    97,108,115,95,95,40,0,0,0,0,40,0,0,0,0,117,
++    29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
++    114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
++    62,117,14,0,0,0,95,78,97,109,101,115,112,97,99,101,
++    80,97,116,104,134,4,0,0,115,20,0,0,0,16,5,6,
++    2,12,6,12,10,12,4,12,12,12,3,12,3,12,3,12,
++    3,117,14,0,0,0,95,78,97,109,101,115,112,97,99,101,
++    80,97,116,104,99,1,0,0,0,0,0,0,0,1,0,0,
++    0,3,0,0,0,66,0,0,0,115,68,0,0,0,124,0,
++    0,69,101,0,0,90,1,0,100,0,0,90,2,0,100,1,
++    0,100,2,0,132,0,0,90,3,0,101,4,0,100,3,0,
++    100,4,0,132,0,0,131,1,0,90,5,0,101,6,0,100,
++    5,0,100,6,0,132,0,0,131,1,0,90,7,0,100,7,
++    0,83,40,8,0,0,0,117,15,0,0,0,78,97,109,101,
++    115,112,97,99,101,76,111,97,100,101,114,99,4,0,0,0,
++    0,0,0,0,4,0,0,0,4,0,0,0,67,0,0,0,
++    115,25,0,0,0,116,0,0,124,1,0,124,2,0,124,3,
++    0,131,3,0,124,0,0,95,1,0,100,0,0,83,40,1,
++    0,0,0,78,40,2,0,0,0,117,14,0,0,0,95,78,
++    97,109,101,115,112,97,99,101,80,97,116,104,117,5,0,0,
++    0,95,112,97,116,104,40,4,0,0,0,117,4,0,0,0,
++    115,101,108,102,117,4,0,0,0,110,97,109,101,117,4,0,
++    0,0,112,97,116,104,117,11,0,0,0,112,97,116,104,95,
++    102,105,110,100,101,114,40,0,0,0,0,40,0,0,0,0,
++    117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,
++    111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,
++    112,62,117,8,0,0,0,95,95,105,110,105,116,95,95,190,
++    4,0,0,115,2,0,0,0,0,1,117,24,0,0,0,78,
++    97,109,101,115,112,97,99,101,76,111,97,100,101,114,46,95,
++    95,105,110,105,116,95,95,99,2,0,0,0,0,0,0,0,
++    2,0,0,0,2,0,0,0,67,0,0,0,115,16,0,0,
++    0,100,1,0,106,0,0,124,1,0,106,1,0,131,1,0,
++    83,40,2,0,0,0,78,117,25,0,0,0,60,109,111,100,
++    117,108,101,32,39,123,125,39,32,40,110,97,109,101,115,112,
++    97,99,101,41,62,40,2,0,0,0,117,6,0,0,0,102,
++    111,114,109,97,116,117,8,0,0,0,95,95,110,97,109,101,
++    95,95,40,2,0,0,0,117,3,0,0,0,99,108,115,117,
++    6,0,0,0,109,111,100,117,108,101,40,0,0,0,0,40,
++    0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
++    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
++    115,116,114,97,112,62,117,11,0,0,0,109,111,100,117,108,
++    101,95,114,101,112,114,193,4,0,0,115,2,0,0,0,0,
++    2,117,27,0,0,0,78,97,109,101,115,112,97,99,101,76,
++    111,97,100,101,114,46,109,111,100,117,108,101,95,114,101,112,
++    114,99,2,0,0,0,0,0,0,0,2,0,0,0,3,0,
++    0,0,67,0,0,0,115,32,0,0,0,116,0,0,100,1,
++    0,124,0,0,106,1,0,131,2,0,1,124,0,0,106,1,
++    0,124,1,0,95,2,0,124,1,0,83,40,2,0,0,0,
++    117,24,0,0,0,76,111,97,100,32,97,32,110,97,109,101,
++    115,112,97,99,101,32,109,111,100,117,108,101,46,117,38,0,
++    0,0,110,97,109,101,115,112,97,99,101,32,109,111,100,117,
++    108,101,32,108,111,97,100,101,100,32,119,105,116,104,32,112,
++    97,116,104,32,123,33,114,125,40,3,0,0,0,117,16,0,
++    0,0,95,118,101,114,98,111,115,101,95,109,101,115,115,97,
++    103,101,117,5,0,0,0,95,112,97,116,104,117,8,0,0,
++    0,95,95,112,97,116,104,95,95,40,2,0,0,0,117,4,
++    0,0,0,115,101,108,102,117,6,0,0,0,109,111,100,117,
++    108,101,40,0,0,0,0,40,0,0,0,0,117,29,0,0,
++    0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,
++    105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,11,
++    0,0,0,108,111,97,100,95,109,111,100,117,108,101,197,4,
++    0,0,115,6,0,0,0,0,3,16,1,12,1,117,27,0,
++    0,0,78,97,109,101,115,112,97,99,101,76,111,97,100,101,
++    114,46,108,111,97,100,95,109,111,100,117,108,101,78,40,8,
++    0,0,0,117,8,0,0,0,95,95,110,97,109,101,95,95,
++    117,10,0,0,0,95,95,109,111,100,117,108,101,95,95,117,
++    12,0,0,0,95,95,113,117,97,108,110,97,109,101,95,95,
++    117,8,0,0,0,95,95,105,110,105,116,95,95,117,11,0,
++    0,0,99,108,97,115,115,109,101,116,104,111,100,117,11,0,
++    0,0,109,111,100,117,108,101,95,114,101,112,114,117,17,0,
++    0,0,109,111,100,117,108,101,95,102,111,114,95,108,111,97,
++    100,101,114,117,11,0,0,0,108,111,97,100,95,109,111,100,
++    117,108,101,40,1,0,0,0,117,10,0,0,0,95,95,108,
++    111,99,97,108,115,95,95,40,0,0,0,0,40,0,0,0,
++    0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,
++    112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,
++    97,112,62,117,15,0,0,0,78,97,109,101,115,112,97,99,
++    101,76,111,97,100,101,114,189,4,0,0,115,6,0,0,0,
++    16,1,12,3,18,4,117,15,0,0,0,78,97,109,101,115,
++    112,97,99,101,76,111,97,100,101,114,99,1,0,0,0,0,
++    0,0,0,1,0,0,0,4,0,0,0,66,0,0,0,115,
++    119,0,0,0,124,0,0,69,101,0,0,90,1,0,100,0,
++    0,90,2,0,100,1,0,90,3,0,101,4,0,100,2,0,
++    100,3,0,132,0,0,131,1,0,90,5,0,101,4,0,100,
++    4,0,100,5,0,132,0,0,131,1,0,90,6,0,101,4,
++    0,100,6,0,100,7,0,132,0,0,131,1,0,90,7,0,
++    101,4,0,100,8,0,100,9,0,132,0,0,131,1,0,90,
++    8,0,101,4,0,100,12,0,100,10,0,100,11,0,132,1,
++    0,131,1,0,90,10,0,100,12,0,83,40,13,0,0,0,
++    117,10,0,0,0,80,97,116,104,70,105,110,100,101,114,117,
++    62,0,0,0,77,101,116,97,32,112,97,116,104,32,102,105,
++    110,100,101,114,32,102,111,114,32,115,121,115,46,112,97,116,
++    104,32,97,110,100,32,112,97,99,107,97,103,101,32,95,95,
++    112,97,116,104,95,95,32,97,116,116,114,105,98,117,116,101,
++    115,46,99,1,0,0,0,0,0,0,0,2,0,0,0,4,
++    0,0,0,67,0,0,0,115,58,0,0,0,120,51,0,116,
++    0,0,106,1,0,106,2,0,131,0,0,68,93,34,0,125,
++    1,0,116,3,0,124,1,0,100,1,0,131,2,0,114,16,
++    0,124,1,0,106,4,0,131,0,0,1,113,16,0,113,16,
++    0,87,100,2,0,83,40,3,0,0,0,117,125,0,0,0,
++    67,97,108,108,32,116,104,101,32,105,110,118,97,108,105,100,
++    97,116,101,95,99,97,99,104,101,115,40,41,32,109,101,116,
++    104,111,100,32,111,110,32,97,108,108,32,112,97,116,104,32,
++    101,110,116,114,121,32,102,105,110,100,101,114,115,10,32,32,
++    32,32,32,32,32,32,115,116,111,114,101,100,32,105,110,32,
++    115,121,115,46,112,97,116,104,95,105,109,112,111,114,116,101,
++    114,95,99,97,99,104,101,115,32,40,119,104,101,114,101,32,
++    105,109,112,108,101,109,101,110,116,101,100,41,46,117,17,0,
++    0,0,105,110,118,97,108,105,100,97,116,101,95,99,97,99,
++    104,101,115,78,40,5,0,0,0,117,3,0,0,0,115,121,
++    115,117,19,0,0,0,112,97,116,104,95,105,109,112,111,114,
++    116,101,114,95,99,97,99,104,101,117,6,0,0,0,118,97,
++    108,117,101,115,117,7,0,0,0,104,97,115,97,116,116,114,
++    117,17,0,0,0,105,110,118,97,108,105,100,97,116,101,95,
++    99,97,99,104,101,115,40,2,0,0,0,117,3,0,0,0,
++    99,108,115,117,6,0,0,0,102,105,110,100,101,114,40,0,
++    0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,
++    111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,
++    98,111,111,116,115,116,114,97,112,62,117,17,0,0,0,105,
++    110,118,97,108,105,100,97,116,101,95,99,97,99,104,101,115,
++    211,4,0,0,115,6,0,0,0,0,4,22,1,15,1,117,
++    28,0,0,0,80,97,116,104,70,105,110,100,101,114,46,105,
++    110,118,97,108,105,100,97,116,101,95,99,97,99,104,101,115,
++    99,2,0,0,0,0,0,0,0,3,0,0,0,12,0,0,
++    0,67,0,0,0,115,94,0,0,0,116,0,0,106,1,0,
++    115,28,0,116,2,0,106,3,0,100,1,0,116,4,0,131,
++    2,0,1,110,0,0,120,59,0,116,0,0,106,1,0,68,
++    93,44,0,125,2,0,121,14,0,124,2,0,124,1,0,131,
++    1,0,83,87,113,38,0,4,116,5,0,107,10,0,114,81,
++    0,1,1,1,119,38,0,89,113,38,0,88,113,38,0,87,
++    100,2,0,83,100,2,0,83,40,3,0,0,0,117,113,0,
++    0,0,83,101,97,114,99,104,32,115,101,113,117,101,110,99,
++    101,32,111,102,32,104,111,111,107,115,32,102,111,114,32,97,
++    32,102,105,110,100,101,114,32,102,111,114,32,39,112,97,116,
++    104,39,46,10,10,32,32,32,32,32,32,32,32,73,102,32,
++    39,104,111,111,107,115,39,32,105,115,32,102,97,108,115,101,
++    32,116,104,101,110,32,117,115,101,32,115,121,115,46,112,97,
++    116,104,95,104,111,111,107,115,46,10,10,32,32,32,32,32,
++    32,32,32,117,23,0,0,0,115,121,115,46,112,97,116,104,
++    95,104,111,111,107,115,32,105,115,32,101,109,112,116,121,78,
++    40,7,0,0,0,117,3,0,0,0,115,121,115,117,10,0,
++    0,0,112,97,116,104,95,104,111,111,107,115,117,9,0,0,
++    0,95,119,97,114,110,105,110,103,115,117,4,0,0,0,119,
++    97,114,110,117,13,0,0,0,73,109,112,111,114,116,87,97,
++    114,110,105,110,103,117,11,0,0,0,73,109,112,111,114,116,
++    69,114,114,111,114,117,4,0,0,0,78,111,110,101,40,3,
++    0,0,0,117,3,0,0,0,99,108,115,117,4,0,0,0,
++    112,97,116,104,117,4,0,0,0,104,111,111,107,40,0,0,
++    0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,
++    122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,
++    111,111,116,115,116,114,97,112,62,117,11,0,0,0,95,112,
++    97,116,104,95,104,111,111,107,115,219,4,0,0,115,16,0,
++    0,0,0,7,9,1,19,1,16,1,3,1,14,1,13,1,
++    12,2,117,22,0,0,0,80,97,116,104,70,105,110,100,101,
++    114,46,95,112,97,116,104,95,104,111,111,107,115,99,2,0,
++    0,0,0,0,0,0,3,0,0,0,11,0,0,0,67,0,
++    0,0,115,91,0,0,0,124,1,0,100,1,0,107,2,0,
++    114,21,0,100,2,0,125,1,0,110,0,0,121,17,0,116,
++    0,0,106,1,0,124,1,0,25,125,2,0,87,110,46,0,
++    4,116,2,0,107,10,0,114,86,0,1,1,1,124,0,0,
++    106,3,0,124,1,0,131,1,0,125,2,0,124,2,0,116,
++    0,0,106,1,0,124,1,0,60,89,110,1,0,88,124,2,
++    0,83,40,3,0,0,0,117,210,0,0,0,71,101,116,32,
++    116,104,101,32,102,105,110,100,101,114,32,102,111,114,32,116,
++    104,101,32,112,97,116,104,32,101,110,116,114,121,32,102,114,
++    111,109,32,115,121,115,46,112,97,116,104,95,105,109,112,111,
++    114,116,101,114,95,99,97,99,104,101,46,10,10,32,32,32,
++    32,32,32,32,32,73,102,32,116,104,101,32,112,97,116,104,
++    32,101,110,116,114,121,32,105,115,32,110,111,116,32,105,110,
++    32,116,104,101,32,99,97,99,104,101,44,32,102,105,110,100,
++    32,116,104,101,32,97,112,112,114,111,112,114,105,97,116,101,
++    32,102,105,110,100,101,114,10,32,32,32,32,32,32,32,32,
++    97,110,100,32,99,97,99,104,101,32,105,116,46,32,73,102,
++    32,110,111,32,102,105,110,100,101,114,32,105,115,32,97,118,
++    97,105,108,97,98,108,101,44,32,115,116,111,114,101,32,78,
++    111,110,101,46,10,10,32,32,32,32,32,32,32,32,117,0,
++    0,0,0,117,1,0,0,0,46,40,4,0,0,0,117,3,
++    0,0,0,115,121,115,117,19,0,0,0,112,97,116,104,95,
++    105,109,112,111,114,116,101,114,95,99,97,99,104,101,117,8,
++    0,0,0,75,101,121,69,114,114,111,114,117,11,0,0,0,
++    95,112,97,116,104,95,104,111,111,107,115,40,3,0,0,0,
++    117,3,0,0,0,99,108,115,117,4,0,0,0,112,97,116,
++    104,117,6,0,0,0,102,105,110,100,101,114,40,0,0,0,
++    0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,
++    101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,
++    111,116,115,116,114,97,112,62,117,20,0,0,0,95,112,97,
++    116,104,95,105,109,112,111,114,116,101,114,95,99,97,99,104,
++    101,236,4,0,0,115,16,0,0,0,0,8,12,1,9,1,
++    3,1,17,1,13,1,15,1,18,1,117,31,0,0,0,80,
++    97,116,104,70,105,110,100,101,114,46,95,112,97,116,104,95,
++    105,109,112,111,114,116,101,114,95,99,97,99,104,101,99,3,
++    0,0,0,0,0,0,0,8,0,0,0,5,0,0,0,67,
++    0,0,0,115,189,0,0,0,103,0,0,125,3,0,120,176,
++    0,124,2,0,68,93,158,0,125,4,0,116,0,0,124,4,
++    0,116,1,0,116,2,0,102,2,0,131,2,0,115,46,0,
++    113,13,0,110,0,0,124,0,0,106,3,0,124,4,0,131,
++    1,0,125,5,0,124,5,0,100,2,0,107,9,0,114,13,
++    0,116,5,0,124,5,0,100,1,0,131,2,0,114,112,0,
++    124,5,0,106,6,0,124,1,0,131,1,0,92,2,0,125,
++    6,0,125,7,0,110,21,0,124,5,0,106,7,0,124,1,
++    0,131,1,0,125,6,0,103,0,0,125,7,0,124,6,0,
++    100,2,0,107,9,0,114,155,0,124,6,0,124,3,0,102,
++    2,0,83,124,3,0,106,8,0,124,7,0,131,1,0,1,
++    113,13,0,113,13,0,87,100,2,0,124,3,0,102,2,0,
++    83,100,2,0,83,40,3,0,0,0,117,63,0,0,0,70,
++    105,110,100,32,116,104,101,32,108,111,97,100,101,114,32,111,
++    114,32,110,97,109,101,115,112,97,99,101,95,112,97,116,104,
++    32,102,111,114,32,116,104,105,115,32,109,111,100,117,108,101,
++    47,112,97,99,107,97,103,101,32,110,97,109,101,46,117,11,
++    0,0,0,102,105,110,100,95,108,111,97,100,101,114,78,40,
++    9,0,0,0,117,10,0,0,0,105,115,105,110,115,116,97,
++    110,99,101,117,3,0,0,0,115,116,114,117,5,0,0,0,
++    98,121,116,101,115,117,20,0,0,0,95,112,97,116,104,95,
++    105,109,112,111,114,116,101,114,95,99,97,99,104,101,117,4,
++    0,0,0,78,111,110,101,117,7,0,0,0,104,97,115,97,
++    116,116,114,117,11,0,0,0,102,105,110,100,95,108,111,97,
++    100,101,114,117,11,0,0,0,102,105,110,100,95,109,111,100,
++    117,108,101,117,6,0,0,0,101,120,116,101,110,100,40,8,
++    0,0,0,117,3,0,0,0,99,108,115,117,8,0,0,0,
++    102,117,108,108,110,97,109,101,117,4,0,0,0,112,97,116,
++    104,117,14,0,0,0,110,97,109,101,115,112,97,99,101,95,
++    112,97,116,104,117,5,0,0,0,101,110,116,114,121,117,6,
++    0,0,0,102,105,110,100,101,114,117,6,0,0,0,108,111,
++    97,100,101,114,117,8,0,0,0,112,111,114,116,105,111,110,
++    115,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
++    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
++    98,46,95,98,111,111,116,115,116,114,97,112,62,117,11,0,
++    0,0,95,103,101,116,95,108,111,97,100,101,114,253,4,0,
++    0,115,28,0,0,0,0,5,6,1,13,1,21,1,6,1,
++    15,1,12,1,15,1,24,2,15,1,6,1,12,2,10,5,
++    20,2,117,22,0,0,0,80,97,116,104,70,105,110,100,101,
++    114,46,95,103,101,116,95,108,111,97,100,101,114,99,3,0,
++    0,0,0,0,0,0,5,0,0,0,4,0,0,0,67,0,
++    0,0,115,97,0,0,0,124,2,0,100,1,0,107,8,0,
++    114,24,0,116,1,0,106,2,0,125,2,0,110,0,0,124,
++    0,0,106,3,0,124,1,0,124,2,0,131,2,0,92,2,
++    0,125,3,0,125,4,0,124,3,0,100,1,0,107,9,0,
++    114,64,0,124,3,0,83,124,4,0,114,89,0,116,4,0,
++    124,1,0,124,4,0,124,0,0,106,3,0,131,3,0,83,
++    100,1,0,83,100,1,0,83,40,2,0,0,0,117,98,0,
++    0,0,70,105,110,100,32,116,104,101,32,109,111,100,117,108,
++    101,32,111,110,32,115,121,115,46,112,97,116,104,32,111,114,
++    32,39,112,97,116,104,39,32,98,97,115,101,100,32,111,110,
++    32,115,121,115,46,112,97,116,104,95,104,111,111,107,115,32,
++    97,110,100,10,32,32,32,32,32,32,32,32,115,121,115,46,
++    112,97,116,104,95,105,109,112,111,114,116,101,114,95,99,97,
++    99,104,101,46,78,40,5,0,0,0,117,4,0,0,0,78,
++    111,110,101,117,3,0,0,0,115,121,115,117,4,0,0,0,
++    112,97,116,104,117,11,0,0,0,95,103,101,116,95,108,111,
++    97,100,101,114,117,15,0,0,0,78,97,109,101,115,112,97,
++    99,101,76,111,97,100,101,114,40,5,0,0,0,117,3,0,
++    0,0,99,108,115,117,8,0,0,0,102,117,108,108,110,97,
++    109,101,117,4,0,0,0,112,97,116,104,117,6,0,0,0,
++    108,111,97,100,101,114,117,14,0,0,0,110,97,109,101,115,
++    112,97,99,101,95,112,97,116,104,40,0,0,0,0,40,0,
++    0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,
++    105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,
++    116,114,97,112,62,117,11,0,0,0,102,105,110,100,95,109,
++    111,100,117,108,101,24,5,0,0,115,16,0,0,0,0,4,
++    12,1,12,1,24,1,12,1,4,2,6,3,19,2,117,22,
++    0,0,0,80,97,116,104,70,105,110,100,101,114,46,102,105,
++    110,100,95,109,111,100,117,108,101,78,40,11,0,0,0,117,
++    8,0,0,0,95,95,110,97,109,101,95,95,117,10,0,0,
++    0,95,95,109,111,100,117,108,101,95,95,117,12,0,0,0,
++    95,95,113,117,97,108,110,97,109,101,95,95,117,7,0,0,
++    0,95,95,100,111,99,95,95,117,11,0,0,0,99,108,97,
++    115,115,109,101,116,104,111,100,117,17,0,0,0,105,110,118,
++    97,108,105,100,97,116,101,95,99,97,99,104,101,115,117,11,
++    0,0,0,95,112,97,116,104,95,104,111,111,107,115,117,20,
++    0,0,0,95,112,97,116,104,95,105,109,112,111,114,116,101,
++    114,95,99,97,99,104,101,117,11,0,0,0,95,103,101,116,
++    95,108,111,97,100,101,114,117,4,0,0,0,78,111,110,101,
++    117,11,0,0,0,102,105,110,100,95,109,111,100,117,108,101,
++    40,1,0,0,0,117,10,0,0,0,95,95,108,111,99,97,
++    108,115,95,95,40,0,0,0,0,40,0,0,0,0,117,29,
++    0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,
++    116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,
++    117,10,0,0,0,80,97,116,104,70,105,110,100,101,114,207,
++    4,0,0,115,14,0,0,0,16,2,6,2,18,8,18,17,
++    18,17,18,27,3,1,117,10,0,0,0,80,97,116,104,70,
++    105,110,100,101,114,99,1,0,0,0,0,0,0,0,1,0,
++    0,0,3,0,0,0,66,0,0,0,115,110,0,0,0,124,
++    0,0,69,101,0,0,90,1,0,100,0,0,90,2,0,100,
++    1,0,90,3,0,100,2,0,100,3,0,132,0,0,90,4,
++    0,100,4,0,100,5,0,132,0,0,90,5,0,101,6,0,
++    90,7,0,100,6,0,100,7,0,132,0,0,90,8,0,100,
++    8,0,100,9,0,132,0,0,90,9,0,101,10,0,100,10,
++    0,100,11,0,132,0,0,131,1,0,90,11,0,100,12,0,
++    100,13,0,132,0,0,90,12,0,100,14,0,83,40,15,0,
++    0,0,117,10,0,0,0,70,105,108,101,70,105,110,100,101,
++    114,117,172,0,0,0,70,105,108,101,45,98,97,115,101,100,
++    32,102,105,110,100,101,114,46,10,10,32,32,32,32,73,110,
++    116,101,114,97,99,116,105,111,110,115,32,119,105,116,104,32,
++    116,104,101,32,102,105,108,101,32,115,121,115,116,101,109,32,
++    97,114,101,32,99,97,99,104,101,100,32,102,111,114,32,112,
++    101,114,102,111,114,109,97,110,99,101,44,32,98,101,105,110,
++    103,10,32,32,32,32,114,101,102,114,101,115,104,101,100,32,
++    119,104,101,110,32,116,104,101,32,100,105,114,101,99,116,111,
++    114,121,32,116,104,101,32,102,105,110,100,101,114,32,105,115,
++    32,104,97,110,100,108,105,110,103,32,104,97,115,32,98,101,
++    101,110,32,109,111,100,105,102,105,101,100,46,10,10,32,32,
++    32,32,99,2,0,0,0,0,0,0,0,5,0,0,0,5,
++    0,0,0,7,0,0,0,115,122,0,0,0,103,0,0,125,
++    3,0,120,52,0,124,2,0,68,93,44,0,92,2,0,137,
++    0,0,125,4,0,124,3,0,106,0,0,135,0,0,102,1,
++    0,100,1,0,100,2,0,134,0,0,124,4,0,68,131,1,
++    0,131,1,0,1,113,13,0,87,124,3,0,124,0,0,95,
++    1,0,124,1,0,112,79,0,100,3,0,124,0,0,95,2,
++    0,100,6,0,124,0,0,95,3,0,116,4,0,131,0,0,
++    124,0,0,95,5,0,116,4,0,131,0,0,124,0,0,95,
++    6,0,100,5,0,83,40,7,0,0,0,117,201,0,0,0,
++    73,110,105,116,105,97,108,105,122,101,32,119,105,116,104,32,
++    116,104,101,32,112,97,116,104,32,116,111,32,115,101,97,114,
++    99,104,32,111,110,32,97,110,100,32,97,32,118,97,114,105,
++    97,98,108,101,32,110,117,109,98,101,114,32,111,102,10,32,
++    32,32,32,32,32,32,32,51,45,116,117,112,108,101,115,32,
++    99,111,110,116,97,105,110,105,110,103,32,116,104,101,32,108,
++    111,97,100,101,114,44,32,102,105,108,101,32,115,117,102,102,
++    105,120,101,115,32,116,104,101,32,108,111,97,100,101,114,32,
++    114,101,99,111,103,110,105,122,101,115,44,10,32,32,32,32,
++    32,32,32,32,97,110,100,32,97,32,98,111,111,108,101,97,
++    110,32,111,102,32,119,104,101,116,104,101,114,32,116,104,101,
++    32,108,111,97,100,101,114,32,104,97,110,100,108,101,115,32,
++    112,97,99,107,97,103,101,115,46,99,1,0,0,0,0,0,
++    0,0,2,0,0,0,3,0,0,0,51,0,0,0,115,27,
++    0,0,0,124,0,0,93,17,0,125,1,0,124,1,0,136,
++    0,0,102,2,0,86,1,113,3,0,100,0,0,83,40,1,
++    0,0,0,78,40,0,0,0,0,40,2,0,0,0,117,2,
++    0,0,0,46,48,117,6,0,0,0,115,117,102,102,105,120,
++    40,1,0,0,0,117,6,0,0,0,108,111,97,100,101,114,
++    40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,
++    110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,
++    116,115,116,114,97,112,62,117,9,0,0,0,60,103,101,110,
++    101,120,112,114,62,57,5,0,0,115,2,0,0,0,6,0,
++    117,38,0,0,0,70,105,108,101,70,105,110,100,101,114,46,
++    95,95,105,110,105,116,95,95,46,60,108,111,99,97,108,115,
++    62,46,60,103,101,110,101,120,112,114,62,117,1,0,0,0,
++    46,105,1,0,0,0,78,105,255,255,255,255,40,7,0,0,
++    0,117,6,0,0,0,101,120,116,101,110,100,117,8,0,0,
++    0,95,108,111,97,100,101,114,115,117,4,0,0,0,112,97,
++    116,104,117,11,0,0,0,95,112,97,116,104,95,109,116,105,
++    109,101,117,3,0,0,0,115,101,116,117,11,0,0,0,95,
++    112,97,116,104,95,99,97,99,104,101,117,19,0,0,0,95,
++    114,101,108,97,120,101,100,95,112,97,116,104,95,99,97,99,
++    104,101,40,5,0,0,0,117,4,0,0,0,115,101,108,102,
++    117,4,0,0,0,112,97,116,104,117,7,0,0,0,100,101,
++    116,97,105,108,115,117,7,0,0,0,108,111,97,100,101,114,
++    115,117,8,0,0,0,115,117,102,102,105,120,101,115,40,0,
++    0,0,0,40,1,0,0,0,117,6,0,0,0,108,111,97,
++    100,101,114,117,29,0,0,0,60,102,114,111,122,101,110,32,
++    105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,
++    116,114,97,112,62,117,8,0,0,0,95,95,105,110,105,116,
++    95,95,51,5,0,0,115,16,0,0,0,0,4,6,1,19,
++    1,36,1,9,2,15,1,9,1,12,1,117,19,0,0,0,
++    70,105,108,101,70,105,110,100,101,114,46,95,95,105,110,105,
++    116,95,95,99,1,0,0,0,0,0,0,0,1,0,0,0,
++    2,0,0,0,67,0,0,0,115,13,0,0,0,100,3,0,
++    124,0,0,95,0,0,100,2,0,83,40,4,0,0,0,117,
++    31,0,0,0,73,110,118,97,108,105,100,97,116,101,32,116,
++    104,101,32,100,105,114,101,99,116,111,114,121,32,109,116,105,
++    109,101,46,105,1,0,0,0,78,105,255,255,255,255,40,1,
++    0,0,0,117,11,0,0,0,95,112,97,116,104,95,109,116,
++    105,109,101,40,1,0,0,0,117,4,0,0,0,115,101,108,
++    102,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
++    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
++    98,46,95,98,111,111,116,115,116,114,97,112,62,117,17,0,
++    0,0,105,110,118,97,108,105,100,97,116,101,95,99,97,99,
++    104,101,115,65,5,0,0,115,2,0,0,0,0,2,117,28,
++    0,0,0,70,105,108,101,70,105,110,100,101,114,46,105,110,
++    118,97,108,105,100,97,116,101,95,99,97,99,104,101,115,99,
++    2,0,0,0,0,0,0,0,12,0,0,0,13,0,0,0,
++    67,0,0,0,115,172,1,0,0,100,5,0,125,2,0,124,
++    1,0,106,1,0,100,1,0,131,1,0,100,2,0,25,125,
++    3,0,121,25,0,116,2,0,106,3,0,124,0,0,106,4,
++    0,131,1,0,106,5,0,125,4,0,87,110,24,0,4,116,
++    6,0,107,10,0,114,76,0,1,1,1,100,6,0,125,4,
++    0,89,110,1,0,88,124,4,0,124,0,0,106,7,0,107,
++    3,0,114,114,0,124,0,0,106,8,0,131,0,0,1,124,
++    4,0,124,0,0,95,7,0,110,0,0,116,9,0,131,0,
++    0,114,147,0,124,0,0,106,10,0,125,5,0,124,3,0,
++    106,11,0,131,0,0,125,6,0,110,15,0,124,0,0,106,
++    12,0,125,5,0,124,3,0,125,6,0,124,6,0,124,5,
++    0,107,6,0,114,45,1,116,13,0,124,0,0,106,4,0,
++    124,3,0,131,2,0,125,7,0,116,14,0,124,7,0,131,
++    1,0,114,45,1,120,91,0,124,0,0,106,15,0,68,93,
++    71,0,92,2,0,125,8,0,125,9,0,100,4,0,124,8,
++    0,23,125,10,0,116,13,0,124,7,0,124,10,0,131,2,
++    0,125,11,0,116,16,0,124,11,0,131,1,0,114,214,0,
++    124,9,0,124,1,0,124,11,0,131,2,0,124,7,0,103,
++    1,0,102,2,0,83,113,214,0,87,100,7,0,125,2,0,
++    113,45,1,110,0,0,120,95,0,124,0,0,106,15,0,68,
++    93,84,0,92,2,0,125,8,0,125,9,0,124,6,0,124,
++    8,0,23,124,5,0,107,6,0,114,55,1,116,13,0,124,
++    0,0,106,4,0,124,3,0,124,8,0,23,131,2,0,125,
++    11,0,116,16,0,124,11,0,131,1,0,114,139,1,124,9,
++    0,124,1,0,124,11,0,131,2,0,103,0,0,102,2,0,
++    83,113,55,1,113,55,1,87,124,2,0,114,162,1,100,8,
++    0,124,7,0,103,1,0,102,2,0,83,100,8,0,103,0,
++    0,102,2,0,83,40,9,0,0,0,117,125,0,0,0,84,
++    114,121,32,116,111,32,102,105,110,100,32,97,32,108,111,97,
++    100,101,114,32,102,111,114,32,116,104,101,32,115,112,101,99,
++    105,102,105,101,100,32,109,111,100,117,108,101,44,32,111,114,
++    32,116,104,101,32,110,97,109,101,115,112,97,99,101,10,32,
++    32,32,32,32,32,32,32,112,97,99,107,97,103,101,32,112,
++    111,114,116,105,111,110,115,46,32,82,101,116,117,114,110,115,
++    32,40,108,111,97,100,101,114,44,32,108,105,115,116,45,111,
++    102,45,112,111,114,116,105,111,110,115,41,46,117,1,0,0,
++    0,46,105,2,0,0,0,105,1,0,0,0,117,8,0,0,
++    0,95,95,105,110,105,116,95,95,70,105,255,255,255,255,84,
++    78,40,19,0,0,0,117,5,0,0,0,70,97,108,115,101,
++    117,10,0,0,0,114,112,97,114,116,105,116,105,111,110,117,
++    3,0,0,0,95,111,115,117,4,0,0,0,115,116,97,116,
++    117,4,0,0,0,112,97,116,104,117,8,0,0,0,115,116,
++    95,109,116,105,109,101,117,7,0,0,0,79,83,69,114,114,
++    111,114,117,11,0,0,0,95,112,97,116,104,95,109,116,105,
++    109,101,117,11,0,0,0,95,102,105,108,108,95,99,97,99,
++    104,101,117,11,0,0,0,95,114,101,108,97,120,95,99,97,
++    115,101,117,19,0,0,0,95,114,101,108,97,120,101,100,95,
++    112,97,116,104,95,99,97,99,104,101,117,5,0,0,0,108,
++    111,119,101,114,117,11,0,0,0,95,112,97,116,104,95,99,
++    97,99,104,101,117,10,0,0,0,95,112,97,116,104,95,106,
++    111,105,110,117,11,0,0,0,95,112,97,116,104,95,105,115,
++    100,105,114,117,8,0,0,0,95,108,111,97,100,101,114,115,
++    117,12,0,0,0,95,112,97,116,104,95,105,115,102,105,108,
++    101,117,4,0,0,0,84,114,117,101,117,4,0,0,0,78,
++    111,110,101,40,12,0,0,0,117,4,0,0,0,115,101,108,
++    102,117,8,0,0,0,102,117,108,108,110,97,109,101,117,12,
++    0,0,0,105,115,95,110,97,109,101,115,112,97,99,101,117,
++    11,0,0,0,116,97,105,108,95,109,111,100,117,108,101,117,
++    5,0,0,0,109,116,105,109,101,117,5,0,0,0,99,97,
++    99,104,101,117,12,0,0,0,99,97,99,104,101,95,109,111,
++    100,117,108,101,117,9,0,0,0,98,97,115,101,95,112,97,
++    116,104,117,6,0,0,0,115,117,102,102,105,120,117,6,0,
++    0,0,108,111,97,100,101,114,117,13,0,0,0,105,110,105,
++    116,95,102,105,108,101,110,97,109,101,117,9,0,0,0,102,
++    117,108,108,95,112,97,116,104,40,0,0,0,0,40,0,0,
++    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
++    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
++    114,97,112,62,117,11,0,0,0,102,105,110,100,95,108,111,
++    97,100,101,114,71,5,0,0,115,62,0,0,0,0,3,6,
++    1,19,1,3,1,25,1,13,1,11,1,15,1,10,1,12,
++    2,9,1,9,1,15,2,9,1,6,2,12,1,18,1,12,
++    1,22,1,10,1,15,1,12,1,26,4,12,2,22,1,16,
++    1,22,1,12,1,26,1,6,1,13,1,117,22,0,0,0,
++    70,105,108,101,70,105,110,100,101,114,46,102,105,110,100,95,
++    108,111,97,100,101,114,99,1,0,0,0,0,0,0,0,9,
++    0,0,0,13,0,0,0,67,0,0,0,115,8,1,0,0,
++    124,0,0,106,0,0,125,1,0,121,19,0,116,1,0,106,
++    2,0,124,1,0,131,1,0,125,2,0,87,110,33,0,4,
++    116,3,0,116,4,0,116,5,0,102,3,0,107,10,0,114,
++    63,0,1,1,1,103,0,0,125,2,0,89,110,1,0,88,
++    116,6,0,106,7,0,106,8,0,100,1,0,131,1,0,115,
++    100,0,116,9,0,124,2,0,131,1,0,124,0,0,95,10,
++    0,110,111,0,116,9,0,131,0,0,125,3,0,120,90,0,
++    124,2,0,68,93,82,0,125,4,0,124,4,0,106,11,0,
++    100,2,0,131,1,0,92,3,0,125,5,0,125,6,0,125,
++    7,0,124,6,0,114,179,0,100,3,0,106,12,0,124,5,
++    0,124,7,0,106,13,0,131,0,0,131,2,0,125,8,0,
++    110,6,0,124,5,0,125,8,0,124,3,0,106,14,0,124,
++    8,0,131,1,0,1,113,116,0,87,124,3,0,124,0,0,
++    95,10,0,116,6,0,106,7,0,106,8,0,116,15,0,131,
++    1,0,114,4,1,116,9,0,100,4,0,100,5,0,132,0,
++    0,124,2,0,68,131,1,0,131,1,0,124,0,0,95,16,
++    0,110,0,0,100,6,0,83,40,7,0,0,0,117,68,0,
++    0,0,70,105,108,108,32,116,104,101,32,99,97,99,104,101,
++    32,111,102,32,112,111,116,101,110,116,105,97,108,32,109,111,
++    100,117,108,101,115,32,97,110,100,32,112,97,99,107,97,103,
++    101,115,32,102,111,114,32,116,104,105,115,32,100,105,114,101,
++    99,116,111,114,121,46,117,3,0,0,0,119,105,110,117,1,
++    0,0,0,46,117,5,0,0,0,123,125,46,123,125,99,1,
++    0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,115,
++    0,0,0,115,27,0,0,0,124,0,0,93,17,0,125,1,
++    0,124,1,0,106,0,0,131,0,0,86,1,113,3,0,100,
++    0,0,83,40,1,0,0,0,78,40,1,0,0,0,117,5,
++    0,0,0,108,111,119,101,114,40,2,0,0,0,117,2,0,
++    0,0,46,48,117,2,0,0,0,102,110,40,0,0,0,0,
++    40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,
++    110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,
++    116,115,116,114,97,112,62,117,9,0,0,0,60,103,101,110,
++    101,120,112,114,62,142,5,0,0,115,2,0,0,0,6,0,
++    117,41,0,0,0,70,105,108,101,70,105,110,100,101,114,46,
++    95,102,105,108,108,95,99,97,99,104,101,46,60,108,111,99,
++    97,108,115,62,46,60,103,101,110,101,120,112,114,62,78,40,
++    17,0,0,0,117,4,0,0,0,112,97,116,104,117,3,0,
++    0,0,95,111,115,117,7,0,0,0,108,105,115,116,100,105,
++    114,117,17,0,0,0,70,105,108,101,78,111,116,70,111,117,
++    110,100,69,114,114,111,114,117,15,0,0,0,80,101,114,109,
++    105,115,115,105,111,110,69,114,114,111,114,117,18,0,0,0,
++    78,111,116,65,68,105,114,101,99,116,111,114,121,69,114,114,
++    111,114,117,3,0,0,0,115,121,115,117,8,0,0,0,112,
++    108,97,116,102,111,114,109,117,10,0,0,0,115,116,97,114,
++    116,115,119,105,116,104,117,3,0,0,0,115,101,116,117,11,
++    0,0,0,95,112,97,116,104,95,99,97,99,104,101,117,9,
++    0,0,0,112,97,114,116,105,116,105,111,110,117,6,0,0,
++    0,102,111,114,109,97,116,117,5,0,0,0,108,111,119,101,
++    114,117,3,0,0,0,97,100,100,117,27,0,0,0,95,67,
++    65,83,69,95,73,78,83,69,78,83,73,84,73,86,69,95,
++    80,76,65,84,70,79,82,77,83,117,19,0,0,0,95,114,
++    101,108,97,120,101,100,95,112,97,116,104,95,99,97,99,104,
++    101,40,9,0,0,0,117,4,0,0,0,115,101,108,102,117,
++    4,0,0,0,112,97,116,104,117,8,0,0,0,99,111,110,
++    116,101,110,116,115,117,21,0,0,0,108,111,119,101,114,95,
++    115,117,102,102,105,120,95,99,111,110,116,101,110,116,115,117,
++    4,0,0,0,105,116,101,109,117,4,0,0,0,110,97,109,
++    101,117,3,0,0,0,100,111,116,117,6,0,0,0,115,117,
++    102,102,105,120,117,8,0,0,0,110,101,119,95,110,97,109,
++    101,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
++    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
++    98,46,95,98,111,111,116,115,116,114,97,112,62,117,11,0,
++    0,0,95,102,105,108,108,95,99,97,99,104,101,113,5,0,
++    0,115,34,0,0,0,0,2,9,1,3,1,19,1,22,3,
++    11,3,18,1,18,7,9,1,13,1,24,1,6,1,27,2,
++    6,1,17,1,9,1,18,1,117,22,0,0,0,70,105,108,
++    101,70,105,110,100,101,114,46,95,102,105,108,108,95,99,97,
++    99,104,101,99,1,0,0,0,0,0,0,0,3,0,0,0,
++    3,0,0,0,7,0,0,0,115,25,0,0,0,135,0,0,
++    135,1,0,102,2,0,100,1,0,100,2,0,134,0,0,125,
++    2,0,124,2,0,83,40,3,0,0,0,117,20,1,0,0,
++    65,32,99,108,97,115,115,32,109,101,116,104,111,100,32,119,
++    104,105,99,104,32,114,101,116,117,114,110,115,32,97,32,99,
++    108,111,115,117,114,101,32,116,111,32,117,115,101,32,111,110,
++    32,115,121,115,46,112,97,116,104,95,104,111,111,107,10,32,
++    32,32,32,32,32,32,32,119,104,105,99,104,32,119,105,108,
++    108,32,114,101,116,117,114,110,32,97,110,32,105,110,115,116,
++    97,110,99,101,32,117,115,105,110,103,32,116,104,101,32,115,
++    112,101,99,105,102,105,101,100,32,108,111,97,100,101,114,115,
++    32,97,110,100,32,116,104,101,32,112,97,116,104,10,32,32,
++    32,32,32,32,32,32,99,97,108,108,101,100,32,111,110,32,
++    116,104,101,32,99,108,111,115,117,114,101,46,10,10,32,32,
++    32,32,32,32,32,32,73,102,32,116,104,101,32,112,97,116,
++    104,32,99,97,108,108,101,100,32,111,110,32,116,104,101,32,
++    99,108,111,115,117,114,101,32,105,115,32,110,111,116,32,97,
++    32,100,105,114,101,99,116,111,114,121,44,32,73,109,112,111,
++    114,116,69,114,114,111,114,32,105,115,10,32,32,32,32,32,
++    32,32,32,114,97,105,115,101,100,46,10,10,32,32,32,32,
++    32,32,32,32,99,1,0,0,0,0,0,0,0,1,0,0,
++    0,4,0,0,0,19,0,0,0,115,46,0,0,0,116,0,
++    0,124,0,0,131,1,0,115,33,0,116,1,0,100,1,0,
++    100,2,0,124,0,0,131,1,1,130,1,0,110,0,0,136,
++    0,0,124,0,0,136,1,0,140,1,0,83,40,3,0,0,
++    0,117,45,0,0,0,80,97,116,104,32,104,111,111,107,32,
++    102,111,114,32,105,109,112,111,114,116,108,105,98,46,109,97,
++    99,104,105,110,101,114,121,46,70,105,108,101,70,105,110,100,
++    101,114,46,117,30,0,0,0,111,110,108,121,32,100,105,114,
++    101,99,116,111,114,105,101,115,32,97,114,101,32,115,117,112,
++    112,111,114,116,101,100,117,4,0,0,0,112,97,116,104,40,
++    2,0,0,0,117,11,0,0,0,95,112,97,116,104,95,105,
++    115,100,105,114,117,11,0,0,0,73,109,112,111,114,116,69,
++    114,114,111,114,40,1,0,0,0,117,4,0,0,0,112,97,
++    116,104,40,2,0,0,0,117,3,0,0,0,99,108,115,117,
++    14,0,0,0,108,111,97,100,101,114,95,100,101,116,97,105,
++    108,115,40,0,0,0,0,117,29,0,0,0,60,102,114,111,
++    122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,
++    111,111,116,115,116,114,97,112,62,117,24,0,0,0,112,97,
++    116,104,95,104,111,111,107,95,102,111,114,95,70,105,108,101,
++    70,105,110,100,101,114,154,5,0,0,115,6,0,0,0,0,
++    2,12,1,21,1,117,54,0,0,0,70,105,108,101,70,105,
++    110,100,101,114,46,112,97,116,104,95,104,111,111,107,46,60,
++    108,111,99,97,108,115,62,46,112,97,116,104,95,104,111,111,
++    107,95,102,111,114,95,70,105,108,101,70,105,110,100,101,114,
++    40,0,0,0,0,40,3,0,0,0,117,3,0,0,0,99,
++    108,115,117,14,0,0,0,108,111,97,100,101,114,95,100,101,
++    116,97,105,108,115,117,24,0,0,0,112,97,116,104,95,104,
++    111,111,107,95,102,111,114,95,70,105,108,101,70,105,110,100,
++    101,114,40,0,0,0,0,40,2,0,0,0,117,3,0,0,
++    0,99,108,115,117,14,0,0,0,108,111,97,100,101,114,95,
++    100,101,116,97,105,108,115,117,29,0,0,0,60,102,114,111,
++    122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,
++    111,111,116,115,116,114,97,112,62,117,9,0,0,0,112,97,
++    116,104,95,104,111,111,107,144,5,0,0,115,4,0,0,0,
++    0,10,21,6,117,20,0,0,0,70,105,108,101,70,105,110,
++    100,101,114,46,112,97,116,104,95,104,111,111,107,99,1,0,
++    0,0,0,0,0,0,1,0,0,0,2,0,0,0,67,0,
++    0,0,115,14,0,0,0,100,1,0,124,0,0,106,0,0,
++    102,1,0,22,83,40,2,0,0,0,78,117,14,0,0,0,
++    70,105,108,101,70,105,110,100,101,114,40,37,114,41,40,1,
++    0,0,0,117,4,0,0,0,112,97,116,104,40,1,0,0,
+     0,117,4,0,0,0,115,101,108,102,40,0,0,0,0,40,
+     0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
+     32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
+     115,116,114,97,112,62,117,8,0,0,0,95,95,114,101,112,
+-    114,95,95,176,4,0,0,115,2,0,0,0,0,1,117,23,
+-    0,0,0,95,78,97,109,101,115,112,97,99,101,80,97,116,
+-    104,46,95,95,114,101,112,114,95,95,99,2,0,0,0,0,
+-    0,0,0,2,0,0,0,2,0,0,0,67,0,0,0,115,
+-    16,0,0,0,124,1,0,124,0,0,106,0,0,131,0,0,
+-    107,6,0,83,40,1,0,0,0,78,40,1,0,0,0,117,
+-    12,0,0,0,95,114,101,99,97,108,99,117,108,97,116,101,
+-    40,2,0,0,0,117,4,0,0,0,115,101,108,102,117,4,
+-    0,0,0,105,116,101,109,40,0,0,0,0,40,0,0,0,
+-    0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,
+-    112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,
+-    97,112,62,117,12,0,0,0,95,95,99,111,110,116,97,105,
+-    110,115,95,95,179,4,0,0,115,2,0,0,0,0,1,117,
+-    27,0,0,0,95,78,97,109,101,115,112,97,99,101,80,97,
+-    116,104,46,95,95,99,111,110,116,97,105,110,115,95,95,99,
+-    2,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,
+-    67,0,0,0,115,20,0,0,0,124,0,0,106,0,0,106,
+-    1,0,124,1,0,131,1,0,1,100,0,0,83,40,1,0,
+-    0,0,78,40,2,0,0,0,117,5,0,0,0,95,112,97,
+-    116,104,117,6,0,0,0,97,112,112,101,110,100,40,2,0,
+-    0,0,117,4,0,0,0,115,101,108,102,117,4,0,0,0,
+-    105,116,101,109,40,0,0,0,0,40,0,0,0,0,117,29,
+-    0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,
+-    116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,
+-    117,6,0,0,0,97,112,112,101,110,100,182,4,0,0,115,
+-    2,0,0,0,0,1,117,21,0,0,0,95,78,97,109,101,
+-    115,112,97,99,101,80,97,116,104,46,97,112,112,101,110,100,
+-    78,40,13,0,0,0,117,8,0,0,0,95,95,110,97,109,
+-    101,95,95,117,10,0,0,0,95,95,109,111,100,117,108,101,
+-    95,95,117,12,0,0,0,95,95,113,117,97,108,110,97,109,
+-    101,95,95,117,7,0,0,0,95,95,100,111,99,95,95,117,
+-    8,0,0,0,95,95,105,110,105,116,95,95,117,23,0,0,
+-    0,95,102,105,110,100,95,112,97,114,101,110,116,95,112,97,
+-    116,104,95,110,97,109,101,115,117,16,0,0,0,95,103,101,
+-    116,95,112,97,114,101,110,116,95,112,97,116,104,117,12,0,
+-    0,0,95,114,101,99,97,108,99,117,108,97,116,101,117,8,
+-    0,0,0,95,95,105,116,101,114,95,95,117,7,0,0,0,
+-    95,95,108,101,110,95,95,117,8,0,0,0,95,95,114,101,
+-    112,114,95,95,117,12,0,0,0,95,95,99,111,110,116,97,
+-    105,110,115,95,95,117,6,0,0,0,97,112,112,101,110,100,
+-    40,1,0,0,0,117,10,0,0,0,95,95,108,111,99,97,
+-    108,115,95,95,40,0,0,0,0,40,0,0,0,0,117,29,
+-    0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,
+-    116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,
+-    117,14,0,0,0,95,78,97,109,101,115,112,97,99,101,80,
+-    97,116,104,131,4,0,0,115,20,0,0,0,16,5,6,2,
+-    12,6,12,10,12,4,12,12,12,3,12,3,12,3,12,3,
+-    117,14,0,0,0,95,78,97,109,101,115,112,97,99,101,80,
+-    97,116,104,99,1,0,0,0,0,0,0,0,1,0,0,0,
+-    3,0,0,0,66,0,0,0,115,68,0,0,0,124,0,0,
+-    69,101,0,0,90,1,0,100,0,0,90,2,0,100,1,0,
+-    100,2,0,132,0,0,90,3,0,101,4,0,100,3,0,100,
+-    4,0,132,0,0,131,1,0,90,5,0,101,6,0,100,5,
+-    0,100,6,0,132,0,0,131,1,0,90,7,0,100,7,0,
+-    83,40,8,0,0,0,117,15,0,0,0,78,97,109,101,115,
+-    112,97,99,101,76,111,97,100,101,114,99,4,0,0,0,0,
+-    0,0,0,4,0,0,0,4,0,0,0,67,0,0,0,115,
+-    25,0,0,0,116,0,0,124,1,0,124,2,0,124,3,0,
+-    131,3,0,124,0,0,95,1,0,100,0,0,83,40,1,0,
+-    0,0,78,40,2,0,0,0,117,14,0,0,0,95,78,97,
+-    109,101,115,112,97,99,101,80,97,116,104,117,5,0,0,0,
+-    95,112,97,116,104,40,4,0,0,0,117,4,0,0,0,115,
+-    101,108,102,117,4,0,0,0,110,97,109,101,117,4,0,0,
+-    0,112,97,116,104,117,11,0,0,0,112,97,116,104,95,102,
+-    105,110,100,101,114,40,0,0,0,0,40,0,0,0,0,117,
+-    29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
+-    114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
+-    62,117,8,0,0,0,95,95,105,110,105,116,95,95,187,4,
+-    0,0,115,2,0,0,0,0,1,117,24,0,0,0,78,97,
+-    109,101,115,112,97,99,101,76,111,97,100,101,114,46,95,95,
+-    105,110,105,116,95,95,99,2,0,0,0,0,0,0,0,2,
+-    0,0,0,2,0,0,0,67,0,0,0,115,16,0,0,0,
+-    100,1,0,106,0,0,124,1,0,106,1,0,131,1,0,83,
+-    40,2,0,0,0,78,117,25,0,0,0,60,109,111,100,117,
+-    108,101,32,39,123,125,39,32,40,110,97,109,101,115,112,97,
+-    99,101,41,62,40,2,0,0,0,117,6,0,0,0,102,111,
+-    114,109,97,116,117,8,0,0,0,95,95,110,97,109,101,95,
+-    95,40,2,0,0,0,117,3,0,0,0,99,108,115,117,6,
+-    0,0,0,109,111,100,117,108,101,40,0,0,0,0,40,0,
++    114,95,95,162,5,0,0,115,2,0,0,0,0,1,117,19,
++    0,0,0,70,105,108,101,70,105,110,100,101,114,46,95,95,
++    114,101,112,114,95,95,78,40,13,0,0,0,117,8,0,0,
++    0,95,95,110,97,109,101,95,95,117,10,0,0,0,95,95,
++    109,111,100,117,108,101,95,95,117,12,0,0,0,95,95,113,
++    117,97,108,110,97,109,101,95,95,117,7,0,0,0,95,95,
++    100,111,99,95,95,117,8,0,0,0,95,95,105,110,105,116,
++    95,95,117,17,0,0,0,105,110,118,97,108,105,100,97,116,
++    101,95,99,97,99,104,101,115,117,17,0,0,0,95,102,105,
++    110,100,95,109,111,100,117,108,101,95,115,104,105,109,117,11,
++    0,0,0,102,105,110,100,95,109,111,100,117,108,101,117,11,
++    0,0,0,102,105,110,100,95,108,111,97,100,101,114,117,11,
++    0,0,0,95,102,105,108,108,95,99,97,99,104,101,117,11,
++    0,0,0,99,108,97,115,115,109,101,116,104,111,100,117,9,
++    0,0,0,112,97,116,104,95,104,111,111,107,117,8,0,0,
++    0,95,95,114,101,112,114,95,95,40,1,0,0,0,117,10,
++    0,0,0,95,95,108,111,99,97,108,115,95,95,40,0,0,
++    0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,
++    122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,
++    111,111,116,115,116,114,97,112,62,117,10,0,0,0,70,105,
++    108,101,70,105,110,100,101,114,42,5,0,0,115,16,0,0,
++    0,16,7,6,2,12,14,12,4,6,2,12,42,12,31,18,
++    18,117,10,0,0,0,70,105,108,101,70,105,110,100,101,114,
++    99,1,0,0,0,0,0,0,0,1,0,0,0,2,0,0,
++    0,66,0,0,0,115,50,0,0,0,124,0,0,69,101,0,
++    0,90,1,0,100,0,0,90,2,0,100,1,0,90,3,0,
++    100,2,0,100,3,0,132,0,0,90,4,0,100,4,0,100,
++    5,0,132,0,0,90,5,0,100,6,0,83,40,7,0,0,
++    0,117,18,0,0,0,95,73,109,112,111,114,116,76,111,99,
++    107,67,111,110,116,101,120,116,117,36,0,0,0,67,111,110,
++    116,101,120,116,32,109,97,110,97,103,101,114,32,102,111,114,
++    32,116,104,101,32,105,109,112,111,114,116,32,108,111,99,107,
++    46,99,1,0,0,0,0,0,0,0,1,0,0,0,1,0,
++    0,0,67,0,0,0,115,14,0,0,0,116,0,0,106,1,
++    0,131,0,0,1,100,1,0,83,40,2,0,0,0,117,24,
++    0,0,0,65,99,113,117,105,114,101,32,116,104,101,32,105,
++    109,112,111,114,116,32,108,111,99,107,46,78,40,2,0,0,
++    0,117,4,0,0,0,95,105,109,112,117,12,0,0,0,97,
++    99,113,117,105,114,101,95,108,111,99,107,40,1,0,0,0,
++    117,4,0,0,0,115,101,108,102,40,0,0,0,0,40,0,
+     0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,
+     105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,
+-    116,114,97,112,62,117,11,0,0,0,109,111,100,117,108,101,
+-    95,114,101,112,114,190,4,0,0,115,2,0,0,0,0,2,
+-    117,27,0,0,0,78,97,109,101,115,112,97,99,101,76,111,
+-    97,100,101,114,46,109,111,100,117,108,101,95,114,101,112,114,
+-    99,2,0,0,0,0,0,0,0,2,0,0,0,3,0,0,
+-    0,67,0,0,0,115,32,0,0,0,116,0,0,100,1,0,
+-    124,0,0,106,1,0,131,2,0,1,124,0,0,106,1,0,
+-    124,1,0,95,2,0,124,1,0,83,40,2,0,0,0,117,
+-    24,0,0,0,76,111,97,100,32,97,32,110,97,109,101,115,
+-    112,97,99,101,32,109,111,100,117,108,101,46,117,38,0,0,
+-    0,110,97,109,101,115,112,97,99,101,32,109,111,100,117,108,
+-    101,32,108,111,97,100,101,100,32,119,105,116,104,32,112,97,
+-    116,104,32,123,33,114,125,40,3,0,0,0,117,16,0,0,
+-    0,95,118,101,114,98,111,115,101,95,109,101,115,115,97,103,
+-    101,117,5,0,0,0,95,112,97,116,104,117,8,0,0,0,
+-    95,95,112,97,116,104,95,95,40,2,0,0,0,117,4,0,
+-    0,0,115,101,108,102,117,6,0,0,0,109,111,100,117,108,
+-    101,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
+-    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
+-    98,46,95,98,111,111,116,115,116,114,97,112,62,117,11,0,
+-    0,0,108,111,97,100,95,109,111,100,117,108,101,194,4,0,
+-    0,115,6,0,0,0,0,3,16,1,12,1,117,27,0,0,
+-    0,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114,
+-    46,108,111,97,100,95,109,111,100,117,108,101,78,40,8,0,
++    116,114,97,112,62,117,9,0,0,0,95,95,101,110,116,101,
++    114,95,95,172,5,0,0,115,2,0,0,0,0,2,117,28,
++    0,0,0,95,73,109,112,111,114,116,76,111,99,107,67,111,
++    110,116,101,120,116,46,95,95,101,110,116,101,114,95,95,99,
++    4,0,0,0,0,0,0,0,4,0,0,0,1,0,0,0,
++    67,0,0,0,115,14,0,0,0,116,0,0,106,1,0,131,
++    0,0,1,100,1,0,83,40,2,0,0,0,117,60,0,0,
++    0,82,101,108,101,97,115,101,32,116,104,101,32,105,109,112,
++    111,114,116,32,108,111,99,107,32,114,101,103,97,114,100,108,
++    101,115,115,32,111,102,32,97,110,121,32,114,97,105,115,101,
++    100,32,101,120,99,101,112,116,105,111,110,115,46,78,40,2,
++    0,0,0,117,4,0,0,0,95,105,109,112,117,12,0,0,
++    0,114,101,108,101,97,115,101,95,108,111,99,107,40,4,0,
++    0,0,117,4,0,0,0,115,101,108,102,117,8,0,0,0,
++    101,120,99,95,116,121,112,101,117,9,0,0,0,101,120,99,
++    95,118,97,108,117,101,117,13,0,0,0,101,120,99,95,116,
++    114,97,99,101,98,97,99,107,40,0,0,0,0,40,0,0,
++    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
++    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
++    114,97,112,62,117,8,0,0,0,95,95,101,120,105,116,95,
++    95,176,5,0,0,115,2,0,0,0,0,2,117,27,0,0,
++    0,95,73,109,112,111,114,116,76,111,99,107,67,111,110,116,
++    101,120,116,46,95,95,101,120,105,116,95,95,78,40,6,0,
+     0,0,117,8,0,0,0,95,95,110,97,109,101,95,95,117,
+     10,0,0,0,95,95,109,111,100,117,108,101,95,95,117,12,
+     0,0,0,95,95,113,117,97,108,110,97,109,101,95,95,117,
+-    8,0,0,0,95,95,105,110,105,116,95,95,117,11,0,0,
+-    0,99,108,97,115,115,109,101,116,104,111,100,117,11,0,0,
+-    0,109,111,100,117,108,101,95,114,101,112,114,117,17,0,0,
+-    0,109,111,100,117,108,101,95,102,111,114,95,108,111,97,100,
+-    101,114,117,11,0,0,0,108,111,97,100,95,109,111,100,117,
+-    108,101,40,1,0,0,0,117,10,0,0,0,95,95,108,111,
+-    99,97,108,115,95,95,40,0,0,0,0,40,0,0,0,0,
++    7,0,0,0,95,95,100,111,99,95,95,117,9,0,0,0,
++    95,95,101,110,116,101,114,95,95,117,8,0,0,0,95,95,
++    101,120,105,116,95,95,40,1,0,0,0,117,10,0,0,0,
++    95,95,108,111,99,97,108,115,95,95,40,0,0,0,0,40,
++    0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
++    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
++    115,116,114,97,112,62,117,18,0,0,0,95,73,109,112,111,
++    114,116,76,111,99,107,67,111,110,116,101,120,116,168,5,0,
++    0,115,6,0,0,0,16,2,6,2,12,4,117,18,0,0,
++    0,95,73,109,112,111,114,116,76,111,99,107,67,111,110,116,
++    101,120,116,99,3,0,0,0,0,0,0,0,5,0,0,0,
++    4,0,0,0,67,0,0,0,115,91,0,0,0,124,1,0,
++    106,0,0,100,1,0,124,2,0,100,2,0,24,131,2,0,
++    125,3,0,116,1,0,124,3,0,131,1,0,124,2,0,107,
++    0,0,114,55,0,116,2,0,100,3,0,131,1,0,130,1,
++    0,110,0,0,124,3,0,100,4,0,25,125,4,0,124,0,
++    0,114,87,0,100,5,0,106,3,0,124,4,0,124,0,0,
++    131,2,0,83,124,4,0,83,40,6,0,0,0,117,50,0,
++    0,0,82,101,115,111,108,118,101,32,97,32,114,101,108,97,
++    116,105,118,101,32,109,111,100,117,108,101,32,110,97,109,101,
++    32,116,111,32,97,110,32,97,98,115,111,108,117,116,101,32,
++    111,110,101,46,117,1,0,0,0,46,105,1,0,0,0,117,
++    50,0,0,0,97,116,116,101,109,112,116,101,100,32,114,101,
++    108,97,116,105,118,101,32,105,109,112,111,114,116,32,98,101,
++    121,111,110,100,32,116,111,112,45,108,101,118,101,108,32,112,
++    97,99,107,97,103,101,105,0,0,0,0,117,5,0,0,0,
++    123,125,46,123,125,40,4,0,0,0,117,6,0,0,0,114,
++    115,112,108,105,116,117,3,0,0,0,108,101,110,117,10,0,
++    0,0,86,97,108,117,101,69,114,114,111,114,117,6,0,0,
++    0,102,111,114,109,97,116,40,5,0,0,0,117,4,0,0,
++    0,110,97,109,101,117,7,0,0,0,112,97,99,107,97,103,
++    101,117,5,0,0,0,108,101,118,101,108,117,4,0,0,0,
++    98,105,116,115,117,4,0,0,0,98,97,115,101,40,0,0,
++    0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,
++    122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,
++    111,111,116,115,116,114,97,112,62,117,13,0,0,0,95,114,
++    101,115,111,108,118,101,95,110,97,109,101,181,5,0,0,115,
++    10,0,0,0,0,2,22,1,18,1,15,1,10,1,117,13,
++    0,0,0,95,114,101,115,111,108,118,101,95,110,97,109,101,
++    99,2,0,0,0,0,0,0,0,4,0,0,0,11,0,0,
++    0,67,0,0,0,115,138,0,0,0,116,0,0,106,1,0,
++    115,28,0,116,2,0,106,3,0,100,1,0,116,4,0,131,
++    2,0,1,110,0,0,120,103,0,116,0,0,106,1,0,68,
++    93,88,0,125,2,0,116,5,0,131,0,0,143,23,0,1,
++    124,2,0,106,6,0,124,0,0,124,1,0,131,2,0,125,
++    3,0,87,100,2,0,81,88,124,3,0,100,2,0,107,9,
++    0,114,38,0,124,0,0,116,0,0,106,8,0,107,7,0,
++    114,109,0,124,3,0,83,116,0,0,106,8,0,124,0,0,
++    25,106,9,0,83,113,38,0,113,38,0,87,100,2,0,83,
++    100,2,0,83,40,3,0,0,0,117,23,0,0,0,70,105,
++    110,100,32,97,32,109,111,100,117,108,101,39,115,32,108,111,
++    97,100,101,114,46,117,22,0,0,0,115,121,115,46,109,101,
++    116,97,95,112,97,116,104,32,105,115,32,101,109,112,116,121,
++    78,40,10,0,0,0,117,3,0,0,0,115,121,115,117,9,
++    0,0,0,109,101,116,97,95,112,97,116,104,117,9,0,0,
++    0,95,119,97,114,110,105,110,103,115,117,4,0,0,0,119,
++    97,114,110,117,13,0,0,0,73,109,112,111,114,116,87,97,
++    114,110,105,110,103,117,18,0,0,0,95,73,109,112,111,114,
++    116,76,111,99,107,67,111,110,116,101,120,116,117,11,0,0,
++    0,102,105,110,100,95,109,111,100,117,108,101,117,4,0,0,
++    0,78,111,110,101,117,7,0,0,0,109,111,100,117,108,101,
++    115,117,10,0,0,0,95,95,108,111,97,100,101,114,95,95,
++    40,4,0,0,0,117,4,0,0,0,110,97,109,101,117,4,
++    0,0,0,112,97,116,104,117,6,0,0,0,102,105,110,100,
++    101,114,117,6,0,0,0,108,111,97,100,101,114,40,0,0,
++    0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,
++    122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,
++    111,111,116,115,116,114,97,112,62,117,12,0,0,0,95,102,
++    105,110,100,95,109,111,100,117,108,101,190,5,0,0,115,20,
++    0,0,0,0,2,9,1,19,1,16,1,10,1,24,1,12,
++    2,15,1,4,2,21,2,117,12,0,0,0,95,102,105,110,
++    100,95,109,111,100,117,108,101,99,3,0,0,0,0,0,0,
++    0,4,0,0,0,4,0,0,0,67,0,0,0,115,194,0,
++    0,0,116,0,0,124,0,0,116,1,0,131,2,0,115,45,
++    0,116,2,0,100,1,0,106,3,0,116,4,0,124,0,0,
++    131,1,0,131,1,0,131,1,0,130,1,0,110,0,0,124,
++    2,0,100,2,0,107,0,0,114,72,0,116,5,0,100,3,
++    0,131,1,0,130,1,0,110,0,0,124,1,0,114,156,0,
++    116,0,0,124,1,0,116,1,0,131,2,0,115,108,0,116,
++    2,0,100,4,0,131,1,0,130,1,0,113,156,0,124,1,
++    0,116,6,0,106,7,0,107,7,0,114,156,0,100,5,0,
++    125,3,0,116,8,0,124,3,0,106,3,0,124,1,0,131,
++    1,0,131,1,0,130,1,0,113,156,0,110,0,0,124,0,
++    0,12,114,190,0,124,2,0,100,2,0,107,2,0,114,190,
++    0,116,5,0,100,6,0,131,1,0,130,1,0,110,0,0,
++    100,7,0,83,40,8,0,0,0,117,28,0,0,0,86,101,
++    114,105,102,121,32,97,114,103,117,109,101,110,116,115,32,97,
++    114,101,32,34,115,97,110,101,34,46,117,31,0,0,0,109,
++    111,100,117,108,101,32,110,97,109,101,32,109,117,115,116,32,
++    98,101,32,115,116,114,44,32,110,111,116,32,123,125,105,0,
++    0,0,0,117,18,0,0,0,108,101,118,101,108,32,109,117,
++    115,116,32,98,101,32,62,61,32,48,117,31,0,0,0,95,
++    95,112,97,99,107,97,103,101,95,95,32,110,111,116,32,115,
++    101,116,32,116,111,32,97,32,115,116,114,105,110,103,117,61,
++    0,0,0,80,97,114,101,110,116,32,109,111,100,117,108,101,
++    32,123,33,114,125,32,110,111,116,32,108,111,97,100,101,100,
++    44,32,99,97,110,110,111,116,32,112,101,114,102,111,114,109,
++    32,114,101,108,97,116,105,118,101,32,105,109,112,111,114,116,
++    117,17,0,0,0,69,109,112,116,121,32,109,111,100,117,108,
++    101,32,110,97,109,101,78,40,9,0,0,0,117,10,0,0,
++    0,105,115,105,110,115,116,97,110,99,101,117,3,0,0,0,
++    115,116,114,117,9,0,0,0,84,121,112,101,69,114,114,111,
++    114,117,6,0,0,0,102,111,114,109,97,116,117,4,0,0,
++    0,116,121,112,101,117,10,0,0,0,86,97,108,117,101,69,
++    114,114,111,114,117,3,0,0,0,115,121,115,117,7,0,0,
++    0,109,111,100,117,108,101,115,117,11,0,0,0,83,121,115,
++    116,101,109,69,114,114,111,114,40,4,0,0,0,117,4,0,
++    0,0,110,97,109,101,117,7,0,0,0,112,97,99,107,97,
++    103,101,117,5,0,0,0,108,101,118,101,108,117,3,0,0,
++    0,109,115,103,40,0,0,0,0,40,0,0,0,0,117,29,
++    0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,
++    116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,
++    117,13,0,0,0,95,115,97,110,105,116,121,95,99,104,101,
++    99,107,207,5,0,0,115,24,0,0,0,0,2,15,1,30,
++    1,12,1,15,1,6,1,15,1,15,1,15,1,6,2,27,
++    1,19,1,117,13,0,0,0,95,115,97,110,105,116,121,95,
++    99,104,101,99,107,117,20,0,0,0,78,111,32,109,111,100,
++    117,108,101,32,110,97,109,101,100,32,123,33,114,125,99,2,
++    0,0,0,0,0,0,0,9,0,0,0,27,0,0,0,67,
++    0,0,0,115,12,2,0,0,100,0,0,125,2,0,124,0,
++    0,106,1,0,100,1,0,131,1,0,100,2,0,25,125,3,
++    0,124,3,0,114,178,0,124,3,0,116,2,0,106,3,0,
++    107,7,0,114,62,0,116,4,0,124,1,0,124,3,0,131,
++    2,0,1,110,0,0,124,0,0,116,2,0,106,3,0,107,
++    6,0,114,88,0,116,2,0,106,3,0,124,0,0,25,83,
++    116,2,0,106,3,0,124,3,0,25,125,4,0,121,13,0,
++    124,4,0,106,5,0,125,2,0,87,113,178,0,4,116,6,
++    0,107,10,0,114,174,0,1,1,1,116,7,0,100,3,0,
++    23,106,8,0,124,0,0,124,3,0,131,2,0,125,5,0,
++    116,9,0,124,5,0,100,4,0,124,0,0,131,1,1,130,
++    1,0,89,113,178,0,88,110,0,0,116,10,0,124,0,0,
++    124,2,0,131,2,0,125,6,0,124,6,0,100,0,0,107,
++    8,0,114,250,0,116,9,0,116,7,0,106,8,0,124,0,
++    0,131,1,0,100,4,0,124,0,0,131,1,1,125,7,0,
++    100,10,0,124,7,0,95,12,0,124,7,0,130,1,0,110,
++    47,0,124,0,0,116,2,0,106,3,0,107,7,0,114,41,
++    1,124,6,0,106,13,0,124,0,0,131,1,0,1,116,14,
++    0,100,5,0,124,0,0,124,6,0,131,3,0,1,110,0,
++    0,116,2,0,106,3,0,124,0,0,25,125,8,0,124,3,
++    0,114,105,1,116,2,0,106,3,0,124,3,0,25,125,4,
++    0,116,15,0,124,4,0,124,0,0,106,1,0,100,1,0,
++    131,1,0,100,6,0,25,124,8,0,131,3,0,1,110,0,
++    0,116,16,0,124,8,0,100,7,0,100,0,0,131,3,0,
++    100,0,0,107,8,0,114,212,1,121,59,0,124,8,0,106,
++    17,0,124,8,0,95,18,0,116,19,0,124,8,0,100,8,
++    0,131,2,0,115,187,1,124,8,0,106,18,0,106,1,0,
++    100,1,0,131,1,0,100,2,0,25,124,8,0,95,18,0,
++    110,0,0,87,113,212,1,4,116,6,0,107,10,0,114,208,
++    1,1,1,1,89,113,212,1,88,110,0,0,116,19,0,124,
++    8,0,100,9,0,131,2,0,115,8,2,121,13,0,124,6,
++    0,124,8,0,95,20,0,87,113,8,2,4,116,6,0,107,
++    10,0,114,4,2,1,1,1,89,113,8,2,88,110,0,0,
++    124,8,0,83,40,11,0,0,0,78,117,1,0,0,0,46,
++    105,0,0,0,0,117,21,0,0,0,59,32,123,125,32,105,
++    115,32,110,111,116,32,97,32,112,97,99,107,97,103,101,117,
++    4,0,0,0,110,97,109,101,117,18,0,0,0,105,109,112,
++    111,114,116,32,123,33,114,125,32,35,32,123,33,114,125,105,
++    2,0,0,0,117,11,0,0,0,95,95,112,97,99,107,97,
++    103,101,95,95,117,8,0,0,0,95,95,112,97,116,104,95,
++    95,117,10,0,0,0,95,95,108,111,97,100,101,114,95,95,
++    84,40,21,0,0,0,117,4,0,0,0,78,111,110,101,117,
++    10,0,0,0,114,112,97,114,116,105,116,105,111,110,117,3,
++    0,0,0,115,121,115,117,7,0,0,0,109,111,100,117,108,
++    101,115,117,25,0,0,0,95,99,97,108,108,95,119,105,116,
++    104,95,102,114,97,109,101,115,95,114,101,109,111,118,101,100,
++    117,8,0,0,0,95,95,112,97,116,104,95,95,117,14,0,
++    0,0,65,116,116,114,105,98,117,116,101,69,114,114,111,114,
++    117,8,0,0,0,95,69,82,82,95,77,83,71,117,6,0,
++    0,0,102,111,114,109,97,116,117,11,0,0,0,73,109,112,
++    111,114,116,69,114,114,111,114,117,12,0,0,0,95,102,105,
++    110,100,95,109,111,100,117,108,101,117,4,0,0,0,84,114,
++    117,101,117,10,0,0,0,95,110,111,116,95,102,111,117,110,
++    100,117,11,0,0,0,108,111,97,100,95,109,111,100,117,108,
++    101,117,16,0,0,0,95,118,101,114,98,111,115,101,95,109,
++    101,115,115,97,103,101,117,7,0,0,0,115,101,116,97,116,
++    116,114,117,7,0,0,0,103,101,116,97,116,116,114,117,8,
++    0,0,0,95,95,110,97,109,101,95,95,117,11,0,0,0,
++    95,95,112,97,99,107,97,103,101,95,95,117,7,0,0,0,
++    104,97,115,97,116,116,114,117,10,0,0,0,95,95,108,111,
++    97,100,101,114,95,95,40,9,0,0,0,117,4,0,0,0,
++    110,97,109,101,117,7,0,0,0,105,109,112,111,114,116,95,
++    117,4,0,0,0,112,97,116,104,117,6,0,0,0,112,97,
++    114,101,110,116,117,13,0,0,0,112,97,114,101,110,116,95,
++    109,111,100,117,108,101,117,3,0,0,0,109,115,103,117,6,
++    0,0,0,108,111,97,100,101,114,117,3,0,0,0,101,120,
++    99,117,6,0,0,0,109,111,100,117,108,101,40,0,0,0,
++    0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,
++    101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,
++    111,116,115,116,114,97,112,62,117,23,0,0,0,95,102,105,
++    110,100,95,97,110,100,95,108,111,97,100,95,117,110,108,111,
++    99,107,101,100,226,5,0,0,115,76,0,0,0,0,1,6,
++    1,19,1,6,1,15,1,16,2,15,1,11,2,13,1,3,
++    1,13,1,13,1,22,1,26,1,15,1,12,1,27,3,9,
++    1,9,1,15,2,13,1,19,2,13,1,6,2,13,1,32,
++    2,24,1,3,1,12,1,15,1,32,1,13,1,8,2,15,
++    1,3,1,13,1,13,1,8,1,117,23,0,0,0,95,102,
++    105,110,100,95,97,110,100,95,108,111,97,100,95,117,110,108,
++    111,99,107,101,100,99,2,0,0,0,0,0,0,0,3,0,
++    0,0,18,0,0,0,67,0,0,0,115,75,0,0,0,122,
++    16,0,116,0,0,124,0,0,131,1,0,125,2,0,87,100,
++    1,0,116,1,0,106,2,0,131,0,0,1,88,124,2,0,
++    106,3,0,131,0,0,1,122,17,0,116,4,0,124,0,0,
++    124,1,0,131,2,0,83,87,100,1,0,124,2,0,106,5,
++    0,131,0,0,1,88,100,1,0,83,40,2,0,0,0,117,
++    54,0,0,0,70,105,110,100,32,97,110,100,32,108,111,97,
++    100,32,116,104,101,32,109,111,100,117,108,101,44,32,97,110,
++    100,32,114,101,108,101,97,115,101,32,116,104,101,32,105,109,
++    112,111,114,116,32,108,111,99,107,46,78,40,6,0,0,0,
++    117,16,0,0,0,95,103,101,116,95,109,111,100,117,108,101,
++    95,108,111,99,107,117,4,0,0,0,95,105,109,112,117,12,
++    0,0,0,114,101,108,101,97,115,101,95,108,111,99,107,117,
++    7,0,0,0,97,99,113,117,105,114,101,117,23,0,0,0,
++    95,102,105,110,100,95,97,110,100,95,108,111,97,100,95,117,
++    110,108,111,99,107,101,100,117,7,0,0,0,114,101,108,101,
++    97,115,101,40,3,0,0,0,117,4,0,0,0,110,97,109,
++    101,117,7,0,0,0,105,109,112,111,114,116,95,117,4,0,
++    0,0,108,111,99,107,40,0,0,0,0,40,0,0,0,0,
+     117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,
+     111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,
+-    112,62,117,15,0,0,0,78,97,109,101,115,112,97,99,101,
+-    76,111,97,100,101,114,186,4,0,0,115,6,0,0,0,16,
+-    1,12,3,18,4,117,15,0,0,0,78,97,109,101,115,112,
+-    97,99,101,76,111,97,100,101,114,99,1,0,0,0,0,0,
+-    0,0,1,0,0,0,4,0,0,0,66,0,0,0,115,119,
+-    0,0,0,124,0,0,69,101,0,0,90,1,0,100,0,0,
+-    90,2,0,100,1,0,90,3,0,101,4,0,100,2,0,100,
+-    3,0,132,0,0,131,1,0,90,5,0,101,4,0,100,4,
+-    0,100,5,0,132,0,0,131,1,0,90,6,0,101,4,0,
+-    100,6,0,100,7,0,132,0,0,131,1,0,90,7,0,101,
+-    4,0,100,8,0,100,9,0,132,0,0,131,1,0,90,8,
+-    0,101,4,0,100,12,0,100,10,0,100,11,0,132,1,0,
+-    131,1,0,90,10,0,100,12,0,83,40,13,0,0,0,117,
+-    10,0,0,0,80,97,116,104,70,105,110,100,101,114,117,62,
+-    0,0,0,77,101,116,97,32,112,97,116,104,32,102,105,110,
+-    100,101,114,32,102,111,114,32,115,121,115,46,112,97,116,104,
+-    32,97,110,100,32,112,97,99,107,97,103,101,32,95,95,112,
+-    97,116,104,95,95,32,97,116,116,114,105,98,117,116,101,115,
+-    46,99,1,0,0,0,0,0,0,0,2,0,0,0,4,0,
+-    0,0,67,0,0,0,115,58,0,0,0,120,51,0,116,0,
+-    0,106,1,0,106,2,0,131,0,0,68,93,34,0,125,1,
+-    0,116,3,0,124,1,0,100,1,0,131,2,0,114,16,0,
+-    124,1,0,106,4,0,131,0,0,1,113,16,0,113,16,0,
+-    87,100,2,0,83,40,3,0,0,0,117,125,0,0,0,67,
+-    97,108,108,32,116,104,101,32,105,110,118,97,108,105,100,97,
+-    116,101,95,99,97,99,104,101,115,40,41,32,109,101,116,104,
+-    111,100,32,111,110,32,97,108,108,32,112,97,116,104,32,101,
+-    110,116,114,121,32,102,105,110,100,101,114,115,10,32,32,32,
+-    32,32,32,32,32,115,116,111,114,101,100,32,105,110,32,115,
+-    121,115,46,112,97,116,104,95,105,109,112,111,114,116,101,114,
+-    95,99,97,99,104,101,115,32,40,119,104,101,114,101,32,105,
+-    109,112,108,101,109,101,110,116,101,100,41,46,117,17,0,0,
+-    0,105,110,118,97,108,105,100,97,116,101,95,99,97,99,104,
+-    101,115,78,40,5,0,0,0,117,3,0,0,0,115,121,115,
+-    117,19,0,0,0,112,97,116,104,95,105,109,112,111,114,116,
+-    101,114,95,99,97,99,104,101,117,6,0,0,0,118,97,108,
+-    117,101,115,117,7,0,0,0,104,97,115,97,116,116,114,117,
+-    17,0,0,0,105,110,118,97,108,105,100,97,116,101,95,99,
+-    97,99,104,101,115,40,2,0,0,0,117,3,0,0,0,99,
+-    108,115,117,6,0,0,0,102,105,110,100,101,114,40,0,0,
+-    0,0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,
+-    122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,
+-    111,111,116,115,116,114,97,112,62,117,17,0,0,0,105,110,
+-    118,97,108,105,100,97,116,101,95,99,97,99,104,101,115,208,
+-    4,0,0,115,6,0,0,0,0,4,22,1,15,1,117,28,
+-    0,0,0,80,97,116,104,70,105,110,100,101,114,46,105,110,
+-    118,97,108,105,100,97,116,101,95,99,97,99,104,101,115,99,
+-    2,0,0,0,0,0,0,0,3,0,0,0,12,0,0,0,
+-    67,0,0,0,115,94,0,0,0,116,0,0,106,1,0,115,
+-    28,0,116,2,0,106,3,0,100,1,0,116,4,0,131,2,
+-    0,1,110,0,0,120,59,0,116,0,0,106,1,0,68,93,
+-    44,0,125,2,0,121,14,0,124,2,0,124,1,0,131,1,
+-    0,83,87,113,38,0,4,116,5,0,107,10,0,114,81,0,
+-    1,1,1,119,38,0,89,113,38,0,88,113,38,0,87,100,
+-    2,0,83,100,2,0,83,40,3,0,0,0,117,113,0,0,
+-    0,83,101,97,114,99,104,32,115,101,113,117,101,110,99,101,
+-    32,111,102,32,104,111,111,107,115,32,102,111,114,32,97,32,
+-    102,105,110,100,101,114,32,102,111,114,32,39,112,97,116,104,
+-    39,46,10,10,32,32,32,32,32,32,32,32,73,102,32,39,
+-    104,111,111,107,115,39,32,105,115,32,102,97,108,115,101,32,
+-    116,104,101,110,32,117,115,101,32,115,121,115,46,112,97,116,
+-    104,95,104,111,111,107,115,46,10,10,32,32,32,32,32,32,
+-    32,32,117,23,0,0,0,115,121,115,46,112,97,116,104,95,
+-    104,111,111,107,115,32,105,115,32,101,109,112,116,121,78,40,
+-    7,0,0,0,117,3,0,0,0,115,121,115,117,10,0,0,
+-    0,112,97,116,104,95,104,111,111,107,115,117,9,0,0,0,
+-    95,119,97,114,110,105,110,103,115,117,4,0,0,0,119,97,
+-    114,110,117,13,0,0,0,73,109,112,111,114,116,87,97,114,
+-    110,105,110,103,117,11,0,0,0,73,109,112,111,114,116,69,
+-    114,114,111,114,117,4,0,0,0,78,111,110,101,40,3,0,
+-    0,0,117,3,0,0,0,99,108,115,117,4,0,0,0,112,
+-    97,116,104,117,4,0,0,0,104,111,111,107,40,0,0,0,
++    112,62,117,14,0,0,0,95,102,105,110,100,95,97,110,100,
++    95,108,111,97,100,20,6,0,0,115,14,0,0,0,0,2,
++    3,1,16,2,11,1,10,1,3,1,17,2,117,14,0,0,
++    0,95,102,105,110,100,95,97,110,100,95,108,111,97,100,99,
++    3,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,
++    67,0,0,0,115,172,0,0,0,116,0,0,124,0,0,124,
++    1,0,124,2,0,131,3,0,1,124,2,0,100,1,0,107,
++    4,0,114,49,0,116,1,0,124,0,0,124,1,0,124,2,
++    0,131,3,0,125,0,0,110,0,0,116,2,0,106,3,0,
++    131,0,0,1,124,0,0,116,4,0,106,5,0,107,7,0,
++    114,87,0,116,6,0,124,0,0,116,7,0,131,2,0,83,
++    116,4,0,106,5,0,124,0,0,25,125,3,0,124,3,0,
++    100,4,0,107,8,0,114,158,0,116,2,0,106,9,0,131,
++    0,0,1,100,2,0,106,10,0,124,0,0,131,1,0,125,
++    4,0,116,11,0,124,4,0,100,3,0,124,0,0,131,1,
++    1,130,1,0,110,0,0,116,12,0,124,0,0,131,1,0,
++    1,124,3,0,83,40,5,0,0,0,117,50,1,0,0,73,
++    109,112,111,114,116,32,97,110,100,32,114,101,116,117,114,110,
++    32,116,104,101,32,109,111,100,117,108,101,32,98,97,115,101,
++    100,32,111,110,32,105,116,115,32,110,97,109,101,44,32,116,
++    104,101,32,112,97,99,107,97,103,101,32,116,104,101,32,99,
++    97,108,108,32,105,115,10,32,32,32,32,98,101,105,110,103,
++    32,109,97,100,101,32,102,114,111,109,44,32,97,110,100,32,
++    116,104,101,32,108,101,118,101,108,32,97,100,106,117,115,116,
++    109,101,110,116,46,10,10,32,32,32,32,84,104,105,115,32,
++    102,117,110,99,116,105,111,110,32,114,101,112,114,101,115,101,
++    110,116,115,32,116,104,101,32,103,114,101,97,116,101,115,116,
++    32,99,111,109,109,111,110,32,100,101,110,111,109,105,110,97,
++    116,111,114,32,111,102,32,102,117,110,99,116,105,111,110,97,
++    108,105,116,121,10,32,32,32,32,98,101,116,119,101,101,110,
++    32,105,109,112,111,114,116,95,109,111,100,117,108,101,32,97,
++    110,100,32,95,95,105,109,112,111,114,116,95,95,46,32,84,
++    104,105,115,32,105,110,99,108,117,100,101,115,32,115,101,116,
++    116,105,110,103,32,95,95,112,97,99,107,97,103,101,95,95,
++    32,105,102,10,32,32,32,32,116,104,101,32,108,111,97,100,
++    101,114,32,100,105,100,32,110,111,116,46,10,10,32,32,32,
++    32,105,0,0,0,0,117,40,0,0,0,105,109,112,111,114,
++    116,32,111,102,32,123,125,32,104,97,108,116,101,100,59,32,
++    78,111,110,101,32,105,110,32,115,121,115,46,109,111,100,117,
++    108,101,115,117,4,0,0,0,110,97,109,101,78,40,13,0,
++    0,0,117,13,0,0,0,95,115,97,110,105,116,121,95,99,
++    104,101,99,107,117,13,0,0,0,95,114,101,115,111,108,118,
++    101,95,110,97,109,101,117,4,0,0,0,95,105,109,112,117,
++    12,0,0,0,97,99,113,117,105,114,101,95,108,111,99,107,
++    117,3,0,0,0,115,121,115,117,7,0,0,0,109,111,100,
++    117,108,101,115,117,14,0,0,0,95,102,105,110,100,95,97,
++    110,100,95,108,111,97,100,117,11,0,0,0,95,103,99,100,
++    95,105,109,112,111,114,116,117,4,0,0,0,78,111,110,101,
++    117,12,0,0,0,114,101,108,101,97,115,101,95,108,111,99,
++    107,117,6,0,0,0,102,111,114,109,97,116,117,11,0,0,
++    0,73,109,112,111,114,116,69,114,114,111,114,117,19,0,0,
++    0,95,108,111,99,107,95,117,110,108,111,99,107,95,109,111,
++    100,117,108,101,40,5,0,0,0,117,4,0,0,0,110,97,
++    109,101,117,7,0,0,0,112,97,99,107,97,103,101,117,5,
++    0,0,0,108,101,118,101,108,117,6,0,0,0,109,111,100,
++    117,108,101,117,7,0,0,0,109,101,115,115,97,103,101,40,
++    0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,
++    114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,
++    95,98,111,111,116,115,116,114,97,112,62,117,11,0,0,0,
++    95,103,99,100,95,105,109,112,111,114,116,33,6,0,0,115,
++    28,0,0,0,0,9,16,1,12,1,21,1,10,1,15,1,
++    13,1,13,1,12,1,10,1,6,1,9,1,21,1,10,1,
++    117,11,0,0,0,95,103,99,100,95,105,109,112,111,114,116,
++    99,3,0,0,0,0,0,0,0,6,0,0,0,17,0,0,
++    0,67,0,0,0,115,254,0,0,0,116,0,0,124,0,0,
++    100,1,0,131,2,0,114,250,0,100,2,0,124,1,0,107,
++    6,0,114,89,0,116,1,0,124,1,0,131,1,0,125,1,
++    0,124,1,0,106,2,0,100,2,0,131,1,0,1,116,0,
++    0,124,0,0,100,3,0,131,2,0,114,89,0,124,1,0,
++    106,3,0,124,0,0,106,4,0,131,1,0,1,113,89,0,
++    110,0,0,120,158,0,124,1,0,68,93,147,0,125,3,0,
++    116,0,0,124,0,0,124,3,0,131,2,0,115,96,0,100,
++    4,0,106,5,0,124,0,0,106,6,0,124,3,0,131,2,
++    0,125,4,0,121,17,0,116,7,0,124,2,0,124,4,0,
++    131,2,0,1,87,113,243,0,4,116,8,0,107,10,0,114,
++    239,0,1,125,5,0,1,122,50,0,116,9,0,124,5,0,
++    100,5,0,100,7,0,131,3,0,114,218,0,124,5,0,106,
++    11,0,124,4,0,107,2,0,114,218,0,119,96,0,113,218,
++    0,110,0,0,130,0,0,87,89,100,6,0,100,6,0,125,
++    5,0,126,5,0,88,113,243,0,88,113,96,0,113,96,0,
++    87,110,0,0,124,0,0,83,40,8,0,0,0,117,238,0,
++    0,0,70,105,103,117,114,101,32,111,117,116,32,119,104,97,
++    116,32,95,95,105,109,112,111,114,116,95,95,32,115,104,111,
++    117,108,100,32,114,101,116,117,114,110,46,10,10,32,32,32,
++    32,84,104,101,32,105,109,112,111,114,116,95,32,112,97,114,
++    97,109,101,116,101,114,32,105,115,32,97,32,99,97,108,108,
++    97,98,108,101,32,119,104,105,99,104,32,116,97,107,101,115,
++    32,116,104,101,32,110,97,109,101,32,111,102,32,109,111,100,
++    117,108,101,32,116,111,10,32,32,32,32,105,109,112,111,114,
++    116,46,32,73,116,32,105,115,32,114,101,113,117,105,114,101,
++    100,32,116,111,32,100,101,99,111,117,112,108,101,32,116,104,
++    101,32,102,117,110,99,116,105,111,110,32,102,114,111,109,32,
++    97,115,115,117,109,105,110,103,32,105,109,112,111,114,116,108,
++    105,98,39,115,10,32,32,32,32,105,109,112,111,114,116,32,
++    105,109,112,108,101,109,101,110,116,97,116,105,111,110,32,105,
++    115,32,100,101,115,105,114,101,100,46,10,10,32,32,32,32,
++    117,8,0,0,0,95,95,112,97,116,104,95,95,117,1,0,
++    0,0,42,117,7,0,0,0,95,95,97,108,108,95,95,117,
++    5,0,0,0,123,125,46,123,125,117,10,0,0,0,95,110,
++    111,116,95,102,111,117,110,100,78,70,40,12,0,0,0,117,
++    7,0,0,0,104,97,115,97,116,116,114,117,4,0,0,0,
++    108,105,115,116,117,6,0,0,0,114,101,109,111,118,101,117,
++    6,0,0,0,101,120,116,101,110,100,117,7,0,0,0,95,
++    95,97,108,108,95,95,117,6,0,0,0,102,111,114,109,97,
++    116,117,8,0,0,0,95,95,110,97,109,101,95,95,117,25,
++    0,0,0,95,99,97,108,108,95,119,105,116,104,95,102,114,
++    97,109,101,115,95,114,101,109,111,118,101,100,117,11,0,0,
++    0,73,109,112,111,114,116,69,114,114,111,114,117,7,0,0,
++    0,103,101,116,97,116,116,114,117,5,0,0,0,70,97,108,
++    115,101,117,4,0,0,0,110,97,109,101,40,6,0,0,0,
++    117,6,0,0,0,109,111,100,117,108,101,117,8,0,0,0,
++    102,114,111,109,108,105,115,116,117,7,0,0,0,105,109,112,
++    111,114,116,95,117,1,0,0,0,120,117,9,0,0,0,102,
++    114,111,109,95,110,97,109,101,117,3,0,0,0,101,120,99,
++    40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,
++    102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,
++    46,95,98,111,111,116,115,116,114,97,112,62,117,16,0,0,
++    0,95,104,97,110,100,108,101,95,102,114,111,109,108,105,115,
++    116,57,6,0,0,115,34,0,0,0,0,10,15,1,12,1,
++    12,1,13,1,15,1,22,1,13,1,15,1,21,1,3,1,
++    17,1,18,6,18,1,15,1,9,1,32,1,117,16,0,0,
++    0,95,104,97,110,100,108,101,95,102,114,111,109,108,105,115,
++    116,99,1,0,0,0,0,0,0,0,2,0,0,0,2,0,
++    0,0,67,0,0,0,115,78,0,0,0,124,0,0,106,0,
++    0,100,1,0,131,1,0,125,1,0,124,1,0,100,6,0,
++    107,8,0,114,74,0,124,0,0,100,2,0,25,125,1,0,
++    100,3,0,124,0,0,107,7,0,114,74,0,124,1,0,106,
++    2,0,100,4,0,131,1,0,100,5,0,25,125,1,0,113,
++    74,0,110,0,0,124,1,0,83,40,7,0,0,0,117,167,
++    0,0,0,67,97,108,99,117,108,97,116,101,32,119,104,97,
++    116,32,95,95,112,97,99,107,97,103,101,95,95,32,115,104,
++    111,117,108,100,32,98,101,46,10,10,32,32,32,32,95,95,
++    112,97,99,107,97,103,101,95,95,32,105,115,32,110,111,116,
++    32,103,117,97,114,97,110,116,101,101,100,32,116,111,32,98,
++    101,32,100,101,102,105,110,101,100,32,111,114,32,99,111,117,
++    108,100,32,98,101,32,115,101,116,32,116,111,32,78,111,110,
++    101,10,32,32,32,32,116,111,32,114,101,112,114,101,115,101,
++    110,116,32,116,104,97,116,32,105,116,115,32,112,114,111,112,
++    101,114,32,118,97,108,117,101,32,105,115,32,117,110,107,110,
++    111,119,110,46,10,10,32,32,32,32,117,11,0,0,0,95,
++    95,112,97,99,107,97,103,101,95,95,117,8,0,0,0,95,
++    95,110,97,109,101,95,95,117,8,0,0,0,95,95,112,97,
++    116,104,95,95,117,1,0,0,0,46,105,0,0,0,0,78,
++    40,3,0,0,0,117,3,0,0,0,103,101,116,117,4,0,
++    0,0,78,111,110,101,117,10,0,0,0,114,112,97,114,116,
++    105,116,105,111,110,40,2,0,0,0,117,7,0,0,0,103,
++    108,111,98,97,108,115,117,7,0,0,0,112,97,99,107,97,
++    103,101,40,0,0,0,0,40,0,0,0,0,117,29,0,0,
++    0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,
++    105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,17,
++    0,0,0,95,99,97,108,99,95,95,95,112,97,99,107,97,
++    103,101,95,95,91,6,0,0,115,12,0,0,0,0,7,15,
++    1,12,1,10,1,12,1,25,1,117,17,0,0,0,95,99,
++    97,108,99,95,95,95,112,97,99,107,97,103,101,95,95,99,
++    0,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,
++    67,0,0,0,115,55,0,0,0,116,0,0,116,1,0,106,
++    2,0,131,0,0,102,2,0,125,0,0,116,3,0,116,4,
++    0,102,2,0,125,1,0,116,5,0,116,6,0,102,2,0,
++    125,2,0,124,0,0,124,1,0,124,2,0,103,3,0,83,
++    40,1,0,0,0,117,111,0,0,0,82,101,116,117,114,110,
++    115,32,97,32,108,105,115,116,32,111,102,32,102,105,108,101,
++    45,98,97,115,101,100,32,109,111,100,117,108,101,32,108,111,
++    97,100,101,114,115,46,10,10,32,32,32,32,69,97,99,104,
++    32,105,116,101,109,32,105,115,32,97,32,116,117,112,108,101,
++    32,40,108,111,97,100,101,114,44,32,115,117,102,102,105,120,
++    101,115,44,32,97,108,108,111,119,95,112,97,99,107,97,103,
++    101,115,41,46,10,32,32,32,32,40,7,0,0,0,117,19,
++    0,0,0,69,120,116,101,110,115,105,111,110,70,105,108,101,
++    76,111,97,100,101,114,117,4,0,0,0,95,105,109,112,117,
++    18,0,0,0,101,120,116,101,110,115,105,111,110,95,115,117,
++    102,102,105,120,101,115,117,16,0,0,0,83,111,117,114,99,
++    101,70,105,108,101,76,111,97,100,101,114,117,15,0,0,0,
++    83,79,85,82,67,69,95,83,85,70,70,73,88,69,83,117,
++    20,0,0,0,83,111,117,114,99,101,108,101,115,115,70,105,
++    108,101,76,111,97,100,101,114,117,17,0,0,0,66,89,84,
++    69,67,79,68,69,95,83,85,70,70,73,88,69,83,40,3,
++    0,0,0,117,10,0,0,0,101,120,116,101,110,115,105,111,
++    110,115,117,6,0,0,0,115,111,117,114,99,101,117,8,0,
++    0,0,98,121,116,101,99,111,100,101,40,0,0,0,0,40,
++    0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
++    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
++    115,116,114,97,112,62,117,27,0,0,0,95,103,101,116,95,
++    115,117,112,112,111,114,116,101,100,95,102,105,108,101,95,108,
++    111,97,100,101,114,115,106,6,0,0,115,8,0,0,0,0,
++    5,18,1,12,1,12,1,117,27,0,0,0,95,103,101,116,
++    95,115,117,112,112,111,114,116,101,100,95,102,105,108,101,95,
++    108,111,97,100,101,114,115,99,5,0,0,0,0,0,0,0,
++    9,0,0,0,5,0,0,0,67,0,0,0,115,227,0,0,
++    0,124,4,0,100,1,0,107,2,0,114,27,0,116,0,0,
++    124,0,0,131,1,0,125,5,0,110,54,0,124,1,0,100,
++    3,0,107,9,0,114,45,0,124,1,0,110,3,0,105,0,
++    0,125,6,0,116,2,0,124,6,0,131,1,0,125,7,0,
++    116,0,0,124,0,0,124,7,0,124,4,0,131,3,0,125,
++    5,0,124,3,0,115,207,0,124,4,0,100,1,0,107,2,
++    0,114,122,0,116,0,0,124,0,0,106,3,0,100,2,0,
++    131,1,0,100,1,0,25,131,1,0,83,124,0,0,115,132,
++    0,124,5,0,83,116,4,0,124,0,0,131,1,0,116,4,
++    0,124,0,0,106,3,0,100,2,0,131,1,0,100,1,0,
++    25,131,1,0,24,125,8,0,116,5,0,106,6,0,124,5,
++    0,106,7,0,100,3,0,116,4,0,124,5,0,106,7,0,
++    131,1,0,124,8,0,24,133,2,0,25,25,83,110,16,0,
++    116,8,0,124,5,0,124,3,0,116,0,0,131,3,0,83,
++    100,3,0,83,40,4,0,0,0,117,214,1,0,0,73,109,
++    112,111,114,116,32,97,32,109,111,100,117,108,101,46,10,10,
++    32,32,32,32,84,104,101,32,39,103,108,111,98,97,108,115,
++    39,32,97,114,103,117,109,101,110,116,32,105,115,32,117,115,
++    101,100,32,116,111,32,105,110,102,101,114,32,119,104,101,114,
++    101,32,116,104,101,32,105,109,112,111,114,116,32,105,115,32,
++    111,99,99,117,114,105,110,103,32,102,114,111,109,10,32,32,
++    32,32,116,111,32,104,97,110,100,108,101,32,114,101,108,97,
++    116,105,118,101,32,105,109,112,111,114,116,115,46,32,84,104,
++    101,32,39,108,111,99,97,108,115,39,32,97,114,103,117,109,
++    101,110,116,32,105,115,32,105,103,110,111,114,101,100,46,32,
++    84,104,101,10,32,32,32,32,39,102,114,111,109,108,105,115,
++    116,39,32,97,114,103,117,109,101,110,116,32,115,112,101,99,
++    105,102,105,101,115,32,119,104,97,116,32,115,104,111,117,108,
++    100,32,101,120,105,115,116,32,97,115,32,97,116,116,114,105,
++    98,117,116,101,115,32,111,110,32,116,104,101,32,109,111,100,
++    117,108,101,10,32,32,32,32,98,101,105,110,103,32,105,109,
++    112,111,114,116,101,100,32,40,101,46,103,46,32,96,96,102,
++    114,111,109,32,109,111,100,117,108,101,32,105,109,112,111,114,
++    116,32,60,102,114,111,109,108,105,115,116,62,96,96,41,46,
++    32,32,84,104,101,32,39,108,101,118,101,108,39,10,32,32,
++    32,32,97,114,103,117,109,101,110,116,32,114,101,112,114,101,
++    115,101,110,116,115,32,116,104,101,32,112,97,99,107,97,103,
++    101,32,108,111,99,97,116,105,111,110,32,116,111,32,105,109,
++    112,111,114,116,32,102,114,111,109,32,105,110,32,97,32,114,
++    101,108,97,116,105,118,101,10,32,32,32,32,105,109,112,111,
++    114,116,32,40,101,46,103,46,32,96,96,102,114,111,109,32,
++    46,46,112,107,103,32,105,109,112,111,114,116,32,109,111,100,
++    96,96,32,119,111,117,108,100,32,104,97,118,101,32,97,32,
++    39,108,101,118,101,108,39,32,111,102,32,50,41,46,10,10,
++    32,32,32,32,105,0,0,0,0,117,1,0,0,0,46,78,
++    40,9,0,0,0,117,11,0,0,0,95,103,99,100,95,105,
++    109,112,111,114,116,117,4,0,0,0,78,111,110,101,117,17,
++    0,0,0,95,99,97,108,99,95,95,95,112,97,99,107,97,
++    103,101,95,95,117,9,0,0,0,112,97,114,116,105,116,105,
++    111,110,117,3,0,0,0,108,101,110,117,3,0,0,0,115,
++    121,115,117,7,0,0,0,109,111,100,117,108,101,115,117,8,
++    0,0,0,95,95,110,97,109,101,95,95,117,16,0,0,0,
++    95,104,97,110,100,108,101,95,102,114,111,109,108,105,115,116,
++    40,9,0,0,0,117,4,0,0,0,110,97,109,101,117,7,
++    0,0,0,103,108,111,98,97,108,115,117,6,0,0,0,108,
++    111,99,97,108,115,117,8,0,0,0,102,114,111,109,108,105,
++    115,116,117,5,0,0,0,108,101,118,101,108,117,6,0,0,
++    0,109,111,100,117,108,101,117,8,0,0,0,103,108,111,98,
++    97,108,115,95,117,7,0,0,0,112,97,99,107,97,103,101,
++    117,7,0,0,0,99,117,116,95,111,102,102,40,0,0,0,
+     0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,
+     101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,
+-    111,116,115,116,114,97,112,62,117,11,0,0,0,95,112,97,
+-    116,104,95,104,111,111,107,115,216,4,0,0,115,16,0,0,
+-    0,0,7,9,1,19,1,16,1,3,1,14,1,13,1,12,
+-    2,117,22,0,0,0,80,97,116,104,70,105,110,100,101,114,
+-    46,95,112,97,116,104,95,104,111,111,107,115,99,2,0,0,
+-    0,0,0,0,0,3,0,0,0,11,0,0,0,67,0,0,
+-    0,115,91,0,0,0,124,1,0,100,1,0,107,2,0,114,
+-    21,0,100,2,0,125,1,0,110,0,0,121,17,0,116,0,
+-    0,106,1,0,124,1,0,25,125,2,0,87,110,46,0,4,
+-    116,2,0,107,10,0,114,86,0,1,1,1,124,0,0,106,
+-    3,0,124,1,0,131,1,0,125,2,0,124,2,0,116,0,
+-    0,106,1,0,124,1,0,60,89,110,1,0,88,124,2,0,
+-    83,40,3,0,0,0,117,210,0,0,0,71,101,116,32,116,
+-    104,101,32,102,105,110,100,101,114,32,102,111,114,32,116,104,
+-    101,32,112,97,116,104,32,101,110,116,114,121,32,102,114,111,
+-    109,32,115,121,115,46,112,97,116,104,95,105,109,112,111,114,
+-    116,101,114,95,99,97,99,104,101,46,10,10,32,32,32,32,
+-    32,32,32,32,73,102,32,116,104,101,32,112,97,116,104,32,
+-    101,110,116,114,121,32,105,115,32,110,111,116,32,105,110,32,
+-    116,104,101,32,99,97,99,104,101,44,32,102,105,110,100,32,
+-    116,104,101,32,97,112,112,114,111,112,114,105,97,116,101,32,
+-    102,105,110,100,101,114,10,32,32,32,32,32,32,32,32,97,
+-    110,100,32,99,97,99,104,101,32,105,116,46,32,73,102,32,
+-    110,111,32,102,105,110,100,101,114,32,105,115,32,97,118,97,
+-    105,108,97,98,108,101,44,32,115,116,111,114,101,32,78,111,
+-    110,101,46,10,10,32,32,32,32,32,32,32,32,117,0,0,
+-    0,0,117,1,0,0,0,46,40,4,0,0,0,117,3,0,
+-    0,0,115,121,115,117,19,0,0,0,112,97,116,104,95,105,
+-    109,112,111,114,116,101,114,95,99,97,99,104,101,117,8,0,
+-    0,0,75,101,121,69,114,114,111,114,117,11,0,0,0,95,
+-    112,97,116,104,95,104,111,111,107,115,40,3,0,0,0,117,
+-    3,0,0,0,99,108,115,117,4,0,0,0,112,97,116,104,
+-    117,6,0,0,0,102,105,110,100,101,114,40,0,0,0,0,
+-    40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,
+-    110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,
+-    116,115,116,114,97,112,62,117,20,0,0,0,95,112,97,116,
+-    104,95,105,109,112,111,114,116,101,114,95,99,97,99,104,101,
+-    233,4,0,0,115,16,0,0,0,0,8,12,1,9,1,3,
+-    1,17,1,13,1,15,1,18,1,117,31,0,0,0,80,97,
+-    116,104,70,105,110,100,101,114,46,95,112,97,116,104,95,105,
+-    109,112,111,114,116,101,114,95,99,97,99,104,101,99,3,0,
+-    0,0,0,0,0,0,8,0,0,0,4,0,0,0,67,0,
+-    0,0,115,162,0,0,0,103,0,0,125,3,0,120,149,0,
+-    124,2,0,68,93,131,0,125,4,0,124,0,0,106,0,0,
+-    124,4,0,131,1,0,125,5,0,124,5,0,100,2,0,107,
+-    9,0,114,13,0,116,2,0,124,5,0,100,1,0,131,2,
+-    0,114,85,0,124,5,0,106,3,0,124,1,0,131,1,0,
+-    92,2,0,125,6,0,125,7,0,110,21,0,124,5,0,106,
+-    4,0,124,1,0,131,1,0,125,6,0,103,0,0,125,7,
+-    0,124,6,0,100,2,0,107,9,0,114,128,0,124,6,0,
+-    124,3,0,102,2,0,83,124,3,0,106,5,0,124,7,0,
+-    131,1,0,1,113,13,0,113,13,0,87,100,2,0,124,3,
+-    0,102,2,0,83,100,2,0,83,40,3,0,0,0,117,63,
+-    0,0,0,70,105,110,100,32,116,104,101,32,108,111,97,100,
+-    101,114,32,111,114,32,110,97,109,101,115,112,97,99,101,95,
+-    112,97,116,104,32,102,111,114,32,116,104,105,115,32,109,111,
+-    100,117,108,101,47,112,97,99,107,97,103,101,32,110,97,109,
+-    101,46,117,11,0,0,0,102,105,110,100,95,108,111,97,100,
+-    101,114,78,40,6,0,0,0,117,20,0,0,0,95,112,97,
+-    116,104,95,105,109,112,111,114,116,101,114,95,99,97,99,104,
+-    101,117,4,0,0,0,78,111,110,101,117,7,0,0,0,104,
+-    97,115,97,116,116,114,117,11,0,0,0,102,105,110,100,95,
+-    108,111,97,100,101,114,117,11,0,0,0,102,105,110,100,95,
+-    109,111,100,117,108,101,117,6,0,0,0,101,120,116,101,110,
+-    100,40,8,0,0,0,117,3,0,0,0,99,108,115,117,8,
+-    0,0,0,102,117,108,108,110,97,109,101,117,4,0,0,0,
+-    112,97,116,104,117,14,0,0,0,110,97,109,101,115,112,97,
+-    99,101,95,112,97,116,104,117,5,0,0,0,101,110,116,114,
+-    121,117,6,0,0,0,102,105,110,100,101,114,117,6,0,0,
+-    0,108,111,97,100,101,114,117,8,0,0,0,112,111,114,116,
+-    105,111,110,115,40,0,0,0,0,40,0,0,0,0,117,29,
+-    0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,
+-    116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,
+-    117,11,0,0,0,95,103,101,116,95,108,111,97,100,101,114,
+-    250,4,0,0,115,24,0,0,0,0,5,6,1,13,1,15,
+-    1,12,1,15,1,24,2,15,1,6,1,12,2,10,5,20,
+-    2,117,22,0,0,0,80,97,116,104,70,105,110,100,101,114,
+-    46,95,103,101,116,95,108,111,97,100,101,114,99,3,0,0,
+-    0,0,0,0,0,5,0,0,0,4,0,0,0,67,0,0,
+-    0,115,97,0,0,0,124,2,0,100,1,0,107,8,0,114,
+-    24,0,116,1,0,106,2,0,125,2,0,110,0,0,124,0,
+-    0,106,3,0,124,1,0,124,2,0,131,2,0,92,2,0,
+-    125,3,0,125,4,0,124,3,0,100,1,0,107,9,0,114,
+-    64,0,124,3,0,83,124,4,0,114,89,0,116,4,0,124,
+-    1,0,124,4,0,124,0,0,106,3,0,131,3,0,83,100,
+-    1,0,83,100,1,0,83,40,2,0,0,0,117,98,0,0,
+-    0,70,105,110,100,32,116,104,101,32,109,111,100,117,108,101,
+-    32,111,110,32,115,121,115,46,112,97,116,104,32,111,114,32,
+-    39,112,97,116,104,39,32,98,97,115,101,100,32,111,110,32,
+-    115,121,115,46,112,97,116,104,95,104,111,111,107,115,32,97,
+-    110,100,10,32,32,32,32,32,32,32,32,115,121,115,46,112,
+-    97,116,104,95,105,109,112,111,114,116,101,114,95,99,97,99,
+-    104,101,46,78,40,5,0,0,0,117,4,0,0,0,78,111,
+-    110,101,117,3,0,0,0,115,121,115,117,4,0,0,0,112,
+-    97,116,104,117,11,0,0,0,95,103,101,116,95,108,111,97,
+-    100,101,114,117,15,0,0,0,78,97,109,101,115,112,97,99,
+-    101,76,111,97,100,101,114,40,5,0,0,0,117,3,0,0,
+-    0,99,108,115,117,8,0,0,0,102,117,108,108,110,97,109,
+-    101,117,4,0,0,0,112,97,116,104,117,6,0,0,0,108,
+-    111,97,100,101,114,117,14,0,0,0,110,97,109,101,115,112,
+-    97,99,101,95,112,97,116,104,40,0,0,0,0,40,0,0,
++    111,116,115,116,114,97,112,62,117,10,0,0,0,95,95,105,
++    109,112,111,114,116,95,95,117,6,0,0,115,26,0,0,0,
++    0,11,12,1,15,2,24,1,12,1,18,1,6,3,12,1,
++    23,1,6,1,4,4,35,3,40,2,117,10,0,0,0,95,
++    95,105,109,112,111,114,116,95,95,99,2,0,0,0,0,0,
++    0,0,16,0,0,0,13,0,0,0,67,0,0,0,115,24,
++    3,0,0,124,1,0,97,0,0,124,0,0,97,1,0,116,
++    1,0,106,2,0,106,3,0,114,33,0,116,4,0,97,5,
++    0,110,6,0,116,6,0,97,5,0,116,7,0,116,1,0,
++    131,1,0,125,2,0,120,119,0,116,1,0,106,8,0,106,
++    9,0,131,0,0,68,93,102,0,92,2,0,125,3,0,125,
++    4,0,116,10,0,124,4,0,124,2,0,131,2,0,114,67,
++    0,116,11,0,124,4,0,100,1,0,131,2,0,115,169,0,
++    124,3,0,116,1,0,106,12,0,107,6,0,114,136,0,116,
++    13,0,124,4,0,95,14,0,113,166,0,116,0,0,106,15,
++    0,124,3,0,131,1,0,114,166,0,116,16,0,124,4,0,
++    95,14,0,113,166,0,113,169,0,113,67,0,113,67,0,87,
++    116,1,0,106,8,0,116,17,0,25,125,5,0,120,76,0,
++    100,28,0,68,93,68,0,125,6,0,124,6,0,116,1,0,
++    106,8,0,107,7,0,114,232,0,116,13,0,106,18,0,124,
++    6,0,131,1,0,125,7,0,110,13,0,116,1,0,106,8,
++    0,124,6,0,25,125,7,0,116,19,0,124,5,0,124,6,
++    0,124,7,0,131,3,0,1,113,193,0,87,100,6,0,100,
++    7,0,103,1,0,102,2,0,100,8,0,100,9,0,100,7,
++    0,103,2,0,102,2,0,100,10,0,100,9,0,100,7,0,
++    103,2,0,102,2,0,102,3,0,125,8,0,120,189,0,124,
++    8,0,68,93,169,0,92,2,0,125,9,0,125,10,0,116,
++    20,0,100,11,0,100,12,0,132,0,0,124,10,0,68,131,
++    1,0,131,1,0,115,107,1,116,21,0,130,1,0,124,10,
++    0,100,13,0,25,125,11,0,124,9,0,116,1,0,106,8,
++    0,107,6,0,114,149,1,116,1,0,106,8,0,124,9,0,
++    25,125,12,0,80,113,64,1,121,60,0,116,13,0,106,18,
++    0,124,9,0,131,1,0,125,12,0,124,9,0,100,10,0,
++    107,2,0,114,207,1,100,14,0,116,1,0,106,22,0,107,
++    6,0,114,207,1,124,10,0,100,15,0,25,125,11,0,110,
++    0,0,80,87,113,64,1,4,116,23,0,107,10,0,114,232,
++    1,1,1,1,119,64,1,89,113,64,1,88,113,64,1,87,
++    116,23,0,100,16,0,131,1,0,130,1,0,121,19,0,116,
++    13,0,106,18,0,100,17,0,131,1,0,125,13,0,87,110,
++    24,0,4,116,23,0,107,10,0,114,38,2,1,1,1,100,
++    27,0,125,13,0,89,110,1,0,88,116,13,0,106,18,0,
++    100,18,0,131,1,0,125,14,0,124,9,0,100,8,0,107,
++    2,0,114,100,2,116,13,0,106,18,0,100,19,0,131,1,
++    0,125,15,0,116,19,0,124,5,0,100,20,0,124,15,0,
++    131,3,0,1,110,0,0,116,19,0,124,5,0,100,21,0,
++    124,12,0,131,3,0,1,116,19,0,124,5,0,100,17,0,
++    124,13,0,131,3,0,1,116,19,0,124,5,0,100,18,0,
++    124,14,0,131,3,0,1,116,19,0,124,5,0,100,22,0,
++    124,11,0,131,3,0,1,116,19,0,124,5,0,100,23,0,
++    116,25,0,124,10,0,131,1,0,131,3,0,1,116,19,0,
++    124,5,0,100,24,0,116,26,0,131,0,0,131,3,0,1,
++    116,27,0,106,28,0,116,0,0,106,29,0,131,0,0,131,
++    1,0,1,124,9,0,100,8,0,107,2,0,114,20,3,116,
++    30,0,106,31,0,100,25,0,131,1,0,1,100,26,0,116,
++    27,0,107,6,0,114,20,3,100,29,0,116,33,0,95,34,
++    0,113,20,3,110,0,0,100,27,0,83,40,30,0,0,0,
++    117,250,0,0,0,83,101,116,117,112,32,105,109,112,111,114,
++    116,108,105,98,32,98,121,32,105,109,112,111,114,116,105,110,
++    103,32,110,101,101,100,101,100,32,98,117,105,108,116,45,105,
++    110,32,109,111,100,117,108,101,115,32,97,110,100,32,105,110,
++    106,101,99,116,105,110,103,32,116,104,101,109,10,32,32,32,
++    32,105,110,116,111,32,116,104,101,32,103,108,111,98,97,108,
++    32,110,97,109,101,115,112,97,99,101,46,10,10,32,32,32,
++    32,65,115,32,115,121,115,32,105,115,32,110,101,101,100,101,
++    100,32,102,111,114,32,115,121,115,46,109,111,100,117,108,101,
++    115,32,97,99,99,101,115,115,32,97,110,100,32,95,105,109,
++    112,32,105,115,32,110,101,101,100,101,100,32,116,111,32,108,
++    111,97,100,32,98,117,105,108,116,45,105,110,10,32,32,32,
++    32,109,111,100,117,108,101,115,44,32,116,104,111,115,101,32,
++    116,119,111,32,109,111,100,117,108,101,115,32,109,117,115,116,
++    32,98,101,32,101,120,112,108,105,99,105,116,108,121,32,112,
++    97,115,115,101,100,32,105,110,46,10,10,32,32,32,32,117,
++    10,0,0,0,95,95,108,111,97,100,101,114,95,95,117,3,
++    0,0,0,95,105,111,117,9,0,0,0,95,119,97,114,110,
++    105,110,103,115,117,8,0,0,0,98,117,105,108,116,105,110,
++    115,117,7,0,0,0,109,97,114,115,104,97,108,117,5,0,
++    0,0,112,111,115,105,120,117,1,0,0,0,47,117,2,0,
++    0,0,110,116,117,1,0,0,0,92,117,3,0,0,0,111,
++    115,50,99,1,0,0,0,0,0,0,0,2,0,0,0,3,
++    0,0,0,115,0,0,0,115,33,0,0,0,124,0,0,93,
++    23,0,125,1,0,116,0,0,124,1,0,131,1,0,100,0,
++    0,107,2,0,86,1,113,3,0,100,1,0,83,40,2,0,
++    0,0,105,1,0,0,0,78,40,1,0,0,0,117,3,0,
++    0,0,108,101,110,40,2,0,0,0,117,2,0,0,0,46,
++    48,117,3,0,0,0,115,101,112,40,0,0,0,0,40,0,
++    0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,
++    105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,
++    116,114,97,112,62,117,9,0,0,0,60,103,101,110,101,120,
++    112,114,62,190,6,0,0,115,2,0,0,0,6,0,117,25,
++    0,0,0,95,115,101,116,117,112,46,60,108,111,99,97,108,
++    115,62,46,60,103,101,110,101,120,112,114,62,105,0,0,0,
++    0,117,7,0,0,0,69,77,88,32,71,67,67,105,1,0,
++    0,0,117,30,0,0,0,105,109,112,111,114,116,108,105,98,
++    32,114,101,113,117,105,114,101,115,32,112,111,115,105,120,32,
++    111,114,32,110,116,117,7,0,0,0,95,116,104,114,101,97,
++    100,117,8,0,0,0,95,119,101,97,107,114,101,102,117,6,
++    0,0,0,119,105,110,114,101,103,117,7,0,0,0,95,119,
++    105,110,114,101,103,117,3,0,0,0,95,111,115,117,8,0,
++    0,0,112,97,116,104,95,115,101,112,117,15,0,0,0,112,
++    97,116,104,95,115,101,112,97,114,97,116,111,114,115,117,11,
++    0,0,0,95,114,101,108,97,120,95,99,97,115,101,117,4,
++    0,0,0,46,112,121,119,117,6,0,0,0,95,100,46,112,
++    121,100,78,40,4,0,0,0,117,3,0,0,0,95,105,111,
++    117,9,0,0,0,95,119,97,114,110,105,110,103,115,117,8,
++    0,0,0,98,117,105,108,116,105,110,115,117,7,0,0,0,
++    109,97,114,115,104,97,108,84,40,35,0,0,0,117,4,0,
++    0,0,95,105,109,112,117,3,0,0,0,115,121,115,117,5,
++    0,0,0,102,108,97,103,115,117,8,0,0,0,111,112,116,
++    105,109,105,122,101,117,27,0,0,0,79,80,84,73,77,73,
++    90,69,68,95,66,89,84,69,67,79,68,69,95,83,85,70,
++    70,73,88,69,83,117,17,0,0,0,66,89,84,69,67,79,
++    68,69,95,83,85,70,70,73,88,69,83,117,23,0,0,0,
++    68,69,66,85,71,95,66,89,84,69,67,79,68,69,95,83,
++    85,70,70,73,88,69,83,117,4,0,0,0,116,121,112,101,
++    117,7,0,0,0,109,111,100,117,108,101,115,117,5,0,0,
++    0,105,116,101,109,115,117,10,0,0,0,105,115,105,110,115,
++    116,97,110,99,101,117,7,0,0,0,104,97,115,97,116,116,
++    114,117,20,0,0,0,98,117,105,108,116,105,110,95,109,111,
++    100,117,108,101,95,110,97,109,101,115,117,15,0,0,0,66,
++    117,105,108,116,105,110,73,109,112,111,114,116,101,114,117,10,
++    0,0,0,95,95,108,111,97,100,101,114,95,95,117,9,0,
++    0,0,105,115,95,102,114,111,122,101,110,117,14,0,0,0,
++    70,114,111,122,101,110,73,109,112,111,114,116,101,114,117,8,
++    0,0,0,95,95,110,97,109,101,95,95,117,11,0,0,0,
++    108,111,97,100,95,109,111,100,117,108,101,117,7,0,0,0,
++    115,101,116,97,116,116,114,117,3,0,0,0,97,108,108,117,
++    14,0,0,0,65,115,115,101,114,116,105,111,110,69,114,114,
++    111,114,117,7,0,0,0,118,101,114,115,105,111,110,117,11,
++    0,0,0,73,109,112,111,114,116,69,114,114,111,114,117,4,
++    0,0,0,78,111,110,101,117,3,0,0,0,115,101,116,117,
++    16,0,0,0,95,109,97,107,101,95,114,101,108,97,120,95,
++    99,97,115,101,117,18,0,0,0,69,88,84,69,78,83,73,
++    79,78,95,83,85,70,70,73,88,69,83,117,6,0,0,0,
++    101,120,116,101,110,100,117,18,0,0,0,101,120,116,101,110,
++    115,105,111,110,95,115,117,102,102,105,120,101,115,117,15,0,
++    0,0,83,79,85,82,67,69,95,83,85,70,70,73,88,69,
++    83,117,6,0,0,0,97,112,112,101,110,100,117,4,0,0,
++    0,84,114,117,101,117,21,0,0,0,87,105,110,100,111,119,
++    115,82,101,103,105,115,116,114,121,70,105,110,100,101,114,117,
++    11,0,0,0,68,69,66,85,71,95,66,85,73,76,68,40,
++    16,0,0,0,117,10,0,0,0,115,121,115,95,109,111,100,
++    117,108,101,117,11,0,0,0,95,105,109,112,95,109,111,100,
++    117,108,101,117,11,0,0,0,109,111,100,117,108,101,95,116,
++    121,112,101,117,4,0,0,0,110,97,109,101,117,6,0,0,
++    0,109,111,100,117,108,101,117,11,0,0,0,115,101,108,102,
++    95,109,111,100,117,108,101,117,12,0,0,0,98,117,105,108,
++    116,105,110,95,110,97,109,101,117,14,0,0,0,98,117,105,
++    108,116,105,110,95,109,111,100,117,108,101,117,10,0,0,0,
++    111,115,95,100,101,116,97,105,108,115,117,10,0,0,0,98,
++    117,105,108,116,105,110,95,111,115,117,15,0,0,0,112,97,
++    116,104,95,115,101,112,97,114,97,116,111,114,115,117,8,0,
++    0,0,112,97,116,104,95,115,101,112,117,9,0,0,0,111,
++    115,95,109,111,100,117,108,101,117,13,0,0,0,116,104,114,
++    101,97,100,95,109,111,100,117,108,101,117,14,0,0,0,119,
++    101,97,107,114,101,102,95,109,111,100,117,108,101,117,13,0,
++    0,0,119,105,110,114,101,103,95,109,111,100,117,108,101,40,
++    0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,
++    114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,
++    95,98,111,111,116,115,116,114,97,112,62,117,6,0,0,0,
++    95,115,101,116,117,112,153,6,0,0,115,106,0,0,0,0,
++    9,6,1,6,2,12,1,9,2,6,2,12,1,28,1,15,
++    1,15,1,15,1,12,1,15,1,22,2,13,1,13,1,15,
++    1,18,2,13,1,20,2,48,1,19,2,31,1,10,1,15,
++    1,13,1,4,2,3,1,15,2,27,1,13,1,5,1,13,
++    1,12,2,12,2,3,1,19,1,13,2,11,1,15,2,12,
++    1,15,1,19,2,16,1,16,1,16,1,16,1,22,2,19,
++    1,19,1,12,1,13,1,12,1,117,6,0,0,0,95,115,
++    101,116,117,112,99,2,0,0,0,0,0,0,0,3,0,0,
++    0,3,0,0,0,67,0,0,0,115,136,0,0,0,116,0,
++    0,124,0,0,124,1,0,131,2,0,1,116,1,0,131,0,
++    0,125,2,0,116,2,0,106,3,0,106,4,0,116,5,0,
++    106,6,0,124,2,0,140,0,0,103,1,0,131,1,0,1,
++    116,2,0,106,7,0,106,8,0,116,9,0,131,1,0,1,
++    116,2,0,106,7,0,106,8,0,116,10,0,131,1,0,1,
++    116,11,0,106,12,0,100,1,0,107,2,0,114,116,0,116,
++    2,0,106,7,0,106,8,0,116,13,0,131,1,0,1,110,
++    0,0,116,2,0,106,7,0,106,8,0,116,14,0,131,1,
++    0,1,100,2,0,83,40,3,0,0,0,117,50,0,0,0,
++    73,110,115,116,97,108,108,32,105,109,112,111,114,116,108,105,
++    98,32,97,115,32,116,104,101,32,105,109,112,108,101,109,101,
++    110,116,97,116,105,111,110,32,111,102,32,105,109,112,111,114,
++    116,46,117,2,0,0,0,110,116,78,40,15,0,0,0,117,
++    6,0,0,0,95,115,101,116,117,112,117,27,0,0,0,95,
++    103,101,116,95,115,117,112,112,111,114,116,101,100,95,102,105,
++    108,101,95,108,111,97,100,101,114,115,117,3,0,0,0,115,
++    121,115,117,10,0,0,0,112,97,116,104,95,104,111,111,107,
++    115,117,6,0,0,0,101,120,116,101,110,100,117,10,0,0,
++    0,70,105,108,101,70,105,110,100,101,114,117,9,0,0,0,
++    112,97,116,104,95,104,111,111,107,117,9,0,0,0,109,101,
++    116,97,95,112,97,116,104,117,6,0,0,0,97,112,112,101,
++    110,100,117,15,0,0,0,66,117,105,108,116,105,110,73,109,
++    112,111,114,116,101,114,117,14,0,0,0,70,114,111,122,101,
++    110,73,109,112,111,114,116,101,114,117,3,0,0,0,95,111,
++    115,117,8,0,0,0,95,95,110,97,109,101,95,95,117,21,
++    0,0,0,87,105,110,100,111,119,115,82,101,103,105,115,116,
++    114,121,70,105,110,100,101,114,117,10,0,0,0,80,97,116,
++    104,70,105,110,100,101,114,40,3,0,0,0,117,10,0,0,
++    0,115,121,115,95,109,111,100,117,108,101,117,11,0,0,0,
++    95,105,109,112,95,109,111,100,117,108,101,117,17,0,0,0,
++    115,117,112,112,111,114,116,101,100,95,108,111,97,100,101,114,
++    115,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
++    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
++    98,46,95,98,111,111,116,115,116,114,97,112,62,117,8,0,
++    0,0,95,105,110,115,116,97,108,108,232,6,0,0,115,16,
++    0,0,0,0,2,13,1,9,1,28,1,16,1,16,1,15,
++    1,19,1,117,8,0,0,0,95,105,110,115,116,97,108,108,
++    78,40,3,0,0,0,117,3,0,0,0,119,105,110,117,6,
++    0,0,0,99,121,103,119,105,110,117,6,0,0,0,100,97,
++    114,119,105,110,40,74,0,0,0,117,7,0,0,0,95,95,
++    100,111,99,95,95,117,27,0,0,0,95,67,65,83,69,95,
++    73,78,83,69,78,83,73,84,73,86,69,95,80,76,65,84,
++    70,79,82,77,83,117,16,0,0,0,95,109,97,107,101,95,
++    114,101,108,97,120,95,99,97,115,101,117,7,0,0,0,95,
++    119,95,108,111,110,103,117,7,0,0,0,95,114,95,108,111,
++    110,103,117,10,0,0,0,95,112,97,116,104,95,106,111,105,
++    110,117,11,0,0,0,95,112,97,116,104,95,115,112,108,105,
++    116,117,18,0,0,0,95,112,97,116,104,95,105,115,95,109,
++    111,100,101,95,116,121,112,101,117,12,0,0,0,95,112,97,
++    116,104,95,105,115,102,105,108,101,117,11,0,0,0,95,112,
++    97,116,104,95,105,115,100,105,114,117,13,0,0,0,95,119,
++    114,105,116,101,95,97,116,111,109,105,99,117,5,0,0,0,
++    95,119,114,97,112,117,4,0,0,0,116,121,112,101,117,8,
++    0,0,0,95,95,99,111,100,101,95,95,117,10,0,0,0,
++    95,99,111,100,101,95,116,121,112,101,117,10,0,0,0,110,
++    101,119,95,109,111,100,117,108,101,117,13,0,0,0,95,109,
++    111,100,117,108,101,95,108,111,99,107,115,117,12,0,0,0,
++    95,98,108,111,99,107,105,110,103,95,111,110,117,12,0,0,
++    0,82,117,110,116,105,109,101,69,114,114,111,114,117,14,0,
++    0,0,95,68,101,97,100,108,111,99,107,69,114,114,111,114,
++    117,11,0,0,0,95,77,111,100,117,108,101,76,111,99,107,
++    117,16,0,0,0,95,68,117,109,109,121,77,111,100,117,108,
++    101,76,111,99,107,117,16,0,0,0,95,103,101,116,95,109,
++    111,100,117,108,101,95,108,111,99,107,117,19,0,0,0,95,
++    108,111,99,107,95,117,110,108,111,99,107,95,109,111,100,117,
++    108,101,117,25,0,0,0,95,99,97,108,108,95,119,105,116,
++    104,95,102,114,97,109,101,115,95,114,101,109,111,118,101,100,
++    117,3,0,0,0,111,114,100,117,17,0,0,0,95,82,65,
++    87,95,77,65,71,73,67,95,78,85,77,66,69,82,117,5,
++    0,0,0,98,121,116,101,115,117,5,0,0,0,114,97,110,
++    103,101,117,12,0,0,0,95,77,65,71,73,67,95,66,89,
++    84,69,83,117,8,0,0,0,95,80,89,67,65,67,72,69,
++    117,15,0,0,0,83,79,85,82,67,69,95,83,85,70,70,
++    73,88,69,83,117,23,0,0,0,68,69,66,85,71,95,66,
++    89,84,69,67,79,68,69,95,83,85,70,70,73,88,69,83,
++    117,27,0,0,0,79,80,84,73,77,73,90,69,68,95,66,
++    89,84,69,67,79,68,69,95,83,85,70,70,73,88,69,83,
++    117,4,0,0,0,78,111,110,101,117,17,0,0,0,99,97,
++    99,104,101,95,102,114,111,109,95,115,111,117,114,99,101,117,
++    17,0,0,0,115,111,117,114,99,101,95,102,114,111,109,95,
++    99,97,99,104,101,117,15,0,0,0,95,103,101,116,95,115,
++    111,117,114,99,101,102,105,108,101,117,16,0,0,0,95,118,
++    101,114,98,111,115,101,95,109,101,115,115,97,103,101,117,11,
++    0,0,0,115,101,116,95,112,97,99,107,97,103,101,117,10,
++    0,0,0,115,101,116,95,108,111,97,100,101,114,117,17,0,
++    0,0,109,111,100,117,108,101,95,102,111,114,95,108,111,97,
++    100,101,114,117,11,0,0,0,95,99,104,101,99,107,95,110,
++    97,109,101,117,17,0,0,0,95,114,101,113,117,105,114,101,
++    115,95,98,117,105,108,116,105,110,117,16,0,0,0,95,114,
++    101,113,117,105,114,101,115,95,102,114,111,122,101,110,117,17,
++    0,0,0,95,102,105,110,100,95,109,111,100,117,108,101,95,
++    115,104,105,109,117,15,0,0,0,66,117,105,108,116,105,110,
++    73,109,112,111,114,116,101,114,117,14,0,0,0,70,114,111,
++    122,101,110,73,109,112,111,114,116,101,114,117,21,0,0,0,
++    87,105,110,100,111,119,115,82,101,103,105,115,116,114,121,70,
++    105,110,100,101,114,117,13,0,0,0,95,76,111,97,100,101,
++    114,66,97,115,105,99,115,117,12,0,0,0,83,111,117,114,
++    99,101,76,111,97,100,101,114,117,10,0,0,0,70,105,108,
++    101,76,111,97,100,101,114,117,16,0,0,0,83,111,117,114,
++    99,101,70,105,108,101,76,111,97,100,101,114,117,20,0,0,
++    0,83,111,117,114,99,101,108,101,115,115,70,105,108,101,76,
++    111,97,100,101,114,117,18,0,0,0,69,88,84,69,78,83,
++    73,79,78,95,83,85,70,70,73,88,69,83,117,19,0,0,
++    0,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111,
++    97,100,101,114,117,14,0,0,0,95,78,97,109,101,115,112,
++    97,99,101,80,97,116,104,117,15,0,0,0,78,97,109,101,
++    115,112,97,99,101,76,111,97,100,101,114,117,10,0,0,0,
++    80,97,116,104,70,105,110,100,101,114,117,10,0,0,0,70,
++    105,108,101,70,105,110,100,101,114,117,18,0,0,0,95,73,
++    109,112,111,114,116,76,111,99,107,67,111,110,116,101,120,116,
++    117,13,0,0,0,95,114,101,115,111,108,118,101,95,110,97,
++    109,101,117,12,0,0,0,95,102,105,110,100,95,109,111,100,
++    117,108,101,117,13,0,0,0,95,115,97,110,105,116,121,95,
++    99,104,101,99,107,117,8,0,0,0,95,69,82,82,95,77,
++    83,71,117,23,0,0,0,95,102,105,110,100,95,97,110,100,
++    95,108,111,97,100,95,117,110,108,111,99,107,101,100,117,14,
++    0,0,0,95,102,105,110,100,95,97,110,100,95,108,111,97,
++    100,117,11,0,0,0,95,103,99,100,95,105,109,112,111,114,
++    116,117,16,0,0,0,95,104,97,110,100,108,101,95,102,114,
++    111,109,108,105,115,116,117,17,0,0,0,95,99,97,108,99,
++    95,95,95,112,97,99,107,97,103,101,95,95,117,27,0,0,
++    0,95,103,101,116,95,115,117,112,112,111,114,116,101,100,95,
++    102,105,108,101,95,108,111,97,100,101,114,115,117,10,0,0,
++    0,95,95,105,109,112,111,114,116,95,95,117,6,0,0,0,
++    95,115,101,116,117,112,117,8,0,0,0,95,105,110,115,116,
++    97,108,108,40,0,0,0,0,40,0,0,0,0,40,0,0,
+     0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+     109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,11,0,0,0,102,105,110,100,95,109,111,
+-    100,117,108,101,19,5,0,0,115,16,0,0,0,0,4,12,
+-    1,12,1,24,1,12,1,4,2,6,3,19,2,117,22,0,
+-    0,0,80,97,116,104,70,105,110,100,101,114,46,102,105,110,
+-    100,95,109,111,100,117,108,101,78,40,11,0,0,0,117,8,
+-    0,0,0,95,95,110,97,109,101,95,95,117,10,0,0,0,
+-    95,95,109,111,100,117,108,101,95,95,117,12,0,0,0,95,
+-    95,113,117,97,108,110,97,109,101,95,95,117,7,0,0,0,
+-    95,95,100,111,99,95,95,117,11,0,0,0,99,108,97,115,
+-    115,109,101,116,104,111,100,117,17,0,0,0,105,110,118,97,
+-    108,105,100,97,116,101,95,99,97,99,104,101,115,117,11,0,
+-    0,0,95,112,97,116,104,95,104,111,111,107,115,117,20,0,
+-    0,0,95,112,97,116,104,95,105,109,112,111,114,116,101,114,
+-    95,99,97,99,104,101,117,11,0,0,0,95,103,101,116,95,
+-    108,111,97,100,101,114,117,4,0,0,0,78,111,110,101,117,
+-    11,0,0,0,102,105,110,100,95,109,111,100,117,108,101,40,
+-    1,0,0,0,117,10,0,0,0,95,95,108,111,99,97,108,
+-    115,95,95,40,0,0,0,0,40,0,0,0,0,117,29,0,
+-    0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,
+-    108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,
+-    10,0,0,0,80,97,116,104,70,105,110,100,101,114,204,4,
+-    0,0,115,14,0,0,0,16,2,6,2,18,8,18,17,18,
+-    17,18,25,3,1,117,10,0,0,0,80,97,116,104,70,105,
+-    110,100,101,114,99,1,0,0,0,0,0,0,0,1,0,0,
+-    0,3,0,0,0,66,0,0,0,115,110,0,0,0,124,0,
+-    0,69,101,0,0,90,1,0,100,0,0,90,2,0,100,1,
+-    0,90,3,0,100,2,0,100,3,0,132,0,0,90,4,0,
+-    100,4,0,100,5,0,132,0,0,90,5,0,101,6,0,90,
+-    7,0,100,6,0,100,7,0,132,0,0,90,8,0,100,8,
+-    0,100,9,0,132,0,0,90,9,0,101,10,0,100,10,0,
+-    100,11,0,132,0,0,131,1,0,90,11,0,100,12,0,100,
+-    13,0,132,0,0,90,12,0,100,14,0,83,40,15,0,0,
+-    0,117,10,0,0,0,70,105,108,101,70,105,110,100,101,114,
+-    117,172,0,0,0,70,105,108,101,45,98,97,115,101,100,32,
+-    102,105,110,100,101,114,46,10,10,32,32,32,32,73,110,116,
+-    101,114,97,99,116,105,111,110,115,32,119,105,116,104,32,116,
+-    104,101,32,102,105,108,101,32,115,121,115,116,101,109,32,97,
+-    114,101,32,99,97,99,104,101,100,32,102,111,114,32,112,101,
+-    114,102,111,114,109,97,110,99,101,44,32,98,101,105,110,103,
+-    10,32,32,32,32,114,101,102,114,101,115,104,101,100,32,119,
+-    104,101,110,32,116,104,101,32,100,105,114,101,99,116,111,114,
+-    121,32,116,104,101,32,102,105,110,100,101,114,32,105,115,32,
+-    104,97,110,100,108,105,110,103,32,104,97,115,32,98,101,101,
+-    110,32,109,111,100,105,102,105,101,100,46,10,10,32,32,32,
+-    32,99,2,0,0,0,0,0,0,0,5,0,0,0,5,0,
+-    0,0,7,0,0,0,115,122,0,0,0,103,0,0,125,3,
+-    0,120,52,0,124,2,0,68,93,44,0,92,2,0,137,0,
+-    0,125,4,0,124,3,0,106,0,0,135,0,0,102,1,0,
+-    100,1,0,100,2,0,134,0,0,124,4,0,68,131,1,0,
+-    131,1,0,1,113,13,0,87,124,3,0,124,0,0,95,1,
+-    0,124,1,0,112,79,0,100,3,0,124,0,0,95,2,0,
+-    100,6,0,124,0,0,95,3,0,116,4,0,131,0,0,124,
+-    0,0,95,5,0,116,4,0,131,0,0,124,0,0,95,6,
+-    0,100,5,0,83,40,7,0,0,0,117,201,0,0,0,73,
+-    110,105,116,105,97,108,105,122,101,32,119,105,116,104,32,116,
+-    104,101,32,112,97,116,104,32,116,111,32,115,101,97,114,99,
+-    104,32,111,110,32,97,110,100,32,97,32,118,97,114,105,97,
+-    98,108,101,32,110,117,109,98,101,114,32,111,102,10,32,32,
+-    32,32,32,32,32,32,51,45,116,117,112,108,101,115,32,99,
+-    111,110,116,97,105,110,105,110,103,32,116,104,101,32,108,111,
+-    97,100,101,114,44,32,102,105,108,101,32,115,117,102,102,105,
+-    120,101,115,32,116,104,101,32,108,111,97,100,101,114,32,114,
+-    101,99,111,103,110,105,122,101,115,44,10,32,32,32,32,32,
+-    32,32,32,97,110,100,32,97,32,98,111,111,108,101,97,110,
+-    32,111,102,32,119,104,101,116,104,101,114,32,116,104,101,32,
+-    108,111,97,100,101,114,32,104,97,110,100,108,101,115,32,112,
+-    97,99,107,97,103,101,115,46,99,1,0,0,0,0,0,0,
+-    0,2,0,0,0,3,0,0,0,51,0,0,0,115,27,0,
+-    0,0,124,0,0,93,17,0,125,1,0,124,1,0,136,0,
+-    0,102,2,0,86,1,113,3,0,100,0,0,83,40,1,0,
+-    0,0,78,40,0,0,0,0,40,2,0,0,0,117,2,0,
+-    0,0,46,48,117,6,0,0,0,115,117,102,102,105,120,40,
+-    1,0,0,0,117,6,0,0,0,108,111,97,100,101,114,40,
+-    0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
+-    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
+-    115,116,114,97,112,62,117,9,0,0,0,60,103,101,110,101,
+-    120,112,114,62,52,5,0,0,115,2,0,0,0,6,0,117,
+-    38,0,0,0,70,105,108,101,70,105,110,100,101,114,46,95,
+-    95,105,110,105,116,95,95,46,60,108,111,99,97,108,115,62,
+-    46,60,103,101,110,101,120,112,114,62,117,1,0,0,0,46,
+-    105,1,0,0,0,78,105,255,255,255,255,40,7,0,0,0,
+-    117,6,0,0,0,101,120,116,101,110,100,117,8,0,0,0,
+-    95,108,111,97,100,101,114,115,117,4,0,0,0,112,97,116,
+-    104,117,11,0,0,0,95,112,97,116,104,95,109,116,105,109,
+-    101,117,3,0,0,0,115,101,116,117,11,0,0,0,95,112,
+-    97,116,104,95,99,97,99,104,101,117,19,0,0,0,95,114,
+-    101,108,97,120,101,100,95,112,97,116,104,95,99,97,99,104,
+-    101,40,5,0,0,0,117,4,0,0,0,115,101,108,102,117,
+-    4,0,0,0,112,97,116,104,117,7,0,0,0,100,101,116,
+-    97,105,108,115,117,7,0,0,0,108,111,97,100,101,114,115,
+-    117,8,0,0,0,115,117,102,102,105,120,101,115,40,0,0,
+-    0,0,40,1,0,0,0,117,6,0,0,0,108,111,97,100,
+-    101,114,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+-    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,8,0,0,0,95,95,105,110,105,116,95,
+-    95,46,5,0,0,115,16,0,0,0,0,4,6,1,19,1,
+-    36,1,9,2,15,1,9,1,12,1,117,19,0,0,0,70,
+-    105,108,101,70,105,110,100,101,114,46,95,95,105,110,105,116,
+-    95,95,99,1,0,0,0,0,0,0,0,1,0,0,0,2,
+-    0,0,0,67,0,0,0,115,13,0,0,0,100,3,0,124,
+-    0,0,95,0,0,100,2,0,83,40,4,0,0,0,117,31,
+-    0,0,0,73,110,118,97,108,105,100,97,116,101,32,116,104,
+-    101,32,100,105,114,101,99,116,111,114,121,32,109,116,105,109,
+-    101,46,105,1,0,0,0,78,105,255,255,255,255,40,1,0,
+-    0,0,117,11,0,0,0,95,112,97,116,104,95,109,116,105,
+-    109,101,40,1,0,0,0,117,4,0,0,0,115,101,108,102,
+-    40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,
+-    102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,
+-    46,95,98,111,111,116,115,116,114,97,112,62,117,17,0,0,
+-    0,105,110,118,97,108,105,100,97,116,101,95,99,97,99,104,
+-    101,115,60,5,0,0,115,2,0,0,0,0,2,117,28,0,
+-    0,0,70,105,108,101,70,105,110,100,101,114,46,105,110,118,
+-    97,108,105,100,97,116,101,95,99,97,99,104,101,115,99,2,
+-    0,0,0,0,0,0,0,12,0,0,0,13,0,0,0,67,
+-    0,0,0,115,172,1,0,0,100,5,0,125,2,0,124,1,
+-    0,106,1,0,100,1,0,131,1,0,100,2,0,25,125,3,
+-    0,121,25,0,116,2,0,106,3,0,124,0,0,106,4,0,
+-    131,1,0,106,5,0,125,4,0,87,110,24,0,4,116,6,
+-    0,107,10,0,114,76,0,1,1,1,100,6,0,125,4,0,
+-    89,110,1,0,88,124,4,0,124,0,0,106,7,0,107,3,
+-    0,114,114,0,124,0,0,106,8,0,131,0,0,1,124,4,
+-    0,124,0,0,95,7,0,110,0,0,116,9,0,131,0,0,
+-    114,147,0,124,0,0,106,10,0,125,5,0,124,3,0,106,
+-    11,0,131,0,0,125,6,0,110,15,0,124,0,0,106,12,
+-    0,125,5,0,124,3,0,125,6,0,124,6,0,124,5,0,
+-    107,6,0,114,45,1,116,13,0,124,0,0,106,4,0,124,
+-    3,0,131,2,0,125,7,0,116,14,0,124,7,0,131,1,
+-    0,114,45,1,120,91,0,124,0,0,106,15,0,68,93,71,
+-    0,92,2,0,125,8,0,125,9,0,100,4,0,124,8,0,
+-    23,125,10,0,116,13,0,124,7,0,124,10,0,131,2,0,
+-    125,11,0,116,16,0,124,11,0,131,1,0,114,214,0,124,
+-    9,0,124,1,0,124,11,0,131,2,0,124,7,0,103,1,
+-    0,102,2,0,83,113,214,0,87,100,7,0,125,2,0,113,
+-    45,1,110,0,0,120,95,0,124,0,0,106,15,0,68,93,
+-    84,0,92,2,0,125,8,0,125,9,0,124,6,0,124,8,
+-    0,23,124,5,0,107,6,0,114,55,1,116,13,0,124,0,
+-    0,106,4,0,124,3,0,124,8,0,23,131,2,0,125,11,
+-    0,116,16,0,124,11,0,131,1,0,114,139,1,124,9,0,
+-    124,1,0,124,11,0,131,2,0,103,0,0,102,2,0,83,
+-    113,55,1,113,55,1,87,124,2,0,114,162,1,100,8,0,
+-    124,7,0,103,1,0,102,2,0,83,100,8,0,103,0,0,
+-    102,2,0,83,40,9,0,0,0,117,125,0,0,0,84,114,
+-    121,32,116,111,32,102,105,110,100,32,97,32,108,111,97,100,
+-    101,114,32,102,111,114,32,116,104,101,32,115,112,101,99,105,
+-    102,105,101,100,32,109,111,100,117,108,101,44,32,111,114,32,
+-    116,104,101,32,110,97,109,101,115,112,97,99,101,10,32,32,
+-    32,32,32,32,32,32,112,97,99,107,97,103,101,32,112,111,
+-    114,116,105,111,110,115,46,32,82,101,116,117,114,110,115,32,
+-    40,108,111,97,100,101,114,44,32,108,105,115,116,45,111,102,
+-    45,112,111,114,116,105,111,110,115,41,46,117,1,0,0,0,
+-    46,105,2,0,0,0,105,1,0,0,0,117,8,0,0,0,
+-    95,95,105,110,105,116,95,95,70,105,255,255,255,255,84,78,
+-    40,19,0,0,0,117,5,0,0,0,70,97,108,115,101,117,
+-    10,0,0,0,114,112,97,114,116,105,116,105,111,110,117,3,
+-    0,0,0,95,111,115,117,4,0,0,0,115,116,97,116,117,
+-    4,0,0,0,112,97,116,104,117,8,0,0,0,115,116,95,
+-    109,116,105,109,101,117,7,0,0,0,79,83,69,114,114,111,
+-    114,117,11,0,0,0,95,112,97,116,104,95,109,116,105,109,
+-    101,117,11,0,0,0,95,102,105,108,108,95,99,97,99,104,
+-    101,117,11,0,0,0,95,114,101,108,97,120,95,99,97,115,
+-    101,117,19,0,0,0,95,114,101,108,97,120,101,100,95,112,
+-    97,116,104,95,99,97,99,104,101,117,5,0,0,0,108,111,
+-    119,101,114,117,11,0,0,0,95,112,97,116,104,95,99,97,
+-    99,104,101,117,10,0,0,0,95,112,97,116,104,95,106,111,
+-    105,110,117,11,0,0,0,95,112,97,116,104,95,105,115,100,
+-    105,114,117,8,0,0,0,95,108,111,97,100,101,114,115,117,
+-    12,0,0,0,95,112,97,116,104,95,105,115,102,105,108,101,
+-    117,4,0,0,0,84,114,117,101,117,4,0,0,0,78,111,
+-    110,101,40,12,0,0,0,117,4,0,0,0,115,101,108,102,
+-    117,8,0,0,0,102,117,108,108,110,97,109,101,117,12,0,
+-    0,0,105,115,95,110,97,109,101,115,112,97,99,101,117,11,
+-    0,0,0,116,97,105,108,95,109,111,100,117,108,101,117,5,
+-    0,0,0,109,116,105,109,101,117,5,0,0,0,99,97,99,
+-    104,101,117,12,0,0,0,99,97,99,104,101,95,109,111,100,
+-    117,108,101,117,9,0,0,0,98,97,115,101,95,112,97,116,
+-    104,117,6,0,0,0,115,117,102,102,105,120,117,6,0,0,
+-    0,108,111,97,100,101,114,117,13,0,0,0,105,110,105,116,
+-    95,102,105,108,101,110,97,109,101,117,9,0,0,0,102,117,
+-    108,108,95,112,97,116,104,40,0,0,0,0,40,0,0,0,
+-    0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,
+-    112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,
+-    97,112,62,117,11,0,0,0,102,105,110,100,95,108,111,97,
+-    100,101,114,66,5,0,0,115,62,0,0,0,0,3,6,1,
+-    19,1,3,1,25,1,13,1,11,1,15,1,10,1,12,2,
+-    9,1,9,1,15,2,9,1,6,2,12,1,18,1,12,1,
+-    22,1,10,1,15,1,12,1,26,4,12,2,22,1,16,1,
+-    22,1,12,1,26,1,6,1,13,1,117,22,0,0,0,70,
+-    105,108,101,70,105,110,100,101,114,46,102,105,110,100,95,108,
+-    111,97,100,101,114,99,1,0,0,0,0,0,0,0,9,0,
+-    0,0,12,0,0,0,67,0,0,0,115,255,0,0,0,124,
+-    0,0,106,0,0,125,1,0,121,19,0,116,1,0,106,2,
+-    0,124,1,0,131,1,0,125,2,0,87,110,24,0,4,116,
+-    3,0,107,10,0,114,54,0,1,1,1,103,0,0,125,2,
+-    0,89,110,1,0,88,116,4,0,106,5,0,106,6,0,100,
+-    1,0,131,1,0,115,91,0,116,7,0,124,2,0,131,1,
+-    0,124,0,0,95,8,0,110,111,0,116,7,0,131,0,0,
+-    125,3,0,120,90,0,124,2,0,68,93,82,0,125,4,0,
+-    124,4,0,106,9,0,100,2,0,131,1,0,92,3,0,125,
+-    5,0,125,6,0,125,7,0,124,6,0,114,170,0,100,3,
+-    0,106,10,0,124,5,0,124,7,0,106,11,0,131,0,0,
+-    131,2,0,125,8,0,110,6,0,124,5,0,125,8,0,124,
+-    3,0,106,12,0,124,8,0,131,1,0,1,113,107,0,87,
+-    124,3,0,124,0,0,95,8,0,116,4,0,106,5,0,106,
+-    6,0,116,13,0,131,1,0,114,251,0,116,7,0,100,4,
+-    0,100,5,0,132,0,0,124,2,0,68,131,1,0,131,1,
+-    0,124,0,0,95,14,0,110,0,0,100,6,0,83,40,7,
+-    0,0,0,117,68,0,0,0,70,105,108,108,32,116,104,101,
+-    32,99,97,99,104,101,32,111,102,32,112,111,116,101,110,116,
+-    105,97,108,32,109,111,100,117,108,101,115,32,97,110,100,32,
+-    112,97,99,107,97,103,101,115,32,102,111,114,32,116,104,105,
+-    115,32,100,105,114,101,99,116,111,114,121,46,117,3,0,0,
+-    0,119,105,110,117,1,0,0,0,46,117,5,0,0,0,123,
+-    125,46,123,125,99,1,0,0,0,0,0,0,0,2,0,0,
+-    0,2,0,0,0,115,0,0,0,115,27,0,0,0,124,0,
+-    0,93,17,0,125,1,0,124,1,0,106,0,0,131,0,0,
+-    86,1,113,3,0,100,0,0,83,40,1,0,0,0,78,40,
+-    1,0,0,0,117,5,0,0,0,108,111,119,101,114,40,2,
+-    0,0,0,117,2,0,0,0,46,48,117,2,0,0,0,102,
+-    110,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
+-    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
+-    98,46,95,98,111,111,116,115,116,114,97,112,62,117,9,0,
+-    0,0,60,103,101,110,101,120,112,114,62,136,5,0,0,115,
+-    2,0,0,0,6,0,117,41,0,0,0,70,105,108,101,70,
+-    105,110,100,101,114,46,95,102,105,108,108,95,99,97,99,104,
+-    101,46,60,108,111,99,97,108,115,62,46,60,103,101,110,101,
+-    120,112,114,62,78,40,15,0,0,0,117,4,0,0,0,112,
+-    97,116,104,117,3,0,0,0,95,111,115,117,7,0,0,0,
+-    108,105,115,116,100,105,114,117,17,0,0,0,70,105,108,101,
+-    78,111,116,70,111,117,110,100,69,114,114,111,114,117,3,0,
+-    0,0,115,121,115,117,8,0,0,0,112,108,97,116,102,111,
+-    114,109,117,10,0,0,0,115,116,97,114,116,115,119,105,116,
+-    104,117,3,0,0,0,115,101,116,117,11,0,0,0,95,112,
+-    97,116,104,95,99,97,99,104,101,117,9,0,0,0,112,97,
+-    114,116,105,116,105,111,110,117,6,0,0,0,102,111,114,109,
+-    97,116,117,5,0,0,0,108,111,119,101,114,117,3,0,0,
+-    0,97,100,100,117,27,0,0,0,95,67,65,83,69,95,73,
+-    78,83,69,78,83,73,84,73,86,69,95,80,76,65,84,70,
+-    79,82,77,83,117,19,0,0,0,95,114,101,108,97,120,101,
+-    100,95,112,97,116,104,95,99,97,99,104,101,40,9,0,0,
+-    0,117,4,0,0,0,115,101,108,102,117,4,0,0,0,112,
+-    97,116,104,117,8,0,0,0,99,111,110,116,101,110,116,115,
+-    117,21,0,0,0,108,111,119,101,114,95,115,117,102,102,105,
+-    120,95,99,111,110,116,101,110,116,115,117,4,0,0,0,105,
+-    116,101,109,117,4,0,0,0,110,97,109,101,117,3,0,0,
+-    0,100,111,116,117,6,0,0,0,115,117,102,102,105,120,117,
+-    8,0,0,0,110,101,119,95,110,97,109,101,40,0,0,0,
+-    0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,
+-    101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,
+-    111,116,115,116,114,97,112,62,117,11,0,0,0,95,102,105,
+-    108,108,95,99,97,99,104,101,108,5,0,0,115,34,0,0,
+-    0,0,2,9,1,3,1,19,1,13,2,11,3,18,1,18,
+-    7,9,1,13,1,24,1,6,1,27,2,6,1,17,1,9,
+-    1,18,1,117,22,0,0,0,70,105,108,101,70,105,110,100,
+-    101,114,46,95,102,105,108,108,95,99,97,99,104,101,99,1,
+-    0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,7,
+-    0,0,0,115,25,0,0,0,135,0,0,135,1,0,102,2,
+-    0,100,1,0,100,2,0,134,0,0,125,2,0,124,2,0,
+-    83,40,3,0,0,0,117,20,1,0,0,65,32,99,108,97,
+-    115,115,32,109,101,116,104,111,100,32,119,104,105,99,104,32,
+-    114,101,116,117,114,110,115,32,97,32,99,108,111,115,117,114,
+-    101,32,116,111,32,117,115,101,32,111,110,32,115,121,115,46,
+-    112,97,116,104,95,104,111,111,107,10,32,32,32,32,32,32,
+-    32,32,119,104,105,99,104,32,119,105,108,108,32,114,101,116,
+-    117,114,110,32,97,110,32,105,110,115,116,97,110,99,101,32,
+-    117,115,105,110,103,32,116,104,101,32,115,112,101,99,105,102,
+-    105,101,100,32,108,111,97,100,101,114,115,32,97,110,100,32,
+-    116,104,101,32,112,97,116,104,10,32,32,32,32,32,32,32,
+-    32,99,97,108,108,101,100,32,111,110,32,116,104,101,32,99,
+-    108,111,115,117,114,101,46,10,10,32,32,32,32,32,32,32,
+-    32,73,102,32,116,104,101,32,112,97,116,104,32,99,97,108,
+-    108,101,100,32,111,110,32,116,104,101,32,99,108,111,115,117,
+-    114,101,32,105,115,32,110,111,116,32,97,32,100,105,114,101,
+-    99,116,111,114,121,44,32,73,109,112,111,114,116,69,114,114,
+-    111,114,32,105,115,10,32,32,32,32,32,32,32,32,114,97,
+-    105,115,101,100,46,10,10,32,32,32,32,32,32,32,32,99,
+-    1,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,
+-    19,0,0,0,115,46,0,0,0,116,0,0,124,0,0,131,
+-    1,0,115,33,0,116,1,0,100,1,0,100,2,0,124,0,
+-    0,131,1,1,130,1,0,110,0,0,136,0,0,124,0,0,
+-    136,1,0,140,1,0,83,40,3,0,0,0,117,45,0,0,
+-    0,80,97,116,104,32,104,111,111,107,32,102,111,114,32,105,
+-    109,112,111,114,116,108,105,98,46,109,97,99,104,105,110,101,
+-    114,121,46,70,105,108,101,70,105,110,100,101,114,46,117,30,
+-    0,0,0,111,110,108,121,32,100,105,114,101,99,116,111,114,
+-    105,101,115,32,97,114,101,32,115,117,112,112,111,114,116,101,
+-    100,117,4,0,0,0,112,97,116,104,40,2,0,0,0,117,
+-    11,0,0,0,95,112,97,116,104,95,105,115,100,105,114,117,
+-    11,0,0,0,73,109,112,111,114,116,69,114,114,111,114,40,
+-    1,0,0,0,117,4,0,0,0,112,97,116,104,40,2,0,
+-    0,0,117,3,0,0,0,99,108,115,117,14,0,0,0,108,
+-    111,97,100,101,114,95,100,101,116,97,105,108,115,40,0,0,
+-    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+-    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,24,0,0,0,112,97,116,104,95,104,111,
+-    111,107,95,102,111,114,95,70,105,108,101,70,105,110,100,101,
+-    114,148,5,0,0,115,6,0,0,0,0,2,12,1,21,1,
+-    117,54,0,0,0,70,105,108,101,70,105,110,100,101,114,46,
+-    112,97,116,104,95,104,111,111,107,46,60,108,111,99,97,108,
+-    115,62,46,112,97,116,104,95,104,111,111,107,95,102,111,114,
+-    95,70,105,108,101,70,105,110,100,101,114,40,0,0,0,0,
+-    40,3,0,0,0,117,3,0,0,0,99,108,115,117,14,0,
+-    0,0,108,111,97,100,101,114,95,100,101,116,97,105,108,115,
+-    117,24,0,0,0,112,97,116,104,95,104,111,111,107,95,102,
+-    111,114,95,70,105,108,101,70,105,110,100,101,114,40,0,0,
+-    0,0,40,2,0,0,0,117,3,0,0,0,99,108,115,117,
+-    14,0,0,0,108,111,97,100,101,114,95,100,101,116,97,105,
+-    108,115,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+-    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,9,0,0,0,112,97,116,104,95,104,111,
+-    111,107,138,5,0,0,115,4,0,0,0,0,10,21,6,117,
+-    20,0,0,0,70,105,108,101,70,105,110,100,101,114,46,112,
+-    97,116,104,95,104,111,111,107,99,1,0,0,0,0,0,0,
+-    0,1,0,0,0,2,0,0,0,67,0,0,0,115,14,0,
+-    0,0,100,1,0,124,0,0,106,0,0,102,1,0,22,83,
+-    40,2,0,0,0,78,117,14,0,0,0,70,105,108,101,70,
+-    105,110,100,101,114,40,37,114,41,40,1,0,0,0,117,4,
+-    0,0,0,112,97,116,104,40,1,0,0,0,117,4,0,0,
+-    0,115,101,108,102,40,0,0,0,0,40,0,0,0,0,117,
+-    29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
+-    114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
+-    62,117,8,0,0,0,95,95,114,101,112,114,95,95,156,5,
+-    0,0,115,2,0,0,0,0,1,117,19,0,0,0,70,105,
+-    108,101,70,105,110,100,101,114,46,95,95,114,101,112,114,95,
+-    95,78,40,13,0,0,0,117,8,0,0,0,95,95,110,97,
+-    109,101,95,95,117,10,0,0,0,95,95,109,111,100,117,108,
+-    101,95,95,117,12,0,0,0,95,95,113,117,97,108,110,97,
+-    109,101,95,95,117,7,0,0,0,95,95,100,111,99,95,95,
+-    117,8,0,0,0,95,95,105,110,105,116,95,95,117,17,0,
+-    0,0,105,110,118,97,108,105,100,97,116,101,95,99,97,99,
+-    104,101,115,117,17,0,0,0,95,102,105,110,100,95,109,111,
+-    100,117,108,101,95,115,104,105,109,117,11,0,0,0,102,105,
+-    110,100,95,109,111,100,117,108,101,117,11,0,0,0,102,105,
+-    110,100,95,108,111,97,100,101,114,117,11,0,0,0,95,102,
+-    105,108,108,95,99,97,99,104,101,117,11,0,0,0,99,108,
+-    97,115,115,109,101,116,104,111,100,117,9,0,0,0,112,97,
+-    116,104,95,104,111,111,107,117,8,0,0,0,95,95,114,101,
+-    112,114,95,95,40,1,0,0,0,117,10,0,0,0,95,95,
+-    108,111,99,97,108,115,95,95,40,0,0,0,0,40,0,0,
+-    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+-    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,10,0,0,0,70,105,108,101,70,105,110,
+-    100,101,114,37,5,0,0,115,16,0,0,0,16,7,6,2,
+-    12,14,12,4,6,2,12,42,12,30,18,18,117,10,0,0,
+-    0,70,105,108,101,70,105,110,100,101,114,99,1,0,0,0,
+-    0,0,0,0,1,0,0,0,2,0,0,0,66,0,0,0,
+-    115,50,0,0,0,124,0,0,69,101,0,0,90,1,0,100,
+-    0,0,90,2,0,100,1,0,90,3,0,100,2,0,100,3,
+-    0,132,0,0,90,4,0,100,4,0,100,5,0,132,0,0,
+-    90,5,0,100,6,0,83,40,7,0,0,0,117,18,0,0,
+-    0,95,73,109,112,111,114,116,76,111,99,107,67,111,110,116,
+-    101,120,116,117,36,0,0,0,67,111,110,116,101,120,116,32,
+-    109,97,110,97,103,101,114,32,102,111,114,32,116,104,101,32,
+-    105,109,112,111,114,116,32,108,111,99,107,46,99,1,0,0,
+-    0,0,0,0,0,1,0,0,0,1,0,0,0,67,0,0,
+-    0,115,14,0,0,0,116,0,0,106,1,0,131,0,0,1,
+-    100,1,0,83,40,2,0,0,0,117,24,0,0,0,65,99,
+-    113,117,105,114,101,32,116,104,101,32,105,109,112,111,114,116,
+-    32,108,111,99,107,46,78,40,2,0,0,0,117,4,0,0,
+-    0,95,105,109,112,117,12,0,0,0,97,99,113,117,105,114,
+-    101,95,108,111,99,107,40,1,0,0,0,117,4,0,0,0,
+-    115,101,108,102,40,0,0,0,0,40,0,0,0,0,117,29,
+-    0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,
+-    116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,
+-    117,9,0,0,0,95,95,101,110,116,101,114,95,95,166,5,
+-    0,0,115,2,0,0,0,0,2,117,28,0,0,0,95,73,
+-    109,112,111,114,116,76,111,99,107,67,111,110,116,101,120,116,
+-    46,95,95,101,110,116,101,114,95,95,99,4,0,0,0,0,
+-    0,0,0,4,0,0,0,1,0,0,0,67,0,0,0,115,
+-    14,0,0,0,116,0,0,106,1,0,131,0,0,1,100,1,
+-    0,83,40,2,0,0,0,117,60,0,0,0,82,101,108,101,
+-    97,115,101,32,116,104,101,32,105,109,112,111,114,116,32,108,
+-    111,99,107,32,114,101,103,97,114,100,108,101,115,115,32,111,
+-    102,32,97,110,121,32,114,97,105,115,101,100,32,101,120,99,
+-    101,112,116,105,111,110,115,46,78,40,2,0,0,0,117,4,
+-    0,0,0,95,105,109,112,117,12,0,0,0,114,101,108,101,
+-    97,115,101,95,108,111,99,107,40,4,0,0,0,117,4,0,
+-    0,0,115,101,108,102,117,8,0,0,0,101,120,99,95,116,
+-    121,112,101,117,9,0,0,0,101,120,99,95,118,97,108,117,
+-    101,117,13,0,0,0,101,120,99,95,116,114,97,99,101,98,
+-    97,99,107,40,0,0,0,0,40,0,0,0,0,117,29,0,
+-    0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,
+-    108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,
+-    8,0,0,0,95,95,101,120,105,116,95,95,170,5,0,0,
+-    115,2,0,0,0,0,2,117,27,0,0,0,95,73,109,112,
+-    111,114,116,76,111,99,107,67,111,110,116,101,120,116,46,95,
+-    95,101,120,105,116,95,95,78,40,6,0,0,0,117,8,0,
+-    0,0,95,95,110,97,109,101,95,95,117,10,0,0,0,95,
+-    95,109,111,100,117,108,101,95,95,117,12,0,0,0,95,95,
+-    113,117,97,108,110,97,109,101,95,95,117,7,0,0,0,95,
+-    95,100,111,99,95,95,117,9,0,0,0,95,95,101,110,116,
+-    101,114,95,95,117,8,0,0,0,95,95,101,120,105,116,95,
+-    95,40,1,0,0,0,117,10,0,0,0,95,95,108,111,99,
+-    97,108,115,95,95,40,0,0,0,0,40,0,0,0,0,117,
+-    29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,
+-    114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,
+-    62,117,18,0,0,0,95,73,109,112,111,114,116,76,111,99,
+-    107,67,111,110,116,101,120,116,162,5,0,0,115,6,0,0,
+-    0,16,2,6,2,12,4,117,18,0,0,0,95,73,109,112,
+-    111,114,116,76,111,99,107,67,111,110,116,101,120,116,99,3,
+-    0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,67,
+-    0,0,0,115,91,0,0,0,124,1,0,106,0,0,100,1,
+-    0,124,2,0,100,2,0,24,131,2,0,125,3,0,116,1,
+-    0,124,3,0,131,1,0,124,2,0,107,0,0,114,55,0,
+-    116,2,0,100,3,0,131,1,0,130,1,0,110,0,0,124,
+-    3,0,100,4,0,25,125,4,0,124,0,0,114,87,0,100,
+-    5,0,106,3,0,124,4,0,124,0,0,131,2,0,83,124,
+-    4,0,83,40,6,0,0,0,117,50,0,0,0,82,101,115,
+-    111,108,118,101,32,97,32,114,101,108,97,116,105,118,101,32,
+-    109,111,100,117,108,101,32,110,97,109,101,32,116,111,32,97,
+-    110,32,97,98,115,111,108,117,116,101,32,111,110,101,46,117,
+-    1,0,0,0,46,105,1,0,0,0,117,50,0,0,0,97,
+-    116,116,101,109,112,116,101,100,32,114,101,108,97,116,105,118,
+-    101,32,105,109,112,111,114,116,32,98,101,121,111,110,100,32,
+-    116,111,112,45,108,101,118,101,108,32,112,97,99,107,97,103,
+-    101,105,0,0,0,0,117,5,0,0,0,123,125,46,123,125,
+-    40,4,0,0,0,117,6,0,0,0,114,115,112,108,105,116,
+-    117,3,0,0,0,108,101,110,117,10,0,0,0,86,97,108,
+-    117,101,69,114,114,111,114,117,6,0,0,0,102,111,114,109,
+-    97,116,40,5,0,0,0,117,4,0,0,0,110,97,109,101,
+-    117,7,0,0,0,112,97,99,107,97,103,101,117,5,0,0,
+-    0,108,101,118,101,108,117,4,0,0,0,98,105,116,115,117,
+-    4,0,0,0,98,97,115,101,40,0,0,0,0,40,0,0,
+-    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+-    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,13,0,0,0,95,114,101,115,111,108,118,
+-    101,95,110,97,109,101,175,5,0,0,115,10,0,0,0,0,
+-    2,22,1,18,1,15,1,10,1,117,13,0,0,0,95,114,
+-    101,115,111,108,118,101,95,110,97,109,101,99,2,0,0,0,
+-    0,0,0,0,4,0,0,0,11,0,0,0,67,0,0,0,
+-    115,138,0,0,0,116,0,0,106,1,0,115,28,0,116,2,
+-    0,106,3,0,100,1,0,116,4,0,131,2,0,1,110,0,
+-    0,120,103,0,116,0,0,106,1,0,68,93,88,0,125,2,
+-    0,116,5,0,131,0,0,143,23,0,1,124,2,0,106,6,
+-    0,124,0,0,124,1,0,131,2,0,125,3,0,87,100,2,
+-    0,81,88,124,3,0,100,2,0,107,9,0,114,38,0,124,
+-    0,0,116,0,0,106,8,0,107,7,0,114,109,0,124,3,
+-    0,83,116,0,0,106,8,0,124,0,0,25,106,9,0,83,
+-    113,38,0,113,38,0,87,100,2,0,83,100,2,0,83,40,
+-    3,0,0,0,117,23,0,0,0,70,105,110,100,32,97,32,
+-    109,111,100,117,108,101,39,115,32,108,111,97,100,101,114,46,
+-    117,22,0,0,0,115,121,115,46,109,101,116,97,95,112,97,
+-    116,104,32,105,115,32,101,109,112,116,121,78,40,10,0,0,
+-    0,117,3,0,0,0,115,121,115,117,9,0,0,0,109,101,
+-    116,97,95,112,97,116,104,117,9,0,0,0,95,119,97,114,
+-    110,105,110,103,115,117,4,0,0,0,119,97,114,110,117,13,
+-    0,0,0,73,109,112,111,114,116,87,97,114,110,105,110,103,
+-    117,18,0,0,0,95,73,109,112,111,114,116,76,111,99,107,
+-    67,111,110,116,101,120,116,117,11,0,0,0,102,105,110,100,
+-    95,109,111,100,117,108,101,117,4,0,0,0,78,111,110,101,
+-    117,7,0,0,0,109,111,100,117,108,101,115,117,10,0,0,
+-    0,95,95,108,111,97,100,101,114,95,95,40,4,0,0,0,
+-    117,4,0,0,0,110,97,109,101,117,4,0,0,0,112,97,
+-    116,104,117,6,0,0,0,102,105,110,100,101,114,117,6,0,
+-    0,0,108,111,97,100,101,114,40,0,0,0,0,40,0,0,
+-    0,0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,
+-    109,112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,
+-    114,97,112,62,117,12,0,0,0,95,102,105,110,100,95,109,
+-    111,100,117,108,101,184,5,0,0,115,20,0,0,0,0,2,
+-    9,1,19,1,16,1,10,1,24,1,12,2,15,1,4,2,
+-    21,2,117,12,0,0,0,95,102,105,110,100,95,109,111,100,
+-    117,108,101,99,3,0,0,0,0,0,0,0,4,0,0,0,
+-    4,0,0,0,67,0,0,0,115,194,0,0,0,116,0,0,
+-    124,0,0,116,1,0,131,2,0,115,45,0,116,2,0,100,
+-    1,0,106,3,0,116,4,0,124,0,0,131,1,0,131,1,
+-    0,131,1,0,130,1,0,110,0,0,124,2,0,100,2,0,
+-    107,0,0,114,72,0,116,5,0,100,3,0,131,1,0,130,
+-    1,0,110,0,0,124,1,0,114,156,0,116,0,0,124,1,
+-    0,116,1,0,131,2,0,115,108,0,116,2,0,100,4,0,
+-    131,1,0,130,1,0,113,156,0,124,1,0,116,6,0,106,
+-    7,0,107,7,0,114,156,0,100,5,0,125,3,0,116,8,
+-    0,124,3,0,106,3,0,124,1,0,131,1,0,131,1,0,
+-    130,1,0,113,156,0,110,0,0,124,0,0,12,114,190,0,
+-    124,2,0,100,2,0,107,2,0,114,190,0,116,5,0,100,
+-    6,0,131,1,0,130,1,0,110,0,0,100,7,0,83,40,
+-    8,0,0,0,117,28,0,0,0,86,101,114,105,102,121,32,
+-    97,114,103,117,109,101,110,116,115,32,97,114,101,32,34,115,
+-    97,110,101,34,46,117,31,0,0,0,109,111,100,117,108,101,
+-    32,110,97,109,101,32,109,117,115,116,32,98,101,32,115,116,
+-    114,44,32,110,111,116,32,123,125,105,0,0,0,0,117,18,
+-    0,0,0,108,101,118,101,108,32,109,117,115,116,32,98,101,
+-    32,62,61,32,48,117,31,0,0,0,95,95,112,97,99,107,
+-    97,103,101,95,95,32,110,111,116,32,115,101,116,32,116,111,
+-    32,97,32,115,116,114,105,110,103,117,61,0,0,0,80,97,
+-    114,101,110,116,32,109,111,100,117,108,101,32,123,33,114,125,
+-    32,110,111,116,32,108,111,97,100,101,100,44,32,99,97,110,
+-    110,111,116,32,112,101,114,102,111,114,109,32,114,101,108,97,
+-    116,105,118,101,32,105,109,112,111,114,116,117,17,0,0,0,
+-    69,109,112,116,121,32,109,111,100,117,108,101,32,110,97,109,
+-    101,78,40,9,0,0,0,117,10,0,0,0,105,115,105,110,
+-    115,116,97,110,99,101,117,3,0,0,0,115,116,114,117,9,
+-    0,0,0,84,121,112,101,69,114,114,111,114,117,6,0,0,
+-    0,102,111,114,109,97,116,117,4,0,0,0,116,121,112,101,
+-    117,10,0,0,0,86,97,108,117,101,69,114,114,111,114,117,
+-    3,0,0,0,115,121,115,117,7,0,0,0,109,111,100,117,
+-    108,101,115,117,11,0,0,0,83,121,115,116,101,109,69,114,
+-    114,111,114,40,4,0,0,0,117,4,0,0,0,110,97,109,
+-    101,117,7,0,0,0,112,97,99,107,97,103,101,117,5,0,
+-    0,0,108,101,118,101,108,117,3,0,0,0,109,115,103,40,
+-    0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,
+-    114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,
+-    95,98,111,111,116,115,116,114,97,112,62,117,13,0,0,0,
+-    95,115,97,110,105,116,121,95,99,104,101,99,107,201,5,0,
+-    0,115,24,0,0,0,0,2,15,1,30,1,12,1,15,1,
+-    6,1,15,1,15,1,15,1,6,2,27,1,19,1,117,13,
+-    0,0,0,95,115,97,110,105,116,121,95,99,104,101,99,107,
+-    117,20,0,0,0,78,111,32,109,111,100,117,108,101,32,110,
+-    97,109,101,100,32,123,33,114,125,99,2,0,0,0,0,0,
+-    0,0,9,0,0,0,27,0,0,0,67,0,0,0,115,12,
+-    2,0,0,100,0,0,125,2,0,124,0,0,106,1,0,100,
+-    1,0,131,1,0,100,2,0,25,125,3,0,124,3,0,114,
+-    178,0,124,3,0,116,2,0,106,3,0,107,7,0,114,62,
+-    0,116,4,0,124,1,0,124,3,0,131,2,0,1,110,0,
+-    0,124,0,0,116,2,0,106,3,0,107,6,0,114,88,0,
+-    116,2,0,106,3,0,124,0,0,25,83,116,2,0,106,3,
+-    0,124,3,0,25,125,4,0,121,13,0,124,4,0,106,5,
+-    0,125,2,0,87,113,178,0,4,116,6,0,107,10,0,114,
+-    174,0,1,1,1,116,7,0,100,3,0,23,106,8,0,124,
+-    0,0,124,3,0,131,2,0,125,5,0,116,9,0,124,5,
+-    0,100,4,0,124,0,0,131,1,1,130,1,0,89,113,178,
+-    0,88,110,0,0,116,10,0,124,0,0,124,2,0,131,2,
+-    0,125,6,0,124,6,0,100,0,0,107,8,0,114,250,0,
+-    116,9,0,116,7,0,106,8,0,124,0,0,131,1,0,100,
+-    4,0,124,0,0,131,1,1,125,7,0,100,10,0,124,7,
+-    0,95,12,0,124,7,0,130,1,0,110,47,0,124,0,0,
+-    116,2,0,106,3,0,107,7,0,114,41,1,124,6,0,106,
+-    13,0,124,0,0,131,1,0,1,116,14,0,100,5,0,124,
+-    0,0,124,6,0,131,3,0,1,110,0,0,116,2,0,106,
+-    3,0,124,0,0,25,125,8,0,124,3,0,114,105,1,116,
+-    2,0,106,3,0,124,3,0,25,125,4,0,116,15,0,124,
+-    4,0,124,0,0,106,1,0,100,1,0,131,1,0,100,6,
+-    0,25,124,8,0,131,3,0,1,110,0,0,116,16,0,124,
+-    8,0,100,7,0,100,0,0,131,3,0,100,0,0,107,8,
+-    0,114,212,1,121,59,0,124,8,0,106,17,0,124,8,0,
+-    95,18,0,116,19,0,124,8,0,100,8,0,131,2,0,115,
+-    187,1,124,8,0,106,18,0,106,1,0,100,1,0,131,1,
+-    0,100,2,0,25,124,8,0,95,18,0,110,0,0,87,113,
+-    212,1,4,116,6,0,107,10,0,114,208,1,1,1,1,89,
+-    113,212,1,88,110,0,0,116,19,0,124,8,0,100,9,0,
+-    131,2,0,115,8,2,121,13,0,124,6,0,124,8,0,95,
+-    20,0,87,113,8,2,4,116,6,0,107,10,0,114,4,2,
+-    1,1,1,89,113,8,2,88,110,0,0,124,8,0,83,40,
+-    11,0,0,0,78,117,1,0,0,0,46,105,0,0,0,0,
+-    117,21,0,0,0,59,32,123,125,32,105,115,32,110,111,116,
+-    32,97,32,112,97,99,107,97,103,101,117,4,0,0,0,110,
+-    97,109,101,117,18,0,0,0,105,109,112,111,114,116,32,123,
+-    33,114,125,32,35,32,123,33,114,125,105,2,0,0,0,117,
+-    11,0,0,0,95,95,112,97,99,107,97,103,101,95,95,117,
+-    8,0,0,0,95,95,112,97,116,104,95,95,117,10,0,0,
+-    0,95,95,108,111,97,100,101,114,95,95,84,40,21,0,0,
+-    0,117,4,0,0,0,78,111,110,101,117,10,0,0,0,114,
+-    112,97,114,116,105,116,105,111,110,117,3,0,0,0,115,121,
+-    115,117,7,0,0,0,109,111,100,117,108,101,115,117,25,0,
+-    0,0,95,99,97,108,108,95,119,105,116,104,95,102,114,97,
+-    109,101,115,95,114,101,109,111,118,101,100,117,8,0,0,0,
+-    95,95,112,97,116,104,95,95,117,14,0,0,0,65,116,116,
+-    114,105,98,117,116,101,69,114,114,111,114,117,8,0,0,0,
+-    95,69,82,82,95,77,83,71,117,6,0,0,0,102,111,114,
+-    109,97,116,117,11,0,0,0,73,109,112,111,114,116,69,114,
+-    114,111,114,117,12,0,0,0,95,102,105,110,100,95,109,111,
+-    100,117,108,101,117,4,0,0,0,84,114,117,101,117,10,0,
+-    0,0,95,110,111,116,95,102,111,117,110,100,117,11,0,0,
+-    0,108,111,97,100,95,109,111,100,117,108,101,117,16,0,0,
+-    0,95,118,101,114,98,111,115,101,95,109,101,115,115,97,103,
+-    101,117,7,0,0,0,115,101,116,97,116,116,114,117,7,0,
+-    0,0,103,101,116,97,116,116,114,117,8,0,0,0,95,95,
+-    110,97,109,101,95,95,117,11,0,0,0,95,95,112,97,99,
+-    107,97,103,101,95,95,117,7,0,0,0,104,97,115,97,116,
+-    116,114,117,10,0,0,0,95,95,108,111,97,100,101,114,95,
+-    95,40,9,0,0,0,117,4,0,0,0,110,97,109,101,117,
+-    7,0,0,0,105,109,112,111,114,116,95,117,4,0,0,0,
+-    112,97,116,104,117,6,0,0,0,112,97,114,101,110,116,117,
+-    13,0,0,0,112,97,114,101,110,116,95,109,111,100,117,108,
+-    101,117,3,0,0,0,109,115,103,117,6,0,0,0,108,111,
+-    97,100,101,114,117,3,0,0,0,101,120,99,117,6,0,0,
+-    0,109,111,100,117,108,101,40,0,0,0,0,40,0,0,0,
+-    0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,
+-    112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,
+-    97,112,62,117,23,0,0,0,95,102,105,110,100,95,97,110,
+-    100,95,108,111,97,100,95,117,110,108,111,99,107,101,100,220,
+-    5,0,0,115,76,0,0,0,0,1,6,1,19,1,6,1,
+-    15,1,16,2,15,1,11,2,13,1,3,1,13,1,13,1,
+-    22,1,26,1,15,1,12,1,27,3,9,1,9,1,15,2,
+-    13,1,19,2,13,1,6,2,13,1,32,2,24,1,3,1,
+-    12,1,15,1,32,1,13,1,8,2,15,1,3,1,13,1,
+-    13,1,8,1,117,23,0,0,0,95,102,105,110,100,95,97,
+-    110,100,95,108,111,97,100,95,117,110,108,111,99,107,101,100,
+-    99,2,0,0,0,0,0,0,0,3,0,0,0,18,0,0,
+-    0,67,0,0,0,115,75,0,0,0,122,16,0,116,0,0,
+-    124,0,0,131,1,0,125,2,0,87,100,1,0,116,1,0,
+-    106,2,0,131,0,0,1,88,124,2,0,106,3,0,131,0,
+-    0,1,122,17,0,116,4,0,124,0,0,124,1,0,131,2,
+-    0,83,87,100,1,0,124,2,0,106,5,0,131,0,0,1,
+-    88,100,1,0,83,40,2,0,0,0,117,54,0,0,0,70,
+-    105,110,100,32,97,110,100,32,108,111,97,100,32,116,104,101,
+-    32,109,111,100,117,108,101,44,32,97,110,100,32,114,101,108,
+-    101,97,115,101,32,116,104,101,32,105,109,112,111,114,116,32,
+-    108,111,99,107,46,78,40,6,0,0,0,117,16,0,0,0,
+-    95,103,101,116,95,109,111,100,117,108,101,95,108,111,99,107,
+-    117,4,0,0,0,95,105,109,112,117,12,0,0,0,114,101,
+-    108,101,97,115,101,95,108,111,99,107,117,7,0,0,0,97,
+-    99,113,117,105,114,101,117,23,0,0,0,95,102,105,110,100,
+-    95,97,110,100,95,108,111,97,100,95,117,110,108,111,99,107,
+-    101,100,117,7,0,0,0,114,101,108,101,97,115,101,40,3,
+-    0,0,0,117,4,0,0,0,110,97,109,101,117,7,0,0,
+-    0,105,109,112,111,114,116,95,117,4,0,0,0,108,111,99,
+-    107,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
+-    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
+-    98,46,95,98,111,111,116,115,116,114,97,112,62,117,14,0,
+-    0,0,95,102,105,110,100,95,97,110,100,95,108,111,97,100,
+-    14,6,0,0,115,14,0,0,0,0,2,3,1,16,2,11,
+-    1,10,1,3,1,17,2,117,14,0,0,0,95,102,105,110,
+-    100,95,97,110,100,95,108,111,97,100,99,3,0,0,0,0,
+-    0,0,0,5,0,0,0,4,0,0,0,67,0,0,0,115,
+-    172,0,0,0,116,0,0,124,0,0,124,1,0,124,2,0,
+-    131,3,0,1,124,2,0,100,1,0,107,4,0,114,49,0,
+-    116,1,0,124,0,0,124,1,0,124,2,0,131,3,0,125,
+-    0,0,110,0,0,116,2,0,106,3,0,131,0,0,1,124,
+-    0,0,116,4,0,106,5,0,107,7,0,114,87,0,116,6,
+-    0,124,0,0,116,7,0,131,2,0,83,116,4,0,106,5,
+-    0,124,0,0,25,125,3,0,124,3,0,100,4,0,107,8,
+-    0,114,158,0,116,2,0,106,9,0,131,0,0,1,100,2,
+-    0,106,10,0,124,0,0,131,1,0,125,4,0,116,11,0,
+-    124,4,0,100,3,0,124,0,0,131,1,1,130,1,0,110,
+-    0,0,116,12,0,124,0,0,131,1,0,1,124,3,0,83,
+-    40,5,0,0,0,117,50,1,0,0,73,109,112,111,114,116,
+-    32,97,110,100,32,114,101,116,117,114,110,32,116,104,101,32,
+-    109,111,100,117,108,101,32,98,97,115,101,100,32,111,110,32,
+-    105,116,115,32,110,97,109,101,44,32,116,104,101,32,112,97,
+-    99,107,97,103,101,32,116,104,101,32,99,97,108,108,32,105,
+-    115,10,32,32,32,32,98,101,105,110,103,32,109,97,100,101,
+-    32,102,114,111,109,44,32,97,110,100,32,116,104,101,32,108,
+-    101,118,101,108,32,97,100,106,117,115,116,109,101,110,116,46,
+-    10,10,32,32,32,32,84,104,105,115,32,102,117,110,99,116,
+-    105,111,110,32,114,101,112,114,101,115,101,110,116,115,32,116,
+-    104,101,32,103,114,101,97,116,101,115,116,32,99,111,109,109,
+-    111,110,32,100,101,110,111,109,105,110,97,116,111,114,32,111,
+-    102,32,102,117,110,99,116,105,111,110,97,108,105,116,121,10,
+-    32,32,32,32,98,101,116,119,101,101,110,32,105,109,112,111,
+-    114,116,95,109,111,100,117,108,101,32,97,110,100,32,95,95,
+-    105,109,112,111,114,116,95,95,46,32,84,104,105,115,32,105,
+-    110,99,108,117,100,101,115,32,115,101,116,116,105,110,103,32,
+-    95,95,112,97,99,107,97,103,101,95,95,32,105,102,10,32,
+-    32,32,32,116,104,101,32,108,111,97,100,101,114,32,100,105,
+-    100,32,110,111,116,46,10,10,32,32,32,32,105,0,0,0,
+-    0,117,40,0,0,0,105,109,112,111,114,116,32,111,102,32,
+-    123,125,32,104,97,108,116,101,100,59,32,78,111,110,101,32,
+-    105,110,32,115,121,115,46,109,111,100,117,108,101,115,117,4,
+-    0,0,0,110,97,109,101,78,40,13,0,0,0,117,13,0,
+-    0,0,95,115,97,110,105,116,121,95,99,104,101,99,107,117,
+-    13,0,0,0,95,114,101,115,111,108,118,101,95,110,97,109,
+-    101,117,4,0,0,0,95,105,109,112,117,12,0,0,0,97,
+-    99,113,117,105,114,101,95,108,111,99,107,117,3,0,0,0,
+-    115,121,115,117,7,0,0,0,109,111,100,117,108,101,115,117,
+-    14,0,0,0,95,102,105,110,100,95,97,110,100,95,108,111,
+-    97,100,117,11,0,0,0,95,103,99,100,95,105,109,112,111,
+-    114,116,117,4,0,0,0,78,111,110,101,117,12,0,0,0,
+-    114,101,108,101,97,115,101,95,108,111,99,107,117,6,0,0,
+-    0,102,111,114,109,97,116,117,11,0,0,0,73,109,112,111,
+-    114,116,69,114,114,111,114,117,19,0,0,0,95,108,111,99,
+-    107,95,117,110,108,111,99,107,95,109,111,100,117,108,101,40,
+-    5,0,0,0,117,4,0,0,0,110,97,109,101,117,7,0,
+-    0,0,112,97,99,107,97,103,101,117,5,0,0,0,108,101,
+-    118,101,108,117,6,0,0,0,109,111,100,117,108,101,117,7,
+-    0,0,0,109,101,115,115,97,103,101,40,0,0,0,0,40,
+-    0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
+-    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
+-    115,116,114,97,112,62,117,11,0,0,0,95,103,99,100,95,
+-    105,109,112,111,114,116,27,6,0,0,115,28,0,0,0,0,
+-    9,16,1,12,1,21,1,10,1,15,1,13,1,13,1,12,
+-    1,10,1,6,1,9,1,21,1,10,1,117,11,0,0,0,
+-    95,103,99,100,95,105,109,112,111,114,116,99,3,0,0,0,
+-    0,0,0,0,5,0,0,0,17,0,0,0,67,0,0,0,
+-    115,233,0,0,0,116,0,0,124,0,0,100,1,0,131,2,
+-    0,114,229,0,100,2,0,124,1,0,107,6,0,114,89,0,
+-    116,1,0,124,1,0,131,1,0,125,1,0,124,1,0,106,
+-    2,0,100,2,0,131,1,0,1,116,0,0,124,0,0,100,
+-    3,0,131,2,0,114,89,0,124,1,0,106,3,0,124,0,
+-    0,106,4,0,131,1,0,1,113,89,0,110,0,0,120,137,
+-    0,124,1,0,68,93,126,0,125,3,0,116,0,0,124,0,
+-    0,124,3,0,131,2,0,115,96,0,121,32,0,116,5,0,
+-    124,2,0,100,4,0,106,6,0,124,0,0,106,7,0,124,
+-    3,0,131,2,0,131,2,0,1,87,113,222,0,4,116,8,
+-    0,107,10,0,114,218,0,1,125,4,0,1,122,35,0,116,
+-    0,0,124,4,0,100,5,0,131,2,0,114,197,0,124,4,
+-    0,106,9,0,114,197,0,110,3,0,130,0,0,87,89,100,
+-    6,0,100,6,0,125,4,0,126,4,0,88,113,222,0,88,
+-    113,96,0,113,96,0,87,110,0,0,124,0,0,83,40,7,
+-    0,0,0,117,238,0,0,0,70,105,103,117,114,101,32,111,
+-    117,116,32,119,104,97,116,32,95,95,105,109,112,111,114,116,
+-    95,95,32,115,104,111,117,108,100,32,114,101,116,117,114,110,
+-    46,10,10,32,32,32,32,84,104,101,32,105,109,112,111,114,
+-    116,95,32,112,97,114,97,109,101,116,101,114,32,105,115,32,
+-    97,32,99,97,108,108,97,98,108,101,32,119,104,105,99,104,
+-    32,116,97,107,101,115,32,116,104,101,32,110,97,109,101,32,
+-    111,102,32,109,111,100,117,108,101,32,116,111,10,32,32,32,
+-    32,105,109,112,111,114,116,46,32,73,116,32,105,115,32,114,
+-    101,113,117,105,114,101,100,32,116,111,32,100,101,99,111,117,
+-    112,108,101,32,116,104,101,32,102,117,110,99,116,105,111,110,
+-    32,102,114,111,109,32,97,115,115,117,109,105,110,103,32,105,
+-    109,112,111,114,116,108,105,98,39,115,10,32,32,32,32,105,
+-    109,112,111,114,116,32,105,109,112,108,101,109,101,110,116,97,
+-    116,105,111,110,32,105,115,32,100,101,115,105,114,101,100,46,
+-    10,10,32,32,32,32,117,8,0,0,0,95,95,112,97,116,
+-    104,95,95,117,1,0,0,0,42,117,7,0,0,0,95,95,
+-    97,108,108,95,95,117,5,0,0,0,123,125,46,123,125,117,
+-    10,0,0,0,95,110,111,116,95,102,111,117,110,100,78,40,
+-    10,0,0,0,117,7,0,0,0,104,97,115,97,116,116,114,
+-    117,4,0,0,0,108,105,115,116,117,6,0,0,0,114,101,
+-    109,111,118,101,117,6,0,0,0,101,120,116,101,110,100,117,
+-    7,0,0,0,95,95,97,108,108,95,95,117,25,0,0,0,
+-    95,99,97,108,108,95,119,105,116,104,95,102,114,97,109,101,
+-    115,95,114,101,109,111,118,101,100,117,6,0,0,0,102,111,
+-    114,109,97,116,117,8,0,0,0,95,95,110,97,109,101,95,
+-    95,117,11,0,0,0,73,109,112,111,114,116,69,114,114,111,
+-    114,117,10,0,0,0,95,110,111,116,95,102,111,117,110,100,
+-    40,5,0,0,0,117,6,0,0,0,109,111,100,117,108,101,
+-    117,8,0,0,0,102,114,111,109,108,105,115,116,117,7,0,
+-    0,0,105,109,112,111,114,116,95,117,1,0,0,0,120,117,
+-    3,0,0,0,101,120,99,40,0,0,0,0,40,0,0,0,
+-    0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,
+-    112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,
+-    97,112,62,117,16,0,0,0,95,104,97,110,100,108,101,95,
+-    102,114,111,109,108,105,115,116,51,6,0,0,115,32,0,0,
+-    0,0,10,15,1,12,1,12,1,13,1,15,1,22,1,13,
+-    1,15,1,3,1,6,1,26,1,18,6,24,1,3,2,32,
+-    1,117,16,0,0,0,95,104,97,110,100,108,101,95,102,114,
+-    111,109,108,105,115,116,99,1,0,0,0,0,0,0,0,2,
+-    0,0,0,2,0,0,0,67,0,0,0,115,78,0,0,0,
+-    124,0,0,106,0,0,100,1,0,131,1,0,125,1,0,124,
+-    1,0,100,6,0,107,8,0,114,74,0,124,0,0,100,2,
+-    0,25,125,1,0,100,3,0,124,0,0,107,7,0,114,74,
+-    0,124,1,0,106,2,0,100,4,0,131,1,0,100,5,0,
+-    25,125,1,0,113,74,0,110,0,0,124,1,0,83,40,7,
+-    0,0,0,117,167,0,0,0,67,97,108,99,117,108,97,116,
+-    101,32,119,104,97,116,32,95,95,112,97,99,107,97,103,101,
+-    95,95,32,115,104,111,117,108,100,32,98,101,46,10,10,32,
+-    32,32,32,95,95,112,97,99,107,97,103,101,95,95,32,105,
+-    115,32,110,111,116,32,103,117,97,114,97,110,116,101,101,100,
+-    32,116,111,32,98,101,32,100,101,102,105,110,101,100,32,111,
+-    114,32,99,111,117,108,100,32,98,101,32,115,101,116,32,116,
+-    111,32,78,111,110,101,10,32,32,32,32,116,111,32,114,101,
+-    112,114,101,115,101,110,116,32,116,104,97,116,32,105,116,115,
+-    32,112,114,111,112,101,114,32,118,97,108,117,101,32,105,115,
+-    32,117,110,107,110,111,119,110,46,10,10,32,32,32,32,117,
+-    11,0,0,0,95,95,112,97,99,107,97,103,101,95,95,117,
+-    8,0,0,0,95,95,110,97,109,101,95,95,117,8,0,0,
+-    0,95,95,112,97,116,104,95,95,117,1,0,0,0,46,105,
+-    0,0,0,0,78,40,3,0,0,0,117,3,0,0,0,103,
+-    101,116,117,4,0,0,0,78,111,110,101,117,10,0,0,0,
+-    114,112,97,114,116,105,116,105,111,110,40,2,0,0,0,117,
+-    7,0,0,0,103,108,111,98,97,108,115,117,7,0,0,0,
+-    112,97,99,107,97,103,101,40,0,0,0,0,40,0,0,0,
+-    0,117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,
+-    112,111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,
+-    97,112,62,117,17,0,0,0,95,99,97,108,99,95,95,95,
+-    112,97,99,107,97,103,101,95,95,85,6,0,0,115,12,0,
+-    0,0,0,7,15,1,12,1,10,1,12,1,25,1,117,17,
+-    0,0,0,95,99,97,108,99,95,95,95,112,97,99,107,97,
+-    103,101,95,95,99,0,0,0,0,0,0,0,0,3,0,0,
+-    0,3,0,0,0,67,0,0,0,115,55,0,0,0,116,0,
+-    0,116,1,0,106,2,0,131,0,0,102,2,0,125,0,0,
+-    116,3,0,116,4,0,102,2,0,125,1,0,116,5,0,116,
+-    6,0,102,2,0,125,2,0,124,0,0,124,1,0,124,2,
+-    0,103,3,0,83,40,1,0,0,0,117,111,0,0,0,82,
+-    101,116,117,114,110,115,32,97,32,108,105,115,116,32,111,102,
+-    32,102,105,108,101,45,98,97,115,101,100,32,109,111,100,117,
+-    108,101,32,108,111,97,100,101,114,115,46,10,10,32,32,32,
+-    32,69,97,99,104,32,105,116,101,109,32,105,115,32,97,32,
+-    116,117,112,108,101,32,40,108,111,97,100,101,114,44,32,115,
+-    117,102,102,105,120,101,115,44,32,97,108,108,111,119,95,112,
+-    97,99,107,97,103,101,115,41,46,10,32,32,32,32,40,7,
+-    0,0,0,117,19,0,0,0,69,120,116,101,110,115,105,111,
+-    110,70,105,108,101,76,111,97,100,101,114,117,4,0,0,0,
+-    95,105,109,112,117,18,0,0,0,101,120,116,101,110,115,105,
+-    111,110,95,115,117,102,102,105,120,101,115,117,16,0,0,0,
+-    83,111,117,114,99,101,70,105,108,101,76,111,97,100,101,114,
+-    117,15,0,0,0,83,79,85,82,67,69,95,83,85,70,70,
+-    73,88,69,83,117,20,0,0,0,83,111,117,114,99,101,108,
+-    101,115,115,70,105,108,101,76,111,97,100,101,114,117,17,0,
+-    0,0,66,89,84,69,67,79,68,69,95,83,85,70,70,73,
+-    88,69,83,40,3,0,0,0,117,10,0,0,0,101,120,116,
+-    101,110,115,105,111,110,115,117,6,0,0,0,115,111,117,114,
+-    99,101,117,8,0,0,0,98,121,116,101,99,111,100,101,40,
+-    0,0,0,0,40,0,0,0,0,117,29,0,0,0,60,102,
+-    114,111,122,101,110,32,105,109,112,111,114,116,108,105,98,46,
+-    95,98,111,111,116,115,116,114,97,112,62,117,27,0,0,0,
+-    95,103,101,116,95,115,117,112,112,111,114,116,101,100,95,102,
+-    105,108,101,95,108,111,97,100,101,114,115,100,6,0,0,115,
+-    8,0,0,0,0,5,18,1,12,1,12,1,117,27,0,0,
+-    0,95,103,101,116,95,115,117,112,112,111,114,116,101,100,95,
+-    102,105,108,101,95,108,111,97,100,101,114,115,99,5,0,0,
+-    0,0,0,0,0,9,0,0,0,5,0,0,0,67,0,0,
+-    0,115,227,0,0,0,124,4,0,100,1,0,107,2,0,114,
+-    27,0,116,0,0,124,0,0,131,1,0,125,5,0,110,54,
+-    0,124,1,0,100,3,0,107,9,0,114,45,0,124,1,0,
+-    110,3,0,105,0,0,125,6,0,116,2,0,124,6,0,131,
+-    1,0,125,7,0,116,0,0,124,0,0,124,7,0,124,4,
+-    0,131,3,0,125,5,0,124,3,0,115,207,0,124,4,0,
+-    100,1,0,107,2,0,114,122,0,116,0,0,124,0,0,106,
+-    3,0,100,2,0,131,1,0,100,1,0,25,131,1,0,83,
+-    124,0,0,115,132,0,124,5,0,83,116,4,0,124,0,0,
+-    131,1,0,116,4,0,124,0,0,106,3,0,100,2,0,131,
+-    1,0,100,1,0,25,131,1,0,24,125,8,0,116,5,0,
+-    106,6,0,124,5,0,106,7,0,100,3,0,116,4,0,124,
+-    5,0,106,7,0,131,1,0,124,8,0,24,133,2,0,25,
+-    25,83,110,16,0,116,8,0,124,5,0,124,3,0,116,0,
+-    0,131,3,0,83,100,3,0,83,40,4,0,0,0,117,214,
+-    1,0,0,73,109,112,111,114,116,32,97,32,109,111,100,117,
+-    108,101,46,10,10,32,32,32,32,84,104,101,32,39,103,108,
+-    111,98,97,108,115,39,32,97,114,103,117,109,101,110,116,32,
+-    105,115,32,117,115,101,100,32,116,111,32,105,110,102,101,114,
+-    32,119,104,101,114,101,32,116,104,101,32,105,109,112,111,114,
+-    116,32,105,115,32,111,99,99,117,114,105,110,103,32,102,114,
+-    111,109,10,32,32,32,32,116,111,32,104,97,110,100,108,101,
+-    32,114,101,108,97,116,105,118,101,32,105,109,112,111,114,116,
+-    115,46,32,84,104,101,32,39,108,111,99,97,108,115,39,32,
+-    97,114,103,117,109,101,110,116,32,105,115,32,105,103,110,111,
+-    114,101,100,46,32,84,104,101,10,32,32,32,32,39,102,114,
+-    111,109,108,105,115,116,39,32,97,114,103,117,109,101,110,116,
+-    32,115,112,101,99,105,102,105,101,115,32,119,104,97,116,32,
+-    115,104,111,117,108,100,32,101,120,105,115,116,32,97,115,32,
+-    97,116,116,114,105,98,117,116,101,115,32,111,110,32,116,104,
+-    101,32,109,111,100,117,108,101,10,32,32,32,32,98,101,105,
+-    110,103,32,105,109,112,111,114,116,101,100,32,40,101,46,103,
+-    46,32,96,96,102,114,111,109,32,109,111,100,117,108,101,32,
+-    105,109,112,111,114,116,32,60,102,114,111,109,108,105,115,116,
+-    62,96,96,41,46,32,32,84,104,101,32,39,108,101,118,101,
+-    108,39,10,32,32,32,32,97,114,103,117,109,101,110,116,32,
+-    114,101,112,114,101,115,101,110,116,115,32,116,104,101,32,112,
+-    97,99,107,97,103,101,32,108,111,99,97,116,105,111,110,32,
+-    116,111,32,105,109,112,111,114,116,32,102,114,111,109,32,105,
+-    110,32,97,32,114,101,108,97,116,105,118,101,10,32,32,32,
+-    32,105,109,112,111,114,116,32,40,101,46,103,46,32,96,96,
+-    102,114,111,109,32,46,46,112,107,103,32,105,109,112,111,114,
+-    116,32,109,111,100,96,96,32,119,111,117,108,100,32,104,97,
+-    118,101,32,97,32,39,108,101,118,101,108,39,32,111,102,32,
+-    50,41,46,10,10,32,32,32,32,105,0,0,0,0,117,1,
+-    0,0,0,46,78,40,9,0,0,0,117,11,0,0,0,95,
+-    103,99,100,95,105,109,112,111,114,116,117,4,0,0,0,78,
+-    111,110,101,117,17,0,0,0,95,99,97,108,99,95,95,95,
+-    112,97,99,107,97,103,101,95,95,117,9,0,0,0,112,97,
+-    114,116,105,116,105,111,110,117,3,0,0,0,108,101,110,117,
+-    3,0,0,0,115,121,115,117,7,0,0,0,109,111,100,117,
+-    108,101,115,117,8,0,0,0,95,95,110,97,109,101,95,95,
+-    117,16,0,0,0,95,104,97,110,100,108,101,95,102,114,111,
+-    109,108,105,115,116,40,9,0,0,0,117,4,0,0,0,110,
+-    97,109,101,117,7,0,0,0,103,108,111,98,97,108,115,117,
+-    6,0,0,0,108,111,99,97,108,115,117,8,0,0,0,102,
+-    114,111,109,108,105,115,116,117,5,0,0,0,108,101,118,101,
+-    108,117,6,0,0,0,109,111,100,117,108,101,117,8,0,0,
+-    0,103,108,111,98,97,108,115,95,117,7,0,0,0,112,97,
+-    99,107,97,103,101,117,7,0,0,0,99,117,116,95,111,102,
+-    102,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
+-    60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
+-    98,46,95,98,111,111,116,115,116,114,97,112,62,117,10,0,
+-    0,0,95,95,105,109,112,111,114,116,95,95,111,6,0,0,
+-    115,26,0,0,0,0,11,12,1,15,2,24,1,12,1,18,
+-    1,6,3,12,1,23,1,6,1,4,2,35,1,40,2,117,
+-    10,0,0,0,95,95,105,109,112,111,114,116,95,95,99,2,
+-    0,0,0,0,0,0,0,14,0,0,0,13,0,0,0,67,
+-    0,0,0,115,196,2,0,0,124,1,0,97,0,0,124,0,
+-    0,97,1,0,116,1,0,106,2,0,106,3,0,114,33,0,
+-    116,4,0,97,5,0,110,6,0,116,6,0,97,5,0,120,
+-    47,0,116,0,0,116,1,0,102,2,0,68,93,33,0,125,
+-    2,0,116,7,0,124,2,0,100,1,0,131,2,0,115,52,
+-    0,116,8,0,124,2,0,95,9,0,113,52,0,113,52,0,
+-    87,116,1,0,106,10,0,116,11,0,25,125,3,0,120,76,
+-    0,100,28,0,68,93,68,0,125,4,0,124,4,0,116,1,
+-    0,106,10,0,107,7,0,114,148,0,116,8,0,106,12,0,
+-    124,4,0,131,1,0,125,5,0,110,13,0,116,1,0,106,
+-    10,0,124,4,0,25,125,5,0,116,13,0,124,3,0,124,
+-    4,0,124,5,0,131,3,0,1,113,109,0,87,100,6,0,
+-    100,7,0,103,1,0,102,2,0,100,8,0,100,9,0,100,
+-    7,0,103,2,0,102,2,0,100,10,0,100,9,0,100,7,
+-    0,103,2,0,102,2,0,102,3,0,125,6,0,120,189,0,
+-    124,6,0,68,93,169,0,92,2,0,125,7,0,125,8,0,
+-    116,14,0,100,11,0,100,12,0,132,0,0,124,8,0,68,
+-    131,1,0,131,1,0,115,23,1,116,15,0,130,1,0,124,
+-    8,0,100,13,0,25,125,9,0,124,7,0,116,1,0,106,
+-    10,0,107,6,0,114,65,1,116,1,0,106,10,0,124,7,
+-    0,25,125,10,0,80,113,236,0,121,60,0,116,8,0,106,
+-    12,0,124,7,0,131,1,0,125,10,0,124,7,0,100,10,
+-    0,107,2,0,114,123,1,100,14,0,116,1,0,106,16,0,
+-    107,6,0,114,123,1,124,8,0,100,15,0,25,125,9,0,
+-    110,0,0,80,87,113,236,0,4,116,17,0,107,10,0,114,
+-    148,1,1,1,1,119,236,0,89,113,236,0,88,113,236,0,
+-    87,116,17,0,100,16,0,131,1,0,130,1,0,121,19,0,
+-    116,8,0,106,12,0,100,17,0,131,1,0,125,11,0,87,
+-    110,24,0,4,116,17,0,107,10,0,114,210,1,1,1,1,
+-    100,27,0,125,11,0,89,110,1,0,88,116,8,0,106,12,
+-    0,100,18,0,131,1,0,125,12,0,124,7,0,100,8,0,
+-    107,2,0,114,16,2,116,8,0,106,12,0,100,19,0,131,
+-    1,0,125,13,0,116,13,0,124,3,0,100,20,0,124,13,
+-    0,131,3,0,1,110,0,0,116,13,0,124,3,0,100,21,
+-    0,124,10,0,131,3,0,1,116,13,0,124,3,0,100,17,
+-    0,124,11,0,131,3,0,1,116,13,0,124,3,0,100,18,
+-    0,124,12,0,131,3,0,1,116,13,0,124,3,0,100,22,
+-    0,124,9,0,131,3,0,1,116,13,0,124,3,0,100,23,
+-    0,116,19,0,124,8,0,131,1,0,131,3,0,1,116,13,
+-    0,124,3,0,100,24,0,116,20,0,131,0,0,131,3,0,
+-    1,116,21,0,106,22,0,116,0,0,106,23,0,131,0,0,
+-    131,1,0,1,124,7,0,100,8,0,107,2,0,114,192,2,
+-    116,24,0,106,25,0,100,25,0,131,1,0,1,100,26,0,
+-    116,21,0,107,6,0,114,192,2,100,29,0,116,27,0,95,
+-    28,0,113,192,2,110,0,0,100,27,0,83,40,30,0,0,
+-    0,117,250,0,0,0,83,101,116,117,112,32,105,109,112,111,
+-    114,116,108,105,98,32,98,121,32,105,109,112,111,114,116,105,
+-    110,103,32,110,101,101,100,101,100,32,98,117,105,108,116,45,
+-    105,110,32,109,111,100,117,108,101,115,32,97,110,100,32,105,
+-    110,106,101,99,116,105,110,103,32,116,104,101,109,10,32,32,
+-    32,32,105,110,116,111,32,116,104,101,32,103,108,111,98,97,
+-    108,32,110,97,109,101,115,112,97,99,101,46,10,10,32,32,
+-    32,32,65,115,32,115,121,115,32,105,115,32,110,101,101,100,
+-    101,100,32,102,111,114,32,115,121,115,46,109,111,100,117,108,
+-    101,115,32,97,99,99,101,115,115,32,97,110,100,32,95,105,
+-    109,112,32,105,115,32,110,101,101,100,101,100,32,116,111,32,
+-    108,111,97,100,32,98,117,105,108,116,45,105,110,10,32,32,
+-    32,32,109,111,100,117,108,101,115,44,32,116,104,111,115,101,
+-    32,116,119,111,32,109,111,100,117,108,101,115,32,109,117,115,
+-    116,32,98,101,32,101,120,112,108,105,99,105,116,108,121,32,
+-    112,97,115,115,101,100,32,105,110,46,10,10,32,32,32,32,
+-    117,10,0,0,0,95,95,108,111,97,100,101,114,95,95,117,
+-    3,0,0,0,95,105,111,117,9,0,0,0,95,119,97,114,
+-    110,105,110,103,115,117,8,0,0,0,98,117,105,108,116,105,
+-    110,115,117,7,0,0,0,109,97,114,115,104,97,108,117,5,
+-    0,0,0,112,111,115,105,120,117,1,0,0,0,47,117,2,
+-    0,0,0,110,116,117,1,0,0,0,92,117,3,0,0,0,
+-    111,115,50,99,1,0,0,0,0,0,0,0,2,0,0,0,
+-    3,0,0,0,115,0,0,0,115,33,0,0,0,124,0,0,
+-    93,23,0,125,1,0,116,0,0,124,1,0,131,1,0,100,
+-    0,0,107,2,0,86,1,113,3,0,100,1,0,83,40,2,
+-    0,0,0,105,1,0,0,0,78,40,1,0,0,0,117,3,
+-    0,0,0,108,101,110,40,2,0,0,0,117,2,0,0,0,
+-    46,48,117,3,0,0,0,115,101,112,40,0,0,0,0,40,
+-    0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
+-    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
+-    115,116,114,97,112,62,117,9,0,0,0,60,103,101,110,101,
+-    120,112,114,62,175,6,0,0,115,2,0,0,0,6,0,117,
+-    25,0,0,0,95,115,101,116,117,112,46,60,108,111,99,97,
+-    108,115,62,46,60,103,101,110,101,120,112,114,62,105,0,0,
+-    0,0,117,7,0,0,0,69,77,88,32,71,67,67,105,1,
+-    0,0,0,117,30,0,0,0,105,109,112,111,114,116,108,105,
+-    98,32,114,101,113,117,105,114,101,115,32,112,111,115,105,120,
+-    32,111,114,32,110,116,117,7,0,0,0,95,116,104,114,101,
+-    97,100,117,8,0,0,0,95,119,101,97,107,114,101,102,117,
+-    6,0,0,0,119,105,110,114,101,103,117,7,0,0,0,95,
+-    119,105,110,114,101,103,117,3,0,0,0,95,111,115,117,8,
+-    0,0,0,112,97,116,104,95,115,101,112,117,15,0,0,0,
+-    112,97,116,104,95,115,101,112,97,114,97,116,111,114,115,117,
+-    11,0,0,0,95,114,101,108,97,120,95,99,97,115,101,117,
+-    4,0,0,0,46,112,121,119,117,6,0,0,0,95,100,46,
+-    112,121,100,78,40,4,0,0,0,117,3,0,0,0,95,105,
+-    111,117,9,0,0,0,95,119,97,114,110,105,110,103,115,117,
+-    8,0,0,0,98,117,105,108,116,105,110,115,117,7,0,0,
+-    0,109,97,114,115,104,97,108,84,40,29,0,0,0,117,4,
+-    0,0,0,95,105,109,112,117,3,0,0,0,115,121,115,117,
+-    5,0,0,0,102,108,97,103,115,117,8,0,0,0,111,112,
+-    116,105,109,105,122,101,117,27,0,0,0,79,80,84,73,77,
+-    73,90,69,68,95,66,89,84,69,67,79,68,69,95,83,85,
+-    70,70,73,88,69,83,117,17,0,0,0,66,89,84,69,67,
+-    79,68,69,95,83,85,70,70,73,88,69,83,117,23,0,0,
+-    0,68,69,66,85,71,95,66,89,84,69,67,79,68,69,95,
+-    83,85,70,70,73,88,69,83,117,7,0,0,0,104,97,115,
+-    97,116,116,114,117,15,0,0,0,66,117,105,108,116,105,110,
+-    73,109,112,111,114,116,101,114,117,10,0,0,0,95,95,108,
+-    111,97,100,101,114,95,95,117,7,0,0,0,109,111,100,117,
+-    108,101,115,117,8,0,0,0,95,95,110,97,109,101,95,95,
+-    117,11,0,0,0,108,111,97,100,95,109,111,100,117,108,101,
+-    117,7,0,0,0,115,101,116,97,116,116,114,117,3,0,0,
+-    0,97,108,108,117,14,0,0,0,65,115,115,101,114,116,105,
+-    111,110,69,114,114,111,114,117,7,0,0,0,118,101,114,115,
+-    105,111,110,117,11,0,0,0,73,109,112,111,114,116,69,114,
+-    114,111,114,117,4,0,0,0,78,111,110,101,117,3,0,0,
+-    0,115,101,116,117,16,0,0,0,95,109,97,107,101,95,114,
+-    101,108,97,120,95,99,97,115,101,117,18,0,0,0,69,88,
+-    84,69,78,83,73,79,78,95,83,85,70,70,73,88,69,83,
+-    117,6,0,0,0,101,120,116,101,110,100,117,18,0,0,0,
+-    101,120,116,101,110,115,105,111,110,95,115,117,102,102,105,120,
+-    101,115,117,15,0,0,0,83,79,85,82,67,69,95,83,85,
+-    70,70,73,88,69,83,117,6,0,0,0,97,112,112,101,110,
+-    100,117,4,0,0,0,84,114,117,101,117,21,0,0,0,87,
+-    105,110,100,111,119,115,82,101,103,105,115,116,114,121,70,105,
+-    110,100,101,114,117,11,0,0,0,68,69,66,85,71,95,66,
+-    85,73,76,68,40,14,0,0,0,117,10,0,0,0,115,121,
+-    115,95,109,111,100,117,108,101,117,11,0,0,0,95,105,109,
+-    112,95,109,111,100,117,108,101,117,6,0,0,0,109,111,100,
+-    117,108,101,117,11,0,0,0,115,101,108,102,95,109,111,100,
+-    117,108,101,117,12,0,0,0,98,117,105,108,116,105,110,95,
+-    110,97,109,101,117,14,0,0,0,98,117,105,108,116,105,110,
+-    95,109,111,100,117,108,101,117,10,0,0,0,111,115,95,100,
+-    101,116,97,105,108,115,117,10,0,0,0,98,117,105,108,116,
+-    105,110,95,111,115,117,15,0,0,0,112,97,116,104,95,115,
+-    101,112,97,114,97,116,111,114,115,117,8,0,0,0,112,97,
+-    116,104,95,115,101,112,117,9,0,0,0,111,115,95,109,111,
+-    100,117,108,101,117,13,0,0,0,116,104,114,101,97,100,95,
+-    109,111,100,117,108,101,117,14,0,0,0,119,101,97,107,114,
+-    101,102,95,109,111,100,117,108,101,117,13,0,0,0,119,105,
+-    110,114,101,103,95,109,111,100,117,108,101,40,0,0,0,0,
+-    40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,
+-    110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,
+-    116,115,116,114,97,112,62,117,6,0,0,0,95,115,101,116,
+-    117,112,143,6,0,0,115,96,0,0,0,0,9,6,1,6,
+-    2,12,1,9,2,6,2,19,1,15,1,16,2,13,1,13,
+-    1,15,1,18,2,13,1,20,2,48,1,19,2,31,1,10,
+-    1,15,1,13,1,4,2,3,1,15,2,27,1,13,1,5,
+-    1,13,1,12,2,12,2,3,1,19,1,13,2,11,1,15,
+-    2,12,1,15,1,19,2,16,1,16,1,16,1,16,1,22,
+-    2,19,1,19,1,12,1,13,1,12,1,117,6,0,0,0,
+-    95,115,101,116,117,112,99,2,0,0,0,0,0,0,0,3,
+-    0,0,0,3,0,0,0,67,0,0,0,115,136,0,0,0,
+-    116,0,0,124,0,0,124,1,0,131,2,0,1,116,1,0,
+-    131,0,0,125,2,0,116,2,0,106,3,0,106,4,0,116,
+-    5,0,106,6,0,124,2,0,140,0,0,103,1,0,131,1,
+-    0,1,116,2,0,106,7,0,106,8,0,116,9,0,131,1,
+-    0,1,116,2,0,106,7,0,106,8,0,116,10,0,131,1,
+-    0,1,116,11,0,106,12,0,100,1,0,107,2,0,114,116,
+-    0,116,2,0,106,7,0,106,8,0,116,13,0,131,1,0,
+-    1,110,0,0,116,2,0,106,7,0,106,8,0,116,14,0,
+-    131,1,0,1,100,2,0,83,40,3,0,0,0,117,50,0,
+-    0,0,73,110,115,116,97,108,108,32,105,109,112,111,114,116,
+-    108,105,98,32,97,115,32,116,104,101,32,105,109,112,108,101,
+-    109,101,110,116,97,116,105,111,110,32,111,102,32,105,109,112,
+-    111,114,116,46,117,2,0,0,0,110,116,78,40,15,0,0,
+-    0,117,6,0,0,0,95,115,101,116,117,112,117,27,0,0,
+-    0,95,103,101,116,95,115,117,112,112,111,114,116,101,100,95,
+-    102,105,108,101,95,108,111,97,100,101,114,115,117,3,0,0,
+-    0,115,121,115,117,10,0,0,0,112,97,116,104,95,104,111,
+-    111,107,115,117,6,0,0,0,101,120,116,101,110,100,117,10,
+-    0,0,0,70,105,108,101,70,105,110,100,101,114,117,9,0,
+-    0,0,112,97,116,104,95,104,111,111,107,117,9,0,0,0,
+-    109,101,116,97,95,112,97,116,104,117,6,0,0,0,97,112,
+-    112,101,110,100,117,15,0,0,0,66,117,105,108,116,105,110,
+-    73,109,112,111,114,116,101,114,117,14,0,0,0,70,114,111,
+-    122,101,110,73,109,112,111,114,116,101,114,117,3,0,0,0,
+-    95,111,115,117,8,0,0,0,95,95,110,97,109,101,95,95,
+-    117,21,0,0,0,87,105,110,100,111,119,115,82,101,103,105,
+-    115,116,114,121,70,105,110,100,101,114,117,10,0,0,0,80,
+-    97,116,104,70,105,110,100,101,114,40,3,0,0,0,117,10,
+-    0,0,0,115,121,115,95,109,111,100,117,108,101,117,11,0,
+-    0,0,95,105,109,112,95,109,111,100,117,108,101,117,17,0,
+-    0,0,115,117,112,112,111,114,116,101,100,95,108,111,97,100,
+-    101,114,115,40,0,0,0,0,40,0,0,0,0,117,29,0,
+-    0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,116,
+-    108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,117,
+-    8,0,0,0,95,105,110,115,116,97,108,108,217,6,0,0,
+-    115,16,0,0,0,0,2,13,1,9,1,28,1,16,1,16,
+-    1,15,1,19,1,117,8,0,0,0,95,105,110,115,116,97,
+-    108,108,78,40,3,0,0,0,117,3,0,0,0,119,105,110,
+-    117,6,0,0,0,99,121,103,119,105,110,117,6,0,0,0,
+-    100,97,114,119,105,110,40,74,0,0,0,117,7,0,0,0,
+-    95,95,100,111,99,95,95,117,27,0,0,0,95,67,65,83,
+-    69,95,73,78,83,69,78,83,73,84,73,86,69,95,80,76,
+-    65,84,70,79,82,77,83,117,16,0,0,0,95,109,97,107,
+-    101,95,114,101,108,97,120,95,99,97,115,101,117,7,0,0,
+-    0,95,119,95,108,111,110,103,117,7,0,0,0,95,114,95,
+-    108,111,110,103,117,10,0,0,0,95,112,97,116,104,95,106,
+-    111,105,110,117,11,0,0,0,95,112,97,116,104,95,115,112,
+-    108,105,116,117,18,0,0,0,95,112,97,116,104,95,105,115,
+-    95,109,111,100,101,95,116,121,112,101,117,12,0,0,0,95,
+-    112,97,116,104,95,105,115,102,105,108,101,117,11,0,0,0,
+-    95,112,97,116,104,95,105,115,100,105,114,117,13,0,0,0,
+-    95,119,114,105,116,101,95,97,116,111,109,105,99,117,5,0,
+-    0,0,95,119,114,97,112,117,4,0,0,0,116,121,112,101,
+-    117,8,0,0,0,95,95,99,111,100,101,95,95,117,10,0,
+-    0,0,95,99,111,100,101,95,116,121,112,101,117,10,0,0,
+-    0,110,101,119,95,109,111,100,117,108,101,117,13,0,0,0,
+-    95,109,111,100,117,108,101,95,108,111,99,107,115,117,12,0,
+-    0,0,95,98,108,111,99,107,105,110,103,95,111,110,117,12,
+-    0,0,0,82,117,110,116,105,109,101,69,114,114,111,114,117,
+-    14,0,0,0,95,68,101,97,100,108,111,99,107,69,114,114,
+-    111,114,117,11,0,0,0,95,77,111,100,117,108,101,76,111,
+-    99,107,117,16,0,0,0,95,68,117,109,109,121,77,111,100,
+-    117,108,101,76,111,99,107,117,16,0,0,0,95,103,101,116,
+-    95,109,111,100,117,108,101,95,108,111,99,107,117,19,0,0,
+-    0,95,108,111,99,107,95,117,110,108,111,99,107,95,109,111,
+-    100,117,108,101,117,25,0,0,0,95,99,97,108,108,95,119,
+-    105,116,104,95,102,114,97,109,101,115,95,114,101,109,111,118,
+-    101,100,117,3,0,0,0,111,114,100,117,17,0,0,0,95,
+-    82,65,87,95,77,65,71,73,67,95,78,85,77,66,69,82,
+-    117,5,0,0,0,98,121,116,101,115,117,5,0,0,0,114,
+-    97,110,103,101,117,12,0,0,0,95,77,65,71,73,67,95,
+-    66,89,84,69,83,117,8,0,0,0,95,80,89,67,65,67,
+-    72,69,117,15,0,0,0,83,79,85,82,67,69,95,83,85,
+-    70,70,73,88,69,83,117,23,0,0,0,68,69,66,85,71,
+-    95,66,89,84,69,67,79,68,69,95,83,85,70,70,73,88,
+-    69,83,117,27,0,0,0,79,80,84,73,77,73,90,69,68,
+-    95,66,89,84,69,67,79,68,69,95,83,85,70,70,73,88,
+-    69,83,117,4,0,0,0,78,111,110,101,117,17,0,0,0,
+-    99,97,99,104,101,95,102,114,111,109,95,115,111,117,114,99,
+-    101,117,17,0,0,0,115,111,117,114,99,101,95,102,114,111,
+-    109,95,99,97,99,104,101,117,15,0,0,0,95,103,101,116,
+-    95,115,111,117,114,99,101,102,105,108,101,117,16,0,0,0,
+-    95,118,101,114,98,111,115,101,95,109,101,115,115,97,103,101,
+-    117,11,0,0,0,115,101,116,95,112,97,99,107,97,103,101,
+-    117,10,0,0,0,115,101,116,95,108,111,97,100,101,114,117,
+-    17,0,0,0,109,111,100,117,108,101,95,102,111,114,95,108,
+-    111,97,100,101,114,117,11,0,0,0,95,99,104,101,99,107,
+-    95,110,97,109,101,117,17,0,0,0,95,114,101,113,117,105,
+-    114,101,115,95,98,117,105,108,116,105,110,117,16,0,0,0,
+-    95,114,101,113,117,105,114,101,115,95,102,114,111,122,101,110,
+-    117,17,0,0,0,95,102,105,110,100,95,109,111,100,117,108,
+-    101,95,115,104,105,109,117,15,0,0,0,66,117,105,108,116,
+-    105,110,73,109,112,111,114,116,101,114,117,14,0,0,0,70,
+-    114,111,122,101,110,73,109,112,111,114,116,101,114,117,21,0,
+-    0,0,87,105,110,100,111,119,115,82,101,103,105,115,116,114,
+-    121,70,105,110,100,101,114,117,13,0,0,0,95,76,111,97,
+-    100,101,114,66,97,115,105,99,115,117,12,0,0,0,83,111,
+-    117,114,99,101,76,111,97,100,101,114,117,10,0,0,0,70,
+-    105,108,101,76,111,97,100,101,114,117,16,0,0,0,83,111,
+-    117,114,99,101,70,105,108,101,76,111,97,100,101,114,117,20,
+-    0,0,0,83,111,117,114,99,101,108,101,115,115,70,105,108,
+-    101,76,111,97,100,101,114,117,18,0,0,0,69,88,84,69,
+-    78,83,73,79,78,95,83,85,70,70,73,88,69,83,117,19,
+-    0,0,0,69,120,116,101,110,115,105,111,110,70,105,108,101,
+-    76,111,97,100,101,114,117,14,0,0,0,95,78,97,109,101,
+-    115,112,97,99,101,80,97,116,104,117,15,0,0,0,78,97,
+-    109,101,115,112,97,99,101,76,111,97,100,101,114,117,10,0,
+-    0,0,80,97,116,104,70,105,110,100,101,114,117,10,0,0,
+-    0,70,105,108,101,70,105,110,100,101,114,117,18,0,0,0,
+-    95,73,109,112,111,114,116,76,111,99,107,67,111,110,116,101,
+-    120,116,117,13,0,0,0,95,114,101,115,111,108,118,101,95,
+-    110,97,109,101,117,12,0,0,0,95,102,105,110,100,95,109,
+-    111,100,117,108,101,117,13,0,0,0,95,115,97,110,105,116,
+-    121,95,99,104,101,99,107,117,8,0,0,0,95,69,82,82,
+-    95,77,83,71,117,23,0,0,0,95,102,105,110,100,95,97,
+-    110,100,95,108,111,97,100,95,117,110,108,111,99,107,101,100,
+-    117,14,0,0,0,95,102,105,110,100,95,97,110,100,95,108,
+-    111,97,100,117,11,0,0,0,95,103,99,100,95,105,109,112,
+-    111,114,116,117,16,0,0,0,95,104,97,110,100,108,101,95,
+-    102,114,111,109,108,105,115,116,117,17,0,0,0,95,99,97,
+-    108,99,95,95,95,112,97,99,107,97,103,101,95,95,117,27,
+-    0,0,0,95,103,101,116,95,115,117,112,112,111,114,116,101,
+-    100,95,102,105,108,101,95,108,111,97,100,101,114,115,117,10,
+-    0,0,0,95,95,105,109,112,111,114,116,95,95,117,6,0,
+-    0,0,95,115,101,116,117,112,117,8,0,0,0,95,105,110,
+-    115,116,97,108,108,40,0,0,0,0,40,0,0,0,0,40,
+-    0,0,0,0,117,29,0,0,0,60,102,114,111,122,101,110,
+-    32,105,109,112,111,114,116,108,105,98,46,95,98,111,111,116,
+-    115,116,114,97,112,62,117,8,0,0,0,60,109,111,100,117,
+-    108,101,62,8,0,0,0,115,132,0,0,0,6,21,6,3,
+-    12,13,12,16,12,13,12,12,12,12,12,10,12,6,12,7,
+-    15,22,12,8,15,3,12,12,6,2,6,3,22,4,19,68,
+-    19,23,12,19,12,20,12,100,34,1,37,2,6,2,9,2,
+-    9,1,9,2,15,27,12,23,12,21,12,8,12,13,12,11,
+-    12,55,12,18,12,11,12,11,12,17,19,57,19,54,19,50,
+-    19,82,22,134,19,29,25,46,25,25,6,3,19,45,19,55,
+-    19,18,19,89,19,125,19,13,12,9,12,17,12,17,6,2,
+-    12,50,12,13,18,24,12,34,12,15,12,11,24,32,12,74,
++    114,97,112,62,117,8,0,0,0,60,109,111,100,117,108,101,
++    62,8,0,0,0,115,132,0,0,0,6,21,6,3,12,13,
++    12,16,12,13,12,12,12,12,12,10,12,6,12,7,15,22,
++    12,8,15,3,12,12,6,2,6,3,22,4,19,68,19,23,
++    12,19,12,20,12,100,34,1,37,2,6,2,9,2,9,1,
++    9,2,15,27,12,23,12,21,12,8,12,13,12,11,12,55,
++    12,18,12,11,12,11,12,17,19,57,19,54,19,50,19,82,
++    22,134,19,29,25,49,25,25,6,3,19,45,19,55,19,18,
++    19,91,19,126,19,13,12,9,12,17,12,17,6,2,12,50,
++    12,13,18,24,12,34,12,15,12,11,24,36,12,79,
+ };
+diff -r bd8afb90ebf2 Python/marshal.c
+--- a/Python/marshal.c
++++ b/Python/marshal.c
+@@ -95,7 +95,7 @@
+ }
+ 
+ static void
+-w_string(char *s, int n, WFILE *p)
++w_string(char *s, Py_ssize_t n, WFILE *p)
+ {
+     if (p->fp != NULL) {
+         fwrite(s, 1, n, p->fp);
+@@ -124,6 +124,21 @@
+     w_byte((char)((x>>24) & 0xff), p);
+ }
+ 
++#define SIZE32_MAX  0x7FFFFFFF
++
++#if SIZEOF_SIZE_T > 4
++# define W_SIZE(n, p)  do {                     \
++        if ((n) > SIZE32_MAX) {                 \
++            (p)->depth--;                       \
++            (p)->error = WFERR_UNMARSHALLABLE;  \
++            return;                             \
++        }                                       \
++        w_long((long)(n), p);                   \
++    } while(0)
++#else
++# define W_SIZE  w_long
++#endif
++
+ /* We assume that Python longs are stored internally in base some power of
+    2**15; for the sake of portability we'll always read and write them in base
+    exactly 2**15. */
+@@ -157,6 +172,11 @@
+         d >>= PyLong_MARSHAL_SHIFT;
+         l++;
+     } while (d != 0);
++    if (l > SIZE32_MAX) {
++        p->depth--;
++        p->error = WFERR_UNMARSHALLABLE;
++        return;
++    }
+     w_long((long)(Py_SIZE(ob) > 0 ? l : -l), p);
+ 
+     for (i=0; i < n-1; i++) {
+@@ -245,7 +265,7 @@
+             n = strlen(buf);
+             w_byte(TYPE_FLOAT, p);
+             w_byte((int)n, p);
+-            w_string(buf, (int)n, p);
++            w_string(buf, n, p);
+             PyMem_Free(buf);
+         }
+     }
+@@ -277,7 +297,7 @@
+             }
+             n = strlen(buf);
+             w_byte((int)n, p);
+-            w_string(buf, (int)n, p);
++            w_string(buf, n, p);
+             PyMem_Free(buf);
+             buf = PyOS_double_to_string(PyComplex_ImagAsDouble(v),
+                                         'g', 17, 0, NULL);
+@@ -287,21 +307,15 @@
+             }
+             n = strlen(buf);
+             w_byte((int)n, p);
+-            w_string(buf, (int)n, p);
++            w_string(buf, n, p);
+             PyMem_Free(buf);
+         }
+     }
+     else if (PyBytes_CheckExact(v)) {
+         w_byte(TYPE_STRING, p);
+         n = PyBytes_GET_SIZE(v);
+-        if (n > INT_MAX) {
+-            /* huge strings are not supported */
+-            p->depth--;
+-            p->error = WFERR_UNMARSHALLABLE;
+-            return;
+-        }
+-        w_long((long)n, p);
+-        w_string(PyBytes_AS_STRING(v), (int)n, p);
++        W_SIZE(n, p);
++        w_string(PyBytes_AS_STRING(v), n, p);
+     }
+     else if (PyUnicode_CheckExact(v)) {
+         PyObject *utf8;
+@@ -313,19 +327,14 @@
+         }
+         w_byte(TYPE_UNICODE, p);
+         n = PyBytes_GET_SIZE(utf8);
+-        if (n > INT_MAX) {
+-            p->depth--;
+-            p->error = WFERR_UNMARSHALLABLE;
+-            return;
+-        }
+-        w_long((long)n, p);
+-        w_string(PyBytes_AS_STRING(utf8), (int)n, p);
++        W_SIZE(n, p);
++        w_string(PyBytes_AS_STRING(utf8), n, p);
+         Py_DECREF(utf8);
+     }
+     else if (PyTuple_CheckExact(v)) {
+         w_byte(TYPE_TUPLE, p);
+         n = PyTuple_Size(v);
+-        w_long((long)n, p);
++        W_SIZE(n, p);
+         for (i = 0; i < n; i++) {
+             w_object(PyTuple_GET_ITEM(v, i), p);
+         }
+@@ -333,7 +342,7 @@
+     else if (PyList_CheckExact(v)) {
+         w_byte(TYPE_LIST, p);
+         n = PyList_GET_SIZE(v);
+-        w_long((long)n, p);
++        W_SIZE(n, p);
+         for (i = 0; i < n; i++) {
+             w_object(PyList_GET_ITEM(v, i), p);
+         }
+@@ -363,7 +372,7 @@
+             p->error = WFERR_UNMARSHALLABLE;
+             return;
+         }
+-        w_long((long)n, p);
++        W_SIZE(n, p);
+         it = PyObject_GetIter(v);
+         if (it == NULL) {
+             p->depth--;
+@@ -413,13 +422,8 @@
+         w_byte(TYPE_STRING, p);
+         n = view.len;
+         s = view.buf;
+-        if (n > INT_MAX) {
+-            p->depth--;
+-            p->error = WFERR_UNMARSHALLABLE;
+-            return;
+-        }
+-        w_long((long)n, p);
+-        w_string(s, (int)n, p);
++        W_SIZE(n, p);
++        w_string(s, n, p);
+         PyBuffer_Release(&view);
+     }
+     else {
+@@ -456,18 +460,18 @@
+ 
+ #define rs_byte(p) (((p)->ptr < (p)->end) ? (unsigned char)*(p)->ptr++ : EOF)
+ 
+-static int
+-r_string(char *s, int n, RFILE *p)
++static Py_ssize_t
++r_string(char *s, Py_ssize_t n, RFILE *p)
+ {
+     char *ptr;
+-    int read, left;
++    Py_ssize_t read, left;
+ 
+     if (!p->readable) {
+         if (p->fp != NULL)
+             /* The result fits into int because it must be <=n. */
+-            read = (int) fread(s, 1, n, p->fp);
++            read = fread(s, 1, n, p->fp);
+         else {
+-            left = (int)(p->end - p->ptr);
++            left = p->end - p->ptr;
+             read = (left < n) ? left : n;
+             memcpy(s, p->ptr, read);
+             p->ptr += read;
+@@ -476,7 +480,7 @@
+     else {
+         _Py_IDENTIFIER(read);
+ 
+-        PyObject *data = _PyObject_CallMethodId(p->readable, &PyId_read, "i", n);
++        PyObject *data = _PyObject_CallMethodId(p->readable, &PyId_read, "n", n);
+         read = 0;
+         if (data != NULL) {
+             if (!PyBytes_Check(data)) {
+@@ -506,7 +510,7 @@
+ {
+     int c = EOF;
+     unsigned char ch;
+-    int n;
++    Py_ssize_t n;
+ 
+     if (!p->readable)
+         c = p->fp ? getc(p->fp) : rs_byte(p);
+@@ -590,8 +594,8 @@
+ r_PyLong(RFILE *p)
+ {
+     PyLongObject *ob;
+-    int size, i, j, md, shorts_in_top_digit;
+-    long n;
++    long n, size, i;
++    int j, md, shorts_in_top_digit;
+     digit d;
+ 
+     n = r_long(p);
+@@ -599,7 +603,7 @@
+         return NULL;
+     if (n == 0)
+         return (PyObject *)_PyLong_New(0);
+-    if (n < -INT_MAX || n > INT_MAX) {
++    if (n < -SIZE32_MAX || n > SIZE32_MAX) {
+         PyErr_SetString(PyExc_ValueError,
+                        "bad marshal data (long size out of range)");
+         return NULL;
+@@ -730,7 +734,7 @@
+             double dx;
+             retval = NULL;
+             n = r_byte(p);
+-            if (n == EOF || r_string(buf, (int)n, p) != n) {
++            if (n == EOF || r_string(buf, n, p) != n) {
+                 PyErr_SetString(PyExc_EOFError,
+                     "EOF read where object expected");
+                 break;
+@@ -768,7 +772,7 @@
+             Py_complex c;
+             retval = NULL;
+             n = r_byte(p);
+-            if (n == EOF || r_string(buf, (int)n, p) != n) {
++            if (n == EOF || r_string(buf, n, p) != n) {
+                 PyErr_SetString(PyExc_EOFError,
+                     "EOF read where object expected");
+                 break;
+@@ -778,7 +782,7 @@
+             if (c.real == -1.0 && PyErr_Occurred())
+                 break;
+             n = r_byte(p);
+-            if (n == EOF || r_string(buf, (int)n, p) != n) {
++            if (n == EOF || r_string(buf, n, p) != n) {
+                 PyErr_SetString(PyExc_EOFError,
+                     "EOF read where object expected");
+                 break;
+@@ -827,7 +831,7 @@
+             retval = NULL;
+             break;
+         }
+-        if (n < 0 || n > INT_MAX) {
++        if (n < 0 || n > SIZE32_MAX) {
+             PyErr_SetString(PyExc_ValueError, "bad marshal data (string size out of range)");
+             retval = NULL;
+             break;
+@@ -837,7 +841,7 @@
+             retval = NULL;
+             break;
+         }
+-        if (r_string(PyBytes_AS_STRING(v), (int)n, p) != n) {
++        if (r_string(PyBytes_AS_STRING(v), n, p) != n) {
+             Py_DECREF(v);
+             PyErr_SetString(PyExc_EOFError,
+                             "EOF read where object expected");
+@@ -856,7 +860,7 @@
+             retval = NULL;
+             break;
+         }
+-        if (n < 0 || n > INT_MAX) {
++        if (n < 0 || n > SIZE32_MAX) {
+             PyErr_SetString(PyExc_ValueError, "bad marshal data (unicode size out of range)");
+             retval = NULL;
+             break;
+@@ -866,7 +870,7 @@
+             retval = PyErr_NoMemory();
+             break;
+         }
+-        if (r_string(buffer, (int)n, p) != n) {
++        if (r_string(buffer, n, p) != n) {
+             PyMem_DEL(buffer);
+             PyErr_SetString(PyExc_EOFError,
+                 "EOF read where object expected");
+@@ -885,12 +889,12 @@
+             retval = NULL;
+             break;
+         }
+-        if (n < 0 || n > INT_MAX) {
++        if (n < 0 || n > SIZE32_MAX) {
+             PyErr_SetString(PyExc_ValueError, "bad marshal data (tuple size out of range)");
+             retval = NULL;
+             break;
+         }
+-        v = PyTuple_New((int)n);
++        v = PyTuple_New(n);
+         if (v == NULL) {
+             retval = NULL;
+             break;
+@@ -905,7 +909,7 @@
+                 v = NULL;
+                 break;
+             }
+-            PyTuple_SET_ITEM(v, (int)i, v2);
++            PyTuple_SET_ITEM(v, i, v2);
+         }
+         retval = v;
+         break;
+@@ -916,12 +920,12 @@
+             retval = NULL;
+             break;
+         }
+-        if (n < 0 || n > INT_MAX) {
++        if (n < 0 || n > SIZE32_MAX) {
+             PyErr_SetString(PyExc_ValueError, "bad marshal data (list size out of range)");
+             retval = NULL;
+             break;
+         }
+-        v = PyList_New((int)n);
++        v = PyList_New(n);
+         if (v == NULL) {
+             retval = NULL;
+             break;
+@@ -936,7 +940,7 @@
+                 v = NULL;
+                 break;
+             }
+-            PyList_SET_ITEM(v, (int)i, v2);
++            PyList_SET_ITEM(v, i, v2);
+         }
+         retval = v;
+         break;
+@@ -972,7 +976,7 @@
+             retval = NULL;
+             break;
+         }
+-        if (n < 0 || n > INT_MAX) {
++        if (n < 0 || n > SIZE32_MAX) {
+             PyErr_SetString(PyExc_ValueError, "bad marshal data (set size out of range)");
+             retval = NULL;
+             break;
+@@ -1180,12 +1184,8 @@
+     if (filesize > 0 && filesize <= REASONABLE_FILE_LIMIT) {
+         char* pBuf = (char *)PyMem_MALLOC(filesize);
+         if (pBuf != NULL) {
+-            PyObject* v;
+-            size_t n;
+-            /* filesize must fit into an int, because it
+-               is smaller than REASONABLE_FILE_LIMIT */
+-            n = fread(pBuf, 1, (int)filesize, fp);
+-            v = PyMarshal_ReadObjectFromString(pBuf, n);
++            size_t n = fread(pBuf, 1, (size_t)filesize, fp);
++            PyObject* v = PyMarshal_ReadObjectFromString(pBuf, n);
+             PyMem_FREE(pBuf);
+             return v;
+         }
+diff -r bd8afb90ebf2 Python/mystrtoul.c
+--- a/Python/mystrtoul.c
++++ b/Python/mystrtoul.c
+@@ -99,7 +99,7 @@
+     register int ovlimit;       /* required digits to overflow */
+ 
+     /* skip leading white space */
+-    while (*str && isspace(Py_CHARMASK(*str)))
++    while (*str && Py_ISSPACE(Py_CHARMASK(*str)))
+         ++str;
+ 
+     /* check for leading 0b, 0o or 0x for auto-base or base 16 */
+@@ -138,7 +138,7 @@
+                 /* skip all zeroes... */
+                 while (*str == '0')
+                     ++str;
+-                while (isspace(Py_CHARMASK(*str)))
++                while (Py_ISSPACE(Py_CHARMASK(*str)))
+                     ++str;
+                 if (ptr)
+                     *ptr = str;
+@@ -266,7 +266,7 @@
+     unsigned long uresult;
+     char sign;
+ 
+-    while (*str && isspace(Py_CHARMASK(*str)))
++    while (*str && Py_ISSPACE(Py_CHARMASK(*str)))
+         str++;
+ 
+     sign = *str;
+diff -r bd8afb90ebf2 Python/pyarena.c
+--- a/Python/pyarena.c
++++ b/Python/pyarena.c
+@@ -12,8 +12,6 @@
+ 
+ #define DEFAULT_BLOCK_SIZE 8192
+ #define ALIGNMENT               8
+-#define ALIGNMENT_MASK          (ALIGNMENT - 1)
+-#define ROUNDUP(x)              (((x) + ALIGNMENT_MASK) & ~ALIGNMENT_MASK)
+ 
+ typedef struct _block {
+     /* Total number of bytes owned by this block available to pass out.
+@@ -85,8 +83,8 @@
+     b->ab_size = size;
+     b->ab_mem = (void *)(b + 1);
+     b->ab_next = NULL;
+-    b->ab_offset = ROUNDUP((Py_uintptr_t)(b->ab_mem)) -
+-      (Py_uintptr_t)(b->ab_mem);
++    b->ab_offset = (char *)_Py_ALIGN_UP(b->ab_mem, ALIGNMENT) -
++            (char *)(b->ab_mem);
+     return b;
+ }
+ 
+@@ -104,7 +102,7 @@
+ {
+     void *p;
+     assert(b);
+-    size = ROUNDUP(size);
++    size = _Py_SIZE_ROUND_UP(size, ALIGNMENT);
+     if (b->ab_offset + size > b->ab_size) {
+         /* If we need to allocate more memory than will fit in
+            the default block, allocate a one-off block that is
+@@ -158,7 +156,6 @@
+ void
+ PyArena_Free(PyArena *arena)
+ {
+-    int r;
+     assert(arena);
+ #if defined(Py_DEBUG)
+     /*
+@@ -175,12 +172,6 @@
+     assert(arena->a_objects->ob_refcnt == 1);
+     */
+ 
+-    /* Clear all the elements from the list.  This is necessary
+-       to guarantee that they will be DECREFed. */
+-    r = PyList_SetSlice(arena->a_objects,
+-                        0, PyList_GET_SIZE(arena->a_objects), NULL);
+-    assert(r == 0);
+-    assert(PyList_GET_SIZE(arena->a_objects) == 0);
+     Py_DECREF(arena->a_objects);
+     free(arena);
+ }
+diff -r bd8afb90ebf2 Python/pythonrun.c
+--- a/Python/pythonrun.c
++++ b/Python/pythonrun.c
+@@ -1358,16 +1358,21 @@
+ {
+     PyInterpreterState *interp;
+     PyThreadState *tstate;
+-    PyObject *loader_type, *loader;
++    PyObject *filename_obj, *loader_type, *loader;
+     int result = 0;
++
++    filename_obj = PyUnicode_DecodeFSDefault(filename);
++    if (filename_obj == NULL)
++        return -1;
+     /* Get current thread state and interpreter pointer */
+     tstate = PyThreadState_GET();
+     interp = tstate->interp;
+     loader_type = PyObject_GetAttrString(interp->importlib, loader_name);
+     if (loader_type == NULL) {
++        Py_DECREF(filename_obj);
+         return -1;
+     }
+-    loader = PyObject_CallFunction(loader_type, "ss", "__main__", filename);
++    loader = PyObject_CallFunction(loader_type, "sN", "__main__", filename_obj);
+     Py_DECREF(loader_type);
+     if (loader == NULL) {
+         return -1;
+@@ -1385,25 +1390,26 @@
+ {
+     PyObject *m, *d, *v;
+     const char *ext;
+-    int set_file_name = 0, ret;
++    int set_file_name = 0, ret = -1;
+     size_t len;
+ 
+     m = PyImport_AddModule("__main__");
+     if (m == NULL)
+         return -1;
++    Py_INCREF(m);
+     d = PyModule_GetDict(m);
+     if (PyDict_GetItemString(d, "__file__") == NULL) {
+         PyObject *f;
+         f = PyUnicode_DecodeFSDefault(filename);
+         if (f == NULL)
+-            return -1;
++            goto done;
+         if (PyDict_SetItemString(d, "__file__", f) < 0) {
+             Py_DECREF(f);
+-            return -1;
++            goto done;
+         }
+         if (PyDict_SetItemString(d, "__cached__", Py_None) < 0) {
+             Py_DECREF(f);
+-            return -1;
++            goto done;
+         }
+         set_file_name = 1;
+         Py_DECREF(f);
+@@ -1417,7 +1423,6 @@
+             fclose(fp);
+         if ((pyc_fp = fopen(filename, "rb")) == NULL) {
+             fprintf(stderr, "python: Can't reopen .pyc file\n");
+-            ret = -1;
+             goto done;
+         }
+         /* Turn on optimization if a .pyo file is given */
+@@ -1446,7 +1451,6 @@
+     flush_io();
+     if (v == NULL) {
+         PyErr_Print();
+-        ret = -1;
+         goto done;
+     }
+     Py_DECREF(v);
+@@ -1454,6 +1458,7 @@
+   done:
+     if (set_file_name && PyDict_DelItemString(d, "__file__"))
+         PyErr_Clear();
++    Py_DECREF(m);
+     return ret;
+ }
+ 
+diff -r bd8afb90ebf2 Python/structmember.c
+--- a/Python/structmember.c
++++ b/Python/structmember.c
+@@ -254,12 +254,8 @@
+         char *string;
+         Py_ssize_t len;
+ 
+-        if (!PyUnicode_Check(v)) {
+-            PyErr_BadArgument();
+-            return -1;
+-        }
+         string = _PyUnicode_AsStringAndSize(v, &len);
+-        if (len != 1) {
++        if (string == NULL || len != 1) {
+             PyErr_BadArgument();
+             return -1;
+         }
+diff -r bd8afb90ebf2 Python/symtable.c
+--- a/Python/symtable.c
++++ b/Python/symtable.c
+@@ -24,16 +24,18 @@
+         void *key, int lineno, int col_offset)
+ {
+     PySTEntryObject *ste = NULL;
+-    PyObject *k;
++    PyObject *k = NULL;
+ 
+     k = PyLong_FromVoidPtr(key);
+     if (k == NULL)
+         goto fail;
+     ste = PyObject_New(PySTEntryObject, &PySTEntry_Type);
+-    if (ste == NULL)
++    if (ste == NULL) {
++        Py_DECREF(k);
+         goto fail;
++    }
+     ste->ste_table = st;
+-    ste->ste_id = k;
++    ste->ste_id = k; /* ste owns reference to k */
+ 
+     ste->ste_name = name;
+     Py_INCREF(name);
+@@ -218,17 +220,40 @@
+     return NULL;
+ }
+ 
++/* When compiling the use of C stack is probably going to be a lot
++   lighter than when executing Python code but still can overflow
++   and causing a Python crash if not checked (e.g. eval("()"*300000)).
++   Using the current recursion limit for the compiler seems too
++   restrictive (it caused at least one test to fail) so a factor is
++   used to allow deeper recursion when compiling an expression.
++
++   Using a scaling factor means this should automatically adjust when
++   the recursion limit is adjusted for small or large C stack allocations.
++*/
++#define COMPILER_STACK_FRAME_SCALE 3
++
+ struct symtable *
+ PySymtable_Build(mod_ty mod, const char *filename, PyFutureFeatures *future)
+ {
+     struct symtable *st = symtable_new();
+     asdl_seq *seq;
+     int i;
++    PyThreadState *tstate;
+ 
+     if (st == NULL)
+         return st;
+     st->st_filename = filename;
+     st->st_future = future;
++
++    /* Setup recursion depth check counters */
++    tstate = PyThreadState_GET();
++    if (!tstate) {
++        PySymtable_Free(st);
++        return NULL;
++    }
++    st->recursion_depth = tstate->recursion_depth * COMPILER_STACK_FRAME_SCALE;
++    st->recursion_limit = Py_GetRecursionLimit() * COMPILER_STACK_FRAME_SCALE;
++
+     /* Make the initial symbol information gathering pass */
+     if (!GET_IDENTIFIER(top) ||
+         !symtable_enter_block(st, top, ModuleBlock, (void *)mod, 0, 0)) {
+@@ -1011,11 +1036,17 @@
+ 
+    VISIT_SEQ_TAIL permits the start of an ASDL sequence to be skipped, which is
+    useful if the first node in the sequence requires special treatment.
++
++   VISIT_QUIT macro returns the specified value exiting from the function but
++   first adjusts current recursion counter depth.
+ */
+ 
++#define VISIT_QUIT(ST, X) \
++    return --(ST)->recursion_depth,(X)
++
+ #define VISIT(ST, TYPE, V) \
+     if (!symtable_visit_ ## TYPE((ST), (V))) \
+-        return 0;
++        VISIT_QUIT((ST), 0);
+ 
+ #define VISIT_SEQ(ST, TYPE, SEQ) { \
+     int i; \
+@@ -1023,7 +1054,7 @@
+     for (i = 0; i < asdl_seq_LEN(seq); i++) { \
+         TYPE ## _ty elt = (TYPE ## _ty)asdl_seq_GET(seq, i); \
+         if (!symtable_visit_ ## TYPE((ST), elt)) \
+-            return 0; \
++            VISIT_QUIT((ST), 0);                 \
+     } \
+ }
+ 
+@@ -1033,7 +1064,7 @@
+     for (i = (START); i < asdl_seq_LEN(seq); i++) { \
+         TYPE ## _ty elt = (TYPE ## _ty)asdl_seq_GET(seq, i); \
+         if (!symtable_visit_ ## TYPE((ST), elt)) \
+-            return 0; \
++            VISIT_QUIT((ST), 0);                 \
+     } \
+ }
+ 
+@@ -1044,7 +1075,7 @@
+         expr_ty elt = (expr_ty)asdl_seq_GET(seq, i); \
+         if (!elt) continue; /* can be NULL */ \
+         if (!symtable_visit_expr((ST), elt)) \
+-            return 0; \
++            VISIT_QUIT((ST), 0);             \
+     } \
+ }
+ 
+@@ -1069,32 +1100,37 @@
+ static int
+ symtable_visit_stmt(struct symtable *st, stmt_ty s)
+ {
++    if (++st->recursion_depth > st->recursion_limit) {
++        PyErr_SetString(PyExc_RuntimeError,
++                        "maximum recursion depth exceeded during compilation");
++        VISIT_QUIT(st, 0);
++    }
+     switch (s->kind) {
+     case FunctionDef_kind:
+         if (!symtable_add_def(st, s->v.FunctionDef.name, DEF_LOCAL))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         if (s->v.FunctionDef.args->defaults)
+             VISIT_SEQ(st, expr, s->v.FunctionDef.args->defaults);
+         if (s->v.FunctionDef.args->kw_defaults)
+             VISIT_KWONLYDEFAULTS(st,
+                                s->v.FunctionDef.args->kw_defaults);
+         if (!symtable_visit_annotations(st, s))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         if (s->v.FunctionDef.decorator_list)
+             VISIT_SEQ(st, expr, s->v.FunctionDef.decorator_list);
+         if (!symtable_enter_block(st, s->v.FunctionDef.name,
+                                   FunctionBlock, (void *)s, s->lineno,
+                                   s->col_offset))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         VISIT(st, arguments, s->v.FunctionDef.args);
+         VISIT_SEQ(st, stmt, s->v.FunctionDef.body);
+         if (!symtable_exit_block(st, s))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         break;
+     case ClassDef_kind: {
+         PyObject *tmp;
+         if (!symtable_add_def(st, s->v.ClassDef.name, DEF_LOCAL))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         VISIT_SEQ(st, expr, s->v.ClassDef.bases);
+         VISIT_SEQ(st, keyword, s->v.ClassDef.keywords);
+         if (s->v.ClassDef.starargs)
+@@ -1105,20 +1141,20 @@
+             VISIT_SEQ(st, expr, s->v.ClassDef.decorator_list);
+         if (!symtable_enter_block(st, s->v.ClassDef.name, ClassBlock,
+                                   (void *)s, s->lineno, s->col_offset))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         if (!GET_IDENTIFIER(__class__) ||
+             !symtable_add_def(st, __class__, DEF_LOCAL) ||
+             !GET_IDENTIFIER(__locals__) ||
+             !symtable_add_def(st, __locals__, DEF_PARAM)) {
+             symtable_exit_block(st, s);
+-            return 0;
++            VISIT_QUIT(st, 0);
+         }
+         tmp = st->st_private;
+         st->st_private = s->v.ClassDef.name;
+         VISIT_SEQ(st, stmt, s->v.ClassDef.body);
+         st->st_private = tmp;
+         if (!symtable_exit_block(st, s))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         break;
+     }
+     case Return_kind:
+@@ -1200,12 +1236,14 @@
+         asdl_seq *seq = s->v.Global.names;
+         for (i = 0; i < asdl_seq_LEN(seq); i++) {
+             identifier name = (identifier)asdl_seq_GET(seq, i);
+-            char *c_name = _PyUnicode_AsString(name);
+             long cur = symtable_lookup(st, name);
+             if (cur < 0)
+-                return 0;
++                VISIT_QUIT(st, 0);
+             if (cur & (DEF_LOCAL | USE)) {
+                 char buf[256];
++                char *c_name = _PyUnicode_AsString(name);
++                if (!c_name)
++                    return 0;
+                 if (cur & DEF_LOCAL)
+                     PyOS_snprintf(buf, sizeof(buf),
+                                   GLOBAL_AFTER_ASSIGN,
+@@ -1215,10 +1253,10 @@
+                                   GLOBAL_AFTER_USE,
+                                   c_name);
+                 if (!symtable_warn(st, buf, s->lineno))
+-                    return 0;
++                    VISIT_QUIT(st, 0);
+             }
+             if (!symtable_add_def(st, name, DEF_GLOBAL))
+-                return 0;
++                VISIT_QUIT(st, 0);
+         }
+         break;
+     }
+@@ -1227,12 +1265,14 @@
+         asdl_seq *seq = s->v.Nonlocal.names;
+         for (i = 0; i < asdl_seq_LEN(seq); i++) {
+             identifier name = (identifier)asdl_seq_GET(seq, i);
+-            char *c_name = _PyUnicode_AsString(name);
+             long cur = symtable_lookup(st, name);
+             if (cur < 0)
+-                return 0;
++                VISIT_QUIT(st, 0);
+             if (cur & (DEF_LOCAL | USE)) {
+                 char buf[256];
++                char *c_name = _PyUnicode_AsString(name);
++                if (!c_name)
++                    return 0;
+                 if (cur & DEF_LOCAL)
+                     PyOS_snprintf(buf, sizeof(buf),
+                                   NONLOCAL_AFTER_ASSIGN,
+@@ -1242,10 +1282,10 @@
+                                   NONLOCAL_AFTER_USE,
+                                   c_name);
+                 if (!symtable_warn(st, buf, s->lineno))
+-                    return 0;
++                    VISIT_QUIT(st, 0);
+             }
+             if (!symtable_add_def(st, name, DEF_NONLOCAL))
+-                return 0;
++                VISIT_QUIT(st, 0);
+         }
+         break;
+     }
+@@ -1262,12 +1302,17 @@
+         VISIT_SEQ(st, stmt, s->v.With.body);
+         break;
+     }
+-    return 1;
++    VISIT_QUIT(st, 1);
+ }
+ 
+ static int
+ symtable_visit_expr(struct symtable *st, expr_ty e)
+ {
++    if (++st->recursion_depth > st->recursion_limit) {
++        PyErr_SetString(PyExc_RuntimeError,
++                        "maximum recursion depth exceeded during compilation");
++        VISIT_QUIT(st, 0);
++    }
+     switch (e->kind) {
+     case BoolOp_kind:
+         VISIT_SEQ(st, expr, e->v.BoolOp.values);
+@@ -1281,7 +1326,7 @@
+         break;
+     case Lambda_kind: {
+         if (!GET_IDENTIFIER(lambda))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         if (e->v.Lambda.args->defaults)
+             VISIT_SEQ(st, expr, e->v.Lambda.args->defaults);
+         if (e->v.Lambda.args->kw_defaults)
+@@ -1290,11 +1335,11 @@
+         if (!symtable_enter_block(st, lambda,
+                                   FunctionBlock, (void *)e, e->lineno,
+                                   e->col_offset))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         VISIT(st, arguments, e->v.Lambda.args);
+         VISIT(st, expr, e->v.Lambda.body);
+         if (!symtable_exit_block(st, (void *)e))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         break;
+     }
+     case IfExp_kind:
+@@ -1311,29 +1356,29 @@
+         break;
+     case GeneratorExp_kind:
+         if (!symtable_visit_genexp(st, e))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         break;
+     case ListComp_kind:
+         if (!symtable_visit_listcomp(st, e))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         break;
+     case SetComp_kind:
+         if (!symtable_visit_setcomp(st, e))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         break;
+     case DictComp_kind:
+         if (!symtable_visit_dictcomp(st, e))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         break;
+     case Yield_kind:
+-    case YieldFrom_kind: {
+-        expr_ty value;
+-        value = (e->kind == YieldFrom_kind) ? e->v.YieldFrom.value : e->v.Yield.value;
+-        if (value)
+-            VISIT(st, expr, value);
++        if (e->v.Yield.value)
++            VISIT(st, expr, e->v.Yield.value);
+         st->st_cur->ste_generator = 1;
+         break;
+-    }
++    case YieldFrom_kind:
++        VISIT(st, expr, e->v.YieldFrom.value);
++        st->st_cur->ste_generator = 1;
++        break;
+     case Compare_kind:
+         VISIT(st, expr, e->v.Compare.left);
+         VISIT_SEQ(st, expr, e->v.Compare.comparators);
+@@ -1367,14 +1412,14 @@
+     case Name_kind:
+         if (!symtable_add_def(st, e->v.Name.id,
+                               e->v.Name.ctx == Load ? USE : DEF_LOCAL))
+-            return 0;
++            VISIT_QUIT(st, 0);
+         /* Special-case super: it counts as a use of __class__ */
+         if (e->v.Name.ctx == Load &&
+             st->st_cur->ste_type == FunctionBlock &&
+             !PyUnicode_CompareWithASCIIString(e->v.Name.id, "super")) {
+             if (!GET_IDENTIFIER(__class__) ||
+                 !symtable_add_def(st, __class__, USE))
+-                return 0;
++                VISIT_QUIT(st, 0);
+         }
+         break;
+     /* child nodes of List and Tuple will have expr_context set */
+@@ -1385,7 +1430,7 @@
+         VISIT_SEQ(st, expr, e->v.Tuple.elts);
+         break;
+     }
+-    return 1;
++    VISIT_QUIT(st, 1);
+ }
+ 
+ static int
+diff -r bd8afb90ebf2 Python/thread_pthread.h
+--- a/Python/thread_pthread.h
++++ b/Python/thread_pthread.h
+@@ -303,6 +303,7 @@
+     sem_t *thelock = (sem_t *)lock;
+     int status, error = 0;
+ 
++    (void) error; /* silence unused-but-set-variable warning */
+     dprintf(("PyThread_free_lock(%p) called\n", lock));
+ 
+     if (!thelock)
+@@ -335,6 +336,7 @@
+     int status, error = 0;
+     struct timespec ts;
+ 
++    (void) error; /* silence unused-but-set-variable warning */
+     dprintf(("PyThread_acquire_lock_timed(%p, %lld, %d) called\n",
+              lock, microseconds, intr_flag));
+ 
+@@ -385,6 +387,7 @@
+     sem_t *thelock = (sem_t *)lock;
+     int status, error = 0;
+ 
++    (void) error; /* silence unused-but-set-variable warning */
+     dprintf(("PyThread_release_lock(%p) called\n", lock));
+ 
+     status = sem_post(thelock);
+diff -r bd8afb90ebf2 README
+--- a/README
++++ b/README
+@@ -2,7 +2,7 @@
+ ============================
+ 
+ Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+-2012 Python Software Foundation.  All rights reserved.
++2012, 2013 Python Software Foundation.  All rights reserved.
+ 
+ Python 3.x is a new version of the language, which is incompatible with the 2.x
+ line of releases.  The language is mostly the same, but many details, especially
+diff -r bd8afb90ebf2 Tools/gdb/libpython.py
+--- a/Tools/gdb/libpython.py
++++ b/Tools/gdb/libpython.py
+@@ -1332,7 +1332,7 @@
+   /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
+ """
+ def register (obj):
+-    if obj == None:
++    if obj is None:
+         obj = gdb
+ 
+     # Wire up the pretty-printer
+@@ -1463,7 +1463,7 @@
+             return name.startswith('pthread_cond_timedwait')
+ 
+     def is_gc_collect(self):
+-        '''Is this frame "collect" within the the garbage-collector?'''
++        '''Is this frame "collect" within the garbage-collector?'''
+         return self._gdbframe.name() == 'collect'
+ 
+     def get_pyop(self):
+diff -r bd8afb90ebf2 Tools/i18n/msgfmt.py
+--- a/Tools/i18n/msgfmt.py
++++ b/Tools/i18n/msgfmt.py
+@@ -24,8 +24,9 @@
+         Display version information and exit.
+ """
+ 
++import os
+ import sys
+-import os
++import ast
+ import getopt
+ import struct
+ import array
+@@ -180,8 +181,7 @@
+         l = l.strip()
+         if not l:
+             continue
+-        # XXX: Does this always follow Python escape semantics?
+-        l = eval(l)
++        l = ast.literal_eval(l)
+         if section == ID:
+             msgid += l.encode(encoding)
+         elif section == STR:
+diff -r bd8afb90ebf2 Tools/i18n/pygettext.py
+--- a/Tools/i18n/pygettext.py
++++ b/Tools/i18n/pygettext.py
+@@ -188,8 +188,8 @@
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n"
+ "Language-Team: LANGUAGE <LL@li.org>\\n"
+ "MIME-Version: 1.0\\n"
+-"Content-Type: text/plain; charset=CHARSET\\n"
+-"Content-Transfer-Encoding: ENCODING\\n"
++"Content-Type: text/plain; charset=%(charset)s\\n"
++"Content-Transfer-Encoding: %(encoding)s\\n"
+ "Generated-By: pygettext.py %(version)s\\n"
+ 
+ ''')
+@@ -203,35 +203,32 @@
+ 
+ 
+ 
+-escapes = []
+-
+-def make_escapes(pass_iso8859):
+-    global escapes
+-    if pass_iso8859:
+-        # Allow iso-8859 characters to pass through so that e.g. 'msgid
++def make_escapes(pass_nonascii):
++    global escapes, escape
++    if pass_nonascii:
++        # Allow non-ascii characters to pass through so that e.g. 'msgid
+         # "Höhe"' would result not result in 'msgid "H\366he"'.  Otherwise we
+         # escape any character outside the 32..126 range.
+         mod = 128
++        escape = escape_ascii
+     else:
+         mod = 256
+-    for i in range(256):
+-        if 32 <= (i % mod) <= 126:
+-            escapes.append(chr(i))
+-        else:
+-            escapes.append("\\%03o" % i)
+-    escapes[ord('\\')] = '\\\\'
+-    escapes[ord('\t')] = '\\t'
+-    escapes[ord('\r')] = '\\r'
+-    escapes[ord('\n')] = '\\n'
+-    escapes[ord('\"')] = '\\"'
++        escape = escape_nonascii
++    escapes = [r"\%03o" % i for i in range(mod)]
++    for i in range(32, 127):
++        escapes[i] = chr(i)
++    escapes[ord('\\')] = r'\\'
++    escapes[ord('\t')] = r'\t'
++    escapes[ord('\r')] = r'\r'
++    escapes[ord('\n')] = r'\n'
++    escapes[ord('\"')] = r'\"'
+ 
+ 
+-def escape(s):
+-    global escapes
+-    s = list(s)
+-    for i in range(len(s)):
+-        s[i] = escapes[ord(s[i])]
+-    return EMPTYSTRING.join(s)
++def escape_ascii(s, encoding):
++    return ''.join(escapes[ord(c)] if ord(c) < 128 else c for c in s)
++
++def escape_nonascii(s, encoding):
++    return ''.join(escapes[b] for b in s.encode(encoding))
+ 
+ 
+ def safe_eval(s):
+@@ -239,18 +236,18 @@
+     return eval(s, {'__builtins__':{}}, {})
+ 
+ 
+-def normalize(s):
++def normalize(s, encoding):
+     # This converts the various Python string types into a format that is
+     # appropriate for .po files, namely much closer to C style.
+     lines = s.split('\n')
+     if len(lines) == 1:
+-        s = '"' + escape(s) + '"'
++        s = '"' + escape(s, encoding) + '"'
+     else:
+         if not lines[-1]:
+             del lines[-1]
+             lines[-1] = lines[-1] + '\n'
+         for i in range(len(lines)):
+-            lines[i] = escape(lines[i])
++            lines[i] = escape(lines[i], encoding)
+         lineterm = '\\n"\n"'
+         s = '""\n"' + lineterm.join(lines) + '"'
+     return s
+@@ -447,7 +444,10 @@
+         timestamp = time.strftime('%Y-%m-%d %H:%M+%Z')
+         # The time stamp in the header doesn't have the same format as that
+         # generated by xgettext...
+-        print(pot_header % {'time': timestamp, 'version': __version__}, file=fp)
++        encoding = fp.encoding if fp.encoding else 'UTF-8'
++        print(pot_header % {'time': timestamp, 'version': __version__,
++                            'charset': encoding,
++                            'encoding': '8bit'}, file=fp)
+         # Sort the entries.  First sort each particular entry's keys, then
+         # sort all the entries by their first item.
+         reverse = {}
+@@ -491,7 +491,7 @@
+                         print(locline, file=fp)
+                 if isdocstring:
+                     print('#, docstring', file=fp)
+-                print('msgid', normalize(k), file=fp)
++                print('msgid', normalize(k, encoding), file=fp)
+                 print('msgstr ""\n', file=fp)
+ 
+ 
+@@ -587,7 +587,7 @@
+                 fp.close()
+ 
+     # calculate escapes
+-    make_escapes(options.escape)
++    make_escapes(not options.escape)
+ 
+     # calculate all keywords
+     options.keywords.extend(default_keywords)
+@@ -620,17 +620,17 @@
+         if filename == '-':
+             if options.verbose:
+                 print(_('Reading standard input'))
+-            fp = sys.stdin
++            fp = sys.stdin.buffer
+             closep = 0
+         else:
+             if options.verbose:
+                 print(_('Working on %s') % filename)
+-            fp = open(filename)
++            fp = open(filename, 'rb')
+             closep = 1
+         try:
+             eater.set_filename(filename)
+             try:
+-                tokens = tokenize.generate_tokens(fp.readline)
++                tokens = tokenize.tokenize(fp.readline)
+                 for _token in tokens:
+                     eater(*_token)
+             except tokenize.TokenError as e:
+diff -r bd8afb90ebf2 Tools/msi/msi.py
+--- a/Tools/msi/msi.py
++++ b/Tools/msi/msi.py
+@@ -415,7 +415,7 @@
+               ("VerdanaRed9", "Verdana", 9, 255, 0),
+              ])
+ 
+-    compileargs = r'-Wi "[TARGETDIR]Lib\compileall.py" -f -x "bad_coding|badsyntax|site-packages|py2_|lib2to3\\tests" "[TARGETDIR]Lib"'
++    compileargs = r'-Wi "[TARGETDIR]Lib\compileall.py" -f -x "bad_coding|badsyntax|site-packages|py2_|lib2to3\\tests|venv\\scripts" "[TARGETDIR]Lib"'
+     lib2to3args = r'-c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"'
+     # See "CustomAction Table"
+     add_data(db, "CustomAction", [
+@@ -977,6 +977,8 @@
+     launchersrc = PCBUILD
+     if launchersrc.lower() == 'pcbuild\\x64-pgo':
+         launchersrc = 'PCBuild\\win32-pgo'
++    if launchersrc.lower() == 'pcbuild\\amd64':
++        launchersrc = 'PCBuild'
+     launcher = os.path.join(srcdir, launchersrc, "py.exe")
+     launcherdir.start_component("launcher", flags = 8+256, keyfile="py.exe")
+     launcherdir.add_file(launcher,
+diff -r bd8afb90ebf2 Tools/msi/schema.py
+--- a/Tools/msi/schema.py
++++ b/Tools/msi/schema.py
+@@ -958,7 +958,7 @@
+ (u'ServiceInstall',u'StartType',u'N',0,4,None, None, None, None, u'Type of the service',),
+ (u'Shortcut',u'Name',u'N',None, None, None, None, u'Filename',None, u'The name of the shortcut to be created.',),
+ (u'Shortcut',u'Description',u'Y',None, None, None, None, u'Text',None, u'The description for the shortcut.',),
+-(u'Shortcut',u'Component_',u'N',None, None, u'Component',1,u'Identifier',None, u'Foreign key into the Component table denoting the component whose selection gates the the shortcut creation/deletion.',),
++(u'Shortcut',u'Component_',u'N',None, None, u'Component',1,u'Identifier',None, u'Foreign key into the Component table denoting the component whose selection gates the shortcut creation/deletion.',),
+ (u'Shortcut',u'Icon_',u'Y',None, None, u'Icon',1,u'Identifier',None, u'Foreign key into the File table denoting the external icon file for the shortcut.',),
+ (u'Shortcut',u'IconIndex',u'Y',-32767,32767,None, None, None, None, u'The icon index for the shortcut.',),
+ (u'Shortcut',u'Directory_',u'N',None, None, u'Directory',1,u'Identifier',None, u'Foreign key into the Directory table denoting the directory where the shortcut file is created.',),
+diff -r bd8afb90ebf2 Tools/msi/uisample.py
+--- a/Tools/msi/uisample.py
++++ b/Tools/msi/uisample.py
+@@ -1195,7 +1195,7 @@
+ (u'ServiceInstall', u'StartType', u'N', 0, 4, None, None, None, None, u'Type of the service'),
+ (u'Shortcut', u'Name', u'N', None, None, None, None, u'Filename', None, u'The name of the shortcut to be created.'),
+ (u'Shortcut', u'Description', u'Y', None, None, None, None, u'Text', None, u'The description for the shortcut.'),
+-(u'Shortcut', u'Component_', u'N', None, None, u'Component', 1, u'Identifier', None, u'Foreign key into the Component table denoting the component whose selection gates the the shortcut creation/deletion.'),
++(u'Shortcut', u'Component_', u'N', None, None, u'Component', 1, u'Identifier', None, u'Foreign key into the Component table denoting the component whose selection gates the shortcut creation/deletion.'),
+ (u'Shortcut', u'Icon_', u'Y', None, None, u'Icon', 1, u'Identifier', None, u'Foreign key into the File table denoting the external icon file for the shortcut.'),
+ (u'Shortcut', u'IconIndex', u'Y', -32767, 32767, None, None, None, None, u'The icon index for the shortcut.'),
+ (u'Shortcut', u'Directory_', u'N', None, None, u'Directory', 1, u'Identifier', None, u'Foreign key into the Directory table denoting the directory where the shortcut file is created.'),
+diff -r bd8afb90ebf2 Tools/scripts/find_recursionlimit.py
+--- a/Tools/scripts/find_recursionlimit.py
++++ b/Tools/scripts/find_recursionlimit.py
+@@ -89,6 +89,12 @@
+         _pickle.Pickler(io.BytesIO(), protocol=-1).dump(l)
+         _cache[n] = l
+ 
++def test_compiler_recursion():
++    # The compiler uses a scaling factor to support additional levels
++    # of recursion. This is a sanity check of that scaling to ensure
++    # it still raises RuntimeError even at higher recursion limits
++    compile("()" * (10 * sys.getrecursionlimit()), "<single>", "single")
++
+ def check_limit(n, test_func_name):
+     sys.setrecursionlimit(n)
+     if test_func_name.startswith("test_"):
+@@ -117,5 +123,6 @@
+         check_limit(limit, "test_getattr")
+         check_limit(limit, "test_getitem")
+         check_limit(limit, "test_cpickle")
++        check_limit(limit, "test_compiler_recursion")
+         print("Limit of %d is fine" % limit)
+         limit = limit + 100
+diff -r bd8afb90ebf2 Tools/scripts/h2py.py
+--- a/Tools/scripts/h2py.py
++++ b/Tools/scripts/h2py.py
+@@ -50,6 +50,11 @@
+         searchdirs=os.environ['INCLUDE'].split(';')
+     except KeyError:
+         searchdirs=['/usr/include']
++        try:
++            searchdirs.insert(0, os.path.join('/usr/include',
++                                              os.environ['MULTIARCH']))
++        except KeyError:
++            pass
+ 
+ def main():
+     global filedict
+diff -r bd8afb90ebf2 Tools/scripts/patchcheck.py
+--- a/Tools/scripts/patchcheck.py
++++ b/Tools/scripts/patchcheck.py
+@@ -173,8 +173,9 @@
+ 
+     # Test suite run and passed.
+     if python_files or c_files:
++        end = " and check for refleaks?" if c_files else "?"
+         print()
+-        print("Did you run the test suite?")
++        print("Did you run the test suite" + end)
+ 
+ 
+ if __name__ == '__main__':
+diff -r bd8afb90ebf2 Tools/scripts/pindent.py
+--- a/Tools/scripts/pindent.py
++++ b/Tools/scripts/pindent.py
+@@ -79,8 +79,9 @@
+ # Defaults
+ STEPSIZE = 8
+ TABSIZE = 8
+-EXPANDTABS = 0
++EXPANDTABS = False
+ 
++import io
+ import re
+ import sys
+ 
+@@ -89,7 +90,8 @@
+ next['while'] = next['for'] = 'else', 'end'
+ next['try'] = 'except', 'finally'
+ next['except'] = 'except', 'else', 'finally', 'end'
+-next['else'] = next['finally'] = next['def'] = next['class'] = 'end'
++next['else'] = next['finally'] = next['with'] = \
++    next['def'] = next['class'] = 'end'
+ next['end'] = ()
+ start = 'if', 'while', 'for', 'try', 'with', 'def', 'class'
+ 
+@@ -105,11 +107,11 @@
+         self.expandtabs = expandtabs
+         self._write = fpo.write
+         self.kwprog = re.compile(
+-                r'^\s*(?P<kw>[a-z]+)'
+-                r'(\s+(?P<id>[a-zA-Z_]\w*))?'
++                r'^(?:\s|\\\n)*(?P<kw>[a-z]+)'
++                r'((?:\s|\\\n)+(?P<id>[a-zA-Z_]\w*))?'
+                 r'[^\w]')
+         self.endprog = re.compile(
+-                r'^\s*#?\s*end\s+(?P<kw>[a-z]+)'
++                r'^(?:\s|\\\n)*#?\s*end\s+(?P<kw>[a-z]+)'
+                 r'(\s+(?P<id>[a-zA-Z_]\w*))?'
+                 r'[^\w]')
+         self.wsprog = re.compile(r'^[ \t]*')
+@@ -125,7 +127,7 @@
+ 
+     def readline(self):
+         line = self.fpi.readline()
+-        if line: self.lineno = self.lineno + 1
++        if line: self.lineno += 1
+         # end if
+         return line
+     # end def readline
+@@ -143,27 +145,24 @@
+             line2 = self.readline()
+             if not line2: break
+             # end if
+-            line = line + line2
++            line += line2
+         # end while
+         return line
+     # end def getline
+ 
+-    def putline(self, line, indent = None):
+-        if indent is None:
+-            self.write(line)
+-            return
++    def putline(self, line, indent):
++        tabs, spaces = divmod(indent*self.indentsize, self.tabsize)
++        i = self.wsprog.match(line).end()
++        line = line[i:]
++        if line[:1] not in ('\n', '\r', ''):
++            line = '\t'*tabs + ' '*spaces + line
+         # end if
+-        tabs, spaces = divmod(indent*self.indentsize, self.tabsize)
+-        i = 0
+-        m = self.wsprog.match(line)
+-        if m: i = m.end()
+-        # end if
+-        self.write('\t'*tabs + ' '*spaces + line[i:])
++        self.write(line)
+     # end def putline
+ 
+     def reformat(self):
+         stack = []
+-        while 1:
++        while True:
+             line = self.getline()
+             if not line: break      # EOF
+             # end if
+@@ -173,10 +172,9 @@
+                 kw2 = m.group('kw')
+                 if not stack:
+                     self.error('unexpected end')
+-                elif stack[-1][0] != kw2:
++                elif stack.pop()[0] != kw2:
+                     self.error('unmatched end')
+                 # end if
+-                del stack[-1:]
+                 self.putline(line, len(stack))
+                 continue
+             # end if
+@@ -208,23 +206,23 @@
+     def delete(self):
+         begin_counter = 0
+         end_counter = 0
+-        while 1:
++        while True:
+             line = self.getline()
+             if not line: break      # EOF
+             # end if
+             m = self.endprog.match(line)
+             if m:
+-                end_counter = end_counter + 1
++                end_counter += 1
+                 continue
+             # end if
+             m = self.kwprog.match(line)
+             if m:
+                 kw = m.group('kw')
+                 if kw in start:
+-                    begin_counter = begin_counter + 1
++                    begin_counter += 1
+                 # end if
+             # end if
+-            self.putline(line)
++            self.write(line)
+         # end while
+         if begin_counter - end_counter < 0:
+             sys.stderr.write('Warning: input contained more end tags than expected\n')
+@@ -234,17 +232,12 @@
+     # end def delete
+ 
+     def complete(self):
+-        self.indentsize = 1
+         stack = []
+         todo = []
+-        thisid = ''
+-        current, firstkw, lastkw, topid = 0, '', '', ''
+-        while 1:
++        currentws = thisid = firstkw = lastkw = topid = ''
++        while True:
+             line = self.getline()
+-            i = 0
+-            m = self.wsprog.match(line)
+-            if m: i = m.end()
+-            # end if
++            i = self.wsprog.match(line).end()
+             m = self.endprog.match(line)
+             if m:
+                 thiskw = 'end'
+@@ -269,7 +262,9 @@
+                     thiskw = ''
+                 # end if
+             # end if
+-            indent = len(line[:i].expandtabs(self.tabsize))
++            indentws = line[:i]
++            indent = len(indentws.expandtabs(self.tabsize))
++            current = len(currentws.expandtabs(self.tabsize))
+             while indent < current:
+                 if firstkw:
+                     if topid:
+@@ -278,11 +273,11 @@
+                     else:
+                         s = '# end %s\n' % firstkw
+                     # end if
+-                    self.putline(s, current)
++                    self.write(currentws + s)
+                     firstkw = lastkw = ''
+                 # end if
+-                current, firstkw, lastkw, topid = stack[-1]
+-                del stack[-1]
++                currentws, firstkw, lastkw, topid = stack.pop()
++                current = len(currentws.expandtabs(self.tabsize))
+             # end while
+             if indent == current and firstkw:
+                 if thiskw == 'end':
+@@ -297,18 +292,18 @@
+                     else:
+                         s = '# end %s\n' % firstkw
+                     # end if
+-                    self.putline(s, current)
++                    self.write(currentws + s)
+                     firstkw = lastkw = topid = ''
+                 # end if
+             # end if
+             if indent > current:
+-                stack.append((current, firstkw, lastkw, topid))
++                stack.append((currentws, firstkw, lastkw, topid))
+                 if thiskw and thiskw not in start:
+                     # error
+                     thiskw = ''
+                 # end if
+-                current, firstkw, lastkw, topid = \
+-                         indent, thiskw, thiskw, thisid
++                currentws, firstkw, lastkw, topid = \
++                          indentws, thiskw, thiskw, thisid
+             # end if
+             if thiskw:
+                 if thiskw in start:
+@@ -326,7 +321,6 @@
+             self.write(line)
+         # end while
+     # end def complete
+-
+ # end class PythonIndenter
+ 
+ # Simplified user interface
+@@ -352,116 +346,86 @@
+     pi.reformat()
+ # end def reformat_filter
+ 
+-class StringReader:
+-    def __init__(self, buf):
+-        self.buf = buf
+-        self.pos = 0
+-        self.len = len(self.buf)
+-    # end def __init__
+-    def read(self, n = 0):
+-        if n <= 0:
+-            n = self.len - self.pos
+-        else:
+-            n = min(n, self.len - self.pos)
+-        # end if
+-        r = self.buf[self.pos : self.pos + n]
+-        self.pos = self.pos + n
+-        return r
+-    # end def read
+-    def readline(self):
+-        i = self.buf.find('\n', self.pos)
+-        return self.read(i + 1 - self.pos)
+-    # end def readline
+-    def readlines(self):
+-        lines = []
+-        line = self.readline()
+-        while line:
+-            lines.append(line)
+-            line = self.readline()
+-        # end while
+-        return lines
+-    # end def readlines
+-    # seek/tell etc. are left as an exercise for the reader
+-# end class StringReader
+-
+-class StringWriter:
+-    def __init__(self):
+-        self.buf = ''
+-    # end def __init__
+-    def write(self, s):
+-        self.buf = self.buf + s
+-    # end def write
+-    def getvalue(self):
+-        return self.buf
+-    # end def getvalue
+-# end class StringWriter
+-
+ def complete_string(source, stepsize = STEPSIZE, tabsize = TABSIZE, expandtabs = EXPANDTABS):
+-    input = StringReader(source)
+-    output = StringWriter()
++    input = io.StringIO(source)
++    output = io.StringIO()
+     pi = PythonIndenter(input, output, stepsize, tabsize, expandtabs)
+     pi.complete()
+     return output.getvalue()
+ # end def complete_string
+ 
+ def delete_string(source, stepsize = STEPSIZE, tabsize = TABSIZE, expandtabs = EXPANDTABS):
+-    input = StringReader(source)
+-    output = StringWriter()
++    input = io.StringIO(source)
++    output = io.StringIO()
+     pi = PythonIndenter(input, output, stepsize, tabsize, expandtabs)
+     pi.delete()
+     return output.getvalue()
+ # end def delete_string
+ 
+ def reformat_string(source, stepsize = STEPSIZE, tabsize = TABSIZE, expandtabs = EXPANDTABS):
+-    input = StringReader(source)
+-    output = StringWriter()
++    input = io.StringIO(source)
++    output = io.StringIO()
+     pi = PythonIndenter(input, output, stepsize, tabsize, expandtabs)
+     pi.reformat()
+     return output.getvalue()
+ # end def reformat_string
+ 
++def make_backup(filename):
++    import os, os.path
++    backup = filename + '~'
++    if os.path.lexists(backup):
++        try:
++            os.remove(backup)
++        except os.error:
++            print("Can't remove backup %r" % (backup,), file=sys.stderr)
++        # end try
++    # end if
++    try:
++        os.rename(filename, backup)
++    except os.error:
++        print("Can't rename %r to %r" % (filename, backup), file=sys.stderr)
++    # end try
++# end def make_backup
++
+ def complete_file(filename, stepsize = STEPSIZE, tabsize = TABSIZE, expandtabs = EXPANDTABS):
+-    source = open(filename, 'r').read()
++    with open(filename, 'r') as f:
++        source = f.read()
++    # end with
+     result = complete_string(source, stepsize, tabsize, expandtabs)
+     if source == result: return 0
+     # end if
+-    import os
+-    try: os.rename(filename, filename + '~')
+-    except os.error: pass
+-    # end try
+-    f = open(filename, 'w')
+-    f.write(result)
+-    f.close()
++    make_backup(filename)
++    with open(filename, 'w') as f:
++        f.write(result)
++    # end with
+     return 1
+ # end def complete_file
+ 
+ def delete_file(filename, stepsize = STEPSIZE, tabsize = TABSIZE, expandtabs = EXPANDTABS):
+-    source = open(filename, 'r').read()
++    with open(filename, 'r') as f:
++        source = f.read()
++    # end with
+     result = delete_string(source, stepsize, tabsize, expandtabs)
+     if source == result: return 0
+     # end if
+-    import os
+-    try: os.rename(filename, filename + '~')
+-    except os.error: pass
+-    # end try
+-    f = open(filename, 'w')
+-    f.write(result)
+-    f.close()
++    make_backup(filename)
++    with open(filename, 'w') as f:
++        f.write(result)
++    # end with
+     return 1
+ # end def delete_file
+ 
+ def reformat_file(filename, stepsize = STEPSIZE, tabsize = TABSIZE, expandtabs = EXPANDTABS):
+-    source = open(filename, 'r').read()
++    with open(filename, 'r') as f:
++        source = f.read()
++    # end with
+     result = reformat_string(source, stepsize, tabsize, expandtabs)
+     if source == result: return 0
+     # end if
+-    import os
+-    try: os.rename(filename, filename + '~')
+-    except os.error: pass
+-    # end try
+-    f = open(filename, 'w')
+-    f.write(result)
+-    f.close()
++    make_backup(filename)
++    with open(filename, 'w') as f:
++        f.write(result)
++    # end with
+     return 1
+ # end def reformat_file
+ 
+@@ -474,7 +438,7 @@
+ -r         : reformat a completed program (use #end directives)
+ -s stepsize: indentation step (default %(STEPSIZE)d)
+ -t tabsize : the worth in spaces of a tab (default %(TABSIZE)d)
+--e         : expand TABs into spaces (defailt OFF)
++-e         : expand TABs into spaces (default OFF)
+ [file] ... : files are changed in place, with backups in file~
+ If no files are specified or a single - is given,
+ the program acts as a filter (reads stdin, writes stdout).
+@@ -517,7 +481,7 @@
+         elif o == '-t':
+             tabsize = int(a)
+         elif o == '-e':
+-            expandtabs = 1
++            expandtabs = True
+         # end if
+     # end for
+     if not action:
+diff -r bd8afb90ebf2 Tools/scripts/serve.py
+--- a/Tools/scripts/serve.py
++++ b/Tools/scripts/serve.py
+@@ -2,7 +2,7 @@
+ '''
+ Small wsgiref based web server. Takes a path to serve from and an
+ optional port number (defaults to 8000), then tries to serve files.
+-Mime types are guessed from the file names, 404 errors are thrown
++Mime types are guessed from the file names, 404 errors are raised
+ if the file is not found. Used for the make serve target in Doc.
+ '''
+ import sys
+diff -r bd8afb90ebf2 Tools/scripts/texi2html.py
+--- a/Tools/scripts/texi2html.py
++++ b/Tools/scripts/texi2html.py
+@@ -319,7 +319,7 @@
+ 
+     # Start saving text in a buffer instead of writing it to a file
+     def startsaving(self):
+-        if self.savetext != None:
++        if self.savetext is not None:
+             self.savestack.append(self.savetext)
+             # print '*** Recursively saving text, expect trouble'
+         self.savetext = ''
+@@ -341,7 +341,7 @@
+         except:
+             print(args)
+             raise TypeError
+-        if self.savetext != None:
++        if self.savetext is not None:
+             self.savetext = self.savetext + text
+         elif self.nodefp:
+             self.nodefp.write(text)
+@@ -350,7 +350,7 @@
+ 
+     # Complete the current node -- write footnotes and close file
+     def endnode(self):
+-        if self.savetext != None:
++        if self.savetext is not None:
+             print('*** Still saving text at end of node')
+             dummy = self.collectsavings()
+         if self.footnotes:
+@@ -804,7 +804,7 @@
+     def close_i(self): self.write('</I>')
+ 
+     def open_footnote(self):
+-        # if self.savetext <> None:
++        # if self.savetext is not None:
+         #       print '*** Recursive footnote -- expect weirdness'
+         id = len(self.footnotes) + 1
+         self.write(self.FN_SOURCE_PATTERN % {'id': repr(id)})
+@@ -1442,7 +1442,7 @@
+             else:
+                 # some other character, e.g. '-'
+                 args = self.itemarg + ' ' + args
+-        if self.itemnumber != None:
++        if self.itemnumber is not None:
+             args = self.itemnumber + '. ' + args
+             self.itemnumber = increment(self.itemnumber)
+         if self.stack and self.stack[-1] == 'table':
+diff -r bd8afb90ebf2 Tools/unicode/comparecodecs.py
+--- a/Tools/unicode/comparecodecs.py
++++ b/Tools/unicode/comparecodecs.py
+@@ -30,7 +30,7 @@
+             mismatch += 1
+     # Check decoding
+     for i in range(256):
+-        c = chr(i)
++        c = bytes([i])
+         try:
+             u1 = c.decode(encoding1)
+         except UnicodeError:
+diff -r bd8afb90ebf2 configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -9,6 +9,22 @@
+ 
+ AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/)
+ 
++AC_SUBST(BASECPPFLAGS)
++if test "$abs_srcdir" != "$abs_builddir"; then
++    # If we're building out-of-tree, we need to make sure the following
++    # resources get picked up before their $srcdir counterparts.
++    #   Objects/ -> typeslots.inc
++    #   Include/ -> Python-ast.h, graminit.h
++    #   Python/  -> importlib.h
++    # (A side effect of this is that these resources will automatically be
++    #  regenerated when building out-of-tree, regardless of whether or not
++    #  the $srcdir counterpart is up-to-date.  This is an acceptable trade
++    #  off.)
++    BASECPPFLAGS="-IObjects -IInclude -IPython"
++else
++    BASECPPFLAGS=""
++fi
++
+ AC_SUBST(HGVERSION)
+ AC_SUBST(HGTAG)
+ AC_SUBST(HGBRANCH)
+@@ -34,6 +50,8 @@
+ AC_CONFIG_HEADER(pyconfig.h)
+ 
+ AC_CANONICAL_HOST
++AC_SUBST(build)
++AC_SUBST(host)
+ 
+ if test "$cross_compiling" = yes; then
+     AC_MSG_CHECKING([for python interpreter for cross build])
+@@ -49,8 +67,10 @@
+ 	    AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
+ 	fi
+         AC_MSG_RESULT($interp)
+-	PYTHON_FOR_BUILD="_PYTHON_PROJECT_BASE=$srcdir"' _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) '$interp
++	PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
+     fi
++elif test "$cross_compiling" = maybe; then
++    AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
+ else
+     PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
+ fi
+@@ -328,15 +348,15 @@
+ ##                           [Use (OpenStep|Rhapsody) dynamic linker]))
+ ##
+ # Set name for machine-dependent library files
+-AC_SUBST(MACHDEP)
++AC_ARG_VAR([MACHDEP], [name for machine-dependent library files])
+ AC_MSG_CHECKING(MACHDEP)
+ if test -z "$MACHDEP"
+ then
+     # avoid using uname for cross builds
+     if test "$cross_compiling" = yes; then
+-       # ac_sys_system and ac_sys_release are only used for setting
+-       # `define_xopen_source' in the case statement below. For the
+-       # current supported cross builds, this macro is not adjusted.
++       # ac_sys_system and ac_sys_release are used for setting
++       # a lot of different things including 'define_xopen_source'
++       # in the case statement below.
+ 	case "$host" in
+ 	*-*-linux*)
+ 		ac_sys_system=Linux
+@@ -746,6 +766,9 @@
+     esac;;
+ esac
+ 
++MULTIARCH=$($CC --print-multiarch 2>/dev/null)
++AC_SUBST(MULTIARCH)
++
+ 
+ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+@@ -984,12 +1007,12 @@
+ fi
+ AC_SUBST(READELF)
+ 
+-AC_SUBST(DISABLE_ASDLGEN)
+-DISABLE_ASDLGEN=""
+-AC_CHECK_PROG(HAS_PYTHON, python, found, not-found)
+-if test $HAS_HG != found -o $HAS_PYTHON != found
+-then
+-    DISABLE_ASDLGEN="@echo hg: $HAS_HG, python: $HAS_PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
++AC_SUBST(ASDLGEN)
++AC_CHECK_PROGS(PYTHON, python$PACKAGE_VERSION python3 python, not-found)
++if test "$PYTHON" = not-found; then
++    ASDLGEN="@echo python: $PYTHON! cannot run \$(srcdir)/Parser/asdl_c.py #"
++else
++    ASDLGEN="$PYTHON"
+ fi
+ 
+ 
+@@ -1329,6 +1352,7 @@
+ AC_MSG_CHECKING(whether pthreads are available without options)
+ AC_CACHE_VAL(ac_cv_pthread_is_default,
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
++#include <stdio.h>
+ #include <pthread.h>
+ 
+ void* routine(void* p){return NULL;}
+@@ -1363,6 +1387,7 @@
+ [ac_save_cc="$CC"
+ CC="$CC -Kpthread"
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
++#include <stdio.h>
+ #include <pthread.h>
+ 
+ void* routine(void* p){return NULL;}
+@@ -1391,6 +1416,7 @@
+ [ac_save_cc="$CC"
+ CC="$CC -Kthread"
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
++#include <stdio.h>
+ #include <pthread.h>
+ 
+ void* routine(void* p){return NULL;}
+@@ -1415,10 +1441,11 @@
+ # so we need to run a program to see whether it really made the
+ # function available.
+ AC_MSG_CHECKING(whether $CC accepts -pthread)
+-AC_CACHE_VAL(ac_cv_thread,
++AC_CACHE_VAL(ac_cv_pthread,
+ [ac_save_cc="$CC"
+ CC="$CC -pthread"
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
++#include <stdio.h>
+ #include <pthread.h>
+ 
+ void* routine(void* p){return NULL;}
+@@ -1618,10 +1645,30 @@
+ AC_DEFINE_UNQUOTED([RETSIGTYPE],[void],[assume C89 semantics that RETSIGTYPE is always void])
+ AC_TYPE_SIZE_T
+ AC_TYPE_UID_T
++
++# There are two separate checks for each of the exact-width integer types we
++# need.  First we check whether the type is available using the usual
++# AC_CHECK_TYPE macro with the default includes (which includes <inttypes.h>
++# and <stdint.h> where available).  We then also use the special type checks of
++# the form AC_TYPE_UINT32_T, which in the case that uint32_t is not available
++# directly, #define's uint32_t to be a suitable type.
++
++AC_CHECK_TYPE(uint32_t,
++  AC_DEFINE(HAVE_UINT32_T, 1, [Define if your compiler provides uint32_t.]),,)
+ AC_TYPE_UINT32_T
++
++AC_CHECK_TYPE(uint64_t,
++  AC_DEFINE(HAVE_UINT64_T, 1, [Define if your compiler provides uint64_t.]),,)
+ AC_TYPE_UINT64_T
++
++AC_CHECK_TYPE(int32_t,
++  AC_DEFINE(HAVE_INT32_T, 1, [Define if your compiler provides int32_t.]),,)
+ AC_TYPE_INT32_T
++
++AC_CHECK_TYPE(int64_t,
++  AC_DEFINE(HAVE_INT64_T, 1, [Define if your compiler provides int64_t.]),,)
+ AC_TYPE_INT64_T
++
+ AC_CHECK_TYPE(ssize_t,
+   AC_DEFINE(HAVE_SSIZE_T, 1, [Define if your compiler provides ssize_t]),,)
+ AC_CHECK_TYPE(__uint128_t,
+@@ -1856,7 +1903,6 @@
+ AC_SUBST(CCSHARED)
+ AC_SUBST(LINKFORSHARED)
+ 
+-AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).])
+ # LDSHARED is the ld *command* used to create shared library
+ # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5
+ # (Shared libraries in this instance are shared modules to be loaded into
+@@ -2340,7 +2386,9 @@
+     _libs=$LIBS
+     LIBS="$LIBS -lpthread"
+     AC_MSG_CHECKING([for pthread_create in -lpthread])
+-    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>
++    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
++#include <stdio.h>
++#include <pthread.h>
+ 
+ void * start_routine (void *arg) { exit (0); }]], [[
+ pthread_create (NULL, NULL, start_routine, NULL)]])],[
+@@ -2406,7 +2454,9 @@
+ 
+       AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported)
+       AC_CACHE_VAL(ac_cv_pthread_system_supported,
+-      [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <pthread.h>
++      [AC_RUN_IFELSE([AC_LANG_SOURCE([[
++      #include <stdio.h>
++      #include <pthread.h>
+       void *foo(void *parm) {
+         return NULL;
+       }
+@@ -2455,25 +2505,15 @@
+ 
+ [
+ dnl the check does not work on cross compilation case...
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* AF_INET6 available check */
++  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ /* AF_INET6 available check */
+ #include <sys/types.h>
+-#include <sys/socket.h>
+-main()
+-{
+- if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
+-   exit(1);
+- else
+-   exit(0);
+-}
+-]])],[
++#include <sys/socket.h>]],
++[[int domain = AF_INET6;]])],[
+   AC_MSG_RESULT(yes)
+   ipv6=yes
+ ],[
+   AC_MSG_RESULT(no)
+   ipv6=no
+-],[
+-  AC_MSG_RESULT(no)
+-  ipv6=no
+ ])
+ 
+ if test "$ipv6" = "yes"; then
+@@ -3095,6 +3135,7 @@
+   AC_MSG_CHECKING(getaddrinfo bug)
+   AC_CACHE_VAL(ac_cv_buggy_getaddrinfo,
+   AC_RUN_IFELSE([AC_LANG_SOURCE([[[
++#include <stdio.h>
+ #include <sys/types.h>
+ #include <netdb.h>
+ #include <string.h>
+@@ -3919,6 +3960,8 @@
+ fi
+ AC_MSG_RESULT($SO)
+ 
++AC_DEFINE_UNQUOTED(SHLIB_EXT, "$SO", [Define this to be extension of shared libraries (including the dot!).])
++
+ # Check whether right shifting a negative integer extends the sign bit
+ # or fills with zeros (like the Cray J90, according to Tim Peters).
+ AC_MSG_CHECKING(whether right shift extends the sign bit)
+@@ -4423,6 +4466,7 @@
+ AC_MSG_CHECKING(for broken mbstowcs)
+ AC_CACHE_VAL(ac_cv_broken_mbstowcs,
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
++#include <stdio.h>
+ #include<stdlib.h>
+ int main() {
+     size_t len = -1;
+diff -r bd8afb90ebf2 pyconfig.h.in
+--- a/pyconfig.h.in
++++ b/pyconfig.h.in
+@@ -426,6 +426,12 @@
+ /* Define to 1 if you have the `initgroups' function. */
+ #undef HAVE_INITGROUPS
+ 
++/* Define if your compiler provides int32_t. */
++#undef HAVE_INT32_T
++
++/* Define if your compiler provides int64_t. */
++#undef HAVE_INT64_T
++
+ /* Define to 1 if you have the <inttypes.h> header file. */
+ #undef HAVE_INTTYPES_H
+ 
+@@ -1047,6 +1053,12 @@
+ /* Define this if you have tcl and TCL_UTF_MAX==6 */
+ #undef HAVE_UCS4_TCL
+ 
++/* Define if your compiler provides uint32_t. */
++#undef HAVE_UINT32_T
++
++/* Define if your compiler provides uint64_t. */
++#undef HAVE_UINT64_T
++
+ /* Define to 1 if the system has the type `uintptr_t'. */
+ #undef HAVE_UINTPTR_T
+ 
+diff -r bd8afb90ebf2 setup.py
+--- a/setup.py
++++ b/setup.py
+@@ -33,10 +33,6 @@
+ # This global variable is used to hold the list of modules to be disabled.
+ disabled_module_list = []
+ 
+-# File which contains the directory for shared mods (for sys.path fixup
+-# when running from the build dir, see Modules/getpath.c)
+-_BUILDDIR_COOKIE = "pybuilddir.txt"
+-
+ def add_dir_to_list(dirlist, dir):
+     """Add the directory 'dir' to the list 'dirlist' (after any relative
+     directories) if:
+@@ -252,16 +248,6 @@
+             args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
+         self.compiler.set_executables(**args)
+ 
+-        # Not only do we write the builddir cookie, but we manually install
+-        # the shared modules directory if it isn't already in sys.path.
+-        # Otherwise trying to import the extensions after building them
+-        # will fail.
+-        with open(_BUILDDIR_COOKIE, "wb") as f:
+-            f.write(self.build_lib.encode('utf-8', 'surrogateescape'))
+-        abs_build_lib = os.path.join(os.getcwd(), self.build_lib)
+-        if abs_build_lib not in sys.path:
+-            sys.path.append(abs_build_lib)
+-
+         build_ext.build_extensions(self)
+ 
+         longest = max([len(e.name) for e in self.extensions])
+@@ -520,6 +506,9 @@
+                 '/lib', '/usr/lib',
+                 ]
+             inc_dirs = self.compiler.include_dirs + ['/usr/include']
++        else:
++            lib_dirs = self.compiler.library_dirs[:]
++            inc_dirs = self.compiler.include_dirs[:]
+         exts = []
+         missing = []
+ 
+@@ -1405,6 +1394,7 @@
+             define_macros = []
+             expat_lib = ['expat']
+             expat_sources = []
++            expat_depends = []
+         else:
+             expat_inc = [os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')]
+             define_macros = [
+@@ -1414,12 +1404,25 @@
+             expat_sources = ['expat/xmlparse.c',
+                              'expat/xmlrole.c',
+                              'expat/xmltok.c']
++            expat_depends = ['expat/ascii.h',
++                             'expat/asciitab.h',
++                             'expat/expat.h',
++                             'expat/expat_config.h',
++                             'expat/expat_external.h',
++                             'expat/internal.h',
++                             'expat/latin1tab.h',
++                             'expat/utf8tab.h',
++                             'expat/xmlrole.h',
++                             'expat/xmltok.h',
++                             'expat/xmltok_impl.h'
++                             ]
+ 
+         exts.append(Extension('pyexpat',
+                               define_macros = define_macros,
+                               include_dirs = expat_inc,
+                               libraries = expat_lib,
+-                              sources = ['pyexpat.c'] + expat_sources
++                              sources = ['pyexpat.c'] + expat_sources,
++                              depends = expat_depends,
+                               ))
+ 
+         # Fredrik Lundh's cElementTree module.  Note that this also
+@@ -1432,6 +1435,8 @@
+                                   include_dirs = expat_inc,
+                                   libraries = expat_lib,
+                                   sources = ['_elementtree.c'],
++                                  depends = ['pyexpat.c'] + expat_sources +
++                                      expat_depends,
+                                   ))
+         else:
+             missing.append('_elementtree')
+@@ -1788,6 +1793,8 @@
+                 mkpath(ffi_builddir)
+                 config_args = [arg for arg in sysconfig.get_config_var("CONFIG_ARGS").split()
+                                if (('--host=' in arg) or ('--build=' in arg))]
++                if not self.verbose:
++                    config_args.append("-q")
+ 
+                 # Pass empty CFLAGS because we'll just append the resulting
+                 # CFLAGS to Python's; -g or -O2 is to be avoided.
+@@ -1983,6 +1990,7 @@
+                 # solaris: problems with register allocation.
+                 # icc >= 11.0 works as well.
+                 define_macros = config['ppro']
++                extra_compile_args.append('-Wno-unknown-pragmas')
+             else:
+                 define_macros = config['ansi32']
+         else:
+@@ -2003,6 +2011,15 @@
+         if not sysconfig.get_config_var('WITH_THREAD'):
+             define_macros.append(('WITHOUT_THREADS', 1))
+ 
++        # Increase warning level for gcc:
++        if 'gcc' in cc:
++            cmd = ("echo '' | gcc -Wextra -Wno-missing-field-initializers -E - "
++                   "> /dev/null 2>&1")
++            ret = os.system(cmd)
++            if ret >> 8 == 0:
++                extra_compile_args.extend(['-Wextra',
++                                           '-Wno-missing-field-initializers'])
++
+         # Uncomment for extra functionality:
+         #define_macros.append(('EXTRA_FUNCTIONALITY', 1))
+         ext = Extension (
--- python3.3-3.3.0.orig/debian/patches/multiarch.diff
+++ python3.3-3.3.0/debian/patches/multiarch.diff
@@ -0,0 +1,121 @@
+Index: b/Lib/sysconfig.py
+===================================================================
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -28,7 +28,7 @@
+         'include':
+             '{installed_base}/include/python{py_version_short}{abiflags}',
+         'platinclude':
+-            '{installed_platbase}/include/python{py_version_short}{abiflags}',
++            '{installed_platbase}/include{multiarchsubdir}/python{py_version_short}{abiflags}',
+         'scripts': '{base}/bin',
+         'data': '{base}',
+         },
+@@ -560,6 +560,12 @@
+         # the init-function.
+         _CONFIG_VARS['userbase'] = _getuserbase()
+ 
++        multiarch = get_config_var('MULTIARCH')
++        if multiarch:
++            _CONFIG_VARS['multiarchsubdir'] = '/' + multiarch
++        else:
++            _CONFIG_VARS['multiarchsubdir'] = ''
++
+         # Always convert srcdir to an absolute path
+         srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
+         if os.name == 'posix':
+Index: b/Lib/distutils/sysconfig.py
+===================================================================
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -111,6 +111,9 @@
+                 incdir = os.path.join(get_config_var('srcdir'), 'Include')
+             return os.path.normpath(incdir)
+         python_dir = 'python' + get_python_version() + build_flags
++        if not python_build and plat_specific:
++            import sysconfig
++            return sysconfig.get_path('platinclude')
+         return os.path.join(prefix, "include", python_dir)
+     elif os.name == "nt":
+         return os.path.join(prefix, "include")
+Index: b/Makefile.pre.in
+===================================================================
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -114,7 +114,7 @@
+ LIBDIR=		@libdir@
+ MANDIR=		@mandir@
+ INCLUDEDIR=	@includedir@
+-CONFINCLUDEDIR=	$(exec_prefix)/include
++CONFINCLUDEDIR=	$(exec_prefix)/include/$(MULTIARCH)
+ SCRIPTDIR=	$(prefix)/lib
+ ABIFLAGS=	@ABIFLAGS@
+ 
+@@ -641,6 +641,7 @@
+ 
+ Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
+ 	$(CC) -c $(PY_CORE_CFLAGS) \
++		$(if $(MULTIARCH),-DMULTIARCH='"$(MULTIARCH)"') \
+ 		-DSOABI='"$(SOABI)"' \
+ 		-o $@ $(srcdir)/Python/dynload_shlib.c
+ 
+@@ -984,7 +985,7 @@
+ 		$(DESTDIR)$(MANDIR)/man1/python$(VERSION).1
+ 
+ # Install the library
+-PLATDIR=	plat-$(MACHDEP)
++PLATDIR=	plat-$(MULTIARCH)
+ EXTRAPLATDIR= @EXTRAPLATDIR@
+ MACHDEPS=	$(PLATDIR) $(EXTRAPLATDIR)
+ XMLLIBSUBDIRS=  xml xml/dom xml/etree xml/parsers xml/sax
+@@ -1119,6 +1120,10 @@
+ $(srcdir)/Lib/$(PLATDIR):
+ 	mkdir $(srcdir)/Lib/$(PLATDIR)
+ 	cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
++	if [ -n "$(MULTIARCH)" ]; then \
++	  cp -p $(srcdir)/Lib/plat-linux/*.py $(srcdir)/Lib/$(PLATDIR)/.; \
++	  rm -f $(srcdir)/Lib/$(PLATDIR)/IN.py; \
++	fi
+ 	export PATH; PATH="`pwd`:$$PATH"; \
+ 	export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
+ 	export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
+@@ -1157,10 +1162,10 @@
+ 
+ # Install the library and miscellaneous stuff needed for extending/embedding
+ # This goes into $(exec_prefix)
+-LIBPL=		$(LIBDEST)/config-$(LDVERSION)
++LIBPL=		$(LIBDEST)/config-$(LDVERSION)-$(MULTIARCH)
+ 
+ # pkgconfig directory
+-LIBPC=		$(LIBDIR)/pkgconfig
++LIBPC=		$(LIBDIR)/$(MULTIARCH)/pkgconfig
+ 
+ libainstall:	all python-config
+ 	@for i in $(LIBDIR) $(LIBPL) $(LIBPC); \
+Index: b/Python/dynload_shlib.c
+===================================================================
+--- a/Python/dynload_shlib.c
++++ b/Python/dynload_shlib.c
+@@ -48,6 +48,9 @@
+     ".exe",
+     ".EXE",
+ #else  /* !__VMS */
++#ifdef MULTIARCH
++    "." SOABI "-" MULTIARCH ".so",
++#endif
+     "." SOABI ".so",
+     ".abi" PYTHON_ABI_STRING ".so",
+     ".so",
+Index: b/Modules/Setup.dist
+===================================================================
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -91,7 +91,7 @@
+ TESTPATH=
+ 
+ # Path components for machine- or system-dependent modules and shared libraries
+-MACHDEPPATH=:plat-$(MACHDEP)
++MACHDEPPATH=:plat-$(MULTIARCH)
+ EXTRAMACHDEPPATH=
+ 
+ COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)$(MACHDEPPATH)$(EXTRAMACHDEPPATH)
--- python3.3-3.3.0.orig/debian/patches/locale-module.diff
+++ python3.3-3.3.0/debian/patches/locale-module.diff
@@ -0,0 +1,19 @@
+# DP:   * Lib/locale.py:
+# DP:     - Don't map 'utf8', 'utf-8' to 'utf', which is not a known encoding
+# DP:       for glibc.
+
+Index: b/Lib/locale.py
+===================================================================
+--- a/Lib/locale.py
++++ b/Lib/locale.py
+@@ -1537,8 +1537,8 @@
+     'uk_ua.iso88595':                       'uk_UA.ISO8859-5',
+     'uk_ua.koi8u':                          'uk_UA.KOI8-U',
+     'uk_ua.microsoftcp1251':                'uk_UA.CP1251',
+-    'univ':                                 'en_US.utf',
+-    'universal':                            'en_US.utf',
++    'univ':                                 'en_US.UTF-8',
++    'universal':                            'en_US.UTF-8',
+     'universal.utf8@ucs4':                  'en_US.UTF-8',
+     'ur':                                   'ur_PK.CP1256',
+     'ur_pk':                                'ur_PK.CP1256',
--- python3.3-3.3.0.orig/debian/patches/avoid-rpath.diff
+++ python3.3-3.3.0/debian/patches/avoid-rpath.diff
@@ -0,0 +1,31 @@
+# DP: avoid runtime library path for some extension modules.
+
+diff -r 12a56a349af2 setup.py
+--- a/setup.py	Sat Jun 30 19:28:16 2012 +0200
++++ b/setup.py	Sun Jul 01 10:25:14 2012 +0200
+@@ -957,6 +957,15 @@
+                 print("bsddb lib dir:", dblib_dir, " inc dir:", db_incdir)
+             db_incs = [db_incdir]
+             dblibs = [dblib]
++            # only add db_incdir/dblib_dir if not in the standard paths
++            # avoids a runtime library path for a system library dir
++            if db_incdir in inc_dirs:
++                db_incs = []
++            else:
++                db_incs = [db_incdir]
++            if dblib_dir[0] in lib_dirs:
++                dblib_dir = []
++            dblibs = [dblib]
+         else:
+             if db_setup_debug: print("db: no appropriate library found")
+             db_incs = None
+@@ -1065,6 +1074,9 @@
+             # can end up with a bad search path order.
+             if sqlite_incdir not in self.compiler.include_dirs:
+                 include_dirs.append(sqlite_incdir)
++            # avoid a runtime library path for a system library dir
++            if sqlite_libdir and sqlite_libdir[0] in lib_dirs:
++                sqlite_libdir = None
+             exts.append(Extension('_sqlite3', sqlite_srcs,
+                                   define_macros=sqlite_defines,
+                                   include_dirs=include_dirs,
--- python3.3-3.3.0.orig/debian/patches/add-python-config-sh.diff
+++ python3.3-3.3.0/debian/patches/add-python-config-sh.diff
@@ -0,0 +1,174 @@
+Index: b/Makefile.pre.in
+===================================================================
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1133,6 +1133,8 @@
+ 	# Substitution happens here, as the completely-expanded BINDIR
+ 	# is not available in configure
+ 	sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
++	# Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
++	sed -e "s,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g" < Misc/python-config.sh >python-config.sh
+ 
+ # Install the include files
+ INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
+@@ -1191,6 +1193,7 @@
+ 	$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
+ 	$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
+ 	$(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config
++	$(INSTALL_SCRIPT) python-config.sh $(DESTDIR)$(BINDIR)/python-config.sh
+ 	rm python-config
+ 	@if [ -s Modules/python.exp -a \
+ 		"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
+Index: b/Misc/python-config.sh.in
+===================================================================
+--- /dev/null
++++ b/Misc/python-config.sh.in
+@@ -0,0 +1,107 @@
++#!/bin/sh
++
++exit_with_usage ()
++{
++    echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir"
++    exit $1
++}
++
++if [ "$1" = "" ] ; then
++    exit_with_usage 1
++fi
++
++# Returns the actual prefix where this script was installed to.
++installed_prefix ()
++{
++    local RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
++    if [ $(which readlink) ] ; then
++        RESULT=$(readlink -f "$RESULT")
++    fi
++    echo $RESULT
++}
++
++prefix_build="@prefix@"
++prefix_real=$(installed_prefix "$0")
++
++# Use sed to fix paths from their built to locations to their installed to locations.
++prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#")
++exec_prefix_build="@exec_prefix@"
++exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real#")
++includedir=$(echo "@includedir@" | sed "s#$prefix_build#$prefix_real#")
++libdir=$(echo "@libdir@" | sed "s#$prefix_build#$prefix_real#")
++CFLAGS=$(echo "@CFLAGS@" | sed "s#$prefix_build#$prefix_real#")
++VERSION="@VERSION@"
++LIBM="@LIBM@"
++LIBC="@LIBC@"
++SYSLIBS="$LIBM $LIBC"
++ABIFLAGS="@ABIFLAGS@"
++MULTIARCH="@MULTIARCH@"
++LIBS="@LIBS@ $SYSLIBS -lpython${VERSION}${ABIFLAGS}"
++BASECFLAGS="@BASECFLAGS@"
++LDLIBRARY="@LDLIBRARY@"
++LINKFORSHARED="@LINKFORSHARED@"
++OPT="@OPT@"
++PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
++LDVERSION="@LDVERSION@"
++LIBDEST=${prefix}/lib/python${VERSION}
++LIBPL=$(echo "@LIBPL@" | sed "s#$prefix_build#$prefix_real#")
++SO="@SO@"
++PYTHONFRAMEWORK="@PYTHONFRAMEWORK@"
++INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
++PLATINCDIR="-I$includedir/${MULTIARCH}/python${VERSION}${ABIFLAGS}"
++
++# Scan for --help or unknown argument.
++for ARG in $*
++do
++    case $ARG in
++        --help)
++            exit_with_usage 0
++        ;;
++        --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--abiflags|--configdir)
++        ;;
++        *)
++            exit_with_usage 1
++        ;;
++    esac
++done
++
++for ARG in $*
++do
++    case $ARG in
++        --prefix)
++            echo "$prefix"
++        ;;
++        --exec-prefix)
++            echo "$exec_prefix"
++        ;;
++        --includes)
++            echo "$INCDIR $PLATINCDIR"
++        ;;
++        --cflags)
++            echo "$INCDIR $PLATINCDIR $BASECFLAGS $CFLAGS $OPT"
++        ;;
++        --libs)
++            echo "$LIBS"
++        ;;
++        --ldflags)
++            LINKFORSHAREDUSED=
++            if [ -z "$PYTHONFRAMEWORK" ] ; then
++                LINKFORSHAREDUSED=$LINKFORSHARED
++            fi
++            LIBPLUSED=
++            if [ "$PY_ENABLE_SHARED" = "0" ] ; then
++                LIBPLUSED="-L$LIBPL"
++            fi
++            echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED"
++        ;;
++        --extension-suffix)
++            echo "$SO"
++        ;;
++        --abiflags)
++            echo "$ABIFLAGS"
++        ;;
++        --configdir)
++            echo "$LIBPL"
++        ;;
++esac
++done
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -913,6 +913,7 @@
+ 
+ # Other platforms follow
+ if test $enable_shared = "yes"; then
++  PY_ENABLE_SHARED=1
+   AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.])
+   case $ac_sys_system in
+     CYGWIN*)
+@@ -968,6 +969,7 @@
+ 
+   esac
+ else # shared is disabled
++  PY_ENABLE_SHARED=0
+   case $ac_sys_system in
+     CYGWIN*)
+           BLDLIBRARY='$(LIBRARY)'
+@@ -3935,6 +3937,11 @@
+ LDVERSION='$(VERSION)$(ABIFLAGS)'
+ AC_MSG_RESULT($LDVERSION)
+ 
++dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
++AC_SUBST(PY_ENABLE_SHARED)
++LIBPL="${prefix}"/lib/python"${VERSION}"/config-"${LDVERSION}-${MULTIARCH}"
++AC_SUBST(LIBPL)
++
+ # SO is the extension of shared libraries `(including the dot!)
+ # -- usually .so, .sl on HP-UX, .dll on Cygwin
+ AC_MSG_CHECKING(SO)
+@@ -4656,7 +4663,7 @@
+ fi
+ 
+ # generate output files
+-AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc)
++AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-config.sh)
+ AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
+ AC_OUTPUT
+ 
--- python3.3-3.3.0.orig/debian/patches/webbrowser.diff
+++ python3.3-3.3.0/debian/patches/webbrowser.diff
@@ -0,0 +1,27 @@
+# DP: Recognize other browsers: www-browser, x-www-browser, iceweasel, iceape.
+
+--- a/Lib/webbrowser.py
++++ b/Lib/webbrowser.py
+@@ -444,9 +444,13 @@
+     if "KDE_FULL_SESSION" in os.environ and _iscommand("kfmclient"):
+         register("kfmclient", Konqueror, Konqueror("kfmclient"))
+ 
++    if _iscommand("x-www-browser"):
++        register("x-www-browser", None, BackgroundBrowser("x-www-browser"))
++
+     # The Mozilla/Netscape browsers
+     for browser in ("mozilla-firefox", "firefox",
+                     "mozilla-firebird", "firebird",
++                    "iceweasel", "iceape",
+                     "seamonkey", "mozilla", "netscape"):
+         if _iscommand(browser):
+             register(browser, None, Mozilla(browser))
+@@ -484,6 +488,8 @@
+ 
+ # Also try console browsers
+ if os.environ.get("TERM"):
++    if _iscommand("www-browser"):
++        register("www-browser", None, GenericBrowser("www-browser"))
+     # The Links/elinks browsers <http://artax.karlin.mff.cuni.cz/~mikulas/links/>
+     if _iscommand("links"):
+         register("links", None, GenericBrowser("links"))
--- python3.3-3.3.0.orig/debian/patches/distutils-init.diff
+++ python3.3-3.3.0/debian/patches/distutils-init.diff
@@ -0,0 +1,60 @@
+# DP: Use _sysconfigdata.py in distutils to initialize distutils
+
+Index: b/Lib/distutils/sysconfig.py
+===================================================================
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -442,49 +442,11 @@
+ 
+ def _init_posix():
+     """Initialize the module as appropriate for POSIX systems."""
+-    g = {}
+-    # load the installed Makefile:
+-    try:
+-        filename = get_makefile_filename()
+-        parse_makefile(filename, g)
+-    except IOError as msg:
+-        my_msg = "invalid Python installation: unable to open %s" % filename
+-        if hasattr(msg, "strerror"):
+-            my_msg = my_msg + " (%s)" % msg.strerror
+-
+-        raise DistutilsPlatformError(my_msg)
+-
+-    # load the installed pyconfig.h:
+-    try:
+-        filename = get_config_h_filename()
+-        with open(filename) as file:
+-            parse_config_h(file, g)
+-    except IOError as msg:
+-        my_msg = "invalid Python installation: unable to open %s" % filename
+-        if hasattr(msg, "strerror"):
+-            my_msg = my_msg + " (%s)" % msg.strerror
+-
+-        raise DistutilsPlatformError(my_msg)
+-
+-    # On AIX, there are wrong paths to the linker scripts in the Makefile
+-    # -- these paths are relative to the Python source, but when installed
+-    # the scripts are in another directory.
+-    if python_build:
+-        g['LDSHARED'] = g['BLDSHARED']
+-
+-    elif get_python_version() < '2.1':
+-        # The following two branches are for 1.5.2 compatibility.
+-        if sys.platform == 'aix4':          # what about AIX 3.x ?
+-            # Linker script is in the config directory, not in Modules as the
+-            # Makefile says.
+-            python_lib = get_python_lib(standard_lib=1)
+-            ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix')
+-            python_exp = os.path.join(python_lib, 'config', 'python.exp')
+-
+-            g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp)
+-
++    # _sysconfigdata is generated at build time, see the sysconfig module
++    from _sysconfigdata import build_time_vars
+     global _config_vars
+-    _config_vars = g
++    _config_vars = {}
++    _config_vars.update(build_time_vars)
+ 
+ 
+ def _init_nt():
--- python3.3-3.3.0.orig/debian/patches/hurd-disable-nonworking-constants.diff
+++ python3.3-3.3.0/debian/patches/hurd-disable-nonworking-constants.diff
@@ -0,0 +1,38 @@
+# DP: Comment out constant exposed on the API which are not implemented on
+# DP: GNU/Hurd. They would not work at runtime anyway.
+
+Index: b/Modules/socketmodule.c
+===================================================================
+--- a/Modules/socketmodule.c
++++ b/Modules/socketmodule.c
+@@ -5942,9 +5942,11 @@
+ #ifdef  SO_OOBINLINE
+     PyModule_AddIntConstant(m, "SO_OOBINLINE", SO_OOBINLINE);
+ #endif
++#ifndef __GNU__
+ #ifdef  SO_REUSEPORT
+     PyModule_AddIntConstant(m, "SO_REUSEPORT", SO_REUSEPORT);
+ #endif
++#endif
+ #ifdef  SO_SNDBUF
+     PyModule_AddIntConstant(m, "SO_SNDBUF", SO_SNDBUF);
+ #endif
+Index: b/Modules/posixmodule.c
+===================================================================
+--- a/Modules/posixmodule.c
++++ b/Modules/posixmodule.c
+@@ -11234,12 +11234,14 @@
+ #ifdef O_LARGEFILE
+     if (ins(d, "O_LARGEFILE", (long)O_LARGEFILE)) return -1;
+ #endif
++#ifndef __GNU__
+ #ifdef O_SHLOCK
+     if (ins(d, "O_SHLOCK", (long)O_SHLOCK)) return -1;
+ #endif
+ #ifdef O_EXLOCK
+     if (ins(d, "O_EXLOCK", (long)O_EXLOCK)) return -1;
+ #endif
++#endif
+ #ifdef O_EXEC
+     if (ins(d, "O_EXEC", (long)O_EXEC)) return -1;
+ #endif
--- python3.3-3.3.0.orig/debian/patches/distutils-sysconfig.diff
+++ python3.3-3.3.0/debian/patches/distutils-sysconfig.diff
@@ -0,0 +1,45 @@
+# DP: Get CONFIGURE_CFLAGS, CONFIGURE_CPPFLAGS, CONFIGURE_LDFLAGS from
+# DP: the python build, when CFLAGS, CPPFLAGS, LDSHARED) are not set
+# DP: in the environment.
+
+Index: b/Lib/distutils/sysconfig.py
+===================================================================
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -190,9 +190,11 @@
+                 _osx_support.customize_compiler(_config_vars)
+                 _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
+ 
+-        (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \
++        (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags,
++         configure_cppflags, configure_cflags, configure_ldflags) = \
+             get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
+-                            'CCSHARED', 'LDSHARED', 'SO', 'AR', 'ARFLAGS')
++                            'CCSHARED', 'LDSHARED', 'SO', 'AR', 'ARFLAGS',
++                            'CONFIGURE_CPPFLAGS', 'CONFIGURE_CFLAGS', 'CONFIGURE_LDFLAGS')
+ 
+         newcc = None
+         if 'CC' in os.environ:
+@@ -207,13 +209,22 @@
+             cpp = cc + " -E"           # not always
+         if 'LDFLAGS' in os.environ:
+             ldshared = ldshared + ' ' + os.environ['LDFLAGS']
++        elif configure_ldflags:
++            ldshared = ldshared + ' ' + configure_ldflags
+         if 'CFLAGS' in os.environ:
+             cflags = opt + ' ' + os.environ['CFLAGS']
+             ldshared = ldshared + ' ' + os.environ['CFLAGS']
++        elif configure_cflags:
++            cflags = opt + ' ' + configure_cflags
++            ldshared = ldshared + ' ' + configure_cflags
+         if 'CPPFLAGS' in os.environ:
+             cpp = cpp + ' ' + os.environ['CPPFLAGS']
+             cflags = cflags + ' ' + os.environ['CPPFLAGS']
+             ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
++        elif configure_cppflags:
++            cpp = cpp + ' ' + configure_cppflags
++            cflags = cflags + ' ' + configure_cppflags
++            ldshared = ldshared + ' ' + configure_cppflags
+         if 'AR' in os.environ:
+             ar = os.environ['AR']
+         if 'ARFLAGS' in os.environ:
--- python3.3-3.3.0.orig/debian/patches/linecache.diff
+++ python3.3-3.3.0/debian/patches/linecache.diff
@@ -0,0 +1,16 @@
+# DP: Proper handling of packages in linecache.py
+
+--- a/Lib/linecache.py
++++ b/Lib/linecache.py
+@@ -109,6 +109,11 @@
+         if os.path.isabs(filename):
+             return []
+ 
++        # Take care to handle packages.
++        if basename == '__init__.py':
++            # filename referes to a package
++            basename = filename
++
+         for dirname in sys.path:
+             try:
+                 fullname = os.path.join(dirname, basename)
--- python3.3-3.3.0.orig/debian/patches/ext-no-libpython-link.diff
+++ python3.3-3.3.0/debian/patches/ext-no-libpython-link.diff
@@ -0,0 +1,22 @@
+# DP: Don't link extensions with the shared libpython library.
+
+--- a/Lib/distutils/command/build_ext.py
++++ b/Lib/distutils/command/build_ext.py
+@@ -243,7 +243,7 @@
+         # for extensions under Linux or Solaris with a shared Python library,
+         # Python's library directory must be appended to library_dirs
+         sysconfig.get_config_var('Py_ENABLE_SHARED')
+-        if (sys.platform.startswith(('linux', 'gnu', 'sunos'))
++        if False and (sys.platform.startswith(('linux', 'gnu', 'sunos'))
+             and sysconfig.get_config_var('Py_ENABLE_SHARED')):
+             if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
+                 # building third party extensions
+@@ -753,7 +753,7 @@
+             return ext.libraries
+         else:
+             from distutils import sysconfig
+-            if sysconfig.get_config_var('Py_ENABLE_SHARED'):
++            if False and sysconfig.get_config_var('Py_ENABLE_SHARED'):
+                 pythonlib = 'python{}.{}{}'.format(
+                     sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff,
+                     sys.abiflags)
--- python3.3-3.3.0.orig/debian/patches/disable-utimes.diff
+++ python3.3-3.3.0/debian/patches/disable-utimes.diff
@@ -0,0 +1,13 @@
+# DP: disable check for utimes function, which is broken in glibc-2.3.2
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -2588,7 +2588,7 @@
+  setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setuid setvbuf \
+  sigaction siginterrupt sigrelse snprintf strftime strlcpy \
+  sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
+- truncate uname unsetenv utimes waitpid wait3 wait4 \
++ truncate uname unsetenv waitpid wait3 wait4 \
+  wcscoll wcsftime wcsxfrm _getpty)
+ 
+ # For some functions, having a definition is not sufficient, since
--- python3.3-3.3.0.orig/debian/patches/libffi-shared.diff
+++ python3.3-3.3.0/debian/patches/libffi-shared.diff
@@ -0,0 +1,13 @@
+Index: b/setup.py
+===================================================================
+--- a/setup.py
++++ b/setup.py
+@@ -1872,7 +1872,7 @@
+                         break
+         ffi_lib = None
+         if ffi_inc is not None:
+-            for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
++            for lib_name in ('ffi', 'ffi_convenience', 'ffi_pic', 'ffi'):
+                 if (self.compiler.find_library_file(lib_dirs, lib_name)):
+                     ffi_lib = lib_name
+                     break
--- python3.3-3.3.0.orig/debian/patches/setup-modules.diff
+++ python3.3-3.3.0/debian/patches/setup-modules.diff
@@ -0,0 +1,52 @@
+# DP: Modules/Setup.dist: patches to build some extensions statically
+
+Index: b/Modules/Setup.dist
+===================================================================
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -171,7 +171,7 @@
+ #_testcapi _testcapimodule.c    # Python C API test module
+ #_random _randommodule.c	# Random number generator
+ #atexit atexitmodule.c      # Register functions to be run at interpreter-shutdown
+-#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c	# elementtree accelerator
++#_elementtree _elementtree.c -lexpat	# elementtree accelerator
+ #_pickle _pickle.c	# pickle accelerator
+ #_datetime _datetimemodule.c	# datetime accelerator
+ #_bisect _bisectmodule.c	# Bisection algorithms
+@@ -200,10 +200,7 @@
+ 
+ # Socket module helper for SSL support; you must comment out the other
+ # socket line above, and possibly edit the SSL variable:
+-#SSL=/usr/local/ssl
+-#_ssl _ssl.c \
+-#	-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
+-#	-L$(SSL)/lib -lssl -lcrypto
++#_ssl _ssl.c -lssl -lcrypto
+ 
+ # The crypt module is now disabled by default because it breaks builds
+ # on many systems (where -lcrypt is needed), e.g. Linux (I believe).
+@@ -245,6 +242,7 @@
+ #_sha256 sha256module.c
+ #_sha512 sha512module.c
+ 
++#_hashlib _hashopenssl.c -lssl -lcrypto
+ 
+ # The _tkinter module.
+ #
+@@ -333,6 +331,7 @@
+ # Fred Drake's interface to the Python parser
+ #parser parsermodule.c
+ 
++#_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c _ctypes/malloc_closure.c -lffi
+ 
+ # Lee Busby's SIGFPE modules.
+ # The library to link fpectl with is platform specific.
+@@ -367,7 +366,7 @@
+ #
+ # More information on Expat can be found at www.libexpat.org.
+ #
+-#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
++#pyexpat pyexpat.c -lexpat
+ 
+ # Hye-Shik Chang's CJKCodecs
+ 
--- python3.3-3.3.0.orig/debian/patches/enable-fpectl.diff
+++ python3.3-3.3.0/debian/patches/enable-fpectl.diff
@@ -0,0 +1,16 @@
+# DP: Enable the build of the fpectl module.
+
+Index: b/setup.py
+===================================================================
+--- a/setup.py
++++ b/setup.py
+@@ -1211,6 +1211,9 @@
+         else:
+             missing.append('_curses_panel')
+ 
++        #fpectl fpectlmodule.c ...
++        exts.append( Extension('fpectl', ['fpectlmodule.c']) )
++
+         # Andrew Kuchling's zlib module.  Note that some versions of zlib
+         # 1.1.3 have security problems.  See CERT Advisory CA-2002-07:
+         # http://www.cert.org/advisories/CA-2002-07.html
--- python3.3-3.3.0.orig/debian/patches/makesetup-bashism.diff
+++ python3.3-3.3.0/debian/patches/makesetup-bashism.diff
@@ -0,0 +1,13 @@
+# DP: Fix bashism in makesetup shell script
+
+--- a/Modules/makesetup
++++ b/Modules/makesetup
+@@ -281,7 +281,7 @@
+ 	-)	;;
+ 	*)	sedf="@sed.in.$$"
+ 		trap 'rm -f $sedf' 0 1 2 3
+-		echo "1i\\" >$sedf
++		printf "1i\\" >$sedf
+ 		str="# Generated automatically from $makepre by makesetup."
+ 		echo "$str" >>$sedf
+ 		echo "s%_MODOBJS_%$OBJS%" >>$sedf
--- python3.3-3.3.0.orig/debian/patches/sysconfigdata.diff
+++ python3.3-3.3.0/debian/patches/sysconfigdata.diff
@@ -0,0 +1,76 @@
+# DP: Issue #15298: Generate _sysconfigdata.py in the build dir, not the source dir.
+
+diff -r 2ecdda96f970 Lib/sysconfig.py
+--- a/Lib/sysconfig.py	Tue Jul 10 18:27:54 2012 +0200
++++ b/Lib/sysconfig.py	Tue Jul 10 22:06:43 2012 +0200
+@@ -390,7 +390,7 @@
+     if _PYTHON_BUILD:
+         vars['LDSHARED'] = vars['BLDSHARED']
+ 
+-    destfile = os.path.join(os.path.dirname(__file__), '_sysconfigdata.py')
++    destfile = '_sysconfigdata.py'
+     with open(destfile, 'w', encoding='utf8') as f:
+         f.write('# system configuration generated and used by'
+                 ' the sysconfig module\n')
+diff -r 2ecdda96f970 Makefile.pre.in
+--- a/Makefile.pre.in	Tue Jul 10 18:27:54 2012 +0200
++++ b/Makefile.pre.in	Tue Jul 10 22:06:43 2012 +0200
+@@ -410,7 +410,7 @@
+ 		Objects/unicodectype.o \
+ 		Objects/weakrefobject.o
+ 
+-SYSCONFIGDATA=$(srcdir)/Lib/_sysconfigdata.py
++SYSCONFIGDATA=_sysconfigdata.py
+ 
+ ##########################################################################
+ # objects that get linked into the Python library
+@@ -472,6 +472,9 @@
+ # Generate the sysconfig build-time data
+ $(SYSCONFIGDATA): $(BUILDPYTHON)
+ 	$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars
++	$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -c 'import os,sys ; from distutils.util import get_platform ; d=os.path.join("build", "lib."+get_platform()+"-"+sys.version[0:3]+("-pydebug" if hasattr(sys, "gettotalrefcount") else "")); print(d, end="")' > pybuilddir.txt
++	mkdir -p `cat pybuilddir.txt`
++	cp $(SYSCONFIGDATA) `cat pybuilddir.txt`/.
+ 
+ # Build the shared modules
+ sharedmods: $(BUILDPYTHON) $(SYSCONFIGDATA)
+@@ -1036,7 +1039,7 @@
+ 		else	true; \
+ 		fi; \
+ 	done
+-	@for i in $(srcdir)/Lib/*.py ; \
++	@for i in $(srcdir)/Lib/*.py $(SYSCONFIGDATA); \
+ 	do \
+ 		if test -x $$i; then \
+ 			$(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
+diff -r 2ecdda96f970 setup.py
+--- a/setup.py	Tue Jul 10 18:27:54 2012 +0200
++++ b/setup.py	Tue Jul 10 22:06:43 2012 +0200
+@@ -33,10 +33,6 @@
+ # This global variable is used to hold the list of modules to be disabled.
+ disabled_module_list = []
+ 
+-# File which contains the directory for shared mods (for sys.path fixup
+-# when running from the build dir, see Modules/getpath.c)
+-_BUILDDIR_COOKIE = "pybuilddir.txt"
+-
+ def add_dir_to_list(dirlist, dir):
+     """Add the directory 'dir' to the list 'dirlist' (after any relative
+     directories) if:
+@@ -250,12 +246,9 @@
+             args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
+         self.compiler.set_executables(**args)
+ 
+-        # Not only do we write the builddir cookie, but we manually install
+-        # the shared modules directory if it isn't already in sys.path.
+-        # Otherwise trying to import the extensions after building them
+-        # will fail.
+-        with open(_BUILDDIR_COOKIE, "wb") as f:
+-            f.write(self.build_lib.encode('utf-8', 'surrogateescape'))
++        # We manually install the shared modules directory if it isn't
++        # already in sys.path.  Otherwise trying to import the
++        # extensions after building them will fail.
+         abs_build_lib = os.path.join(os.getcwd(), self.build_lib)
+         if abs_build_lib not in sys.path:
+             sys.path.append(abs_build_lib)
+ 
--- python3.3-3.3.0.orig/debian/patches/bdist-wininst-notfound.diff
+++ python3.3-3.3.0/debian/patches/bdist-wininst-notfound.diff
@@ -0,0 +1,19 @@
+# DP: suggest installation of the pythonX.Y-dev package, if bdist_wininst
+# DP: cannot find the wininst-* files.
+
+Index: b/Lib/distutils/command/bdist_wininst.py
+===================================================================
+--- a/Lib/distutils/command/bdist_wininst.py
++++ b/Lib/distutils/command/bdist_wininst.py
+@@ -342,7 +342,10 @@
+             sfix = ''
+ 
+         filename = os.path.join(directory, "wininst-%.1f%s.exe" % (bv, sfix))
+-        f = open(filename, "rb")
++        try:
++            f = open(filename, "rb")
++        except IOError as e:
++            raise DistutilsFileError(str(e) + ', %s not included in the Debian packages.' % filename)
+         try:
+             return f.read()
+         finally:
--- python3.3-3.3.0.orig/debian/patches/platform-lsbrelease.diff
+++ python3.3-3.3.0/debian/patches/platform-lsbrelease.diff
@@ -0,0 +1,41 @@
+# DP: Use /etc/lsb-release to identify the platform.
+
+--- a/Lib/platform.py
++++ b/Lib/platform.py
+@@ -284,6 +284,10 @@
+             id = l[1]
+     return '', version, id
+ 
++_distributor_id_file_re = re.compile("(?:DISTRIB_ID\s*=)\s*(.*)", re.I)
++_release_file_re = re.compile("(?:DISTRIB_RELEASE\s*=)\s*(.*)", re.I)
++_codename_file_re = re.compile("(?:DISTRIB_CODENAME\s*=)\s*(.*)", re.I)
++
+ def linux_distribution(distname='', version='', id='',
+ 
+                        supported_dists=_supported_dists,
+@@ -308,6 +312,25 @@
+         args given as parameters.
+ 
+     """
++    # check for the Debian/Ubuntu /etc/lsb-release file first, needed so
++    # that the distribution doesn't get identified as Debian.
++    try:
++        etclsbrel = open("/etc/lsb-release", "rU")
++        for line in etclsbrel:
++            m = _distributor_id_file_re.search(line)
++            if m:
++                _u_distname = m.group(1).strip()
++            m = _release_file_re.search(line)
++            if m:
++                _u_version = m.group(1).strip()
++            m = _codename_file_re.search(line)
++            if m:
++                _u_id = m.group(1).strip()
++        if _u_distname and _u_version:
++            return (_u_distname, _u_version, _u_id)
++    except (EnvironmentError, UnboundLocalError):
++            pass
++
+     try:
+         etc = os.listdir('/etc')
+     except os.error:
--- python3.3-3.3.0.orig/debian/patches/profiled-build.diff
+++ python3.3-3.3.0/debian/patches/profiled-build.diff
@@ -0,0 +1,15 @@
+# DP: Ignore errors in the profile task.
+
+Index: b/Makefile.pre.in
+===================================================================
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -451,7 +451,7 @@
+ 
+ run_profile_task:
+ 	: # FIXME: can't run for a cross build
+-	$(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
++	-$(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
+ 
+ build_all_use_profile:
+ 	$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use -fprofile-correction"
--- python3.3-3.3.0.orig/debian/patches/distutils-install-layout.diff
+++ python3.3-3.3.0/debian/patches/distutils-install-layout.diff
@@ -0,0 +1,254 @@
+# DP: distutils: Add an option --install-layout=deb, which
+# DP: - installs into $prefix/dist-packages instead of $prefix/site-packages.
+# DP: - doesn't encode the python version into the egg name.
+
+Index: b/Lib/distutils/command/install_egg_info.py
+===================================================================
+--- a/Lib/distutils/command/install_egg_info.py
++++ b/Lib/distutils/command/install_egg_info.py
+@@ -14,18 +14,38 @@
+     description = "Install package's PKG-INFO metadata as an .egg-info file"
+     user_options = [
+         ('install-dir=', 'd', "directory to install to"),
++        ('install-layout', None, "custom installation layout"),
+     ]
+ 
+     def initialize_options(self):
+         self.install_dir = None
++        self.install_layout = None
++        self.prefix_option = None
+ 
+     def finalize_options(self):
+         self.set_undefined_options('install_lib',('install_dir','install_dir'))
+-        basename = "%s-%s-py%s.egg-info" % (
+-            to_filename(safe_name(self.distribution.get_name())),
+-            to_filename(safe_version(self.distribution.get_version())),
+-            sys.version[:3]
+-        )
++        self.set_undefined_options('install',('install_layout','install_layout'))
++        self.set_undefined_options('install',('prefix_option','prefix_option'))
++        if self.install_layout:
++            if not self.install_layout.lower() in ['deb', 'unix']:
++                raise DistutilsOptionError(
++                    "unknown value for --install-layout")
++            no_pyver = (self.install_layout.lower() == 'deb')
++        elif self.prefix_option:
++            no_pyver = False
++        else:
++            no_pyver = True
++        if no_pyver:
++            basename = "%s-%s.egg-info" % (
++                to_filename(safe_name(self.distribution.get_name())),
++                to_filename(safe_version(self.distribution.get_version()))
++                )
++        else:
++            basename = "%s-%s-py%s.egg-info" % (
++                to_filename(safe_name(self.distribution.get_name())),
++                to_filename(safe_version(self.distribution.get_version())),
++                sys.version[:3]
++                )
+         self.target = os.path.join(self.install_dir, basename)
+         self.outputs = [self.target]
+ 
+Index: b/Lib/distutils/command/install.py
+===================================================================
+--- a/Lib/distutils/command/install.py
++++ b/Lib/distutils/command/install.py
+@@ -50,6 +50,20 @@
+         'scripts': '$base/bin',
+         'data'   : '$base',
+         },
++    'unix_local': {
++        'purelib': '$base/local/lib/python$py_version_short/dist-packages',
++        'platlib': '$platbase/local/lib/python$py_version_short/dist-packages',
++        'headers': '$base/local/include/python$py_version_short/$dist_name',
++        'scripts': '$base/local/bin',
++        'data'   : '$base/local',
++        },
++    'deb_system': {
++        'purelib': '$base/lib/python3/dist-packages',
++        'platlib': '$platbase/lib/python3/dist-packages',
++        'headers': '$base/include/python$py_version_short/$dist_name',
++        'scripts': '$base/bin',
++        'data'   : '$base',
++        },
+     'unix_home': {
+         'purelib': '$base/lib/python',
+         'platlib': '$base/lib/python',
+@@ -161,6 +175,9 @@
+ 
+         ('record=', None,
+          "filename in which to record list of installed files"),
++
++        ('install-layout=', None,
++         "installation layout to choose (known values: deb, unix)"),
+         ]
+ 
+     boolean_options = ['compile', 'force', 'skip-build']
+@@ -181,6 +198,7 @@
+         self.exec_prefix = None
+         self.home = None
+         self.user = 0
++        self.prefix_option = None
+ 
+         # These select only the installation base; it's up to the user to
+         # specify the installation scheme (currently, that means supplying
+@@ -202,6 +220,9 @@
+         self.install_userbase = USER_BASE
+         self.install_usersite = USER_SITE
+ 
++        # enable custom installation, known values: deb
++        self.install_layout = None
++        
+         self.compile = None
+         self.optimize = None
+ 
+@@ -441,6 +462,7 @@
+             self.install_base = self.install_platbase = self.home
+             self.select_scheme("unix_home")
+         else:
++            self.prefix_option = self.prefix
+             if self.prefix is None:
+                 if self.exec_prefix is not None:
+                     raise DistutilsOptionError(
+@@ -455,7 +477,24 @@
+ 
+             self.install_base = self.prefix
+             self.install_platbase = self.exec_prefix
+-            self.select_scheme("unix_prefix")
++            if self.install_layout:
++                if self.install_layout.lower() in ['deb']:
++                    self.select_scheme("deb_system")
++                elif self.install_layout.lower() in ['unix']:
++                    self.select_scheme("unix_prefix")
++                else:
++                    raise DistutilsOptionError(
++                        "unknown value for --install-layout")
++            elif (self.prefix_option and os.path.normpath(self.prefix) != '/usr/local') \
++                    or 'PYTHONUSERBASE' in os.environ \
++                    or 'VIRTUAL_ENV' in os.environ \
++                    or 'real_prefix' in sys.__dict__:
++                self.select_scheme("unix_prefix")
++            else:
++                if os.path.normpath(self.prefix) == '/usr/local':
++                    self.prefix = self.exec_prefix = '/usr'
++                    self.install_base = self.install_platbase = '/usr'
++                self.select_scheme("unix_local")
+ 
+     def finalize_other(self):
+         """Finalizes options for non-posix platforms"""
+Index: b/Lib/distutils/sysconfig.py
+===================================================================
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -132,6 +132,7 @@
+     If 'prefix' is supplied, use it instead of sys.base_prefix or
+     sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
+     """
++    is_default_prefix = not prefix or os.path.normpath(prefix) in ('/usr', '/usr/local')
+     if prefix is None:
+         if standard_lib:
+             prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
+@@ -143,6 +144,8 @@
+                                  "lib", "python" + get_python_version())
+         if standard_lib:
+             return libpython
++        elif is_default_prefix and 'PYTHONUSERBASE' not in os.environ and 'VIRTUAL_ENV' not in os.environ and 'real_prefix' not in sys.__dict__:
++            return os.path.join(prefix, "lib", "python3", "dist-packages")
+         else:
+             return os.path.join(libpython, "site-packages")
+     elif os.name == "nt":
+Index: b/Lib/site.py
+===================================================================
+--- a/Lib/site.py
++++ b/Lib/site.py
+@@ -285,6 +285,13 @@
+ 
+     if ENABLE_USER_SITE and os.path.isdir(user_site):
+         addsitedir(user_site, known_paths)
++    if ENABLE_USER_SITE:
++        for dist_libdir in ("lib", "local/lib"):
++            user_site = os.path.join(USER_BASE, dist_libdir,
++                                     "python" + sys.version[:3],
++                                     "dist-packages")
++            if os.path.isdir(user_site):
++                addsitedir(user_site, known_paths)
+     return known_paths
+ 
+ def getsitepackages(prefixes=None):
+Index: b/Lib/test/test_site.py
+===================================================================
+--- a/Lib/test/test_site.py
++++ b/Lib/test/test_site.py
+@@ -239,12 +239,20 @@
+             self.assertEqual(dirs[2], wanted)
+         elif os.sep == '/':
+             # OS X non-framwework builds, Linux, FreeBSD, etc
+-            self.assertEqual(len(dirs), 2)
+-            wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
+-                                  'site-packages')
++            self.assertEqual(len(dirs), 4)
++            wanted = os.path.join('xoxo', 'local', 'lib',
++                                  'python' + sys.version[:3],
++                                  'dist-packages')
+             self.assertEqual(dirs[0], wanted)
+-            wanted = os.path.join('xoxo', 'lib', 'site-python')
++            wanted = os.path.join('xoxo', 'lib',
++                                  'python3', 'dist-packages')
+             self.assertEqual(dirs[1], wanted)
++            wanted = os.path.join('xoxo', 'lib',
++                                  'python' + sys.version[:3],
++                                  'dist-packages')
++            self.assertEqual(dirs[2], wanted)
++            wanted = os.path.join('xoxo', 'lib', 'dist-python')
++            self.assertEqual(dirs[3], wanted)
+         else:
+             # other platforms
+             self.assertEqual(len(dirs), 2)
+Index: b/Lib/distutils/tests/test_bdist_dumb.py
+===================================================================
+--- a/Lib/distutils/tests/test_bdist_dumb.py
++++ b/Lib/distutils/tests/test_bdist_dumb.py
+@@ -88,7 +88,7 @@
+             fp.close()
+ 
+         contents = sorted(os.path.basename(fn) for fn in contents)
+-        wanted = ['foo-0.1-py%s.%s.egg-info' % sys.version_info[:2],
++        wanted = ['foo-0.1.egg-info',
+                   'foo.%s.pyc' % imp.get_tag(),
+                   'foo.py']
+         self.assertEqual(contents, sorted(wanted))
+Index: b/Lib/distutils/tests/test_install.py
+===================================================================
+--- a/Lib/distutils/tests/test_install.py
++++ b/Lib/distutils/tests/test_install.py
+@@ -194,7 +194,7 @@
+ 
+         found = [os.path.basename(line) for line in content.splitlines()]
+         expected = ['hello.py', 'hello.%s.pyc' % imp.get_tag(), 'sayhi',
+-                    'UNKNOWN-0.0.0-py%s.%s.egg-info' % sys.version_info[:2]]
++                    'UNKNOWN-0.0.0.egg-info']
+         self.assertEqual(found, expected)
+ 
+     def test_record_extensions(self):
+@@ -224,7 +224,7 @@
+ 
+         found = [os.path.basename(line) for line in content.splitlines()]
+         expected = [_make_ext_name('xx'),
+-                    'UNKNOWN-0.0.0-py%s.%s.egg-info' % sys.version_info[:2]]
++                    'UNKNOWN-0.0.0.egg-info']
+         self.assertEqual(found, expected)
+ 
+     def test_debug_mode(self):
+Index: b/Lib/pydoc.py
+===================================================================
+--- a/Lib/pydoc.py
++++ b/Lib/pydoc.py
+@@ -380,6 +380,7 @@
+                                  'marshal', 'posix', 'signal', 'sys',
+                                  '_thread', 'zipimport') or
+              (file.startswith(basedir) and
++              not file.startswith(os.path.join(basedir, 'dist-packages')) and
+               not file.startswith(os.path.join(basedir, 'site-packages')))) and
+             object.__name__ not in ('xml.etree', 'test.pydoc_mod')):
+             if docloc.startswith("http://"):
--- python3.3-3.3.0.orig/debian/patches/profile-doc.diff
+++ python3.3-3.3.0/debian/patches/profile-doc.diff
@@ -0,0 +1,32 @@
+# DP: hotshot/pstats.py: Error out on missing profile/pstats modules.
+# DP: Add a note to the library documentation, that the profile and pstats
+# DP: modules can be found in the python2.x-profiler package.
+
+--- a/Doc/library/profile.rst
++++ b/Doc/library/profile.rst
+@@ -4,6 +4,12 @@
+ The Python Profilers
+ ********************
+ 
++Debian note: The license for the :mod:`profile` and :mod:`pstats`
++modules doesn't conform to the Debian Free Software Guidelines (DFSG).
++These modules can be found in the *python-profiler* package in the
++*non-free* section of the Debian archives or in the the *multiverse*
++section of the Ubuntu archives.
++
+ .. sectionauthor:: James Roskind
+ 
+ .. module:: profile
+@@ -211,6 +217,12 @@
+    :synopsis: Python profiler
+ 
+ 
++Debian note: The license for the :mod:`profile` and :mod:`pstats`
++modules doesn't conform to the Debian Free Software Guidelines (DFSG).
++These modules can be found in the *python-profiler* package in the
++*non-free* section of the Debian archives or in the the *multiverse*
++section of the Ubuntu archives.
++
+ The primary entry point for the profiler is the global function
+ :func:`profile.run` (resp. :func:`cProfile.run`). It is typically used to create
+ any profile information.  The reports are formatted and printed using methods of
--- python3.3-3.3.0.orig/debian/patches/no-zip-on-sys.path.diff
+++ python3.3-3.3.0/debian/patches/no-zip-on-sys.path.diff
@@ -0,0 +1,54 @@
+# DP: Do not add /usr/lib/pythonXY.zip on sys.path.
+
+Index: b/Modules/getpath.c
+===================================================================
+--- a/Modules/getpath.c
++++ b/Modules/getpath.c
+@@ -466,7 +466,9 @@
+     wchar_t *path = NULL;
+     wchar_t *prog = Py_GetProgramName();
+     wchar_t argv0_path[MAXPATHLEN+1];
++#ifdef WITH_ZIP_PATH
+     wchar_t zip_path[MAXPATHLEN+1];
++#endif
+     int pfound, efound; /* 1 if found; -1 if found build directory */
+     wchar_t *buf;
+     size_t bufsz;
+@@ -661,6 +663,7 @@
+     else
+         reduce(prefix);
+ 
++#ifdef WITH_ZIP_PATH
+     wcsncpy(zip_path, prefix, MAXPATHLEN);
+     zip_path[MAXPATHLEN] = L'\0';
+     if (pfound > 0) { /* Use the reduced prefix returned by Py_GetPrefix() */
+@@ -673,6 +676,7 @@
+     bufsz = wcslen(zip_path);   /* Replace "00" with version */
+     zip_path[bufsz - 6] = VERSION[0];
+     zip_path[bufsz - 5] = VERSION[2];
++#endif
+ 
+     if (!(efound = search_for_exec_prefix(argv0_path, home, _exec_prefix))) {
+         if (!Py_FrozenFlag)
+@@ -718,7 +722,9 @@
+         defpath = delim + 1;
+     }
+ 
++#ifdef WITH_ZIP_PATH
+     bufsz += wcslen(zip_path) + 1;
++#endif
+     bufsz += wcslen(exec_prefix) + 1;
+ 
+     buf = (wchar_t *)PyMem_Malloc(bufsz*sizeof(wchar_t));
+@@ -738,9 +744,11 @@
+         else
+             buf[0] = '\0';
+ 
++#ifdef WITH_ZIP_PATH
+         /* Next is the default zip path */
+         wcscat(buf, zip_path);
+         wcscat(buf, delimiter);
++#endif
+ 
+         /* Next goes merge of compile-time $PYTHONPATH with
+          * dynamically located prefix.
--- python3.3-3.3.0.orig/debian/patches/lib-argparse.diff
+++ python3.3-3.3.0/debian/patches/lib-argparse.diff
@@ -0,0 +1,24 @@
+# DP: argparse.py: Make the gettext import conditional
+
+Index: b/Lib/argparse.py
+===================================================================
+--- a/Lib/argparse.py
++++ b/Lib/argparse.py
+@@ -90,7 +90,16 @@
+ import sys as _sys
+ import textwrap as _textwrap
+ 
+-from gettext import gettext as _, ngettext
++try:
++    from gettext import gettext as _, ngettext
++except ImportError:
++    def _(message):
++        return message
++    def ngettext(singular,plural,n):
++        if n == 1:
++            return singular
++        else:
++            return plural
+ 
+ 
+ SUPPRESS = '==SUPPRESS=='
--- python3.3-3.3.0.orig/debian/patches/sysconfig-debian-schemes.diff
+++ python3.3-3.3.0/debian/patches/sysconfig-debian-schemes.diff
@@ -0,0 +1,67 @@
+# DP: Add schemes 'deb_system' and 'posix_local', make the latter the default
+
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -32,6 +32,30 @@
+         'scripts': '{base}/bin',
+         'data': '{base}',
+         },
++    'deb_system': {
++        'stdlib': '{installed_base}/lib/python{py_version_short}',
++        'platstdlib': '{platbase}/lib/python{py_version_short}',
++        'purelib': '{base}/lib/python3/dist-packages',
++        'platlib': '{platbase}/lib/python3/dist-packages',
++        'include':
++            '{installed_base}/include/python{py_version_short}{abiflags}',
++        'platinclude':
++            '{installed_platbase}/include/python{py_version_short}{abiflags}',
++        'scripts': '{base}/bin',
++        'data': '{base}',
++        },
++    'posix_local': {
++        'stdlib': '{installed_base}/lib/python{py_version_short}',
++        'platstdlib': '{platbase}/lib/python{py_version_short}',
++        'purelib': '{base}/local/lib/python{py_version_short}/dist-packages',
++        'platlib': '{platbase}/local/lib/python{py_version_short}/dist-packages',
++        'include':
++            '{installed_base}/local/include/python{py_version_short}{abiflags}',
++        'platinclude':
++            '{installed_platbase}/local/include/python{py_version_short}{abiflags}',
++        'scripts': '{base}/local/bin',
++        'data': '{base}',
++        },
+     'posix_home': {
+         'stdlib': '{installed_base}/lib/python',
+         'platstdlib': '{base}/lib/python',
+@@ -162,7 +186,7 @@
+ _PYTHON_BUILD = is_python_build(True)
+ 
+ if _PYTHON_BUILD:
+-    for scheme in ('posix_prefix', 'posix_home'):
++    for scheme in ('posix_prefix', 'posix_home', 'posix_local', 'deb_system'):
+         _INSTALL_SCHEMES[scheme]['include'] = '{srcdir}/Include'
+         _INSTALL_SCHEMES[scheme]['platinclude'] = '{projectbase}/.'
+ 
+@@ -200,7 +224,12 @@
+ def _get_default_scheme():
+     if os.name == 'posix':
+         # the default scheme for posix is posix_prefix
+-        return 'posix_prefix'
++        if 'real_prefix' in sys.__dict__ or 'VIRTUAL_ENV' in os.environ:
++            # virtual environments
++            return 'posix_prefix'
++        else:
++            # Debian default
++            return 'posix_local'
+     return os.name
+ 
+ 
+@@ -485,7 +514,7 @@
+         else:
+             inc_dir = _sys_home or _PROJECT_BASE
+     else:
+-        inc_dir = get_path('platinclude')
++        inc_dir = get_path('platinclude', 'posix_prefix')
+     return os.path.join(inc_dir, 'pyconfig.h')
+ 
+ 
--- python3.3-3.3.0.orig/debian/source/format
+++ python3.3-3.3.0/debian/source/format
@@ -0,0 +1 @@
+1.0